Back from Fuzhou, China

November 19, 2007
3 comments

Today I'm back in London and working. I just got back from a 2 week holiday in Fuzhou in China where I've been hanging out with my friend Chris, eat and train kungfu. I've got a tonne of photos (mostly of kungfu training) that I'll upload in due course.

Long story short: It was great! Everything went really well and the training was well above expectations except that it was one of the hardest weeks (physically) I've endured in a very long time.

Now I'm on Last.fm

October 30, 2007
1 comment Music

Now I'm on Last.fm I've started exploring Last.fm now as an alternative and/or complement to Pandora which I still use.

Here's my profile page

I haven't yet fully understood how Last.fm works but I'm going to try to learn it the same way you learn to use a new wrist watch: baby steps.

The standalone player application works great on my mac at home but the Linux version segmentation faulted before the music even started so I'm going to use a much more interesting alternative on Linux which is to play Last.fm inside Amarok (which is tonnes better than iTunes by the way). Sadly the pause keyboard command doesn't seem to work.

One thing I do love about Pandora, is the ability to shuffle between various stations/channels. In Pandora I've got one station of heavy metal and one for Frank Zappa type music (amongst others) and if I stay for too long on one station it gets a bit boring. Let's hope this is possible with Last.fm too.

DateIndex in Zope doesn't have indexed attributes

October 28, 2007
0 comments Zope

This took me a while to grok and perhaps by mentioning it here, it'll prevent other people from making the same mistake as I did and perhaps preventing myself from doing the same mistake again.

In the ZCatalog, when you set up indexes you can give them a name and an index attribute. If you omit the index attribute, it'll try to hook into the objects by the name of the index. For example, if you set the index to be title with no indexed attribute it'll fetch the title attribute of the objects it catalogs. But if you set the indexed attribute to be something like idx_getTitle you can do something like this in your class:


def idx_getTitle(self):
   """ return title as we want it to be available in the ZCatalog """
   return re.sub('<*.?>','', self.title)

The same can not be done with indexes of type DateIndex.

Truncated! Read the rest by clicking the link below.

Piteå, as experienced by Sam Dunstan

October 25, 2007
0 comments Sweden

Piteå, as experienced by Sam Dunstan A friend of mine, Sam Dunstan has written a hilarious blog entry about his visit to Sweden that I find so amusing that people who are interested in Sweden and the swedes really should read. It's hilarious as a swede since there are so many embarrassing truths, especially if you live in Piteå.

"Piteå is about 50kms from nowhere. Despite the university (reputable) and paper mill (smelly), there is very little going on here. Granted, there are few towns that have a snowmobile drive-through McDonalds"

The blog entry isn't just about Piteå but also has lots of thing in general about Sweden that we should be proud of. Reading it from Sam's perspective is quite interesting because he sees it in a way only a non-swede could but still we recognize so much of it.

"I could hear my wallet creak in agony everytime I opened it to pay for something. I had to stop mentally converting prices to the old AUD when I bought things because it kept making me dizzy. To be fair, herrings were cheap and good. But how many herrings can you eat? I'm not a seal."

Islington Kungfu charity fund raiser 2007

October 22, 2007
1 comment Kung Fu

Islington Kungfu charity fund raiser 2007 Thank you everyone who sponsored me for this weekends Kungfu endurance challenge to raise money for the Claremont project.

A reminder... The Claremont project is a venue where old people go to for activities in Islington. Many of these people are weak and lonely and doing these activities is practically all they have to meet and socialise with people.

Unfortunately I didn't win any of the individual events of the endurance challenge but I did try my best and I'm very happy that I participated and at least tried.

Thank you all who sponsored me!!

Here are some photos from the event

Bicycle racing in NYC

October 11, 2007
0 comments Misc. links

Bicycle racing in NYC I totally don't approve of what they're doing but what they're doing is totally impressive.

It's a long clip of a couple crazy couriers racing through the streets of New York crossing red lights and zebra crossings and going in the oncoming traffic lanes. Mental!

Silk icons

October 9, 2007
1 comment Web development

I'm sure there are plenty of free icon sets on the net but since I always forget the few I find, this time I'm going to blog about it to not forget it.

The Silk Icons is a really nice set of 16x16 pixel icons free and free for commercial use. You can either download them all as individual PNG files or preview them all using this one big image file (1Mb)

Whilst on the subject it's also worth keeping the iconfinder in mind. It's in beta and both limited and slow but worth keeping an eye on.

Future of Web Apps (quick summary and thoughts)

October 4, 2007
2 comments Web development

Future of Web Apps (quick summary and thoughts) Pretty cool talks and talk topics. A pretty dull expo area but Adobe give out free beer if you take one of their books and trade in a business card.

