Category "random"

MySQL insert at random position

I want to build a poll where the answers are not assignable to the voters. But I need to keep track of who already voted. So I have two different MySQL tables,

How to make a button that teleports randomly on the website onclick

At the moment I wanted to create a button that teleports randomly back and forth on my website. As I am very new to JavaScript, I did not get it right. That's w

Define agent with parameter (%) and delay time in main is based of it. (Anylogic)

I have a simple model which has a separate Agent called 'Passenger'. Inside the Passenger I have a parameters called 'WITH_CHILDREN' which it's default value is

Generate a Random Output from the List of Multiplicities of a Number X up to a MAX Number Y?

Using a bash script, I want to choose a random number from such a list: [0, X, 2X, 3X, 4X, ..., Y] where Y=k*X and k is an integer. X and Y are just some input

How to make a tuple give a random new tuple?

I am trying to take a position (a,b) and via the code receive a random new position (a,b).. I am having great trouble implementing the code and what I got is by

Python sklearn RandomForestClassifier non-reproducible results

I've been using sklearn's random forest, and I've tried to compare several models. Then I noticed that random-forest is giving different results even with the s

How to generate pseudo-random number in dart

I'm currently trying to pick up a random item in a list in dart. For this, I would like to generate a pseudo-random number (my seed) which will be the index whe

How to choose a weighted random array element in Javascript?

For example: There are four items in an array. I want to get one randomly, like this: array items = [ "bike" //40% chance to select "car" //30%

How to generate a cryptographically secure random integer within a range?

I have to generate a uniform, secure random integer within a given range for a program that generates passwords. Right now I use this : RNGCryptoServiceProvide

Generating easy to remember numbers

Is it possible to generate random numbers between say 1000000 and 9999999 that are easy to remember? I know the term easy to remember is relative but I'd beli

random number generator function returns a nested tuple in haskell

I am trying to understand why my haskell function returns a nested tuple, and I cannot seem to wrap my head around the problem. I have this function that genera

Why is %random% in Windows time based and how to get a real random number?

I use the following script: set /a num=%random% %%1000 +3000 timeout /T %num% taskkill /F /IM chrome.exe I trigger it using Windows task scheduler on multipl

Is there a way to seed a cryptographically secure RNG engine in rust using a [u8; 64] array?

ORIGINAL QUESTION: I am currently trying to write a library in rust - to be compiled to WASM - for converting a bip39 mnemonic passphrase into an Arweave JWK. I

How to randomly generate names for each file in folder in batch file?

I want to rename all files in folder to random name but it wants to rename all the files to the same name: ren "c:\Test\*.txt" %Random%.txt pause Output: C:\Us

TI-84 Plus Random Number Generator Algorithm

Edit: my main question is that I want to replicate the TI-84 plus RNG algorithm on my computer, so I can write it in a language like Javascript or Lua, to test

How to generate random binary numbers 0 or 1 with length of N and with option to control the probability of having 0 or 1?

I want to generate random binary numbers (0 or 1) having N length size. The tricky part is that, It should be able to control the probability of having either m

ElasticSearch random score combined with boost?

I am building a iOS app with Firebase, and using ElasticSearch as a search engine to get more advanced queries. I am trying to achieve a system where I can get

How to set a seed for the generating random numbers in Excel? [duplicate]

I am running a experiment in excel using NORM.S.INV(RAND()) Is there a way to set the seed for the random function?

How to shuffle strings in arrays in golang?

So I created a program to help me decide which game to play. Before I start my problem let me show you my code: package main import ( "fmt" "strconv"

Why is my rock/paper/scissors game getting the same random number for multiple function calls?

I have made a functioning (if possibly extremely verbose) game of rock/paper/scissors. If I run the game by calling the function once over and over the 'compute