Archive for 2006

Published by Niels on 19 Mar 2006

More on the old beast

In this log I mentioned that the Dell Dimension XPS I am running has been extended with a Promise Ultra ATA-100 TX2 IDE card. This has the advantage that, instead of the local IDE’s 33 MHz bus, the PC can now utilize its full 100 MHz bus power. This meant that I could make better use of a new 40 GB hard drive I bought (which can operate at 150 MHz, but hey!). On this newly installed drive Ubuntu Breezy Badger is installed and on the old drive Windows already had been installed. The chain-loader used for Windows gets a bit confused if the Master Boot Record is on this second drive on the second controller, so some fancy Grub settings have to be put into /boot/grub/menu.lst. Here is mine:


# This is a divider, added to separate the menu items below
# from the Debian ones.
title Other operating systems:
root

# This entry automatically added by the Debian installer for a
# non-linux OS on /dev/hda1
title Windows
map (hd0) (hd1)
map (hd1) (hd0)
rootnoverify (hd1,0)
chainloader +1
makeactive

If there are any questions on running Linux on old hardware just let me know.

Published by Niels on 18 Mar 2006

Useful links

Google is a great search engine and it has helped me very often to find the information I needed at that very moment. But filtering all the results presented by Google can soon become a tedious task. Not always are the best results for what is wanted presented at the top of the search results. So I always try to find (and bookmark) pages that provide a good overview. And so recently I found two (well, one was presented at SlashDot :) )

The first one is a link to IBM’s DeveloperWorks that shows a ‘reading list’ for PHP developers. The title is a bit misleading because they provide links to common tools, articles, web-pages and yes, even books. I wish they had created this page a month ago. It would have saved a lot of searching.

The second link surprised me a bit. But is really a Microsoft owned page linking to a lot of tools that can be used for .NET development. And the part that surprised me is that they also link to 3rd party tools and even Open Source projects. Do I hear the sound of an air born pig in the distance?

Published by Niels on 16 Mar 2006

A storage pattern

Every time I build software that makes use of a Model-View-Controller pattern I always have the feeling that the wheel is being re-invented with regards to the View part (and to a lesser extent the Model part as well). This is caused by the fact that, to me, the most obvious solution for a view is a tree-structure of elements that share a single interface so that a simple draw() on the top-most interface is sufficient enough to get the whole tree drawn (to screen, file, paper, etc. but that will be for a later story).

The pattern below is what I always use to implement this:

Storage Pattern

This makes it very easy to create objects that either store a single element that is drawn, or multiple elements that are drawn. You have to choose if the concrete element is either a SingleElement storing ‘content’ or a ContainerElement that can store other elements. This way it is very easy to build a tree of similar objects that have a shared interface. This pattern is more commonly known as the Composite Pattern.

The diagram is drawn using Dia. The original diagram source can be found here.

Published by Niels on 12 Mar 2006

Networking and sound on an old system

So we have this old system running at home. That is, this message is brought to you by a Dell Dimension XPS R450 that originally had 64MB RAM, a 450MHz Pentium II processor and a whopping 9GB hard-drive. Last year I have upgraded the system to a 1.3GHz processor using a Powerleap PL-iP3/T processor board, added some extra RAM (256MB), a second hard-drive of 40GB using a Promise Ultra ATA-100 TX2 so that the system could fully use its 100MHz bus potential, and last but not least a CD-RW drive instead of the 8x CD-ROM that came with it.

This system ran Gentoo Linux for a while, but I found that the continuous compile sessions became somewhat of a burden (this is a mild remark, the truth is a lot worse). So Ubuntu was installed and everything was fine. Except for the sound card that refused to work. The lspci command showed me that the sound card was of the cs46xx type. But when I did modprobe snd-cs46xx the module got nicely loaded, but the sound card did nothing. After some tinkering with several modules I found that the system worked using the snd-cs4236 module. All was fine and I put this module in the /etc/modules file. After a reboot (just to check) the network did not come up. Some research later revealed that one of the IRQ’s the sound card occupied was IRQ 10. Did I mention that my network card is a 3Com 3c509 hard-wired to use IRQ 10?

