jump to navigation

Jim Gray – LA Times version May 30, 2008

Posted by Peter Hornby in software.
add a comment

Look, I know it’s hard to describe someone as multi-contributory as Jim Gray in one paragraph, but, really, I think Michelle Quinn, in her story in this morning’s Los Angeles Times, might have done better than this:

The daylong event honoring the computer-science whiz who helped create automated teller machines will be part celebration, part science fair.

“The computer-science whiz who helped create automated teller machines”?  That’s it?  Really?

I guess it’s possible that Michelle Quinn’s research led her to the Microsoft press release announcing Gray’s 1999 Turing Award, which has this as its subheading

Gray’s database research paved the way for ATM machines, computerized airline reservations and e-commerce. The Microsoft senior researcher this month received the prestigious A.M. Turing Award-the “Nobel Prize of computer science”-for his contributions.

The Times story is actually pretty good once you make it past the open.  It talks at some length about tomorrow’s tribute symposium at Berkeley, and spends more time on Gray’s wife Donna Carnes, and her life since his disappearance, than it does on his life and achievements.


The most luminous event in the universe May 19, 2008

Posted by Peter Hornby in astronomy.

Something astonishing happened in the sky earlier this year, something unique in human experience. I’d like to talk a little about what this event was, and why it was so remarkable.

Let’s start with some background.  Since the late sixties, astronomers have been recording, analyzing – and puzzling over – enigmatic objects called gamma ray bursts.  Gamma rays are the most energetic form of electromagnetic radiation, so when we see something shining at gamma ray wavelengths, we know that something extraordinarily powerful is behind it. The gamma ray burst (GRB) is a flash of gamma rays, typically lasting no more than a few seconds, coming from a place in the sky where nothing had previously been recorded. As they fade, GRBs normally show an afterglow at X-ray, ultraviolet or visible wavelengths.

For decades, no visible light counterpart – a star or galaxy – could ever be found, but the suspicion was that, since the distribution of GRBs on the sky showed no relation to the structure of our galaxy, they must be extragalactic, and consequently extraordinarily luminous. This suspicion was confirmed in 1997 when a faint galaxy was found at the location of a GRB.

We’re now in the midst of a revolution in GRB study, dating from the launch of the SWIFT orbiting observatory in late 2004. SWIFT combines a sensitive gamma ray detector with the ability to rapidly slew its other instruments to the location of a burst within seconds. Not only that, there’s now an amazing network which permits co-operating ground-based observatories, both professional and amateur, to be activated, totally automatically, within seconds of SWIFT’s detection of a GRB.

So why I am I so excited?  Well, the July “Sky and Telescope” magazine arrived this morning, with a brief analysis of a March 19 GRB detected by SWIFT. What’s totally amazing is that the visible-light afterglow of this event was, for a few seconds, bright enough to be visible to the unaided eye.  This struck me as the most astonishing event and I threw a few calculations together to get a sense of just how unbelievable it really was – what’s actually meant when we describe this event as the most luminous single event ever seen, anywhere in the universe.

So, let’s start with some numbers. The March 19 event, called GRB 080319B, occurred in a galaxy 7.5 billion light years away. The galaxy itself can only be seen by the most rigorous imaging techniques. By contrast, the galaxies we can see with our backyard telescopes are only tens of millions light years away – the famous Andromeda galaxy (M31) is just over 2 million light years away and it’s about 60 million light years to the huge Virgo cluster of galaxies, a favourite telescopic target for amateur astronomers in the spring sky.

That’s million, by the way, not billion. At 7.5 billion light years, GRB 080319 B was a long, long way away.

So, how bright was it?

Let’s digress a bit to discuss the way astronomers talk about the brightness of celestial objects. The key thing to realise is that how bright an object appears to us in the sky is no guide to its intrinsic luminosity. Is it a dim candle close by, or a distant searchlight? Astronomers use the apparent magnitude scale to describe how bright an object looks to us. How apparent magnitude is defined doesn’t really matter here. It’s enough to understand that bigger numbers mean fainter objects, on a scale where the faintest star visible to the unaided eye is about magnitude 6, the brightest stars in the sky are around magnitude -1, Venus is around -4, the full moon around -12 and the sun around -26.

Following our analogy, if the candle were ten feet away and the searchlight ten miles, they might have the same apparent magnitude. However, if you move them so that they’re at the same distance from you, it becomes immediately obvious that the searchlight is vastly more powerful than the candle. The absolute magnitude, which astronomers use to describe the intrinsic brightness of an object, is defined in an analogous way. It’s just the apparent magnitude an object would have if you moved it to a standard distance – in this case 32.6 light years.

Let’s look at the Sun as an example. It’s so bright because it’s so close. When you compare it to other stars, though, is it a candle or a searchlight? The answer is – it’s a candle. Move the Sun out to 32.6 light years, and it becomes a dim yellow star of magnitude 4.8, barely visible to the naked eye. By contrast, Rigel, the brilliant white star in the lower right of the famous Orion figure, is a distant celestial searchlight. Even at a distance of 700-800 light years, it appears as one of the brightest stars in our sky, with an apparent magnitude of 0.1. Move it in to 32.6 light years, and it dazzles at magnitude -7.0, ten times brighter even than Venus.

