"Groups" search on Google

November 30, 2005
0 comments Politics

When I can't remember the URL site I just search for it quickly in Firefox which is quicker than trying to remember the address. Today I needed to go to "Google Groups"n:http://groups.google.com/ but couldn't remember the address, so I searched for it on Google

Guess which site came up first?! Not Google, but their main competitor Yahoo! I guess this just gives Google more kudos because their indexes aren't tainted in their favour.

CSS code of del.icio.us

November 29, 2005
1 comment Web development

I love del.icio.us and use it on a daily basis. Today I had a quick look at the source code (HTML source) of the posting page and found a very funny style tag:


<div style="clear:both; height:1px; 
font-size:0; line-height:0; ie-sucks:yes"></div>

This is only funny if you're a web developer. Keep up the good work del.icio.us people!

Yahoo! Inbound Links API

November 27, 2005
0 comments Python

Had a quick play with Yahoo!'s Inbound Links API today. You use their web services API to check which other URLs a URL is linked to from. This can come in handy if you want to know which other sites make a link to your article. Googleblog is using this (obviously not by using the Yahoo! API); look at this blog post for example and scroll to the end of the text.

The inspiration came from Fredrik Lundh's term extraction example that I'm actually now use in a production site. So I basically took Fredriks code and modified it for Inbound Links.

Truncated! Read the rest by clicking the link below.

The Search Engine Experiment

November 25, 2005
0 comments Misc. links

This is interesting, Webmasterbrain which is a SEO company has created a little experiment app. You search for something and it shows the first 3 results from the three major search engines google, yahoo and msn. You don't know which search engine gave which 3 results but for each 3 results you select which set was "Most relevant". When you've done that you see which search engine found those results.

I tried it a for a couple of search terms and apparently I chose the google results all times except one. I guess that means that my findings coincide with their results

Islington Knuckle Walk

November 24, 2005
1 comment Kung Fu

My kung fu club is this week going to do a major charity event in Islington (north east central London). We start at 14.00 very near Angel tube station this Saturday the 26th. Our aim is to walk like lizards on our bare knuckles from Angel tube station to Highbury corner. In other words, we're going to do the whole Upper Street in relay which is about 1 mile (1,600 metres).

Claremont Project The charity that we're supporting is called the Claremont Project which is a centre for old people in Islington where they can participate in activities such as dancing, drawing and t'ai chi. Since this year, the local government has drastically reduced the budget for places like the Claremont Project. The reason our club (led by David Courtney Jones

) do this particular charity is that we know them well because we train at the Claremont Project building in the evening on White Lion street. (more about that here)

Truncated! Read the rest by clicking the link below.

Mvbackupfiles - a script to "delete" back autosaved backup files

November 24, 2005
1 comment Linux

Last month I complained about how brutal the rm program in Linux was and how I cocked things up when I wanted to remove the autosaved backup files that jed creates. Here's the solution...

I created a script in ~/bin/Mvbackupfiles that looks like this:


#!/bin/sh
mv -v *~ /tmp

Now, whenever I want to clear a directory of all files like dummy.py~ or README.txt~, I just run Mvbackupfiles and I become a much happier and tidier person.

Truncated! Read the rest by clicking the link below.

createElement('a') with a javascript href

November 21, 2005
22 comments Web development

In Javascript, have you ever needed to create a hyperlink element like this?:


div = document.getElementById('foo');
newlink = document.createElement('a');
div.appendChild(newlink);

That snippet doesn't do much. It just creates a hyperlink element with no href, class, title or content. Let's make it a bit more useful:


newlink = document.createElement('a');
newlink.setAttribute('class', 'signature');
newlink.setAttribute('href', 'showSignature(xyz)');

The problem with this code is that the href becomes a link to a page called showSignature(xyz) and not a javascript function call to the function showSignature() with parameter xyz.

Truncated! Read the rest by clicking the link below.

Major performance fix on file searches

November 19, 2005
0 comments Zope, IssueTrackerProduct

A week ago I ran some ad hoc benchmarks on various suspect functions in the IssueTrackerProduct and came to a clear and simple conclusion: searching is the bottleneck and within the search it's the searching for file attachments that take all of the time.

If you're interested and open minded, here's the results of that benchmark This sparked some thoughts. First I wrote a filename splitter which isn't rocket science but I'm proud to say that it's use is brilliant. Before, the find-by-file function in the IssueTrackerProduct used a plain old find() test like this:


filename.find('foo') > -1

This is very fast but not very intelligent. For example it'll with match on foobar.txt and plainfooter.gif. So, what I did instead was to create a KeywordIndex and index all the splitted filenames in that index.

Truncated! Read the rest by clicking the link below.

Old School Kung Fu

November 16, 2005
0 comments Kung Fu

My dear Kung Fu sister Pen Rance has now published a lovely little article on the FWC Inter-Club Competition, Dulwich (August 2005)

It's complete yet short (so you can afford the time to read it) and funny too. I like the fact she didn't forget about the dodgeball incident:

"The action was rounded off by a giant game of dodgeball, in which the students took on the instructors," ... "Shot of the game has to go to Instructor Adam Prout, who managed to silence the hall with a direct hit on Chief Instructor Ngo’s ear."

Last but not least my name was mentioned too which I'm not going to quote so you'll have to find it yourself.

Filename splitter

November 15, 2005
4 comments Python, Zope

I need to create a Zope index for a ZCatalog that is KeywordIndex. A KeywordIndex is a list (array if you like) that is used to describe some data. For example, if the data is "Peter is a Swedish Londoner", the the keywords are ("peter", "swedish", "londoner"). What about if the data you want to create an index of is a filename like "NameLog.txt" or "holiday-00412-juli-05.jpg". I've now quickly written a little something that seems to do a decent job. It splits the filenames (these are filenames only and no paths) by caMel structure, dot (.), underscore (_), dash (-) and digits.

If you want to play with my little script, have a look at filenamesplitter.py If you open that script you'll see that it tests a whole bunch of filenames (taken from the Demo issuetracker) and if you want to see what this the result is, here it is:

Truncated! Read the rest by clicking the link below.