Recently Read Book

A Thousand Splendid Suns by Khaled Hosseini

Previously, I gave “The Kite Runner” 4.5 zombie heads. That was a good story. Heartbreak, regret, redemption. This one? Meh.

It’s a brief history of modern-day Afghanistan featuring people beating the shit out of each other, either physically or emotionally. The first 80% builds the characters and relationships pretty well, even if it’s difficult (for me) to relate to them. Then, it’s as if Hosseini discovered he didn’t know what to do with them, so he rushes through the remaining 20% tying up the loose ends he’s created. There’s no “emotional reward” for the reader; it’s *bing* this happens, *bam* here’s an effortless concept, *boom* you’re done… buy my next one, too.

Skip it.

3

Recently Viewed Movies

Let’s Go to Prison 3.5 Vapid and hilarious in an Idiocracy kinda’ way. Great twist. Prepare to be woo-ed.
No Country for Old Men 4.5 Fuckin’ fantastic. Erin hated the ending. I loved it.
Cloverfield 4 Great monster flick.
Gone Baby Gone 3.5 Yeah. Didn’t see that coming. Still, though… tried too hard to be clever.
3:10 to Yuma 4.5 Erin hated the ending. I thought it was awesome. Claire’s suicidal, bi-curious boyfriend from “Six Feet Under” is such a dirt-bag in this film; he’s great.
The Simpsons Movie 3 Not bad, but quite preachy. I was disappointed.

Questions Answered

About 2 months ago, I asked a lot of questions. Here are the answers:

Art Ross, Maurice “Rocket” Richard, Jack Adams, Hart Memorial, Lester B. Pearson.

Quite a number of trophies to add to the Washington Capitals’ glass case, eh?

While ultimate victory will have to wait, this past season reminds me of another NHL team that succeeded after being the worst team in the league a few years running, and their subsequent rebuild.

I only hope the Caps do it while I still live here.

Why the Caps Need to Sign Huet

Before we get started w/ the stats, a remedial math course… as it relates to hockey goaltenders.

Goals Against Average (GAA) is calculated like this:
You take the total minutes that the goalie played in the season (including the playoffs, if desired) and divide that by 60, since there are 60 minutes in a regular NHL game (not including overtime or the shootout). That gives you the number of games played by the goalie (not always a whole number). I can only imagine that overtime or shootout minutes are not included in that goalie’s total-minutes-played stat because these are not “regular” periods; they only happen when necessary. Then, you take the total number of goals scored against that goalie (empty-net goals are not included, since he wasn’t on the ice at the time) and divide that by the number of games (figured previously). That gives you the average number of goals scored against that goalie in 60 minutes (or, per game). That’s your goals-against-average, or GAA.

So it’s:
TOTAL MINUTES / 60 = GAMES PLAYED
… then:
TOTAL GOALS ALLOWED / GAMES PLAYED = GAA

Mathematical shorthand is:
(GOALS ALLOWED x 60) / TOTAL MINUTES = GAA

The lower the GAA number, the better the goaltender’s performance.

Save Percent (SV%) is calculated like this:
You take the total number of shots that a goalie faced all season (including the playoffs, if desired), and subtract the total number of goals scored against him. That gives you the total number of “saves” he had… or the number of shots he didn’t let into the net. You then take that number of saves, and divide it by the total number of shots (from before), and that gives you the percentage of shots he didn’t let into the net. That’s your save percent, or SV%.

So it’s:
(TOTAL SHOTS - TOTAL GOALS) / TOTAL SHOTS = SV%

The higher the SV%, the better the goaltender’s performance.

Now, for those of you unfamiliar with the situation in D.C. over the course of the 2007-2008 regular season and playoffs: Olaf Kolzig was the starting goaltender for the majority of the season; Brent Johnson was the backup all season (while not injured, and before Huet came along), and Cristobal Huet was acquired at the trade deadline for the Caps’ playoff run, effectively supplanting Kolzig as the starter for the end of the regular season, and throughout the Caps’ 7-game playoff series (relegating Olie to the backup position).

Long story longer… here’s what’s up:

Kolzig let in a total of 153 goals in 3,154 minutes on the ice. That gives him a GAA of 2.91.
Kolzig faced 1,423 total shots, and you know 153 of them went in. That gives him a SV% of 0.892.

Johnson let in a total of 46 goals in 1,032 minutes on the ice. That gives him a GAA of 2.67.
Johnon faced 500 total shots, and you know 46 of them went in. That gives him a SV% of 0.908.

That brings us to Huet. The following stats include playoff games, since he was the only Caps goalie to play during all 7 games; Kolzig and Johnson never made it to the ice.

Huet let in a total of 43 goals in 1,222 minutes on the ice. That gives him a GAA of 2.11.
Huet faced 571 total shots, and you know 43 of them went in. That gives him a SV% of 0.925.

Upshot?

Kolzig’s performance was the worst on the team. Johnson was better, given his meager minutes.

In only 20 games, Huet kicked the shit out of them both.

Introducing the Perez Cup

Immediately after the Tampa Bay Lightning won the Stanley Cup, I received (among a shitload of sweet swag) two miniature, plastic Cup replicas from my brother who attended Game 7 in Tampa.

Last year, I quickly got sick of comparing my Stanley Cup playoff picks against the “experts” published on various sports-related websites across North America. This year, I invited all of my hockey-savvy friends and family to participate in a playoff competition.

