This Space for Rent

Feb 28, 2009

Time to write some database code

So far this year, I’ve managed to ride my bicycle something on the order of 2200km. I don’t know exactly how far I’ve ridden it, because I don’t actually have any good way of recording how long I’ve been out on the line. I do have a [el-cheapo US$1] cycle computer, but I’ve clipped the sensor lines off it and I’m using it as a handlebar mounted clock. (I’ve found that if I have a speedometer gazing balefully up at me I tend to overpush myself early in the day and end up being a large peach-colo(u)red slug on the way back home. If I just have a clock, it lets me know when I need to turn around so I won’t run out of {sun|school day}, and then I can find my average speed when I get back home and plot my route on a map. This isn’t that great for actually recording it, though.)

I used an online social milage bookmarking website for a while, but after getting a couple of contacts there I found the record-keeping getting overwhelmed by the social aspects. Which are fine, I’m sure, but when it comes to bicycling I’m very much a hermit and I’m much more interested at knowing how close I am to getting back to being able to do 200 or 300km loops without either dying or running out of daylight.

I can write things down in a textfile, then manually run ploticus or some similar program to build graphs, but that’s not quite as pointy and drooly as I’d like it to be. So I guess I’ll have to sit down and make up some code to spit up a milage chart, do authentication, and edit that chart. In K&R C, or maybe in FORTRAN.


New Code!

