Colemak is easy to learn!

If you touch-type QWERTY you already half-know Colemak.

Many of the keys stay the same, which means many of your shortcuts remain the same. On a Mac, these shortcuts are Undo, Cut, Copy, Paste, Bold, Minimize, Hide, Quit and Close.

The keys that do move don’t go far, usually one or two keys away. Mostly we’re trying to get the common letters on to the home row and move the uncommon ones away. Many keys that move stay on the same finger, or at least in the same hand. Only E and P swap hands. In Dvorak, 22 keys swap hands.

The punctuation keys don’t move, except for the colon/semicolon (no way that gets to stay on the home row!) In the Dvorak layout, all of these punctuation characters move: fullstop, comma, question mark, single quote, double quotes, square brackets, curly braces, angle brackets, dash, underscore, plus and equals. It’s a nightmare for programmers!

If you were to scratch off the keys that have moved, look how many you’d have to remove for Colemak compared to Dvorak:

Learning Colemak vs Dvorak keyboard layout

As if you didn’t know, QWERTY is inefficient. Dvorak is a lot better, but Colemak is by far the best. To prove this point, here is the heat map of typing this very blog post on QWERTY, Dvorak and Colemak:

Why Colemak is best

Row usage compared between QWERTY, Dvorak and Colemak

There are other reasons here to explain why Colemak is easy to learn.

With the holidays coming up, do your future self a favour and learn Colemak!

Update: so you’ve decided you want to learn Colemak and want to know how to go about it? AWESOME! I have just the post for you: How to learn Colemak.

Colemak and vim: “But what about h/j/k/l?”

I have my phone set to alert me when anyone mentions Colemak on twitter. It’s a fun one to follow, you get new people trying out Colemak at least once a week, and i love to encourage people.

One thing i see a lot is programmers talking about vim, and asking what you do about the h/j/k/l keys. Do you remap them or relearn them?

There is at least one person who has made a colemak-vim remapping plugin (see this discussion in the Colemak forum), but i can’t imagine it working well. If you try to put h/j/k/l back where you’re used to them then you have to find new homes for n, e and i. (h actually stays in the same place) As you may well know, if you’re reading this, n is next search match, e is end of word, and i gets you to insert mode.

So if you move those keys, where would you put them? Almost every letter in vim has some sort of significance, and many of them are chosen for the action they stand for, which is part of the power of vim.

My answer is to relearn them. Maybe it’s easy for me because i was on Dvorak when i learned vim, so i was never attached to the position of h/j/k/l in the first place. Curiously enough, in Colemak h/j/k/l all end up on the same finger: the index finger of the right hand. Some people complain that j and k feel upside down, and they do at first, but then you realise that Apple is busy rewiring our brains with “natural scrolling” (which i think is just awesome, by the way) and before you know it, Colemak and vim feel perfectly wonderful together!

So my advice: print out one of these Colemak/vim cheat sheets and just get used to it!

vi / vim graphical cheat sheet - Colemak version

Look! i’ve even done a typematrix version for all you Colemak people who pair program and need a keyboard with a hard wired Colemak switch!

vi / vim graphical cheat sheet - Colemak TypeMatrix version

Of course, the other great thing to note about Colemak is one of its big advantages over Dvorak: that punctuation characters remain in their QWERTY positions. Which is very useful for vim users! :)

Git: remove a submodule

For years, i’ve been searching the internet every time i want to do this. Various guides have come and gone. I rarely deal with git submodules anymore since the dawn of Bundler, but every now and then i find i want to remove a submodule in order to convert to bundler.

So once and for all, here’s the process, for example i am deleting a cucumber rails plugin:

Remove the three lines from .gitmodules

[submodule "vendor/plugins/cucumber"]
	path = vendor/plugins/cucumber
	url = git://github.com/cucumber/cucumber.git

Remove the two lines from .git/config

[submodule "vendor/plugins/cucumber"]
	url = git://github.com/cucumber/cucumber.git

Delete the git reference file that holds the submodule’s SHA commit id. Note the important lack of a trailing slash.

git rm --cached vendor/plugins/cucumber

Git will now see the entire directory as new files, because it’s no longer a submodule. Now you are free to delete the whole lot.

rm -rf vendor/plugins/cucumber/

And now you can add it to your Gemfile to use with bundler :)

QIDO for Colemak please!

As most of my followers are probably well aware, i’m a bit of a nerd on the matter of keyboard ergonomics and keyboard layouts.

For any Dvorak typists, the QIDO (QWERTY In, Dvorak Out) is a very useful device that converts any USB keyboard into a Dvorak one. It is a spin-off product of KeyGhost, a hardware keylogger, but in this case put to a completely different use.

They QIDO plugs between the keyboard cable and the USB port on the computer, and it translates all keyboard input signals into the Dvorak letters. Reminds me somehow of a Babel fish! :) Having a QIDO means you don’t have to switch keyboard input at the operating system, especially useful if you’re pair programming with someone who types on QWERTY.

