Questions tagged as 'random'

0
answers

Distribution addicted to using rand () function [closed]

Hello, how do I use the rand() function with the range Y ∈ [11, height + 9] and X ∈ [11, width-1]. srand (time(NULL)); y=rand() % ((altura+9)-11) + 11; x=rand() % ((largura-1)-11) + 11; gotoXY(x, y); cout<<"o"; Is it like this...
asked by 03.08.2018 / 23:26
0
answers

(JAVA) Timeout for random token

I'm generating an alphanumeric token like this: SecureRandom secureRandom = new SecureRandom(); long longToken = Math.abs(secureRandom.nextLong()); String random = Long.toString(longToken, 16); I need a mechanism that defines the lifetime...
asked by 04.07.2018 / 00:43
0
answers

Array with random indices

I have a random array that returns several keys and I need to manipulate all the returned data, the problem is that they vary according to the occasion, I want to display this information organized in HTML, but there are cases where this array r...
asked by 10.05.2018 / 03:12
0
answers

Generate random numbers in R with Skew-Normal Bivariate distribution

I made the script below, but I doubt if it is correct, I need to generate a bivariate vector with Skew-normal distribution of mean mu=(mu1,mu2) , variance and covariance matrix Sigma=matrix(c(sigma1^2,rho*sigma1*sigma2,rho*sigma1*sigma2...
asked by 18.08.2017 / 17:34
2
answers

Random button with isEmpty ();

Hello, I'm new to programming with Java and now a little Android. I am trying to use Random to issue random messages if nothing is typed. So, my code looks like this: public class MainActivity extends AppCompatActivity { private EditTe...
asked by 25.11.2016 / 16:37
0
answers

Selecting and deleting random csv lines in python [closed]

I need to make a small python script that meets the following requirements: Open a csv file; Exclude from reading the first line and the first column, because it contains information that will not be necessary in this computation itself;...
asked by 24.07.2016 / 04:55
1
answer

How to make a Seed.rb by looking for random SQLite data in Rails?

As I already have a register of Cities and states, you can see below, my question is as follows, how can I put inside the 10.times function in the lines of address_city and address_state a parameter to search for cities and random states? within...
asked by 08.06.2015 / 20:05
2
answers

Randomly generated list

I want to generate a list of cars with random characteristics of brand, model, color and year. These values are stored in a car list. The problem is that at the time of doing the loop that calls the gerarCarro() function, which adds ran...
asked by 04.08.2017 / 02:07
1
answer

Is there any way to define a random order by order for an already established order?

If the title of my question was confused, I explain: I want to sort a result of a given query from MYSQL . Example: SELECT * FROM usuarios ORDER BY cidade = 'BH' DESC, cargo = 'Programador' DESC But I would like tha...
asked by 17.09.2015 / 14:41
1
answer

Set of 3 Java ports

I have to do an exercise in Java that consists of creating an array [3] [3] where each line would be a phase of the game. The user must guess which door the prize is on. For this I need to do a random on each line assigning the value 1 for the...
asked by 17.04.2015 / 11:45