Archive for February, 2005

Canon EOS350D

Thursday, February 24th, 2005

Always nice to look at wannahaves. Canon just announced a successor of the 300D; a new toy called 350D . It looks good, all-black looks better then the default-grey 300D. The specifications are a bit better and I wish I had one. However, I don’t think it’s worth upgrading from a 300D because the improvements are small. For instance, 8 Megapixel only increases the resolution 12% in each direction. Maybe in a few years, the 300D has become really old… :-D

Concurrency

Wednesday, February 23rd, 2005

The free lunch is over! Herb Sutter writes an interesting and predictive article in the freshly arrived Dr.Dobbs Journal, claiming that computer programs won’t just go faster every year for free. Not anymore. Up until now, processor speed, harddisk space, memory capacity, everything about computers has doubled every one-and-a-half year (somewhere related to Moore’s law). But while we were all already anticipating our programs would run twice as fast in the near future, we won’t get this lunch for free.

While we were not really paying attention, the exponential increase in processor speed has already ended. There already was a 2 GHz Pentium in 2001, but right now we’re not passing the 3,6 Ghz instead of the expected 10GHz. Instead of increasing clock speed an important growth factor will be multi-core processors. To utilize this modern type of computing power in a single application, it should be multi-threaded. Multiple threads working together means watching out for concurrency issues (like race conditions, dead lock, and so on). So concurrency is going to be more important than ever.

In fact, Sutter believes that concurrency will become a first class concern for more developers and language designers. An “efficient language” will maximize cpu utilization of modern multicore cpu’s. I certainly don’t hope this will resurect Fortran. That medieval programming language requires you to type 7 spaces or so on every line, before you can write anything serious (sounds like assembler to me). And if you do, the compiler stops reading what you wrote after you typed 70 characters on that line, no matter how important.

But to keep to the point. I once followed a course called concurrency. We had a look at the correctness of multithreaded programs, looking at fairness and avoiding deadlocks. If you think that program verification doesn’t scale beyond 100 lines of code, you should try verifying concurrent programs. It is terribly complicated!

Luckily, most programmers don’t verify their programs for correctness (you would never get past 100 lines of code anyway) because a lot of things are “obviously correct”. Well, I can warn you: in multi-threaded programs, nothing obvious is as correct as it seems. Concurrency (and its implications) is a hard problem (NP hard ;-) ). Even if you understand all issues involved in concurrency, you should know the semantic memory model of the virtual machine you’re working with, or the write- and read instruction reordering of your cpu (which hopes it didn’t change the semantics too much). If programmers can’t “intellectually grasp” a program containing goto statements, multi threaded programs should never have been invented.

For instance, I will show you a piece of code I thought was completely correct:

class Singleton {
	private static Singleton instance;
	private Singleton() {
	}

	public static Singleton getInstance() {
		if (instance == null) {
			synchronized (Singleton.class) {
				if (instance == null) {
					instance = new Singleton();
				}
			}
		}
		return instance;
	}

This is a “smart” implementation of the singleton pattern. It is supposed to only create one instance while the class is in the JVM, and it does it the first time any thread calls getInstance(). The advantage of this implementation over one that just makes the whole method synchronized, is that it avoids the overhead associated with synchronizing all subsequent calls. By also checking for null within the synchronized code, it still avoids more than one instance creation. Isn’t that nice?

But it’s wrong!

It’s called double checked locking, and it does not work correctly for reasons we can’t intellectually grasp. A lot has been written about it, and it does not work.

To keep you from reading the details, some of the problems are:

  • The compiler / JVM can rearrange code within synchronized blocks for optimisation.
  • The compiler / JVM can move code into a synchronized block for optimisation.
  • The compiler / JVM cannot move code out of a synchronized block.
  • Threads can store local copies of variables that are not declared volatile or protected by a synchronized block, so may not see changes made by other threads. (And volatile has a known bug – it doesn’t appear to actually do anything).

There isn’t a real sollution to this problem, but maybe we can avoid some concurrency problems by reassuring:

  • support for first-class concurrency-related language concepts (like in Java 1.5)
  • libraries that are inherently thread safe
  • and most importantly: system and programming frameworks that are set up to execute computations as independant as possible (like J2EE, or service based computing)

I’m sure we will here a lot about this subject in the coming years.

MicroSoft eXtended Linux (Epia in msx)

Wednesday, February 23rd, 2005
In august 2002, I took up the idea of building a small, light-weight, and more important, low power-consuming server. The Via epia 800 motherboard had just arrived, and it sounded like the ideal choice. With a left-over harddisk, some memory, and a power supply to go, the only thing I needed for the small motherboard was a nice looking case.

For that purpose, I demolished an old MicroSoft eXtended (MSX)

NMS-8250 case (1). It didn’t feel that eXtended anymore I guess; ready for an MSX case mod! I never used the machine to begin with as it was given to me at a time I even didn’t use my own MSX anymore. I never would give up my own though! No, that one has safely been catching dust at my parents attick for over 10 years now.

The

msx (2) linux-server (3) has been serving me for almost three years. I mostly use it for music (mp3’s and streaming radio) and movies (avi’s play just fine), and to access all my files (ssh/samba/webdav) and adresses (ldap) wherever I am.

I think it was a good choice. I like my MSX around in my living room, having a server up and running always comes in handy. It’s quiet and doesn’t use a lot of energy. After seeing a friends energy-bill (he had a scsi-enabled, dual-everything, hot-swappable, heavy-duty-cooling server), I think the EPIA or pentium-M servers are the way to go for a personal server at home.

Weekendje Veenhorst

Monday, February 21st, 2005

I just returned from a long weekend I organized with a friend of mine. We invited quite a list of former-students of a management course (links all in Dutch) I’ve been taking a few years ago. We called it weekend in the Veenhorst because that’s the name of the very nice location we visited quite a lot of training days. Getting everyone together was quite a hassle, but it definititely was worth it.

We were lucky to get some trainers giving several workshops. The workshops were about meditation, exercising to play with your own creativity, the relation of fairy tales with current life, sources of inspiration for a stone sculptor (an exercise with klay can be executed quite a bit faster though) and archtetypical interpretations of a modern tale called Monsters & Co (just as applicable as the planned Soprano’s workshop, and a lot of fun!).

It felt like back in the old days. The same things happened, the same discussions about everything in life with sometimes only a slight change of focus: instead of talking about study, the same issues these days are related to work or even the color of the child’s room ;-) . Feeling very tired but satisfied afterwards hadn’t change either.

