Page not found – Not Even My Wife Reads This
type: channel
description: Python, Linux, Bicycles, Books, Games, Etc.
date: 2015-04-19T22:46:02Z
update period: hourly
update frequency: 1
update base: 2000-01-01T12:00+00:00
generator agent: https://wordpress.org/
items: DC Randonneurs Frederick 300 km Brevet Ride Report
items: DC Randonneurs Warrenton 300 km Brevet Pre-Ride
items: PyPy 2.5 Speed Test
items: Why is Go slower than Python for this parallel math code?
items: A Quick Test of PyPy-STM
items: DC Randonneurs Pastries and Coffee 209 km Brevet
items: Team Double the Blues Fleche
items: DC Randonneurs Warrenton 300 km Brevet
items: DC Randonneurs Paul's Paradise 200 km Brevet
items: DC Randonneurs Wilderness Campaign 200k Brevet / Get Well Soon Lynn

DC Randonneurs Frederick 300 km Brevet Ride Report
type: item
date: 2015-04-19T22:41:24Z
creator: dripton
subject: Bicycles
description: Here's the route map. Three weeks after a very slow and very cold Warrenton 300 pre-ride, I decided to ride the Frederick 300. I wasn't sure if this was the best choice — with only two rides longer than my 11-mile commute leg all year, a 200 km permanent might make more sense. But I […]
encoded: Here's the route map. Three weeks after a very slow and very cold Warrenton 300 pre-ride, I decided to ride the Frederick 300. I wasn't sure if this was the best choice — with only two rides longer than my 11-mile commute leg all year, a 200 km permanent might make more sense. But I finished Warrenton, and the numbness in my left index finger had mostly gone away, so why not? I figured the worst thing that was likely to happen was being very slow over the early climbs and riding alone in the back all day. It was about 45F at the start with a forecast high around 80, and then a forecast low Saturday night around 44. If I weren't so slow this year I would have just dressed for 45 and not brought anything else, but after almost freezing my hands off at the end of the Warrenton pre-ride when it got down into the low 20s, I wasn't taking any chances. I brought several items of just-in-case winter clothing: lobster claws, balaclava, rain jacket. I considered bringing a Camelbak, because of the forecast high temperature and gaps of up to 41 miles between stops, but decided that two Zefal Magnum bottles (advertised at 1L of capacity, but actually only holding 28 oz.; caveat emptor) were enough. We got a good-sized group: about 40 riders. Impressive considering we have 3 300s this spring. With most of the climbing in the first third of the ride, my strategy was to avoid burning any extra energy at the start so I would have something left for the last 100 miles. With that in mind, I started near the back of the pack and did my best to stay there. The ride started at 5 a.m. and went through empty downtown Warrenton, with the big group running every red light after verifying the lack of cross traffic. I slipped off the back early on some small hills, and by mile 3 got permanently separated from the big group when they crossed US 15 a few seconds before me, then I had to wait for cross traffic to clear. Riding alone, with my poorly aimed helmet light making reading the cue sheet…

DC Randonneurs Warrenton 300 km Brevet Pre-Ride
type: item
date: 2015-03-29T20:43:06Z
creator: dripton
subject: Bicycles
description: I volunteered to organize the Warrenton 300, which meant I also got to do the pre-ride. Unfortunately, due to an unusually cold, snowy, and late winter, our rides keep getting postponed this winter and "spring." The 100 km populaire that was supposed to happen on January 17 got moved back a week to January 24, […]
encoded: I volunteered to organize the Warrenton 300, which meant I also got to do the pre-ride. Unfortunately, due to an unusually cold, snowy, and late winter, our rides keep getting postponed this winter and "spring." The 100 km populaire that was supposed to happen on January 17 got moved back a week to January 24, and it was cold enough that water bottles froze. The Pastries and Coffee 200 that was supposed to happen on March 7 actually happened on March 14. And the Urbana 200 got pushed back from March 21 to March 28, conflicting with the Warrenton 300 pre-ride. The net result of all this for me was that I ended up riding a 300 without first riding a 200 in 2015. Not recommended. I went looking for someone to do the pre-ride with me, not really expecting to find any takers since it conflicted with the Urbana 200, but Charlie stepped up. Good thing; I probably wouldn't have finished without him. Thanks Charlie. The weather forecast was pretty dire. Temperatures in the 30s all day, with a small chance of snow at the start. And sustained 15 mph winds out of the northwest all day. The actual weather was a bit worse than the forecast — it got down to 23 by the end of the ride, and the winds got up to 20 sustained, 25 gusts. The only good thing about the forecast was that since it was supposed to be cold all day, we didn't have to mess around with removing and stowing clothes as it warmed up, putting on sunscreen, etc. Charlie and I shared a room at the Hampton Inn. I didn't sleep well, and got up at 4:15 needing 3 or 4 more hours of sleep. I was ready to go at 4:45, after having a Clif Bar for breakfast, but Charlie took longer, and we didn't actually roll out until 5:07. The light at 211 that doesn't usually change for even large groups of bikes changed for us right away, before I even hit the pedestrian button — maybe they fixed the sensor. (I recommend that someone hit the button anyway.) I led us through sleepy Warrenton and up to route 55, then Charlie pulled for a whi…

