Skip to main content
Stack Overflow
  1. About
  2. For Teams
Filter by
Sorted by
Tagged with
1 vote
1 answer
123 views

I have legacy code written in Visual Basic 6. It uses Rnd and Randomize to produce an output given an initial random seed. These are the rtcRandomNext and rtcRandomize functions in the MSVBM60.DLL, ...
0 votes
1 answer
107 views

I am making an rng function in C with an upper bound. However, I'm always getting the same sequence of numbers - 3675356291. This is the file I'm using: // The #include block. Contains the header ...
pere T's user avatar
  • 11
Best practices
1 vote
5 replies
132 views

Given an input string, I want to generate a "random" number between 0 and 1. However given the same input string, the returned value should stay the same. I tried something like: Random ...
Nathan H's user avatar
  • 49.7k
4 votes
8 answers
300 views

Starting with the example dat0 below, let's say I want to randomly extract 3 pairs of ìd`s. Initial data (5 id pairs) dat0 <- structure(list(id = c("A", "A", "B", &...
denis's user avatar
  • 1,164
0 votes
1 answer
59 views

In a v12 TYPO3 site running EXT:news 12.3.0 I'd like to display a random selection of news articles, maintaining other chosen restraints (as limit to categories, respect top news etc.). Best practice ...
2 votes
1 answer
316 views

Recently, on a project, I encountered the need for uniformly distributed integers within an arbitrary range [a, b] from random bytes, a problem that is quite common and is usually solved using ...
Marz's user avatar
  • 23
1 vote
1 answer
125 views

I have a simple example for random stability in QuestaSim. module sv_rand_stability; class dummy; rand int data; endclass initial begin dummy d; $display("%...
0 votes
2 answers
112 views

I have a beginner Python program that generates random output and does not take any input. For example, it simulates rolling a dice 5 times and prints the results, their sum, and average: import ...
1 vote
1 answer
107 views

I've been digging into "true" randomness idea, and I've noticed that modern CPUs support instructions for generating randomness. X64 has RDRAND instruction, while ARM has RNDR (I'm not ...
0 votes
0 answers
83 views

I have the following code to calculate and visualise the probability of scoring 10 points or more This is the Scoreboard image that I used to run the code from PIL import Image, ImageDraw import ...
0 votes
0 answers
68 views

I'm trying to fetch random posts using the WordPress REST API, but the orderby=rand parameter is not working as expected. Instead of returning random posts on each request, it consistently returns the ...
4 votes
3 answers
171 views

I want to iterate through a list of size n, with A 1s in it (the rest are 0s), and I want the 1s randomly distributed. n and A are large, so I'm trying to make a generator instead of a list. If they ...
6 votes
3 answers
264 views

I need to generate a random integer from 0 (inclusive, but it doesn't matter) to p*q (exclusive, but it doesn't matter) that is divisible by neither p nor q. It just so happens that p and q are ...
nonhuman's user avatar
  • 141
-6 votes
2 answers
198 views

I'm trying to reorder the randomly generated numbers of a set, and I don't know how to do so: import numpy as np import random as rd NUMBER=5 c = np.zeros(NUMBER+1) for k in range(1,NUMBER+1): ...
Médicis's user avatar
2 votes
1 answer
153 views

I'm writing a chess engine in Rust and want to start using Zobrist Hashing, which requires me to pre-initialize an array of pseudo-random numbers from a constant seed. Since this array won't change, I ...

15 30 50 per page
1
2 3 4 5
...
2388

AltStyle によって変換されたページ (->オリジナル) /