Sun, 17 Aug 2008
Bath Walks - Kennet and Avon Canal Claverton to Bath
Another dreary wet Saturday yesterday. Since moving to Bath I have been going for walks in the surrounding countryside if it is fine at the weekends, but there have been very few fine weekends so far this summer. Perhaps it will make up for it with some fine weather in september, which is when I take most of my holiday (I would have taken more over the summer, if it were finer), but perhaps I'm falling into the gambler's fallacy there.
I have a load of pictures from my walks during last summer cluttering up my camera, so I may as well take the dreary weather as a chance to finally sort through them.
First up, this is the walk from Bathhampton Down to Claverton and then via the canal towpath to Bathhampton and back to Bath. This was my favourite walk last summer, as the section of canal in the Avon valley from Claverton to Bathampton is very pleasant. This section of the canal towpath also forms part of national cycle route 4, but although it's not a large path, there isn't a large volume of cyclists so it is not inconvenient for walkers.
I do not appear to have any pictures of the section up to Claverton down yet; I may add those later. For the first part of the walk (from central Bath where I live currently) I walk out along Great Pulteney Street and up Bathwick Hill, then walk along the road that passes the front of Bath Uni campus and past its playing fields.
Coming down the far side of Bathampton down, you pass through some woods and emerge into the countryside here. This shot is looking south-east just past the woods; the entrance to the American Museum is just to my left here.
At the end of the road is the hamlet of Claverton. The ridge to the east of Bath is called Bathampton Down at the north end, and Claverton Down further south, named after this hamlet. I assume the division between the two, assuming there is a definite division, is the road I have just walked down. Bath uni and the golf course and the prehistoric earthworks on Bathampton Down, whereas Claverton down is mostly playing fields and farms.
You can just see the end of the road here, where it meets the main road Bath to Bradford-on-Avon. The road down to the canal is about 100 meters left of this junction.
This is on the road just below Claverton headed down to the canal, looking across the valley.
And here is the canal; the bridge is to the towpath on the far side.
This is looking east again, from just to the right of the bridge in the previous shot. Just below the canal here is Claverton pumping station. For most of the length of the valley, the river Avon, the railway Bath to Bradford on Avon, and the canal are close together.
This is walking north along the towpath, looking across at Bathampton down, the east side of which is covered with Hengrove Wood The main road runs above the canal the for some way, but isn't intrusive.
There aren't many paths connecting with the towpath, sandwiched as it is by the canal and the river and railway.
The green and pleasant land at its best.
Looking west again, a bit further north. The east side of the National Trust Bath Skyline Walk is up the top of Bathampton Down, and passes through National Trust land Bushey Norwood which is just behind the woods up there.
Coming towards the north end of Bathampton Down now, and the valley now opens up on the other side. Bathford is just coming into view in the distance.
Looking east-south-east. I used to travel that stretch of railway every day when Netcraft was down in Bradford-on-Avon.
Bathford on the slope on the shoulder of the far side of the valley. The main Great Western railway line passes east-west just to the north of Bathford and Bathampton; the Bradford-on-Avon line joins it just north of here.
Now the canal swings west and passes under Bathampton; this is looking south now, at the north end of Bathampton Down with part of the village in view.
There is a less picturesque bit of canal west of Bathampton, as there are houses on the south bank and it's more suburban-wooded and quite blocked in by the railway main line just to the north. It opens up again once you are into the outskirts of bath, as the canal runs along a massive embankment from which there is a good view over to the georgian terraces of eastern Bath.
And this is looking along the embankment. It's not easy to tell from this picture, but Bathampton Down is still above on the left; presumably the embankment is there to give a big enough area to build the canal into the slope here.
The canal passes through/under Sydney Gardens, which is a small park to the back of the art museum.
And this is where I leave the canal; the towpath crosses the canal on the far side of that bridge, and connects with Sydney Road on the bridge.
Into the streets of bath: Sydney Place. Sydney Gardens on the right.
And back in Great Pulteney Street.
[12:08] | [/walks] | #
Sun, 06 May 2007
BBC in two minds about shared ownership
How to get on the housing ladder:
For example, the homebuyer raises the cash to buy 50% of the property and then pays rent on the remaining 50%. The benefits of shared ownership schemes are:
- For many this is the only way to achieve home-ownership
- You can buy a share as low as 25% or as high as 75% at the outset
…
Help for the elderly in mortgage trap:
Under the deal customers were able to borrow around a quarter of the value of their property.
But when they sell they must also pay back 75% of the increase in value, leaving many unable to buy a new home.
…
Well, if you only buy 25% of your house, you will only get 25% of the value when you sell it. Sounds quite fair to me.
So, in conclusion, the BBC thinks banks are evil for offering shared ownership schemes, and at the same time thinks they are a good idea. So that's clear then.
[19:04] | [/maths/economics] | #
Sat, 07 Apr 2007
Kye on OLPC
I have been offline for most of the past month, so I have only just got around to noting the news about Kye. This site has been getting quite a few hits due to being mentioned in the OLPC news: Kye has been ported to the OLPC.
Kye might well be a very appropriate game for the OLPC, in fact; it's an innocuous child-friendly game, simple to learn but, depending on the levels you play, can be very challenging. And it seems in keeping with the intent of the original Kye (where the registration money went to Save the Children).
Mind you, the laptop will have to have a durable mouse if it is to survive kids playing RUNNER :-).
Coincidentally, it appears that the port was done by Chris Ball, who used to work with me at Netcraft.
[11:38] | [/games/kye] | #
Don't Turn Off Your Wireless!
I ran into this bug on my Toshiba Tecra at work - if you turn off the wireless switch, the laptop randomely hangs about 50% of the time when booting up. I guess they forgot to test the wireless driver with the wireless turned off :-) .
[10:07] | [/computers/hardware] | #
Thu, 01 Mar 2007
Apache piped ErrorLog broken
I came across this frustrating little Apache bug today: if you configure your error log to be a pipe to an external command, the external process is not killed when doing a graceful restart of the server, so you end up with redundant processes building up (and holding old logfiles open), one per restart.
How it works is: let's say you have what appears to be a popular configuration these days, with:
ErrorLog "|/usr/sbin/cronolog /var/log/apache/error.%Y%m%d.log"
When you do a graceful restart, apache starts the new cronolog first, attaches this to its stderr (closing the handle to the old cronolog), then kills the old child process. But: the new cronolog inherits apache's original stderr, which points to the old cronolog. And instead of killing the old one, apache kills the immediate child process, which is a sh (because apache passes the ErrorLog command line to be interpreted by the shell); leaving the cronolog behind. So the old cronolog is not killed, and although apache closes the filehandle that it is reading from, the new cronolog process is still holding it open.
Once you have done a few graceful restarts, you will have a whole tree of cronolog's (or other external logging program). The first cronolog reads from the second cronolog's stderr, which is reading from the third cronolog's stderr, which is reading from … which is reading from apache's stderr. So if you kill the penultimate cronolog, the whole stack of stale processes unwinds (each cronolog exits when the last process writing to its stdin exits).
Given that cronolog has been popular for > 5 years, and apache itself ships with a similar rotatelogs script, I'm surprised this bug has lasted so long. I have tested that it occurs with Apache 1.3 on both FreeBSD and Linux. It appears to have been fixed only in October, so I guess only Apache 2.2 and up includes the fix?
But I seem to have a workaround:
ErrorLog "|exec /usr/sbin/cronolog /var/log/apache/error.%Y%m%d.log"
… a favourite trick of mine, for avoiding all those sh processes kicking around, which here happens also to make everything work: because there is now only one direct child process, so apache now kills the cronolog when it has completed its restart. Disclaimer: I have only tried this in my test setup so far.
There is just one hit on Google for "exec cronolog": and it seems related (but they haven't realised there is a problem with restarts). But it seems to me that all the sites recommending cronolog need to update to make this their suggested configuration.
[21:04] | [/computers/code] | #
Wed, 28 Feb 2007
Google webmaster tools
I'm not sure I have ever looked at Google's webmaster tools in depth before — not testing against my personal sites anyway. It appears that Google has just replaced yet another tool for me: it's easier to look at Google's trawl errors than to run my own link checker.
[23:21] | [/computers/web] | #
Sat, 10 Feb 2007
kye 0.9.3
More minor fixes in this release. The main fix here is for the wall auto-rounding option in the editor, which did not work correctly in 0.9.2. Also, the .desktop files in the RPM were not compliant with the most recent Linux desktop specification, so I have made some corrections to those. Apart from those 2 changes, the rest is minor code cleanups. Get it here.
A stable 1.0 release should be close (hmm, I think I said this before...).
[16:02] | [/games/kye] | #
Mon, 01 Jan 2007
Python Kye plugged by Linux Format
It is good to see that Python Kye is getting some attention; because I get precious little feedback about it. I never know how to read this - most feedback you get about open source projects is when someone finds a bug or wants something changed, so it can mean that it is "just working" for people; or it can mean that nobody managed to get it running.
Linux Format seem to like it though, as they gave a half-page write-up of Python Kye in their "HotPicks" section in issue 88 (Jan 2007). They seem to have understood the idea of Kye as a cross between Boulderdash and Sokoban, which is roughly how I characterised it for the description on Freshmeat.
I need to pick up the development again and get a version 1.0 released — I should be only two or three releases away from being able to declare it stable.
[15:21] | [/games/kye] | #
Linux on a Sony Vaio PCG-Z600HEK
Reposting this here, as it is was one of the pages in danger of being lost on my old demon webspace.
This is my (now rather old) write-up of installing Linux on one of the older Sony laptops at work. As I managed to install using the PCMCIA CD-ROM, and get the sound, pcmcia, floppy & software modem working, it may be of interest to someone. Food for TuxMobil & Google at least.
I don't have exact specs for the machine, as I wasn't involved in its
purchase and was just given it to use, no manuals etc. I only know the model
number from the sticker on the bottom :-).
Hardware
This model features an Intel PIII 800MHz, 256k cache and 256megs of
RAM. The screen is ~12inch and does 1024x768, driven by an ATI
Rage Mobility chipset. The hard drive in mine is a 20gig Toshiba MK2016GAP.
The unit has built in ethernet supplied by an eepro100, standard Intel
chipsets providing IDE and USB. lspci:
00:00.0 Host bridge: Intel Corporation 440BX/ZX - 82443BX/ZX Host bridge (rev 03)
00:01.0 PCI bridge: Intel Corporation 440BX/ZX - 82443BX/ZX AGP bridge (rev 03)
00:07.0 ISA bridge: Intel Corporation 82371AB PIIX4 ISA (rev 02)
00:07.1 IDE interface: Intel Corporation 82371AB PIIX4 IDE (rev 01)
00:07.2 USB Controller: Intel Corporation 82371AB PIIX4 USB (rev 01)
00:07.3 Bridge: Intel Corporation 82371AB PIIX4 ACPI (rev 03)
00:08.0 FireWire (IEEE 1394): Sony Corporation CXD3222 iLINK Controller (rev
02)00:09.0 Multimedia audio controller: Yamaha Corporation YMF-744B [DS-1S Audio Controller] (rev 02)
00:0a.0 Communication controller: CONEXANT: Unknown device 2443 (rev 01)
00:0b.0 Ethernet controller: Intel Corporation 82557 [Ethernet Pro 100] (rev
08)00:0c.0 CardBus bridge: Ricoh Co Ltd RL5c475 (rev 80)
01:00.0 VGA compatible controller: ATI Technologies Inc 3D Rage P/M Mobility AGP 2x (rev 64)
The laptop has no built-in floppy drive or CD-ROM; an external USB floppy
is provided instead, and an external CD-ROM which connects via a PCMCIA
card.
Installation
I have tried installing various distributions on here.
Redhat 7.3 went on very smoothly, and presumably so will newer versions.
It boots from the PCMCIA CD-ROM drive, and reads from it once booted with no
problems.
Mandrake 9.1 hung after booting.
Debian can be installed, but it takes a little more work. Specify this
kernel parameter "ide2=0x180,0x386" so that it can read from the
PCMCIA CD-ROM drive (as /dev/hde) once it is booted.
Configuration
Ethernet
The eepro100 driver in 2.2.x and 2.4.x worked for me, others I haven't
tried.
Touchpad
No idea, a colleague with a grudge against touchpads disabled the one on
mine using the machine's driver disk. Apparently it works just like a PS/2
mouse though.
Video
Using XFree86 3.3.6, I installed the Mach64 server, chose a high
frequency SVGA monitor
setting and faked some refresh rates, and it
worked fine. Did I mention I know nothing about laptops?
It works fine with the XFree86 v4.1 ATI driver as well.
fbcon works using the vgacon driver, although the boot logo colours get
messed up when at the end of the kernel startup. The vesafb driver also
works, and with vga=791 gives a very nice text resolution. The
mach64 framebuffer driver did not work straight off, the machine didn't
crash, but nothing on the screen except a few lines criss-crossing. I didn't
need fbcon for anything so I did not investigate further.
USB
There's a single USB port on the side of the machine. It works fine
loading the usb-uhci driver.
If you plug in a USB mouse, you should only need to load the
hid and mousedev modules, and set up gpm or X to
read from /dev/input/mice with input type PS2.
Floppy Drive
The USB floppy drive works fine with the USB Mass Storage Devices
(usb-storage) module (note: this option in the kernel
config is dependent on SCSI support, which took me a while to figure out).
Once you have usb-storage loaded, the device will be
automatically detected when it is inserted. It will be assigned a SCSI disk
device; it seems to show up as /dev/sdb on my machine. Edit your
/etc/fstab line for the floppy drive to point to
/dev/sdb; it should look something like this:
/dev/sdb /floppy auto defaults,user,noauto 0 0
PCMCIA
The single socket on this laptop worked once I loaded the
yenta_socket and ds kernel modules. With the
pcmcia-cs package auto-loading of drivers for PCMCIA cards and
setup of devices worked nicely.
On Debian I use the following in /etc/defaults/pcmcia:
PCMCIA='yes'
PCIC=yenta_socket
PCIC_OPTS=""
CORE_OPTS='unreset_limit=400'
CARDMGR_OPTS="-d"
(The unreset_limit I added to work around timeouts waiting
the the CD-ROM to spin up.)
CDROM
The CDROM supplied with the laptop connects via a PCMCIA card, so you need
the PCMCIA drivers and software above and the ide-cs module for
the CD itself. It will show up as /dev/hde, unless you have an
unusual setup; link it to /dev/cdrom.
APM
APM is disabled in the BIOS on mine (maybe win2k didn't like it, don't
know), and I use apm=on to enable it for Linux. Alternatively
you can load apm as a module. Battery status reads out OK.
Suspend with "apm -s" works. And it automatically powers down on shutdown
once apm is loaded/enabled.
Sound
The ymfpci driver supports the built in chipset.
Modem
Unlike some laptops in the Vaio range which come with PCMCIA
modems, the Z600HEK has a built in modem. It is a software modem (with a
Conexant chipset), so you will need a special driver, which can be obtained
from http://www.mbsi.ca/cnxtlindrv/hsf/.
Binary/RPM drivers are available. I went for the source .tar.gz, which
contains the source to a number of kernel modules which make up the driver,
and some utilities, primarily hsfconfig which compiles and installs the
modules for the running kernel, and adds the /dev/ttySHS0 device
with which the modem is accessed.
[15:21] | [/computers/linux] | #
Sat, 11 Nov 2006
Perl Best Practices

