Confoederatio Helvetica

It’s crossing my mind to move here in ~ two years.

Today we visited Zug; it has a Ferrari shop.

Zug, where an apartment costs far more than a villa in Belgium. Briefly a million euros.

It also comforts me. I could be here. Zug has a volière with exotic birds and a lake.

When Tinne and me were driving back to Oerlikon, we listened to Karoliina’s Symphonic dream.

The music; a canvas for the paint, Switzerland.

Die Lichter auf dem Berg. Die sind alle Seelen.

From grey mouse to putschist. That was quick.

Congratulations to Mr. Van Rompuy for helping the EU powers to find a compromise.

Diplomats credit him with a shrewd sense of deal-making and a determination that is belied by his quiet anti-charisma, and he has already begun to win plaudits from Paris, Berlin and other capitals.

Financial Times, Saturday Mar 27 2010 (alt. link)

Finally a politician to be proud of as a Belgian!

The mouse is dull grey
It steps into the sunshine
The mouse is snow white

Reporting busy status

We’re nearing our first release since very long, so I’ll do another technical blog post about Tracker ;)

When the RDF store is replaying its journal at startup and when the RDF store is restoring a backup it can be in busy state. This means that we can’t handle your DBus requests during that time; your DBus method will be returned late.

Because that’s not very nice from a UI perspective (the uh, what is going on?? -syndrome kicks in) we’re adding a signal emission that emits the progression and status. You can also ask it using DBus methods GetProgress and GetStatus.

The miners already had something like this, so I kept the API more or less the same.

signal sender=:1.99 -> dest=(null destination) serial=1454
  path=/org/freedesktop/Tracker1/Status;
  interface=org.freedesktop.Tracker1.Status; member=Progress
   string "Journal replaying"
   double 0.197824
signal sender=:1.99 -> dest=(null destination) serial=1455
  path=/org/freedesktop/Tracker1/Status;
  interface=org.freedesktop.Tracker1.Status; member=Progress
   string "Journal replaying"
   double 0.698153

Jürg just reviewed the SPARQL regex performance improvement of yesterday, so that’s now in master. If you want this busy status notifying today already you can test with the busy-notifications branch.

Performance improvements for SPARQL’s regex in Tracker

The original SPARQL regex support of Tracker is using a custom SQLite function. But of course back when we wrote it we didn’t yet think much about optimizing. As a result, we were using g_regex_match_simple which of course recompiles the regular expression each time.

Today Jürg and me found out about sqlite3_get_auxdata and sqlite3_set_auxdata which allows us to cache a compiled value for a specific custom SQLite function for the duration of the query.

This is much better:

static void
function_sparql_regex (sqlite3_context *context,
                       int              argc,
                       sqlite3_value   *argv[])
{
  gboolean ret;
  const gchar *text, *pattern, *flags;
  GRegexCompileFlags regex_flags;
  GRegex *regex;

  if (argc != 3) {
    sqlite3_result_error (context, "Invalid argument count", -1);
    return;
  }

  regex = sqlite3_get_auxdata (context, 1);
  text = sqlite3_value_text (argv[0]);
  flags = sqlite3_value_text (argv[2]);
  if (regex == NULL) {
    gchar *err_str;
    GError *error = NULL;
    pattern = sqlite3_value_text (argv[1]);
    regex_flags = 0;
    while (*flags) {
      switch (*flags) {
      case 's': regex_flags |= G_REGEX_DOTALL; break;
      case 'm': regex_flags |= G_REGEX_MULTILINE; break;
      case 'i': regex_flags |= G_REGEX_CASELESS; break;
      case 'x': regex_flags |= G_REGEX_EXTENDED; break;
      default:
        err_str = g_strdup_printf ("Invalid SPARQL regex flag '%c'", *flags);
        sqlite3_result_error (context, err_str, -1);
        g_free (err_str);
        return;
      }
      flags++;
    }
    regex = g_regex_new (pattern, regex_flags, 0, &error);
    if (error) {
      sqlite3_result_error (context, error->message, error->code);
      g_clear_error (&error);
      return;
    }
    sqlite3_set_auxdata (context, 1, regex, (void (*) (void*)) g_regex_unref);
  }
  ret = g_regex_match (regex, text, 0, NULL);
  sqlite3_result_int (context, ret);
  return;
}

Before (this was a test on a huge amount of resources):

$ time tracker-sparql -q "select ?u { ?u a rdfs:Resource . FILTER (regex(?u, '^titl', 'i')) }"
real	0m3.337s
user	0m0.004s
sys	0m0.008s

After:

$ time tracker-sparql -q "select ?u { ?u a rdfs:Resource . FILTER (regex(?u, '^titl', 'i')) }"
real	0m1.887s
user	0m0.008s
sys	0m0.008s

This will hit Tracker’s master today or tomorrow.

Working hard at the Tracker project

Today we improved journal replaying from 1050s for my test of 25249 resources to 58s.

Journal replaying happens when your cache database gets corrupted. Also when you restore a backup: restore uses the same code the journal replaying uses, backup just makes a copy of your journal.

During the performance improvements we of course found other areas related to data entry. It looks like we’re entering a period of focus on performance, as we have a few interesting ideas for next week already. The ideas for next week will focus on performance of some SPARQL functions like regex.

Meanwhile are Michele Tameni and Roberto Guido working on a RSS miner for Tracker and has Adrien Bustany been working on other web miners like for Flickr, GData, Twitter and Facebook.

I think the first pieces of the RSS- and the other web miners will start becoming available in this week’s unstable 0.7 release. Martyn is still reviewing the branches of the guys, but we’re very lucky with such good software developers as contributors. Very nice work Michele, Roberto and Adrien!

