Animated Flag
This effect has been done ages ago, back in the days when nehe was still active! I remember seeing this effect for the first time in the 90s and knowing then already it was old. I came across the code...
View ArticleCoins Spinning
The code for this post originally started out as example on how to remove bias from a biased coin flip. The code was written to transform a coin that landed heads up 25% of the time to get a result...
View ArticlePark Miller distributions
I have posted previously about the Park Miller method for generating uniform random numbers. This post is about visualising the distribution and any modifications of the .random() function. The...
View ArticleBinary Sorted Array
Some versions of quick sort and some other sorting algorithms have their worst case when a list is mostly sorted. This post is about an array that keeps itself sorted. It makes use of a binary search...
View ArticleStreaming Histograph
Streaming Histograph is a term I came up with for a component I tried to recreate from controul.com. It is essentially a histogram that works with stream data. Stream data is a series of data where...
View ArticleStreaming descriptive statistics
I recently ran into the problem of getting sample statistics from potentially infinite population or very large sample sizes. The problem is that most algorithms scale linearly with this problem...
View ArticlePark Miller Random Number Generator (RNG)
I remember seeing a seeded random number generator at gskinner.com and thinking wow that has some cool functionality. I completely missed that it was a seeded random number generator. After a while I...
View ArticleMarsaglia Transform: Uniform to Standard Normal
The polar method (attributed to George Marsaglia, 1964) is a pseudo-random number sampling method for generating a pair of independent standard normal random variables. While it is superior to the...
View ArticleFNV 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 =...
View ArticleCommand-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...
View Article