I read this a few weeks ago, and I think it is one of the most useful programming books that I have read in a while. Whereas most programming books are about how to get stuff done, this book is definitely about how to write code that someone else will be able to maintain afterwards. Perl has a reputation of being a fairly compact, fast-to-code language — and the resulting code looking like line noise and being opaque to the next person to look at it. So perhaps perl needs a book like this more than most.
I like how Conway is not afraid to give normative advice. He advocates, rather
than defends, a fixed set of standards for things like commenting,
indentation, variable naming conventions etc; he gets the balance right
between justifying his opinion in favour of certain conventions, and not
turning the book into a rehash of what can be endless debates between
programmers about the relative merits of, for example, tabs and spaces. Better
still, he comes down against the TMTOWTDI principle which seems to run through
so much of perl's design and use: he simply dismisses all sorts of syntax
features — like unless, and postfix modifiers — pointing out that
they add nothing to the expressive power of the language, and do add keyword
clutter and increase the risk of maintenance errors and oversights.
The book draws attention to lots of language features and important modules
that make code easier and clearer. The Scalar::Util and List::MoreUtils
modules, in particular, were a real find for me; many of the modules now
standard in perl 5.8 I had not seen written up before, so this was
particularly useful.
I couldn't agree with his chapter on regular expressions, though. This part of the book seems to be based on the assumption that regular expressions are hard, nobody understands them at sight, and so they should always be expanded out and commented in verbose and explicit ways. But why should we do this for regexes, but not for algebra? We don't expect people to write out algebraic expressions over multiple lines with extensive embedded comments, the + and - of maths speak for themselves without comments. I see regexes as being a similar compact language for text manipulation, and see no reason to treat them as obscure.
[16:53] | [/books] | #
Mon, 30 Oct 2006
HTTP Performance
This fascinating article about HTTP performance caught my eye on Slashdot today. It parallels the W3C paper about HTTP, keep-alives and pipelining that I used as a reference while working on zsync. zsync uses HTTP 1.1 with keep-alive and pipelining, and certainly has terrible performance without it.
The most interesting thing is how the whole article is really about problems
caused by not having pipelining enabled by default in web browsers.
The recommendation ‒ run 4 different hostnames, as a way of raising the browser based restriction (actually mandated by the HTTP RFC) on the number of connections in parallel to the same site from 2 to 8 ‒ is effectively saying that the system as-is is broken. The RFC limits to 2 connections at a time because there is a tragedy of the commons here: every individual user gains by opening as many parellel connections as they can, but this hurts overall network performance (HTTP keep-alives are designed specifically to avoid having one HTTP connection overhead per HTTP request). Having lots of connections reduces latency, but it creates a lot of TCP connection overhead on the network and for the server.
The article is up-front about the fact that the performance problems are all solved by enabling pipelining. The discussion of upstream bandwidth is interesting, and I hadn't considered the effect of asymmetric Internet connections in this light before. But the upstream bandwidth wouldn't affect the latency (except for the first request) if pipelining was used; zsync works fine on ADSL, because it uses pipelining to transmit the next request up while the current one is being received down. Upstream bandwidth could still affect latency, but far less than the effect the article shows for servers without pipelining; and making multiple connections would certainly do no better.
Since the owners of broken servers are free to disable HTTP 1.1 keep-alives, or just put a proxy in front, I second the idea of just turning on pipelining in the mainstream browsers. HTTP 1.1 already solved this problem. The only reason we aren't benefitting from the solution is that it is disabled due to broken servers; but they will never be fixed if the option is never turned on.
[20:59] | [/computers/zsync] | #
Mon, 23 Oct 2006
kye 0.9.2
This release is mostly about code cleanup. I think all the major code commenting & reorganisation that I have wanted to do is now complete, so I should have only minor changes to make before I make the first stable release. 1.0 is not far away now.
This release fixes some problems with the game recording feature. And I have rewritten the status bar, so that the hint text is now displayed in a tooltip if it is too long to fit in the normal display.
Available here.
[21:50] | [/games/kye] | #
Thu, 12 Oct 2006
Another package
Mattias Drochner wrote to let me know that NetBSD has had a package of Kye for some time.
[20:19] | [/games/kye] | #
Tue, 10 Oct 2006
Packaged
João Pinto has created an unofficial package of Kye suitable for Ubuntu 6.06, available here.
[20:10] | [/games/kye] | #
Sun, 08 Oct 2006
kye 0.9.1
This release does not contain much new from the user's point of view. I have been improving the error handling in several areas, so file and permissions errors should be less likely to result in a crashed interface; common problems like images.tar.gz being inaccessible should result in error messages in a dialog box now. The lack of other changes needed is partly due to getting little feedback, as you would expect for a pre-v1 version of a game few people know of, and there being few bugs to fix.
Internally, I have been doing a lot of cleaning up of the code: I learned python from a python-1.5 reference book that I bought from a remainders bookshop some years ago, so I have been using a lot of rather… old python idioms. So I have been doing a lot of code refactoring to make it a bit more modern and readable. There is still more to do here; on the bright side, given the lack of any other bugs, I should be ready to do a v1.0 when the code clean-up is done.
The new version is available from the python Kye page.
[14:55] | [/games/kye] | #
Maths A-Level 2006
Ever a person of habit, I decided to look at the numbers for maths A-level, as I have done in the previous 2 years.
There is a rise in numbers for 2006:

The government press release highlights this as the big success of the year, and declares that the trend has been reversed. Indeed this is true, as far as it goes: maths has risen as a percentage of A-levels back to the level of 2 years ago.

Of course, there is a lot of ground to cover before the damage of the previous trend is fully unwound:

The rise in the number of A grades has taken this to an almost absurd 43.5% of candidates. The number of A grades is up 20% in 5 years, against the decline in numbers taking the exam. One has to wonder if making the exam easier is doing more to encourage people to take the exam than any of the other measures taken.

Maths now has the highest percentage of A grades of any subject except for… further maths, and Irish (going by the available figures). Out of the major subjects (which I'm calling those with more than 10,000 entrants), the next highest A-rate is French at 36.2%. How long will they let maths continue to give such relatively high grades, I wonder.
(All figures for 2001 onwards taken from the JCQ press releases.)
(Previous discussion.)
[14:18] | [/maths] | #