March 16, 2009

Post-Emptive Strike

Yes, I blocked Wikipedia at work by overriding HOSTS. (Yes, NRC uses Windows for internal purposes, with the inevitable result that everyone installs Cygwin to avoid incurring undue mental trauma when working with our UNIX clusters.) I look forward to reaching unprecedented heights of productivity - starting, naturally, with spending 5 minutes blogging about it.

Update: In the same vein, I've decided to install the Email Addict feature from Gmail Labs. Any other thoughts on reducing distractions?

Life on Film

Well, not quite - but I have started uploading my photos here. (Yes, my other account still exists.) So far, the Parkour album contains nary but a couple of shots of the OGC gym floor and various downtown Ottawa hotspots; I have yet to grab any action shots, which may disappoint those of you expecting to see photographic evidence of my accumulating injuries. I haven't quite started living by my camera yet, and routinely forget to bring it along for photo-worthy events. Hopefully the act of keeping this blog will change that!

Other than that: I'm back in Ottawa, this time with a bike, a djembe, and a mostly-finished computer in tow. If I ever figure out how to use all three concurrently, I'll let you know. (Maybe if I strap the tower to my rear pannier rack with bungee cords and excessive amounts of duct tape...)

March 14, 2009

@~

I'm at home for the weekend, basking in the almost imperceptibly warmer Oakville-Toronto weather before booking it up to Waterloo. Pleasant drive down here, if uneventful - absolutely magnificent sunset, French-edition CBC Radio discussions on the caisse populaire and our troubled economic times, slices of Bowie, and some much-needed mid-term reflections.

Also: it's Pi Day! Unfortunately, the Math Department decided to give the requisite pie out yesterday, so it looks like I'll miss out on that.

March 12, 2009

Vox Populi

Not even voicemail can escape Big G, it seems - Google Voice, built off Grand Central's technology, will transform your voice messages into email transcripts. In the era of mobile computing this could be a wise move indeed, although it will certainly enrage privacy advocates.

