Pharo-dev
By thread
pharo-dev@lists.pharo.org
By month
Messages by month
- ----- 2026 -----
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
March 2016
- 716 messages
Re: [Pharo-dev] [Pharo-users] Call about Numerical Methods in Pharo :)
by Blondeau Vincent
Hi Alex,
This binding allows to execute (almost) any function provided by R via Native Calls.
You can find some documentation here: http://smalltalkhub.com/#!/~VincentBlondeau/RProjectConnector
I just released a new stable version, you should be able to load it from the catalog (Pharo40 only).
However, you must install R and copy the libraries in the VM folder (see doc).
And it is working only with pre-spur images (the migration to FFI has to be done).
Try to run the tests (in RConnector package). Iff they are green, you succeeded to configure the binding.
And you can plot the famous Iris Data:
iris := 'eval' asREval: { RObject findVar: 'iris' }.
'plot'
asREval:
{(iris at: 'Petal.Length').
(iris at: 'Petal.Width').
(#pch -> 21).
(#xlab -> 'length').
(#ylab -> 'Width').
(#bg ->((iris at: 'Species') collect: [ :value | {'red'. 'green3'. 'blue'} at: value ])).
(#main -> 'Edgar Anderson''s Iris Data')}.
plot(iris$Petal.Length, iris$Petal.Width, pch=21, bg=c("red","green3","blue")[unclass(iris$Species)], main="Edgar Anderson's Iris Data")
is the genuine R function.
And inspect them:
iris inspect
You can use any collection of pharo and put it as argument, it should do the boxing automatically.
Warning: while testing new functions, donât forget to save because evaluation of a non-existing R function throws a error that is not caught and makes Pharo crashing.
Cheers,
Vincent
De : Pharo-dev [mailto:pharo-dev-bounces@lists.pharo.org] De la part de Alexandre Bergel
Envoyé : mardi 8 mars 2016 20:23
à : Any question about pharo is welcome
Cc : Didier Besset; Souissi Sami; Pharo Development List
Objet : Re: [Pharo-dev] [Pharo-users] Call about Numerical Methods in Pharo :)
Vincent, can you tell a bit more what this binding is about?
how can I try?
Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
On Mar 3, 2016, at 6:43 AM, Blondeau Vincent <vincent.blondeau(a)worldline.com<mailto:vincent.blondeau@worldline.com>> wrote:
Hi,
That's a very good idea.
For now, I use a Pharo-R binding to make the statistics, but it is better if it is directly in the image.
For my part, it should be nice to have:
- Principal Component Analysis
- Time series
- Correlation with several variables (Correlation matrix) + significance tests (pearson, spearman...)
- Standard statistical tests: normality, variance, mean, distribution
- And the more important is to have nice tools to visualize the data (Box plot, histogram, scatterplots, PCA ones) with a simple API for standard things but that we can customize. The best is that we are able to draw regression lines on them. But I think that is more a Roassal part.
Thanks for the initiative,
Cheers,
Vincent
-----Message d'origine-----
De : Pharo-users [mailto:pharo-users-bounces@lists.pharo.org] De la part de
stepharo
Envoyé : mercredi 2 mars 2016 14:17
à : Pharo Development List; Any question about pharo is welcome; Didier
Besset; Souissi Sami
Objet : [Pharo-users] Call about Numerical Methods in Pharo :)
Hi guys
I met Didier Besset and we had a great hacking session and discussions with
Serge Stinckwich.
Didier would like to help Pharo and the numerical part of it. ***Big
thanks*** Didier.
We would like to do several things:
- Work on "Hows to"
The numerical methods in Pharo is good but the gap between us and the
math is too large :)
so the idea is to have a series of "how to ..."
- histomgram (simple, based on distribution)
- Improve the SciPharo/NumPha (previously SciSmalltalk) library
This morning we started to implement a
ComponentPrincipalDecomposition by combining two of the
objects available in SciPharo.
Then we started to enhance the distributions to make sure that we can
plug other distribution for having
controlled random number.
- Do a public call to know what is missing for you: this is this mail :)
Didier would like to work on concrete cases. I love that attitude
So tell us :)
Hernan ??
Alex: ?? pvalue? better distribution?
Vincent: covariance? CPA?
Philippe: times series
Serge R frames?
Sami: Better random number and various distributions?
- Organise a two day lectures with practices on concrete case in September
with a recording session.
Either at IRD Bondy or Lille.
- Make sure that the Numerical Method book will get on lulu :) with a
better cover and title :)
Stef
!!!*************************************************************************************
"Ce message et les pièces jointes sont confidentiels et réservés à l'usage exclusif de ses destinataires. Il peut également être protégé par le secret professionnel. Si vous recevez ce message par erreur, merci d'en avertir immédiatement l'expéditeur et de le détruire. L'intégrité du message ne pouvant être assurée sur Internet, la responsabilité de Worldline ne pourra être recherchée quant au contenu de ce message. Bien que les meilleurs efforts soient faits pour maintenir cette transmission exempte de tout virus, l'expéditeur ne donne aucune garantie à cet égard et sa responsabilité ne saurait être recherchée pour tout dommage résultant d'un virus transmis.
This e-mail and the documents attached are confidential and intended solely for the addressee; it may also be privileged. If you receive this e-mail in error, please notify the sender immediately and destroy it. As its integrity cannot be secured on the Internet, the Worldline liability cannot be triggered for the message content. Although the sender endeavours to maintain a computer virus-free network, the sender does not warrant that this transmission is virus-free and will not be liable for any damages resulting from any virus transmitted.!!!"
!!!*************************************************************************************
"Ce message et les pièces jointes sont confidentiels et réservés à l'usage exclusif de ses destinataires. Il peut également être protégé par le secret professionnel. Si vous recevez ce message par erreur, merci d'en avertir immédiatement l'expéditeur et de le détruire. L'intégrité du message ne pouvant être assurée sur Internet, la responsabilité de Worldline ne pourra être recherchée quant au contenu de ce message. Bien que les meilleurs efforts soient faits pour maintenir cette transmission exempte de tout virus, l'expéditeur ne donne aucune garantie à cet égard et sa responsabilité ne saurait être recherchée pour tout dommage résultant d'un virus transmis.
This e-mail and the documents attached are confidential and intended solely for the addressee; it may also be privileged. If you receive this e-mail in error, please notify the sender immediately and destroy it. As its integrity cannot be secured on the Internet, the Worldline liability cannot be triggered for the message content. Although the sender endeavours to maintain a computer virus-free network, the sender does not warrant that this transmission is virus-free and will not be liable for any damages resulting from any virus transmitted.!!!"
March 9, 2016
Re: [Pharo-dev] [squeak-dev] Re: [Vm-dev] strange array instance
by Eliot Miranda
On Wed, Mar 9, 2016 at 3:08 AM, Stéphane Ducasse <stephane.ducasse(a)inria.fr>
wrote:
> Hi eliot
>
> Do not worry.
> Now would it be possible to have a test or something like that that would
> help us
> to
> - document this part of the system
> - check that the system is in a coherent state
>
> Stef
>
Yes, watch this space. I should have the work done by tomorrow. And the
64-bit system will be a tiny bit smaller and faster :-)
On 09 Mar 2016, at 10:26, Eliot Miranda <eliot.miranda(a)gmail.com> wrote:
>
> Um, under /no/ circumstances do what I'm suggesting below. It will screw
> up 320bit images completely. I've just turned odd SmallIntegers into
> SmallFloat54's in 32-bit Squeak. I hope I won't destroy too many people's
> images. This is perhaps my worst blunder.
>
> On Tue, Mar 8, 2016 at 10:38 AM, Eliot Miranda <eliot.miranda(a)gmail.com>
> wrote:
>
>> Hi Pavel,
>>
>> On Tue, Mar 8, 2016 at 1:40 AM, Pavel Krivanek <pavel.krivanek(a)gmail.com>
>> wrote:
>>
>>> Hi,
>>>
>>> there is a strange array of size 1024 in the Pharo image that is not
>>> eaten by garbage collector even if no object points to it. I guess it is
>>> related to Spur.
>>>
>>> ((Array allInstances select: [ :i | i size = 1024 ])
>>> select: [ :a | a second = SmallInteger ]) pointersTo
>>>
>>> What is it and is it accessible somehow?
>>>
>>
>> It is indeed the first class table page. It looks like an old bug. The
>> oldest Spur image I can start up has the problem. The way that class
>> table pages are hidden is that they have a class index which is not that of
>> Array. Array is at index 52 in the class table (51 zero-relative, Array
>> identityHash = 51), but it is also at index 17 (16 zero-relative). Array
>> allInstances looks for objects whose class index is 51, hence not seeing
>> the class table pages, which all (but the first) have class index 16.
>>
>> Luckily we can fix the problem easily, and we can fix another problem at
>> the same time, which is that SmallFloat64 has the wrong hash.
>>
>> The class table is two-level; a (hidden) array of Arrays. Classes are in
>> the class table at their identityHashes (so that to instantiate a class one
>> copies the class's identity hash into the classIndex of the new instance
>> instead of having to search the class table). But when SmallFloat64 was
>> created in the 32-bit image I forgot to give it the right hash and store it
>> in the class table. (there are no SmallFloat64 instances in a 32-bit
>> image, only in 64-bits).
>>
>> So we can first change SmallFloat64's hash to 3, which is what the Spur
>> 64-bit VM and image require, and enter it into the first class table page,
>> and then we can make the first class table page disappear.
>>
>>
>> | firstClassTablePage clone |
>> "The first class table page is the first Array instance. Of course this
>> is a bug."
>> firstClassTablePage := Array someInstance.
>>
>> "It should contain only nil and classes."
>> self assert: (firstClassTablePage allSatisfy: [:e| e == nil or: [e
>> isBehavior]]).
>>
>> "And its first 17 elements should only be the immediate classes and
>> Array, since Array is used as the class pun for class table pages, with
>> index 17 (16 zero-relative)"
>> self assert: (firstClassTablePage first: 17) asSet = {nil. SmallInteger.
>> Character. Array} asSet.
>>
>> "It just so happens that the second Array is the specialSelectors"
>> self assert: Array someInstance nextInstance == Smalltalk
>> specialSelectors.
>>
>> "Store SmallFloat64 in the first class table page at index 4 (3
>> zero-relative)."
>> firstClassTablePage at: 4 put: SmallFloat64.
>>
>> "Use the secret set identity hash primitive to set SmallFloat64's
>> identityHash to 3."
>> SmallFloat64 tryPrimitive: 161 withArgs: #(3).
>>
>> "Now create an object that looks like Array class, but has identityHash
>> 16."
>> "Take a shallow copy of Array class."
>> clone := Array shallowCopy.
>> "Change it into an Array."
>> Array adoptInstance: clone.
>> "Set its identityHash to 16."
>> clone tryPrimitive: 161 withArgs: #(16).
>> "Use the adoptInstance: primitive to ``set the class of the
>> firstClassTablePage to the cone''.
>> or, more accurately, to set the firstClassTablePage's class index to 16."
>> clone tryPrimitive: 160 withArgs: {firstClassTablePage}
>>
>>
>> With the above done, we can check that everything is ok."
>> self assert: SmallFloat64 identityHash = 3.
>> self assert: Array someInstance == Smalltalk specialSelectors.
>> "A class table page is 1024 slots, contains only nil or behaviours, and
>> contains at least one behaviour (is not all nils). There shouldn't be any
>> that we can find."
>> self assert: (self systemNavigation allObjects select: [:o| o isArray
>> and: [o size = 1024 and: [(o allSatisfy: [:e| e == nil or: [e isBehavior]])
>> and: [o anySatisfy: [:e| e isBehavior]]]]]) size = 0
>>
>>
>> I recommend you create an update map. Then create a version of kernel
>> with a post-load action, written something like this:
>>
>>
>> (Array someInstance size = 1014
>> and: [(Array someInstance allSatisfy: [:e| e == nil or: [e isBehavior]])
>> and: [(firstClassTablePage first: 17) asSet = {nil. SmallInteger.
>> Character. Array} asSet]]) ifTrue:
>> [| firstClassTablePage clone |
>> firstClassTablePage := Array someInstance.
>> self assert: (firstClassTablePage allSatisfy: [:e| e == nil or: [e
>> isBehavior]]).
>> self assert: (firstClassTablePage first: 17) asSet = {nil. SmallInteger.
>> Character. Array} asSet.
>> firstClassTablePage at: 4 put: SmallFloat64.
>> SmallFloat64 tryPrimitive: 161 withArgs: #(3).
>> clone := Array shallowCopy.
>> Array adoptInstance: clone.
>> clone tryPrimitive: 161 withArgs: #(16).
>> clone tryPrimitive: 160 withArgs: {Array someInstance}
>> self assert: SmallFloat64 identityHash = 3.
>> self assert: (Array someInstance first: 4) = {nil. SmallInteger.
>> Character. SmallFloat64}]
>>
>> Then create a second update map to ensure that that version of Kernel is
>> loaded.
>>
>> I will do this for Squeak immediately.
>>
>>
>> Apologies.
>>
>> P.S. Interestingly enough, it shows what a horrible security hole the
>> debugger primitives tryPrimitive:withArgs: and tryNamedPrimitive:withArgs:
>> are.
>>
>> Cheers,
>>> -- Pavel
>>>
>>
>> _,,,^..^,,,_
>> best, Eliot
>>
>
>
>
> --
> _,,,^..^,,,_
> best, Eliot
>
>
> --------------------------------------------
> Stéphane Ducasse
> http://stephane.ducasse.free.fr
> http://www.synectique.eu / http://www.pharo.org
> 03 59 35 87 52
> Assistant: Julie Jonas
> 03 59 57 78 50
> 03 59 35 86 16
>
> S. Ducasse - Inria
> 40, avenue Halley,
> Parc Scientifique de la Haute Borne, Bât.A, Park Plaza
> Villeneuve d'Ascq 59650
> France
>
>
>
>
>
--
_,,,^..^,,,_
best, Eliot
March 9, 2016
[pharo-project/pharo-core]
by GitHub
Branch: refs/tags/50633
Home: https://github.com/pharo-project/pharo-core
March 9, 2016
[pharo-project/pharo-core] 2227ab: 50633
by GitHub
Branch: refs/heads/5.0
Home: https://github.com/pharo-project/pharo-core
Commit: 2227ab165dd3b0114bf7db52f66d1c6beedf9974
https://github.com/pharo-project/pharo-core/commit/2227ab165dd3b0114bf7db52…
Author: Jenkins Build Server <board(a)pharo-project.org>
Date: 2016-03-09 (Wed, 09 Mar 2016)
Changed paths:
M ConfigurationOfFastTable.package/ConfigurationOfFastTable.class/instance/baselines/baseline03_.st
M ConfigurationOfFastTable.package/ConfigurationOfFastTable.class/instance/symbolic versions/stable_.st
A ConfigurationOfFastTable.package/ConfigurationOfFastTable.class/instance/versions/version0101_.st
A ConfigurationOfRubric.package/ConfigurationOfRubric.class/class/loading/load.st
M ConfigurationOfRubric.package/ConfigurationOfRubric.class/instance/symbolic versions/stable_.st
A ConfigurationOfRubric.package/ConfigurationOfRubric.class/instance/versions/version210_.st
A ConfigurationOfRubric.package/ConfigurationOfRubric.class/instance/versions/version211_.st
M Kernel.package/Point.class/instance/truncation and round off/ceiling.st
M Kernel.package/Point.class/instance/truncation and round off/floor.st
M Kernel.package/Point.class/instance/truncation and round off/rounded.st
M Kernel.package/Point.class/instance/truncation and round off/truncated.st
A Morphic-Base.package/CircleMorph.class/instance/initialization/defaultBounds.st
A Morphic-Base.package/CircleMorph.class/instance/initialization/defaultColor.st
R Morphic-Base.package/CircleMorph.class/instance/initialization/initialize.st
R Morphic-Widgets-FastTable.package/FTDataSource.class/instance/accessing/elementAt_.st
A Morphic-Widgets-FastTable.package/FTDataSource.class/instance/drag and drop/passengerAt_.st
A Morphic-Widgets-FastTable.package/FTDataSource.class/instance/private/elementAt_.st
M Morphic-Widgets-FastTable.package/FTTableMorph.class/instance/drag and drop/startDrag_.st
M Rubric.package/RubParagraph.class/instance/editing/actionAttributesUnder_event_do_.st
M Rubric.package/RubParagraph.class/instance/editing/click_for_controller_.st
R Rubric.package/RubSHTextStylerST80.class/instance/private/addLinkAttributesFor_in_to_.st
R Rubric.package/RubSHTextStylerST80.class/instance/private/resolveTextLinkFor_.st
R Rubric.package/RubSHTextStylerST80.class/instance/visiting rb nodes/visitLiteralNode_.st
M Rubric.package/RubSHTextStylerST80.class/instance/visiting rb nodes/visitMessageNode_.st
M Rubric.package/RubSHTextStylerST80.class/instance/visiting rb nodes/visitMethodNode_.st
R Rubric.package/RubTextClassLink.class/README.md
R Rubric.package/RubTextClassLink.class/class/instance creation/className_.st
R Rubric.package/RubTextClassLink.class/class/instance creation/class_.st
R Rubric.package/RubTextClassLink.class/definition.st
R Rubric.package/RubTextClassLink.class/instance/accessing/className_.st
R Rubric.package/RubTextClassLink.class/instance/evaluating/actOnClick_for_in_editor_.st
R Rubric.package/RubTextClassLink.class/instance/system primitives/className.st
R Rubric.package/RubTextLink.class/README.md
R Rubric.package/RubTextLink.class/definition.st
R Rubric.package/RubTextLink.class/instance/testing/mayActOnEvent_.st
R Rubric.package/RubTextMethodLink.class/README.md
R Rubric.package/RubTextMethodLink.class/class/instance creation/selector_.st
R Rubric.package/RubTextMethodLink.class/class/instance creation/selector_senders_.st
R Rubric.package/RubTextMethodLink.class/definition.st
R Rubric.package/RubTextMethodLink.class/instance/accessing/selector.st
R Rubric.package/RubTextMethodLink.class/instance/accessing/selector_.st
R Rubric.package/RubTextMethodLink.class/instance/accessing/senders_.st
R Rubric.package/RubTextMethodLink.class/instance/event handling/actOnClick_for_in_editor_.st
R Rubric.package/RubTextMethodLink.class/instance/initialization/initialize.st
R Rubric.package/RubTextVariableLink.class/README.md
R Rubric.package/RubTextVariableLink.class/class/instance creation/variableName_.st
R Rubric.package/RubTextVariableLink.class/definition.st
R Rubric.package/RubTextVariableLink.class/instance/accessing/variableName.st
R Rubric.package/RubTextVariableLink.class/instance/accessing/variableName_.st
R Rubric.package/RubTextVariableLink.class/instance/evaluating/actOnClick_for_in_editor_.st
A Rubric.package/extension/TextAttribute/instance/rubMayActOnEvent_.st
A Rubric.package/extension/TextClassLink/instance/rubActOnClick_for_in_editor_.st
A Rubric.package/extension/TextLink/instance/rubMayActOnEvent_.st
A Rubric.package/extension/TextMethodLink/instance/rubActOnClick_for_in_editor_.st
A Rubric.package/extension/TextVariableLink/instance/rubActOnClick_for_in_editor_.st
R ScriptLoader50.package/ScriptLoader.class/instance/pharo - scripts/script50632.st
A ScriptLoader50.package/ScriptLoader.class/instance/pharo - scripts/script50633.st
R ScriptLoader50.package/ScriptLoader.class/instance/pharo - updates/update50632.st
A ScriptLoader50.package/ScriptLoader.class/instance/pharo - updates/update50633.st
M ScriptLoader50.package/ScriptLoader.class/instance/public/commentForCurrentUpdate.st
Log Message:
-----------
50633
16537 FTDataSource>>elementAt: should not be there.
https://pharo.fogbugz.com/f/cases/16537
16330 Text*Link users should use RubText*Link
https://pharo.fogbugz.com/f/cases/16330
17774 Use isIntegerPoint instead of "x isInteger and: [ y isInteger ]" in some Point methods
https://pharo.fogbugz.com/f/cases/17774
17773 CircleMorph should use default initialize methods instead of #initialize
https://pharo.fogbugz.com/f/cases/17773
http://files.pharo.org/image/50/50633.zip
March 9, 2016
Re: [Pharo-dev] strange array instance
by Eliot Miranda
Um, under /no/ circumstances do what I'm suggesting below. It will screw
up 320bit images completely. I've just turned odd SmallIntegers into
SmallFloat54's in 32-bit Squeak. I hope I won't destroy too many people's
images. This is perhaps my worst blunder.
On Tue, Mar 8, 2016 at 10:38 AM, Eliot Miranda <eliot.miranda(a)gmail.com>
wrote:
> Hi Pavel,
>
> On Tue, Mar 8, 2016 at 1:40 AM, Pavel Krivanek <pavel.krivanek(a)gmail.com>
> wrote:
>
>> Hi,
>>
>> there is a strange array of size 1024 in the Pharo image that is not
>> eaten by garbage collector even if no object points to it. I guess it is
>> related to Spur.
>>
>> ((Array allInstances select: [ :i | i size = 1024 ])
>> select: [ :a | a second = SmallInteger ]) pointersTo
>>
>> What is it and is it accessible somehow?
>>
>
> It is indeed the first class table page. It looks like an old bug. The
> oldest Spur image I can start up has the problem. The way that class
> table pages are hidden is that they have a class index which is not that of
> Array. Array is at index 52 in the class table (51 zero-relative, Array
> identityHash = 51), but it is also at index 17 (16 zero-relative). Array
> allInstances looks for objects whose class index is 51, hence not seeing
> the class table pages, which all (but the first) have class index 16.
>
> Luckily we can fix the problem easily, and we can fix another problem at
> the same time, which is that SmallFloat64 has the wrong hash.
>
> The class table is two-level; a (hidden) array of Arrays. Classes are in
> the class table at their identityHashes (so that to instantiate a class one
> copies the class's identity hash into the classIndex of the new instance
> instead of having to search the class table). But when SmallFloat64 was
> created in the 32-bit image I forgot to give it the right hash and store it
> in the class table. (there are no SmallFloat64 instances in a 32-bit
> image, only in 64-bits).
>
> So we can first change SmallFloat64's hash to 3, which is what the Spur
> 64-bit VM and image require, and enter it into the first class table page,
> and then we can make the first class table page disappear.
>
>
> | firstClassTablePage clone |
> "The first class table page is the first Array instance. Of course this is
> a bug."
> firstClassTablePage := Array someInstance.
>
> "It should contain only nil and classes."
> self assert: (firstClassTablePage allSatisfy: [:e| e == nil or: [e
> isBehavior]]).
>
> "And its first 17 elements should only be the immediate classes and Array,
> since Array is used as the class pun for class table pages, with index 17
> (16 zero-relative)"
> self assert: (firstClassTablePage first: 17) asSet = {nil. SmallInteger.
> Character. Array} asSet.
>
> "It just so happens that the second Array is the specialSelectors"
> self assert: Array someInstance nextInstance == Smalltalk specialSelectors.
>
> "Store SmallFloat64 in the first class table page at index 4 (3
> zero-relative)."
> firstClassTablePage at: 4 put: SmallFloat64.
>
> "Use the secret set identity hash primitive to set SmallFloat64's
> identityHash to 3."
> SmallFloat64 tryPrimitive: 161 withArgs: #(3).
>
> "Now create an object that looks like Array class, but has identityHash
> 16."
> "Take a shallow copy of Array class."
> clone := Array shallowCopy.
> "Change it into an Array."
> Array adoptInstance: clone.
> "Set its identityHash to 16."
> clone tryPrimitive: 161 withArgs: #(16).
> "Use the adoptInstance: primitive to ``set the class of the
> firstClassTablePage to the cone''.
> or, more accurately, to set the firstClassTablePage's class index to 16."
> clone tryPrimitive: 160 withArgs: {firstClassTablePage}
>
>
> With the above done, we can check that everything is ok."
> self assert: SmallFloat64 identityHash = 3.
> self assert: Array someInstance == Smalltalk specialSelectors.
> "A class table page is 1024 slots, contains only nil or behaviours, and
> contains at least one behaviour (is not all nils). There shouldn't be any
> that we can find."
> self assert: (self systemNavigation allObjects select: [:o| o isArray and:
> [o size = 1024 and: [(o allSatisfy: [:e| e == nil or: [e isBehavior]]) and:
> [o anySatisfy: [:e| e isBehavior]]]]]) size = 0
>
>
> I recommend you create an update map. Then create a version of kernel
> with a post-load action, written something like this:
>
>
> (Array someInstance size = 1014
> and: [(Array someInstance allSatisfy: [:e| e == nil or: [e isBehavior]])
> and: [(firstClassTablePage first: 17) asSet = {nil. SmallInteger.
> Character. Array} asSet]]) ifTrue:
> [| firstClassTablePage clone |
> firstClassTablePage := Array someInstance.
> self assert: (firstClassTablePage allSatisfy: [:e| e == nil or: [e
> isBehavior]]).
> self assert: (firstClassTablePage first: 17) asSet = {nil. SmallInteger.
> Character. Array} asSet.
> firstClassTablePage at: 4 put: SmallFloat64.
> SmallFloat64 tryPrimitive: 161 withArgs: #(3).
> clone := Array shallowCopy.
> Array adoptInstance: clone.
> clone tryPrimitive: 161 withArgs: #(16).
> clone tryPrimitive: 160 withArgs: {Array someInstance}
> self assert: SmallFloat64 identityHash = 3.
> self assert: (Array someInstance first: 4) = {nil. SmallInteger.
> Character. SmallFloat64}]
>
> Then create a second update map to ensure that that version of Kernel is
> loaded.
>
> I will do this for Squeak immediately.
>
>
> Apologies.
>
> P.S. Interestingly enough, it shows what a horrible security hole the
> debugger primitives tryPrimitive:withArgs: and tryNamedPrimitive:withArgs:
> are.
>
> Cheers,
>> -- Pavel
>>
>
> _,,,^..^,,,_
> best, Eliot
>
--
_,,,^..^,,,_
best, Eliot
March 9, 2016
Re: [Pharo-dev] [Pharo-users] Little how to
by philippe.back@highoctane.be
Isn't Boardician usable?
http://forum.world.st/Boardician-board-game-framework-td4814794.html
On Mar 5, 2016 10:19 AM, "stepharo" <stepharo(a)free.fr> wrote:
> So cooooooooooooooooooooooooooool, it was on my todo with my son.
> --- this is really true, he came and told me I want to build my own game...
> And we do not have a game framework in our community --- at least one that
> I understand.
> So I was looking at Ruby or JS :(
>
> And clement show me the link and how he extracted the png.
> So we will do that this afternoon and add this as a challenge for the mooc
> I should have got faster :).
>
>
> Le 3/3/16 22:58, Tudor Girba a écrit :
>
>> Hi,
>>
>> I wrote a little post with a how to extract sprites from a larger png
>> file:
>> http://www.humane-assessment.com/blog/extracting-sprite-from-png
>>
>> Cheers,
>> Doru
>>
>>
>> On Mar 3, 2016, at 9:23 AM, stepharo <stepharo(a)free.fr> wrote:
>>>
>>> Hi guys
>>>
>>> for the mooc I would like have a list of how to that students should
>>> look in the system and implement.
>>> The idea is to show to the participants that Pharo is open and that they
>>> can find information.
>>> For example,
>>> - extracting a sprite from a png file
>>> - access a time service of the web
>>>
>>> Now I would love to get your ideas and their solution.
>>>
>>> Stef
>>>
>>>
>>>
>>> --
>> www.tudorgirba.com
>> www.feenk.com
>>
>> "Beauty is where we see it."
>>
>>
>>
>>
>>
>>
>>
>
>
March 9, 2016
Re: [Pharo-dev] strange array instance
by Eliot Miranda
Hi Pavel,
here's the debugged script that works in Squeak. It needs to be the
*postload* script. I didn't realise but the preamble script is only run
before a package is loaded, and is /not/ run before a package is updated.
"below, add code to be run after the loading of this package"
"Make sure that
a) SmallFloat64 has identityHash 3 and occupies the 4th (3rd,
zero-relative) slot of the first class table page, and
b) that the first class table page is hidden by ensuring its class index
is 16, the Array class index pun."
(Array someInstance size = 1024
and: [(Array someInstance allSatisfy: [:e| e == nil or: [e isBehavior]])
and: [(Array someInstance first: 17) asSet = {nil. SmallInteger.
Character. Array} asSet]]) ifTrue:
[| firstClassTablePage clone |
firstClassTablePage := Array someInstance.
self assert: (firstClassTablePage allSatisfy: [:e| e == nil or: [e
isBehavior]]).
self assert: (firstClassTablePage first: 17) asSet = {nil. SmallInteger.
Character. Array} asSet.
firstClassTablePage at: 4 put: SmallFloat64.
SmallFloat64 tryPrimitive: 161 withArgs: #(3).
clone := Array shallowCopy.
Array adoptInstance: clone.
clone tryPrimitive: 161 withArgs: #(16).
clone tryPrimitive: 160 withArgs: {firstClassTablePage}.
self assert: SmallFloat64 identityHash = 3.
self assert: (firstClassTablePage first: 4) = {nil. SmallInteger.
Character. SmallFloat64}]
On Tue, Mar 8, 2016 at 10:38 AM, Eliot Miranda <eliot.miranda(a)gmail.com>
wrote:
> Hi Pavel,
>
> On Tue, Mar 8, 2016 at 1:40 AM, Pavel Krivanek <pavel.krivanek(a)gmail.com>
> wrote:
>
>> Hi,
>>
>> there is a strange array of size 1024 in the Pharo image that is not
>> eaten by garbage collector even if no object points to it. I guess it is
>> related to Spur.
>>
>> ((Array allInstances select: [ :i | i size = 1024 ])
>> select: [ :a | a second = SmallInteger ]) pointersTo
>>
>> What is it and is it accessible somehow?
>>
>
> It is indeed the first class table page. It looks like an old bug. The
> oldest Spur image I can start up has the problem. The way that class
> table pages are hidden is that they have a class index which is not that of
> Array. Array is at index 52 in the class table (51 zero-relative, Array
> identityHash = 51), but it is also at index 17 (16 zero-relative). Array
> allInstances looks for objects whose class index is 51, hence not seeing
> the class table pages, which all (but the first) have class index 16.
>
> Luckily we can fix the problem easily, and we can fix another problem at
> the same time, which is that SmallFloat64 has the wrong hash.
>
> The class table is two-level; a (hidden) array of Arrays. Classes are in
> the class table at their identityHashes (so that to instantiate a class one
> copies the class's identity hash into the classIndex of the new instance
> instead of having to search the class table). But when SmallFloat64 was
> created in the 32-bit image I forgot to give it the right hash and store it
> in the class table. (there are no SmallFloat64 instances in a 32-bit
> image, only in 64-bits).
>
> So we can first change SmallFloat64's hash to 3, which is what the Spur
> 64-bit VM and image require, and enter it into the first class table page,
> and then we can make the first class table page disappear.
>
>
> | firstClassTablePage clone |
> "The first class table page is the first Array instance. Of course this is
> a bug."
> firstClassTablePage := Array someInstance.
>
> "It should contain only nil and classes."
> self assert: (firstClassTablePage allSatisfy: [:e| e == nil or: [e
> isBehavior]]).
>
> "And its first 17 elements should only be the immediate classes and Array,
> since Array is used as the class pun for class table pages, with index 17
> (16 zero-relative)"
> self assert: (firstClassTablePage first: 17) asSet = {nil. SmallInteger.
> Character. Array} asSet.
>
> "It just so happens that the second Array is the specialSelectors"
> self assert: Array someInstance nextInstance == Smalltalk specialSelectors.
>
> "Store SmallFloat64 in the first class table page at index 4 (3
> zero-relative)."
> firstClassTablePage at: 4 put: SmallFloat64.
>
> "Use the secret set identity hash primitive to set SmallFloat64's
> identityHash to 3."
> SmallFloat64 tryPrimitive: 161 withArgs: #(3).
>
> "Now create an object that looks like Array class, but has identityHash
> 16."
> "Take a shallow copy of Array class."
> clone := Array shallowCopy.
> "Change it into an Array."
> Array adoptInstance: clone.
> "Set its identityHash to 16."
> clone tryPrimitive: 161 withArgs: #(16).
> "Use the adoptInstance: primitive to ``set the class of the
> firstClassTablePage to the cone''.
> or, more accurately, to set the firstClassTablePage's class index to 16."
> clone tryPrimitive: 160 withArgs: {firstClassTablePage}
>
>
> With the above done, we can check that everything is ok."
> self assert: SmallFloat64 identityHash = 3.
> self assert: Array someInstance == Smalltalk specialSelectors.
> "A class table page is 1024 slots, contains only nil or behaviours, and
> contains at least one behaviour (is not all nils). There shouldn't be any
> that we can find."
> self assert: (self systemNavigation allObjects select: [:o| o isArray and:
> [o size = 1024 and: [(o allSatisfy: [:e| e == nil or: [e isBehavior]]) and:
> [o anySatisfy: [:e| e isBehavior]]]]]) size = 0
>
>
> I recommend you create an update map. Then create a version of kernel
> with a post-load action, written something like this:
>
>
> (Array someInstance size = 1014
> and: [(Array someInstance allSatisfy: [:e| e == nil or: [e isBehavior]])
> and: [(firstClassTablePage first: 17) asSet = {nil. SmallInteger.
> Character. Array} asSet]]) ifTrue:
> [| firstClassTablePage clone |
> firstClassTablePage := Array someInstance.
> self assert: (firstClassTablePage allSatisfy: [:e| e == nil or: [e
> isBehavior]]).
> self assert: (firstClassTablePage first: 17) asSet = {nil. SmallInteger.
> Character. Array} asSet.
> firstClassTablePage at: 4 put: SmallFloat64.
> SmallFloat64 tryPrimitive: 161 withArgs: #(3).
> clone := Array shallowCopy.
> Array adoptInstance: clone.
> clone tryPrimitive: 161 withArgs: #(16).
> clone tryPrimitive: 160 withArgs: {Array someInstance}
> self assert: SmallFloat64 identityHash = 3.
> self assert: (Array someInstance first: 4) = {nil. SmallInteger.
> Character. SmallFloat64}]
>
> Then create a second update map to ensure that that version of Kernel is
> loaded.
>
> I will do this for Squeak immediately.
>
>
> Apologies.
>
> P.S. Interestingly enough, it shows what a horrible security hole the
> debugger primitives tryPrimitive:withArgs: and tryNamedPrimitive:withArgs:
> are.
>
> Cheers,
>> -- Pavel
>>
>
> _,,,^..^,,,_
> best, Eliot
>
--
_,,,^..^,,,_
best, Eliot
March 8, 2016
Last modified method in nautilus does not show the recently modified
by stepharo
Hi guys
I'm trying to do a video (I will not show the feature) but Last modified
method in nautilus does not show the recently modified
Stef
March 8, 2016
Re: [Pharo-dev] [Pharo-users] Call about Numerical Methods in Pharo :)
by Alexandre Bergel
Vincent, can you tell a bit more what this binding is about?
how can I try?
Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
> On Mar 3, 2016, at 6:43 AM, Blondeau Vincent <vincent.blondeau(a)worldline.com> wrote:
>
> Hi,
>
> That's a very good idea.
> For now, I use a Pharo-R binding to make the statistics, but it is better if it is directly in the image.
>
> For my part, it should be nice to have:
> - Principal Component Analysis
> - Time series
> - Correlation with several variables (Correlation matrix) + significance tests (pearson, spearman...)
> - Standard statistical tests: normality, variance, mean, distribution
> - And the more important is to have nice tools to visualize the data (Box plot, histogram, scatterplots, PCA ones) with a simple API for standard things but that we can customize. The best is that we are able to draw regression lines on them. But I think that is more a Roassal part.
>
> Thanks for the initiative,
>
> Cheers,
> Vincent
>
>> -----Message d'origine-----
>> De : Pharo-users [mailto:pharo-users-bounces@lists.pharo.org] De la part de
>> stepharo
>> Envoyé : mercredi 2 mars 2016 14:17
>> Ã : Pharo Development List; Any question about pharo is welcome; Didier
>> Besset; Souissi Sami
>> Objet : [Pharo-users] Call about Numerical Methods in Pharo :)
>>
>> Hi guys
>>
>> I met Didier Besset and we had a great hacking session and discussions with
>> Serge Stinckwich.
>> Didier would like to help Pharo and the numerical part of it. ***Big
>> thanks*** Didier.
>>
>> We would like to do several things:
>>
>> - Work on "Hows to"
>> The numerical methods in Pharo is good but the gap between us and the
>> math is too large :)
>> so the idea is to have a series of "how to ..."
>> - histomgram (simple, based on distribution)
>>
>> - Improve the SciPharo/NumPha (previously SciSmalltalk) library
>> This morning we started to implement a
>> ComponentPrincipalDecomposition by combining two of the
>> objects available in SciPharo.
>> Then we started to enhance the distributions to make sure that we can
>> plug other distribution for having
>> controlled random number.
>>
>> - Do a public call to know what is missing for you: this is this mail :)
>> Didier would like to work on concrete cases. I love that attitude
>> So tell us :)
>>
>> Hernan ??
>> Alex: ?? pvalue? better distribution?
>> Vincent: covariance? CPA?
>> Philippe: times series
>> Serge R frames?
>> Sami: Better random number and various distributions?
>>
>> - Organise a two day lectures with practices on concrete case in September
>> with a recording session.
>> Either at IRD Bondy or Lille.
>>
>> - Make sure that the Numerical Method book will get on lulu :) with a
>> better cover and title :)
>>
>>
>> Stef
>>
>
>
> !!!*************************************************************************************
> "Ce message et les pièces jointes sont confidentiels et réservés à l'usage exclusif de ses destinataires. Il peut également être protégé par le secret professionnel. Si vous recevez ce message par erreur, merci d'en avertir immédiatement l'expéditeur et de le détruire. L'intégrité du message ne pouvant être assurée sur Internet, la responsabilité de Worldline ne pourra être recherchée quant au contenu de ce message. Bien que les meilleurs efforts soient faits pour maintenir cette transmission exempte de tout virus, l'expéditeur ne donne aucune garantie à cet égard et sa responsabilité ne saurait être recherchée pour tout dommage résultant d'un virus transmis.
>
> This e-mail and the documents attached are confidential and intended solely for the addressee; it may also be privileged. If you receive this e-mail in error, please notify the sender immediately and destroy it. As its integrity cannot be secured on the Internet, the Worldline liability cannot be triggered for the message content. Although the sender endeavours to maintain a computer virus-free network, the sender does not warrant that this transmission is virus-free and will not be liable for any damages resulting from any virus transmitted.!!!"
March 8, 2016
Re: [Pharo-dev] strange array instance
by Eliot Miranda
Hi Pavel,
On Tue, Mar 8, 2016 at 1:40 AM, Pavel Krivanek <pavel.krivanek(a)gmail.com>
wrote:
> Hi,
>
> there is a strange array of size 1024 in the Pharo image that is not eaten
> by garbage collector even if no object points to it. I guess it is related
> to Spur.
>
> ((Array allInstances select: [ :i | i size = 1024 ])
> select: [ :a | a second = SmallInteger ]) pointersTo
>
> What is it and is it accessible somehow?
>
It is indeed the first class table page. It looks like an old bug. The
oldest Spur image I can start up has the problem. The way that class
table pages are hidden is that they have a class index which is not that of
Array. Array is at index 52 in the class table (51 zero-relative, Array
identityHash = 51), but it is also at index 17 (16 zero-relative). Array
allInstances looks for objects whose class index is 51, hence not seeing
the class table pages, which all (but the first) have class index 16.
Luckily we can fix the problem easily, and we can fix another problem at
the same time, which is that SmallFloat64 has the wrong hash.
The class table is two-level; a (hidden) array of Arrays. Classes are in
the class table at their identityHashes (so that to instantiate a class one
copies the class's identity hash into the classIndex of the new instance
instead of having to search the class table). But when SmallFloat64 was
created in the 32-bit image I forgot to give it the right hash and store it
in the class table. (there are no SmallFloat64 instances in a 32-bit
image, only in 64-bits).
So we can first change SmallFloat64's hash to 3, which is what the Spur
64-bit VM and image require, and enter it into the first class table page,
and then we can make the first class table page disappear.
| firstClassTablePage clone |
"The first class table page is the first Array instance. Of course this is
a bug."
firstClassTablePage := Array someInstance.
"It should contain only nil and classes."
self assert: (firstClassTablePage allSatisfy: [:e| e == nil or: [e
isBehavior]]).
"And its first 17 elements should only be the immediate classes and Array,
since Array is used as the class pun for class table pages, with index 17
(16 zero-relative)"
self assert: (firstClassTablePage first: 17) asSet = {nil. SmallInteger.
Character. Array} asSet.
"It just so happens that the second Array is the specialSelectors"
self assert: Array someInstance nextInstance == Smalltalk specialSelectors.
"Store SmallFloat64 in the first class table page at index 4 (3
zero-relative)."
firstClassTablePage at: 4 put: SmallFloat64.
"Use the secret set identity hash primitive to set SmallFloat64's
identityHash to 3."
SmallFloat64 tryPrimitive: 161 withArgs: #(3).
"Now create an object that looks like Array class, but has identityHash 16."
"Take a shallow copy of Array class."
clone := Array shallowCopy.
"Change it into an Array."
Array adoptInstance: clone.
"Set its identityHash to 16."
clone tryPrimitive: 161 withArgs: #(16).
"Use the adoptInstance: primitive to ``set the class of the
firstClassTablePage to the cone''.
or, more accurately, to set the firstClassTablePage's class index to 16."
clone tryPrimitive: 160 withArgs: {firstClassTablePage}
With the above done, we can check that everything is ok."
self assert: SmallFloat64 identityHash = 3.
self assert: Array someInstance == Smalltalk specialSelectors.
"A class table page is 1024 slots, contains only nil or behaviours, and
contains at least one behaviour (is not all nils). There shouldn't be any
that we can find."
self assert: (self systemNavigation allObjects select: [:o| o isArray and:
[o size = 1024 and: [(o allSatisfy: [:e| e == nil or: [e isBehavior]]) and:
[o anySatisfy: [:e| e isBehavior]]]]]) size = 0
I recommend you create an update map. Then create a version of kernel with
a post-load action, written something like this:
(Array someInstance size = 1014
and: [(Array someInstance allSatisfy: [:e| e == nil or: [e isBehavior]])
and: [(firstClassTablePage first: 17) asSet = {nil. SmallInteger.
Character. Array} asSet]]) ifTrue:
[| firstClassTablePage clone |
firstClassTablePage := Array someInstance.
self assert: (firstClassTablePage allSatisfy: [:e| e == nil or: [e
isBehavior]]).
self assert: (firstClassTablePage first: 17) asSet = {nil. SmallInteger.
Character. Array} asSet.
firstClassTablePage at: 4 put: SmallFloat64.
SmallFloat64 tryPrimitive: 161 withArgs: #(3).
clone := Array shallowCopy.
Array adoptInstance: clone.
clone tryPrimitive: 161 withArgs: #(16).
clone tryPrimitive: 160 withArgs: {Array someInstance}
self assert: SmallFloat64 identityHash = 3.
self assert: (Array someInstance first: 4) = {nil. SmallInteger. Character.
SmallFloat64}]
Then create a second update map to ensure that that version of Kernel is
loaded.
I will do this for Squeak immediately.
Apologies.
P.S. Interestingly enough, it shows what a horrible security hole the
debugger primitives tryPrimitive:withArgs: and tryNamedPrimitive:withArgs:
are.
Cheers,
> -- Pavel
>
_,,,^..^,,,_
best, Eliot
March 8, 2016