Loading....
Recent Article links:

Archive for February, 2004

Macho Radio

N.E.R.D., the band of Farell Williams, one of the infamous Neptunes (from what I know of it, a group of producers who somehow got famous by writing loads of mediocre RMB music), did a performance in the Melkweg last week, and if you missed it, at least I can say for use you weren’t listening to 3FM that evening.

For I think a few months now, some guy called Timur (surname unknown; he likes to call himself Timurrrr, which gets quite irritating after a while), does a daily radioshow on my former favorite radio station.

Now, Timurrr has a musical taste that is completely different from mine, which by itself isn’t a bad thing, but the trouble is that he makes absolutely no point of showing that fact. So, on the night N.E.R.D. played in the Melkweg, he mentioned the concert at least once between every song between eight and ten o’clockwith his female sidekick (which seems to be the trend nowadays) supporting him. And he even had a reporter on the scene of the crime, with whom he had one of the stupidest pieces of non-reporting I’ve ever heard. It went something like:

– So, you’re at the Melkweg now. I guess the party has already begin?
– Yeah, definitely. Everybody is waiting very anxiously.
– And what about the people there. Surely, they’re all very hip people.
– Yes, everybody I see around my has very hip clothing, and everybody is having a great time. [note that at this point, the actual performance had not begun yet]
– So, you would say that all the hip people of the Netherlands are down there?
– Well, yes, there are very many hip people here

And he finished the interview saying something like “Oh man, that’s a really cool party over there”. Reminded me of nothing so much as this Simpsons episode:

Zookeeper: Boy, that Stone Phillips sounds like quite a bloke. What television network is he on?
Bart: Why, NBC, of course.
Lisa: NBC has lots of great shows, and their news and sports coverage can’t be beat.
Wiggum: Do you think there’s anything great on NBC right now?
Homer: Oh, I’m sure of it.
Marge: But there’s only one way to find out.
[cut to the closing credits]

While his first ten mentionings of N.E.R.D. merely raised a “yeah, whatever”-reaction, that interview really made me wanna scream “Please shut the fuck up, you overpaid pathetic semi-macho!” (I’m sorry, my English swearing isn’t that good). Either he was paid for each time he said “hip”, or he just sucks all by himself.

When finally it was 10 o’clock and Timurrr’s program came to an end, he even succeeded in getting N.E.R.D. in his closing sentence by saying “That’s it. I’m going to N.E.R.D.”, thus solving the difficult “everybody hip is at N.E.R.D., yet I’m only whining about it on the radio”-paradox.

The real problem nowadays though is that these semi-macho, semi-hip DJ’s have been getting more and more predominant over the last few years. It was Jeroen van Inkel who succeeded in finally driving me away from Radio 538, and now it seems Timurrr is driving me away from 3FM now. Should get myself a cable radio connection so I can finally listen to Kink FM.

Static Blogging with Blosxom, or “Look what I did!”

I’ve had almost two months’ experience with the Blosxom blogging tool, and this document is meant to describe some of the things I did to tailor Blosxom to my situation, and I hope this might come in useful for others.

The thing is, my situation is this: I have some web space at my provider, but my provider doesn’t support CGI scripts or PHP — and to run a weblog, you’d normally need to have one of these, because the content of virtually all weblogs is dynamically generated. Now, rather than looking for some better place to host my pages as I probably should have done, I decided it should be possible to have a static weblog, that is, a weblog that is generated on my local PC, and then uploaded to my provider.

There are actually some weblogs, including Movable Type, with which you can actually pretty much do this: Movable Type does actually generate static a version of your weblog you could just upload to your provider. Trouble there though is that you’d still need to run a local web server to post articles, which is not really a desirable situation.

After some looking, I found Blosxom though, which has a static mode with which you can generate your web pages. This works pretty well, so I can really recommend it. But, if you want to have a perfect setup, there are some issues you should know about which I’m about to describe (alternatively, when Free2Go starts accepting new subscriptions for their free service again, that might be a good idea for you).

Warning: The following text requires some general knowledge about HTML and programming, and it definitely isn’t for the faint-of-heart. You have been warned! You can always e-mail for questions though.

Static rendering and plug-ins

Though Blosxom itself supports static rendering pretty well, the same cannot be said for all of its plugins. I had to hack my way through some plug-ins to make them work correctly with static rendering, particularly the breadcrumbs and calendar plugins. Mostly my changed versions are just ugly hacks, but they do work fine for me. You can download my modified plugins here: breadcrumbs and calendar.

Relative URLs

After a while, I got pretty bored at having to type the complete URL to my homepage in my articles, so I wrote a plugin for blosxom to automagically replace $url by the base URL of the Blosxom website. This will only worked with my modified blosxom.cgi; read on for more information or use $aurl instead and uncomment the line mentioning $blosxom::url in the plugin.

