Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xsl] RandomList.xsl from FXSL-xslt2

From: Jesper Tverskov <jesper.tverskov@-----.--->
To: xsl-list@-----.------------.---
Date: 10/2/2009 2:36:00 PM
Are 5 digits more than good enought to generate random numbers below
1000. Any rule of thumb for how to make the best possible seeds?

format-time(current-time(), '[f][s]')

Cheers,
Jesper







On Fri, Oct 2, 2009 at 2:57 PM, Dimitre Novatchev <dnovatchev@g...> wrote:
> On Fri, Oct 2, 2009 at 1:23 AM, Jesper Tverskov <jesper@t...> wrote:
>> Hi List
>>
>> I'm trying to get RandomList.xsl from FXSL-xslt2 working.
>>
>> The test file provided by FXSL, testRandomList2.xsl, works well for
>> shuffling a deck of cards. But the order of the 52 cards is always the
>> same.
>
> This is a FAQ.
>
> You need a seed to generate a sequence of random numbers and if you
> always start with the same seed, you'll always get the same random
> sequence.
>
> In order to have a different seed each time you need it, use the current time.
>
> For example, if you need to make 100 shuffles, first get a sequence of
> 100 numbers (using the current time as the seed for the generation of
> the sequence).
>
> Then use each of these 100 numbers to generate a shuffle.
>
>
>
> --
> Cheers,
> Dimitre Novatchev
> ---------------------------------------
> Truly great madness cannot be achieved without significant intelligence.
> ---------------------------------------
> To invent, you need a good imagination and a pile of junk
> -------------------------------------
> Never fight an inanimate object
> -------------------------------------
> You've achieved success in your field when you don't know whether what
> you're doing is work or play
>
> --~------------------------------------------------------------------
> XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
> or e-mail: <mailto:xsl-list-unsubscribe@l...>
> --~--
>
>



-- 
Jesper Tverskov

http://www.xmlkurser.dk
http://www.xmlplease.com

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe@l...>
--~--



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent