Tuesday, December 29, 2009

Urban Terror

This is a fun old game I used to play a lot about 5 years ago. It kind
of fell by the wayside as I kept upgrading hardware and software.
But this new version 4.1 installs easy and runs great on my
hardware with Ubuntu 9.10. Urban Terror no longer requires an
installation of Quake 3 Arena.

Urban Terror

It's an online first-person shooter.
There are versions for Linux, the Mac, even (retch) Windows.

I must have played for about 4 hours today. This is what vacation
is all about.

Thursday, December 17, 2009

Wednesday, December 16, 2009

Using Firefox as Eclipse's external browse

My environment for this is Ubuntu 9.10, Eclipse Galileo (3.5).
I started out thinking this would be about a one minute
configuration change. Go to Window->Preferences, click on
Web Browser, select 'use external web browser' and 'default
system web browser', done, right?

Oops, that's not quite what I want. I always already have
Firefox open and when I clicked on something that used
a browser like Help->Help Contents, it would open a new
tab in one of my existing Firefox windows instead of opening
a new browser window in the same virtual desktop as

I found Mozilla Command Line Options and decided what I
needed was a command like 'firefox -new-window URL'. I
tried this at the command line and it seemed to do the right
thing - bring the URL up in a new window of the existing
browser session.

Now all I needed to do was configure this in Eclipse.
I created a new web browser (Window->Preferences,
General->Web Browser) like this:

Name: Firefox
Location: /usr/bin/firefox
Parameters: -new-window %URL%

I tried that and numerous variations. It felt like Eclipse
was just ignoring whatever I put in 'Parameters'. The URL
would always open in a new tab instead of opening a new

Frustrated, I finally edited 'Firefox' to this:

Name: Firefox
Location: /home/lmulcahy/bin/firefox-new-window

and wrote the firefox-new-window script as follows:

echo $@ > /tmp/firefox-new-window

I tried Help->Help Contents again and found this in
the output in /tmp:

