Archive for the 'controversial' Category

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

Monday, March 8th, 2010

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

Sunday, March 7th, 2010

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.

The Euro skeptics and pro Europeans are finally united in an opinion!

Thursday, February 25th, 2010

We both agree that Nigel Farage is a complete moron.

Perhaps we should put a damp rag like the one he mentions in his mouth next time he opens it?

Nigel Farage, you’re an disgrace to yourself. The European parliament is no place for personal attacks, and you aren’t fit to carry the title Member of the European Parliament. Please keep the honour to yourself and resign.

Every sensible person outside of the U.K. thinks you should. Even the Euro skeptics do. You’re an embarrassment for your country and its culture, so I hope for the people in the U.K. that they’ll kick you out of politics.

I fear you’re just playing the populist card, and that you’ll even get votes for this from other morons.

Please don’t rewrite softwares (that are) written in .NET

Tuesday, February 9th, 2010

This (super) cool .NET developer and good friend came to me at the FOSDEM bar to tell me he was confused about why during the Tracker presentation I was asking people to replace F-Spot and Banshee.

I hope I didn’t say it like that, I would never intent to say that. But I’ll review the video of the presentation as soon as Rob publishes it.

Anyway, to ensure everybody understood correctly what I did wanted to say (whether or not I did, is another question):

The call was to inspire people to reimplement or to provide different implementations of F-Spot’s and Banshee’s data backends, so that they would use an RDF store like tracker-store instead of each app its own metadata database.

I think I also mentioned Rhythmbox in the same sentence because the last thing I would want is to turn this into a .NET vs. anti-.NET debate. It just happens to be that the best GNOME softwares for photo and music management are written in .NET (and that has a good reason).

People who know me also know that I think those anti-.NET people are disruptive ignorable people. I also actively and willingly ignore them (and they should know this). I’m actually a big fan of the Mono platform.

I’ll try to ensure that I don’t create this confusion during presentations anymore.

Tough talk

Friday, January 29th, 2010

Not all discussions are easy. If discussions were to be easy, the bar wouldn’t be high enough for your bullshit filter to be effective here.

During dark hours of discussions the nineties syndrome of wanting immediate results plays its role among spectators: It’s not a popular job to be a dissident. It’s not popular to be critical about a (the leader of a) popular idea. This is illustrated by the intellectually absurd criticisms David Schlesinger receives.

Yet is the critic who monitors the organs of a society key to that organ either producing for its stakeholders, or failing and dragging the entire society it serves down with it.

In Western Europe we traded Kings and Popes for a government that is held accountable by an opposition. Many countries and cultures adopted this system of governance. That’s because it undeniably works. If you have a better system in mind, that can be put to the test, please come forward.

It is good that the GNOME foundation board has decided to increase the amount of surveys. But I have one request which I didn’t succeed in raising before the end of last year:

Although I accept the decisive role a group of leadership has to take, I want foundation board members and employees to be held accountable for the decisions they make. Especially the ones where they go against the results of such a survey.

But this is not up to me.

*edit* They are showing an old episode of Married with Children on TV, I’ll be back in half an hour!

Dear France

Tuesday, January 26th, 2010

Thank you for trying to forbid the burka. I hope my country will also forbid it. We need to protect (but not overprotect) the women of Muslim cultures, cultures who are massively migrating to Western Europe at this moment, against the oppressive anti-woman and religious nature of the burka.

I don’t believe, at all, that the burka is an expression of free speech. I believe it’s an instrument to oppress woman, and that this is its only purpose. There is no place for that in Western European culture. None. And we must be assertive about it.

I’d also like to ask Muslim countries to stay out of the debate: we decide about Western European values, you don’t. Equality between men and woman is a Western European value. If you don’t like that, sorry, it’s not negotiable.

The role of media in the USA

Monday, January 18th, 2010

Two posts ago I wrote that something like The Real news is quite unique in the U.S.’s completely broken media.

