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.

Interview with Varg Vikernes

July 1, 2008
10 comments Music

Interview with Varg Vikernes Varg Vikernes, a.k.a. Count Grishnackh is a black metal musician, convicted murderer, arsonist and political activist. He's now in prison in Norway and also famous for his one-man band Burzum. I've just read this long interview with him from 2005 and thought it was really interesting.

I adore his music. Maybe not everything but most of it. It's music that even non metal heads would like because it's quite ambient and strangely melodic. His views are very old-fashioned, chauvinistic and racist and I'm not going to defend anything he says but I have to admit that I'm drawn to some of it simply because it's an unusual and different perspective. Some of the views he has reminds me of Daoism in that the right path in life is to live contently with the earth and not greedily search for material happiness the whole time.

Read it carefully. Some of it is quite offensive. Some parts are very profound, some are rubbish and some practical ones like the section about life in prison is really intelligent. Some quotes:

On our environment:

"I think the growing disregard for the environment, culture and heritage is a natural consequence of capitalism. When people care more about profit than the world they live in that is what happens. Capitalism in the "Western" world in turn is just a natural consequence of Christianity, because Christianity created a spiritual void when it ousted Paganism, and all that is left is materialism and a religion with no meaningful contents."

On women as equals:

"The modern women can no longer cook, they no longer want children and they are no longer warm, tidy and loving creatures who think spending time with their family is a good thing. They are probably too "independent" and "strong" to even have a family of their own. The only thing modern women have to offer men today is sex. So instead of being loving housewives who cook and raise children, they are reduced to being sexual objects only - and they are so messed up emotionally and intellectually that they often spend most of the money they make on their jobs on plastic surgery, cosmetics and tons of clothes they think will make them look good, in a desperate attempt to stay or become more attractive. Well, they have no other qualities attractive to men, so what else can we expect? This is the fruit of feminism. The fruit of "women's liberation"."

On the meaning of life:

"In the past we had a crude arrow and a crude bow, but at least we had something to aim at. Today our arrow and bow is very nice, golden, expensive, high-tech and fancy, but what good is that when we just fire randomly into the air, hoping we might hit something?"

On suicide:

"The suicide is the ultimate victory over the body, because the body's natural instincts will force you to try and survive, no matter what, while the spirit and hugr (mind, "soul") always seek to return to the gods. The suicide is also very attractive because it allows me to demonstrate the will to remove the effete, and to give room for the young and healthy, even if the effete is me - and naturally at one point I will become effete too, like we all will."

WestIsEast.co.uk launched

June 26, 2008
1 comment Misc. links

WestIsEast.co.uk launched My good friend Chris West has finally launched his blog

Chris is not a designer or hacker but he's done the design himself and learnt Django to be able to code it. I haven't helped at all other than listening which has just meant that he's discovered the solution himself.

I think the site looks great and has a unique feel to it and very user-friendly. There is a really interesting blog post about olympic superstitions that you should read.

Another brownie point for Django

June 16, 2008
1 comment Django

Another brownie point for Django I've been working with Django a lot lately and while I can't contribute to the code base until my project is done, I can contribute money.

Been browsing the Django mailinglist and found this guy (link above) and some other people saying they're willing to donate money towards the OS effort that is Django. That's nuts and is a failed practice but it does mean a lot. Zope had this about 4-5 years ago too but that was then. Clearly the heat is all on Django (and Rails admittedly) at the moment. Well done to all involved!

I've been doing quite a bit of Django this weekend and this instant quick rush I got from getting started has gone off and now starts to become just normal trudging. At the moment it's the templating language that annoys the hell out of me.

In conclusion: Today Django won another point in the race for my attention.

Difference between Sweden and UK: renewable energy

June 13, 2008
1 comment Sweden

I'm a big fan of solar power. Whenever I see news about interesting industry projects or science news about better technology I get my hopes up. Soon the western world community will come to accept that oil is actually not such a good idea. It's both very expensive and very bad for the environment. Renewable energy sources of any kind is a good thing and today I learnt something that both made me happy and made me a bit sad.

Sweden (where I'm from) is the top European country of using renewable energy at 39.8% and the UK (where I live) is the bottom at the list at a mere 1.5%.

It's quite sickening what a dangerous game the UK plays and I'm disgusted that we are the worst renewable energy user in Europe. I'm not sure what to do but hopefully by keeping the issue of solar power high I add some progress to it. And raising this will perhaps get people to think a bit more about it and with time we can make our government aware that this is important to us here in the UK.

Read the article and scroll down for the list of "EU renewable league"