• Old CRT Monitor Effect

    Does anyone remember the first CRT monitors? Those monochrome ones that had the ugly refresh line, scanlines, etc. This is an attempt to recreate that feel. I got the idea from tutsplus.com. Actually I used the method there almost exactly and changed the image. This effect makes use of RGB …

    Old CRT Monitor Effect
  • Monte Carlo, Gemini Rue Solver

    This is a solver for a puzzle found in a game called Gemini Rue. This particular puzzle is found later in the game and can be frustrating, especially the second time you run into it. This particular toy recreates the puzzle for you to play, however it started as a …

    Gemini Rue Monte Carlo Solver
  • Procedural colors

    How often are you going to sites like colorschemedesigner.com to generate a colour palette for your design? This article on devmag.org.za had algorithms to generate procedural colours. Whilst I was porting the C# code, a commonality was found. All the algorithms relied on altering one of the dimensions of a …

    Procedural.Color-Screen
  • Sum to Fifteen (All About Perspective)

    I got the idea for this game from a lecture I was watching, given by Scott E. Page. He gave the online course Model Thinking over at Coursera. He is a lecturer in Complex Systems at the University of Michigan.  He presents the idea of how perspectives have such a large influence …

    sum-to-fifteen

Command-line progress bar

[================> ] 33% I frequently need a progress bar for applications, in order to visualize what is going on in the application. Below is a Java implementation of one. private static int lastPercent; public static void updatePercentageBar(float progress) { int percent = (int) Math.round(progress * 100); if (Math.abs(percent – lastPercent) …

FNV Hash in Java

The need for this function cropped up again. This time I in Java. Below is an implementation for 64bit as well as 32bit. public final class FNVHash { private static final long FNV_64_INIT = 0xcbf29ce484222325L; private static final long FNV_64_PRIME = 0x100000001b3L; private static final int FNV_32_INIT = 0x811c9dc5; private …

Streaming descriptive statistics

I recently ran into the problem of getting sample statistics from potentially infinite population or very large sample sizes. The problem is …

Marsaglia transform

Streaming Histograph

Streaming Histograph is a term I came up with for a component I tried to recreate from controul.com. It is essentially a …

Binary Sorted Array

Some versions of quick sort and some other sorting algorithms have their worst case when a list is mostly sorted. This post …

Marsaglia transform

Park Miller distributions

I have posted previously about the Park Miller method for generating uniform random numbers. This post is about visualising the distribution and …

Coins Spinning

Coins Spinning

The code for this post originally started out as example on how to remove bias from a biased coin flip. The code …

Animated Flag

Animated Flag

This effect has been done ages ago, back in the days when nehe was still active! I remember seeing this effect for …