Tagged articles
7 articles
Page 1 of 1
Laravel Tech Community
Laravel Tech Community
Nov 23, 2022 · Backend Development

Understanding PHP mt_rand and Five Ways to Generate Random Numbers

This article explains how PHP's mt_rand function works, its deterministic nature when the seed and PHP version are identical, and demonstrates five distinct code techniques—including range‑shuffle, unique random loops, mt_rand with array filtering, array slicing, and microtime‑seeded shuffling—to produce pseudo‑random sequences.

Random Number Generationmt_randprogramming
0 likes · 4 min read
Understanding PHP mt_rand and Five Ways to Generate Random Numbers
FunTester
FunTester
Jul 12, 2022 · Backend Development

Why AtomicInteger Outperforms Random() in High‑Concurrency Random Number Generation

The article analyzes two common random‑number scenarios in software testing, identifies a CPU‑heavy custom random method, benchmarks ThreadLocalRandom, AtomicInteger, and plain int implementations under multi‑ and single‑thread loads, and proposes a lightweight AtomicInteger‑based selector that consistently delivers the best performance.

AtomicIntegerJavaPerformance Testing
0 likes · 7 min read
Why AtomicInteger Outperforms Random() in High‑Concurrency Random Number Generation
NetEase LeiHuo UX Big Data Technology
NetEase LeiHuo UX Big Data Technology
Feb 14, 2022 · Fundamentals

Understanding Random Number Generation and the Linear Congruential Method for Game Gacha Systems

This article explains how linear congruential generators produce pseudo‑random numbers, demonstrates their use with step‑by‑step examples, visualizes the distribution of generated values, and applies the method to design a simple gacha system while discussing its statistical properties and practical limitations.

Random Number Generationalgorithm fundamentalsgacha system
0 likes · 6 min read
Understanding Random Number Generation and the Linear Congruential Method for Game Gacha Systems
Kuaishou Large Model
Kuaishou Large Model
Oct 22, 2021 · Fundamentals

How Noise Powers Real‑Time Short‑Video Effects: Algorithms, Samples & GPU RNG Comparison

This article explains how various noise algorithms—value, gradient, simplex, cellular, and FBM—are applied to short‑video visual effects, showcases shader implementations and image examples, and compares GPU random‑number generators to help developers choose the right balance of performance and visual quality.

GPURandom Number GenerationShader
0 likes · 17 min read
How Noise Powers Real‑Time Short‑Video Effects: Algorithms, Samples & GPU RNG Comparison
macrozheng
macrozheng
Jun 25, 2021 · Fundamentals

Mastering Java Random Number Generation: Random, ThreadLocalRandom, SecureRandom & Math

This article reviews four Java random number generation techniques—Random, ThreadLocalRandom, SecureRandom, and Math.random()—detailing their usage, underlying algorithms, thread‑safety, performance trade‑offs, and appropriate scenarios, helping developers choose the right tool for their applications.

JavaMath.randomRandom Number Generation
0 likes · 15 min read
Mastering Java Random Number Generation: Random, ThreadLocalRandom, SecureRandom & Math
Programmer DD
Programmer DD
Dec 18, 2020 · Backend Development

Master Java Random Generators: Math.random, Random, ThreadLocalRandom & SecureRandom

This article explains how Java's random number utilities—Math.random, java.util.Random, ThreadLocalRandom, and SecureRandom—work, covering their algorithms, thread‑safety, usage examples, code snippets, and when to prefer cryptographically secure generators for security‑critical applications.

JavaMath.randomRandom Number Generation
0 likes · 10 min read
Master Java Random Generators: Math.random, Random, ThreadLocalRandom & SecureRandom
Hulu Beijing
Hulu Beijing
Dec 26, 2017 · Fundamentals

How to Sample a Gaussian Distribution: Methods, Algorithms, and Performance

This article explains why Gaussian (normal) distribution sampling is essential, describes the mathematical transformation from a standard normal, and compares several practical algorithms—including inverse transform, Box‑Muller, Marsaglia polar, rejection sampling, and Ziggurat—highlighting their implementation steps and efficiency considerations.

Box-MullerGaussianMarsaglia
0 likes · 8 min read
How to Sample a Gaussian Distribution: Methods, Algorithms, and Performance