Older blog entries for alex (starting at number 5)

I've been hacking some C++ 2D vector and matrix classes in preparation for a vector drawing program I'm planning to do. They are template expression based and therefore totaly unreadable. But they do generate kick ass code using the latest g++ snapshot.

Using the online snapshot compile form at codesourcery this function:

double dotty(Vector &x, Vector &y, Vector &z)
{
  return dot(x, y+z);
}
compiles to this (x86) code (using -O2 -march=pentiumpro):
dotty__FR6VectorN20:
        pushl   %ebp
        movl    %esp, %ebp
        subl    $24, %esp
        movl    8(%ebp), %eax
        movl    12(%ebp), %edx
        movl    16(%ebp), %ecx
        movl    %ebp, %esp
        fldl    (%eax)
        fldl    (%edx)
        fldl    8(%eax)
        fxch    %st(1)
        popl    %ebp
        faddl   (%ecx)
        fmulp   %st, %st(2)
        fldl    8(%edx)
        faddl   8(%ecx)
        fmulp   %st, %st(1)
        faddp   %st, %st(1)
        ret
which is pretty damn good for that (very readable) sourcecode. There is none of the normal problems with temporary objects etc.

Unfortunately i had to fight quite a lot with the template syntax, so the code isn't very nice. It would be a lot nicer if convertion operators were actually used when matching arguments to template functions. I wonder why that isn't in the C++ standard?

I'm not a man of much emotions. In fact, some might call my apparent lack of emotions somewhat disturbing. But still, i get used to things, attached to things, and leaving this place, where I've lived for many years makes me a bit sad. I get this knot in my stomach and I almost get tears in my eyes.

I wish I had any poetic talent whatsoever so I could write a poem about it.

Haven't written much here lately, it's time to post an update.

Last to days was major hacking time. Yesterday I continued porting the Axis journaling flash file system to Linux 2.3 and MTD. After 12 hours continous hacking i have a working readable filesystems which also supports attribute changes. I'll continue to hack away on it next friday. When the port is finished i might look at changing the on-flash representation a bit, I talked to Keith Packard at the GUADEC, and he would very much want to have support for compressed files in the filesystem, maybe I'll do that. Huge thanks to Axis for releasing this. It is really needed, since there are some patent problems with the current solution (FTL).

On thursday I spent half the night making Dia a bonobo component. It was quite easy, although there were some small problems with initialization. It basically works, but there is no persistance implemented yet. Also, I need to do some autoconf/automake hacking to make it build nicer. I'll probably rip it from gnumeric.

Worked on the current consulting project as normal, but then I sneaked away for some hours to take a look at the MTD project. The core looked fairly good. Sent some comments to the mailing-list.

We really need a standard flash subsystem and good flash filesystem. Currently we have to hack something together for every embedded project we do. I'm gonna try porting the jffs filesystem from Axis to Linux 2.3.x with MTD.

Played some floor hockey. Very though games tonight.

Some more sketching of voronoi diagrams. I really thought I had an idea of how to choose the correct line when calculating the bisector of two line segments. Seems i was wrong again... I probably have to pass the intersection point to the bisector calculation and then just choose the nearest segment.

To tired to think, I'll go watch some tv.

Worked a bit on the voronoi diagram construction code. There are like a zillion different cases when calculating the bisectors for point sites with incident segments, bah. Stumbled upon the line-segment bisector problem again, seems like i have to work this one out before i can continue. Tried to find raph on irc to ask him some questions about it. Didn't find him.

Got an advogato account. Lets see if this is any fun.

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!