I'll admit, as a software developer I have been tempted by tales of thousands of dollars a month for simple applications for the iPhone. But these days, writing apps for the iPhone is a risky proposition.

If you are starting a serious business, you have to consider risks involved. Being dependent on a single vendor puts you on shakey ground to start with. After spending thousands of dollars on Apple development tools, investing hundreds of hours in development time, who wants to be told:
Upon review of your application, <name> cannot be posted to the App Store due to <insane reason of the week>. This behaviour is prohibited, as outlined in the iPhone SDK Agreement section 3.3.1.xx.5a.
THIS REJECTION NOTICE IS PROTECTED UNDER YOUR NON-DISCLOSURE AGREEMENT WITH APPLE (PAGE 42). ANY VIOLATIONS OF THE NDA WILL BE DEALT WITH AT THE FULL EXTENT OF THE LAW.
This is just one of hundreds of stories of Apple crushing dreams, posted weekly to programming websites and blogs.
- Game emulators are not allowed because they could be used to run other programs (in the emulator).
- Applications that can download and display things are not allowed, because they can be used to display the Kama Sutra.
- Games featuring pictures of political figures are not allowed.
- Apps that bear any resemblance at all to any Apple apps, now or in the future, are a no-no.
To be sure, many apps are rejected for valid reasons. But sometimes the reasons are questionable and inconsistent. Apple must realize that this damages their reputation. What are they going to do next? Nobody knows, because they're craaaaazzy! Next think you know, they'll be trying to control the media.
When you get a new job, you can breathe a sigh of relief, but not for long. You have an offer letter in your hand, and it is easy to miss one of the most important opportunities of your life – the starting salary. Here’s the tale of two programmers. When getting a job, Goofus didn’t negotiate. Gallant asked and got an extra $2500. They both get yearly raises of 3%
| Year | Goofus | Gallant |
|---|---|---|
| 1 | 45000 | 47500 |
| 2 | 46350 | 48925 |
| 3 | 47740 | 50392 |
| 4 | 49172 | 51904 |
| 5 | 50647 | 53461 |
After five years, Gallant has made an extra $13272, enough to get his car paid off, or keep his Macbook software up to date.
Goofus is in prison because he had to become a spam lord to pay child support for his six kids.
Everything in life is negotiable. C.E.O.s and corporate executives are simply people that learned this at an early age. The things that are most negotiable are the things written in black and white in indelible ink. They are engraved in silver, carved in stone, simply to trick you into thinking you cannot negotiate. “Just sign here. It's a formality.” “It's a preprinted form, it can't be changed.”
Do not be intimidated. Salary negotiation is a game, and the first to give a number loses.
When it goes wrong…
A friend once confided in me one of the biggest mistakes of his life.
If a reporter asks you about your new startup company, be careful what you say.
- The statement that sounds best will be quoted.
- Some of what you say will be re-ordered or deleted.
- Long, rambling descriptions will be paraphrased and condensed.
Here is a pitch from a new startup company, taken from an article in The KW Record on Wednesday, April 1st, 2009:
Every company that I worked for has its own method of testing, and I've gained a lot of experience in what works and what doesn't. At last, that stack of conflicting confidentiality agreements that I got as a coop student have now all expired, so I can talk about it. (I never signed them anyway.)
I use graphviz whenever I need to draw state machine diagrams. Drawing circles connected with lines is a hard problem for computers, because they have to decide where to place the circles so the diagram makes sense. These types of diagrams are called graphs.
To my surprise, I found that there is a very simple way to arrange graphs that can be expressed in only a few lines of code, using force-directed placement [Fruchterman, 1991].
I've been installing Ubuntu exclusively on USB memory sticks, because then if Canonical suddenly decides I don't need frivolous things like sound or wifi to work properly, I can just pop in another installation and keep going. A 4GB USB drive is plenty of space, if you remove the all the junk that comes with the default Ubuntu Desktop installation.
I went through the entire package listing in Ubuntu 8.10 and figured out which packages were useless space-hogs. It is utterly astounding that for every package installed by default, someone at Canonical decided it would be more useful than VLC Media Player.
There are burgeoning numbers of Ph.D's and grad students who are choosing to study pornography. Techniques for the analysis of "objectionable images" are gaining increased attention (and grant money) from governments and research institutions around the world, as well as Google. But what, exactly, does computer science have to do with porn? In the name of academic persuit, let's roll up our sleeves and plunge deeply into this often hidden area that lies between the covers of top-shelf research journals.
I once took computer vision class. Every algorithm we learned was done on grayscale images, as if it were 1950 and we couldn't afford those new fangled colour VDTs. I put up my hand and asked why we discard all of this lovely colour information. The prof answered that some people have tried it, but it doesn't give much benefit.
But in some situations, colour can be important.
Once you post something on the Internet, it is hard to get rid of it. As an experiment, I deleted one of my past posts, and I tried to remove all traces of it.
It is common knowledge that Linux users needn't worry about viruses because users don't run as root. I've never understood the reasoning behind this. Here are a few of the malicious things that a program can do without being root on Ubuntu 8.10:

