Roland's homepage

My random knot in the Web

Articles about programming

  1. Using sqlite3 for time management

    After some initial experiments with sqlite as a replacement for a json data file format (which I did not pursue in the end), I have now started using sqlite in earnest. And I must say that I quite like it.

    At $work, we still have to submit written time sheets …

  2. Doing calculations with Python

    As an engineer I do a lot of calculations. These can be done with pen and paper and a calculator, in an IPython notebook or in a throwaway spreadsheet. All of these methods have shortcomings, though.

    Pen and paper is hard to share and (in my case) hard for others …

  3. Structures in Python

    Sometimes I miss the C’s plain old struct in Python.

    Of course Python has dictionaries, but I prefer to write a.b over a['b'].

    Here are several ways of doing something akin to a struct in Python.

    Using a dict subclass

    This is the shortest and most general …

  4. State machines in Python

    State machines can be relatively easy defined as a data structure.

    It has been said that data structures are central to programming. So we should find a way to express a state machine into a data structure.

    The following dictionary of state transitions can be used to define a state …

  5. Using gnuplot from Python

    According to my revision control systems (rcs in those days), I’ve been using gnuplot to make graphs since at least 2002. And I’ve got it set up via a custom gnuplotrc to match the style of the TeX documents I often use the graphs in.

    At work we …

  6. Parallel execution with Python

    With Python it is relatively easy to make programs go faster by running things in parallel on multiple cores. This article shows you how.

    We sill concentrate on a type of problem that is easy to parallelize.

    Problem description

    Suppose you have a huge number of files and a program …


Page 1 / 2 Page 2 →