Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sat 25 May 2013, 23:29
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » REQUESTS
Is there a random number generator for Puppy? (Solved)
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 2 [17 Posts]   Goto page: 1, 2 Next
Author Message
Dromeno

Joined: 12 Sep 2008
Posts: 470

PostPosted: Fri 02 Dec 2011, 08:12    Post subject:  Is there a random number generator for Puppy? (Solved)  

Currently I am learning memorizing techniques for random numbers to improve my visualization capabilities (read Foer's Moonwalking with Einstein if you want to know why)

Is there a program which offline does what this site does:

http://www.random.org/strings/

Does such a random number generator exists as pet?
Back to top
View user's profile Send private message 
Flash
Official Dog Handler


Joined: 04 May 2005
Posts: 9853
Location: Arizona USA

PostPosted: Fri 02 Dec 2011, 08:30    Post subject:  

I seem to remember a thread years ago about generating random numbers in Puppy. Have you tried searching the forum for other posts with the word random in them? Or random number generator?
Back to top
View user's profile Send private message 
stu90


Joined: 25 Feb 2010
Posts: 1401
Location: England. Dell Inspiron 1501. Dpup

PostPosted: Fri 02 Dec 2011, 09:03    Post subject:  

Paste one of these into terminal - or make a script and run from terminal:

Mixed letters (lower and upper case) and numbers:
cat /dev/urandom| tr -dc 'a-zA-Z0-9' | fold -w 10| head -n 10


Mixed letters (upper case only) and numbers:
cat /dev/urandom| tr -dc 'A-Z0-9' | fold -w 10| head -n 10


Numbers only:
cat /dev/urandom| tr -dc '0-9' | fold -w 10| head -n 10

fold -w 10 - is the amount of numbers on each line.
head -n 10 - is the amount of lines.
Change the numbers if you want more or less numbers/lines.

example output numbers:
2358050481
8314333229
5764338769
2275964781
4952461006
7813938010
7352332659
8528802348
5485997065
1874076173

example output mixed:
iBMAwghUnz
P8LL2M5Bae
wjvw5ofoh9
Hc28U2BE00
sJSFBbsL1F
6u8oENfSNf
brKzmmwya3
nyvf6JMlRD
nvrRK8ElEZ
MfaDglBaDM
Back to top
View user's profile Send private message 
Dromeno

Joined: 12 Sep 2008
Posts: 470

PostPosted: Fri 02 Dec 2011, 14:42    Post subject: Almost there  

He. thanks...

One more question for the script - what is the command to make lxterminal show the numbers and not disappear immediately? It works when I open lxterminal then type or copypaste the line

cat /dev/urandom| tr -dc '0-9' | fold -w 10| head -n 10

...but I want to make it into a simple icon which I can click to get the numbers in lxterminal without opening the lxterminal first.
Back to top
View user's profile Send private message 
jrb


Joined: 11 Dec 2007
Posts: 972
Location: Smithers, BC, Canada

PostPosted: Fri 02 Dec 2011, 16:15    Post subject:  

You can also open gnumeric, Calc on the desktop, and type in:
Code:
=rand()
which will give you a number between 0 and 1. If you want them bigger type
Code:
=rand()*1000
or 1000000 or whatever.
_________________
SFS-TCZ_Linker, http://puppylinuxstuff.meownplanet.net/choicepup/ user=puppy, password=linux
Back to top
View user's profile Send private message 
jrb


Joined: 11 Dec 2007
Posts: 972
Location: Smithers, BC, Canada

PostPosted: Fri 02 Dec 2011, 23:05    Post subject: Re: Almost there  

Dromeno wrote:
He. thanks...

One more question for the script - what is the command to make lxterminal show the numbers and not disappear immediately? It works when I open lxterminal then type or copypaste the line

cat /dev/urandom| tr -dc '0-9' | fold -w 10| head -n 10

...but I want to make it into a simple icon which I can click to get the numbers in lxterminal without opening the lxterminal first.

Create a new script, i.e. random_numbers, and type in the following:
Code:
#!/bin/sh
xterm -hold -e "cat /dev/urandom| tr -dc '0-9' | fold -w 10| head -n 10"

Drag it to the desktop and you will have your numbers in a readable terminal window.

_________________
SFS-TCZ_Linker, http://puppylinuxstuff.meownplanet.net/choicepup/ user=puppy, password=linux
Back to top
View user's profile Send private message 
01micko


Joined: 11 Oct 2008
Posts: 7019
Location: qld

PostPosted: Sat 03 Dec 2011, 00:00    Post subject:  

I like that snippet stu90... dunno why I but I felt compelled to make a silly little Xdialog..
Code:
#!/bin/ash
while [ 1 ]
 do
 VAR=$(cat /dev/urandom| tr -dc 'A-Z0-9' | fold -w 10| head -n 10)
  Xdialog -yesno "$VAR \n\nGenerate More?" 0 0
  case $? in
  0)
  unset VAR
  sleep 0.5
  ;;
  *)break
  ;;esac
 done
 
