Wednesday, January 12, 2005

EUR-FREAKING-EKA!

So, the moral of the story is, don't try to deserialize a Java SDK object in Java 1.4.2 if the aforementioned object was serialized in Java 5.0. And what's the story? Well, if the first sentence didn't make any sense to you, then you probably don't care what the story is.

So I've been wracking my brain the better part of a day trying to figure out why I've been getting the Java exception StreamCorruptedException in a code fragment that is attempting to deserialize an object. The object exists in a pre-existing file (i.e., it's not created during the execution of the program). The only "extended" information that stack trace was telling me was that it was getting an I/O error. I've been debugging, trying to work around it, blowing away the file and re-creating it, etc. etc. It just didn't make any sense to me. I've been running other applications which use this same piece of code that was blowing up. In fact, the new code I was working with was basically extending the main class of one of those old programs, to simplify (at least that was the plan) testing some new code I was writing. So it should friggin work!

Long story short, what I finally realized was that I was trying to run this new program in my IDE, and the IDE was still configured to use JDK 1.4.2 (oops). As I mentioned above, the object serialization occurred outside of the IDE, separate from the execution of the failing program. It was created in an Ant build script, which was set up to use JDK 5. Apparently, this is a "bad thing". I'm guessing the underlying object changed between the two JDK versions. Of course, the reason the other programs were working just fine was that I was still running them from the Ant script, not directly from the IDE. Doh!

The frustrating thing is that the exception didn't give any indication of the actual cause, i.e. incompatible versioning. I've seen that in other instances where you try to deserialize an object that was created with a different version of that object. But all the exception told me was that it was encountering an I/O error reading the file. This is reason number 4,831,691,227 why I hate computers.

It's finally time to join that cult.

Well, looks like I'm going to be joining a cult. You know, the cult of Mac users? The new "Mac Mini" is just too good to pass up! As a software developer I don't see that I'll be able to give up Windows any time soon, but the Mac Mini is a fairly inexpensive way to dip my toes in the Apple-water. (Is that anything like Apple cider?)

I think this is a genius move by Steve Jobs. I know there are lots of geeks like me who have been curious about Apple, and for $500 and the ability to hook this baby up on the KVM switch we already have, it's perfect! I mean, c'mon, OS X, it's Unix! I doubt this will be my primary machine, but it'll give me a chance to learn more abot OS X, and who knows, maybe one day I will completely abandon the dark side of the force. My "mini" is pre-ordered and I will share my impressions sometime after I get it later this month (hopefully).

Our dogs are still getting along well. Harley is doing great -- but we've found that he has one bad habit, which is that he has a tendency to "guard" his food, his bone and toys. The thing with the bone and toys is really funny, because 99% of the time he won't even mess with them, but if you get near them he tries to cover them up and lets out a low growl. We are trying to slowly educate him that this is not acceptable, and he is learning, and getting better about it, so we think we'll be able to break this bad habit before long. He hasn't tried to bite or anything, so it's not a big problem, but it's definitely something we don't want to leave unchecked.

The weather here has been absolutely fabulous. Probably about 20 degrees above normal. I think I can learn to live with this whole global warming thing. Sadly, in another couple of days temps are supposed to go back to normal. On the bright side, the Daytona 500 is not far away. :)

Tuesday, January 04, 2005

The Joy of Mathematics

So I'm reading this little book, The Joy of Mathematics, that I bought on a whim who knows how long ago. I have many unread and interesting looking books that fall into that category. Someday I will have time to read them all. But I digress.

Now this is probably old hat to everyone on the planet but me, but I thought it was cool and it's my blog so I'm sharing! The one thing that I've been most fascinated by so far in the book is the Moebius strip. It is a one sided object. You start out with a long strip of paper. If you tape the ends together you end up with just a ring. But if you first twist one end, and then tape it together, you have a Moebius strip. This strip of paper, which only a moment ago had two unique sides, now is an object with only one side. If you don't believe it, start drawing a line down the middle of it. Eventually you end up back where you started, without ever lifting the pen off the paper, and you have traversed the entire length of it. In the words of Neo: "Whoa."

Then again, perhaps I'm just easily amused. :)

Saturday, January 01, 2005

Can it really be 2005?

It seems like only yesterday that we were all worrying about the end of the world as we knew it from Y2K! I'm still getting used to the whole idea of 200x, and x is already up to 5. As one of my friends used to say, times fun when you're having flies!

Not really much profound to say. Mostly been slacking off and watching the Twilight Zone marathon on the SciFi channel (much to Donna's dismay). Also been trying to get a jump on spring cleaning in my office. How can a person accumulate so much junk???

Here are some more pictures of Scout and Harley. They are getting along really well, so I don't think we need to worry about that anymore. We took them both for a walk today, and it was pretty nice. They were really well behaved and walked side by side.

We also took them on a walk yesterday, and Harley acted a bit oddly then. As we walked away from our house, he was really pulling hard on the leash. Which was really a surprise, because the night we picked him up he did so well on the leash. We even took him to PetSmart with us and he did great. Anyway, we decided to turn around and go back toward home. The instant we changed directions, he stopped pulling. Hmmm, that's weird. So we decided to turn around again, and you guessed it ... as soon as we did he started pulling real hard on the leash. I was feeling a little parnoid because the new harness we got for him seemed a little loose and he was really pulling hard, so we headed back toward home again. And, like clockwork, as soon as we turned around he stopped pulling. And today, he really didn't pull on the leash at all.

Doggie brains are weird! Oh, that reminds me. For a good chuckle (particularly if you're a dog lover) read Dave Barry's latest column. Donna and I both got a kick out of it.

Not much else to say, except happy new year everybody! Here's looking forward to a great 2K5!