Quick! Where do you go to increase the text size in all your applications? Can you pick the right button on the first try? Do you feel lucky, punk?

Today's usability tips
- If users have to start a new project to use your program, then when your program starts, it should automatically start a new project.
- It is never a good idea to make menu items that inexplicably do nothing.
- Few types of software benefit from a "Tip of the day". If you can't think of any tips, then your software is not one of them.
- If you have a help feature, it should be under the help menu.
- Slapping up a wiki is not a substitute for a help system.
Case study: ktoon
I recently started re-reading William Zinsser's On Writing Well. Zinsser emphasizes simplicity in writing.
Okay, say you work at a company that uses Perforce (on Windows). So you're happily tapping away using perforce for years and years. Perforce is pretty fast -- I mean, it has this "nocompress" option that you can tweak and turn on and off depending on where you are, and it generally lets you get your work done. If you change your client spec, it synchronizes only the files it needs to. Wow, that's blows the mind! Perforce is great, why would you ever need anything else? And its way better than CVS.
Tip 1: Stop Firefox from writing to disk
To further my understanding of frequency analysis and the fast fourier transform, I have created an application that just turns on the microphone and continually plots the FFT magnitude of what it records. It allows control over the window size and sampling rate.

Download SoundLab
Here's a quick little Windows XP/Vista tray application that I made to disable the screensaver and standby modes.

Download StandbyPreventerInstall.exe
- Financial data for 1600 public companies listed on the TSX is downloaded from http://finance.google.com.
- The annual and quarterly revenue and earnings is scraped from the HTML file using an sgrep query.
- Each company is filtered according to the following criteria:
- Resource, mining, and energy stocks are excluded.
- Stocks with PE ratio higher than 50 are excluded.
- Stocks which had negative revenue or earnings in the past two years are excluded.
- The remaining stocks are sorted by growth and displayed here.
I stumbled accross this page about myself on this rotten company Spoke.com, who, without my permission, gathered my name and employment history together into one place. I object to it, but there was no obvious way to get it removed. After a lot of searching, I found a contact page and filled it out, but I'm not at all confident that it will be acted on.
Spoke, if you want me to remove this entry about you, you can opt-out at any time using the contact form below. After I verify your identity I will put your request into a queue for removal.
I just spent several hours debugging clipboard copy of a DIB image. I could copy from my application, and paste into Paint. I could paste into Word. But if I pasted into WordPad, nothing showed up. If I pasted into GIMP, it crashed.
The general procedure is to fill out a BITMAPINFO structure, calculate the size of the image + row padding + the bitmap info structure itself, the allocate a memory handle with GlobalAlloc(), then copy the BITMAPINFO structure followed by the image.
What they don't tell you in msdn is that you must use a positive value for the BITMAPINFOHEADER biHeight member. That means that you have to create the bitmap upside down
Have a look at this image. You might think I scrawled it on a napkin and scanned it in. Wrong! It was completely automatically generated by an upcoming release of www.websequencediagrams.com, with the new "napkin" style. Getting it to render this way was easy, simply with a tiny bit of math and a change to my line drawing function. The handwriting font FG Virgil.

