Running Commentary
posted at 11:06 on 2009.12.08

First things first: happy 21st!

Those irrevocably consigned to the nine circles of geekdom will be pleased to know that Google has officially beta'd Chrome for Linux. In other news, you can now post comments to the new quizzical quincunx; simply visit the post page and fill out the handy comment form. In the process of hacking this together, I finally became frustrated enough with the WordPress API to toss this gem into my functions.php:

function trap_output($function, $args = array()) {
  ob_start();
  call_user_func_array($function, $args);
  return ob_get_clean();
}

Also, I've decided to go with reCAPTCHA instead of post moderation; I'll be interested to see if this is sufficient to defend against the spammer hordes of the Internets.

So - test it out, and let me know if you find any problems!

Final Fortnight
posted at 11:59 on 2009.12.05

I'm perched by the windowsill outside Brenda's French Soul Food as I reflect upon this grim reality: only two weeks remain in the fantastic ride that has been (and, for now, still is) my last co-op term down here in San Francisco. (Why Brenda's? I yelped reasonably-priced breakfast joints and sorted by top rated, and this is what I got.) Two weeks - not enough time to seriously launch into a new project at work, nor enough time to truly complete my haphazard exploration of this most multifaceted of cities. Every end-of-term comes with equal parts trepidation and excitement, and this one is no exception.

What next? I'll be heading back up to Waterloo to cap off my undergraduate education. Before that happens, though, I've got (in no particular order) a company holiday party to attend, a certain club by the name of DNA Lounge to pay one last visit, a game of Capture-the-Flag to play, a bottle of tequila to buy (so I can take advantage of the token customs allowances!), a work term report to write, two presentations to give, a couple of projects at work to bring to a satisfactory close, a handful of friends in Vancouver to visit...the list goes on; as usual, it's so much to do, so little time. I wouldn't have it any other way.

Then what? I've studiously ignored this question for much of the past four years, pausing only briefly to give it any thought whatsoever. As I approach graduation, however, this question seems to be popping up with exponentially increasing frequency. According to the hard-earned wisdom of generations past, it is considered Unconscionably Short-Sighted to not have A Plan - and yet that wisdom seems quaint now, politely antiquated when faced with the constant upheaval that has come to characterize modern life. It has never been so commonplace for best-laid plans to go awry. Insofar as I have made any post-undergrad decisions, here they are:

  • My decision to spend a while travelling after undergrad is absolutely non-negotiable. I will have spent the better part of five years in the teeter-totter rat-race training ground that is co-op, flipping like high-voltage AC between work and school, and I desperately crave the opportunity to sample the other possibilities offered by this short existence we have on Earth.
  • That said, I'll be signing up for the next round of GREs - why not? - and making the round of grad school applications at some point.
  • I'll also keep contacts at the places I've worked for. This is rightly considered Good and Smart, and I've no qualms with jamming my feet into as many doors as humanly possible.

Context switch - having finished my breakfast in the cramped temple to tastiness that is Brenda's (Yelp does not lie - the beef cutlets and grits are indeed both packed with deliciousness, and the bottomless watermelon iced tea is wonderfully pulpy), I've meandered my way over to Ferry Building to borrow wireless and power off Peet's. The hallways are packed on weekends, tourists and locals alike buzzing around in the frantic search for produce to the reverberating refrains of street performers - a lucrative profession in this part of town, where no one sets foot without consciously agreeing to part ways with their gold. This may very well be the last time I set foot in this building for quite some time; next weekend is decidedly busy, and the weekend after is earmarked for the aforementioned jaunt up the coast to Vancouver.

Anything else? I still haven't seen Alcatraz, but I consider this no great loss; the only proper way to see it would be late at night, a sort of reverse infiltration that would ideally be carried out by boat. This is my first real post at the new site; it remains to be seen whether this will precipitate a noticeable shift in writing style. I should start posting more regularly, if only to prepare for my travels next summer - my less itinerant friends and relatives will demand compensation for my absence in the form of chances to live vicariously through me, something which I certainly owe them more of.

Anyways, that's it for now. Owing to my unusually pensive state, I've rambled on for far longer than I had hoped - and so, my fingers having reached exhaustion, I shall leave you all with a simple exhortation: keep posted!

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!
iPwned
posted at 14:31 on 2009.10.28
It was only a matter of time before Google did this - let the battle begin.
802.11x In The City
posted at 10:36 on 2009.10.28
Another morning, another wireless hotspot courtesy of the thriving West Coast coffee-shop culture. This one is located within the confines of Cup Of Java, a fairly standard joint that just so happens to have a Casio CTK-471 sitting around - any instrument on the keyboard-piano spectrum, even a cheap MIDI-spewing plastic-encased Casio, earns bonus points. I order the Greek Omelet, which comes nestled between a bed of -

Actually, never mind that. I'm no food critic; that's what we have Yelp for. (Hooray for externalized memory!)

In San Francisco, every coffee shop comes with its very own resident Bluetooth headset-wearing intravenous-caffeine-drip work-from-home maven; the more popular ones boast entire armies of these laptop-toting soldiers, each one vying for a slice of the ether. (I'm taking more than my fair share with Transmission (more proof that the highly publicized takedown and subsequent sale of The Pirate Bay does jack-all to staunch the, er, torrential (yeah, I winced too, but it seemed like most appropriate adjective) flow of information), and am watching nervously over my shoulder for the legions of RIAA men-in-black that are no doubt waiting to haul my recidivist pirate ass into court.) I'm half tempted to whip out Wireshark to see what exactly these people are doing, but that would most likely cross the line between harmless curiosity and feline genocide.

...and I'm off to scour a couple of thrift stores before grabbing the bus into work.
The Gubernator Strikes Back
posted at 23:17 on 2009.10.27
Need one more reason to be proud of your elected officials? Here you go. While we're at it, here's another epic fail courtesy of our beloved civil engineers.

What else? I went ATVing at the Pismo Dunes State Vehicular Recreation Area, an unnecessarily obtuse moniker for what amounts to a giant outdoor sandbox filled with off-road vehicles of every description. As a testament to its rugged nature, the area is rife with Second-Amendment freaks on oversized rollcages-with-wheels proudly festooned with Southern Confederate flags. If you've ever wanted to live out those Mad Max post-apocalyptic fantasies of petrol-fueled villainy, this is most definitely the place.

Found a super-chill haven of hippie-dom sandwiched between Mission and Valencia. The Oz Hookah Lounge delivers drunk revelry, multiflavoured smoke haze, cushions, and a panoply of psychedelic patterns at nearly every hour of the night. This particular visit was punctuated by a host of inebriated Iranian expats carrying beer-laden ice buckets and gin-and-tonics from a nearby bar, which they promptly distributed amongst the crowd.

Halloween's coming - get your costumes together! Photographic evidence is requested, lest the veracity of your respective accounts be called into question.