Entries from March 2003 ↓

The Pareto Principle: 80/20 rule.

The Pareto Principle was discovered when Vilfredo Pareto observed that 80% of the land in Italy was owned by just 20% of the population. Since then, many other people in different disciplines have observed similar 80/20 distributions.

In programming this often means that the last 20% of a development project can require 80% of the cost. Knowing this, it would make sense to concentrate on producing a 80% solution; this would happen if you use the "worse is better" philosophy.

It seems that the same principle can also apply to car repair. My car had been sluggish and inefficient recently, so I went to the garage today. The mechanic examined the engine and determined that the problem was a build-up of carbon on the valves that stopped them closing correctly. He told me that the correct way to fix this problem was to remove all the valves and clean them by hand: this would cost at least 200. He didn’t do that. Instead he sprayed decarboniser into the pipes and recommended that I buy a fuel additive. The total cost of this option turns out to be about 20% of the correct solution.

Selective recursive file copy

Tony suggested I post useful tips to my blog. He persuaded me to start the Vim category, and now suggested I post this too.

There are lots of little things I do that I don’t think are interesting or useful, but Tony thinks they are when he sees them. I suppose this could be a case of familiarity breeds contempt; I don’t recognise how useful something could be because I use it all the time.

Anyway, today Tony wanted to recursivly copy all the regular files from his current directory to another one; he didn’t want to copy symlinks or anything else. As usual, he wanted a one-liner. So, I did this:

tar cf - `find . -type f -print` | tar xCf /home/tony/otherdir -

Help me, vim

Have you ever been editing a script or program in vim and had to open a man page for a command, function, class, or Perl module you’re trying to use? If so, you should use the K command to do it for you. Move your cursor over the command word, hit K, and vim will display the man page for you.

Love your SMTP neighbour

Postfix is my favourite MTA for reasons I’ll not go into at the moment. It’s much better than sendmail.

Recently there has been yet another sendmail vulnerability, but I didn’t care because I use Postfix. Wietse Venema, the author of Postfix, did care. He could have said "sendmail sucks; use Postfix", but instead he wrote a patch for Postfix to remove the sendmail exploit from messages before they reach sendmail. Kudos.