Friday, June 02, 2006

I came across this article while doing some research.  It's well worth the read for anyone doing any kind of development.

6/2/2006 8:54:16 PM (Eastern Daylight Time, UTC-04:00)  #    Comments [0]  | 
 Wednesday, May 31, 2006

Microsoft has published a new white paper on the Micro Framework information page.

5/31/2006 4:11:03 PM (Eastern Daylight Time, UTC-04:00)  #    Comments [0]  | 

Ever want to make all CAB file installs on your device be silent?  Simply add the following registry key to your platform:

[HKEY_CLASSES_ROOT\cabfile\Shell\Open\Command]
    @="wceload.exe \"%1\" /nodelete /noaskdest /noui"

5/31/2006 1:04:13 PM (Eastern Daylight Time, UTC-04:00)  #    Comments [2]  | 
 Tuesday, May 30, 2006

Just as a mental exercise, today I decided to try to write a single method that would allow me to return information about the currently running assembly as a string.  One method needed to return the copyright info, the company info, etc.

The end result is this simple function:

public string GetAssemblyAttribute<T>(T attributeType) where T:Type
{
    object attribute = Assembly.GetExecutingAssembly().GetCustomAttributes((T)attributeType, false)[0];
    return (string)attribute.GetType().GetProperties()[0].GetValue(attribute, null);
}

And calling it is this easy:

string s = "";

s = GetAttribute(typeof(AssemblyCopyrightAttribute));
s = GetAttribute(typeof(AssemblyCompanyAttribute));
s = GetAttribute(typeof(AssemblyDescriptionAttribute));
s = GetAttribute(typeof(AssemblyProductAttribute));
s = GetAttribute(typeof(AssemblyTitleAttribute));
s = GetAttribute(typeof(AssemblyTrademarkAttribute));

Now why it has to be this ugly I'm not sure, but isn't reflection a hoot!? 

5/30/2006 10:12:52 PM (Eastern Daylight Time, UTC-04:00)  #    Comments [0]  | 

As I get older and busier I've found that I seem to have a hard time keeping up with artists that produce music I like.  The radio only plays familiar new stuff over and over and is a poor way to get informed, and I don't really have the time to go blog hunting to find someone with similar tastes and then look at their play lists, then look at each band.  I want simplicity.

Today I found Pandora, and I found it works beautifully.  Basically you put in a group or song you like and it just starts playing random songs that it thinks you might like based on that.  You can tune it like a TiVo - telling what you do and don't like (though I've not had to say no to anything yet).  Even more impressive is that it will give you an explanation of why it picked the song it's playing.

They have a revenue model as well - you can buy the song directly from iTunes or the entire album from Amazon from the interface, which means that they may stay around a while to continue bringing us music.

 

5/30/2006 12:09:53 PM (Eastern Daylight Time, UTC-04:00)  #    Comments [1]  | 
 Monday, May 29, 2006

For those interested in the quick version of how I got where I am, I just posted my partner profile at OpenNETCF.  If you want a more detailed version you'll have to catch me in person and buy me a beer.

5/29/2006 3:19:41 PM (Eastern Daylight Time, UTC-04:00)  #    Comments [0]  | 
 Friday, May 26, 2006

Ever have to do manual serialization of data in a DataSet?  The challenge is being able to call BitConverter.GetBytes on the data element when at compile time you have no idea what it's type is, and GetBytes doesn't accept an Object (though I'd argue maybe it should and attempt to convert the underlying type if it's resolvable).

Here's my solution:

byte[] elementBytes = (byte[])typeof(BitConverter).GetMethod(
   
"GetBytes", new Type[] { dataRow[columnNumber].GetType() }).Invoke(
    null, new object[] { dataRow[columnNumber] });

5/26/2006 1:09:56 PM (Eastern Daylight Time, UTC-04:00)  #    Comments [0]  |