This Space for Rent

Jan 31, 2010

Picture of the day


I was coming back from a short loop on the mlcm this afternoon, and was moving along at a pretty good clip as I plunged down the hill on River Road. I’ve been taking the short bike path through the park that’s wrapped around the Kellog St water treatment plant, so I jump off River Road halfway down the hill and take Wren down to the waterfront. I was moving around 30mph on River Road, but I’d slowed down to under 20mph when I turned onto Wren because the city of Milwaukie doesn’t bother to cut the curb where Wren crosses any other streets. I spotted the curbs, jumped them, but just as I reached the block before the railroad crossing I missed a bump, and when I thumped over it my Pentax leapt out of my handlebar bag, whizzed by my ear, and fell with a fatal-sounding *clonk*! onto the street as I slammed on my brakes and skidded to a stop.

I got off the bicycle, walked back, picked up the Pentax. Intact, except for an impressive skid mark and crack at the corner of the battery case (the battery case lid had fallen off and the battery bay was empty.) A little bit of scouting around found the batteries laying forlornly on the ground, and a more extensive search found the battery lid sitting in the middle of the street looking like the cat that had just eaten the canary. It was a good sign that optics or electronic weren’t spilling out from the case or lens, and it was a better sign that once I put the batteries back and wedged the battery lid back on that the camera booted up and went to the bios date/time screen.

The only way to find out if the camera still works is to take a picture, and the railroad crossing was right in front of my nose on this nice warm sunny January day. So I performed the necessary diagnostics on the spot, then got back onto my bicycle and returned to tell the tale.

Too bad Apple doesn’t build their Macbook Air as robustly as the *istDS was built.

Snap Crackle Pop

