Don’t expect school to teach you everything

I find it amazing how many people seem to learn very little outside of what they were taught in their classes. We’ve been interviewing a few people at work over the past few months, and many people just seem to know very little beyond what they where taught in class.

To make matters worse, the kind of experience that you get in classes tends not be the kind of experience that would be very useful in the real world. It seems to be very uncommon that one would have to write something extensive for an assignment in university.  Most assignments consist of maybe 5-10 small functions strung together.  There’s no way to practice code that doesn’t repeat itself because there’s very little chance that you’d run into code that would be repeating.

I’m not saying that classes aren’t important. You can definitely learn a lot of useful things in class that will be very useful on the job. It’s just that you won’t learn the most important thing. That is, how to actually plan and complete a large project from beginning to end.

All the best experience that I got while in university was in co-op placements where I got to work on real projects.  If you are in university and there’s a co-op or internship program available make sure you take advantage of it.  This usually means it will take a little longer to graduate, but the experience you get will be very valuable.

I was also very lucky in that we had a two semester group project as one of our classes. In this class, we were required to find a customer who wanted an actual product (the professor had some people lined up, but we were free to find our own if we pleased) and do an entire project from beginning to end. We were required document what we were doing, write the code, write the test cases, and meet with the customer to discuss requirements and talk about how the project was progressing at regular intervals. This taught me not only about the technical side of software development but also how to actually work not only with other developers, but also the customer.

The other thing that I find is that a lot of students don’t have experience using real world tools. Very few students seem to know how to use a debugger coming out of university.  I don’t know how they get along without it. But I guess if you’re only doing very small projects, then they aren’t that necessary. But when you’re writing projects that are larger than you can fit in your head, it makes  the job a whole lot easier when you have a debugger and you can step through the code to see what’s going on.

My advice to anybody in college or university is to try to learn as much as you can before you graduate.  This is when you’ll have the most free time. You may think you are busy now with assignments, studying, and even a part time job,  But the truth is that now as a person with a job and a family, I find that I have much less time now than I did as a student.  I wasted a ton of time when I was a student and really wish I had spent my time more wisely.

So think of a project that interests you and go ahead and do it.  You’ll learn a lot more from doing an actual project than you will from just about any class.  And you’ll have something to showcase your skills when it comes time to interview for jobs.  You’ll definitely stand out from the rest of the applicants.

Of Bike Mechanics and Computer Repair Techs

As somewhat of a bike enthusiast, I came upon this presentation discussing bicycle mechanic salaries.  Long story short, they are depressingly low. At around $22,000, it’s pretty close to the minimum cost of living in most places.  In many places, this won’t even cover rent in a 1 bedroom apartment.

So, it seems there’s a problem in that it’s almost impossible to make a living being a bike mechanic.  Bike mechanics can be useful, and I’ve even taken my bike to a mechanic from time to time. The presentation (I use this word, because a simple 1 page article was turned into 39 slides), states that some bikes can cost $8000, and that people are unwilling to pay $80 for a tune up.

While a bike certainly could cost $8000, most do not.  I don’t have any actual data, but based on the bikes I see on the street, that the average price of bikes that are sold, is somewhere around $400.   Most people, even the enthusiasts that I know, will never spend more than $1500 on a bike.  For those that aren’t enthusiasts, and who only shop for bikes at Walmart, will probably think that $400 is way too much for a bike.  And bike prices are only coming down.  $1000 will get you a bike that’s better then what the pros were riding 10 years ago.

When you have a $400 bike, charging $80 for tune up sounds like a lot to ask.  It’s similar to a computer repair guy from the Geek Squad asking you for $80 to fix you $400 laptop.  For the price of a couple tune ups, you’re well on your way to purchasing a whole new bike, or laptop.

Fixing a bike is easy. You don’t even need many fancy tools.  About 95% of the work you will ever have to do on your bike could probably done with about $50 worth of tools.  There’s even this great site  where people will help you fix your bike for free.  And it’s also (at least in my opinion) quite invigorating, to know that you can do it yourself, when you’re 50 km from nowhere, and something breaks, it’s nice to know you could solve the problem yourself instead of having to hitch-hike home, or call someone for a ride.

