int modulus(int n, int m) { return n < m ? n : n % m; }

Real Programmers will love this! (Except that they always knew…)

At CppCon’15, Chandler Carruth, lead of the Clang team at Google, gave a great talk titled Tuning C++: Benchmarks, and CPUs, and Compilers! Oh My!. The talk that is mostly live-coding and micro-benchmarking is both, informative and entertaining. Among other things, Chandler presents an optimized version of the good old modulus. Let n be a non-negative and m a positive integer. Then he proposes replacing n % m by n < m ? n : n % m because – after all – if n is less than m, there is nothing to compute.

What supposedly was meant to be a joke, proposing a dumb micro-optimization that actually makes the code run slower, turned out to be in fact an improvement. This is astonishing because it violates just about every principle we’ve learned about writing fast code. Continue reading

A Simple Script for Generating Printed Sheets With Your OpenPGP Fingerprint

For some time, I have used printed sheets with my OpenPGP key and a short summary of the most important commands needed to fetch it from a key server, check its fingerprint and sign it. These I handed to people who wish to use and potentially sign my key as a secure means of exchanging my key’s fingerprint. It turned out that people liked these sheets and I have been asked how to generate them. The versions I have used in the past were just hand-crafted TeX documents but for your convenience, I have now written a simple shell script that will generate such sheets. Here is an example.

In the most simple case, you can simply run

Continue reading

Die Hacker sind an gar nichts schuld

Sehr geehrte Damen und Herren beim Deutschlandfunk,

seit Tagen berichten Sie immer wieder von dem Angriff auf die IT-Systeme des Deutschen Bundestags. Während ich der Berichterstattung bislang nur äußerst wenige technische Details zu Art und Umfang des Angriffs entnehmen konnte, ist mir aufgefallen, dass Sie regelmäßig von „Hackern“ sprechen, die den Angriff ausgeführt haben sollen. Während es nach meinem aktuellen Kenntnisstand nicht gänzlich auszuschließen ist, dass dem tatsächlich so gewesen sein könnte, halte ich es doch für äußerst unrealistisch, und bitte Sie, von dieser unbegründeten Anschuldigung in Zukunft Abstand zu halten.

Continue reading

A General Prohibition for Teachers in Public Schools to Wear a Headscarf is Incompatible with the German Constitution

One of Germany’s worst and most freedom-denying pieces of law has become a thing of the past. Because of a mature insight on behalf of the responsible politicians to revoke unjust legislation? No way! This is not how politics work in Germany, sadly. Instead, the Federal Constitutional Court of Germany (BVerfG), one more time, had to settle the mess politics has left behind.

In a court decision from January 27 (1 BvR 471/10, 1 BvR 1181/10) that was published today, the BVerfG has ruled that legislation by the state of North Rhine-Westphalia (NRW) that prohibited non-Christian teachers to dress according to their religious believes is partially incompatible with the Basic Law for the Federal Republic of Germany (GG) and partially has to be applied in a restricted manner to be compliant with the GG. Continue reading

30 Years of E-Mail in Germany

Today, it has been exactly 30 years since Germany’s first e-mail was received in Karlsruhe. This anniversary was celebrated with a small event at the Karlsruhe Institute of Technology (KIT). A press conference was organized and students launched 72 helium balloons shaped as 0s and 1s that were arranged to read 0x4B40726C7372756865. (I didn’t actually verify this.) While personally I disapprove of such intentional and needless environmental pollution, it was a great opportunity for us to raise awareness for privacy of e-mail communication and teach people about OpenPGP. Continue reading


Get every new post delivered to your Inbox.