Tuesday, December 30, 2008

Buzzword overload

There's a question on StackOverflow about the best source code comments people have seen or written. My favourite answer is this one, which doesn't require any programming knowledge to understand, since it's impossible to understand anyway. I found it quite hysterical:

/**
This method leverages collective synergy to drive "outside of the box" thinking and formulate key objectives into a win-win game plan with a quality-driven approach that focuses on empowering key players to drive-up their core competencies and increase expectations with an all-around initiative to drive down the bottom-line. I really wanted to work the word "mandrolic" in there, but that word always makes me want to punch myself in the face.
*/

Nothing about "solutioning", though; perhaps it's out of date. I'd never heard the word "mandrolic" before, so perhaps I'm out of date.

Gail has on occasion actually used some of these words, particularly "synergy" and "solutioning", and doesn't understand why I laugh every time. I have an idea what it "means", or what it's supposed to mean, but to me, "synergy" is just the quintessential buzzword that doesn't actually mean anything.

Monday, December 22, 2008

Failure is not an option

Our camera stores pictures on a compact flash memory card. The other day when changing the card, Gail managed to bend a pin inside the camera, so it wouldn't recognize any card. We took it into a camera repair shop yesterday, and it's going to cost us $200 to get fixed. The repair guy said that Gail likely tried to put the card in sideways or backwards or something and that it's not that uncommon. For a fairly expensive piece of equipment, this seems like a blatant design flaw. If a card should only go in one way, why can't they design them so that it's physically impossible to put it in wrong? Make it so that it's impossible to screw it up. Failure should not be an option.

We had the same problem with an old wireless PCMCIA card. We had a PCI card in the computer, and that card had a slot that the PCMCIA card could slip into. But it was entirely possible to put the card in the wrong way, in which case it simply wouldn't work. (Luckily it didn't damage the card.) Unfortunately, it wasn't plug and play, so you had to shut the computer down, put the card in, and boot it up again. If you got it backwards, you'd have to shut the computer down again, reverse the card, then boot it back up.

The designers of the SD card that's in my kids' $89 cameras seemed to get it right:

  1. Make it a rectangle that's longer than it is wide, so you can't put it in sideways
  2. Put a notch in one corner so that if you put it in backwards, the notch makes it not fit before the card gets to the pins.

Update: I wrote the above before talking to the camera guy. Turns out it is impossible to put the card in backwards or upside down, but it is not impossible to put it in sideways. If they had made it "portrait instead of landscape" as the camera guy said, this possibility would have been removed as well.

Friday, December 19, 2008

Raindrops on roses and whiskers on kittens

I'm not a big fan of the snow. I go skiing once or twice a year, maybe more in the future because I took the boys last year and they enjoyed it, and tobogganing and making snowmen with them is fun too, but other than that, I'd be fine living somewhere that never got snow.

However, and I can't explain this, one of my favourite things is a work-from-home day when I sit down at my laptop, sip a mug of hot chocolate, and watch a huge snowstorm outside. Maybe it's the knowledge that I don't have to navigate the roads, or maybe it's just the fact that it's cold and nasty outside and I'm toasty and warm inside, but I love that feeling.

It's snowing like crazy outside, and I just finished my hot chocolate. I might make another cup. It's a snow day today so the boys and Gail are home, but I'm warm and cozy inside and have no plans of venturing outside today (except maybe to shovel later on but I won't think about that now). <Happy sigh> Suddenly my TLS certificate validation problem on the Mac just doesn't seem so daunting.

Saturday, December 13, 2008

The might know science, but they don't know web programming

While trying to buy tickets online for the Ontario Science Centre, I saw this:

Seriously, how hard is it to accept a postal code without a space and add it yourself?

Later on in the transaction, I hit an SSL error because the certificate was valid for "www.ontariosciencecentre.ca" but I happened to type "ontariosciencecentre.ca" into my browser, and none of the links after that redirected me to "www.". If their certificate relies on the "www." prefix, then their web server should be redirecting me.

