# Flash, actionscript, flex & AIR

## 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 Box–Muller transform, the Ziggurat algorithm is even more efficient. – Wikipedia This post by Hristo Dachev on the Marsaglia transform …

## 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 noticed polygonal had implemented a Park Miller Carta psuedo random number generator (PRNG). I remember wondering what …

## 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 domain. Especially when looking at quartiles. I am going to detail below firstly how I was doing things and secondly …

## 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 there is no known end or where the population size is potentially infinite. The …

## 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 to determine the place to insert a new element. Let it be noted …

## 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 histographer is used to visualise the distribution and estimate the descriptive statistics. The default ParkMiller.random() uniform distribution is shown first. Thereafter …

## 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 landing heads up 50% of the time. However, as the …

## 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 by andre-michelle implementing this effect in actionscript and decided to …

## Fairy Dust Particle Effect

Here is another particle system which makes for some pretty graphics. The premise for this demo is a particle that chases something and fires hollow circles in the general direction of movement. I decided to hook three of these particles up to chase each other, with the lead particle chasing …