Changes to Trunk (http://source.squeak.org/trunk.html) in the last 24 hours:
http://lists.squeakfoundation.org/pipermail/packages/2014-July/007201.html
Name: Monticello-eem.595
Ancestors: Monticello-eem.594
Don't prompt for a selector when getting the selected
method reference in a BrowserRequestor. This fixes
trying to open a browser in a MessageSet with no selection.
The Monticello history decoration would prompt for a
selector and select that underneath the cursor.
=============================================
http://lists.squeakfoundation.org/pipermail/packages/2014-July/007202.html
Name: Collections-nice.577
Ancestors: Collections-nice.576
Convert Base64MimeConverter implementation from ReadWriteStream to alternate WriteStream/ReadStream.
Beware, the main class messages now answer a ReadStream, not a ReadWriteStream.
=============================================
http://lists.squeakfoundation.org/pipermail/packages/2014-July/007203.html
Name: System-nice.681
Ancestors: System-nice.680
Remove one useless send of reset.
By the way, this is twice the same method... TODO remove the InternalTranslator version.
=============================================
Nicolas Cellier uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-nice.577.mcz
==================== Summary ====================
Name: Collections-nice.577
Author: nice
Time: 26 July 2014, 11:34:56.071 pm
UUID: c5925cce-0dac-4744-9c8e-08888f259f63
Ancestors: Collections-nice.576
Convert Base64MimeConverter implementation from ReadWriteStream to alternate WriteStream/ReadStream.
Beware, the main class messages now answer a ReadStream, not a ReadWriteStream.
=============== Diff against Collections-nice.576 ===============
Item was changed:
----- Method: Base64MimeConverter class>>encodeInteger: (in category 'as yet unclassified') -----
encodeInteger: int
| strm |
"Encode an integer of any length and return the MIME string"
+ strm := WriteStream on: (ByteArray new: int digitLength).
- strm := ReadWriteStream on: (ByteArray new: int digitLength).
1 to: int digitLength do: [:ii | strm nextPut: (int digitAt: ii)].
+ ^ ((self mimeEncode: strm readStream) contents) copyUpTo: $= "remove padding"!
- strm reset.
- ^ ((self mimeEncode: strm) contents) copyUpTo: $= "remove padding"!
Item was changed:
----- Method: Base64MimeConverter class>>mimeDecodeToBytes: (in category 'as yet unclassified') -----
mimeDecodeToBytes: aStream
+ "Return a ReadStream of the original ByteArray. aStream has only 65 innocuous character values. aStream is not binary. (See class comment). 4 bytes in aStream goes to 3 bytes in output."
- "Return a RWBinaryOrTextStream of the original ByteArray. aStream has only 65 innocuous character values. aStream is not binary. (See class comment). 4 bytes in aStream goes to 3 bytes in output."
| me |
aStream position: 0.
me := self new mimeStream: aStream.
+ me dataStream: (WriteStream on: (ByteArray new: aStream size * 3 // 4)).
- me dataStream: (RWBinaryOrTextStream on: (ByteArray new: aStream size * 3 // 4)).
me mimeDecodeToByteArray.
+ ^ me dataStream readStream!
- me dataStream position: 0.
- ^ me dataStream!
Item was changed:
----- Method: Base64MimeConverter class>>mimeDecodeToChars: (in category 'as yet unclassified') -----
mimeDecodeToChars: aStream
"Return a ReadWriteStream of the original String. aStream has only 65 innocuous character values. It is not binary. (See class comment). 4 bytes in aStream goes to 3 bytes in output."
| me |
aStream position: 0.
me := self new mimeStream: aStream.
+ me dataStream: (WriteStream on: (String new: aStream size * 3 // 4)).
- me dataStream: (ReadWriteStream on: (String new: aStream size * 3 // 4)).
me mimeDecode.
+ ^ me dataStream readStream!
- me dataStream position: 0.
- ^ me dataStream!
Item was changed:
----- Method: Base64MimeConverter class>>mimeEncode:multiLine:atStart: (in category 'as yet unclassified') -----
mimeEncode: aStream multiLine: aBool atStart: resetInput
+ "Return a ReadStream of characters. The data of aStream is encoded as 65 innocuous characters. (See class comment). 3 bytes in aStream goes to 4 bytes in output."
- "Return a ReadWriteStream of characters. The data of aStream is encoded as 65 innocuous characters. (See class comment). 3 bytes in aStream goes to 4 bytes in output."
| me |
resetInput ifTrue:[aStream position: 0].
me := self new dataStream: aStream.
me multiLine: aBool.
+ me mimeStream: (WriteStream on: (String new: aStream size + 20 * 4 // 3)).
- me mimeStream: (ReadWriteStream on: (String new: aStream size + 20 * 4 // 3)).
me mimeEncode.
+ ^ me mimeStream readStream!
- me mimeStream position: 0.
- ^ me mimeStream!
Eliot Miranda uploaded a new version of Monticello to project The Trunk:
http://source.squeak.org/trunk/Monticello-eem.595.mcz
==================== Summary ====================
Name: Monticello-eem.595
Author: eem
Time: 26 July 2014, 7:05:32.68 am
UUID: a8f13cc3-8d2a-428b-a218-f54bb1a5f4bf
Ancestors: Monticello-eem.594
Don't prompt for a selector when getting the selected
method reference in a BrowserRequestor. This fixes
trying to open a browser in a MessageSet with no selection.
The Monticello history decoration would prompt for a
selector and select that underneath the cursor.
=============== Diff against Monticello-eem.594 ===============
Item was changed:
----- Method: BrowserRequestor>>selectedMethodReference (in category '*monticello-history') -----
selectedMethodReference
^ MethodReference
class: self getClass
+ selector: self getBrowser selectedMessageName!
- selector: self getSelector!
... at http://www.mirandabanda.org/files/Cog/VM/VM.r3056/.
CogVM binaries as per VMMaker.oscog-eem.832/r3056
Add the time zone to the version info on Mac OS X and Win32.
Fix bug in assigning parameter 55 (growth ratio at which to do a global GC).
Add vmParameter 52 to answer the capacity of the root table
(in Spur a.k.a. the rememberedSet).
In the wake of the inlining change below (see Slang:), split
lookupInMethodCacheSel:classTag: into
inlineLookupInMethodCacheSel:classTag:,
and use the inline version in internalFindNewMethod.
Fix printStringOf: (used in e.g. frame print) to not print crs
that would cause previous info to be overwritten.
Spur:
Fix bug with class table management and two-way become. Because two-way
become
may do an in-place swap obj1 & obj2 in
SpurMemoryManager>>doBecome:and:copyHash:
may not be forwarded after the inner become. Hence they should not be
followed
if not forwarded. The bug manifested as Object's identityHash changing:
superclass is the first slot in a class. Following an unforwarded subclass
of
object yields Object. Setting the hash bits of the followed object smashes
Object's identityHash. Thanks to Stephane Rollandin for finding the bug.
More rationalization of the class table management post become. Now no post
become scan of the class table is necessary at all.
Add vm parameter 53 to answer the number of segments.
Move the rememberedSet into a pinned object in oldSpace. Allow it to grow
on demand, starting at 1k entries, doubling on each grow. Make sure to
abort
if the attempt to grow the remembered set fails. Try to grow by another 1k
slots if doubling fails, then abort.
Revise markAndTrace: given that markAndShouldScan: is inlined within it (see
Slang changes below). Move the ephemeron processing into markAndShouldScan:
out of the now unused numStringSlotsOf:ephemeronInactiveIf: circumlocution.
Add activeAndDeferredScan: and numStrongSlotsOfInephemeral: in place of the
double negative inactiveOrFailedToDeferScan: and hence inline
numStrongSlotsOfInephemeral:. Increase the traceImmediatelySlotLimit.
These
changes plus the 2 repeats for compaction speed up global GC by at least x2.
Change the defaultEdenBytes to 4Mb.
Allow the number of compaction passes to vary, 2 on GC, 3 on GC for
snapshot.
Slang:
Add support for inlining into the condition of ifTrue:/ifFalse:
when it is marked as inline. Transform
expr1 ifTrue:/ifFalse: [^expr2]
by inlining ^expr2 into expr1. Transform
expr ifTrue:/ifFalse: [statements]
by replacing ^boolean occurrences in expr with gotos.
--
Aloha,
Eliot
Hey guys---
Just wanted to make my first trunk commit. :) I downloaded the Squeak
4.6alpha and updated it. I made some changes. I tried to commit... *bam*
Seems to me that somehow the zip archives are written brokenly (to disk). I
inspected the package-cache and found many broken *.mcd files there (e.g.
Kernel-eem.859(eem.857).mcd).
Now I'm a little bit sad. :'(
Best,
Marcel ;)
--
View this message in context: http://forum.world.st/ZipArchive-Error-can-t-find-EOCD-position-trunk-tp476…
Sent from the Squeak - Dev mailing list archive at Nabble.com.
On Thu, 24 Jul 2014, commits(a)source.squeak.org wrote:
> Chris Muller uploaded a new version of Collections to project The Inbox:
> http://source.squeak.org/inbox/Collections-cmm.576.mcz
>
> ==================== Summary ====================
>
> Name: Collections-cmm.576
> Author: cmm
> Time: 24 July 2014, 10:39:06.452 am
> UUID: 17b60ac6-55b3-4706-b1c8-d826e6ad5657
> Ancestors: Collections-eem.575
>
> When a SequenceableCollection contains duplicate keys, #findBinaryIndex:do:ifNone: should answer the index of the _earliest_.
There are two problems with this change
- it breaks this method's runtime guarantee which is O(log(n)) for all cases. Worst case runtime becomes O(n) [2], instead of O(log(n)) (actually Big Theta instead of Big Omicron[1], but it's not on my keyboard).
- it introduces unwanted behavior. What if I want the index of the last matching element?
If you want the index of the first matching element, then you can do two
things:
- find the index after the binary search yourself (which is still not a
good idea because of the possible performance loss)
- change the binary search to behave as you'd like to
| haystack needle |
haystack := #(1 3 5 7 11 11 15 23).
needle := 11.
haystack
findBinaryIndex: [ :each |
needle = each
ifTrue: [ -1 " Go to the left in case of a match to ensure that upper will be the index of the leftmost match " ]
ifFalse: [ needle - each ] ]
do: nil "We'll never get here, so it can be anything."
ifNone: [ :lower :upper |
" upper is the index of the leftmost match if there's a match, and its value is at least 1 "
(upper <= haystack size and: [ (haystack at: upper) = needle ])
ifTrue: [ upper ]
ifFalse: [ 0 ] ]
With a slight modification you can find the index of the last match too.
Levente
[1] https://en.wikipedia.org/wiki/Big_O_notation#Family_of_Bachmann.E2.80.93Lan…
[2] Here's a small benchmark demonstrating the edge case with your change:
| haystack needle |
Smalltalk garbageCollect.
haystack := Array new: 100000 withAll: 11.
needle := 11.
{ [ haystack
findBinaryIndex: [ :each |
needle = each
ifTrue: [ -1 ]
ifFalse: [ needle - each ] ]
do: nil
ifNone: [ :lower :upper |
(upper <= haystack size and: [ (haystack at: upper) = needle ])
ifTrue: [ upper ]
ifFalse: [ 0 ] ] ] bench.
[ haystack
findBinaryIndex: [ :each | needle - each ]
do: [ :each | each ]
ifNone: [ 0 ] ] bench }
#('1,150,000 per second.' '741 per second.')
>
> =============== Diff against Collections-eem.575 ===============
>
> Item was changed:
> ----- Method: SequenceableCollection>>findBinaryIndex:do:ifNone: (in category 'enumerating') -----
> + findBinaryIndex: aBlock do: actionBlock ifNone: exceptionBlock
> - findBinaryIndex: aBlock do: actionBlock ifNone: exceptionBlock
> "Search for an element in the receiver using binary search.
> The argument aBlock is a one-element block returning
> 0 - if the element is the one searched for
> <0 - if the search should continue in the first half
> >0 - if the search should continue in the second half
> If found, evaluate actionBlock with the index as argument
> If no matching element is found, evaluate exceptionBlock,
> with the indexes of the 'bounding' elements as optional
> arguments. Warning: Might give invalid indexes, see
> examples below.
> Examples:
> + #(1 3 5 7 11 11 15 23)
> - #(1 3 5 7 11 15 23)
> findBinaryIndex: [ :arg | 11 - arg ]
> do: [ :found | found ]
> ifNone: [ :a :b | ('between: ', {a. b} printString)]
> #(1 3 5 7 11 15 23)
> findBinaryIndex: [ :arg | 12 - arg ]
> do: [ :found | found ]
> ifNone: [ :a :b | ('between: ', {a. b} printString) ]
> #(1 3 5 7 11 15 23) d
> findBinaryIndex: [ :arg | 0.5 - arg ]
> do: [ :found | found ]
> ifNone: [ :a :b | ('between: ', {a. b} printString) ]
> #(1 3 5 7 11 15 23)
> findBinaryIndex: [ :arg | 25 - arg ]
> do: [ :found | found ]
> ifNone: [ :a :b | ('between: ',{a. b} printString) ]
> "
> | index low high |
> low := 1.
> high := self size.
> + [ index := high + low // 2.
> + low > high ] whileFalse:
> + [ | test |
> + test := aBlock value: (self at: index).
> + test = 0
> + ifTrue:
> + [ "In case there are duplicate keys, walk backward to the first."
> + [ index > 1 and: [ (aBlock value: (self at: index - 1)) = 0 ] ] whileTrue: [ index := index - 1 ].
> + ^ actionBlock value: index ]
> + ifFalse:
> + [ test > 0
> - [
> - index := high + low // 2.
> - low > high ] whileFalse: [
> - | test |
> - test := aBlock value: (self at: index).
> - test = 0
> - ifTrue: [ ^actionBlock value: index ]
> - ifFalse: [ test > 0
> ifTrue: [ low := index + 1 ]
> ifFalse: [ high := index - 1 ] ] ].
> + ^ exceptionBlock
> + cull: high
> + cull: low!
> - ^exceptionBlock cull: high cull: low!
>
>
>
Changes to Trunk (http://source.squeak.org/trunk.html) in the last 24 hours:
http://lists.squeakfoundation.org/pipermail/packages/2014-July/007192.html
Name: Kernel-nice.860
Ancestors: Kernel-eem.859
Avoid engaging LargeInteger arithmetic (asTrueFraction) just for testing the sign of a Float
=============================================
http://lists.squeakfoundation.org/pipermail/packages/2014-July/007193.html
Name: System.spur-kfr.678
Ancestors: System-kfr.678
System-kfr.678 patched for Spur by SpurBootstrapMonticelloPackagePatcher Cog-eem.170
When collapsing windows pay attention to the height of the docking bar
=============================================
http://lists.squeakfoundation.org/pipermail/packages/2014-July/007194.html
Name: Kernel.spur-nice.860
Ancestors: Kernel-nice.860
Kernel-nice.860 patched for Spur by SpurBootstrapMonticelloPackagePatcher Cog-eem.170
Avoid engaging LargeInteger arithmetic (asTrueFraction) just for testing the sign of a Float
=============================================
http://lists.squeakfoundation.org/pipermail/packages/2014-July/007195.html
Name: System.spur-kfr.679
Ancestors: System-kfr.679
System-kfr.679 patched for Spur by SpurBootstrapMonticelloPackagePatcher Cog-eem.170
Utilities class>>commandKeyMappings is now a help topic. This menthod is removed to avoid dupication
Utilities class>>openCommandKeyHelp opens a HelpBrowser
=============================================
http://lists.squeakfoundation.org/pipermail/packages/2014-July/007196.html
Name: System.spur-nice.680
Ancestors: System-nice.680
System-nice.680 patched for Spur by SpurBootstrapMonticelloPackagePatcher Cog-eem.170
RWStream Shoot them up part 4:
How to drop an image without a RWBinaryOrTextStream.
I feel like applying a balm on chicken pox one by one. There are a lot of them, my image is crippled, and it's itching considerably!
=============================================
http://lists.squeakfoundation.org/pipermail/packages/2014-July/007197.html
Name: CollectionsTests-nice.220
Ancestors: CollectionsTests-eem.219
Let ReadStreamTest test ReadStream, WriteStreamTest test WriteStream, and move ReadWriteStream tests in ReadWriteStreamTest.
=============================================
http://lists.squeakfoundation.org/pipermail/packages/2014-July/007198.html
Name: Collections-nice.576
Ancestors: Collections-eem.575
Convert a WriteStream into a ReadStream.
Beware, this version is optimized to avoid a copy, but is sharing some state.
Thus:
s := WriteStream on: String new.
self writeSomethingOn: s.
self readSomethingFrom: s readStream.
is a good replacement for:
s := ReadWriteStream on: String new.
self writeSomethingOn: s.
self readSomethingFrom: s reset
But avoid overwriting like this:
w := String new writeStream.
self writeSomethingOn: w.
r := w readStream.
self writeSomethingElseOn: w reset.
self compare: r to: w readStream.
=============================================
http://lists.squeakfoundation.org/pipermail/packages/2014-July/007199.html
Name: Installer-Core-nice.394
Ancestors: Installer-Core-cmm.393
Replace usage of ReadWriteStream for piping transformations by alternate WriteStream converted to ReadStream.
=============================================
http://lists.squeakfoundation.org/pipermail/packages/2014-July/007200.html
Name: Collections.spur-nice.576
Ancestors: Collections-nice.576
Collections-nice.576 patched for Spur by SpurBootstrapMonticelloPackagePatcher Cog-eem.172
Convert a WriteStream into a ReadStream.
Beware, this version is optimized to avoid a copy, but is sharing some state.
Thus:
s := WriteStream on: String new.
self writeSomethingOn: s.
self readSomethingFrom: s readStream.
is a good replacement for:
s := ReadWriteStream on: String new.
self writeSomethingOn: s.
self readSomethingFrom: s reset
But avoid overwriting like this:
w := String new writeStream.
self writeSomethingOn: w.
r := w readStream.
self writeSomethingElseOn: w reset.
self compare: r to: w readStream.
=============================================
Eliot Miranda uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections.spur-nice.576.mcz
==================== Summary ====================
Name: Collections.spur-nice.576
Author: eem
Time: 24 July 2014, 11:17:50.427 am
UUID: 11b232ab-e47e-473c-8b0c-d737ff322bc6
Ancestors: Collections-nice.576
Collections-nice.576 patched for Spur by SpurBootstrapMonticelloPackagePatcher Cog-eem.172
Convert a WriteStream into a ReadStream.
Beware, this version is optimized to avoid a copy, but is sharing some state.
Thus:
s := WriteStream on: String new.
self writeSomethingOn: s.
self readSomethingFrom: s readStream.
is a good replacement for:
s := ReadWriteStream on: String new.
self writeSomethingOn: s.
self readSomethingFrom: s reset
But avoid overwriting like this:
w := String new writeStream.
self writeSomethingOn: w.
r := w readStream.
self writeSomethingElseOn: w reset.
self compare: r to: w readStream.
=============== Diff against Collections-nice.576 ===============
Item was changed:
==== ERROR ===
Error: Unrecognized class type
24 July 2014 9:18:39.186 pm
VM: unix - a SmalltalkImage
Image: Squeak3.11alpha [latest update: #8824]
SecurityManager state:
Restricted: false
FileAccess: true
SocketAccess: true
Working Dir /home/squeaksource
Trusted Dir /home/squeaksource/secure
Untrusted Dir /home/squeaksource/My Squeak
MCClassDefinition(Object)>>error:
Receiver: a MCClassDefinition(Character)
Arguments and temporary variables:
aString: 'Unrecognized class type'
Receiver's instance variables:
name: #Character
superclassName: #Magnitude
variables: an OrderedCollection(a MCClassVariableDefinition(CharacterTable) a M...etc...
category: #'Collections-Strings'
type: #immediate
comment: 'I represent a character by storing its associated Unicode. The first ...etc...
commentStamp: 'ar 4/9/2005 22:35'
traitComposition: nil
classTraitComposition: nil
MCClassDefinition>>kindOfSubclass
Receiver: a MCClassDefinition(Character)
Arguments and temporary variables:
Receiver's instance variables:
name: #Character
superclassName: #Magnitude
variables: an OrderedCollection(a MCClassVariableDefinition(CharacterTable) a M...etc...
category: #'Collections-Strings'
type: #immediate
comment: 'I represent a character by storing its associated Unicode. The first ...etc...
commentStamp: 'ar 4/9/2005 22:35'
traitComposition: nil
classTraitComposition: nil
MCClassDefinition>>printDefinitionOn:
Receiver: a MCClassDefinition(Character)
Arguments and temporary variables:
stream: a WriteStream
Receiver's instance variables:
name: #Character
superclassName: #Magnitude
variables: an OrderedCollection(a MCClassVariableDefinition(CharacterTable) a M...etc...
category: #'Collections-Strings'
type: #immediate
comment: 'I represent a character by storing its associated Unicode. The first ...etc...
commentStamp: 'ar 4/9/2005 22:35'
traitComposition: nil
classTraitComposition: nil
[] in MCDiffyTextWriter(MCStWriter)>>writeClassDefinition:
Receiver: a MCDiffyTextWriter
Arguments and temporary variables:
definition: a WriteStream
s: a MCClassDefinition(Character)
Receiver's instance variables:
stream: a WriteStream
initStream: nil
--- The full stack ---
MCClassDefinition(Object)>>error:
MCClassDefinition>>kindOfSubclass
MCClassDefinition>>printDefinitionOn:
[] in MCDiffyTextWriter(MCStWriter)>>writeClassDefinition:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
String class(SequenceableCollection class)>>new:streamContents:
String class(SequenceableCollection class)>>streamContents:
MCDiffyTextWriter(MCTextWriter)>>chunkContents:
MCDiffyTextWriter(MCStWriter)>>writeClassDefinition:
MCDiffyTextWriter(MCStWriter)>>visitClassDefinition:
MCClassDefinition>>accept:
[] in MCDiffyTextWriter(MCTextWriter)>>visitInFork:
String class(SequenceableCollection class)>>new:streamContents:
String class(SequenceableCollection class)>>streamContents:
MCDiffyTextWriter(MCTextWriter)>>visitInFork:
MCDiffyTextWriter>>writePatchFrom:to:
MCDiffyTextWriter>>writeModification:
[] in MCDiffyTextWriter>>writePatch:
SortedCollection(OrderedCollection)>>do:
MCDiffyTextWriter>>writePatch:
SSDiffyTextWriter>>writePatch:
[] in SSDiffyTextWriter>>writeVersion:for:
BlockClosure>>on:do:
SSDiffyTextWriter>>writeVersion:for:
[] in SSEMailSubscription>>versionAdded:to:
BlockClosure>>on:do:
SSEMailSubscription>>versionAdded:to:
[] in [] in SSProject>>versionAdded:
[] in BlockClosure>>newProcess