Why can't anybody write a decent stock screener? Google did, but they left out my favourite exchange, the TSX. The best indicator of whether a stock is going to go up in the medium term is growth in earnings, but it is near impossible to find this information for Canadian stocks. I have tried the one at GlobeInvestor.com, but it seems to be written by an imbecile, and its results are quite random.
Frustrated, I wrote my own tool to pull this information from publicly available sources (Only took about 5 hours). Here, at last, is a text file containing the fundamentals for about 1100 securities on the TSX, as of June, 2008.
The Via Artigo was just too cute to pass up. The videos don't do its size justice. When I unpacked it, it was even smaller than I expected. I was looking for a system to replace my home web server, on which this blog is hosted.
By the time I put it all together, I was so impressed that I began to use it as my full desktop system. It consumes so little power that I can just leave it on all the time without feeling pangs of guilt.
Here are some notes about my experiences.
Cairo is the hot new cross platform graphics library. It is becoming very popular, because it solves two outstanding problems in a portable way:
- Path based drawing
- Antialiasing
Both of these problems are astoundingly hard. You would have to read a whole graphics textbook in order to implement basic drawing, and antialising. Before cairo, your choices were Win32 GDI based drawing, or whatever GTK uses. In addition, cairo is supported in Python.
Recently on www.websequencediagrams.com, I noticed that I had a link from a Japanese web site. So I decided to check how my web application worked with Japanese. Of course it didn't work. So I had to figure out how php and python use unicode.
Examples
C:\>calc 5+5*5 30.000000 c:\>calc 0x30 48.000000 c:\>calc (123456 % 51)/12 3.000000
If you have to draw something called "UML Sequence Diagrams" for work or school, you already know that it can take hours to get a diagram to look right. Here's a web site that will save you some time:
You can just write the diagram out in text, click "Draw", and the web site will spit out an image. Then you can tell your boss that you slaved for hours in MS Visio perfecting every line...
I have created a separate web page for this project... please go there.
Download Installer
UMA and free long distance
Last time, I talked about the UMA technology used in some newer cell phones. Some of you might be thinking, these new cell phones work over the Internet. What's to stop me from travelling to another continent, and then making free long distance calls to local numbers back home?For more UMA answers, see my more recent article.
What's UMA?
Recently, many carriers have started offering UMA, or WiFi phones. These are cell phones with WiFi capabilites. Don't be fooled -- you won't be able to get free calls and run skype on them. The UMA technology is meant to extend the carrier's cellular network into your home using your broadband internet connection.How does UMA work?
An UMA phone operates just like a regular cell phone. It can talk to cellular base stations. But it is dual mode, and it also has a WiFi radio on board. When it finds a WiFi access point, it will attempt to connect to your carrier's servers over the Internet. If the connection is successful, it will "Rove in" and begin sending everything over the Internet.Go to http://gandolf.homelinux.org/~smhanov/todo/ to try it out.
Here's the php source code.
The challenge: Install Linux on a really old laptop. The catch: It has only 32 MB of RAM, no network ports, no CD-ROM, and the floppy drive makes creaking noises. Is it possible? Yes. Is it easy? No. Is is useful? Maybe...
Motivation
Why? Like mountain climbers say: because it's there. As an environmental nut, I don't like to throw away things that still work. But I have a PCMCIA network card and I would rather not have to hunt down and install 10 year old drivers to get it to work with Windows 95. The latest Linux definitely supports more hardware out of the box than Windows 95.The google show_ads.js script has been optimized for quick loading. Google has removed all whitespace, and renamed variables and funcitons to have single letter names. While this is good for fast page loading, it is not so good for understanding what it does. So I ran this through my Javascript PrettyPrinter, and then renamed the functions and some variables based on what I think they do.
- It handles HTML, embedded javascript and CSS
- It uses syntax highlighting for keywords and punctuation.
- It adds links to Javascript function calls so you can click on them to jump to their definition.
- Shareware
- Adware
- Adsense
- Donations
Compare your per-second income with various celebrities. It only works with Firefox.
You:

download WaveStudio.exe
In this article, I'll explain how you can get a stack trace for where your resource leaks occur. This method is for Microsoft Windows. Linux developers are better served with Valgrind.
You might want to visit DialAbc.com, which has more results. Stay here if you are interested in the theory behind it.
This article was actually written in 2002. Here, I explain a technique for figuring out which words are in which phone numbers. Full C source code is included.
Here's a rhyming engine, written in 1000 lines of C++ code. It uses the freely available Moby dictionary, and full source code is provided. Give it a try. Read on for technical information.
Recently, however, my views have changed after reading Scott Meyer's book, Effective C++. In Meyer's book, he goes through every feature of C++ and shows you how you have to program with extreme care to avoid undefined behaviour. It seems like every modern feature that C++ has was specifically designed to help you shoot yourself in the foot.
I never realized this before, because I simply never use these dangerous features. In this article, I'll show you how to program in C++ safely.


