Nicolas,<div>yes, if I compare with the Trunk I only get my changes,</div><div>but if I continue with step 5) I will end up with a saved version for the Trunk, not the Inbox, won&#39;t I?</div><div>(and be blocked [correctly] because I have no write access)</div>
<div><br></div><div>What&#39;s next?</div><div><br></div><div>Bye</div><div>Enrico</div><div><br><br><div class="gmail_quote">On Mon, Jan 25, 2010 at 12:06 PM, Nicolas Cellier <span dir="ltr">&lt;<a href="mailto:nicolas.cellier.aka.nice@gmail.com">nicolas.cellier.aka.nice@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">2010/1/25 Enrico Spinielli &lt;<a href="mailto:enrico.spinielli@googlemail.com">enrico.spinielli@googlemail.com</a>&gt;:<br>

<div class="im">&gt; Nicolas,<br>
&gt; Thanks.<br>
&gt; by the way why do I see &quot;dirty&quot; packages even if I did not touch them?<br>
&gt; For a little contribution I want to post<br>
&gt;<br>
&gt; HTTPSocket&gt;&gt;httpGetDocument:args:accept:request:<br>
&gt;<br>
&gt; I see hundreds of changes when I select &#39;Changes&#39; in Monticello Browser<br>
&gt; after step 4) below<br>
&gt; Thanks in advance for your feedback (and eventually sorry if the question is<br>
&gt; silly)<br>
&gt; Bye<br>
&gt; Enrico<br>
&gt;<br>
<br>
</div>Open a MC browser<br>
select a dirty package in left pane,<br>
select <a href="http://source.squeak.org/trunk" target="_blank">http://source.squeak.org/trunk</a> in right pane,<br>
press button changes<br>
<br>
You will get a list of changes between you image and latest trunk.<br>
<br>
Maybe some false positive occur sometimes (mark dirty but not really dirty)<br>
In my experience, running some tests tend to mark packages as dirty.<br>
&gt;From time to time, the update mechanism produces false positives too.<br>
Or you did a lot of work in you image...<br>
<br>
You should publish only relevant changes (revert the non relevant ones...)<br>
<font color="#888888"><br>
Nicolas<br>
</font><div><div></div><div class="h5"><br>
&gt; On Sun, Jan 24, 2010 at 4:10 PM, Nicolas Cellier<br>
&gt; &lt;<a href="mailto:nicolas.cellier.aka.nice@gmail.com">nicolas.cellier.aka.nice@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; 2010/1/24 Enrico Spinielli &lt;<a href="mailto:enrico.spinielli@googlemail.com">enrico.spinielli@googlemail.com</a>&gt;:<br>
&gt;&gt; &gt; No need to thank me, I just enjoyed to implement an algorithm in Squeak<br>
&gt;&gt; &gt; and<br>
&gt;&gt; &gt; signed for MIT license:<br>
&gt;&gt; &gt; so use/abuse/misuse/... freely.<br>
&gt;&gt; &gt; We all have to thank you and the others for looking after contributions<br>
&gt;&gt; &gt; and<br>
&gt;&gt; &gt; make them available<br>
&gt;&gt; &gt; in Trunk or images.<br>
&gt;&gt; &gt; I think that what Levente discovered from<br>
&gt;&gt; &gt; DigitalSignatureAlgorithm&gt;&gt;isProbablyPrime:<br>
&gt;&gt; &gt; is worth some thoughts in terms of cleanup and rationalisation...from<br>
&gt;&gt; &gt; the<br>
&gt;&gt; &gt; version info this<br>
&gt;&gt; &gt; piece of code seems to precede mine...and confirm the need of primality<br>
&gt;&gt; &gt; testing for encryption<br>
&gt;&gt; &gt; (hence big integers)<br>
&gt;&gt; &gt; Bye<br>
&gt;&gt; &gt; Enrico<br>
&gt;&gt; &gt; PS: I tried to see how to contribute, i.e. in the inbox but did not find<br>
&gt;&gt; &gt; too<br>
&gt;&gt; &gt; much of instructions<br>
&gt;&gt; &gt; (something in Squeak board blog but not too clear for me at least). Any<br>
&gt;&gt; &gt; suggestion? URL?<br>
&gt;&gt; &gt;<br>
&gt;&gt;<br>
&gt;&gt; The preferred way:<br>
&gt;&gt; 1) make your changes to the image<br>
&gt;&gt; 2) open a Monticello browser,<br>
&gt;&gt; 3) select one dirty packages in left pane (marked with *)<br>
&gt;&gt;   presumably, it&#39;s Kernel here.<br>
&gt;&gt; 4) select <a href="http://source.squeak.org/inbox" target="_blank">http://source.squeak.org/inbox</a> in right pane<br>
&gt;&gt; 5) press save button<br>
&gt;&gt; 6) repeat step 3 for each dirty package<br>
&gt;&gt; 7) post a message to this list indicating which set of .mcz solves which<br>
&gt;&gt; problem<br>
&gt;&gt;<br>
&gt;&gt; If <a href="http://source.squeak.org/inbox" target="_blank">http://source.squeak.org/inbox</a> does not appear for a specific package:<br>
&gt;&gt; a) unselect package in left pane<br>
&gt;&gt; b) select  <a href="http://source.squeak.org/inbox" target="_blank">http://source.squeak.org/inbox</a> in right pane<br>
&gt;&gt; c) choose pop up menu option &#39;add to package...&#39;<br>
&gt;&gt; d) go to step 3<br>
&gt;&gt;<br>
&gt;&gt; Hope I did not forget anything; maybe ask for a free beer to next<br>
&gt;&gt; Squeak smalltalk event ?<br>
&gt;&gt;<br>
&gt;&gt; cheers<br>
&gt;&gt;<br>
&gt;&gt; Nicolas<br>
&gt;&gt;<br>
&gt;&gt; &gt; On Sat, Jan 23, 2010 at 9:51 PM, David T. Lewis &lt;<a href="mailto:lewis@mail.msen.com">lewis@mail.msen.com</a>&gt;<br>
&gt;&gt; &gt; wrote:<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; To follow up on this discussion from last month, I updated Squeak trunk<br>
&gt;&gt; &gt;&gt; such that LargePositiveInteger uses the probabilistic algorithm for<br>
&gt;&gt; &gt;&gt; #isPrime, and added method comments to explain. A couple of folks<br>
&gt;&gt; &gt;&gt; suggested<br>
&gt;&gt; &gt;&gt; this change, and Enrico concurred.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; It turns out that SmallInteger maxVal is a reasonable point at which<br>
&gt;&gt; &gt;&gt; to switch from use of #isPrime to #isProbablyPrime. On my system before<br>
&gt;&gt; &gt;&gt; the change:<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;  count := 1000.<br>
&gt;&gt; &gt;&gt;  largeMin := SmallInteger maxVal + 1.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;  &quot;SmallInteger values up to maxVal&quot;<br>
&gt;&gt; &gt;&gt;  Time millisecondsToRun: [(SmallInteger maxVal - count to: SmallInteger<br>
&gt;&gt; &gt;&gt; maxVal) do: [:e | e isPrime]]. ==&gt; 120<br>
&gt;&gt; &gt;&gt;  Time millisecondsToRun: [(SmallInteger maxVal - count to: SmallInteger<br>
&gt;&gt; &gt;&gt; maxVal) do: [:e | e isProbablyPrime]]. ==&gt; 984<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;  &quot;LargePositiveInteger values just above SmallInteger maxVal&quot;<br>
&gt;&gt; &gt;&gt;  Time millisecondsToRun: [(largeMin to: largeMin + count) do: [:e | e<br>
&gt;&gt; &gt;&gt; isPrime]]. ==&gt; 6599<br>
&gt;&gt; &gt;&gt;  Time millisecondsToRun: [(largeMin to: largeMin + count) do: [:e | e<br>
&gt;&gt; &gt;&gt; isProbablyPrime]]. ==&gt; 714<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; After changing LargePositiveInteger&gt;&gt;isPrime, we have:<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;  &quot;LargePositiveInteger values just above SmallInteger maxVal&quot;<br>
&gt;&gt; &gt;&gt;  Time millisecondsToRun: [(largeMin to: largeMin + count) do: [:e | e<br>
&gt;&gt; &gt;&gt; isPrime]]. ==&gt; 719<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; So the implementation of LargePositiveInteger&gt;&gt;isPrime is now this:<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; isPrime<br>
&gt;&gt; &gt;&gt;        &quot;Answer true if the receiver is a prime number. Use a<br>
&gt;&gt; &gt;&gt; probabilistic<br>
&gt;&gt; &gt;&gt; implementation       that<br>
&gt;&gt; &gt;&gt;        is much faster for large integers, and that is correct to an<br>
&gt;&gt; &gt;&gt; extremely high statistical<br>
&gt;&gt; &gt;&gt;        level of confidence (effectively deterministic).&quot;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;        ^ self isProbablyPrime<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Thanks to Enrico for his patience ;-)<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Dave<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; On Sat Dec 19 13:58:16 UTC 2009, Enrico Spinielli wrote:<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; The original implementation is was has been renamed by ul to<br>
&gt;&gt; &gt;&gt; &gt; isProbablyPrime<br>
&gt;&gt; &gt;&gt; &gt; Note that the probability is according to Knuth&#39;s words<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; ...less than (1/4)^25 that such a 25-time-in-a-row procedure gives<br>
&gt;&gt; &gt;&gt; &gt; the<br>
&gt;&gt; &gt;&gt; &gt; wrong<br>
&gt;&gt; &gt;&gt; &gt; information about its input. This is less than one chance in a<br>
&gt;&gt; &gt;&gt; &gt; quadrillion;<br>
&gt;&gt; &gt;&gt; &gt; [...]<br>
&gt;&gt; &gt;&gt; &gt; It&#39;s much more likely that our computer has dropped a bit in its<br>
&gt;&gt; &gt;&gt; &gt; calculations,<br>
&gt;&gt; &gt;&gt; &gt; due to hardware malfunctions or cosmic radiation, than that Algorithm<br>
&gt;&gt; &gt;&gt; &gt; P<br>
&gt;&gt; &gt;&gt; &gt; has<br>
&gt;&gt; &gt;&gt; &gt; repeatedly guessed wrong!<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; So &#39;probabilistic&#39; in this case is very much deterministic!<br>
&gt;&gt; &gt;&gt; &gt; For accessible rationale about the algoritm (and a non probabilistic<br>
&gt;&gt; &gt;&gt; &gt; better<br>
&gt;&gt; &gt;&gt; &gt; one as well)<br>
&gt;&gt; &gt;&gt; &gt; you can also see &quot;1.2.6 Example: Testing for<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; Primality&lt;<a href="http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-11.html#%_sec_1.2.6" target="_blank">http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-11.html#%_sec_1.2.6</a>&gt;&quot;<br>

