2014-11-14

Thank you Google!

This is my third "Thank you Google!" article. In the first two articles I've thanked Google for fixing the Droid and then the Roboto font families.

This time I'm thanking Google for adding a dictionary for the Romanian keyboard in Android thus enabling gesture typing. I remember seeing gesture typing fist on the Swype keyboard.

I've noticed this feature on my Nexus 5 with the arrival of Android 4.4.4 update.

Last week I've updated my HP TouchPad to Android 4.4 (CyanogenMod 11) and took a screen shot of "Google Keyboard". I've pointed out the elephant in the picture.


Gesture typing makes typing correct Romanian fast and enjoyable! Note that the keyboard has some quirks, which I've reported here: #35339.

Here is a recording of me gesture typing the Romanian Pangram:


Microsoft has added to Windows Phone 8.1 gesture typing and the call it shape writing or Word Flow. As it turns out, Word Flow is supported only for the following languages:
Arabic, Dutch, English (UK and US), Finnish, French, German, Italian, Polish, Portuguese (Brazil), Russian, Spanish (Mexico and Spain), Turkish, Ukrainian.
It seems Windows Phone keyboard needs more than a dictionary (it does come with a Romanian dictionary) to enable gesture typing. I've made a suggestion to Microsoft to add WordFlow support to Romanian language in Windows Phone. Vote if you want it :)

Hats off to Google! Shame on you Microsoft!

P.S. Recently I've learned that Google Keyboard is not available everywhere. For example you will not find Google Keyboard on Play Store in Germany and if you search it in the browser and then open the link you will get this nice image (Tested on a Moto X bought in Germany):


It's not only music and videos that Google blocks in Germany, it's also apps!

2014-06-20

Qt Creator - Help is on the way

Visual Studio starting from version 2002 to 2008 had a poor help experience. Hitting F1 in Visual Studio resulted soon in me cursing while looking at the help window's progress bar. Unlike Visual Studio 6 which had a very responsive help system.

I remember looking with Process Explorer to see what's going under the hood and it was very surprising to see the C# compiler running...

To overcome this waiting I would open up a web browser and search online. This habit stuck. The web search engine become my best friend.

Visual Studio 2010 has fixed the help system (some local web server technology if I remember correctly), but I haven't spent much time with it so that I would go back at pressing F1 for help.

For the past three years I've been using Qt Creator and I was happy with my work flow: code editing, debugging with Qt Creator and online web search for help.

Therefore I found myself hacking a project using Qt and Qt Creator and searching online after QBrush, QPainter documentation.

If you search online after QBrush you will most probably (at this moment in time using google) get this: qt-project.org/doc/qt-4.8/qbrush.html I would then click on the link and change it to qt-project.org/doc/qt-5.3/qbrush.html. This became annoying after a while.

Now I know that Qt Creator already comes with the most up to date Qt documentation (depending of course if you have the most up to date Qt installed).

But I would have not realized this if my work colleague Miika Järvinen wouldn't have mentioned a small project of his.

His small project involved having the awesome cppreference.com offline C++ documentation available in Qt Creator. Now cppreference has a qch file compiled, but it only shows the main index page when using F1 or searching with "?". If you navigate to the help panel you get an annoying endless "waiting" cursor.

Miika noticed that the qch file was broken due to invalid paths and he compiled a fixed version, which you can get it from here. The endless "waiting" cursor is still present though.

Below you have an example how to use the awesome Qt Creator help system with the equally awesome offline documentation from cppreference.com:

Qt Creator 3.1 on Kubuntu 14.04
Now I could be "helped" by Qt Creator and not by the online web search!

Imagine the productivity kick you can get if you have the browser window closed, or code offline for that matter :)

2014-03-02

Debugging QNX applications using Qt Creator

According to Wikipedia QNX is: "QNX is a commercial Unix-like real-time operating system, aimed primarily at the embedded systems market".

One could get an evaluation copy of QNX 6.5.0SP1 and have a virtual machine running the x86 version of QNX 6.5.0SP1. QNX comes with an Eclipse based IDE, which is nice and all but I'm interested in QtCreator :)

Ed Langley has a very nice blog entry named - Setting up a QNX image for use with Qt Creator.

Qt Creator needs SSH communication with the QNX target, in my case a virtual machine. Ed Langley's blog entry has details on how to get this up and running.

I've created a "hello world" C++ project. In order to have Qt Creator deploy this hello world application one needs to add the following lines to the pro file:

target.path = /home/sam/qnx_test
INSTALLS += target 


Debugging the application using Qt Creator 3.0.1 looked like this:


Debugging works out of the box, unfortunately the STL types are not displayed very "pretty".

QNX 6.5.0SP1 comes with "GNU gdb 6.8 qnx-nto (rev. 506)" which is copyrighted "(C) 2008 Free Software Foundation, Inc.", which is a bit dated.

Fortunately QNX has an updated version of GDB "gdb-7.5-r791". Upgrading gdb was just a matter of unpacking gdb-prereq-linux.tgz and linux-gdb-7.5-r791.tar.gz. Now GDB version is "GNU gdb (GDB) 7.5 qnx (rev. 791)" which is copyrighted "(C) 2012 Free Software Foundation, Inc.".

Unfortunately Qt Creator 3.0.1 was not able to use the debugger. In Qt Creator's "Debugger Log" I was able to find out why:

&"    import binascii\n"
&"ImportError: No module named binascii\n"
&"Error while executing Python code.\n"


Python from the "gdb-prereq-linux.tgz" file, which ended up being installed here /opt/qnx650/host/linux/x86/usr/python27/, was incomplete. Binascii module should have been available, but was not.

So I decided to compile my own version of "Python 2.7.2". This was a bit tricky because Qt Creator needs a 32bit version of Python and my Linux installation was 64bit. I've set up a schroot environment for a 32bit version of my Linux distribution and done a ./configure, make, make install build of Python 2.7.2.

I've uploaded my Python 2.7.2 build here, "installation" should be done like:

# tar xJf python-2.7.2.tar.xz  -C /opt/qnx650

After upgrading GDB and Python Qt Creator 3.0.1 debugging looked like this:


As we can see it's not necessarily better. The STL types are not just not "pretty", this time are not accessible. One could say that's even worse.

Upgrading Qt Creator to the upcoming 3.1 release improved things a bit:


As you can see std::vector was displayed correctly. I don't know why "value" was presented as . The "Debugger Log" didn't show up any errors.

Digia announced on 25th of February 2014 the debut of "Qt 5 support for latest release of QNX operating system", which means that Qt Creator 3.1 and future versions would support QNX 6.6!

I hope you will give Qt Creator a try when developing QNX applications!

2014-02-15

(ro) Tastatura românească „3 în 1”


Când vine vorba de tastaturi românești multora li se ridică părul în cap. Și asta pe bună dreptate, de vină este aranjamentul „moștenit” de la Microsoft. Conform Decât o Revistă „moștenirea” a început astfel:
„Legenda spune că pe la începutul anilor ’90, băieții de la Microsoft au venit în România să se intereseze cum să-și localizeze sistemul de operare și au ajuns la Poliție. Destul de logic, pentru că Poliția emite documentele de stare civilă și se presupune deci că sunt cunoscute nevoile limbii. Ei bine, la Poliție se pare că au găsit niște mașini de scris nemțești și așa ne-am pricopsit cu z și y inversate și ă, î, ș, ț pe tastele cu parantezele pătrate, punct și virgulă și apostrof.”
Din 2004 avem un standard ASRO de tastatură (SR-13392:2004) actualizat, bazat pe aranjamentul american. Acest standard este implementat pe sistemul de operare Windows începând cu Windows Vista, pentru drivere pentru Windows XP / 2000 vizitați această pagină.

Avem și o lege care recomandă folosirea tastaturii românești, și anume ordinul MCTI  nr. 414 din 25 septembrie 2006 cu privire la utilizarea codării standardizate a seturilor de caractere în documentele în formă electronică, conține la Art. 4: 
„Pentru scrierea și procesarea documentelor în formă electronică în limba română se recomandă a se folosi tastatura românească în conformitate cu aranjamentul 1 de caractere din standardul SR 13392:2004 sau orice versiune actualizată a acestuia ori standardul care îl înlocuiește.”
Din păcate nici acum, peste aproape zece ani, nu există pe piața românească tastaturi conforme cu standardul românesc SR-13392:2004.

Anul trecut am aflat de existența firmei americane WASD Keyboards. Ei fac tastaturi mecanice la comandă, tastaturi care pot fi desenate cum vrea clientul. În felul acesta mi-am comandat o tastatură conformă cu aranjamentul secundar al standardului SR 13392:2004. Am scris despre acestă poveste aici: Tastatura RO-PRO.

