Saturday, 14 November 2009

Hiding in the attic

I'm hiding in the attic at the moment. I'm not cool with other people. Any of them. Which is really fricking weird, because almost everyone I know is at least a bit lovely. I know that. But I'm still hiding in the attic.

I'll get over it in a bit, I guess, it's really not that much of a big deal - but earlier today, in the middle of the village I live in, I nearly got into a fight in the street. It's so weird. More than a little my own fault, I guess: Two youths were walking along the street, and one of them said something along the lines of "alright, ginger" to me, and barged me for no good reason. I can't remember what I said exactly, but something along the lines of "what the hell was that for?".

All a bit of a blur after that, but I end up standing with some scrawny teenager doing the aggressive talk thing about me in some way "acting like the big man, innit"so close to my face that the tips of our noses touched. I guess I was supposed to back off at this point, but I'm strangely not that bothered by the proximity thing (I guess years of jitsu took care of that) so despite being properly freaked out, the only thing not really bothering me is how close he is.

I'm having trouble at this point understanding what the hell he's saying between the "innit"s - seriously, it was probably English but I have no idea what he was saying. I think he wanted me to start a fight with him or something, or he was threatening to beat me up, or... something. In broad daylight. In the middle of the village. What the fuck. What. The. Fuck.

So aside from "what the fuck?" I don't really know what to say to him... I'm certainly not going to hit him unless he attacks me, mostly because I'm a wuss and partly because I'm enough of a wuss that if I *do* have to hit him I'm not going to dick around playing nice; I'll be going for his eyes, windpipe, groin and (given the opportunity) stomping on his knees. Which is going to get me in Deep Shit. And I just went out for a walk on a Saturday, and my brain is swimming in What The Fuck??? and I'm having flashbacks to school, and on top of that I can't get over the incongruity of the situation, that someone so much smaller than me is trying to get into a fight with me, and they're treating me like I'm someone to be bullied in the playground...

So I gave him a hug. Prizes to anyone who can figure out what on earth possessed me there.

Strangely, this didn't effortlessly defuse the situation. It did seem to freak him out, and then piss him off even more (so now there were accusations of both gayness and molestation hidden in the mostly unintelligible stream of noise coming out of his face-hole). Back to another round of him mouthing off and me, basically, saying "what the fuck??" over and over. I think this, combined with my squeaky terrified/exasperated voice, may have blown my chances of intimidating him into going away. Eventually he plain came out and demanded that I hit him if I was, indeed, such a big man. I pointed out that of course I'm not going to hit him. I think that was taken as a submission, because he started to proceed Fucking Off To Buy Booze at this point, slowly, shouting threats at me still while I (positively drunk with confusion now) told him that he was welcome to hit me, but I wouldn't be hitting him back (this bit would be a lie; I don't know that I'd have gone apeshit had he hit me, but I don't know that I wouldn't either). I suspect perhaps the evil bit of my subconscious had, at this point, noticed the CCTV camera pointed at us and wanted to give him every opportunity to get nicked.

So then I went home, a bit shaken up. Just a bit, so I thought. Except I now don't want to see any people again ever and would prefer to live my life sitting here at the keyboard and never go out. This is not the response of a sane and rational mind. Now it's out in words, though, I feel considerably better. I suppose writing about things really does help.

...That plus I totally gave his description to the police. Little bastard.

Thursday, 8 October 2009

Follow me!

Despite my often-stated Not Knowing What I'm Doing, sometimes friends are around who want to play on bikes and there's no-one with The Know kicking around to assume a position of authority and show us where to go. Since I live here, naturally I'm the fallback leader in such situations (and I hope the idea of me leading a ride even of only two people amuses you as much as it amuses me). I have to say, I think that due to lack of planning on my part I can't really call the two expeditions I have under my belt complete successes, but I think there was more success than fail.

The first one was with Ian (hi, Ian!) who got the train over to Oxford a couple of weekends ago. I managed to start this one pretty badly by being late to the station. D'oh. Apologies out of the way, I made some more apologies pretty quickly: I hadn't found the time to ride all (or even most) of the route before, and some of it was a complete guess as to whether it was rideable or not. There were definitely rideable and fun bits in there that I'd been to with the club, but there were also some sketchy paths that were marked but for all I knew could be ploughed fields. Plan B was to take roads to the bits I was more confident about being both rideable and easily findable. But Ian was cool with exploring and, hey, we had all afternoon. We set off up the Thames path in search of a pub to get some lunch from. The Thames path runs from pretty much round the back of Oxford station to the edge of the village, and while it's flat (being a path next to the Thames what else would you expect?) it's still more enjoyable than riding along the road. The weather was glorious, so the ride up from the station to the Trout was extremely pleasant. We stopped off at the pub, ordered some burgers (tasty) and chips (so-so), and had a chat about where we were headed. Since we'd have another five miles-ish of riding along the river, we figured digesting wouldn't be a problem.

After lunch as we left the more well-travelled part of the path, the realisation hit us that the ripply floodplain surface of the ground, baked by the sun over a fortnight of no rain, was going to prove a bit of a boneshaker. Not a fun boneshaker. Just a bit sapping. On top of that, the sun was just unbelievably hot. It was a great relief when we got back into the shade of some trees. Reaching the 'Sham, we cycled straight through to Chill Bridge Lane, and off the end of it onto a bridleway which connected us up to a minor road west of the village. Not a particularly interesting bridleway, and honestly I can't remember anything about it at this point. Apart from it'd been diverted down the edge of a field on one section. Once on the road again we were looking out for a right onto one of the total unknown tracks on the map. We found it... straight over the middle of a field. It wasn't so much a trail as a line of cleared vegetation across a once-ploughed (and baked solid) surface. I take back what I said about the thames path being a boneshaker; this really, really was. Didn't last too long before getting into more of a trail, though, once we were across the field. It didn't seem well frequented by anyone except horse riders though, and the terrain really didn't smooth out that much. The surface was just about dry, and I guess at any other time of year it would've just been a mud bath. Again, not so much fun as hard work, though. Out of the other end of this, we had another short section of road before picking up the next path - or so I thought. We took one look at the nonexistent path and decided to make for the next one along. And then we did the same again. Third path along, we decided to have a go. The problem was, the actual route of the path was... ambiguous. We set off up a likely looking trail that seemed approximately right only to find it terminated in a dense thicket. Bugger. Looking down across the field next to us, it seemed there was a gap in the hedge... so back we went to the start of the path and tried again, going the opposite way around the field. Again, no joy. I got off and had a walk... turns out the path runs directly through the middle of the field. Bah. So we plodded along the edge, through the gap, and then round the edge of the next field onto the path leading up to the road. Here we were planning to cross over the A40 and go on a bridleway past the western side of the parkand of Eynsham hall. Cleverly, though, I chose this moment to notice the wide variety of thorny twigs I'd managed to collect in my tyres. My back wheel was fine, but pulling the thorns from the front rewarded me with multiple hisses. I was packing a couple of spare tubes, though, so all was well... Until we found that Ian had two flats, no repair kit and only one spare tube. And needed tubes with different valves to me.


I hightailed it back along the A40 to Eynsham to the magic hardware shop to buy more tubes, and Ian followed as best he could. The shop was crazy busy, so it took me a while, and as I headed back out of the village with the spares, I met Ian on his way back. We replaced his other tube, and decided not to bother going back out to another potentially unknown bridleway and instead to take the roads up to Stonesfield to go to the quarry I've written about before. We got up there, belted down the bridleway, crossed the river and climbed up through the wood to the top of the quarry I've fretted publicly here about riding before (from the opposite side to the one I first rode). From behind me, I heard the sound of quiet expletives. Apparently, it looks one hell of a lot bigger in real life than in photos. To his credit, though, Ian rode it. After a brief stop in the bottom of the bowl to look up and marvel about our continued survival, it was time to head down the rest of the descent - which for my money is actually more worrying and difficult than the chute. It's a longer but shallower (still very steep) slope which ends in a sharp left. If you don't make the turn, you plough straight into a fence. Since it's longer you have plenty of room to balls it up, and you actually have to control the speed of the bike so you can make the corner at the foot of the slope - and on top of that, it's quite a loose surface, so you don't get that much grip when you start braking before you're skidding down the slope rather than rolling down it. A brief run along the foot of the hill, and we climbed back up and round to the quarry again, this time from the opposite side. From this approach, the descent after the chute is longer, smoother, straighter and much more zoomable. So rather than stopping, we just flew down, through the bowl without stopping, and down the trail back out of the wood and to the bridge over the river in a lovely, flowing blast. We went back up the bridleway we came down, headed back into East End, and picked up the bridleway across to Hanborough. This is a nice, undulating trail - not amazing, but pleasant. As we reached the other end, Ian ran out of water and we noticed the light was beginning to go. The time had come to head back to the village on the roads, and then on to Oxford so Ian could get the train back home.

I must confess, one of the other problems with not planning the route was the unexpected length. Over 30 miles for Ian and probably about 40 for me! Oops. I promise I'll plan something saner next time!

This Wednesday I had my chance to rectify some of my poor route choices, as Claire had agreed to come over for a ride. After we'd arranged this I found out that I had to be in the office in the day, so we were looking at doing the whole thing in the dark. This was a bit of a worry for me, since I'd be leading and still (still!) failed to go out and properly figure out the route beforehand. I was planning to stick to stuff I'd ridden at least once before (if not necessarily in the same direction), though, so I thought the worst case would be the occasional overshoot, missed turning or accidental cutoff of interesting sections.

