How to implement a Poset in Java

Inspired by this question in Stack Overflow, I decided to try my hand at implementing a Poset in Java. In order to understand how to do this, we need to define some concepts. Basic Poset terminology Poset definition A Poset is a set of elements with a binary relation defined between them (not necessarily between …

Do you really know how to use the modulo operator?

It may come as a surprise but not all integer divisions are the same. Perhaps because we are used to operate mostly with positive numbers, we don’t pay too much attention to what happens when the modulo operator is used with negative integers. If you calculate the integer division of 7/3 in your favourite programming …

Folding things with Functional Programming

Introduction In this post we will discuss the concept of fold in functional programming: fold functions are used to reduce a data structure containing multiple values into a single one. Associated to the idea of fold are the concepts of recursion: via recursion, fold traverses the different elements of the data structure. summarisation: the data …

Microservice boundaries

Although working with microservices delivers many benefits, experience has shown that there are also some problems associated with their use. It is important to be aware of these issues so that their impact can be minimised. One of these problems is getting right the boundaries of microservices. This has proved to be one of the …

Focus on your data structures with Scala lenses

With new programming techniques come new problems and new patterns to solve them. In functional programming, immutability is a must. As a consequence, whenever it is needed to modify the content of a data structure, a new instance with updated values is created. Depending on how complex the data structure is, creating a copy may …

How to use your own domain to access an AWS-hosted website

If you have had a domain name parked for a while and want to put it to a better use, this post explains my experience in doing so. Since my idea was to create a very simple website with static content, I decided to use an AWS S3 bucket. AWS documentation is good so I …

From Functional to Imperative programming

In The power of generic algorithms, we mentioned the need of taking into consideration the physical limitations of time and space when writing an algorithm. In this post, we will show how the anatomy of an algorithm varies as successive optimisations are added. This change is reflected, especially, in the shift from a functional to …