Today I found an interesting double interview on AlJazeeraEnglish by Riz Khan titled Has the mainstream media in the US replaced serious coverage with “junk news” and tabloidism?


Reconciling

Monday, December 21st, 2009

The discussion with Richard Stallman ended with requested silence.

I’d like to ask people to use the following meme for future such discussions:

La pensée ne doit jamais se soumettre, ni à un dogme, ni à un parti, ni à une passion, ni à un intérêt, ni à une idée préconçue, ni à quoi que ce soit, si ce n’est aux faits eux-mêmes, parce que, pour elle, se soumettre, ce serait cesser d’être.

Henri Poincaré, University of Brussels (1909-11-19)

As for the conclusions. I believe this survey result and this analysis are conclusive.

No reason

Monday, December 14th, 2009

I would like to dedicate this moment to this version of Metallica’s Nothing Else Matters.

Jono, our Metal fan, probably agrees with me that even the toughest person in the world of Metal can be brought to his knees, crying.

It’s a moment of reconciliation. What is it that we want?

I think more than ever, we do understand each other.

I don’t know.

Bla bla bla, subqueries in SPARQL, bla bla

Tuesday, December 8th, 2009

Coming to you in a few days is what Jürg has been working on for last week.

Yeah, you guess it right by looking at the query below: subqueries!

This example shows you the amount of E-mails each contact has ever sent to you:

SELECT ?address
    (SELECT COUNT(?msg) AS ?msgcnt WHERE { ?msg nmo:from ?from })
WHERE {
    ?from a nco:Contact ;
          nco:hasEmailAddress ?address .
}

The usual warnings apply here: I’m way early with this announcement. It’s somewhat implemented but insanely experimental. The SPARQL spec has something for this in a draft wiki page. Due to lack of error reporting and detection it’s easy to make stuff crash or to get it to generate wrong native SQL queries.

But then again, you guys are developers. You like that!

Why are we doing this? Ah, some team at an undisclosed company was worried about performance and D-Bus overhead: They had to do a lot of small queries after doing a parent query. You know, a bunch of aggregate functions for counts, showing the last message of somebody, stuff like that.

I should probably not mention this feature yet. It’s too experimental. But so exciting!

Anyway, here’s the messy branch and here’s the reviewed stuff for bringing this feature into master.

ps. I wish I could show you guys the query that we support for that team. It’s awesome. I’ll ask around.

Debian, wtf! @#**&#

Friday, November 27th, 2009

We all woke up with a broken debian testing this morning.

You fix it by removing /boot from the Grub entries. You type ‘e’ and then you go to the vmlinuz line, and you remove “/boot” from that line.

Thanks Debian guys! Remember that normal people would have reformatted their computer and called debian “junk”. You’re even making the software developers nervous. We install debian testing because we don’t like Ubuntu’s broken upgrades. You don’t have to copy this.

Cheers.

ps. I of course understand that testing != stable. But still, Grub? That’s a drastic way to make your point about Debian testing being unstable :-)
Edit: Apparently I was on unstable for the system where this failed. That might explain it.

Handling triplets arriving in tracker-store, CouchDB integration as use-case

Sunday, November 22nd, 2009

At GCDS Jamie told us that he wants to make a plugin for tracker-store that writes all the triplets to a CouchDB instance.

Letting a CouchDB be a sort of offline backup isn’t very interesting. You want triples to go into the CouchDB at the moment of guaranteed storage: at commit time.

For the purpose of developing this we provide the following internal API.

typedef void (*TrackerStatementCallback) (const gchar *graph,
                                          const gchar *subject,
                                          const gchar *predicate,
                                          const gchar *object,
                                          GPtrArray   *rdf_types,
                                          gpointer     user_data);
typedef void (*TrackerCommitCallback)    (gpointer     user_data);

tracker_data_add_insert_statement_callback (TrackerStatementCallback callback,
                                            gpointer                 user_data);