Another issue is that I wanted to be able to browse my website locally (e.g. for CSS testing). The fact that Blosxom uses absolute URLs for everything makes this pretty much impossible, so I hacked a bit into blosxom modified blosxom.cgi) to make it use relative URLs rather than absolute ones for static rendering. Quite an ugly hack this is, but it does seem to work rather well. I also made some changes to some plugins to make them append the ‘/index.html’ to their links so that local browsing works well. I’ll readily admit you probably won’t need it, but I think it’s a nice hack anyway.

FTP dates

If, like me, you don’t have a decent file transfer protocol to publish your files (e.g. rsync), only FTP, you might run into the problem that while Blosxom uses the file modification date to decide when a weblog entry is posted, this date is not preserved when uploading files to FTP. This can become a problem if you maintain your weblog on multiple PCs, like I do, and you move files around, or edit them and you don’t want that to change your original posting date. I came up with a solution that’s definitely not pretty.

The idea is that when uploading, a file is uploaded containing the right timestamps, and when downloading, the timestamps file is downloaded and the right timestamps are restored. For downloading, I use fmirror, a standard Unix tool, and for uploading, I use Weex. Here’s my ~/.fmirror-wanadoo:

file_and_mask: 777
file_or_mask: 777
localdir: .
username: meilof
password: uhm... i'd rather not tell you
remotedir: /
host: home.wanadoo.nl

My ~/.weexrc looks like:

[default]
(...)

[Wanadoo]
HostName = home.wanadoo.nl
LoginName = meilof
Password = tsja...
SrcDir = /home/meilof/wanadoo
DestDir = /

Now, I use the following script, get.sh, to download my website:

#!/bin/sh
fmirror -f ~/.fmirror-wanadoo
rm ~/.weex/weex.cache.Wanadoo
cd blog
gunzip timestamps.gz
perl ../tsrestore.pl

And the following to upload:

#!/bin/sh
blog/blosxom.cgi -password=blog
cd blog
rm timestamps.gz
perl ../tssave.pl
gzip timestamps
cd ..
weex wanadoo

The perl scripts referenced to are here and here. This solution seems to work reasonably well, though it has the drawback that due to the timestamping, when you download or upload, more files will be downloaded/uploaded than nessecary. Because my weblog isn’t that large, that’s no big deal, but it will probably become more important later. The solution would be to restore the timestamps to the FTP timestamps right before downloading/uploading, which can be done fairly easily.

Conclusion

As you can see, my website backend is an ugly hacked-together mess, so if you can alltogether avoid publishing your weblog using FTP to some static place, I’d advide you to avoid it :)

‘Environmental and social performance reports are bullshit’

In the “something everybody knows but which is nice to see confirmed anyway”-section, I read an interview (local copy) in De Volkskrant this morning about environmental and social performance reports. In Dutch, we call this “maatschappelijk verantwoord ondernemen” or MVO, a term which really has no good English equivalent that I know of.

Anyway, the article basically states that these performance reports are all a bunch of bullshit, according to Chris Hibbit, who graduated from the Vrije Universiteit of Amsterdam on a paper about these reports. His conclusion:

The reports contain the good news only, and ignore bad news about environmental and social circumstances.

Only one percent of all reports actually contained bad news. Now, MVO has been a big issue over the last few years in Holland (actually, MVO was the topic for my high school exams writing assignment), and I have always though this was just a bunch of crap used to sell stuff. People supporting MVO claim that consumers can improve the environment and social circumstances by looking at the company’s environmental and social profile, but obviously the conclusion of this investigation is that this is actually not the case.

Favorite quotes, that just about summarize it:

If you want to stop pollution, you should tackle the causes rather than the symptoms. In that case, you’ll need throw away the capitalistic system.

Stop these projects. They’re useless. (…) I don’t blame managers fo seeking higher profits. It’s the consequence of the system.

Quite a clear case for stronger government regulation, which is something I am deaply in favour of as well. Self-regulation? Yeah, right.

The Unix clipboard in GTK 1.2

One of the things that has been on my TODO-list for some time is the ability to copy answers from Dnsquery to the clipboard.

Unfortunately, using the clipboard in GTK 1.2 is a bit of a cumbersome process. GTK 2.0 has a nice API with which you can directly edit the clipboard (or so it seems, I didn’t try it), but this doesn’t go for GTK 1.2.

The GTK 1.2 tutorial does describe selections, but it is only about the PRIMARY selection, not about the CLIPBOARD (for more information, refer to this article by jwz), and Google does not tend to give much information, either. So, after a bit of fiddling, I got it to work, thanks to the source code to the excellent Scintilla text-editing component, from which I got some of the code.

Anyway, for people who have the same problem, my code basically does this:

You need to associate the selection to a widget which receives clipboard-related signals. This snippet in my main does that:

  /* set up copy/paste */
  gtk_selection_add_target (lookup_widget(frmMain, "lstAnswer"),
                            gdk_atom_intern("CLIPBOARD", FALSE),
                            GDK_SELECTION_TYPE_STRING,
                            1);

Then, if the user wants to copy something to the clipboard, we can use the following code to let X-Windows know we have some data to copy:

void
on_mnuOptionsClipboard_activate        (GtkMenuItem     *menuitem,
                                        gpointer         user_data)
{
  gtk_selection_owner_set (lookup_widget(frmMain, "lstAnswer"),
                           gdk_atom_intern("CLIPBOARD", FALSE),
                           GDK_CURRENT_TIME);
}

And for the widget owning the clipboard focus, we need to handle the selection_get event to make it return the clipboard data:

void
on_lstAnswer_selection_get             (GtkWidget       *widget,
                                        GtkSelectionData *data,
                                        guint            info,
                                        guint            time,
                                        gpointer         user_data)
{
  const char *str = "Hello, World!";

  gtk_selection_data_set (data, GDK_SELECTION_TYPE_STRING,
                          8, (const unsigned char*)str, strlen(str));
}

Looking at it like this it is actually pretty simple, it's just that it isn't documented well.

Update: I have just tested it, and it seems to work under Windows as well without any changes. I remember testing it first without success, but at least the current Dnsquery code works.

Enlightenment

It just occured to me why I keep losing the dates of my weblog posts (see here): whenever I made a copy of my wanadoo directory, the new copy had the creation date set on the moment of copying rather than the actual creation date. Seems a bit of a strange behaviour to me. Just spent another half an hour touch -t‘ing my files back to the right date :( but now at least I know what’s going on.

It keeps getting better and better

Tweaking your weblog is fun!

Today, I added a category view for the weblog entries. As you can see on the left, there are a few categories to choose from. Each category even has its odnw RSS feed, so if you’re only interested in my programming projects, just subscribe to the projects RSS feed :)

One really fun thing is the Blosxom plugin repository. Lots of great things there. Got the calendar from it, for one.

Though Blosxom does make templates thing pretty easy to modify, you do notice it isn’t optimized for static content. If I want to make site-wide changes that are applied to all pages, I can run Blosxom to generate everything, but then the calendar in the January pages becomes a february calendar, which isn’t really what you’d want… For now if I want to re-generate I switch the calendar back to January 31, generate the January content, and then switch it back for the February content… And when entering the content, I have to type in the base URL of my page every time I want to insert an image or something….

Anyway, maybe rather than fuzzing I should just fix it; after all, I do have the source code here so I could hack on it. Nah… don’t feel like it now…

Did I mention that static blogging sucks?

Just found out I lost all modification dates of the blogging entries I wrote. Because Blosxom uses these dates to find out on what date a message was posted, this meant all of my posts showed up today. So, I spent the last half an hour restoring them from an older generated version I had lying around… Not sweet.

Note to self: always check modification dates before upload!

I like tools

… especially creating them.

For the LAN party I organized with some other people last week, I wrote a small launcher tool, so I figure I’d submit it here.

The issue was that we pre-install games on a large number of PC’s, but not all PC’s have all games installed. But because all PCs are logged in under the same account name, if you create a desktop shortcut somewhere, it will be shown everywhere. So this launcher tool will try and detect what games are installed, and display them in a small menu.

A screenshot can be found here. And yes, the colors _can_ be changed :)

So, the package, with EXE and C++ Builder 5 source code, can be found here. You’ll need the BCB DLL’s, which can be retrieved here.

Your votes please

After I had a bit of a political discussion with my father today, I said I would vote for GroenLinks, a green, left-wing party for the next elections. My father noted he was a bit surprised, because he said he’d heard me utter some right-wing opinions lately (not that he had any examples)…

So, of course, I had to check, so I did the Stemwijzer. My results are here. My preference list seems to be pretty much a left-wing to right-wing list of the Dutch political parties (with the left wing parties on top obviously). This did surprise me a bit, because I felt I had filled in quite some non-left-wing opinions… Makes you wonder what morons get a right-wing preference out of it…

A book to read

Because I had nothing to do while cooking, I fetched an old newspaper to read and I happened to stumble across an article about a subject I am very interested in: meritocracy (”Verdienen zonder verdienste”, de Volkskrant, 13 September 2003). Basically the article is about whether meritocracy is a good thing.

Now, I have though about this a few times, and I think I find a meritocracy a bad thing because even if you give people the same opportunities, still there are factors such as their intelligence you simply cannot change, so you can never have real equality.

Anyway, it was quite fun to read an article by an author who has much the same opinion as me… He also mentioned the book ” the Rise of the Meritocracy, which is a satirical novel about this subject. So, when I finish the Lord of the Rings, this should be one of the next books I’m going to read (if I feel like paying $25 for it, that is…). It was fun to read an article