commits | 19 Jun 2013 01:55
Favicon

Daily Commit Log

Changes to Trunk (http://source.squeak.org/trunk.html) in the last 24 hours:

http://lists.squeakfoundation.org/pipermail/packages/2013-June/006059.html

Name: Tools-nice.472
Ancestors: Tools-eem.471

Why making one UI request to UIManager default and the other to Utilities?
Let's make the two  requests to UIManager default.

=============================================

http://lists.squeakfoundation.org/pipermail/packages/2013-June/006060.html

Name: Multilingual-nice.161
Ancestors: Multilingual-nice.160

Invoke Character escape by name rather than by value.

=============================================

http://lists.squeakfoundation.org/pipermail/packages/2013-June/006061.html

Name: MorphicExtras-nice.111
Ancestors: MorphicExtras-fbs.110

Make UI requests to the same UIManager object rather than once to Utilities and once to UIManager default.

=============================================

(Continue reading)

Frank Shearar | 19 Jun 2013 00:32
Picon
Gravatar

Re: The Trunk: Tools-nice.472.mcz

On 18 June 2013 21:36,  <commits <at> source.squeak.org> wrote:
> Nicolas Cellier uploaded a new version of Tools to project The Trunk:
> http://source.squeak.org/trunk/Tools-nice.472.mcz
>
> ==================== Summary ====================
>
> Name: Tools-nice.472
> Author: nice
> Time: 18 June 2013, 10:36:32.295 pm
> UUID: 44e681e0-42bc-4490-afdc-37b505e70df4
> Ancestors: Tools-eem.471
>
> Why making one UI request to UIManager default and the other to Utilities?
> Let's make the two  requests to UIManager default.
>
> =============== Diff against Tools-eem.471 ===============
>
> Item was changed:
>   ----- Method: ChangeSorter>>rename (in category 'changeSet menu') -----
>   rename
>         "Store a new name string into the selected ChangeSet.  reject duplicate name; allow user to back out"
>
>         | newName |
>         newName := UIManager default request: 'New name for this change set'
>                                                 initialAnswer: myChangeSet name.
>         (newName = myChangeSet name or: [newName size = 0]) ifTrue:
>                         [^ Beeper beep].
>
>         (self class changeSetNamed: newName) ifNotNil:
> +                       [^ UIManager default inform: 'Sorry that name is already used'].
(Continue reading)

Nicolas Cellier | 18 Jun 2013 23:32
Picon
Gravatar

Re: The Trunk: Kernel-nice.771.mcz

Next step will be to let \\\ invoke deprecated: and move it to appropriate 45Deprecated package, but two things stopped me:
- this might require a two fold changes with an intermediate config map (so let's consider it is the first step)
- I don't know whether I should recommend using \\ or rem: since \\\ is mixing the behaviours whether the receiver is Small or Large


2013/6/18 <commits <at> source.squeak.org>
Nicolas Cellier uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-nice.771.mcz

==================== Summary ====================

Name: Kernel-nice.771
Author: nice
Time: 18 June 2013, 11:28:04.495 pm
UUID: e6da6bb0-0aa4-4400-b96c-c53dc343584a
Ancestors: Kernel-fbs.770

Start deprecating usage of \\\
A long comment in \\\ tells the reasons for deprecating

=============== Diff against Kernel-fbs.770 ===============

Item was changed:
  ----- Method: Integer>>\\\ (in category 'arithmetic') -----
  \\\ anInteger
+       "A modulo method former used in DSA."
+
+       "Notes: this method used to be a faster than \\ for LargeIntegers, but this advantage is fainting:
+       - it always was slower for SmallInteger because of the indirection below
+       - a new LargeInteger primitive makes \\ faster up to 64 bits operands
+       - even above 64 bits, its advantage has become marginal thanks to revised \\ primitive fallback code
+       Moreover, \\\ behaviour is questionable for these reasons:
+       - for a negative receiver xor argument, it behaves like rem: for LargeInteger and \\ for SmallInteger
+       - it may answer a not normalized LargeInteger (with leading null digits) which breaks some invariants
+       For example, check (SmallInteger maxVal + 1 \\\ 8) isZero.
+       So beware if you ever think using this method."
-       "a modulo method for use in DSA. Be careful if you try to use this elsewhere"

        ^self \\ anInteger!

Item was changed:
  ----- Method: Integer>>reciprocalModulo: (in category 'arithmetic') -----
  reciprocalModulo: n
        "Answer an integer x such that (self * x) \\ n = 1, x > 0, x < n.
        Raise an error if there is no such integer.
        The algorithm is a non extended euclidean modular inversion called NINV.
        It is described in this article:
                'Using an RSA Accelerator for Modular Inversion'
        by Martin Seysen. See http://www.iacr.org/archive/ches2005/017.pdf"

        | u v f fPlusN b result result2 |
        ((self <= 0) or: [n <= 0]) ifTrue: [self error: 'self and n must be greater than zero'].
        self >= n ifTrue: [self error: 'self must be < n'].

        b := n highBit + 1.
        f := 1 bitShift: b.
        v := (self bitShift: b) + 1.
        u := n bitShift: b.
        fPlusN := f + n.
        [v >= fPlusN] whileTrue:
+               [v := u \\ (u := v)].
-               [v := u \\\ (u := v)].
        result := v - f.
        (result2 := result + n) > 0
                ifFalse: [self error: 'no inverse'].
        ^result positive
                ifTrue: [result]
                ifFalse: [result2]!

Item was changed:
  ----- Method: Integer>>slidingLeftRightRaisedTo:modulo: (in category 'private') -----
  slidingLeftRightRaisedTo: n modulo: m
        "Private - compute (self raisedTo: n) \\ m,
        Note: this method has to be fast because it is generally used with large integers in cryptography.
        It thus operate on exponent bits from left to right by packets with a sliding window rather than bit by bit (see below)."

        | pow j k w index oddPowersOfSelf square |

        "Precompute powers of self for odd bit patterns xxxx1 up to length w + 1.
        The width w is chosen with respect to the total bit length of n,
        such that each bit pattern will on average be encoutered P times in the whole bit sequence of n.
        This costs (2 raisedTo: w) multiplications, but more will be saved later (see below)."
        k := n highBit.
        w := (k highBit - 1 >> 1 min: 16) max: 1.
        oddPowersOfSelf := Array new: 1 << w.
        oddPowersOfSelf at: 1 put: (pow := self).
+       square := self * self \\ m.
+       2 to: oddPowersOfSelf size do: [:i | pow := oddPowersOfSelf at: i put: pow * square \\ m].
-       square := self * self \\\ m.
-       2 to: oddPowersOfSelf size do: [:i | pow := oddPowersOfSelf at: i put: pow * square \\\ m].

        "Now exponentiate by searching precomputed bit patterns with a sliding window"
        pow := 1.
        [k > 0]
                whileTrue:
+                       [pow := pow * pow \\ m.
-                       [pow := pow * pow \\\ m.
                        "Skip bits set to zero (the sliding window)"
                        (n bitAt: k) = 0
                                ifFalse:
                                        ["Find longest odd bit pattern up to window length (w + 1)"
                                        j := k - w max: 1.
                                        [j < k and: [(n bitAt: j) = 0]] whileTrue: [j := j + 1].
                                        "We found an odd bit pattern of length k-j+1;
                                        perform the square powers for each bit
                                        (same cost as bitwise algorithm);
                                        compute the index of this bit pattern in the precomputed powers."
                                        index := 0.
                                        [k > j] whileTrue:
+                                               [pow := pow * pow \\ m.
-                                               [pow := pow * pow \\\ m.
                                                index := index << 1 + (n bitAt: k).
                                                k := k - 1].
                                        "Perform a single multiplication for the whole bit pattern.
                                        This saves up to (k-j) multiplications versus a naive algorithm operating bit by bit"
+                                       pow := pow * (oddPowersOfSelf at: index + 1) \\ m].
-                                       pow := pow * (oddPowersOfSelf at: index + 1) \\\ m].
                        k := k - 1].
+       ^pow!
-       ^pow normalize!

Item was changed:
  ----- Method: LargePositiveInteger>>\\\ (in category 'arithmetic') -----
  \\\ anInteger
+       "A modulo method former used in DSA.
+       This method is not much faster than \\ and rem: and it breaks some invariants (see super).
+       Usage is now deprecated and should be reserved to backward compatibility."
-       "a faster modulo method for use in DSA. Be careful if you try to use this elsewhere"

        ^(self digitDiv: anInteger neg: false) second!




commits | 18 Jun 2013 02:00
Favicon

The Trunk: Kernel-nice.771.mcz

Nicolas Cellier uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-nice.771.mcz

==================== Summary ====================

Name: Kernel-nice.771
Author: nice
Time: 18 June 2013, 11:28:04.495 pm
UUID: e6da6bb0-0aa4-4400-b96c-c53dc343584a
Ancestors: Kernel-fbs.770

Start deprecating usage of \\\
A long comment in \\\ tells the reasons for deprecating

=============== Diff against Kernel-fbs.770 ===============

Item was changed:
  ----- Method: Integer>>\\\ (in category 'arithmetic') -----
  \\\ anInteger 
+ 	"A modulo method former used in DSA."
+ 	
+ 	"Notes: this method used to be a faster than \\ for LargeIntegers, but this advantage is fainting:
+ 	- it always was slower for SmallInteger because of the indirection below
+ 	- a new LargeInteger primitive makes \\ faster up to 64 bits operands
+ 	- even above 64 bits, its advantage has become marginal thanks to revised \\ primitive fallback code
+ 	Moreover, \\\ behaviour is questionable for these reasons:
+ 	- for a negative receiver xor argument, it behaves like rem: for LargeInteger and \\ for SmallInteger
+ 	- it may answer a not normalized LargeInteger (with leading null digits) which breaks some invariants
+ 	For example, check (SmallInteger maxVal + 1 \\\ 8) isZero.
+ 	So beware if you ever think using this method."
- 	"a modulo method for use in DSA. Be careful if you try to use this elsewhere"

  	^self \\ anInteger!

Item was changed:
  ----- Method: Integer>>reciprocalModulo: (in category 'arithmetic') -----
  reciprocalModulo: n
  	"Answer an integer x such that (self * x) \\ n = 1, x > 0, x < n.
  	Raise an error if there is no such integer.
  	The algorithm is a non extended euclidean modular inversion called NINV.
  	It is described in this article:
  		'Using an RSA Accelerator for Modular Inversion'
  	by Martin Seysen. See http://www.iacr.org/archive/ches2005/017.pdf"

  	| u v f fPlusN b result result2 |
  	((self <= 0) or: [n <= 0]) ifTrue: [self error: 'self and n must be greater than zero'].
  	self >= n ifTrue: [self error: 'self must be < n'].

  	b := n highBit + 1.
  	f := 1 bitShift: b.
  	v := (self bitShift: b) + 1.
  	u := n bitShift: b.
  	fPlusN := f + n.
  	[v >= fPlusN] whileTrue:
+ 		[v := u \\ (u := v)].
- 		[v := u \\\ (u := v)].
  	result := v - f.
  	(result2 := result + n) > 0
  		ifFalse: [self error: 'no inverse'].
  	^result positive
  		ifTrue: [result]
  		ifFalse: [result2]!

Item was changed:
  ----- Method: Integer>>slidingLeftRightRaisedTo:modulo: (in category 'private') -----
  slidingLeftRightRaisedTo: n modulo: m
  	"Private - compute (self raisedTo: n) \\ m,
  	Note: this method has to be fast because it is generally used with large integers in cryptography.
  	It thus operate on exponent bits from left to right by packets with a sliding window rather than bit by bit
(see below)."
  	
  	| pow j k w index oddPowersOfSelf square |
  	
  	"Precompute powers of self for odd bit patterns xxxx1 up to length w + 1.
  	The width w is chosen with respect to the total bit length of n,
  	such that each bit pattern will on average be encoutered P times in the whole bit sequence of n.
  	This costs (2 raisedTo: w) multiplications, but more will be saved later (see below)."
  	k := n highBit.
  	w := (k highBit - 1 >> 1 min: 16) max: 1.
  	oddPowersOfSelf := Array new: 1 << w.
  	oddPowersOfSelf at: 1 put: (pow := self).
+ 	square := self * self \\ m.
+ 	2 to: oddPowersOfSelf size do: [:i | pow := oddPowersOfSelf at: i put: pow * square \\ m].
- 	square := self * self \\\ m.
- 	2 to: oddPowersOfSelf size do: [:i | pow := oddPowersOfSelf at: i put: pow * square \\\ m].
  	
  	"Now exponentiate by searching precomputed bit patterns with a sliding window"
  	pow := 1.
  	[k > 0]
  		whileTrue:
+ 			[pow := pow * pow \\ m.
- 			[pow := pow * pow \\\ m.
  			"Skip bits set to zero (the sliding window)"
  			(n bitAt: k) = 0
  				ifFalse:
  					["Find longest odd bit pattern up to window length (w + 1)"
  					j := k - w max: 1.
  					[j < k and: [(n bitAt: j) = 0]] whileTrue: [j := j + 1].
  					"We found an odd bit pattern of length k-j+1;
  					perform the square powers for each bit
  					(same cost as bitwise algorithm);
  					compute the index of this bit pattern in the precomputed powers."
  					index := 0.
  					[k > j] whileTrue:
+ 						[pow := pow * pow \\ m.
- 						[pow := pow * pow \\\ m.
  						index := index << 1 + (n bitAt: k).
  						k := k - 1].
  					"Perform a single multiplication for the whole bit pattern.
  					This saves up to (k-j) multiplications versus a naive algorithm operating bit by bit"
+ 					pow := pow * (oddPowersOfSelf at: index + 1) \\ m].
- 					pow := pow * (oddPowersOfSelf at: index + 1) \\\ m].
  			k := k - 1].
+ 	^pow!
- 	^pow normalize!

Item was changed:
  ----- Method: LargePositiveInteger>>\\\ (in category 'arithmetic') -----
  \\\ anInteger 
+ 	"A modulo method former used in DSA.
+ 	This method is not much faster than \\ and rem: and it breaks some invariants (see super).
+ 	Usage is now deprecated and should be reserved to backward compatibility."
- 	"a faster modulo method for use in DSA. Be careful if you try to use this elsewhere"

  	^(self digitDiv: anInteger neg: false) second!

commits | 18 Jun 2013 02:00
Favicon

The Trunk: MorphicExtras-nice.111.mcz

Nicolas Cellier uploaded a new version of MorphicExtras to project The Trunk:
http://source.squeak.org/trunk/MorphicExtras-nice.111.mcz

==================== Summary ====================

Name: MorphicExtras-nice.111
Author: nice
Time: 18 June 2013, 10:42:55.148 pm
UUID: 1f2ba902-1c24-4fdc-b18a-79349e9d8844
Ancestors: MorphicExtras-fbs.110

Make UI requests to the same UIManager object rather than once to Utilities and once to UIManager default.

=============== Diff against MorphicExtras-fbs.110 ===============

Item was changed:
  ----- Method: RemoteHandMorph class>>ensureNetworkConnected (in category 'utilities') -----
  ensureNetworkConnected
  	"Try to ensure that an intermittent network connection, such as a dialup or ISDN line, is actually
connected. This is necessary to make sure a server is visible in order to accept an incoming connection. If
the network connection does not work - the user has given up - return false. Otherwise, return true."
  	"RemoteHandMorph ensureNetworkConnected"
  	| address |
+ 	UIManager default
- 	Utilities
  		informUser: 'Ensuring your network connection works...'
  		during: [
  			address := (NetNameResolver
  				addressForName: 'squeak.org'
  				timeout: 30)].
  	^ address notNil.!

Item was changed:
  ----- Method: WaveEditor>>chooseLoopStart (in category 'menu') -----
  chooseLoopStart 

  	| bestLoops choice start labels values |
  	possibleLoopStarts ifNil: [
+ 		UIManager default
- 		Utilities
  			informUser: 'Finding possible loop points...' translated
  			during: [possibleLoopStarts := self findPossibleLoopStartsFrom: graph cursor]].
  	bestLoops := possibleLoopStarts copyFrom: 1 to: (100 min: possibleLoopStarts size).
  	labels := OrderedCollection new.
  	values := OrderedCollection new.
  	bestLoops do: [:entry |
  		| secs |
  		secs := ((loopEnd - entry first) asFloat / self samplingRate) roundTo: 0.01.
  		labels add: ('{1} cycles; {2} secs' translated format:{entry third. secs}).
  		values add: entry].
  	choice := UIManager default chooseFrom: labels values: values.
  	choice ifNil: [^ self].
  	loopCycles := choice third.
  	start := self fractionalLoopStartAt: choice first.
  	self loopLength: (loopEnd asFloat - start) + 1.0.
  !

commits | 18 Jun 2013 02:00
Favicon

The Trunk: Multilingual-nice.161.mcz

Nicolas Cellier uploaded a new version of Multilingual to project The Trunk:
http://source.squeak.org/trunk/Multilingual-nice.161.mcz

==================== Summary ====================

Name: Multilingual-nice.161
Author: nice
Time: 18 June 2013, 10:39:44.246 pm
UUID: c60bf0fa-0618-4c77-b8c7-2de799e340ea
Ancestors: Multilingual-nice.160

Invoke Character escape by name rather than by value.

=============== Diff against Multilingual-nice.160 ===============

Item was changed:
  ----- Method: JISX0208 class>>initialize (in category 'class initialization') -----
  initialize
  "
  	self initialize
  "

  	CompoundTextSequence := String streamContents: [:s |
+ 		s nextPut: Character escape.
- 		s nextPut: (Character value: 27).
  		s nextPut: $$.
  		s nextPut: $B
  	].
  !

Item was changed:
  ----- Method: Latin1 class>>initialize (in category 'class initialization') -----
  initialize
  "
  	self initialize
  "

  
  	CompoundTextSequence := String streamContents: [:s |
+ 		s nextPut: Character escape.
- 		s nextPut: (Character value: 27).
  		s nextPut: $(.
  		s nextPut: $B.
  	].

  	RightHalfSequence := String streamContents: [:s |
+ 		s nextPut: Character escape.
- 		s nextPut: (Character value: 27).
  		s nextPut: $-.
  		s nextPut: $A.
  	].
  !

commits | 18 Jun 2013 02:00
Favicon

The Trunk: Tools-nice.472.mcz

Nicolas Cellier uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-nice.472.mcz

==================== Summary ====================

Name: Tools-nice.472
Author: nice
Time: 18 June 2013, 10:36:32.295 pm
UUID: 44e681e0-42bc-4490-afdc-37b505e70df4
Ancestors: Tools-eem.471

Why making one UI request to UIManager default and the other to Utilities?
Let's make the two  requests to UIManager default.

=============== Diff against Tools-eem.471 ===============

Item was changed:
  ----- Method: ChangeSorter>>rename (in category 'changeSet menu') -----
  rename
  	"Store a new name string into the selected ChangeSet.  reject duplicate name; allow user to back out"

  	| newName |
  	newName := UIManager default request: 'New name for this change set'
  						initialAnswer: myChangeSet name.
  	(newName = myChangeSet name or: [newName size = 0]) ifTrue:
  			[^ Beeper beep].

  	(self class changeSetNamed: newName) ifNotNil:
+ 			[^ UIManager default inform: 'Sorry that name is already used'].
- 			[^ Utilities inform: 'Sorry that name is already used'].

  	myChangeSet name: newName.
  	self update.
  	self changed: #mainButtonName.
  	self changed: #relabel.!

Frank Shearar | 18 Jun 2013 10:30
Picon
Gravatar

Re: The Trunk: Morphic-fbs.659.mcz

On 15 June 2013 15:25,  <commits <at> source.squeak.org> wrote:
> Frank Shearar uploaded a new version of Morphic to project The Trunk:
> http://source.squeak.org/trunk/Morphic-fbs.659.mcz
>
> ==================== Summary ====================
>
> Name: Morphic-fbs.659
> Author: fbs
> Time: 15 June 2013, 3:25:34.535 pm
> UUID: eebc0854-52d0-4ebc-8b78-85597450927e
> Ancestors: Morphic-eem.658, Morphic-kb.657
>
> Balázs Kósi's un-futuring of PluggableListMorph's preselection:
>
> Do not defer the model selection action in PluggableListMorph, instead step the World on cycle so the pre
selection highlight can take effect, but avoid the timing issue, which broke MorphicToolBuilderTest >> #testSetListIndex.
>
> =============== Diff against Morphic-eem.658 ===============

This work's definitely better now that the future's gone. (Where
"better" means "all the tests pass". I'm happy to see futures being
used (especially since Promises are now composable) as long as someone
rewrites those tests that break.)

Open up something with a long list, like a Browser. Select the top
system category, and then hold the down arrow for a while. You'll see
the preselection blue move down the list, as expected. And then when
you lift your finger off the down arrow, you'll see this weird
going-back-up behaviour, and you'll end up actually selecting an item
far above where you thought you were. Presumably that's because of the
high number of keyboard events and the World doOneCycle or something.

frank

commits | 18 Jun 2013 01:55
Favicon

Daily Commit Log

Changes to Trunk (http://source.squeak.org/trunk.html) in the last 24 hours:

http://lists.squeakfoundation.org/pipermail/packages/2013-June/006058.html

Name: Tests-fbs.222
Ancestors: Tests-fbs.221

Fix the dependency tests of the Compression and File packages.

=============================================

OpenSlate ChalkDust | 17 Jun 2013 23:42
Picon

Squeak on tablets

As some of you know I spent quite a bit of time getting nowhere trying to get Squeak running on top of FreeBSD in a tablet form factor.The situation has changed considerably, in that the world has gone tablet crazy. Typically using fingers rather than a mouse or stylus.

I would appreciate any recommendations on what tablets work well with squeak, and what to avoid. What has been done to adapt the three-button mouse squeak expects to have to a fingertip input? Then of course there is keyboard input in general, including keyboard shortcuts.

I'd be happy to collect the results in a table on Google Drive.

--
Gary Dunn
Open Slate Project
http://openslate.org/

commits | 17 Jun 2013 02:00
Favicon

The Trunk: Tests-fbs.222.mcz

Frank Shearar uploaded a new version of Tests to project The Trunk:
http://source.squeak.org/trunk/Tests-fbs.222.mcz

==================== Summary ====================

Name: Tests-fbs.222
Author: fbs
Time: 17 June 2013, 12:12:07.678 pm
UUID: 076fe890-1ec2-44d6-96dc-e6948a310c26
Ancestors: Tests-fbs.221

Fix the dependency tests of the Compression and File packages.

=============== Diff against Tests-fbs.221 ===============

Item was changed:
  ----- Method: PackageDependencyTest>>testCompression (in category 'tests') -----
  testCompression
  	self testPackage: 'Compression' dependsExactlyOn: #(
  		Collections
  		Files
  		Graphics
  		Kernel
  		Multilingual
- 		SUnit
  		System
  		'ToolBuilder-Kernel'
  	).!

Item was changed:
  ----- Method: PackageDependencyTest>>testFiles (in category 'tests') -----
  testFiles
  	self testPackage: 'Files' dependsExactlyOn: #(
  		Collections
  		Compression
- 		Exceptions
  		Graphics
  		Kernel
  		Multilingual
  		System
  		'ToolBuilder-Kernel'
  	).!


Gmane