*** povbot has joined #maemo | 10:11 | |
*** eMHa__ has joined #maemo | 10:20 | |
*** florian has joined #maemo | 10:25 | |
*** Kabouik has joined #maemo | 10:33 | |
*** geaaru has joined #maemo | 10:41 | |
*** Venemo has joined #maemo | 10:44 | |
*** eMHa__ has quit IRC | 11:05 | |
*** eMHa__ has joined #maemo | 11:09 | |
*** jskarvad has joined #maemo | 11:52 | |
*** Kabouik has quit IRC | 12:52 | |
*** Oksana_ has joined #maemo | 13:13 | |
*** Oksana_ has quit IRC | 13:14 | |
*** Oksana_ has joined #maemo | 13:14 | |
*** LauRoman has quit IRC | 13:41 | |
*** LauRoman has joined #maemo | 13:42 | |
*** cyteen has joined #maemo | 13:43 | |
*** idwrqd has joined #maemo | 14:06 | |
*** saidinesh5 has quit IRC | 14:14 | |
*** saidinesh5 has joined #maemo | 14:14 | |
*** troulouliou_div2 has joined #maemo | 14:16 | |
*** Cor-Ai has quit IRC | 14:32 | |
*** Cor-Ai has joined #maemo | 14:34 | |
*** idwrqd has quit IRC | 14:38 | |
*** idwrqd has joined #maemo | 14:39 | |
*** Kabouik has joined #maemo | 14:40 | |
*** xes has quit IRC | 14:42 | |
*** idwrqd has quit IRC | 14:45 | |
*** idwrqd has joined #maemo | 14:47 | |
*** idwrqd has quit IRC | 14:48 | |
*** idwrqd has joined #maemo | 14:48 | |
*** xes has joined #maemo | 14:49 | |
*** idwrqd has quit IRC | 14:49 | |
*** Cor-Ai has quit IRC | 14:49 | |
*** idwrqd has joined #maemo | 14:50 | |
*** idwrqd has joined #maemo | 14:51 | |
*** idwrqd has joined #maemo | 14:54 | |
*** xes has quit IRC | 14:54 | |
*** idwrqd has quit IRC | 14:54 | |
*** idwrqd has joined #maemo | 14:55 | |
*** idwrqd has joined #maemo | 14:55 | |
*** idwrqd has quit IRC | 15:00 | |
*** saidinesh5 has quit IRC | 15:08 | |
*** saidinesh5 has joined #maemo | 15:09 | |
sixwheeledbeast | can random be used in a loop on the shell without having the same number come up | 15:15 |
---|---|---|
KotCzarny | ? | 15:17 |
KotCzarny | try: echo $RANDOM | 15:17 |
KotCzarny | works in bash | 15:17 |
sixwheeledbeast | to avoid xy I need to pull a random list of say 50 integers from a pool of 01-99 . I beleive RANDOM will repeat them if in a loop | 15:17 |
KotCzarny | it returns 0-32767 i think | 15:17 |
KotCzarny | up to you to scale it to range you need | 15:18 |
sixwheeledbeast | i want no duplicates | 15:18 |
KotCzarny | thats not random then | 15:18 |
KotCzarny | what you need is to create an array with 99 elements, then shuffle it | 15:18 |
sixwheeledbeast | well I suppose so but that's what i am looking for | 15:18 |
sixwheeledbeast | i see is array the best way you think? | 15:19 |
KotCzarny | otherwise you have to keep different array with 'used' numbers anyway | 15:19 |
KotCzarny | and having to scan through it on every new return | 15:19 |
sixwheeledbeast | I suppose so. I didn't think of it like that. i was hoping for a shell function already there :) | 15:20 |
KotCzarny | i havent seen such functionality in bash | 15:21 |
KotCzarny | anyway, your problem is 'shuffle deck of cards then deal them' | 15:21 |
KotCzarny | taught in schools often | 15:21 |
KotCzarny | so there should be lots of examples for different languages | 15:22 |
sixwheeledbeast | np array it is then. school? | 15:22 |
KotCzarny | ya, it101 | 15:22 |
sixwheeledbeast | school is long behind me we where lucky to have working ones in my era | 15:23 |
KotCzarny | but as i've said, google: deal shuffled deck of cards in bash | 15:23 |
Maxdamantus | or a more interesting way of looking at it: find an information densitity preserving encryption, and encrypt all possible inputs in a predictable sequence. | 15:26 |
KotCzarny | or basically: shuffle in bash | 15:27 |
Maxdamantus | basically, encrypt(0), encrypt(1), encrypt(2), .. encrypt(n) | 15:27 |
sixwheeledbeast | yep i am waiting for something to render so can't open a browser at the moment, hence I thought I'd ask the question having used random before. | 15:27 |
KotCzarny | swb: but it's better to use any scripting lang, perl/php/python | 15:27 |
KotCzarny | whichever you are best in | 15:28 |
KotCzarny | at some point you will have to switch to it when adding functionality | 15:28 |
Maxdamantus | anyway, if you want a sequence of numbers in a random order: seq 99 | sort -R | head -50 | 15:28 |
KotCzarny | wow | 15:29 |
sixwheeledbeast | only ever used bash for most things but i can have a look in python if necessary. | 15:29 |
KotCzarny | i forgot sort has shuffle | 15:29 |
Maxdamantus | (`seq 99` is a bit weird; I suspect what you really want is either `seq 0 99` or `seq 100`, which both emit 100 numbers (`seq 99` emits 99 numbers)) | 15:29 |
sixwheeledbeast | oh useful ty :) | 15:30 |
KotCzarny | seq -f '%02.0f' 1 99|sort -R | 15:30 |
KotCzarny | done | 15:30 |
KotCzarny | if you want only 50 of them, add |head -50 | 15:31 |
sixwheeledbeast | oh i see you have used the format flag to have 2sf nice | 15:33 |
*** Cor-Ai has joined #maemo | 16:13 | |
*** Venemo has quit IRC | 16:20 | |
*** saidinesh5 has quit IRC | 16:30 | |
*** saidinesh5 has joined #maemo | 16:30 | |
*** Venemo has joined #maemo | 17:02 | |
*** cyteen_ has joined #maemo | 17:10 | |
*** cyteen has quit IRC | 17:11 | |
*** troulouliou_div2 has quit IRC | 17:13 | |
*** cyteen__ has joined #maemo | 17:17 | |
*** cyteen_ has quit IRC | 17:18 | |
*** Oksana__ has joined #maemo | 17:20 | |
*** Oksana__ has quit IRC | 17:21 | |
*** Oksana__ has joined #maemo | 17:21 | |
*** Oksana_ has quit IRC | 17:24 | |
*** Oksana__ is now known as Oksana_ | 17:24 | |
*** cyteen_ has joined #maemo | 17:25 | |
*** saidinesh5 has quit IRC | 17:25 | |
*** saidinesh5 has joined #maemo | 17:26 | |
*** cyteen__ has quit IRC | 17:27 | |
*** Oksana_ is now known as Oksana | 17:28 | |
*** remarc has joined #maemo | 17:50 | |
*** remarc_ has joined #maemo | 17:51 | |
*** remarc has quit IRC | 17:55 | |
*** saidinesh5 has quit IRC | 18:20 | |
KotCzarny | Mangy_Dog: pink screen on hdmi means hdmi pixel format failed | 18:20 |
KotCzarny | erm, wrong chan | 18:20 |
*** saidinesh5 has joined #maemo | 18:20 | |
*** remarc__ has joined #maemo | 18:25 | |
*** remarc_ has quit IRC | 18:28 | |
*** remarc_ has joined #maemo | 18:32 | |
*** remarc__ has quit IRC | 18:36 | |
*** remarc has joined #maemo | 18:43 | |
*** remarc_ has quit IRC | 18:47 | |
*** remarc_ has joined #maemo | 18:50 | |
*** remarc has quit IRC | 18:53 | |
*** remarc_ has quit IRC | 19:04 | |
*** remarc has joined #maemo | 19:08 | |
*** remarc_ has joined #maemo | 19:12 | |
*** saidinesh5 has quit IRC | 19:14 | |
*** saidinesh5 has joined #maemo | 19:14 | |
*** remarc__ has joined #maemo | 19:15 | |
*** remarc has quit IRC | 19:16 | |
*** idwrqd has joined #maemo | 19:16 | |
*** remarc_ has quit IRC | 19:19 | |
*** remarc__ has quit IRC | 19:21 | |
*** remarc__ has joined #maemo | 19:22 | |
*** remarc_ has joined #maemo | 19:30 | |
*** remarc__ has quit IRC | 19:34 | |
*** remarc__ has joined #maemo | 19:41 | |
*** saidinesh5 has quit IRC | 19:41 | |
*** saidinesh5 has joined #maemo | 19:41 | |
*** remarc_ has quit IRC | 19:44 | |
*** remarc_ has joined #maemo | 20:02 | |
*** remarc has joined #maemo | 20:05 | |
*** remarc__ has quit IRC | 20:06 | |
*** remarc__ has joined #maemo | 20:06 | |
*** remarc_ has quit IRC | 20:08 | |
*** remarc has quit IRC | 20:10 | |
*** remarc has joined #maemo | 20:12 | |
*** remarc__ has quit IRC | 20:13 | |
*** Kabouik has quit IRC | 20:14 | |
*** eMHa__ has quit IRC | 20:20 | |
*** remarc_ has joined #maemo | 20:22 | |
*** remarc__ has joined #maemo | 20:23 | |
*** eMHa__ has joined #maemo | 20:25 | |
*** remarc has quit IRC | 20:25 | |
*** remarc_ has quit IRC | 20:27 | |
*** florian has quit IRC | 20:30 | |
*** saidinesh5 has quit IRC | 20:35 | |
*** saidinesh5 has joined #maemo | 20:35 | |
*** jskarvad has quit IRC | 20:37 | |
*** tm has quit IRC | 20:50 | |
*** Pali has joined #maemo | 20:51 | |
*** Venemo has quit IRC | 20:57 | |
*** tm has joined #maemo | 21:00 | |
*** remarc__ has quit IRC | 21:03 | |
*** remarc has joined #maemo | 21:11 | |
*** remarc_ has joined #maemo | 21:13 | |
*** remarc has quit IRC | 21:16 | |
*** remarc__ has joined #maemo | 21:16 | |
*** florian has joined #maemo | 21:19 | |
*** remarc_ has quit IRC | 21:20 | |
*** remarc has joined #maemo | 21:29 | |
*** saidinesh5 has quit IRC | 21:29 | |
*** saidinesh5 has joined #maemo | 21:30 | |
*** remarc__ has quit IRC | 21:32 | |
*** remarc has quit IRC | 21:39 | |
*** remarc has joined #maemo | 21:42 | |
*** parazyd has quit IRC | 21:58 | |
*** parazyd has joined #maemo | 22:00 | |
*** parazyd has joined #maemo | 22:00 | |
*** Kabouik has joined #maemo | 22:03 | |
*** remarc has quit IRC | 22:17 | |
*** remarc has joined #maemo | 22:18 | |
*** remarc has quit IRC | 22:27 | |
*** eMHa__ has quit IRC | 22:47 | |
*** xmn has joined #maemo | 23:08 | |
*** TheKit has quit IRC | 23:12 | |
*** TheKit has joined #maemo | 23:14 | |
*** LauRoman has quit IRC | 23:22 | |
*** LauRoman has joined #maemo | 23:23 |
Generated by irclog2html.py 2.15.1 by Marius Gedminas - find it at mg.pov.lt!