Archive for December, 2006
December 30, 2006 at 10:26 pm
· Filed under Ego
My personal best of 2006:
Books read – fiction:
- Walter Moers: Die Stadt der Traeumenden Buecher
A marvellous fantasy world where everything revolves around books and stories. Like many of Terry Pratchett’s Discworld novels, the German author Moers asserts the validity of living in a world of fiction, of being absorbed by whatever one determines to be his or her great passion.
- Rudy Rucker: Spaceland
A novel of the fourth dimension. Emphasizes the “science” in science fiction.
- Nick Hornby: A Long Way Down
Another good read from Nick Hornby. My favourites books are still Fever Pitch and About a Boy, but there’s something about the drifting characters of this novel.
Books read – non-fiction:
- Various: The Simpsons and Philosophy: The D’oh! of Homer
A collection of philosophical essays on the Simpsons, arguably the most successful cartoon show of this decade and the 90s. Multiple authors dissect the hidden agendas, allusions and roles in the Simpsonian universe.
- Romeo Dallaire: Shake Hands with the Devil: The Failure of Humanity in Rwanda
The dismaying report of the UN commander of the peacekeeping mission in Rwanda during the genocide of 1993/94. A detailed account of the cynicism with which the West approached and still approaches the peoples of Africa. Also a forceful statement in favor of an active UN peacekeeping agenda, that helping others in an armed conflict does mean risking “Western” lives, and that in not doing so one presumes that the own life is more precious than the other’s.
- Chad Fowler: My Job Went to India – And All I Got Was This Lousy Book
On a lighter topic, Chad Fowler offers valuable insights why outsourcing software development is not a “magic sword” and how to keep one’s own job in a globalized economy. Tailored to programmers, but probably applicable to other professions, too.
Movies watched – yes, it was a pretty bad year in terms of movies.
- Martin Scorsese: The Departed
Great story, great actors, great pictures, great movie.
- Pedro Almodovar: Volver
Since I did not like Almodovar’s previous movie La Mala Educacion (Bad Education) too much, I was surprised how funny and heart-warming his latest movie turned out to be.
- Dayton, Faris: Little Miss Sunshine
I saw this in a test screening, and loved every minute. It’s probably not the greatest piece of movie making and could use a few less stereotypes, but it is great entertainment.
Bands seen live:
- Tool – Vienna and Novarock: besides being my favourite band of this year, both live performances I saw this year were impressive.
- Metallica – Novarock: Yes, they’re old, and Some Kind of Monster did confirm quite a lot of stereotypes for metal bands in general and Metallica in particular, but they did an astonishing 3+ hours concert at this year’s Novarock festival in Nickelsdorf, Austria.
- Fettes Brot – Donauinselfest: German hiphop, a very powerful and entertaining concert.
Top personal moments – overall it’s been a hard year on me, on the other hand I learned quite some things about myself, and had some truly great times anyway:
- Attending the JAX Java conference in Wiesbaden, Germany. 3-4 days of interesting lectures and workshops, making me remember why I like programming so much.
- The sailing trip on the Baltic Sea. It wasn’t quite as cool as the year before, but everyone tried hard and made it a great experience again. Our next trip will be during the Easter holidays, which means lower temperatures, less waiting and a free summer to do something else (got some spare days left from this year, anyway).
- Jens’ wedding. A great weekend, including a visit to Adrian.
So what’s up for 2007? First and foremost, probably all-new projects at work, moving to a larger flat, addressing some social issues, stop thinking of money, stop thinking of getting older, porting Gametective to Ruby on Rails (including true internationalization, starting with English and German), expanding on my writing both in English and German, learning Swedish, doing more photography, attending the Nine Inch Nails concert in March, and whatever comes around.
Permalink
December 27, 2006 at 11:03 pm
· Filed under Kubuntu, Linux, Printing, Ubuntu
I recently bought a Brother HL-5250DN mono laser printer. It features a duplex unit and can act as an autonomous network printer. Just for the fun of it, I decided to install it as a network printer and attached it to one of the ethernet ports of my Wireless LAN router. As expected, Windows installation was a breeze – but so was Kubuntu (Edgy).
First thing (for both Windows and Linux) was to assign a static IP address to the printer – launch the web interface (enter the printer’s IP address in your browser), go to “Network Configuration”, select “TCP/IP” and assign the printer a static IP address on your local network (by default, the printer uses DHCP – my router provides a table of leased IP addresses, so it was easy to find the newly attached printer).
Open Kubuntu’s System Settings screen (i.e. KControl), go to Printer –> Add Printer/Class –> Next –> Network Printer (TCP) –> Next.
Enter the printer’s IP address, e.g. 192.168.1.250, and click Next.
The best driver currently available in Kubuntu seems to be the Brother HL-5170DN driver. It works, but may not utilize all features. Instead, insert the printer driver CD-ROM and copy Driver/PS/PPD/<your language>/BR5250_2.PPD to a local directory. Use a tool like flip to convert the line feeds from Windows to Unix format. In the model select dialog, click Other… and select the converted PPD file. Click Next. No you can print a test page and enter additional printer information – for me, this worked the very first time I tried. Duplex printing can be enabled in the printer’s properties. Nice done, (K)Ubuntu (and Debian).
Permalink
December 22, 2006 at 12:49 pm
· Filed under Miscellaneous, Vacation
I’m off to Kaisersdorf, Burgenland, a small rural village about 90 kilometers from Vienna, to celebrate christmas with my family (my parents and my brother). No internet, no phone calls, and no PCs. Just books, food and wine. Paradise!
I’ve also taken the rest of next week off, a badly needed vacation. A merry christmas to everyone!
Permalink
December 20, 2006 at 7:09 pm
· Filed under IntelliJ IDEA, Java, Java Serialization
Cleaning up code I launched serialver to create serialVersionUIDs for some serializable classes. Wondering why IntelliJ IDEA did not seem to provide a generator for UIDs, I browsed the code inspection settings and it turns out that there actually is one – but it is disabled by default. To use it, go to
Settings -> Errors -> Serialization issues -> Serializable class without ’serialVersionUID’
When editing a Serializable class without a serialVersionUID field set, IDEA now displays a warning and provides a Quickfix (Alt+Enter) to generate one.
Permalink
December 17, 2006 at 9:14 pm
· Filed under Miscellaneous

