Donnerstag, 14. April 2011

I wrote a guide to set up a Clojure development environment for Emacs and Ubuntu/Debian (and friends). Check it out here.

I try to keep it updated, as Clojure and it's dev tools are changing and evolving pretty fast.

Freitag, 04. März 2011

I sometimes need the IP address of the current machine and information about it in a machine readable fashion. So I created ip.beached.org, which returns a JSON object encapsulating your IP information. Not a big thing, and also available on dozen other places, but sometimes very useful for me. And now, perhaps you.

Note on the city data: I use the (static) free Maxmind GeoLite database. If your city response is not correct, the database just doesn't know better. Sorry.

Mittwoch, 23. Februar 2011

Today I stumbled upon this hexadecimal clock on many german blogs. A really nice idea and well made, but what troubled me a little bit was that it's Flash based. And I don't really like Flash and it's enormous CPU requirements. So I built my own version, based on the canvas element for HTML5.

The background, like the original version, changes it's background according to the hexadecimal value of the clock. You can also click somewhere on the page to switch the clock display and/or click the small bar (which indicated the percentage of the day already over) to add a small hex-only clock.

I hope you like it!

Dienstag, 30. November 2010

While working in my latest project, the CachePlanner, I was in the need of a code highlighting tool for blog entries (and code embeded there) and found google-code-prettify. It's used at code.google.com and Stackoverflow (and friends). But what I was missing was a nice theme like Zenburn, so I did my own version for Prettify. You can download the prettify.css here.

And here is a small sample. It looks, of course, best on a dark background. This one is #222.

import sys
import math

input = sys.stdin.readlines()
t = int(input[0])

for i in range(1,t+1):
    s = input[i].split()
    n = int(s[0])
    m = int(s[1])

    # algorithm
    l = range(2, m+1)
    msqrt = int(math.sqrt(m))

    for i in l[:msqrt-1]:

        for j in range(2, m+1):
            try:
                l.remove(j*i)
            except ValueError:
                pass
            
    for x in l:
        if (n <= x and x <= m):
            print x