From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/57942 Path: news.gmane.org!not-for-mail From: Arthur Reutenauer Newsgroups: gmane.comp.tex.context Subject: Re: randomize Date: Wed, 7 Apr 2010 13:05:33 +0200 Message-ID: <20100407110533.GA28601@phare.normalesup.org> References: <4BBC81EC.26955.5DF4DB@wwl.musensturm.de> Reply-To: Mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1270638350 3418 80.91.229.12 (7 Apr 2010 11:05:50 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 7 Apr 2010 11:05:50 +0000 (UTC) To: Mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Wed Apr 07 13:05:49 2010 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1NzT4v-0004lP-LY for gctc-ntg-context-518@m.gmane.org; Wed, 07 Apr 2010 13:05:49 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 2C4CAC9CB3; Wed, 7 Apr 2010 13:05:49 +0200 (CEST) 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 yLFDBii+gnxP; Wed, 7 Apr 2010 13:05:46 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 67504C9CE1; Wed, 7 Apr 2010 13:05:46 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 1970CC9CE1 for ; Wed, 7 Apr 2010 13:05:45 +0200 (CEST) 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 HIVBu7ajpP2W for ; Wed, 7 Apr 2010 13:05:33 +0200 (CEST) Original-Received: from nef2.ens.fr (nef2.ens.fr [129.199.96.40]) by balder.ntg.nl (Postfix) with ESMTP id E3B5DC9CB3 for ; Wed, 7 Apr 2010 13:05:33 +0200 (CEST) Original-Received: from phare.normalesup.org (phare.normalesup.org [129.199.129.80]) by nef2.ens.fr (8.13.6/1.01.28121999) with ESMTP id o37B5XXm003375 for ; Wed, 7 Apr 2010 13:05:33 +0200 (CEST) X-Envelope-To: Original-Received: by phare.normalesup.org (Postfix, from userid 1008) id 1A958BC0B5; Wed, 7 Apr 2010 13:05:33 +0200 (CEST) Content-Disposition: inline In-Reply-To: <4BBC81EC.26955.5DF4DB@wwl.musensturm.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.1.4 (nef2.ens.fr [129.199.96.32]); Wed, 07 Apr 2010 13:05:33 +0200 (CEST) X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:57942 Archived-At: > Now it works. But WHY? Because that's the way random number generators works. They're not random at all, they generate completely predictable number sequences from a "seed": each time you use the same seed, you get the exact same sequence. In your case, you used os.time() as a seed, which is an integral number of seconds elapsed since some fixed date, and the fact you saw the same number ten times simply means your code was ran ten times within the same second. Arthur ___________________________________________________________________________________ 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 ___________________________________________________________________________________