Category Archives: Coding

Sort python dictionaries by values

Perhaps you already encountered a problem like the following one yourself: You have a large list of items (let’s say URIs for this example) and want to sum up how often they were viewed (or edited or… whatever). A small … Continue reading

Posted in Coding | Tagged , , , , , , , , | 2 Comments

Min-Heap in Python

I recently wanted to implement a small event system where events can have different priorities. So for example the event with highest priority (lowest value) should be handled first. Python comes with a heapq module which can transform a list … Continue reading

Posted in Coding | Tagged , , , , , , | 4 Comments

Python and encoding

Well, first real post, so let’s start easy. I’ve been working a lot with python lately, and came across a nice short How to Use UTF-8 with Python which also makes the difference between unicode and utf8 very clear. The … Continue reading

Posted in Coding | Tagged , , , | Leave a comment