În timp ce lucram la șabloanele pentru tastatură mi-a venit ideea să combin cele două aranjamente, în felul acesta am obținut o tastatură „3 în 1” - americană, română standard și română programatori.
Pentru a diferenția cele două aranjamente am folosit culori. Roșu pentru caracterele specifice aranjamentului primar / standard și albastru pentru cel secundar / programatori.

Tastatura „3 în 1” ar putea satisface 100% nevoia de comunicare a utilizatorului român. Dacă nu scrie cu diacritice, poate liniștit să ignore tastele colorate și să folosească partea americană a tastaturii. Dacă scrie cu diacritice poate să-și seteze în sistemul de operare aranjamentul preferat și culorile o să-l ghideze spre diacritice, respectiv ghilimelele românești sau linia de dialog.

Am mai tratat și problema traducerii etichetelor de pe tastele de sistem și anume „Esc”, „Insert”, „Delete”, „Home”, „End”, „Page Down”, „Page Up”, „Print Screen”, „Scroll Lock”, „Pause”. Nu le-am tradus în română deoarece etichetele ar fi fost prea lungi, am folosit simboluri. Există standardul ISO/IEC 9995-7:2009 (vezi varianta „final draft”) care tratează exact această problemă (mulțumesc „Secărică” pentru document / idee). Dacă în marea majoritate a cazurilor simbolurile erau „ușor” de înțeles, pentru „Esc” și „Pause” cu greu utilizatorul de rând și-ar fi dat seama ce înseamnă acele simboluri. Așa că am decis să folosesc alte simboluri mult mai ușor de înțeles.

Pentru că „WASD Keyboards” a început să folosească culori am decis să dau comandă la o tastatură „3 în 1”. În urma sfaturilor primite pe lista de Diacritice (mulțumesc Mișu', mulțumesc „Pixel”) am schimbat și fontul folosit pentru etichete din Roboto în Fira Sans, font folosit de sistemul de operare Firefox OS.

Tastatura arată astfel:

Pentru cei dispuși să plătească pentru o asemenea tastatură, pașii pentru a o achiziționa sunt:
  1. mers la WASD Keyboards pe sait și ales varianta cu 87 sau cu 104 taste
  2. selectat tipul de contact folosit (Cherry Maro, Roșu, Verde, etc)
  3. selectat tipul de atenuator de zgomot
  4. selectat șablonul tastaturii românești „3 în 1”
  5. selectat culoarea tastelor, textul negru din șablon va fi înlocuit cu alb pe tastele negre.
Anul acesta am avut șansa să merg la CES2014, unde am discutat cu reprezentanții câtorva producători de tastaturi: Logitech, Genius și Delux. A rămas că după târg vom discuta pe email. De la Logitech nu am primit niciun răspuns. Cu cei de la Genius am avut un schimb de emailuri concluzionat cu (diacriticele le-am adăugat eu):
„Lipsa unei cereri constante din piață pentru tastaturile customizate, după cum sunt sigur că știți, nu ne permite să onorăm cereri punctuale, chiar dacă discutăm de un MOQ de 1000 buc.

Ar însemna o investiție considerabilă în capacitățile de producție, care nu poate fi susținută „a la long”
Am avut o discuție și cu partenerii noștri în acest sens, dar nici acolo nu există un interes major pentru a susține livrări constante.

În situația dată, mă tem că nu putem avea o soluție la cererea dumneavoastră.”
Din fericire cei de la Delux s-au arătat mai deschiși la idea de a produce o tastatură românească „3 în 1”. Comanda minimă ar fi de 1000 bucăți. Am înțeles că urmează să primesc o mostră și apoi voi putea da comanda :)

Pentru finanțare m-am gândit la o campanie pe Multifinanțare. Cu ajutorul unei campanii „virale” pe rețelele de socializare ar trebui să se găsească 1000 de oameni de bine, nu?

Eu sper că în viitorul apropriat vor exista tastaturi românești conforme cu standardul SR 13392:2004 în România!

2014-02-06

Romanian Virtual Keyboards

In this post I will talk about the Romanian virtual keyboard on smart phones. I will cover the default virtual keyboard provided by the manufacturers.

A virtual keyboard is basically an array of buttons which when pressed they generate a character. This sounds easy, right? Well, it's easy when you know which characters to generate. In practice it seems nobody knows very well which characters belong in the Romanian virtual keyboard.