Even though every second app on the expo and many of the talks are about social networking I found it really hard to network here. I had some decent chats with the expo people but not much with the fellow guests. They few who aren't head-down stuck in their mac laptops were being cliquey and hard to approach.

A blind talker from AbilityNet taught gave me a few thoughts:

  • he likes that Gmail has a plain HTML alternative
  • Google docs (despite being heavily javascriptted) works for him
  • AJAX is generally bad news for him
  • screen readers have javascript enabled by default so don't expect them to read notices inside noscript tags

An interesting company there was XCalibre. After 3 years of development they've come up with a virtual private server hosting solution which looks cool. Unlike us, when a virtual server outgrows a physical machine they can move the virt. server from one machine to another with less than 1 min downtime and without loosing any packets or stuff in RAM. They currently support Windows and some Linuxes for operating systems Currently not Ubuntu due to a tricky kernel bug but they're working on it. The cost model is cost per usage. Ie. by megabytes, data transfers and time. The name of the product is Flexiscale.

A few things I learnt from one talk by a lady called Heidi who is an expert at mobile web development:

  • don't use the strong tag, use the b tag because it's smaller in size (5 bytes)
  • Don't use H tags like H1 or H2 or maybe even H3. They're almost always too big for mobile screens and the mobile browsers make them too big. Content wise, a bold is enough.
  • Use the xhtml-mobile10.dtd DOCTYPE.
  • Navigation links are over-rated. Use search instead!
  • Mobile acid test: http://jwtmp.com/a

One of my personal heros had a talk about Firefox and JavaScript and the future of Firefox. It was John Resig. A nerdy looking fellow who was an excellent speaker with a voice a very very confident and clear voice but with some very shy movements on stage. He had a very technical talk about where Firefox is heading with Javascript 2, SVG and some weird OpenGL extensions. He also touched a bit about Firefox 3 and offline use. Long story short: Mozilla has some grand and exciting ideas about Firefox. Really exciting!

One of the most interesting talks was that of Kevin Rose. The Digg founder. It was nice to hear that he's no genius God. He's just another regular bloke who likes to put together websites. He started everything up from scratch and made lots of misstakes and had to learnt lots as they grew. A few random points I can remember:

  • invitation features such as address book import and email invites has been very good for their user growth.
  • on the "send an email to a invite a friend", instead of using a mailto: link, use the mail program icons like the Outlook, Firebird etc logos to very quickly explain what it's about
  • Their second project, Revision 3 was done in Python and the latest was done in Django and they were very happy with it. Digg is done with LAMP(hp).
  • Don't (even try to) go for VC until you've got a working app
  • Plan for success! One of the biggest mistakes he confessed. However, at the very earliest stage his aim was to get something working and earn a few extra bucks to reduce his rent.

Linux tip: du --max-depth=1

September 27, 2007
28 comments Linux

There are lots of fancy programs for Linux to find out where your gigabytes are sitting and filling your hard drive, the simplest of them is du (from disk usage). The trick is to use the --max-depth=1 option so that you get a view of which folder weighs how much. Try this:


peterbe@trillian:~/tmp $ du -h --max-depth=1
900K    ./Example-Receipts
4.0K    ./Foredettinghelgen
44K     ./IssueTrackerBlogInterface
1.9M    ./IssueTrackerProduct
12K     ./fried-mugshots
2.1M    ./ies4linux-2.0.5
4.8M    ./pyexcelerator
52K     ./levenstein
4.0K    ./newitpdesign
4.7M    ./photoresizing
69M     ./databases
4.5M    ./i18nextract-sa
532M    .

Pretty nifty! That way you can quickly see which folder contains the most junk so that you can free up some hard drive space.

To sort it I don't know how to reformat it into human readable values but there's the command:


peterbe@trillian:~/tmp $ du --max-depth=1 | sort -n
4       ./Foredettinghelgen
4       ./newitpdesign
12      ./fried-mugshots
44      ./IssueTrackerBlogInterface
52      ./levenstein
900     ./Example-Receipts
1856    ./IssueTrackerProduct
2140    ./ies4linux-2.0.5
4528    ./i18nextract-sa
4796    ./photoresizing
4872    ./pyexcelerator
70392   ./databases
544608  .

Spellcorrector 0.2

September 24, 2007
3 comments Python

Unlike previous incarnations of Spellcorrector not it does not by default load the two huge language files for English and Swedish. Alternatively/additionally you can load your own language file. The difference between loading a language file and training on your own words is that trained words are always assumed to be correct.

Another major change with this release is that a pickle file is created once the language file or own training file has been parsed once. This works like a cache, if the original text file changes, the pickle file is recreated. The outcome of this is that the first time you create a Spellcorrector instance it takes a few seconds if the language files is large but on the second time it takes virtually no time at all.

Truncated! Read the rest by clicking the link below.