Monday, 29 August 2005

Floated Into Limbo

I Apologise to users of Internet Explorer. I realised on Friday that all pictures and notes I float into the left margin are actually floated so far t the left with Internet Explorer that they disappear from the page. There is also an unexpected amount of white space at the top of the page with IE. I suppose those glitches are due to IE not calculating percentages according to the specs and it is annoying to have to write special IE code but then again I don't want IE users to miss anything. So bear with me, I'll try to get it sorted within the next few days.

Monday, 22 August 2005

Lunch!

There are people who do macro photography. And then there's Jim. His close-up pictures are just amazing! I wish I could take that type of shots. I suppose it's a question of patience and practice but still, the results are amazing!

Power Nap

As promised, here's a sample of the pictures I took a week ago at the London Wetland Centre. The centre is a great place for young and old alike. If you're in London, don't miss it.

Sunday, 21 August 2005

I switched back

I had been using since I bought my Mac. But Safari is a pure browser with no extension capabilities and I was really missing some of the extensions I had got used to on , such as ScrapBook, WebDeveloper, FireFTP, FlashGot or Gmail Notifier. So I downloaded Firefox for my Mac and switched back. One interesting side effect is that Firefox appears significantly faster at downloading and displaying pages. Don't get me wrong, Safari is a great browser, but I find Firefox better.

Sunday, 14 August 2005

Cute Birds

It was quite a nice day today, rather warm with the occasional rain shower. So I went to the London Wetland Centre. It is actually quite close to where I live but I had never been. To be fair, I don't think many Londoner realise that they have a waterfowl nature reserve just across the river from Hammersmith. This is why the WWT, who run the centre, have been doing a serious advertising campaign in trains and buses over the past few years. This is something I love about London: it is the largest city in Europe but you have amazing parks and nature reserves virtually in the centre. But I digress. So I went there today, armed with my camera, tripod and lenses to take snaps of cute birds. It was the opportunity to try out features of my camera I had never really tried, in particular the AI-Servo auto focusing mode and the continuous shooting mode. The 100-400mm zoom lens I bought in the US earlier this year is great for that sort of shots. Although quite often I wished I had had a longer focal length as I couldn't really fill the frame. It might be time to invest in a 1.4x or 2.0x extender. The only problem with those is that they reduce the effective maximum aperture of the lens, which is used by the auto-focus mechanism. Considering the smaller aperture my camera can auto-focus at is f/8, which is already the best in the Canon range, and my lens has an aperture range of f/4.5-5.6, I would lose the ability to use auto-focus, let alone AI-Servo, with the 2.0x extender. This obviously would not be good to take pictures of birds in flight. But I digress again. I will get the pictures developed tomorrow and post them online afterwards. Hopefully there will be a few nice shots.

Saturday, 13 August 2005

Week-End

It's the week-end and I intend to do some serious relaxation. The past two weeks have been hectic at work and I am happy to be off today and tomorrow. However, in typical Murphy's law fashion, the weather was beautiful all week until today lunchtime. Since then, it has been rainy and grim. The weather forecast says it should be nice tomorrow though so there is still hope.

Monday, 1 August 2005

Cool gazpacho

I just tried the gazpacho I did yesterday and it is just great. This is so simple to do and is so nice. And it has a nice kick to it, thanks to the chilies and habanero sauce. But it's a summer soup so now I just need a few rays of sun to go with it. Come on, it's July, in the Northern hemisphere, it should be possible! Even in London! Ah well, maybe not after all.

This might sound stupid or obvious but, by doing it, I found out what makes gazpacho taste so fresh: the cucumber! So the English had it right all along: cool as a cucumber.

Sunday, 31 July 2005

Ice-cream, smoothies and gazpacho

The ice-cream I did yesterday with my new toy turned out great. The only problem is that my freezer is in serious need of defrosting so it was a bit overzealous in freezing the ice-cream which means it was rock hard and I couldn't scoop it. I had to cut pieces with a warm knife. But once it was slightly warmer it was great. I'm sure there are some ingredients I could add to prevent it from becoming rock hard. I shall investigate.

On the smoothies front, I improved the recipe by replacing half the milk with yogurt and using only fruits that have no pips or where the pips are easy to remove, such as bananas and pears. The result is a definite improvement.

