The Elegant Chaos Blog

Have a fantastic «fill in your festival of choice» everyone, and a Happy New Year if it is a new year for you!

And if you’re not celebrating, then enjoy the peace & quiet at work :)

more...

March 13, 2008

I’ve updated the Live Update widget slightly, to fix a bug which caused problems when the station being displayed doesn’t list the platform numbers.

I’m not sure quite why some stations don’t do this, but apparently they do!

more...

I’ve been fiddling around with Dashcode, and have created my first widget.

It displays live train update information for the UK train network, of the sort that you get on the live indicator boards on the platforms.

Dashcode itself is quite cool, except for its utterly infuriating habit of completely destroying and recreating the entire directory structure of your project all the time, thus rendering it utterly incompatible with Subversion.

sigh.

more...

November 08, 2007

One nice little bonus with XCode 3.0 (new with Leopard) is the inclusion of the xed command to invoke the xcode editor from the command line. It’s nice to be able to open an XCode window to edit files, and it’s particularly handy to be able to set P4EDITOR, SVN_EDITOR and other such environment variables to xed.

Something like this was possible before using open -b com.apple.Xcode, but the problem with that way of doing things is that you had to quit XCode afterwards to convince things like Perforce that your edits had been completed (perforce typically invokes the editor for you, then waits until you’ve finished editing a specification file before doing something with it).

The nice thing with the xed command is that it has a -w flag which does just what is needed in most cases - it sits in a loop spinning until XCode tells it that you have closed the file that it opened. This allows you to use XCode as your general text editor without it interfering with your normal work.

Nice touch…

more...

October 31, 2007

I think I’ve just found what seems to be a nasty bug in Drupal.

You can specify a page to display if a requested URL isn’t found. However, if you request a URL that starts with “/node/” this page doesn’t seem to be displayed - you just seem to end up back on the referring page, but with a seemingly new URL which is a product of the existing URL plus the requested URL.

Why is this bad? Because if you inadvertantly miss out the “http:” bit from a link and therefore create a local link instead of an external one, you can end up creating an infinitely recursive sequence of “pages” that link to each other. In reality they are all just the same page, but each URL for each one is different.

This isn’t an issue for humans, but it is for you if a dumb crawler stumbles across your site. It will just sit in a loop hammering the same page… forever. Nasty.

Needless to say I discovered this bug by making the mistake myself. And I only spotted it (a long time later) when looking through the logs wondering why on earth a page on my site was continuously being requested that contained the URL www.apple.com in the middle of it!

more...