Why Python List Comprehensions are awesome

I’m currently in the process of rewriting a bunch of Perl code into Python code and optimising a fairly complex Machine Learning system. Here is a big ugly perl excerpt. It searches strings for ASCII characters 0-9 and replaces them with @@@ for machine learning lemmatization purposes. my @char_array = split(//,$temp); my @final_array = (); …

More

ZSH History Completion

One of the many advantages of switching to ZSH from BASH is the huge number of plugins that provide really useful autocomplete features for git (it will list repositories for you), ssh (it knows your frequently connected hosts and will suggest them for you) and package managers. One of my favourite features is the substring …

More

Another average day at work…

This is my job now...

Me after two cappucinos this morning…

I’m sitting rewriting some fairly in-depth AI and machine learning code and I’ve noticed some less than desirable things: There were a few pointless loops (where the author has decided they don’t need the result from the calculation but left the code in anyway) and some very long iterations used to get around the fact that a container (with about 40,000 elements) isn’t indexed. I’ve got my work cut out – that’s for sure!

Zoo City by Lauren Beukes

When I bought a copy of the Humble Book Bundle in the summer last year, I wasn’t quite sure what I’d gotten myself into. Lots of great authors publishing their books for whatever price you choose? It seemed too good to be true! Luckily, the books I’ve read so far are as fantastic as I’d …

More

Setting up and writing plugins for TwistedBot

Downloading/Installing Sylnai’s TwistedBot (https://bitbucket.org/Sylnai/twistedbot) offers a scalable, pythonic IRC chatbot with loads of really cool extension modules for doing things like googling, flipping tables (courtesy of Afal who also wrote the fweather and rainbowdash plugins too) and more. This brief tutorial explains how to set up an instance of TwistedBot on your machine, get it …

More