Sunday, November 16, 2008

Una artista en mi corazón


Mi esposa además de ser una física es también una artista con gran talento. El dibujo arriba es una pequeña muestra de su sensibilidad, que hace mi corazón golpear más fuerte toda vez que lo admiro con más cuidado. Yo lo veo todas las mañanas porque el se queda en la cabecera de mi cama, pero a veces lo miro con más atención do que el habitual al coger mis gafas cuando despierto.

A mi me gusta la combinación amarillo + negro, y muchas veces es así que pongo mi ropa y es así que aparezco en el dibujo. Mi esposa y yo salimos muchas veces a caminar en el parque charquito, en nuestra adorada Cali con nuestra querida Mariposa.
Después que la bonita perrita ya se cansó (lo que no es muy difícil, debo decir), nos quedamos un rato sentados en la banquita junto a ella, esperando a que esté lista para volver a la casa (cosa que a ella nunca le gusta hacer de modo que siempre intenta irse por otro camiño). Y ni es necesário decir que siempre estamos muy felizes con la compañia del otro.

Eses son los eventos que mi esposa amada puso en el dibujo, y ahora es él que hace mis recuerdos volveren a aquellos días maravillosos que pasamos en Cali junto a nuestra hija, la adorable Mariposa.

Son durante esas miradas más largas que muchas veces las lágrimas llegan a mis ojos, por saber que debo esperar lleno de nostalgia a que ellas estén conmigo otra vez, caminando felices y cansadas por las calles de Cali bajo el sol que añade aún más calor a nuestros ya calientes corazones de pasión.

Mientras tanto, sigo mirando sus dibujos y ansiando al día en que estaremos juntos otra vez, para que también esos días sirvan de inspiración para otros dibujos, futuros testigos de nuestra felicidad.

Friday, November 14, 2008

Chasing a bug

This afternoon I was a bit tired with my 5-pt computation at 1-loop, because I have to check if something very boring is true and I know from consistency that it has to be true.

So I tried to occupy my mind with something interesting instead, and get back to my long problem later on.

A post [1] to the Window Maker list was enough to make me curious and I decided to think about it. The problem was an apparent bug with Window Maker, which was not recognizing the release of a shortcut key called Mod4, with keycode == 115.

My first reaction was to ask for more information, because it looked like a X bug to me due to the fact that the reporter had a non-standard Sun keyboard, and it had already uncovered a X bug last month, IIRC.

After a few private emails I learned how to reproduce the issue with my keyboard too, using the "Windows" key (maybe this name or even the logo has some special ability to make bugs happen). Having something which I could test myself I went to the wmaker source code to learn where the problem was happening.

A few 'git grep'(s) later I found the source responsable for this anomaly in src/cycling.c
            case KeyRelease:
#ifdef DEBUG
printf("Got key release\n");
#endif
for (i = 0; i <>max_keypermod; i++) {
if (keymap->modifiermap[i] == ev.xkey.keycode &&
wKeyBindings[WKBD_FOCUSNEXT].modifier
& 1<<(i/keymap->max_keypermod)) {
done = True;
break;
}
}
break;
and at first I thought that the problem was about keymap->max_keypermod being 3 instead of 4. But that hypothesis did not withstand my tests, and the scenario which emerged after some debug printf's was

  1. The modifier (Mod4) keycode was equal to 115 (I looked at 'xev' output)
  2. There was no keymap->modifiermap[i] for any 1<= i <= 24 which was equal to 115, so the condition inside the if () was not being satisfied and the key would never be recognized as being released.
  3. For this particular Mod4 key, whe have wKeyBindings[WKBD_FOCUSNEXT].modifier== 64
Therefore, as 1<<( i / keymap->max_keypermod) == 64 for i == 18 (remember that keymap->max_keypermod == 3) I simply set keymap->modifiermap[18] = 115 before the 'for' loop, and it fixed the issue for me!

I wrote the workaround patch and asked it to be tested, and it worked for the reporter too. The origin of the problem was found, but the proper fix was yet to be written.

I went out for a cappuccino I had the idea of searching about it with google. After some time I found out [2] that this is really a X bug, which can be "fixed" by adding to the .Xmodmap file the following
    remove mod4 = Super_L
keycode 127 = NoSymbol
add mod4 = Super_L
I wrote about it back to the list and the original reporter confirmed that doing this modification fixed the problem for him too.

And that is how my quest for some fun ended, and Window Maker remains bug-free as far as this issue is concerned (I don't know of any other wmaker bug, though).

The lesson I guess is, ask the almighty google first and hack the code later...

...but if I had done that I wouldn't have some fun learning new things about the inner workings of Window Maker.


[1] http://lists.windowmaker.info/dev/msg00123.html
[2] http://modeemi.fi/~tuomov/ion/faq/entries/Modifier_releases.html

Tuesday, November 11, 2008

First post

Right, so this is the first post and I don't know why I am writing it in English.

But anyway, let's see how it goes and if I will have time to upload pictures, write some random thoughts and all that.