Tuesday, 4 January 2005

Ode to Spanish Hot Chocolate

I have been to Spain quite a few times but it's only in Barcelona last week that I discovered Spanish hot chocolate. Forget Cadbury's chocolate powder to which you add water, this is the real thing. A real Spanish hot chocolate is made from real milk and real dark chocolate that has been melted in said milk, the way our grand-mothers used to do before the Nestles and Cadburys of this world invented the sachet of chocolate powder. The resulting drink is just heaven in a cup, sometimes so thick you have to eat it with a spoon. It is ideal for an afternoon break or, with churros, as a pick-me-up in the morning after a night of debauchery.

My favourite place to have hot chocolate in Barcelona is a small coffee shop aptly called Bliss, on Plaça Sant Just. Sit down in one of the sofas, order a chocolate caliente and relax, watch the world go by. You have just found Nirvana.

Monday, 3 January 2005

The perfect New Year holiday

I had a great New Year holiday. With a group of friends, we went to Barcelona, home of Antoni Gaudí. We all arrived on different days, at different times but most of us had time to enjoy Barcelona before the big party, especially considering the weather was very warm for the season, 15 Celsius with a bright blue sky. We also enjoyed some of the most amazing food: tapas, seafood, etc.

On the 31st, we all headed to Rita Blue for a nice meal, lots of champagne and lots of partying. At 4am, we decided to move somewhere else and ended in El Cangrejo until 7am, at which point we went to bed.

Photo of Barceloneta Beach, taken on 1 Jan 2005, blue sky and sunny
Barceloneta Beach, 1 Jan 2005 Posted by Hello
The 1st of January was a beautiful day and we ended up on the beach in Barceloneta. We ended up having the most amazing tapas on the terrace of the Baja Beach Club. I then had to rush to the airport to catch my flight back but made it in time, with even 5 minutes to spare to go wine shopping before boarding. Then for some reason, British Airways decided to upgrade me to business class. I didn't argue of course and enjoyed the wide seat and better leg room. When we landed at Gatwick Airport early, I thought we had flown into another dimension. This feeling was compounded by the fact that the trains were running smoothly and on time and I actually managed to make it from the door of the plane to Kew Bridge in 1½ hour. This is theoretically impossible.

It can't get better than this. I love Barcelona.

Thursday, 23 December 2004

Unexpected "feature" in Windows XP home Edition

I stumbled upon an unexpected "feature" in Windows XP Home Edition on Tuesday. Someone had found a photograph I had taken on DHD Multimedia Gallery but wanted a high resolution scan suitable for printing. So, back home, I found the negative of the picture and connected my Minolta Dimage Scan Elite 5400 to the only working computer I currently have in the house, an IBM ThinkPad T20, the same machine I tried to install Gentoo Linux on a few months back and on which I reinstalled Windows XP Home Edition.

It all started well. I put the negative in, did a first scan with no particular option, at 5400dpi, the highest resolution for the scanner. It gave me a whooping 16Mb JPEG image file that was equivalent to a 113Mb uncompressed image. But then because the negative is 8 years old and has gone through a few house moves, it has suffered a bit and had specks of dust I could not remove. So I decided to try the Minolta Digital ICE grain dissolver built in the scanner that is supposed to remove such specks of dust on the scanned image. It took a good 5 minutes to scan the image but it did a good job. So far, so good. Now, this scanner comes with another option to improve the quality of the scanned image so I decided to try that. The scanner started scanning. Then the machine started using its hard disk like mad, probably swapping because it only has 256Mb RAM. After a good 10 minutes of this, I decided I'd give up and tried to bring up the task manager to close the application. No chance there, the application just wouldn't close. By that time, it was using so much resources I was unable to do anything, even CTRL-ALT-DEL would not respond. The only solution ended up being disconnect the laptop from the mains and remove the battery. That stopped it alright.

