Archive for March, 2007

Python Notes

March 30th, 2007
[ Software Development ]

I’m taking python, the language not the non venomous snake, for a test drive of late. One of python’s core tenets reminds me of something some guy once wrote. Mister python says:

“By philosophy, Python adopts a somewhat minimalist approach. This means that although there are usually multiple ways to accomplish a coding task, there is usually just one obvious way, a few less obvious alternatives, and a small set of coherent interactions everywhere in the language.” (quote from Learning Python)

I wish I’d wrote that in that previous post because it’s certainly another perq of the approach of building the smallest API footprint possible. Doing so makes the framework simpler to use and accelerates a developer’s ability to familiarize themselves with it.

Is Your Software Doomed?

March 29th, 2007
[ Software Development ]

Leon over at secretGeek put together a way for you to check.

Wanted: Your Vote

March 26th, 2007
[ General ]

It’s for a good cause. My friend’s Cassie and Mike are entered in this contest. That’s Mike stripping off his green belts in the top left video. Lend them your vote. I can’t stop watching it……

Harnessing all that wasted energy

March 23rd, 2007
[ General ]

While I don’t expect anyone to believe me, I swear this is one I thought of myself a long time ago. It’s proof that ideas are cheap, implementation is all that matters.

Anyway, I had a brief stint in a previous life as a bit of a gym rat. Whenever I was in the gym watching all these people working their asses off it always struck me as odd that we just throw away all that energy. Well technically not throw it away but translating into something useless like noise, heat, a spinning treadmill etc. I often wondered what a farming family from a century ago would think if they saw a modern gym. It’s cool to see someone’s finally trying to do something about this.

What about something more rudimentary though? There’s all these people out there with a need to pick up heavy objects to stay in shape. Certainly there must be customers for that, people who have heavy objects they need lifted. Can’t we get them together instead of all these bright lights lifting the same damn objects over and over again all day?

What about a moving company? Instead of paying for a gym membership, I’ll setup a “circuit” for you for free. Run up the street to 35 Morris, climb the stairs, pick up a dresser, carry it down stairs, put in van, run a mile to another house, move something else, run back to previous house, etc. Sure, the uniforms would be a bit odd but how environmentally friendly is my new moving company?

Maybe I’ll try this next time I’m at a gym and someone picks up some dumbbells:

“Oh don’t worry about those, I already lifted those.”

“Pardon?”

“Those ones. I already lifted them. There’s a bunch over there that still need to be lifted.”

[NHL bot] I think we’re in a fight?

March 23rd, 2007
[ Geek ]

(04:29:40 PM) …brydon: where were you last night?
(04:29:41 PM) NHL: I live in a clean room at a high-tech hosting facility in California.

(04:26:28 PM) …brydon: I thought we were watching the game
(04:26:28 PM) NHL: Oh really? How did that make you feel?

Baby Planners

March 23rd, 2007
[ General ]

There’s a cool new service, well new to me anyway, the Brit’s have call Babyplanners.

“babyplanners is an all-embracing service for women expecting their first baby. Through one-to-one sessions at home or the office, we’ll take care of all the organisational aspects of having a baby on your behalf…”

Cool eh? Ahhhh, not so much. In a word, depressing. We’re so entrenched in needing two incomes to survive that we’re left hiring total strangers to play the roles typically played by family, friends, and community.

I think it’s great that they saw an opportunity and built a business around it. It just depresses me that the opportunity even existed.

New Best Friend

March 22nd, 2007
[ General ]

(11:19:57 AM) …brydon: see ya
(11:19:58 AM) NHL:

XXXX
X“X
XXXXXXXXXXXXXX
XX XX
XX XX XX XX
XX XX
XX XX XX XX
XX XXXX XX
XX XX XX XX
XXXXXXXXXXXXXXXXXXXXXXXXXXXX
X XXXXXXXXXXXXXXXXXXXX X
XXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXX
XXX XXX
XXXXX XXXXX

(11:20:27 AM) …brydon: where are you?
(11:20:28 AM) NHL: I live in Silicon Valley, California!
(11:20:44 AM) …brydon: what are you wearing?
(11:20:44 AM) NHL: I’m NHL Stats Agent! I’m a smart computer that you can chat with about all kinds of things.

Type “?” to see what I can do.
(11:21:09 AM) …brydon: I love you
(11:21:09 AM) NHL: That’s nice… I love you too!

Why don’t you ask me about the things that I’m here for? :-)

(11:22:58 AM) …brydon: I really love you
(11:22:58 AM) NHL: Hey, I love you too!

NHL Command Line over IM

March 22nd, 2007
[ General ]

This is very cool. A friend at Navantis passed me this, I believe they built it. It’s a messenger bot for the NHL. Just add the contact nhlstats@hotmail.com to your contact list and then start chatting. This is going to put a serious dent in my tsn.ca visits.

Feature request? Get this thing to find video links for me. It’d be amazing if I could just say “find video highlights for last night’s toronto game”, or “find video for wade belak and cam jannsen” and have a link returned to a video.

