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