This is my home in the virtual world, where I write
about things that I want to share. The freely available software that
I've written as well as some of the photographs I've taken over the
years can also be found here. Please use the navigation links on the
right if you are looking for something.
While regular expressions can't fully parse XML, they can be sufficient to
extract data from it. In cases where the dataset is large and we are only
interested in a small part of the data, this can be significantly faster than
using a full XML parser.
This documents how I installed Python bindings for libmagic.
There are actually different bindings for libmagic. One set is part of the
original distribution. It can be found in /usr/src/contrib/file/python/.
But in my opinion it is somewhat cumbersome to use and not very Pythonic.
The implementation from ahupp/python-magic in Github feels more natural.
So I got a call from a friend who's ms-windows 8 laptop was wedged.
Having set the machine up for him, I felt obliged to help, even though
troubleshooting ms-windows ranks pretty on the bottom my list of favorite activities.
Manufacturing is more of a craft than it is science.
After having seen it linked on Hacker News, I've been following Spencer
Wright's adventures in additive manufacturing (more specifically powder bed
fusion in titanium);
Photos from modern digital cameras are generally so large these days
that you have to shrink them to use them in a document. I do this a
lot, so I automated it.
The foto4lb.py script shrinks the files it is given to a width of 886
pixels, and shrinks ...
The csv2tbl.py script takes a comma-separated values ("csv") file, and
converts it to a LaTeX table. It handles a couple of different possible
seperators; semicolon, comma and tab. Of those it automatically pics the one
that occurs most.
N.B.: it does not try to interpret quotation marks!