Everything works fine now that the following line is included in the file /etc/modprobe.d/alsa-base:

options snd-cs4236 port=0x530 mpu_port=0x330 irq=5 mpu_irq=3 dma1=1 dma2=0

This nicely forces the card to use IRQ’s 3 and 5. My daughter can now even play Putt-Putt games using Wine and her own mouse :).

If you want more information on upgrading your Dell Dimension XPS there is a lot of information to be found here.

Published by Niels on 09 Mar 2006

Check this out…

If you want to learn something.

Out of curiosity I started writing an application using PHP and MySQL. The syntax of PHP wasn’t a problem, it feels like a very dumbed down version of Perl, with which I am very familiar. And neither was MySQL. It is ‘just’ another RDBMS and a simple one at that. Nor was the design of the database tables a problem as I remembered my lessons and experiences on database normalization.

When I wanted to code the entire application I found out that I lacked experience in setting up a website using the n-tier model and the MVC (Model-View-Controller) pattern. After some searching Tony Marston provided me with a lot of good insights. He is very pragmatic, but don’t let that scare you off. The proof is in the pudding and a wonderful pudding he made and explains how he made it.

Published by Niels on 03 Mar 2006

Alas, poor sl, I knew him well

To update a site created by NanoBlogger you either have to:

  • Painfully copy the newly created entries by hand and move or remove all other files.
  • Use a protocol like rsync. But some of us are not fortunate enough to have a hosting company that offers this protocol (as a side note: that is about the only shortcoming I can think of regarding BHosted).
  • Brew your own update script that works quite well, but is still a little rough around the edges. In order the smooth things out you would have to spend considerable time which you don’t have.

Or you can read the NanoBlogger newsgroup where a question on site-synchronization was answered by me and then by someone else who had a better answer.

So suffice to say that I will be no longer using my home-brew sl, instead I will be using sitecopy. It works on the same principle as my own solution, only more mature and maintained by somebody else :). The observant reader will notice that sl no longer is in my category list. The entries and the program will stay however. So if needed they can still be found.

Sitecopy is very simple. All it needs are two things:

  1. An entry in a file called .sitecopyrc in your $HOME, where an entry has to be created per website. The permissions of the file have to be set to 600. Mine looks like this:
    site heirbaut.nl
        server server9.bhosted.nl
        protocol sftp
        rsh "ssh"
        rcp "sftp"
        username ***
        password ***
        local /home/niels/Projects/www/www.heirbaut.nl/
        remote /srv/nielsh/www/www.heirbaut.nl/
        state checksum
        checkmoved renames
    
  2. A working directory called .sitecopy in $HOME with the permissions set to 700.

Published by Niels on 03 Mar 2006

Just documenting

One of the reasons I keeps this weblog is to have a central storage of my cumulative knowledge. That is, instead of writing all kinds of little tidbits in a notebook, I put them here. This has the benefit that wherever there is have web-access the information can be found and perhaps someone else that is looking for the information is happy to find it here.

OpenOffice Writer was given me a minor problem: it set the page size for all new documents to the Letter format. It is not difficult to change, but quite annoying. After some investigation I found that the best (only?) method was to:

  1. Open OpenOffice Writer.
  2. Open the Stylist by pressing F11.
  3. Go to the list with page styles.
  4. Right-click ‘Default‘ and select ‘Modify‘.
  5. In the Page-tab choose the format you want (A4 in my case) and click ‘OK‘.
  6. Go to ‘File -> Templates -> Save‘ to save the current template. Choose a new name.
  7. Go to ‘File -> Templates -> Organize‘ and right-click the save template (probably under ‘My Templates‘) and select ‘Set As Default Template‘.
  8. Restart OO Writer and check if the page size is indeed the correct one.

Published by Niels on 14 Feb 2006

Interesting times

As the Chinese proverb says: May you live in interesting times. Normally this is meant as an insult, but for me the current times are interesting indeed. Since it is now official (i.e. all the paperwork has been done) I can now say:

Bye bye old company and hello new company.

On May 1st I will be starting there and I am looking forward to it :).