Cool
_________________
keep the faith Cool ..
Back to top
View user's profile Send private message Visit poster's website 
Dromeno

Joined: 12 Sep 2008
Posts: 470

PostPosted: Sun 04 Dec 2011, 06:44    Post subject: Perhaps something for pwidgets
Subject description: random number widget
 

Thanks again! For anyone who wants to try it (surry for my ranting...I am amazed by the results) after reading Moonwalking with einstein I read this one http://www.amazon.com/Quantum-Memory-Power-Improve-Champion/dp/0743528662, practiced a bit, and in less than a week I can memorize a 25 digit number in ten minutes. And remember it three days later. I have no idea of a good application yet but it definately is a fun technique to win bar bets.

But to return to the subject of this post. With this site you can make a true randomness producing widget. Perhaps a nice addition to pwidgets (random number block of the day)? It would be the most useful, I think, if you were able to choose the length and width of the column.

http://www.random.org/widgets/integers/
Back to top
View user's profile Send private message 
stu90


Joined: 25 Feb 2010
Posts: 1401
Location: England. Dell Inspiron 1501. Dpup

PostPosted: Sun 04 Dec 2011, 10:19    Post subject:  

Following on from 01micko's xdialog GUI - here is a yad GUI with format, character and column length options. Smile



Code:
#!/bin/bash

## stu90 ##
## random number / letter / mixed generator ##
## root password for user fido ###
[ "`whoami`" != "root" ] && exec sudo -A ${0} ${@}

TITLE="Randomizer"
TEXT=" Make a random memory string "
FORMAT="mixed!numbers!letters"

GUI=$( yad --title="$TITLE" --text="$TEXT" --form \
--field="Format:CB" "$FORMAT" \
--field="Character:NUM" "10" \
--field="Columns:NUM" "10" --button="gtk-ok" )

 GETFORM=`echo $GUI | cut -d '|' -f1`
 GETCHAR=`echo $GUI | cut -d '|' -f2 | cut -d '.' -f1`
 GETCOLU=`echo $GUI | cut -d '|' -f3 | cut -d '.' -f1`

if `echo "$GETFORM" | grep -q mixed` ; then
  cat /dev/urandom| tr -dc 'A-Z0-9' | fold -w "$GETCHAR"| head -n "$GETCOLU" | yad --title="$TITLE" --height="275" --text-info
elif `echo "$GETFORM" | grep -q numbers` ; then
  cat /dev/urandom| tr -dc '0-9' | fold -w "$GETCHAR"| head -n "$GETCOLU" | yad --title="$TITLE" --height="275" --text-info
elif `echo "$GETFORM" | grep -q letters` ; then
  cat /dev/urandom| tr -dc 'A-Z' | fold -w "$GETCHAR"| head -n "$GETCOLU" | yad --title="$TITLE" --height="275" --text-info
fi

Back to top
View user's profile Send private message 
Dromeno

Joined: 12 Sep 2008
Posts: 470

PostPosted: Sun 04 Dec 2011, 16:59    Post subject: Glad I don't have a Mac  

wow... It are threads like this, with lots of helpful geeks hobbyists and other humans which makes me love linux so much in comparison to, for instance...

http://edcooke.memrise.com/2011/05/is-apples-aesthetic-fundamentally.html

I have a lucid puppy 525 running on an asus eee 1215n, running one and a half times as fast as a MacPro for 1/4 of the costs plus a top notch helpful forum
Back to top
View user's profile Send private message 
stu90


Joined: 25 Feb 2010
Posts: 1401
Location: England. Dell Inspiron 1501. Dpup

PostPosted: Thu 08 Dec 2011, 11:28    Post subject:  

Hi Dromeno - I might try using this my self any tips on how to remember the strings?

I also updated my script/GUI to incorporate a random word list generator - any interest in this?

