Monday, June 6, 2011

Some shortcuts for the Samsung Galaxy Ace

While my new external USB hard drive came with a 50 pages manual, of which none were useful, my android smatphone came without manual. HHopefully it's just because I bought it in a small shop in Taiwan... but still it seems most android apps are poorly documented.

After a difficult (early) morning, I discover that there was a screen capture folder with a screenshot in it. It turns out that Samsung has added to the galaxy ace a shortcut to screen capture: back + home (you actually have to press in this order). Surprisingly, on other phones, it's a different combination... as if it was still too easy to find ;-)

I also recently realised that long pressing a key can bring a special action. For instance in the mail client and browser, pressing long menu brings the search widget. Long pressing back in the browser brings the history.

There is also this horrible design which makes the camera application to lock/unlock the interface if power is pressed. Not stupid but completely unstandard. I rebooted my phone twice because I thought the camera had gone blocked before realizing this.

So far I haven't any action activated by the accelerometer, like undo on the iPhone. Still, the picture gallery react a bit to it by tilting the images,  so there is hope to find such a hidden unpractical feature...

Any one knows some other shortcuts? Maybe I should start reading the source code to replace the user manual?

Sunday, February 13, 2011

Just finished my first town

I've just finished mapping my first town in OpenStreetMap, and coincidently it's also the first town where I lived: Crépy-en-Valois. Completed it using mainly the "cadastre" from the French authorities, and the Bing imagery, and the memories I have from spending 15 years there (turned out to be extremely useful).

Of course a place is never fully mapped, but here is can be found:
* all the streets
* all the streets names
* the shape of every building

I finished by naming the streets, and to ensure the quality, I compared the list of street names found on internet (from the phone directory) to the list in OpenStreetMap. I converted the directory data into a text file with one name per street alphabetically sorted.

To get the list of streets in OSM, the nominatim service seemed the most appropriate but I seemed not to answer this type of query. So eventually I settled with a very basic command:
curl -g "http://api.openstreetmap.org/api/0.6/map?bbox=2.8634295463562,49.2131958007812,2.93606853485107,49.2601203918457"
| grep =\"name | sort -u | sed -re "s/.*v=\"(.*)\".*/\1/;s/'/'/" > names-osm.txt

As long as there aren't many amenities, it works fine. Then using a diff tool (I used Meld), you can see which street is still missing, or where there are spelling mistakes. It turned out to be really useful. In addition to knowing there are 212 streets in such a small town, it even allowed me to notice small streets I had forgotten to map, and some streets whose name are not on the cadastre! 

Sunday, May 2, 2010

What happens when you plug a keyboard into your computer

While reporting a bug, I learned a lot about the different programs which are involved when a keyboard is plugged in. As simple as such an action can sound, it is amazingly complex as it traverse many layers. So, what happens when you are using gnome in Linux and you insert a new keyboard in your USB port?

  1. The Linux kernel usb system detects a new device
  2. From the device properties it is determined as an HID device, and therefore a new input device is created by the evdev module (which is loaded if it was not before)
  3. Event info about a new device is sent to udev
  4. Udev parses its rules and creates a new file in /dev for this new device
  5. Udev transmits the info of a new device to listeners such as DeviceKit and Hal
  6. Hal parses its rules, one of which is the distro script which set the default layout to the device
  7. Hal transmits the info of a new device to its listeners, such as Xorg
  8. Xorg add the new device to the children of the Xkb core keyboard
  9. Hal transmits the options for this new device to Xorg via Xkb
  10. Xorg, via the Xkb extension, transmits the info that the Xkb config has be modified to listeners such as xklavier
  11. xklavier transmits the info of a change in config to its listeners, such as libgnomekdb
  12. libgnomekdb reloads the configuration of the keyboard and update the status icon in the system tray
  13. Xorg, via the XINPUT extension, transmits the info that a new device is present to the listeners, like xklavier
  14. xklavier transmits the info of a new device to its listeners, such as gnome-settings-daemon (g-s-d)
  15. g-s-d changes this new device's layout to the user preferences via libgnomekdb.
Voilà!

Note that it depends a bit on your system, and in particular in very modern Xorg's (xserver >= 1.8) the Hal part is removed and udev and Xorg communicate together directly. It might also contain some mistakes, don't hesitate to mention it in the comments.

Thursday, October 1, 2009

Keyboard layouts could be so much simpler

My brand new laptop has a french keyboard, but I've connected to it an full size dutch keyboard. Linux is great because it can actually deal with such weird setup so that for both keyboards when you press a key you get what you would expect. To do that, I configured the french layout as the default (because it's always connected to the laptop!) and whenever I plug the dutch keyboard I've got a little script which does this:
xinput --list # to find the id of the keyboard
setxkbmap -device $kb-id nl


Now, all this troubles could be avoided if not every country had a different keyboard layout (Switzerland is special, they have several layouts). 100 years ago, this could make sense, but now that there is so much exchange between countries, this is bringing more pain than advantages. One solution would be to simply change the spelling of every language to restrain them to the good old 26 basic letters, and be happy with a US layout forever after. This could happen, the Turkish people did manage, but for sure not any time soon, and anyway the culture should not be driven by the technology. It's up to the technology to adapt.