If we go a little crazy, and try to estimate the absolute magnitude of an entire galaxy, we come out with, as you’d expect , some very negative numbers. The absolute magnitude of our own Milky Way – the combined luminosity of its 200 billion or so stars – is estimated at -21.

The estimated absolute magnitude of GRB 080319B was -34.

I still can’t quite believe this.  GRB 080319B was a single object – probably a massive star collapsing catastrophically into a black hole – which was, for its few final moments of life, a million times brighter than the entire galaxy it lived in, bright enough to be visible to an unaided human eye halfway across the universe.

Let me conclude with a couple of broad comparisons and a pen picture.

  • Place it anywhere at all in our galaxy. GRB 080319B would have appeared as a point source way, way brighter than the full moon. Anywhere within 2000 light years, it would have appeared as bright as the Sun.
  • Place it in the Andromeda Galaxy, an association of several hundred billion stars 2 million light years from us, and visible as a faint naked eye object, around magnitude 4. GRB 080319B would have appeared around magnitude -10, still almost as bright as the full moon.

Finally, I want you to imagine that you’re observing the galaxy M58, 60 million light years away, with your backyard telescope. It’s a dark, steady, moonless night, and you’re concentrating on a faint, elliptical haze, trying to detect the spiral structure you know is there. Suddenly, a point of light appears. In a few seconds, it’s so bright that looking at it through your telescope hurts your eyes. You step away from the telescope and look up. The object continues to brighten, until it outshines Venus. A few seconds more and it starts to fade, and within a couple of minutes, it’s lost to your sight.

We’ve only been studying gamma ray bursts seriously for a few years. Maybe, one day, some lucky amateur astronomer will be in the right place, at the right time, to make the observation of a lifetime, to see, with his own eyes, the brightest object anywhere in the universe.

One last note. Sky and Telescope notes that GRB 080319B occurred seven hours after the death of the revered science-fiction writer and visionary Arthur C. Clarke.  Some astronomers are already referring to GRB 080319B as the “Clarke Burst”, the universe’s spectacular sendoff to one of our own brightest stars.

Build your own font May 13, 2008

Posted by Peter Hornby in software.
add a comment

I’ve never developed a font.  I don’t suppose many people have.  It’s always seemed as though you need expensive tools, planetary-level creative skills and, let’s say, a tendency to the obsessive.  Well, some of those barriers to entry have just been broken down with the release of FontStruct, a free web-based font construction tool from a font house called FontShop.

The metaphor is simple.  You fill a rectilinear grid with bricks.  OK, it’s just pixel editing. But the bricks can be odd shapes, so you can round off corners and end up with some radical character shapes.  Once you’re done, you can save your work, and download a TrueType version for use in your own work, or you can share your font with other users.

I have to say that FontStruct is really well done.  You have the tools you need, and no more.  The interface is clean and attractive.  All in all, an excellent job.

So, building a font is now simple.  Of course, designing a great font is exactly as hard as it was before, and for that, you’re on your own.

Thanks to Jason Kottke for the tip.

IIS7, PHP and WordPress on Vista May 12, 2008

Posted by Peter Hornby in tech.

I spent a substantial part of the weekend getting WordPress running on my laptop. There was actually a good reason for this, other than my strange attraction to hitting myself over the head with a brick. Actually, I’m planning to set up a blog for the Saddleback Master Chorale in the next couple of weeks, and I thought that it would be useful to develop some experience with the non-hosted version of WordPress. What made the effort somewhat more challenging was that my laptop runs Vista, so I decided to use IIS7 to host the WordPress installation.

Many people have blogged aspects of this challenge, and I wouldn’t pretend that this is the canonical story. But there were some pieces of the puzzle which caused me more trouble than I expected, so I’ll try to concentrate on those.

Installing IIS7

IIS is not installed by default on Vista, so you have to go to the “Turn Windows Features on and off” selection in the “Programs and Features” control panel. The key thing to remember is to make sure that you’ve enabled the CGI feature while you’re checking IIS options.

Finding and installing FastCGI

Many people recommend using Microsoft’s FastCGI if the application framework you’re using supports it,as PHP does. Reusing Windows processes is a big performance win, and there are reliability benefits too, especially since FastCGI is thread-safe. So how do you get FastCGI? If you’re running Windows Server 2008, you’re in good shape, since FastCGI is bundled, but Vista is another story. Microsoft released a technical preview version of FastCGI last year, but that’s now gone, and it’s now only available as part of Vista SP1. And that was my first problem – how to get hold of Vista SP1.

Finding Vista SP1

