elliot's blog

BookmarksToDelicious trundles on

I haven't edited this code in a while, but have released a new version (0.5) after someone requested my code be released under the LGPL, so they could use my Mozilla bookmark parser (in Python). So it's now all under the LGPL. All in all, it has been downloaded 500 times so far, so it's been useful by the looks of things.


Wondering what the music is in an advert? I do all the time.

Want to see Web 2.0 pilloried and mocked in a childish manner?

Need to write into NTFS partitions from Linux, but can't be arsed recompiling your kernel? It works, really it does.

Want to contact your MP? This year must be the year when I get some things off my chest (why haven't I got a wheely-bin, and as a consequence have rats under my shed? why does no one collect my bottles and cans for recycling?).

Many kinds of thing

I've been meaning to write some stuff down for a while, and have it all whirling around in my mind tank. This could be a bit random, so here goes:

  • Doing a bit of ego surfing, I found Afzal Upal's homepage, containing several papers which in turn reference my work. Nice to think that at least one person has made use of my Ph.D. research.
  • I decided I should make an effort to write down some of the things Madeleine currently says and does, as they are both fascinating and hilarious (I know I have very few readers, so it can't hurt for me to be indulgent). I know all children can do them, and we take it for granted, but watching it emerge in your own child is astonishing. I spent 4 years trying to coerce a computer into understanding very simplistic stories which weren't even in English (they were represented as trivial logical statements), and I got nowhere near; in two years, Madeleine can understand 100 times as much as any computer program yet devised:
    • She has taken to saying "Nice X, daddy/mummy". For example, the other night when I was giving her a bath, I leaned over and she said "Nice buttons, daddy". She said to Nicola the other day: "Nice hair, mummy".
    • When I go off to work, I normally call "Bye, honey" to Nicola. Madeleine thinks this is hilarious and has started copying me and calling it out as I go through the door.
    • She has started to work out the concept of time. When I ask her to get out of the bath, for example, she will sometimes say "One minute, daddy" while holding up her forefinger. She also says "Stay here moment" and "Play for a minute".
    • She has been potty training this week (doing very well with few accidents so far) and whenever she sees me on the toilet, she repeats my advice to her: "Hold on tight!".
    • She has worked out what "me" and "own" mean, and will say things like: "Play on own", "Me do it daddy", "Do it self". For a while, I would point at a photo of her and say "That's you", and when asked who it was, she would say "You". She's now realised that "you" and "me" have a semantics dependent on context (in fact, she's grasped the idea of what pronouns are, which is incredible).
    • She has started applying quantitative adjectives to nouns. For example, at the moment she says "Too much dark" when she goes to bed if we pull the door shut too far.
    • She is very adept at memorising nursery rhymes, and can recite "Mary, Mary, Quite Contrary" and "Pop Goes the Weasel". Not word perfect, but you can tell what they are.
    • She makes analogies between disassociated objects. For example, she has a water wheel in the bath, which one day all of a sudden she started rocking back and forth and singing "See Saw Marjorie Daw"; and she has a bowl with a picture of a wand, and made a connection with one of her favourite books, "Room on the Broom", which also features a wand. This transfer of concepts between domains is amazing.
    • She loves books, and her current favourites are "The Cat in the Hat", "The Cat in the Hat Comes Back", "The Gruffalo", "The Gruffalo's Child", "Room on the Broom", "Where's My Teddy?", and "The Hairy MacLary Omnibus".
  • My status in Ultracorps is slipping considerably, and I've lost my early momentum in the game. Never mind. I've started thinking about my own space strategy game.
  • I've got a paid account for Backpack now. This gives me neat to-do lists, "writeboards" (collaborative whiteboards), reminders, a limited amount of file upload space, and a few other bits and pieces. It's handy as an online notepad for scratching stuff on. Also it is a great example of the real potential and usefulness of AJAX for enabling web interfaces.
  • I've joined the development team for Instant Rails, as some of their aims overlap with those of ROROX. They are a really friendly bunch, and I'm looking forward to working with them. Their emphasis seems to be more on writing a Rails management environment for developers, while ROROX is pretty low tech and only for advanced users. I'm also interested in pursuing SCGI as a method for running Rails, which is what Instant Rails uses. They are also on the verge of moving to XAMPP (which I love) from EasyPHP, so they can go cross-platform (currently Instant Rails is Windows-only).
  • I dallied with a new work laptop over Christmas, the gorgeous little Sony VAIO TX1. It worked OK with Ubuntu "Breezy", but not brilliantly: suspend didn't work, it inexplicably refused to power off when I was at work, the keyboard was a bit small, the screen made me squint, I couldn't turn off mouse taps on the touchpad, the volume control buttons didn't work, etc.. The main thing it had going for it was that it was very light. However, I had a hardware failure last weekend, so on Monday and Tuesday I moved back to my IBM Thinkpad T42. This is a beautiful machine. The screen isn't at such a high resolution as the VAIO, but I can read it; the keyboard is the best of any laptop I've ever used; suspend works (!) - for the first time on any Linux laptop I've ever owned; and I can turn off touchpad taps. I don't think I'll be tempted away again.
  • Much of today and yesterday has been spent rewriting my PHP code examples and slides for my PHP/MySQL course (I'm doing a 4 day course in February). One thing I like to have is a set of code samples which incrementally grows, mirroring how we build it during the course: so I have the code as it exists at the end of each exercise. In the past, I've done this using copying, but this causes havoc if I change something in an early version and have to forward propagate it to later versions. I decided Subversion would be the solution: I would tag the code as I was developing it with the exercise number, so I would in effect have multiple copies, but should be able to do forward-propagation more easily.
    However, it turns out forward-propagating changes in Subversion from one copy to another is not trivial. Much of the last two days was spent working out how to do this. I also put together a Ruby script to encapsulate what I found out. So what happens now goes like this: let's say I have four exercises: ex1, ex2, ex3, and ex4. These are basically tagged snapshots of the codebase, where ex1 < ex2 < ex3 < ex4 (in terms of time); ex2 contains all of ex1, ex3 contains all of ex2, and ex4 contains all of ex3.
    If I change something in ex1, I want this to be reflected in ex2, ex3, and ex4 (i.e. I want to forward-propagate the changes to those snapshots). The procedure for this goes as follows:
    • Check out all the snapshots into a temporary directory; each snapshot ends up in a sub-directory with the same name as its tag (so I get ex1, ex2, ex3, ex4 directories).
    • Enter the ex1 directory and make edits.
    • Get the revision number of the working copy in ex1 (call it M).
    • Commit the changes to the ex1 tag in the repository.
    • Update my working copy ex1 from the repository (which is a new revision).
    • Get the revision number of the working copy in ex1 again (call it N).
    • For each working copy WC which is a later snapshot than ex1 (i.e. the snapshots in ex2, ex3, ex4):
      • Get the changes between M and N which occurred in ex1.
      • Apply those changes to the WC.
      • Commit WC back to the snapshot in the repository.
  • Sounds complicated, and it is. It is also a bit fragile, relying on a fixed directory structure and a particular naming scheme for directories and snapshots. But it does work, and will save me a lot of manual editing and breaking stuff. (By the way, as well as being great to work with in Rails, Ruby is a fantastic language for shell scripts - easily better than Bash, and better than Python.) I've attached my subversion change propagation script for reference below.

Telemarketer counter-script

This is really cool! I will definitely be printing a copy and using it on any unwanted phone callers.

ROROX version 0.2

I've got round to putting my ROROX (Ruby on Rails on XAMPP) project onto RubyForge. They can hopefully provide more bandwidth and exposure for it than I can on my puny blog. I notice a similar project (Instant Rails) has masses of traffic (17,000 downloads), so hopefully I can attract at least a fraction of that. I'm also going through the rigmarole of announcing it on Freshmeat, notifying the XAMPP people, and adding it the the XAMPP Add-Ons repository (phew!).

For this release, I've upgraded Switchtower, added lots of explanation, included the compilation scripts after tidying them up, and compiled Ruby with tcltklib (a small addition to the tarball size, but useful in that it provides a more full Ruby - I use it as my only Ruby interpreter on my development machine, so I need as much of it turned on as possible). I did toy with finding a way of doing two compilation methods (one with all my gunk compiled in, one stripped down) but it adds so little overhead I decided to just keep it simple.

Kevin Kelly on how music can be free

Interesting article about how freely-downloadable music doesn't have to mean the end of people making money from music. People will pay for convenience, personalisation, and value-added, difficult-to-copy extras, even if they won't pay for music. Open source is doing the same thing for software, and the industry is recognising and responding to the trend. The music industry should take a leaf from the software industry's book.


Today I have been testing Biscuit, yet another web application framework in the style of Rails. This one is fairly lightweight and written in PHP. I got off to a flying start, and found I could do a fair amount without too much trouble (e.g. pulling records from the database and rendering them as HTML). The trouble started when I tried to do inserts and updates: as the system is centred on PostgreSQL, and I was using MySQL, the insert and update queries didn't work correctly out of the box. I dug around in the code and found that despite using PEAR::DB as a database layer, manual SQL statement construction was still going on. I fixed and generalised this using the PEAR::DB autoExecute methods, which will take an array of field values, keyed by field names, and construct an insert or update statement. This got everything working (at least for MySQL).

However, the next problem occurred with validation. I could get it to sort of work, but displaying the error messages under the fields isn't straightforward. Despite using the supplied functions for this, I didn't get very far. And at this point I gave up.

It's a fairly good, neat little framework, but it feels a bit like a hobby project which isn't really designed to work across multiple databases (unlike Ruby on Rails, which does work). Plus there are some hard-coded bits and pieces in there which ought to have been generalised out more. Another missing feature is the ability to specify which field is used for the primary key: if you've got legacy tables without an field called id, you could be a bit buggered. It's this plus other niggles (like the lack of an implementation for <form> tags, no URL rewriting built in, etc.) which has driven me straight back to Rails.

I have looked at Cake before, which is more complex, but more satisfying to use. It feels more generic, and covers more of the functionality of Rails. However, using these two has made me aware how great the documentation is for Rails. Granted, it's not perfect, but it is very, very good. Compared to this, Biscuit has a sketchy tutorial, while Cake has some fairly good documentation (though frustratingly incomplete in places). Don't underestimate the importance of documentation when deciding which open source software to use: for me, it's the number one consideration. I'd rather have a sparse piece of software with excellent documentation than something all-singing and all-dancing which I can't comprehend. Plus of course Dave Thomas' Ruby on Rails book is superb.

Ultracorps - I am enjoying this!

I'm really enjoying playing Ultracorps, and so far it's going well. At the end of turn 3, this is where I am in the rankings (out of 393 players):

My rankings in Ultracorps

Not bad, eh? Sad too, though. Plus I haven't had to deal with any real baddies yet, or opposition players (i've stayed out of their way so far).

Boardgame geek

Back from a good Christmas. Notable highlights:

  • Madeleine worked out that Christmas was different from other days. She was highly excited by the stocking hanging on her bed, and stayed awake until 2.30 am on Christmas morning.
  • We spent Christmas at home (me, Nicola, Madeleine). On Boxing Day, Nicola's Uncle Ray visited with his wife Tina and their three teenage children. We spent a couple of nights at Nicola's sister Paula's house, with her husband Matthew and my nephew Henry. Madeleine loved it. Then had a couple of friends over for New Year's Eve. Quiet and relaxing.
  • I got several nice books, including The Naming of Names (about plant classification), Life in the Undergrowth (the book of the TV series - did you know some species of terrestrial scorpion can survive underwater for two days, and others can go without food for up to 12 months?); a couple of essential comedy books, Britain: What a State and How to Survive a Robot Uprising; the new Fall LP; DVDs of The League of Gentlemen series 3 and Extras; plus lots of other goodies.
  • At Paula's, my interest in board games was rekindled for the first time in many years. I used to love games when I was growing up. During my teens, most of my time was taken up with role-playing games (mainly Traveller, but also Call of Cthulu, Paranoia, Dungeons and Dragons), board games (Valley of the Four Winds, Kung Foo 2100, Quirks, the Judge Dredd board game, and lots of others), and war games (Warhammer, and my favourite, Car Wars). Anyway, we played a game called Carcassonne with Paula and Matthew, a simple but tactically-challenging tile game, where you have to claim territory as it is placed on the board. We bought our own copy later in the week from a nice little gaming shop in Altrincham, and I also bought Zombies!!!, a fast-paced, tongue-in-cheek board game which is a homage to zombie movies. You play a "shotgun guy" trying to cut a swathe through the zombies to reach the helipad. It nicely captures the claustrophobic feeling of an encroaching zombie horde and is recommended for a quick hour of mayhem.
  • My interest thusly rekindled, I found an online version of Carcassonne called Toulouse which you can play for free versus other people or computer players. They also have a version of the Settlers of Catan (the most popular game on Boardgame Geek) called Xplorers, which is pretty engrossing too. I also joined up to a trial game of Ultracorps, a massively-multiplayer, browser-based space conquest game. I was a big fan of Stars!, and a few years ago was desperate for the release of Stars! Supernova, which disappeared. So I was delighted to see Ultracorps turn up, which is pretty similar to Stars! (but far simpler). So far, it is pretty good (though the interface is a bit clunky and showing its age). I'm doing pretty well, and am ranked 14th for firepower at the moment (out of 393 players). Could be tempted to pay for a subscription. And what with Jono alerting me to Second Life, which is a fascinating, vast virtual world, I can see a lot of evenings playing games on the horizon.

As an aside, one game I really loved when I was growing up was Laserburn: an obscure, but really good miniatures gaming system set in the future, with highly detailed rules covering how laser weapons blind and maim opponents. The rules also had a good line in sardonic black humour. Any game where you can cut someone's arm off with a power sword has to be good. Nice to see that Tabletop Games, the originators of the game, are still in business, and Laserburn is still available for purchase (20 or so years after I bought my copy).

As another aside, how come Wikipedia can tell me more about the games I played when I was growing up than Games Workshop can (the company who supplied most of the decent board games in the 80s)? No sense of history, those people.

ROROX - useful to someone

ROROX (Ruby On Rails On XAMPP) is now available for download. It's a bit rough round the edges, but at least one person has already downloaded it and successfully installed it.

Note I've put it up under my new "commercial" name we are programmers. I've decided to put my previous name nooq to one side for now. I still kind of like it, but everyone I know thought it was too obscure and not obvious to spell. So I decided to go for the extremely direct approach instead. I also bought up flickrlilli.org.uk for FlickrLilli.

Syndicate content