Hi,

Am Montag, den 22.03.2010, 21:06 +0100 schrieb Stephan Renatus:
> On Sun, Mar 21, 2010 at 11:27:19PM +0100, Joachim Breitner wrote:
> > 
> > What is the correct way to initialize the seed?
> > 
> I was wrong about that, xscreensaver must somehow already take care of this.
> (I tried adding "srandom(time(NULL))" to unicode_init() but there's an error
> indicating that this shouldn't be done inside the screensaver code for
> xscreensaver screensavers.)
> 
> Now I'm left completely puzzled as I do believe that there's something weird
> about the screensaver's randomness.  I spent quite some time watching it and
> some chars occoured way too often -- while using arc4random from above most
> chars I saw where unknown to be beforehand...
> 
> I tried a "modulo bias" workaround that was suggested here [1] using code
> from here [2] and tried to capture some data with minimal examples of both
> versions with the numbers from unicode-screensavers (max=3092 and 5121) and
> compared their histograms but I couldn't find anything significant there,
> what increases my confusion.
> 
> [1] http://stackoverflow.com/questions/648739/objective-c-modulo-bias
> [2] 
> http://stackoverflow.com/questions/1322510/bit-twiddling-find-next-power-of-two
> 
> Sorry for the noise in case there actually is no "objective" bug...
> Greetings,
> Stephan
> 
> PS: The workaround:

Thanks for your investigations! Just clarifying: You could not give hard
evidence what, if anything, is wrong with the current code, but the
patch you included did fix the impression of non-randomness you had? 

If that’s the case I can just apply this patch (which does not introduce
a dependency) and hope that we are done with this.

(Although I find it hard to believe that this can be the cause, given
that ya_random() is supposed to return something between 1 and
4294967295...)

Thanks,
Joachim
-- 
Joachim "nomeata" Breitner
Debian Developer
  nome...@debian.org | ICQ# 74513189 | GPG-Keyid: 4743206C
  JID: nome...@joachim-breitner.de | http://people.debian.org/~nomeata

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to