Finding High-Quality US ASCII English Keyboards in Japan

As a teenager I often took advantage of living in Vienna and traveled across Central Europe by bus. In those days, there existed highway buses going down the same path as Vindobona, a long distance passenger train connecting Vienna and Berlin via Brno, Prague and Dresden. I occasionally took one of those highway buses to Bohemia and stayed in a cheap youth hostel.

There I encountered something I could never handle; the Czech keyboard. The keyboard looked similar to the German keyboard I was familiar with but the @ symbol shared the key with the number 2 and Czech/Sorbian letter ě. Finding a way to type the @ symbol was kinda difficult, while it was essential to check your email and chat histories.

There was no such thing as free Wi-Fi at that time. Nobody ever had smartphones, tablet computers or wireless travel routers. Every guest was encouraged to go to the front lobby or the computer room to use desktop computers with internet access. And all the computers had Czech keyboards. Because of the different keyboard layout, I could never use the computers properly and succeed logging in to neither Googlemail (Gmail service provided in Germany) nor facebook, while I was staying in the Czech Republic. I guess this was the first moment I became aware of keyboard layouts.

After returning from my weekend trip, I started learning to use the 104-key US ANSI keyboard. Since then, I’ve been using the US keyboard to write source code for my programs, edit TeX documents, type commands to the computer and do many other things. I must have wanted the standard keyboard available everywhere on the planet. I’m still not sure whether I was really on the right track. But my decision has helped me immensely, since I moved back from Vienna to Kyoto.




There are several US English layout keyboards sold in Japan. Some are expensive, others cheap. And the most of them are made by domestic brands and sold only in the internal market.

It’s really hard to identify good and poor keyboards without touching them. They look all the same in pictures but are different in build quality, have different switches and provide different typing experience. The differences can affect your performance as much as the keyboard layout. Finding the right keyboard will surely improve the comfort of your computer.

Here, I list three really good keyboards you may want to check at your nearest electronics store.



PFU Happy Hacking Keyboard Professional2 PD-KB400B

PFU’s Happy Hacking keyboard is one of the most beloved US keyboards in this country. Even though its layout is totally different from the Japanese keyboard, many computer programmers prefer this small keyboard over any other input devices. They appreciate the HHKB’s quality, reliability and minimalist layout that, in their words, enhances typing performance.

The HHKB isn’t just an ordinary compact keyboard; its layout is highly optimized for the UNIX environment. The keyboard has only 60 keys. The control key isn’t located on the bottom left side but to the left of the ‘A’ key. And there are neither function nor cursor keys on the board (they are mapped on the Fn layer, though).

The HHKB layout is much different from the common 104 keys layout you’re probably familiar with. If you are looking for a standard full-sized ANSI keyboard in Japan, you would be interested in either TOPRE Realforce or FILCO Majestouch. But if you write source code every day and night or are searching for a good, Linux-friendly keyboard, you would love this programming keyboard.



東プレ/TOPRE Realforce 104U-S 英語配列 XF01TS

Well known as the quiet mechanical keyboard, TOPRE’s Realforce is widely supported by clerical workers, typists, writers and those who sit in front of a computer screen for hours each day.

The Realforce isn’t really a mechanical keyboard but a hybrid of a mechanical and a rubber dome. TOPRE’s hybrid switches have different characteristics from other mechanical switches. Some people become addicted to the feel. Its switches, solid heavy body and high-profile spherical keycaps are all dedicated to your comfort.

And there are also 87-Key ANSI English Layout keyboards out there.



FILCO Majestouch Convertible2 FKBC104M (茶軸/Brown)

If you find that the typing feel of the Realforce or TOPRE switches is not for you, it’s time to consider FILCO Majestouch. It’s a mechanical keyboard with the Cherry MX switches.

In comparison with the Realforce, the Majestouch makes relatively loud clicking sounds. And the Majestouch has smooth-surfaced keycaps with visible lettering, while the Realforce has keys with a non-smooth surface. They both are thick and heavy.

I myself have been using a Majestouch for years. It’s just a good keyboard and feels simply the best on my hands. Touch one and you’ll instantly understand what I mean!

