Final notes on Notes

Now that I’m no longer working for IBM, I’m saying goodbye to the application formerly known as Lotus Notes, as well as the server known as Domino. Both have been sold off and are now products of an Indian company called HCL Technologies, but they were still in heavy use within IBM. Mention Notes online and you’ll usually encounter derision, particularly from people who think it’s an e-mail program. It was all too often sold as one, but that was really something it could incidentally handle, not what it was designed for.…

Go HTTP handler patterns

Imagine you’re a beginner writing a Web Service or web application in Go. Everything is going fairly smoothly, right up until you realize your HTTP handlers are going to need to access a database. The http.HandlerFunc interface is set by the Go standard library: type HandlerFunc func(ResponseWriter, *Request) There’s no obvious way to add more arguments, so what can we do? I’m going to run through three different ways to solve the problem: the object-oriented approach, a more functional approach, and a third variant using an interface and an adapter function.…

COBOL

A story has been making the rounds about how New Jersey suddenly needs COBOL programmers to fix its unemployment claims processing system. People have expressed horror, amusement or incredulity that COBOL is still being used, and that the system is so obsolete (reportedly running on 40 year old hardware.) I’m not a COBOL programmer and I don’t work in the mainframe division, but I’d like to point out a few things about this story.…

Building a Kotlin fat JAR with IntelliJ IDEA

Here are my initial assumptions: You want to build a command-line tool or server task. You want to use Kotlin for as much of the project as possible. You might use some Java-based libraries Your main main() binary will be in Kotlin. You want building the binary to be as quick and easy as possible. You want to end up with a single fat jar file you can deploy to any JVM.…

Go and SQL memory leaks

The scenario: You’ve got some Go code. You can run the unit tests individually, but when you try go test -v ./... or try to run continuous integration, the tests fall over from lack of memory. There are lots of things that could be causing the problem, but one you should definitely check for is unclosed SQL database statements and connections. You’re probably aware that the general pattern for SQL queries in Go, assuming you have a sql.…

JDBC connections over TLS with IBM DB2 11.1

With GDPR around the corner, lots of organizations are suddenly developing an increased interest in encryption. In particular, I found myself asked to ensure that all of our database access was performed over encrypted channels. No problem, I thought, DB2 is bound to support TLS connections. And indeed it does, but the setup process turns out to be a bit involved. While I was changing things, I decided to upgrade to DB2 11 and implement pooled JDBC connections.…

Java time conversion madness

Lotus Notes is an old piece of software. It was inspired by PLATO Notes and DECNotes, and its development began in 1984. The first release was in 1989, though that’s not particularly old by IBM standards – IBM is still developing IMS, the database designed in 1966 as ICS/DL/I to keep track of the approximately three million parts that made up an Apollo Saturn V. Nevertheless, Notes predated Java, JavaScript, Unicode, TCP/IP support in Windows, and many other things we now take for granted.…

Logging levels in Go

I keep seeing people in the Go community suggesting that there’s no need for error levels when logging. Often this idea is pushed through memes like “You don’t need levels if you’re only logging errors”. Perhaps I see this in the Go community because Go’s standard logging API has no support for levels. I think Go’s logging is woefully inadequate. I’ve tried levelless logging, and it doesn’t work for me.…

Go, PostgreSQL, time zones, UTC, and +0000 +0000

Imagine you’re writing a web application in Go, and storing your data in PostgreSQL. At some point, you find yourself wanting to store timestamps, and display them to the user in local time. Being a smart developer, you decide to store all your timestamps in UTC, and convert them for display. Suppose you use a TIMESTAMP WITHOUT TIME ZONE data type, because you know all your values are going to be UTC.…

Go Fish

I’ve been trying Fish, the Friendly Interactive Shell. I was driven to do so by two Zsh bugs. The first is that when I SSHed from a Linux machine to a Mac, something was getting messed up or not initiated correctly in my terminal session. There were control codes which messed up the display, and no matter what I set the prompt environment variables or TERM to, they remained. The problem didn’t occur in the opposite direction.…