(11:04:36 AM) …brydon: east standings
(11:04:36 AM) NHL: STANDINGS >> Eastern Conference:
NAME GP W L OTL PTS
1 Buffalo Sabres 73 47 19 7 101
2 New Jersey Devils 73 43 22 8 94
3 Atlanta Thrashers 74 39 25 10 88
4 Ottawa Senators 74 43 23 8 94
5 Pittsburgh Penguins 73 41 22 10 92

Type “more” for more.

(11:04:57 AM) …brydon: darcy tucker
(11:04:58 AM) NHL: PLAYER STATISTIC CARD:

NUM NAME POS
16 Darcy Tucker Right Wing

TEAM
Toronto Maple Leafs (Leafs)

GP G A PTS GWG +/- PIM
47 22 14 36 5 -13 70

PPG PPA SHG SHA Shots
14 6 0 0 126

FOW FOL FOA
6 9 15

(11:05:16 AM) …brydon: last night’s scores
(11:05:16 AM) NHL: SCORES >> Last night’s scores:

HOME AWAY SCORE
Montreal Canadiens Boston Bruins 1 - 0
Calgary Flames Detroit Red Wings 2 - 1
Minnesota Wild Phoenix Coyotes 3 - 2
St. Louis Blues Ottawa Senators 2 - 4
Philadelphia Flyers Florida Panthers 1 - 4

Type “more” for more.

A Cheap(Free) Backup Tool

March 21st, 2007
[ Geek ]

I handle my main backups the old fashioned way. I have a script I run periodically which creates a date based folder. I then zip up specific areas of files and move them over to that date based folder. I also make sure that only admin has rights to the backup area so I can’t damage it in course of daily work.

I keep this file in my home directory but create a symbolic link in /usr/bin so that I can run it anytime by issing:

sudo backup

Yes I also run a raid-1 array and keep almost all my files in svn but it doesn’t hurt to be cautious. It’s really simple and I’m sure interests no one but in case, here’s what it looks like. Oh, and to add other directories to be backed up, you just copy that last section and change the “personal” to the other directory name you want to backup. Each section is put into it’s own backup file.

#!/bin/bash
# Specify the base backup dir where all the backups live.
baseDir=”/backup/”

# Create backup directory based on date.
# This is based on the baseDir set above.
# Example: Feb 14, 2005 would be 20050214
backupDir=$baseDir$(date +%F)
echo “Creating backup dir $backupDir”
mkdir $backupDir

# Specify the base dir where all the files to be backed up live.
# All subsequent directories are built relative to this.
baseSrcDir=”/home/brydon”

# personal dir
srcDir=”personal”
dir=”$baseSrcDir/$srcDir”
echo “backing up dir ‘$dir’…”
tar cfj $backupDir/$srcDir.tar.bz2 $dir

Unit Tests <> QA

March 15th, 2007
[ Software Development ]

Based on this post, I’m guessing that secretGeek isn’t a hardcore fan of test driven development(TDD). I’m actually unsure whether I’m a fan of pure TDD as I’ve never adhered to it in the “pure” sense of always writing a test before you write code.

What I can say is that I’m a huge fan of test driven bug fixing(TDBF), and yes I did just make that up, catch phrases really are that simple. What’s TDBF? When you find a bug, in development or QA or whenever, you start by writing a unit test to reproduce it.

Here’s why I’m a fan of this. What’s the generic process for fixing a bug?

    1. Reproduce: Hack away in a gui, web app or debugger until you can continually reproduce the bug in a controlled environment.
    2. Research: Once you can reproduce it then it’s recon time to understand the bug.
    3. Solve: Design an appropriate solution and implement it.
    4. Validate: This consists of doing exactly what you started with, trying to reproduce the bug by hacking away in a gui, web app or debugger, etc.

      The first and the last step are almost identical. You will likely add to the validate stage, possibly testing in varied environments etc. No matter how you do the first step, you will have to reproduce that step again at the end. So why not start by capturing it in code? Do that and you’ve not only accelerated the last step but you now have a repeatable means of ensuring this bug doesn’t exist tomorrow or a year from now.

      My take on unit tests is that you are capturing debugger statements in a usable form NOT performing any form of quality assurance. Unit tests should never ever ever ever ever be considered a replacement, in any form, for QA.

      Think of this in terms of development cost. Everytime you pay a developer to fix a bug without using unit tests, you are paying that developer to write a lot of code that escapes into the void. Sure you may not think of the act of reproducing a bug as writing code but it’s a small shift for it to be just that. Without that, this ‘code’ is never checked in anywhere, it’s likely not even saved in any fashion. In a sense, you are throwing away valuable code.

      So I agree with secretGeek on that point, however, the flaw is in allowing unit tests to be viewed as replacing QA. It’s not a flaw in TDD itself.

      Will you have to refactor your unit tests? Definitely and if you’re going to have unit tests then I suggest you stop thinking of them as some appendage. If you’re building a software product and you’re using unit tests then you must think of them as being part of your product.