all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Brad Collins <brad@studiojungle.net>
Subject: Re: UUIDGEN in lisp
Date: Mon, 16 Feb 2004 20:47:17 +0700	[thread overview]
Message-ID: <wk8yj3w2ze.fsf@studiojungle.net> (raw)
In-Reply-To: <m3u11sdq8f.fsf@defun.localdomain> (Jesper Harder's message of "Sun, 15 Feb 2004 21:47:44 +0100")


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

  parent reply	other threads:[~2004-02-16 13:47 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.2374.1076727586.928.help-gnu-emacs@gnu.org>
2004-02-14  4:05 ` UUIDGEN in lisp Jesper Harder
2004-02-14 18:23   ` Brad Collins
     [not found]   ` <mailman.2398.1076783242.928.help-gnu-emacs@gnu.org>
2004-02-15  0:27     ` Jesper Harder
2004-02-15  4:16       ` Brad Collins
2004-02-15 16:05         ` Brad Collins
     [not found]       ` <mailman.2412.1076818749.928.help-gnu-emacs@gnu.org>
2004-02-15 20:47         ` Jesper Harder
2004-02-16 10:04           ` Eli Zaretskii
2004-02-16 13:47           ` Brad Collins [this message]
     [not found]           ` <mailman.2461.1076925909.928.help-gnu-emacs@gnu.org>
2004-02-16 16:30             ` Jesper Harder
2004-02-16 19:48               ` Eli Zaretskii
     [not found]               ` <mailman.2509.1076960950.928.help-gnu-emacs@gnu.org>
2004-02-16 21:05                 ` Jesper Harder
2004-02-17  6:46                   ` Eli Zaretskii
     [not found]                   ` <mailman.2546.1077000306.928.help-gnu-emacs@gnu.org>
2004-02-17 18:45                     ` Jesper Harder
2004-02-17 20:08                       ` Eli Zaretskii
     [not found]                       ` <mailman.2586.1077048551.928.help-gnu-emacs@gnu.org>
2004-02-17 21:21                         ` Jesper Harder
2004-02-18  6:34                           ` Eli Zaretskii
2004-02-19 16:57                         ` Stefan Monnier
     [not found]           ` <mailman.2471.1076940207.928.help-gnu-emacs@gnu.org>
2004-02-16 17:10             ` Jesper Harder
2004-02-14 18:54 ` Kai Grossjohann
2004-02-15  2:37   ` Felix
2004-02-14  2:57 Brad Collins

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=wk8yj3w2ze.fsf@studiojungle.net \
    --to=brad@studiojungle.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.