-remote openURL(

Well, now we're getting somewhere...
Eclipse is adding '-remote' to my command line
and it's also enclosing the URL in 'openURL()'.

To make a long story short, here's my firefox-new-window script
now. This does just what I wanted:

URL=`echo $2 | sed 's/.*(\(.*\))/\1/'`
/usr/bin/firefox -new-window $URL

Is it just me or does this seem like a pretty gross Eclipse bug?

Emacs features I miss in Eclipse

It's been about 2 years since I bit the bullet and abandoned my
beloved Emacs in favor of Eclipse for Java coding. I don't
really regret this. Eclipse's many features offering specialized
support for Java (things like Organize Imports, Generate
Getters and Setters, all the refactoring commands, etc.) make
this a no-brainer. Yet I still find myself occasionally dropping
back into Emacs for these indispensable features:
  • Defining macros on the fly with M-(, M-) for repetitive changes.
  • M-X sort-lines. If I'm working on some kind of list like a list of JAR files in a classpath where the order doesn't really matter, I like to have them in alphabetical order. Eclipse doesn't really give you any way to do this.
  • Dired (file manager)
  • Split-window (C-X 2), split-window-horizontally (C-X 3).
  • All the downcase/upcase/capitalize commands.
  • Case-smart search and replace. I'm constantly repeating the same search and replace 2 or 3 times in Eclipse because Eclipse can't figure out that if I want to change 'string1' to 'string2', then I probably also want to change 'String1' to 'String2'. Emacs just quietly Does The Right Thing.
  • Comment-dwim (M-;) Inserts end of line comments, aligned at a preconfigured column or just at the end of the line if the line is already longer than that column. If a comment is already present, aligns the comment to the appropriate column and places the cursor at the beginning of the comment. Does multiple lines if a region is selected. Works the same way in Java, Perl, C, etc. using the appropriate syntax for the language. Great for adding a short comment to every element of a list neatly aligned in the same column. DWIM stands for 'do what I mean'.
  • Indenting and filling that works for comments.
  • Ironically, Emacs' compact and lightweight memory footprint, by comparison.

Thursday, November 12, 2009

More Ubuntu 9.10

Earlier I noted that Ubuntu 9.10 reported my laptop hard drive was going
to fail. At first I discounted this as (1) it was reporting a crazy and
impossible 500,000+ bad sectors and (2) the drive seemed to be working
fine and other metrics didn't indicate a problem.

Well, yesterday my file system came up dirty for the second time in a
week and I reluctantly concluded there was a problem with the drive.

I got a new drive and went about restoring from a recent disk to disk
backup. All went well until I was getting ready to edit /etc/fstab and
/var/boot/menu.lst to change the UUID of the ext4 file system and
discovered the vol_id command no longer seems to be part of Ubuntu.
You really need this to restore from a full backup.

Workaround: The needed information is available at /dev/disk/by-uuid.

GRUB 2: Live CD Install Guide documents how to install GRUB into
the MBR... worked for me.

Tuesday, November 10, 2009

Ubuntu 9.10 vs. Eclipse

After upgrading Ubuntu to 9.10 on my computer at work, I noticed a lot
of dialog buttons weren't working. In some cases I could work around by
hitting return which is the same as clicking on the highlighted dialog
button. Or it was possible to navigate around within the fields and buttons
of a dialog using TAB and Shift-TAB but that was pretty slow and painful.

Fortunately there's a fix.

Monday, November 9, 2009

Ubuntu 9.10

Just upgraded my laptop from Ubuntu 9.04 to 9.10. Here are some observations.
  • It came up with wireless working. I never had to plug in to ethernet.
  • My X display used to lock up if I left xscreensaver running for long periods. That seems to have cleared up.
  • In spite of MySQL being updated from 5.0 to 5.1, my MySQL databases survived untouched.
  • I was able to load my SlashEM saved game after the upgrade.
  • VMware Player initially didn't work but after I updated it from 2.5.2 to 3.0 it was fine.
  • Glxgears went from around 500 to around 1600 FPS. There's a noticeable performance improvement in some of the OpenGL screen savers in xscreensaver.
  • One disappointment, 'buoh' (application to retreive and display newpaper comic strips) is gone.
  • When I log in I get a pop-up saying that my hard drive is failing. There's a widget in the Gnome panel that says the drive has many bad sectors. When I click on it, it informs me that the drive has over 500,000 bad sectors. The disk seems to be working fine with no errors being reported in syslog. 'smartctl -H /dev/sda' says 'PASSED'.
  • Hibernate works. One time resuming from hibernate the display was so dim I could barely make it out, but I was able to correct with Fn-F10. Since then the display has come up at normal brightness.
  • I expected to have to reload libdvdcss since the upgrade disables medibuntu, but when I popped a DVD in the drive it started playing.

Thursday, November 5, 2009

Sunday, October 18, 2009

New hardware

A while back my system started crashing. It would just lose
power. I determined that the CPU was overheating by looking
at the temperature in the BIOS. I checked the CPU fan and it
was turning. I took a closer look and found that the fan was
wobbly. It needs to be securely attached to the CPU. There
are two little plastic posts on the motherboard which the fan
needs to snap on to and I found that one of them broke off. So
I started researching.

Goals: I want something that can keep up with DOOM 3 and
Quake 4 (Linux) at my monitor's maximum resolution (1680 X 1050).
My old card is an nVidia GeForce FX 5500. It's an AGP card with
256 MB RAM. I can bring up Quake 4 at 1680 X 1050 but it's like
a slide show. Best playable resolution is 800 X 600. My buddies
tell me AGP is the bottleneck... you need PCI Express for the
higher res games.

My old system has 2 GB of RAM which isn't quite cutting it
anymore. (Is Eclipse a pig these days or what?)
so I want more memory, but that is pretty easy
these days.

Generally I want to build a pretty high end system that will
have adequate performance (or be upgradeable to have adequate
performance) for some years to come, without spending for the
absolute top of the line latest-and-greatest.
  • GIGABYTE GA-MA790FXT-UD5P AMD 790FX AM3 Phenom II/Athlon X4/Athlon X3/Athlon X2 Socket AM3 5200 MT/s PC3-10600 (DDR3-1333) ATX Motherboard
  • AMD HDZ965FBGIBOX Black Edition 3.40 GHz 4000 MHz AM3 4 x 512KB Desktop Processor
  • HIS H487FN1GP Radeon HD 4870 1GB GDDR5 PCI Express x16 (2.0v) Video Card
  • OCZ OCZ3OB1600LV4GK 4GB PC3-12800 (DDR3-1600) Dual Channel Memory

I priced this on ZipZoomFly and Newegg and ZipZoomFly came
in about $5 lower.

Since Intel still has not apologized and made restitution for its
impertinent prosecution of Perl guru Randal Schwartz, my CPU choice remains AMD. Plus AMD just seems to offer better

Here are some of the articles that helped me reach this decision:

I was a bit surprised to see ATI graphics cards getting
these glowing reviews. The last time I researched a purchase
nVidia was the hot card and ATI was viewed as kind of an
also-ran. The HD 4870 is not the absolute hottest card
available but it is a Crossfire card and my
motherboard choice has a second PCI-E slot, so I can add
a second card if needed.

Memory-wise I'm getting 4 GB RAM plus two open slots, seems
like enough for the forseeable future.

I settled on the 790 FX chipset. I knew I was going to
buy a graphics card separately so it didn't make sense
to get something with an integrated graphics processor
like the 785. Of the four 790FX motherboards reviewed
in the article, only the GA-MA790FXT-UD5P had a legacy
parallel port allowing me to continue using my 15 year
old HP Laserjet 6, so I chose this one.

Monday, October 12, 2009

AppFuse, Grails and Rails

Matt Raible on AppFuse, Grails and Rails

I was actually googling 'appfuse grails' wondering if Grails used AppFuse internally.
The answer is 'no'.

JBoss web sites down again

Argh. I surf to the Drools documentation and get

You caught us doing a little maintenance. We're sorry
that you can't access your community right now. We
promise to be back up and running soon. Thank you
for your patience.

JBoss people, this is not OK.

Earlier this year I was doing something with Hibernate
and it was like this for weeks.

Tuesday, October 6, 2009


I posted some comments (scroll down to 10/6/2009) about the book
JBoss Drools Business Rules and its examples.

If you subscribe to Books 24X7, you can find this online here.

PS great book, I've spent a lot of time with it, just a couple of little
nits to pick.

Free Maven book

Maven, the Definitive Guide

A couple more days have gone by and I'm not constantly stuck waiting
for Maven to download plugins. I guess it has most of what it's going to
need by now. Here's what my repository looks like:

$ du -sk /home/lmulcahy/.m2/repository/
171408 /home/lmulcahy/.m2/repository/

Monday, October 5, 2009

Tapestry nostalgia

I just spent about 4 hours helping a co-worker debug a problem
in my 4 year old Tapestry 3.03 code. That was a cool framework.
Too bad it's kind of on the fringes today.

Friday, October 2, 2009


Lately I've had the Maven bug, but I'm starting to feel skeptical about
this design where you start out with only a small core and auto-download
plug-ins as needed. It's a regular occurrence that I try some new
command only to get stuck for 10 minutes waiting for it to download plug-ins.

Tuesday, September 29, 2009


Tool to auto-generate equals(), hashCode(), toString() and
compareTo() from within Eclipse.


Eclipse Galileo has this functionality in the Source menu, but when I
tried to use it, it got an error due to trying to call the super()
method of the abstract parent class.

Friday, September 25, 2009


I just discovered this tool AppFuse. You enter one command and it
creates a whole project skeleton for you. Rails and Grails can do
this but AppFuse can do more than one kind of project.

JBoss Drools

I've spent the last week immersing myself in JBoss Drools.
Superficially it's a lot like ILOG (now IBM) JRules, but
Drools has more of a sparse, lightweight feel with every
feature well thought out and well integrated.
By comparison ILOG was like this mountain of opaque
and inaccessible software.
Another advantage of Drools is it's opening doors
to other open source tools like Maven, GWT and
AppFuse, and of course all the other JBoss stuff.
I've also learned a few things about Eclipse I didn't know.
ILOG helped a little in this regard getting me
started with JSF but other than that it didn't really
take me anywhere.