This is very similar to computers, where most people could figure out how to fix their own computer if they just took some time. Actually, fixing a computer is probably more difficult than fixing most bike related problems, as actually diagnosing the problem, and fixing it without just formatting the machine and starting from scratch can actually be quite difficult.  A bike has way less parts than a computer.  And there’s very few things that actually go wrong with quality bikes

I admit, if you have an $8000 bike, and need it for racing, where seconds can mean the difference between winning and losing, then paying somebody big bucks to makes sure the wheels are perfectly true, and the gears and brakes are adjusted just so makes perfect sense.  At this point you should be spending your free time training, and not mucking around with wrenches and grease.  But if you just use your bike for transportation or recreational rides, then you really should be doing your own maintenance.

I don’t think we can solve the problem of the low paid bike mechanic.  If you want to make big bucks as a bike mechanic, you’d better start fixing bikes for people who really care about them. People who’s livelihood depends on their bike, like professional bike riders.  Just like computer techs who want to make more money have to end up going to fix computers for people who have rooms full of computers, and having a computer not working  means loosing money for every minute that computer isn’t running.

But I just don’t think there’s any money to be made in tuning brakes, tuning derailleurs, and switching out bottom brackets.  It’s too easy to learn to do these things yourself, and if you start asking for more money in the hopes of making more money, you’ll probably just drive potential customers away, who will figure out how to do it themselves, or get the local high-school bike enthusiast to do it for the price of a couple inner tubes.

Battery Powered Raspberry Pi

Since the Raspberry Pi is so small, and has a similar architechure to most phones, I was thinking it would be fun to see if I could run it from batteries. I wanted something that would give it a long run time, not something that would only run for half an hour. It would also have to utilize rechargeable batteries, otherwise, the
cost of the batteries would quickly outrun the cost of the Raspberry Pi. Also I have no abilities to build my own circuits, so it had to be something I could buy ready to use.

After doing a little searching, I was able to find this USB battery backup case. It uses 18650 lithium batteries. It’s meant for charging cell phones and other gadgets when they run out of power, so I figured it would work quite well for powering the Raspberry Pi. Most people in North America will probably be a little unfamiliar with these batteries. But I think they are great. They look like AA batteries, but are actually quite a bit bigger, are rechargeable, and run at a higher voltage. They are actually similar to the cells that are used in many laptop batteries. I had used them before for bike lights that I had purchased from that same site, and was really impressed with how much power they were able to hold. I don’t know why they don’t have batteries like this in North America. They kick the pants off anything you can find around here.

