Toothpaste

March 10th, 2006

Did you know that the main ingredient of toothpaste is wet sand? They call it "hydrated silica" on the ingredients list but that's actually what it is - a suspension of very fine grained silica (sand) particles in water. It's an abrasive - it gets into the tiniest cracks and scrapes out left-over food.

A while back I was cleaning my keyboard (a Microsoft Natural Keyboard Pro):

There was a rather unsightly stain on the front part which had arisen through using the keyboard one too many times with hands greasy from cheese sandwiches. It didn't come off with soap and warm water. I thought to myself "I need some sort of fine abrasive, combined with some kind of detergent that is good for removing organic matter - ah, toothpaste!". I scrubbed at the stain with some toothpaste and an old toothbrush and it came right out.

Security requires the right mindset

March 9th, 2006

A friend of mine at Microsoft told me this story about his manager, who is a very smart guy but apparently doesn't have the right mindset to be writing software that doesn't have security holes. The other day my friend and his manager were in their offices (just across the corridor from each other). The manager was making a phonecall. To his bank. On speakerphone. With the door open. To verify his identity, he had to key in his social security number. This number was then repeated by the electronic voice on the other end of the line for our entire corridor to hear. D'oh. To make matters worse, he continued the entire phonecall on speakerphone (with the door open).

A joke I thought of today

March 9th, 2006

It seems that astronomers and astrologers have in recent years started pronouncing the name of the planet Uranus as "you're a nus" instead of "your anus" as it was before. I believe this is the first time that the pronunciation of the name of a planet has changed for this reason.

Watch out because you're next, Mars ("m'arse").

Charity cold calls

March 8th, 2006

Is my karma going to hell because I hang up on charities that phone me asking for money? I always feel a little bit bad for doing so (which happens about once a weekend), but I logically I know I really shouldn't. If everyone donated money to every charity that ever called them, then charity cold calling would just explode and everyone's phone would be continually ringing. The amount of money these charities received would probably increase at first but then fall back to normal levels as people found themselves having to donate smaller and smaller amounts per phone call.

On the other hand, if no-one ever donated money to charities that called them, the calls would soon stop, the people employed to make the phone calls would be able to put their energies towards more constructive uses (such as promoting that charity's cause in less invasive ways, or working more directly to help the people that the charity is trying to help) and I could go back to expecting to speak to family or friends whenever I heard the phone ring.

I figure the best thing to do with charity phone calls is just to hang up as quickly as possible (without even saying anything) after discovering that it's not somebody I know or some kind of emergency. That way I have used up as little of that charity's money/time as possible (not to mention my own valuable time). Doing this feels kind of rude but it really isn't - the call in itself is rude so the social contract of politeness has already been broken and there should be no expectation of politeness from me.

I'm not against the concept of charity altogether (I donate money through work so it gets taken out of my paycheck before the tax withholding, my employer matches my contribution and I don't have to remember what I donated when I come to file my taxes).

Security hole

March 7th, 2006

At work today, I had a security hole to investigate. Say what you like about Microsoft, but you have to admit that in recent years they have really turned things around on the front of taking security seriously. It was interesting to get to experience this from the inside today.

As it turned out, all the Microsoft Security Response Center wanted to know was if this bug (which is known to affect certain no-longer-supported parts of Visual Studio 6) also affected the later versions (Visual Studio .NET, Visual Studio .NET 2003 and Visual Studio 2005). Rather than just testing the exploit against these later versions, I insisted on debugging through the VS6 code to find the faulty code and then making sure that this code was fixed in the later versions.

It's quite a strange experience to be debugging through such old code (some of it at least a decade old) especially when I work every day on the code that is descended from it. It's kind of like going back in time and meeting your ancestors. There are some strangely familiar things there but it is very much code from another time. It's also much simpler with 10 years fewer layers of features and added special cases. I was surprised at how easy the bug was to track down.

It was also a relief that, when I found the right place, the bug was completely obvious to any (modern day) programmer looking at the routine in question. Rather than being some subtle and hard-to-spot side-effect of a rare interaction between unrelated parts, the faulty code was doing all the things you're not supposed to do, like allocating a fixed-length buffer on the stack and concatenating C-style strings without any size checks. Such code could never get into the product with the processes we have in place now.

Amazingly, the function with the fault still exists in the codebase today, though the buffer overrun was fixed a long time ago (sometime before November 2000, when the code was moved to the version control system we currently use). It's good to know that when issues like this come up we can track them down quickly even in ancient code, and that our processes work.

Computer talk

March 6th, 2006

I always enjoy listening to Car Talk on the radio. I think it's wonderful that it is possible to have a show with such broad appeal on such a technical subject. I suspect that most people who actually know a lot about cars find it annoyingly simplistic and inaccurate but probably still enjoy the jokes.

I wonder if it would be possible to do a similarly broadly-appealing show about computers? I guess the closest thing I've seen was Call for help on the old TechTV but I think that was both too geeky (and not funny enough) to have broad appeal, and also too simplistic to be of interest to real geeks. Being on TV instead of the radio probably didn't help either - if you're watching a TV show it's much more difficult to do something else at the same time than if you're listening to the radio so you're only going to watch if you're particularly interested, not if you're just a casual computer user.

