2013 Track Days

By , December 14, 2013

Given the arrival of Jr in August my track time was rather limited this year but I still managed to do another level of CSS and a couple of lovely sunny days at Snetterton; one of my new favourite tracks.

The year started with CSS level 3 in the snow at Silverstone. God it was cold, but CSS is always great.
_PIC7532

Then the 675.cc track day at Snetterton at the beginning of May.
AJP_5611

And quickly back to Snetterton for another go at the end of May.
8K9U5749

I also finally managed to get my GoPro on track. Here’s a video from the 675.cc track day:

Calculating distance with Scala’s foldLeft

By , October 17, 2013

I wanted a way to calculate the total distance of a GPS track. A track is basically just a list of lat,long pairs – represented in Scala by the following:

One way to do this would be to iterate over the sequence, calculating the distance between points (using the haversine formula) and updating the sum in a variable but since this is Scala we can do it in a more functional way.

According to the Scaladoc, foldLeft “Applies a binary operator to a start value and all elements of this list, going left to right.” The signature looks like this for List[A] (a List of type A):

The first parameter z is of type B, so it can be different from the list type. The second parameter is a function that takes a B and an A (one of the list items) and produces a B.

The neat bit is this function iterates over the list and passes in each item to function f as the value of A. For the first item, z is passed in to f as the value of B. For each subsequent item the result of the previous call to f is used.

The usual example you will find is to sum a list of integers or something similar, like this:

This will return the sum of all the items items in a list.

My use-case was slightly different. My list consisted of tuples and I needed to apply a function to each pair of tuples in the list and accumulate the sum of those results. This meant I needed to keep track of both the current element and the previous one during the folding.

It was Matt Malone’s page of lots and lots of foldLeft examples that put me on the right track, specifically his example for Average which showed how to use a tuple as an accumulator. Here’s how I did it:

As I said, points is just a sequence of lat,long pairs, eg:

We first split the list into head and tail and use head and 0.0 as initial values. The folding function then produces a Tuple2[(Double, Double), Double]. The first item of the resultant tuple is the current list element and the second item is the sum of the current total and the result of the haversineDistance function (which itself takes as input the previous element and the current element).

The pattern matching is used to handle the case of an empty list.

Phew! This one line took me a while to figure out but it packs a lot of work into just a single line of code and shows how powerful Scala can be. Experimenting with the REPL was invaluable here.

For completeness, here’s the haversine function which calculates the distance between two points on the Earth (3958.761 is the mean radius of the Earth in miles):

MotoCal: Personalised motor racing calendars

By , March 2, 2013

IMG_9335I like just about any kind of motor sport. If it has wheels and an engine then I’m probably interested in watching it drive round in circles for a couple of hours. But there are a few race series I follow closely and try to watch on TV whenever I can: Formula One, MotoGP, Superbike.

Wouldn’t it be good, I thought, if I could subscribe to a single calendar feed that showed all the races I was interested in (and none of the ones I wasn’t).

So I built MotoCal.net.

I’ve put all the hard work into collecting all the qualifying and race times so you don’t have to. Just click on each race series you want in your calendar and it will generate a URL that you can stick into your calendar application (Google, Apple, Outlook) and you  will get  a synchronised calendar that is automatically kept up to date.

You can currently subscribe to any and all of the following:

It’s pretty easy to add more calendars so leave a comment if you would like to see any other series.

Things I can see from my window

By , December 15, 2012

It’s nice not living in a basement anymore. Living on the river means we get quite a good angle of view. Here’s some stuff I can see.

Lots Road Power Station

Not the four-stack one down the river but the two-chimney version that used to power the London Underground. In fact, Lots Road used to have four chimneys too  but by the late 70′s it had been reduced to two. Built in 1905, twenty-four years before Battersea Power Station, it was claimed to be the largest power station ever built with a capacity of 50,000 kW.

lots-road-power-station-1936

Stamford Bridge

Just peeking over the tops of the buildings is the home ground of Chelsea Football Club. Opened in 1877 it was first used for athletics until Chelsea took over in 1905.

Stamford_Bridge_-_West_Stand

Empress State Building

Built in 1961, this building is occupied by the Metropolitan Police Service. A building called the Empress Hall used to stand on the site. It has a private revolving bar at the top and in the evening it catches the setting sunlight on one of its three curved sides beautifully.

esb

Queen’s Tower

