Making “Slice” Pointfree

Let the Haskell function slice be defined as

slice :: Int -> Int -> [a] -> [a]
slice from len xs = take len (drop from xs)

It takes to integral values, marking the beginning and the length of a sub-list, which is sliced out of the third parameter (a list). Applied to strings, this function may be known as substring. Here are some examples, illustrating what it does:

Prelude> slice 2 3 [0..9]
[2,3,4]
Prelude> slice 2 10 [0..9]
[2,3,4,5,6,7,8,9]

The goal is, to make slice pointfree, i.e. write it as slice = ..., and thereby illustrate the systematic approach of doing so. Continue reading Making “Slice” Pointfree

Digital-Piano Dashboard

I have recently acquired a digital piano. Other than playing it, I have spent some time processing and visualizing its MIDI output data. What’s that? The digital piano has a USB port for data streaming (while somebody is playing). This data contains among other things information about what key is being pushed at a given time. The Digital-Piano Dashboard visualizes that information and renders a nice piano-key-push-history. Continue reading Digital-Piano Dashboard

Haskell BNF Parser

This is a brief update about a project I have been working on lately. It’s my first bigger Haskell project, and about parsing a Backus-Naur form (BNF) expression and returning it in JSON format. More formally, this can be seen as compilation between two languages, namely BNF and JSON. Continue reading Haskell BNF Parser

Corsairs3D

Corsairs3D is a riveting single player game that puts you into a pirate’s shoes. Your ship sails around an island, defended by brave guards, with the goal being, to collect as many coins as possible. But watch out: The defense tour’s cannons are pointing your way. If you do not change course quickly enough, your ship might sink. Continue reading Corsairs3D

Connecting PyCharm to a TensorFlow Docker Container

This guide walks you through setting up PyCharm Professional and Docker, with the goal of developing TensorFlow applications in PyCharm, while executing the code inside of an encapsulated container. After completing the following steps, you will be able to write Python code in PyCharm, and have the execution take place on a container, without any complication. Continue reading Connecting PyCharm to a TensorFlow Docker Container

LaTeX Plot Snippets

The LaTeX package tikz contains a set of commands that can render vector based graphs and plots. This post contains several examples which are intended to be used as a cut-and-paste boilerplate. Each sample comes with a screenshot and a snippet that contains the relevant parts of the LaTeX source code. The entire source code can be examined by clicking onto the individual images. Continue reading LaTeX Plot Snippets

MOV is Turing-Complete: 4-bit Adder Implementation

In late 2017, small groups of our class were given the task to delve into the assembly language and write a program for the 8051 microcontroller, as part of the Low-Level Programming lecture. This post documents the project MOV is Turing-Complete: 4-bit Adder Implementation — an assembly program that adds two 4-bit numbers relying solely on mov instructions. The appendix lists the minified version of the code. Continue reading MOV is Turing-Complete: 4-bit Adder Implementation

TeX Math to Image Conversion

This post functions as a quick development update on the Math to Image Conversion Bot (on Telegram), the TeX math to image conversion tool (at tools.timodenk.com), and the API that serves them both. The objective is to convert TeX math-code into images. Continue reading TeX Math to Image Conversion

ShiftRegister PWM Library

The ShiftRegister PWM Library enables usage of shift register pins as pulse-width modulated (PWM) pins. Instead of setting them to either high or low, the library lets the user set them to up to 256 PWM-levels. This post serves as a documentation page for the library and is to be extended over time. Continue reading ShiftRegister PWM Library

[Paper Recap] Multiple Hypotheses Prediction

The paper Learning in an Uncertain World: Representing Ambiguity Through Multiple Hypotheses was publish by Christian Rupprecht et al. in late 2016. The authors propose a training technique for machine learning models which makes them predict multiple distinct hypotheses. This is an advantage for many prediction tasks, in which uncertainty is part of the problem. In this article I am going to summarize the paper and name further thoughts. Continue reading [Paper Recap] Multiple Hypotheses Prediction