Change application language of GVim

Recently I have been using Vim more often to give it a try. I use GVim for windows. Unfortunately my windows installation of my office laptop is in German, though I changed the display language to English. GVim apparently doesn’t mind the display language and shows itself in German.

I added the following lines to the _vimrc file, which is located within the program files folder of vim, if you’re using windows.

set langmenu=en_US
let $LANG = 'en_US'

Posted in Development, Linux, Technology, Windows | Tagged , , | Leave a comment

Overview of code coverage metrics

Unit tests are essential in software engineering nowadays. The quality of software begins with unit testing, but they are useless if there isn’t a metric or an indicator that shows how good the unit tests are. This is called code coverage. There are different kinds of code coverage metrics.

Statement Coverage

Let’s say we’ve got the following code

int myMethod(int x)
        /* some stuff */
    }while(x == 0);

    return -42;

A unit test (in this case CPPUnit light) for this could be

TEST(Quick, test)
    CHECK(myMethod(1) == -42);

Statement coverage means, as you might expect, that every statement is covered, which is the case with the test above. But there are several flaws in this. The potential endless loop isn’t covered or even detectable. Also, depending on the compiler, there might be machine code, which is still untested.

Decision or Branch Coverage

Again another example:

int myMethod(bool a, bool b)
    int result = 0;

    if(a && b){
            result = 1;

    return result;

A unit tests for this could be:

TEST(Quick, test)
    CHECK(myMethod(true, false) == 0);

    CHECK(myMethod(true, true) == 1);

With branch coverage, every control flow needs to be tested and that means two tests. With code coverage only one test would be necessary.

Decision and Condition Coverage

If you look at the last unit test example, you can see that variable a wasn’t changed. Decision and condition coverage means, that every variable has to have every possible condition. In this case

TEST(Quick, test)
    CHECK(myMethod(true, false) == 0);

    CHECK(myMethod(false, true) == 1);

Modified Condition and Decision Coverage

A much more intensified approach is the modified condition and decision coverage (MC/DC). MC/DC is often used in a high risk environment. It is also used by NASA (see [1]). It’s supposed to show that every condition could have influence on the control flow. In this case it means three tests (n condition – 1).

TEST(Quick, test)
    CHECK(myMethod(true, true) == 1);

    CHECK(myMethod(false, true) == 0);

    CHECK(myMethod(true, false) == 0);

Which metric should I use?

There is no correct answer for this. It depends on the purpose of the system or device. For a lower risk, just choose statement coverage or branch coverage. If there is a higher risk, branch or decision and condition coverage is always a good choice. If you develop spacecrafts or an artificial lung, as a customer I would highly appreciate the modified condition and decision coverage.


Posted in C/C++, Development | Tagged , , , , | 1 Comment

Unable to play DVDs on Xubuntu or GStreamer backend error

Despite the fact that DVDs are a little bit old fashioned, I tried to watch one the other day. To my surprise I wasn’t able to do so. Every time I tried I got the following error

GStreamer backend error
Could not read DVD. This may be because the DVD is encrypted and a DVD decryption library is not installed.

But I already installed the library. I added the Medibuntu repository with the following command

sudo wget --output-document=/etc/apt/sources.list.d/medibuntu.list$(lsb_release -cs).list && sudo apt-get --quiet update && sudo apt-get --yes --quiet --allow-unauthenticated install medibuntu-keyring && sudo apt-get --quiet update

and installed libdvdcss2

sudo apt-get install libdvdcss2 -y

But I still wasn’t able to watch the DVD. As it turned out, I need to set the region of the DVD drive. That’s pretty simply done with the tool regionset, which can be installed with your favorite package manager. Afterwards just execute the tool and set the region with the wizard.

regionset /dev/sr0

Posted in Linux, Technology | Tagged , , , , | Leave a comment

Using nmap to find a Raspberry Pi within a network

I find it really annoying to connect an HDMI monitor and a keyboard to the Pi, in order to get the IP address to connect with SSH. The terminal program nmap is able to scan your network and gets the IP easily.

If nmap isn’t installed, install it with your favorite paket manager. On debian based systems you can use the following command:

sudo apt-get install nmap

Get your own ip with the following command.


In my case my address is This means that the Pi must be also within this range. The following command scans between and, but the maximum has to be entered as CIDR and in binary. The binary value of each section (max number is 255) is 11111111, in sum 24 x 1 and that is exactly what needs to be entered.


The result of the command depends on the network. In my case it looks like the following:

Nmap scan report for
Host is up (0.045s latency).
Not shown: 999 closed ports
22/tcp open ssh

After you got the IP, you can use ssh to get access to the PI with the username pi and the password raspberry

ssh pi@

I highly recommend to change the password after you successfully logged in for the first time.

Posted in Linux, Technology | Tagged , , , | Leave a comment

Step by step installation of Raspbian on a Raspberry Pi

First of all, download Raspbian. Check the website for the latest version. In my case I used wget to download the version:


Get the checksum to check if the download was correct:


Unpack the zip archive:


Check all block devices with the following command, before you put the SD card into your PC:


Unmount the partition:

sudo umount /dev/

Copy the img file to the SD card – Be careful not to overwrite your HDD.

sudo dd if=2014-09-09-wheezy-raspbian.img of=/dev/ bs=4k

You’re finished. Put the SD card into the Pi and turn it on.

Posted in Linux, Technology | Tagged , , | 1 Comment

Podcasts recommendations

I listen to podcasts nearly every day during my commute with my bicycle and I do love podcasts. Here is a short list of recommendations.

Stuff you should know
I know “Stuff you should know” for nearly one year now and it is definitely my favorite. Each episode is 30 min ish long, which makes is perfect for me and the topics are often interesting. The best thing is, however, that the hosts, Josh and Chuck, explain in a very funny and way. Sometimes I just want to listen to them, even if the topic is boring.

If you’re a .NET developer, you know Scott Hanselman. His podcast hanselminutes is often interesting. Scott is a .NET and C# developer by heart, but his podcasts isn’t focused on .NET only.

Chaosradio (German)
Chaosradio is the radio show of the Chaos Computer Club in Germany. The radio show started in 1996 and my first listen was back in 1998. Sometimes very technical, but every time interesting.

Posted in Linux, Other, Technology, Windows | Tagged , , | Leave a comment

Xubuntu, Code::Blocks and Ctrl+F9

Code::Blocks uses the Shortcut Ctrl + F9 to do a build. Unfortunately uses Xubuntu in its default settings Ctrl + F9 to switch to the workspace 9, if available. Xfce wins over Code::Blocks, which means Ctrl + F9 simply doesn’t work.

The solution is simple: Open Settings, go to Window Manager and clear the Workspace 9 shortcut.


Posted in C/C++, Development, Linux, Technology | Tagged , | 1 Comment