We were located in the middle of the woods (for so far as that’s possible in our country) and we had great wheather now and then. Therefore, I had a nice opportunity to

play (4) with the aperture and zoom of my new new lens. I discovered that, just like you can read anywhere in photo-forums, for taking full-frame wild- birds (5) photographs, one definitely needs more than 200mm max zoom.

The Curious Incident of the Dog in the Night-Time

Thursday, February 17th, 2005

This book is written from the perspective of Christopher Boone, a
fifteen-year-old boy who knows all the countries of the world with
accompanying capitals and every prime number up to 7,057. He’s a smart
kid, but also autistic; he doesn’t comprehend emotions or
anything not logical deductable.

One day he finds his neighbours dog killed with a garden
fork. Initially he is blamed for the murder, but he is intended to
solve the mystery of Who Really Killed The Dog, eventhough this means
he has to leave the safety of his little world. Doing his, he meets
Strangers and Other People who behave unpredictably. He observers, and
works with logic and order, just like his hero Sherlock Holmes.

What grabbed me in this novel is the discovery by Christopher of his
own world (like namesake Columbus), where I felt sorry, angry, ashamed
and more for him, but where Christopher narrates in a completely
emotionless way.

Wordpress

Monday, February 14th, 2005

So, why choose for the wordpress system? After all, it’s just a bunch of php scripts. Well, I had quite a whishlist, and no existing software package did exactly what I wanted. Nothing mapped for 100% to my requirements. Being a computer scientist, the only obvious solution was to start from scratch and build a complete custom solution. (Maybe I’ll spend some words on this phenomenon in the future).

However, I know what an effort that can be. Creating a new framework always seems to appeal, but working out the details can be a burden. I’ve done some things with html, css, mysql, php and more before. Based on this experience I knew I would have to spend days getting the php-scripts running, creating lots of functionality, creating some user and moderation system, creating some management interface for me, debugging post-roundtrips and charset encoding details, setting up tables in mysql, debugging html and css rendering in different browsers, and many more things. Man, I don’t have time for that!

So, the simple solution was to have a look at different CMS/blog-like systems, fitting to my hosting environment, customizable so it does any specific things I want, with some user/development community around it. This would allow me to get up a site in a short time, allowing me to focus on content (and maybe a bit design) very fast, while benefitting from lots of functionality extensions already available. The system at hand seems to do that quite nicely, we’ll see how well it holds…

First post

Thursday, February 10th, 2005

Ha!

Some people dislike them. You can get kicked only for trying!

On the other hand, the phenomenon is very present.

I’m talking about the first post posts.

Anyway, this won’t continue to pose as the first post on this site for long I guess. I’ll import some things I’ve written before, and assign the right dates to the articles. But the whole wordpress system and layout has only been instantiated as of today.

The reasons for setting up a site were diverse. Finally I’ve got a spot to quable a bit about some of my projects, post some notes on travelling, computers, my work and photography. I needed a single point of access to put all the things different people sometimes bug me about, usually related to photos I’ve just taken. But mainly, I like to keep excersising in writing, anything.

setting up a multi-card reader for Fedora Core 2

Tuesday, February 8th, 2005

Maybe with the a new kernel (>2.6.10) and a new distribution (>FC2), this info becomes outdated. I however, had quite a bit of work getting a multi-(memory)-card reader to work on this versioning of (GNU/)linux. This post consists of a bunch of links I used, giving guidance (and assuming you know how to recompile your kernel).

I started out using www.linux-sxs.org/hardware/flashreaders.html, which got me somewhere (scsi support running), but not where I wanted. The mini-howto on www.fedoraforum.org/forum/showthread.php?t=15737 got me bit further. I made sure my device was supported by looking up the USB device ID
(lsusb) which gave “ID 0aec:3260 Neodio Technologies Corp”. Googling
assured this one was on the white list for linux support.

Finally, this link told me I had to compile and probe/insert the sd_mod.o and sg.o kernel modules (now .ko, but that’s detail)

After reconfiguring the kernel, compiling and installing modules, I got the support I wanted. But then, the wish was to insert and download my photos. So, here
comes the trick. See www.buberel.org/linux/usb-automounter.php for automatically starting scripts on insertion.

Good luck!