The battery backup case provides 5V at 1A and each of the batteries I purchased was rated at 2400 mAh and 3.7V. The battery backup case also doubles as a charger for the batteries. Plug into the USB Mini on the battery backup unit, and plug the other end into a phone charger (similar to what you use to power the Raspberry Pi, and it charges. The full size USB port is used for powering devices. Get a cable that is full sized USB on one end, and micro USB on the other end, and you can use it to power your Raspberry Pi. This is one of my main disappointments with the device. Had they used USB micro to charge the batteries then you could have used the same charger to recharge these batteries as you use to power your Pi, but the way it’s set up you need 2 different cables. This unit, like the Pi, comes without any cables. Luckily I had a few lying around.

My first use for the device was to test it for it’s intended purpose, to charge my phone. I charged the batteries in my old charger, as I was unaware that this device even had charge capabilities, and then put the batteries in the backup unit. Plugged it into my phone. Nothing. Pushed the button. Nothing. I really just thought the thing was completely dead. I decided to just Google for “dealextreme 129749” which is where I bought it and the SKU, and about 5 links down the page I found this page, which was somebody else who bought it and had the same problem. Of course, the page is in Polish, so what could I was stuck. Google Translate to the rescue. It did a fair job, good enough for me to figure out that if I hooked up USB mini port up to a charge or computer, that
the device would turn on, and start working. It did a pretty good job at charging my phone. It worked about as good as it does when plugging my phone into the wall. The batteries didn’t get hot at all, and there was a little bit of heat from the circuit part of the charger, but nothing worth worrying about.

Then it came time to try it out on my Raspberry Pi. I wrote a program in Python to record the current time to a file every minute, so I wouldn’t have to sit around watching and waiting for it to die. The program is as follows

import time
i = 0

while i >= 0:
        f = open('timelog.txt','a')
        i = i + 1


There’s obviously some testing code left in there, switch the condition of the while loop to “i < 5” if you just want to run a test and have it exit after 5 minutes. I opened an closed the file each iteration because I didn’t wanted to be reassured that the writes wouldn’t all disappear when the power cut out.

Now for the test. I started up my Pi, ran the time logging program in the background, and then let it run. I wanted to see how well it would do under minimal load. The results were pretty astounding. It ran for just under 5 and a half hours. Which once you count in the boot up time and me starting the test probably came in pretty close to exactly 5 and a half hours.

Being somewhat impressed, I wanted to now test it under full load. It would be easy enough to write a busy while loop to get it to use the CPU at 100%, but I wanted to stress out the GPU as well. So I posed a question on and one person suggested using Quake 3 to test it out. I figured that would use probably as many resources as possible, so I gave it a go. In the background I ran my python time logging program same as before, and in Quake 3 I ran a demo loop to max out the resources. I put the following in a file called demoloop.cfg located in the baseq3 folder for Quake 3.

set loop "vstr loop1"
set loop1 "set timedemo 1 ; demo four ; set nextdemo vstr loop2"
set loop2 "demo four ; set nextdemo vstr loop1"

Then I started Quake 3, and ran the demo loop by bringing up the console with “~” and typing:

exec demoloop.cfg
vstr loop

The demo began to loop. I had to use some commercial .pk3 files because the demo wouldn’t run with the freely available files because missing maps. I watched for a while, using my laptop on the side. I didn’t expect it to last very long with the CPU and GPU undergoing so much use. Eventually I got bored and went to bed. In the morning, I woke up and checked the results. The total run time was 4 hours 23 minutes before the log program stopped logging the time, and I presumed the Raspberry Pi lost power.

All in all I have to say that I’m pretty impressed that I got such good performance out of this battery pack. The batteries stayed cool, even when running my Quake 3 stress test. This battery pack did quite a good job, and would probably work quite well for anyone who wanted to power their Raspberry Pi off batteries.

Raspberry Pi – First Impressions

I got my Raspberry Pi a couple weeks ago, only a few short months after placing my order, and I’ve gotten a little bit of time to play with it. So far the experience has been pretty good. The speed is pretty much as I expected. I was able to get Quake 3 up and running on it. I spend countless hours playing that game in university, and it sure did bring back some memories.

I think the thing I like most about my experience so far is that I can get different SD cards set up, one for a media centre, one with a working desktop distribution, one to play around with and break, and more for whichever purpose I feel like. It’s nice having a computer you can just tinker with, where you can back up the whole system in a matter of minutes, and load on a whole new OS quickly if something goes wrong. I haven’t had a computer I can just tinker with in quite a while. It’s also nice that the Raspberry Pi doesn’t take up any space, and that I can just hook it up to my existing peripherals.

I have had a couple problems with it. My wireless keyboard that I use with my desktop doesn’t seem to work so well. Sometimes keys stick and repeat endlessly, and sometimes keystrokes don’t register. I’ll have to go and get a USB keyboard soon, but so far most of my experimenting has been connecting through SSH and VNC remotely, so I haven’t needed the keyboard for too many tasks.

I’ll be updating this blog with a few of the things I’ve figured out, just to pass on the knowledge. Most of the stuff has been pretty straight forward, but I’m pretty familiar with Debian, so most of it was the same as what I’m used to. I have to say, I’m really impressed with the way the distributions have been put together. Kudos to the people who are working on these. I expected things to be much more difficult to set up.

The root word of specification is specific

As a developer, I’ve seen a lot of specifications float across my desk. The quality differences between them is staggering. Sometimes you get a really nice specification document. Other times things are a complete mess. What bothers me most about some specifications, it that they aren’t “specific” at all. They leave way too much up to the imagination. They’ve left out way too many use cases.

The first thing I do when getting a spec is that I go over all the different use cases. I start coding the thing in my head, and start to think about all the different interactions the system will have. Most of the time, in the first 5 minutes I can come up with 2 or 3 use cases that the author of the spec didn’t even consider.

This is very frustrating, because, when the specification is a work in progress, it means that I must send back the spec to the person who wrote it up, and ask a whole bunch of questions to clarify or expand on the specification so that we don’t end up with a system that doesn’t do what it’s required to do.

When it’s not a work in progress, I just resort to slamming my head against the desk. Because what that means is that this specification has already gone across the desk of many other developers, and there’s probably very little I can do to get things changed, because then all the other implementations would have to be adjusted to fix the changing spec, and even if they all wanted to, the people in control of the spec think there’s nothing wrong with it, because everyone else has been using it for years and never come across a problem (or never bothered to complain).

Anyway, I think that the best thing you can do with a spec is to get as many people to read is as possible. Because other people reading it will find holes in the specification. They will find new ways of interpreting whatever it is you wrote, and they will make your specification more clear and more useful to other developers. Because nobody wants their project ending up like PHP.

Coding For Fun

Sometimes when I’m coding for work, I feel like it’s lost all it’s fun. At work, we sometimes have to work on boring projects. For me the boring projects are the ones where I don’t even have to think about what I’m doing. The tools, the framework, the existing libraries are enough that I can get the job done without even really thinking about it. The kind of project where you can just go straight for 2 hours of programming, compile once, run it, and it just works, no fixes needed.

Now when you can do this, you at least you know you are doing something right. Because not everything you have to do should be some kind of epic battle to get stuff done. Trudging into new territory. But that doesn’t mean it doesn’t drown your spirits when the only thing you’re doing it just going through the movements to get the code into the computer.

I really enjoy going out and exploring new tools, new languages, new language features, new anything, because it really makes me think. It opens up your mind to new possibilities. A developer who doesn’t code for fun is usually not a very good developer. If you can’t take pleasure in exploring programming, learning new techniques, discovering unexplored territory, then you’re going to have a lot of trouble staying on top of all the new technologies.

If you find yourself getting bored with coding, just go out and try something completely new. Program a type of application that you have never programmed before, in some language that you aren’t that familiar with. Exploring new avenues in development will take your mind off the day to day drudgery that your job is, and really help to bring the fun back into programming.

Don’t Fight The Tools




The coming celebration of non-general purpose computing

This is a little bit inspired by The War on General Purpose Computing by one of my favourite authors, Cory Doctorow. I greatly respect his work, and see some very important ideas in his article. But I just can’t stop thinking, about how most people don’t really want a general purpose computer. Most people have no intention of writing programs to run on their computer. Don’t get me wrong, I’m a developer. I couldn’t imagine having a world without computers that I could write and run my own code on. But most people aren’t developers. For people who don’t write their own programs, the fact that a computer will do whatever you tell it to, is, well, problematic.

Think about the whole problem with viruses and malware. In some cases, there are bugs in programs that allow things to run without the user intending to run them in the first place. Open network ports with buffer overflow vulnerabilities allow things to come in over the internet, and just run on unsuspecting computers. While some viruses, many of the more prevalent ones, have infected machines over the years in this manner, there’s still a lot of viruses that infect computers from people just clicking on the file to run it. You can display warnings before running anything that comes from the internet, you can lock down user accounts, and display even more warnings when an application requires administrator privileges, but users will still let it execute anyway, because they were promised smiley icons, or a crack for some game they couldn’t be bothered to pay for. And so the general purpose computer runs said program, even it it’s a program that will cause no end of problems for this general purpose computer.

I think this is the reason why the iPhone is such a big hit. You constantly hear developers and technology enthusiasts whine about how the Apple walled garden is evil, and causes so many problems, with apps that can’t get approved, or apps that were approved, and then mysteriously removed afterwards for seemingly nonsensical reasons. But many people love the walled garden. There are a few things at play here. First, applications are reviewed by Apple employees before being placed on the App store. So there’s a good chance that a malicious program wouldn’t make it past the approval process. Second, you have to pay money to get your app on the app store. So if someone were to write a virus and it go through the approval process, then Apple might have a not so hard time tracking you down. Thirdly, even if the app did get published, and assuming the developer used false credentials so they couldn’t be caught, the app could still be quickly removed from the store as soon as it was found to be malicious. Before it could cause too much damage People love their iPhones because they don’t have to worry about malware anymore.

The other kind of non-general purpose computer is the game console. People love these too. Not counting hardware problems like the infamous red ring of death, people generally don’t experience any problems with these machines. You never hear about people having to format their Xbox or run a virus scan on their Wii. Again these machines have no problem with viruses because they only programs they run are the ones that are vetted for by MS, Sony, Nintendo, or whoever else makes the console.

I don’t think most people care if they can run any program, including ones they write themselves. As long as they can find applications that do what they need them to do, it doesn’t matter that they can’ write their own applications, because they have no desire to do that. I think that the desktop PC is headed this way too. Regular people just can’t handle general purpose computers. I don’t mean that in a negative way. In the same way I could care less about how my furnace, fridge, or oven works on the inside, and I care even less to tinker with them to work outside their original specified uses, most people don’t care how their computer works, and don’t care to be able to reprogram them. To these people, computers are just another appliance.

Now, I guess the final point. Does all this mean the end of general purpose computers. Not on your life. That boat has already sailed. The genie is out of the bottle. Computers are simply too ubiquitous and too well understood to ever get to a point where it is not easy to get a general purpose computers. Take a look at the Raspberry Pi project and you might see what a mean. A very small group of people, producing only 10,000 computers is able to sell a true general purpose computer for only $35. Now, it’s not the most powerful computer, but it’s fully internet capable, can play high def video, and has enough power to play Quake 3. There’s enough computer enthusiasts out there that general purpose computers will never be unavailable. But I don’t doubt there will be a day when most houses do not own a general purpose computer, but instead run some appliance type computer that the user can’t program, but which meets all their needs. And then the users will be happy. And so will the geeks, because it means we won’t have to fix their computers anymore, because they got yet another virus on their machine, even though they swear the didn’t run anything they shouldn’t have, again.

Sending Email With Telnet

Here’s a very interesting piece of information. You can send an email message by typing commands directly to the mail server. The protocol used to send email all over the world is simple enough that a human can type it out on their keyboard. Using a program called Telnet, you can send an email the same way that your mail client such as Outlook or Thunderbird would do. The conversation looks something like this (I’m using -> to denote what the user types, and

<- 250 Welcome to the mail server
<- 250 Continue 
<- 250 Continue
<- Please enter message. enter a single period followed by a "." to complete sending
-> SUBJECT: This is my message subject
-> Lorem ipsum dolor sit amet, consectetur adipiscing elit.
-> Curabitur elit justo, pretium ut lacinia non, dapibus eu magna. 
-> Duis nunc quam, lacinia sit amet hendrerit ac, malesuada in magna.
-> Duis dapibus elit a nisi ultrices dictum semper sem scelerisque. 
-> Nulla arcu lacus, placerat eu vehicula et, malesuada nec magna. 
-> .
<- 250 Message accepted for delivery


That’s basically it. Every email message that gets sent anywhere can be sent like that. In fact, the only thing you can send over email is text. All those pictures, or other attachments that are sent over email actually have to be encoded to type-able text using MIME. And because of this, the attachment will take 1/3 more space than the original file when sent over email. That is, a 300 KB email attachment with actually require 400 KB to be sent over the internet.

I just find it amazing how long email this simple protocol has stood the test of time. Sure things have been tacked on, to allow for authentication with the server, as well as a few other things, but not much. Makes me think of one of my favourite software development rules. Do the simplest thing that could possibly work.

Welcome To Developer Odyssey

I’ve decided to start a new blog. One about the odyssey which is software development. There are many books out there that may lead one to believe they can become a computer programmer in only a few hours. There are schools that promise to teach you computer programming in as little as 6 months. These things may teach you some rudimentary programming skills. They may start you off on your way to becoming a software developer. But becoming a software developer is not something that can be taught in a few hours. I might even like to say that I don’t even know if it’s something that can be taught at all. Being a software developer is something that can only happen as part of a long, unending, journey. In order to be a good developer, you must have a deep knowledge of how the computer works. You must understand the foundations upon which the technologies are based. This blog will be part of my journey. Documenting that which I find interesting, noteworthy, or just plain fun about software development or computers in general.