Log <-

Archive for July, 2004

A death in the family

Last night, my grandma passed away. I had to leave for work this morning, so I don't know how she passed away exactelly. But her health lately was getting worse and worse, so that was probably the main factor.

About one and a half years ago, she was still in full health, living on her own. It's weird how things can suddenly take a turn for the worst and rapidly digress. She had to be put in a home for the ederly and even though she never complained, I don't believe she liked her new situation.

My grandma always was a very classy lady and was well traveled. She often visited friends and family around the whole country on her own, by train, even in her elderly years. After the years caught up with her she coulnd't move around anymore and was bound to the nurseryhome.

I was never very close to her. She lived too far away for me to visit her often when I was a child, and when that child-fase passed it was hard to create a good bond between us. Still, it's a shame. She was always such a friendly optimistic lady. Even 'till the end.

Goodbye grandma, you will be missed.

o:XML; a XML based programming language

This looks pretty inconvenient:

Programming with o:XML.

It's an XML based programming language. Pretty useless, if you ask me.

PHP 5

PHP 5 has been released.

New features:
* The Zend Engine II with a new object model and dozens of new features.
* XML support has been completely redone in PHP 5, all extensions are now focused around the excellent libxml2 library (http://www.xmlsoft.org/).
* A new SimpleXML extension for easily accessing and manipulating XML as PHP objects. It can also interface with the DOM extension and vice-versa.
* A brand new built-in SOAP extension for interoperability with Web Services.
* A new MySQL extension named MySQLi for developers using MySQL 4.1 and later. This new extension includes an object-oriented interface in addition to a traditional interface; as well as support for many of MySQL's new features, such as prepared statements.
* SQLite has been bundled with PHP. For more information on SQLite, please visit their website.
* Streams have been greatly improved, including the ability to access low-level socket operations on streams.
* And lots more…

Also check out this post on my log.

Nethack notes

I've been playing a lot of Nethack lately. It's quite addictive. And you tend to die a lot.

For instance: In my last game I arrived at the Medusa level. Now, Medusa will turn you to stone if you look at here directly, so I was going blindfolded. I read somewhere that you can use a mirror to defeat here, so I went back up in the dungeon to get one. On the level directly above the Medusa level, I encountered a cockatrice. These will also turn you to stone, but only if you touch them. "Okay, let's be carefull" I think, and kill it from a distance with some daggers. When it's finally dead, I walk over the corpse, but I forgot I was wearing the blindfold. When wearing the blindfold, you can't see what's on the ground, so instead you'll feel what's on the ground. "You feel here a cockatrice corpse". Feeling usually involves touching, and touching a cockatrice…. turns you to stone. Ooh, the irony!

This is just one of the many splendid ways in which you can die in Nethack. Pretty neat huh? :)

Anyay.. I've been collecting all possible information given to me during the game in one way or another. I've put my notes on-line for all to see.

Nethack notes

Sun's Looking Glass

Sun's Looking Glass looks pretty awesome. (Click the screenhots and the select different 'views' from the dropdown)

PHP

Now that I've taken the job at ZXFactory, I'll be doing some heavy-duty PHP programming again. It's been a while since I last programmed in PHP. (Not that I've forgotten how to do so). I did a little research for some functional specifications I am working on at ZX and found some interesting sites and articles.

PEAR DB

The project I'm currently working on will probably be put on the market, so it was decided that we should start looking for some database abstraction library. The idea is that you should be able to change the database back-end from i.e. MySQL to Postgresql without having to change any code.

So I started looking around and ended up at the PEAR repository. It has some nice database abstraction layers like PEAR::DB. DB provides an Object Oriented layer around the database call-functions. It unifies things like the various different functions for counting the number of affected rows so that it will work on any database. It also restructures the results from queries so that you won't have to deal with different types of resultsets. Best of all are probably the standard error reporting routines.

