I’m going to use git for a project of mine and instead of parsing git’s output (which is the adviced way to use it from your application), I thought I’d rather use libgit and link to it. The first step was getting rid of autohell and moving to CMake.

This patch against git’s current master branch includes the CMakeLists.txt file and a few modifications to the source (mostly due to the different way variable replacement works in autotools vs CMake).

So far, only libgit, libxdiff and git are built. Will I go go for the other binaries (gitweb, gitk, etc)? I’m not sure, as I’m not interested but it shouldn’t be difficult to CMake-ize those.

I think the move from autotools to CMake could be very useful for the msysgit* developers, as they no longer would depend on MSys*

* I have not tried to build git on Windows with my CMakeLists.txt yet, I’ll do it tomorrow

** It’s not actually true yet: I run two bourne shell-scripts but I could easily rewrite those in CMake, too.

Update I’ve produced a new patch, as the old one did not perform a few needed renames

Most of my coworkers use Qt4 but only on Windows. Some of them did not even know KDE existed, much less that since KDE 4.1 there are official packages and an official installer for Windows.

Last week, I wandered around the office, occasionally assaulting people to show them KDE on Windows, the API docs, this-and-that widget, answering their questions (mostly technical), etc (if you know how tackatpromotioned Marble at past aKademy-s, you know what I did 🙂 )

So, what was the reaction of people to KDE? Surprisingly, extremely good! I was expecting more resistance to the fact that to use K* classes, KParts, etc you have to convert your QApplication to a KApplication but they went like “the advantages of using KDE classes and KDE’s ActiveX [that’s how some of them call KParts] are so obvious I will do that as soon as I installing a development version of KDE on Windows is easy”. People specially liked the Kate, oKular and KPlato KParts (although I showed KPlato 1.6 and only on Linux). The pie-like ToolBox menu in Amarok also received some praising.

My conclusion: I really think we should raise more awareness of KDE among Windows developers and the “wander-around-and-assault-for-no-reason” approach works very well. Try it with your Win32 coworkers and friends and blog about KDE on Windows. Let’s get some momentum for KDE4 on Windows!

If you use Ubuntu and have added my Personal Package Archive to your /etc/apt/sources.list, you surely have noticed I have “backported” a lot of “sensitive” packages Hardy: Qt4, Glib, Gtk+, Cairo, lsb-base, HAL, hdparm, alsa, GNU parted, PCRE, etc. There are a lot more packages, not that “sensitive”: Samba, CMake, Telepathy, GStreamer, Rails, Boost 1.36.0, libvirt, Qemu, KVM, rdesktop, git, Apache, rsync, etc

If Ubuntu Intrepid or Debian Unstable or Experimental had the latest upstream version, I backported it to Hardy. If upstream was newer, I took the latest Debian/Ubuntu packaging and used that for the latest upstream version, with some fixes here and there.

This usually works fine because I’m careful and I test the packages myself. Actually, that’s the only reason I backport stuff: I usually need versions newer than the available ones in Ubuntu.

So far, the count had been “broke: 0 – fixed: a lot”, my biggest “success” being providing a fixed GNU Parted for bug 107326 months before Ubuntu did.

This time, however, I have inadvertedly inherited a bug present in some update (probably HAL), which makes your keys work in a “funny” way. First user to report that to me has been Michael Adams: “Having updated with your backports, I notice that my arrow keys have been converted to macro keys: my side keys don’t work, and up takes screenshots”. And indeed that happens! In my defense, I have to say I had not noticed before because I seldomly reboot my computer, so changes had not been applied to my system yet.

What’s the fix? Apparently nobody knows for sure (sometimes a reboot fixed it, sometimes setkbmap is needed) but it’s been already reported, see bug 255008.

Why am I posting this to Planet KDE? Because although the bug report barely mentions it, it does happen with KDE, too.

PS: If you use the ATI proprietary drivers, dual-head configuration, and one of your monitors is rotated (i. e. in vertical instead of horizontal), please contact me. Rotation was easy with NVidia but I’ve been unable to get it to work with ATI ðŸ™

When I search for a particular software application (Wt, CMake, etc), please show me, in the results page, the latest version and a link to the download page (or even to the file, if there is only one file to be downloaded) so that I do not need to enter the website, check if there is a newer version and, if there is, go to the download page. Here you have a mockup:

Mockup of Google showing the latest version of CMake in the results page

Mockup of Google showing the latest version of CMake in the results page

