Wednesday, February 28, 2007

New Horizons probe Jupiter flyby

The NASA's New Horizons's probe made its closest approach to Jupiter today morning (well, morning in my time zone, that is) on its way to its ultimate destination (Pluto, to be reached in 2015). It sent back some of the best to-date pictures of Jupiter and some of its moons.

The probe also carries a compact disc that stores a file listing the names of some 430000 people who chose to send their name in the space. Were you nerd enough to sign up? Or even to sign up your kids? (By the time the news of probe reaching Pluto hits the media in 2015, my kids will be 16 and 14 years old respectively, and I hope they'll grow to be geeks as their dad is, thus appreciate this).

Snowflake magnified 36000 times

Yes, I'm sort-of obsessed with snowflakes - this is not the first time I blogged about them. Here's a fascinating series of images of a single snowflake, imaged with an electron microscope, ranging in magnification factors from 93x to 36000x.

I often try to explain to my son just how small scale is the molecular structure of the material world that surrounds us, but it's hard to word it so that a 8-year old understands it. As they say, a picture is worth a thousand words, and these breathtaking pictures certainly prove the point.

Friday, February 23, 2007

You still can't write a good novel

My brother-in-law was given the task of writing some integrated-circuitry emulator in C# on his internship job. He's a soon-to-graduate electrical engineer and rather an alien to software development. He was given a book, "Visual C# Step by Step" to supposedly help him along and complained to me how it doesn't really help him in figuring out how to actually write a good program, it just teaches him a programming language.

I told him that if he attended a course in French language, he still wouldn't learn how to write a good novel in French.

He understood the analogy. The problem is - at least if I remember my university years - an awful lot of educators around here don't get it.

Speaking in Vegas

I'll be attending the TheServerSide Java Symposium (TSSJS) in Las Vegas between March 21 and 23. On friday, I'll be speaking about the Java 6 Scripting API. I'll be delivering the same talk on the European TSSJS event organized at the end of the June in Barcelona as well.

Monday, February 05, 2007

"Iterators are not intended to be serializable." Huh?

In a recent attempt to reduce my "Unread" mailbox, I went back in it marking as "Read" everything that has been, well, read. So it happened that I stumbled across a bug report I filed with Sun around 7 months ago (yes, that mailbox was deep), and went to see what became of it. You can see it here.
The problem I reported is that various iterator objects shipped with Sun's JRE aren't serializable. Looking at the bug's page, I noticed that the "Evaluation" field has been filled out with:

Iterators are not intended to be serializable. Probably.... Not a Defect.
Wow. Whoever evaluated this wasn't particularly, to put it mildly, in short supply of short-sightedness. In accordance to this, the bug was marked as "Request for Enhancement".
Now please tell me if I see it wrong, and if there never-ever can arise a valid class design where a stateful object maintains certain aspect of its state by keeping an iterator into a collection, and said object should be serializable. At least for lists, the concept can even be emulated by holding a reference to the list object and an index variable, so it definitely doesn't sound like a very unsane idea.
I will admit though that I didn't come across an explicit case of it myself. How did I stumble upon this bug then? Continuations. I had a JavaScript program that had a loop going through a collection with an iterator, and captured a continuation within the loop and subsequently attempted to serialize the continuation. Naturally, the continuation being within a loop, the serialization graph of objects reachable through it contained the iterator. Blam.
Now, this admittedly might sound as a more esoteric case of serializing state that contains an iterator, but really, were I to use a "for" loop with explicit indexing instead of an iterator, it wouldn't have been a problem. Therefore, I can't see serializing an iterator to be such an off-the-wall idea to justify the anonymous Sun mouthpiece saying "Iterators are not intended to be serializable"?