From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.help Subject: Re: numerical analysis Date: Fri, 30 Jul 2004 11:05:10 -0600 Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <410A7FC6.9000808@yahoo.com> References: <10gjdus6ip76h85@corp.supernews.com> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1091207222 13049 80.91.224.253 (30 Jul 2004 17:07:02 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 30 Jul 2004 17:07:02 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jul 30 19:06:53 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BqaqL-0002VU-00 for ; Fri, 30 Jul 2004 19:06:53 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Bqata-0000DN-Qm for geh-help-gnu-emacs@m.gmane.org; Fri, 30 Jul 2004 13:10:14 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!newsmi-us.news.garr.it!newsmi-eu.news.garr.it!NewsITBone-GARR!fu-berlin.de!uni-berlin.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 36 Original-X-Trace: news.uni-berlin.de 8QZnTksE0pspF/Kxmr1ldAsplYxU+CRDaHRH/Y+G2xJ+Nj1j0= User-Agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2 X-Accept-Language: en-us Original-Xref: shelby.stanford.edu gnu.emacs.help:124558 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 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:19893 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:19893 Edward Casey wrote: > This code fragment produces somewhat pseudo-random powerball numbers: > > (progn > (random t) > (setq lis6 nil) > (while (< (length lis6) 5) > ;; (setq cm (+ (mod (* (nth 1 (current-time))(/ (nth 2 > (current-time)) 10000)(random)) 52) 1)) > ;; (random t) > (setq cm (+ (random 52) 1)) > (if (not (member cm lis6)) (setq lis6 (cons cm lis6))) > ) > (setq lis6 (sort lis6 '>)) > (random t) > (setq cm (+ (random 41) 1)) > (setq lis6 (cons cm lis6)) > (reverse lis6) > ) > > The commented-out lines don't seem to work in a loop. Is there some > way I could mix this up some more to get closer to true randomness? Why do you (re)set the random number seed more than once? In what way does the (setq cm ...) form not work? > In emacs lisp is it possible to open an arbitrary file (say a > compressed graphic file of white noise) and to advance the file > pointer by 8-bit increments? Use find-file-literally or insert-file-contents-literally, then forward-char. -- Kevin Rodgers