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"

Damn lies and benchmark comparing Apache and Nginx

June 3, 2008
7 comments Linux

Today I moved a bunch of sites over from Apache to Nginx but still keeping Squid in between as a http accelerator (I hope to replace Squid with Varnish soon). I did a quick benchmark of a HTML page that is cached by Squid, 4 times via Apache and 4 times via Nginx. The results:


Apache2
********
Requests per second:    1601.34 [#/sec] (mean)
Time per request:       6.268 [ms] (mean)
Time per request:       0.627 [ms] (mean, across all concurrent requests)
Transfer rate:          13020.50 [Kbytes/sec] received

Nginx
********
Requests per second:    1810.02 [#/sec] (mean)
Time per request:       5.6435 [ms] (mean)
Time per request:       0.5645 [ms] (mean, across all concurrent requests)
Transfer rate:          14591.35 [Kbytes/sec] received

That's "only" 13% faster and I had hoped for a bigger difference but the test is very simple and depends on how Squid feels. The other important test would be to see how much less CPU and memory Nginx uses during the stresstest period but that's for another day.

One note: This is Nginx 0.4.3 on Debian Etch. The current stable release is Nginx 0.6.13. I'll need to talk to my sys admins to remedy this. Perhaps it makes a difference on the benchmark, I don't know.

zope-memory-readings - Tracking Zope2's memory usage by URL

May 30, 2008
0 comments Zope

zope-memory-readings - Tracking Zope2's memory usage by URL I've just released a new little project in Python for tracking memory usage in Zope2 applications with the added benefit that you can hopefully see what URL causes which memory usage "jumps". Hopefully this can help Zope2 developers find out what causes RAM bloat but can also help in helping you optimize your application by early in the development process find out what uses too much RAM. I wouldn't be surprised that there is already a program that does something like this. I've just never seen one. Also by putting this out as an Open Source project and blogging about it hopefully more clever people than me will come forward and point out the right way to do things.

I've also used Google Code this time to manage the project. I've used it before but only for hosting a public SVN for the IssueTrackerProduct SVN. I have to say that I was quite impressed with Google Code this second time. I think it's still fundamentally wrong to confuse people with by offering both download and SVN checkout. I did both this time but I think I might give up on the downloads because who out there, who understands that he/she needs to debug RAM usage, doesn't know how to use SVN?

Finally a little disclaimer: By writing about this here, preparing it on Google Code and writing a README.txt file I've now spent more time "managing" the project than I have on coding it. It's an early test release which hopefully will stir up some ideas for genuine important improvements. I had fun coding it as well since this is my first attempt with Flot which has been great to work with. You get very quick and powerful results. Lastly, I haven't tested this in anything but 32-bit Ubuntu Linux and Firefox.

Here is a sample report: 2008-05-30_16.47.32__3.8_minutes

split_search() - A Python functional for advanced search applications

May 15, 2008
0 comments Python

Inspired by Google's way of working I today put together a little script in Python for splitting a search. The idea is that you can search by entering certain keywords followed by a colon like this:


Free Text name:Peter age: 28

And this will be converted into two parts:


'Free Text'
{'name': 'Peter', 'age':'28}

You can configure which keywords should be recognized and to make things simple, you can basically set this to be the columns you have to do advanced search on in your application. For example (from_date,to_date)

Feel free to download and use it as much as you like. You might not agree completely with it's purpose and design so you're allowed to change it as you please.

Here's how to use it:


$ wget https://www.peterbe.com/plog/split_search/split_search.py
$ python
>>> from split_search import split_search
>>> free_text, parameters = split_search('Foo key1:bar', ('key1',))
>>> free_text
'Foo'
>>> parameters
{'key1': 'bar'}

UPDATE

Version 1.3 fixes a bug when all you've entered is one of the keywords.

The importance of the TITLE attribute

April 23, 2008
2 comments Web development

Let's go back to basics of HTML development.

All A tags whose content isn't a text string should have a TITLE attribute

If your link is plain like this, adding a TITLE attribute is less über important but gives you a chance to help your poor user even more:


<a href="settings.html" 
   title="Change settings, language and preferred colour">Settings</a>

Where it really matters is when you use an icon instead of system text to link to describe something. Having an ALT attribute on the image isn't always good enough. Some browsers will not show the ALT attribute tooltip when you roll over an image that is wrapped in an A attribute. Here's how you should do it:


<a href="settings.html"
   title="Change settings, language and preferred colour">
   <img src="wrench.gif" alt="Wrench" border="0" />
</a>

Sure you should use the ALT attribute. In this above example, in Firefox, what happens when you roll over the icon is that the TITLE attribute's content is shown in the tooltip. What we have to do then is to copy the TITLE attribute to the ALT attribute so it looks like this:


<a href="settings.html"
   title="Change settings, language and preferred colour">
   <img src="wrench.gif" border="0"
        alt="Change settings, language and preferred colour" />
</a>

Now you get the best user experience in both Firefox and IE. Your users can roll the mouse over the icon and be guided by a tooltip if they're uncertain what clicking the link means. Why does this matter? You probably, as me, have been on tonnes of sites with mysterious icons you can click and you have no idea what they do. Sometimes they have tooltips, sometimes just a tooltip like "email" or something equally cryptic. There's been times when I hesitate to click but instead try to guess what the click means by looking at the URL it will go to. If it looks like something like this .../change_password?user_id=1234 that gives a way a lot. Other times, I've actually inspected what the name of the icon file is to understand what it actually does (you can do this in Firefox by right-clicking and select Copy Image Location).

Why does this matter? The ultimate gospel in web usability (if you belong to the Steve Krug school) is: Don't make me think! It's painful to not only have to waste seconds on guesswork and forensic analysis but it's also a really bad user experience since you'll force your users to plunge into a click they're not entirely certain about.

Whilst I'm at it, this appeared in front of my eyes today on a hotel booking site. None of them were links but just icons with no ALT attribute. Can you guess them all?

Hotel booking icons

I've put together a little demo.html page so you can see for yourself what happens when you roll your mouse over these and what happens.

What I like and dislike about Grok

April 11, 2008
2 comments Zope

Martijn Faasen is my hero. Not only is an absolutely brilliant coder he's also able talk so that mortals understand.

This is why I like Grok

What he's replying about is mainly the question "What does Grok give me that, say, django does not?"

And, this is why I dislike Grok

Yes, you clever people. It's the same link. For some reason all the great documentation goes into replies on the mailing list rather than into a concise web page with cookbook, book and styled and funny tutorials. Why is that? They've actually made it quite easy now to enter documentation on grok.zope.org with the new Plone site.

An equally important question is: Why don't I do something about it rather than to complain? Well, I've written one how-to at least. My other "excuse" is that I'm not yet an expert enough and hence writing good documentation takes a very long time.

I think there's an important philosophical and political issue at hand. The Grok community is filled with really clever people who are very senior in the web development industry who like using mailing lists and perhaps more importantly, don't need documentation since they can study source code and unit tests to answer their questions. I know this is a sensitive statement but I'll take my chances since it implies that these guys are smarter (or perhaps just more time on their hands).

My internal battle of which new web framework to put my energy into continues. Today (thanks to Martijn's post) Grok earned one more point.

Mixing in new-style classes in Zope 2.7

April 9, 2008
0 comments Zope

Don't ask why I'm developing products for Zope 2.7 but I had to and I should have been more careful with these oldtimers.

I kept getting this error:


TypeError:  expected 2 arguments, got 1

(notice the strange double space after the : colon) This is different from the standard python TypeError when you get the parameters wrong which looks like this TypeError: __init__() takes exactly 2 arguments (1 given).

The line it complained this happened looked like this:


class MyTool(SimpleItem, UniqueObject, OtherClass):
   id = 'some_tool'
   meta_type = 'some meta type'
   def __init__(self, id='some_tool'):
       self.id = id  # <--- THIS WAS THE CULPRIT LINE APPARENTLY!!

I couldn't understand what the hell was wrong on that line! Clearly it wasn't a normal Python error. Here's the explaination: That OtherClass was a new-style class inheriting from object. It looked like this:


class OtherClass(object):
   ...

When I changed that to:


class OtherClass:
   ...

The whole thing started to work. Long lesson learnt, don't use new-style classes mixed in into Zope 2.7.