They might know everything there is to know about science (and they do, I've loved going to the Science Centre since I was a kid), but their webmaster has a few things to learn.

Update: As you can see in the comments, Ken Huxley from the Science Centre has fixed the postal code problem and is working on fixing the SSL problem as well. Kudos to him, and my apologies for my condescending "has a few things to learn" comment above (not to mention the title of the post). When he mentioned that he was going to reconfigure DNS to fix the SSL problem, I realized that I understand at a high level what he's going to do, but I have no idea how to actually do it. I guess I have a few things to learn as well. But if I hadn't whined written about the problems I found, they wouldn't have gotten fixed, so it's nice to know that my blog has made the world a better place.

Tuesday, December 09, 2008

Stability in the NLL

OK, this is getting ridiculous. There's a news report saying that the owner of the Chicago Shamrox is trying to sell the team, and they might fold (as early as this week) which would require yet another dispersal draft. Is anyone else getting tired of this? The last time an NLL season began with exactly the same teams as the previous year (in the same cities) was 1993. Here's what's happened since:

  • 1994: Removed Pittsburgh
  • 1995: Added Rochester, removed Detroit
  • 1996: Added Charlotte
  • 1997: Removed Charlotte
  • 1998: Added Ontario and Syracuse, removed Boston
  • 1999: Ontario moved to Toronto
  • 2000: Added Albany, Baltimore moved to Pittsburgh
  • 2001: Pittsburgh moved to Washington, Syracuse moved to Ottawa, added Columbus
  • 2002: Added New Jersey, Montreal, Calgary, Vancouver
  • 2003: Washington moved to Colorado, removed Montreal
  • 2004: New Jersey moved to Anaheim, Albany moved to San Jose, Columbus moved to Arizona, removed New York and Ottawa
  • 2005: Added Minnesota, removed Vancouver
  • 2006: Added Edmonton and Portland, removed Anaheim
  • 2007: Added New York and Chicago
  • 2008: Removed Arizona
  • 2009: Added Boston, removed Chicago?

Sometimes franchises fail because lacrosse just didn't sell in that city (Ottawa, Anaheim). Sometimes they fail because of corrupt or incompetent ownership (Vancouver). In the case of Arizona, it was some mystery reason that made no sense — they shut down operations because the season was cancelled, but then the season was resurrected two weeks later. Arizona management announced that they had already shut everything down and couldn't restart it in time (though every other team managed it), so they'd just sit out 2008 and return in 2009. Of course they didn't return at all, so it sounds to me like they used the season cancellation as an excuse to fold up operations since they weren't making much money. This is too bad (particularly for Arizona fans), since they had a very good team that made the finals twice in three years. The Chicago thing sounds like another mystery reason — their owners say that it's just too difficult to manage the team in Chicago from their offices in Atlanta and LA. Mmmmmmkay. Never heard of phones? Email? Video conferencing? Hell, hire someone who lives in Chicago that can run things.

What the hell ever happened to due diligence, not only on the part of NLL ownership groups, but on the part of the NLL itself?

Apparently the Chicago owner announced that he wanted to sell the team during the middle of last season, which means that less than two seasons after he bought an expansion franchise, he's trying to sell it. Did he not consider the "difficulty" of running a team from a thousand miles away before spending $3 million to buy an expansion franchise? Did the NLL not ask him how he intended to run the team from a thousand miles away?

Twenty-one NLL teams have folded or moved since the league was formed in 1987. Of those, four only lasted a single season. Compare that to the NHL, where a total of eighteen teams have folded or moved since 1917. Three cities (Pittsburgh, Washington, and New Jersey) have had NLL teams fail twice, and the New York Titans are threatening to make it four. Does this sound like a good league to purchase a franchise in?

Having said that, the Toronto, Colorado, Calgary, Philadelphia, Buffalo, and Rochester franchises are all healthy. I don't know about Edmonton, Minnesota, Portland, or San Jose, and I haven't heard too much lately in the way of negative rumours about those four. I really hope that the late 90's and early 2000's were a kind of experimental phase for the NLL, where they tried lots of new markets, many of which failed. Now that they have a core of seven or eight franchises that are doing well and are unlikely to fold, perhaps we'll see a little more stability.

Thursday, December 04, 2008

On rebuilding

I read an article on general borschevsky's Maple Leafs blog the other day that contained the following text at the bottom:

Brian Burke believes Mats Sundin is not interested in returning to Toronto. No one seems to mind. Despite the obvious need for a top line centre, despite the need for veteran leadership, despite the fact that this team is already better then last year's team and that the playoffs are just a short win-streak away,...

As soon as I saw the line about "the playoffs are just a short win-streak away", I cringed. I immediately commented on the article, saying that this is why many people think that Leafs fans are stupid. No matter how bad the team is, these die-hards always seem to think that if we just make the playoffs, the Cup is ours. Or that making the playoffs, even if you get swept in the first round, makes the season a success. I wrote a little while ago about delusional Leafs fans who think that every year is the year. I, on the other hand, have accepted the fact that this year's Leafs are not a contending team, and are likely not even a playoff team. In the long run, this is probably good, in that they will get a higher draft choice, and Our Saviour will pick the next Sidney Crosby.

For the record, general borschevsky is neither delusional nor stupid. He responded to my comment, saying that making the playoffs may not mean a Cup victory, but it does mean that we'll be watching the Leafs in the playoffs, and it'll be exciting and entertaining. And for those of us not employed in the sports industry, that's what sports is, isn't it? Entertainment? This is a good point — neither Toronto nor Pittsburgh won the Cup last year, but I am quite sure that Pittsburgh fans enjoyed last year's playoffs a lot more than Leafs fans did.

There are three reasons a team misses the playoffs:

  1. Your team sucks because you are rebuilding, and after a few years, you will be a contender.
  2. Your team sucks because you are rebuilding, but after a few years, you will still suck.
  3. Your team just sucks.

Of course, the difference between groups 1 and 2 can only be seen through hindsight. The Leafs have missed the playoffs three years in a row, and I think they were squarely in group 3 during that span. They were not rebuilding — you don't trade away a prospect and a draft pick for Yanic Perrault if you're rebuilding. But the Leafs are clearly rebuilding now, so if they miss the playoffs this year, it will be because they have moved to either group 1 or group 2 — only time will tell which one.

I have been a Leafs fan my whole life. In that time, I have never watched a Leaf game hoping that they lose. So why is it that I cringe when someone suggests the possibility that the Leafs might make the playoffs this year? Because I have managed to convince myself that in order to get good, the Leafs will have to suck for a while. I mean really suck. It'll be a tough couple of years (or more), but if Our Saviour does what everyone seems to think he will do, the Leafs will be a really good team in four or five years. I know that there's no guarantee (losing is a necessary but not sufficient condition for building a winning team), but I have some confidence, so I'm willing to put up with the sucky years, mainly because the only other option is stay mediocre-at-best for the rest of whatever. So I've convinced myself that the Leafs will suck for a few years but in the long run, this is a good thing. I've braced myself for the pain. Then someone says "the Leafs could make the playoffs!" and I realize that if that happens, the pain will likely still come, it's just been postponed.

I love analogies. I'm not always good at coming up with them, but I love them. So here's my analogy. Sorry if you're reading this over lunch.

You went for dinner at the local greasy spoon and had the monster chili burger with onion rings and big piece of coconut cream pie. And a Diet Coke. Man, was that good. But a couple of hours later as you're sitting down to watch the Leaf game, you realize that the Diet Coke just isn't sitting well. Damn, shoulda had the chocolate shake. The discomfort turns to pain, and a few minutes later, you start to wonder if your dinner might, ahem, come back. Twenty agonizing minutes later, you're now hoping it will come back, since that will likely make the pain stop. You make your way to the bathroom not looking forward to what's about to happen, but ready for it. But when you get there, the bathroom door is locked — your roommate, who went for dinner with you, is in there already with similar issues. Do you bang on the door and thank your roommate for allowing you to put off the inevitable upchucking? No, because as unpleasant as it's going to be, you know it's necessary, and you've braced yourself for it.

Dumb analogy? Well, sure it is. Dinner is likely coming back up anyway, whether the bathroom door is locked or not, whereas the pain of not making the playoffs but not getting any better either can continue indefinitely. So here's another one:

You're in the dentist's office getting a filling. The dentist is about to stick that four-foot needle in your mouth (and then wiggle it around just in case you can't feel it). You grip the armrests, leaving visible dents that patients that use that chair the next day can still feel, bracing yourself for the most unpleasant part of any dentist visit. (Aside: I've had many fillings and four or five root canals and crowns, and for me, the needles are always the worst part.) Just before the dentist gives you the needle, he remembers something. "Oh, hold on" he says, puts the needle down, and starts fiddling with some other equipment. You breathe out, having been given a little reprieve. A minute later he picks the needle up again and says, "OK, I'm ready now". You grip again, and again he says "Oh, wait a sec" and puts the needle down. Now say he keeps doing this, several times. First off, you might want to find a less forgetful dentist. Secondly, by the seventh time he does this, you're ready to yell "Just give me the damn needle, will you?" Do you want the needle? No, but you know it's necessary and you've braced yourself for it.

So when someone suggests that the Leafs might make the playoffs this year, I say no. Not because I want them to lose, but because they are rebuilding and they need to lose for a while in order to get better. It's necessary, and I've braced myself for it.

Thursday, November 27, 2008

That was random

One thing that computers are really bad at is coming up with random numbers. You ask the computer to do something specific and tell it exactly how, and it will do it exactly right every time. But ask it to come up with a random number, and it will ask "how?" Well, there is no "how" for that question, you just pick a number at random. A human can do it better, but even we're not that good at it. If you ask a million people to each pick a random number between 1 and 1000, the number of people who choose numbers less than 10 or greater than 990 should be around 2% but is likely to be much less. And who's going to pick 500? Or 666? That's not very random, right?

In recent years, some computers have been built with real random number generators; these use things like thermal noise generated by the processor itself to come up with truly random numbers. In the majority of cases, though, this isn't available, or at least it may not be so you have to assume it isn't. You are then forced to use a pseudo-random number generator (PRNG), which gives you a sequence of numbers that appear to be random, but are actually completely reproducible if you "seed" the generator with the same value each time. This is helpful for us programmers when trying to reproduce a problem, but in general you want your pseudo-random numbers to be closer to real randomness, so you need to seed the PRNG with a different value each time. Coming up with enough entropy in your PRNG seed can be a difficult problem.

Many programs choose the number of seconds since midnight January 1, 1970, since it's a fairly easy number to obtain in the C language (for historical reasons that I am not going to go into here, mainly because I have no idea what they are). However, if you have multiple programs starting at the same time, they can end up using the same seed and therefore the same sequence of pseudo-random numbers, which can be a serious security hole. So some programs go much further in picking a seed — combining the current time with the process ID or some other piece of data that changes frequently in an unpredictable way. I have heard of programs that ask the user to type a sentence, and calculate entropy by analyzing the typing pattern of the user — the average number of milliseconds between keystrokes and stuff like that.

The end result is that programs sometimes have to go to a lot of trouble to come up with a seed for the PRNG that has sufficient entropy. Essentially, you need to come up with a good pseudo-random number in order to generate pseudo-random numbers.

Straight outta left field

Just announced: Brian Burke is the new Leafs President and GM. Wow, didn't see that one coming.

I was going to call it the worst-kept secret in sports, but I don't think anyone attempted to keep it secret, even when Burke was still employed by the Ducks.

Now that Our Saviour has come, the Leafs are a lock for the Stanley Cup within three years, right? If you believe the Toronto sports media who have been going apeshit over Burke for a year, you might believe that too. Personally, I will reserve judgement for a while. At least let the man arrive in Toronto before you start planning the Stanley Cup parade.

Wednesday, November 26, 2008

NLL West 2009 predictions

I did my analysis of the NLL East two weeks ago, so now I'll do the NLL west. I realized after I posted the east review that I should probably have waited for the rosters to be announced. I know about the major trades and such, but there are always players that are released and free agents signed that either aren't announced or are announced quietly, so I'm partially going by last year's rosters. Once the rosters are announced, I'll look things over and post updates if necessary.

Calgary Roughnecks

2009 will be Calgary's first full season with Josh Sanderson. Sanderson joins an already potent offensive group with Kelusky, Toth, Ranger, Cable, and Curt Malawsky, and they also signed Kyle Goundrey. The Roughnecks went 8-10 last year including the playoffs, but 4-2 with Sanderson in the lineup. Shooter is an impact player who will definitely have a positive impact on the 'necks. The loss of veteran Steve Dietrich won't make too much of a difference, since he played less than Pat Campbell last year anyway. The Roughnecks have both Ryan Avery and Matt King, both decent backups to Campbell.

Colorado Mammoth

In the past, trading Gary Gait away would be considered a major move for any team, but it's almost a non-issue for the Mammoth since he's been retired for three years. Actually, losing Gait is a plus for the Mammoth, since they picked up Andrew Potter and two first round draft picks from the Knighthawks essentially for nothing. Gee Nash is a top 5 goalie in the NLL and now has Andrew Leyshon backing him up. Gary Rosyski joins Gavin Prout, Dan Carey, and the always fun to watch Brian Langtry on the offense. This franchise has been at or near the top of the pack since they were in Washington, so it would be a mistake to count them out.

Edmonton Rush

The people who sew the names on the back of Edmonton Rush jerseys have really been earning their money in the past year. They made five trades in March alone last year (four on trade deadline day), and have made eight more since the season ended. In are veteran goalie Steve Dietrich, Spencer Martin, Cam Bergman, Andrew Biers, and Lindsay Plunkett, and out are Brendan Thenhaus, Kurtis Wagar, Matt King, Kyle Goundrey, Ben Prepchuk, and Dan Stroup. They also traded Troy Bonterre, but signed former Rock Tim O'Brien to play the same goon role. I'm surprised they released Stroup and losing Prepchuk will hurt as well. They also lost Mike Accursi who played part of last year with the Rush. Goaltending looks solid with Dietrich and Palidwor, but that's a lot of offense to lose, especially for a team that was 4-11 and last place overall last year. Barring yet more trades, I don't see the Rush contending anytime soon.

San Jose Stealth

Big changes for the Stealth! Former goaltender of the year Anthony Cosmo is gone, as are Gary Rosyski, Luke Wiles, Paul Dawson and a bunch of others. In are Peter Veltman and Matt Roik and a bunch of young kids. Colin Doyle posted his opinions on his blog after week 1 of training camp; he didn't say whether they'd be better or worse, but he did say they'd be "bigger and a little more athletic", and that the offense will "have a different flavor to it". Not sure what he means by that exactly. Lots of the defenders are American rookies, and American lacrosse players tend to start with field lacrosse and learn box later. As Doyle says, "the learning curve will take some time". With this many changes to the roster and this many American rookies, I don't see the Stealth repeating as Western division champs.

Minnesota Swarm

The Swarm move from the East to the West division, and might be poised to take over the west. Goalie Nick Patterson showed he was the real deal last year, Craig Point was Rookie of the Year, and Ryan Cousins was Defensive Player of the year. The Swarm was third in the NLL in scoring last year, and had five players over 50 points, all of whom are returning. If the sophomore jinx doesn't hit Point like it hit the previous ROTY, Ryan Benesch, I see the Swarm being a major player in the west.

Portland LumberJax

The LumberJax won the division in their first season, and then sucked rocks in their second season. Last year, they were pretty ordinary in the regular season, just squeaking into the playoffs, where they caught fire and went to the Championship game. Given all that, I have no idea how to predict what the Jax will do this year. The Jax lost Dan Dawson to Boston, and with all due respect to Brodie Merrill, he was their franchise player. Future Hall of Famer Dallas Eliuk has retired (or at least won't be playing this coming year — there are rumours that he has not retired and may play in 2010, but he's 44 now so I doubt that), but he wasn't their starting goalie last year anyway. They did sign Dan Stroup and traded for defender Brad MacDonald, but the loss of Dawson might just push the LumberJax back down into "sucks rocks" territory.

Summary

New kids on the Western block Minnesota should take it. San Jose won't repeat, but will still make the playoffs. Calgary and Colorado will be there too, as always, but there might be a pretty big gap between fourth place and fifth, with Portland and Edmonton finishing out of the playoffs.

Prediction:

  1. Minnesota
  2. Calgary
  3. Colorado
  4. San Jose
  5. Portland
  6. Edmonton

Update: After Chicago vanished and the rosters were released, I updated my predictions.

Tuesday, November 25, 2008

Dues

An actual conversation at our house tonight:

Nicky: Ryan, what's the money you have to bring to Cubs called?
Ryan: Dues.
Nicky: You don't have to go get dues today. Here. <Gives him a toonie>
Ryan: Where'd you get it?
Nicky: From my piggy bank. It's my only toonie.
Ryan: That's OK, Nick, you keep it. I'll get one from my piggy bank.

Wednesday, November 19, 2008

CD Review: Death Magnetic

I bought a CD a couple of weeks ago — an actual physical CD! How quaint! I have bought my share of music from both iTunes and puretracks.ca, and as convenient as digital music is, for some albums I still prefer having the actual CD for the liner notes. iTunes has its advantages, the main one being convenience. It's absolutely brain-dead simple to buy stuff from iTunes; from the time you say "I think I will buy this", you could have it downloaded and available on your iPod within a couple of minutes. However, the music is DRM'ed up the wazoo. I tend to prefer puretracks.ca over iTunes as they sometimes have DRM-free MP3s available, but if they don't, you get fully-protected WMAs. Either way, though, you can burn a CD from the iTunes files or the WMAs, and then rip the CD to clean MP3s. If you use a rewritable CD and then erase it when you're done, you don't even waste a CD, which begs the question: why do you need a physical CD to do this? You're using software to convert the files from protected MP3/WMA to CD format, then using software to convert from CD format to unprotected MP3. So why can't the software just do both without writing to a physical disk in the middle? It just blows my mind.

But I digress. The CD I bought was the latest from Metallica, "Death Magnetic". I have been a Metallica fan since 1991, thanks to the Black Album. I still remember buying it (and Nirvana's "Nevermind") at Tower Records in Redmond, Washington during my work term at Microsoft. It wasn't long before I picked up all of Metallica's previous albums, and "Master of Puppets" and "...And Justice For All" quickly became two of my favourite albums of all time. I wasn't that thrilled with "Load" when it came out, but it grew on me after a while and now I really like it. "Reload" never grew on me at all and I rarely listen to it. It should have been called "Filler from the 'Load' sessions". It just seems too, I don't know, gimmicky, for lack of a better word. "Garage, Inc." was good, but obviously a little different since it's all covers. Since it's mainly covers of bands I don't listen to (Motörhead, Mercyful Fate, Misfits, Killing Joke), I don't listen to that album often either (though their cover of Bob Seger's Turn the Page is seriously kick-ass). For whatever reason, I had high hopes for "St. Anger", but was sorely disappointed. I've listened to it many times since in the hopes that it too would grow on me, but while Frantic isn't a bad song, the title track annoys the hell out of me and much of the rest is simply forgettable.

Which brings me (finally) to "Death Magnetic". In a nutshell, this is easily the best Metallica album since (at least) "Load" — though given my comments above about the albums since "Load", that's not saying much. There are actual guitar solos, something completely lacking from "St. Anger". Jason Newsted was a decent bassist, but his bass playing in Metallica kind of sat unnoticed in the background. You can really hear Trujillo's bass playing, and that combined with the sometimes unconventional drumming of Lars Ulrich makes for a powerful bottom end. James Hetfield is one of the most underrated guitarists out there, probably because he isn't flashy and doesn't generally do the solos — Kirk Hammett plays the solos (and nothing else) on the recordings — but Hetfield is his usual solid self here. He is also one of the better metal singers around, in that he actually sings. He can growl with the best of them when necessary, but isn't afraid to actually use his voice for more than just belting out words.

Some other miscellaneous comments:

  • Broken, Beat & Scarred has the same problem that annoyed me about St. Anger (the song): excessive repetition. "What don't kill ya make ya more strong" is not only bad English but is said about a hundred times in the song. It's still a better song than St. Anger though.
  • the beginning of The Day That Never Comes sounds uncannily like Fade to Black.
  • The Unforgiven II on "Reload" had some obvious musical nods to the original The Unforgiven. The Unforgiven III on this album does as well, but isn't quite as obvious. The music is different, but the vocal melody during the verses is reminiscent of the original.
  • Parts of All Nightmare Long are almost radio-friendly but not as blatantly so as Escape from "Ride the Lightning". But don't expect to hear it on Top-40 radio anytime soon.
  • Suicide & Redemption is the first Metallica instrumental song since "...And Justice For All". I'm not a huge fan of To Live Is To Die, but I love the other instrumentals (The Call of Ktulu and Orion), and this one is up there with those two.

Sunday, November 16, 2008

perrow.ca 2.0

I've just finished rewriting some parts of my family web site to be more "AJAX-y". There are a bunch of pages where we have pictures from various vacations and baby pictures of my kids and such. With the old format, the page loaded all of the images for a particular page and if you wanted to see a close-up of one of them, you clicked on it and it just displayed the raw image. Then you had to click the back button to get back to the list of images. This was fine, but not very nice on a slow system (like my parents and Gail's parents, who are on dial-up). Some friends of mine use smugmug.com for their family pictures, and I like their setup — it shows some thumbnails in a panel on the left and when you click on one, it loads that image on the right. There are also next and previous links to cycle through pictures one at a time, and there are page forward and page back links for going to the next set of thumbnails. I decided to steal borrow this idea and in so doing, teach myself Javascript and AJAX. AJAX is actually an acronym meaning "Asynchronous Javascript And XML", but my solution doesn't use any XML, so I suppose I should just call it AJ.

