Oct 11 2007

Google Me!

Category: Just for funJoeGeeky @ 05:05

This really made me laugh.  The other day I was looking for a list of Team Foundation Server (TFS) Widgets.  So I Googled TFS and widget and what do you know, the first hit was exactly what I was looking for.  Ok...  This is really no surprise...  Google is great!  But look at the second item on the list.  

Tags:

Oct 11 2007

Feed It!

Category: Tips and TricksJoeGeeky @ 04:51

One of the really nice features introduced with Internet Explorer 7 and Microsoft Outlook 2007 is the ability to subscribe to RSS Feeds and share the feed list between the two applications. This makes it really easy to access Feeds offline and monitor when new content is available, but there is a hidden monster. If you don't pay attention to your default Archival settings in Outlook you may be archiving a ton of content that you have no intention of saving. This can lead to PST files that run in the Gigabytes.  In my case, I was able to shrink my archive by almost 2GB, which for most people is a huge savings. The resolution is really quite simple...  All you have to do is set the archive settings on the RSS Feeds folder to Do not archive items in this folder. Do this, and you will be much happier...  Cheers!  

 

Tags:

Oct 10 2007

When is that meeting?

Category: Tips and TricksJoeGeeky @ 06:52

If you have been in this business for any length of time then you have likely had to colleagues in another time zone, and these days across many time zones.  Whatever your situation here is a little something that often goes unnoticed.  When you are scheduling meetings in Outlook you can explicitly identify the time zone your meeting is scheduled against.  This is really handy, especially when you are working with people in other countries.  Enjoy...

Tags:

Oct 10 2007

Parameterized threading for your own good

Category: Tips and TricksJoeGeeky @ 06:14

The Benefits of multithreading application function are numerous and well documented so I will not bore you will all of that.  However setting up a parameterized threading routine is not all that obvious and you don't see much of this in the boggouspher. So with that in mind I will walk you through a simple example of how to set up a parameterized thread, which I believe is far more practical for most applications today. First lets look a standard thread invokation without any params.  This is pretty straight foward... 

1.  Write the method that you would like to call via an alternate thread.  

 

private void MyAsyncMethod()
{
    //Save the world here...
}

2.  Write the method that will invoke your new AsyncMethod.  In this method you will need to instantiate the thread and point it to the address of the method to be invoked and then you will need to start the thread.  If you read the details on the Thread class on MSDN you will see there are tons of things you can do, but to keep this simple we will simply start the thread.

public void InvokeMyAsyncMethod()
{
    Thread myThread = new Thread(MyAsyncMethod);
    myThread.Start();
}

Thats it...  Call your invoke method and you are all set.  If you look at the Thread Class Constructor you will quickly see there is no overload supporting an address assignment of a method with parameters.  In the real world, we often need to execute threads based on some set of parameters. To accomplish our goal we need to employ a class named "System.Threading.ParameterizedThreadStart".  Essentially this is a delegate that allows us to assign a Thread to specific signature supplying one parameter via the Threads Start method. Lets walk through an example.

1.  Write the parameterize method that you would like to call via an alternate thread. In this case we have to follow the signature x(object y).  

private void MyAsyncParamMethod(object paramObject)
{
    //Save the world here with parameters...
}

2.  Now lets write our parameter-aware invocation method.

public void InvokeMyAsyncParamMethod(object paramObject)
{
    ParameterizedThreadStart pts = new ParameterizedThreadStart(MyAsyncParamMethod);
    Thread myParamThread = new Thread(pts);
    myParamThread.Start(paramObject);
}

That it... At this point you can pass a single object in for the params and parse the object internally to process whatever you need.

This is were a little old-time developer religion comes in to play.  So often I see people sending dictionary objects, collections, or worse yet an arraylist.  While this can get the job done, I would recommend creating your own strongly typed parameter class.  This is easier to parse, maintain, extend, document, etc...  Also, you can place tighter controls on validating what can be submitted via these params.... and it not so sloppy.  

 

Tags: ,

Oct 10 2007

How To Write Unmaintainable Code

Category: Just for funJoeGeeky @ 04:45

If you are not a code writing geek, you probably won't get this. I am not sure who wrote this but it is genious... Enjoy... 
Laughing

http://www.smelser.net/blog/blog/page/How-To-Write-Unmaintainable-Code.aspx

 

Tags: