This is the blog of Gerd Riesselmann, a freelance software developer from Cologne, Germany. This site contains articles about software development and user interface design in general and object oriented programming in special, covering a set of programming languages from C++ and C# to PHP and Javascript. Additionally, you'll find code snippets and modules for Drupal, the open source content management system powering this site.
When Internet Explorer displays a white page...
.. this may be because of a wrong script tag. Actually, both Internet Explorer 6 and 7 will fail, if you use the script tag like this:
<script type="text/javascript" src="blabla.js" />IE instead requires an explicit closing tag, like this:
<script type="text/javascript" src="blabla.js"></script>PS: This is primary a note to myself, since I get trapped by this over and over again...
PHP: Beware of Variables Inside Strings
One of the rather useless discussion among software developers is if to use PHP variable parsing when building string or not. That is if you should write your code like this:
<?php
$value = 15;
$text = "Value is $value, isn't it?";
?>Or better like this?
<?php
$value = 15;
$text = 'Value is ' . $value . ', isn\'t it?';
?>Well, some claim that the first version, using variables inside strings, is slower, while the others point out the second code is less readable.
A matter of taste, I think, since both readable code and performance are important some way or another.
However, this PHP memory bug gives me the creeps: The first code will not free the memory used until the end of script execution. So you better don't use code like this within loops.
Maintaining Drupal Userreview module
I'm maintaining the Drupal userreview module now and hope to do the first round of bug fixing before Christmas.
Internet update the wrong way IV
Two things I find especially annoying about updating iTunes:
- Why I need to download a full setup each time?
- And why are all QuickTime settings - especially the setting to not install a QuickTime icon in the taskbar on startup - lost after each update?
The Holy Grail CSS Layout Fix for IE7
In Search of The Holy Grail describes an easy way to create a three-column, source-ordered, table-less layout with a fluid column in the middle. It is used by the Comic Marktplatz, for example. However, there is an annoying bug with the shiny new Internet Explorer 7. IE7 has a problem in understanding the left column rule of
margin-left: -100%;
Instead of considering the width of the surrounding div container, IE7 inserts the width of the body, which leads to the left column being moved out of sight to the far left. Here's how to fix it.
And again: Is C++ really faster?
I was pointing to articles about if low level optimization really makes sense and if C++ is really faster than higher level languages several times. But of course this will be a never ending debate, and it still continues. This time C and C++ should be the best languages for higher level mathematics problems. Unfortunately this is not the case.
I'm writing in German, too
I'm now writing in German, too: Gerd Riesselmann: Notizen aus dem Moor
How to update Drupal while preserving all your changes
Let's face it: Updating a Drupal instance can be a pain, especially, if your Drupal installation is full of custom patched, like mine is. Wouldn't it be nice to have an installation that can be updated safe and easily? This article is about how I achieved this.
As you may know, Drupal uses CVS. In simple words, CVS allows several developers to work on the same file at the same time. Therefore developers can apply changes without overriding the changes of others - at least to some extend. Different changes to the same line of course need manual resolution.
General Comments on Drupal's Error "Unknown table 'n'"
Maybe you already know the famous Drupal error "Unknown table 'n'". It looks like this:
user warning: Unknown table 'n' in where clause query: SELECT DISTINCT(node.nid), node.type AS node_type, node.title AS node_title, node.changed AS node_changed, users.name AS users_name, users.uid AS users_uid, node.created AS node_created, node_counter.daycount AS node_counter_daycount FROM node node LEFT JOIN users users ON node.uid = users.uid LEFT JOIN node_counter node_counter ON node.nid = node_counter.nid INNER JOIN node_access na ON na.nid = node.nid WHERE (na.grant_view >= 1 AND ((na.gid = -1 AND na.realm = 'all') OR (na.gid = 0 AND na.realm = 'og_public') OR (na.gid = 0 AND na.realm = 'og_all') OR (na.gid = 3 AND na.realm = 'og_subscriber') OR (na.gid = 4 AND na.realm = 'og_subscriber') OR (na.gid = 0 AND na.realm = 'cac_lite'))) AND (n.moderate != 1) AND (node.status = '1') ORDER BY node_counter.daycount DESC LIMIT 0, 5 in /home/orbit42/public_html/includes/database.mysql.inc on line 120.
This error is caused by some module "rewriting" a query of some other module, each of them not aware of each other. This is a powerful Drupal feature, yet it also is highly error prone - as the lots of error alike show. Here's how to deal with it.
No more relative links in WordPress RSS feeds
Rev. Jon Pekele Kamalani Thysell turned my function to convert relative to absolute Urls into a neat little RSSBaseFix WordPress Plugin. Turning relative to absolute Urls is required when creating a feed, and that's what the plugin does.

