Questions tagged as 'random'

1
answer

Random ads with viewer counter

I have the following script to put random ads on the site, in addition to simple and easy also works very well and fast with multiple ads. The problem is as follows: How many times have each ad been chosen by this script (how many times have...
asked by 13.12.2016 / 15:16
1
answer

Problem after applying a patch for random name generation in ffmpeg

I applied the following patch below, it works as expected, but occasionally transcoding to and in other cases ( rare cases depending on the version of compiled ffmpeg ) continues to run but instead of creating multiple segments with random names...
asked by 21.11.2016 / 15:28
1
answer

How to create random filenames with ffmpeg?

I'm compiling a custom version of ffmpeg, and I want it to generate random file names but it does not support this, so I need some function that does this with X the quantity is not important, as long as it is above 10 and below 20), if pos...
asked by 30.10.2016 / 18:37
2
answers

Choose an index from a list

I have a list: l = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] I would like to choose a value between indexes 6 and 14 from this list, but do this 5 times and store those values in another list. How do I? If it were of any index,...
asked by 16.07.2016 / 12:48
1
answer

PHP How to get a random value like in rand ($ min, $ max) but with a query?

For example, in a browser game I want the user to click on attack to return another user who has + - the same battle power as he. $select = $mysqli->query("select * from data order by rand()"); This way it always returns a random value,...
asked by 06.06.2016 / 04:28
1
answer

Random of Enumerator

I'm not able to do a random enumerator. enum Notas {A=10, B=22, C=31, D=44, E=56}; It has this solution, but I need the enumerator values and here it is returning the rest of the calculation. enum Notas {A=10, B=22, C=31, D=44, E=56, ULTI...
asked by 09.03.2016 / 18:00
1
answer

Random letters: How to generate with rand and how to compare them in C

I'm trying to create a 10-position char array, I want to feed it with 10 random letters and sort it out with Bubble Sort. My question is: does rand generate random characters as well as generate numbers, or does it make any difference? I can com...
asked by 31.10.2015 / 22:11
1
answer

Simplify Probability function with priority

I have this function that works the way I want it to. It gets a value between -2 to 2 to set the priority to choose between two strings. My question is: How can I simplify the function? function random_str($val){ if($var == '-2') { $ou...
asked by 29.06.2015 / 16:44
1
answer

RANDOM function in IBM Informix BD?

I need to use a random () function in SQL in an Informix database version 11.50. However in the select below it returns syntax error: select random(), codigo from minha_tabela; 674: Routine (random) can not be resolved. Error in line 1 Near...
asked by 29.03.2014 / 22:35
3
answers

Range of random numbers in C

In a certain program, I need to generate a random value greater than 1000 (with a limit set by me for up to 5000 (maybe still a very high value)). This unique code refers to a type of registration to be performed. After solving some doubts of...
asked by 05.11.2014 / 01:09