I think a car-talk-style show about computers would be great fun to do. It would include all the jokes, banter and puzzles that we enjoy on Car Talk, and also help normal, non-geeky people with their computer problems. Sure you'd get a lot of calls just consisting of "Help! My computer has spyware!" but the Car Talk guys get a lot of calls just consisting of "Help! My car is making a funny noise/smell!" and somehow they always manage to make it interesting so I'm sure it's possible.

Perhaps it is just an idea whose time has not yet come. Computers have only been widely available for about half as long as cars have. Perhaps in another 30 years or so computers will be enough like cars are now that such a show would be possible.

Man prepares for hardware store

March 5th, 2006

As a man, I am always a bit nervous about taking my car to the garage or going into a hardware store because I am expected to know about such things. I went into a hardware store last weekend and was afraid that they were going to ask me if there was anything they could help me with and then laugh at me if I said something like "I need some grease for my garage door" instead of something like "I need a type 2 metallic lubricant with a polarization ratio of less than 7 diflurges per snoof". Women, I am sure, generally do not have this problem as they are not expected to know about these things (though knowing about which sorts of shoes are currently in fashion sounds more difficult to me so I think I prefer being a man on the whole).

The problem is exacerbated because lots of bits of hardware have different names in this country. Who would have though that a rawl plug would be called a "wall anchor", for example? (Okay, in this particular case it would probably be more difficult for an American living in England).

Wasn't there a TV comedy sketch which had a salesperson in a hardware shop tried to narrow down exactly what type of flange his customer was looking for by asking lots of nonsense questions? (Did you want a screw type flange or a plain flange? How many legs?) I think it might have been a Two Ronnies sketch, but all I can find on the internet is the "four candles" sketch which (while hilarious) is not what I was thinking of.

Car parts

March 4th, 2006

Last weekend, one of my car's dashboard warning lights came on. I cursed slightly, because that usually means a fair bit of expense and inconvenience. This proved to be the case this time too - so far its cost $500, the car has been at the menders for 3 days and the light is still on.

One up side is that this has caused me to do some research on the parts of my car that went wrong, and they were two parts that I had no idea even existed.

One is the Exhaust Gas Recirculation Valve. This pumps a small amount of exhaust gas back into the cylinder towards the end of the ignition cycle to cool the reaction and inhibit the oxidation of nitrogen. I knew about NOx pollution from secondary school chemistry but didn't know this was how it was fixed in modern cars.

The other is the carbon canister, which adsorbs vapors from the fuel tank, preventing these vapors from leaking out into the environment while allowing the pressure in the tank to equalize with the external pressure.

Fascinating stuff.

The universe (and TV) needs more Shakespeare-quoting starship captains

March 3rd, 2006

My favourite of the Star Trek serieses has to be The Next Generation. The Original Series was groundbreaking for its time but I don't think it has aged well and now looks very silly and dated. The more recent series never quite recaptured the spirit and originality of TNG. There were some truly marvellous pieces of TV in that series, such as:

  • The outwitting of Moriarty in "Ship in a bottle"
  • The entire episode "The Inner Light" (I was so engrossed that I had forgotten I was watching TV by the end)

And, of course, there is the episode "Hide and Q" where Picard (surely one of the greatest characters in all of TV) defeats an immortial, omnipresent, omniscient alien by quoting Shakespeare at him! What could possibly be more awesome than that?

Special relativity is kind of like religion

March 2nd, 2006

Here's an interesting little analogy I thought of the other day. In the theory of Speciai Relativity (SR) the result of any experiment is the same if the entire experiment is moving at constant speed in a constant direction, so there is really no way to tell if you are stopped or moving at a constant speed, so the concept of "absolute rest" is not really meaningful from a point of view of science (you can only be "not moving" with respect to something, like the planet Earth for example).

Somebody who believes in God is kind of like somebody who believes that they are at absolute rest. There is no way to prove or disprove that claim, scientifically speaking, but if it makes them happy and it isn't doing anybody any harm then there's nothing wrong in believing that.

The trouble comes, of course, when somebody else believes just as strongly in a completely different god, or when they are moving at 100 miles per hour towards the other believer and claiming that it is they, not the other guy, who is actually in a state of absolute rest. If the two believers are firm in their beliefs they may choose to disagree amicably as they pass each other, or if they are fundamentalists they may choose to blow the heads off the heretics and unbelievers. This is where religion (and unprovable beliefs in general) stop being harmless and start to become a real problem for society.

Perhaps that is the real answer to the "science verses religion" debate. Science deals in relative things, religion deals in absolutes. Science is perfectly compatible with any given religion but two different religions are fundamentally incompatible with each other. Hence there are plenty of Christian scientists and plenty of Islamic scientists but no Christian Islamists.

My philosophy is that one should believe what one likes, but should let others believe what they like as well and should not try to blow the heads off those who disagree with you. Don't try to push your absolutes on someone else who may have their own absolutes already. We can all agree as long we only speak in relative terms ("this guy is at rest relative to the Earth") rather than in absolute terms ("this guy is at absolute rest). Relatives are universal and absolutes are personal. Science is universal and religion is personal.