tracker_data_add_delete_statement_callback (TrackerStatementCallback callback,
                                            gpointer                 user_data);
tracker_data_add_commit_statement_callback (TrackerCommitCallback callback,
                                            gpointer              user_data);

You’ll need to make a plugin for tracker-store and make the hook at the initialization of your plugin.

Current behaviour is when graph is NULL, it means that the default graph is being used. If it’s not NULL, it means that you probably don’t want the data in CouchDB: it’s data that’s coming from a miner. You probably only want to store data that is coming from the user. His applications won’t use FROM and INTO for their SPARQL Update queries, meaning that graph is NULL.

Very important is that your callback handler works with bottom halves: put your expensive task on a queue and handle the queued item somewhere else. You can for example use a GThreadPool or a GQueue plus a g_idle_add_full with G_PRIORITY_LOW callback picking items one by one on the mainloop. You should never have a TrackerStatementCallback or a TrackerCommitCallback that blocks. Not even a tiny tiny bit of blocking: it’ll bring everything in tracker-store on its knees. It’s why we aren’t giving you a public plugin API with a way to install your own plugins outside of the Tracker project.

By the way: we want to see code instead of talk before we further optimize things for this purpose.

Who the fuck is this guy?!

Thursday, November 19th, 2009

While you guys are all wondering who he is, we in Belgium are wondering who’s going to replace Herman Van Rompuy as our prime minister.

He’s the only prime minister who managed to give Belgium non-chaotic federal politics, for a few months.

I fear that Belgium will now plunge into a new political crisis. Not because the former prime-minister, Yves Leterme, is a bad one, but because the Walloons simply don’t want him. We know they’ll do everything in their power to discredit Yves. Especially their media will. Le Soir already publicly said that they’ll “veto” Yves Leterme as prime minister. As if a newspaper elects ministers. Arrogance.

Anyway.

If the price for delivering the first president of Europe is that we must pay with a new political crisis, I guess that we are so used to politic crisis that it’s okay. We’ll survive. You guys can have him.

He’s quite intelligent. He’s not a media guy. We don’t know more about him ourselves. Use wikipedia.

The real bad thing about Herman is that in the past he let religion influence his politics. He was for example against abortion laws. And he is against Turkey joining the union because of religious differences.

However. For the people from the United Kingdom: fuck your conservative tabloid magazines. To the idiot editors of those tabloids: discrediting Van Rompuy was easy, still you guys screwed up with retarded articles about Belgium.

ps. I don’t care that you don’t want politics on planet.gnome. It pulls from my blog, so ask the administrators of planet.gnome to pick the right categories. I say this because I know that people will otherwise comment about it. I want them to know that I don’t care.

Writeback, writing metadata back into your files

Wednesday, November 11th, 2009

Today, I feel like exposing you to some bleeding edge development going on as we speak at the Tracker team. I know you’re scared of that and that’s precisely why I want to expose you! Hah.

We are prototyping writeback support for Tracker.

With writeback we mean writing metadata that the user passes to us via SPARQL UPDATE into the file that he’s describing.

This means that it must be about a thing that is stored, that it must update a property that we want to writeback and it means that we need to support the format.

OK, that’s three requirements before we write anything back. Let’s explain how this stuff works in the prototype!

In our prototype you mark properties that are eligible for being written into the files using tracker:writeback.

It goes like this:

nie:title a rdf:Property ;
   rdfs:label "Title" ;
   rdfs:comment "The title of the document" ;
   rdfs:subPropertyOf dc:title ;
   nrl:maxCardinality 1 ;
   rdfs:domain nie:InformationElement ;
   rdfs:range xsd:string ;
   tracker:fulltextIndexed true ;
   tracker:weight 10 ;
   tracker:writeback true .

Next you need a writeback module for tracker-writeback. We implemented a prototype one that can only write the title of MP3 files. It uses ID3lib’s C API.

