<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">If you are following trunk updates, yes. Otherwise you would have to wait for the next release.<div><br></div><div><span class="Apple-style-span" style="font-family: Helvetica; font-size: 12px; ">- Bert -</span></div><div><font class="Apple-style-span" face="Helvetica"><br></font><div><div>On 07.04.2011, at 14:20, michael rice wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><table cellspacing="0" cellpadding="0" border="0"><tbody><tr><td valign="top" style="font: inherit;">And I can acquire the new behavior by updating Squeak?<br><br>Michael<br><br>--- On <b>Thu, 4/7/11, Bert Freudenberg <i>&lt;<a href="mailto:bert@freudenbergs.de">bert@freudenbergs.de</a>&gt;</i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: Bert Freudenberg &lt;<a href="mailto:bert@freudenbergs.de">bert@freudenbergs.de</a>&gt;<br>Subject: Re: [Newbies] Randomness<br>To: "A friendly place to get answers to even the most basic questions about Squeak." &lt;<a href="mailto:beginners@lists.squeakfoundation.org">beginners@lists.squeakfoundation.org</a>&gt;<br>Date: Thursday, April 7, 2011, 6:19 AM<br><br><div id="yiv1571448901"><span class="yiv1571448901Apple-style-span" style="font-family: Helvetica; font-size: 12px;"><div><span class="yiv1571448901Apple-style-span" style="font-family: Helvetica; font-size: 12px;">The new behavior is that you get a different stream of random numbers each time you start the image. Or at least it's
 really really unlikely you get the same sequence again.&nbsp;</span></div><div><span class="yiv1571448901Apple-style-span" style="font-family: Helvetica; font-size: 12px;"><br></span></div>- Bert -</span><div><font class="yiv1571448901Apple-style-span" face="Helvetica"><br></font><div><div>On 07.04.2011, at 02:54, michael rice wrote:</div><br class="yiv1571448901Apple-interchange-newline"><blockquote type="cite"><table style="" border="0" cellpadding="0" cellspacing="0"><tbody><tr><td style="font: inherit;" valign="top">So it was a problem? The old behavior was: if I saved a project and quit the image without saving it, the next time I bought up the image and loaded the project I would get the same stream of random numbers. What is the new behavior?<br><br>Michael<br><br>--- On <b>Wed, 4/6/11, David T. Lewis <i>&lt;<a rel="nofollow" ymailto="mailto:lewis@mail.msen.com" target="_blank" href="x-msg://1774/mc/compose?to=lewis@mail.msen.com">lewis@mail.msen.com</a>&gt;</i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: David T. Lewis &lt;<a rel="nofollow" ymailto="mailto:lewis@mail.msen.com" target="_blank" href="x-msg://1774/mc/compose?to=lewis@mail.msen.com">lewis@mail.msen.com</a>&gt;<br>Subject: Re: [Newbies] Randomness<br>To: "A friendly place to get answers to even the most basic questions about Squeak." &lt;<a rel="nofollow" ymailto="mailto:beginners@lists.squeakfoundation.org" target="_blank" href="x-msg://1774/mc/compose?to=beginners@lists.squeakfoundation.org">beginners@lists.squeakfoundation.org</a>&gt;<br>Date: Wednesday, April 6, 2011, 8:35 PM<br><br><div class="yiv1571448901plainMail">I made the update in Squeak trunk similar to the Etoys image, but used<br>the existing seed generator in Random&gt;&gt;initialize on the
 theory that if<br>the generator is good enough for a new Random, it should be good enough<br>for an existing one too ;)<br><br>Michael, thanks for spotting the problem.<br><br>Dave<br><br>On Tue, Apr 05, 2011 at 01:16:31PM +0200, Bert Freudenberg wrote:<br>&gt; <br>&gt; On 05.04.2011, at 02:32, Levente Uzonyi wrote:<br>&gt; <br>&gt; &gt; On Mon, 4 Apr 2011, michael rice wrote:<br>&gt; &gt; <br>&gt; &gt;&gt; I forgot to mention, I'm using the random number tile and scripting. Does that make it more difficult?<br>&gt; &gt; <br>&gt; &gt; Not really, RandomNumberTile uses the global random number generator of Collection. I don't know how/why is it serialized/restored<br>&gt; <br>&gt; It is not stored in the project. But in trunk, the seed does not get re-initialized when starting up. In the Etoys image, Collection class has a startUp method<br>&gt; <br>&gt; startUp<br>&gt; &nbsp;&nbsp;&nbsp; RandomForPicking seed: Time totalSeconds hash asFloat.<br>&gt;
 <br>&gt; IMHO we should adopt something like this for trunk (maybe with your "more" random approach below). <br>&gt; <br>&gt; - Bert -<br>&gt; <br>&gt; &gt; but here's a method which should help:<br>&gt; &gt; <br>&gt; &gt; RandomNumberTile &gt;&gt; #comeFullyUpOnReload: smartRefStream<br>&gt; &gt; <br>&gt; &gt; &nbsp;&nbsp;&nbsp; | seed |<br>&gt; &gt; &nbsp;&nbsp;&nbsp; [<br>&gt; &gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; seed := (Time millisecondClockValue bitAnd: 16r3FFFFFFF) bitXor: self hash.<br>&gt; &gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; seed := seed bitXor: (Time totalSeconds bitAnd: 16r3FFFFFFF).<br>&gt; &gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; seed := seed bitXor: 16r3FFFFFFF atRandom.<br>&gt; &gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; seed = 0 ] whileTrue. "Try again if ever get a seed = 0"<br>&gt; &gt; &nbsp;&nbsp;&nbsp; Collection mutexForPicking critical: [<br>&gt; &gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Collection randomForPicking
 seed: seed ].<br>&gt; &gt; &nbsp;&nbsp;&nbsp; ^super comeFullyUpOnReload: smartRefStream<br>&gt; &gt; <br>&gt; &gt; It's drawback is that it will reseed the rng for every RandomNumberTile. The best solution would be if Etoys would use a custom Random instance or a subclass where this is done by default.<br>&gt; &gt; <br>&gt; &gt; <br>&gt; &gt; Levente<br>&gt; &gt; <br>&gt; &gt;&gt; <br>&gt; &gt;&gt; Michael<br>&gt; &gt;&gt; <br>&gt; &gt;&gt; --- On Mon, 4/4/11, Levente Uzonyi &lt;<a rel="nofollow">leves@elte.hu</a>&gt; wrote:<br>&gt; &gt;&gt; <br>&gt; &gt;&gt; From: Levente Uzonyi &lt;<a rel="nofollow">leves@elte.hu</a>&gt;<br>&gt; &gt;&gt; Subject: Re: [Newbies] Randomness<br>&gt; &gt;&gt; To: "A friendly place to get answers to even the most basic questions about Squeak." &lt;<a rel="nofollow">beginners@lists.squeakfoundation.org</a>&gt;<br>&gt; &gt;&gt; Date: Monday, April 4, 2011, 8:08 PM<br>&gt; &gt;&gt; <br>&gt; &gt;&gt; On Mon, 4 Apr 2011,
 michael rice wrote:<br>&gt; &gt;&gt; <br>&gt; &gt;&gt;&gt; I just noticed that when I load a morphic project I get the same stream of random numbers each time. Is there a simple way to install a new different random seed each time the project is loaded?<br>&gt; &gt;&gt; <br>&gt; &gt;&gt; If you serialize the Random object, then it will have the same state when it's restored. I guess you should create a subclass of Random, which implements #comeFullyUpOnReload:. That method can reinitialize the seed of the random number generator. You may want to check UUIDGenerator &gt;&gt; #makeSeed if you don't know how to get a good seed for your rng.<br>&gt; &gt;&gt; <br>&gt; &gt;&gt; <br>&gt; &gt;&gt; Levente<br>&gt;&nbsp;</div></blockquote></td></tr></tbody></table></blockquote></div><div>
<span class="yiv1571448901Apple-style-span" style="border-collapse: separate; border-spacing: 0px; color: rgb(0, 0, 0); font-family: Lucida Grande; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px;"><div style="font-family: Helvetica;"><br></div><br class="yiv1571448901Apple-interchange-newline"></span>
</div>
<br></div></div><br>-----Inline Attachment Follows-----<br></blockquote></td></tr></tbody></table></blockquote></div><div><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Lucida Grande; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="font-size: medium;"><br class="Apple-interchange-newline"></span></span>
</div>
<br></div></body></html>