As everyone may already know, we (as in Squeak) are members of the Software Freedom Conservancy (sfconservancy.org) as a way to have a legal existence and so on.
Every now and then they try to raise some money to keep operating, and right now they have a big donation matching effort in progress. Please consider tossing a few dollars, euros, yen or what have you their way.
tim
--
tim Rowledge; tim(a)rowledge.org; http://www.rowledge.org/tim
We can rescue a hostage or bankrupt a system. Now, what would you like us to do?
Levente Uzonyi uploaded a new version of Collections to project The Inbox:
http://source.squeak.org/inbox/Collections-ul.812.mcz
==================== Summary ====================
Name: Collections-ul.812
Author: ul
Time: 5 December 2018, 7:11:14.545451 pm
UUID: b76e2bfa-1510-4380-8ce6-421c08623ce6
Ancestors: Collections-eem.811
Simple OrderedSet based on OrderedDictionary's implementation, but the order instance variable is an OrderedCollection, which simplifies a few things and makes #removeFirst and #removeLast O(1) (amortized).
=============== Diff against Collections-eem.811 ===============
Item was added:
+ Set subclass: #OrderedSet
+ instanceVariableNames: 'order'
+ classVariableNames: ''
+ poolDictionaries: ''
+ category: 'Collections-Sequenceable'!
+
+ !OrderedSet commentStamp: 'ul 12/4/2018 23:48' prior: 0!
+ I am an ordered set. I have an additional index (called 'order') to keep track of the insertion order of my objects.
+
+ Access and insertion time is not affected by the additional index.
+
+ Removal takes O(n) time in general, but it is O(1) to remove the first and last elements via #removeFirst and #removeLast, respectively.!
Item was added:
+ ----- Method: OrderedSet>>atIndex: (in category 'accessing') -----
+ atIndex: integer
+
+ ^order at: integer!
Item was added:
+ ----- Method: OrderedSet>>atIndex:ifAbsent: (in category 'accessing') -----
+ atIndex: integer ifAbsent: exceptionBlock
+ "As we are sequenceable, provide index-based access."
+
+ ^order at: integer ifAbsent: exceptionBlock!
Item was added:
+ ----- Method: OrderedSet>>atNewIndex:put: (in category 'private') -----
+ atNewIndex: index put: setElement
+
+ super atNewIndex: index put: setElement.
+ order addLast: setElement enclosedSetElement
+ !
Item was added:
+ ----- Method: OrderedSet>>copyFrom:to: (in category 'copying') -----
+ copyFrom: startIndex to: endIndex
+ "Answer a copy of the receiver that contains elements from position
+ startIndex to endIndex."
+
+ ^ self shallowCopy postCopyFrom: startIndex to: endIndex!
Item was added:
+ ----- Method: OrderedSet>>do: (in category 'enumerating') -----
+ do: aBlock
+ "Iterate over the order instead of the internal array."
+
+ order do: aBlock!
Item was added:
+ ----- Method: OrderedSet>>eighth (in category 'accessing') -----
+ eighth
+
+ ^order eighth!
Item was added:
+ ----- Method: OrderedSet>>fifth (in category 'accessing') -----
+ fifth
+
+ ^order fifth!
Item was added:
+ ----- Method: OrderedSet>>first (in category 'accessing') -----
+ first
+ "Answer the first element of the receiver"
+
+ ^order first!
Item was added:
+ ----- Method: OrderedSet>>first: (in category 'accessing') -----
+ first: n
+ "Answer the first n elements of the receiver.
+ Raise an error if there are not enough elements."
+
+ ^ self copyFrom: 1 to: n!
Item was added:
+ ----- Method: OrderedSet>>fourth (in category 'accessing') -----
+ fourth
+
+ ^order fourth!
Item was added:
+ ----- Method: OrderedSet>>initialize: (in category 'private') -----
+ initialize: n
+
+ super initialize: n.
+ order := OrderedCollection new: n!
Item was added:
+ ----- Method: OrderedSet>>isSorted (in category 'sorting') -----
+ isSorted
+ "Return true if the receiver is sorted by #<=."
+
+ ^order isSorted!
Item was added:
+ ----- Method: OrderedSet>>last (in category 'accessing') -----
+ last
+ "Answer the last element of the receiver"
+
+ ^order last!
Item was added:
+ ----- Method: OrderedSet>>last: (in category 'accessing') -----
+ last: n
+ "Answer the last n elements of the receiver.
+ Raise an error if there are not enough elements."
+
+ ^ self copyFrom: tally - n + 1 to: tally!
Item was added:
+ ----- Method: OrderedSet>>ninth (in category 'accessing') -----
+ ninth
+ "Answer the ninth element of the receiver.
+ Raise an error if there are not enough elements."
+
+ ^ self atIndex: 9!
Item was added:
+ ----- Method: OrderedSet>>postCopy (in category 'copying') -----
+ postCopy
+
+ super postCopy.
+ order := order copy!
Item was added:
+ ----- Method: OrderedSet>>postCopyFrom:to: (in category 'copying') -----
+ postCopyFrom: startIndex to: endIndex
+ "Adapted from SequenceableCollection and OrderedCollection."
+
+ tally := endIndex - startIndex + 1.
+ array := self class arrayType
+ new: (self class goodPrimeAtLeast: tally * 4 // 3). "fill up to ~75%"
+ order := order copyFrom: startIndex to: endIndex.
+ order do: [ :element | "TODO: do we need #enclosedSetElement?"
+ array at: (self scanFor: element) put: element].
+
+ !
Item was added:
+ ----- Method: OrderedSet>>remove:ifAbsent: (in category 'removing') -----
+ remove: anObject ifAbsent: aBlock
+
+ ^order remove: (super remove: anObject ifAbsent: [ ^aBlock value ])!
Item was added:
+ ----- Method: OrderedSet>>removeFirst (in category 'removing') -----
+ removeFirst
+
+ ^super remove: order removeFirst ifAbsent: nil!
Item was added:
+ ----- Method: OrderedSet>>removeLast (in category 'removing') -----
+ removeLast
+
+ ^super remove: order removeLast ifAbsent: nil!
Item was added:
+ ----- Method: OrderedSet>>second (in category 'accessing') -----
+ second
+
+ ^order second!
Item was added:
+ ----- Method: OrderedSet>>seventh (in category 'accessing') -----
+ seventh
+
+ ^order seventh!
Item was added:
+ ----- Method: OrderedSet>>sixth (in category 'accessing') -----
+ sixth
+
+ ^order sixth!
Item was added:
+ ----- Method: OrderedSet>>sort (in category 'sorting') -----
+ sort
+
+ self sort: nil!
Item was added:
+ ----- Method: OrderedSet>>sort: (in category 'sorting') -----
+ sort: aSortBlock
+ "Like in OrderedCollection, sort the associations according to the sort block."
+
+ tally <= 1 ifTrue: [ ^self ].
+ order sort: aSortBlock!
Item was added:
+ ----- Method: OrderedSet>>sorted: (in category 'sorting') -----
+ sorted: aSortBlockOrNil
+
+ ^ self copy sort: aSortBlockOrNil!
Item was added:
+ ----- Method: OrderedSet>>third (in category 'accessing') -----
+ third
+
+ ^order third!
Hi,
I think I found a bug with the named serial ports in windows.
I can open a named port without problem the first time but if I close it
and try to open it again it fails until I restart the image. This doesn't
happen with numeric ports. I could reproduce this bug in both Squeak5.2 and
Pharo6.1 (both using windows 8.1).
I think the problem is that SerialPort>>#primClosePortByName: calls the
"primitiveSerialPortCloseByName" but I couldn't find this primitive
anywhere in the SerialPlugin source (
https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/Cog/src/plugins/Seri…).
So I'm guessing that the port is never properly closed.
I added the missing primitive (find attached) and recompiled the vm, and
now it seems to work. So my question is: how can I contribute this small
fix? Should I commit to the VM Maker Inbox repository?
Thanks,
Richo
Marcel Taeumel uploaded a new version of 60Deprecated to project The Trunk:
http://source.squeak.org/trunk/60Deprecated-mt.27.mcz
==================== Summary ====================
Name: 60Deprecated-mt.27
Author: mt
Time: 2 December 2018, 11:11:20.814325 am
UUID: 0133c524-d990-db4f-8a76-de226601891d
Ancestors: 60Deprecated-pre.26
Deprecations from Morphic-mt.1468
=============== Diff against 60Deprecated-pre.26 ===============
Item was added:
+ ----- Method: BorderedMorph>>setBorderWidth:borderColor: (in category '*60Deprecated-private') -----
+ setBorderWidth: w borderColor: bc
+
+ self deprecated: 'mt: Use #borderStyle: or #borderWidth:/Color: directly.'.
+
+ self borderWidth: w.
+ self borderColor: bc.!
Item was added:
+ ----- Method: BorderedMorph>>setColor:borderWidth:borderColor: (in category '*60Deprecated-private') -----
+ setColor: c borderWidth: w borderColor: bc
+
+ self deprecated: 'mt: Use #borderStyle: or #borderWidth:/Color: directly.'.
+
+ self color: c.
+ self borderWidth: w.
+ self borderColor: bc.!
Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1468.mcz
==================== Summary ====================
Name: Morphic-mt.1468
Author: mt
Time: 2 December 2018, 11:09:37.078325 am
UUID: f2fb9cd4-6b5a-9941-adf6-0ecba9b669e5
Ancestors: Morphic-mt.1467
Two minor fixes in the realm of BorderedMorph:
1) Fixes a small issue with translucent borders.
2) Deprecates two set* messages.
=============== Diff against Morphic-mt.1467 ===============
Item was removed:
- ----- Method: BorderedMorph>>setBorderWidth:borderColor: (in category 'private') -----
- setBorderWidth: w borderColor: bc
- self borderWidth: w.
- self borderColor: bc.!
Item was removed:
- ----- Method: BorderedMorph>>setColor:borderWidth:borderColor: (in category 'private') -----
- setColor: c borderWidth: w borderColor: bc
- self color: c.
- self borderWidth: w.
- self borderColor: bc.!
Item was changed:
----- Method: FormCanvas>>frameAndFillRectangle:fillColor:borderWidth:topLeftColor:bottomRightColor: (in category 'drawing-rectangles') -----
frameAndFillRectangle: r fillColor: fillColor borderWidth: borderWidth topLeftColor: topLeftColor bottomRightColor: bottomRightColor
| w h rect |
"First use quick code for top and left borders and fill"
self frameAndFillRectangle: r
fillColor: fillColor
borderWidth: borderWidth
borderColor: topLeftColor.
+
+ "Return here for duplicate colors. Makes translucent borders work better."
+ topLeftColor = bottomRightColor ifTrue: [^ self].
"Now use slow code for bevelled bottom and right borders"
bottomRightColor isTransparent ifFalse: [
borderWidth isNumber
ifTrue: [w := h := borderWidth]
ifFalse: [w := borderWidth x. h := borderWidth y].
rect := r translateBy: origin.
self setFillColor: bottomRightColor.
port
frameRectRight: rect width: w;
frameRectBottom: rect height: h].
!
Item was changed:
----- Method: MorphHierarchyListMorph>>createContainer (in category 'private') -----
createContainer
"Private - Create a container"
| container |
container := BorderedMorph new.
container extent: (self world extent * (1 / 4 @ (2 / 3))) rounded.
container layoutPolicy: TableLayout new.
container hResizing: #rigid.
container vResizing: #rigid.
container
+ color: (Color gray: 0.9);
+ borderWidth: 1;
- setColor: (Color gray: 0.9)
- borderWidth: 1
borderColor: Color gray.
container layoutInset: 0.
"container useRoundedCorners."
""
container setProperty: #morphHierarchy toValue: true.
container setNameTo: 'Objects Hierarchy' translated.
""
^ container!