Down at the WWA we're creating a new pond, which we hope will be a haven for dragonflies, amphibians and the like. This sort of endeavour clearly necessitates some fun toys, so we hired a JCB mini-digger. And I can report that it's great fun – I'm going to have to get one for the flat!

PondDigger 6348
The controls are numerous but relatively easy to get the hang of. The most counter-intuitive bit is that the left-hand joystick uses left/right to tilt the bucket itself.

Update: There is a new effort to create a decent Windows Ruby installer. You can get the new downloadable installers from http://rubyinstaller.org/ though as of August 2009 these are still in preview form. It seems from my brief experiment that you'll still have to set your PATH manually, as per my manual instructions below. This installer also promises a faster Ruby as it builds using superior tools, so might well be worthwhile if only for that. Below are my original manual instructions for installing Ruby on Windows, which should still be just as valid as they always were. The installer is probably worth a look though.

The following worked for me on Windows XP, but maybe I'm yet to run into problems I don't know I've got:

That got ruby working in a basic sense for me, but I wasn't able to install gems. If I tried, I got two errors in sequence: "The ordinal 277 could not be located in the dynamic link library SSLEAY32.dll" and "This application has failed to start because zlib.dll was not found."

The ssleay32.dll problem was solved by getting hold of a couple of DLLs and putting them in the right place, as follows:

  • Download "Win32 OpenSSL v0.9.8k Light" from http://www.slproweb.com/products/Win32OpenSSL.html.
  • Run the installer, but take note of the following:
  • You can ignore any initial warning about not having Microsoft Visual C++ 2008 Redistributables.
  • You can ignore any warnings about command prompts being open.
  • Install to somewhere like C:\OpenSSL – it doesn't really matter, we just need a couple of DLLs.
  • When prompted, choose to Copy OpenSSL DLLS to The OpenSSL binaries (/bin) directory.
  • Once the installer has completed, you can go to C:\OpenSSL\bin (or wherever you installed it) and copy the two files ssleay32.dll and libeay32.dll to your Ruby bin directory, C:\ruby191\bin in my case.

The zlib.dll problem was solved by in much the same way:

  • Download the compiled zlib 1.2.3 DLL from http://www.zlib.net/ (about two thirds of the way down the page).
  • Unzip it to get the zlib1.dll file.
  • Put that file in your Ruby bin directory, but rename it to zlib.dll

Et voila – gems can now be installed successfully! Note that you may have had copies of some of these DLLs in your \WINDOWS\system32 directory already (I certainly did) but the problem is that they are too old. I prefer to put the newer ones directly in the Ruby bin directory, so only Ruby picks them up and it can't break anything else on the system.

Rather mysteriously, my bluetooth mouse suddenly stopped responding with no warning. I assumed it was duff batteries, though I'd normally get a warning a good while before they conk out completely. Changed them, but still no dice. I attached a wired mouse and did some digging – basically Bluetooth no longer seemed to exist on my Mac! The menubar widget claimed bluetooth was 'not available' and the System Preferences Panel said similar. Restarting didn't help – in fact it made the menubar widget and System Preferences Panel disappear entirely!

After a bit of digging on the web, what worked for me was to reset PRAM. Shutdown computer, then start it up whilst holding down cmd-option-P-R until it chimes a second time. Actually I held down until a third chime for good luck. Seems to have done the trick!

Update: It then failed again shortly afterwards. Next move was to delete a critical prefs file. Best not to do this unless you have a clue what it means:
  • sudo mv /var/root/Library/Preferences/blued.plist ~/Desktop/

At the same time I shutdown the computer, removed all attached cables, opened it up and pressed the PMU/SMC reset button down near the RAM (this is a PowerMac G5 tower) then restarted. It seems to be OK for now. It did mean the clock resetting to 1970 and me having to wait for all my iCal notifications to stream in once I'd reset to 2009.

Update 2: And it's gone again. Maybe it'll never be back. I swear if Apple sold some sort of mid-tower machine – somewhere between an iMac (but without a screen) and the Mac Pro, I'd buy one without a second's hesitation. I've been waiting for years for this machine, on the assumption that it's an obvious hole in their line-up and will be along any moment, but I've been hideously disappointed.

Update 3: It seems that if I shutdown the computer rather than simply restarting, my bluetooth comes back to life. At the moment it's been fine for all of today, but it might flake out on me at a moment's notice for all I know.

Update 4: Correction – resetting PRAM by holding down cmd-opt-P-R until you hear a second chime is vital. Simply shutting down and restarting does not seem to do it. At the moment I sometimes get a few days of successful use between failures.

I've been experimenting with Ruby 1.9.1 and trying to make it my natural home recently. Crucial to that was getting the mysql gem installed. Actually it's fairly straightforward with the 2.8.1 version of the gem and only very minor mods to the official instructions at http://www.tmtm.org/en/mysql/ruby/ were required.

