I was asked today if one could make LaTeX skip all occurances of the value 13, in all counters, as some buildings do. Well, of course you can:
\let\stepc\stepcounter\renewcommand{\stepcounter}[1]{%
\ifthenelse{\equal{\value{#1}}{12}}{\stepc{#1}}{}\stepc{#1}}
Here, we first save the \stepcounter macro in \stepc, then we renew its definition by stepping the counter twice if its current value equals 12, therefore effectively omitting the 13th occurance. Also, you should watch the thirteenth floor, it's a nice movie if you're into scifi.


Because apparently, some people our age still do not know about the Pilot Frixion Pen ((At the time of writing, this ebay shop is Germany's cheapest option.)), let me just very briefly inform you about this ingenious item. It is a regular ball pen, but the ink it uses turns invisible under a certain amount of heat. Hence, the Frixion has a little rubber nob at the end, which effectively works as an eraser, because rubbing it against a sheet of paper produces enough heat to turn the ink invisible! Good news: Leaving your lecture notes on the heating does not erase them. Seriously though, this pen is just awesome.


Let's say you have a Windows PC on a 64 bit machine. Obviously, you have Cygwin because anything else would just be silly. Then you want to develop C-Applications that you can compile and run on large Linux-based servers, so you turn to an an IDE that can work with Cygwin. Now here comes the twist: For whatever stubborn reason, you want to be able to compile your applications native 64 bit, and you want to do it in Eclipse, and you want to be able to debug them. Do you want to know how?


Roman told us about a turing machine in Magic: The Gathering™. The design seems very complicated at first, I would have thought that there was an easier way to do it. However, with the 8 minutes invested so far, I did not come up with a better implementation.


I was recommended taskwarrior by Lars, who advertised it as a very cool todo-list manager for the commandline. It's available under cygwin as well. I wanted to give it a try today, so installed it and checked out the taskwarrior homepage. The first thing it does, it leads you to the 30 second taskwarrior tutorial where they give you a very tiny set of commands you need to make a todo-list in the most literal sense: A list of things that you have to do. Of course, the program can do much more than that, and I am not even familliar with all of its features. However, at this point already, I want to comment positively on the unusually gentle learning curve it provides, compared to most other Linux tools. This is an aspect of program design often neglected: Do not overwhelm the user, in particular not with features that are optional. I think a great many deal of open source projects could benefit significantly from improvements in that area, because all elitism aside, a large and devoted userbase is the heart and soul of a vivid, open software project.


You use Opera? Good. Go to * Settings * Preferences * Advanced * Content Check the checkbox that says Enable plug-ins on demand. This is the plugin setting you always wanted. It replaces all plugins (say, annoying flash ads) by a little play button which you can click to activate the control. This way, all plugins are disabled by default (and that's good, because most of them are annoying), and whenever there actually is a plugin that you want to use, just click the play button and play your silly flash game if you must.


Here's my code for quickly uploading files to virustotal and retrieving the reports.
import postfile
import sys

import json
from StringIO import StringIO

import urllib
import urllib2

import time

import webbrowser

apikey = 'YOUR API KEY ' + \
         '  GOES HERE  '
resources = []
for i in range(1, len(sys.argv)):
    file = sys.argv[i]
    print 'Preparing Scan of %s ...' % file

    host = 'www.virustotal.com'
    selector = 'https://www.virustotal.com/vtapi/v2/file/scan'
    fields = [('apikey', apikey)]
    file_to_send = open(file, 'rb').read()
    files = [('file', file, file_to_send)]

    print 'Uploading file...'
    ret = postfile.post_multipart(host, selector, fields, files)
    try:
        data = json.loads(ret)
    except ValueError:
        print 'Cannot decode server response: '
        print ret
        exit()
    print 'Upload done.'

    # for k in data: print '%s: %s' % (k, data[k])

    resources.append((file, data['resource']))

print 'Retreiving reports...'
i = 1
permalinks = []
for resource in resources:
    response_code = 0
    while response_code == 0:
        url = 'https://www.virustotal.com/vtapi/v2/file/report'
        parameters = {
            'resource': resource[1],
            'apikey': apikey
        }
        data = urllib.urlencode(parameters)
        req = urllib2.Request(url, data)
        response = urllib2.urlopen(req)
        ret = response.read()
        data = json.loads(ret)
        response_code = data['response_code']
        #print json.dumps(data, sort_keys=True, indent=4)
        if response_code == 0: time.sleep(5)
    #print json.dumps(data, sort_keys=True, indent=4)
    permalinks.append(data['permalink'])
    print '%2i: %s' % (i, resource[0]), 
    print ': %i / %i' % (data['positives'], data['total'])
    i += 1

wb = webbrowser.get()
selection = 0
while selection >= 0 and selection < len(permalinks):
    selection = int(raw_input('Open: '))-1
    if selection >= 0 and selection < len(permalinks):
        wb.open(permalinks[selection])
P.S.: This is all part of a great plan I'm following at the moment. Edit (2013-09-05): Since the VirusTotal API is now out there for a while, a lot of awesome python libraries have emerged: * https://github.com/Erethon/vta.py * https://github.com/Gawen/virustotal * https://github.com/botherder/virustotal * https://github.com/Xen0ph0n/VirusTotal_API_Tool


Lars has put together a rather disturbingly large list of objects that are either useless or dyfunctional. Most of them have pretty YouTube Videos. Maybe one of them makes for a great gift. Do you want to look at them?


I have wondered how to undefine existing commands in $\LaTeX$ for so long. Finally, I googled it up. It's easy. Simply
\makeatletter
\let\command\@undefined
\makeatother
and the \command has been undefined. This does not cause an error when \command was undefined before. After that, you can merrily
\newcommand{\command}{Hell Yeah.}
and be on your way.


I just wanted to include an SVG file into a LaTeX Beamer presentation and I found the following articles very useful: * LaTeX and Inkscape * includesvg Apparently, Inkscape has a built in feature that allows you to write LaTeX-Code in Inkscape, export the generated SVG image as PDF and then even reimport this into LaTeX documents. Awesome!


Under Cygwin, you can install the 64 bit mingw version of GCC, but you don't get the gnu multiprecision library for free with it, you'll much rather have to compile it from source. I ran into a bit of trouble here: It will not suffice to tell the configuration script about the new compiler, there are now mingw-64 versions of all relevant binaries that should be used instead. Basically, you go like
tar -xjf gmp-5.0.4.tar.bz2
cd gmp-5.0.4
./configure                          \
  AR=x86_64-w64-mingw32-ar           \
  AS=x86_64-w64-mingw32-as           \
  DLLTOOL=x86_64-w64-mingw32-dlltool \
  DLLWRAP=x86_64-w64-mingw32-dllwrap \
  CC=x86_64-w64-mingw32-gcc-4.5.3    \
  NM=x86_64-w64-mingw32-nm           \
  LD=x86_64-w64-mingw32-ld           \
  OBJDUMP=x86_64-w64-mingw32-objdump \
  RANLIB=x86_64-w64-mingw32-ranlib   \
  STRIP=x86_64-w64-mingw32-strip
I am not sure if all of these are needed, but it won't hurt either. After that, you should
make && make check
the whole thing. Worked perfectly for me, so now I can link with libgmp.a in .libs and native 64 bit bignum action ensues!


Als großer Befürworter von Palatino-Schriftarten ((insbesondere auch mathpazo für mathematische Texte)) möchte ich natürlich auch meine Briefe so verfassen. Wem das nicht passt, der kann ... trotzdem weiterlesen! Wesentlich wichtiger war mir für diesen Brief nämlich, dass die Adresse des Empfängers bei korrekter Faltung in einem Fensterumschlags sichtbar ist. Das sieht dann etwa so aus. Wollen Sie den Code sehen?


Ich befand mich vor nicht allzulanger Zeit in der unerquicklichen Lage, dass mein sage und schreibe sieben Jahre altes ThinkPad so langsam den Geist aufgab. Meiner Meinung nach sind ThinkPads immer noch das Mittel der Wahl, auch wenn inzwischen Lenovo draufsteht. Ein Kommolitone empfahl mir dazu Notebooks wie Neu: Dort werden ThinkPads verkauft, die mal irgendwann auf irgendeiner Messe ausgestellt worden sind und damit formal als Gebrauchtware gelten. Ich war zunächst skeptisch, doch gab es mein Wunschmodel dort rund 30% günstiger, also wurde das gute Stück einfach direkt mal gekauft. Ich habe es jetzt einige Wochen und kann nur sagen, ich bin rundum zufrieden. Das Gerät ist wirklich wie neu.