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)

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)

Grails!

1 AM November 29, 2007

Paul King, co-author of Groovy in Action is speaking on Grails, the Groovy version of Ruby on Rails.

  • Grails is rip-off of Rails. Development in Grailsis much the same as Rails. It even has the same folder layout.
  • There is IDE support for Grails.
  • Grails is in its infancy. 1.0 due out in a few weeks.
  • Integrates robust tools such as Hibernate, Spring and Jetty.
  • Several Javascript frameworks incorporated, including Prototype, Dojo and Yahoo.
  • Because it uses Hibernate, Grails supports a wide range of databases.
  • Grails can build a standard WAR file, ready to be deployed to just about any Java servlet engine.
  • Grails “is growing enormously”. The number of people involved is growing by an order of magnitude every six months. (!)
  • Performance is comparable to Ruby on Rails, but somewhat slower than a bespoke Java web app. The good news is that it’s easy to replace performance hotspots with Java code.

Grails looks nice, partly because I can make use of the giant body of Java libraries in any Grails code I write. Next time I’m building a standalone web-app, I’ll definitely consider it.

Update: Paul, of course is also responsible for much of the Groovy content in the PLEAC.

By alang | # | Comments (4)
(Posted to Software Development and Java)

The rest of OSDC day 2

11 PM November 28, 2007

Caught a number of interesting sessions yesterday:

  • Adam Kennedy spoke animatedly on the topic of CPAN 1.5. I have only an abstract interest in the CPAN as a colossal piece of software engineering, but Adam is always amusing.
  • Josh Heumann’s Intermediate Perl Testing turned out to be more about testing than Perl. Lots of good advice for organisations that don’t yet have testing as part of their culture.
  • Google’s own Leslie Hawthorn, Geek Shepherd, spoke about the Google Summer of Code program, which she manages, and then launched a similar program for High School students, Google Highly Open Participation Contest. My eldest is just one year too young to join in this year – next year for sure.
  • Paul Fenwick’s dinner talk, An Illustrated History of Failure was funny, interesting and geeky. Everything a dinner talk should be.

And after dinner, went out with a crowd from Sydney. We drank lemonade and ginger ale.

By alang | # | Comments (1)
(Posted to Software Development)
© 2003-2006 Alan Green