Month: December 2010

  • Merry Christmas!

    Merry Christmas to everyone! I wish you all relaxing days and a nice time together with the people you love.

  • Coding trick: Toggle code with comment switch

    Some time ago I stumbled over a neat trick in programming languages which understand C++-like comment lines (single- and multi-lined comments). This allows toggling between two different blocks of code by just adding or removing a simple ‘/’ character in the first line.

        /*  <<- Add/remove one '/' here to toggle active code block
        String mode = "release";
        /*/
        String mode = "debug";
        //*/

    I found this somewhere on Stackoverflow.com but couldn’t locate the article containing this again. I found a reference to this here but I guess this trick is much, much older than this article.