When the user is describing a file, the resource must have nie:isStoredAs. The property being changed ’s tracker:writeback must be true. We want the value of the property too. That’s simple in SPARQL, right? Sure it is!

SELECT ?url ?predicate ?object {
    <$subject> ?predicate ?object ;
               nie:isStoredAs ?url .
    ?predicate tracker:writeback true
 }

You’ll find this query in the code, go look!

Now it’s simple: using ID3lib we map Nepomuk to ID3 and write it.

No don’t be afraid, we’re not going to writeback metadata that we found ourselves. We’ll only writeback data that the user provided in the form of a SPARQL Update on the default graph. No panic. Besides, using tracker-writeback is going to be completely optional (just don’t run it).

This is a prototype, I repeat, this is a prototype. No expectations yet please. Just feel exposed to scary stuff, get overly excited and then join us by contributing. It’s all public what we’re doing in the branch ‘writeback’.

ps. Whether this will be Maemo’s future metadata-write stuff? Hmm, I don’t know. Do you know? ;-)

Keeping the autotools guys happy with qmake

Tuesday, October 20th, 2009

I’m still figuring out how to do the same thing with cmake, but various bloggers and comments appear to be promising that it’ll be even more easy.

But this is a message for probably all Nokia teams who are making Qt-based libraries:

First open your src/src.pro file and add this stuff:

CONFIG += create_pc create_prl
QMAKE_PKGCONFIG_REQUIRES = QtGui
pkgconfig.files = packagename.pc
pkgconfig.path = $$(DESTDIR)$$[QT_INSTALL_LIBS]/pkgconfig
INSTALLS += target headers pkgconfig

Now open your debian/$package-dev.install file and add this line:

usr/lib/pkgconfig

You’ll be doing all the autotools people a tremendous favor.

Next, open the README file and document that you need to use qmake-qt4 on Debian or make either qmake-qt3 or qmake-qt4 work flawlessly with your build environment. Perhaps also mention how to set the install prefix, how to make qmake find and install .pc files in another location, stuff like that. I find that this is lacking for almost every Qt-based library.

You’ll be doing everybody who wants to use your software a tremendous favor.

The act of making …

Sunday, October 4th, 2009

To be a Rubens, is to make paintings

Indentation

Friday, September 25th, 2009

People,

Let’s all stop doing this:

static void
my_calling_function_wrong (void)
{
[tab]MyItem1 *item1;
[tab]MyItem2 *item2;
[tab]MyItem3 *item3;

[tab]my_long_funcion (item1,
[tab][tab][tab][tab]..item2,
[tab][tab][tab][tab]..item3);
}

And start doing this:

static void
my_calling_function_right (void)
{
[tab]MyItem1 *item1;
[tab]MyItem2 *item2;
[tab]MyItem3 *item3;

[tab]my_long_funcion (item1,
[tab].................item2,
[tab].................item3);
}

The former doesn’t make sense unless each and every code viewing text display understands Mode lines’ tab-width property. The latter just always works, with every normal text editor.

ps. The super cool guys at Anjuta have already fixed this for me. I’m sure the even more cool EMacsers and the uber cool vimers can also fix their text editors?

Unnecessary note: [tab] is a tab and . is a space in the examples.

Melk

Thursday, September 17th, 2009

Veel mensen beweren dat indien je de prijs van een product artificieel verhoogt dat je daardoor de producent ervan rijker maakt. Laten we melk als voorbeeld nemen om dit gesprek wat minder abstract te maken.

Europese overheden worden momenteel door belangengroepen en stakende boeren gedwongen om de prijs van melk artificieel te maken. Met andere woorden wordt de overheid gevraagd om het concept van vrije marktprijzen voor melk los te laten. Dus zelf maar te gaan bepalen wat de prijs voor melk hoort te zijn. Niet de markt maar wel politici en belangengroepen moeten dan bepalen wat die prijs zou moeten zijn.

