blog.x-e.ro / random: page 2 of 38

another as3 range seeded randomizer

as3 :: random number in flash

just another take on a classic piece of code. the pseudo-random number generator. this one is almost the same, just a slightly diffrent algorithm.

private function randomizer(low:Number, high:Number):Number {
	var num:Number = high-low;
	return (Math.random()*num)+low;
}

then use it...

var x:Number = randomizer(5, 50);

i <3 randomization

Read: another as3 range seeded randomizer »

the lorenz attractor

demos :: with papervision3D

papervision3D lorenz attractor

we were discussing recursive algorithms and chaos theory at work yesterday. when one of the chemistry professors brought up the lorenz attractor. he was trying to draw one on the white board for about 10 minutes until i decided it would be easier to draw in flash, lol!

after a quick conversation w/ andy zupko about the new Line3D object, and my new CanvasView3D component for papervision, i made a sweet lorenz attractor! 

the algorithm is super simple:

x1 = x0 + h * a * (y0 - x0);
y1 = y0 + h * (x0 * (b - z0) - y0);
z1 = z0 + h * (x0 * y0 - c * z0); 

Read: the lorenz attractor »

asp.net random number generator

c-sharp :: the central randomizer

here is my asp.net randomizer class based on the c R250/512 shift-register sequence random number generator, by kirkpatrick and stoll and published (j. computational physics, vol 40, pp. 517-526) with an added a pseudo-random class redefinition and buffer overflow protection.

example usage:

randomizer x = new randomizer();
int num = x.random();

Read: asp.net random number generator »

graphic reset buttons

html-css :: w/o javascript

i was having some trouble at work creating form buttons with graphics for reset buttons. i just thought someone might be interested in my non-javascript solution:

<button style="background: none; border: none;">
<img src="reset.jpg" alt="" />
</button>

Read: graphic reset buttons »

loading...

loading...