&gt;&gt; &gt;&gt; &gt; in SICP.<br>
&gt;&gt; &gt;&gt; &gt; A possible improvement could have been to keep a list of the first N<br>
&gt;&gt; &gt;&gt; &gt; prime numbers (i.e. N=1000 or whatever integrer where gain in<br>
&gt;&gt; &gt;&gt; &gt; performance<br>
&gt;&gt; &gt;&gt; &gt; and or memory) and resort to the probabilistic test if self<br>
&gt;&gt; &gt;&gt; &gt; is greater than the bigger in the list.<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; The value of original algorithm is all research and reasoning that<br>
&gt;&gt; &gt;&gt; &gt; went<br>
&gt;&gt; &gt;&gt; &gt; into<br>
&gt;&gt; &gt;&gt; &gt; it from<br>
&gt;&gt; &gt;&gt; &gt; Knuth et al. (note the order of growth is log(n), where n is the<br>
&gt;&gt; &gt;&gt; &gt; integer<br>
&gt;&gt; &gt;&gt; &gt; under scrutiny)<br>
&gt;&gt; &gt;&gt; &gt; The problem with the new implementation is that it goes thru testing<br>
&gt;&gt; &gt;&gt; &gt; numbers<br>
&gt;&gt; &gt;&gt; &gt; which are<br>
&gt;&gt; &gt;&gt; &gt; clearly not prime, 5, 15, 25, 35...just to mention multiples of 5.<br>
&gt;&gt; &gt;&gt; &gt; It can possibly be faster for small integers hence the above possible<br>
&gt;&gt; &gt;&gt; &gt; improvement suggestion...but for the rest it should be thrown away<br>
&gt;&gt; &gt;&gt; &gt; IMHO.<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; Primality testing is very important for modern electronic<br>
&gt;&gt; &gt;&gt; &gt; communications,<br>
&gt;&gt; &gt;&gt; &gt; i.e. encryption<br>
&gt;&gt; &gt;&gt; &gt; and as such it has to be reliable and performant for big integers.<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; Hope this clarifies<br>
&gt;&gt; &gt;&gt; &gt; Bye<br>
&gt;&gt; &gt;&gt; &gt; Enrico<br>
&gt;&gt; &gt;&gt; &gt; PS: the comment in the code was explicit enough to allow to research<br>
&gt;&gt; &gt;&gt; &gt; for<br>
&gt;&gt; &gt;&gt; &gt;       the rationale about the algorithm...we should not fix what<br>
&gt;&gt; &gt;&gt; &gt; works<br>
&gt;&gt; &gt;&gt; &gt; (well)<br>
&gt;&gt; &gt;&gt; &gt;       there are so many other fixes waiting...<br>
&gt;&gt; &gt;&gt; &gt; On Sat, Dec 19, 2009 at 12:56 AM, David T. Lewis &lt;lewis at<br>
&gt;&gt; &gt;&gt; &gt; <a href="http://mail.msen.com" target="_blank">mail.msen.com</a>&gt;wrote:<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; &gt; On Fri, Dec 18, 2009 at 05:25:45PM +0100, Enrico Spinielli wrote:<br>
&gt;&gt; &gt;&gt; &gt; &gt; &gt; Hi all,<br>
&gt;&gt; &gt;&gt; &gt; &gt; &gt; I am back to checking Squeak after quite a while and got latest<br>
&gt;&gt; &gt;&gt; &gt; &gt; &gt; trunk.<br>
&gt;&gt; &gt;&gt; &gt; &gt; &gt; I looked after one of my contributions Integer&gt;&gt;isPrime<br>
&gt;&gt; &gt;&gt; &gt; &gt; &gt; and I found my implementation of Algorithm P from Knuth&#39;s AOCP<br>
&gt;&gt; &gt;&gt; &gt; &gt; &gt; vol 2<br>
&gt;&gt; &gt;&gt; &gt; &gt; &gt; substituted by an iteration of dividing self by all even numbers<br>
&gt;&gt; &gt;&gt; &gt; &gt; &gt; starting<br>
&gt;&gt; &gt;&gt; &gt; &gt; &gt; from 3<br>
&gt;&gt; &gt;&gt; &gt; &gt; &gt; and (correctly) stopping at self sqrtFloor.<br>
&gt;&gt; &gt;&gt; &gt; &gt; &gt; This is IMHO a questionable/useless &quot;improvement&quot;, not even<br>
&gt;&gt; &gt;&gt; &gt; &gt; &gt; looking<br>
&gt;&gt; &gt;&gt; &gt; &gt; &gt; to<br>
&gt;&gt; &gt;&gt; &gt; &gt; try<br>
&gt;&gt; &gt;&gt; &gt; &gt; &gt; to implement the Sieve of Eratostene...!<br>
&gt;&gt; &gt;&gt; &gt; &gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; &gt; &gt; Again IMHO isPrime should be reverted back to what has been<br>
&gt;&gt; &gt;&gt; &gt; &gt; &gt; renamed<br>
&gt;&gt; &gt;&gt; &gt; &gt; &gt; isProbablyPrime<br>
&gt;&gt; &gt;&gt; &gt; &gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; &gt; &gt; Not being anymore used to contribute I just signal it here...<br>
&gt;&gt; &gt;&gt; &gt; &gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; &gt; &gt; Hope it helps<br>
&gt;&gt; &gt;&gt; &gt; &gt; &gt; Bye<br>
&gt;&gt; &gt;&gt; &gt; &gt; &gt; --<br>
&gt;&gt; &gt;&gt; &gt; &gt; &gt; Enrico Spinielli<br>
&gt;&gt; &gt;&gt; &gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; &gt; Enrico,<br>
&gt;&gt; &gt;&gt; &gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; &gt; Is this your original implementation?<br>
&gt;&gt; &gt;&gt; &gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; &gt;   isPrime<br>
&gt;&gt; &gt;&gt; &gt; &gt;        &quot;See isProbablyPrimeWithK:andQ: for the algoritm<br>
&gt;&gt; &gt;&gt; &gt; &gt; description.&quot;<br>
&gt;&gt; &gt;&gt; &gt; &gt;        | k q |<br>
&gt;&gt; &gt;&gt; &gt; &gt;        self &lt;= 1 ifTrue: [^self error: &#39;operation undefined&#39;].<br>
&gt;&gt; &gt;&gt; &gt; &gt;        self even ifTrue: [^self = 2].<br>
&gt;&gt; &gt;&gt; &gt; &gt;        k := 1.<br>
&gt;&gt; &gt;&gt; &gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; &gt;        q := self - 1 bitShift: -1.<br>
&gt;&gt; &gt;&gt; &gt; &gt;        [q odd] whileFalse:<br>
&gt;&gt; &gt;&gt; &gt; &gt;                        [q := q bitShift: -1.<br>
&gt;&gt; &gt;&gt; &gt; &gt;                        k := k + 1].<br>
&gt;&gt; &gt;&gt; &gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; &gt;        25 timesRepeat: [(self isProbablyPrimeWithK: k andQ: q)<br>
&gt;&gt; &gt;&gt; &gt; &gt; ifFalse:<br>
&gt;&gt; &gt;&gt; &gt; &gt; [^false]].<br>
&gt;&gt; &gt;&gt; &gt; &gt;        ^true<br>
&gt;&gt; &gt;&gt; &gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; &gt; It was recently changed as follows:<br>
&gt;&gt; &gt;&gt; &gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; &gt; &gt; Name: Kernel-ul.305<br>
&gt;&gt; &gt;&gt; &gt; &gt; &gt; Author: ul<br>
&gt;&gt; &gt;&gt; &gt; &gt; &gt; Time: 25 November 2009, 2:55:43.339 am<br>
&gt;&gt; &gt;&gt; &gt; &gt; &gt; UUID: a95be01c-d87c-154b-bdc6-c582dafad80b<br>
&gt;&gt; &gt;&gt; &gt; &gt; &gt; Ancestors: Kernel-nice.304<br>
&gt;&gt; &gt;&gt; &gt; &gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; &gt; &gt; - added Integer &gt;&gt; #sqrtFloor, which returns the floor of the<br>
&gt;&gt; &gt;&gt; &gt; &gt; &gt; square<br>
&gt;&gt; &gt;&gt; &gt; &gt; &gt; root<br>
&gt;&gt; &gt;&gt; &gt; &gt; of the receiver.<br>
&gt;&gt; &gt;&gt; &gt; &gt; &gt; - renamed Integer &gt;&gt; #isPrime to #isProbablyPrime.<br>
&gt;&gt; &gt;&gt; &gt; &gt; &gt; - added Integer &gt;&gt; #isPrime which is implemented as a<br>
&gt;&gt; &gt;&gt; &gt; &gt; &gt; deterministic<br>
&gt;&gt; &gt;&gt; &gt; &gt; primality test<br>
&gt;&gt; &gt;&gt; &gt; &gt; &gt; - both #isPrime and #isProbablyPrime return false for receivers<br>
&gt;&gt; &gt;&gt; &gt; &gt; &gt; &lt;= 1<br>
&gt;&gt; &gt;&gt; &gt; &gt; instead of raising an error<br>
&gt;&gt; &gt;&gt; &gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; &gt; Is this a reasonable change?<br>
&gt;&gt; &gt;&gt; &gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; &gt; Dave<br>
&gt;&gt; &gt;&gt; &gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; --<br>
&gt;&gt; &gt; Enrico Spinielli<br>
&gt;&gt; &gt; &quot;Do Androids dream of electric sheep?&quot;— Philip K. Dick<br>
&gt;&gt; &gt; &quot;Hear and forget; see and remember;do and understand.&quot;—Mitchel Resnick<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Enrico Spinielli<br>
&gt; &quot;Do Androids dream of electric sheep?&quot;— Philip K. Dick<br>
&gt; &quot;Hear and forget; see and remember;do and understand.&quot;—Mitchel Resnick<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Enrico Spinielli<br>&quot;Do Androids dream of electric sheep?&quot;— Philip K. Dick<br>&quot;Hear and forget; see and remember;do and understand.&quot;—Mitchel Resnick<br>

</div>