Het probleem is dat volgorde van nut, van melk, niet wijzigt wanneer incompetente mensen een prijs vastleggen.

Met melk kan veel gedaan worden. Je kan er yoghurt mee maken, je kan het gewoon drinken, je kan er een kind een gezond drankje mee geven, je kan er kaas mee maken, je kan er chocolade mee maken, en zo verder. Zoals bijna alle producten is het veelzijdig.

Ieder individu heeft een voorkeurenladder voor zijn melk doelen. Tegenwoordig hebben we een ruilmiddel dat we geld noemen. Maar laten we voor de grap minuten werk gebruiken als eenheidsprijs. Je kan stellen dat een mens een zekere hoeveelheid werktijd over heeft voor ieder van zijn melk doelen.

Laat me een voorbeeld maken. Deze lijst hangt af van persoon tot persoon, maar kan slechts enkel objectief vastgesteld worden door naar handelingen te kijken. Niet door naar iemand zijn beweringen te luisteren. Stel dat we de volgende vaststelling doen bij de man:

  • Zijn kind melk geven - 8 minuten werk voor over
  • Zelf melk drinken - 6 minuten werk voor over
  • Yoghurt eten - 4 minuten werk voor over
  • Kaas eten - 4 minuten werk voor over
  • Chocolade eten - 3 minuten werk voor over

Dit betekent dat de persoon 8 minuten wil werken om zijn kind een gezonde drank te geven. Hij wil echter maximaal 6 minuten werken om zelf melk te kunnen drinken. Yoghurt vindt hij wel lekker, maar minder belangrijk. Dus heeft de man 4 minuten werk voor yoghurt over. En zo verder.

We zullen om het eenvoudig te houden elk van deze handelingen gelijk stellen aan één liter melk. Dit is in werkelijkheid niet het geval maar het maakt het voorbeeld eenvoudig zonder af te doen aan de logica.

Stel dat we in totaal 10 liter melk hebben voor één man. Hij wil het kind melk geven en heeft daar 8 minuten voor over. Daarna wil hij zelf melk drinken. In totaal verbruikt hij nu 2 liter melk. Hij wil ook yoghurt eten. Hij wil kaas eten, en zelfs chocolade. Al die doelen zijn mogelijk want er is voldoende melk.

De man zal nu al zijn doelen invullen door de melk te kopen aan 3 minuten per liter. Met andere woorden koopt hij in totaal 5 liter melk voor 15 minuten werk. Er is een melk overschot van 5 liter. De producent heeft dus 5 liter teveel geproduceerd. Maar de producent heeft ook werkuren in die melk moeten stoppen. Hij zal dus niet toelaten dat de man oneindig laag gaat in wat hij over heeft voor melk.

Stel nu dat de regering bij wet vastlegt dat een liter melk niet 3 minuten maar wel 5 minuten werk moet kosten. We herhalen ons voorbeeld.

Hij wil nog steeds zijn kind melk geven. Daar heeft hij 8 minuten werk voor over. Daarna drinkt hij zelf melk, daar zou hij 6 minuten werk voor over hebben. Maar voor yoghurt heeft hij niet meer de prijs van 5 minuten werk over, dat is immers meer dan de 4 minuten die hij er voor over heeft. De persoon koopt dus géén yoghurt. Hij koopt ook géén kaas en hij koopt géén chocolade. Die producten kosten allemaal meer dan wat hij over heeft voor de liter melk die ze vereisen. In totaal heeft hij 2 liter melk gekocht voor 10 minuten werk en is er 8 liter overschot.

Door de prijs van melk vast te leggen zorgt de regering er dus voor dat bedrijven die yoghurt, kaas en chocolade maken failliet gaan en creëert het een nog grotere melk overschot.

Het kost ons allen belastingen om die melk op te kopen, en meer aan sociale zekerheid om werkloosheidsuitkeringen uit te betalen voor mensen in de sectoren kaas, chocolade en yoghurt.