After this, I restarted and was quite surprised when it didn't do a scan disk, considering how heavily it had been using it and how brutally I had stopped it. It still seemed to work though so I logged on to my account again to try something different. I started up Paint Shop Pro to do some manual tweaking of the image. The first task was to crop it to remove the edges, which in PSP involves doing a copy and then pasting the copy as a new image. So I selected the piece I wanted to keep, went to the Edit menu and selected Copy. The machine started to use its hard disk like mad once again. This time I decided to investigate and opened the task manager to look at performance and see what it was doing. This is when I realised that not only was the physical memory completely full but the paging file as well, which was an enormous 900Mb, which meant that the simple copy I was doing in Paint Shop Pro required more than 1Gb of RAM! That was bad enough. But what was worse is that Windows then warned me that I was getting low on memory so it would increase the size of the paging file, thus requiring even more resources, rather than stop the offending application. So it appeared that my machine was completely unresponsive and unable to let me stop the application because what was using the resources was not the application itself but the operating system's memory management that was trying to meet the demands of the application, even though it obviously couldn't. This time I was able to shut down the system properly.

Now this is bad because, by trying to be user friendly so as not to kill a user application that requires more memory than the system can offer, said operating system offers no protection against a misbehaving application that demands more memory than it should require or that the system can reasonably offer. It means that a memory leak in a badly written application can potentially bring the whole system to its knees in such a way that is impossible to recover nicely. It also means that, because it is impossible to subsequently reduce the size of the paging file, if the file keeps growing due to application memory demands, it could potentially end up taking an inordinate amount of disk space.

Fair enough, if I want to do image manipulation with images that take more than 100Mb in memory, I should really have a good desktop machine with lots of RAM. However, this discovery means that I'd rather not buy another Windows machine. Linux is not an option unfortunately because my scanner is explicitly not supported by SANE and I don't have the time nor the skills to develop a SANE backend for it, nor do I expect Minolta to develop one anytime soon. So I suppose the answer to my problem is to buy an Apple Mac with lots of memory and a good processor. I suppose I could think of a worse Christmas present for myself. And I don't even have the excuse that I can't find a good store, because Apple have just opened a brand new store in Regent Street.

Thursday, 2 December 2004

Cool Technology

The Register has this article on liquid lenses for camera phones. Those lenses are designed and built by a French company, Varioptic and are really cool. Because they use a combination of water and oil, they can change shape, which means that the focal length of the lens can change without any moving part, a bit like the human eye does. As a result, you can have auto focusing lenses that fit into something a few millimeters thick and use much less power than a traditional lens. The ideal solution for a camera phone. And they reckon we might get the first models in the shops by 2006. I want one of these!

Tuesday, 30 November 2004

Round Italy on a Vespa

I've had Vroom with a View on my pile of books to read for some time now and I started reading it yesterday. By the end of the first chapter, I was already laughing out loud in the tube, to the dismay of my fellow passengers. The book is about the author, Peter Moore, driving around Italy on a 1961 Vespa motorscooter, trying to live la dolce vita. I just love the way Moore has to describe his travels, with his ability to highlight the good, funny and ridiculous of any weird situation in a way only an Aussie can do. Vroom With A View is one of the best examples of this and is just a joy to read. This book will make you want to travel, will give you the urge to buy a plane ticket to Italy, buy a Vespa and whiz around in the sun. This is what travel books should be about, not a boring story about a scary place far away but an exhilarating tale that makes you want to pack up your bags and go. In this sense, Moore is a master story teller. And when you're done with Vroom, go and read his other books, they are equally entertaining.

Monday, 22 November 2004

Google Desktop Search

I am impressed. I installed Google Desktop Search on my work laptop this afternoon, just to try it out. The installation took about 2 minutes. Then it took a few hours to index the whole hard disk but it was doing that in the background without any noticeable effect on the system, apart from the disk activity LED blinking. And then, even with a partial index, it was already returning amazing results and making my job easier. But rather than expect you to believe me at face value, here is what I tested it with:

Code search

While writing code, I needed to use a class that is part of our standard library so I entered the name in the search box. In a fraction of a second (not enough time to blink), I had the list of all Java source files that contained a reference to that class, giving me the original code as well as usage examples; the related Javadoc pages, giving me the documentation for it; all without having to trawl through dozens of directories. Clicking on a Java source file opened it in my preferred editor and clicking on a Javadoc page opened it in the browser. 5 seconds to find more than what I would have found in 5 minutes before: fantastic.

Random search

Just for the sake of it, I entered the name of one of our customers in the search box next. Still less time than you need to blink later, I had my results, about 400 files and 300 emails. Google Desktop Search not only indexes text files and their content but also emails if you use Microsoft Outlook, as well as Microsoft Office files, web pages cached by Internet Explorer and AOL instant messages. The sweet thing with email is that they've obviously re-used some of the code they developed for Gmail because the search engine is able to recognise message threads and will group them as such, providing you with links to navigate from one message to another within the same thread. You can then open each individual message in your browser or in Microsoft Outlook: very, very nice.

That's it, I'm sold. No salesman, no marketing, just a very good piece of code that has been painless to install and has proved useful in less time than a Starbucks barista would need to serve a cappuccino.

Sunday, 21 November 2004

Oops!

Just found the pictures of a very unfortunate accident via #!/usr/bin/girl. Note that the registration plate of the bigger truck shows that it was registered in Dublin, Ireland, in 2004. Now, go and explain this to the insurance company! Good thing they have the pictures to prove what really happened.

Accessible Blogger Navbar

As mentioned earlier, I sent a feature idea message to the Blogger team to suggest they consider making their navbar accessible. So far, I got the automatic answer saying they received my suggestion and they were going to have a look at it. Let's wait and see. I'll mention the Blogrolling thing later if the answer is positive.

Second Step, Patch 1

Here we go, just after doing my second template change, I patched it again within minutes to change the style of <code> and <pre> tags. I shamelessly stole the idea from the XStandard web site. So, my thanks to their web designer, I now like the way the content of my <code> and <pre> tags looks like.

Site Re-design, Second Step

The second round of re-design was a short one. This is because I went out last night and didn't see much of the morning today. Nevertheless, I did a couple of changes.

Cosmetic changes

I didn't like my new h4 tags so I removed the italics and modified the other headers so that h3 would stand out from h4 better.

Link and access key to front page

I realised that the fact that the link back to the front page only existed on the archive pages meant that this same link was not available from the permanent pages, where the comments are. It also meant that the presence of this link was dependant on Javascript, which can pose problems, as highlighted in the next section. Therefore, I changed the template to have this link, and its associated access key on all pages. So you can now click the link or press ALT-1 to go back to the front pages, from any page on the site. I'll grant you that this feature is of dubious benefit on the front page itself except that it refreshes it and brings you back to the top.

HTML validation

I ran the W3C validator and the Bobby accesibility validator against the home page. This made me realise that my DOCTYPE was incorrect so I changed it. I then tried to correct all the errors highlighted by both services and am now left with errors in the Blogger toolbar on top and in the fact that I use Javascript to build the Blogrolling link lists, both of which I have no control over. The use of Javascript poses another problem in the sense that, in a browser that has Javascript disabled or doesn't support it, the lists of links will not appear.

In order for this page to be Bobby approved, valid XHTML 1.0, I would first need to convince the Blogger team to make their top toolbar accessible. I would then need to convince the Blogger and Blogrolling teams to make both systems interact better, in a way that doesn't require Javascript. One solution would be to have the ability in the Blogger template to use server side includes so that you could include fragments of code from another source, directly at the server, rather than rely on client side Javascript to do it; then Blogrolling would need to be able to deliver HTML without it being enclosed in a document.write Javascript call. I'll see what I can do. At the end of the day, it doesn't harm to ask.