Re: [Pharo-dev] Bad layoutFrame>>#hash

2016-01-21 Thread stepharo
ro-dev@lists.pharo.org Subject: Re: [Pharo-dev] Bad layoutFrame>>#hash On 13-01-16 18:38, David Allouche wrote: Why did you use a single expression instead of using a temporary variable? I find it harder to understand. I did find it very slightly easier to understand. It is not a strong opin

Re: [Pharo-dev] Bad layoutFrame>>#hash

2016-01-21 Thread Ben Coman
egards, > Henrik > > -Original Message- > From: Pharo-dev [mailto:pharo-dev-boun...@lists.pharo.org] On Behalf Of > Stephan Eggermont > Sent: Wednesday, January 13, 2016 8:34 PM > To: pharo-dev@lists.pharo.org > Subject: Re: [Pharo-dev] Bad layoutFrame>>#hash > &g

Re: [Pharo-dev] Bad layoutFrame>>#hash

2016-01-21 Thread Henrik Nergaard
^hash := (hash + anObject hash) hashMultiply Best regards, Henrik -Original Message- From: Pharo-dev [mailto:pharo-dev-boun...@lists.pharo.org] On Behalf Of Stephan Eggermont Sent: Wednesday, January 13, 2016 8:34 PM To: pharo-dev@lists.pharo.org Subject: Re: [Pharo-dev] Bad layoutFrame>&

Re: [Pharo-dev] Bad layoutFrame>>#hash

2016-01-14 Thread stepharo
I hope that will not upset Stef too much ;-) No do not worry! We finished to shot the first lectures of the mooc. Now we should go over the environment and this is also a difficult and tedious job. Stef

Re: [Pharo-dev] Bad layoutFrame>>#hash

2016-01-14 Thread stepharo
Le 13/1/16 22:45, David Allouche a écrit : On 13 Jan 2016, at 20:32, stepharo wrote: Hi david I would like to turn your post into a chapter for a forthcoming book so that people can read and get the idea. Yes I would be glad :-) Please just remember to credit the author. Always Is ther

Re: [Pharo-dev] Bad layoutFrame>>#hash

2016-01-14 Thread David Allouche
> On 14 Jan 2016, at 13:31, David Allouche wrote: > >> >> On 14 Jan 2016, at 01:55, Ben Coman wrote: >> >> On Thu, Jan 14, 2016 at 5:45 AM, David Allouche wrote: >>> On 13 Jan 2016, at 20:32, stepharo wrote: Hi david I would like to turn your post into a chapter f

Re: [Pharo-dev] Bad layoutFrame>>#hash

2016-01-14 Thread David Allouche
> On 14 Jan 2016, at 01:55, Ben Coman wrote: > > On Thu, Jan 14, 2016 at 5:45 AM, David Allouche wrote: >> >>> On 13 Jan 2016, at 20:32, stepharo wrote: >>> >>> Hi david >>> >>> I would like to turn your post into a chapter for a forthcoming book so >>> that people can read and get the ide

Re: [Pharo-dev] Bad layoutFrame>>#hash

2016-01-13 Thread Ben Coman
On Thu, Jan 14, 2016 at 5:45 AM, David Allouche wrote: > >> On 13 Jan 2016, at 20:32, stepharo wrote: >> >> Hi david >> >> I would like to turn your post into a chapter for a forthcoming book so that >> people can read and get the idea. > > Yes I would be glad :-) Please just remember to credit

Re: [Pharo-dev] Bad layoutFrame>>#hash

2016-01-13 Thread David Allouche
> On 13 Jan 2016, at 20:32, stepharo wrote: > > Hi david > > I would like to turn your post into a chapter for a forthcoming book so that > people can read and get the idea. Yes I would be glad :-) Please just remember to credit the author. Is there a recommended license for Pharo documenta

Re: [Pharo-dev] Bad layoutFrame>>#hash

2016-01-13 Thread Nicolas Cellier
2016-01-13 20:34 GMT+01:00 stepharo : > Nicolas > > two questions: > - should we integrate your float changes in Pharo? > - I would like to get a chapter explaining the points raised by david, > would you like to review it? > > Stef > > 1) yes, that's low hanging fruits if you have a good

Re: [Pharo-dev] Bad layoutFrame>>#hash

2016-01-13 Thread Nicolas Cellier
2016-01-13 19:55 GMT+01:00 David Allouche : > > On 13 Jan 2016, at 19:31, Nicolas Cellier < > nicolas.cellier.aka.n...@gmail.com> wrote: > > Note that Squeak has reduced the number of collisions for floats by not > erasing the most significant bits of each word. > I've tested the squeak implementa

Re: [Pharo-dev] Bad layoutFrame>>#hash

2016-01-13 Thread stepharo
Nicolas two questions: - should we integrate your float changes in Pharo? - I would like to get a chapter explaining the points raised by david, would you like to review it? Stef Le 13/1/16 19:31, Nicolas Cellier a écrit : 2016-01-13 17:22 GMT+01:00 David Allouche

Re: [Pharo-dev] Bad layoutFrame>>#hash

2016-01-13 Thread Stephan Eggermont
On 13-01-16 18:38, David Allouche wrote: Why did you use a single expression instead of using a temporary variable? I find it harder to understand. I did find it very slightly easier to understand. It is not a strong opinion however. The ideomatic smalltalk would be ^#(leftFraction leftOff

Re: [Pharo-dev] Bad layoutFrame>>#hash