Daarbovenop creëert men armoede in landen waar Europa de opgekochte overschot aan melk aan dumpingprijzen op de markt gooit. Hierdoor kunnen plaatselijke boeren niet concurrentieel zijn en worden ze werkloos. In tegenstelling tot werkloos zijn in ons land, wat werkelijk het paradijs op aarde is met brugpensioenen, gratis huisvesting, een legioen aan mensen die werk voor je zoeken en een royale uitkering, betekent het daarginds dat de boer, zijn vrouw en zijn kinderen sterven van de honger.

Dus wanneer we er dan toch ideologie bij roepen dan blijkt dat in een geglobaliseerde samenleving zoals de onze het vastleggen van prijzen door de regering immoreel is.

Ook de boeren die melk produceren gaan mee moeten opdraaien voor extra belastingen. Dat is het enige dat de regering heeft gedaan voor de boer: meer belastingen opgelegd.

Het is dus niet logisch te stellen dat wanneer je de prijs van melk artificieel maakt, dat de producent dan meer geld krijgt. Het enige wat wijzigt, is de omvang van de persoonlijke tabellen van doelen die mensen hebben die in aanmerkingen komen voor melk.

Heel wat leiders van belangengroepen, vooral socialistische, moeten hoogdringend enkele basis lessen economie volgen en moeten nog dringender ophouden met populisme. Zij maken ons land er werkelijk mee kapot en creëren armoede in andere landen.

Iedereen heeft het moeilijk, boeren hoeven geen voorkeursbehandeling te krijgen ten koste van anderen.

A reason to get up in the morning

Friday, August 28th, 2009

Ever since Nokia contacted me about improving Tinymail to make it suitable for their Modest E-mail client have they given me a reason to get up in the morning, to work on something of which I knew would someday kick ass.

With the Maemo5 based Nokia N900 device we’ll have Modest shipped by default, and Tracker being actively used by several of its softwares. Future is going to shine even brighter for Tracker. Hard to brag about it, Tracker is inherently a background thing. Ah, well, technical people know about it.

Having worked on Tracker for more than a year, I now understand Tracker’s potential. At first, while I was trying to make an API for- and store the summary of E-mail envelope headers, so that E-mail clients can access this in a memory efficient way, I was critical of this Tracker stuff.

But then I joined Ivan, Urho, Ottela, Martyn and Carlos who were working on Tracker. Later Jürg joined and at the Berlin Hackfest people like Rob Taylor, Jürg and Urho discussed replacing Tracker’s poorer own ontology with Nepomuk and replacing its query language with SPARQL.

Given the implied complexity I was again critical, but then that crazy Jürg guy in a few weeks time turned Tracker into 99.9% pure fine awesomeness. I quickly joined working on this crazy “vstore” branch. Since a few months we have convinced the other Tracker guys to just start calling it “master”.

Ever since I feel again like a student who is learning how to develop software. Jürg is utilizing so many good techniques and we’re implementing so many specifications that are just “the right thing to do”, that the beautify of it all could sometimes make me cry of happiness.

Thanks to creating the opportunity to develop on software that will be used on for example their N900 device, Nokia continues giving people like me a reason to get up in the morning.

Don’t tell the native Nokians, but that’s why the N900 announcements secretly also made me a little bit proud. To whoever of us that worked on this stuff: guys, we’re all doing a great job. Let’s make the next one even better!

As it should be

Monday, August 24th, 2009

Last week I wrote down why I believe the model should not have anything about columns. In .NET many people only ever used DataTables as their models. Because of that they often believe that in .NET the model must contain the columns.

They forget that DataGridView ’s DataSource doesn’t require a DataTable at all, DataTable just happens to implement what DataSource needs: IList. It’s correct that if the model has all information that .NET’s many databinding components will get all the information they need out of your model. But it ain’t true that this is the only way nor a by-design in .NET. In .NET the by-design is that the view has all this and the model *can* pass it, if it has it, but it doesn’t have to.