I started doing the work myself from scratch. I found an online tutorial that described Javascript (I had done a little bit previously, but had to get much more in-depth) as well as what AJAX was and how to do asynchronous requests. After adding a few fairly simple AJAX things to my lacrosse pool web site, I started work on the image galleries at perrow.ca. I was making progress when I discovered a Javascript library called jquery which made some of the AJAX stuff easier but more importantly, made navigating through the DOM much easier as well. It allows you to iterate through all objects of a particular class and make changes to them, or find a particular element given its ID, and make other changes that would otherwise require lots of HTML changes. Best of all, they've already solved the cross-browser issues for you, so when trying to determine the size of an element, I don't have to worry about the fact that IE does things in the DOM differently than Firefox.

I downloaded it and started adding jquery calls to my Javascript code, and this allowed me to clean up my code significantly. As I mentioned, all of the code I'd written to handle IE and Firefox differences went away (and I hadn't even got to Safari, Opera, or Chrome).

The most complex part of this whole project was keeping all the languages straight. The whole site is written using PHP, so to make changes, I had to change the PHP code to generate different HTML, then update the CSS stylesheet, then add the Javascript code to make the AJAX requests, then update more PHP code to handle those requests. The Firebug plug-in for Firefox was invaluable for debugging Javascript, although there were a number of occasions where it would just lock up. Firefox would continue seemingly normally, but Firebug just stopped responding. I couldn't even click the 'X' or hit F12 to close the Firebug window. Shutting down Firefox completely and then starting it up again cleared out whatever cruft was causing that.

The other difficult part was the fact that the browser's "Display page source" feature is not useful if the contents of the page are mostly generated using Javascript. If the page wasn't doing the right thing, I had to tweak the output so that it would display the raw html so that I could see what was going wrong. This is what we old guys call the time-honoured printf method of debugging, not like these kids today with their C# and their Visual Studio and their fancy-schmancy debugging tools. Back in my day, we used printf and that was it. And we liked it.

The whole page is basically done with Javascript now. The HTML for the main part of the page now consists of:

<div id="pagecount">&nbsp;</div>
<div id="imgcount">&nbsp;</div>
<div style="clear: both"></div>
<div id="thumbnailarea"><span class="spinner">&nbsp;</span></div>
<div id="mainimagearea"><span class="spinner">&nbsp;</span></div>