This is a common mistake I see every time an English speaker tries to speak Spanish, or a Spanish speaker tries to speak English.

  • Mister = Señor
  • Sir = Caballero

When in English you would say “Sir, your umbrella”, do not say “Señor, su paraguas” but “Caballero, su paraguas”. Also, never say “Gracias, señor” for “Thank you, Sir” but just a plain “Gracias”.

Hoy publica El Mundo un artículo titulado Apostar por el bilingüísmo puede ocasionar un problema de tartamudez. El titular dice claramente que los niños bilingües son más propensos a ser tartamudos.

Pero, ¿es cierto?

Pues no.

Basta con leer el artículo para darse cuenta de que ni el periodista, ni los que han hecho el artículo, saben nada de Estadística ni Inferencia Estadística.

El primer error es la población elegida para el estudio: sólo niños tartamudos. Con ese punto de partida, es IMPOSIBLE y TOTALMENTE ERRÓNEO concluir que el bilingüísmo lleva al tartamudeo. Para poder obtener esa conclusión habría que haber hecho el estudio con niños tartamudos monolingües, niños tartamudos bilingües, niños no tartamudos monolingües y niños no tartamudos bilingües. De esos cuatro grupos, sólo los dos primeros estaban en la población elegida para el estudio. Esto, de por sí, ya anula todo el estudio.

Segundo error: sólo clínicas y hospitales públicos. Los padres adinerados llevan a sus hijos a clínicas privadas, así que la población estudiada son niños pobres y tartamudos. ¿Y quién suele encuadrarse entre los pobres tan pobres que ni haciendo un esfuerzo pueden llevar a sus hijos a una clínica privada? Pues los inmigrantes, claro. Que da la casualidad que suelen venir de otro país, así que hablan otro idioma. Eso explica el bilingüísmo de esos niños.

La única conclusión válida que se podría sacar de este estudio es que las familias pobres con niños tartamudos los llevan a clínicas públicas, no privadas. Cualquier otra cosa es errónea o malintencionada.

Es increíble que todavía se publiquen tantos artículos, en periódicos y en revistas de prestigio, que pequen de la falacia del tercer factor (“Cum hoc ergo, propter hoc”).

Para terminar, un ejemplo de un estudio muy antiguo que pecaba también del proper hoc. Se hizo un estudio y se vio que aquellas personas que compraban muchos zapatos, también compraban muchos libros. ¿Sería que leían mientras se ponían los zapatos? ¿Mientras esperaban en la zapatería? ¿Deberíamos regalar zapatos para “fomentar” la lectura, como parecía concluirse del estudio? Pues tampoco: es simplemente que quienes compraban muchos zapatos eran gente con dinero, así que podían permitirse comprar más libros. El estudio ni siquiera miraba si esos libros eran luego leídos: había mucha gente que apenas compraba zapatos, pero iba a la biblioteca y leía más libros que los “comprazapatos compulsivos”

I am adding Strigi support to an application using the Strigi socket interface (it’s faster than DBus and, in my case, easier to use). When using the socket interface, Strigi needs to to know where the socket should be created (for instance, /home/pgquiles/.strigi/socket) and it will search for indices in a subdirectory of that directory (/home/pgquiles/.strigi/clucene if using the CLucene backend, /home/pgquiles/.strigi/estraier if using the HyperEstraier backend, etc).

So I was telling Strigi the socket should be created in /home/pgquiles/.strigi/socket and to use the CLucene backend, thus indices would be looked for in /home/pgquiles/.strigi/clucene. Problem is, I was not getting any result back!

    std::string socketpath("/.strigi/socket");

    const char *homeVariableName = "HOME";
    char *home = getenv(homeVariableName);

    if( 0 != home ) {
      std::string socketpath = std::string(home) + "/.strigi/socket";      
    }

    socket.setSocketPath( (const char*)socketpath.c_str() );

Notice the subtle error with block-scoped std::string socketpath hiding method-scoped std::string socketpath. Due to that, Strigi tried to use a socket from /.strigi/socket (which did not exist) instead of the right one, so it did not even try to look for indices!.

By coincidence, today I arrive to the ACCU website. ACCU is an organisation of programmers who care about professionalism in programming and are dedicated to raising the standard of programming. They publish a magazine (C Vu) and a newsletter (Overload), and organize a yearly conference in Oxford, UK. Slides from last year’s conference are available online and seem quite interesting. Next year‘s conference is from April 22 to April 25 and one of the three tracks will be about patterns.

