A photo I took back in March at the Cliffs of Moher featured on This Is Broken today. I’m a bit annoyed that they didn’t give any sort of hypertext attribution, despite me giving them the Flickr URL for the photo and my own URL. Oh well, I guess not everyone’s a conscientious Web citizen.
Mountain View
I’ve just payed to renew this domain for the next year, so I guess I better start using it. It’s been a busy couple of weeks for me, what with starting work, Good Good Friday in Nottingham, and now I’m in Mountain View, California.
Yesterday I took myself on a self-guided walking tour of San Francisco. I wholeheartedly recommend walking across the Golden Gate Bridge (photos to come). On the other hand I cannot in good conscience recommend walking to the Golden Gate Bridge from downtown San Francisco. My feet hurt. I’m reminded of this story. Here’s a map of my approximate route, though I actually took a more up-and-over approach than a go-around approach to the hills.
I set out from the Caltrain station at 11:30 and got back there at18:30. That’s local time. In GMT those times translate to some time next Thursday. Of course I managed to get a Golden Gate shot glass, not to mention reams of photos of the bridge, of Alcatraz Island and of some really steep hills.
These Boots
There’s a joke or a comic to be made of the phrase “These boots are made for Walken”, but for the life of me I can’t think what it is.
Isn’t There an Alternative?
Search Google maps for directions from Dublin, Ireland to San Francisco, California and look at step #46:
Swim across the Atlantic Ocean 5,572 km
I was rather hoping to fly…
Travel Plans
I don’t know if I mentioned before that my starting work next week looked like it was going to prevent me from spending the Easter weekend in Nottingham with the Joinees. It turns out that my manager will be away at the end of that week, so I can take the Thursday off even though it’s only my fourth day on the job. Thanks to the bank holiday on Friday and the public holiday on Monday, my first weekend will be five days long. I just needed to book a hotel, because I still had my flights.
The following weekend, I’ll be flying to California to spend three weeks at Google HQ in Mountain View, near San Francisco.
Now if you’ll excuse me, I need to go and get a machine-readable passport.
300
Marks out of ten: 300
Ok, for a change I’m going to take a break from my usual love-it-or-loath-it style and give you a mixed review. I enjoyed this film, but it wasn’t as good as it could have been. It had everything I knew it would have but none of what I hoped it would have.
300 is a ball of solid testosterone marinated in adrenalin and wrapped in a loin cloth. It’s a style-fest, a gore-fest and a comic book on the screen. Every part of it looks beautiful: every beheading, impaling, stabbing, slicing, swing of a sword or hurling of a spear is crafted into a piece of art visible for one twenty-fourth of a second. Like its predecessor, Sin City, you could take any given frame from this film and hang it on your wall. Just don’t let any children or the faint of heart see it. There will be blood.
If that doesn’t sound appealing then you’re not going to like 300. There’s not much more to it than that. There are no characters to get behind unless you get caught up in Leonidas’s sub-Gladiator quality bellowings about honour and glory. The parts that aren’t directly about putting sharpened bits of metal in people seem to have been fairly dubbed the “bathroom breaks”.
But then, if you’re not all about hardened men’s men kicking ass so hard the Persians are still feeling it 2500 years later, then what are you watching this for? You won’t feel anything when any character dies. You won’t get dragged into caring about the people of Sparta. But you might just be so pumped full of adrenalin that you punch a hobo on your way out of the cinema. (Note: Don’t do that.)
mod_negotiate
I can succinctly describe Apache’s mod_negotiate in the words of Homer Simpson: “It can’t be turned off… Though it does break easily.”
I’ve spent longer than I care to contemplate wrestling with a mod_rewrite directive that was acting up on the about and /projects/ sections of this site. I’ll record the resolution here for posterity.
The directive was a simple one:
RewriteRule ^projects/(.+) /projects/?project=$1
This should take a URL such as /projects/make-link and map it onto /projects/?project=make-link. As mod_rewrite goes, this is a simple one. It gave me a 404 response every time.
After much poking and prodding I discovered that it would do the correct redirect for the url /projects/foo. (This took a lot of fiddling to discover, because the script that serves that part of the site will return a 404 response for projects that don’t exist, making that indistinguishable from a failed redirect. I had to edit that script to discover that the redirect was working for /projects/foo but not for /projects/make-link.) This turned out to be the work of mod_speling (sic). It will “fix” a single typo in any url you request (a missing character, an extra character or a transposition), so it was rewriting “make-link” to “makelink”, which happens to be the name of a directory in that section.
Having turned off mod_speling, I still had trouble. I narrowed the bug down to three simple conditions. Usually /projects/foo would redirect properly to /projects/?project=foo. If there was a file in the /projects/ directory called foo.html then /projects/foo would redirect to /projects/?project=foo.html. Finally, if there was a file called foo.html.inc in that directory (and there was), it would crap out and give a 404 response.
This was caused by the aforementioned mod_negotiate, which basically guesses what file to serve if it’s asked for a URL with no file extension. The default is to serve whatever file it can that it recognises the extension for. Thus it will serve foo.html because it knows the .html extension, but it doesn’t play well with foo.html.inc because .inc is just something I made up for my own convenience.
The problem is that this module can’t be turned off! Ridiculous. The only thing I could do to stop it from breaking my site was to set it to be as promiscuous as it can be, to try to serve up any file with any extension that seems to match. This got me to the stage that /projects/foo would redirect to /projects/?project=foo.html.inc. A small change to the relevant scripts now strips the unwanted “.html.inc” from the parameter it’s given.
Why is there no off switch on that module?
Download of the Day: Make Link
Imagine my surprise and delight yesterday when I found out that one of my favourite blogs, Lifehacker, had featured my very own Make Link Firefox extension as its Download of the Day.
My joy was tempered somewhat by the fact that I’ve always been a little bit ashamed of the quality of that extension. I wrote it quickly and a long time ago so all I see when I look at it are flaws. The few comments on the site and by email inspired me to put a little bit of effort into polishing it up somewhat. The result is Version 2.1, which addresses three of the more widely reported bugs and feature requests.
Rice Rice Baby
Did you ever hear the old Chinese story about the rice and the chessboard? The specifics are hazy, and I’m sure there are lots of variations anyway, but I remember the important details. Someone having performed some important task for the king asked that he be paid in rice. The king was to put one grain of rice on the first square of a chessboard, two on the next, four on the next and so on to fill the board with each square containing twice as much rice as the previous one. How much rice do you think this adds up to?
The answer is easy to calculate but difficult to imagine. There are 2N – 1 grains on the Nth square. 20 = 1 on the first, 21 = 2 on the second, 22 = 4 on the third, and so on. The last square, number 64, has , 263 = 9×1018 grains on it. That’s a nine followed by 18 zeros or nine billion billion. Let’s try to cut that down to something we can imagine.
There are about 2000 grains, give or take, in a reasonable portion of rice. If a person eats one portion every day she will eat 730,000 grains a year. That last square will feed her for about 1013 (ten thousand billion) years. I think we need to cut it down further.
There are six billion people alive right now. If they all loved rice as much as the example person in the previous paragraph and consumed it at the same rate of 730000 grains a year it would take about 2000 years to eat it all. The only problem is that none of us will live that long. We could eat it at twice the rate, say two portions a day each, but that will only reduce it to 1000 years. We need more people.
It’s estimated that there have been somewhere in the region of 100 billion people ever. Let’s assume that they all loved rice and would want to eat two portions a day for their entire lives. So we have 100 billion people each eating 1460000 grains of rice per year. How long would it last?
263 grains / (1011 people * 1460000 grains per person per year) = 63 years, a lot more than the average lifespan for most of human history. That single square of rice would comfortably feed two portions a day to every person who has ever lived for their entire life.
The rest of the board contains the same amount again (less one grain).
Life Updates
My eyes hurt from spending the whole day with dilated pupils so I’ll make this brief. In the words (possibly) of Charles Manson, bullets to the rescue:
- I was offered a job on Friday. I have accepted. I start in three weeks. There will soon be a disclaimer that the opinions expressed on Soylent Red are mine and not those of my new employer.
- I spent the weekend in Clare (the county, not a girl). It was fun.
- I have resolved to spend St Patrick’s Day next year in New York. People appear to be interested in this idea.
- I had an examination at the Wellington Eye Clinic today. I’m an ideal candidate for LASIK. In fact, post surgery, I will have better eyesight than I could possibly get from corrective lenses because they can fix the asymmetry in my corneas as well as my myopia.
- I love Lamp.