An Eccentric Anomaly: Programming

Ed Davies's Blog

Pages tagged: Programming

Programming and related frustrations


I don't much like telephones. They're great for “operational” use for updating when you're already expecting visitors, deliveries or whatever. They're also great for chatting (particularly with video), again when you're expecting a call because you've just escalated from chatting on a text medium or whatever.

What I don't like are calls (incoming or outgoing) when you're not expecting things and are put on the spot to make decisions. And they're totally infuriating for transferring data (e.g., giving an address or directions). And the lack of a record is a serious impediment (though I suspect some people see that as a plus, but maybe they have better memory than me).

I don't hate telephones as much as James Fisher does but I can definitely recognise where he's coming from.

So, it's a bit surprising how many telephone numbers I have.


Raspberry Pi Clock

The Raspberry Pi is (in)famous for not having an internal hardware clock to keep time while it's powered off. This can mean that the clock has weird values for a few minutes after the device starts up until it's got a network connection and an updated time via NTP.

There are battery-backed real-time clock boards (“hats”) available for the Pi but I haven't got one. Here's how my logging software deals with this.


Raspberry Pi Setup

I have an “always-on” Raspberry Pi 3 which does logging of temperature, pressure, power use and so on readings from around the house and county.

I've had it just over a year and it's been running the version of Raspbian (the Debian Linux distribution modified for the Pi) that was current when I got it. The logging has been to flat files containing lines of JSON but recently I started switching to a Sqlite3 database but was having problems with the code running on the Pi which didn't happen on my laptop running Ubuntu 17.04. I strongly suspected the problem was the old version of Sqlite3 or Python3 in that Raspbian distribution so decided to upgrade to the latest Rasbian (2017-11-29, based on Debian 9 Stretch rather than the previous one which was based on Debian 8 Jessie).

During the installation on the new system I made notes of what I needed to do to get my code running. For my own future reference and maybe of help to others, here they are.



Some lines which have been in my /etc/hosts file for a while:


Unique Email Addresses

Lots of websites, forums, etc, ask you for your email address. I usually make up a unique email address for each for a number of good reasons, including a new one I've just realised today. However, there are also some downsides to the scheme.


Cryptography, Blank Minds and the Law

This afternoon I had a little crypto-fright, forgetting an important passphrase for a while.


Wider Encryption Considerations

Yesterday I wrote some comments on the UK government's response to a petition submitted to the parliament web site on encryption. Those comments were rather specific to the general technical issues with the response.

I'd also like to make some wider comments.


RevK's Encryption Petition

Adrian Kennard submitted a petition to the parliament web site asking (implicitly) that the government not ban strong encryption. I and about 11'000 others signed this petition so the government felt obliged to respond.

Regrettably, they didn't seem to feel the obligation to make much sense in the response.


SExpr: Parts Lists

The point, at least originally, of my SExpr mini-language is to make lists of parts so it's worth talking about those a bit.


SExpr: Indentation

My little Lisp-like SExpr language has significant indentation, that is indentation is used to delimit syntactic constructs (lists in this case). A bit about why and how.