Lisa Christmas 2021

Is it a shed? No, Is it a treadmill? No, it’s a ShedMill Combining the best of an insulated shed (it’s secure, dry, free from the elements) and a treadmill, the ShedMill ™ is the ideal place to exercise at home. There is an opening window for ventilation, a shelf for an Ipad or sound system, lighting and of course power. And because it’s at home, there’s none of those posey people from the gym to distract you. [Read More]

Learning a Language Part 1

So it turns out I don’t have as much free time as I thought I would during lockdown!. About six weeks ago I posted that I was going learn 5 new languages during the free time I expected to be encountering. However things haven’t worked out quite like that. I’ve been lucky enough to be able to carry on working which I ‘m grateful for and so there hasn’t been as much free time as expected. [Read More]

A New Challenge

First of all I hope everyone is safe and doing all they can to keep themselves and their families safe. As we all adjust to the restrictions imposed on our daily life by the current Covid-19 outbreak. We are forced to find new ways to fill the time. In a brief interview on the Andrew Marr show this morning, Stephen Fry (president of Mind the mental health charity) was asked how he was coping with the situation. [Read More]

Autogenerating Inverse Maps

NOTE: This is a post written sometime in the early 2000s The map class in the C++ standard library works like an associative array, mapping from one type collection to another for example from color names (“Red”, “Green”, “Blue) to RGB values (0xFF0000, 0×00FF00, 0×0000FF). Sometimes you require to map both ways and while it is simple to generate the inverse map, it can be tedious to do it for lots of maps. [Read More]

Configurable Items Example

NOTE: This is a post written sometime in the early 2000s This is a quick example of how the configurable items manager (as described in Don’t Shoot the Reviewer ) could work. #include <string>#include <iostream>#include <map>struct ValueTextPair { public: ValueTextPair(int val, char *text) { m_Value = val; m_Text = text; } int m_Value; char *m_Text; ~ValueTextPair() { //std::cout << "Destroying ValueTextPair with value " << m_Value << std::endl; } }; class MapStream { public: MapStream &operator<< (const ValueTextPair &aPair) { m_map. [Read More]

Don't shoot the reviewer

NOTE: This is a post written sometime in the early 2000s Introduction Recently while reviewing some code that a colleague has written I made a fairly innocuous comment (or so I thought). The code was a series of nested switch statements and looked something like this switch (param->type) { case LINE_SPEED: switch (param->data) { case BAUD_19K2: retVal = "19200"; break; case BAUD_9K6: retVal = "9600"; break; . . . [Read More]

Include Files – Best Practice

NOTE: This is a post written sometime in the early 2000s Include files for C++ (and C) are a simple idea but they are often misused. The main intent of an include file is communication. While that is a woolly statement, it is quite true. A header file communicates the interface of a class/module to it’s clients and nothing more. Anything that a client needs to know in order to use a class/module (I’ll use class from now on to mean either) should be present in the header file, anything that is used internally by the class should not [Read More]

Sorting Algorithms

NOTE: This is a post written sometime in the early 2000s Often we require data to be ordered according to some criteria but how do we sort the data? This has been an active area of research for decades. Here I compare a few of the more well known algorithms. Bubble Sort I think I was in secondary school when I first encountered a sorting algorithm, as part of a computer studies class project we had to implement one. [Read More]