Discount has been rolled up to version 1.3.4 with the addition of a couple of bits of new code;

  1. First, I’ve modified the table-of-contents handing so that there’s a new function (int mkd_toc(Document*,char**)) which gives you back a malloc()ed string containing the compiled html for the table of contents (mkd_toc() returns the # of bytes allocated, 0 if there’s no toc, and EOF on error.) This is a first step of a planned rework that will arrange things so that every core function that prints to a FILE* will have a corresponding function that will populate a string for you.

  2. Secondly, I just recently became aware that there’s a newer version of the standard Markdown test suite (fallout from the recent Solaris port; the rdiscount gem had a rake task which mentioned a 1.0.3 conformance test, which I then found by the traditional method of using a search engine) which isn’t quite compatable with the old 1.0 test suite, and which discount failed on three of the tests.

    One of the tests was the old bugaboo of “preserve trailing whitespace except on the first line of a codeblock” which was changed to the correct behavior of “preserve trailing whitespace always”, but the other two were a new (and undocumented, except in the test suite) style of implicit reference link that doesn’t have the second set of [] on it. So now, a reference link like [foo] expands to <a href="what foo is">foo</a> instead of simply being a parenthetical comment with square brackets (or an array index. Whatever works for you.)

    Supporting this new behavior was a matter of maybe 20 minutes of work, but I also added test suites for it as well as a mkdio.h flag (MKD_1_COMPAT, 0x2000, or -f1.0 for the markdown command line program) to make discount revert back to the old MarkdownTest_1.0 compatable behavior – and that was enough for one day’s work.

This code should be pretty safe. Yes, it does add new code paths (particularly the table-of-contents code around mkd_toc(), which I have not tested as thoroughly as the other code (annotations doesn’t use it, nor does the copy of theme that’s embedded in the discount distribution) but it’s not very much new code and the tentacles have been lopped off once already so you should be okay with them. So it’s the ideal candidate for New Code! which you should grab, install, and use starting right about now.

I’ll be over here in the bomb shelter, waiting to hear the bug reports going off (and one already went off! I managed to break the “two trailing spaces becomes a <br/>” rule. Fixed, and that makes the code version 1.3.4.)

Feb 27, 2009

Friday Dust Mite Blogging™


Dust Mite may get cold feet, but it’s hard to find gloves that actually fit.

Feb 26, 2009

Railroad picture of the day


I was very late heading out on the line today, but when I reached the bridge over the Yellow Menace, I looked south at the signal to see if it said anything interesting. It was green, so I looked north to see if I could see a train, and there were headlights right there coming towards me very fast.

So. Slam on the brakes, jump off the bike, flip down the kickstand, open the pannier, yank out my purse, and pull the camera out while bolting across the bridge to get to the north side. The train was moving fast, but I was moving faster, and I didn’t even break anything in my mad scramble for the photo opportunity.

Feb 25, 2009

Picture of the day


A dark fir tree on a dark, cold, and rainy day.

New Code! (part 2)

Postoffice is joining the fun of the new code release festival by being shoved up to version 1.4.10, which does not have the new configuration code from discount in it (yet,) but which does have a minor code change:

When I wrote postoffice in the first place, I made up a fairly elaborate state machine to process CRLF.CRLF and LF.LF (for network and terminal traffic, respectively) and collapse down CRLF network line terminators to LF Unix line terminators. With well-behaved clients, this seemed to work very well, but there seems to be a largish body of mailers out there that appear to add additional CR’s to their mail bodies. And postoffice didn’t deal at all with that input, and would transpose the CR and the character immediately preceding it.

This made for some interesting results when the offending mail contained a url, which ended up having the last character clipped off and put on the next line.

I finally snapped and tried to correct this defect this last week. At first, I thought that I’d just completely miscoded the state machine, so I discarded it and put in a far simpler bit of code that does the same thing, but I was still getting naked CRs from these mailers. And, since it was no longer transposing the CR and the last character, some mail readers (like Apple’s decided that this meant that the whole mail message was lots of additional headers.


After spending some time trying to outguess these mailers, I finally gave up and redid the data() function so that it would silently discard all CRs it found in the input stream. Yes, it’s not very RFC-compliant, but it ends up with a larger body of mail that shows up at pell and is actually readable. So that’s as good a reason as any for some New Code!, don’t you think? I’m sure there’s some pathological case out there like someone doing an accounts-receivable system in whitespace who also uses postoffice, but sends plaintext copies of their code around for review. (This would be the imaginary language whitespace++, which uses CR as a magic “I am a class” marker)) where this will fail horribly, but, please, if you’re it, give me a couple of days before reporting the defect.)

New Code!

Discount has been shoved up to version 1.3.2 with the addition of not a single line of new code, and not a single bugfix, but with changes to and to make it deal with the differently-functional version of tr that’s found on the Solaris boxes that Joyent uses in their compute farm. Joyent is apparently a big Ruby shop, and some clients/developers/customers(?) there really really want to use Ryan Tomayko’s rdiscount shim layer, which doesn’t work either.

One of the staff at Joyent wrote me and asked if I could help fix the not-yet-functional rdiscount code, and I said sure because, even though I don’t know Ruby, I can certainly work on the C side of the fence to make sure that discount at least compiles.

And it didn’t, because /usr/xpg4/bin/tr didn’t work with fancy character ranges like [a-z] or [A-Z]. So, after some choice commentary about how there are so many standards to choose from, I reworked to make some guesses about how tr will work on any given system and pick the way that works best (or die trying.) And that’s enough to make it New Code!, particularly if you’re running on Solaris and would like to see a make actually make something.

And, yes, I did this for free. If you’d like to pay me to maintain and feep discount, my mail address is up near the top of my weblog, but I’m perfectly happy to have my BSD-style license spread the attributiondamnit! love across the world all by itself.

Feb 20, 2009

Interesting bicycle discovery

I must be getting stronger. Last fall, when the Trek was still a bobtail bike, I would spend the bulk of my cruising time in the 52:17 gear (82\“, dropping to 70” when an upgrade or headwind hit me.) Today, after doing a 107km ramble in Clackamas County, I got home and looked idly at the rear cassette when I was putting the bicycle away – it was sitting at 53:13, or 107\“. I’m still not going particularly fast (I pedal at between 50 and 60 rpm, only speeding up when I’m trying to punch through a green light or see if I can make trees blueshift on a downhill [45-50 pounds of bicycle may not accelerate that quickly, but if I give it half a chance it descends like a bomb]) but that’s a disconcertingly high gear to be sitting in at the end of a 100km loop.

I need to figure out how to carve out 11 hours of free time. If I can do a >100km loop (in 5h45 minutes, including stops for donuts, dust mites, and railroad bridges) and still be sitting at a >100\“ gear, it’s probably time to see if I’ve still got the capacity to do a R200-length loop.

Of course if I’m going to do this I’ll have to pry myself out of the house earlier in the morning, instead of sitting around until 11:30 waiting for the sun to warm things up a bit. I can, after all, always pile on extra layers and peel them off when I go into runaway exothermia – the Trekracycle may be slower and heavier than a bobtail, but it does not lack for cargo space, and, at least until I reach the donut shop, there’s nothing getting in the way of me wadding in several layers of sweat-soaked woolen clothes.

Out on the line


Portland Traction’s Eagle Creek bridge, 40-odd years after the Barton trestle burned and the line was abandoned around it. Tri-Met still runs a bus out to Estacada, of course, and there’s lots of freight traffic going up and down the highway, but I strongly suspect that this railroad bridge will remain derelict at least past the end of my life, and most likely forever.

Friday Dust Mite Blogging™


Dust Mite went for a long bicycle ride this afternoon, and had a picture taken at Estacada City Hall to prove it.

Feb 19, 2009



To: Interested Parties
From: Michele Bradley, General Manager
Date: 2/17/2009
Re: Decision on POTB Railroad

At a Special Board Meeting today [02/16/09], the Port of Tillamook Bay Commissioners made two decisions by motion during the public meeting. Both decisions were unanimous:

  1. To discontinue freight service from Cochran (railroad MP 802) into the Port of Tillamook Bay Industrial Park; and
  2. To not repair the POTB rail line between railroad mileposts 802-810 (Cochran to Enright).

After all, it’s not as if gasoline is expensive, Oregon’s in a depression, or running the railroad would take thousands of truck trips off the roads. Better to just scrap the railroad and let the entire damned region slide into poverty, made just a little bit more desperate by having to scramble for tourist dollars every summer.


1 comment

Railroad picture of the day

A brace of P&W geeps wait for the Oswego Branch signal

Three P&W geeps wait for permission to return to the P&W Oswego branch from the south end of Brooklyn Yard.

The moving target, temporarily immobile


It’s been about 4 months, and I’m up to somewhere in the ballpark of 1600 miles on the thing. It spends a lot of time moving these days, thanks to the typically bizarre Oregon weather.

I finally swapped out the crunched left pedal (with MKS touring pedals,) the handlebars with a twisted left horn (replaced with a Nitto Randonneur bar, which I highly recommend; the horns flare out a little bit, so I can ride in the drops and not have my lower arms rubbing against the top part of the handlebar anymore,) the old Suntour indexed shifters (with a pair of Rivendell Silver friction shifters – the Suntour shifters allegedly had a friction mode, but it was less frictiony and more mushy indexed than I was willing to put up with, and after a day when I went up a pretty steep hill on 232nd with the chain hopping unhappily all the way, I decided that sacrificing Yet Another Computer was worth a more retrogrouchy shifter,) and the Avocet saddle (with first an old used Brooks Professional (US$30 on Ebay) and, when that saddle started to develop a tear across the front, a new unused Brooks Professional mail-ordered from the UK (because, even with shipping, it was US$100 cheaper than the prices I was seeing from sellers in the American Imperium.)) On the pure cosmetics front, I replaced the neon green Blackburn bottle holder (which had finally worn to the point where it was neon green and scraped-bare aluminum,) and the cheap-and-it-showed Trek bottle holder I got from my LBS, with a couple of cheap-but-it-doesn’t-show silver bottle holders, and the pink bar tape had gotten so filthy that I needed to replace it, so I went with some black tape on the hopes that the black greasy staining the pink tape had gotten wouldn’t be quite so visible against a black background.

I was given a US$75 Amazon gift certificate for christmas, and I spent that money buying a generator hub, which needs to be laced into a wheel before it goes onto the bicycle. This might take a while, because I don’t actually know how to build wheels yet, but those parts won’t be going anywhere while I’m waiting.


Feb 18, 2009

Stratovolcano picture of the day


Mount Hood from the Bluff Rd. scenic viewpoint in Sandy, Oregon.

1 comment

Taking advantage of a sunny day


The weather forecast for today was sunny and 50°F (10°C,) plus the bears were going to spend the afternoon with my parents, so it was obvious what I had to do; go get more donuts!

41 km out, 41 km back, and the donuts were freshly out of the oven when I went in to buy them. And 41km isn’t that long anymore; this trip, including a stop in Pleasant Home to inhale a couple of bananas, a more leisurely stop in Sandy to eat donuts and drink some hot chocolate (“more leisurely”, in this context, was 45 minutes,) and a stop on Bluff Road to take a picture of Mount Hood, took me 4h45 minutes. I’m starting to get back to the speed that I was doing when the Trek was still a bobtail bike, and I’m getting that speed back on longish loops that include long stretches of hilly country roads.

Johnson Creek Blvd, on the other hand, is going to be filed under “where the wankers play” – when I came back along it, I had another fat gentleman in a car shout abuse at me for daring to ride a bicycle on a public road. That makes two times that people (both men, of course, and both fat) whined bitterly about me being on their roads, and one time when some idiot almost (fortunately for me) bodychecked me off the road because he forgot that I would still be there after he passed me in his stupid truck. The problem with Johnson Creek Blvd is that where it parallels the Springwater Trail there are 2 stop signs and a signalled light on the trail, as opposed to just one signalled light on the road. And the trail is pretty washboardy through there, while the road (at least the lanes in the road; the bike lane is full of sunken grates and never-swept road debris, so I ride in the lane where it’s safe) is regularly resurfaced, which makes it at least 5km/h faster than the trail. So it’s a bit annoying that that neck of the woods appears to be where the anti-bike idiots drive.

You’ll notice in the bike picture that the donut boxes are duct taped to the skateboard. This has proven to be the most effective way to carry objects on top of the V-racks. I’ve decided that the skateboard has to go. I’m not exactly sure what I’m going to replace it with, but it’s a large heavy chunk of wood that never going to see a passenger on my bike (short wheelbase racy road bikes do not magically become monster cargo haulers with the addition of a Free Radical) and if I’m going to lug around that sort of weight I’d rather it be another lens or a tripod for my Pentax. I might take a piece of canvas and sew a couple of sidebars onto it, then use straps to clinch it onto the top of the V-racks (I’m doing that right now with the saddlebags: I’ve reversed the front and rear clips so that the saddlebags clip into the V-rack on the other side of the bicycle. This pulls the saddlebags tightly up against the V-racks and makes the whole assembly less flappy at speed. It makes it a little more difficult to load groceries, so I’m going to have to add opposite-sexed clips to the front and rear so I can clip across when the bags are empty, but clip to the same side when I’m out shopping.

(I wish I knew how to braze; I could see brazing up a nice Blackburn-style rack for a free radical that replaces the surfboard and V-racks, and then I could modify the saddlebags to fasten on as if they were a pair of abnormally elogated panniers.)


Feb 17, 2009

Stratovolcano picture of the day


Mount Hood is hidden under a low-lying lenticular cloud.


Feb 16, 2009

Domestic vermin picture of the day


I was up early a couple of days ago taking pictures of yet another snow flurry, and I couldn’t resist taking a picture of Mr. Bignose Cat when he hopped up on the sofa looking for some affection.

How fortunate it is for humanity that the African Wildcat is a social feline. Leo would be a pretty formidable pest if he didn’t like people, but all he uses his inch-and-a-half-long talons for is to grab my hand if I stop petting him.


Feb 15, 2009

Well, it was certainly worth a try, but it’s not worth trying again

Not For Me

On the positive side, riding in the so-called “Worst Day of the Year Ride” (“worst day”, Oregon-style, means that it rained and snowed very early in the morning, but by the time I’d reached the starting point the rain was over with and by the time I returned to NW Portland the clouds had evaporated and it was a warm sunny day) got me over the river and into the wilds of Washington County, plus got me to actually ride up (and [quickly] down) Tualatin Mountain a couple of times.

On the negative side, there are approximately 70,000 stop signs on the east side loop of this ride, and approximately 70,000 other bicycle riders (none of which happened to be riding Xtracycled bicycles) all jostling for room on the streets and in the more chaotic than a bazaar controls.

Despite being passed by everyone (and by everyone I mean everyone, from the usual lot of bespandexed gentlemen on their carbon-fiber and titanium bicycles to every fixed-gear rider in the tri-state area and down to aged grandparents on their omafeits – I didn’t get passed by any recumbents, but I attribute that to their rarity instead of any great climbing skill on my part) on the climbs up to the top of Tualatin Mountain, it was quite pleasant to run out and back into the wilds of Washington County (I was thinking of doing that loop twice, but I was worried that it would take too much time and I’d miss the (much more crowded and stop/start) East Portland loop.) The swarms of bicyclists in town, and the bestopsigned route, well, not so good, and it was a good reminder why I tend to do most of my urban riding along major thoroughfares (or trails, or anywhere where I don’t need to do start-stop traffic on my way out to the country where the major threat to my life is sub-micron wide shoulders right next to truck-devouring runoff ditches.

But it was worth trying, just so I could see if paying the big bucks for an organized Event! was worth it. It’s not, at least not for me. If I spent this sort of money for a hotel room, I could ferry myself out to Newburg or Forest Grove, overnight, ride a brevet or permanent, and get the riding done without the loudspeakers, bands, bike corrals, and rudderless chaos at the start/finish of the loop. Let other people have the bicycling community; I’ll stick with the contemplative solitude of the road.

But I’m going to have to find time to do more ascents (and – wheee! – 40mph descents) of Tualatin Mountain. With some practice, I might be able to increase my climbing speed from that of a banana slug to that of a three-toed sloth.

Trolley picture of the day


A westbound Hillsboro train crosses MLK Ave at about 8:30pm tonight.

Feb 14, 2009

Life on the river (#28)


The Ross Island Sand & Gravel tugboat sits just offshore from OMSI, waiting for a barge to finish loading at the waste rock dump pier (waste rock from the Eastside Big Pipe project; the cutter uses slip as lubricant, which gets contaminated with rock debris, so the used slip is pumped back to the pipehead just west of Portland Traction’s East Portland yard, cleaned, and returned to the cutting face, while the rock debris is, apparently, sold to Ross Island Sand & Gravel (FOB 50 meters west of the east bank of the Willamette River) for, I dunno, concrete aggregate?

Anyhow, the tug has been doing daily pickups from the dump pier for at least the last year and a half. It was doing it when I was still working for my last set of Corporate Masters™, and it was doing it today when I was (slowly) returning home with 55 pounds of shimmy-inducing catfood on the back of the Xtracycle.

Feb 13, 2009

Friday Dust Mite Blogging™


If you look at the elegant pink socks (excuse me, but those are my elegant pink socks and I don’t want them to become a nest,) the hat, and the green strap, it would appear that Dust Mite is building a nest of some sort. But what is the metal ruler and tax form doing there?

Feb 12, 2009

Railroad picture of the day


Here it comes…


… and there it goes!

I was feeling out of sorts today, so I chopped my usual ride very short (16km) and rode down into deepest Milwaukie to see if I could get pictures of the 11:15(ish) Cascades at a different spot. I ended up stopping at the Harmony Road crossing, and after waiting for about 10 minutes (with lots of curious stares from passing traffic and the survey crew that was working there) the train showed up, and not in very much of a hurry about it.

After the train departed northwards, I rode up to downtown Milwaukie and waited another 10 minutes for the southbound Yellow Menace train I’d previously seen stopped at the signal just south of the Springwater Trail bridge. But no such luck – apparently I wasn’t the only person who was feeling sluggish today, and that southbound train never materialized on me.

Feb 11, 2009

Railroad picture of the day


Portland Traction has hidden their NW-5 by moving it from Milwaukie to the very southern edge of Sellwood, just west of where Golf Junction used to be when the line to Oregon City was still in service. It does not appear to have been mended, so it’s still a large expensive sled instead of a locomotive.

Feb 10, 2009

hey, look, more snow!


An old truck shivers to life on a snowy morning.

Feb 09, 2009

Trolley picture of the day


A train headed by a Bombardier/BN car (in the new paint scheme, too!) approaches the Gresham end of the line on a Hillsboro->Gresham service.

Feb 08, 2009

Project of the day


Store-bought bagels have been steadily getting more and more expensive, and finally reached the US$1/bagel point a couple of weeks ago (with luxury “wood-oven” bagels clocking in at US$1.50/bagel.) This is kind of ridiculous, so I’ve started making my own. They are time-consuming (these 16 bagels took me about 3 hours – mainly thumb-twiddling while waiting for the little yeastie beasties to perform their reenactment of the United States economy – to make,) but 3 hours + US$3.50 in materials and electricity is much better than US$16.00 for the privilege of getting older staler bagels from the Big Big Store.

And, to my amazement, my children will actually eat them, which reduces the morning scramble to wedge food into them to a dignified gallop (and cuts out the periodic “we’re going to have to eat breakfast at Marsee Baking” breakfast of last resort.)


Feb 07, 2009

Stratovolcano picture of the day


Mount Hood from 232nd Ave just south of the Damascus-Boring highway. This was enough of a picture-perfect view that I locked up the brakes and skidded to a stop so I could get photos, and fortunately I’d remembered to bring my circularly polarized filter so I could hack away some of the haze in the sky while I was taking the pictures.

Feb 06, 2009

Friday Dust Mite Blogging™


The thing’s hollow–it goes on forever–and–oh my G-d–it’s full of donuts!

Feb 05, 2009

Picture of the day


Two bridges over the Sandy River; one carries cars (and the occasional cyclotourist) while the other one carries some of the Bull Run river across hill and dale to the reservoirs on Powell Butte, Mount Tabor, and in Washington Park (and from there down into our plumbing and into our tea.)

Feb 04, 2009

Variations on a theme


City bike vs country bike, Xtracycle-style.


Feb 03, 2009

Picture of the day


A panoramic view of the vast mudpit that used to be Roslyn Lake, now containing nothing but the scrapwood that used to be the Marmot flume.

(panorama made with a bunch of photos @f5.6, stitched together with a demo copy of DoubleTake)



Obéir c'est trahir, Désobéir c'est servir