ferrari.mind.publish()

You just found Benjamin Ferrari's web log. I occasionally write here about stuff I'm fascinated with. You might also be interested in my link feed, where I constantly post stuff I found on the web, or the comments I write on other peoples sides. Finally, I recommend this list of other web logs to you.

Popular Articles

Python Decorators

Ruby, Python Compared

Delicious As a Feed Aggregator

Re: Developing A State Of The Art Web Application

Reduce Any Map And Filter All Lambda

Blogging With Emacs, Ruby and Textile

A short note on Mac OSX (Tiger)

Closures in Python

You can subscribe to all my stuff using RSS syndication: RSS (articles and linkfeed | articles only | linkfeed only | contributions to other sides)

You can also contact me at
benjamin DOT ferrari AT knallgrau DOT at

This blog is still beta. Everything you hate will be fixed in the final version.

This blog has moved to http://blog.bookworm.at . The most up-to-date RSS feed is http://blog.bookworm.at/feeds/posts/default Please update your feed readers. Thank You!

Source code of chinas sentencing program revealed

I read on slashdot that a chinese court is using software to mete out sentences in criminal cases.

I was getting really curious of how such a program was implemented, which tools were used and so on. So I did some research and finally got the full source code from one of my super secret hacker snitches.

I'm even allowed to post it here without permission, since all code from china is automatically licensed under an open source license (this is because communism and open source are practically the same thing. Thanks to the Microsoft guys pointing this out).

Here it is:


years_in_jail = 5
for word in evidence:
  if word in ["freedom", "falun gong", "democracy"]:
    years_in_jail += 10

print "I recommend a %d year sentence.", years_in_jail
As a sidenote: The program was first written in Ruby but it had to be ported to Python because of Rubys poor unicode support.

.