A few months ago i wrote to KeyGhost, the makers of the QIDO, to ask for a Colemak version (or even better, a programmable version) of the QIDO. Theo Kerdemelidis gave this reply:

We have had a few requests for Colemak support, so we will look into it as soon as we have a chance.

I know they also sent the same response to someone else who asked for a Colemak QIDO at the same time. As far as i’m aware they are still sending out the same reply to people who ask.

So i have a task for you! If you could use a Colemak QIDO (or QICO as they might call it!) please email helpdesk@keyghost.com to let them know your interest. If you get any reply, please let me know here.

Dvorak might be more popular at the moment, but that’s only because it’s been around for a lot longer than Colemak. We know that Colemak has the edge, and it’s getting more popular all the time. Let’s give KeyGhost all the encouragement we can to get a Colemak version of the QIDO made soon! :)

Computer generated art

I woke up yesterday with a simple idea for generating a picture based on an input string. I don’t exactly know where the idea came from, but i think i’ve been influenced by Nick Huggins, whose abstract work i adore, and also in a way by QR codes. I’m not a particularly artistic person, but i figured i could come up with an algorithm and let the computer do the creative bit for me! :)

So i installed the open source tools ImageMagick and RMagick, learned a bit about the RVG library, and set about trying some ideas. I fiddled and tweaked the algorithm until it seemed to consistently output something that was reasonably pleasant. Here is the picture for my name, and for my twitter id.

aimee @sermoa

Having tried random numbers and obvious inputs like my name, i searched for other input sources. Being interested in community generated content, i wrote a script to fetch the current top twitter trends. Here are the results.

Kim Hee Chul Solomon Burke Steamed Bun #thingsyoushouldntsay HEEBUM
#badsongsinjail Limera1n Aiden #bsr_tousounow One Direction

As you can see, some come out better than others. I’m adding the input string mostly for debugging purposes so that i can see how the image was seeded. When i get one that i like, i can increase the blur and remove the input string. For example, i really like the images produced by “Kim Hee Chul” and “#bsr_tousounow”, so let’s try with a bit more blur.

Kim Hee Chul (with more blur) #bsr_tousounow

Nice, hey?! Not sure they’re ready for a gallery just yet, but certainly an interesting experiment.

Everything in the picture is generated from the input string: the size, colour, number of boxes, box sizes, opacity, border style. It is extremely unlikely that any two input strings would ever generate the same picture. However, the algorithm is not random. Given an input string, you’ll always get the same picture, though i may choose to do some post-processing on it (such as blur, frame, lighten or darken).

In the interests of sharing knowledge here is the main structure of my generator, but the really creative part is in how it comes up with the numbers, which is going to remain a secret, sorry!

I am willing to generate images for anybody who asks nicely! :)

Packard Bell Mustek Bearpaw scanner on Ubuntu/Mint

I am quite sure that nobody cares about this except for me, unless they happen to have a similar scanner to mine. I’ve had to do this process about 5 times now on different installs. I can guarantee that it works for Fedora, Debian, Ubuntu and Mint. I thought i’d share it because i’ll probably need it again and someone else might find it helpful.

First you need xsane to be able to scan things at all.

sudo apt-get install xsane

Plug in your scanner by USB. Attempt to scan by typing scanimage. It won’t work, but you need to see the error message.

scanimage
[gt68xx] Couldn't open firmware file (`/usr/share/sane/gt68xx/PS1Dfw.usb'): No such file or directory
scanimage: open of device gt68xx:libusb:004:002 failed: Invalid argument

See that PS1Dfw.usb? You need to get that file from http://meier-geinitz.de/sane/gt68xx-backend/ but be aware that your computer might ask for a different file such as ps1fw.usb or ps1fw.usb. Whichever it is, find it on the page and click it to download.

Assuming it’s gone into your Downloads folder, move it to the right place.

sudo mv ~/Downloads/PS1Dfw.usb /usr/share/sane/gt68xx

Now try the scanimage command again. With any luck your scanner will burst into life and a whole load of crazy gobbledegook will splurge into your terminal window. This is the picture your scanner is seeing, trying to be displayed as text! Don’t be afraid to Ctrl-C to stop it once you see it working. Or you can just wait for it to finish.

You can also do this to ensure that your scanner is configured correctly:

