Tag

Random

0 views collected around this technical thread.

Raymond Ops
Raymond Ops
Jan 14, 2025 · Fundamentals

How to Generate Random 4‑Digit Numbers in Python with randint, randrange, and More

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.

PythonRandomcode
0 likes · 6 min read
How to Generate Random 4‑Digit Numbers in Python with randint, randrange, and More
Python Programming Learning Circle
Python Programming Learning Circle
Sep 21, 2024 · Information Security

Generating Random Passwords with Python's Random Module

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.

RandomTutorialpassword-generator
0 likes · 7 min read
Generating Random Passwords with Python's Random Module
php中文网 Courses
php中文网 Courses
Mar 1, 2024 · Backend Development

Using PHP's array_rand() Function to Randomly Select Elements from Arrays

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.

Backend DevelopmentRandomarray_rand
0 likes · 5 min read
Using PHP's array_rand() Function to Randomly Select Elements from Arrays
Python Programming Learning Circle
Python Programming Learning Circle
Dec 5, 2023 · Information Security

Generating Random Verification Codes in Python

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.

PythonRandomTutorial
0 likes · 3 min read
Generating Random Verification Codes in Python
Python Programming Learning Circle
Python Programming Learning Circle
Nov 14, 2023 · Fundamentals

Generating Random Numbers with Python’s random Module and NumPy

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.

NumPyRandomTutorial
0 likes · 7 min read
Generating Random Numbers with Python’s random Module and NumPy
Python Programming Learning Circle
Python Programming Learning Circle
Jun 9, 2022 · Fundamentals

Python Interview Questions and Answers: Memory Management, Lambda, List Operations, Exceptions, and More

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.

Exception HandlingInterviewMemory Management
0 likes · 10 min read
Python Interview Questions and Answers: Memory Management, Lambda, List Operations, Exceptions, and More
Python Programming Learning Circle
Python Programming Learning Circle
May 14, 2022 · Fundamentals

Advanced Number, Date, and Formatting Techniques in Python

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.

Complex NumbersDateTimeDecimal
0 likes · 24 min read
Advanced Number, Date, and Formatting Techniques in Python
Sohu Tech Products
Sohu Tech Products
Apr 27, 2022 · Backend Development

Why Using Fixed Seeds with Java Random Prints "Hello World"

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.

Code ExplanationHello WorldJava
0 likes · 10 min read
Why Using Fixed Seeds with Java Random Prints "Hello World"
Python Programming Learning Circle
Python Programming Learning Circle
Mar 4, 2022 · Fundamentals

Building a Simple “Take Stones” Game in Python

This tutorial walks you through creating a basic “take stones” game in Python, explaining the game rules, required functions, use of random numbers and the retrying library, and the main loop that lets a user play against a computer opponent.

Game developmentPythonRandom
0 likes · 3 min read
Building a Simple “Take Stones” Game in Python
Ops Development Stories
Ops Development Stories
Dec 17, 2021 · Backend Development

Boost Java Concurrency Performance with ThreadLocalRandom: Deep Dive & Code

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.

ConcurrencyJavaPerformance
0 likes · 9 min read
Boost Java Concurrency Performance with ThreadLocalRandom: Deep Dive & Code
Python Programming Learning Circle
Python Programming Learning Circle
Dec 7, 2021 · Fundamentals

Drawing a Starry Sky with Python Turtle

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.

RandomTutorialgraphics
0 likes · 3 min read
Drawing a Starry Sky with Python Turtle
Test Development Learning Exchange
Test Development Learning Exchange
Aug 26, 2021 · Fundamentals

Python Functions for Generating Random Captcha and Password Strings

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.

Password generationRandomcaptcha
0 likes · 2 min read
Python Functions for Generating Random Captcha and Password Strings
Laravel Tech Community
Laravel Tech Community
Mar 1, 2021 · Backend Development

PHP srand() – Seeding the Random Number Generator

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.

Randombackendseed
0 likes · 1 min read
PHP srand() – Seeding the Random Number Generator
Laravel Tech Community
Laravel Tech Community
Feb 23, 2021 · Backend Development

PHP rand() Function – Generating Random Integers

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.

PHPRandombackend
0 likes · 2 min read
PHP rand() Function – Generating Random Integers
Laravel Tech Community
Laravel Tech Community
Jan 25, 2021 · Backend Development

PHP getrandmax() Function – Returns the Maximum Random Number Value

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.

PHPRandombackend
0 likes · 1 min read
PHP getrandmax() Function – Returns the Maximum Random Number Value
Laravel Tech Community
Laravel Tech Community
Dec 29, 2020 · Backend Development

PHP shuffle() Function – Randomly Shuffle an Array

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.

PHPRandomarray
0 likes · 2 min read
PHP shuffle() Function – Randomly Shuffle an Array
IT Xianyu
IT Xianyu
Oct 16, 2020 · Fundamentals

Java Random Class: Constructors, Methods, and Implementation Details

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
Java Random Class: Constructors, Methods, and Implementation Details
Laravel Tech Community
Laravel Tech Community
Jun 12, 2020 · Backend Development

PHP shuffle() Function: Randomly Reordering Arrays with Detailed Examples

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.

RandomTutorialarray
0 likes · 3 min read
PHP shuffle() Function: Randomly Reordering Arrays with Detailed Examples
Architecture Digest
Architecture Digest
Apr 17, 2017 · Backend Development

Java Load Balancing Algorithms: Round Robin, Random, Source‑IP Hash, Weighted Round Robin, Weighted Random, and Least Connections

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.

JavaLoad BalancingRandom
0 likes · 14 min read
Java Load Balancing Algorithms: Round Robin, Random, Source‑IP Hash, Weighted Round Robin, Weighted Random, and Least Connections
Qunar Tech Salon
Qunar Tech Salon
Apr 25, 2015 · Fundamentals

Why a Java Program Using Random with Fixed Seeds Always Prints "Hello world"

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.

JavaPseudo‑randomRandom
0 likes · 5 min read
Why a Java Program Using Random with Fixed Seeds Always Prints "Hello world"