David T. Lewis uploaded a new version of MorphicExtras to project The Trunk:
http://source.squeak.org/trunk/MorphicExtras-ms.254.mcz
==================== Summary ====================
Name: MorphicExtras-ms.254
Author: ms
Time: 22 March 2019, 1:48:31.043664 pm
UUID: d7b3adea-c5be-47f1-8247-7c5ae1ad7f34
Ancestors: MorphicExtras-kfr.253
Adds a preview morph for results of all BitBlt rules.
When first using BitBlt, it wasn't easy to understand the effects of the possible rules on pixel combinating for me.
I implemented two example methods which preview the effects of rule 0 to 41 (these are all, I believe) on quadratic existing forms with colors and 1 bit alpha channel (previewAllBitBltRules uses ToolIcons flag/collection) plus Forms with more alpha values (previewAllBitBltRulesWithAlpha uses ToolIcons flag and a Color red + 0.4 alpha preview). They generate a combined morph for all rules applied on these forms (scaled, because icons are small) and opens it in your hand.
Internally, this morph can be generated for any rule, forms and scale. Rules which throw exceptions are replaced with a fallback form.
Now in the correct package (see http://forum.world.st/The-Inbox-Graphics-ms-407-mcz-td5097206.html ).
Thank you for your feedback!
=============== Diff against MorphicExtras-kfr.253 ===============
Item was added:
+ ----- Method: BitBlt class>>previewAllBitBltRules (in category '*MorphicExtras') -----
+ previewAllBitBltRules
+
+ (self previewBitBltRules: (0 to: 41)
+ on: ToolIcons flag
+ and: ToolIcons collection
+ fallback: ToolIcons exception
+ scaledTo: 32) openInHand.!
Item was added:
+ ----- Method: BitBlt class>>previewAllBitBltRulesWithAlpha (in category '*MorphicExtras') -----
+ previewAllBitBltRulesWithAlpha
+
+ (self previewBitBltRules: (0 to: 41)
+ on: ToolIcons flag
+ and: ((Color red alpha: 0.4) iconOrThumbnailOfSize: 12)
+ fallback: ToolIcons exception
+ scaledTo: 32) openInHand.!
Item was added:
+ ----- Method: BitBlt class>>previewBitBltRules:on:and:fallback:scaledTo: (in category '*MorphicExtras') -----
+ previewBitBltRules: rules on: aForm1 and: aForm2 fallback: fallbackForm scaledTo: aNumberOrPoint
+ "Returns a combined morph of the result of each rule applied on aForm1 combined with
+ aForm2 scaled to aNumberOrPoint. If the combination faild with a rule, fallbackForm is
+ shown instead. The number of each rule is appended at the bottom of each result."
+
+ | resultMorph tileExtent |
+ tileExtent := aNumberOrPoint asPoint.
+ resultMorph := Morph new
+ color: Color transparent;
+ extent: (rules size * tileExtent x)@tileExtent y;
+ yourself.
+
+ rules withIndexDo: [ :rule :index | | form formMorph numberLabel |
+ form := aForm1 copy.
+ [aForm2 copy displayOn: form at: 0@0 rule: rule]
+ on: Exception
+ do: [form := fallbackForm].
+ formMorph := (form scaledToSize: tileExtent) asMorph
+ position: (index*tileExtent x)@0;
+ yourself.
+ resultMorph addMorph: formMorph.
+
+ numberLabel := rule asString asMorph
+ center: ((index+0.5)*tileExtent x)@tileExtent y;
+ yourself.
+ resultMorph addMorph: numberLabel].
+
+ ^ resultMorph!
A new version of MorphicExtras was added to project The Inbox:
http://source.squeak.org/inbox/MorphicExtras-ms.254.mcz
==================== Summary ====================
Name: MorphicExtras-ms.254
Author: ms
Time: 22 March 2019, 1:48:31.043664 pm
UUID: d7b3adea-c5be-47f1-8247-7c5ae1ad7f34
Ancestors: MorphicExtras-kfr.253
Adds a preview morph for results of all BitBlt rules.
When first using BitBlt, it wasn't easy to understand the effects of the possible rules on pixel combinating for me.
I implemented two example methods which preview the effects of rule 0 to 41 (these are all, I believe) on quadratic existing forms with colors and 1 bit alpha channel (previewAllBitBltRules uses ToolIcons flag/collection) plus Forms with more alpha values (previewAllBitBltRulesWithAlpha uses ToolIcons flag and a Color red + 0.4 alpha preview). They generate a combined morph for all rules applied on these forms (scaled, because icons are small) and opens it in your hand.
Internally, this morph can be generated for any rule, forms and scale. Rules which throw exceptions are replaced with a fallback form.
Now in the correct package (see http://forum.world.st/The-Inbox-Graphics-ms-407-mcz-td5097206.html ).
Thank you for your feedback!
=============== Diff against MorphicExtras-kfr.253 ===============
Item was added:
+ ----- Method: BitBlt class>>previewAllBitBltRules (in category '*MorphicExtras') -----
+ previewAllBitBltRules
+
+ (self previewBitBltRules: (0 to: 41)
+ on: ToolIcons flag
+ and: ToolIcons collection
+ fallback: ToolIcons exception
+ scaledTo: 32) openInHand.!
Item was added:
+ ----- Method: BitBlt class>>previewAllBitBltRulesWithAlpha (in category '*MorphicExtras') -----
+ previewAllBitBltRulesWithAlpha
+
+ (self previewBitBltRules: (0 to: 41)
+ on: ToolIcons flag
+ and: ((Color red alpha: 0.4) iconOrThumbnailOfSize: 12)
+ fallback: ToolIcons exception
+ scaledTo: 32) openInHand.!
Item was added:
+ ----- Method: BitBlt class>>previewBitBltRules:on:and:fallback:scaledTo: (in category '*MorphicExtras') -----
+ previewBitBltRules: rules on: aForm1 and: aForm2 fallback: fallbackForm scaledTo: aNumberOrPoint
+ "Returns a combined morph of the result of each rule applied on aForm1 combined with
+ aForm2 scaled to aNumberOrPoint. If the combination faild with a rule, fallbackForm is
+ shown instead. The number of each rule is appended at the bottom of each result."
+
+ | resultMorph tileExtent |
+ tileExtent := aNumberOrPoint asPoint.
+ resultMorph := Morph new
+ color: Color transparent;
+ extent: (rules size * tileExtent x)@tileExtent y;
+ yourself.
+
+ rules withIndexDo: [ :rule :index | | form formMorph numberLabel |
+ form := aForm1 copy.
+ [aForm2 copy displayOn: form at: 0@0 rule: rule]
+ on: Exception
+ do: [form := fallbackForm].
+ formMorph := (form scaledToSize: tileExtent) asMorph
+ position: (index*tileExtent x)@0;
+ yourself.
+ resultMorph addMorph: formMorph.
+
+ numberLabel := rule asString asMorph
+ center: ((index+0.5)*tileExtent x)@tileExtent y;
+ yourself.
+ resultMorph addMorph: numberLabel].
+
+ ^ resultMorph!
Levente Uzonyi uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-ul.823.mcz
==================== Summary ====================
Name: Collections-ul.823
Author: ul
Time: 22 March 2019, 12:04:40.596433 pm
UUID: 2fef1e34-e45a-4f70-bb7b-56aa1c610df9
Ancestors: Collections-pre.822
Fixed bug in Heap >> #upHeap:. When the first element of a Heap was removed, the index of the first object was not always updated.
=============== Diff against Collections-pre.822 ===============
Item was changed:
----- Method: Heap>>upHeap: (in category 'private-heap') -----
upHeap: anIndex
"Check the heap upwards for correctness starting at anIndex.
Everything below anIndex is ok."
| index parentValue parentIndex value |
+ anIndex = 1 ifTrue: [
+ indexUpdateBlock ifNotNil: [ indexUpdateBlock value: (array at: 1) value: 1 ].
+ ^self ].
- anIndex = 1 ifTrue: [ ^self ].
value := array at: (index := anIndex).
[ index > 1 and: [
parentValue := array at: (parentIndex := index bitShift: -1).
sortBlock
ifNil: [ value <= parentValue ]
ifNotNil: [ sortBlock value: value value: parentValue ] ] ]
whileTrue: [
array at: index put: parentValue.
indexUpdateBlock ifNotNil: [ indexUpdateBlock value: parentValue value: index ].
index := parentIndex ].
array at: index put: value.
indexUpdateBlock ifNotNil: [ indexUpdateBlock value: value value: index ]!
A new version of Graphics was added to project The Inbox:
http://source.squeak.org/inbox/Graphics-ms.407.mcz
==================== Summary ====================
Name: Graphics-ms.407
Author: ms
Time: 20 March 2019, 1:51:42.768596 pm
UUID: 40a66bd7-815f-43f7-bbd0-31dc8da3a483
Ancestors: Graphics-mt.406
Adds a preview morph for results of all BitBlt rules.
When first using BitBlt, it wasn't easy to understand the effects of the possible rules on pixel combinating for me.
I implemented two example methods which preview the effects of rule 0 to 41 (these are all, I believe) on quadratic existing forms with colors and 1 bit alpha channel (previewAllBitBltRules uses ToolIcons flag/collection) plus Forms with more alpha values (previewAllBitBltRulesWithAlpha uses ToolIcons flag and a Color red + 0.4 alpha preview). They generate a combined morph for all rules applied on these forms (scaled, because icons are small) and opens it in your hand.
Internally, this morph can be generated for any rule, forms and scale. Rules which throw exceptions are replaced with a fallback form.
=============== Diff against Graphics-mt.406 ===============
Item was added:
+ ----- Method: BitBlt class>>previewAllBitBltRules (in category 'examples') -----
+ previewAllBitBltRules
+
+ (self previewBitBltRules: (0 to: 41)
+ on: ToolIcons flag
+ and: ToolIcons collection
+ fallback: ToolIcons exception
+ scaledTo: 32) openInHand.!
Item was added:
+ ----- Method: BitBlt class>>previewAllBitBltRulesWithAlpha (in category 'examples') -----
+ previewAllBitBltRulesWithAlpha
+
+ (self previewBitBltRules: (0 to: 41)
+ on: ToolIcons flag
+ and: ((Color red alpha: 0.4) iconOrThumbnailOfSize: 12)
+ fallback: ToolIcons exception
+ scaledTo: 32) openInHand.!
Item was added:
+ ----- Method: BitBlt class>>previewBitBltRules:on:and:fallback:scaledTo: (in category 'examples') -----
+ previewBitBltRules: rules on: aForm1 and: aForm2 fallback: fallbackForm scaledTo: aNumberOrPoint
+ "Returns a combined morph of the result of each rule applied on aForm1 combined with
+ aForm2 scaled to aNumberOrPoint. If the combination faild with a rule, fallbackForm is
+ shown instead. The number of each rule is appended at the bottom of each result."
+
+ | resultMorph tileExtent |
+ tileExtent := aNumberOrPoint asPoint.
+ resultMorph := Morph new
+ color: Color transparent;
+ extent: (rules size * tileExtent x)@tileExtent y;
+ yourself.
+
+ rules withIndexDo: [ :rule :index | | form formMorph numberLabel |
+ form := aForm1 copy.
+ [aForm2 copy displayOn: form at: 0@0 rule: rule]
+ on: Exception
+ do: [form := fallbackForm].
+ formMorph := (form scaledToSize: tileExtent) asMorph
+ position: (index*tileExtent x)@0;
+ yourself.
+ resultMorph addMorph: formMorph.
+
+ numberLabel := rule asString asMorph
+ center: ((index+0.5)*tileExtent x)@tileExtent y;
+ yourself.
+ resultMorph addMorph: numberLabel].
+
+ ^ resultMorph!
Hi Gabriel,
On Thu, Mar 21, 2019 at 1:15 PM Gabriel Cotelli <g.cotelli(a)gmail.com> wrote:
>
> https://raw.githubusercontent.com/OpenSmalltalk/opensmalltalk-vm/1a09bae437…
> and save as ?
>
great. This works (provided one selects "Page Source"). But how did you
get to that link?
>
> On Thu, Mar 21, 2019 at 5:01 PM Eliot Miranda <eliot.miranda(a)gmail.com>
> wrote:
>
>> Hi GitHub mavens,
>>
>> how does one download a specific patched file from GitHub? I want
>> to test Pablo's fix here:
>>
>> https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/381
>> platforms/iOS/vm/OSX/sqSqueakOSXOpenGLView.m
>> <https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/381/files#diff-0>
>>
>> I don't want to go through "View File", or clone, or anything else. I
>> just want the file itself. How do I get it?
>>
>> _,,,^..^,,,_
>> best, Eliot
>>
>
--
_,,,^..^,,,_
best, Eliot
Looking at the code I had a minor issue with the other day when loading from SqueakMap, I see what looks like a good opportunity to cleanup and simplify some classes. Since I'm most definitely not an expert in sockets and web interfaces etc I think some input from those of you more knowledgeable would be very helpful.
SqueakMap uses an HttpSocket directly to load; this has a problem in that the only error detection is to check the response for being a String. Which isn't the most robust or helpful technique. RBInternalSpellCheck does much the same, as do a few other users of #httpGet: (as an example).
InstallerInternetBased uses an http socket and checks the response for responding to #reset (I imagine as a proxy for stream-like behaviour?) which doesn't seem long-term robust.
Worst of all quite a few users of #httpGet: don't do any sort of checking and so will just dump users into a debugger; not our best look.
I know that WebClient is a somewhat heavier class but it does seem to do a lot more helpful things like handling redirects and so on as well as some better error testing. Would it be sensible to convert as much as practical to use WebClient instead of a plain HttpSocket? Might it be better to improve HttpSocket?
Some related stuff - there is an HttpClient class as well, unconnected to WebClient but used in several important looking places. Can that be improved or merged? At the very least it would be good to be able to document and comment code to explain why so many classes exist.
tim
--
tim Rowledge; tim(a)rowledge.org; http://www.rowledge.org/tim
Strange OpCodes: TOAC: Turn Off Air Conditioner
A new version of Morphic was added to project The Inbox:
http://source.squeak.org/inbox/Morphic-LB.1465.mcz
==================== Summary ====================
Name: Morphic-LB.1465
Author: LB
Time: 21 March 2019, 10:29:53.207601 am
UUID: 771444aa-6f73-e64a-8111-6af3e69e9525
Ancestors: Morphic-eem.1464
SystemWindow#replacePane:with: had an unexpected side effect changing the color of the pane put in place to transparent. This limited it's use as it is unwanted.
=============== Diff against Morphic-eem.1464 ===============
Item was changed:
----- Method: SystemWindow>>replacePane:with: (in category 'panes') -----
replacePane: oldPane with: newPane
"Make newPane exactly occupy the position and extent of oldPane"
| aLayoutFrame hadDep |
hadDep := model dependents includes: oldPane.
oldPane owner replaceSubmorph: oldPane by: newPane.
newPane
position: oldPane position;
extent: oldPane extent.
aLayoutFrame := oldPane layoutFrame.
paneMorphs := paneMorphs collect:
[:each |
each == oldPane ifTrue: [newPane] ifFalse: [each]].
aLayoutFrame ifNotNil: [newPane layoutFrame: aLayoutFrame].
- newPane color: Color transparent.
hadDep ifTrue: [model removeDependent: oldPane. model addDependent: newPane].
self changed
!