Programming

How to keep an iPad awake

The database on my one of my health tracking apps was corrupted and the FAQ said to remove the app and reinstall it. I have been using this app for a long time and the iPad Pro its running on is due for replacement. Apparently I have a lot of data in it and security features I can't turn off (auto lock screen) mean that it needs to be kept awake while it won loads.

So how do you keep an iPad awake for more than 24 hours …
Read More...

Five minute intro to debuggers for Go

What should be written on the Golang / Go debugger box



The out of the box experience of debugging Go on a Mac was a tad disappointing. I was expecting to be able to type my usual list command and throw in a few break points and get started.

Firstly, gdb is no longer installed by default with the developer tools (apparently it works but …), and secondly lldb (which is installed by default) could not even list the code.

Delve (dlv)



Next up was dlv (
https://github.com/go-delve/delve) which is designed for Go.

This short article will cover the few things I found out the hard way that would have speeded up the experience of getting started with this debugger.
Read More...

Perl on BSD talking to MS-SQL Server

A lot of broadcast monitoring equipment seems to use Microsoft SQL Server as backend for storing alerts and other data. As we use a FreeBSD based monitoring box it proved necessary to find a way of accessing these servers via ODBC. Read More...

Don't forget your keys

Data cleansing is the process of taking the data contained in a data base and correcting the errors in it. It is probably one of the most hated jobs in the industry as it tends to be both tedious and exacting. The final two nails in its coffin is that it is almost never finished and almost never completely correct. All in all a miserable and mostly unsatisfying experience.

One of the secrets to success in data cleansing is in selecting keys i.e. the fields that allow the identification of the record to be updated. Read More...

The Power of Random

A few years ago I spent a great deal of time thinking about parallel programming. One of the counter intuitive things that emerged was that organisation in a massively parallel system can be detrimental to performance. A recent article on LinkedIn by Don P (To Be More Successful, Study Failures) which mentioned under sampling reminded me of one of my key counter intuitive conclusions. Read More...

Python Serving HTTPS with CGI

One of the claims often made about Python is that it is so easy to extend the language and change the behaviour of an object. The classic example of this is turning the standard library http server into an https server. Unfortunately, although there are hundreds of examples on the web about how to do this - made even more numerous by the move to Python 3 - days of testing here failed to get them to work with CGI scripts. Ordinary pages worked fine, but CGI would fail silently. Apparently these same examples worked on PCs.

The problem turned out to be a quite subtle implementation difference between the Mac and Unix handling of CGI processes and the PC approach in the Python library. Read More...

Range Inputs and Events

The range input looked perfect for writing a web interface to control volume levels on a batch of play out boxes. However, the initial choice of the onChange Javascript event turned out to be both naive and unworkable when tested on an iPad under Mobile Safari although it appeared to work well enough for a mouse driven interface. The better solution was to use two events: onMouseUp and onTouchEnd. Read More...

Internationalising PHP Web Control Panels

Cocoa on OS X is Unicode based. This makes working with non-ASCII character sets fairly easy … provided you can encode them in a unicode format. PHP has some facilities for writing UTF-8 character set based files. Read More...

Replacing Cocoa applications with a new instance

Sometimes you need to start a Cocoa application and have it replace a previously running instance of itself. In the case of the application that we are writing it is invoked by the open command line command and we then want it to replace a previously running version of the program. If the application is activated from the GUI we want the default behaviour going to the open application to be preserved. Read More...