I got a bit more adventurous tonight and decided to attempt a using an online recipe as a base. Having no celery, parsley or chives I had to simplify the recipe a bit. I also replaced the Tabasco and Worcestershire sauces with a combination of chilies and sauce, so that it would be reasonably high on the Scoville scale: a real gazpacho needs to have a bit of a kick to it.

And for those who like stats, this is post number 200 in this weblog.

Saturday, 30 July 2005

CSS Superscript and Subscript Using Relative Position

You might have noticed in my previous post that the note references in the body of the text were displayed as superscript. Now sup and sub are tags and should be avoided because the presentation should be in the CSS. However, there is no immediate CSS property for superscript and subscript. Here is a solution using the relative value of the position property. Let's take fractions as an example and assume I want to write 3/17. I will use classes fnum and fden for the fraction numerator and denominator respectively.

The first step is to make the text smaller, 70% should be fine. Then we need to offset it vertically. The best way to do this is to use position:relative. For the superscript, it's easy, just push it up from the bottom by 0.5em. For the subscript it is a bit more difficult. Using the top property has no effect so instead we are going to use a negative bottom property to push it down. Here is the resulting code:

.fnum {
  font-size:70%;
  position:relative;
  bottom: 0.5em;
}
.fden {
  font-size:70%;
  position:relative;
  bottom:-0.5em;
}

This works but looks weird for the denominator because, in a fraction, the forward slash (/) character between the numerator and denominator leaves a lot of white space in front of the denominator. The solution for this is to slightly shift the left margin of the denominator: margin-left:-0.2em. Why not use the fact that we are using a relative position and add left:-0.2em instead? This is because the left property shifts the content of the display box but not the box itself and it would leave a gap on the right of the denominator. The margin-left property will shift the whole box and modify the right margin as well. Of course, none of this applies for a standard subscript such as the one used in chemical fomulae like C2H5OH. That's one more reason to use semantic HTML and CSS: you can adjust the display of each individual element depending on their meaning so that they look good in context.

Update

Following the comments below, here's a simpler solution to achieve the same thing courtesy of squidoography.com:

.fnum {
  font-size:70%;
  vertical-align: super;
}
.fden {
  font-size:70%;
  vertical-align: sub;
  margin-left:-0.1em;
}
.atomnum {
  font-size:70%;
  vertical-align: sub;
}

I also agree that in an ideal world we would use MathML to display mathematical formulae but a number of major browsers (this one in particular) don't support MathML so for web documents, we have to do with HTML and CSS.

Poor DHL, Great Smoothies

A few days ago I found a delivery notice from DHL in my letter box, telling me that they had tried to deliver me a parcel but as I wasn't at home they took it back to their depot in Park Royal, West London, not very far from where I live, as the crow flies. However, getting there on public transport involves a 1 hour journey on 2 buses. So that's at least 2 hours there and back. Knowing this, I called them earlier during the week to see if we could arrange for a new delivery. It turns out that DHL don't deliver on Saturdays and can't deliver to my work address because it is not the same depot. So I had no alternative other than going to the Park Royal depot on a Saturday morning. I did so this morning. In the process, I discovered that the map printed on the notice is incorrect: the Asda store is not where the map puts it. This is quite important considering it's a major landmark there and you can't rely on street names because there are virtually no street signs in that area11 The English have this very annoying habit of having street signs only at major junctions and only if they really feel like it; and don't get me started on house numbers in the street. Furthermore, the DHL depot is only indicated by a small DHL sign hidden behind a tree just outside the depot. If you don't know exactly where it is, you will never find it.

As a result it took me slightly longer than expected to get there. But I did get there in the end and got my parcel. It was worth all the pain. The parcel in question contained a Braun Multiquick professional MR 5550 M BC-HC blender that I bought from Amazon. This thing is the Rolls-Royce of blenders: it can do all the normal things a hand held blender can do plus all sorts of cool stuff like smoothies, crushed ice22 Essential for cocktails, whipped cream, etc. So after dropping it home, I went to the shops to buy fruit, milk and cream and decided to try it out. It took a few minutes to have a raspberry and blueberry smoothie to die for. Then I got adventurous. The home made ice-cream is now in the freezer. It is probably worth 42 gazillion points on the Weight Watchers scale but it's all natural stuff.