Why bikes are “expensive”

I’ve come up quite frequently against people who are aghast that I paid £700 for a bike (or £3000 for a trike, but let’s not go into that) when you could get a second hand car for less that would do several thousand miles before needing an overhaul.

Alot of this you can put down to the TCO of the car vs the bike with the car needing MOTs, fuel etc, etc that will cost hundreds if not thousands. However, I recently had abit of a revelation.

I think my trike:


Is heavy at 18kg, but I recently got my old kart out of the garage for my son to have a play in.

I struggled to move the thing (without it’s engine). The chassis must have been close to 50kg. Fair enough, it has to put up with alot of lateral forces when cornering at 1.5g, but there’s no reason it should be so much heaver, apart from the fact that the thing doesn’t need to be powered by my legs and there’s a 140kg driver + kart (minimum) weight limit in the class.

To get that kart weighing 20kg, would have needed F1 components crafter from titanium and carbon fibre and the kart chassis would have cost more than the £700 I paid for it. In fact, car racing components tend to cost a ludicrous amount, like 10k for a set brake disks.

So, in conclusion, when I pay £700 for a bike, I’m getting a bargain, F1 spec technology in a super-lightweight package for the cost of 10 tanks of petrol.


The shortest trip to Wales ever

On a recent holiday at my parents in Winterbourne, near Bristol, I was all set to do a ride to discover the “mountains” at Wotton-under-Edge. However, there wasn’t time for a half day ride. I had happened on the fact that it was possible to cycle across the “old” Severn bridge, so I though what better to replace a long ride, than a ride to another country!

The details and stats of the journey are available here: http://connect.garmin.com/activity/118129908. Not sure what was going on with the altitude measures, because thankfully, the bridge is not 100ft below sea level. I like the fact that you can see the hump of the bridge on the way out and back.




Modify URL parameters using Javascript

I recently had a situation where I had an anchor tag with a long URL containing a lot of parameters. I wanted to change one and wanted a generic way I could do it without string parsing my life away.

After some web searching and modification, I came up with the following:

var URLMash = new function () {
// Takes a whole url as a parameter and returns an object with fields set to the key value pairs of the url parameters
    this.URLParamsToObject = function (url) {
        var vars = [], hash;
        var hashes = url.slice(url.indexOf('?') + 1).split('&');
        for (var i = 0; i < hashes.length; i++) {
            hash = hashes[i].split('=');
            vars[hash[0]] = hash[1];
        return vars;

    // Takes a javascript object and writes its fields as url parameters.
    this.ObjectToURLParams = function (obj) {
        var u = [];
        for (x in obj) {
            if (obj[x] instanceof Array) {
                u.push(x + "=" + encodeURI(obj[x].join(",")));
            } else if (obj[x] instanceof Object) {
            } else {
                u.push(x + "=" + encodeURI(obj[x]));
        return "?" + u.join("&");

Thank you to:http://jquery-howto.blogspot.com/2009/09/get-url-parameters-values-with-jquery.html and http://alexcline.net/2010/04/10/recursive-json-to-url-function/ for most of those.

I could then call this on the following anchor:

<a id=”reSearchLink” href=”/FileManagement/Search?page=1&isAscendingOrder=False&orderBy=ID&admin=True&searchUserOnly=False&searchImages=True&searchDocuments=True&tagFilterIds=-35″>Re-search</a>

and do the following Javascript wizardry:

var searchLnkParameters = URLMash.URLParamsToObject($('#reSearchLink').attr('href'));
searchLnkParameters.searchUserOnly = true;
var newParameters = URLMash.ObjectToURLParams(searchLnkParameters);
setActionLink('lnkFileReSearch', newParameters);

That’ll change the URL of the anchor to have “&searchUsersOnly=true”.

I’m cheating abit here by using “setActionLink” (yep .Net MVC) which grabs the first part of the URL and appends the parameters. The functions in URLMash could easily be changed to first store and restore “path” as a special case.

Happy coding.

A year of cycling 2010/11 – August to August

Another year of cycling is complete.

Some stats by cycle:

  • V3
    • Trips:2
    • Distance: 21.8 miles
  • Cruz
    • Trips: 3
    • Distance: 16.8 miles
  • Khatmandu (baby/boy lugger)
    • Trips: 123
    • Distance: 710.2 miles
  • Sirrus
    • Trips: 68
    • Distance: 765.7 miles
  • Brompton
    • Trips: 6
    • Distance: 35.8 miles
  • Total
    • Trips: 204
    • Distance 1571.8 miles
As expected, I user the Khatmandu the most for commuting, but use the Sirrus for long rides. £170 of petrol though.