Posts

Showing posts from July, 2012

Hacking the Sudoku solver from The Ruby Programming Language

Image
On only page 18 of Flanagan and Matsumoto's excellent "The Ruby Programming Language" a relatively complex example is presented: a Sudoku puzzle solver. I've had a decades-long interest in maze solvers, and this tied in nicely with that. I resolved to give the code a close look when I'd finished the book. And surprising myself, I soon did. I read it cover-to-cover, frequently even re-reading sections I'd already covered when a lack of mastery of specific material became evident later. The language is a nice alternative to Perl, which had been my scripting language of choice since 1998. Ruby has a lot of cool characteristics, even if it sometimes falls weakness to Perl's desire to appease too much diversity in coding styles. I personally think being able to do things effectively two different ways is inferior to being able to do things as effectively only one, as the latter makes multi-author code easier to follow and coherently maintain. But as usu

Mount Diablo Time Trial: the numerator problem

Image
Last post I talked about the denominator issue I had with the Diablo hillclimb time trial. There I converted my present weight to my weight when I set my Old La Honda PR late last year and concluded that my time, which would have put me 3rd in my category, was pretty good, and that therefore my numerator was fine: my power was basically on target. But that level of analysis really doesn't stand muster. I have the data available to estimate my power: I just need to run the numbers. I could use Strava's estimated power but that's based on an undocumented model. It's easy enough to download data from Strava myself and run my own calculations. So here I go: Diablo starts at relatively low altitude and the time trial climbs a net of only 520 vertical meters so the air is fairly thick: I assumed 1.15 kg/m³. I know my mass at ride time (59 kg), my bike's mass (approx 5.1 kg), and the mass of stuff on my body (1.5 kg estimated). My tires are Vittoria Chronos pumped

Mount Diablo Time Trial: the denominator problem

As I was standing at the finish of the Mount Diablo Time Trial , I suddenly remembered that I'd left a pack of Gu in my pocket. Gu was sponsoring the race and there had been a box of peanut butter Gu's at registration. I'd taken one and put it in my back pocket, intending to leave it with the backpack I had stashed at the start line. But I'd forgotten... would have been better to push it under the leg of my bib shorts where I'd be less likely to overlook it. All of this seems like a lot of fuss over a little Gu, but Gu packs are 30 grams each. That's around 0.5 seconds extra climbing time for the course , which consists of the first half of the climb to Diablo summit from the north ( formula for estimating this sort of thing ). Sure, usually 0.5 seconds doesn't matter, but sometimes it does. As it turns out, I ended up 5th in my age group, 1.9 seconds out of 4th, 5.0 seconds out of 3rd. So 0.5 seconds alone didn't make a difference. But people s

proposed crash rule for Grand Tours

Image
My pick for the bottom step of the Tour podium was Ryder Hesjedal. Unfortunately, I never got a chance to see whether he was up to the task. He crashed on the sixth stage and abandoned before the next stage . For as long as I've followed cycling, crashes in the Tour, Vuelta, and Giro have taken their toll on the general classification. Serious contenders are either taken out of the race outright, or lose so much time they are no longer in a position to contend. Crashing is a part of racing. Bike racing isn't about finding he physiologically superior rider, although physical aptitude a part of success. It's also about strategy, about tactics, and about luck. Luck is a critical component to the interest of cycling. Crashing is just one component of cycling's luck. Bike racing is carried out on real roads, for example, and real roads provide the risk of changes in weather, shifts in the wind, and debris which can lead to punctures. And since real roads aren'