Angry Bits

Words on bytes and bits

Plug StatsD into Munin

Whenever you care about the availability of your service, you need a monitoring tool. I've not a long past as a system administrator and I'd to learn how to do it the hard way. Doing my regular web shopping tour, looking for the tools that most fit my ...

Unicode in Python: Common Pitfalls

Most people don't get Unicode right. It is not their fault, I believe the biggest trouble here is that people underestimate the complexity of Unicode.

I've been working with text manipulation tasks using Python for a long time. During the last ten years I've been collecting thousands ...

Django: serving hashed static files with Nginx

If you are using Django, you certainly know about a nice feature that was added to since 1.4 for better caching static files. I'm talking about the CachedStaticFilesStorage (doc), a new storage which saves static files with also their hashed content values appended to the name.

Why is ...

Backup and Restore

31st March is apparently World Backup Day.

Curiously a few days ago we faced a disaster in a server we are using for some of our services. (Some static websites and some internal services like source code repositories, wiki, etc...) Both of our drives failed (we are using Raid 1 ...

Connect four

We've previously said that most of the algorithms we are looking at on this post series are common to many other games. This post will explain how to make an engine that plays Connect Four and in the meantime prepare the road for the chess engine. We are going ...

Chess board move generations

In the previous post we've discussed about how to choose the best move in a game. The algorithm we've talked about is quite simple but a little detail was ignored: the move generation. Actually we've omit this detail because it's not a small topic and it ...

Minimax, the chess engine's core

A chess engine selects the best move to do given a board configuration. There are several ways to achieve it, despite the common sense, the most used and studied is the simplest: exhaustive search.

Python and Chess

I had flu last weekend and I've looked for something to take advantage of the long stay at home. Eventually I took back some of my old work done on chess engines as I've been thinking recently about making some experiments on them again.

I've started downloading ...

Quick median

As I haven't found any explanation on the web about this useful algorithm, I've decided to write this post. Consider this a follow up of the previous post about the n-smallest algorithm.

Disclamer

Actually the problem we wanted to solve in that post was not really the generic ...

Quick and dirty language detection

Few months ago, during the development of a demo of a product we wanted to try a new feature that required language detection. I couldn't find a pluggable one so we've decided to quickly build up our own. This might sound complicate for many of you but indeed ...

Deployment for a desktop application

Orbit is our first desktop application. As Orbit is a project that evolves continuously, it was necessary from the beginning to enstablish an optimized development workflow and think about how to deploy it. Moreover the first release of Orbit had a strictly short time to market, forcing us to adopt ...

Optimizing workflows

Working in a startup lets you face problems with strict boundaries due to the low budget/time/resources. You need to be creative to find efficient solutions. Part of the management of the available resources is done by development workflows.

With development workflow I mean the whole pipeline that brings ...

Python unit testing and MongoDB

One of the last project I've worked on use MongoDB for collecting events, manipulate them and computing statistics. MongoDB is quite popular nowadays but I couldn't find any doc about integrating it with Python unittest.

When I run tests I like to have a self-configured environment that just ...

No time for testing

Few days ago, I had to review the code of a colleague that was introducing a new feature on our project. The code was just a few lines of code but it was actually setting up a sensitive feature for our product. During the review I've noticed that it ...

Fear and loathing with ctypes

Yesterday I've done some hacks with ctypes. ctypes is a nice library but I've felt like the doc wasn't that good. My task was to wrap librsync to make it available to Python code. I was quite surprised to find out that such a wrapper didn't ...

Nadir never became Zenith

Many years ago, SkiceLab was just an idea and Marco and I were technology enthusiasts trying to build whatever came to our minds. Today, searching for my old stuff in the basement, I've found this:

image0

Divx were getting popular and the regular media devices lacked support for it. We ...

Cite-as-you-write

My master thesis work with my collegue and friend Salvatore Trani was a nice challenging problem on recommending citations for academic papers. We've basically built a system that is able to suggest related papers given the general idea of some research you want to do.

The system wants to ...