Performance test: rotate images in C# – Bitmap.RotateFlip vs.Graphics-Object

During my search for a function to rotate images in C#, I came across the following post on dotnet-snippets.de: rotate images with C #.
Besides the method presented in the article there were 2 other approaches presented in the comments and so the question was: which method is the fastest of them.
Since this also awakened my interest, I wrote a small test application which checks every of those functions for their performance.
After a few test runs, it became clear that the original solution from the above mentioned post was not suitable because it created a new bitmap every run, what eats tons of memory. Thus, the following function has been excluded from the tests.

public Bitmap rotateImage(Bitmap bitmap, float angle)
{
Bitmap returnBitmap = new Bitmap(bitmap.Width, bitmap.Height);
Graphics graphics = Graphics.FromImage(returnBitmap);
graphics.TranslateTransform((float)bitmap.Width / 2, (float)bitmap.Height / 2);
[…]

“A regular crossword” – a crossword puzzle for coders

How about a crossword puzzle for programmers? One in which the searched words are not described by reference words, but by regular expressions. That’s what I call a crossword. And so I got immediately enthusiastic about the regular expression crossword from this years MIT Mystery Hunt when a friend pointed it to me. (The Mystery Hunt is a competition that is arranged for more than 30 years, held every year at MIT and in which it comes to solve a whole bunch of puzzles.)
One part of this year’s MIT Mystery Hunt is the just mentioned crossword which is titled “A regular Crossword”. Contrary to classical crosswords there are three descriptive directions. The horizontal and two diagonal. Each direction is described by a regular expression.
And now to the puzzle. You can download it as PDF file on the MIT Coinheist page. Alternatively, I’ve saved a copy on my server.

Mastering OpenSSH – Part 1: Installing the OpenSSH server

When it comes to secure connections between two computers, SSH (SSH = Secure Shell) is the drug of choice. Thus for example you can remotely control your home- or web-server by an encrypted connection via SSH. How to install the OpenSSH server (software) on Linux (Ubuntu) and establish and secure the connections, is what I want to show to you in the following series of articles.
As an example scenario, we assume that we have a Linux machine which acts as a server and two computers, one with Ubuntu Linux and one running Windows 8, which represent our clients.
OpenSSH server installation
The first step is to download the server software. The SSH client (for connecting the server with another PC/server for example) can be installed as well if needed.

sudo apt-get update
sudo apt-get install openssh-server openssh-client

After the installation of the OpenSSH server you may need to start the service manually. This can be […]

How to activate USB mass storage and developer options on CyanogenMod

For over three years I’m a user of Android smartphones. At first with Motorola Defy, then Samsung’s Galaxy S2. What both of these devices have in common, is the fact, that both were not running the original ROM for a long time. Too much trash, too much unnecessary, pre-installed software and really to less updates.
Both devices got the CyanogenMod-ROM, one of the most famous mods for Android devices. And because I like to be up to date and also like to try out experimental features, I flash my Samsung Galaxy S2 regularly with the so called nightly builds. (Nightly-Builds = daily updated version directly from the developers. Bleeding edge but not always 100% stable.)
No products found.With the latest CyanogenMod version (10.1), two features have disappeared, so far. On the one hand the possibility to use the phone as a mass storage device on your PC and on the other hand […]

How to set default color scheme in vim

After I’ve shown you Vim and explained the most essential commands, there is  is another tip I’ll give to you. As described in the above linked article, Vim brings a really nice syntaxhightlighting implementation with it. Unfortunately, this is by default, depending on the file type and your monitor, difficult to read. So today I want to show you, how you can modify the Vim syntax highlighting scheme.
Change Vim syntaxhightlighting color scheme
Once you’ve opened Vim, you can change the color scheme with the “colo”-command.

:colo murphy

As you can see, the color scheme is set off from the command mode. In this case, the command is “colo” followed by a space and the name of the color scheme you want to use. (If you like, you can use “colorscheme” instead of “colo”. “colo” is just a shortcut to “colorscheme”.)
vim colo murphy