Quantcast
Channel: Andrew van der Westhuizen
Browsing latest articles
Browse All 10 View Live

Image may be NSFW.
Clik here to view.

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 Article



Image may be NSFW.
Clik here to view.

Coins 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 Article

Image may be NSFW.
Clik here to view.

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 any modifications of the .random() function. The...

View Article

Image may be NSFW.
Clik here to view.

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 is about an array that keeps itself sorted. It makes use of a binary search...

View Article

Image may be NSFW.
Clik here to view.

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 histogram that works with stream data. Stream data is a series of data where...

View Article


Image may be NSFW.
Clik here to view.

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 that most algorithms scale linearly with this problem...

View Article

Image may be NSFW.
Clik here to view.

Park 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 Article

Image may be NSFW.
Clik here to view.

Marsaglia 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 Article


Image may be NSFW.
Clik here to view.

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 =...

View Article


Image may be NSFW.
Clik here to view.

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...

View Article
Browsing latest articles
Browse All 10 View Live




Latest Images