elliot's blog


Amazon Mechanical Turk is a kind of artificial artificial intelligence (sic). Basically, if you are a software developer, you can write code into your program which will submit tasks to the Mechanical Turk website. The tasks get added to a list, from which humans registered with the site can choose. The humans complete the tasks online (the samples they have currently are all US-based and ask opinions on traffic, restaurants, etc. in US cities), and the Mechanical Turk makes the results available to the program which initally set the task. The program presumably has to poll the API periodically to find out if the task has been completed, and picks up the human-generated results when they are ready. These results are then incorporated into the program's inner workings. Interesting. Mad, but interesting. There's got to be some potential in there somewhere...

Selling frenzy

Must get rid of all stuff. Must sell things. So can buy more things. Even found myself thinking tonight (after watching a marvellous documentary where Richard Dawkins basically laid into loads of religious types and told them they were abusing children with their religious lies), I'm unlikely to read Climbing Mount Improbable again, good as it was: sell the bastard, while the public's interest is piqued. Sold on Amazon within about an hour. See that, that's complementary marketing. Put a load of CDs up there as well. GreenMetropolis has also raised a few sales, and is good for stuff which is ubiquitous on Amazon. Although I did stop myself when I was slavering with greed, prowling round the living room for prey to sell, and said enough's enough.

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).

Syndicate content