What is so special about the Romanian virtual keyboard? In addition to the English characters the Romanian virtual keyboard should have:
  • Five extra letters: ăĂ â îÎ șȘ țȚ (U+0103 U+0102 U+00E2 U+00C2 U+00EE U+00CE U+0219 U+0218 U+021B U+021A)
  • Non breaking hyphen (cratima): ‑ (U+2011)
  • Romanian quotes: «„”» (U+00AB U+201E U+201D U+00BB)
  • EN Dash (linia de dialog): – (U+2013)
How should we put all of these, or at least the five extra letters, into the keyboard? One way would be to put them like separated buttons, like the Nokia Symbian virtual keyboard:


To overcome this space problem an extra array of buttons pops up when one long-presses the base character, for example long-press "s" and you will get a menu containing "ș".

What do we do with this pop-up menu? Just leave it there? Or select by default one of the characters and on release activate it?

I like the second part. I find it very practical to long-press "s" wait for the menu and then release knowing that I will always get "ș".

You might have noticed that we have "ă" and "â", which both have "a" as the base character. The solution would be to put "â" also on long-press "q". This method is used by the "Romanian Programmers" layout, which is present on Windows Vista and above. Note that "â" would still be part of the long-press menu for "a".

My ideal virtual Romanian keyboard would have on long-press a→ă, q→â, i→î, s→ș, t→ț. On long-press space, or other key, it will generate Non Breaking Hyphen or just the common minus "-". The quotes and the EN Dash could be added to a symbols menu. In landscape mode, because of the extra space, one could have buttons for the five extra letters.

I did a quick test for just the five characters on a few smart phones. All the links point to small video recordings on YouTube.

Apple iPhone 5 - has support for all five characters. On long-press no selection of the diacritical mark is made. The same base character is copied in the menu as default selected character, which makes the release of a long-press useless, one needs to move the finger to select the character, which in practice is error prone.

Nokia Lumia 928 - Windows Phone 8 - all five characters can be inserted. There is no long-press character generation, just the pop-up menu, which actually remains open when you release the long-press.

Blackberry Z10 - all five characters can be inserted. It supports long-press and release but it copies the base character and when you release you don't get the diacritical mark.

I've left Android at the end because every major OEM has its own virtual keyboard.

Google Nexus 7 - Android 4.4.2 comes with the stock Android keyboard, which can generate all five diacritics. Unlike the others there is support for long-press and release to generate the diacritical marks. But not all of them work as expected: a→â, s→ș, t→5, i→8. In my opinion the diacritical mark should be selected on long-press and not the number. If the user wants numbers (s)he can switch to numbers mode, or long-press the base letter.

Samsung Galaxy S4 - Android 4.3 - is the first Android virtual keyboad which doesn't generate all five diacritics. S Comma Below is missing, instead there is present the old S Cedilla. Interstingly "t" has on the long-press menu both T Comma Below and old T Cedilla.

Like the Android stock keyboard there is support for long-press and release to generate the diacritical marks and because it has an extra row for numbers it works better than the stock Android keyboard.

Samsung Galaxy Note 3 - it resembles the Samsung Galaxy S4, but with one major difference - there is no long-press and release support. It behaves like Windows Phone 8, it just leaves the pop-up menu floating.

LG G2 - Android 4.2.2 - it doesn't generate all the five diacritics - î is missing. It has support for long-press and release, but instead of generating diacritics they generate symbols: a→@, s→* etc.

HTC One Max - Android 4.3 - it also doesn't generate all diacritics, instead of S and T Comma Below it generates S and T Cedilla. It has support for long-press and release, but it generates symbols and not diacritics. The diacritics on the long-press menu are not optimized for Romanian usage, you have to hunt for them.

Sony Xperia Z1 Compact - Android 4.3. It does generate all diacritics, it has long-press and release to generate the diacritic mark. Sony has the best support for Romanian in a smartphone's virtual keyboard! Congratulations Sony! Still no "â" on "q" though.

Below I've put a summary of all of the above:


At CES2014 I gave feedback to Sony, Samsung, and LG. I hope that they will improve the Romanian virtual keyboard in their products.

As a final remark. I haven't mentioned anything about the dictionary  which usually comes with a virtual keyboard. I haven't had time to test them. One needs to pay attention to S and T Comma Below, you should not have words containing old S and T Cedilla. Also dictionary needs to know about Romanian for example if I type "cutit" it should present me "cuțit".

If you have any comments, please feel free to comment below.