At heart, this is a fairly basic application of speech recognition software; simply strap together a recognition engine, a mailing script, and something to monitor your phone and you've got a working replacement. Replace the phone with Skype (or, better yet, open-source equivalent Ekiga) and the monitoring step becomes a great deal easier - you could even use it to archive all your phone calls. For the paranoid, you could toss in an extra pass through PGP and skip the mailing script, archiving instead to a TrueCrypt'd partition. (Of course, you'd have to encrypt your calls in the first place.)

March 11, 2009

Food, Water, Air, ...

Okay, so I haven't posted in a week - five days of parkour/conditioning/rock-climbing does that to you. So sue me. (Then watch as I nimbly elude your litigious minions.)

It's mid-March. There's nothing special about mid-March per se; it's just close enough to the Spring 2009 term to finally kick off the housing search. If anyone cares, I'm looking for something: close to Uptown Waterloo, at most $350/month, non-smoking, decent kitchen, with broadband and at least passably sociable roommates. I'd prefer laundry and relatively secure bike storage, but I'll take what I can get. Now to set up a properly-weighted LP and crunch the available housing data...

I've tried a number of approaches in the student housing market. Cluster-bombing Craigslist, Kijiji, and Facebook Marketplace allowed me to sublet out my previous digs with relative ease. On the other side, I've always had decent success sifting through Off-Campus Housing. I tried finditoffcampus; the interface is zippy, the idea is good, but there's still a couple of missing pieces. The selection is somewhat limited (only 220 listings!) You can search for housing near the universities/colleges, but you can't search by proximity to, say, Uptown or Waterloo Park. The Advanced Search form fails to fill in sensible defaults - try filling in just the upper limit for rent, and you get this. These are mostly minor annoyances, though, and it could easily cure me of my board-sifting ways with just a touch more work.

March 3, 2009

On a More Personal Note

My posts have been fairly tech/rant-heavy over the last while, so I figured I'd take a breather and bring everyone up to date on, well, me.

I've been madly posting to the PKCC sessions and regional talk, doing my part to help revive the Ottawa parkour scene. Yesterday, fainjoe (one of the PKCC regulars) and I paid a visit to the Ottawa Gymnastics Centre for their open gym session; apparently this is where all the traceurs are hiding, and no wonder - there's plenty of equipment and floor space to play around with. I'm confident that we can turn this into a cohesive and highly active group again. In the meantime, I'll be hitting up OGC and Vertical Reality (thanks for the tip, fainjoe!) as much as possible, aiming for my (possibly foolhardy) term goal of 5 consecutive muscle-ups.

Aside from that, I've been trying to knock all those menial but necessary items off my to-do list - things like filing taxes (in both the US and Canada!), making sure I can graduate on time (despite my propensity for taking the hardest classes possible), and finally firing off some essential emails. Not so exciting, but it will be nice once I have these weights off my shoulder.

I did manage to come up with a decent approach to my current project at NRC. I could tell you what it is, but - well, you know.

I'll be in Indiana for the last weekend in April - prepare your lynch mobs now, Hoosiers! As we Canadian pirates say, ehhhhhrrrrrrrrrrrrrrrrr!

Public Service Announcement

The concept of an academy for public service is solid, but the public sector needs more than manpower - it desperately needs brainpower, and top brainpower at that. We need judges and patent officers who grok current technologies, and qualified IT specialists who will apply that technology to reforming paper-form bureaucracy. We need urban planners who understand green design principles, and legislators who will update our building and zoning codes to accept those principles. We need ministers and advisors with expertise in addressing environmental and economic issues. We need math teachers who know math. We need education advisors who believe in the value of music, of art, of physical education. The list is endless.

Bottom line: the public sector is bloated and rife with nepotism, so much so that the very people who could reform it avoid it like the plague. After all, why spend years banging your head against red tape when Company X will put your skills to use immediately and pay you more for the privilege?

I'm going to make a controversial assertion: we need "braintrust conscription." We need to force our world's most knowledgeable and respected experts to spend two years using their skills in the service of the public good. We need to force our most experienced workers to become teachers. Conversely, we need to force our public servants to hold relevant qualifications.

I'm slowly becoming convinced that this is the only way to address our current problems. Our political circles are awash in so-called "leaders" - alpha-male types who git 'er done like blind (American) football players, conniving backroom puppetmasters, and a smattering of determined yet relatively impotent do-gooders. Enough. It's high time to bring meritocracy to politics. Iff the Public Service Academy can do that, I'm all for it.

March 1, 2009

Pirates of the World, Arrrrr!

"First they ignore you, then they ridicule you, then they fight you, then you win." -- Mahatma Gandhi

Judging by the absolute chaos going down in Sweden, I'd say we're well into the fighting stage. Conflicts of interest are popping up like flowers, the FUDslingers are in full swing, and The Pirate Bay's pagehits are skyrocketing. The RIAA/MPAA are backed against a wall, their remaining options few; to vanquish file-sharing, the Internet would need to be transformed from an information free-for-all to something akin to Vista's DRM pipelines. Failing that, they would need the compliance of every last government and ISP on Earth. Even that might not do it; throw mobile mesh networks and increasingly popular (and cheap!) netbooks into the mix, and you've got a recipe for file-sharing flash mobs.

The recording industry might win this battle, but they won't win the war. TPB's outright defiance is building a critical mass of support, and all the budget-horror pyramid charts in the world can't do a lick of good against that.

(As an aside: your opinion of him regardless, rms has a Pretty Good Plan for reasonable copyright laws - far more sensible than his protracted debate over the semantics of Linux vs. GNU/Linux. Check it out.)

February 26, 2009

In Soviet Russia, Website Uses You!

I could go on for days about how government websites are hopelessly mired in a funk of ancient design practices and proprietary databases - or I could just point you here, where the U.S. Department of Health & Human Services has kindly made my point for me. Among the snafus:
  • Three separate stylesheets. Three: one for IE, one for Navigator 5 and up, and one for the rest - plus the browser detection code is crude.
  • Those image links are killing me. They're ugly, they're unnecessary, the rollovers don't even line up properly. Worse, they're backed up by some horrendous-looking JavaScript that could be rewritten in about five lines even without pulling in anything like jQuery.
  • Searching the site for CSS turns up...no results. How do you write about website usability without once mentioning CSS!? Simple: throw in a bunch of process jargon. And you wonder why these government websites never finish their usability reviews...
  • That aside, finding anything on this site is a bit of a chore. Either I go with Search and receive what I'll refer to as "context-free results", or I poke through their gangly tab-list-hyperlink structure. Wait, never mind - this makes everything so much clearer, right?

And...

...we're back to relative sanity here at Quizzical Quincunx, now that the new CSS has been plugged in. With that out of the way, I might delve into the widget content itself (free time pending, as always!)

Note to Blogger: editing HTML directly through your editor is a terrible experience. So terrible, in fact, that I resorted to saving a local copy and vim-Firebug double-teaming it. Make it easier to quickly see the results of my changes and start supporting things like, you know, the tab key. Ugh.

Note to everyone else (yes, all three of you): comments? thoughts? gripes? minor sticking points? Feedback is always appreciated.

February 24, 2009

Hooray for Experimentation!

I'll be gutting and tweaking my Blogger theme over the next few days. In the meantime, if you should have the misfortune to happen upon my humble ramblings and irreversibly sear your eyes in the process, well - you have been warned.

February 23, 2009

On the Bright Side...

...my camera and associated USB cable are finally in the same location, which means I can start annotating my posts with random images like this:

Pay attention to what the Fuel Gauge says!

It was the best of luck, it was the worst of luck: today, en route to salsa lessons (nothing better than dancing away the Ottawa winter blues!), I ran out of gas halfway up a hill on King Edward - almost directly across from a gas station. I was operating under the (evidently false) assumption that the angry blinking indicator really meant that I had about 30 km of good driving left before my ride puttered out on me.

Which brings me to ask - we have indicators that display external temperature, speed, and cumulative distance. We have GPS systems and radar warning systems and anti-lock brakes. Why not tell me exactly how many liters of gas are sitting in my tank? After all, if we want to encourage those hypermiling gas-sipping compulsive optimizers, we should give them all the relevant data.

February 12, 2009

ICANN't

Here's a question: in the age of crowdsourcing, social networking, and distributed peer-to-peer filesharing, why do we have to pay a centralized body $2500 for the right to directly register a domain name? Small wonder that some disagree. Part of the issue is DNS itself - to translate that nice, human-readable URL into an IP address like 64.58.66.214, your computer has to ask a translator. To find the right translator, it asks a global directory.

If you have any background in security whatsoever, digital or otherwise, you're probably asking yourself - isn't that a really dumb idea? Sure. Let's ignore that, however, and envision instead the following scenario:

A person, who we'll call X, decides one night to nmap -sP 0.0.0.0/0 | grep "appears to be up". X then scrapes DNS and WHOIS info for each responding host using nslookup and whois into a massive database. Since X is a computer programmer par excellence with access to infinite upload bandwidth, they write their own server capable of answering all DNS queries worldwide.

Obviously, there are some minor wrinkles - like the intractability of crawling the IPv6 address space, or the impossibility of X being able to serve the immense global DNS lookup demand, or the infeasibility of expecting your average (read: clueless) computer user to change their DNS lookup settings. The above scheme is clearly suboptimal, though; the scraping part is embarrassingly parallel, and X could easily publish the data publicly - as a torrent, say, or as multiple smaller chunks.

Of course, this opens up a whole new can of worms: as a decentralized DNS provider, I could direct every lookup to my website or add entries for my competitors pointing to, er, less reputable content. Nevertheless, the idea is at least plausible; with a reliable trust model and just enough regulation of domain markets to shut out serial cybersquatters, it might even be workable.

February 11, 2009

NaNoWriMo 2008

Last term, I had the immense pleasure of participating in NaNoWriMo - that hallowed annual event wherein would-be writers consent to a month of grueling lexical vomitus in exchange for, well, nothing (unless you count pride and a sense of accomplishment as material.)

My tool of choice? Google Docs. Despite some slowdown on the sluggish university lab terminals - especially towards the end of the month - the experience was relatively smooth. The greatest benefit, however, was being able to easily share it with friends and have them track the development of the story. Try doing that with MS Word. Anyways, here it is.

February 8, 2009

Dimwitted Reactionary Measures

Just read some snippets from Cory Doctorow's 2004 talk at Microsoft Research about the absolute mindboggling brain-deadness of DRM schemes - it's a shame they ignored the lesson. Anyways, the talk is well worth a read, even if it is outdated by online standards.

February 3, 2009

Monkeying Around

I finally got in touch with PKCC, Ottawa's local parkour community. One of their members is trying to get a weekly group conditioning session going, which is definitely A Good Thing; the harsh and prolonged Ottawa winter puts a damper on most regular outdoor activity, save perhaps for the occasional bit of vigorous snow-trudging.

On my goals list for this term: do 5 muscle-ups in a row. My training has been less than dedicated over the last couple of years, and this seems like a good benchmark to start with.

That said, I'm slightly disappointed to find that PKCC is nowhere near as active or cohesive as the group in Toronto. I'm hoping that the Ottawa scene will pick up again once this frigid pallor lifts. Until then, I've got some serious conditioning to do.

February 2, 2009

Doesn't Help, Statistically

Bruce Schneier often finds occasion to rail against what he refers to as "security theater" - and what better example thereof than that most venerated of public institutions, the Department of Homeland Security? Happy reading.

(As an aside, I'm still waiting for the day when some enterprising terrorist decides to make explosive clothing, thus resulting in a general ban on clothes in airports. (Not really, of course - but it makes for a darkly comical thought experiment!))

(Update: I can't believe I'm linking to MSN Video, but...watch L'Aeroport.)

February 1, 2009

So You Think You Can Sort

Selection sort. Insertion sort. Quicksort. Mergesort. All are standard fare in your average basic-level CS class; the first two are inefficient but conceptually simple, whereas the last two are decent general sorting algorithms. This is all good and well, but no one uses them for performance-critical applications:
  • Often, a sort is not required; what you really want in most large-scale cases are the top k results for some relatively small k.
  • Real-world data has patterns that general algorithms like your standard library quicksort fail to exploit.
  • Comparisons and swaps aren't always cheap.
For you C++ programmers, the first point means little more than the difference between sort and partial_sort. The second point, however, is slightly more subtle.

As a simple example, suppose you have a billion integers to sort, but you know that each one is between 1 and 100. With that restriction alone, you can easily sort them in O(n) time. Other examples:
  • The data are k-sorted (i.e. A[i] >= A[i-k].)
  • The data aren't quite sorted, but they are unique; furthermore, abs(A[i] - A[i-1]) < k.
The third point might seem like a dubious proposition, especially that part about swaps. How can swaps be expensive? If I want to swap complex structures, I use pointers. Simple, right?

A while ago, I wrote a DHTML table sorter (for fun, naturally!) For reference, here's a standard quicksort implementation. Ignoring the horrendous colour scheme for a moment, why is the first one so much faster? Simple - it avoids swapping DOM elements. (There's a reason it's called permutation quicksort!)

Fine. So we can guarantee O(n) swaps in exchange for linear memory overhead. How do you limit comparisons? Remember that second point - notice patterns.

At Last!



Yeah, I know. Problem 117 is easy. IMHO, it's ranked "harder" than other problems simply because the requisite formulae for many of these questions are easily found using a combination of Wikipedia, MathWorld, and Sloane - which is not to say that the implementation part is always trivial!