Daniel Keast

Stuff about programming

Spectrum Machine Language for the Absolute Beginner - William Tang

A lovely book, easy to read and clear. There are some typos in the code examples but that was literally always the case back then. It was a part of how you learnt I think, forced you into figuring it out.

Introducing Erlang

Pretty short but clear book on Erlang. The first half consists of things I’m familiar with already (immutability, pattern matching, recursion, higher order functions). It was the last half that I was more interested in, process oriented programming and OTP. I’ll have to read a more in depth book to understand it thoroughly, but it’s a very interesting approach.

Python HTTP Server

Python has an http server in it’s standard library, and if you invoke the module directly from the command line it conveniently serves the local directory:

Delete a remote git branch

I can never remember the command to delete remote git branches, ending up on the page in the git book. Maybe writing it down here will help:

My current tmux config

My configuration file for tmux has changed a lot over the years. I ended up with all sorts of custom settings after reading tmux by Brian P. Hogan, and the Arch Wiki page. Both are great resources, but I ended up with a config file that I didn’t fully understand or use. I’ve since trimmed it down to only the parts I use regularly. This should also make upgrades easier, since tmux has a habit of breaking config file compatibility between versions.

Makefile for Markdown

I have a little git repository for keeping recipes. They’re all Markdown files, and I use pandoc to convert them into pdfs. I’ve created a Makefile for doing the conversion:

Game loop frame timer

I love video games, and partly started programming in the first place to learn how they work. Recently I’ve been learning OpenGL in an effort to try and build a simple game engine.

Real World Haskell 4

These are the first exercises of chapter 4.

Real World Haskell 3

Finally got it I think. This was bloody tricky.

Real World Haskell 2

There are several more questions in this book at the end of the chapter.

Real World Haskell

Real World Haskell chapter 3 is about recursive data types, and includes an example of creating a list-like data structure.

Short circuiting is lazy

I’m used to the concept of short circuiting operators. For example, in this Python code “evaluated” is never printed as it is clear before then that the entire if branch must resolve to True.

Python array columns

I wanted to access the columns in a 2D array in Python today. I found that it’s surprisingly simple to do. This is what I ended up with:

Rust's ownership system

Rust is a systems programming language. It aims for there to be as little as possible between your code and the hardware running it. The reason for this is to give you full control of what the CPU is doing, and how your data structures are laid out in memory.

SQLite in Python

Python contains a SQLite client in it’s standard library. This is really useful for prototyping, and great for when a script grows into needing a little more data integrity. It’s really quite unexpected to be able to use something like this without any dependencies.