Hello world!
posted at 23:49 on 2009.11.30
It's official: quizzical quincunx is moving to its new home here at blog.evanstratford.com. Why the sudden shuffle?
  • Incompatibilities between Blogger's draft editor (which I use) and its regular editor (which pops up anytime I follow an edit link from the blog page) butcher my formatting with unsettling regularity. I've had enough.
  • Hosting this blog myself means I have complete control over design, blog post/comment data, and deployment. If the blog goes down, I have no one to blame except myself. If I want to add cool homebrew widgets or features (post clustering? user-based post targeting? easter-egg blink tags?) I need only hack something together in PHP; no more working around Blogger's platform.
  • I've been meaning to try out WordPress for a while; this seemed like a perfect opportunity.
My overall impression of WordPress is mostly favourable. More details:
  • Writing your own theme is a relatively painless process, thanks in part to the excellent documentation. I had the current (admittedly incomplete, but mostly functional) theme together in roughly 2.5 hours.
  • Half the WordPress template tag hooks echo by default; the other half return rendered strings. Why? Is it that hard to agree on one? (Personally, I think they should all return strings - this makes it easier to process the text and add filler without turning the PHP code into a mess of <php? /*...*/ ?> tags.
  • The Blogger importer imports tags as categories. Why? What's the difference? Should I care? This seems like an unnecessary source of confusion.
  • TinyMCE is immeasurably superior to the Blogger editor, albeit somewhat slower.
  • Some serious design effort has gone into the WordPress admin console. There's five metric whackloads of functionality, yet it still doesn't seem overly cluttered.
I'll leave the old blog site up for a while, but all new posts will go here - enjoy the ride, and keep posted!
Recyclists of SF
posted at 13:42 on 2009.11.29
San Francisco - nexus for the industries of silicon and logic, erstwhile hub for countless wide-eyed Flower Children and their pharmacopoeia of psychedelics, and home to the most efficient army of hunter-gatherer recyclers known to mankind. These scavengers rove about the city filling carts of all descriptions with aluminum, plastic, and glass gold, pausing only to swig the last dregs of partially re-fermented beer from that hastily-discarded PBR. There's a lesson in here somewhere about economics: by raising its bottle deposits to the point where serial bottle-returning becomes a decent source of quick cash, California has effectively crowd-sourced recycling. As a result, they're able to post 74% recycling of beverage containers.

(I can hear the Hounds howling - this wealth-redistribution racket is straight-up capital-C Communism, a conspiracy perpetrated by Obama and his sleeper-agent terrorist-Jew-Illuminati cohort ever since the Dark Time of Marx to pave the way for such unimaginable horrors as public health care and tighter bank regulations!)

The bottle deposit is an effective tax on laziness, which is perfectly fine by me. After all, it's a fair bet that even if we taxed the beverage companies for making these containers in the first place, polluter-pays style, we'd end up paying this portion anyways (unless, in accounting for the total cost of production, that can of Coke became prohibitively expensive...)
Fear and Loathing in Philadelphia
posted at 06:00 on 2009.11.26
6:00 am. There is something brutal and savage about stepping off a red-eye flight into the flickering fluorescent wash at Philadelphia to the tune of stock classical music, like a low-budget stage production of Clockwork Orange - any second now, I fear, my generally unorthodox wardrobe will spark senseless violence and mayhem. Then again, anyone voluntarily leaving California - especially as we begin this inevitable march towards Winter - is clearly expecting a rude shock to the system. Cats meow from somewhere in the open-concept holding cell known as The Waiting Area; before my sleep-deprived sensory apparatus has time to square this with the whole airport thing, a woman starts jerkily dancing along with the classical fare over out front of Gate B-13. There is a scent of rank feral desperation about the place, augmented by the ringtone interjections of crudely-produced hip-hop. The double shot of bourbon back in SFO has long worn off, leaving me woefully unequipped to handle the sort of ultraviolence that is surely headed my way. I hear they still have Public Lynchings in those pleasant atavistic backwaters of this fine country, and I can certainly muster enough blasphemy to make the ticket...

God Jesus! It seems the spirit of Hunter S. Thompson has crept into my brain, a direct frontal assault from the pages of my newly-finished copy of Fear and Loathing: On the Campaign Trail '72. If you would claim to understand the intricate meanderings of politics, read this book - a better account of the haphazard chaos behind your average televised presidential campaign has never been given. No major newspaper could print this with a straight face without immediately forcing the termination of half their editorial staff, with the heads to be mailed to Washington for public display...and it seems my connecting flight is boarding, judging by the impatient queue slowly lurching towards the open gate. More to follow...
In San Francisco, Startup == Pub
posted at 15:20 on 2009.11.21
Any event where you wake up the next morning with two free shirts, a deck of cards, a jar of bubble soap, a stack of business cards, and a video of yourself ziplining across an office hallway is a resounding success. Enter Startup Crawl, an open house on some of San Francisco's hottest startups. It's part pub crawl, part power-speed-networking, part tech-speak geekout session, and 100% SF-style general hilarity. Where else can some lowly Canadian undergrads walk in off the street - in jeans and T-shirts, no less - and end up throwing back Don Julio with the CEO over talk about scalability and the startup life within the half hour? Where else can you climb out a window to have rooftop beers with high-wired entrepreneurs preparing for next morning's Y Combinator pitch? The list of such meritocratic hedonist enclaves is short indeed.

This event deserves to be ported elsewhere - where's the beef, Waterloo?
Mean Streets of Silicon Valley
posted at 15:40 on 2009.11.20
Mean/variance calculation is ridiculously commonplace in data analysis, yet most programmers have never seen this gem from TAoCP:

def online_mean_and_variance(data):
    n, mu, s2 = 0, 0, 0
    for x in data:
        n += 1
        delta = x - mu
        mu += delta/n
        s2 += delta*(x - mu)
    if n > 1:
        yield (mu, s2/(n-1))

Unlike the standard two-pass algorithm, this one is online; it also happens to be more stable.
If that's not enough, I've given it to you here as a Python generator. Enjoy!