Archive for the ‘Computing’ Category.

Working on PHP Weather

PHP Weather I’ve been working on PHP Weather today. And I have actually made some progress :-)

The print_pretty_en() function has been improved, and can now be customized by supplying the right arguments. Two arguments control the HTML-code that will be inserted in front of and after all numbers. This makes it easy to color all numbers red or do other things like that.

Another argument controls the format of the numbers. This argument can be one of these values: ‘both_metric‘, ‘both_imperial‘, ‘only_metric‘ or ‘only_imperial‘. So if it’s ‘both_imperial‘, all values will be printed with the imperial form first, and the metric second in parenthesis.

This new and substantially cooler version of PHP Weather is not quite finished, but it’s getting closer. So stay tuned! :-)

Online Quake

After I’ve bought Quake for Linux, I’ve been playing it a lot on the Internet. And I must say that it’s great fun!

I like it best, when there are about 10 other people in the areana. This ensures that you never have to search for someone to frag, which is nice :-) There is one problem, though, with to many people: it’s always the others who get all the good weapons.

Upgrade - again :-)

I’ve just bought 128 MB of RAM extra for my machine. That brings the total amount of RAM up to 256 MB. If you count the 64 MB on my V7700, then the total is 320 MB :-)

So now I’ve finally got rid of the swap-file. Nice. I can now play Quake and have a bunch of Eterms and Emacs open at the same time.

Quake on Linux?

Quake III Arena You bet!

I’ve just bought the Linux-version of Quake from a Danish reseller of Lokigames, called linuxspil.dk. And it plays beautifully :-)

With my new V7700 GeForce2 Ultra graphicscard from Asus, I can play the game at a resolution of 1600×1200 under Linux (just as I can under Windows). I think it’s nice to see, that the hardware manufactures are finally providing desent drivers for Linux.

A new menu-system

I know that I haven’t been updating this page so often lately, but I’ve been busy with other things. One of those things is my new menu-system.

The main requirement for the new system was, that it should be able to deal with a tree of pages several levels deep. The new system handles this beautifully, as you can see at the sitemap. Notice how the lists are nested within each other. The most extreme case is at the bottom, where I use five levels to describe the structure of my Danish Stuff.

To define this structure, I have all the pages specify their parent and their children. All pages have a parent, but does not necessarily have any children. I store all this information in a huge array, which means that it is extremely easy to access the information.

Because all the pages have a reference directly to their parent, it’s quite easy to find your way back to the root of the tree. All you have to do, is to use a recursive function. This function takes one argument: the node who’s parent we want to find. So the function just adds the node to a global array, and then it calls itself with the parent as an argument. This means that you’ll eventually reach the root, where the parent will be an empty string (''). It’s called recursion because we have a function that keeps executing itself until some condition has been met. Because I can now use recursion, the code needed to build the sitemap, has been cut in half.

The next task, is to make some tools to make it easier for me (and eventually also others) to maintain the structure. I’ll let you know when it’s ready.