HornetsEye demo video

This video shows current capabilities of HornetsEye. The video was created using recordMyDesktop on a Compiz-Fusion desktop. The audio track is Funki good time by Morusque.

Ruby and Machine Vision

I have made the presentation Ruby & Machine Vision available for download. The presentation gives an introduction to the Ruby programming language and its features. Furthermore it demonstrates a few capabilities of HornetsEye.

Ruby 1.9 was released

Yesterday Ruby 1.9.1 was released. Here is a small presentation about changes in Ruby 1.9. There are some new features in the syntax and the semantics of local variables was improved. For example Array.map now returns an enumerator if you don’t give a code block as argument

e1 = [ 1, 2, 3, 4 ].collect
e2 = [ 5, 6, 7, 8 ].collect
loop { puts "#{e1.next}, #{e2.next}" }

Ruby 1.9 (formerly known as YARV) also has native threads. Now it is not necessary any more to use Distributed Ruby (DRb) to make use of multicore processors. Of course this means that a Ruby extension has to be thread-safe depending on how it is being used.

There also is a lot of work on making the handling of strings aware of the current character encoding

ruby -e "puts 'Hä?'.size"
# 4
ruby1.9 -e "puts 'Hä?'.size"
# 3
ruby -e "puts 'Hä?'[1]"
# 195
ruby1.9 -e "puts 'Hä?'[1]"
# ä

Another new feature is the implementation of fibers. Fibers are like threads but they are not preemptive. This means that a fiber has to suspend itself first before execution of the calling thread can continue. Fibers allow you to implement parallel contexts with implicit locking.

Yukihiro Matsumoto's keynote at Rubyconf 2007

You can install Ruby 1.9 alongside 1.8 as follows (under GNU/Linux)

./configure --prefix=/usr/local --program-suffix=1.9
make
sudo make install

The performance of the Ruby VM was improved and the memory footprint was reduced. String operations in general will be slower though since UTF-8 now is the default character encoding. But then again Yukihiro Matsumoto’s primary goal in designing Ruby always has been to minimize the effort in programming.

Note that it will take some time until the existing Ruby-extensions get ported to 1.9.

Update: I submitted a summary of this to Slashdot and it was accepted

Programmer's joke

Update: Everyone is telling me that this joke is stupid.

Mesa3D (OpenGL) and MinGW

I’ve just managed to compile and install Mesa3D version 7.2 under Microsoft Windows (using MinGW). Here are the steps in case anyone else needs to know:

  • Install MinGW and MSYS
  • Download and unpack MesaLib, MesaGLUT, and MesaDemos into the same directory. The files are available on SourceForge.
  • Open the file Mesa-7.2/Makefile.mgw in an editor and replace
    <pre>copy progs\samples\star.exe lib</pre> with
    <pre>cp progs/samples/star.exe lib</pre>
  • Compile Mesa3D by executing make -f Makefile.mgw under MSYS
  • Copy the files Mesa-7.2/lib/lib*.a to the directory /mingw/lib
  • Copy the files Mesa-7.2/lib/*.dll to the directory /mingw/bin
  • Copy the content of Mesa-7.2/include to the directory /mingw/include

To test Mesa3D you can for example download SGI’s cube.c and compile it by executing

gcc -o cube cube.c -lopengl32 -lglu32 -lglut32