[ Content | Sidebar ]

Archives for 2011

Tent

June 11th, 2011

Here’s one I assembled earlier:

I’m going on a camping trip in a few weeks. Sooo unprepared.

Filed in musings - Comments closed

Out and about

May 23rd, 2011

It was lovely and sunny this Saturday so it seemed like a good day to go for an adventure in the wild and barren lands of south Oxfordshire.

I walked from Henley on a rather roundabout route to Wallingford. Here’s the ruined church that’s appeared on this blog before. This time swamped by blooming flowers.

In the next picture you can see the structural defect that caused the church to be abandoned.

Much later on I came across another sea of flowers.

Sweden

May 7th, 2011

Sweden! That’s where I was last weekend. I had been in Uppsala the week before on a business trip so I stayed for a few days to do some sightseeing. Alas this did mean I missed the royal wedding, but as compensation I did get to blast things with a neutron beam.

On Saturday, after I was done working, I caught the train to Stockholm which took about 40 minutes. It was surprisingly cheap for Scandinavia, I think this might be a consequence of their deregulated rail system: there are multiple operators covering similar routes with incompatible tickets and so lots of competition. The downside is that actually buying a ticket is an extremely complicated and confusing process.

While I was wandering around Stockholm I came to the Royal Palace where there was some sort of ceremony going on. Luckily I decided to hang around and was only a few rows from the front when the king of Sweden appeared! I do believe this is the first royalty I’ve ever seen, and more than makes up for missing our own royal nuptials. Dazed by this encounter I wandered aimlessly around Stockholm old town and eventually caught a ferry to the island with all the museums on it. Olso had this too, it is truly excellent city planning.

On the museum island I went to the Vasa museum who’s main attraction is a 17th century warship dredged up from the bottom of the Baltic. It’s a lot like the Mary Rose museum in Portsmouth but the ship is in much better condition: apparently this is because the Baltic is a lot less salty than other seas. After that I went to Skansen which is something of a Swedish institution. It’s one of those outdoor museums where they bring old buildings from all over the country, reassemble them, and populate them with actors to show you what like was like in The Past. But it’s more than that: it had a zoo, gardens, and much more than I had time to see in the hour or two I was there.

Uppsala, where I was staying, is quite a nice, small university town but there’s not a whole lot to see once you’ve done the castle and the cathedral. Admittedly both are quite impressive though. Here are some photos I took on my travels:

Hastings Castle

April 25th, 2011

I was back home in Hastings for the Easter weekend. My mum and I visited that often overlooked Hastings attraction: the castle! Granted, it’s not the most extensive or complete castle in the country, but it is historically significant and, well, local. Most of it has fallen into the sea or was demolished by over-enthusiastic Victorians although there are a few interesting bits left. It was also ridiculously hot and sunny for April. Here are some pictures I took:

Royal fact-say

April 24th, 2011

It’s less than a week to go until the most anticipated day of the year: the wedding of Kate and Wills. A momentous day in the history of our nation. And look, even the humble pound shops are joining the celebrations!

Here at doof.me.uk we’re marking the occasion with a release of a special royal themed script for xcowsay: royal-fact-say! Install xcowsay, unzip the file, then run ./royal-fact-say and xcowsay will spout a random wedding factoid alongside an adorable picture of the happy couple. Enjoy!

Filed in xcowsay - Comments closed

Conky BBC weather

April 17th, 2011

I’ve written a Ruby script called bbc-weather.rb that parses the BBC weather RSS for a particular location and formats the data for conky. Here’s an example:

To use it insert the following in your .conkyrc:

${execpi 600 ruby /path/to/bbc-weather.rb 4197}

This will refresh every hour. Replace 4197 with the number of your local weather station. You can find this by looking at the BBC weather URL which is of the form weather/forecast/XXXX. You also need to define two colours for the script to use, in the options section before TEXT, like so:

color1 white
color2 grey

You might also need the following, as conky limits the about of text it will read from a sub-process:

text_buffer_size 2048

UPDATE: apparently this script no longer works with recent BBC Weather updates. Check out the comments for an improved version.

More or Less

April 10th, 2011

I love More or Less on Radio 4. I did squee so much when it came back for a new series. It isn’t easy to make statistics both fun and intelligible.

Also, I got horribly sunburnt yesterday :-(. But only on the top of my arms and face and not where my watch goes so is both daft and painful. Grr.

Also, I have a TrainGame-derived maths problem: let’s say I have a three-dimensional Bezier curve (X(t), Y(t), Z(t)) defined for 0 <= t <= 1. In my case this defines a track segment and works admirably for rendering the track. However it also determines the position of the train on the track at some time t. The problem is, with the train travelling at a constant speed, it appears to speed up or slow down depending where it is on the curve. It turns out that most of the time this doesn’t really matter, but sometimes it does.

What I would like is for the t parameter to be linearly related to the distance travelled along the curve; so if A is the arc length between two points A(0, s) = s * A(0, 1). Unfortunately, Bezier curves don’t possess this property and there’s not even a closed-form solution to A. So I’ve had to write this crude and slow approximation to such a curve given a normal Bezier curve as input:

http://git.nickg.me.uk/?p=traingame.git;a=blob;f=include/BezierCurve.hpp;#l84

It works by assuming that (X(s), Y(s), Z(s)) should be sL units along the curve, where L is the length of this track segment. It then approximates the curve by lots of little straight lines and moves t along the curve summing lengths until it reaches sL. Then we evaluate the curve at (X(t), Y(t), Z(t)).

So the question is, mathematicians of the interwebs, is there a better way to do this??

Extended Adventure Up North

April 2nd, 2011

I was away in Yorkshire last week visiting some northern acquaintances and going for a walk on the moors. I walked along the first part of the Cleveland way, from Helmsley to Kildale, and then got the train back to Middlesbrough and civilisation. Around 45 miles over three and a half days so not very far but it was hilly! I had planned to take a short cut on the final day and get the train at Battersby but the nice people on the farm where I was staying gave me a lift back to where I’d left the path the previous day so I was able to do the whole route. On the way home I was stranded for 40 minutes in Middlesbrough so I paid a visit to my favourite attraction: the transporter bridge! Somehow my memory of Middlesbrough was pleasanter than the reality.

Weather was good and bad on alternate days but it only rained on Saturday when I was walking from Hambleton to Osmotherley so it could have been worse. Also, I managed to get sunburnt on Sunday! In March! In Yorkshire! The photos I took are a mixed bunch, which is a shame because the scenery was pretty awesome, but here they are:

Officially Spring

March 20th, 2011

I declare yesterday to have been the sunniest day of the year thus far, and so was an excellent day to visit hitherto unexplored parts of Buckinghamshire. Here’s roughly where I went:

Saw lots of strange animals: a pheasant, a red kite, and a small red mammal that cannot be classified using the standard blodgett flowchart (best guess is a fox-carrot hybrid). Also stumbled across a ruined church which was a bit spooky. I later found out that it was once St James church abandoned in the 19th century. Here are some photos I took along the way:

Emacs commit message mode

March 12th, 2011

Here’s a really trivial Emacs major mode for editing Git and Mercurial commit messages: commit-msg-mode.el. It works in basically the same way as the Vim mode, highlighting the summary line, help text, etc.

To use it, put it on your load-path and add the following to your .emacs:

(autoload 'commit-msg-mode "commit-msg-mode"
  "Major mode for editing commit messages." t)
(add-to-list 'auto-mode-alist '("COMMIT_EDITMSG$" . commit-msg-mode))
(add-to-list 'auto-mode-alist '("hg-editor-.*$" . commit-msg-mode))

If you’re anything like me you’ll appreciate having your commit message spell-checked which you can do with:

(add-hook 'commit-msg-mode-hook
          (lambda ()
            (flyspell-mode t)))