A blog about random things and sometimes about my work translating and developing KDE and anything
Monday, July 27, 2009
Twice a FIBer
So after studying at Facultat d'Informàtica de Barcelona (FIB for short) last week i attended Festival Internacional de Benicàssim (FIB for short) so i can say i'm a double FIBer now. Bad jokes aside, i want to recommend anyone that has never attended a music festival yet to do so (if you remotely like the music played on it) being on one is an experience you have to live (singing a song together with 100K people is HUGE), maybe at the end you decide you don't want to repeat it, but i'm sure you won't regret being in at least one.
wcgrep
wcgrep is a script from the subversion dudes dfaure copied to kdesdk/scripts that greps ignoring .svn directories, you should be using it for your greps!
Etiquetes de comentaris:
grep,
subversion,
svn,
wcgrep
Wednesday, July 22, 2009
KDE 4.3 Release Dinner at Barcelona
Following the tradition of doing release meetings the Barcelona KDE crew is meeting for dinner this friday (yeah damn the release team for postponing the release), if you want to join us head to http://cat.kde.org/index.php/Sopar_KDE43 FAST!
Etiquetes de comentaris:
4.3,
kde,
release party
Saturday, July 11, 2009
GCDS
So i had planned to do blogging each day but at the end there's too many interesting things going on at the same time to get time to write something down.
GCDS has already ended and i'm waiting at the Fataga hotel hacking area with other barcelona fellows until late as our plane leaves at 00:05 of tomorrow.
Let's try to summarize a whole week of GCDS :-D
I have some new gear now: Kubuntu, GCDS and KDAB tshirts and a Qt towel
Keynotes where rather interesting, RMS speech had as expected some Mono bashing, Sugar shown us a different way of having a Desktop Environment, Quim Gil told us that Maemo was switching to Qt as GUI toolkit and Robert Lefkowitz told us we use Free Software not because it's better, but because we are gentleman and he convinced me :D
Then we had the cross-desktop lighting talks that started with Frank Karlistech announcing Open-Pc project and followed with lots of other fast talks not really cross-desktop but one of each
Next day i attended some more so-called cross-desktop talks and sadly most of the focused only on one of the two projects, i think i managed to be quite equidistant in my poppler talk but maybe i wasn't :D
After day Akademy started with a nice keynote telling us that Free Software will save the world, we rock! Then we had the IDE battle with KDevelop and Qt Creator, Qt Creator requiring you to grant Nokia a commercial license so that they accept your code makes it the loser in my book. Then GAmaral talked us about KDE in Mexico and Knut introduced some students that had been working on Qt.
Nokia payed us a nice party that night in the harbour
Next day we had Akademy too, i attended talks about Qt graphic things, improving productivity, improving design and improving git for Qt and KDE.
After lunch, Sebastian did a keynote on our own future followed by dfaure telling us how to fix bugs faster and Olivier doing the same talk i had prepared for Akademy-es :D After that i switched to the Business track with Till, Nikolaj, Bart and Frank telling us how to win money with KDE.
And finally Akademy almost ended with the Akademy Award ceremony, with three of the key people in our community awarded.
The real Akademy ending was at the basysKom party
From there all turned even more crazy, with KDE eV assembly, ereslibre and antlarr saving Behdad from dead (well just leading him to the hospital), KDE España assembly, bofhs, Akademy-es (more on that on the dot shortly) a trip to the beach with a bug in the transportation system, having Behdad explaining me how font rendering works, discussing about poppler with lost of people and yet another party this time sponsored by Collabora.
All in all i think the GCDS was ok, though as always with this kind of events there were several things i did not like much like people being spread on lots of hotels, having one auditorium room outside the main building with too much time travel to the other, having the travel agency (Viajes El Corte Inglés sucks!) kind of scamming me, the University being too far away from the hotel and Akademy-es being eaten by a too much bigger event, on the other hand having the possibility to meet some gnome people i needed to talk to was a pleasant experience even if it made it a bit more difficult to start talking with people at parties because maybe you spoke with someone that did not have much in common with you.
GCDS has already ended and i'm waiting at the Fataga hotel hacking area with other barcelona fellows until late as our plane leaves at 00:05 of tomorrow.
Let's try to summarize a whole week of GCDS :-D
I have some new gear now: Kubuntu, GCDS and KDAB tshirts and a Qt towel
Keynotes where rather interesting, RMS speech had as expected some Mono bashing, Sugar shown us a different way of having a Desktop Environment, Quim Gil told us that Maemo was switching to Qt as GUI toolkit and Robert Lefkowitz told us we use Free Software not because it's better, but because we are gentleman and he convinced me :D
Then we had the cross-desktop lighting talks that started with Frank Karlistech announcing Open-Pc project and followed with lots of other fast talks not really cross-desktop but one of each
Next day i attended some more so-called cross-desktop talks and sadly most of the focused only on one of the two projects, i think i managed to be quite equidistant in my poppler talk but maybe i wasn't :D
After day Akademy started with a nice keynote telling us that Free Software will save the world, we rock! Then we had the IDE battle with KDevelop and Qt Creator, Qt Creator requiring you to grant Nokia a commercial license so that they accept your code makes it the loser in my book. Then GAmaral talked us about KDE in Mexico and Knut introduced some students that had been working on Qt.
Nokia payed us a nice party that night in the harbour
Next day we had Akademy too, i attended talks about Qt graphic things, improving productivity, improving design and improving git for Qt and KDE.
After lunch, Sebastian did a keynote on our own future followed by dfaure telling us how to fix bugs faster and Olivier doing the same talk i had prepared for Akademy-es :D After that i switched to the Business track with Till, Nikolaj, Bart and Frank telling us how to win money with KDE.
And finally Akademy almost ended with the Akademy Award ceremony, with three of the key people in our community awarded.
The real Akademy ending was at the basysKom party
From there all turned even more crazy, with KDE eV assembly, ereslibre and antlarr saving Behdad from dead (well just leading him to the hospital), KDE España assembly, bofhs, Akademy-es (more on that on the dot shortly) a trip to the beach with a bug in the transportation system, having Behdad explaining me how font rendering works, discussing about poppler with lost of people and yet another party this time sponsored by Collabora.
All in all i think the GCDS was ok, though as always with this kind of events there were several things i did not like much like people being spread on lots of hotels, having one auditorium room outside the main building with too much time travel to the other, having the travel agency (Viajes El Corte Inglés sucks!) kind of scamming me, the University being too far away from the hotel and Akademy-es being eaten by a too much bigger event, on the other hand having the possibility to meet some gnome people i needed to talk to was a pleasant experience even if it made it a bit more difficult to start talking with people at parties because maybe you spoke with someone that did not have much in common with you.
Etiquetes de comentaris:
akademy,
akademy-es,
gcds
Monday, June 01, 2009
Okular, PDF and file permissions
There seems to be some controversy about how Okular handles file permissions (sometimes called DRM) in PDF files. I will put here my personal opinions (weird i have to say this since this is *my* blog so when i write here it's always *my* personal opinion).
As a note for those that don't know me much, i was KPDF maintainer from 2004 or so till it's death, mentored the SoC project that created Okular, a regular Okular developer and i'm also the maintainer of poppler since a few time ago, so well, i think we'll agree i know what i'm talking about ;-)
Let's analize the bug-reporter sentence:
"So what I want to know is: why are people putting code into Debian
that limits our freedom? Why are people putting such code into KDE?"
So he wants to KNOW why *we* did this, yet he mails Debian bug tracker. First weird thing man, we have the okular irc channel, the okular mailing list and the kde bug tracker, all this are MUCH BETTER places for knowing.
First question:
"why are people putting code into Debian that limits our freedom?"
is very similar to
"why is people coding in GPL that that limits our freedom?" from the BSD fanboys. It all boils down to your freedom ends where other people freedom starts. And someone freely decided he doesn't want you to copy his PDF, you may hate him for that, but it is his freedom, *his* license, and we all like people respecting our license (GPL) so we should respect others, or are we just going to respect licenses we like?
Second question:
"Why are people putting such code into KDE?"
because it's what the PDF specification says and we want to have a PDF reader, don't we?
Now, there's even a LWN article talking about it (sorry folks, you have to pay them to read that unresearched article), but i'll quote here a small part (under the fair quotation law i hope)
he means evince has it disabled by default and okular enabled by default? I don't see a "tend to" here
KPDF had the exact very same behaviour since 2005. And well, if Okular is not called KPDF in KDE 4 it's just because we decided to support more formats but for the rest it's the same program.
Repeat with me Okular is not Linux, Okular is KDE, Okular runs in Linux, Okular runs in Solaris, Okular runs in FreeBSD, Okular runs in Windows, Okular runs in Mac OS X.
And now my final words. I hate DRM, i don't buy DRM enabled things (or try as hard as i can not to) BUT KDE is not the place to protest about that. The place to protest against that is with your wallet (don't buy DRM'ed things), with your vote (don't vote politicians that pass pro-DRM laws) or even in the streets in demonstrations.
As a note for those that don't know me much, i was KPDF maintainer from 2004 or so till it's death, mentored the SoC project that created Okular, a regular Okular developer and i'm also the maintainer of poppler since a few time ago, so well, i think we'll agree i know what i'm talking about ;-)
Let's analize the bug-reporter sentence:
"So what I want to know is: why are people putting code into Debian
that limits our freedom? Why are people putting such code into KDE?"
So he wants to KNOW why *we* did this, yet he mails Debian bug tracker. First weird thing man, we have the okular irc channel, the okular mailing list and the kde bug tracker, all this are MUCH BETTER places for knowing.
First question:
"why are people putting code into Debian that limits our freedom?"
is very similar to
"why is people coding in GPL that that limits our freedom?" from the BSD fanboys. It all boils down to your freedom ends where other people freedom starts. And someone freely decided he doesn't want you to copy his PDF, you may hate him for that, but it is his freedom, *his* license, and we all like people respecting our license (GPL) so we should respect others, or are we just going to respect licenses we like?
Second question:
"Why are people putting such code into KDE?"
because it's what the PDF specification says and we want to have a PDF reader, don't we?
Now, there's even a LWN article talking about it (sorry folks, you have to pay them to read that unresearched article), but i'll quote here a small part (under the fair quotation law i hope)
Applications which do implement this "feature" tend to disable it by default.
he means evince has it disabled by default and okular enabled by default? I don't see a "tend to" here
Perhaps this behavior is result of the relative newness of this application; as it accumulates more users, the pressure for more user-friendly behavior is likely to grow.
KPDF had the exact very same behaviour since 2005. And well, if Okular is not called KPDF in KDE 4 it's just because we decided to support more formats but for the rest it's the same program.
Linux, at all levels, has felt free to ignore standards when following them makes no sense.
Repeat with me Okular is not Linux, Okular is KDE, Okular runs in Linux, Okular runs in Solaris, Okular runs in FreeBSD, Okular runs in Windows, Okular runs in Mac OS X.
And now my final words. I hate DRM, i don't buy DRM enabled things (or try as hard as i can not to) BUT KDE is not the place to protest about that. The place to protest against that is with your wallet (don't buy DRM'ed things), with your vote (don't vote politicians that pass pro-DRM laws) or even in the streets in demonstrations.
Friday, May 29, 2009
A day in scam land
So i'm looking for two tickets for FIB now that tickets are sold out.
One goes to google and finds three announcements on craigslist, price is okaish so you contact the posters ... and all you get are scammers.
The first one says "please provide me this details asap so i can start this transaction asap through craigslist they will contact you", a mention to craigslist itself, this must be safe for sure, but then you go to craigslist and see a page that explicitly says that they don't handle transactions at all. The announcer does not answer back once i point her to this page.
The second and third announcements end up being from the same mail address, interesting as one announcement is from Barcelona and the other from London, one asks 400€ and other 380£. The poster says he is not able to meet me and Barcelona and neither an hypothetic friend of mine in London because "he works all day" (though answers my mails in 5 minutes). I ask him to post pictures of the tickets with a newspaper of today or the very same mail i just send and he just sends pictures of the tickets themselves. More over he says we'll do the transaction via "Ebay and Square Trade". If you look at Square Trade, they are not a transaction company at all either, seems someone is using their name to scam gullible people.
So basically it seems that yeah, the prices they were selling the tickets were "too low" and are just a honey pot to scam people.
I hate how the world is full of people that don't any respect for others at all. Meh :-/
One goes to google and finds three announcements on craigslist, price is okaish so you contact the posters ... and all you get are scammers.
The first one says "please provide me this details asap so i can start this transaction asap through craigslist they will contact you", a mention to craigslist itself, this must be safe for sure, but then you go to craigslist and see a page that explicitly says that they don't handle transactions at all. The announcer does not answer back once i point her to this page.
The second and third announcements end up being from the same mail address, interesting as one announcement is from Barcelona and the other from London, one asks 400€ and other 380£. The poster says he is not able to meet me and Barcelona and neither an hypothetic friend of mine in London because "he works all day" (though answers my mails in 5 minutes). I ask him to post pictures of the tickets with a newspaper of today or the very same mail i just send and he just sends pictures of the tickets themselves. More over he says we'll do the transaction via "Ebay and Square Trade". If you look at Square Trade, they are not a transaction company at all either, seems someone is using their name to scam gullible people.
So basically it seems that yeah, the prices they were selling the tickets were "too low" and are just a honey pot to scam people.
I hate how the world is full of people that don't any respect for others at all. Meh :-/
Etiquetes de comentaris:
craigslist,
scam,
square trade
Thursday, May 28, 2009
Your talk in Akademy-es 2009
You may that we are celebrating Akademy-es 2009 inside GCDS. If you did not know you do now ;-)
So if you think you have something to say to the Spanish community that will gather there do not hesitate to read the call for activities and submit one before the 8 of June!
We are waiting for them ;-)
So if you think you have something to say to the Spanish community that will gather there do not hesitate to read the call for activities and submit one before the 8 of June!
We are waiting for them ;-)
Etiquetes de comentaris:
akademy-es,
gran canaria desktop summit
Tuesday, May 19, 2009
Buenos Presagios (Good Omens)
So yesterday i finished reading Buenos Presagios the translation of Good Omens by Terry Pratchett and Neil Gaiman, a book written in 1990 and that has the Spanish first edition on ... April 2009 ... it's intriguing how some editorials decide to translate not so great books asap and better ones are left on the dust for almost 20 years.
And now onto the book, it's my first Gaiman book, but my n-th Pratchett one and i have to say it lives to the expectation.
It's a novel about the end of the world because of the Armageddon, the coming of the Antichrist, with the Four Horsemen of the Apocalypse, a witch that did 300 years of exact predictions and an earth-living Angel and Demon that prefer to work together instead of for their far away bosses. All that mixed with the great humour that Pratchett gives to all his books, will have to read some Gaiman to see if it's good too (Just saw he's the writter of Stardust, i haven't read the book but the movie was entertaining). The only thing i did not like much is that book ending is a bit weak in my opinion, but otherwise a very recommended book.
And now onto the book, it's my first Gaiman book, but my n-th Pratchett one and i have to say it lives to the expectation.
It's a novel about the end of the world because of the Armageddon, the coming of the Antichrist, with the Four Horsemen of the Apocalypse, a witch that did 300 years of exact predictions and an earth-living Angel and Demon that prefer to work together instead of for their far away bosses. All that mixed with the great humour that Pratchett gives to all his books, will have to read some Gaiman to see if it's good too (Just saw he's the writter of Stardust, i haven't read the book but the movie was entertaining). The only thing i did not like much is that book ending is a bit weak in my opinion, but otherwise a very recommended book.
Etiquetes de comentaris:
book,
buenos presagios,
good omens,
neil gaiman,
terry pratchett
Monday, May 11, 2009
Poppler 0.11.0 (0.12 Alpha 1) released
Available from
http://poppler.freedesktop.org/poppler-0.11.0.tar.gz
WARNING: This is a unstable release, it is actually 0.12 Alpha 1 release, it should work like any release from the 0.10 branch, but do not blame us if it turns the sea into Coke.
Changes against the 0.10 branch:
core:
* Add initial support for color management
* Remove case-insensitive matching of filenames in PDFDoc constructor
* Fix extraction of some ActualText content
* More work on Annotations support
* Improve font rendering in Cairo output device
* Fix bug in cairo backend with nested masks
* Fix cairo luminosity smask rendering
* Add optionally text support to Cairo output device
* Add the possibility of setting the datadir on runtime
* Return an error code instead of a boolean when saving
* Make the font scanner more versatile
* Small opimization in documents that use PostScriptFunction
* Minor optimization to Stream handling
* Fix some compile warnings
glib:
* Optional content support
* More work on Annotations support
* Improvements to the demo
* Documentation improvements
* Fix build when compiling with GTK_DISABLE_SINGLE_INCLUDES
Qt4:
* Support URI actions for Table Of Contents items
* Documentation improvements
* Improvements to the demo
* Add a FontIterator for iterating through the fonts of the document
utils:
* Allow the use of cropbox in pdftoppm
* Make pdftohtml output png images when the image is not a jpeg
* Make pdftotext accept cropping options like pdftoppm
* Support rendering non-square pixels in pdftoppm
build system:
* Require Cairo 1.8.4 for the Cairo output device
* Require CMake 2.6 when using the CMake build system
* Optionally require libpng for pdftohtml
* Optionally require libcms for color management
Testing, patches and bug reports welcome.
http://poppler.freedesktop.org/poppler-0.11.0.tar.gz
WARNING: This is a unstable release, it is actually 0.12 Alpha 1 release, it should work like any release from the 0.10 branch, but do not blame us if it turns the sea into Coke.
Changes against the 0.10 branch:
core:
* Add initial support for color management
* Remove case-insensitive matching of filenames in PDFDoc constructor
* Fix extraction of some ActualText content
* More work on Annotations support
* Improve font rendering in Cairo output device
* Fix bug in cairo backend with nested masks
* Fix cairo luminosity smask rendering
* Add optionally text support to Cairo output device
* Add the possibility of setting the datadir on runtime
* Return an error code instead of a boolean when saving
* Make the font scanner more versatile
* Small opimization in documents that use PostScriptFunction
* Minor optimization to Stream handling
* Fix some compile warnings
glib:
* Optional content support
* More work on Annotations support
* Improvements to the demo
* Documentation improvements
* Fix build when compiling with GTK_DISABLE_SINGLE_INCLUDES
Qt4:
* Support URI actions for Table Of Contents items
* Documentation improvements
* Improvements to the demo
* Add a FontIterator for iterating through the fonts of the document
utils:
* Allow the use of cropbox in pdftoppm
* Make pdftohtml output png images when the image is not a jpeg
* Make pdftotext accept cropping options like pdftoppm
* Support rendering non-square pixels in pdftoppm
build system:
* Require Cairo 1.8.4 for the Cairo output device
* Require CMake 2.6 when using the CMake build system
* Optionally require libpng for pdftohtml
* Optionally require libcms for color management
Testing, patches and bug reports welcome.
Thursday, April 30, 2009
i18n as second citizen in KDE
Sadly it seems that i18n (short for internationalization), that is, making your program available for non english speakers is a second citizen between KDE developers.
Programmers are treating bugs reported against i18n as non critical when effectively they are making their program unavailable for lots of users.
You may think this is a personal perception, but let's mention some examples:
* Plasma: Category names ("Application Launchers", "Astronomy") in the drop down box of the "Add Widget" dialog are untranslatable. Plasma developers excuse themselves saying i18n is not their best aptitude
* Places names are set after first use and don't follow the user locale https://bugs.kde.org/show_bug.cgi?id=177536
* KMail view names have a similar problem, can't find the bug number right now
* Places names for devices are not translatable http://lists.kde.org/?t=123937583500004&r=1&w=2
* Amarok: Items in the playlist layout editor are not translated https://bugs.kde.org/show_bug.cgi?id=189750
* Amarok: Default layout names are not translatable https://bugs.kde.org/show_bug.cgi?id=189751
These are just some examples, don't feel finger pointed if your app is here.
You'll notice that some of this bugs/reports have patches or suggestions on how to fix it, yet nothing has been done to fix them.
So please, don't treat i18n as second citizen, you *really* don't want to alienate so much users from your program.
Programmers are treating bugs reported against i18n as non critical when effectively they are making their program unavailable for lots of users.
You may think this is a personal perception, but let's mention some examples:
* Plasma: Category names ("Application Launchers", "Astronomy") in the drop down box of the "Add Widget" dialog are untranslatable. Plasma developers excuse themselves saying i18n is not their best aptitude
* Places names are set after first use and don't follow the user locale https://bugs.kde.org/show_bug.cgi?id=177536
* KMail view names have a similar problem, can't find the bug number right now
* Places names for devices are not translatable http://lists.kde.org/?t=123937583500004&r=1&w=2
* Amarok: Items in the playlist layout editor are not translated https://bugs.kde.org/show_bug.cgi?id=189750
* Amarok: Default layout names are not translatable https://bugs.kde.org/show_bug.cgi?id=189751
These are just some examples, don't feel finger pointed if your app is here.
You'll notice that some of this bugs/reports have patches or suggestions on how to fix it, yet nothing has been done to fix them.
So please, don't treat i18n as second citizen, you *really* don't want to alienate so much users from your program.
Wednesday, April 29, 2009
Fix for broken hplip in Jaunty upgraded from Intrepid
If hp-toolbox fails to start for you with
Traceback (most recent call last):
File "/usr/bin/hp-toolbox", line 246, in
from ui4.devmgr5 import DevMgr5
File "/usr/share/hplip/ui4/devmgr5.py", line 45, in
from dbus.mainloop.qt import DBusQtMainLoop
ImportError: No module named qt
The solution is purging and reinstalling the python-qt4-dbus package
Traceback (most recent call last):
File "/usr/bin/hp-toolbox", line 246, in
from ui4.devmgr5 import DevMgr5
File "/usr/share/hplip/ui4/devmgr5.py", line 45, in
from dbus.mainloop.qt import DBusQtMainLoop
ImportError: No module named qt
The solution is purging and reinstalling the python-qt4-dbus package
Tuesday, April 21, 2009
Book reviews
This week is Saint George's Day and in Catalonia it's typical to buy/gift books so i'm commenting over the fours last books i've read.
El Códice de la Atántida (Decipher) by Stel Pavlov: A Science Fiction book that carries the tag "Best Seller in USA and Italy". Well, i'm not going to comment on these countries taste for books, but this is a book you should avoid, it's a mix of Atlants, nanobots, armies, earth to be destroyed, misc adventures and all, but at the end i just had no interest for keep reading another page, and i just finished the book because it's what i do will all books.
Los hombres que no amaban a las mujeres (The Girl with the Dragon Tattoo) by Stieg Larsson: A noir novel, you should read it if you are not scared of a book were some pages talk about crimes on women being killed by cutting their head and putting it on the fire. It's a book i got addicted fast and could not stop reading it until the end. It features kidnaped girls, assassins, investigators and more important Lisbeth Salander, best good-evil character since Wolverine.
La chica que soñaba con una cerilla y un bidón de gasolina (The Girl Who Played with Fire) by Stieg Larsson: Second part of The Girl with the Dragon Tattoo. You'll have to read it after reading the first one, the story is less macabre than in the first book but as vibrating as the first one and involves some "I'm your father" Star Wars-like scenes that even feature everywhere still impacts the reader.
La verdad (The Truth) by Terry Pratchett: It's for sure not the best Discworld novel, but still worth a read, Pratchett can create jokes from almost everything, and newspapers are not going to be an excempion. In this novel a new character is introducted William de Worde that will try to do real journalism and investigate the charges of embezzlement and attempted murder against Lord Vetinari.
So all in all, don't buy Decipher, read Stieg Larsson books if you like noir novels and The Truth is just another Discworld novel, so it's of course worth a read.
P.S: Stieg Larsson books since to have a much more catchier name in Spanish than in English, wonder which is more closed to the original swedish though.
El Códice de la Atántida (Decipher) by Stel Pavlov: A Science Fiction book that carries the tag "Best Seller in USA and Italy". Well, i'm not going to comment on these countries taste for books, but this is a book you should avoid, it's a mix of Atlants, nanobots, armies, earth to be destroyed, misc adventures and all, but at the end i just had no interest for keep reading another page, and i just finished the book because it's what i do will all books.
Los hombres que no amaban a las mujeres (The Girl with the Dragon Tattoo) by Stieg Larsson: A noir novel, you should read it if you are not scared of a book were some pages talk about crimes on women being killed by cutting their head and putting it on the fire. It's a book i got addicted fast and could not stop reading it until the end. It features kidnaped girls, assassins, investigators and more important Lisbeth Salander, best good-evil character since Wolverine.
La chica que soñaba con una cerilla y un bidón de gasolina (The Girl Who Played with Fire) by Stieg Larsson: Second part of The Girl with the Dragon Tattoo. You'll have to read it after reading the first one, the story is less macabre than in the first book but as vibrating as the first one and involves some "I'm your father" Star Wars-like scenes that even feature everywhere still impacts the reader.
La verdad (The Truth) by Terry Pratchett: It's for sure not the best Discworld novel, but still worth a read, Pratchett can create jokes from almost everything, and newspapers are not going to be an excempion. In this novel a new character is introducted William de Worde that will try to do real journalism and investigate the charges of embezzlement and attempted murder against Lord Vetinari.
So all in all, don't buy Decipher, read Stieg Larsson books if you like noir novels and The Truth is just another Discworld novel, so it's of course worth a read.
P.S: Stieg Larsson books since to have a much more catchier name in Spanish than in English, wonder which is more closed to the original swedish though.
Saturday, April 11, 2009
How to make foreach loops that don't suck
Calling values in Hashes/Maps/Sets
This code is iterating over the values of a hash and doing something over them. Everything seems ok, but it's not, it's calling values() on the hash and that's causing the creation of a temporary list with all the values of the list, effectively causing a bigger memory usage and iterating over the list twice (one to get the values and other to do something over them).
You can write something that does the same without these two problems doing
So if you are using values() in a foreach, just remove it and your code will be instantaneously faster.
Calling keys in Hashes/Maps
This is calling keys() over the hash, this, as values(), means going across the container and creating a temporary list containing all the keys of the hash, that's a waste of memory when you could simply use a proper
and just iterate keys one by one.
Then it does plotters.value(key) twice, ok, accessing a value in a hash is amortized O(1) but still you are going to calculate the qHash of the string twice for no reason.
But more important, what the code is doing is actually iterate over the values, so the proper way is doing
Probably in this case the net benefit is not much because probably the number of element of plotters is small, but there's no need to write inefficient code when the efficient one is as easy to write.
And of course it could be worse. If plotters was a map instead of a hash, lookup would be O(log(n)).
So if you are using keys() in a foreach, please think twice what you are doing and if you only need the value, iterate of the container and if you really need the key use a proper iterator to avoid constructing the temporary list.
QHash<QString,Plasma::Meter*> meters;
foreach (Plasma::Meter *w, meters.values()) {
w->setLabelColor(0, theme->color(Plasma::Theme::TextColor));
}
This code is iterating over the values of a hash and doing something over them. Everything seems ok, but it's not, it's calling values() on the hash and that's causing the creation of a temporary list with all the values of the list, effectively causing a bigger memory usage and iterating over the list twice (one to get the values and other to do something over them).
You can write something that does the same without these two problems doing
QHash<QString,Plasma::Meter*> meters;
foreach (Plasma::Meter *w, meters) {
w->setLabelColor(0, theme->color(Plasma::Theme::TextColor));
}
So if you are using values() in a foreach, just remove it and your code will be instantaneously faster.
Calling keys in Hashes/Maps
QHash<QString,Plasma::SignalPlotter*> plotters;
foreach (const QString& key, plotters.keys()) {
plotters.value(key)->setShowLabels(detail == SM::Applet::High);
plotters.value(key)->setShowHorizontalLines(detail == SM::Applet::High);
}
This is calling keys() over the hash, this, as values(), means going across the container and creating a temporary list containing all the keys of the hash, that's a waste of memory when you could simply use a proper
QHash<QString,Plasma::SignalPlotter*>::const_iterator
and just iterate keys one by one.
Then it does plotters.value(key) twice, ok, accessing a value in a hash is amortized O(1) but still you are going to calculate the qHash of the string twice for no reason.
But more important, what the code is doing is actually iterate over the values, so the proper way is doing
QHash<QString,Plasma::SignalPlotter*> plotters;
foreach (Plasma::SignalPlotter *plotter, plotters) {
plotter->setShowLabels(detail == SM::Applet::High);
plotter->setShowHorizontalLines(detail == SM::Applet::High);
}
Probably in this case the net benefit is not much because probably the number of element of plotters is small, but there's no need to write inefficient code when the efficient one is as easy to write.
And of course it could be worse. If plotters was a map instead of a hash, lookup would be O(log(n)).
So if you are using keys() in a foreach, please think twice what you are doing and if you only need the value, iterate of the container and if you really need the key use a proper iterator to avoid constructing the temporary list.
Wednesday, April 01, 2009
3 years and 8 months later...
The nice swindler inside Apple
Apple has just gone a step higher in my list of companies i hate. Let me explain my last experience with them.
So i am browsing the net and see there's an iPhoneOS 3.0 pre-release, you have to register, pay something like 80€ and then you are part of the developer program and can download the SDK. So as my daywork involves working with phones i decide to register and pay with my boss credit card, something i've done lots of times already and never had any problem with.
But seems Apple is special and needs the names to match. No problem, i can accept that.
What i can not accept is they charging my boss the 80€ and then denying me the access to the developer zone because names do not match. That's what i call a swindle.
And the even more wonderful thing is the people that answers my mails don't see Apple did anything wrong and is asking me to send a fax (to US that i don't want to know how much it cost) of my and my boss ID cards with a notary sign saying it's ok (i don't know elsewhere, but in Spain a notary is NOT CHEAP). And won't return the 80€ either. Wonder if the only chance is asking the bank not to pay that 80€ :-(
That's what i get for dealing with Apple :-/
So i am browsing the net and see there's an iPhoneOS 3.0 pre-release, you have to register, pay something like 80€ and then you are part of the developer program and can download the SDK. So as my daywork involves working with phones i decide to register and pay with my boss credit card, something i've done lots of times already and never had any problem with.
But seems Apple is special and needs the names to match. No problem, i can accept that.
What i can not accept is they charging my boss the 80€ and then denying me the access to the developer zone because names do not match. That's what i call a swindle.
And the even more wonderful thing is the people that answers my mails don't see Apple did anything wrong and is asking me to send a fax (to US that i don't want to know how much it cost) of my and my boss ID cards with a notary sign saying it's ok (i don't know elsewhere, but in Spain a notary is NOT CHEAP). And won't return the 80€ either. Wonder if the only chance is asking the bank not to pay that 80€ :-(
That's what i get for dealing with Apple :-/
Thursday, March 19, 2009
Transactions and rollback and their lack of in viajar.com
This post should be called "I'm going to Akademy! (i hope)", but instead of rejoicing of going for 4th consecutive year to KDE meeting, i'm going to do a rant about transactions and how rollback should work.
So here was I, sitting in my computer trying to find a good flight to go to Gran Canaria and ended up in viajar.com. They had a mixed offer (flight from Barcelona to Gran Canaria with one company and back with a different one) that was the best considering time and money so i went on and bought from them.
So i clicked the "buy" button after filling all the data and scared saw that the server was taking too much time to show me the "done" page. After 5 minutes or so, it told me "error", and i went like "oh, i'll have to find some other place to buy". But first i had a look at my credit card account and saw in horror that a the company of the second flight (clickair) had charged me about the half of the amount of money of what i had bought.
Calm down! I thought, and waited for a mail explaing something, but there was none for 12 hours so i had to call them. A nice person answered and explained me that they had absolutely no record of my purchase so they could not give me any info, i then explained the situation and she realized that clickair bookings are somewhat done differently from the rest because it's a Low Cost Company so she asked me which dates i had booked and promised to give an answer back.
Two hours later she phoned me with the needed data to take both flights as it seems she could book me also the first flight, good, all resolved!
But i was still wondering, how can the system book one ticked without checking the other one is available? how can i get a ticket booked and get no information back? Probably i went to the last if/else/if/else/if/else of conditions, but that's no excuse.
So if you are doing internet "shops" think twice your transactions and rollbacking mechanism, and then, think it a third time!
So here was I, sitting in my computer trying to find a good flight to go to Gran Canaria and ended up in viajar.com. They had a mixed offer (flight from Barcelona to Gran Canaria with one company and back with a different one) that was the best considering time and money so i went on and bought from them.
So i clicked the "buy" button after filling all the data and scared saw that the server was taking too much time to show me the "done" page. After 5 minutes or so, it told me "error", and i went like "oh, i'll have to find some other place to buy". But first i had a look at my credit card account and saw in horror that a the company of the second flight (clickair) had charged me about the half of the amount of money of what i had bought.
Calm down! I thought, and waited for a mail explaing something, but there was none for 12 hours so i had to call them. A nice person answered and explained me that they had absolutely no record of my purchase so they could not give me any info, i then explained the situation and she realized that clickair bookings are somewhat done differently from the rest because it's a Low Cost Company so she asked me which dates i had booked and promised to give an answer back.
Two hours later she phoned me with the needed data to take both flights as it seems she could book me also the first flight, good, all resolved!
But i was still wondering, how can the system book one ticked without checking the other one is available? how can i get a ticket booked and get no information back? Probably i went to the last if/else/if/else/if/else of conditions, but that's no excuse.
So if you are doing internet "shops" think twice your transactions and rollbacking mechanism, and then, think it a third time!
Sunday, March 15, 2009
NetworkManager settings not shared/specified?
Dear lazyweb, please prove me wrong.
I've been having a quick look at how NetworkManager is implemented and from what i see the public DBUS API is only for querying, not editing there. The edition of new networks et al is to be provided by a separate NetworkManager service that has no common API. This has two consequences to me:
* Users that edit/create connections under KDE don't see them under Gnome/Xfce/wathever and viceversa
* You can not write a desktop agnostic program that needs to modify/create networks as you don't know who you have to talk to <-- This is specially ugly
I've been having a quick look at how NetworkManager is implemented and from what i see the public DBUS API is only for querying, not editing there. The edition of new networks et al is to be provided by a separate NetworkManager service that has no common API. This has two consequences to me:
* Users that edit/create connections under KDE don't see them under Gnome/Xfce/wathever and viceversa
* You can not write a desktop agnostic program that needs to modify/create networks as you don't know who you have to talk to <-- This is specially ugly
Wednesday, February 25, 2009
ddrescue to the rescue
So two weeks ago my HD did a huge CRACK and it stopped working. The system did not boot up and it just did CRACK CRACK CRACK all the time. So i browsed a bit and saw that ddrescue was a dd variant able to skip failing sectors. So i picked up a new HD the double size of the old one and a RIP CD and started the process of dumping the old filesystem into a file. Two weeks after ddrescue told me i had lost 77MB and thankfully after dumping the file into a newly created filesystem and some fsck later i did not lost anything important.
So thanks a lot ddrescue devels!
So thanks a lot ddrescue devels!
Monday, February 02, 2009
How to get Konsole 4.2 to behave?
Dear lazyweb: My Konsole in KDE 4.2 does not like me. Let me explain myself, i like to use vim for quick text editing and i like using the numeric keypad to type numbers, if i use the "Default (XFree 4)" input method, that doesn't work, and pressing any keypad number makes vim go nuts, so i'm using the "Linux Console" input method.
"Linux Console" works correctly when on a local session but if i log into a remote machine using ssh, then suddenly the Home and End keys start outputing ~ characters. And this all does not happen in xterm so it must be a konsole feature, any idea how can i get rid of it?
"Linux Console" works correctly when on a local session but if i log into a remote machine using ssh, then suddenly the Home and End keys start outputing ~ characters. And this all does not happen in xterm so it must be a konsole feature, any idea how can i get rid of it?
Saturday, January 10, 2009
Announcing KDE 4.2 Barcelona Release Party
Along with other KDE 4.2 Release Parties all over the globe, the KDE barcelona crew is also hosting one. The date is the 30th of January. Place is still to be determined, so if you have suggestions contact me asap! Also contact me if you want to be in the list of people.
Etiquetes de comentaris:
kde,
kde 4.2,
release party
Subscribe to:
Posts (Atom)