Note that I have only tried this to work against MySQL 5.0.x, which I have installed in /usr/local/mysql, as all my previous attempts to use MySQL 5.1 have failed miserably and I've given up on that for now. These instructions install from source, resulting in a fresh /usr/local/ruby191/lib/ruby/site_ruby/1.9.1/mysql.bundle. Then you can simply require 'mysql' in your Ruby code and you're away.

  • Downloaded 2.8.1 source tgz from RubyForge, linked from http://www.tmtm.org/en/mysql/ruby/ downloads section.
  • Expanded the tgz with Finder, then opened a command prompt…
  • > cd mysql-ruby-2.8.1
  • > ruby extconf.rb –with-mysql-config=/usr/local/mysql/bin/mysql_config -with-mysql-dir=/usr/local/mysql
  • > make
  • > sudo make install
Et voila! Note that make did output a bunch of warnings about implicit 64/32 bit conversion that suggests the code isn't entirely 64 bit happy, but I've not observed any problems as a result. Yet.

First off, a pair of great diving beetles apparently mating. You can really see the difference between the male and the female – having completely different wing cases. These were on the surface of the pond in the Italian garden of The Lost Gardens of Heligan in Cornwall. I've never seen great diving beetles for real before so I was thrilled to see these. They are really quite big.

DivingBeetles 6318
In another pond at Heligan, here's what I think is a toad, though it's hard to be sure. I think that the relatively warty skin and chunky build make it more toad-like. The original photo was really low contrast so I've zapped it way up and made it nearly monochrome for a slightly eery effect.
Toad 6319
Finally, a Treecreeper, hopping its way up a tree quite high up and pushing my 400mm lens to its limits (this is a tight crop as it is). I'm disappointed I never got a better angle of it, but it was always moving or somehow obscured. I'm still quite chuffed as this is my first Treecreeper sighting and I was explicitly looking out for them at the time. This was on the RSPB reserve at West Sedgemoor in the woods.
Treecreeper 6320

I advise every programmer out there to read lots of other people’s code. Pick an open source project that you’re a fan of (and perhaps use every day), download the source and then sit and try and figure out how it works. You may find the following things:

  • It’s interesting to see how other people write code, from their specific syntactic style to the level of commenting, overall design and code layout, common idioms etc. You’ll probably learn something – either good things that you can copy, or bad things that are tough to read and warn you off doing the same.
  • You may find the code frustrating and difficult to figure out, not only initially but no matter who long you work through it, though if that’s the case then it’s probably poor code. Hopefully that will influence how you write your own code, for the better. 
  • If it is a product that you use regularly, you may gain insights into what it’s really doing and how, that empower you to use it more effectively. You may even be able to modify it to make some improvement that matters to you.
  • Once you’ve got past the initial difficulty and started to understand things, you acquire a sense of power. No longer are these complicated pieces of software opaque and mysterious. They can be broken down, understood and messed with. A whole world of possibilities opens up and you no longer need to be afraid. 

I’ve recently been reading the Ruby source code of Innate – the new underpinnings of next generation Ramaze, a Ruby web app framework that I particularly enjoy using. Innate is built on top of Rack, so I’ve been reading that too. The mystery is ebbing away and it’s making me more powerful. Stand back! :-)

It's easy to just pull out the big non-stick half-wok half-frying pan thing for most meals that involve frying anything (especially if you're going to add liquid later as its high sides mean a good overall capacity), but it's not always best. A good stainless steel thick-bottomed frying pan has some important qualities that you're missing out on. In particular you'll be missing out on building a layer of tasty brown fried-on stuff as you do your onions and meat, which you can then de-glaze into the sauce as you add liquid. In a non-stick pan that just doesn't really happen.

We got a great deal on a set of Prestige stainless steel cookware a couple of years back and it's been a real eye opener. My biggest worry was that it would be a complete pain to wash up, but this really isn't the case at all. Generally things don't stick much anyway, and a short soak soon sorts out even the worst offence. And they look dead professional :-)

21. March 2009 · 1 comment · Categories: Travel
I was overjoyed to see the new March 22nd First Capital Connect Thameslink timetable, which seems to have a straight flush of 8 car trains from St Albans into London in the morning rush hour! There are also more 8 car trains coming back out in the evening than there were, but they don't seem to have managed to cover all services.

That would have been it for this post, but my wife told me that she'd had a letter from FCC saying that the new trains required to do this are actually four months late (cue obvious jokes) and so we'll be lucky to actually see this working out in reality. Either that or they will try to manage it with yet more borrowed stock from Southern, but cunningly setup such that the first minor problem wrecks everything through lack of contingency capacity. Brilliant.

I still find it highly amusing that there's all this talk of 12 car trains when they still can't run anything better than 4 car trains for many rush hour services. Let's get to 8 first!

Incidentally, is there an even more disgruntled commuter somewhere in the deep South wondering why they now have 1 car trains, by virtue of all Southern's stock having been sent to FCC? Or did they just have all these trains sat in a shed waiting for their calling?!