For some weeks I’ve been trying to organize my personal and professional tasks with Remember the Milk. It’s a free Web 2.0 application for organizing and scheduling todo items. Tasks may be tagged and associated with locations (picked via Google Maps). Tasks can also be shared with other users, which makes it an interesting (albeit minimal) tool for online collaboration. Similar to applications like GMail and Google Calendar, almost anything can be done with keyboard shortcuts. While it takes some time getting used to it, keyboard navigation vastly improves usability and makes all the difference for serious use.
If you’re like me, easily distracted and uneasy with deciding which task to do next, you should try Remember the Milk. While it may not be the most impressive Web 2.0 app out there, it’s fun and gets the job done.
Permalink
December 16, 2006 at 4:32 pm
· Filed under JSP, Java
Upgrading to Java 6 spells trouble for JSP compilers: the new bytecode verifier does not allow jsr and ret instructions previously used for generating try/finally-blocks. Instead, finally clauses are inlined on all “exit paths” of a try clause.
Why is this relevant for JSP pages? A JSP page is compiled into one large method, which is usually wrapped with a large try block including a non-trivial finally block for cleanup routines, e.g. for tag reuse. Looking at a reasonably complex JSP page with many tags reveals many exit paths from the try block, meaning that the finally block will be inlined hundreds, if not thousands of times for a single JSP page.
Memory-size issues aside, that still would be a rather cosmetic issue. Here’s the problem: even modern JVMs do have a 64k limit on methods and blocks. While no sane coder should ever hit this limit, this is a serious problem for generated code. It was quite easy to hit this limit before JDK6, and the new compiler makes it even easier.
As a workaround, it seems that setting both source and target to 1.4 (or 1.5) with “-target 1.4 -source 1.4” reverts to the old compiler behaviour, meaning that finally blocks won’t always be inlined and code size decreases. Where to set this parameter depends on the JSP container, in OC4J, for example, it is set in the the java-compiler entry in server.xml. There’s also a bug entry in Sun’s Bug Database.
Permalink
December 12, 2006 at 1:25 am
· Filed under Java
Java SE 6 was released earlier today. The list of improvements contains many new APIs, including scripting support (with built-in Javascript support via Rhino), JDBC 4.0, the Java Compiler API, and the Compiler Tree API.
The Java Compiler API provides an abstraction for Java compilers, while the Compiler Tree API provides direct access to javac’s AST. Sorcerer is a powerful source code browser generator based on the tree API, and I guess many more cool tools will follow.
I haven’t looked into either API too hard yet, but at least managed to come up with a trivial program that invokes javac on a given file:
JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
StandardJavaFileManager manager = compiler.getStandardFileManager(null, null, null);
Iterable compilationUnits = manager.getJavaFileObjects(new File("MyClass.java"));
compiler.getTask(null, manager, null, null, null, compilationUnits).call();
manager.close();
Besides being overly explicit for this rather trivial task (perhaps I missed a shortcut), it “just works” and makes life for anyone needing to compile some java files much easier.
Permalink
December 5, 2006 at 1:20 am
· Filed under AJAX, JavaScript, Web Development
Selenium is a collection of cross-browser, cross-system browser testing frameworks. It includes a client-side Javascript/HTML testing application and, for more complex tasks, a remote framework that can be used for automated browser access in a number of programming languages (e.g. Java or Python). Thus it becomes possible to write browser tests like ordinary unit tests in your favourite language, assuming that the targeted browser is available on the host system.
While I haven’t gotten around to using the remote framework yet (I’m really inclined to do this soon), I just discovered the Selenium IDE plugin for Firefox. It’s a macro-based web testing application that captures the user’s input on a webpage and replays it at a later moment. If an user action fails to execute, the test is aborted and an error message is returned. Tests can be exported to remote tests in any supported language, effectively providing people a way to write (read: record) remote tests without actually programming anything.
Unfortunately, my first attempts to record tests for an in-house application heavily dependent on Javascript and DHTML failed, yielding incorrectly captured input (e.g. frame names) or missing actions (e.g. clicks on Dojo tree nodes). However, for 1.0 web pages with little or no Javascript involved, it worked flawlessly.
At first glance, there are still some issues to be solved for testing arbitrary web applications, but the overall concept is promising and works well if Javascript is not critical to the execution of core functionality.
Permalink
December 2, 2006 at 9:40 pm
· Filed under AJAX, Dojo, JavaScript, Web Development
As much as I like the Dojo toolkit, its out-of-the-box performance leaves something to be desired. While the package system is very capable, the (synchronous) loading of missing widgets and classes via XmlHttpRequest is slow and usually misses the browser cache. This can be fixed by creating a custom Dojo build with all required files included in a single dojo.js file.
On a reasonably complex page another problem becomes obvious: the DOM parser Dojo employs to search for widgets in a HTML page seems to be rather slow. For example, on a page with several nested tables of about 40k this takes seconds on my machine, without a single Dojo widget actually being used on the page.
Apparently, the only feasible solution at this time is to set the parseWidgets init parameter to false and specify all Dojo widget IDs explicitly. For example,
var djConfig = { isDebug: false,
baseRelativePath: "/js/dojo/",
parseWidgets: false,
searchIds: ["dojoWidget1", "dojoWidget2"]
};
While not exactly user-friendly, at least this works without a noticeable impact on performance.
Permalink