Tagged articles
random
43 articles · Page 1 of 1

liandkMay 12, 2026 · Fundamentals
This tutorial reviews three import patterns, demonstrates essential functions of the math, random, and datetime built‑in modules with concrete code examples, combines them in a practical exercise, highlights four common beginner pitfalls with fixes, and provides short post‑lesson tasks.
DATETIMEMathPython
0 likes · 8 min read

This article explains why the built‑in Math.random() function yields predictable pseudo‑random numbers, describes its limitations, and shows how to use the browser’s crypto.getRandomValues() API to generate cryptographically secure random values with practical code examples.
JavaScriptcryptofrontend
0 likes · 6 min read

This article explains how to use Python's built‑in random module—specifically randint() and randrange()—to generate random four‑digit numbers, and also demonstrates alternative approaches using string.digits, choice(), and join(), complete with code snippets and sample outputs.
Stringcoderandint
0 likes · 6 min read

This article presents a collection of Java techniques—including Random, SecureRandom with Base64, ThreadLocalRandom, Collections.shuffle, third‑party libraries like Apache Commons and Guava, custom character sets, template‑based generation, and regex validation—to create secure random passwords with configurable length and complexity.
Base64GuavaJava
0 likes · 15 min read

This tutorial demonstrates how to use Python's Random module to generate customizable, secure passwords by selecting character types, specifying length, and shuffling the result, complete with full source code and step-by-step explanations.
PythonTutorialpassword-generator
0 likes · 7 min read

This guide explains how to install the PHP Sodium extension, perform basic encryption and decryption, generate cryptographically secure random data, and implement AES‑256‑GCM encryption with both Sodium and OpenSSL, including a discussion of the AAD parameter.
AES-256-GCMPHPSodium
0 likes · 11 min read

This tutorial explains how to use Python's random module—including randint, randrange, and alternative methods with string.digits and choice—to generate random four‑digit numbers, complete with code examples and sample outputs.
Code Examplerandintrandom
0 likes · 5 min read

This article explains PHP's array_rand() function, its syntax and parameters, and provides three practical examples showing how to randomly pick one or multiple values from indexed and associative arrays, complete with code snippets and expected output.
PHParray_randarrays
0 likes · 5 min read

This article explains how to use Python to randomly generate a six‑character verification code by building a list of ASCII characters, sampling six items, and concatenating them into a string, providing a simple method to enhance account security.
Verification Coderandom
0 likes · 3 min read

The article explains that Java’s Random class uses a predictable linear‑congruential generator, making its output vulnerable to seed‑guessing attacks, and demonstrates how SecureRandom with strategies like SHA1PRNG, NativePRNGBlocking, and NativePRNGNonBlocking provides stronger, non‑predictable randomness suitable for security‑critical applications.
JavaSecureRandomcryptography
0 likes · 12 min read

This article explains how to use Python’s built‑in random module and NumPy’s random submodule to generate various types of pseudorandom numbers, covering functions such as random(), randint(), randrange(), uniform(), choice(), shuffle(), sample() and their NumPy equivalents with code examples and seed control.
NumPyPythonTutorial
0 likes · 7 min read

This article presents a collection of common Python interview questions covering memory management mechanisms, lambda functions, tuple/list conversion, duplicate removal techniques, sorting tricks, object copying methods, exception handling, the pass statement, range usage, regex operations, match vs search differences, and random number generation, each accompanied by clear explanations and code examples.
Listexception-handlingmemory-management
0 likes · 10 min read

This article explains how to perform precise numeric operations, format numbers, convert between bases, handle complex numbers, work with infinities and NaN, use fractions, manipulate large arrays with NumPy, generate random data, and manage dates, times, and time zones in Python.
DATETIMEDecimalNumPy
0 likes · 24 min read

This article explains how seeding Java's Random with specific integer values generates deterministic character sequences that spell "hello world", walks through the underlying ASCII conversion, shows code examples, and discusses related Java source quirks and seed‑search techniques.
JavaSEEDThreadLocalRandom
0 likes · 10 min read

