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.

Ugliest site of the month - The Backyard Comedy Club

September 21, 2007
15 comments Misc. links

Ugliest site of the month - The Backyard Comedy Club It's been a while since I last ranted about some website looking not only totally unappealing but also barely usable. This time it's called The Backyard Comedy Club and it's a quite simply, a comedy club near where I live. The sad thing about this site unlike other sites that I've criticized as being butt-ugly in the past, this one is actually quite new. The footer says "Copyright Backyard Comedy Club 2007 ©".

Maybe the intention is that the whole website is a joke. Kind of to get you in the right mood for the comedy acts.

Vertically expanding textarea input boxes

September 19, 2007
0 comments JavaScript

I've recently improved the IssueTrackerProduct so that when you start to write in the little textarea it expands and grows vertically as the text gets larger and larger. Other sites like Highrise do this too for note taking.

Long story short, here's the demo and here's the solution:


function _getNoLines(element) {
  var hardlines = element.value.split('\n');
  var total = hardlines.length;
  for (var i=0, len=hardlines.length; i<len; i++) {
     total += Math.max(Math.round(hardlines[i].length / element.cols), 1) - 1;
  }
  return total;
}

$(function() {

  // First, for all the textareas that have lots of lines of text 
  // in them, we want to double their number of rows
  $('textarea.autoexpanding').each(function() {
     while (_getNoLines(this) > parseInt(this.rows))
       this.rows = '' + Math.round((parseInt(this.rows) * 1.5));
  });

  // When a user enters new lines, if they have entered more
  // lines than the textarea has rows, then double the textareas rows
  $('textarea.autoexpanding').bind('keyup', function() {
     if (_getNoLines(this) > parseInt(this.rows))
       this.rows = '' + Math.round((parseInt(this.rows) * 1.5));
  });

}

Truncated! Read the rest by clicking the link below.

Nasty human error in Zope ZEO setup

September 14, 2007
0 comments Zope

Together with my colleague Jan we today tried to fix a problem with Zope ZEO server that wouldn't start. Very strange we thought since another ZEO server on the same machine was working fine. We compared zope.conf files and found nothing obvious. Here was the error you get with 'bin/runzeo':


root@da-ovz-vm99182:/var/lib/zope-2.8.9/aragdb-zeo1# ./bin/runzeo 
Error: error opening file //var/lib/zope-2.8.9/aragdb-zeo1/etc/zeo.conf: 
[Errno ftp error] no host given

What?? ftp error??

Long story short, the error was this line in 'runzeo':


CONFIG_FILE="/${INSTANCE_HOME}/etc/zeo.conf"

which should have been this:


CONFIG_FILE="${INSTANCE_HOME}/etc/zeo.conf"

Not so easy to spot because the CONFIG_FILE line is something you rarely look closely at.

Fun Python error message

September 7, 2007
0 comments Zope

I saw this today on the Zope mailing list:


TypeError: open() takes at least 1946389116 arguments (4 given)

For anybody who's ever used Python you'll find this funny.

What art is ...according to Don Van Vliet

September 7, 2007
5 comments Art

What art is ...according to Don Van Vliet I finished a wonderful book about Don Van Vliet called "Captain Beefheart" by Mike Barnes and being a huge Beefheart fan this was a very interesting book. To be honest, I found out things about Don that I'm not sure I even wanted to know. I feel both sorry for and jealous of the musicians he worked with. The book is full of little mind bogging quotes by Don all worth a blog each but one that I did write down was this:

"[Don Van Vliet] told John Yau what painting was to him: 'Fulfilling the absence of space between the opposite meanings. I think that's essentially what I think. That came the other night. It cam blasting into my head. I quickly wrote it down. Yes, that's what painting is.'"

I've thought about it a bit too now and although I don't have to agree or disagree I think it's a very good answer.

Not just the bikini event

August 31, 2007
0 comments Misc. links

Not just the bikini event I've always considered the "personality" test even of beauty competition such as Miss World as a chance to go away and get some food or a toilet break and it's really only the bikini event that matters. It's time to revise that now maybe. Until this clip I've always thought what the beauties say just stupid, now I'm going to consider it amusing instead.

What's South Africa got to do with it?