Everything else is done using CSS and Javascript — CSS to define where things go and what they look like (colours, borders, stuff like that), and Javascript to load the page initially and to handle mouse clicks. The "pagecount" block is populated with the page number, number of pages, and page navigation links. The "imgcount" block contains the image number, image count, and image navigation links. The thumbnail area is populated with the appropriate page of thumbnails, currently four rows of images, where the number of images per row is dependent on the size of the block in the browser. The "mainimagearea" is populated with the first image on the page, and is then updated whenever the user clicks on a thumbnail. When the page is loaded, the "spinner" spans are initialized to contain a little spinner image spinner that indicates that something is happening in the background. Thanks to jquery, this can be done in a single line, regardless of how many spinners I have on the page:

$(".spinner").html( "<img src='/images/ajax-loader.gif' />" );

It's also nice that if I change the spinner image or the location of the file, I just have to change the URL in this one place rather than anywhere I use the spinner image. That can be done with CSS as well:

.spinner { background: url( /images/ajax-loader.gif ); }

If you do it using Javascript, however, the spinners won't show up if you have Javascript disabled. In that case, however, nothing else will load either, so the page will be entirely blank. I had to add <noscript></noscript> tags containing a message saying that you need Javascript enabled to make this work. Since I do have a non-Javascript solution (the old code), I could just put that code inside the <noscript> tag, and I probably will... later.

I used to have a special page for a "slideshow", where it would display a large image and you could click next and previous to go through them, or click "autoplay" and it would automatically go to the next image after five seconds. To implement this in the Javascript world, I just added a checkbox for "Auto-advance", which sets a Javascript timer for five seconds and pretends that "Next" was clicked when the timer fires. I had to make sure I cancel the timer if the user clicks anything else, but apart from that, it was pretty easy.

Friday, November 14, 2008

Irony: thawte.com insecure?

I was trying to download some root certificates from thawte, and Firefox gave me this error:

XSS attempt from thawte.com

Thawte is the second biggest public certificate authority in the world. Their entire raison d'être is internet security. I see there being three posibilities here:

  1. they really do have an XSS vulnerability on their site
  2. their site is badly written so as to confuse NoScript
  3. there's a bug in NoScript that causes a false positive on the Thawte web site

Any of the three is the height of irony.

Thursday, November 13, 2008

NLL East 2009 predictions

Lacrosse season is almost upon us! The season starts at the end of December, and the teams are getting their rosters ready now. I don't think I've done this in the past, but here is my mini-analysis of the NLL's Eastern division as well as some predictions for how the teams finish. The teams below are listed in no particular order; I'll get to the predictions at the end. I'm a Rock fan so I'll start with Toronto.

Toronto Rock

It turns out Dan Ladouceur did not retire at the end of last year as previously believed (though I never did see an official statement to that effect), but will play at least one more year. Honestly, I'm not sure how much Laddy can contribute anymore. He used to be a very solid defenseman, but he's not nearly as effective as he once was — though I do remember saying after one game last year that he played really well. Jim Veltman did retire which is a big loss for the Rock, but he will join the coaching staff and I think he'll do a good job there. I'm happy with the Rock's choice of Chris Driscoll as the new captain. He's a veteran player who's respected, and is also one of the unsung heroes of the Rock over the last few years. He can score with the best of them but also plays solid defense and is pretty quick on transition as well.

Manning and Ratcliff will lead the offense, and hopefully Ryan Benesch can shake the sophomore jinx that plagued him last year. Aaron Wilson is gone but was replaced by Luke Wiles, and I mentioned before that he looks like a similar player to Wilson anyway, so that's a wash. If Craig Conn is healthy then he will be a strong addition. Jason Crosbie has scored more than 50 points in four of the past six seasons, so even if the two big "ifs" (Benesch and Conn) don't produce, the offense is still better.

We lost Veltman but gained Stephen Hoar. Hoar is a good defenseman, but he's no Jim Veltman. But Veltman was a hundred and eighty years old while Hoar is 26. At best, that's a wash. There weren't any other major defensive or transition changes, so call the defense a little worse, but not significantly.

My biggest fear for the Rock is goaltending. Bob Watson is coming off a Goaltender of the Year award, which is pretty impressive for a 7-9 team that didn't make the playoffs. But he's also 38, and Mike Poulin, a very capable backup, is gone. Mike Attwood, the new backup (gotta have a goalie named "Mike", apparently), has played a total of zero minutes in the NLL. If Watson gets injured or just can't play as well as he used to, the Rock could be in serious goaltending trouble.

Overall the Rock are improved, but it may not be by much. Exactly how much depends on Conn, Benesch, and Watson.

Buffalo Bandits

Not much to say here. They're the defending champs and have made no major changes in the off-season. Tavares is 40 now but doesn't seem to be slowing down, and Steenhuis and Powless are only likely to get better.

Rochester Knighthawks

Not many changes for the K-Hawks this year, but they are significant. Out: John Freakin' Grant, arguably the best player in the game right now, and Stephen Hoar. In: Gary Freakin' Gait, arguably the best player in the game ever, and Aaron Wilson. Gait is not likely to be what he once was — heck, when he retired in 2005, he wasn't what he once was. But he's still Gary Gait, and though he won't replace Grant, he and Wilson together might, numbers-wise anyway. Last time Grant was injured for a while, Shawn Williams stepped up admirably and became the de facto team leader. Might that still happen with Gait on the team? Sure it could.

But if Wilson+Gait=Grant, then the Knighthawks are a Hoar short of the same team that missed the playoffs last year. From that point of view, it could be argued that they're not much improved from last year, and I suppose that's true. But I don't see the Knighthawks missing the playoffs this year. Why do I think Rochester will improve while I'm not so sure about Toronto? Easy: Rochester underperformed last year, while Toronto didn't.

Weird: Grant will not play this year, but he will be an assistant coach in Rochester. John Grant the injured player coaching Gary Gait the former NLL Championship-winning coach seems a little weird.

Philadelphia Wings

No major changes in the off-season for the Wings either, though reigning MVP Athan Iannucci got injured in the summer league and there were rumours that would not be 100% this coming season. If that's true, that's a big blow to the Wings, but from what I've heard recently, those rumours were unfounded and Nooch will be ready to go. Kyle Wailes has been signed and has apparently dealt with his work visa issues, and so he will be able to play this year, so he joins Iannucci, AJ Shannon, and Merrick Thomson on the offense. Geoff Snider broke Jim Veltman's loose balls record last year, and is an absolute monster on faceoffs. The Wings have Hajek, Jacobs, and Taylor Wray on defense, and they also have Rob Blasdell and Brandon Miller in goal, possibly the best one-two punch in the NLL.

I expect big things from Philly this year

New York Titans

The Titans went to the eastern division final last year, and now have a new coach in Ed Comeau. What else can I say but that they are an all-round solid team? I remember seeing Jarett Park play last year and was impressed, and Jordan Hall was a heckuva player as well. Powell, Boyle, and Maddalena make for a pretty potent offense, and Matt Vinc was an All-Pro last year. Turns out Americans can play box lacrosse after all. Who knew?

Boston Blazers

Meh — they're an expansion team so they'll suck, right? Maybe not. The Blazers grabbed Dan Dawson from Arizona in the dispseral draft (or was it from Portland in the expansion draft?), and remember Dawson brought the LumberJax from missing the playoffs to the Championship game the very next season. They also got Jake Bergey from Philly, and a couple of pretty solid goaltenders both named Mike: Miron and the aforementioned Poulin. Will they make the playoffs? I'd say probably not, but this will not be one of your 2-14 expansion teams (à la Edmonton or Ottawa).

Chicago Shamrox

Chicago only made one major move in the offseason, but it was a doozy. The Shamrox acquired Anthony Cosmo, one of the best goaltenders in the league, from San Jose for Matt Roik, a better-than-decent goaltender himself, and a couple of draft picks. This doesn't immediately turn them into a contender, they'll need some more offense for that, but they might win a few more 11-9 games rather than losing 17-11.

Summary

The East will be a tight race, as it always is. I think the Bandits and Wings have to be your top two teams. New York proved last year that they can compete with anyone, and I think Rochester will rebound from an off year, so that gives you your top four. This means that Toronto, Chicago, and Boston will not make the playoffs. Man, I hope I'm wrong about Toronto, but I have no idea which of my top four would have to drop out for Toronto to get in. If I had to guess, I'd have to say Rochester.

Prediction:

  1. Philadelphia
  2. Buffalo
  3. New York
  4. Rochester
  5. Toronto
  6. Boston
  7. Chicago

I'll do the NLL West next.

Update: After Chicago vanished and the rosters were released, I updated my predictions.

Saturday, November 08, 2008

Obama makes headlines

How is this for cool? This page has a whole ton of newspaper front pages from around the world the morning after Obama was elected. Most of the headlines are what you would expect — "Obama" (with and without exclamation point), lots about change, lots about making history, that sort of thing.

Gotta love this paper from Portugal, where a picture of a supermodel is bigger than the one of Obama and McCain. And this one, also from Portugal, or this one from Bulgaria, where there's no mention of the election at all (as far as I can tell, I don't speak Portuguese or Bulgarian). But this one combines the "best" of both worlds — a scantily-clad woman and no mention of Obama!

That last one isn't from Portugal, it's from Brazil — where they speak Portuguese. What does that tell you about Portuguese people? They like women in bathing suits and don't care about American politics. Can't fault them for that. Next vacation — Rio de Janeiro? Hmmmm....

Friday, November 07, 2008

Concert review: Robert Munsch

We went to see Robert Munsch last night in Hamilton. We saw him a year or two ago in Kitchener as well, and we all really enjoyed it, so when we heard he was coming to Hamilton, we grabbed some tickets. Gail is away this weekend so she had to miss it, but I took the boys who are both big Munsch fans. We have a bunch of his books, and the boys regularly bring home others from the school library.