Wednesday came, and I found that the main feature of the ride was not to be my dodgy guiding, but instead Mud. After three weeks or so of little-or-no rain, it absolutely tipped it down all day. But, we'd done Arranging and everything, so off we went. I decided after the ride with Ian that nothing south of the A40 was really worth the effort, and curious to ride the bridleway by Eynsham Hall that I'd planned to go up with him, we headed out on the cycle path alongside the A40. I'd been down the trail we were heading to a couple of weeks previously after a club ride - they pointed me down it as they were heading off back to Witney with the advice "watch out: there's a couple of muddy, rutty sections, so don't go too fast. Other than that, it's fine. Oh, apart from the deer. Try not to hit any deer." I hadn't found it too bad, though there were indeed some muddy sections even after all the good weather and the ruts were definitely worth being wary of. So on this occasion, I was hoping that the mud hadn't become too horrific. It was certainly tougher going; between ruts and roots and mud, the bike was sliding around a fair bit, and there were a couple of points where going slightly off-piste was the only viable choice. I was finding it pretty fun, though. Claire was... maybe not having so much fun. Despite having a much more expensive lighting set-up than me, it wasn't working so well. On top of that, she seemed to be having more trouble with the mud than me. I dunno if that's because I've ridden on more mud or because of her bike (fancy full-sus affair, but something was amis with the drivetrain; she was having trouble with it jumping gears unexpectedly from time to time). The trail climbs gently from a farm, rolls down for a while, then climbs back up to the road. Very very light gradients, but still a reasonably fun route. I think I actually preferred the muddy version, oddly.

At the end of the bridleway we popped out of the woods onto a road, crossed it and cycled through North Leigh. I was pretty sure I could spot a short trail that would connect us up to East End as we went - and I did! Woohoo! Now, with the club this route drops into a bmx park someone's made in the woods, but somehow I managed to miss the turn (I think this is near where the steps I've ridden down are, but I didn't find those either) and we ended up on a trail next to, and slightly above, the park. I suggested we drop down into it, but Claire preferred to keep on the route we'd hit, so very shortly we were out of the wood and crossing the road to East End common. There's a twisty maze of trails round here, and I'd sort of planned to go deeper into the countryside and curve back to join the route I took with Ian down to Stonesfield, but in the dark and wet I missed a right - possibly after the annoyance of finding that my shifter was on the blink and only pulling cable when it felt like it - and instead joined the road again further down East End after a fun ride along an undulating turfed trail and some nettley singletrack. So instead, we just followed the road to the head of the bridleway. I'd not ridden down it in both dark and wet conditions before, and the zoomy fun became a little more worrying, with a wide variety of unpredictable-depth puddles. I unfortunately ploughed into a deeper example about two-thirds of the way down which scrubbed a good deal of my speed off. We regrouped at the bottom of this section to go through the gate and onwards down the hill alongside a field and over to the bridge. We heaved the bikes over the style, and crossed over to the woods. Now, it's not exactly the easiest of climbs up this side at the best of times. Totally doable, and not that long, but you definitely feel like you're working at it. Claire decided to walk the first, steepest section, and about halfway up, so did I when I realised I was pedalling and the wheels were going around, but the bike was going backwards. When the slope slackened off somewhat, we got back on and continued, but the bikes were trying very very hard to slide sideways off the trail and down the hill - especially with their tyres all gooped up with mud and slicked even further with wet leaves. It soon became clear we should probably just walk some more. So we did, until we got to the level top of the slope. From there it was an easy ride to the top of the old quarry. It's becoming quite the old friend, wouldn't you say? Claire really wasn't keen to ride it - and given the conditions, I can't say I blame her. And whilst I was happy to ride the first, steep section, the longer descent to the sharp corner was definitely giving me pause for thought, what with the traction issues I'd been having already. Not like I had much choice; it wouldn't have been at all right to hoy off into the darkness and leave her to find her own way out of the woods! Instead, we walked around the top of the quarry to the opposite side, and started to ride down the rockier, rootier trail that we would've used as our climb back up to the quarry for our second run at it. I'd never ridden down this, and was delighted to find it was really fun. It's a shame there's no way to use it as a descent without either walking around the top or going up and back down it. Part of the way down, Claire spotted a much smaller bowl with steepish sides (maybe two-three feet deep?) that she thought looked more doable. I needed to change my batteries, so I suggested we stop here while I do so, and then we could both try rolling into it. I went first, and apart from a very leafy, loose roll-out at the bottom, it was nice and easy and safe feeling. Probably a good taster or warm up for someone not prepared for the big steep rolls further up the hill. After a little encouragement, Claire went for it, and rode it with ease but declined to go back for another run at the big 'un. I think maybe better weather conditions would have made a different story (it was tipping it down the first time I came here, and it really helped to freak me out). We rode down the rest of the trail, and out onto the road. With all the walking on the last section, it was now far, far later than I'd expected, so we pretty much just had to crank it home along the road - so the second half of my planned route was a write off. I think, honestly, that given the weather much of it would've been a mudbath and not so much fun anyway. I spent a few minutes butchering a map with a colour-coded guesstimate of the route (red = planned on-road that we rode, blue = planned off-road that we rode, brown = unplanned on-road-ness, yellow = planned off-road we didn't ride, green = planned road we didn't ride):

Professional, eh? You should probably definitely not try to use that as a workable map, by the way. Much of it was drawn by me going "er... well I know there's a trail somewhere there that connects up to somewhere over here..." and so some of it (especially the yellow sections) are Highly Dubious.

So, what have I learned? Mostly that I should plan my routes more! Also, I don't know my way around that well still. But it's getting there! By next summer, hopefully I should be able to give any visitors a reasonably entertaining tour provided they're not expecting anything too adrenaline-y or technical - and there's a couple of bits of trail further to the North West I'd like to link into a bigger loop like this, I just need to figure out how to do so (and where exactly they are). Thanks to Ian and Claire for coming through and putting up with my dodgy route planning - I had a lot of fun, and I hope you both did too!

Tuesday, 6 October 2009

Dear Jim...

Dear Jim,

Will you fix it for me to know why we have such stupid, restrictive laws in England which prevent cyclists from using the vast majority of the public rights of way network?

Someone pointed out to me that you no longer actually promise to fix it, so I sent a letter to my MP too, some chap called David Cameron:

I was wondering what your position is (if any) on the right of access to the countryside by cyclists and specifically a change in the law allowing cyclists to use footpaths. As it stands, in England cyclists have access to only about 20% of all public rights of way, with the vast majority being footpaths and therefore off-limits no matter that most footpaths are perfectly suitable for cycling along. When compared with the Scottish system (cyclists and walkers sharing all the same routes with no discrimination), the English legislation seems needlessly proscriptive, and given it's an aim to get people more active and to use sustainable transport more, seems positively obstructive for no good reason. Provided that cyclists are required to cycle responsibly (as in Scotland), I don't see any rational argument against allowing them to use footpaths. Bicycles don't cause any more erosion of trails than walkers do, and judging by the Scottish system, even near major cities such as Edinburgh cyclists and pedestrians seem perfectly capable of co-existing on the same paths without trouble - as they already do on bridleways and other byways in England. Just not footpaths, for some arbitrary reason.

I should make it clear I'm talking about right-of-way footpaths only, not pavements next to highways.

Some background information:

Thanks for your time.

Yours sincerely, etc.

Imagine my glee when I got a reply in a fancy Houses of Parliament envelope!

Thank you for your email dated 16 Septmeber 2009 about changing the law to allow cyclists to use right-of-way footpaths.

I can understand why you feel the current system is unfair to cyclists. As you mention, whilst legislation currently allows cyclists to use bridal[sic] paths, they are not permitted to use right-of-way footpaths, which are reserved for pedestrians.

There are problems with changing existing legislation to allow cyclists to use all right-of-way footpaths. Whilst many of these footpaths may be suitable for cyclists, others are not and allowing cyclists to use them could have significant safety implications for both themselves and pedestrians.

I do certainly think that local authorities should encourage landowners to volunteer to allow cyclists to use footpaths that run through their land. Similar initiatives have been used successfully around the country, and I believe this is a more cost-effective, local solution of opening up the countryside to cyclists.

I am a keen cyclist myself and encouraging people to cycle more will be a major priority for a future Conservative Government. My party will reform the much-criticised Transport Innovation Fund, to free local authorities to use £200 million a year to encourage the development of new green transport schemes such as cycle routes and corridors. These measures will help improve road safety and promote cycling as a safe alternative means of travel.

Thank you again for taking the time to write to me.

David Cameron

