This would be great stuff to post to our Wiki, and FAQ.
http://wtr.rubyforge.org/wiki/wiki.pl
http://wtr.rubyforge.org/wiki/wiki.pl?FrequentQuestions
How 'bout a Wiki page on the topic?
Bret
At 03:28 PM 10/4/2005, Jeff Wood wrote:
>I recently posted this, but I'll pop another copy here.
>
>def allowed_chars
> output = []
> output += ('A'..'Z').to_a
> output += ('0'..'9').to_a
>end
>
>def random_text( length )
> output = ""
> allowed = allowed_chars()
> length.times do
> output << allowed[ rand( allowed.length ) ]
> end
> output
>end
>
>all done with functionality to easily add/remove chars from your set of
>allowed.
>
>hope that helps.
>
>j.
>
>On 10/4/05, Winston, Phyllis H
><<mailto:[EMAIL PROTECTED]>[EMAIL PROTECTED]> wrote:
>>Alan Richardson has an excel spreadsheet using visual basic macros for
>>data generation:
>><http://www.compendiumdev.co.uk/testdata/index.php>http://www.compendiumdev.co.uk/testdata/index.php
>>
>>-----Original Message-----
>>From: Chris McMahon [mailto:[EMAIL PROTECTED]
>>Sent: Monday, October 03, 2005 6:33 PM
>>To: <mailto:[email protected]>[email protected]
>>Subject: [Wtr-general] OT: generate random text?
>>
>>Hi...
>>
>>I want to generate some random text for test purposes. "rand" doesn't
>>seem to DWIM. Say, to pick an arbitrary letter from the uppercase
>>range A to Z.
>>
>>[A-Z].rand
>>[A..Z].rand
>>
>>seems right, but isn't.
>>-Chris
>>
>>
>>
>>_______________________________________________
>>Wtr-general mailing list
>><mailto:[email protected]>[email protected]
>>http://rubyforge.org/mailman/listinfo/wtr-general
>
>
>
>--
>" http://ruby-lang.org -- do you ruby?"
>
>Jeff Wood
>_______________________________________________
>Wtr-general mailing list
>[email protected]
>http://rubyforge.org/mailman/listinfo/wtr-general
_____________________
Bret Pettichord
www.pettichord.com
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general