Category Archives: Uncategorised

Linear programming with Python

A linear programming problem may be defined as the problem of maximizing or minimizing a linear function subject to linear constraints. The constraints may be equalities or inequalities. Here is a simple example: find numbers x1 and x2 that maximize the sum x1 + x2 subject to the constraints x1 ≥ 0, x2 ≥ 0,… Read More »

AWS Latency Index

In modern web applications, it is of paramount importance to deal with latency correctly.   Within an application, latency reveals itself at many different levels and with very different values. Computer latency at a human level is a good reference to understand the different timescales. It is clear that  the dominant term, by large, is the… Read More »

From Functional to Imperative programming

In http://blog.bytecode.tech/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 an imperative style. As we… Read More »

Statistics for Machine Learning

One of the first things that one encounters when studying Machine Learning is a barrage of terms like: inferential statistics, statistical test, statistical hypothesis, null hypothesis, alternative hypothesis, p-value, probability distribution… and the list goes on and on. This may prove discouraging for those who are not familiar with Statistics. The present post aims to… Read More »

The power of generic algorithms

In computer science, there is this tension between creating generic algorithms applicable to different situations and optimising an algorithm to solve a specific problem. Generic algorithms make it possible to find similarities between problems that, at first glance, may seem completely unrelated. This is especially interesting when those problems belong to different domains. When this… Read More »

Traps for numbers

This post is a playful combination of maths and computing to design “traps for numbers”. Here is the accompanying code to this post along with its tests. Collatz sequence Many classical problems in maths can be given a new twist with the help of computers, resulting in surprising results. One of these problems is the… Read More »

Java phasers made simple

I recently came across Java phasers while reviewing different constructs for inter-thread communication. Phasers are associated to the concepts of fuzzy barriers and point to point synchronisation which are all well explained on this parallel programming course. As to this post, I will borrow the example of the one-dimensional stencil to explain very intuitively the motivation behind the concept of… Read More »

Inversion of Control vs Dependency Injection

Background Lately, I have been interviewing candidates for a Developer role and realised how much confusion there is, still, around the concepts of Inversion of Control and Dependency Injection. The majority of people use both terms interchangeably. Probably, the confusion derives from the heavy use of those concepts on Spring, where Inversion of Control is used to enable Dependency Injection.… Read More »