I didn't know until yesterday (before the show) that Munsch had a stroke back in August which left him unable to form sentences. Luckily, he's recovered enough that he is still able to perform, though he did have a couple of pauses during the show where he seemed to forget the next part of the story he was telling. But he's quite animated and a bit eccentric on stage anyway, so if I hasn't known about the stroke beforehand, I don't think I would really have noticed.

According to the article on the stroke, he's touring in support of his latest book "Just One Goal", but he didn't perform that one last night. Munsch frequently invites kids from the audience up onto the stage, but they frequently just sit while he tells the story. During the Paper Bag Princess, one of Gail's favourites and a highlight of the show, he had people from the audience perform it with him — he'd read the lines and had the "characters" repeat them. He had a young girl playing the part of Princess Elizabeth, an even younger boy as Prince Ronald, and a father (he said he needed "an ugly father") playing the dragon. He also performed I Have To Go!, Love You Forever (which I am completely unable to read without choking up), Mortimer (which everyone loves to sing along with), We Share Everything!, Stephanie's Ponytail, Something Good, Thomas' Snowsuit, Up Up Down, and a bunch of others that I hadn't heard before. He talked for about an hour and ten minutes so it wasn't a long show, but you can't expect young kids to sit much longer than that. The tickets were $18, which is quite reasonable in this era of $75-for-the-cheap-seats concert tickets.

If you've never seen Robert Munsch perform live and you have young kids, I recommend taking in a show. By "young kids", I mean pre-teenager. I'm sure there are teens who would enjoy it as well, but it's more aimed at the younger crowd. My boys are 9 and 6 and they both loved it.

And that's the end of that story.

Wednesday, November 05, 2008

Obama makes history

First off, congratulations to US President-elect Barack Obama. I don't follow American politics all that much (hell, I don't follow Canadian politics all that much), but I do like what I've heard from Obama in the past, and I'm also glad that a nutcase like Palin will not be VP. I've heard of a lot of Americans who are truly excited and optimistic about their future with their new President, probably for the first time in many years.

But onto the reason for the title of this entry. You might think that Obama is just another politician, just like every other guy who's been elected President. But there's something different about him, something that makes him stand apart from every other President the US has ever had. Yes, it's true: Barack Obama has won two Grammy awards, both for Best Spoken Word Album. As far as I can tell, no other President has ever won a Grammy award.

To be fair, Bill Clinton and Jimmy Carter have each won a Grammy award, also for spoken word performances, but they both won theirs after being President. Hillary Rodham Clinton has also won one, so perhaps in four years...

Monday, November 03, 2008

Leafs fans are revolting

Howard Berger posted an article last week on his blog that insulted Leaf fans in every way possible. He called us sheep, delusional, easily placated, and said that we have "an insatiable willingness to accept whatever garbage is tossed [our] way". His point is that the powers-that-be at MLS&E are getting rich off of us stupid Leaf fans who continue to buy tickets and merchandise in record numbers. He even brags about how much money he personally is making from Leafs fans who read his blog. Then after all that Leaf-fan-bashing, he adds the postscript: "p.s. You're the very best, most devoted fans in the world... don't change a thing" If you asked every sports writer in Canada to write something more patronizing and ass-kissing, I doubt anyone could.

After posting this garbage article, he then has the nerve to disallow comments on it. Well OK, he hasn't formally disallowed them. Comments are moderated, which is fine, but in the four days since the article was posted, he hasn't seen fit to approve a single one. I left one myself that hasn't been approved, and if you think that mine is the only one, you're as delusional as us Leaf fans.

Update: Between the time I wrote this article and the time I published it, Mr. Berger and/or the Fan blog people approved 25 comments on this article, including mine.

Are there delusional Leaf fans out there who see a three-game win streak in October and want to plan the Stanley Cup parade? Sure there are. Are there delusional Leaf fans who hate a particular player and want to trade him for a bucket of pucks one day and then want to nominate him for the Hart trophy the next? Sure. Are there Sens fans who do the same? Yes, absolutely! Canadiens fans? Yes! Red Wings fans? Yes! Predators fans? Well, probably not. But Berger lives and works in Toronto, probably the biggest hockey market in North America, if not the world. In absolute numbers, there may be more hockey fans in Toronto than any other city in the NHL (with the possible exception of New York City, just because greater New York has four times the population of the GTA and two NHL teams — three if you include New Jersey). Every city has its share of delusional fans, so it stands to reason that if your total number of fans is higher, you're going to have more delusional fans. And guess what? These delusional fans are also frequently the loudest, so a sports writer like Berger is going to hear from them a lot more than from us realistic fans. But Howard Berger has covered the Leafs for years, so I would have thought that by this point, Berger would be smart enough not to paint all Leafs fans with the same brush.

Even my favourite sports broadcaster, Bob McCown, has talked about Leafs fans as sheep in the past. He doesn't say it because people buy lots of tickets or merchandise, or even because they support a team that hasn't won a Stanley Cup in forty years; he says that people that cheer for a team that so openly treats them like garbage are sheep. I guess I can understand his reasoning, but I've grown up in Toronto and have been a Leafs fan all my life. I can't just up and change teams, though I do admit to having had doubts in the past.

A bunch of Leafs blogs have gotten together and written an open letter to Leaf fans saying that we've had enough of media types criticizing and insulting us. They suggest a "revolt" of sorts, saying that we do have alternatives to these media types who blame Leafs fans for failings of Leafs players, coaches, and management. These blogs provide commentary and insight on the Leafs without the condescension of Mr. Berger and other Toronto sports writers because they are written by actual Leafs fans. I don't have the time to read all of these blogs myself, but I do read Down Goes Brown, which I find quite insightful and thought-provoking and sometimes just funny. Pension Plan Puppets has some good stuff as well, though there seems to be less discussion and analysis and more "Go Leafs Go!" on that one.

For my part, I have removed the Toronto Star's Damien Cox's blog from my blog list. I have only been reading it for a few weeks and I never found it all that insightful anyway. I never subscribed to Berger's blog in the first place. Now I'm posting this article in support of this "boycott" of sports writers who think of Leafs fans as moronic sheep while they make money off of us.

Having said all that, I'm not going to stop listening to McCown.

Saturday, October 25, 2008

Thursday, October 23, 2008

The hockey story that just won't die

Mats Sundin had a physical in Toronto the other day in preparation for his return to the NHL. Toronto apparently has cap room to sign Sundin, but why the hell would they? They're trying to rebuild and are letting the young kids play to see what they've got. Would Sundin make the team better? In the short term, yes, but at the expense of taking playing time away from the kids. They've already got veterans like Blake and Kaberle for the kids to learn from. News flash (via Ron Wilson): the Leafs are not going to contend for the Cup this year (or likely for at least the next couple), so what would be the point of signing Sundin?

Nobody from the Leafs organization will say this out loud, but you have to know they're thinking it: they also don't want to be too good this year, otherwise their chances of winning the John Tavares sweepstakes get lower and lower.

Sundin has said that if he plays this season, it will be his last season. But this is the same guy who refused to waive his no-trade clause last year (when the Leafs could have gotten something for him) because he didn't like the idea of being a rental player. He said that playing for the Stanley Cup is only meaningful if you've been playing with the team since the beginning of the season. And now, less than a year later, he's sitting out until two months into the season and is hoping to sign with a Cup contender, and then he'll retire after the season's over. In other words, he's sitting out specifically so that he can be a rental player.

I harbour no ill will towards Sundin; if he comes back with another team (even the Senators or Habs), best of luck to him. But part of me will remain angry with him for a while because of his refusal to waive his no-trade clause last season. He could have made the Leafs a better team in the long term by agreeing to a trade for draft picks and/or prospects, but he didn't want to do that because (he said) he didn't want to be a rental player and (he said) he wanted to remain a Maple Leaf. I accepted both of those statements at the time. But his actions since the end of last season conflict with both of them, and now I don't know what to think. It's kind of too bad that he won't get the retirement send-off that one of the best captains in Leaf history should have had. Rather than have the big celebration of his career in his last-ever game in Toronto like Jim Veltman had this past year, the Sundin era in Toronto just faded away.

A second team in Toronto? Puh-leeze.

Let's get one thing straight, OK? This rumour that the NHL is considering giving Toronto a second NHL franchise is complete hogwash. The NHL has gone to great lengths to make sure that Jim Balsillie cannot buy an existing NHL team and move it to Hamilton and the reason they've given for this is that it would infringe on Toronto and Buffalo territory. This is in itself mostly hogwash, since nothing is going to take money or fans away from the Leafs, though I suppose it could pull fans away from Buffalo. It could be argued that if that's the case, then maybe the Sabres should be moved. Anyway, after fighting Balsillie at every opportunity, they're not about to turn around and just give Toronto a second team.

Then there are the issues of where they'd play. The ACC already has three professional teams playing there during the winter, plus lots of concerts and other events; adding another team would cause no end of scheduling headaches. From a selfish point of view, this would likely mean that the Toronto Rock (who are the lowest team on the ACC totem pole) would be "evicted" from the ACC and have to play at Ricoh Colliseum, which would suck for us Rock fans.

Would a second team succeed in Toronto? Sure it would. First off, it would likely be possible to get tickets for the Toronto Whatevers, whereas getting Leafs tickets is an exercise in frustration. Plus, Toronto has a lot of people who have moved from other parts of Canada, and have hated the Leafs all their lives. Toronto loves its Leafs, make no mistake, but they're one of the most hated teams outside the GTA. A second team in Toronto would give them someone to root for.