The future of the European community, a European Monetary Fund.

I’m worried about the EURO’s M3 if a European version of the IMF (a EMF) is to be installed.

Nonetheless, I think the European community should do it just to strengthen Europe’s economy. I’m not satisfied by Europe’s economic strength: I want it to be undefeatable.

We must not let the IMF solve our problems. Europe might be a political dwarf, but we Europeans should show that we will solve our own problems. We’re an adult composition of cultures with vast amounts of experience. We know how to solve any imaginable problem. And let’s not, in our defeatism, pretend we don’t.

A EMF is a commitment to future member states: Europe often asks them fundamental changes; economic strength is what Europe offers in return. This needs to come at a highest price: Greece will have to fix their deficit problem. Even if their entire population goes on strike. Greece will be an example for countries like my own: Belgium has to fix a serious deficit problem, too.

An EMF comes at an equally high price, and that frightens me a bit: I don’t want the ECB to go as ballistic on money creation as the FED has been last two years. I want the EURO to be the strongest relevant currency mankind has ever created. No matter how insane the rest of the world thinks that ambition is: I believe that keeping the EURO’s M3 in check is a key to creating a wealthy society in Europe.

Politically I want European nations to negotiate more and more often. The European Union is a political dwarf only because finding agreement is hard. But in the long run will our solution be the most negotiated, most tested on this planet.

Together we can deal with anything. That doesn’t mean it’ll be easy; it has never been easy: just seventy years ago we were still killing each other. We’re all guilty of that one way or another. And before that it wasn’t any better. Today, not that many people still care: “it wasn’t me”, right? So stop being a bitch about it, then.

It’s time to let it be. It’s time to start a new European century that will be better. With respect for all European cultures, languages, nations, nationalities, values, borders and interests.

But also a European century with economic responsibilities for each member. It’s our strength: we figured out how to keep our population wealthy: let’s continue doing so in the future.

Emotional (and social) intelligence

It was the dawn of the 1970s, at the height of worldwide student protests against the Vietnam War, and a librarian stationed at a U.S. Information Agency post abroad had received bad news: A student group was threatening to burn down her library.

But the librarian had friends among the group of student activists who made the threat. Her response on first glance might seem either naïve or foolhardy — or both: She invited the group to use the library facilities for some of their meetings.

But she also brought Americans living in the country there to listen to them — and so engineered a dialogue instead of a confrontation.

In doing so, she was capitalizing on her personal relationship with the handful of student leaders she knew well enough to trust — and for them to trust her. The tactic opened new channels of mutual understanding, and it strengthened her friendship with the student leaders. The library was never touched.

(More available at the flash preview widget’s page 21)

— Daniel Goleman, Working With Emotional Intelligence, Competencies of the stars. 1998

In Working with Emotional Intelligence, Daniel Goleman explains several practical methods to improve the social skills of people. Before I bought this book a year or two ago, I read Daniel’s first book Emotional Intelligence. This weekend I finally started reading Working With.

I recommend the section Some Misconceptions. Regretfully ain’t this section available for display in the flash preview widget. Instead of violating copyright laws by typing it down here, I’m recommending to just buy the book.

You can find audiobooks online. The section about misconceptions is at track three. Track five talks about two computer programmers, which is very illustrative for many of my blog’s readers (and possibly myself). I hope you wont illegally download using torrents. Instead, buy the material.

Also very interesting is this lecture by Daniel:

Part 1, Part 2, Part 3

Here you can also find a Authors@Google talk by Daniel Goleman:


What distinguishes Daniel Goleman from old line proponents of positive thinking, however, is his grounding in psychology and neuroscience. Armed with a Ph.D in psychology from Harvard and a first-grade journalism background at the New York Times, Dr. Goleman has authored half a dozen books that explore the physical and chemical workings on the brain and their relationship with what we experience as everyday life.

— Peter Allen, director of Google university, introduction to Daniel Goleman. August 3, 2007

I hope readers of my blog will shun away from pseudo science when it comes to emotional and social intelligence, but instead read and learn from authors like Daniel Goleman. I also (still) recommend the books available at The Moral Brain by for example Dr. Jan Verplaetse.

Tinymail 1.0!

Tinymail‘s co-maintainer Sergio Villar just released Tinymail’s first release.

psst. I have inside information that I might not be allowed to share that 1.2 is being prepared already, and will have bodystructure and envelope summary fetch. And it’ll fetch E-mail body content per requested MIME part, instead of always entire E-mails. Whoohoo!

An ode to our testers

You know about those guys that use your software against huge datasets like their entire filesystem, with thousands of files?

We do. His name is Tshepang Lekhonkhobe and we owe him a few beers for reporting to us many scalability issues.

Today we found and fixed such a scalability issue: the update query to reset the availability of file resources (this is for support for removable media) was causing at least a linear increase of VmRss usage per amount of file resources. For Tshepang’s situation that meant 600 MB of VmRss. Jürg reduced this to 30 MB of peak VmRss in the same use-case, and a performance improvement from minutes to a second or two, three. Without memory fragmentation as glibc is returning almost all of the VmRss back to the kernel.

Thursday is our usual release day. I invite all of the 0.7 pioneers to test us with your huge filesystems, just like Tshepang always does.

So long and thanks for all the testing, Tshepang! I’m glad we finally found it.

Invisible costs


We would rather suffer the visible costs of a few bad decisions than incur the many invisible costs that come from decisions made too slowly – or not at all – because of a stifling bureaucracy.

Letter by Warren E. Buffett to the shareholders of Berkshire, February 26, 2010