Search Results

Search found 4 results on 1 pages for 'd moberg'.

Page 1/1 | 1 

  • Understanding Thread/BeginInvoke? [beginner]

    - by Moberg
    Consider the code: class Work { public void DoStuff(string s) { Console.WriteLine(s); // .. whatever } } class Master { private readonly Work work = new Work(); public void Execute() { string hello = "hello"; // (1) is this an ugly hack ? var thread1 = new Thread(new ParameterizedThreadStart(o => this.work.DoStuff((string)o))); thread1.Start(hello); thread1.Join(); // (2) is this similar to the one above? new Action<string>(s => this.work.DoStuff(s)).BeginInvoke(hello, null, null); } } Is (1) an acceptable way of easy starting some work in a seperate thread? If not a better alternative would be much appreciated. Is (2) doing the same? I guess what I ask is if a new thread is started, or.. Hope you can help a beginner to a better understanding :) /Moberg

    Read the article

  • Skype silent chat message

    - by D Moberg
    Reason: I have a contact that I know is busy, but still want notifications so he is in "online"-mode and not DND-mode. I want to write "OK" to him, without having to disturb him (having him to open and look in skype to see if it was something important, which it is not). Question: Is there any way to send a message that won't trigger a notification at the receiver's end? Something like a "silent message".

    Read the article

  • Running PowerShell from MSdeploy runcommand does not exit

    - by Peter Moberg
    Im am trying to get MSDeploy to execute a PowerShell script on a remote server. This is how i execute MSDeploy: msdeploy \ -verb:sync \ -source:runCommand='C:\temp\HelloWorld.bat', \ waitInterval=15000,waitAttempts=1 \ -dest:auto,computername=$WebDeployService$Credentials -verbose HelloWorld.bat contains: echo "Hello world!" powershell.exe C:\temp\WebDeploy\Package\HelloWorld.ps1 echo "Done" The HelloWorld.ps1 only contains: Write-Host "Hello world from PowerShell!" However, it seems like PowerShell never terminates. This is the output from running the msdeploy: Verbose: Performing synchronization pass #1. Verbose: Source runCommand (C:\temp\HelloWorld.bat) does not match destination (C:\temp\HelloWorld.bat) differing in attributes (isSource['True','False']). Update pending. Info: Updating runCommand (C:\temp\HelloWorld.bat). Info: Info: C:\temp>echo "Hello world!" "Hello world!" C:\temp\WebDeploy>powershell.exe C:\temp\HelloWorld.ps1 Info: Hello world from Powershell! Info: Warning: The process 'C:\Windows\system32\cmd.exe' (command line '/c "C:\Users\peter\AppData\Local\Temp\gaskgh55.b2q.bat "') is still running. Waiting for 15000 ms (attempt 1 of 1). Error: The process 'C:\Windows\system32\cmd.exe' (command line '/c "C:\Users\peter\AppData\Local\Temp\gaskgh55.b2q.bat"' ) was terminated because it exceeded the wait time. Error count: 1. Anyone knows a solution?

    Read the article

  • LINQ extention SelectMany in 3.5 vs 4.0?

    - by Moberg
    Hi When I saw Darins suggestion here .. IEnumerable<Process> processes = new[] { "process1", "process2" } .SelectMany(Process.GetProcessesByName); ( http://stackoverflow.com/questions/3059667/process-getprocessesbyname/3059733#3059733 ) .. I was a bit intrigued and I tried it in VS2008 with .NET 3.5 - and it did not compiling unless I changed it to .. IEnumerable<Process> res = new string[] { "notepad", "firefox", "outlook" } .SelectMany(s => Process.GetProcessesByName(s)); Having read some Darins answers before I suspected that it was me that were the problem, and when I later got my hands on a VS2010 with.NET 4.0 - as expected - the original suggestion worked beautifully. My question is : What have happend from 3.5 to 4.0 that makes this (new syntax) possible? Is it the extentionmethods that have been extended(hmm) or new rules for lambda syntax or? I've tried to search but my google-fu was not strong enough. Please forgive if the question is a bit naive and note that I've taged it as beginner :)

    Read the article

1