Entries by Kevin Godden

C++ thread safe blocking queue using boost

In Software Engineering some patterns reoccur only every few years. The blocking queue pattern is on such for me. Here is a great article on an implementation of a thread-safe blocking queue that uses boost for synchronisation: http://www.justsoftwaresolutions.co.uk/threading/implementing-a-thread-safe-queue-using-condition-variables.html I implemented something like this some years ago (without the benefit of boost etc.) and now I […]

Making an external connection to a Blaknight MySQL database

You can connect to a Blacknight MySQL database from an external tool (e.g. mysql or mysqlimport commandline) if you change some of the database’s settings. This can be useful if you need to manage your database, for example if you need to perform a large database import (one that is so large it causes phpMyAdmin […]

New Scientist Enigma 1780 and Python

Sometimes a body has to take a break from all this Software Engineering stuff and instead delve into some recretional programming, so with this in mind I decide to see if I could write a small python program to solve the New Scientist Enigma #1780. This enigma is kind of like suduku on an icosahedron […]

Software Requirements Specification

I am currently of writing a fairly large software requirements specification for a client. I am acutely aware that in general people don’t like to read documents, and that large terse documents like software development specifications can be especially challenging. To help reduce the amount of effort that readers will have to put into reading […]

sed: unsupported command e

If, when you try to use sed command to do a search and replace you get the following error: sed: unsupported command e Then you may have forgotten to include ‘s’ at the start of the command, e.g. this will produce the error: sed -i ‘/^server\s\+\S\+$/server 192.168.1.145/’ test.conf While this will work ok (note the […]

Converting between std::string and .NET System::String in C++/CLI

In the software development world it seems that we spend most of our time converting from one data representation to another….. So with that in mind, Here is a vary handy cheat sheet for how to go about converting to and from standard strings and .NET System::String when using C++/CLI/CLR: http://msdn.microsoft.com/en-us/library/bb384865.aspx Note that the include […]

Mathematica to be bundled with Raspberry Pi

The register reports that Mathematica is to be bundled with the RaspberryPi which to my ears is fantastic news as Mathematica is by far my favourite mathematical tool even if the forces of convention force me to use the slightly duller Mathlab most of the time… sudo apt-get update && sudo apt-get install wolfram-engine