Archive for April, 2004

Handling dependencies

Monday, April 12th, 2004

Something which has paid off for me a couple of times so far, though only on individual projects and not on corporate team work projects where issues like never getting to refactor could come into play:

When starting a new project, let the dependencies run wild. Include Commons Lang because you’re too long-term-lazy to c+p yet another simple function in. Include log4j because you don’t want to be JDK 1.4 dependent. Basically, be chaotic.

Following the initial release, over which some will grumble about dependencies, have a crack-down on those dependencies when you find yourself next working on the code. There seem to be four ways of removing a dependency;

1) Remove the functionality. For example, throw out regular expression support.

2) Increase platform dependency. This is cheating basically, but utterly legal. Move from JDK 1.2 support to 1.4. A simple way to remove a log4j or jakarta-oro dependency.

3) Inline the code. I find myself doing this quite a lot when I depend on my genjava-core utils or Commons Lang/IO/Collections etc. Often it’s just the one method. An important thing to do in this case is make a note that it’s inlined so that later on in life the code may decide to regain the dependency due to the number of inlined methods.

4) Optional functionality. Make it a compile-time dependency, but allow the user to ignore that jar and still get the basic functionality. This one is the nicest one, but a bit of a pig for the user who wants the extra functionality. Must be clearly documented. Possibly you could write something dynamic to print out an error message frmo your library instead of the Java interpreter.

A fifth might be to create a common facade, ie) commons-logging, but this is really increasing your dependency list by trying to be tidier.

Java Creator faster download

Sunday, April 11th, 2004

Just in case people are having pain with trying to download the Windows version of Sun’s new Java Creator release; the Linux version downloads much much faster. No idea why. Maybe different machines and the Windows version’s machine has a lot more downloads hitting it.

I’ve not beyond a Meg on the Windows one yet, but the Linux version downloaded all 180 megs or whatever in 5 minutes or so.

cvs2cl.pl in SVN??

Saturday, April 10th, 2004

One of my favourite scripts is the csv2cl script which creates a nice big description of everything that has changed in a cvs directory (and its children).

I probably use this 5 times a day, whenever I wonder what’s been going on on a project since the last release. While it has no concept of a release, I can at least see my post-release commit in which I always change the version in the maven project.xml to the next bugfix and know when a release happened.

I have no clue how to do this in SVN. The one way I’d expect to do it is ’svn -R log’, which would run the log on every file, but that fails as it prints an error message about not being a recursive command. I did discover a gnuify-changelog.pl script in the tools/dev directory of the source, but that’s a transformation for the svn log output, which doesn’t help if I can’t output the information I want.

I can run svn log on every file, but then needs to be sorted into chronological order and include the file name etc. Must be a better way. Anyone know? username: bayard domain: generationjava.com

Slightly OT, It’s frustrating that instead of the repository system learning what a release meant, the concept of a tag is now genericized to a sym-link. Very generic, but I’m hoping for someone to use SVN as the basis for an SCM.

VMWare fun

Saturday, April 10th, 2004

Been having some fun with VMWare, though not all that successfully.

It took only 2 tries to get SuSE happily running as a Guest on my XP laptop [the powerbook is now sulking]. There’s some oddness you have to do with X. VMWare claim you should install SuSE without the X server, but as this does not seem to work well with SuSE 8.2, I installed the whole thing, init’d down to runlevel 3 and ran the VMWare Tools ‘CD’ to install their X server.

Not that it matters. I’m running SuSE in 800×600 as the host OS can only manage 1024×768 on this laptop [Dell Inspiron 4150, Windows XP Pro].

One oddity. The keyboard seemed to be configured to be german. Quick hack of XF86Config fixed that. Since then, I’ve found another oddity. Shift-backspace restarts X. I keep doing this. It’s not funny. The only thing I can find out is that this can be due to a bad keyboard mapping. US-104 however seems to be the right one, so I can only guess this is a VMWare thing.

Since then, I’ve tried to install BeOS 5-PE under the SuSE Linux, FreeDOS, Solaris x86, ReactOS, MenuetOS and FreeBSD with no luck. It doesn’t help that I have no floppy drive in this laptop, so am making ample use of the virtual floppy facility, though I don’t think I can change floppies without restarting. MenuetOS is the only one I got to run, but the graphics driver was borked.

With the SuSE install, I’ve had no obvious luck with the copy+paste between machines and I’ve not managed to perform drag and drop either. I suspect this is all between Windows or something.

The mouse is quite interesting. Most of the time when it hits the edge of the guest screen it will switch to the host machine, but sometimes it seems to be stuck within the guest machine. No big problem as ‘ctrl-shift’ backs you out, but a bit odd.

I’m still not convinced. It’s a nice toy, and I’d love to have both OSes running at the same time, but it feels clunky. I’m going to see if I can start SMB so the XP box thinks it has a constant buddy, and see if I can put the laptop to sleep without confusing the Linux guest. If they work seamlessly, I can see a chance for vmware giving the Inspiron the clout to kick the Powerbook out of my laptop bag.

Neither XP or Linux can overwhelm OS X, even with their superior Java skills, but together I think they can do it.

6 years, and I've learned?

Wednesday, April 7th, 2004

I can’t believe I just made the same mistake I made on my very first Linux
installation :)

I used Partition Magic [back then it was v1, now it’s 5 or something] to
blow away the Linux partition [gonna use VMWare] and didn’t restore the
master boot record first. Back then it was a SuSE 4(?) dual boot with Win 95. Now it’s SuSE 8.2 with XP. It might also have been whatever Red Hat existed at the same time. I know I played with both until SuSE won me over by simple virtue of having the X server work first.

Things are improved however. GRUB gives me a console to show me what an
idiot I am. LILO used to just hang at LI. Better however is that Windows
XP has a recovery mode on their disk, and I can hopefully type ‘FIXMBR’
and the old [now expanded to its original size] XP can take over.

It seems to have worked, though Partition Magic had a few errors attempting to resize the hard drive. I repeated this, and it didn”t even have to reboot this time, possibly the problem is that PM tries to do all the tasks while it’s rebooting and can’t do them all there.

Anyway. 6 years, and while I’ve not learned any better, Windows and Linux [in the form of GRUB] have.

Taxes done

Sunday, April 4th, 2004

Taxes done for another year.

A long battle with minutae to find out whether the US governments or I owe each other a pittance.

Apart from general brain-wrackings over how to handle Carrie’s new knitware company, which is an LLC, the main lesson learnt was that last years state tax refund is taxable as income, but only on the federal tax income.

Yet again, filing the state tax separately on a combined return turns out to be the best approach, and the reality is that the state of KY is paying the US government a small amount via me. The most amusing part is Carrie’s OL-3, in which Jefferson county will receive all of 32 cents.

Baby time…

Friday, April 2nd, 2004

One piece of news I get to happily tell people from now on is that my wife and I are expecting our first child. It’s due in October sometime and we’re both looking forward to it with a sense of fear and joy.

Due to my wife’s blood clot 18 months ago, she’ll have to inject herself with blood thinners every day, which helps to increase worries and apprehension, but at this point we seem to have a 2 month old foetus happily growing day by day.

Pergamum changes..

Friday, April 2nd, 2004

It’s somewhere to mention it, so I will.

I’ve added RSS feeds to the front page. Unsure how well it will work, I’m clueless.

I’ve also added more content etc. The trick from now on will be to keep it up to date as a part of my very periodic wanderings of publisher sites etc.