Home  |  Photos  |  Blog

 Tuesday, October 04, 2005

Today at work I came across some new APIs in Whidbey that I found to be quite useful when dealing with generic types.  System.Type.IsGenericType and System.Type.GetGenericTypeDefinition().  Have you ever wondered how to reflect if an object's type is a specific generic type definition (wait...is that any oxymoron :))?

Suppose we have some generic code:

class Foo {}

static void Main(string[] args) {
  System.Collections.Generic.List<Foo> fooList = new System.Collections.Generic.List<Foo>();
 
}

and now we want a method of determining at runtime if the object, fooList is a generic list:

static void Main(string[] args) {
  System.Collections.Generic.List<Foo> fooList = new System.Collections.Generic.List<Foo>();
  Console.WriteLine(IsObjectGenericList(fooList));
}

static bool IsObjectGenericList(object o) {
  Type t = o.GetType();
  return (t.IsGenericType && t.GetGenericTypeDefinition().Equals(typeof(System.Collections.Generic.List<>)));
}

I found these APIs useful when working with various generic types in my system.  For more information on this subject, look here.

10/4/2005 6:58 PM Eastern Standard Time  #    Disclaimer  |   |  Trackback
 Thursday, September 29, 2005

So I went to the Coldplay concert last night in Atlanta at the Philips Arena. I was impressed with the way they sounded live compared to their recordings. Since the lead singer was on mostly on the piano, it wasn't as entertaining as other concerts I've been to, but it was still cool nonetheless. I used my phone to record the last couple minutes of the finale song and I thought I'd post it for fun, so...here it is.  Enjoy!

9/29/2005 8:53 AM Eastern Standard Time  #    Disclaimer  |   |  Trackback
 Tuesday, August 16, 2005

I'm pleased to announce that I'm officially a homeowner!  I bought a townhouse in the Vinings (Sminings) area of Atlanta.   I closed the deal last Monday and moved in this past weekend.  The move was rough (isn't it always), but I'm really excited about living there.  Here are some photos of Lindsey and I looking at it before we decided to buy.

Paces Point

8/16/2005 10:19 AM Eastern Standard Time  #    Disclaimer  |   |  Trackback
Scott Gu has posted about the upcoming fixes to the web projects in Whidbey.  It looks like it may be a good change afterall :)
8/16/2005 9:56 AM Eastern Standard Time  #    Disclaimer  |   |  Trackback
 Wednesday, August 03, 2005

Wow, it's finally here!  Stereoscopy brought to an LCD display with NO GLASSES!!!  It looks like Sharp is now selling autostereoscopic displays (for the 3D layman, this is like watching a 3D IMAX at home without the use of glasses).

I would love to have the opportunity to check out one of these and see how good it really is.  It's just a matter of time before someone will be selling a 3D digital video camera that integrates directly with the software and the display.  It now looks like my custom-built 3D camera and viewer has already become obsolete.  Wow, this technology could really revolutionize the world of multimedia.

8/3/2005 5:37 PM Eastern Standard Time  #    Disclaimer  |   |  Trackback