cheers.
Back to top
View user's profile Send private message 
vovchik


Joined: 23 Oct 2006
Posts: 1231
Location: Ukraine

PostPosted: Thu 08 Dec 2011, 12:57    Post subject:  

Dear Stu,

It's tiny and great, so thanks. The only thing I would do is change the 'Columns' label for the spinbox to Rows, since that is what we seem to be dealing with Smile Don't worry. I can't tell right from left without looking at my hands. Really Smile And, strictly speaking, x and y are relative.

With kind regards,
vovchik

PS. I recently got the latest Yad and compiled it (Anansik is up to 0.16.3)!
Back to top
View user's profile Send private message 
Dromeno

Joined: 12 Sep 2008
Posts: 470

PostPosted: Thu 15 Dec 2011, 19:49    Post subject:  

stu,

One useful forum about such memory techniques is
http://mnemotechnics.org/x/

The audiobook by Dominic O'Brian about "quantum memory techniques" can be downloaded from filestube (but I think it is more legal to buy it). Weird name, quantum memory technique, since a quantum leap is by definition the smallest possible change in nature, so I guess it is more a title intended to boost sales. There is no new age magic stuff involved.

It is more a kind of mental zip for numeral information. It is a kind of mental-visual language. If you picture a single given digit in ten different colors (for instance transparent, red, orange, yellow, green, blue, violet, black, white, gold) then you can mentally encode/remember all numbers between 1-100 by just 10 digits. With little practice in the same direction it is possible to condense all numbers between 1 and 999,999 with just 1 mental picture etc. Remembering pics is way easier than remembering strings of numbers.

Basically this is the technique which memory champions use to remember ten thousands digits of pi. And other than just trying to remember long strings by reading/repeating, visulalization is something you can train for. So thanks again for your little piece of software. Being able to remember a copuple of dozen random digits is a fun thing to amaze friends and a nice "mind game" to practice. Some people like to do tetris. I like to train remembering random number blocks...
Back to top
View user's profile Send private message 
stu90


Joined: 25 Feb 2010
Posts: 1401
Location: England. Dell Inspiron 1501. Dpup

PostPosted: Fri 16 Dec 2011, 11:14    Post subject:  

vovchik wrote:
Dear Stu,

It's tiny and great, so thanks. The only thing I would do is change the 'Columns' label for the spinbox to Rows, since that is what we seem to be dealing with Smile Don't worry. I can't tell right from left without looking at my hands. Really Smile And, strictly speaking, x and y are relative.

With kind regards,
vovchik

PS. I recently got the latest Yad and compiled it (Anansik is up to 0.16.3)!


Thanks Volchik - yes the colums label needs to be changed Embarassed Very Happy

cheers.
Back to top
View user's profile Send private message 
stu90


Joined: 25 Feb 2010
Posts: 1401
Location: England. Dell Inspiron 1501. Dpup

PostPosted: Fri 16 Dec 2011, 11:15    Post subject:  

Dromeno wrote:
stu,

One useful forum about such memory techniques is
http://mnemotechnics.org/x/

The audiobook by Dominic O'Brian about "quantum memory techniques" can be downloaded from filestube (but I think it is more legal to buy it). Weird name, quantum memory technique, since a quantum leap is by definition the smallest possible change in nature, so I guess it is more a title intended to boost sales. There is no new age magic stuff involved.

It is more a kind of mental zip for numeral information. It is a kind of mental-visual language. If you picture a single given digit in ten different colors (for instance transparent, red, orange, yellow, green, blue, violet, black, white, gold) then you can mentally encode/remember all numbers between 1-100 by just 10 digits. With little practice in the same direction it is possible to condense all numbers between 1 and 999,999 with just 1 mental picture etc. Remembering pics is way easier than remembering strings of numbers.

Basically this is the technique which memory champions use to remember ten thousands digits of pi. And other than just trying to remember long strings by reading/repeating, visulalization is something you can train for. So thanks again for your little piece of software. Being able to remember a copuple of dozen random digits is a fun thing to amaze friends and a nice "mind game" to practice. Some people like to do tetris. I like to train remembering random number blocks...


Thanks Dromeno - i will check it out, i need all the help i can get in the memory department! Idea

cheers.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 2 [17 Posts]   Goto page: 1, 2 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » REQUESTS
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0776s ][ Queries: 12 (0.0065s) ][ GZIP on ]