In this example I illustrate that in .NET you can do a databinding with a simple .NET array. In .NET simple arrays implement IList. When a column of the DataGridView isn’t ReadOnly the property setter of the instance in the array will be called after the user edited the cell. I’ll illustrate this in the dataGridView1_CellEndEdit method: the property setter of the property Age of the Person instance being edited will be called. The view will as a result of a Refresh fetch the model’s new values. The Changed property will be rendered as True, for the Person that got changed.

People with VS.NET can drag a DataGridView and a Button on a Windows Form, and copypaste the Person class, button1_Click’s and dataGridView1_CellEndEdit’s code over. It’ll work.

// No DataTable, I'm not even importing System.Data, IList is fine
using System;
using System.Windows.Forms;

public partial class Form1 : Form
{
    public Form1() [+]

    private void button1_Click(object sender, EventArgs e) {
        dataGridView1.AutoGenerateColumns = false;

        DataGridViewColumn column;

        column = new DataGridViewTextBoxColumn();

        column.DataPropertyName = "Name";
        column.HeaderText = "The name of the person";
        column.Width = 180;

        // As you can see we are not doing anything on the model
        // to tell the view what the columns are.

        dataGridView1.Columns.Add(column);

        column = new DataGridViewTextBoxColumn();
        column.DataPropertyName = "Age";
        column.HeaderText = "The age";
        column.Width = 70;

        // Let's make this one editable
        column.ReadOnly = false;

        // We're just telling the view about the properties it
        // needs to bind, using the DataPropertyName member of
        // a DataGridViewColumn

        dataGridView1.Columns.Add(column);

        // Let's add a column that will show us that the view
        // will fetch property values at refresh

        column = new DataGridViewTextBoxColumn();
        column.DataPropertyName = "Changed";
        column.HeaderText = "?";
        column.Width = 45;

        dataGridView1.Columns.Add(column);

        // This is a normal array in .NET: it implements IList.
        // An IList is a collection with a known order. 

        Person[] people = new Person[2];

        // Let's create two people in this array

        people[0] = new Person();
        people[0].Name = "Jos";
        people[0].Age = 30;
        people[0].Changed = false;

        people[1] = new Person();
        people[1].Name = "Jan";
        people[1].Age = 25;
        people[1].Changed = false;

        // And let's set the model of the view to be that array

        dataGridView1.DataSource = people;
        dataGridView1.CellEndEdit += new DataGridViewCellEventHandler(dataGridView1_CellEndEdit);
    }

    void dataGridView1_CellEndEdit(object sender, DataGridViewCellEventArgs e)
    {
        // This makes the view refresh its currently visible values, by reading
        // them from the model again. This callback happens after the user is
        // done editing a cell.

        dataGridView1.Refresh();
    }
}

public class Person {
    private string name, city;
    private uint age;
    private bool changed;
    public string Name {
        get { return name; }
        set { name = value; }
    }
    public bool Changed {
        get { return changed; }
        set { changed = value; }
    }
    public uint Age {
        get { return age; }
        set {
            age = value;
            Changed = true;
        }
    }
    public string City {
        get { return city; }
        set { city = value; }
    }
}

You can compare a GtkTreeModel with a DataTable in .NET: it’s a model that has its own memory storage and it contains both rows and columns. This means that GtkTreeModel isn’t a generic model, like IList in .NET actually is. With GtkTreeModel you must always represent your data as rows and columns. Even if the data ain’t rows and columns.

I indeed believe that Microsoft got databinding right in their .NET platform, and that Gtk+’s GtkTreeView and GtkTreeModel got it wrong.

Also feel free to have a huge array of Person instances. It’ll only read property values of the visible ones (plus a few more, shouldn’t be much). Fun tip: write something to the console in the property getters of the Person class, and start scrolling. Now you can easily discover yourself how to do lazy loading tricks with MVC in .NET, and make things scale.