Wednesday, August 30, 2006

Helping the world...

How often can you say products that you work on are really used to help save lives? (I'm not talking to you EMTs, etc. out there; I'm talking to the software people!)

Check out this DMReview article.
Dr. Richard Gray and of his staff of six used PV-WAVE, a sophisticated visual analysis tool from Visual Numerics, to build a "first of its kind" research application for identifying fibrillation.

Friday, August 25, 2006

Serialization in .NET

I had a Java example to work from, but had to do this in .NET. In this case, my class basically had a Hashtable that I wanted to serialize. On the Java side, there really isn't much more to this than creating an ObjectOutputStream and then calling writeObject(this). If you add implements Serializable and add a couple UIDs, you're all set. Actually very easy.

Well, not so much on the C# side. First, you class needs to have the [Serializable()] attribute set and you also implement ISerializable. All fine so far, but implementing this interface means you need a GetObjectData method too. Visual Studio drops the skeleton in your class, but that's were my general clue of what I was doing stopped.

Instead of going through all the crap I went through, in the end you need to simply add a couple lines in GetObjectData to add whatever local variables you want to serialize. In this case, it was just that Hashtable, so my method looks like:
public void GetObjectData(SerializationInfo info, StreamingContext context)
{
info.AddValue("hashSeries", hashSeries);
}

So that's all and fine -- but you need to realize now that you've only got a way to get the data serialized. The part they don't really tell you is that now you need a special ctor for your serializable class that's used when you call Deserialize on the input stream and cast it back to your original object. This constructor needs the same parameters as that GetObjectData method and basically just does things in reverse:
protected StockDatabase(SerializationInfo info, StreamingContext context)
{
hashSeries = (Hashtable)info.GetValue("hashSeries", typeof(Hashtable));
}
Simple as pie right? I really didn't spin my wheels too long on this one, but I did do some real research trying to find a good example and piece together the bits from the various things I saw on the way to something that works. The best example ended up being the one for the Deserialize Method even though it doesn't serialize a class object.

M.I.T. CSAIL building


A very strange place. We had a meeting there on Tuesday and got an unofficial tour. Officially, it's the Computer Science and Artificial Intelligence Lab and it's functional as a lab. But it's one of the strangest buildings you'll ever find yourself in. Apparently the idea is to now really know if you're on an inside wall or not. So lots of sunlight, but apparently some acoustical problems too. I have a bunch more pictures from my Treo, but it looks like you're only allowed one picture per blog. So I'll probably just add a few more on future slow days.

Monday, August 21, 2006

Boston

I do have pictures of the new stuff for the Mini, but it'll have to wait a few days. In a couple hours, I'm picking Weaze up from work and we're driving to Boston. Kind of a long drive for a couple days of meetings, but work pays for gas and I don't have to worry about flying/airport security for a another week. Ciao.

Wednesday, August 16, 2006

Car for sale


I should mention that I have a car for sale. It's a fast TBird SuperCoupe with a good amount of aftermarket mods. It's a rare (1 of about 500) 1995 5-speed. See my SCCOA page for more info. Nothing wrong with it, just wanted to have a car the wife could also drive (so we got the MINI).

Tuesday, August 15, 2006

PS3 vs Wii

PS3 vs. Wii
Best Video Ever.
Adblock
Adblock

Monday, August 14, 2006

Turbo Borland

I just read in an SD Times announcement "Turbo Brand Returns to Borland". You know, I thought Borland went out of business 3 times already. Now they're back with their 20 year old brand names. They need to learn this tidbit: No matter how much marketing you have, you're not going to beat Microsoft at the IDE game. Period. Give up and find another source of revenue (or stay out of business next time!).

By the way, I spend too much of my time answering things on "Yahoo! Answers". I'm at a meaningless "Level 2" right now with something like 900 points. The only pride I have in that is that 1/3 of my answers get selected "Best Answers" -- compare that to all the chaff out there of people with 2000 points, getting 2 points each time they say "um, I don't know".
My stats page

Saturday, August 12, 2006

1000 Miles


So the wife flipped 1000 miles on the MINI last night -- I was looking forward to this milestone, but alas, it wasn't meant to be. Maybe I'll be the one to flip 1500 and end this annoying break-in period where we're supposed to keep it under 4500 rpm (which is getting harder and harder to do!).

Friday, August 11, 2006

.Not

Writing a lot of C# code lately. While you really appreciate Visual Studio quickly, there's some things about .NET that aren't that fun to learn. An interesting page on what's bad about .NET in general: .Not, the .Net hall of shame. Delegates and event handling are another odd can of worms. Maybe it makes sense if you know C++ (I don't), but to a Java hack, it takes some getting used to. And if you're coming from Java, Microsoft of course wants you to drink their Kool-aid: C# for Java Developer.