Tuesday, August 25, 2009

1984

So yesterday i finished reading 1984, a book written in 1949 about a future 1984 where the world is divided in three mega countries in permanent war. The book talks about Winston Smith a mid-level member of The Party, the dictatorial organization leading one of those 3 mega countries, and how he hates the establishment and how he tries to subvert the system. It also features "telescreens" a fictional two-way camera/television that sees everything and controls everyone.

The book is the first Orwell novel i read (though i read an adaptation for kids of Animal Farm when i was younger) and i found it rather interesting and as a classic in science fiction i think you should read it. The topics it covers are still up to debate: Are "low level classes" with less problems happier than people that know more? Do revolutions just mean changing who is in charge but "exploited people" remain in the same situation? Is government surveillance a good thing? Is torture a valid method to achieve government objectives? Is true love a thing that can not be destroyed?

How not to do a poll

Today i was traveling on the TramBaix back home and noticed a leaflet that said "Imagine the new Diagonal", that said the city council wants to reorganize the Diagonal (one of Barcelona's most important avenues) and wants the citizen feedback. I'm a good citizen so i read the first question, it says:
The Diagonal should be:
a) A space where neighbours and citizens can meet and walk
b) A space to travel using public transport
c) A space to have shops
d) A space with green areas
e) A space for traffic, but with less private cars than right now

And then i saw it made no sense keeping reading, all of the answers are targeted to what the city council wants, so whatever you answer, they will be happy, there's no answers like (not that i agree with them)
x) A space for traffic, but with more space for private cars than right now
y) Remove the TramBaix, it's useless

So basically this is a sham, a fake poll and whoever did it should be ashamed, but it seems we are in a time were politics are not ashamed anymore of any kind of wrongdoing and citizens don't seem to care much :-/

Sunday, August 16, 2009

Trobadour knowledge about QGraphicsScene

If you do not want your QGraphicsView to repaint itself totally do not delete QGraphicsItems without removing them from the QGraphicsScene first.

Thursday, August 13, 2009

Is the X11 engine slower than raster just because of the drivers?

Here was i profiling KSquares and discovered that when painting an antialiased dashed line using the Qt X11 engine you hit a code path in which Qt tries to detect for each dash of the line which other dashes intersect with it, that's right a O(n^2) calculation that makes no sense, that since you are drawing a line the intersections it will find it's that a dash only intersects with itself. So seeing things like that i wonder if the Raster engine is faster because X11 drivers suck we have been told or it's that the X11 engine code is not as good as it could be. I've checked and the raster engine has no such "bad" loop

Friday, August 07, 2009

Even more symbian woes

Symbian has pthreads support, but it sucks, yesterday i discovered it has a maximum number of threads you can create, that is

void *dumb_thread(void *)
{
pthread_exit(NULL)
}

function_somewhere_in_my_code()
{
pthread_t t;
int error = pthread_create(&t, NULL, dumb_thread, NULL);
check_error();
pthread_join(t, NULL);
call_function_somewhere_in_my_code_though_a_timer();
}

will end up returning error 35 (EAGAIN) in pthread_create after some calls, depending on the phone it can be 20000 or 60000, and yes, that's a lot of threads, but if you are using threads for fire and forget jobs it's relatively easy to hit that number, so i've been forced to implement a thread pool just to workaround yetAnotherSymbianBug.

And yes, this has nothing to do with KDE, except that the more i code in Symbian the more i appreciate the rock solid API provided by KDE and Qt

Monday, August 03, 2009

Symbian stringstream woes

Here i am, wondering why the hell Symbian code is so bad after all the years that have passed since it was created. I was bitten by the "select() memory leak" bug some months ago and now i've been bitten by the "stringstream is not thread-safe" bug. One wonders if such simple things fail[1] what more can be hidden in the deeps of the Symbian code, i think it's time for the Symbian Foundation to open up the code already.

[1] Ok, actually the "select() memory leak" got fixed (or so i was told) after i reported the bug in the Symbian Foundation bugzilla and the "stringstream is not thread-safe" seems to be fixed either in the OpenC/C++ 1.5.5 beta that can be dowloaded from the trolls site or in the new firmware for the N78 (can't tell which one fixes things as i updated both)

Saturday, August 01, 2009

Help translating KDE

KDE has a strong translators community being one of the most translated software all around but as all areas of [Free] Software development the more people helping the better, so you should consider going to http://l10n.kde.org/teams-list.php and contact the team of your language. In case the point your team is marked as inactive or the contact for your team does not answer, you should contact the general list for KDE i18n where we'll give you further guidance.

"Why should i translate if i already understand english?" will you ask yourself. There is no definitive answer to that but i can give you two reasons:

  • As any contribution to Free Software will make your karma go up and you'll be part of something BIG

  • It will help you improve your english and your native language knowledge. That's because most of the times you understand english enough to understand the sentence, but transforming it to correct native language in a semantic and sintatic way is not always simple so you end up improving a lot both your English and your native language skills



As i said all languages need help, but the ones of this list are more in need as their former translators don't seem active anymore: Afrikaans, Albanian, Armenian, Azerbaijani, Bosnian, Breton, Chinese Hong Kong, Croatian, Dzongkha, Esperanto, Faroese, Igbo, Indonesian, Kabyle, Kikongo, Kinyarwanda, Kirghiz, Kiswahili, Lao, Latin, Luxembourgish, Malagasy, Maltese, Maori, Mongolian, Nepali, Occitan, Pashto, Persian, Swati, Tamashek, Tatarish, Tibetan, Tigrinya, Urdu, Uzbek Venda, Vietnamese, Welsh, Xhosa, Yoruba, Zulu