Angry Bits

Words on bytes and bits

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 ...

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 ...

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 ...

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 ...