Geeks With Blogs
c pound I reject your reality and substitute my own! August 2006 Entries
Fall is here
I can feel it. I was running the other day, The Distance playing in my ear-buds, and I caught a whiff of it. The scent of rain and plants and cold pavement and other things I can’t remember, a barbeque, maybe. The sun was shining, the clouds were awesome. I had clear road in front of me and nothing to do but run. I had to laugh – a bit maniacally, I admit. Then the moment passed and all returned to the way it was. But, oh yes, fall is here ......

Posted On Thursday, August 31, 2006 6:16 AM

Traced Debug Line
Bloody useful, this code. Especially when threads or timers are involved. class Tracer { private Tracer() { } public static void WriteTracedDebugLine(string message) { StackTrace stack = new StackTrace(); string caller = stack.GetFrame(2).GetMethod... string callee = stack.GetFrame(1).GetMethod... if(message != null && message.Length > 0) Debug.WriteLine(message, caller + " -> " + callee); else Debug.WriteLine(caller + " -> " + callee); } } ......

Posted On Wednesday, August 23, 2006 12:35 PM

Asynchronous Anonymous Methods
Anonymous methods are a great new feature in .Net 2. Another great new feature is the ParameterizedThreadStart delegate. Since the ParameterizedThreadStart delegate is just a delegate, these two concepts can be combined to effectively create an asynchronous anonymous method – an anonymous thread, if you will. You can spin off a chunk of code to run asynchronously without having to put it into a separate function. Check out the following code: private void AddAsync(int a, int b) { //Define the ......

Posted On Monday, August 21, 2006 8:17 AM

Copyright © Dan Koster | Powered by: GeeksWithBlogs.net | Join free