If the owners of the new team are smart, they will keep ticket prices down, since MLS&E have not. Right now even if it's possible to get Leafs tickets, the prices are insanely high. Your average guy doesn't want to (or simply can't) spend the many hundreds of dollars required to take his family to a Leafs game. And if you want decent seats and a couple of drinks and hot dogs and to park your car within a mile of the ACC, you'd better be prepared to shell out half a grand for an evening of entertainment. (And the way the Leafs have been playing over the past few years, the "entertainment" part is questionable.) I've brought Ryan to a couple of Rock games and a Raptors game, and both my kids have been to Blue Jays games, but neither has ever seen a Leaf game live, since I simply can't justify the expense.

The whole idea seems very unlikely anyway, not only because the NHL keeps preventing Balsillie from joining the owner's club, but because they have consistently refused to investigate the possibility of moving one of their struggling franchises to Canada, whether to Hamilton or back to Winnipeg or Quebec City. In fact, the league seems reluctant to even acknowledge that they have any struggling franchises. From interviews I've heard with Gary Bettman, they won't even acknowledge that a Canadian dollar that goes from 65 cents US up to $1.05 and then back down to 79 cents has any effect on overall league revenue, despite the fact that the six Canadian teams are pulling well more than their weight. I've heard a number of times that the 6 Canadian franchises (20% of the teams in the league) bring in over 40% of the league's revenue. Bettman is determined to make the league a huge success in the US, despite the fact that every attempt to do so over the past however-many years has failed. It's big in the traditional hockey markets (Boston, Detroit, Chicago, New York), decent in some (San Jose, Minnesota, Dallas), but downright lousy in many others (Atlanta, Florida, Phoenix, Nashville). Kansas City or Oklahoma City may do OK, but they're not going to change the hockey landscape much or turn the US into a hockey-loving nation, and I think Las Vegas is a disaster waiting to happen.

Winnipeg and Quebec City would be great NHL markets. Each of them used to have an NHL team that moved, but that had nothing to do with support from the city or fans; in both cases it had to do with rising salaries and a weak Canadian dollar. With the right ownership, I think either of these two cities could flourish in the NHL. Of course, I live less than 12 km from Copps Coliseum, so I'd be perfectly happy with a team in Hamilton, but I don't see that happening anytime soon either. The NHL just won't allow it.

Monday, October 20, 2008

The Run

Yesterday was the "5K Your Way" run in Toronto for which I requested donations a little while ago. The run started at Queen's Park at 8:00am, so I stayed at my sister's place in downtown Toronto on Saturday night. We got to the start line around 7:30 and met the other members of our team. One of them had made custom (hot pink!) T-shirts for the rest of the team that said "Trudy and Jean 2008" on the front and "We acquire the strength we have overcome" on the back. The picture near the bottom of this post shows me wearing mine. BTW, Trudy is my sister and Jean is my mother, both of whom have been fought cancer within the past year. I will write more about that sometime later this week.

My parents were originally planning on walking as well, but my mom had an appointment at the hospital, so they were unable to. I was planning on walking with them while Trudy ran on ahead, so with the change of plans, I was going to walk alone. A couple of minutes before the race started, I told Trudy that I was going to start out running with her, and then when I was no longer able to run, I'd walk from there. I didn't have any kind of goal in mind at this point; I was hoping to make it more than just a couple of blocks. If I'd really thought about it, running half the race would have been quite optimistic, considering I don't run and didn't do any training for the race (since up until Friday afternoon, I figured I was walking it with my parents, and I can walk 5k without any problems).

The Race

The race started at the northwest corner of Queen's Park and looped around to University Ave. We ran southbound on University to Wellington Ave., then turned around and ran north on University back up to Queen's Park, and looped around it again to the finish line at the south end. We didn't start near the front of the pack, so the first few minutes was mostly walking since there were just too many people around to run. We passed underneath a large metal scaffold-like thing that I assumed was the sensor for the electronic timing chip that each of us was wearing. I assumed at this point that this was also the finish line, though that turned out to be wrong. Once the pack thinned out a bit, we started to run. There were a number of us running together for a while — me and Trudy and a bunch of her friends: Maria, Monica, Lindsay, and Jen (who has run full duathlons in the past, so this 5K was like a warm-up for her). We were between College and Gerrard when we saw the first guy coming back along the course approaching the finish line.

Trudy and I several years ago
Trudy and I several years ago

Before I knew it, I had run with the girls down to Dundas. I was feeling a little tired, but no big deal, so I figured I could keep going. Shortly thereafter we hit Queen St., and I realized that I only had a couple of blocks to go before we hit Wellington, where we would turn 180° and go back up University. I was excited about running half the race, so I made that my goal. I had kind of pulled away from Trudy and the other girls at this point without realizing it — it had ceased to be a social event at this point. I was simply trying to run as far as I possibly could.

Halfway there

After making the big turn, I got a bit of a second wind, and I started making smaller goals. I wanted to make it back up to King St. Once there, my next goal was Queen St., and then Dundas after that. It was when I passed Dundas that I realized that my "pipe dream" of running the whole thing just might really be possible. I mean, my legs were pretty sore, but Queen's Park was right there a few blocks in front of me, and the finish line was at the north end of that, so I was almost done! As I passed Gerrard, I saw Toronto General Hospital on my right, which is where Trudy had had her surgeries back in January and March. As corny as it sounds, that gave me a little more energy when I "remembered" (not that I ever really forgot) why I was doing this in the first place. Up until there, I was hoping that I would be able to run the entire race. Once I passed the hospital and College St. and realized that I just needed to get to the north end of Queen's Park and that was it, I decided that I was going to finish it. No more of this "hoping" crap, I'm going to do this.

I remember the very second that I first saw (what I thought was) the finish line; the song "I Kissed A Girl" was blasting from a loudspeaker, and I tried to concentrate on the song rather than my aching legs. It wasn't until I was maybe 50 feet from the finish that I realized that it wasn't the finish. There were no people standing around it, and people who were passing it ahead of me kept running without slowing down. Then I remembered that at the beginning of the race I had seen an actual finish line near the south end of Queen's Park, complete with a timer and everything. I'm kind of glad that my brain fooled me like that, since for most of the last quarter of the race, I was concentrating on the finish line at the north end, and didn't think once about running all the way around Queen's Park. By the time I realized my mistake, I was at the north end, and so all I had to do was loop around to the south end.

Beginning my recovery
Napping after the race

The Finish

About 50 feet from the finish line, there was a mat that went across the track, and as I passed over it, I heard my name being read out over a loudspeaker. A few seconds later I crossed the finish line (I didn't actually raise my arms in the air, though I felt like it), and immediately slowed down to a walk. This was almost a very bad idea, as my legs decided "Finally, he's finished the damn run and we can shut down now." Luckily my brain convinced them to hang on just a few minutes more and kept me from collapsing. Trudy and her friends finished a minute or two later and we celebrated our collective triumph.

Each runner was given a timing chip, which was a little RFID tag that you attached to your shoe. As you crossed the start and finish lines it recorded your start and finish times, thus giving you an accurate count of how long it took you, even if you were in the back of the pack and hit the start line long after the start of the race. It also allowed them to post the results of the race on the internet in real time. I ran 5 km in a time of 32 minutes 3.7 seconds. I finished 869th of 2071 participants, 406th of the 769 men in the race, and 48th of the 89 35-to-39-year-old men. The comparisons are rather meaningless, considering it wasn't a race where everybody was running; it could very well be that all 41 men in my age group that finished after me were walking, not running. I have no idea, and frankly, I don't care. I finished the race, and I considered it a race against myself. Next year, I plan on running it again, and the only time I'm interested in beating then is my time from this year.

More importantly, I raised $480 and Trudy's team raised almost $6,000 for cancer research at Princess Margaret Hospital. Our team raised more money for gynecological cancer than any other team. To my sponsors: a huge thank you to all of you, and I hope I can count your support again next year! (BTW it's still not too late to sponsor me!)

Hurts so good

After the race came the pain. We took a cab back to Trudy's place, got changed, and went over to the restaurant where the team was going to have brunch. My parents came too, as did Gail and the boys. My legs were a bit sore at this point, but I didn't really feel it until I had to take Nicky to the washroom, which was upstairs. Going up was bad enough, but coming back down was brutal. We spent the afternoon at Trudy's place and then came home, where I soaked my legs in a hot bath then took some more Tylenol and flaked on the couch for a while before going to bed. This morning I could barely walk, and I decided very quickly that there was no way I could sit in a car for an hour to get to work, so I worked from home. I made sure to get up every now and again and just walk around the house a little, and by dinner time I felt pretty good. It's now almost 8:00pm, and I haven't taken any Tylenol since early this morning. Stairs are still tough, but getting better.

I've never felt pain like this though. It doesn't actually feel any different from other times I've had pain from overexertion (for example after skiing or the baseball tournament), though maybe a little worse. I think the difference is that because I'm happy (OK, proud) that I ran the entire race, it's like I have really earned this pain, in a good way, and that makes it somehow different from the "I haven't been skiing in a year and now my legs hurt" pain. I plan on running again next year, though I will be training long and hard beforehand, and next time, the expectation will be that I run the entire thing, and beat my time from this year. I also expect to feel less pain after next year's race, but right now, I'm kind of enjoying it.

Sunday, October 12, 2008

Kicked in the Saku Koivu

I attended the first Leafs home game of the post-Kyle Wellwood era tonight. After the victory in Detroit on Thursday, Leafs fans were a little more (cautiously) optimistic about the Leafs team this year. Of course, there are the omnipresent Leafs fans who figure "This is the year" every year. They're the ones you see on TV all the time that give other more realistic Leafs fans a bad name and make people think that all Leafs fans are moronic sheep. Anyway, I hope tonight's game wasn't a more realistic indication of how the Leafs will do this year. Are they going to beat great teams like the Red Wings every time? Certainly not, but hopefully we won't see too many more 6-1 losses either.

The Good

Curtis Joseph played the third and didn't allow a single goal, much to the delight of the Joseph-loving Toronto fans. Strangely, one of the biggest ovations he got (with the crowd erupting into chants of "CuJo! CuJo! CuJo!") was after he was beaten by a shot that rang off of the goal post.

A total of one penalty for both teams in the first period.

Twenty of Canada's medal winners from the Beijing Olympics were there for the ceremonial faceoff. They got a well-deserved standing ovation, and then led the crowd of almost 20,000 in singing the national anthem a capella style. No matter what big musical star they could have gotten to sing the anthem, it couldn't have been any cooler than 20,000 people singing in unision. It was amazing.

Mike Van Ryn made a very nice defensive move in the first, stripping a Montreal player of the puck. It was a play that Bryan McCabe could never have made, but of course you knew that already — I did say it was a very nice defensive move.

The Bad

The Leafs were playing their second game of the season, and it showed. There were lots of missed passes and lots of shots that missed the net by a foot or more. It seemed that there were a lot of players just out of place all night. The Habs would take a shot and the rebound (whether off the goalie or the boards) would go straight to another Montreal player. The Leafs would take a shot and the rebound would either go straight to a Montreal defenseman or would coast all the way to the neutral zone because there were no Leafs players anywhere near it. The Habs played like it was their twentieth game of the season — less missed passes, less players out of place, less penalties... though it's possible that Montreal is simply a better team.

Penalty killing was awful. The Leafs had five penalties in the second period, leading to four Montreal power play goals. I suppose it improved in the third though, as the Leafs had four more penalties but no goals allowed.

In the second period, Carlo Colaiacovo (I spelled that right without even looking it up first! <proud>) tripped over a Montreal player who was knocked down by another Leaf and limped off the ice in obvious pain. I thought maybe Captain Glass was injured again and would be out for a few weeks, but he returned in the third period, so maybe this should have been listed under "The Good".

Toskala was shaky for the first two periods, though a few of the six goals he allowed weren't his fault at all.

Toronto only scored one goal, and it wasn't even that nice a goal. They had another one called back because Antropov directed it in with his arm. This was on Montreal's backup goaltender — they didn't want to waste Carey Price on Toronto.

The Ugly

Final score: Montreal 6 Toronto 1. 'Nuff said.

The Leafs could really have used the scoring touch from their former number one center — Kyle Wellwood. Or Darcy Tucker. Or that other guy, what's his name? You know, that Swedish guy? Anyway, the team is rebuilding and we all know that when a team is rebuilding, there are going to be some ugly games. But despite the final score, I don't think this was really one of them. A young rebuilding team was simply beaten by a more talented team. They put up a good fight and as Andy Frost mentioned in the post-game show on the radio, the Leafs did not mail it in in the third period, they came out and played hard. You gotta respect that.

Sunday, October 05, 2008

I'm Half the Man I Used To Be

Popular Mechanics has a list of 100 skills every man should know. I don't get why it's not a list of skills everyone should know, but whatever. There are certainly things that I think everyone should know that aren't on the list (change a tire, install a light fixture, barbecue a burger, and bake a pie using a recipe would all rank higher on my list than "fly a stunt kite"), but I guess that's a matter of opinion. I thought it might be fun to go through the list and see what I can do.

Bold means I can do it, italics means I can to some extent, and regular type means DYI FAIL.

Automotive

1. Handle a blowout
2. Drive in snow — Duh, I live in Canada
3. Check trouble codes
4. Replace fan belt — but I can change my air filter like nobody's business
5. Wax a car — I've done it, though I did a lousy job (you could still see circles on the hood of my dad's car months later)
6. Conquer an off-road obstacle
7. Use a stick welder
8. Hitch up a trailer
9. Jump start a car