Windows Update, you’d think. Not so fast, sparky. Microsoft says that they’re rolling out Vista SP1 gradually through Automatic Updates, but if you want to jump the line, you can manually scan for updates. I did that. No sign of SP1. Luckily, there’s a KB article which addresses the problem, offering seven possible reasons why SP1 is not offered by Windows Update even after a manual scan. Actually, it’s really six, since Cause 1 is “You’re already running SP1”. The two possibilities which seemed pertinent were Cause 5 – “SP1 won’t be offered if Windows detects that you have device drivers which might cause problems with SP1” – and Cause 7 – “SP1 won’t be offered if other Windows updates are offered – it needs to be installed as a single update operation”.

So I spent a couple of hours addressing these points, with no success. More scrabbling around in Google turned up another KB article which, while describing the ways SP1 can be obtained, referred to the need to update the Kernel Streaming driver (ks.sys) before updating to SP1, since the older driver version can cause a crash during the update process. This driver comes into play, I think, with the Logitech webcam on my Dell XPS M1530 laptop. The ks.sys update was made available in early April as a Microsoft download. I updated this driver, and suddenly SP1 appeared in the Windows Update list.

So let’s move on to the real work.

Downloading and installing MySQL

I Installed MySQL 5.0, and used the command-line configuration tool to create a user and a database, as described in the WordPress installation instructions. That at least was simple enough.

Downloading and installing PHP

I downloaded PHP 5.2.6, and installed it in C:\inetpub, as recommended by Scott Hanselman in his essential screencast on getting PHP working with IIS7 and FastCGI. The next step is to use IIS Manager to create a handler mapping to have IIS route .php files to the FastCGI module. This stuff is all covered by Scott Hanselman and also by Ryan Dunn’s screencast on Channel 9. Note that if you’re out for performance, there’s significant benefit to be had from using the non-threadsafe version of PHP, since FastCGI ensures that requests are single-threaded through service processes. The PHP core is threadsafe, as are most PHP extensions, but there are third-party extensions which aren’t, and there can be instabilities if you use a non-threadsafe PHP with the ISAPI interface. See the relevant entry in Mike Volodarsky’s blog for more.

Configuring PHP

There are a number of steps you need to take here, and you’ll be editing the php.ini file. The main work is to wire PHP up to MySQL. You need to tell PHP where its extensions directory is (the extension_dir option) and you need to make sure that the reference to the MySQL extension (extension=php_mysql.dll) is uncommented. One final thing, which caused me substantial headscratching, is to tell PHP where to look for this php.ini file. You’ll need to create a registry key (HKLM/Software/PHP/IniFilePath) to hold this location, and then restart IIS to have PHP read it. The PHP documentation for this is here. Check that PHP is loading the correct .ini file (and that PHP is wired up properly) by browsing to http://localhost/phpinfo.php.

Installing WordPress

I installed WordPress 2.5.1 into C:\inetpub\wwwroot\blog. The wiring between WordPress and the MySQL database you created earlier is done in wp_config.php. Here’s how the relevant piece of the file should look.

// ** MySQL settings ** //
define('DB_NAME', 'putyourdbnamehere');    
define('DB_USER', 'usernamehere');     
define('DB_PASSWORD', 'yourpasswordhere'); 
define('DB_HOST', 'localhost');

And, then, browse to http://localhost/blog/wp-admin/install.php, and after a couple of install forms, you should have a running blog.

I wish you luck!

Comfort Books May 11, 2008

Posted by Peter Hornby in books.

When you look over your shoulder, and find the world staring at you accusingly, you need help.  Some people have comfort foods – the kind that their mothers made for them when they were small.  For me, it’s comfort books.  There are several heavily dog-eared books on my shelves which fill this need, offering a sense of familiarity and warmth when life starts to crowd me.

One of my best comfort books is Fred Hoyle’s 1957 science-fiction novel “The Black Cloud”.  It’s not a literary classic by any means, as I’m sure Hoyle would have admitted – he called it a “frolic” in the Preface.  I think what I like about the story is the sense of bright scientific collegiality it conjures in its characters, who are mostly astronomers and physicists. It takes me back to my undergraduate days, many years ago, when I was peripherally involved in the professional astronomy scene in the UK.  The hero is Chris Kingsley, Professor of Astronomy in the University of Cambridge, and it’s clear that Kingsley is who Hoyle wants to be when he grows up – he’s young, ferociously smart, and suffers fools not at all.  Oh yes, and he’s also possessed of a “shock of thick, dark hair” and “penetrating blue eyes”.

Let me give you an example of the kind of dialog which makes me smile.  Kingsley is travelling back to Cambridge with the Astronomer Royal, after the meeting at which the observations which led to the discovery of The Black Cloud were announced:

“Let’s put it this way”, answered Kingsley. “There are two hypotheses I can make.  Both at first sight seem incredible, but one of them must be right. One hypothesis is that a hitherto unknown body with a mass of the same order as Jupiter has invaded the solar system.  The second hypothesis is that the Astronomer Royal has taken leave of his senses.  I don’t want to give offence, but quite frankly the second alternative seems to me less incredible than the first”.