Monthly Archives: March 2015

green: a tiny util for turning every third line green

Yesterday I told you about the python module ‘termcolor’, which could be used to print coloured output onto an ANSI terminal. I suggested that every third line should be coloured, to aid readability. Today, I’ll show you how to do … Continue reading


Posted in Uncategorized | Leave a comment

Simple colored output in python 3 using termcolor

Visually scanning long lines of output can cause the eye to lose track of the line you are interested in. Wouldn’t it be nice if you could simulate lineprinter paper? In this article, I’ll show you how with termcolor. It’s … Continue reading

Posted in Python | Tagged , , | 1 Comment

CCL- Carnival – the Market likes the results

Cruise ship company CCL (Carnival) released its Q1 results, sending the shares up 7.2% to 3241p. It reported: We are experiencing an ongoing improvement in underlying fundamentals based on our successful initiatives to drive demand. Our efforts to further elevate … Continue reading

Posted in Uncategorized | Leave a comment

Haskell: collating two lists

I’m working on my rewrite of my accounting program from C into Haskell. I’m tackling the mentally challenging problem of aggregating two lists together. What I have is a list of equities and a list of equity transactions. I want … Continue reading

Posted in haskell | Leave a comment

Collatz conjecture

Whilst fooling around with Haskell, I came across the Collatz Conjecture … The Collatz function f is defined by f(n) = n/2 if n is even f(n) = 2n+1 if n is odd n is any positive integer. The conjecture … Continue reading

Posted in Uncategorized | Leave a comment

Eclipse over Aberdeen

Pictures were taken at Bridge of Don, Aberdeen, Scotland, on Fri 20 March 2015 at approximately 9.30 am. Pictures were taken by Sylwia Mroz, and are copyright by her. Reproduced here with permission. Sylwia is a work colleague of mine. … Continue reading

Posted in Art | Tagged , | Leave a comment

Haskell: use the assign operator (<-) for great victory

I was wondering how to escape Haskell’s “monad jail”. Now I’ve figured it out. I am writing my little accounting package in Haskell. I have “pure” functions which work on regular lists and suchlike. I have written a little parser … Continue reading

Posted in Uncategorized | Leave a comment

zeromq: an easy-to use IPC mechanism

Zeromq is a library that makes IPC as simple as reading and writing messages. No multithreading is required, as zermoq handles all the fuss of queuing and dispatching messages. IPC (Inter Process Communication) is something I have been interested in … Continue reading

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

Haskell: the pleasure of bondage and discipline

Like Emacs vs Vim, static versus dynamic typing is apt to spark bloody holy wars in a brutal attempts to determine who has the kindest and most compassionate God. My Go To language is Python, and one of the many … Continue reading

Posted in Uncategorized | Leave a comment

map_concurrently: simple multithreading in Python

I had been playing with multithreading in Haskell recently, and I was impressed to see that it had a function mapConcurrently, which allowed you to run functions in parallel. I thought I would implement this functionality in Python. Multithreading is … Continue reading

Posted in Python | Tagged | 1 Comment