Handling Emergencies

10. Perform the Heimlich
11. Reverse hypothermia
12. Perform hands-only CPR — I'm sure I knew how to do this at one point; I did get a St. John's Ambulance badge when I was a Scout
13. Escape a sinking car — The very thought of this terrifies me.

Home

14. Carve a turkey
15. Use a sewing machine — I have done it, but only once or twice and not for many years
16. Put out a fire
17. Home brew beer
18. Remove bloodstains from fabric
19. Move heavy stuff
20. Grow food
21. Read an electric meter
22. Shovel the right way — Again, Canadian. Don't hafta like it though.
23. Solder wire
24. Tape drywall
25. Split firewood
26. Replace a faucet washer
27. Mix concrete
28. Paint a straight line
29. Use a French knife — I don't remember knives in France being all that different from those here
30. Prune bushes and small trees
31. Iron a shirt
32. Fix a toilet tank flapper
33. Change a single-pole switch
34. Fell a tree
35. Replace a broken windowpane
36. Set up a ladder, safely
37. Fix a faucet cartridge
38. Sweat copper tubing
39. Change a diaper
40. Grill with charcoal
41. Sew a button on a shirt
42. Fold a flag

Medical Myths

43. Treat frostbite — use warm water, not hot
44. Treat a burn — run it under cold water, and if you have an aloe plant, break off a leaf and rub it on the burn
45. Help a seizure victim — best I could do would be to scream "help!" and call 911
46. Treat a snakebite
47. Remove a tick — I've read about it, but never done it

Military Know-How

48. Shine shoes
49. Make a drum-tight bed
50. Drop and give the perfect pushup

Outdoors

51. Run rapids in a canoe — I can steer a canoe pretty well, but I've never done it in rapids
52. Hang food in the wild
53. Skipper a boat
54. Shoot straight
55. Tackle steep drops on a mountain bike
56. Escape a rip current

Primitive Skills

57. Build a fire in the wilderness
58. Build a shelter
59. Find potable water

Surviving Extremes

60. Floods
61. Tornados
62. Cold
63. Heat
64. Lightning

Teach Your Kids

65. Cast a line
66. Lend a hand — Lending a hand is a skill? I thought it was just not being a dick.
67. Change a tire
68. Throw a spiral
69. Fly a stunt kite
70. Drive a stick shift
71. Parallel park
72. Tie a bowline
73. Tie a necktie
74. Whittle
75. Ride a bike

Technology

76. Install a graphics card
77. Take the perfect portrait
78. Calibrate HDTV settings
79. Shoot a home movie
80. Ditch your hard drive — Given the events of the last couple of weeks, don't even go there.

Master Key Workshop Tools

81. Drill driver
82. Grease gun
83. Coolant hydrometer
84. Socket wrench
85. Test light
86. Brick trowel
87. Framing hammer
88. Wood chisel
89. Spade bit
90. Circular saw
91. Sledge hammer
92. Hacksaw
93. Torque wrench
94. Air wrench
95. Infrared thermometer
96. Sand blaster
97. Crosscut saw
98. Hand plane
99. Multimeter
100. Feeler gauges

Results: I can do 54 out of the 100 things on the list, plus a few maybes. I'm just over ½ of a real man. Sorry, gotta go; I've got a quiche in the oven.

Friday, October 03, 2008

Review: StackOverflow