The 87 m tall Queen’s Tower is in the campus of Imperial College London at South Kensington. It is the sole remaining part of the Imperial Institute. When the Imperial Institute was demolished, Victorian architecture was not fashionable and the tower was only saved by a campaign led by John Betjeman. The tower houses ten bells donated in 1892 by Mrs Elizabeth M. Millar of Melbourne, Australia.

450px-Queen's_Tower

The Imperial Crown

Designed by Aston Webb, after winning a competition in 1891 to extend the museum, the tower above the main entrance to the Victoria and Albert Museum has an open crown topped by a statue of Fame. Webb wanted to “mark the character as a great national building.”

Natural History Museum

I love the architecture of this building by Alfred Waterhouse and I can just see the two towers that frame the entrance.

800px-Natural_History_Museum_London_Jan_2006

Crosby Hall

This is a strange building. According to Wikipedia: Part of the building’s architectural features are from the Great Hall, which is the only surviving part of the mansion of Crosby Hall, Bishopsgate which was built in 1466 by the wool merchant John Crosby. Crosby rented it to Richard Duke of Gloucester who used it as his London home. It was used as the setting for a scene in William Shakespeare’s Richard III. In the reign of Henry VIII it belonged to Antonio Bonvisi.

Following a fire in 1672 only the Great Hall and Parlour wing of the mansion survived, it then became a Presbyterian Meeting House and then a warehouse with an inserted floor.

In 1910 it was threatened with demolition and then moved brick by brick to its present site and the rest of the building by Walter Godfrey constructed around it. The move was paid for by the Bank of India who had purchased the Bishopsgate site to build offices. Godfrey also added the north wing in 1925-6 as a women’s university hall of residence.

crosby

Battersea Bridge

Not as flashy as Albert or Chelsea Bridge, Battersea Bridge used to be the last wooden bridge over the River Thames until the old bridge was demolished in 1885 and replaced by the current one designed by Sir Joseph Bazalgette. Despite it being the narrowest road bridge over the Thames, trams used to run over it until 1950 and due to it being on a bend in the river it is a hazard to navigation being subject to numerous collisions in its history.

Battersea_bridge_1

Winter Wonderland

Being Christmas, I can also see the Giant Observation Wheel and the Power Tower in Hyde Park.

IMG_0374

2012 Track Days

By , November 22, 2012

2012 was a pretty busy year for me!
Started off with CSS Level 1 in March:

css1

Then the forum trackday at Cadwell on a chilly April day:

cadwell-675.cc

Back to Silverstone for a damp CSS Level 2 in May (still waiting for the weather to warm up):

css2

Then Brands GP with TripleJimmy:

brandsgp

Unfortunately this also involved a little off-track excursion. :-(

brandscrash

No pics from Rockingham in July with buzz675 but Bedford in July I felt was my most successful day. Lovely and warm and also ran into Farebro doing his licence:

bedford

Back up to Cadwell in August (finally summer!):

cadwell2

And finished the season at Brands Indy:

brands-indy

Looking forward to finishing the CSS and another good year of track days in 2013!

Adelaide to Phillip Island (and back again)

By , November 17, 2012

A few weeks ago I went back to Oz and hired a bike in Adelaide to ride across to Phillip Island for the MotoGP. Unfortunately, unless I wanted a cruiser, Adelaide literally had a choice of one half-decent bike so I loaded up the Kriegas and headed off on the Yamaha FZ600 with Mark on his Aprilia.

We took the quick route across; heading straight down the Western Highway stopping off in Ararat for the night. It had been a while since I’d been that way. Man they build some long straight roads in Australia! I had also come down with some kind of man-flu so was feeling pretty rough and not in the best condition for a long distance ride. A lamington at Kaniva helped.

Next day, instead of going through Melbourne we dropped down to Geelong and caught the ferry over to the Mornington Peninsula. While waiting for the ferry we chatted to a guy who had ridden his Blackbird from Western Australia!

It was still another good couple of hours to the Island so it was getting late in the day when we arrived. The sky was also looking very threatening and we struggled with some epic winds but no rain so far!

This was the first time I’d been to Phillip Island and I have to say what a fantastic track! Such a beautiful location by the sea and it looks like it would be awesome to ride. It’s definitely one of the great circuits of the world. We had seats at Lukey Heights and so could see most of the track and also had a lovely backdrop of Bass Straight.

Unfortunately the weather was a bit rubbish. Bloody cold with the occasional shower most days but race day was alright. Stoner absolutely dominated the race and there was an Aussie on the podium for all three races so the home crowd was happy.

On the way back we took the Great Ocean Road. All I can say is wow! This really was epic! I wished I had my Daytona. Without doubt it’s one of the great biking roads of the world. It starts off snaking around the mountains by the sea. Really twisty with dramatic views and you can’t think it can get any better. But then at Apollo Bay it heads off into the Great Otway National Park with fast sweeping bends shooting through the forest. My God it was amazing. GoPro footage to come!

We stayed the night at Port Campbell which is near the 12 Apostles.

The next day it was back onto boring South Australian roads and the long straight slog back home. We made sure to stop at the Big Lobster though. :-)

