Someone installed a Scheme development environment on their phone

Ben Simon has a post up on his blog describing how he set up a scheme development environment on his Galaxy S9 Android phone. It was also an especially timely post as I had been eyeing a Mac Quadra with a Symbolics Lisp Machine extension card on eBay. As if we needed another reminder just how powerful current phones have become!

And no, I didn’t put a bid on that Quadra – not quite feeling this flush at the moment!

Ben also mentioned that he installed vim, git and Emacs as part of the development environment. That alone is worth a blog post, and I think he has one on that topic, too. The screenshots show Emacs in a Scheme mode, how cool is that?

I’m very tempted to trying something like this on my Essential PH-1. I just need to get some sort of Bluetooth keyboard for it first.

The Art of Prolog, 2nd edition

The Art of Prolog – reading another classic programming text

I did have to learn some Prolog when I was studying CS and back then it was one of those “why do we have to learn this when everybody is programming in C or Turbo Pascal” (yes, I’m old). For some strange reason things clicked for me quicker with Prolog than Lisp, which I now find quite ironic given that I’ve been using Emacs for since the early 1990s.

Anyway, a recent post over on Hacker News alerted me to a book called “The Art of Prolog”. From what I can tell it’s out of print but it’s not a book that is very hard to find.

So that’ll be the reading material sorted for the next week or three.

The Art of Prolog, 2nd edition
The Art of Prolog, 2nd edition

Talk – Getting started with geospatial data in MongoDB (MDBW 2017)

I’ve been meaning to post this link for quite a while now but keep forgetting to do so. If you are planning to store geospatial data in MongoDB, the database offers you a variety of ways to deal with geospatial-specific data storage and queries.

I gave an introductory talk on this subject at MongoDB World 2017 and you can find a recording of the talk here.

Disclaimer: I work for MongoDB as a Consulting Engineer and this is my personal blog. Any opinions expressed herein are entirely my own and do not reflect opinions of my employers, past present or future.

Emacs 26.1 has been released (and it’s already on Homebrew)

Saw the announcement on on the GNU Emacs mailing list this morning. Much to my surprise, it’s also already available on homebrew. So my Mac is now sporting a new fetching version of Emacs as well :). I’ve been running the release candidate on several Linux machines already and was very happy with it, so upgrading my OS X install was pretty much a no brainer.

Here we go:

Screenshot of Emacs 26.1 running on OS X
Emacs 26.1 on OS X, installed via homebrew

Another way to use Emacs to convert DOS/Unix line endings

I’ve previously blogged about using Emacs to convert line endings and use it as an alternative to the dos2unix/unix2dos tools. Using set-buffer-file-coding-system works well and has been my go-to conversion method.

That said, there is another way to do the same conversion by using M-x recode-region. As the name implies, recode-region works on a region. As a result, it offers better control over where the line ending conversion is applied. This is extremely useful if you’re dealing with a file with mixed line endings.

Mixed line endings due to version control misconfiguration are actually the main reason for me having to use these type of tools in the first place…

Emacs 26.1-RC1 on the Windows Subsystem for Linux

As posted in a few places, Emacs 26.1-RC1 has been released. Following up my previous experiments with running Emacs on the Windows Subsystem for Linux, I naturally had to see how the latest version would work out. For that, I built the RC1 on an up-to-date Ubuntu WSL. I actually built it twice – once with the GTK+ toolkit, once with the Lucid toolkit. More on that later.

The good news is that the text mode version works right out of the box, the same way it worked the last time. I only gave it a quick spin, but so far it looks like it Just Works.

Read More

Can you get a deadlock with a single lock and an IO operation?

Quite a while ago, I answered a question about the basic deadlock scenario on Stack Overflow. More recently, I got an interesting comment on it. The poster asked if it was possible to get a deadlock with a single lock and an I/O operation. My first gut reaction was “no, not really”, but it got me thinking. So let’s try to unroll the scenario and see if we can reason at least about my gut feeling.

Read More

Using tuned.conf to disable mongod startup warnings on RHEL/CentOS 7

RHEL 7 – and CentOS 7, which I used for this test – use tuned.conf to set a lot of system settings. Several of the tuned settings affect MongoDB’s performance; some are important enough that mongod actually triggers startup warnings. The main setting is transparent huge pages, which is a setting that does not work very well with databases in general.

The MongoDB documentation already describes how to disable Transparent Huge Pages (aka THP) using tuned.conf, but there are several other settings that mongod tends to warn users about if you run it on an out-of-the-box CentOS 7.

Read More

Digg Reader shuts down, and thoughts on organising my blog reading

Farewell, Digg Reader

Unfortunately,  Digg announced that Digg Reader is shutting down tomorrow. While I never used Digg Reader as my main RSS feed reader – I’ve got a paid subscription to Feedly – I was very happy to use it as a backup reader for those feeds that weren’t always that great at adhering to the RSS feed standard (I’m looking at you, bringatrailer.com) as it was more forgiving when it parsed feeds. Unfortunately it appears to be another one of the “feed readers are dying” incidents that seems to have started when Google Reader was shut down. There weren’t really that many alternatives in the first place unless one wanted to self host.

Read More

How to enable logging in the MongoDB Java driver

I will show you how to enable logging in the MongoDB Java driver and also how to set and change the log level. The official mongoDB Java driver uses java.util.logging as its default logging framework or sl4j if the latter is present. It can be very useful to enable logging in the MongoDB drivers to trace how the driver is interacting with the database.

Read More