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.

Pandora Update

November 14, 2005
0 comments Music

I really do enjoy my Pandora internet radio station and it greatly pleases me to hear about the Pandora Version 2 which they emailed me about just a few days ago.

"As one of our most treasured early listeners, we want to make sure this transition works for you?-recognizing that you subscribed at a time when subscription was the only option. To that end, we've automatically given you a complimentary upgrade of your current quarterly subscription to an annual subscription-9 additional months at no cost to you."

Cool. Not only are they upgrading my subscription, they're also vastly improving the whole service:

"As you read this, we are releasing Pandora Version 2. In addition to many new features including bookmarking, station editing, playlist improvements and much fine-tuning, the new service will now include a free, ad-supported version. Listeners have the choice to subscribe and stay clear of ads, or use the free service which will gradually incorporate advertising."

What can I say? Use Pandora!!

MyMcDiet.com Kevin O'Connor's fast food diet

November 12, 2005
15 comments Misc. links

Kevin O'Connor's MyMcDiet.com "WOW!! 107 Days and I have lost 46.2 Pounds! Eating ONLY McDonalds!!!"

Here's a guy with some real self distance: Kevin O'Connor of MyMcDiet.com

"Super Size me was the wrong message! It's you, not them, that is responsible. Great idea Morgan, tell a fat guy it is not their fault. How about telling them to get off their fat butts and do something before they hurt themselves. You don't have to stop eating at McDonald's or anything else you like, you just have to match it with the appropriate amount of exercise! Watch me."

This is so cool. Kevin has set out to prove the Super Size Me film wrong. It's not about MacDonald's and it's evil corporate ideals. It's about the individual and her decision. Kevin understands that you remain/become a "big fat guy" from unhealthy food; but he also points out that unhealthy food exists elsewhere too.

"Yes I have elected not to buy McDonald's on occasion and went to the grocery store, just to find myself buying doughnuts and bearclaws! What would have been better for me, the bagel, egg and cheese with orange juice or 3 big fat doughnuts that made me crave more sugar all day. Get real people. Take AIM, at ourselves. Stand up for yourself."

Truncated! Read the rest by clicking the link below.

"Clever" date formatting accessibility

November 10, 2005
14 comments Python, Zope

Last night I wrote a little function that tries to show dates cleverly by comparing the date with todays date, it formats the date differently.

If the date is today is just says "Today 10:00" and for yesterday it says "Yesterday 10:00". If it's within a week it shows is like this "Thursday 10:00". If the date is older than about 30 days it skips the time part and just shows "13-May 2005" and if anything else (ie. > 7 and < 30 days) it shows the whole thing like this "13-Oct 2005 10:00".

What do you think about this? ...from a usability/accessability point of view. One counter argument I have against this is that if you print off a page where it says "Today 12:22" and leave that printed paper for a few days, what "Today" means will change.

To demonstrate it, I've put together a little demo page so that you can get a feel for how it works. Please let me know what you think.