Archive for the ‘General’ Category

Flying upside down

Monday, June 2nd, 2008

Someone asked me a while ago how aeroplanes can fly upside down. After all, the wings normally ’suck’ the plane upwards. So if you fly upside down then surely they suck the plane down to the ground?

The trick is that you don’t just flip the plane over and try to fly horizontally - if you did that, you would get sucked down. Instead, you also point the nose a little bit up towards the sky so that your wings are passing through the air at the same angle as they would do in normal flight (somewhere between zero and fifteen degrees).

Of course, that’s all just theoryschmeery until you see someone actually doing it for real. Awesome.

What’s an electron, anyway?

Monday, June 2nd, 2008

An electron is one of those tiny negative particles, right? Well, that’s not how things were originally.

The word itself comes from the greek for amber (ήλεκτρον) because that’s how people first noticed the phenomena of charged objects. For some reason, scientists throughout time have been obsessed with rubbing various objects with cat fur to see what happened.

I’ve been reading the 1917 book “The Electron” by Robert Millikan (of the oil drop fame). He identifies George Stoney (in 1891) as the person who first suggested the word. However, this was in the days before anyone had identified an electron as a distinct object. When Stoney used the word ‘electron’ he defined it to be a “unit of electricity, namely that quantity of electricity which must pass through a solution in order to liberate .. one atom of hydrogen”. So, in 1891, Stoney wasn’t talking about the electron as a ‘thing’ but as an amount of charge, which today we’d measure as coulombs.

At some point the meaning must have changed, presumably after JJ Thomson discovered his ‘corpuscles’ in 1897 and Millikan measured the charge on them around 1909.

However, I was surprised to read the following line in the later chapters of the Millikan book:

“We have concerned ourselves with studying the properties of these electrons themselves and have found that they are of two kinds, negative and positive, which are however, exactly alike in strength of charge but wholly different in inertia or mass”

So it seems that in 1917 the word ‘electron’ was being used to collectively refer to what we now call electrons and protons. I have no idea of exactly when the meaning finally shifted to the modern version.

BBC invents new SI unit

Monday, May 26th, 2008

BBC News reports: “The Mars Phoenix lander touched down … after a 680-million-km journey”.

I’m amused by “million kilometre” as a unit of measurement. What happened to the gigametre? Why mix french and greek? Perhaps this is actually a clever new idea. We could start measuring hard disk capacity like “350 million kilobytes” to emphasise just how mindbogglngly large they are.

Netscape; hindsight is foresight

Saturday, May 10th, 2008

I have been enjoying reading “Architects of the Web” (see it on my Amazon bookshelf), a collection of stories from the early days of Netscape, Yahoo and the like. Perhaps in an attempt to avoid the doom of repetition, I’ve been reading a lot of “software history” recently … Seattle Public Library has got plenty of cool books.

Chapter one follows the founding of Netscape, from the early days of NCSA Mosaic, the fortuitous meeting of Marc Andreessen and Jim Clark and the beginning of the browser wars. I remember this from first time around, but I didn’t really understand all of what was going on.

The book progresses to follow the start of the browser wars, AOL beginning to bundle IE, Netscape launching the communicator suite …

And then the Netscape part of the book ends.

What? The end? But what about the browser wars? Microsoft getting sued by their own government? The AOL buyout? The Time Warner merger? Open sourcing of mozilla? The doldrums of tangled source code? And finally the rise of firefox?

As I flipped back to the opening “acknowledgements” page, I suddenly understand.

It was written in December 1996.

OMG. This book is a history of the web from the world of 1996. They had no idea what was coming next. Napster was nearly three years away. iTunes and the DRM wars would wait another few years beyond that. Skype, blogs, Flickr and web2.0 weren’t even on the radar yet.

But then again, what would happen if I wrote a ‘history of the web’ book today? Twelve years from now, someone might pick it up and say “Wow, these guys had no idea that X, Y and Z were just around the corner”.

I remember during the early days of Napster, I thought “this is basically illegal and will get squished”. But it took me a while to understand that (although Napster itself would ultimately be doomed) a genie had came out from a bottle and wasn’t ever going back in. Napster itself would end up dead, but so would the “old way of thinking”. It maybe took over a decade, but now stores are selling DRM free digital music and making lots of money doing so. People voted with their feet and it’s hard to stop a crowd.

So it occurs to me that in order to have a chance of seeing the new X, Y and Z before they creep over the horizon, you probably want to try letting go some of your ‘immutable assumptions’ about the world, and see what’d change if the assumption didn’t hold any more. Here’s some which pop into my head: ‘you need to have a bank account to put your money into’, ‘computers are not disposable items’, ‘companies need to keep stuff secret from their competitors’. Coincidentally, I’m also reading a book about Einstein’s life (on my bookshelf) and he’s the posterchild for the the “what happens if we ignore this fundamental assumption” school of thought.

So I’m now wondering: which ‘truths’ will have their demise chronicled in the history books of the future?

RAID-1 sans disks

Thursday, March 20th, 2008

In preparation for a somewhat more dramatic future experiment, I’ve been trying out RAID-1 failure modes using linux’s loopback capabilities to avoid having to actually buy any more real hard drives. You can simulate drive failures, failover and easily see what the current disk contents are. It should go without saying that, if you have a real RAID system currently running, you probably don’t want to execute these commands without thinking a bit first:

# Creating and destroying disks from the safety of your own console
mkdir ~/raid; cd ~/raid
 
# Create two 10Mb files called disk0 and disk1
for d in 0 1; do dd if=/dev/zero of=disk${d} bs=1024 count=10240; done
 
# Make them available as block devices using the loopback device
for d in 0 1; do sudo losetup /dev/loop$d disk$d; done
 
# Combine the two 'disks' into a RAID-1 mirrored block device
# Using '--build' rather than '--create' means there is no device
# specific metadata, and so the contents of the disks will be identical
sudo mdadm --build --verbose /dev/md0 --level=1 --raid-devices=2 /dev/loop[01]
 
# Create a filesystem on our raid device and mount it
sudo mkfs.ext3 /dev/md0 
mkdir /tmp/raidmnt
sudo mount /dev/md0 /tmp/raidmnt
sudo chown $USER /tmp/raidmnt
 
# The contents of both disks change in unison
md5sum disk[01]
date > /tmp/raidmnt/datefile
sync
md5sum disk[01]
 
# If we mark one disk as failed, disk contents diverge
sudo mdadm --fail /dev/md0 /dev/loop0
date > /tmp/raidmnt/datefile
sync
md5sum disk[01]
 
# Remove the failed disk and readd it, and RAID1 will sync
sudo mdadm --remove /dev/md0 /dev/loop0
sudo mdadm --add /dev/md0 /dev/loop0
sleep 1
md5sum disk[01]
 
# Add a third (unused) disk into the system to test failover
dd if=/dev/zero of=disk2 bs=1024 count=10240
sudo losetup /dev/loop2 disk2
sudo mdadm --add /dev/md0 /dev/loop2
sudo mdadm --detail /dev/md0
 
# When one of original two disks fail, the new disk gets used
md5sum disk[012]
sudo mdadm --fail /dev/md0 /dev/loop0
date > /tmp/raidmnt/datefile
sync
md5sum disk[012]
 
# Tidy up the world
sudo umount /dev/md0
sudo mdadm -S /dev/md0
for x in /dev/loop[012]; do sudo losetup -d $x; done
rm -rf /tmp/raidmnt ~/raid