PyPy 2.5 Speed Test
type: item
date: 2015-02-20T02:09:50Z
creator: dripton
subject: Programming
subject: Python
description: I saw there was a new version of PyPy available, and realized I hadn't benchmarked it in a while. So here's a quick test of CPython 2.7 versus PyPy 2.2.1 (the default on Ubuntu 14.04 LTS) and PyPy 2.5 (the latest and greatest, unless you're reading this post in the future). The benchmark is simply […]
encoded: I saw there was a new version of PyPy available, and realized I hadn't benchmarked it in a while. So here's a quick test of CPython 2.7 versus PyPy 2.2.1 (the default on Ubuntu 14.04 LTS) and PyPy 2.5 (the latest and greatest, unless you're reading this post in the future). The benchmark is simply running all of my Python Project Euler solutions on each of these Python versions, throwing away any that didn't work or took longer than 60 seconds on any of them, and then dumping all the runtimes. There is definitely some random noise in the numbers, but it should mostly even out over many programs. (There were 145 that made the time cut this time.) I ran these on Ubuntu 14.04 on an Amazon EC2 c4.2xlarge instance. (A Haswell Xeon CPU running somewhere in the 2.9 – 3.2 GHz range depending on whether Turbo Mode is engaged, 4 or 8 cores depending on whether you count HyperThreading, 15 GB.) I'll give the results first in case you don't want to scroll past the big table: PyPy 2.5 177.35s, PyPy 2.2.1 208.11s, CPython 2.7 616.73s. So PyPy 2.5 is about 17% faster than PyPy 2.2.1 on this benchmark, a nice sign that PyPy keeps getting faster even though much of the low-hanging fruit was picked long ago. And PyPy is about 3.5 times as fast, or 250% faster, than CPython 2.7 on this benchmark. I don't see any interesting cases where CPython significantly beats PyPy. We used to see cases like that, but as PyPy has matured it's become more consistently fast on a larger set of programs.) I guess the closest to an interesting result is euler225.py, where CPython beats PyPy 23.74s to 27.75s. Not a huge difference, but worth taking a look. I may try to figure out what's going on and post a followup. script PyPy 2.2.1 PyPy 2.5 CPython 2.7.6 euler1.py 0.31 0.10 0.31 euler2.py 0.31 0.10 0.10 euler3.py 0.20 0.10 0.10 euler4.py 0.10 0.10 0.10 euler5.py 0.10 0.10 0.10 euler6.py 0.10 0.10 0.10 euler7.py 0.10 0.10 0.20 euler8.py 0.10 0.10 0.10 euler9.py 0.10 0.10 0.10 euler10.py 0.99 0.71 3.20 e…

Why is Go slower than Python for this parallel math code?
type: item
date: 2014-08-04T04:44:30Z
creator: dripton
subject: Programming
subject: Python
description: I was recently messing around with one of my old Project Euler solutions (specifically, problem 215) to test PyPy's new software transactional memory feature, and decided to port it to Go to see how the code compared. The first question I had was how to do generators in Go. Python has the magic yield statement, […]
encoded: I was recently messing around with one of my old Project Euler solutions (specifically, problem 215) to test PyPy's new software transactional memory feature, and decided to port it to Go to see how the code compared. The first question I had was how to do generators in Go. Python has the magic yield statement, so you can do things like this: def gen_ways(width, blocks): """Generate all possible permutations of items in blocks that add up to width, as strings.""" if width == 0: yield "" else: for block in blocks: if block <= width: for way in gen_ways(width - block, blocks): yield str(block) + way The Go equivalent is a function that returns an output-only unbuffered channel, which returns the output from a goroutine. It's not quite as terse, but then it didn't require adding extra support to the language, either. /* Generate all possible permutations of items in blocks that add up to width, as strings. */ func gen_ways(width int, blocks []int) chan string { out := make(chan string) go func() { if width == 0 { out <- "" } else { for _, block := range blocks { if block <= width { for way := range gen_ways(width-block, blocks) { out <- strconv.Itoa(block) + way } } } } close(out) }() return out } Longer, but it's very nice to be able to do this without an additional keyword. One gripe: the channel is logically output-only, but the code doesn't work unless I make it bidirectional. (Because the function is recursive?) The next function to port looked like this: def build_mirrors(ways): mirrored = set() mirrors = set() for way in ways: rev = "".join(reversed(way)) if way != rev: low, high = sorted([way, rev]) mirrored.add(low) mirrors.add(high) return mirrored, mirrors Go lacks a builtin set. I considered just building my own with a map, but instead pulled in github.com/deckarep/golang-set. Which worked okay. One annoyance was that I couldn't just declare a set and have a useful set; I had to call mapset.NewSet(). Can't really fault the author of the set module for that …

A Quick Test of PyPy-STM
type: item
date: 2014-08-01T02:33:08Z
creator: dripton
subject: Python
description: The Software Transactional Memory branch of PyPy has been under development for a while now, and the first binary release was made available earlier this month. (See the announcement.) So I went digging through my collection of Project Euler solutions, looking for a good candidate to test with pypy-stm. Basically, I needed a CPU-bound program […]
encoded: The Software Transactional Memory branch of PyPy has been under development for a while now, and the first binary release was made available earlier this month. (See the announcement.) So I went digging through my collection of Project Euler solutions, looking for a good candidate to test with pypy-stm. Basically, I needed a CPU-bound program that used multiple threads, and didn't depend on C libraries that weren't available in PyPy. I found one, my solution to Project Euler Problem 215. It used the multiprocessing module to run on multiple CPU cores (without tripping over Python's global interpreter lock and ending up with single-core performance). But multiprocessing uses almost the same interface as threading, so it just took a few simple tweaks to switch it over. Here's the multiprocessing version: #!/usr/bin/env python """Project Euler, problem 215 Consider the problem of building a wall out of 2x1 and 3x1 bricks (horizontal vertical dimensions) such that, for extra strength, the gaps between horizontally adjacent bricks never line up in consecutive layers, i.e. never form a "running crack". For example, the following 9x3 wall is not acceptable due to the running crack shown in red: 3222 2232 333 There are eight ways of forming a crack-free 9x3 wall, written W(9,3) = 8. Calculate W(32,10). """ import sys import multiprocessing sys.setrecursionlimit(100) def gen_ways(width, blocks): """Generate all possible permutations of items in blocks that add up to width, as strings.""" if width == 0: yield "" else: for block in blocks: if block <= width: for way in gen_ways(width - block, blocks): yield str(block) + way def build_mirrors(ways): mirrored = set() mirrors = set() for way in ways: rev = "".join(reversed(way)) if way != rev: low, high = sorted([way, rev]) mirrored.add(low) mirrors.add(high) return mirrored, mirrors def find_cracks(way): """Return the set of indexes where cracks occur in way""" result = set() total = 0 for ch in way[:-1]: total += int(ch) result…

DC Randonneurs Pastries and Coffee 209 km Brevet
type: item
date: 2014-07-23T22:59:02Z
creator: dripton
subject: Bicycles
description: DCR doesn't usually run brevets in July or August. It's often really hot and lots of people are on vacation. But this year, at the last minute, we added a new 200 out of Severna Park, Maryland. I hadn't ridden much in the Baltimore 'burbs, so this was a nice chance to see some different […]
encoded: DCR doesn't usually run brevets in July or August. It's often really hot and lots of people are on vacation. But this year, at the last minute, we added a new 200 out of Severna Park, Maryland. I hadn't ridden much in the Baltimore 'burbs, so this was a nice chance to see some different roads. The route, shown here, starts in Severna Park and basically just scribbles north and south all over the place. You wouldn't think that it would be very hilly, and you'd be correct if you're comparing to a route that crosses actual mountains, but there are surprising number of streams and rivers to cross in that part of Maryland, and every one is preceded by a downhill and followed by a little climb. Somewhere around 6000 feet of climbing in 130 miles. The weather was forecast to be unseasonably cool, which meant starting in the low 70s and peaking in the high 70s, which meant no concerns about clothes. Shorts and short-sleeve jersey all day. I did pack a cycling cap in case it rained, but didn't bother with a rain jacket since at that temperature it would just mean getting wet from sweat instead. I made sure to apply sunscreen, and brought some Ibuprofin in case my knee acted up, but otherwise it was a really easy packing job. I resumed bike commuting (25 miles/day) on July 2 (after about two years of telecommuting a.k.a. not riding enough), so I was curious whether 2.5 weeks of steady riding would help with my 200 km pace, and with the stability of my left knee. I figured it was probably not enough time to make much difference. It's about an 80-minute drive from my house to Severna Park, so I got up at 4:45 and left the house around 5:15. Arrived at Big Bean around 6:30 and the place was overrun with cyclists. There had only been about 20 riders pre-registered when I signed up a week before, but about 50 showed up to do the ride. They ran out of brevet cards and had to improvise for the last couple of riders. So I guess that shows that people will show up for a July brevet,…

Team Double the Blues Fleche
type: item
date: 2014-04-28T23:21:32Z
creator: dripton
subject: Bicycles
description: Looking at the DC Randonneurs calendar for 2014, I decided not to ride the fleche. First, I wasn't sure if I could handle the 360 km (223 mile) minimum distance, since I hadn't finished a ride that long since fall 2012. And I particularly didn't want to fail to finish a team event, where I'd […]
encoded: Looking at the DC Randonneurs calendar for 2014, I decided not to ride the fleche. First, I wasn't sure if I could handle the 360 km (223 mile) minimum distance, since I hadn't finished a ride that long since fall 2012. And I particularly didn't want to fail to finish a team event, where I'd be hurting my teammates not just myself. Second, it was scheduled for the week before the 400 km brevet, so even if I could finish, I might not be able to recover, and might end up having to miss the 400. After the 300 km brevet, two weeks before fleche, George W. asked if I might want a spot on his fleche team. I was sore and tired after a poor finish to that ride, so I told him I was not interested. Then, a few days later, Nick asked me the same question via email. By then I was no longer sore and the pain of the last 20 miles of the 300 had started to recede from my memory, so I changed my mind and decided to ride. (Without such selective memory, there would be no endurance sports. We'd all be smart enough to stick to non-painful distances.) Just a few days before the fleche, Christian crashed his bike on gravel and had to withdraw from the team, leaving us with only 4 riders. We were prepared to ride with 4, but then Dave S., who had previously dropped out of the team, decided to rejoin, so we were back to the full 5. We had some a few small changes to last year's route. An optional gravel detour (to avoid a few miles on high-traffic Route 522) was added to the route, but everyone except Nick decided not to take it. The Westover 7-11 closed, so we changed the start control to the Wells Fargo ATM next door. Tolliver's Grocery (with barbeque) and Baker's Store weren't really needed to guarantee the 360 km distance, so they were removed as controls. The updated route is here. The pre-ride forecast was for about 50 degrees and dry at the start, wind and a 25% chance of rain during the day Saturday, a high around 75, and then a low in the low 40s Saturday night. So we …

DC Randonneurs Warrenton 300 km Brevet
type: item
date: 2014-04-15T13:41:21Z
creator: dripton
subject: Bicycles
description: After the cold, wet, hilly Paul's Paradise 200k, I was ready for spring and fewer hills. The Warrenton 300k is relatively flat, and April is warmer than March. The forecast a few days out had a chance of rain on Saturday, but as the ride got closer the chance of rain went down to zero. […]
encoded: After the cold, wet, hilly Paul's Paradise 200k, I was ready for spring and fewer hills. The Warrenton 300k is relatively flat, and April is warmer than March. The forecast a few days out had a chance of rain on Saturday, but as the ride got closer the chance of rain went down to zero. I packed my rain jacket anyway, but was cautiously optimistic. This year's innovation was adding some gravel sections to the route. I mostly ride brevets on a road bike with 25mm tires, so gravel doesn't thrill me. The pre-ride report was that some of the gravel was new and not easy to ride on skinny tires. I do have a touring bike with 30mm tires, and I would have ridden it if the gravel were mandatory, but there were paved options to bypass the gravel so I decided to skip it so I could ride the lighter bike with better brakes. So far in April, I'd done a couple of 20-mile rides Wednesdays after work, and a 60-mile ride the previous Saturday. Not a lot, but, on top of the 2 200-km brevets I did in March, I thought I was approaching a reasonable mileage base for a 300. My main concern was my left knee, which got sore enough to make me bail out of the fleche last April at around 150 miles. I hadn't done that distance since, so I couldn't be sure my knee would make it 300k. But I thought the recent rides were helping it, since it started hurting around 50 miles in March but I made it 60 miles without pain in April. My weight had been 203 lbs. (dehydrated and glycogen-depleted) on Thursday, but two days of pre-ride carbo loading had it up to 211 (glycogen-stuffed and retaining water). A bit more than I wanted; next time I'll eat light on Thursday and only eat heavy on Friday. Our 300s start at 5 a.m. I live about 45 minutes from Warrenton, so I packed the bike the night before and set the alarm for 3. I tried, but failed, to get to sleep early, and so only got about 4 hours of sleep. I threw several caffeinated Gu packets in my bag, just in case I got sleepy during the ride…

DC Randonneurs Paul's Paradise 200 km Brevet
type: item
date: 2014-03-31T21:36:31Z
creator: dripton
subject: Bicycles
subject: Uncategorized
description: Our second 200 of the year was Paul's Paradise, a very hilly route. The weather forecast was 40s and rainy. Bleh. If I were in better shape, I may have decided to skip it. But with only 2 weeks until the 300, I really needed the miles, so I gathered up my rain gear. I […]
encoded: Our second 200 of the year was Paul's Paradise, a very hilly route. The weather forecast was 40s and rainy. Bleh. If I were in better shape, I may have decided to skip it. But with only 2 weeks until the 300, I really needed the miles, so I gathered up my rain gear. I have two bikes with fenders. One is a fixed gear — nope. The other has fiddly cantilevers that are always going out of adjustment. (I own some nicer Paul cantis but haven't got around to installing them yet.) The thought of going down a wet Mar-Lu Ridge with brakes I don't really trust — nope. So I decided to ride my Litespeed road bike, sans fenders. I figured I'd eventually get soaked with or without them, and I probably wouldn't be going fast enough for anyone to want to draft me anyway. Though, with hindsight, maybe I should have attached my Race Blades, which aren't as good as real fenders but are better than nothing. I wore a short-sleeve wool jersey, shorts, heavy tights, cotton socks, wool socks, summer mountain bike shoes, a balaclava, light full-finger gloves, a rain jacket, and a reflective vest. I started with the jacket's pit zips open (but mostly blocked by the vest). I also had some arm warmers and an extra set of gloves in my bag. Hindsight says I should have worn my winter boots, which are waterproof. (Though maybe they would have made my feet too warm.) Or, at least, two pairs of wool socks. I started the ride at a carbo-loaded 208 lbs., only 1 pound less than the ride 3 weeks ago. I've lost almost 40 lbs. since October, but very little in March, as I reduced my calorie deficit to keep from losing too much muscle mass along with the flab. I'd never ridden this route before, but I rode the similarly hilly Urbana 200 at 228 lbs. last March, and hoped the 20 lbs. of weight loss would, if not getting me back to the midpack speed I had when I was riding every day, at least let me finish before dark. My left knee started hurting on Urbana last March, and got bad enough on …

DC Randonneurs Wilderness Campaign 200k Brevet / Get Well Soon Lynn
type: item
date: 2014-03-11T21:19:33Z
creator: dripton
subject: Bicycles
description: A couple of weeks before our first 200k of the year, Lynn and Maile were hit by a psycho in a CR-V, while riding a permanent. Maile is okay, but Lynn is still in the hospital and has a long way to go to make a full recovery. This awful incident is a reminder that […]
encoded: A couple of weeks before our first 200k of the year, Lynn and Maile were hit by a psycho in a CR-V, while riding a permanent. Maile is okay, but Lynn is still in the hospital and has a long way to go to make a full recovery. This awful incident is a reminder that even the safest and most experienced cyclists are at the mercy of any drunk, distracted idiot, or nutjob in a motor vehicle. In my opinion, the penalty for hit and run needs to be increased to the point where no even slightly rational person would ever consider doing it. A decade in prison and lifetime revocation of driving privileges seems about right. Fortunately, the vast majority of people out there are decent and kind. Thanks to everyone who helped Lynn and Maile. It's been an unusually cold and snowy winter, meaning a lot of cyclists have been riding less than usual. (Of course the hardcore R-12 crowd finds a way to get a 200k in every month regardless of the weather, and thus don't have to beat themselves back into riding shape in the spring. They might be onto something. But it's so cold in January…) I hadn't done a long ride since dropping out of the fleche with a knee injury last April, so I was worried about whether my knee would hold up for the full distance. My warm-up rides were a hilly 100k back in early February (which I completed without drama but very slowly), and a couple of 35-milers since. Not enough, but it would have to do. I'd been dieting hard for months and had dropped from my bloated high of 245 lbs. down to 207 a couple of days before the ride, though I carbo-loaded myself back to 209 with a big dinner Friday night. I also tweaked my serratus lifting on Thursday, but I didn't think that would matter much for cycling. The forecast was for just below freezing at the 7 a.m. start and 50s by the afternoon. So we needed to be prepared for a wide temperature range. I wore shorts and a summer jersey, thermal tights and heavy winter jersey, cotton and heavy wool socks, su…