Yesterday my girlfriend and I went to the movies to see Batman: The Dark Knight but it was not without trouble!

Instead of going to nearby cinemas, as we usually do, we went to the IMF Cinemas in Torrevieja (a 45-min drive from home) because their website lists the movie as being played in original version (i. e. English) instead of the dubbed Spanish version. In case you didn’t know, movies are dubbed in Spain.

First of all, signs to the mall where the cinemas are located are scarce, so we ended up near the seafront. As we had plenty of time, we took the opportunity to go for a walk. Not that bad, in the end, but it we had been tight on time we would have not arrived in time for the movie.

After asking for directions twice, we arrived into the mall. Surprise: traffic jam due to lots of cars and only one lane in each direction. Second surprise: each shop has got its parking and the parking exit is closed when the shop closes. Given that we went to the 22.00 movie, that meant we had no other option than going to the cinema’s parking, which was already packed (first time we tried to get in it was complete, 15 minutes later we were luckier and got a spot).

But I’m not writing because it was difficult to get to the shopping center or to park my car. I’m writing because I was lied: I went to see a movie in original version but the movie is played in Spanish!

Turns out if you want to listen to the movie in English you have to deposit 20 EUR and you get a headphone set. You tune channel 1 and after 5 minutes you give up. You give up because the audio track in Spanish is so loud (the loudest cinema I’ve been in my life!) it’s impossible to properly understand the English audio. That’s in case you put up with the glitches, static and interruptions in the audio. “Latest infrarred technology”? Don’t make me laugh!

Other than that, the movie is OK. I don’t understand so much fanfare. I’ve read reviews which compare it to The Godfather. Give-me-a-break. It’s not even close!

This is mostly a self-reminder

I attended aKademy 2008 and there are so many things to write about I don’t even know what to start with. I’ll probably write something in a few days, when I’m feeling less sick (thanks to a Flemish waiter who had the OpenBossa guys, Knut and I waiting for almost one hour for dinner, I got a cold).

As you may know, part of my job (and hobby, too) consists on “shaking” software to make it compile on different platforms and with different compilers: I port Linux software which builds with gcc to Windows with Visual C++, or Visual C++ to MingW, or… well, whatever. It’s funny.

Back on topic: Wednesday as the Sun tutorials day and I got immediately interested in Sun Studio. Message to Sun Microsystems people: your installer is so broken on Linux it is impossible to make it work on Debian and Ubuntu (and I guess on anything other than RHEL). The only way I found to “install” SS12 was to download the Express version, remove the sh-code and untar the resulting package. It works but it’s so nasty hardly anybody would try that.

Sun Studio 12 is 100% ISO C++ compliant, which means support for wchar_t is not as good as most applications require nowadays. The best way to overcome this limitation is to use Apache Foundation’s STDCXX to replace SS12’s STL (which is STLport 4 (according to Adriaan, stdcxx would roughly correspond to STLport 6)

Building STDCXX is relatively easy, if you know the tricks:

  • export PATH=/path/to/sunstudioceres/bin/:$PATH
  • export CC=/path/to/sunstudioceres/bin/suncc
  • export CPP=/path/to/sunstudioceres/bin/suncc
  • export CXX=/path/to/sunstudioceres/bin/sunCC
  • You should be able to do this step by exporting CFLAGS, etc but it won’t work, so edit stdcxx-4.2.1/etc/config/sunpro.config and:
  • Replace
    CXXFLAGS= -library=%none
    with
    CXXFLAGS = -library=no%Cstd -YI,/path/to/source/of/stdcxx/include/
  • Replace
    CPPFLAGS =
    with
    CPPFLAGS = -YI,/path/to/source/of/stdcxx/include/
  • Replace
    LDFLAGS= -library=%none
    with
    LDFLAGS = -library=no%Cstd
  • make BUILDTYPE=12d
  • make locales(if you don’t use BUILDTYPE=12d, current Sun Studio Express Edition fails with yi_US, thus you need to edit stdcxx-4.2.1/etc/nls/gen_list and remove that line)
  • cd build && make install PREFIX=/where/you/want/to/install/stdcxx
  • At the moment, I’m trying to get Wt built with Sun Studio 12 on Linux. Given that SS12 is the compiler of choice for KDE4 on Solaris, I may try to get KDE4 built on Linux with SS12 at a later stage. That would help both the Solaris port and the Linux code.

    PS: Hello Planet KDE