What could be worse than having one hinge fail on my Macbook Air? Well, 20 days later I have the answer. I was planning on taking the thing into the local Apple Store and engaging in hand to hand combat with the hipsters manning the advice desk there, so I copied most of my home directory over to my other Macbook (the ancient 13" one that my mother gave me several years ago, which was my main workstation when I did my more-portability hack to git (not for the Mac, of course – Apple has drunk the FSF flavor-aid and has the latest and greatest not-quite-C compiler and toolkit – but for the SLS Linux system that I use for most of my serious development these days)) and attempted to close the Macbook Air so I could put it into a box for safely carrying down to Pioneer Place.

Well, that was not a good plan. There was a terrible plasticky ripping noise and the other hinge shattered, which levered the plastic hinge cover far enough up to foul the now-closing lid, with the result that it started to tear the entire lid off before I stopped and quickly flopped the lid open the other way.

My Macbook Air now opens up to 180°, and will close to about 90° before the shattered hinge area fouls the lid. That’s quite an impressive bit of engineering, Apple – I hope that the subsequent generations of the Macbook Air have that area redesigned.

Jan 30, 2010

Fun with edge cases

If I feed the string “foo ” to, it becomes <p>foo </p>. If I feed it to discount, it becomes <p>foo<br/></p>. This is because I’m following the spec where it says “end the line with two or more spaces, then type return”.

So I’m not following the specification exactly here. My fault (and it’s not easily catchable because of the way I parse blocks – I cut the input up into a linked list of lines, and the last line ends up as a single line whether or not there’s a newline at the end of it.

I could fix that by not trimming out the newlines when building the initial list of lines (and then silently dropping it when I’m doing the htmlification pass(es) through the compiled blocklist. However it turns out that it’s not just lines that don’t end with newlines; if I have input like (pipes added to show end of lines; see that there are two or more spaces at the end of the “foo” and “bar” paragraphs):

foo  |
bar  |
| spits out

<p>foo   </p>

<p>bar   </p>

So even though the spec says “two or more spaces, then type a return”, the reference implementation overrules it and says “two or more spaces, unless you’re at the end of a paragraph.”


This is a one line fix (in generate.c, function printblock(), add && t->next to the check for two or more blank lines) but it’s kind of ugly. It breaks two of my test cases, but (obviously) neither of the official Daring Fireball test suites I test against (1.0 and 1.0.3.)

So should I

  1. Modify my code to follow the reference implementation, or
  2. Modify my code to more closely follow the spec (the edge case of two+ spaces followed by EOF), or
  3. Open another beer and just forget about the whole thing?

My “I want this code to be PERFECT, PERFECT!” instinct says to choose #1 (which I’ve already written the patch for,) but my “but I’ve got a userbase now and they might be unhappy!” sense likes #3.

Flattery will get you everywhere

We’ve been using handy scripting languages for so long, it’s easy to forget how wickedly, ruthlessly, and diabolically fast C code actually runs. :)

-from the comments to Ryan Tomayko’s announcement of his RDiscount ruby binding.

YAFYE picture of the day


When I went out for a ride this afternoon, I saw a train waiting just north of where the Springwater Trail crosses over the SPYellow Menace mainline, and a red signal just south of the bridge. So, after waiting for a few minutes to see if anything would show up, I detoured south to Milwaukie and west east along Railroad Avenue (and thus to Harmony Road over to the i205 path, which took me back to the Springwater Trail just west of i205) and, just as I reached the Harmony/Lake/Linwood/Railroad intersection, I spotted this train approaching from the east.

And, after it slowly crept over the crossing, I managed to take a few pictures before going on my way.

Jan 29, 2010

Friday Dust Mite Blogging™


Dust Mite poses in front of an old patent model of a reversable trolley pole.

New Code!

Discount has been shoved up to version 1.6.0 with the addition of one new feature; I’ve added support for user callback functions so a program can modify urls and add additional arguments to the tags generated from []() and <link> constructs.

They are not documented well right now (I spun out 1.6.0 from a larger project to remove all the build time feature flags and do all the feature tweaking at runtime) but what you do is write a callback function (char *e_url(char*,int,void*), which is passed a pointer & the side of the url, plus a pointer to (optional) user data) which can return a pointer to a modified url (or null if there is nothing that needs to be changed.) Discount will write that url onto the output, then attempt to free any dynamic memory that was used to create it (via the void e_free(char*,void*) function.)

There is also a char* e_flags(char*,int,void*), which can be used to add additional flags to the generated tags. As an example, one of the companies that’s using discount wants to add rel="nofollow" to generated links. This would be impossible with standard discount, but with callbacks they can write:

char *
nofollow(char *string, int len, void *data)
    return "rel=\"nofollow\";


mkd_e_flags(Document, nofollow);

And then [foo](bar) will become <a href="bar" rel="nofollow">foo</a>. (you can test this with the markdown program – the -E option creates a simple callback that does what the nofollow() function does here.

More complicated callbacks (ones that actually rewrite urls) can return their new urls or flags in dynamically allocated memory, which discount will then attempt to free with the deallocator callback assigned by the mkd_e_free(MMIOT*,(void*)(free)(char*,void*)) function.

This code is not yet fully documented, because it’s still being revised, but I’m using it now and it hasn’t caused anything to explode, so it’s the New Code! of your dreams. Please let me know if it doesn’t work.

Jan 28, 2010

Trolley picture of the day


A pair of SD70s climb the ramp from Division St to Powell St (on the i205 trolley line) this afternoon. It was not nearly as foggy as the picture would indicate; I was carrying a point and shoot camera in one of my pants pockets, and it had gotten fairly damp as a result.

Jan 24, 2010

Domestic vermin picture of the day


I forgot and dropped one of my sweaters on the arm of the loveseat, so Mavis seized the opportunity for cozy woolen napping.

1 comment

Jan 23, 2010

Now that’s an interesting way of doing infill housing


The City of Portland, as part of their sensible relaxing of zoning codes to allow people to build houses more densely than the standard suburban 50x100 lot, did a competition a few years back for some dense-pack house designs that could be used (almost) for free on narrow lots. People have been using these plans, and I’ve seen 3-4 of them built up during my ramblings through the east side of the city.

I spotted this one when I was heading home from Hawthorne Blvd this afternoon, so (because I only had the 55mm Super-Tak on my Pentax at the time) I used it as an anchor for an autostitched photo of new housing in the inner city. When I got home and assembled the photo, I noticed that the Vargas on the right, despite being crammed right up against the property line, had a very expansive side yard which was bookended by another narrow lot house that was similarly packed up against its property lines.

Brand new buildings, brand new fences.

What I suspect happened is that the developer bought a doublewide lot, split the now 100 ft empty space into three lots, built on the two edge lots (the Vargas and the other new narrow house,) then left the middle lot empty and made it into their own yard. If so, that’s fairly clever – you get a 66 x 100 lot with a nice 40x100 yard which, if you run into very hard times, you can then split off from your house, build another narrow house, and pocket the change. (The aerial photos of the area show the other house and a nice wide treed empty lot, so it looks like the developer didn’t even have to scrape anything (except possibly where the other new house is.))

It’s unfortunate that the standard house designs are set up so that if you put wide sideyard in it looks like someone came and scraped out the house that used to be there. If I was doing development like this, I’d find it very difficult to avoid modifying the Vargas houseplan to take advantage of the view (as well as modifying it to rip out the “master bathroom” (a good place for an office), the two-story-high ceiling in the living room, and the loooong hall leading from the front door to the living room & stairs.)

Jan 22, 2010

Friday Dust Mite Blogging™


A dust mite cage is an important accessory for any bicycle.

Jan 20, 2010

Picture of the day


A threatening sunrise lurks just the other side of the sweetgum trees out front of our house.

Jan 19, 2010

Trolley picture of the day


One of my regular loops is to ride out to the edge of Gresham on the Springwater Trail, then return via Jenne Rd, Foster Rd, and Woodstock (sometimes with a run down 39th to Crystal Springs Blvd and then back to Woodstock right after it finishes turning into Bybee.) This loop takes me right by the new Foster Rd station on the i205 trolley line, but I’m usually zipping along quickly enough to not want to stop.

Well, today I was feeling fairly sluglike (a sluggish 14mph average on the mlcm, and later on a whopping 11mph on the Trek. Ugh) so I decided to not waste my slothful progress. And in the fullness of time a train zipped over the bridge and into the field of view of my Pentax.


Jan 16, 2010

Domestic vermin picture of the day


Queen Mavis dozes on the sofa this evening.

Trolley picture of the day


It wasn’t quite raining today, but it was pretty aggressively misting, and by the time I got on the mlcm and rode out to the trolley line everything was pretty well covered with a thin layer of water. Fortunately I could wedge myself under the tiny canopy that the ticket machine is hidden under while waiting for something interesting to come by.

Jan 15, 2010

Friday Dust Mite Blogging™


Dust Mite stands guard while Mavis sleeps.

Domestic vermin picture of the day


Dorrie leans in to look at my Pentax.

Jan 11, 2010

Trolley picture of the day


When I was on the way back from a slightly longer and much chillier ride than I planned (the weather forecast was for 50°F and light wind; what I got was 10°F colder than that with a stiff east wind. My fingers and toes were very unhappy by the time I got back home) I spotted a train coming up i205 as I was waiting at the light at Glisan St. I wanted to take a picture of the train approaching the bridge, but there was a lot of traffic, so I turned around and got this picture just as it popped out from under the bridge. I didn’t notice until later that an airport train was waiting for it to pass before proceeding onto the fishhook bridge.

1 comment

Jan 10, 2010

Well, there goes the resale value of that Macintosh

Damaged hinge

About 18 months ago, I killed the display on my 13" Macbook and decided that if I was going to replace it I might as well replace it with the lightest possible Unix machine I could get (and, no, a Linux box with G-dd-mn X11 doesn’t count. I’ve done my time fighting with X11, and my tolerance for crappy software with even crappier apps has worn down to nothingness.) So I bought a first-gen Macbook Air, which, aside from becoming obsolete approximately 30 minutes after I copied a link to onto the dock, served as a perfectly acceptable development machine (and, thanks to not having X11, as an even better machine to run web browsers on.)

A couple of weeks ago, one of the screws holding the back on started to work loose, and, after a day or two of ignoring the creaky sounds, I screwed it tightly back in. This, apparently, wasn’t quickly enough, because I noticed the lid starting to get a little bit springy, and then, just the other day, I noticed that it wasn’t closing properly.

So I looked a little bit closer, and lo and effing behold what did I see but this plastic thing stripping out. And when I unbolted the back of the machine to try and see if I could fit it back into place, I saw that there’s a little floating metal hinge unit that’s twisted 90° out of the way, thus forcing the lid up and away from the case.

So I can’t actually close my Macbook any more. I’m guessing that I could cut some of this plastic away and then reach in with a pair of pliers or Vice-Grip®©™s and twist the hinge back into place, but I don’t know if it would actually stay there without the (now bent and cracking) plastic panel.

Mind that this hasn’t happened with any of my other macbooks, including the super-ancient Powerbook 100 I bought from a friend on, then surgically replaced the display with one from another PB100 I bought for parts, so I could always just roll back down to one of them. But, ouch, it is sad that my tiny and lightweight FreeBSD workstation is no longer nearly as portable as it used to be (at least without an expen$ive trip to Apple technical support or a risker DIY hackjob at home.)

1 comment

Jan 09, 2010

Compare and Contrast (bicycle style)


I sat my Trek alongside the midlifecrisismobile so I could compare the frame geometry between them. The rear end geometry is radically different, of course, but the front triangles are identical except for the size (58cm vs 56cm; I upsized the Soma frame a little bit because when I ride in the drops on the Trek I end up feeling a bit squashed after half an hour or so.)

The Trek + xtracycle makes a very lively frame; when I’m on level ground it feels like it wants to go really fast, even though I tend to poke along like Pete the flamingo on it. The mlcm, on the oher hand, is a very sturdy nonflexy frame that doesn’t seem like it’s going that fast, even when I’m whipping down Foster at 25(!) mph (it never did that during the 650b trial, even on days when I had a stiff tailwind assisting my return down the hill.)

I’m going to have to sell my way to a considerably longer stem for the Trek, and I’m going to have to adjust the seat and bars up a little bit to make them fit more closely to the driver’s cab on the mlcm; If I can desquash the Trek a little bit I might be able to get it a little faster and a little better suited for shorterflatter brevets & populairespermanents.

Jan 08, 2010

Friday Dust Mite Blogging™


Dust Mite and the gang, as posed by Silas.

Jan 06, 2010

Domestic vermin picture of the day


Mavis demonstrates typically cattish style and elegance.

Out on the line


The drilling head for the east side big pipe project sits out in the gloom this afternoon at the OMSI mine shaft/construction yard.

Jan 05, 2010

Another day, another cat


Our cat Mavis and a Toys-R-Us birthday balloon (And, no, I don’t know where it came from; it materialised with the bears one day after they had visited their grandparents) gaze balefully at us from the other side of the living room sofa.

Jan 03, 2010

Leo “Mr Bignose” Cat, ~2005 - 2010


Our cat Leo had a heart attack this morning, and after grimly hanging on for about 5 hours finally died in my arms at around 3pm. The last picture I took of him was when I was trying to get pictures of the snowstorm last week and he poked his snoot in to see what I was doing.

In the grand scheme of things, it’s probably better to have your cat just die than it is to have her slowly die over the course of two years from cancer, but it’s still a horrible thing to have a cat who was galloping around the house at 4am be dead and in the ground 12 hours later.


Oh g-d my eyes!

A weblog I used to read religiously until about 12 hours ago – Comics Curmudgeon – went on holiday and came back with a brand new post-Decaster page design.

Which sucks.

It sucks with the malignant light of a thousand imploding suns.

I looked at it the first time, went “eeeuuuww!”, and adblocked the more offensive images out of my sight.

A few hours later, I looked at it again, said “Oh, I can’t stand this!” and checked to see if the rss feed would be better. Nope; the RSS feed is one of those excerpt feeds where you have to go to the regular page to read anything). So I went on a search for readability to see if a format sanitizer would make things any better. It didn’t (readability stripped out things like post titles, and mangled the formatting to the point where all of the interesting images fell down to the end of the now single long (and slightly more incoherent that usual) mashup post.

And then I tried to look at it again. And my fingers immediately ran screaming to the bookmarks file where they deleted the offending bookmarks and, possibly, saved the remaining fragments of my sanity.

And I thought the scienceblogs layout was tacky and horrible. I mean it is tacky and horrible (but all script-delivered, and NoScript fixes that wagon) but compared to the New! Shiny! Comics Curmudgeon it’s like a Palladian villa.


Jan 02, 2010

Don’t underinflate the beams

I don’t know if it was an artifact of forcing the tires onto the rims, or if it’s an artifact of slightly underinflating them, but I managed to get pinch-flats on both of the mlcm’s wheels when I was trying to ride down to the post office to mail a couple of packages.

Annoying, particularly when the sequence was that the rear tire went flat, so I stopped to change it, and after I changed it I realized that the front tire was going flat, so I had to actually patch it (since the new tube went on the back tire), and then by the time I’d wedged the front wheel back together and (slooooowly, thanks to using a minipump) inflated it I discovered that the rear wheel had gone flat, due to an imperfect patch on the new tube, so I had to pull the rear wheel off and apply more patches.

20 minutes per tirechange. × 3. sigh. I need to (a) inflate the tires a lot closer to 120psi, (b) be even more paranoid about checking that the tube isn’t pinched under the tire, and (c) get a better pump to carry on the mlcm (a large amount of the 20 minutes per tirechange is pumping air into the tires, and even then I couldn’t get more than about 40psi (measured at home after I limped home at 15mph)) pushed into the tubes.

On the bright side, the tires remain unpunctured. Just like my surly disposition.


Jan 01, 2010

Friday Dust Mite Blogging™


Brand new year, same old Dust Mite