More pictures from the race here.

Westbound commute 1

By , October 18, 2012

The public transport options for getting to work are so bad the pushbike is really the best option. I’m trying to find the best route.

This wasn’t too bad although the traffic is pretty nasty in the Farringdon St/Fleet St/Strand area and the shortcut from Clerkenwell Rd to Farringdon Rd didn’t really work because of all the Crossrail construction work. I think next time I’ll cut out the Strand and go via Charing Cross Rd.

  • Distance: 6.38 mi
  • Duration: 38 mins
  • Avg speed: 9.90 mph
 

GPXpress – a WordPress plugin for displaying GPS tracks

By , September 15, 2012

When I was in the Lake District the other week I tried out an iPhone app by Felix Lamouroux called Trails. It’s a really great app that you can use to record where you go on hiking trips, bike rides, etc. One cool feature of the app is the ability to export your tracks as a GPX file and I wanted to be able to show this on a map on my blog.

So this afternoon, with the help of Leaflet and Open MapQuest, I made a little WordPress plugin to do just that.

Here is the result; my walk round Wastwater:

 

To install the plugin:

  1. Download the ZIP file from GitHub and drop the contents in the wp-content/plugins/ directory of your WordPress installation.
  2. Activate the plugin from Plugins page.
  3. Go to the plugin settings page and choose the colour of your tracks. This may be any valid HTML colour code (default is ‘red’).

To add a map to a post:

  1. Insert the [gpxpress] shortcode into your post where you want to display the map. Use the ‘src’ parameter to specify the URL of the GPX track you want to display. Use the ‘width’ and ‘height’ parameters to give the width and height of the map in pixels (default is 600×400). Eg, [gpxpress src=http://www.example.com/my_file.gpx width=600 height=400].

You could also use my Garmin Communicator plugin to add a button that allows people to download your track directly to their Garmin device.

Endurance Racing

By , September 7, 2012

This weekend is the Le Mans 24 Heures Moto. I went last year and it was an incredible experience. I really want to go again but I’m not sure I’m ready for that campsite again just yet. I have heard there are slightly less mental campsites than where we were but being Le Mans everything’s relative.

I like this description from May 2012 Bike Magazine:

Only the deranged or chemically numbed actually enjoy camping at a French 24-hour motorcycle race, but that’s no reason not to eagerly sign up for the experience.

The Gauls have few rivals when it comes to organising a race-centric party. They think nothing of goading the Gendarmes to the point of distraction, then scarper when the paramilitary CRS goosestep on to the scene. If they’re not doing that they’re revving a brand new GSX-R1000 until its headers glow cherry red. This kind of idiocy is best viewed through beer goggles, but it’ll stay with you forever.

Then there’s the racing. If you don’t camp you’ll be itching to leave by 10pm to get back to the B&B before it’s too late and you’ll miss what makes 24-hour racing special. Camp and you can sit, like a gargoyle with a swollen bladder and pink eyes, mesmerised by the glowing discs ’til sunrise. You’ll get a good 43 minutes shut-eye before a 1988 VFR750 with no silencer is ragged around your chosen field. But you have to experience it once.

Here’s a few videos I took last time.

 

 

Coal Holes

By , July 29, 2012

From the Wiki:

A coal hole is a hatch in the pavement (sidewalk, in US usage) above an underground coal bunker. They are sometimes found outside houses that existed during the period when coal was widely used for domestic heating from the early 19th century to the middle 20th century. In Britain they became largely obsolete within the major cities of the UK when the Clean Air Act forced a move towards oil and gas for home heating.

The coal hole allowed the easy delivery of coal, generally in sacks and often from horse drawn carts, to the house’s coal bunker. The location of the coal hole on the street minimised the distance the sacks needed to be carried and meant that dusty sacks and delivery men did not need to enter the house.

I’ve lived in London for twelve years and never really noticed these small metal plates but now that I know what they are I see them everywhere.

Panorama Theme by Themocracy