From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Brad Collins Newsgroups: gmane.emacs.help Subject: Re: UUIDGEN in lisp Date: Mon, 16 Feb 2004 20:47:17 +0700 Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1076940493 8519 80.91.224.253 (16 Feb 2004 14:08:13 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 16 Feb 2004 14:08:13 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Feb 16 15:07:58 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AsjPi-0003DM-00 for ; Mon, 16 Feb 2004 15:07:58 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AsjOg-0004sP-Sv for geh-help-gnu-emacs@m.gmane.org; Mon, 16 Feb 2004 09:06:54 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AsjJj-0003qI-AP for help-gnu-emacs@gnu.org; Mon, 16 Feb 2004 09:01:47 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AsjBo-0001mg-Oh for help-gnu-emacs@gnu.org; Mon, 16 Feb 2004 08:54:07 -0500 Original-Received: from [203.146.30.109] (helo=mailgw.cscoms.com) by monty-python.gnu.org with esmtp (Exim 4.24) id 1Asj7c-0000md-BX for help-gnu-emacs@gnu.org; Mon, 16 Feb 2004 08:49:16 -0500 Original-Received: from cscoms.com (mail.cscoms.com [203.146.30.108]) by mailgw.cscoms.com (8.12.8p2/8.12.3) with ESMTP id i1GDn7xt061402 for ; Mon, 16 Feb 2004 20:49:09 +0700 (ICT) Original-Received: from KAME.cscoms.com (dial-115.ras-1.bkk.c.cscoms.com [202.183.157.115]) by cscoms.com (8.12.8p2/8.12.3) with ESMTP id i1GDn4iM024084 for ; Mon, 16 Feb 2004 20:49:07 +0700 (GMT) Original-To: help-gnu-emacs In-Reply-To: (Jesper Harder's message of "Sun, 15 Feb 2004 21:47:44 +0100") User-Agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (windows-nt) X-Virus-Scanned: by amavisd-milter (http://amavis.org/) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:16896 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:16896 Fantastic! Just as you said, moving (random t) outside the function allows you to generate as many as you please. This is very helpful for assigning ids to a large list of items at the same time. I don't know how many you can assign at the same time (the spec says 10 million a unique ids in a second per machine). I wouldn't want to put this little script to any test that big, but I would think it should be okay for assigning a couple hundred or even a couple thousand items at a time in a replace funcion.... Last question -- promise :) I've looked this up in the elisp manual but don't really understand what is going on. I noticed in the original script that the third field always would begin with the number four. I started changing things around and found if I changed the following, (logior #B01000000 (logand #B11111111 (nth 7 bytes)))) ^^^^^^ the numbers would be begin looking random again. What does `logior' and `logand' actually do in the script and what does the string #B01000000 mean? And how should they be set in this script? The manual completely lost me. Sorry to keep bugging you like this but I like to understand how things work.... BTW I've been Googling to see how good /dev/random and /dev/urandom are on cygwin. A number of people seem to have asked the same question and it sounds like it's good enough for most purposes.... Thanks, b/ -- Brad Collins Chenla Labs www.chenla.org Bangkok, Thailand