Yo-Dave

Things I'm Likely to Forget

Restart River5 after Reboot with PM2

I run a River5 “River of News” on a Raspberry Pi wirelessly connected to my internal home network. Sometimes, the power fluctuates, and the Pi reboots. I want to have River5 restart when the system comes back up. There are lots of ways to restart stuff on Linux. (I am running Raspian GNU/Linux 8.0.) The process manager I use is PM2 – mostly because it knows Nodejs. River5 is written for Node.

New Blogging Setup

It’s been a bit of a slog, but things should be up and running again. The transition was a bit harder than expected. Here are some things you should know: The site is generated by the Hugo static site generator. The site uses a trivial modification of the very pleasant Blackburn theme. There are still some kinks I want to work out, but it is very useful overall. The repository for the site is on GitHub here and is generated from the information in the repository here.

So Many Broken Links

As noted in yesterday’s blog, I’m making a sweep through my previous posts trying to fix links that have broken over the years. This is in preparation for switching to another blogging platform. I find that the rot even creeps into the README.md files in my own code repositories. Many of them refer back to descriptions of the repositories posted to no longer existing versions of the blog. I’ll fix those as soon as I can.

Bit Rot

Every once in awhile, I change blogging platforms. Recently I have been working on a switch to Hugo. Whenever I go through this exercise, I religiously check for broken links. There are always plenty. Most of the time, when broken links are found, I can find a replacement. Sometimes not though. Sometimes something is just gone. No new address. No record in the Internet Archive Wayback Machine. Just gone. I know I’m contributing to this myself by changing hosts and blogging platforms.

A Timestamp Plugin for Sublime Text 3

Since switching from Windows to a Mac in the middle of developing a new wiki, I lost access to the MarkdownPad Markdown editor – it’s Windows only. One of the nice features of MarkdownPad was the ability to insert a timestamp easily. It’s what I used to insert the creation date and the time of the last modification. Since the switch, I’ve been using Sublime Text 3 as my editor for Markdown files.

Another Useful Function -- convert-seq-to-comma-separated-string

This is a little note about a function I find myself using frequently in Clojure. User interface code often needs to display a list of things as a comma-separated list, e.g. “a, b, c, d”. If all of the things are strings, you can use the built-in string/join function to build such a string. When you have a sequence of things that are not strings, I suppose you could convert each element to a string and then use string/join.

sorted-set-by

This is just a little note about one of my favorite datatypes in Clojure. Like most Lisps, Clojure has a very useful group of datatypes built in including some set types. I use sorted-set a lot. Until recently, I hadn’t noticed sorted-set-by, a function that returns a sorted set using a comparator you specify. I found myself needing to create a sorted set of strings where the sorting was case-insensitive. The sorted-set-by function was exactly what I needed.

A New Version of the Confidence Interval Program

Recently, I wrote about updating an old program that did the Sign Test. Well, I have lots of old programs that could stand a bit of refreshing. Another of the simple ones calculates the confidence interval around the proportion of successes in a series of Bernoulli trials. I wrote about it way back in 2011. The original was written in Java and Swing many years ago. It is still available in a repository on Bitbucket.

Spell Checking in the Editor Changes the Way I Name Things

While editing some program text recently, I noticed myself doing something weird. I do most of my programming in Clojure these days. I mostly use IntelliJ IDEA with the Cursive plugin for Clojure. This turns out to be a great way to develop. One of the (many) things I love about IntelliJ IDEA is that it does spell checking in my code. Stops me looking (so much) like an idiot when I misspell stuff in comments.

A Titled JavaFX Separator

In the process of updating some old programs, I had to change the GUI frameworks used. The old programs were written in Java using the Swing GUI framework and the JGoodies Forms and Looks libraries. Nowadays, the official GUI framework for Java is JavaFX. Making the transition from Swing to JavaFX was relatively painless because the programs were so small. However, one of the things I missed from the JGoodies Forms library was the “titled separator”, that is a separator with a label in front of it.