Category "random"

Generating a random number that ends with a certain digit in Java

How does one generate a random number between 0 and 500 that ENDS WITH 5 in Java? I'm fairly new to programming.

Random array element creation into Dom only once JavaScript

I've got a problem to insert a random array element into the DOM. I want it to only do it once for each array element but the code keeps fetching the element in

R: How to randomly sample one value from each column and bootstrap

I have 18 columns and 100 rows, where columns stand for 18 students and rows stand for their grades in 100 exams. Here is what I want: for each student, I want

Randomness between Jupyter Kernel Restarts

Problem: I am currently working on clustering of data and found a weird behavior in my Jupyter Notebooks. All seeds are fixed. Executing some or all code multip

The problem when working with requests using a proxy in Python

Sorry if some of the suggestions are going to be weird. I used a translator, because this question was not answered on my language's stackoverflow. import threa

Simulating random numbers in R using a certain condition

I would like to simulate 100 random numbers from N(0,1) in such a manner that the i-th number generated is always greater than the (i-1)-th number. I've tried u

Random Sampling base on 1 column after Groupby

I have a Spark Table, which contains 400+ millions records/rows. I used spark.table to convert it into a DF. The DF looks like this below id pub_date

Testing randomness function without intended mean

I have a program that tests a randomness function for how truly random it is: function testRandom(randomF, tests, intendedMean){ let total = 0; fo

12 digit unique distributed random number generator

I ported sonyflake to Java and it worked fine. However, instead of generating 8 digit numbers, I am looking to generate 12 digit unique numbers. The original po

C# - Random Generator exclude last number from Array

I've just started my first little project in C# and with WinForms and I am stuck on this one feature for a few days now.. I have an Array with about 60 PictureB

Scraping SofaScore votes using Xpath and google sheets

I'm trying to scrape the votes from SofaScore with google sheets using the importxml function. I'm running into an issue because the class name has a random str

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