scanimage -L
device `gt68xx:libusb:004:002' is a Mustek Bearpaw 1200 CU Plus flatbed scanner

Now to actually scan something! Open up The Gimp and click File -> Create -> XSane -> gt68xx:libusb:004:002

It comes up with this super ugly XSane interface, where you can make a preview, choose the scan area, fiddle with the colour settings and DPI settings, and scan an image.

XSane scanning an image on Linux Mint

When it’s done, it’ll come back to The Gimp ready for you to edit the scanned image.

Protip: If you lose one or more of the XSane windows, you can get them back again by going to the Window menu of XSane and ticking on the ones you need.

Gowalla pins

As of Monday, 5th July, these are the 38 pins currently available on Gowalla, grouped by category. I just made this because it’s sometimes hard to see what all the pins are at a glance.

If you’re curious about Gowalla, see my other introductory post: Gowalla tips.

Installing Gowalla

I Installed Gowalla I Installed Gowalla

Checking in

Wanderer Wanderer Check in at 5 different Spots to receive the Wanderer Pin.
Sightseer Sightseer Check in at 10 different Spots to receive the Sightseer Pin.
Ranger Ranger Check in at 25 different Spots to receive the Ranger Pin.
Discoverer Discoverer Check in at 50 different Spots to earn the Discoverer Pin.
Explorer Explorer Check in at 100 different Spots to receive the Explorer Pin.
Wayfarer Wayfarer Check in at 250 different Spots to receive the Wayfarer Pin.
Voyager Voyager Check in at 500 different Spots to receive the Voyager Pin.
Epic Voyager Epic Voyager Check in at 1,000 different spots to receive the Epic Voyager Pin!

Continue reading

don't you just love an awesomesauce #tupperwarebox

This weekend the world went mad for Tupperware Boxes.

Key output:

Some rather bizarre songs:

My dog’s favourite thing is my #tupperwarebox, it’s full of treats and nom, she behaves so well when it’s around, I think I’ll tie it on.

I’ve got a massive #tupperwarebox it’s got a special lid that clicks and locks

Come on and let’s rock! Everybody let’s rock! Everybody in the whole cell block was dancing to the #tupperwarebox!

How I love my little #tupperwarebox! You can a-store my cheese, you can a-sit on my knees, feels like a picnic right here at home…

A quiz: “Which #tupperwarebox would you be?”

A twitter retweeter bot: @tupperwarebot – the cool thing about this was i learnt how to use Yahoo Pipes and made a pipe that finds relevant tweets and manipulates the stream to become retweets with the hashtag #tupperwarebox

A Justin Bieber in a #tupperwarebox which gained the @tupperwarebot a lot of Justin Bieber fans!

Justin Bieber in a #tupperwarebox on Twitpic

This is actually quite disturbing when i found there is a rumour that Justin Bieber got stuck in a toy box at age 7 and suffers from claustrophobia. But anyway, the fans seem to like it. They appreciate the randomness of it and came up with the hashtag #justininatupperwarebox!

Finally, there is a Facebook group: Tupperware Box! If you are a fan of Tupperware and/or pure random nonsense, please don’t hesitate to join! :D

FB.init(“f76c8ae933a8204f4a989f77369fa340″);

Tupperware Box on Facebook

A quick way to resize images in Linux

Quite often i find myself wanting to resize a whole directory of images. Rather than opening them all in the gimp, i do it through the command line. I seem to do this often enough that it’s worth recording here, for my own reference as well as for anybody else who would find it useful.

First of all, you need imagemagick.

sudo apt-get install imagemagick

Change directory to where the images are and create a subdirectory for the resized versions.

cd ~/Photos/2010/04/05
mkdir resized

My phone likes to put spaces in file names which really confuses things, so i convert them to underscores. You can skip this step if your filenames contain no spaces.

for image in *.jpg; do mv "$image" `echo $image | tr ' ' '_'`; done

Now for the clever bit: i run convert command on the image files, resizing them to 1024px and saving with a quality of 80%.

for image in *.jpg; do convert $image -resize 1024 -quality 80 resized/$image; done

Lovely wonderful linux! :D

One thing to note: it always resizes along the top edge, which may not be the longest edge. If you have a portrait file which is 1536×2048 it comes out at 1024×1365 (not 768×1024 as you might have expected).

The resize option can take a percentage, so if you know all your images are the same size then you could just send a 50% to reduce to half size.

for image in *.jpg; do convert $image -resize 50% -quality 80 resized/$image; done

Imagemagick is super-incredible-awesome so there probably is a way to deal with differently sized images at different orientations. If anybody knows, please add it in the comments! :)

My software apprenticeship

I have recently had the privilege of being accepted as an apprentice to software craftsman and philosopher Enrique Comba Riepenhausen. This is part of Eden Development adopting a craftsmanship approach to software creation.

I am very excited at this new development in my career. It’s going to be hard work because i have a lot to learn, but i am pleased to have made the commitment and to know that i have someone who is playing a very active part in my personal and professional development. Funnily enough, the more i learn, the more i realise how little i really know. The first task that i have been set as part of my apprenticeship is really showing me that.

Eden Development has given me a blog to talk about my progress during my apprenticeship. So i have decided that my apprenticeship blog will become the place that i talk about my technical and coding interests, leaving this blog to be more personal. So if you are interested in me from a technical point of view, please follow edendevelopment.co.uk/blogs/aimee.

There are actually now five apprentices at Eden Development. If you are interested in software craftsmanship it is well worth looking at the Eden staff blogs aggregation to read all our thoughts and experiences on our own journeys.