Why we like Obama, short answer: his speeches

September 11, 2008
1 comment Politics

Watch this speech and listen. It's impressive. As long as I can remember I've always thought the US elections being phoney and very much about the guy (until this year I guess) and his charm, looks and presentation. Unlike politics here in Europe (I've only lived in three European countries) it has always seemed that election campaigns over here are more about the issues and the politicians trying to sell their side of the issues. Until now. This Obama guy does make a difference. He talks about concrete issues, how to solve them, how important they are and actually gives evidence of understanding why they are important. And last but not least, he ridicules the press and the whole election itself for not being about the issues. Quite refreshing.

Please take the time and watch the 6 minute speech.

Sadly the McCain supporters are not going to reach my blog post and watch the video. But if there are, against all odds, any McCain supporters here, what do you think about this speech? Please let me know what you think.

Accessible UK Train Timetable

September 3, 2008
1 comment Misc. links

Accessible UK Train Timetable Booking and finding timetables for trains here in the UK sucks. The worst, for me, is when you don't know which London station certain destinations start from. For example, if you're going to take the train to Aberdeen, do those starts start from Victoria, Kings Cross, St Pancras, Paddington, Euston, Liverpool street or London Bridge? Sometimes you even have to know which train company to use!

Accessible UK Train Timetable seems like a great website to remedy this. You can enter a search for something like "London" to "Aberdeen" and it magically works out that Kings Cross is the London station you have to tube yourself to. They've also got this great map which I haven't fully understood yet but seems work. The URLs when you do a search become really friendly too. For example:


http://traintimes.org.uk/london/aberdeen/10:00/2008-09-03

...when I've done a search for London to Aberdeen today. And if you want a timetable that isn't for a particular day just change the URL to this:


http://traintimes.org.uk/london/aberdeen/10:00/

One last thing. Several months ago I found another website for booking trains and finding timetables. It had a blue background I think and was almost equally user-friendly. Only problem is that I can't find it again or remember what it was called. But I think I'll stick with traintimes.org.uk for now.

Kalle Kappner - Opeth and Pain of Salvation piano tribute

August 19, 2008
0 comments Music

Kalle Kappner - Opeth and Pain of Salvation piano tribute If you, like me, like Opeth and Pain of Salvation and you like the piano, then do check out Kalle Kappner and his free mp3s on this website. It's beautiful stuff if you, like me, like metal.

I discovered one of his Opeth compositions on Last.fm and tried to buy it from iTunes and Amazon but nothing could be found. I then searched the torrents but nothing there either. Then imagine how happy I became when I found that he's giving them all away on his website.

Anti-McCain propaganda videos

August 12, 2008
3 comments Politics

This is propaganda against senator John McCain and a lot of the snippets of what he says is out of context making it borderline unfair. I'm not American and I can't vote in this 2008 election but if I could I would certainly not vote for McBush.

There are a lot of Youtube videos making fun of McCains incompetency, lies and gaffs. Some are just plain funny and some are quite refreshing but we have to, bear in mind that this is nothing but propaganda and should we really endorse this kind of stuff? Well, I'm genuinely afraid that if America continues to let corporations rule the world and allow politicians use their might to kill people and the planet then maybe a little propaganda to get the message out might be OK. Or, is the reason we support progressive candidates like Ron Paul and Barak Obama that we reject lies and propaganda.

The question is, with this much at stake should we play by the rules?

That should last a couple of weeks

August 7, 2008
0 comments

That should last a couple of weeks I've got a tonne of excuses why I haven't done this for such a long time but none of the excuses are any good. Yesterday afternoon I did a shop on Ocado for £96 which almost only consisted of meat, muesli, porridge oats, orange juice and milk. The juice and milk are longlife so I can store it in room temperature and just shift one at a time into the fridge so it's fine. Although I hate eating the same stuff too many times I do eat porridge every morning and after a years worth of research into all possible brands I've finally decided that Dorset Cereals fruity porridge is the best, so I bought 6 packs.

Ocado rocks! I've said this before but I'm saying it again. You should try it too next time you do a big shop.

Python new-style classes and the super() function

July 12, 2008
5 comments Python

I've never really understood the impact of new-style Python classes and what it means to your syntax until now. With new-style classes you can use the super() builtin, otherwise you can't. This works for new-style classes:


class Farm(object):
   def __init__(self): pass

class Barn(Farm):
   def __init__(self):
       super(Barn, self).__init__()

If you want to do the same for old-style classes you simply can't use super() so you'll have to do this:


class Farm:
   def __init__(self): pass

class Barn(Farm):
   def __init__(self):
       Farm.__init__(self)

Strange that I've never realised this before. The reason I did now was that I had to back-port some code into Zope 2.7 which doesn't support setting security on new-style classes.

Now I need to do some reading on new-style classes because clearly I haven't understood it all.

Use Javascript to prevent spambots

July 9, 2008
3 comments Web development

Does anybody know roughly how many of the spambots out there that support Javascript?

We've all heard of honeypots and things like that that try to catch out spambots because they render the forms they pre-fill differently. The ideal solution is extremely convenient for non-spambots (you and me) and extremely effective in keeping out the spambots (porn and viagra sellers). With a bit of Javascript you could for example do the captcha technique for the user on the assumption that spambots don't render Javascript. And for the few poor suckers who don't have Javascript but are human (e.g. lynx users, blind people, paranoids) they'll just have to complete the captcha. For example, suppose you have a captcha quiz that says : "Capital of United Kingdom: Rome, _ London, Paris" and then an AJAX request fetches the correct answer from the server, fills it in and hides the whole captcha.

The big question is: How many of the spambots out there support Javascript? I guess the best experiment would be to write a tempting form for spambots and in it you let Javascript enter some value on submission.

If it turns out that spambots do render Javascript, one could perhaps combine server side cookies with it such that the first time you complete the form you have to prove that you're human the hard way and on all consecutive entries a Javascript does it for you.

Why I like this idea is that you can write your server-side code as if Javascript didn't exist and then softly add the sugar that Javascript can be an be 100% unintrusive.

Obviously a technique like this wouldn't work on a mainstream site like *.blogspot.com or ebay.com but for the 90% of all sites out there that aren't mainstream it could work.

The importance of checking in Firefox

July 7, 2008
4 comments Web development

The importance of checking in Firefox I can appreciate that sometimes some browsers just don't work very well with the latest Flash animations but then you make a backup HTML version which should have some information or at least one of those annoying messages that says "Sorry, please upgrade to Internet Explorer 4.5 to play this intro". What I don't appreciate is when web developers can't even get anything to work at all in Firefox.

On my site, 44% of my visitors are Firefox users but it's slightly skewed because it's quite a techy site. In general, out there on the internet a rough guess is about 15-30% are Firefox. Out of them I don't know how many are Firefox 3 on OS X but I'm sure it amounts to a large number. This is basically what Stride - The Ridiculously Long Lasting Gum is missing out on. D'oh!

When I try to view their site I just get a big fat grey screen with nothing. I'm sure they've spent many tens of thousands of US dollars or more on this web team and yet they get the very basics wrong. Why??

A great thing about Squid: Calamaris

July 4, 2008
0 comments Linux

A great thing about Squid: Calamaris I'm talking about Squid the web proxy cache server and Calamaris the Squid log file analyzer not food. Calamaris was a breeze to set up and now it emails me once a month a report summary of what Squid has done for my site each month. It's brilliant because it includes a piece of information that both really easy to understand and really useful no matter how technical you are:


Proxy statistics                                                                
-------------------------------------------------------------------- 
Average speed increase:                                     %  44.57 

Nota bena: I've had to work on this. It used to be a lot lower before but I've worked on setting no-refresh on selected few resources and I've tweaked the Cache-Control headers here and there.

What people sometimes forget about Squid is that it can actually slow down your site too. On an individual object that you test with ab you can go from 50 requests/sec to 2000 requests/sec but for large sites with many many objects Squid has to do a lot of thinking to work out what to cache, not to cache, put in RAM, etc. Just installing Squid is not necessarily good enough. You have to massage and caress it till it starts to work for you. And to get to that Calamaris really helps.