Don't put title in a <link> tag

January 7, 2006
3 comments Web development

I learnt an important lesson today about the <link> tag. I had a XHTML Strict that looked like this:


<link rel="stylesheet" type="text/css" media="print"
title="Design for print" href="/print.css" />

And every time I tried to print the page it did not correctly incorporate the print.css file. The file gets downloaded by the client but not incorporated. After a lot of trial and errors and testing I finally discovered why. The title attribute stops the link tag from working.

The correct way to declare a link tag for a media="print" is to do the following:


<link rel="stylesheet" type="text/css" media="print"
href="/print.css" />

Hopefully this will help someone else getting into the same pickle as I was in.

Back from China

January 4, 2006
0 comments

After a pleasant 12 hour flight in Upper Class and 18 days, 15 days of hard training, 13 saunas, 5 massages and many many meals later I'm back in England again. My club training camp in China was a huge success. We had a great time and everything went smoothly.

Big thanks to all those who made it possible: Master Dennis Ngo, Karl the translator and guide in everything, Master Su Ying Han of Yong Chun White Crane, Master Chai of Wu Dang and Master Gu of Natural Boxing.

Although training was very hard every day the trip was more than just training punches and kicks. We learnt a lot about the food, the people and the habits and customs in China. Food was at major focus every day. Not only did we eat vast amounts of healthy food but we ate lots of different things of many different tastes. Some of the "weirder" things we ate: corps eating eal, frogs, sea blubber fish, jelly fish, wild chicken, turtle, dog and cat. Fortunately it wasn't the right season for mice which pleased me.

In a couple of weeks I will try to get all my photos up on this website. I took about 1,000 photos but some are experimental and some are near duplicates but expect more than 500 photos here soon.

UPDATE Photos from the trip now available here

Off to holiday in China

December 17, 2005
0 comments

Today I'm leaving for China, Fujian province. I'm going to stay in China till early next year. This is a kung fu training holiday with my club

I'm back on the 3rd of Jan and won't be posting much to my site but do expect some really exciting photos in the near future!

Merry Christmas and A Happy New Year!!

Emacs on the Palm OS

December 15, 2005
0 comments Mobile

Emacs on the Palm OS Do you love Emacs (or Jed) and you have a Palm PDA or a Treo 650 or something else cool that runs Palm OS; then you're in luck: install pssh

pssh is a SSH client for Palm OS that makes it possible to log in to a server running a SSH daemon and obviously the server will have Emacs.

Haven't had the time to install it myself yet but I will I hope. The only problem for me is that I don't have a WiFi card for my Treo so I'll have to try this stuff via GPRS which sucks.

Geek entrepreneurs' reading list

December 13, 2005
1 comment Books

FogGreek is putting together some sort of management training course and Joel has put up a reading list for the course. They're all either technical computer or modern management books that new-age web entrepreneurs should read.

Of all those books I've only read five but I recognize almost half of them.

Here are the ones I've read:

Don't Make Me Think Web Publishing The Inmates Are Running the Asylum Peopleware The Tipping Point

It's a shame they've missed out on Maverick! (or at least The Seven Day Weekend) by Ricardo Semler but it pleases me that he skipped the micro$oft propaganda book Joel on software

ALTER TABLE patch

December 12, 2005
0 comments Work

Since I always forget how to do this and have to reside to testing back and forth or to open a book I will now post an example patch that alters a table; correctly. Perhaps this is done differently in Oracle, MySQL, etc. but in PostgreSQL 7.4 you can't add a new column and set its default and constraints in the same command. You have to do that separately for it to work and most likely you'll have to run a normal update once the column has been added.

Just doing:


ALTER TABLE users ADD mobile VARCHAR(20) NOT NULL DEFAULT '';

...won't work and you'll get an error.

Truncated! Read the rest by clicking the link below.

iWipe - toilet paper and a Mac

December 11, 2005
2 comments Misc. links

iWipe - toilet paper and a Mac Is this geeky, trendy or just practical?

"Well, as soon as I saw the Mac SE case, I realized that this one had the most potential. So this weekend, I bought a few things at Home Depot and got started making my Apple-powered, wireless, portable toilet paper dispenser
the iWipe."

I don't really need a toilet paper holder but we do need a spice rack/shelve in the kitchen and I have an old medium towered PC box that one might turn into something. Perhaps a rectangular flower pot?

have or has?

December 8, 2005
2 comments Wondering

I stumbled across this at work the yesterday and I'm still not sure what it should be. This is how I found it written by our Britain-born client:

If your e-mail address or mobile number have changed since the last time, please let us know.

Does that sound right? Or more important, is it correct even if it doesn't sound right? How about:

If your e-mail address or mobile number has changed since the last time, please let us know.

It could be that both e-mail address and mobile number are now different. Therefore both of these things have changed. However, it's unlikely in general that either change. It's then also extremely unlikely that both have changed. In most cases, if there is a change, there is only one change.

Truncated! Read the rest by clicking the link below.

DOM Scripting

December 5, 2005
0 comments Books

DOM Scripting by Jeremy Keith I just finished reading DOM Scripting by Jeremy Keith to learn more about how to use the DOM (Document Object Model) to manipulate web content with JavaScript. The book teaches you how to write JavaScripts to create, change and animate content with scripts using document.createElement and stuff. The book starts with refresher on JavaScript which I must confess to reading much faster than I'm able to. However, it did explain the importance of declaring variables with var and why it matters well.

After chapter 4, you've been taught more or less everything there is to know about the DOM and the rest of the book is just big and explained exercises that iterate the importance of separating Structure (XHTML), Presentation (CSS), Behaviour (JavaScript) with examples and code from all three disciplines. By the way, don't worry when I say "exercises". You can read the book in the bath tub without having to do step-by-step exercises; Jeremy does all of that for you in the book.

Truncated! Read the rest by clicking the link below.