RSSAmplifier

Blog

Simon Zelazny's Blog

pzel.nameRSS feed ↗10 posts

Latest posts

Scrolling read-only buffers with Spacebar in Emacs

A small usability improvement If you are used to scrolling reading material with your spacebar and you dislike Emacs’ unhelpful default (showing Buffer is read-only: #<buffer blah.txt> in the minibuffer) when trying to do so in a read-only buffer, I have a simple solution: Create a function that maps <SPC> to #'scroll-up-command when the current buffer is read-only: (defun set-read-only-spacebar…

Built-in Japanese Dictionary App on iPhone

Reviving Dictionary.app on your iPhone (kind of) Desktop Macs come with a superbly useful application called Dictionary.app , which is slowly getting shuffled out of sight in favor of ‘integrated’ search in Spotlight. I think this is a shame, since the quality of the dictionaries that come for free with Mac OS is simply outstanding. I first got a Mac in Japan in 2005, while studying in Tokyo, and…

My recreational programming in 2024: Mostly Standard ML

The year in review To the extent that lack of free time permits, I try to do some recreational programming on the side, unrelated to my dayjob or any money-making concerns. I find it helps me retain some love for the subject matter, and keeps me sharp. In the past year, I’ve gotten into Standard ML programming, using the excellent PolyML compiler, and got a bunch of tiny projects done. The…

Mechwarrior 2 on Dosbox: Fixing the “Press any key to exit“ problem

If you’re trying to play Mechwarrior 2 for Dos under dosbox and find that the game hangs after a mission ends, displaying the message “Press any key to exit” on top of the screen, this is the solution: Grab dosbox-x , compile it, and enjoy your Mechwarrior 2.

Working grayscale color filter on linux (Xwindows)

Picom compositor to the resuce I’m a big fan of grayscale color filters on computer screens. I have them on on my iPhone and on my work laptop (Mac OS). However, I’ve never managed to turn my linux desktop black-and-white, in spite of periodic attempts every couple of months. To be precise, no xorg.conf setting worked reasonably for me. If I changed the Depth or DefaultDepth setting in my Screen…

Unicode string literals in PolyML

A small hack with a large ergonomic payoff As I wrote previously, I’ve put away the SML# and got back to recreational programming in plain old Standard ML. I really love the spartan feeling of the language and the fact that it doesn’t allow for too much fanciness (module-level magic aside), while still enabling a nice, high-level functional-programming experience. One “spartan” aspect of Standard…

Wrapping up `Practical SML#'

Review of chapters 9-11 & overall thoughts For Context: All the previous posts in this series Chapter 1: Setting Up an SML# Environment Chapter 2: The Essense of ML Programming Chapter 3: List Processing Chapter 4: Defining and Using Datatypes Chapter 5: Modules and Partial Compilation Chapter 6: Techniques of Designing and Developing ML-style Systems Chapter 7: Interoperability with the C…

Working Review of "Practical ML Programming with SML#" (Ohori, Ueno), CHAPTER 8

Accessing External Data Before the year ends, let’s take a look at Chapter 8, titled “Accessing External Data”. This chapter teaches us how to read and interpret files on disk, as well as how to parse JSON data . Additionally, we are introduced to ML-style error handling, via explicit handle expressions and pattern-matching on exn constructors. File I/O This section gives us a very quick run-down…

Python defaultdict as sparse array: use with caution

TLDR: When using defaultdict s to represent sparse data with large cardinalities, remember that reading values with [] is side-effecting and increases the size of the dictionary. Use .get() for reads, and reserve [] for insertions, increments, and updates. Python’s collections package has some nice convenient datastructures that you might be familiar with, such as namedtuple or deque . There is…

NuScratch: Getting around the 'Unknown class: SmallFloat64' error

Polish schoolchildren learn the basics of coding in the MIT Scratch creative programming environment. I was very happy when my oldest daughter really got into programming and asked me if we can “have Scratch at home”. But we do have Scratch at home, I told her. Scratch at home (when trying to save a project): Jokes aside, I was quite frustrated because NuScratch, the continuation of the original…