Archive for April, 2008

What It’s Like to Be a Programmer

This pretty much sums it all up.

Programmer spends days researching a bug

Back When It Was The JDK

This graphic illustrates the JDK naming history.

JDK Version History

I like “JDK 6u5″ the best. The first number indicates API changes, the second number indicates implementation changes. The “JDK” lets you know this is the development kit, not the runtime environment. This is simple, concise, and easy to understand.

I think the 1.x.0_0y scheme is redundant and confusing because the “1″ and “0″ never change any more.

The whole “Java SE 6″ name just adds to the confusion. Nobody I know says that name out loud. It reminds me of the asinine commercials where the 5 year old kid is singing “I am stuck on Band Aid Brand”, as if a 5-year old would ever say “Band Aid Brand”.

Picasa Best Practices?

I’d like to devise a strategy for organizing photos. Up until now, I’ve manually organized pictures into a directory tree. At the top level, I have a year, then folders for each month, then a bunch of pictures. For example:

2008
 |
 +--01_Jan
 +--02_Feb
 +--etc...

The number prefix keeps things properly sorted. But I’m losing out on searching, tagging, etc, and would like to simply move to Picasa.

I’m curious how other people organize their photos, using Picasa. It would be nice if there was a “best practices” guide or perhaps even a “common organization patterns” guide, that listed a few different strategies for organizing photos on the hard drive. Then I could choose the strategy that works best for me.

How do you organize your photos?

Simplified Array Syntax

Sometimes, when working with Java 5/6, you still have to call methods from pre-Java 5 libraries. For instance, many of our DAOs are littered with code similar to this:

jdbcTemplate.query(sql,
    new Object[]{ customerId, customerName },
    new int[]{Types.INTEGER, Types.VARCHAR},
    ... );

I don’t like the new Object[] { … }, So today I wrote a static method:

public static <T> T[] array(T... t) {
    return t;
}

And another for primitive ints:

public static int[] intArray(int... i) {
    return i;
}

Thus, I can now write the original code like this:

jdbcTemplate.query(sql,
    array(customerId, customerName),
    intArray(INTEGER, VARCHAR),
    ... );

I have to say that static imports and varargs are among my favorite Java 5 syntax features. Now if only I didn’t have to have special methods to handle arrays of primitives.

Seeking Atom Debugging Help

I’m producing an Atom 1.0 feed in a servlet. To debug, I’m pointing Firefox at the feed URL. But Firefox shows a “friendly” page that formats the page as HTML and prompts me to subscribe.

When I view the page source in Firefox, I see HTML and RSS from the “user friendly” subscription page. I really want to see the raw Atom XML source.

I get similar results in IE and Safari. UPDATE: It seems that I can view source in IE, and I see the original Atom feed.

Is there a way to view the raw feed XML source in Firefox???

UPDATE 2: I am at home now, trying this in Firefox on my blog’s feed. I can view page source just fine and I see the Atom feed content. Now I’m completely confused by what I saw at work. When at work, hitting a servlet that generated Atom, the page source was always the “friendly” page. But at home, hitting a different Atom feed, I’m seeing the raw feed source. I don’t get it. Maybe I’m just nuts.

DRM IQ Test

This won’t take long.

DRM IQ Test: I Still Buy Music with DRM: Yes or No

Did Google Kill Andrew?

Poor Andrew.

Andrew saws off his own hand, and then bleeds to death.