StackOverflow is a new programming Q&A web site created by Jeff Attwood and Joel Spolsky. (Well, I think Joel just helped fund and promote it, he didn't do any of the actual creation — that was Jeff and his team). It is still in beta, and things are still in flux, but the changes are calming down somewhat. It's not a discussion board (though some would like to use it that way), it's specifically designed for programming questions and answers. The questions can be as detailed as you need them to be (here's one on writing XML files using a particular tool in a particular encoding scheme using C#), but there are lots of more generic ones too. One seemingly popular question is "what are some of your favourite "hidden" features of <language>" — there are such questions on C, C++, C#, Java, python, perl, and others. I've found a couple of helpful tips in those ones.

The site was meant to be an amalgam of Yahoo! Answers (though only for programming questions), digg, and a wiki. You can ask and answer questions (and make comments on both), and each question can have one "accepted" answer. For each question and answer, you can "upvote" if you like it (i.e. it's correct, partially correct, or at least helpful) or "downvote" if you don't (if it's wrong or not helpful at all). You can also mark a question or answer as "offensive" if it's hate speech or spam or something like that. If an question or answer gets enough offensive votes, it vanishes entirely. With the speed at which things get voted on, this can happen very quickly, so if someone posts some spam "question", it will likely vanish within a couple of minutes. You can also tag each question with up to five categories, similar to gmail labels, so if you want to search for all questions on C#, you can just click the C# tag. (There's even a sqlanywhere tag, though there's only been one SQL Anywhere question so far.) The idea of the site is that if you have a programming question, even if you don't know about SO, google searches will hit the SO site and you'll find your answer quickly and easily.

I think the idea of this site originated in part with experts-exchange.com (which used to be expertsexchange.com but they added the dash because it looked like ExpertSexChange.com (snicker)). A number of times in the past, I have done Google searches looking for information, and came across a question on that site that was similar to the information I was looking for. But when I went to the site to look at the conversation, it said that I had to become a member (i.e. pay) to see the answers. I immediately thought "bite me" and went to the next Google entry. I'm sure Jeff did the same thing, and then decided that having such a site for programmers that was free would be a good thing.

On a related note, there is advertising on the SO site, but it's only one unobtrusive ad down the right side of each page. Maybe I'm naïve when it comes to internet advertising (actually, there's no maybe about it), but I can't imagine that even with several thousand users, that one ad is bringing in enough money to pay Jeff a living wage (he is working on this full-time) plus pay the other three or four part-time employees.

SO uses the concept of "reputation" to (a) give users some "credibility" (though that's artificial; I'll get to that in a bit) and (b) to allow users to gain limited "moderator" abilities. The more upvotes your questions and answers get, the more you gain reputation, and obviously you lose rep points for downvotes. There are also badges for certain milestones (eg. you get a "good answer" badge for each of your answers with a net upvote of 25), but they're essentially just for fun. Once you have enough rep points, you can start doing extra things; you can't leave comments until you have 50 points, you can retag other people's questions when you get to 500, and you can edit other people's posts and delete comments when you get to 2000.

Anyway, enough about what the site is, and onto my impressions of it.

Moderation in moderation

SO was a private beta for several weeks before it went public. While it was private, everything was wonderful. Once it went public, I didn't notice a significant drop in the quality of questions or answers, but there was an (expected) increase in the amount of junk added — people asking silly or subjective questions ("Should the open brace of an if be on the same line as the if or on the next line?"). One question contained the subject line "Why do birds..." and the rest of the question was "...suddenly appear, every time you are near?". The user who posed the question was "The Carpenters". The question was down-voted so fast that within two minutes of the question being posted, I couldn't find it anymore. I was one of those who down-voted it, mainly because it forced that horrible song into in my head, and it's still there. Now that I've mentioned it, it's probably in your head too — sorry 'bout that.

However, the moderation is having its problems too. I've seen lots of questions closed by one user and then re-opened by a different one. I saw one question that was an exact duplicate of another one posted a couple of minutes earlier by the same guy (it looked like he posted a question and didn't think it worked, so he did it again). One of them received five or six answers and was then closed as a duplicate, while the other one (that remained open) had no answers. Part of this problem is the speed at which answers show up, which is the next topic.

For the most part, the moderation is done automatically by the community as a whole — if a question or answer is stupid, meaningless, or an obvious troll, it's downvoted or marked as offensive and disappears. There is no provision for voting on users, but at least one has been deleted because of useless postings (this was "Consultant Barbie" who answered a bunch of questions with "<topic of question> is hard. Let's go shopping!"). This is odd because in one of the SO podcasts, Jeff mentioned that he did not want to delete users who did this, because it would basically make them mad and they'd just keep creating new accounts or finding other ways to be a pest. If you just ignore them and downvote their inane answers, they will either get bored and stop, or they wouldn't, but you would rarely see their downvoted answers anyway.

I'm not sure I'm sold on the idea of closing threads, other than for questions that are duplicates of previous questions. It won't be long until there are hundreds of users with enough rep to close questions, and then there will be edit wars where one user will continuously close a thread and another will continuously re-open it. At that point a real moderator will need to step in, and then the whole self-moderation thing goes out the window.

The Fastest Gun in the West

One problem that's come up a number of times was summarized in a question and given the name The Fastest Gun in the West problem. You see a question that you know the answer to, and you take the time to write a well thought-out and researched answer. Once you click "Post your answer", you find that eight other people have answered in the meantime, and some of those answers have even been upvoted. Those answers are frequently quick and dirty ("I dunno, maybe try this"), and may even be wrong. In the long run, you'd think that your longer and better answer would get more upvotes, but it doesn't always seem to work that way. In the end, you see a question that you know the answer to, and immediately starting writing the fastest, shortest answer possible. You post pseudocode rather than actually make sure your code compiles. You say "there may be issues on Mac" rather than taking two minutes to look up what the issues are and post them. All in all, the quality of answers tends to go down.

In the long run, I think this will be less of an issue, as people's reputation gets high enough that they don't worry so much about the numbers. If you write the best answer to a question but people vote up an earlier answer more than yours, oh well. You can always leave a comment explaining why your answer is better or more complete or whatever.

Reputation is everything — or not

Your abilities on SO are based solely on your reputation score. The more people upvote your questions or answers, the more reputation you get. You also gain rep by having lots of people respond to (or even view) your questions. The idea is that if you ask smart questions and give helpful answers, you'll get a high rep score, and people will be able to trust your answers. This is meaningless for (at least) three reasons:

  1. A very knowledgable user who just joined SO last week will have a much lower rep score that someone who joined a few months ago (and this will get worse the longer the site is around).
  2. There are rep whores out there who post questions and answers willy-nilly in the hopes of gaining rep points. One upvote is worth five downvotes, so as long as you don't post utter garbage, you're bound to gain more than you lose, even if your answers aren't always that helpful. I've seen answers that were wrong but voted up anyway that began "I don't know but maybe..." Why would you upvote that kind of answer?
  3. Some questions are not programming-related, but still count towards your reputation. I am a prime example of this. As of today (Sept. 30, 2008), I have a reputation score of 1939. I have asked three questions and given 65 answers. My top answer to an actual programming question is 18, but I have five answers that are much higher than that:
    • two answers to one question ("What is your favourite programmer cartoon?") that combine for 102 upvotes
    • two more for another question ("Great programming quotes") that combine for 107, and
    • one answer at an unbelievable 123 (and still growing daily). That one is an answer to the question "Confessions of your worst WTF Moment" where I tell the story of the time I accidentally got my colleague's fingerprints inserted into the FBI database. (I blogged about that a couple of years ago.)
    The majority of my reputation (1090 points out of 1939) has come from those five non-programming questions. So most of my reputation on this question-and-answer site comes from two quotes I didn't make, two comics I didn't draw, and a story (though admittedly a pretty funny one). Less than half actually comes from questions or answers. I'm sure that I'm not the only one in this situation, though I suppose in five years, assuming I actually ask some more good questions and give some more helpful answers, it will all even out.

What's a programming question?

One of the biggest problems right now is questions that involve programmers but don't actually involve programming. There have been questions on interview tips (both from the interviewer and interviewee points of view), writing a resume, salaries, certification, and that kind of thing. There are lots of very subjective questions that don't have real answers (or at least, not a single answer), like "Should programmers have laptops or desktops?" or "What's the most influential book every programmer should read?" There have also been some other questions that might be tangentially related to programming, like questions on hardware setups or networking problems. Those ones are sometimes "justified" by things like "As a programmer, I need to have my network properly configured or I can't do my job". This may be true, but it's true for many other non-programmer jobs too. You shouldn't be able to just prefix any question with "As a programmer, ..." and automatically have it apply. As a programmer, I need to eat healthy foods, but asking about whether asparagus is better for you than broccoli isn't a valid question for SO.

When such questions appear, some folks just answer them, others downvote and complain, and sometimes a moderator will just close the question as not being a programming question. If that's the case, why is the "programming cartoons" thread still open? The guidelines (in the faq) aren't clear. Well, they try to be clear, stating "Avoid asking questions that are subjective, argumentative, or require extended discussion" and "try to refrain from asking questions about Stack Overflow itself unless you absolutely, positively have to". But searching the "subjective" tag gives you 583 questions, the vast majority of which are not closed. One question asks "How do you vent stress as a programmer?" Is that a programming question? No, and it's subjective and could require (or incite) extended discussion. So it should be avoided, according to the faq, right? But this question has received 34 (net) upvotes and 133 answers and has not been closed. There are no negative comments or answers saying that it's not a programming question. So are these kind of questions allowed, or not?

What the site really needs is forums.stackoverflow.com or something like that — a message board where you can go and discuss things. I suppose you could use the comments for that, but it would be nice to have a place to discuss things that's separate from the Q&A part of the site.

Community-owned posts

One idea that I didn't get at first was community-owned posts. When you ask a question, you can mark it as "Community-owned", and then you get no reputation points for that question. Every answer is also marked as community-owned, and so people who answer get no rep either. I get that — if you're asking a subjective question (i.e. one that might have many answers), you might mark it as community-owned so that people know you're not just trying to bump your rep score by asking such a question. In that case, it's your choice as to whether to mark the question as community-owned. The thing that I didn't get about it was that there are a few rules that will automatically turn a regular question into a community-owned question, which means that the person who asked will get no further reputation score from that question. This happens if:

  1. the asker edits the question more than five times
  2. if more than four different people edit the question, or
  3. if the question receives more than 30 answers.

I didn't like the idea that other people had control over whether I received reputation score from my own question. However, I heard Jeff talk on the podcast about the reasons behind these decisions, and now I think it's kind of clever. Here is the reasoning behind each of these rules:

  1. This is to prevent someone from continually editing their own question just so that it stays on the home page.
  2. Any question that has been edited by lots of different people was more than likely not very clear to begin with, and so rewarding the asker with rep points after others have cleaned up the question doesn't make sense.
  3. A question that has more than 30 answers is more than likely a subjective one or a poll or something similar, not a specific programming question that the site was designed for. In that case, you should not be rewarded for asking such a question.

Conclusion

Overall I'm pretty psyched about StackOverflow. I think it could be a really useful resource for every programmer. It's also a lot of fun (which is why some have begun calling it "CrackOverflow"), though it's still very new, so we'll see if the novelty wears off after a while. There's are still some kinks to work out, but once people figure out (and get comfortable with) the community moderation thing, and realize that the reputation scores don't tell you how much creedence to give an answer, I can see this site becoming one of the most popular programming sites anywhere.