From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/79211 Path: news.gmane.org!not-for-mail From: Peter Rolf Newsgroups: gmane.comp.tex.context Subject: Re: random seed Date: Wed, 14 Nov 2012 21:15:11 +0100 Message-ID: <50A3FBCF.8050905@gmx.net> References: <50A3E91A.5010009@gmx.net> <50A3EF1A.8010405@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1352924127 8931 80.91.229.3 (14 Nov 2012 20:15:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 14 Nov 2012 20:15:27 +0000 (UTC) Cc: mailing list for ConTeXt users To: Hans Hagen Original-X-From: ntg-context-bounces@ntg.nl Wed Nov 14 21:15:38 2012 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TYjMw-0008Dc-VW for gctc-ntg-context-518@m.gmane.org; Wed, 14 Nov 2012 21:15:31 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id BB67D102A5; Wed, 14 Nov 2012 21:15:20 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id oImZkpKxUqJ6; Wed, 14 Nov 2012 21:15:18 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id F10C91028A; Wed, 14 Nov 2012 21:15:17 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 3FD1D1028A for ; Wed, 14 Nov 2012 21:15:16 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id NAx1iTUM4pIR for ; Wed, 14 Nov 2012 21:15:15 +0100 (CET) Original-Received: from filter3-til.mf.surf.net (filter3-til.mf.surf.net [194.171.167.219]) by balder.ntg.nl (Postfix) with ESMTP id 3269610281 for ; Wed, 14 Nov 2012 21:15:14 +0100 (CET) Original-Received: from mailout-de.gmx.net (mailout-de.gmx.net [213.165.64.23]) by filter3-til.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with SMTP id qAEKFDGv019419 for ; Wed, 14 Nov 2012 21:15:14 +0100 Original-Received: (qmail invoked by alias); 14 Nov 2012 20:15:13 -0000 Original-Received: from ip-88-153-133-252.unitymediagroup.de (EHLO [192.168.178.3]) [88.153.133.252] by mail.gmx.net (mp017) with SMTP; 14 Nov 2012 21:15:13 +0100 X-Authenticated: #24293357 X-Provags-ID: V01U2FsdGVkX1/vcCMTpK7vjAKAM9Rtm9tJeIrSB/+Yeyq+eOqiY/ mAJ3nI1yMgrHjp User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 In-Reply-To: <50A3EF1A.8010405@wxs.nl> X-Enigmail-Version: 1.4.5 X-Y-GMX-Trusted: 0 X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=213.165.64.23; country=DE; latitude=51.0000; longitude=9.0000; http://maps.google.com/maps?q=51.0000,9.0000&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 06InwfeaS - 6daffaaa706d - 20121114 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.219 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:79211 Archived-At: Am 14.11.2012 20:20, schrieb Hans Hagen: > On 11/14/2012 7:55 PM, Peter Rolf wrote: >> Hi, >> >> in one of my documents I use a specific random seed to create a fixed >> random based graphic (size, color, position). This works fine under >> Windows (where I 'found' the seed value), but I get a complete different >> result on my Debian system. >> >> Is there a way to get identical results on different OS? Or is the >> random number generator OS specific? Just wondering... > > yes and it cannot be trusted either (some underlying os code is used); i > also found out that you need to call a couple of random's in a row first > to get at least not the same ones in the beginning > > in contetx I've now settled on: > > math.initialseed = > tonumber(string.sub(string.reverse(tostring(ceil(socket and > socket.gettime()*10000 or time()))),1,6)) > > Thanks for the info. The formula looks like an incantation for the god of random numbers ;-) I already migrated the tex code to lua, so that I can do some post processing on the collected random based data. To get identical results, I only have to save the final data set then. ___________________________________________________________________________________ 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 ___________________________________________________________________________________