Posts

  • Christmas Starts

    Sainsburys had Lindt Christmas chocolates in store today.

    At least they didn’t have the decorations up.

    It’s just too early.

  • SXC 2007 Round 7: Glentress

    I wasn’t the only one that was disappointed to hear that round seven of the SXC had been moved to Glentress instead of the original Aviemore venue. Of course, Andy Wardman had a few tricks up his sleeve, and produced what is easily the best Glentress course ever.

    My race started off well, with me in fourth position at the end of the second lap. It was then tha the sore throat I’d had all weekend really started to kick in. I was having trouble breathing, so I slowed down a little, letting a few guys past, but still keeping a good position.

    At the end of the fourth lap I stopped to put on arm warmers, as I was getting pretty cold. I wasn’t feeling any better, and pulled out at the end of the fourth lap.

    So far I’ve had 3 days with some sort of dry-cold, it’s just irritating enough to distract from day-to-day tasks, and to stop me form training.

    I was pretty disappointed with this, especially as it makes my record of Glentress races look even worse:

    • 2002 (Junior) – Third behind the Wardells.
    • 2003 (Junior) – Drifted both wheels a bit too much on (the old) Spooky Wood. Went from 2nd place to a DNF with a broken rear mech.
    • 2005 (Expert) – Broken pedal on first lap. DNF.
    • 2006 – Crashed on the rocky steps going into the Pennyls Vennyl race link. Did another two laps before a prostate pain became agony. DNF.
      2007 – See this post.

    Maybe next year…

  • Rails Plugin: Will_Paginate_Search

    THIS PLUGIN IS NOW DEPRECATED

    The features provided by this plugin are now part of the Acts_as_indexed plugin it originally supported.

    This plugin allows my acts_as_indexed indexed search plugin to interoperate with the will_paginate pagination plugin.

    Install

    Prerequisites

    For this to work you’ll need the following two plugins…

    Install will_paginate_search

    ./script/plugin install http://svn.douglasfshearer.com/rails/plugins/will_paginate_search

    Setup

    Follow through the instructions on setting up acts_as_search in the readme, and give the will_paginate readme a read over too.

    Searching With Pagination

    First argument is the search query (can be a GET variable or anything else), and after that it takes all the standard will_paginate arguments.

    @images = Image.paginate_search 'girl', :page => 1, :per_page => 5

    Other Stuff

    Problems, Comments, Suggestions?

    All of the above are most welcome. dougal.s@gmail.com

    Credits

    Douglas F Shearer

    Donate

    If you find this plugin useful, please consider a “donation (Paypal) “:https://www.paypal.com/cgi-bin/webscr?cmd=xclick&business=dougal%2es%40gmail%2ecom&item_name=Douglas%20F%20Shearer&buyer_credit_promo_code=&buyer_credit_product_category=&buyer_credit_shipping_method=&buyer_credit_user_address_change=&page_style=Primary&no_shipping=0&return=http%3a%2f%2fdouglasfshearer%2ecom&cancel_return=http%3a%2f%2fdouglasfshearer%2ecom&no_note=1&cn=I%20am%20donating%20because%2e%2e%2e&tax=0&currencycode=GBP&lc=GB&bn=PP%2dDonationsBF&charset=UTF%2d8 to show your support!

  • 2007 EUCC Site

    Followers of this blog will know that I’m a devoted (I go to the pub EVERY week) Alumni member of the Edinburgh University Cycling Club. At the last AGM I took on the role of webmaster. And did nothing. Until yesterday!

    The Brief

    • A simple design that gets information across in a clear manner.
    • A gallery to show people rides and social events.
    • Easy maintenance.

    Preparation

    The reason it took me so long to get round to building a site, was that Edinburgh University Computing Services weren’t willing to give me a MySQL database, so that ruled out Wordpress.

    What’s up so far?

    Yesterday I made a simple un-styled page to display all the information regarding upcoming events (especially Freshers Week) and regular rides.

    I then styled this with a very basic style, which quickly grew into something a little more advanced. It even has my favourite style of navigation and orientation; tabs!

    At the moment there is no login for updating content, mostly due to the lack of a database. I hope to solve this by building a Rails REST app running on my own servers, queried by PHP when edits are in progress.

    The Gallery

    Once I had the basic style done, the next thing people were asking for was a gallery. Instead of uploading images to the University servers, I decided to make use of Flickr and their APIs to power the gallery.

    The advantages of this are obvious:

    • Many of our members already have a Flickr account with lots of club photos in.
    • Flickr already has a mature and advanced photo administration interface.
    • Everyone can add photos!

    So a Flickr Group and a quick bit of PHP to query the API had it up and running!

    A bit more PHP added paginations and a few other niceties. This was the first time I had done any PHP in a few months, but despite this, the only real issue I had was remembering to put semi-colons at the end of every line.

    Obviously, this was a good time for Flickr to have an rare outage. Nothing to do with me.

    So there you go, head over and check it out.

  • Acts_As_indexed v0.2.1 Released

    My Acts_as_indexed plugin has been updated to version 0.2.1.

    New in this version is:

    • Search now accepts all the standard Active Record find options.
  • SXC 2007 Round 6 - Drumlanrig Castle

    Gonna be a short one this, really should have written this ages ago.

    The Course

    It had been four years since I had last ridden Drumlanrig, as a junior. The course was almost exactly the same as the courses back then, although not continuing around route no.7 for quite so far.

    The course basically follows route no.7 for the majority of it’s distance. The amazing rooty descents and steep climbs make it a properly fun course to ride lap after lap.

    How’d I do?

    Off the startline I felt good, quickly gaining places on the first steep climb. On the next climb I passed Iain Nimmo and went into 4th position. Down the second descent I passed Andy Barlow who had slid out on one of the corners. I did the same a few corners later, and was passed by Andy, Iain and Andrew Cockburn.

    James FM went past at warp 9 on the final fireroad section, way too fast for me to get on his wheel. For the next few laps I sat with Cockburn while Barlow pulled out a gap on us. On lap 2 I hit my knee on my stem, apologies to the man and his kid standing at that corner for my cursing out loud.

    Lap 4 saw me fall again, this time sliding out on some gravel as I came onto a fireroad. It took me the whole way down the long rooty descent to catch Cockburn. Back onto the fireroad I downed what remained of my coke, and put the hammer down. It was the only time I used my big-ring for the whole race. On the next steep singletrack climb I locked out my forks, and gave it death round the switchbacks to get a decent gap going.

    Going into the final lap I had about 10s, definitely not comfortable in case of accidents. I kept the hammer down and caught and passed Barlow on the first climb.

    The last lap seemed to go super fast, with me only looking back when the trail doubled back. Luckily I had no trouble, and finished 5th, my best XC result of the year so far.

    Hopefully Glentress will be as good.

  • Acts_As_indexed v0.2 Released

    My Acts_as_indexed plugin has been updated to version 0.2.0.

    New in this version is:

    • Major performance improvements.
    • Segmentation of the index can now be tuned.
  • Rails Plugin: Acts_As_Indexed

    Version 0.4.4 released 04 February 2008 – Fixed some minor AR bugs

    This plugin allows ranked boolean-queried fulltext search to be added to any Rails app with no dependencies and minimal setup.

    Install

    ./script/plugin install git://github.com/dougal/acts_as_indexed.git

    If you don’t have git installed, you can download the plugin from the GitHub page and unpack it into the vendor/plugins directory of your rails app.

    Setup

    Add acts_as_indexed to the top of any models you want to index, along with a list of the fields you wish to be indexed.

    
    class Post < ActiveRecord::Base
      acts_as_indexed :fields => [:title, :body]
    
       ...
    end
    

    Searching

    To search, call the find_with_index method on your model to search using the index. The optional ids_only parameter, when set to true, will return only the IDs of any matching records.

    
        # Returns array of Post objects.
    	my_search_results = Post.find_with_index('my search query') # =>  [#<Post:0x314b09c @attributes={"...
    	
    	# Pass any of the ActiveRecord find options to the search.
    	my_search_results = Post.find_with_index('my search query',{:limit => 10}) # return the first 10 matches.
    	
    	# Returns array of IDs.
    	my_search_results = Post.find_with_index('my search query',{},{:ids_only => true}) # =>  [12,19,33...
    

    h4. Boolean Query Options

    The following query operators are supported:

    • AND – This is the default option. ‘cat dog’ will find records matching ‘cat’ AND ‘dog’.
    • NOT – ‘cat -dog’ will find records matching ‘cat’ AND NOT ‘dog’
    • INCLUDE – “cat +me” will find records matching “cat” and “me”, even if “me” is smaller than the min_word_size.
    • ”” – Quoted terms are matched as phrases. ‘“cat dog”’ will find records matching the whole phrase. Quoted terms can be preceded by the NOT operator. ‘cat -“big dog”’ etc.

    Pagination

    Pagination is supported via the paginate_search method whose first argument is the search query, followed all the standard will_paginate arguments.

    
    @images = Image.paginate_search 'girl', :page => 1, :per_page => 5
    

    Other Stuff

    Full Documentation

    You can either build the rdoc by running rake rdoc in the acts_as_indexed directory, or look at the latest version online.

    Problems, Comments, Suggestions?

    All of the above are most welcome. dougal.s@gmail.com

    Credits

    Douglas F Shearer

    Donate

    If you find this plugin useful, please consider a donation to show your support!

  • The £4.29 Riding Glasses

    Over the years a few people have tried to express the virtues of industrial safety specs for use when riding. I pretty much dismissed this, partly through a hatred of wearing specs while riding, and partly because I thought I could so without. It needs to be pretty damn sunny before I’ll even consider breaking out the sunglasses, and even then I’ll have them on my helmet more than on my face. Poland of course, was the place that had enough sun to change my mind.

    Over the last year I have had a few incidents that have made me think more carefully about whether I wear glasses when riding or not. In a nighttime cyclo-cross race last year I lost a contact lens, as I did in the second round of the Ingliston Crit Series this year. At the Fort William SXC, and the recent Selkirk Merida I had plenty of trouble with dirt in my eyes, at some points being unable to see for the water in my eyes.

    Enter a set of Superior Safety Specs from Screwfix Direct. At £4.29, it was worthwhile risk to see how good they actually were. From here on I’ll split the review up a bit for convenience.

    Aesthetics

    Conventional safety specs tend to be clear plastic numbers, function at any cost. These safety specs look like regular riding glasses, in fact, they are hard to tell apart from their considerably more expensive counterparts.

    Optics

    While the optics are never going to win awards, they do the job well enough. I never felt while using these that the lens was interfering with my vision. The lens also wipes clean with the snot-wipe on your glove, leaving only a few minor streak marks behind. I’ve yet to scratch them, probably something to do with the lenses being pretty tough polycarbonate.

    Build Quality

    Despite the cost, these are really well build. Not surprising when you read the minimal documentation that comes with them, which informs you they should protect you from medium-speed small projectiles. Ideal on the bike then!

    Fit

    These fitted me perfectly, surprising considering that my eyelashes touch the inside of the lenses on most glasses. The wide wraparound means that peripheral vision is excellent, and the chunky frame wasn’t as obtrusive as I had expected. The only fault I can find, is that the optic quality drops within 1mm of the frame, but this is only an issue if you ride with your head down, and your eyes up to see 200m+ ahead.

    Overall

    I like these so much I’m going to buy the 5-pack. Several riding friends have tried them on, and been impressed by the fit and optical quality for glasses so cheap. It really is hard to find fault with them, and apart from those who ride with their head at odd angles, everyone should rush out and buy a pair of these.

    For more photos, check out my Superior Safety Specs Flickr Set.




    Questions

    It looks like I missed some good points in my review, thanks to Iain for the following questions:

    Do they fog up in humid conditions? – Rode them in the rain the other day, they only steam up if you stop for a good few minutes, but it quickly clears when you start riding again. I didn’t experience any fogginess while riding.

    Do the lenses stain? – After a muddy ride the other day, I cleaned them with soapy water this morning. There was no marks on the lenses at all afterwards.

    Are the legs and nose bridge rubberized, and do they slip around when things get sweaty? – I hadn’t actually looked at this previously, as the rubber is exactly colour-matched to the rest of the frames. But yes, they are rubberised, and no, they do not slip around, they stay firmly planted even in the roughest and wettest of conditions.

    If anyone has any other questions, stick them in the comments below and I’ll get them answered.

  • Selkirk Merida 2007

    After hearing about the Selkirk Merida and it’s dusty dry singletrack for the past three years, I thought it was time I gave it a go.

    So it rained, yah! Was still an awesome course, and because of the daily torture in Poland my legs were feeling great. Unfortunately I had a series of mechanical incidents that kept holding me back.

    30km – Front wheel puncture, wasn’t even ware of hitting anything.

    40km – Miss the (poorly signed) feedstation, turn in the road, falling over on the greasy surface. James Fraser-Moodie amused greatly. Front shifter damaged so shifting sticky.

    55km – Rear brake wears all the way to metal on the first part of the Minch Moor descent, rest of race done with just the front brake.

    65km – New saddle comes loose on rooty descent before second last feed station, probably due to my very out of control riding due having only one brake.

    75km – Front shifting completely broken, stuck in the big ring to the finish.

    Finished in just over 4:30, not entirely shabby.