Published by Niels on 28 Jan 2006

Upgrade time

A new day a new look. NanoBlogger version 3.3-RC4 has been released yesterday. Always ready to try out new things I upgraded this site to that version as well. I followed the steps mentioned at the NanoBlogger User Manual and some extra steps and now everything seems to be working fine again. Steps taken:

  1. Renamed the directory where this site is stored to something else. In my case: mv ~/Projects/www ~/Projects/www.org.
  2. Downloaded the new release, unpacked it and set my PATH to the new NanoBlogger directory. Tested with nb --version if that went well.
  3. Created a new weblog using nb -a. This assumes that $BLOG_DIR is set of course.
  4. Deleted the default entry from NanoBlogger: nb -d 1.
  5. Copied the data/ directory from the original directory to the new directory.
  6. I have a local copy of my plugins. So the plugins/ directory from the distribution have been copied to $BLOG_DIR.
  7. Copied some personal plugins (google.sh, gallery.sh and code.sh) to the correct places in the local plugin directory ($BLOG_DIR/plugins).
  8. The stylesheet for this site is base on the nb_clean.css stylesheet. So that stylesheet was copied to to heirbaut_nl.css. From the original’s site stylesheet the additions for the gallery and code plugin were added. See the result here.
  9. GViM was started in diff-mode with the original and the new blog.conf files. All personal settings were also put it the new blog.conf.
  10. GViM was started in diff-mode with the original templates/main_index.htm. All personal settings (navigation menu) were put in the new templates/main_index.htm.
  11. Same for templates/main_links.htm.
  12. Run DirDiff on the old and the new directory and checked if anything was missing. There was: images/galleries. So that directory was copied to the new location as well. Other diffing tools would do as well, of course. I just like ViM :).
  13. Ran nb -u all. Checked that everything was fine.
  14. Added this entry and uploaded the site using sl (which can expect some additions in the near future).

And now I am going to have some coffee…

Published by Niels on 25 Jan 2006

The meaning of…

Once in a while I check the website statistics for this site. They tell all kinds of neat stuff like who visited when and how did they come here. For example it tells that people visited through a link on another webpage or through a search engine. It even tells, in case of the search engines, what the search terms were that lead to here. To my surprise someone found this site searching for ‘ebo no kata meaning’. The only place I ever mentioned the Ebo-no-kata is here.

Being intrigued by this search term I got the feeling that I could tell about my view on the Ebo-no-kata.

Short Introduction
The Ebo-no-kata is a Dutch national kata that is mandatory for every Dan exam. It is performed by two persons where one does all the attacks and the other
does all the counters. There are twenty different attacks divided into four groups:

  1. Grabs
  2. Holds
  3. Punches/Kicks
  4. Weapons

It was created by Mario den Edel and Wim BOersma (EBO :) ) to represent their view on contemporary jiu-jitsu. As I understood it it serves not only as a kata (or a teaching tool, which most katas are), but also as a framework to start technique training from. One of its shortcomings is that it has little ground techniques but that is compensated by another Dutch national kata called the Ne-Waza-Jitsu kata which consists purely of defenses on the ground.

The following items are my personal views and motivations on the Ebo-no-kata. To me the kata is:

  • A great way to start an exam. Both as an examine and as an examiner. As examine it gives you a nice warming-up and a sort of constant factor that can help to overcome nxiety.
  • A good excuse to work on my technical skills. Just take it slow in an constant pace an try to improve my technique. This is how I think all katas should be performed. Fluent, clear and skillful.
  • A good excuse to take a slow pace in training. Perfection does not allow rushing.
  • A starting point to develop technical skills like the correct distance and moving in the right position and direction. My main problem is that the more I learn about that the more a get the feeling that I have to start all over again with my kata training.
  • Discussion material. People often debate the way a technique in the kata should be performed and sometimes go as far as to declare their way the one and only correct way. I think this is a mistake. Their is more than one way to arrive at a technique as long as you can make the technique work for you without using ‘force’.

Like I said I like to discuss stuff like this. So if anyone has more or other viewpoints, or would like more information, I would be glad to hear from you.

« Prev - Next »