So, first of all, thanks to David Cameron for taking the time to reply. But I don't really agree with any of the reasons he gives for maintaining the status quo. I'll get my thoughts in order, then post my criticisms in a bit. I may even write back (not that I think it'll do much good), so if you have any evidence/arguments you think I should include then let me know. Or, if you particularly want to, write to your own MP. Yes, even if you're in Scotland, since hilariously your MP in Westminster gets to have a say on English laws even if my MP doesn't get a say on Scottish laws.

Tuesday, 1 September 2009


Hot on the heels of the weekend expedition, I got an email just before finishing work today saying there was a club ride tonight, 7-9. The first of my lights arrived the other day, and this seemed to be the perfect time to try them out. The club always seems to ride the same routes (so I was told) so I knew at least that despite the dark I'd be covering ground I'd ridden before.

Due to the late notice, though, this was going to be another ride without any food beforehand. I grabbed the crust of bread we had left over and bolted it down while I nipped over to the co-op with my shiny pound coin to buy a couple of chocolate bars. I scoffed one as I jogged over to the garage, got the bike out, and headed over to Witney. It's about six miles from the garage to the meeting point, and I had a whole 20 minutes to get there in, against a headwind. So once again, the trip started with a manic dash to catch people before they set off without me. Fortunately I made it just before they left, and with the briefest of greetings we were off to get out of town. The guys were in such a hurry to be off I didn't have chance to strap my light to my helmet, but I figured there'd be time for that later - it was only just beginning to get dusky. And we wouldn't get to anywhere wooded for a while yet.

About five minutes later, we turned left. In itself not unusual, but we'd never been down that road before when I'd been out... and why was everyone tanking it so fast? Oh well, head down, zoom along after them. Probably just eager to get to some fun stuff. Soon enough, we turn off the road... straight onto a wooded track. Arse. Oh well, still not that dusky, I should be fine... ooh crap, why is my bike sliding all over like a demented thing as I ride?

Turns out this track is strewn with lots of pebbles. Everyone slowly pulled away from me as I struggled to bully my legs into picking up more speed with the promise of chocolate as soon as it feels like I'm more than 50% in control of where the bike's going. Zooming out of the track and back onto the road, the two folks in front of me bunny-hopped up the curved curb ahead without breaking their stride. Determined to keep up, I do my best to do the same, and happily despite my failure to time it anything like right, and a gut-wrenching sideways lurch as the back wheel and the curb meet, I'm up and over and all is well.

At about this point I figured out it was likely that I wouldn't be having the easy ride I was hoping for. And then we turned into the jumps someone had cunningly made in the woods. I'd fallen a bit behind the two lead bikes, with the other guy behind me, and had no idea this was coming. I couldn't see their route through it, and we'd joined the run sort of in the middle. I figured out what I thought was sensible line through it all and just in time realised that if I carried on the way I was going, I was about to hit a deep double at the perfect speed to plough into the other side. Somehow I managed to squeak around it (and so did the chap behind me, who had also not noticed what we were riding into). Commenting about it later, it turned out the other two had ridden across and round the jumps - i.e., gone the sensible way. Oh well. Quickly we were on to the next bit, and another new experience for me: Going down steps. A flight of about six of them. The two lead guys shot off down them, and as I did a slow turn in the clearing before the steps to clip in, the final one of my companions disappeared down the gap in the foliage. I figured it was probably a bit late now to ask advice about how to ride them, got my weight back, dragged the back brake and with a mutter of "ah, screw it" went for it before I had a chance to think better of it. About three steps in I realised the suspension was working harder and harder each step... I was hoping I wouldn't end up running out of spring and pitching over the front bars, which felt ever more likely, and then with great relief, I got to the bottom and hared off after the others. A short run of roads and we were on a nice, zoomy, undulating turfy path with bumps just begging to get you a little air. I wasn't really expecting this, so squandered it for the most part (next time, maybe...).

I was beginning to get an idea of where we were now... just coming to the top of the rocky bridleway I mentioned last post. It seems we were now back on ground I'd actually ridden before, but doing it the opposite way. I was amazed at the difference in character going down compared to going up; what looked trivial features when climbing seemed to have grown over the past couple of days, and the gentle-ish climb was now a fairly speedy descent. I think it was down here that I managed to jump in the wild for the first time (if I actually got both wheels off the ground, that is). And nearly fell off; I really have to stop turning the front wheel while I'm in the air.

As we got to the bottom of the hill, a sinking feeling came over me. We were heading to the woods near Stonesfield again, where I'd been out alone at the weekend. I had been looking forward to this, but it was beginning to get really dark now... and we were going at it backwards. So I'd be going down the other side of the hole... bigger, steeper, rockier and new to me. In the dark. Eek.

I finally got my light fixed to my helmet at this point, crossed the river and into the half-light of the wood. The climb up this side was much much steeper than the route I'd taken before, which was probably good - I had no time to worry. At the top, the guys asked if I was up to riding down, or if I wanted to go round. It couldn't be more worrying than the steps, I thought. Ah screw it, lets go. Dropping in from this side sets you up for a jump at the bottom, and the guy in front of me got some monster air from it. My standard issue inability to plan my exit line well meant I missed the jump. But I made it down, no crashes, feeling pretty comfortable. Result!

The next section, a sweeping downhill through the woods to a sharp turn at the bottom was, if anything, more worrying than what I'd just ridden; it was properly fast. I didn't feel like I was shedding enough speed, but wasn't keen on hitting the brakes any harder. What to do? Turns out I had slowed down plenty, and made the turn with just the slightest skid (I should emphasise that everyone else did it much faster than me - the wuss is still strong in me). A twisty turny climb back out to the entrance to the wood, and we were back on the road for a bit. It was now getting properly dark as we hit a more protracted stretch of road riding, and my light got dimmer and dimmer. As soon as we pulled onto the next bridleway, I stopped to switch batteries. The next section is a bit of a blur to me... it wasn't boring, just nothing special as we trundled along the sides of a couple of fields. Soon enough we were in Hanborough and one of the group was turning for home.

Not the rest of us though. Time for the last wood of the day - Pinsley. Much flatter than the others, but much bigger, and with the feeling of the speeder bike sequence from Return of the Jedi as you weave around the trees - especially in what was now completely pitch darkness aside from our lights. I was trailing the two experienced guys relatively slowly now - I couldn't figure out how they were even able to follow the path at the speed they were going, much less negotiate the roots and stuff. If I didn't have their lights to follow, I'd have been totally lost pretty quickly. Just before the bomb hole run in the middle of the wood, we stopped and turned out the lights just to appreciate how dark it was. And then onto the main event: Two bomb holes, in succession, with a slight dip and turn between them. Going down the first one in the dark was a fantastic experience - just hurtling into pitch black and then the trail appears in front of you from nowhere like a wall as you hit the climb out the other side. After the second one, you just have to turn around at the top and head back through them. Whee! I got totally freaked out by hanging ivy as I hit the bottom of the last hole on my way out; in my peripheral vision I thought it was a branch, and swerved madly to avoid it. Lost my momentum, and had to walk the last part of the exit. Oh well. Unfortunately as we left the wood, I made exactly the opposite mistake - what I thought was ivy was a branch. I ducked as the trailed dipped under it, but forgot that I had a light on top of my helmet, meaning I was taller than I thought. Didn't hit it too hard, but enough to be a warning not to make that mistake again in a hurry!

Then we were out of the woods, and off towards the roads home. I got back about three hours after setting off, starving, and elated to have been out on my first ride in the dark and to have managed to nerve myself up to trying everything I was presented with. Riding at night is such a different experience; it's nerve wracking as things leap out at you from nowhere, and trails you think you know take on a different character but also really, really beautiful. Even though you can't see much. A great experience.

Then I got home, et tea and wrote this. Then probably went to sleep.

Sunday, 30 August 2009


Having chilled the hell out after last post, I was inspired by Iains comment to get off my whiney arse and just find some fun. I mean, if he can provide options from the other end of the country I can surely just grab a map and go looking, right? With a couple of hours to spare, I was sure I could at least try to figure out a reasonable route to and from one of the near-ish bits that I'd been shown by the local club. I did have another motive, too: The big hole in the ground near Stonesfield scares me. I'm not even close to going down the Big Side of it, but even the not so huge drop terrifies me. Until this expedition, I'd been there twice with the club. The first time it was dusky and rainy and very very wet. It was my first time out on my bike. I'd set off without having had chance to eat anything that evening, and we reached the woods about an hour and a half after I'd set off from home. I was already shaky from hunger, and by the time we'd climbed up through the woods (about 5 minutes of fun) to the main event, looking down it there was just no way I was going to ride it. None. I made my apologies, and one of the guys showed me the way around.

Second visit, again with the club, was at least a sunny evening. There were a few more people around, and as we rode up through the woods I could feel the apprehension growing. By the time I got to the top, I was absolutley bricking it again. This time, I was determined to ride it. I know in my head it's not that big, and it's not that hard. Just keep my weight back, hands off the front brake, let the bike do its thing. It'll be fine. Plus, you're at the top now. Too late to turn back. Nice one! You've totally fooled yourself into going down! Ahahahahaaa!

Unfortunately I was so caught up tricking myself into actually trying it that I hadn't bothered to check out how to ride it out once I reached what I thought was the bottom. It's not, there's another much moroe gentle drop after it that you need to turn into. If you don't turn, you end up ploughing straight into the other side of the bomb hole. Straight into a wall of roots. Which I did, then fell off and spent the next five minutes changing the inner tube that I popped with my crash-stop.

So, on the whole I'm feeling a bit better about it - hey, I mostly rode it. I actually got it together enough to try it. But, if I'm going to be honest, I didn't really ride it. It was a mess, I didn't have my head together, and mostly I just chucked myself over the edge before I noticed. And I'm not really feeling that much better about it... It still scares me. A lot.

So. The only sensible thing to do is ride it more, right? And now, with my determination to go out and ride is the perfect time. Perfect. I'm a little worried about going out by myself, but I'm pretty sure that I'm not going to manage to mangle myself that much if it goes wrong. So I tell myself as I talk myself into going.

Now, it's a fair ride out there, mostly on the roads. I'd spotted a byway that looked like it might get me a bit of the way there with some stuff to keep my mind occupied on the way, but when I tried to ride it it turned out to be pretty much impassable due to the four-foot-high nettle and thorn beds that had grown right across the track as far as the eye could see. I struggled through it a little way in the hopes it would clear up, but it seemed like a hopeless (and painful) job. I turned back, and resigned myself to just following the roads for half an hour. The whole time, I could feel the apprehension rising. By the time I reached the woods I'd worked myself up to a ridiculous state. I really, really didn't think this was going to go well. But I realised that if I turned back now, this was just going to get worse. A brief text message to some friends (just so I didn't feel like I was as alone as I actually was at this point), and I began the climb.

By the time I got to the top, I was feeling physically sick with apprehension. But screw it, I came this far. Time to do it. Weight back, off the brakes, check the exit line, pretend like you want those roots to be there... GO!

...and I made it. The adrenaline rush, having worked myself up so much, was just insane. I was whooping like I'd just pulled the most insane stunt in the world, not ridden down something that - honestly - isn't really worth fretting about as much as I had. Now the big drop, over to the left... yeah. Maybe one day.

Here's the top bit:
I went down the leftish way (right as you look at it) - over the roots, not down the way my bike is blocking in the picture.

After that, I settled in to a nice hour of pootling around various bridleways on my way home. There's a fun rocky trail up to East End past the site of a roman villa which, while easy, at least feels like you're doing something (if you catch my drift), and the bridleway to Hanborough had enough uppy-downy ness to keep the euphoria of still being alive up. I burst into fits of laughter at my one bail of the day though - a totally hidden rut just next to the trail that I acidentally rode into. It was a little over wheel width, and deep enough that even with pedals level, I grounded instantly. Fortunately I was going slowly at the time, so just had to hop off.

I had planned to head over to another wood for some more fun, but time had caught up with me. Time to head home on the roads, pausing only to provide directions to lost motorists on the way.

Thursday, 27 August 2009

"Adventures" off bikes

I've been trying my damndest to get some off-road cycling in. I tracked down a club near here, and I've been out with them twice (once in pouring rain, I chickened a few things, once in not pouring rain, and I rode everything I'd chickened the last time round - huzzah! I'm planning to take photos of the interesting bits, so I might post more here when I've done so). The problem is, whilst I really enjoy it, I don't really know where to ride, aside from the club (who I don't know yet) don't have anyone to ride with nearby, and on top of that, having ridden very little I'm not very good at it. That's fair enough; ride more and all will be well.

I have friends who are range from very good to jaw-dropping (in my eyes), but none of them live near here, so I only get to play with them when I go a-visiting. They also have lots of fun stuff to ride over near them, so I'm eager to get good enough to be able to ride that without bricking it the whole time. Again, that's going to come with time and experience, I know. I've been trying for months now to put in the time and get the experience, but it feels like such a non-starter sometimes that I can't help but get a little discouraged by it. We've had such mental weather on the nights that the club has been riding that a few times I've just not bothered to turn up (Hey, I made it to the pouring rain one, but thunderstorms, and high wind + bucketing it down extreme weather combos are a bit much for me - I don't mind getting wet, but since I have almost 0 confidence in good conditions, riding in a storm just doesn't feel appealing). In addition to that, aside from literally three small bomb holes (pictures to follow, as promised above), the local riding I've been introduced to is far from technical. If you're cool with riding on medium-chossy bridleway, or slaloming a little through a flat wood then you're going to be pretty much sorted for everything round here, it seems. Not that it isn't fun, it is, I just don't really feel like I'm going to learn much from it, and more importantly from my point of view it's not going to help me build confidence on the bike. I've tried to hook up with a variety of people when Up North, but between more Extreme Weather, financial woes (mostly of others), and the pressures of fitting things in around family time it's just not been happening.

This week, I realised that I'd left it somewhat late to sort out lights. I don't have any suitable to get me through even a dusky ride when we get to the fun bits (my recent experimentation has revealed), and it's getting darker from here on in. I've ordered some lights, but they're not going to be here by tonight, so that's going to be another week of not riding anything at all. I'm heading off up to Scotland early next Friday morning, and given I want to take both my bike and my Stuff with me, I'm not sure that I'm going to be able to fit in the 7-9 ride next Thursday either. I've also been looking at going on a skills course to try to learn something (anything!), but so far that's been comprehensively stymied by every fricking course I could make it to being Women Only.

I tried blowing off some steam about this to a couple of friends yesterday, and got pretty much blank incomprehension from them both. One outright said they couldn't understand why I'd want to do a skills course when there was nothing technical to ride round here anyway, and the other seemed to have pretty much the same opinion, but just didn't come right out and say it. Neither seem to really get why I'm so totally frustrated - both thought I should just "go out and ride more". It's easy to say that when you're surrounded by excellent riding and in the company of lots of other mountain biking folks all the time. I suspect I'm just annoying people by being all whiney at them. This is, I admit, pretty much par for the course for me (sorry). But I'm conscious that in a week and a half, I'll be back up where there are interesting things to ride, with people who are easily capable of riding them, and I'll be back to where I was pretty much where I started when I went up last time (i.e., terrified and clueless) due to lack of practice between then and now. By the end of the weekend, I'll hopefully feel a bit more confident again, and be having fun... only to come back home and do lots more Not Riding and lose it all. Again.

Thursday, 6 August 2009

Adventures on Bikes

I planned to keep a bit of a log of my two-wheeled adventures. The problem is, I've left it so long since I was going to start this that I've got a bit of a backlog to get through. So we're going to have to do a touch of pretending we're back in time for this...

28th June - The Chilterns Challenge

Very very late in the day - just a couple of weeks before - I got a message from Ed saying he and Beth would be visiting that weekend. So how about doing this years Chilterns Challenge? Since I'd hoped to do it anyway, and was already training for a 100 mile ride from York later in the year, I leaped at the chance. The route was similar to last years and I'd really enjoyed that.

I say really enjoyed.

It was a nice route, but it damn near killed me getting up those hills... Admittedly, I'd been doing almost no exercise that time round, and was riding a heavy rustbucket of a bike, but still. It was tough. So I had a little trepidation (to say the least) about how I'd find it this year. All the more because the weather forecast as the day approached kept tending more towards "you are going to melt". I can't remember what temperature was threatened, but it was alleged to be feeling well in excess of 30 degrees.

The ednbeth arrived late on Thursday night in advance of the ride. We decided to leave the bikes in the car and sort out taking them round to the garage the next morning. Which we did - along with my shiny new secondhand Kona Caldera which they'd brought down from Glentress for me (yup, I got the bug... although where I'm going to find mountains round here is anyones guess - more on that in subsequent posts, I suspect). Unfortunately, Ed decided to ride Beths bike round to the garage while simultaneously pushing his. And fell off, tacoing his front wheel, bending his bars, mangling his grip tape and nearly severing the cables on that side. Fortunately, he had a couple of days in hand to Do Fixing and by the time Saturday night came, his bike had been bludgeoned back into something approaching a rideable state.

The night before the ride, we cooked Epic Pasta and resolved to get up before six, in a bid to beat the worst of the afternoon heat. Shockingly, we did so. After a couple of false starts (forgetting such vital tools as a pump the first time round), we were off.

Arriving at Henley, we found the tiny car park at the start absolutely rammed with cars, but through some sneaky parking-on-the-driveway we managed to bag a plot and begin assembling our glorious steeds. A brief queue for registration, and a mere quarter of an hour or so of faffing around later we were off!

...for all of about three minutes. And then we realised we'd forgotten the sunscreen. Ed, bless his enthusiastic little socks, decided he was the person to ride back to the car, grab the cream, and catch us back up. Beth and I were to pootle along until he caught up. And pootle we did. After a little while, we were beginning to get concerned that he'd maybe missed the first turn. We were just about to turn back and go searching when we saw him in the distance, bombing up the road. It turns out that our pootle was a bit more like a brisk zoom, and poor Ed was now wrecked already from trying to catch up with us. Oops. Still, he had some respite while we gooped up. But not much. For we'd managed to stop at the start of the first big climb of the day... now, I remembered this with much trepidation from last year. The two big hills on the route had very nearly finished me off, and I'd been worrying that this year would be no different despite the training. I was both surprised and delighted to scoot up the first one pretty easily - so much so that I found the energy to wonder why the fellow in front of me was insisting on wobbling all over the road rather than just dropping gears and spinning more, like I had. It's not like he was going any faster than me, and I was having a much easier time of it... As an aside, I should mention that this is something I really don't get about a lot of road cyclists. They seem to actively want to make life harder for themselves by not having a triple chain set. Now, I sort of see that for the top-end elite cyclists that not having that tiny amount of extra weight might make a difference. And they're elite, so they don't need a granny ring. But, honestly, the majority of the folks I see out aren't elite. They're just in pain. I suppose that part of the answer might be that it's not fashionable to have all the gears at the moment, so it's hard to find bikes with them. Anyway.

Zooming down from the first hill, the road was beginning to feel a little sketchy, and since I wasn't sure how far it was to the junction I started to slow down a bit. Ed zoomed past me (probably with a "why are you slowing down?"), and then realised - just as I did - that we were about to hit the T junction at the end of the road. Fortunately, our brakes were up to the job.

Excitement over, we settled in to a merry pace, chatting as we went. Seemingly in no time at all we were at the first food stop. We zoomed straight past, deciding we didn't need to stop, only to stop a mile or so down the road (I think Beth ran out of water and needed a transfer, but I'm not sure now). We timed that perfectly so we were just setting off again as we passed the event photographer, who somehow managed to completely miss us.

Now we were hitting the BIG climb of the ride. Last year it was at the start of the route, and I remember it being pure purgatory and seeming to go on forever. I started to realise as I overtook a few people on the way up it that either my new bike was awesome compared to the old one, or I was far, far fitter this year. I suspect mostly the former. Once we were all up that hill, we were fast approaching the route split. We'd all signed up for 100km, but for some reason the organisers had Ed and Beth down for 100 miles. Destiny maybe? We decided not, and opted for the short route whilst confidently proclaiming we'd do the 100 miles next year (which, incidentally, Ed and I had confidently proclaimed last year too. We were now onto the swoopy downhill fun-run I remembered so fondly from my previous attempt at this ride, and swoopy swift fun it was. We ate up the miles to the next food stop, where we paused for a re-gooping and to swipe some supplies. There were zip-vit energy gels being given out, and I bagged a few in case I needed them later. Curious as to their effect, though, I decided to scarf one down straight away to see what it was like.

Oh my word.

I'm assuming that these things are designed for people who are on the verge of collapse. To someone very far from that point, they had the effect of making me giggle hysterically as I rode for about the next twenty minutes, weaving around like a drunken loon. The next section of the ride is a bit of a blur, and soon enough we were pulling over at the lunch stop. Pasta and doughnuts all round! By the time we set off again, it was beginning to really get warm. Whilst we were moving, all was well since we were at least getting some airflow, but whenever we stopped at junctions it was like stepping into an oven. Also at this point, we were beginning to hit the really chossy roads that I'd been fortunate enough to be packing front suspension for last year. I really do mean chossy, too, with quite a lot of the section between lunch and the last food stop seemingly midway back to turning into a dirt track. The heavy rain from last night was clearly in evidence too - the roads were covered in bits of branches, stones and earth which had been washed into the road by the torrential rain. Not fun riding for the full-on road bikes, but since we were riding a tourer (Beth) and a cross bike (me) we weren't to bothered. I distinctly remember Ed complaining about the bumpy surfaces on his audax bike (with the trashed bars), though.

Midway through this middle-of-nowhere only-barely-still-a-road section, we found the highlight of weird for the journey. A traffic jam behind a land rover which had fallen partly into a field. Rather than the other drivers get out to help, they thought it best to stop the cyclists who were mid-way through an event to get them to push the car back out of the field. Nice one, guys. Being pleasant types, push we did.

As we were approaching the last food stop, we saw a marvelous sight: A family out on their bikes. With a child trailer! And balance bikes! Sweet! I slowed down to have a chat with them, only to be overtaken by a pair of tandems. If only there'd been a trike and a unicycle too, I'd have had the full set...

After the last stop, the heat was beginning to tell. whilst the terrain now was mostly flat, I found this section to be a long grind (partly, I guess, because I knew most of the fun stuff was over). Up one last, then down a track to the river and we were back into Henley, and nearly at the finish. Since it was regatta time, the traffic was insane, and just before the town centre I was separated from the rest of the posse. Since we were nearly done (and the traffic was scary-busy), I headed off to the finish alone. Once again, I missed my chance to get a photo as the tandems pulled into the finish just ahead of me, with many oohs and ahhs. The photographer didn't even notice me slinking in past them. I claimed my medal, and then stuck around waiting for the others. Just a couple of minutes later, Ed rolled up, and then Beth... who stopped just short of the line, and made to start taking her bike apart and put it back in the car. She hadn't noticed the huge inflatable finish line, and just assumed that entering the car park again was the finish. We shouted her over, and she walked across the line, and we'd finished! Huzzah! Time to pick up our t-shirts and medals, splat down on the grass for a rest and marvel at the sheer number of bugs we'd managed to glue to ourselves using sunblock as we rode.

All in all, excellent fun. But only 100km, and I still felt pretty tired by the end of it so I was still far from confident that the 100 mile ride from York later in the year would go so smoothly...

Thursday, 16 July 2009

The Amazing Windows Specific Bug

I've just spent a week and a bit tracking down possibly the weirdest, most pernicious bug I've seen all year. It was obviously going to be a doozy - the application crashed only when the system had multiple cores, only when the input images were all of different sizes, and the crashes were both intermittent and unpredictable. Oh, and in the middle of code that had been seriously hammered in the past, and in the wild, and shown no signs of falling over.

Where to start?

Well, first of all, that intermittent crashing? That looks like a threading issue. It could just be memory corruption, but running on the exact same input data in the exact same order gave significantly different times to failure each run. It just feels like a threading issue. That plus it's only apparent on multi-core machines. A check of the code reveals some worker threads that are spawned in the midst of some number crunching to make use of all the available cores - so if there's only one core, there're no more threads. Aha, this looks likely. Right, so, if there's a weird issue going on here, we might be able to track it down using Valgrind, right? right?

Wrong. Because on Linux... there is no issue. Exact same source code. No crashing.

Here's a pseudocode version of the section of code in question:

In the main thread, for each image processed:
//Initialise the shared job queue (that all threads will pull jobs from)
//Initialise and resume the worker threads
for (i=0; i<threadCount; i++)
while (true)
//Keep pulling jobs off of the shared job queue until there's no more work to do
job = this->jobQueue.GetJob();
if (job)
else break;

//Wait for the worker threads to finish
for (i=0; i<threadCount; i++)
busy = this->threads[i]->CheckBusy();
if (busy) break;
while (busy);
//Pause all the workers until we need them again
for (i=0; i<threadCount; i++) this->threads[i]->Pause();

And in each worker thread :
//Signal that the thread is now working
this->busy = true;

while (!this->TestDestroy())
job = this->jobQueue->GetJob();
if (job)
//Signal that the thread is no longer busy
this->busy = false;

So, to explain a little, what we have here is a pool of threads that are created at one time and then re-used through the lifetime of the application. Whenever we get into the number crunching code, the threads have their operating data passed in and they're resumed. As soon as all the jobs are processed, the threads signal that they're finished. Once all the threads are done, the main thread pauses them all and the program goes on its merry way.

Anyone figured it out yet?

There's one last piece of interesting information, to do with the way that threads are paused on the two different platforms. On Linux, the thread won't honour the Pause() call immediately, but will pause the next time it gets to TestDestroy() (for those wanting to replicate this, I'm using wxThread though this behaviour is a result of the underlying threading of the target OS). On Windows, the thread is paused immediately.

The upshot of this is that you can't guarantee, when you resume a thread in Windows, where it's going to start execution from. Now, with this last piece of information, it should all fall into place. See where the thread sets its busy flag to false? Right, in your head pause the thread there. Now, next iteration the thread will be set up properly by the initialise call, which raises the busy flag... only for it to instantly lower the flag when the thread resumes. So now the thread is merrily doing its processing, but it's signalling that it isn't, and is ready to be paused.

That in itself, while worrying, isn't so bad. What can happen next is. The Pause() can now happen anywhere in the worker threads loop. So if the thread happens to still be working when the main thread starts checking the workers to see if they're ready to be paused, it's more than likely going to be paused in the middle of doing number crunching on the input data.

And then, next iteration, you change all the input parameters and resume the thread mid-calculation with totally different data. If you're lucky, that means you get garbage out for this one iteration. If you're not, and your worker is mucking around with variable length data, you just wandered off your allocated heap and into the wild unknowns of Segfault City.

There's an easy fix, of course. The issue only arises because when the thread is in a state that it flags as "pausable", it's still performing write operations on itself (constantly re-clearing the busy flag). If we consider that the pause, and any re-initialisation of the thread data, is asynchronous to the thread entry (which it is) then it's obvious this is going to cause trouble. Instead, we can make sure that once the thread has signalled it's ready to be paused it no longer performs any writes. Since it's not going to be writing, it's now safe to pause it, do some asynchronous writes, and then set it going again. (note: I say "safe". It's safe in this context. You could still really confuse the thread if it's checking badly-considered conditionals that you just monkeyed with the control parameters of, but let's take that as read).
while (!this->TestDestroy())
//Make sure we don't keep setting the busy flag to false over and over
if (this->busy)
job = this->jobQueue->GetJob();
if (job)
this->busy = false;
else Sleep(1); //Oh, and may as well consume fewer resources while we're at it

Tuesday, 2 June 2009


I don't drive a lot. I don't even have a car. But since sprogging it's become much less practical to always travel by train, so I end up hiring a car once a month or so - like last weekend. We had a family wedding to go to, so Friday night I picked up the car and set off to Cambridge the following day. Pretty easy drive on the way there (and rather a pleasant weekend), but the journey back on Sunday night... honestly, I swear people were deliberately trying to make me crazy.

So, if you're also a driver, here're a few tips for how not to meet with my ire:
  1. Don't overtake people when you're in a slower lane than they are. Really, seriously, don't. It's not cool. It's more than a little dangerous - for a start, the person you just overtook isn't expecting you to be there, so may well pull into you, and on top of that you just removed their ability to get out of the way of everyone else. You know, they may actually have been trying to get out of your way when you decided that you couldn't wait?
  2. Indicating is really useful. Was it maybe abolished and I didn't get the memo? How the hell am I supposed to know what you're doing if you don't indicate? My favourite trick there is when you indicate you're about to overtake, and then the car behind with no warning pulls out and overtakes you. Maybe they're going for bonus style points?
  3. Don't drive along the middle lane of an otherwise free-flowing motorway at 50 miles an hour. Asshat.
Feel free to disagree with me from the comfort of your armchair, but please stop pulling those tricks on the road. It both annoys and terrifies me. Mostly the latter.

On an even more disturbing note, I stopped off for a coffee on the way back. And noticed the little vending machine thing in the toilets, and couldn't help wondering: Have I been doing long distance journeys wrong all these years? Does everyone else regularly need to buy condoms, disposable hand wipes, lube, a vibrator and a packet of painkillers when travelling? If so, what on earth do you need that exact combination of items for? Am I driving unsafely as a result of my ignorance? It's a worry, I must say.

Oh, and while on the subject of things that drive me up the wall, please everyone: Don't say "blah blah blah" when you mean "and so on" or "for example" or "words fail me, but you know what I mean". It really gets on my nerves, and makes you appear to have a stunted vocabulary.

On top of that, stop eating cod. All of you. The wishful thinking must end before the species does. There are many more tasty fish in the sea.


Thursday, 21 May 2009

Tree-hugging hippy nonsense

I fear this may categorise me as some kind of freaking liberal communist hippy nutter, but genuinely I'm curious: Why isn't public transport free? Or, more accurately, is there any good reason why public transport shouldn't be free?

The obvious one, to my mind, is that not everyone uses it, so why should everyone pay for it. Except, you know, I'm not convinced that's actually true. Say you drive everywhere, and never use public transport. Your roads are kept clear(er) just because there are lots of other people that aren't driving on them. You're in effect using public transport to keep your motorway nice and quiet. Another issue, I guess, is that you'd have to raise taxes and that would make a government unelectable. Well, to begin with, what you do in government seems to have little to do with how electable you are. Manifesto promises seem made to be broken - and once you're in power, until the next election you can do whatever you like. Maybe I'm being too cynical there. But the argument that you'd need to raise taxes and that would therefore make you unpopular... I'm not sure I buy that either. Obviously, yes, you'd raise taxes. But we already pay for public transport. Due to the hilarious, incompetent and spectacularly wasteful way our railways are run, we as a nation frequently subsidise private rail operators that have failed to perform. Whilst still paying big salaries to their directors and, in some cases, even managing to be profitable enough to pay their owners dividends. On top of that, which comes directly from our taxes, we pay to use public transport. Does it really matter whether we pay our money to the tax man or to the transport companies? It comes from the same source and goes to the same sink. The route is irrelevant.

I understand that it's a bit of an extreme position, and as such I should at least propose some benefits. So here goes:

The big one is that right now we have the issue that having a car - and using a car - are for most people the primary mode of transport. Because it's convenient, and because (tellingly) public transport is often too expensive. Now, we're funding public transport as a society anyway. The benefit of having a public transport system is that it's relatively efficient, keeps the roads relatively quiet, has less potential for the spectacular number of accidents and fatalities, and is massively more efficient in terms of maintenance to the user. There's clearly a social benefit to having a decent public transport system - you get more people to work on time, more reliably (yes yes, if it's working well), and you no longer force people to be dependent upon the constant outlay of having a car, maintaining a car, fuelling a car, driving a car, and not crashing a car.

Now I'm not saying that we should outlaw cars or anything crazy like that. They're really handy. I'm just saying that - like with the NHS - surely the base level of transport that we expect society to have (because society relies on it) should be covered by the society as a whole. And once you take that step, why charge for it? Make it free at point of use, and you'll see usage increase. You have to pay for that, but what comes out of your taxes is no longer coming out of your pay packet when you want to go somewhere. You can keep paid upgrades to first class, that's fine. And if you really want to drive, you can pay extra and do that too.

But just because you want to drive a shiny car, that doesn't abrogate you of the responsibility to pay your social debt and fund the base level of transport. You're chosing to use something beyond the basics that society requires, so you should pay for that in addition to the basics, not instead of.

Wednesday, 6 May 2009

Look at the state of your code

Recently I've been working to re-implement an application from scratch. Not normally a sensible thing to do, but the codebase of the original was so far from being maintainable that you couldn't see maintainable from the highest point of the code on a clear day. With a telescope. Ostensibly the main reason it was such a mess is that as the application rolled out, there were an ever-increasing number of tweaks, special cases and optional extras which needed bolting into it. After a bit of thought, though, it seems to me that this is almost entirely not the case.

The root of the problem is that the code was never really designed before it was written. There were no pen-and-paper diagrams, whiteboard sketches or rough attempts at figuring out a structure prior to getting "stuck in" and hacking out code. It's a common mistake, it seems, that writing code is the important, difficult bit. It's really, really not. Figuring out how the code should hang together, that's the important bit. And as part of that figuring out both what the job you need it to do is, and what it might need to do in the future is. Now, obviously, you could take that too far - abstract enough and you just specify a thing that does something. Can't really design that, right? Well... sort of. But you know the special case of what it needs to do right now. Abstract all those things: If you need to be able to accept an input from an edit box before you fire the McGuffin that does your big cool number crunching task, then isn't it a good idea to make sure that you don't care where you get your data from? Yes, in this case it's an edit box, but why make life difficult for yourself in the future? You're going to get your data from something and in your first cut, that something will be an instance of an edit box. Next week it might be a piece of custom hardware. Design the way everything hangs together right, though, and aside from writing the code that details internally how you get data from the hardware, none of the rest of your code changes.

So far, so obvious. I'd hazard that no one really disagrees with that approach. But what really struck me with this project is how cool state machines are, for doing the above but with your business logic program flow. What you see in a lot of projects is a section of code that tells your system to do stuff - either the main loop, or the equivalent for the subsystem that you're looking at. Within it you'll often find a collection of conditional or a case statement. With the project we started with here, that had... I hesitate to say "grown"... mutated into a gigantic cascade of conditionals. Following what the hell was going was difficult, because there was no easy to reference concept of what the system thought it should be doing at any given point. It becomes difficult to add functionality, because checking what conditional statements are going to be executed is far from trivial. And on top of that, where do you sensibly add your code? Most likely as another conditional in the big list - making it even harder to get the next revision in. And because you've had to mess with the internal flow of the entire system, you've potentially destabilised what you had to begin with - even sections of the code you didn't think you changed.

So, here's an alternative approach: Let's abstract our central functional loop. It's going to take some data into it, sit there performing some function until it's done, return some data which determines what needs to be done next then pass whatever data it thinks might be useful out to the next iteration which will do the same thing. So what do we need to do this? Let's define a generic state object which will take care of Doing Stuff. We don't care what it does. We can give it access to a message queue so it can throw data out to non-state based components of the system (such as a GUI or some hardware), so there's no worries about it needing to have access to data that the central class shouldn't really relinquish - we can just pipe data out through the central controller class. Equally, we can pipe data in through the main controller loop. As much data as we like, and of any type. The state object can decide what to do with it, or junk it if it decides it's irrelevant. All we really need to define for the generic state is a HandleData() a Run() and a member variable to tell us when it's finished, and ready to move on to the next state - and, ideally, give us an idea of how this state finished. A binary works well here (success/fail), but you could use anything I guess, provided you can keep track of your state progressions. Now, we can define our states totally independently. Chaining them together into an application is just a case of defining a flow tree for the controller which tells it what state comes next for a given exit condition on the current state. You can define that in XML or whatever and parse it at runtime - no coding involved. The main control class becomes trivially simple - it just sits in a loop piping data into and out of the current state until it's told that the state is finished, then looks up the next state from the flow table and makes it current.

The neat thing about all this is that you inherently know what the system is doing all the time - it's just a state machine. You want to know what code is running when it's in a given state? The code in that state object. You don't have to figure out what conditionals are valid right now - just look at what that state does. You need to add functionality? Either change how the relevant state works if it's a simple change, or add a new state if you want the system to do something new. Then just update your flow table. Need to take something out? Just edit the flow table. You maintain tight encapsulation of your business logic the whole time, but at the same time get a very extensible framework. And because you're not modifying the existing code at all, you've drastically limited your ability to kark something up by mistake - you've got to either mess up your state flow table, or pass garbage into a state while at the same time managing to convince it that the garbage isn't garbage. A well-designed state object should be pretty resillient to this, and a well designed controller should do at least some amount of sanity checking of the state flows it loads to give you confidence that you are trying to run a system that has a chance of being stable.

Now, there's a downside to this: you pretty much have to stop and figure out what you're trying to do as a state machine, rather than hacking in some conditionals. Well, I say downside. Figuring out an actual state machine is probably a good idea in many cases - you've had to formalise what you want to do before you go ahead and try to do it.

Obviously, you don't always want to take this approach - if you're writing heavily optimised, time critical code then you maybe have other considerations to worry about. And no pattern is going to be right all the time, but I would hazard that unless you've got a good reason not to design your code using state machine architecture then it's probably a good idea to at least consider taking this approach. Especially if you know that you're going to need to add or modify functionality in the future - it really does make modification amusingly easy.

Wednesday, 29 April 2009

Race hazard

The other week I was visiting friends in Edinburgh. A great time was had by all (I hope - I certainly had a whale of a time). Aside from the joys of seeing all-too-distant friends and moseying around a beautiful city, we had a little time to play on mountain bikes at Glentress. I've never been mountain biking before. I never realised what I was missing. Oh my word, it's so much fun. I'm reasonably sucky at it (hey, first time, remember), and spent the first day vacillating between terror and refusal to attempt stuff that really shouldn't have worried me at all, and stupidly tearing down trails faster than I was capable of handling because I knew no better. And then falling off. Given that they were carting Mr. Liability around all day with them, many many thanks are in order for the folks I was with - they encouraged, scraped me up, and tried to teach me enough to stop being such a danger to myself all in the best of spirits. As a result, despite the wealth of bruises I'm still sporting, I'm totally hooked and can't wait to go again. The second day we went, by the way, I got padded up to try to stop me from getting bruises on bruises. And managed not to fall off once. Ho hum. But another glorious day of epic fun for me.

...and between those two days, we get to the point I want to do writing about: Racing games. Edd, Ruth and I convened to introduce Ruth to the Way of Game (which she picked up and ran with startlingly quickly and well). In our session, we played two entirely different racing games: Pitch Car and Formula D. The former is sort of like racing subbuteo, or shove hapenny maybe (if that means anything to you). You have a wooden track, with little fences on the outside of the corners to help keep your cars on, and you flick your little wooden disc-shaped cars around the track. That's it. If it sounds simple, that's because it is - but that doesn't stop it from being brilliant fun. The main problem with it is the amount of time you have to spend crawling around under the table tracking down the car you just blasted into the stratosphere by mistake.

Formula D is a totally different kettle of fish; it's a dice-rolling based game with a nifty gear shifting mechanic (based on the gear your car is currently in you roll a different dice). It is, however far more complicated and drier than pitch car. Having said that, we almost killed ourselves laughing when Ruth took a hairpin bend at 300 miles an hour. While being shot at. Unsurprisingly, she didn't quite make it.

Pitch car would probably be fun no matter who you played it with - anyone who'd be happy to flick a wooden car around a racetrack is going to be in the right frame of mind to enjoy the game anyway - but I definitely got the feeling that Formula D relies, like so many games, on the personalities around the table. It could be dull, tedious play if everyone was going to carefully analyse every move to pick the statistically optimal gear each turn. Or, as it was for us, it could be a riot as you wing it round every corner slightly too fast hoping not to launch yourself into a building. I guess that's why I enjoy playing games so much: it's not just the game (though I do enjoy them for their own sake), it's also a prism to direct the attention of a group of friends together into a shared experience. And how is sitting around a table with good friends having a whale of a time ever not going to be a good way to spend a few hours?

Definitely looking forward to doing all that again. If only they didn't live so damn far away.

Monday, 13 April 2009

Peering in from the outside

So here's a thing: It seems an awful lot of people don't get what peer review is for, and how it works. Keeping the standard issue "I may not know what I'm talking about" disclaimer in mind, I thought I'd take a look at it since I've been both the reviewer and the reviewee in the past. And the perception that some people have seems to bear little relation to my experience of it. So, let's take a look at the strange idea of peer review that people have.

As far as I can tell, this is how the people that've bothered me with this think the process works:
1) A scientist writes a paper to prove their theory is the new theory of awesome
2) Some other scientists read said paper and then vote on whether or not it's the new theory of awesome
3) Depending upon what these other scientists vote, it's either an official New Theory of Awesome (and hence Is Science), or it's not (and hence is either junk or One Of The Great Ideas The Establishment Have Turned Their Back On).

There's a weird misunderstanding of the process of scientific endeavour in there, and it's one that is most likely linked to the way the media cover scientific research (with all the talk of "breakthroughs" and scientists "challenging" each other when they disagree). I think it's fundamentally leaning towards seeing science as received wisdom, where Experts who Know snipe at each other until the ones who win the most points get to have their idea exalted as Science and the losers are... I dunno exactly. I suspect that people think this is where the nutjob theorists who claim to have been rejected by The Establishment come from.

The funny thing is that this is almost exactly not what happens. Although the majority of scientists within a field will tend to share a consensus view of many aspects of that field, they didn't vote for it. There's not an organisation that neatly divides theories and empirical data into "science" and "not science" based on the votes of scientists. What happens to form this consensus then? Well, in my experience this:-

A researcher, working in some field or other, will to begin with spend many, many hours trying to find every paper which might possibly have something to do with what they're working on. Why? Well, for a start, how do you think researchers decide what to research? And how do you think they decide how to go about it? And how do they figure out what might already have been done many times before so they can choose whether or not to do it again (this bit's actually quite important)? By trawling through huge numbers of papers and reading bits of them.

Hold on a moment.

Bits of them?

Yes. Bits of them. Right now, they've got an epic stack of research papers on their desk/hard drive. They've pulled everything they can find which might be relevant. Most of it won't be. So now, they read through the abstracts and maybe some other bits of the papers, and throw out everything that was likely looking, but turned out to be irrelevant. Note irrelevant. Not "inconsistent with what they want to read". I mean stuff like, you were looking for papers on face recognition because you're doing a study on how people recognise faces. Unless you're planning to also look at how automated face recognition works, any papers you might have picked up which deal purely with automatic face recognition probably aren't relevant to you at all. If you find a paper which inconveniently seems to show exactly the opposite of what you hope to find - well, that's not only relevant, that's gold dust. Put that on the top of the pile. You'll be needing to read that.

Right, we've manageed to shrink our pile of papers to something manageable. Now we're going to go through it all in detail and figure out what each paper says, what the researchers did, how they did it, and if they did it sensibly. Once we've done that we can decide if we need to replicate any of their results before we carry on.

This is the important bit I mentioned earlier.

Now, if you're going to be directly building on the work other people have done, it's a good idea to (a) make sure their theoretical work holds water (b) make sure their maths isn't squiffy and (c) make sure that you can empirically demonstrate what they said they demonstrated. After all, best will in the world, they could've just got (un)lucky and fluked it. They may have messed up their experimentation. Probably best if you verify that you can pretty much do what they say you can do with their technique, right?

Obviously, you can't always do this. Sometimes you don't even want to. But in these cases, you can really rely on their results only when you have lots of other papers which have been independently produced by other people who've been in your position but actually done the verification work. If fifty research groups have already demonstrated a paper to be reliable. you're not adding much by re-running the experiment. It may still be helpful for you as a learning exercise or a baseline - in which case you'll run it anyway. Sometimes, of course, you simply can't reproduce the experiment. You don't have the resources. So you do the best you can. You check their methodology. You make sure you can reproduce any derivations. You take a look at their data and verify that what they claim it shows is, indeed, what it shows. And you keep in your mind - and likely note in any publication - that you're basing this on work that you couldn't verify and that no one else has. It'll be a worry. And it'll mean your work has less weight to it because it's built on a shakier foundation.

OK, so, you've done all your work and you write up your paper detailing what you did, how and why, what your results were and what you think they mean. And you reference all the papers you found which were relevant to your work. So, anyone really interested in what you did can go back and see the work that your work relies on.

Now, multiply this up by ALL THE RESEARCHERS IN THE WORLD.

What you see is that useful, reliable work is being checked all the time by being used. Scientists aren't voting on what they believe to be right, they're just reporting back on what they tried out, and what seemed to be reliable because they used it themselves, or because they wanted to verify that someone elses work ...well... worked. And what they're doing the whole time is criticising the work that came before - pointing out experimental flaws, errors in reasoning, over-stated conclusions. And that all gets fed back round the system. On top of that, you have to remember that scientists aren't trying to prove themselves right - you take your hypothesis and you try to prove it wrong. So, all those papers are trying to show that their central idea is false, and then reporting back on their failure to do so. (Before anyone points out this isn't always the case - I know, ideal world. But the scientific process is fundamentally based on this type of negative feedback. Even if you're trying to prove something is the case, you do this by trying to demonstrate that it isn't, if you get what I mean).

OK, so, that's science. And personally, I wouldn't consider any of the above to be "voting". And at no point does anyone decide what is or isn't science, you just have models which have proven to be useful and ones which haven't. Where does peer review come in? And why is it so important?

To answer the second question first: It isn't all that. Peer review is a very, very poor approximation to the above (which happens after publication). Just because something's appeared in a peer reviewed journal doesn't make it right. Independent verification is the thing. So what's the point of peer review?

As far as I can see, it comes down to basic quality control. It's an attempt to weed out the papers that are nonsensical, unreadably badly written, patently fraudulent, misleading, blatantly poorly designed, have obviously fudged their results, etc. It doesn't pick out the absolute best papers, it filters out the garbage that no one would (or could) ever apply the above process to in the first place. And why do we need it? Partly to reduce the expense of publishing, though I have little sympathy for that argument, but also partly to cut down on the volume of crap that researchers would have to wade through to get to the well-written papers about well-constructed experiments that are of any value at all. It's a blunt instrument, and it's far from ideal.

But don't be mistaken by the fact that something is peer reviewed. It's a start - but it doesn't make it valuable, reliable or right. Read the paper. See if it makes sense. If you have the resources, reproduce the work. If you don't, find other papers that have. Build an evidence base for its reliability. Build an evidence base for its unreliability. Compare the two. That's science.

Friday, 3 April 2009


I'm not entirely sure where this is going, but bear with me. Hopefully a point will start waving and shouting at us as we proceed, and I can skid to a halt at its feet and pretend that's where I was trying to get to all along.

Now, a couple of weeks or so ago I got into a bit of an ill-tempered argument with a good friend of mine. It was a stupid argument, not really worth having. One of those that comes from both parties being tired, not understanding the other properly and having the added confusion of conducting the conversation through the medium of little typed words in between doing work. Standard issue falling out because what you wrote in your email isn't what the other person read, even though both of you were looking at the same words in the same order. I suspect, moreover, that no small part of the problem was that I was trying to make a general point, but doing it very badly and ended up coming across like I was bludgeoning a specific issue I knew very little about to death from a position of complete ignorance.

Which, as it turns out, is deliciously ironic because the point I was fumbling towards was this: There's a fascinating world view shift between three groups of people - those who actually know what they're talking about for a given subject, those who think they know but don't, and those that are fully aware that they don't know jack.

I'm talking about something a little more subtle than the persons own perception of how good they are at something (although, a little aside here, I know there's an interesting paper about this, and I'd love to link it here. I think it's this one that I've seen referenced before but, ho ho ho, it's pay-to-view only and I don't have a whole world of spare cash to throw at checking whether or not I'm right. Chances are I'm wrong and I'll need to go on a merry chase through several references and more pay-to-view articles to find it. Nice one, Science. Just you go ahead keeping your findings under lock and key. No wonder people turn to mentalist woo-merchants because they seen no difference between their statements of absolute truth and What Scientists Say, since joe public can have a hell of a time trying to track down the papers to read for themselves. Anyway, I digress.). Rather, the perception they have of the entire field that they're talking about.

Here's an example that I haven't been recently fighting with my friends over. Now, I happen to know, on account of spending quite a long time looking up the details and poring over them, that for lots of applications you don't need to use Windows. Especially for embedded or server based applications. In fact, I'd go as far as to say that for many applications you would be better served by using an alternative OS. I don't think that's a particularly contentious position to take. I'm not saying that you should never use Windows, just to be clear, simply that sometimes it's not the best choice for a given system. Point in case, I've recently worked on a system that needs to be running a tiny, fast, secure, kiosked OS that pretty much just exists to get a single application running and pass hardware control through to it. Now, you can do that with Windows. But you're paying for software you just don't need, and that (from the position of sitting there and trying) is much harder to cut down to the core that you want. But I've had conversations with people - recently - that have flatly stated, variously, that "no one uses anything but Windows. Ever" and "our customers insist that everything connected to their network must run Windows. Everything". The former statement is patently false (just check the statistics for the number of *nix web servers, the number of people in the media that use Macs, etc, etc) and the latter is highly debatable. So, they insist that ip enabled security cameras run Windows? They'll have a job. Such devices don't even have an operating system.

But the interesting thing, I think, the really interesting thing is that the people making the above statements Knew They Were Right. They honestly, and without any hint of one-upmanship or nonsense like that, thought that they were in a position to make these firm statements because they believed they were in the position of knowing all about that field. Now, talking to other people about the same situation shows that people who simply don't know anything about it - and know they don't - will tend to pretty much come out and say that they don't know but will often express surprise, or even outright incomprehension, that something is the way it is. But then, from the opposite side, people in a position of immersion in a field will be bemused and often unable to understand the decisions and world view that people less immersed hold. So, for example, I'm generally bemused at the way that most people seem happy enough with proprietary, closed-source software. I can't really understand why anyone would want to put up with the restrictive world of Apple. But then, I'm perfectly happy to spend an evening hacking around compiling a new kernel with debug outputs to find out why a new bit of hardware isn't working (and I suspect most people aren't). I like to know that I can have a poke under the hood if I want to (and I suspect most people couldn't care less).

So, to get back to what started this, which provides a somewhat less techy and perhaps more accessible example, I was trying to explain why I found the world of people who really know about cycling weird. A bit of backstory here - for the past ten years, my primary mode of transport has been a bike. Until this year, it's been either a very crappy bike, or a reasonably OK if you know no better bike. The best I could afford when I bought them - and, given I was a student at the time, that should paint a relatively clear picture. Even so, I've racked up many, many miles on them. Our holidays tend to involve getting on the bike and heading off into the wild blue yonder for a week or so. Our weekends often require significant pedalling to get us where we're going. Until we moved to our current house two years ago, we would transport all of our groceries through the medium of panniers. All of my commuting would be done on a bike. And now, with a one and a half year old son, we have a kickass trailer which I haul around the local countryside as often as we're able. So, in summary: I would say that over the past ten years, I've cycled quite a lot. But I can only do the most rudimentary maintenance, and have never been in any kind of cycling club or anything like that. And I certainly don't know much about bikes.

On the other hand, I have friends who know an awful lot about bikes. They have multiple bikes costing (to me) eye-watering amounts of money. And, frankly, I just plain don't understand why they'd want them. And I'm not going to - I use my bike to haul stuff (and me) around places. I can't possibly afford to have another bike, and what would I use it for? I could just about understand having a mountain bike as well as my general purpose workhorse bike, but... well... there're no mountains here. And I can't imagine why I'd ever want to ride a singlespeed bike. It looks like a world of pain for no good reason to me. Of course, from their point of view, I don't know what I'm talking about. I freely admit this. But then, that's the difference: They do cycling. It's a big part of their life. I, on the other hand, ride my bike sometimes. Of course we're going to see the entire world of bikes in totally different ways, see different things as reasonable, etc. But what I didn't realise before I started asking them about bikes (because I wanted to buy a new one that was a little more efficient than the old one) was just how little I knew. I went from a position of thinking that I knew a reasonable amount about a subject to realising that I really didn't know that much at all. And, thinking about it, you have to worry because...

...what if the things I think I know, I actually don't? How does one tell that one know nothing about a subject? You have to know enough to know that you don't know much... but if you don't know enough to know you don't know much then you might think you know lots but actually know next to nothing. And the view you have of that aspect of the world, that you know is reliable, might actually be a complete fantasy based upon your current ignorance. But you don't know that, because you know so little that you think you know a lot. I think. Maybe.

And now I need to go and have a lie down in a darkened room until I manage to un-knot the above.

Tuesday, 24 March 2009

How to Lose Staff and Influence People

So, yesterday was a bit of a mixed bag. I finally got to put the thing I've been working on into some hardware so I can see what it looks like in something approaching the box it should be in (rather than seeing it on my development machine). It was a glorious moment. In the space of about a month, a very small team of developers have turned around something that outperforms the application it's supposed to replace by so much that I just sat back with a massive, massive grin on my face. It just works, in every way. And on top of that, the code base is almost 1/10th the size of the original. And on top of that it's also been structured such that if you want to add functionality or change the look and feel, you have next to no code to write; it'll just load up whatever extra stuff you generate and incorporate it into itself (of course, no one but the current development team know the extent of the awesome in that respect). Even though I do say so myself, it's a good solution. It's been designed. We spent a lot of time and effort making sure that it does exactly what it needs to, and doesn't rely on lots of special cases and conditional hacks.

And so life is good. This, after all, is why I'm an engineer - it's only partly for the money (though that's sort of important). As I've observed a couple of times, engineering stuff is 90% miserable, difficult grind. But the payoff when you get something working right is worth all the pain. I tried to explain to my wife just how cool what we've done is, and I'm sure she thought I'd lost the plot somewhat: I get excited about it because the whole thing is elegant, and hangs together with the right-ness of something that has been designed and implemented well. I'm not talking about an intellectual analysis here - sometimes, things just feel right. And the more you delve into the design, and look at the details, and use it, the more you feel that. It's wonderful. It's why I do my job. And it's why I get so very pissed off when people force me to do my job wrong, or interfere when things are out of the hands of the designers and cark it up, or just don't get it, and in doing so undo all the right-ness.

Which brings me to the second half of the day. Now, I know I get a bit... how to put it... in your face with people at work sometimes. And because I know it, I actively try not to be in a position that I have to deal with people doing stupid things. And when I do have to, I run things past colleagues who I trust before I open my big mouth. It means I generally don't send emails to people when they've done something stupid pointing out they've done something stupid anymore, but instead send long considered messages about how it "might be even better" if we did x. One side effect of this is that it now takes me in excess of quarter of an hour to send even the simplest email to anyone outside my immediate team. It seems my precautions are wasted, since even after spending that amount of time writing my mail, even after getting it vetted by third parties, even when my direct superior admits he can't see anything wrong with what I've said, I still get a warning for writing aggressive emails. And what am I getting uptight (allegedly) about? Well. Let's see. The company I work for has a spectacular track record of making frankly bizarre arbitrary design and production decisions. I'd go into details, but I don't really feel I have the freedom to do so, but what it comes down to is that the organisation is incapable of either admitting (and learning from) mistakes, and has an obsession with meddling. Not a thing seems to get done without someone interfering from a position of complete ignorance. When it gets to the point that black box replacement components, which the design company state are direct replacements but with lifespan and reliability improvements, are vetoed by a technician with no consultation at all with our internal design team, you have to wonder what the point of having a design team is. I mean, I don't want to go to overboard on how amazing we are, but some of us have spent nearly ten years just training to do our jobs, before you even look at our industrial experience. Why hire people like that if you're just going to ignore them?

And I'm not even going to begin to rant about how let down I feel by the rest of the company. Apart from to state this: It does not take three months to set up an agreement with a distributor. If it does, then your commercial team need quietly taking out the back and shooting.

So, in summary: a good way to break the spirit of your staff, even when they can take pride in their own work, is to get them to the position where they feel let down by every other aspect of the company, cut them out of all communication that touches on their area of expertise as soon as any individuals outside their immediate team need to be involved, arbitrarily assume that your design professionals don't understand what they're designing and overrule their decisions, and if anyone tries to point out any cock ups, tell them to shut up. Oh, and for those of you that advocate the gently gently style of pointing out problems: Tried that. For months. As have my direct colleagues. It just gets ignored.

Well, that's me at my wits end. Anyone need a software engineer?