Parsing Operators in Rust

The Advent of Code is just around the corner. This is an advent calendar of programming tasks, the solution of which can serve as a pastime for the fun of joy. After successfully processing a task, you receive a virtual golden star. My first participation was in 2020. At the time, I thought I’d try to do this directly in the Rust programming language, which I hadn’t used before. By the way, this article is not only intended to shed light on an interesting Advent of Code task, but also to highlight the flexibility of my Rust library Exmex, which is discussed below as part of the solution.

Continue reading “Parsing Operators in Rust”

Sequences of partial reductions in Elm

In my previous article I derived the calculation for passive income from invested assets and demonstrated a small calculator. It struck me that there was a slight delay in the case of high annual numbers. The cause of the delay lies in my implementation of the formula $$ \sum_{k = 1}^{m-1} \frac {1} {\prod_ {t = 1} ^ {k} w_t}. $$

Continue reading “Sequences of partial reductions in Elm”

Passive income from stock market investments

How can you generate passive income from return on stock market investments or dividends1Dividends are of course also a kind of investment income. I just wanted to mention them again because they play a special role in this article. and when does that make sense? In addition to explanations and anecdotes, I also present mathematical formulas to answer this question­čą│2That’s a smiley celebrating the existence of math in this article..

Before I continue to write about a financial topic, I would like to point out that I am not a financial expert at all. I am only a private person who is interested in their own retirement provision and other financial topics, therefore amassing solid half-knowledge. Especially, the tax related stuff represents my understanding of the situation in Germany.

Continue reading “Passive income from stock market investments”

First imperative views on dynamic web apps in Elm

Some time ago I was able to listen to the episode We’re Teaching Functional Programming Wrong of the podcast Corecursive. Richard Feldman tells of a purely functional language with which you can actually create dynamic web pages. It is not even necessary to understand what a Monad is. Since I consider object-oriented programming to be overrated1The talk Free your Functions by Klaus Iglberger highlights some practical aspects my point of view., I had a closer look at this approach. In this post I will report on my first steps, hurdles and progress in Elm and focus on aspects that were unfamiliar to me having an imperative background.

Continue reading “First imperative views on dynamic web apps in Elm”

Modular Image Processing Algorithms Revisited – Functional Style

In the blog post from August 2014 we compared the modularization of image processing algorithms with template based policies against the dynamic polymophism based stragety pattern in terms of speed. We will compare the run-time of (almost) the same pixel-wise operations on images again. But this time, we consider different functional modularization techniques. More precisely, we will pass function pointers, lambdas, and derived functors to algorithms with corresponding argument types such as a templated one and std::function among others.

Continue reading “Modular Image Processing Algorithms Revisited – Functional Style”

Strategy vs. Policy for Image Processing Algorithms

I was wondering for quite a while how much speed-up one can roughly expect by a policy1Modern C++ Design, A. Alexandrescu, 2001 based design of algorithms in C++ using templates compared to the strategy2Design Patterns, E. Gamma, R. Helm, R. Johnson, and J. Vlissides, 1995 pattern using polymorphism. Thereby, I am especially interested in algorithms for image processing.

Continue reading “Strategy vs. Policy for Image Processing Algorithms”