ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* METAFUN's randomized operator's seed
@ 2011-08-03 13:19 Marcin Borkowski
  2011-08-03 13:48 ` Peter Rolf
  2011-08-03 13:53 ` Aditya Mahajan
  0 siblings, 2 replies; 6+ messages in thread
From: Marcin Borkowski @ 2011-08-03 13:19 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi,

I noticed that each time I recompile a document using randomized the
result is the same, so presumably the random seed is also the same.  I
guess this is intentional.  My questions are:
* Does the random seed value depend on a checksum of the tex file or
  something like this?
* How to change it (e.g., to make it depend on the compile time or
  whatever)?

Regards,

-- 
Marcin Borkowski
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: METAFUN's randomized operator's seed
  2011-08-03 13:19 METAFUN's randomized operator's seed Marcin Borkowski
@ 2011-08-03 13:48 ` Peter Rolf
  2011-08-03 14:07   ` Procházka Lukáš Ing. - Pontex s. r. o.
  2011-08-03 13:53 ` Aditya Mahajan
  1 sibling, 1 reply; 6+ messages in thread
From: Peter Rolf @ 2011-08-03 13:48 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Am 03.08.2011 15:19, schrieb Marcin Borkowski:
> Hi,
> 
> I noticed that each time I recompile a document using randomized the
> result is the same, so presumably the random seed is also the same.  I
> guess this is intentional.  My questions are:
> * Does the random seed value depend on a checksum of the tex file or
>   something like this?
Hi,

it's derived from system time and stored in the *.tuc-file (see
definition of \setuprandomize). As long as this file is not rewritten,
you get the same random seed.

> * How to change it (e.g., to make it depend on the compile time or
>   whatever)?
>
Something like (untested)

\setuprandomize[\normaltime]

I guess a call after \starttext will do.

> Regards,
> 

Peter
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: METAFUN's randomized operator's seed
  2011-08-03 13:19 METAFUN's randomized operator's seed Marcin Borkowski
  2011-08-03 13:48 ` Peter Rolf
@ 2011-08-03 13:53 ` Aditya Mahajan
  1 sibling, 0 replies; 6+ messages in thread
From: Aditya Mahajan @ 2011-08-03 13:53 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Wed, 3 Aug 2011, Marcin Borkowski wrote:

> Hi,
>
> I noticed that each time I recompile a document using randomized the
> result is the same, so presumably the random seed is also the same.  I
> guess this is intentional.  My questions are:
> * Does the random seed value depend on a checksum of the tex file or
>  something like this?

AFAIK, no. But the seed is stored in tuc file. Grep for randomseed.

> * How to change it (e.g., to make it depend on the compile time or
>  whatever)?

Delete the tuc file and recompile (or compile using --purge).

Aditya
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: METAFUN's randomized operator's seed
  2011-08-03 13:48 ` Peter Rolf
@ 2011-08-03 14:07   ` Procházka Lukáš Ing. - Pontex s. r. o.
  2011-08-03 14:22     ` Peter Rolf
  0 siblings, 1 reply; 6+ messages in thread
From: Procházka Lukáš Ing. - Pontex s. r. o. @ 2011-08-03 14:07 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hello,

> \setuprandomize[\normaltime]
>
> I guess a call after \starttext will do.
>
> Peter

I tried it as I was just about to solve the same problem; it seems to work in condition that *at least one minute elapses between two runs*.

BTW, what exactly does \normaltime expand to? Does it contain seconds as well?

Where to find some more info about \normaltime?

Best regards,

Lukas


-- 
Ing. Lukáš Procházka [mailto:LPr@pontex.cz]
Pontex s. r. o.      [mailto:pontex@pontex.cz] [http://www.pontex.cz]
Bezová 1658
147 14 Praha 4

Tel: +420 244 062 238
Fax: +420 244 461 038

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: METAFUN's randomized operator's seed
  2011-08-03 14:07   ` Procházka Lukáš Ing. - Pontex s. r. o.
@ 2011-08-03 14:22     ` Peter Rolf
  2011-08-03 14:27       ` Procházka Lukáš Ing. - Pontex s. r. o.
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Rolf @ 2011-08-03 14:22 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Am 03.08.2011 16:07, schrieb Procházka Lukáš Ing. - Pontex s. r. o.:
> Hello,
> 
>> \setuprandomize[\normaltime]
>>
>> I guess a call after \starttext will do.
>>
>> Peter
> 
> I tried it as I was just about to solve the same problem; it seems to
> work in condition that *at least one minute elapses between two runs*.
> 
> BTW, what exactly does \normaltime expand to? Does it contain seconds as
> well?
> 
> Where to find some more info about \normaltime?
>
probably just an alias for \time

http://www.tug.org/utilities/plain/cseq.html#time-rp


this would also explain, why the seconds do not count :-)

> Best regards,
> 
> Lukas
> 
> 

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: METAFUN's randomized operator's seed
  2011-08-03 14:22     ` Peter Rolf
@ 2011-08-03 14:27       ` Procházka Lukáš Ing. - Pontex s. r. o.
  0 siblings, 0 replies; 6+ messages in thread
From: Procházka Lukáš Ing. - Pontex s. r. o. @ 2011-08-03 14:27 UTC (permalink / raw)
  To: mailing list for ConTeXt users

> http://www.tug.org/utilities/plain/cseq.html#time-rp
>
>
> this would also explain, why the seconds do not count :-)
>
>> Best regards,


OK, so it could be better e.g.:

----
\starttext
   \directlua{context.setuprandomize{os.time()}}
   ...
----

Best regards,

Lukas


-- 
Ing. Lukáš Procházka [mailto:LPr@pontex.cz]
Pontex s. r. o.      [mailto:pontex@pontex.cz] [http://www.pontex.cz]
Bezová 1658
147 14 Praha 4

Tel: +420 244 062 238
Fax: +420 244 461 038

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-08-03 14:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-03 13:19 METAFUN's randomized operator's seed Marcin Borkowski
2011-08-03 13:48 ` Peter Rolf
2011-08-03 14:07   ` Procházka Lukáš Ing. - Pontex s. r. o.
2011-08-03 14:22     ` Peter Rolf
2011-08-03 14:27       ` Procházka Lukáš Ing. - Pontex s. r. o.
2011-08-03 13:53 ` Aditya Mahajan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).