This article explains how using fixed seeds with Java's Random class generates deterministic pseudo‑random strings that can be crafted to output "hello world", demonstrates the underlying seed mechanics, shows how to reverse‑engineer seeds for arbitrary phrases, and discusses related quirks in the Java source code.
JavaSEEDcode analysis
0 likes · 11 min read

Under Jason Donenfeld’s leadership, Linux kernel’s random number generator was overhauled in versions 5.17 and 5.18, replacing SHA1 with BLAKE2s and shifting from per‑NUMA to per‑CPU structures, delivering up to a 131% speed increase and an astonishing 8450% boost in getrandom() performance on multi‑core systems.
BLAKE2sLinuxkernel
0 likes · 3 min read

This article walks through building a classic number‑guessing game in Python, explains two community‑sourced solutions with full source code, highlights common pitfalls, and shows how to enhance interactivity by narrowing the guessing range.
Code ExamplePythonconsole
0 likes · 6 min read

This article walks through creating a Python program that simulates the popular Chinese card game ZhaJinHua, covering deck construction, random dealing to five players, hand‑type evaluation, scoring, and ranking, with complete source code and a concise explanation of each step.
AlgorithmListPython
0 likes · 12 min read

This article explains how ThreadLocalRandom in JDK7 improves multithreaded random number generation, compares it with Random and Math.random(), analyzes the underlying linear congruential algorithm, and provides practical code examples for high‑performance Java applications.
ConcurrencyJavaThreadLocalRandom
0 likes · 9 min read

This tutorial demonstrates how to use Python's turtle module to randomly generate and draw a starry sky, explaining the core logic of random positions, sizes, and angles for each star and providing complete code to render the night sky effect.
Graphicsrandomstarfield
0 likes · 3 min read

This article walks through a Python exercise that creates random student names, IDs, and scores, then saves the data into both TXT and CSV files using the random module, lists, dictionaries, and file I/O, complete with full code examples and output screenshots.
CSVData GenerationPython
0 likes · 8 min read

This article presents three Python approaches for generating random strings, including single captcha-like codes, password lists, and batch generation functions, demonstrating the use of the random and string modules to create alphanumeric sequences.
CAPTCHAfundamentalspassword generation
0 likes · 2 min read

This article introduces Python function fundamentals, shows how to define and call functions, demonstrates common time‑related functions from the time and datetime modules, and provides examples of calendar and random number utilities, all illustrated with clear code snippets and output screenshots.
DATETIMETutorialfunctions
0 likes · 6 min read

This article explores the performance drawbacks of java.util.Random in high‑concurrency scenarios, explains how ThreadLocalRandom leverages Unsafe for per‑thread seeds, examines native getLong/putLong operations, and discusses memory layout nuances such as compressed oops and potential pitfalls.
ConcurrencyJavaThreadLocalRandom
0 likes · 10 min read

This article examines Java's Random performance issues in high‑concurrency environments, explains how ThreadLocalRandom leverages sun.misc.Unsafe for lock‑free per‑thread seeds, and explores the associated memory layout, safety concerns, and practical code examples.
ThreadLocalRandomUnsaferandom
0 likes · 10 min read

This article introduces Python functions, demonstrates how to define and call them, and explores essential time-related modules such as time, datetime, calendar, and random, providing clear code examples and output screenshots to help beginners grasp practical usage.
DATETIMEPythonfunctions
0 likes · 6 min read

This article explains PHP's srand() function, detailing its purpose of seeding the random number generator, optional seed parameter, lack of return value, and provides a complete example showing how to generate a seed from microtime and produce random numbers.
PHPSEEDrandom
0 likes · 1 min read

The PHP rand() function returns a pseudo‑random integer within a given range, defaulting to 0 through getrandmax() when no parameters are supplied, and includes details on its parameters, return value, and usage examples.
BackendFunctionPHP
0 likes · 2 min read

The article explains PHP's getrandmax() function, which returns the maximum integer that rand() can generate, provides a usage example with code, and shows the typical output value of 2147483647, helping developers understand random number limits in backend applications.
BackendPHPgetrandmax
0 likes · 1 min read

This article explains the PHP shuffle() function, describing its purpose of randomly reordering array elements, the required array parameter, the boolean return value, and provides a complete example with sample output to illustrate its usage.
BackendPHPShuffle
0 likes · 2 min read

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.randomSecureRandom
0 likes · 10 min read

This article provides a comprehensive overview of Java's Random class, describing its constructor, implemented interfaces, direct subclasses, and detailed explanations of all public methods—including setSeed, next, nextBytes, nextInt, nextLong, nextBoolean, nextFloat, nextDouble, and nextGaussian—along with the underlying linear‑congruential algorithm and code examples.
AlgorithmsCore LibraryJava
0 likes · 12 min read


ITPUBJul 31, 2020 · Backend Development
This article reviews several of the most popular Java questions on StackOverflow, explaining branch prediction for sorted arrays, why char[] is safer than String for passwords, handling NullPointerException, deterministic random strings, historic timezone quirks, creating an uncatchable exception, and the differences between HashMap, TreeMap and LinkedHashMap, highlighting practical lessons for developers.
Exception HandlingHashMapJava
0 likes · 10 min read

This article explains the PHP shuffle() function, its syntax, parameters, return values, and demonstrates three practical examples showing how to randomize indexed and associative arrays, highlighting the effect on array keys and values after shuffling.
ShuffleTutorialarray
0 likes · 3 min read

Learn how to use Python’s built‑in random module and NumPy’s random functions to generate various types of random numbers—including floats, integers, ranges, selections, shuffling, and sampling—while understanding seeds, pseudo‑randomness, and practical code examples for each method.
NumPyPythonSEED
0 likes · 8 min read

This guide explains the various special file types under Linux's /dev directory, shows how to identify them with ls, and demonstrates practical uses of /dev/null, /dev/full, /dev/zero, /dev/random, /dev/urandom, and /dev/pts through concrete command‑line examples.
LinuxNULLdev
0 likes · 5 min read

This article examines how Java's built‑in Random class works, its predictability and thread‑contention issues, and why SecureRandom and ThreadLocalRandom are essential for security‑critical or high‑concurrency scenarios, helping developers avoid common pitfalls when generating random numbers.
JavaSecureRandomThreadLocalRandom
0 likes · 5 min read

This article explains the concept of load balancing and provides Java implementations of several common algorithms—including Round Robin, Random, Source‑IP Hash, Weighted Round Robin, Weighted Random, and a discussion of Least Connections—highlighting their principles, advantages, drawbacks, and concurrency considerations.
BackendHashload balancing
0 likes · 14 min read


ITPUBNov 2, 2016 · Operations
This guide presents ten distinct Linux command‑line techniques—including SHA‑based hashing, OpenSSL, /dev/urandom filtering, dd, and custom Bash functions—to quickly produce strong, random passwords of configurable length, each illustrated with sample output.
Linuxbashpassword
0 likes · 5 min read


ITPUBOct 23, 2016 · Information Security
This guide walks through ten distinct Linux command‑line techniques—including date hashing, /dev/urandom filtering, OpenSSL, tr, strings, dd, and custom shell functions—to quickly produce secure, random passwords of configurable length for any environment.
passwordrandomsecurity
0 likes · 6 min read


Aotu LabApr 29, 2016 · Frontend Development
This article explains how JavaScript's Math.random works, why it lacks a built‑in seed, and shows practical ways to override or seed the function—including V8's internal algorithm, simple custom implementations, and real‑world use cases for reproducible randomness in web games.
SEEDV8codewars
0 likes · 7 min read

Although the program uses java.util.Random with different seed values, each execution prints the same 'Hello world' because the Random instances are initialized with fixed seeds, causing the pseudo‑random generator to produce identical sequences that map to the characters forming the phrase.
JavaSEEDprogramming
0 likes · 5 min read

This article presents ten tested Linux command‑line techniques for generating random passwords, each easily adjustable for length and suitable for use on Linux, Cygwin‑enabled Windows, and even macOS, offering practical options for sysadmins and developers.
command-linepasswordrandom
0 likes · 5 min read