What you can do when your Android Studio could not start AVD on Ubuntu 18.04

After experiencing repeated sudden system crashes, I decided to update my Linux environment. Since then, my Android Studio stopped working properly. Several problems were found with the AVD, JVM and Gradle project sync and so forth. And I needed to spend my weekend fixing one problem after another.

I had kvm installed, added myself to its users group and rebooted the system.

$ kvm --version
QEMU emulator version 2.11.1(Debian 1:2.11+dfsg-1ubuntu7.2)
Copyright (c) 2003-2017 Fabrice Bellard and the QEMU Project developers

$ kvm-ok
INFO: /dev/kvm exists
KVM acceleration can be used

$ ls -l /dev/kvm 
crw-rw---- 1 root kvm 10, 232 May 28 18:20 /dev/kvm

$ grep kvm /etc/group
kvm:x:128:femoghalvfems

Still it didn’t make any difference. The IDE kept showing the message “Error while waiting for device: Could not start AVD” and would never start the emulator.




This gave no clue what was going on. There had to be permission problems, I suspected. I changed the permission of the directory.

$sudo chmod 777 /dev/kvm

Of course, I knew it is usually not a good idea. Granting the full control permission to everyone would pose a threat to the entire system and even possibly cause another problem. But it worked, anyway. As I changed the directory permission, I became able to build apps using Android studio.

Unfortunately, the case was not yet closed. In the following hours, I got another system crash and had to reinstall the whole system from a bootable flash drive. My workstation contained NVIDIA and CUDA property drivers that conflicted with some other modlues from time to time. They froze all the processes and threads. I could not even raise skinny elephants.

So I reinstalled Ubuntu 18.04 LTS on my workstation and tried building apps with the latest Android Studio.

This time, I could open the AVD by simply adding myself to kvm user group. And it worked well! I didn’t do anything other than newly install a series of the required virtualization tools and add a new user. And it worked!

$ sudo adduser femoghalvfems kvm
Adding user `femoghalvfems' to group `kvm' ...
Adding user femoghalvfems to group kvm
Done.

Now I really don’t know what prevented the IDE from running the virtual machine.

Chinese Word Counting Made Easy with the Command Line

Days ago, I wrote an article entitled creating Chinese/Japanese word clouds in Python. The article was written for a friend of mine who is learning the language for his research in mathematics and mathematical biology. By writing codes from scratch, one can learn data structures and time complexities. Hash tables and their worst case O(log n), binary search trees O(n) or whatever. Not that there is anything wrong with that. It just takes some time to think and write codes.

Instead of writing scripts, I usually get the same outputs from the GNU/Linux command line tools. As you may know, there are many other ways to do the same thing. And it is always a good idea to find easier, faster and/or more efficient ways. You do not always need to write your own code to get what you want.

Counting occurrences of Chinese nouns annotated by Stanford part-of-speech tagger, for instance, can be carried out by typing the following command.

$ < tmp04_zh.txt sed 's/\s/\n/g'|grep -E '#(NN|NR)'|sed -E 's/#(NR|NN)//g'|LC_ALL=C sort|LC_ALL=C uniq -c|awk '{print $2 "," $1}'

It is a simple combination of 5 different commands which produces the same result as the "count_word_zh.py" script listed on my previous post.

sed performs basic text transformations manual
grep prints lines that contain a match for a pattern. manual
sort sorts lines manual
uniq removes duplicated lines manual
awk is used to rearrange the order of columns here manual
LC_ALL=C is an option to remove localized settings that affect the sorting and comparison results

Despite the fact that Chinese text is written in non-alphanumeric, multi-byte characters, you can still take advantage of the major functions of UNIX and UNIX-like operating systems.




The command line tools may help you save time not only in coding but also in running programs. If you handle large input files, you probably think it is time to execute more than one process simultaneously. Many hands make light work. There are also powerful tools that enable concurrent, and even parallel processing.

These are only a few examples of what you can do with the command line. You can actually do a whole lot more without writing a line of code. While I was doing my PhD in Informatics, I was even taught to avoid writing unnecessary code. The single most important thing is to get the results you want easily, quickly and efficiently. The command line tools will be of great help to you in accomplishing this goal.