Java Nerd-Shirt

10 PM March 3, 2008

Charles is getting together a bunch of T-shirt slogans for Java nerds. Here's what I'd put on mine:

dup
iadd
iconst_0
ior
Groovy

That'll ramp up the nerd quotient of just about any gathering on the face of the Earth.

By alang | # | Comments (1)
(Posted to javablogs, Software Development and Java)

Lies, Damn Lies and Dam Statistics

10 PM February 4, 2008

Apparently, we’ve had a lot of rain lately. The water board reckon that it hasn’t made much difference:

Warragamba Dam had received just 30 millimetres of rain since Friday, a spokeswoman for the Sydney Catchment Authority said. “The rainfall we’ve had so far hasn’t been enough to make a significant impact [on dam levels].”

I live in Sydney.com have a different story – 0.1% up over the last few days. That’s a lot of water.

They also have a neat page detailing Sydney’s dam levels over the last few years, and showing the positive effects of the water restrictions. Without the restrictions, Sydney would have run out of water in early 2007.

By alang | # | Comments (1)
(Posted to Stuff and Rants)

Phase Playlist Sync Bug

10 PM January 4, 2008

I recently downloaded the game Phase for my shiny new iPod Nano and immediately hit a bug synchronizing the Phase playlist. If you just want to know how to solve the bug, skip down two paragraphs while I tell everyone else about Phase.

Phase is one of those games like Guitar Hero: you press keys matching the coloured dots falling down the screen in time to the music. The twist is, you get to use your own music. When you first sync the game to your iPod, it creates a playlist named “Phase Music”. You load up the Phase Music playlist with your songs, sync to your iPod, and ta-da, you can play with your own songs. Woohoo! The coloured dots are backed by The Living End! All good, except…

The Bug: you have songs on your iPod, in the Phase Music playlist, but Phase can’t see those songs and says that your Phase Music playlist is empty.

The Workaround: Back in iTunes, you need to drag a song to the Phase Music playlist that isn’t already in there. If you add songs to the playlist using “Add To Playlist” on the option menu, it won’t work. After you have dragged a song, you can then resync your iPod and it will happily play all the songs on the playlist.

It took me two hours of searching, fiddling and resetting my iPod to find this workaround. Grrr.

The Cause: it seems that Phase requires some sort of pre-processing to be done in iTunes before it can be played in Phase. This pre-processing is only triggered when a song is dragged to the playlist, not when a song is added by other means. I’m not sure whether this is dodgy programming on Harmonix’ part, or iTunes not providing a rich enough set of events for game plugins. Either way, for people that tend to use menus instead of dragging, the out-of-the-box experience is terrible, and this reflects both on Harmonix and Apple.

Apple/Harmonix: It’s disappointing this bug wasn’t caught and fixed in testing. I’m sure your developers are fixing it now, but, in the meantime, could you please mention drag-not-menus right up front in the help, the faq AND the support article? Three short sentences would save hundreds of hours of frustration from iPod fans all over the world.

PS: It turns out that you can put any song you want on Guitar Hero – it just takes a bit of hacking.

By alang | # | Comments (0)
(Posted to Stuff, Software Development and Rants)

Give me the damn source!

10 AM December 4, 2007

After taking a much-needed break, I’m back programming Java. Much to my surprise, I’m enjoying it. However, there is still one wound that time hasn’t healed: JAR files without source.

Oh, the hair I’ve pulled out, staring at Javadoc, trying to divine whether a function returns null or empty array to indicate no-result! The co-workers I’ve disturbed swearing at RuntimeExceptions thrown from ten layers beneath the API! The unwarranted pride I’ve felt correctly guessing a working sequence of method calls!

Fortunately, I have found a partial relief in JadClipse, a Java decompiler for Eclipse. JadClipse not only does a reasonable job of recovering source, it also attempts to match up the line numbers in the generated code with the line numbers in the .class file so I can trace execution in the debugger. JadClipse is much happy-making.

A few notes:

  1. JadClipse relies on a native executable, Jad, to do the decompilation.
  2. Jad does not come with source.
  3. Time spent perusing the JadClipse preferences page is well rewarded.
  4. Be careful what you decompile. Many sourceless packages have licenses that prohibit reverse engineering. One wrong click, and you could be sued.
By alang | # | Comments (1)
(Posted to Software Development and Java)

Ruby for Java programmers

2 AM November 29, 2007

My good friend Keith says he’s not starting a language war, but he wants to tell Java programmers what’s so great about Ruby. So here are the reasons:

  • Generally speaking, Ruby is much quicker for development than Java, and for some projects, time to market is important.
  • Ruby’s great at scripts. Java isn’t. Why not use it to automate repetitive tasks.
  • Meta programming Rocks! (Actually Keith didn’t say “Rocks!”, but if he was 17, that’s what he would have said.)
  • Ruby has a bunch of interesting Domain Specific Languages.
  • Rails make it dead easy to build web apps.
  • JRuby means that Ruby code and Rails apps can make use of standard Java libraries and be deployed in standard Java environments.
By alang | # | Comments (0)
(Posted to )
© 2003-2006 Alan Green