If you’ve used Twitter during the begining of 2022 you’ll almost certainly have seen people posting tweets like this:
Wordle 202 3/6 ⬜⬜⬜⬜🟨 🟨⬜⬜⬜⬜ 🟩🟩🟩🟩🟩
This is the result of playing the latest viral game “Wordle”. The concept is very easy, you have to guess a 5-letter word each day. For each guess you get the basic “Mastermind” reply, green for the correct character, yellow if it’s in the wrong spot.
This game was fun, for a couple of days, but my curious mind started to wonder… what are the BEST words to play?
So I downloaded a...
Today I stumbled across this excellent short video bij Mathologer:
This simple proof shows that 1/3 is the same as: 1/4 + 1/4^2 + 1/4^3 + 1/4^N…
As a programmer I wanted to try and program this.
Dividing by multiples of two (like 4^3) is extremely easy in binary, we just shift a number to the right. So if you have some integer X and we want to divide by 4, we do
X >> 2, if we want to divide by 4^2 we shift
X >> 4 etc.
AZsPCs: AP Math
Al Zimmermann hosts awesome Programming Contests every once in a while. They usually run for a long time (multiple months) and it allows mathematicians and programmers to compete in optimization problems. Usually the search space is very large and optimal solutions aren’t found for large N-values.
This time the contest was called “AP Math” and the goal was:
Given a hexagonal grid of size N, select the maximum amount of cells so no three cells form an arithmetic progression.
During this contest I didn’t find the right way to attack the problem, but I did discover a clever way to store all the hex coordinates in a singe integer value and do the math on that; which I wanted to share here.
Bert Jan Schrijver and I did a livestream showcasing Log4Shell and talking about the vulnerability, check it out here:
What is Log4Shell?
Last couple of days (and nights) I’ve been studying the new (extremely dangerous) vulnerability in log4j2 called Log4Shell.
All versions of log4j-core from 2.0-beta9 to 2.14.1 are affected by this, and it’s a big one.
This morning I woke up and saw the following Tweet:
I'm a bit pissed right now! 😡 Why is the world so mean to me, to all of us developers, really? We've been so friendly! How often have we written "Hello, world"? And has anybody ever gotten as much as friendly nod in return?— Nicolai Parlog (@nipafx) May 14, 2020
And yes, I agree.
The world has been a pretty shitty friend to us in 2020. Why should all the new programmers/developers have to welcome this messed up world with open arms?
I say: Screw You, World.
What is OpenAI?
OpenAI is an AI research organization founded by Elon Musk in January 2016 to explore, develop, and deploy technology for the benefit of humanity. It’s headquartered in San Francisco, with headquarters in Mountain View, California.
OpenAI recently unveiled a language model called GPT-2 that, given some input text, predicts the coming sentences. GPT-2 also supports the idea of the “Grammar of Reasoning” (GRR), in which the model attempts to extract sentences that would make the most intuitive sense, in terms of human understanding. For example, if you input “the dog ate the cat” and the model predicts “dogs eat cats”, the GRR system would make that sentence as the most probable result. The problem is that even though GRR is very good at answering the question, its predictions are still highly contingent. For example, it is still possible to be a cat-eating dog, and then someone else who doesn’t eat cats can still eat your dog, but the GRR system would not make such a mistake for the second sentence.
Last week, during a code camp session at work, for some reason the subject of “joggling” came up.
What is Joggling?
This might sound very strange, but it is an actual sport. There are people joggling marathons (in under three hours!), they are faster while juggling 3 balls than most people (including me) are just running. I’m probably never running a marathon under three hours.
The world is changing, more and more people are openly against racism, against gender discrimination, very much pro equality. People and companies are being called out when they do discriminate and there is a big movement against bias (in general).
One problematic thing though, for me as a programmer, is the backlash against ‘biased algorithms’.
What are algorithms?
If you look up the definition wikipedia you’ll find:
A sequence of instructions, typically to solve a class of problems or perform a computation. Algorithms are unambiguous specifications for performing calculation, data processing, automated reasoning, and other tasks.
In our case today, let’s define it is a set of instructions that a computer follows so it does a calculation and produces a result. People also do the same thing, they use sets of rules to come to certain conclusions.
This is the second blogpost in a series about SAT solving. Today we’re going to build a simple solver in
Before continuing, if you don’t know what a SAT solver is, read [part one].
The algorithm we’re going to implement is called DPLL (Davis Putnam Logemann Loveland).
The input we’ll accept is in
DIMACS format. For now we can just skip the
p-line with all the settings and just parse all the numbers.
Here is an example input:
In Java we can parse this entire file with almost a one liner (don’t do this in production code):
Most software developers have never heard about SAT solvers, but they are amazingly powerful and the algorithms behind them are actually very easy to understand. The whole concept blew my mind when I learned about how they worked. This will be the first post in a series about SAT solving where we’ll end up building a simple solver in Java later on.
In this first part of the series we’ll cover:
- Look at what SAT is
- Explain the SAT DIMACS format
- Solve a puzzle: Peaceable Queens
The first day was about clean code and the second day was about architecture.
The main attraction of this conference: Robert C. Martin, also known as Uncle Bob. He is one of the founders of the Agile manifesto and wrote numerous very good books on topics like ‘Clean Code’ and ‘Clean Architecture’. He’s also the main advocate for the SOLID design principles.
This presentation of mine… turned out to be my worst...
In the previous post I showed a nice snippet/trick at the bottom of the post to find all the neighbors in a 2D array.
Last week I used this snippet to solve a word search puzzle a colleague created for us as a “Back to work in 2019”-challenge:
(Note: Some fellow developer colleagues think that solving the puzzle with code is unfair… heh. really?!)
Reading the lexicon
Here is the complete code:
First we’ll need to read in all the possible words we’re looking for. And using the new Java streams...
Pathfinding for Tower Defense
Last week though I was reading this tutorial, Pathfinding for Tower Defense.
He explains a method for creating a single vector/flow field for game AI’s to follow. This allows a single calculation to...
First of all, best wishes for 2019 from me.
Time for me to reflect on the last couple of months.
Last year has been a crazy busy year for me. I’ve been to and spoken at to J-Spring, J-Fall, Devoxx Belgium, Devoxx Poland and JavaOne… errr… Oracle CodeOne on various topics. From quantum computing to software architecture.
Here is a list of all my conference talks.
I’m a big fan of sharing knowledge and getting people together to have fun. This is why I’ve decided to create...
We looked at GraalVM and what it can do. We dove into the
native-image command and transformed a simple HelloWorld application into a native application (running in Docker).
This time I want to go beyond “Hello World” and build something useful (despite all the limitations listed below). A CRUD microservice with REST API and database access.
TLDR; If you’re just intersted in the end result, go right to the results
So what are some of the limitations that GraalVM currently has?...