The PEAR::DB_DataObject_FormBuilder is also pretty cool.

PEAR::DB_DataObject's description sounds really cool ("An SQL Builder, Object Interface to Database Tables"), but isn't really usefull. It's just a kind of template for building classes for retrieving data from tables.

What you really want (yes you do!) is a unified way to write queries. You see, the problem with different database backends is that you can't use any of the database vendor specific functions and/or syntax. And this really limits the possibilities. I haven't really found any useable way of doing this, so you'll probably just have to stick with ANSI-SQL and do any complicated things in the code.

PHP's DBX

If you don't like PEAR, you could always use PHP's native DBX library. It's faster than PEAR's stuff (if you believe these statistics) and you won't have to fiddle around with PEAR installations. Here are some DBX examples.

Shared memory

Another cool feature in PHP is the POSIX Shared memory PHP library. Suppose you have to retrieve some statistics from a database, do some calculations on them and show the endresult to users visiting the page. Let's say you've got 8 million rows in the database and you have to add the values of some column of all those rows. That's going to take some time. You most certainly don't want to do that every time a user visits the page now, do you? The awnser to this problem is probably shared memory.

With shared memory you could simply perform the calculations once and then allocate some shared memory (the size of the results) and put the result in there. Then, when another user visits the page, you can first query the shared memory to see if the results are already calculated. If so, you can simply retrieve the results from memory without having to perform any queries or calculations at all. Pretty neat stuff. Here's an article on how to use them.

Debugging

Did you know you can produce tracebacks in PHP? You could write your own errorhandler function which shows the traceback.

PHP 5

On a final note, I'm eagerly awaiting the release of PHP 5. Check out this new stuff. Lot's of great new Object Oriented features like public, private and protected vars/methods, interfaces, class type hinting and best of all: Overloading! Too bad they're also implementing exceptions. I hate exceptions.

Windows Vim settings

Geez, the default settings for the windows version of vim suck! It's got all these crooked little 'shift-arrowkeys for selecting text' options and whatnot. I don't want that crap! Autoindenting was completely fubar too. So much so that I couldn't even normally insert text without each line violently shaking the left and right.

So I tweaked the vimrc settings to make Vim under windows as much the same as GVim for Linux as possible. I've put the resulting _vimrc online.

I also did some updates on the white.vim colorscheme.

NL withdraws software patents vote

"The Dutch Parliament has decided to direct Minister Brinkhorst and Secretary of State van Gennip (Economic Affairs) to withdraw the Dutch vote in support of the Council of Ministers' text for the Directive on Software Patents. This is the first time in the history of the EU that such a course of action has been undertaken."

Read all about it.

Windows GVim FTP

I've spent an eternity trying to find out how to get gvim under Windows to open files transparantely over FTP. According to the manual, it's supposed to work like this:

:e ftp://[user]@[hostname]/file

But that didn't work for me. I thought I tried everything, but it just wouldn't work. Some red-coloured errors flashed by everytime I tried to open a FTP file, but I coulnd't read the errors because they were gone too fast.

Turns out I had to make sure of at least the following:

  • Don't forget to create a temporary directory c:temp or c:tmp, or some other path which is set in the 'directory' setting in vim (type ":set directory" to find out). GVim needs it to temporary store the file there.
  • Make sure the NetRW plugin is loaded.
  • When opening a FTP file, make sure you put a DOUBLE SLASH between the hostname and any filenames. For instance, I tried opening the file ftp://hostname/myfile.php, and it worked. But when I tried to open ftp://hostname/mydir/myfile.php, it failed! When I entered ftp://hostname//mydir/myfile.php, it worked again. Weird stuff but who cares? As long as it works, it's all fine with me.

I've got some more tips and pointers about the windows version of GVim. One of them is: "Don't use windows." ;-) Some other tips might be added to my vim page in the near future (where 'near future' in my dictionary is defined as 'somewhere between now and a vague and distant future).