So what I'd really like to see is a generic keyboard layout, which allows to type any latin character-based language (or at least all the official ones present in Europe). The us-international layout is not so bad, but they are lots of small adaptations needed to not make it a pain to use (especially on windows where by default the diacritics are added to the next letter). Some European peoples are at it, and I hope it goes somewhere. While at changing the layout, we could move to dvorak, so the loss of direct access for the special keys of a language would be more or less counter-balance by the increase speed provided by the dovrak layout.

Even more useful would be to have the input method follow more closely the normal behaviour of putting diacritics: you first put and the letter and then you put the diacritics. It would in addition allow to add easily diacritics while reviewing a text (put the cursor just after the letter, and press the diacritic you want to add). Today, in Xorg, a first layout providing such a mechanism appeared: "USA - International (AltGr Unicode combining)". As its name implies it uses some special features of unicode. This has the disadvantage of not yet being correctly supported in every program, but that's the way to go!

Test this new layout, and report bugs on application not correctly responding to it, and propose better versions of the layout :-)

Monday, August 3, 2009

Getting integrated

As a sign that I'm integrating to the Netherlands, I have a patch in pidgin for... the Dutch translation. Ok, it's just one word, but that's a beginning!

Tuesday, July 28, 2009

Annoying bug tracking systems

Bugs are extremely annoying, but unfortunately bug tracking systems are also very annoying. They are several existing systems used with open source software. Unfortunately they more or less all sports the same problems.

One which is rather known is the connection of the bugs between upstream (the original project) and downstream (the distros), and in between downstream. Each project and each distro has its own bug tracking system. As a result of this, first, bugs might end up being duplicated: in general the users report their problem in the tracking system of their distro, excepted for some advanced users who directly follow upstream and report there as well. Second, the bugs get reported to places which are not read by the authors of the project, which reduces a lot the chances to have them fixed. So far, only lauchpad has tried to answer this problem, by automatically following upstream, but this does not resolve the problems to link the bug reports in-between downstream. Of course, it doesn't seem reasonable to have only one global bug tracking system for all the projects in the world. What would be useful is a mechanism which allows to transmit a bug from downstream to upstream, just by decision of the bug triaging team. It is then up to the triage team to differentiate bugs related to packaging problems to the bugs which have to be treated upstream.

However, an even bigger problem is that the bug tracking systems are actually bug report tracking system. The main concept is not a "bug", but the "report from someone about a bug". The main description about a bug is the first description ever written about it... which is one less likely to be precise: written before anyone ask for precisions, by someone who is a simple user. Generally, valuable information about the bug (eg: why and when it happens, how it can be fixed) is only available disseminated in the comments, or, even worse, in the comments of bug reports marked as duplicates. To correct this, the main concept should be shifted from "bug report" to "bug". Each bug could have assigned to it several bug reports, and bug reproducers (people would are affected by this bug and most likely able to confirm that the bug is fixed). The main description of a bug would be much closer to a wiki page, which can be updated little by little, as more things get known. Moreover, associated to the bug, there should be test cases, which allow to reproduce the bug. Each test case can be either manual, or automatic, in which case it could be possible to run the test case regularly and automatically against the latest version of the project to detect if the bug is still present. A bug would also be associated to fixes and workarounds. The fixes are patches, which can be commented, and which eventually become a commit in the code repository of the project.

A third problem is that when someone finds a bug in a project and reports it. The reporter should first check for previous reports of the bug. However, if the bug has been corrected in the mean time (typically, in the development version), it will not be easily findable because marked as closed. That is why the bug tracker should also be more aware of the versions of the projects, usually ordered as a tree. So that for each version of the project, it is possible to know which (known) bug is present, likely present, or fixed. When someone search for a bug, he or she will also indicate the version on which the bug was seen, and the search will show bugs even now closed. Not only this avoid to create a duplicate bug report, but also allow the reporter to use a workaround if it is available, without having to update to a new version.

Lots of perspectives to improve bug tracking systems. Maybe it is possible to modify bugzilla or launchpad in this directions. Maybe first, a proof of concept should be implemented. What other important features are missing in current bug trackers?

Monday, July 20, 2009

Hello from the other side of the world

So far Microsoft as been considering Linux as if it was they were two persons living on a different side of the world. No contact. Today, they have therefore done a big leap, by releasing drivers for the kernel under the GPL. It's actually only drivers to improve the execution speed of Linux when running in their virtualization engine, much less impressive than if they had released drivers for supporting the hardware of the Xbox for instance. Nevertheless, this is still a very symbolic step, as eventually a part of the kernel might be officially maintained by Microsoft.

The code will very likely be accepted, but for now it's only in the staging tree, the part of the kernel which contains "crap code" which does not yet have the quality to be normal part of the kernel. Indeed, the code looks rather ugly, but hopefully mainly just due to the coding style... Now it's time for everybody interested to go and have a look clean it up or test it.

Probably it's just a little "hello" from Microsoft, and other friendly actions towards Linux will take a very long time to come again.