2016-01-13 Thread stepharo
Hi david I would like to turn your post into a chapter for a forthcoming book so that people can read and get the idea. I did not think about the same object. Is it ok for you? Stef PS: May be this was obviosu for you that we should all get this out of your previous mail but it was not my ca

Re: [Pharo-dev] Bad layoutFrame>>#hash

2016-01-13 Thread stepharo
Thanks for your post it was really nice. I am sure you could have figured that by yourself, If I asked this is that I could not. And I read the book on hash numbers. by thinking about how hash values are used and by looking at the code of kernel classes, instead of getting offended and turnin

Re: [Pharo-dev] Bad layoutFrame>>#hash

2016-01-13 Thread David Allouche
> On 13 Jan 2016, at 19:31, Nicolas Cellier > wrote: > > Note that Squeak has reduced the number of collisions for floats by not > erasing the most significant bits of each word. > I've tested the squeak implementation with Andres Valloud tool in VW, it does > not perform so bad for the sets

Re: [Pharo-dev] Bad layoutFrame>>#hash

2016-01-13 Thread Nicolas Cellier
2016-01-13 17:22 GMT+01:00 David Allouche : > > On 12 Jan 2016, at 20:59, stepharo wrote: > > Hi david > > I rad the wikipedia page you mention and this looks a bit obvious to me. I > knew this. > now it does not really help fixing the problem you mention. > > Stef > > > Since you asked for it… >

Re: [Pharo-dev] Bad layoutFrame>>#hash

2016-01-13 Thread David Allouche
> On 13 Jan 2016, at 18:09, Stephan Eggermont wrote: > > Name: > SLICE-Issue-17363-LayoutFrame-fractions-0--0-corner-1--1--LayoutFrame-identity-should-be-true-and-it-is-not-StephanEggermont.2 > Author: StephanEggermont > Time: 13 January 2016, 6:06:01.571074 pm > UUID: 9a5e9ae3-1357-4bfb-921a-3

Re: [Pharo-dev] Bad layoutFrame>>#hash

2016-01-13 Thread Stephan Eggermont
Name: SLICE-Issue-17363-LayoutFrame-fractions-0--0-corner-1--1--LayoutFrame-identity-should-be-true-and-it-is-not-StephanEggermont.2 Author: StephanEggermont Time: 13 January 2016, 6:06:01.571074 pm UUID: 9a5e9ae3-1357-4bfb-921a-3762d57402fd Ancestors: Dependencies: Morphic-Base-StephanEggermont.

Re: [Pharo-dev] Bad layoutFrame>>#hash

2016-01-13 Thread David Allouche
> On 12 Jan 2016, at 20:59, stepharo wrote: > > Hi david > > I rad the wikipedia page you mention and this looks a bit obvious to me. I > knew this. > now it does not really help fixing the problem you mention. > > Stef Since you asked for it… The #hash method is used in Pharo to separate o

Re: [Pharo-dev] Bad layoutFrame>>#hash

2016-01-12 Thread stepharo
Hi david I rad the wikipedia page you mention and this looks a bit obvious to me. I knew this. now it does not really help fixing the problem you mention. Stef Le 11/1/16 10:09, David Allouche a écrit : Since it's not obvious why xor-ing is a bad way to produce hash, here is a link that giv

Re: [Pharo-dev] Bad layoutFrame>>#hash

2016-01-12 Thread stepharo
Ok but be concrete. What will be the solution for this particular case? Stef Le 11/1/16 22:30, Nicolas Cellier a écrit : Yep, a must read if you want to improve the hash methods. 2016-01-11 10:09 GMT+01:00 Sven Van Caekenberghe >: David, > On 11 Jan 2016, at 10:

Re: [Pharo-dev] Bad layoutFrame>>#hash

2016-01-12 Thread stepharo
You see K. Beck in his book smalltalk best pratices promotes this form. So can you propose a better solution so that we learn? Stef Le 11/1/16 10:09, David Allouche a écrit : Since it's not obvious why xor-ing is a bad way to produce hash, here is a link that gives some background https://en.

Re: [Pharo-dev] Bad layoutFrame>>#hash

2016-01-11 Thread Nicolas Cellier
Yep, a must read if you want to improve the hash methods. 2016-01-11 10:09 GMT+01:00 Sven Van Caekenberghe : > David, > > > On 11 Jan 2016, at 10:01, David Allouche wrote: > > > > I happened to look at the new code for LayoutFrame>>#hash > > > > hash > > ^self species hash bitXor: > >

Re: [Pharo-dev] Bad layoutFrame>>#hash

2016-01-11 Thread Sven Van Caekenberghe
David, > On 11 Jan 2016, at 10:01, David Allouche wrote: > > I happened to look at the new code for LayoutFrame>>#hash > > hash > ^self species hash bitXor: > (self leftFraction bitXor: > (self leftOffset bitXor: > (self topFraction bitXor: >

Re: [Pharo-dev] Bad layoutFrame>>#hash

2016-01-11 Thread David Allouche
Since it's not obvious why xor-ing is a bad way to produce hash, here is a link that gives some background https://en.wikipedia.org/wiki/Hash_function#Uniformity > On 11 Jan 2016, at 10:01, David Allouche wrote: > > I happened to look at the new code for LayoutFrame>>#hash > > hash > ^s

[Pharo-dev] Bad layoutFrame>>#hash

2016-01-11 Thread David Allouche
I happened to look at the new code for LayoutFrame>>#hash hash ^self species hash bitXor: (self leftFraction bitXor: (self leftOffset bitXor: (self topFraction bitXor: (self topOffset bitXor: (self rightFra