April 30, 2009


The birds are singing, the sun is bright, the days are getting ever-longer - and I have to write another work term report. Ugh. Fortunately, a quick Google search brought up this. It's not the cleanest bit of LaTeX code, but it gets the job done! (Yes, I know I could use Word. I'll consider it next time I want to spend 90% of my time format-tweaking to obtain a layout that I can't easily reuse and share.)\

Also: the same search unearthed this (unfortunately nascent) effort to create a public repository of work report templates! Hooray for open source.

Little 5

(Not to be confused with Big5.) 5 hours of plane travel each way (despite the fact that a direct flight would probably take less than 2.) 5 pictures (four of airports and one of the best beer selection I've seen since...so I forgot to take real pictures. Oops.) 5 ten-spots laid out for extended-stay parking at YOW. 5 pancakes shuttled down my gaping maw. (At least I think it was 5. Really, the pan-sized ones can count for anywhere between 2 and 3 - say, e pancakes.) 5 bottles/cans of beer partaken of in the weekend. Coincidence? I think so. Anyways, Little 5 weekend was an absolute blast - I'd write more about it, but that's already been done for me.

April 29, 2009

Nobles Paroles, Seigneur Gardakan!


A while back, I promised some basic regularity in my postings here. I've been somewhat lax with that, so here's the first in a rapid succession of updates covering my numerous activities this previous fortnight.

The weekend of April 17-19 brought me the inestimable bewilderment and pleasure of two lifetime firsts. It was my first visit to the beautiful bastion of historical import that is Quebec City. I only received a cursory overview of the city proper, however; the bulk of my weekend was spent engaging in the sort of faux-chicanery alluded to by the above snapshot. (I've got a few more here, among other random photos.) Yes - it was also my first time engaging in the bizarre yet alluring world of Live Action Role-Playing, which translates in French to the somewhat more poetic Grandeur Nature.

Imagine a weekend-long costume party where the attendees actually put in some effort, throw in some overtones of medieval fantasy, toss it all together with a heavy dose of guerilla theatre, and garnish lightly with pencil-and-paper role-playing geekdom. That gives some idea of the atmosphere here.

Of course, Imagika is one of the more politically-involved games out there, and so I spent much of my time randomly milling about while grasping desperately for some context as to how exactly a debate on slavery, a war against the descendants of dragons, the birth of a new god, a wayward monk whose teachings instilled madness, a roving band of necromantic cultists, and countless other subplots were connected. Owing to my status as a weak newcomer, I also spent a good deal of time faking death while awaiting the kindness of capable healers. Peu importe - it was still loads of fun, and I might even consider taking part in Waterloo By Night if my habitually overloaded schedule permits!

April 20, 2009

Speaking of Essential Research...

...here's a gem from the pen of Knuth.

Lights Out On Parliament Hill

For those who can read French: here. For those who can't, a brief summary:

As the Obama administration pours billions into scientific research, Harper and his cronies are busy slashing funding for "non-essential" research left and right in favour of programs that will net immediate jobs - this, shortly after announcing cuts in support for the arts. Between this and the appointment of a creationist as Minister of Science, it's evident that Harper is, er, heaven-bent on ensuring that we remain shackled by Bush-era ideals. Let's hope that the common sense of over 2000 of Canada's top scientists and researchers can sway the issue, and that subsequent governments have the foresight to protect Canada's position in the modern global economy.

April 16, 2009

Something To Chew On

To please certain of my readers, I furnish you with this bilingual gem from the hinterlands of Gatineau - enjoy.

Original Thug Life

Proof, if needed, that LaTeX is the shiv of academics worldwide. Now get outta my way before I get all Knuth on your ass.

(Oh, and bonus points if you get the reference in the comic/song.)

Safe Computing 101: Use LaTeX

I'm plunging into that dreaded final stretch of the work term, where everything is due concurrently and you suddenly realize you have approximately numeric_limits<int>::max() things to properly wrap up. Top of the end-of-term priority queue: give two presentations tomorrow morning explaining how exactly I spent the three months prior. Most people would reach for PowerPoint at this, er, juncture. I, however, am a CS student with a Tux-genuflecting, Redmond-execrating reputation to uphold, and therefore by socialization rendered immune to such manifestations of pure evil. I'm with these people on this one, and so I reach for something completely different: LaTeX with Prosper. As a result, I can nimbly sidestep the format-tweaking cruft of PowerPoint and cut to the meat of the matter - the content. Not only that, but my content becomes easily reusable if, say, I want to draft some papers. Even better, I can quickly render PDFs, PostScript, or whatever I want out of the LaTeX files, all the while remaining smugly assured that my presentation will work on pretty much any computer - for free. Try doing that with those arcane and proprietary MS formats.
Long story short: if you have an urge to use MS Office, there's usually a better way.

April 15, 2009

The Twitter Olympics

The Waterloo Regional Police Service has recently joined the ranks in using Twitter to broadcast updates, incident reports, and other information - 37 followers and counting. Now if only the rest of our public services could follow suit...

April 14, 2009

Rise and Shine

6:40 am - a record unmatched in the three months and change since I rolled off a plane from Tokyo directly into the flesh-piercing depths of the infamous Ottawa winter, only to greet the then-prolonged night at the sprightly hour of 4 am. This is not really impressive by any means - back in high school (a suitably Germanic name for it) I would routinely hoist myself from betwixt my covers ragdoll-physics style around 6:30 am to make the train for band practice.

Also a first for this term: pre-work training. I've started adding weight to my squats and situps, and am adding one-legged calf raises and pistols to my routine - as far as bodyweight exercises go, the unbalanced motions are spectacular for both strength and stability.

And now for something completely different: I made a trip over to Value Village this weekend to pick up some garb such as might befit one with a taste for the piratical. I'll explain later - say, about a week from now - in lurid detail both visual and prosaic. I will remark, however, that it has proven nigh impossible to source a tricorn in Ottawa, whereas a quick perusal of the Kensington-Chinatown stretch back in Toronto would effortlessly net me my sought-after accoutrements. Oh well.

April 8, 2009

Best Malpractices

"I learned very early the difference between knowing the name of something and knowing something." -- Richard Feynman
With that in mind, here's a well-reasoned rant against Best Practices. The IT world is replete with buffoons - programmers, managers, CS students, whatever - who toss around terms like AJAX, ORM, XP/Agile, Web 2.0, RDBMS, DRY, NIH, and OOP without ever pausing to ask the real questions. What do they mean? What do they do? Where do they succeed - and where do they fall short?

Consider this: Google does not follow Best Practices. They solve problems. Period.

Dark Night

Stayed up late (for work-term-acceptable values of "late") last night to watch Batman Begins. It's a fairly solid flick, but...while scientific snafus don't bother me as much as some, I draw the line somewhere before targeted microwave weapons capable of vaporizing a city's water supply while leaving nary a scratch on millions of human bystanders.

Speaking of water, it's hovering around freezing point here in Ottawa for the third day in a row. It's spring now - didn't you get the memo?

April 6, 2009

Brute Force Attack

Somewhere back near the beginning of this term, I set myself a goal. Today, I made some very definite progress towards that goal by completing three (non-consecutive, alas) muscle-ups on one of the bars at OGC. Of course, I'm sticking to the wording of the goal, which means this only counts as one in a row; that said, they take a fair amount of dedication to build up to, so I'm quite proud of myself right now!

Winter, Still

It's snowing - rather fiercely, too. I'd provide proof, but I don't have my camera and the Hill Cam is down.

Edit: Our wintry sentence has recently been commuted to a blustery blanket of barely-liquid rain. I now fully appreciate the benefits of living a mere two-minute walk away.

Bric-A-Brac, Post-Weekend Style

Decided to try waking up earlier this week. Today: 7:20 am after one false start at 7:07 am. (Yes, I really do set my alarm clock for times like this - my favourite time is 8:08.)

Sugar is wonderful, maple sugar all the more so. I had the inimitable pleasure of visiting a sugar bush on Saturday along with the rest of my office; turns out the uncle of one of our programmer-analysts runs the operation, now in its 27th season of business. Nothing like maple sugar, maple syrup, and maple taffy in one day to mount a buffer overflow attack on your sweet taste buds.

Just found this cool animation off a link posted in a tweet from an ex-coworker; as explained on the video page, it uses data from this site. My $.02: I think all public services, utilities, etc. should be releasing data APIs for the general public to hack on. They could even release the data under a GPL-ish licence that requires any resulting apps to be made publicly available. They could even go one step further - simply hold an online vote to pick the top apps, then host them free of charge on their website. Help us to help you...

Edit: I forgot to post links to the sugar bush photos! Here they are. Additionally, here's some more pics as taken by coworker Boxing Chen and uploaded by the owner, Pierre Joanis.

April 4, 2009

Quod Libet: First Day

Some thoughts/observations so far:
  • I'm enjoying the automatic rating plugin, and expect it will be very useful in filtering out the detritus from my CBC Radio 3 crawls - just listen on shuffle for a while, then drop the worst-rated files.
  • The default rating settings are weird - 4 notes? Usually 5 or 10 is standard.
  • I haven't found a way to properly refresh the library without restarting - newly downloaded songs don't show up. Not a deal breaker, but annoying nonetheless.
  • Relatively seamless transitions between songs. I like. Also, the interface is snappy in general - no slowdown when I rescan the watch directories, no strange loading pauses.
  • The built-in config GUI hides most options from me. Why? Is it that hard to provide an advanced settings toggle?
  • The Amazon album-cover-grabbing plugin is barfing on me with some expat errors. Not cool. (As an aside: there's a bewildering proliferation of XML-parsing libraries for Python. It's no wonder that the Python standard library has taken the "here's some reasonable defaults, plug your own in if you want" route.)
Overall, it's a positive first impression - most things work as they should, save for some minor gripes with plugins and general style.

Anything Goes

A growing music collection demands a powerful media player. While VLC will play just about anything you throw at it, it seems to choke regularly on larger libraries. I'm giving Quod Libet a spin for now:

# apt-get install quodlibet quodlibet-plugins

(The plugins aren't strictly necessary, but they include some nice features like album cover grabbing and automatic rating systems.) So far, the experience is pretty seamless, though I've only got about 2000 songs loaded into the library; I'll be chiefly looking for scalability as I put my 1.5 TB RAID 5 to good use!

Scripted Reality

As promised, here are the scripts.

April 3, 2009

The Sound of Scraping

After sitting on my CBC Radio 3 metadata for just over a week, I finally got around to throwing together a decent downloading script. Actually, the scraper/downloader is a loose federation of scripts, deliberately kept in separate modules so as to allow nice things like, say, running multiple copies thereof concurrently. I'll post a link to the source in the near future, along with a few words of explanation. Maybe I'll even write a README - after all, although CBC Radio 3 is afloat for now, there's no telling how long it will survive the budget axes of doom.

(And, to prevent the inevitable smartasses from chiming in with "you forgot wget, n00b" - nope, it's in there somewhere. That said, I think you'll find these scripts go a tiny bit further...)

April 2, 2009

If It Floats Like An Octopus

"C++: an octopus made by nailing extra legs onto a dog."

C++ is often referred to as a statically-typed language - it aggressively checks types at compile time (and, in the case of anything STL-related, spews out monstrous-looking errors.) By comparison, many "scripting" languages (and I use that word cautiously, since these are proving to be powerful application development languages in their own right!) such as Python and PHP support what is known as duck typing. Many rail against this, arguing that it leads to unmaintainable code and nasty runtime errors.

That aside, C++ does have support for duck typing - in its template system. Consider:

#include <iostream>
using namespace std;
template <class T> void p(const T& t) { t.print(); }
struct A { void print() const { cout << "A!" << endl; } };
struct B { void print() const { cout << "B!" << endl; } };
struct C { };
int main() {
   A a; B b; C c;
   p(a);        // "A!"
   p(b);        // "B!"
   //p(c);      // compile-time error

The global function p() enforces no type restrictions on the template class T; all it requires is that T implement void T::print() const, as A and B do. Also, note that p(c) causes a compile-time error, not a runtime error! There is a tradeoff, naturally: the compiler creates a separate copy of p() for each type that it's invoked with (g++ -S for the gory details!), so extensive use of this technique can easily balloon your object files.

April 1, 2009

Oh, Google

In the grand annual tradition - enjoy.