FreeGuide fan mail

Really encouraged to receive this:

Hello Mr Balaam,

A quick email to thank you for giving the world the brilliant Freeguide.
(I saw in your blog that you have a high volume of email - no reply needed).

I tried Digiguide for a while, loved the principle, found the interface too cluttered. Went back to downloading pages from here and there, and dipping into the Radio Times timeline, which is not quite customisable enough.

I happen to live in a place where I get an unusual mix of channels - UK free satellite + UK terrestrial +Irish terrestrial. I'd never found a single listings service which covers the options.

Then, by chance, I found Freeguide, and I love it. I couldn't ask for more (except, perhaps, for customisable colours for program categories :-) ) Incidentally, one of your blog entries wondered how many painless installs there currently were. Here's one more to be counted (WIn2K, Sun Java v5Update6)

I don't know much about software, but I'm sure this must have taken a vast amount of your time. Thank you for every moment of it. This program will be useful every day, and I'll be passing it on at every chance I get.

Best wishes
Nick Nixon

Over-engineering gone mad

Picture the scene: you are writing a Java application and you’re trying to do things right, so you use the java.util.logging code to do your logging. To create a logger you do this:

Logger log = Logger.getLogger( "name" );

Everything goes fine until you want to set the logging level from a command-line argument. You set the logging level like so:

log.setLevel( lev );

Where lev is, e.g. Level.FINE.

When you run your program, none of your log messages appear except the ones that appeared before (SEVERE, WARNING, INFO). Nothing appears to have changed.

You read some API docs, and find out that each Logger has a list of handlers. So you call getHandlers() on your Logger.

It doesn’t have any.

You take a breath.

You read some more, muttering about Sun engineers having spent too much time at university, and find out that there is a hierarchy of Loggers containing other Loggers.

You simultaneously wonder how that could be useful, and whether some stupid thing is happening here to do with that.

You try log.getParent() and find that it is not null. Eureka! You’ve got it now:

log.getParent().setLevel( lev );

You hastily recompile, palms sweaty with finally cracking a problem that should not have taken this long.

Nothing has changed. You still don’t get your log messages.

OK, that’s fine: you know about handlers now, so it’s a simple change – we’ll do this instead:

log.getParent().getHandlers()[0].setLevel( lev );

You recompile, trying not to get your hopes up.

Nothing.

You consider re-writing your application (which has been in development over 5 years) in any other language. You decide to try one more thing before giving up. What if you need to tell both the Logger and the handler what level to use? It would be pretty awkward, but not outside the realms of possibility.

log.getParent().setLevel( lev );
log.getParent().getHandlers()[0].setLevel( lev );

Not even very hopeful now, you recompile.

Nothing.

This is the moment where you go and find anyone who will understand (or failing that anyone at all) and tell them about it. They wipe the spittle from their faces and appear keen to leave.

You will not be defeated by this. You try every combination you can think of. You start looking into how to log a bug with Sun. You curse and curse again.

A very long time later, you know you should have given up, and you’re trying things just out of bloody-mindedness, and you stumble across this:

log.setLevel( lev );
log.getParent().setLevel( lev );
log.getParent().getHandlers()[0].setLevel( lev );

Yes, that’s right. To set the log level of the default logger in Java you have to learn about handlers and the logger hierarchy, and you have to set the level in three places.

THREE PLACES.

You swear never to feel superior again when people start having “language wars” about which programming language is better. They are not all the same.

You engage in a relaxing pasttime, such travelling to Sun’s development centre and punching the person who “designed” that interface in the face.

Keyboard layout change in Ubuntu

I’ve had this problem a couple of times in my Ubuntu machine. I installed it with US keyboard layout, and then changed it to UK later (for my user). Even when I select the correct keyboard model (Generic 105-key (Intl) PC), and layout (United Kingdom International) some keys still act weirdly (e.g. pressing ” does nothing, and if I press it twice I get a strange “-like symbol). I fixed it by running:

sudo xmodmap /usr/share/xmodmap/xmodmap.uk

FreeGuide source layout (and SVN migration)

Christian and others have pointed out lots of problems with the source code layout in FreeGuide. The biggest problem is that each plugin has its own source tree which makes it very difficult to set up in an IDE like Eclipse. I knew it needed doing, and the other night I couldn’t sleep and I felt like making it happen. Since SVN is so much better than CVS for re-arranging source code (because you can move files and keep their history) and because sourceforge are now offering SVN, I decided the right thing to do would be to migrate to SVN before making the changes.

So far, I have managed to get all the source code to build from the command line (instructions here: freeguide-tv.sourceforge.net/dev/index.php/Build_from_SVN) and I’m working on making the Ant build work again, although there’s still a bit to do there.

My aim is for it to be extremely easy to start developing FreeGuide: just download or check out the source code, fire up your editor or IDE, compile and run. That means FreeGuide needs to handle loading plugins from either JARs or directories (without being told which to do), and it needs to know where to look for its lib and doc directories if they are not specified.

Soon, it will Just Work. Then hopefully this will encourage more developers to get involved.

Meanwhile I’ve decided if I want to build up some momentum I need to balance my limited time between code and email, instead of just fire-fighting the email all the time. Some individual users may not get their questions answered, which I hate, but in the end it would be worse if the project lost interest and faded away. I need to inject some excitement!

Letter to Linux Journal

Dear LJ,

I’d like to start by saying thank you very much for the years of quality articles and features that your magazine has provided. I eagerly await the arrival of each month’s copy as it jets over the Atlantic to my doorstep. LJ has always provided detailed and informative articles on topics both mainstream and more quirky, but always with the deeply technical edge no other magazine or web site I have found can provide.

I am writing because the April issue proved a grave disappointment. Gone were the technical articles and gone were the interesting projects. In their place I found a plethora of opinion pieces most of which provided no new insight into their subject that I could not have found on Slashdot or OSNews, along with some beginner’s articles on how to install a couple of PHP applications. Even the Doc had nothing interesting to say about the yesterday’s-news trying-to-be-trendy refrain of “blogs, wikis and podcasts” which seemed to be repeated several times on each page. The articles which did contain decent technical content (notably “Work the shell” and “Remote Temperature Monitoring with Linux”) were swamped beneath the river of fluff through which I found myself wading.

When Nicholas Petreley wrote his first uninformed and ill-judged “/etc/rant” I felt I could let it pass since it was just one page of an excellent magazine, but now that his style of writing – opinion rather then content – seems to be spreading to the rest of the magazine, I feel the need to express my disquiet at what he has been doing with this column.

/etc/rant is an article put aside each month for criticising free software projects. The fact that an editor would allow such an article to exist, let alone write it himself, displays a profound and worrying misunderstanding of the community to which he is trying to contribute. Free software projects live and breath through encouragement and just plain getting on with it. As a member of this community, the right way to express dissatisfaction with the way something is being done is to contribute to the project, or (if necessary) launch or encourage an equivalent project that does things differently. By criticising from the sidelines Mr. Petreley reveals himself to be an outsider – as a writer a more appropriate way to contribute to the community (and hence form a useful part of it) would be to praise and encourage projects which are doing the right thing, rather than sucking energy out of valuable and innovative projects which have involved large amounts of volunteer effort such as GCJ and Gnome.

I never thought I would say it, but if this continues I will be cancelling my subscription to LJ. Sadly, I don’t think I’ll ever find another magazine that will reach the level of quality I have come to expect from you.

Yours sincerely,

Andy Balaam