Aside from my gorgeous-and-pregnant wife, only two had the balls to step up: “J” and “M”. Identifying information has been removed to provide anonymity, and also because I didn’t ask them if it’d be okay for me to post their picks.

The prize for winning the competition wasn’t really decided until I purchased a Dremel engraver offa’ the Amazon. After that, one of my two mini-Cups was destined to fall victim to the winner, as would everyone except Erin.

Here’s the final points tally, and here’s the reward:

Perez Cup 2008

Granted, I must work on my engraving skills (it was my first time!).

There’s plenty of room on that little plastic bitch to serve us well for years to come. If you missed this year’s competition, don’t miss it next year. Your name could end up on the Stanley Perez Cup.

Severe Weather

One hell of a storm system passed through Northern Virginia today.

radar map

Check out the play-by-play action.

Recently Read Book

The Pillars of the Earth by Ken Follett

976 pages of 12th century England. Sound like a snorer? It’s not. Looking for historical accuracy and/or a more reliable dissertation on the political discord between the church and ruling class? Look elsewhere… this book is fictional, and makes no claim to the contrary (fucking snobby-ass Amazon nerds). I’ve never read Follett before, so I can’t make any comparisons to his other works. This one is a good read, though, and it surely doesn’t feel like it’s almost a thousand pages. I can’t say the same about Cryptonomicon, despite it being one of my absolute favorites.

3.5

LayoutError in ReportLab

Attempting To: Generate a PDF file listing a few attributes of various systems. Each set of system information needs to stay together as a block of info on the page; having some on one page, and the remainder on the following page is unacceptable.

Established Method: Employ the “KeepTogether” flowable. Pass a list of things (here, Paragraph objects) to it, and it’s supposed to handle things properly. If the length of the content passed exceeds that of the page, it will auto-magically insert a page break, and place the content on the next page.

Problem: ReportLab throws “LayoutError: Splitting error” on one of the KeepTogether flowable objects. Further, this particular exception seems impossible to handle; wrapping the calls in “try” and “except” clauses appears to have no effect whatsoever, and the error is raised without fail.

Investigation, conclusion & code examples follow…

Read the rest of this entry »

Trashing a “Clever” OS X Trash Utility

Here’s an article featured on Daring Fireball which claims:

The Mac OS X command line is missing any way to move files to the trash…

Uh.

No it’s not, and your Ruby util is completely unnecessary.

Move file to the trash:
mv ~/Desktop/filename.ext ~/.Trash/

Move file from trash:
mv ~/.Trash/filename.ext ~/Desktop/

List items in the trash:
ls ~/.Trash/

Empty the trash:
cd ~/.Trash/
rm -rf ./*

Elementary CLI shit here, folks. Or… am I missing the point entirely?

Update: Respected Mac blogger says of the above commands: “This won’t do the magic the Finder does where you can trash multiple files with the exact same name, and they get unique names in the trash. This won’t list items from other volumes than your boot disk.” To which, I reply: “So the app exists to bring “magic” from the UI down to the CLI. Not that the facilities don’t already exist, they’re merely inconvenient? I suppose that’s enough to create the app for a niche group of users, but the description he uses to justify its development is a bit hyperbolic,” and note, “Each mounted volume’s trash is accessible at /Volumes/[mountpoint]/.Trashes/[userid].” cf. this previous MMH post.

Posted in Mac. 2 Comments »

My Programming Philosophy: Not the Last X Percent

When you’re a mediocre programmer (read: me), it’s easy to conjure great ideas because you know their solutions to be possible.

It’s slightly more difficult to implement the main constituent concepts of your idea, but only (and hopefully) because there’s some research and learning involved. Recognizing your skills as mediocre, there’s likely a better way to do things than your current level of knowledge permits. A bit of reading and examination of examples set forth by those less-mediocre than you result in slightly-more-elegant code for your idea.

It may be difficult to stitch together all your elegant concepts into the idea, because you want the implementation of your idea to be elegant, as well. Don’t you?

This is the universally-loathed “Last x Percent”.

If you are unfortunate enough to have developed each of the elegant concepts in isolation, your stitching will involve dealing with myopically-complex data structures, and attempts at creating workable interfaces to them. It will be hellish; you’ll wonder why you opted to do things the way you did. But you’ll be too far into the project to go back and change the basics of the concepts to retain their elegance, yet offer graceful interaction.

Or will you?

The majority of the work you should do after dreaming up a great idea is: Work it through completely, or as completely as you can.

Start by thinking of how you would implement the whole shebang with your current (mediocre, remember?) knowledge and skills. Then, make a list of things you wish existed that would make it easier (tools, definitions, whatever). Next, see if those things already exist; do a moderate amount of homework, but don’t kill yourself. If you can’t find them readily, you already have a concept of what you must do to create them. Perhaps you’ll discover new tools, definitions, whatever that will facilitate making those things on your own.

Either way, you’re making progress.

But there has to be a sweet spot.

As you learn more, your functional knowledge will grow, and how you envisage the path to realizing your elegant idea will change. As every programmer’s painful memories can attest: Scope creep is bad. But it’s worse when it’s self-imposed.

You must consciously determine when you’ve learned enough. You have to be able to cut bait on theory and start typing code that works. Otherwise, you’ll never get it done.

Fulfill your personal need to collect fragments of new knowledge. Feel satisfied that you’ve done enough homework to become a better programmer.

Then do your shit. Make it work.

You can always come back later and repeat the process.