Re: [Pharo-users] How to programatically select an item in a Spec TreeModel ?
It's also possible that it is simply bugged. PackageRemotesManager doesn't use TreeModel, it uses different widget (whose API looks cleaner). I'll try to look at this tomorrow (unless someone else beats me to it) how this could be done (and maybe even take a stab at cleaning the API a bit...). Peter On Fri, Oct 23, 2015 at 5:17 PM, Edouard KLEINwrote: > Hi ! > > I've been playing with Pharo again. In the application I'm building, I > need to load a file from disk, and depending on what is inside this > file, select an item in a tree that is displayed on the main window. > > The SearchableTree subclass I use is copied at the end of the email. It > is nothing fancy, just creating the nodes from a fixed tree structure. > > The method selectedItemFRomPathArray (e.g. #('a' 'a1')) is the one that > should be responsible for selecting the node, but for now it just > returns the array of TreeNodeModel that correspond to the strings in the > 'PathArray' given in argument. > > I tried the following in a PlayGround : > > w := CRPJCategories2 new. w openWithSpec. > "Taken from packageRemotesManager without understanding it." > w tree selectedItem:( > (w roots) first "This line can also be : > ((w selectedItemFromPathArray:#('a')) last)" > selected:true; > takeHighlight; > yourself). > > Which works, but when I try to select something that is not a root node, > then it does not work, and I've been pulling my hair trying to > understand why. > > w := CRPJCategories2 new. w openWithSpec. > "Taken from packageRemotesManager without understanding it." > w tree selectedItem:( > ((w selectedItemFromPathArray:#('a' 'a1')) last) "<- DOES NOT WORK" > selected:true; > takeHighlight; > yourself). > > > Any pointer would be very much appreciated. > > Thenks in advance. > > Edouard. > > > > > --- > 'From Pharo4.0 of 18 March 2013 [Latest update: #40623] on 23 October > 2015 at 4:55:07.823126 pm'! > SearchableTree subclass: #CRPJCategories2 > instanceVariableNames: 'structure' > classVariableNames: '' > poolDictionaries: '' > category: 'CRPJ'! > > !CRPJCategories2 methodsFor: 'as yet unclassified' stamp: 'EdouardKlein > 10/23/2015 15:29'! > nodeFromTreeStructure: anArray > ^ (anArray collect:[:x| TreeNodeModel new > content: (x at:1); > children: [((x size = 1) ifTrue:[#()] ifFalse:[self > nodeFromTreeStructure:(x at:2)])]; > hasChildren:[x size > 1]]) asOrderedCollection.! ! > > !CRPJCategories2 methodsFor: 'as yet unclassified' stamp: 'EdouardKlein > 10/23/2015 15:10'! > initialize > | | > super initialize. > structure := { > {'a' . { > {'a1'}. > {'a2'}}}. > {'b' . { > {'b1' . { > {'b1A'}. > {'b1B'}}}. > {'b2'}. > {'b3' . { > {'b3A'}. > {'b3B'}. > {'c' . { > {'c1'}. > {'c2'}. > {'c3'. > self roots:(self nodeFromTreeStructure: structure).! ! > > !CRPJCategories2 methodsFor: 'as yet unclassified' stamp: 'EdouardKlein > 10/23/2015 16:54'! > selectedItemFromPathArray:aPathArray > "a string description of the currently selected item" > | recurse | > recurse := [:path :nodes| > |nextNode| > nextNode := (nodes select:[:n| n content = path first]) > first. > (path size = 1) ifTrue:[{nextNode}] ifFalse:[ > {nextNode},(recurse value:(path > allButFirst)value:(nextNode children > value))]]. > ^(recurse value: aPathArray value:(self roots)).! ! > > !CRPJCategories2 methodsFor: 'as yet unclassified' stamp: 'EdouardKlein > 10/23/2015 16:53'! > selectedItemAsPathArray > "an array of the path to the currently selected item" > | recurse | > recurse := [:node| node ifNil:[{}] > ifNotNil:[(recurse value:(node > parentNode)),{node}]]. > ^(recurse value:self selectedItem) collect:[:node| node content].! > ! > >
Re: [Pharo-users] memory question
Thank you Norbert and Alexandre, #sizeInMemory was obviously what i was looking for. and the hint about the little complication in a collection that can grow, was helpful indeed! werner
[Pharo-users] memory question
Hi, i'd like to test how much memory a dictionary uses. i guess i could simply delete that dictionary and see how much memory the garbage collector releases, but i wonder how i could measure that without destroying that dictionary? werner
Re: [Pharo-users] Feedback on #assert: vs. #assert:equals:
Thanks for the answers, and for addressing this soon :) I would like to participate on the sprint but I can't make it this time. Nahuel 2015-10-22 12:15 GMT-03:00 Alexandre Bergel: > Dear Nahuel, > > I think you are raising in excellent point. > I think that assert: should raise an assertion error when a non-boolean is > provided. > I have added an entry: > https://pharo.fogbugz.com/f/cases/16847/assert-should-not-raise-an-error-with-a-non-boolean-argument > > Tomorrow we have a sprint, this is like an easy thing to fix. We will work > on it! > > Thanks, > Alexandre > -- > _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: > Alexandre Bergel http://www.bergel.eu > ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;. > > > > On Oct 21, 2015, at 10:21 PM, Nahuel Garbezza wrote: > > Hi everyone, > > I'm using Pharo for teaching and we use TDD since the beginning. I've > noticed that if you use #assert: on a test, like this: > > self assert: object messageReturningBoolean > > It gives you strange results in terms of feedback if the result is not a > boolean. I would expect an AssertionFailed (yellow test) but I got a > NonBooleanReceiver (red test). > > What we do in our course is to write the assertion like this: > > self assert: object messageReturningBoolean equals: true > > So we got a "expected true but was " error which is a lot more > helpful to the students. > > I was thinking that is better to have #assert: implementation based on > #assert:equals:. It is like saying #assert:equals: is the "primitive" > assertion message, which makes sense to me since you are always comparing if > an object is equal to another, there's no reason to handle the booleans' > case differently. > > What do you think? > > Thank you! > > Nahuel > >
Re: [Pharo-users] memory question
Well, this is not enough. This #sizeInMemory only tells you the size of the object, which is simply the number of variables * 4 + size of the header. For collection, such as OrderedCollection and Dictionary, it is worth asking #size and #capacity: - #size tells you the amount of objects kept in the collection - #capacity tells you the maximum size the collection can hold without triggering a grow operation. For example: Dictionary new sizeInMemory => 16 d := Dictionary new. d at: #foo put: 1. d sizeInMemory => 16 d := Dictionary new. d at: #foo put: 1. d capacity => 5 d := Dictionary new. 1 to: 1000 do: [ :i | d at: i put: i ]. d capacity => 2213 d := Dictionary new. 1 to: 1000 do: [ :i | d at: i put: i ]. d size => 1000 Alexandre > On Oct 23, 2015, at 9:06 AM, Norbert Hartlwrote: > > >> Am 23.10.2015 um 13:29 schrieb Werner Kassens : >> >> sorry, wrong thread, that was unintentional. werner >> >> On 10/23/2015 01:24 PM, Werner Kassens wrote: >>> Hi, >>> i'd like to test how much memory a dictionary uses. i guess i could >>> simply delete that dictionary and see how much memory the garbage >>> collector releases, but i wonder how i could measure that without >>> destroying that dictionary? >>> werner > > Try > > Dictionary new sizeInMemory > > Norbert > > > -- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
Re: [Pharo-users] VM crash on Ubuntu 14.04
On Thu, Oct 22, 2015 at 2:25 AM, Johan Fabrywrote: > Hi all, > > I am having some unpleasant experiences on Ubuntu 14.04 (experimenting with > Live Robot Programming on PhaROS). The VM crashes after a random amount of > time (< 25 minutes), with no clear sequence of steps on how to reproduce the > crash. I am using Pharo 4 (Pharo 40622 as installed by PhaROS) + Roassal > which required an install of libcairo2:i386 . VM version details below. > > There is no printout on stdout, and the debug.log does not contain recent > entries (timestamp is always some minutes before the actual crash happens). > > Is this a known problem? If so, how can I fix it, and if not how can I > provide more debugging info? > > Thanks in advance! I'm not much help since I haven't done these myself, but just some ideas (maybe someone can add more details) * compile and run a debug vm * trace all function calls, http://tinyurl.com/gdb-trace-all cheers -ben > vm version: > 3.9-7 #1 Thu May 15 18:29:30 CEST 2014 gcc 4.6.3 [Production ITHB VM] > NBCoInterpreter NativeBoost-CogPlugin-GuillermoPolito.19 uuid: > acc98e51-2fba-484 > 1-a965-2975997bba66 May 15 2014 > NBCogit NativeBoost-CogPlugin-GuillermoPolito.19 uuid: > acc98e51-2fba-4841-a965-2 > 975997bba66 May 15 2014 > https://github.com/pharo-project/pharo-vm.git Commit: > ed4a4f59208968a21d82fd2406 > f75c2c4de558b2 Date: 2014-05-15 18:23:04 +0200 By: Esteban Lorenzano > gmail.com> Jenkins build #14826 > Linux pharo-linux 3.2.0-31-generic-pae #50-Ubuntu SMP Fri Sep 7 16:39:45 UTC > 201 > 2 i686 i686 i386 GNU/Linux > plugin path: /home/jfabry/catkin_ws/src/pharo/vm/ [default: > /home/jfabry/catkin_ > ws/src/pharo/vm/] > > > ---> Save our in-boxes! http://emailcharter.org <--- > > Johan Fabry - http://pleiad.cl/~jfabry > PLEIAD and RyCh labs - Computer Science Department (DCC) - University of > Chile > >
Re: [Pharo-users] memory question
> Am 23.10.2015 um 13:29 schrieb Werner Kassens: > > sorry, wrong thread, that was unintentional. werner > > On 10/23/2015 01:24 PM, Werner Kassens wrote: >> Hi, >> i'd like to test how much memory a dictionary uses. i guess i could >> simply delete that dictionary and see how much memory the garbage >> collector releases, but i wonder how i could measure that without >> destroying that dictionary? >> werner Try Dictionary new sizeInMemory Norbert
Re: [Pharo-users] memory question
sorry, wrong thread, that was unintentional. werner On 10/23/2015 01:24 PM, Werner Kassens wrote: Hi, i'd like to test how much memory a dictionary uses. i guess i could simply delete that dictionary and see how much memory the garbage collector releases, but i wonder how i could measure that without destroying that dictionary? werner
Re: [Pharo-users] Fwd: FOSDEM 2016 devroom selection
Sad news. 2015-10-22 17:05 GMT+02:00 stephan: > > Forwarded Message Subject: FOSDEM 2016 devroom selection > Date: > Thu, 22 Oct 2015 13:18:25 +0200 From: Johan van Selst > To: devro...@fosdem.org > > Hi, > > I'm sorry to inform you that we declined your devroom proposal. > > To clarify, your request was perfectly valid, but we had to choose. > Unfortunately we do not have a sufficient number of rooms at our > disposal to cover all requests. This year, we had over 60 requests > for a devroom and were only able to accept 37 of those. However, > some requests have been combined into a single devroom. > > Nevertheless, there are other ways to participate in FOSDEM too. > You can still: > - have a stand at FOSDEM, > - hold a 15 minute 'lightning talk' in one of the biggest rooms, > - speak in one of the other devrooms (CfP to follow), > - hold a session in the community meeting room (new; CfP to follow). > > The full list of accepted devrooms will be published on the > FOSDEM website later this week. > > > On behalf of the FOSDEM devroom team, > > Johan van Selst > > > > >
Re: [Pharo-users] Updated Pharo By Example
The possibility to take automatic screenshot should be added to Pillar but for now it's just an idea and no one have the time to do it. On Fri, Oct 23, 2015 at 6:59 PM, Dimitris Chloupiswrote: > I completely agree with Stef, I did actually removed some screenshots and > someone put them pack > > Maybe I can create a pharo script to auto make them for each version > -- Cheers Cyril Ferlicot
Re: [Pharo-users] Updated Pharo By Example
Le 23 oct. 2015 7:00 PM, "Dimitris Chloupis"a écrit : > > I completely agree with Stef, I did actually removed some screenshots and someone put them pack > > Maybe I can create a pharo script to auto make them for each version Wasn't there a way to run Smalltalk code inside pillar? Code that would open windows, screenshot and return a png. Thierry > > > On Fri, Oct 23, 2015 at 5:24 PM Damien Cassou wrote: >> >> >> Dimitris Chloupis writes: >> >> > "Yes we can ask oscar and after will host it also at books.pharo.org and in >> > HTML version too as for all the other books. >> >> >> please contact "Oscar Nierstrasz" to: >> >> - get the website sources >> - redirect pharobyexample.org to files.pharo.org/books/pharobyexample >> >> > "pay attention. I think that we should minimize UI elements and external >> > frameworks because else we will have more work in 4 years from now. " >> > >> > What do you mean ? >> >> >> Stephane wants to facilitate migration of UPBE to Pharo 6/7/8/... For >> that, the book should limit the number of screenshots and fine-grained >> tutorials such as "Left click Here, press the button name 'That Way', >> you will see a window looking like That". These fine-grained >> instructions are a pain to update and need to change with each version >> of Pharo. It is ok to have some, but not too much. >> >> -- >> Damien Cassou >> http://damiencassou.seasidehosting.st >> >> "Success is the ability to go from one failure to another without >> losing enthusiasm." --Winston Churchill >>
Re: [Pharo-users] Updated Pharo By Example
I completely agree with Stef, I did actually removed some screenshots and someone put them pack Maybe I can create a pharo script to auto make them for each version On Fri, Oct 23, 2015 at 5:24 PM Damien Cassouwrote: > > Dimitris Chloupis writes: > > > "Yes we can ask oscar and after will host it also at books.pharo.org > and in > > HTML version too as for all the other books. > > > please contact "Oscar Nierstrasz" to: > > - get the website sources > - redirect pharobyexample.org to files.pharo.org/books/pharobyexample > > > "pay attention. I think that we should minimize UI elements and external > > frameworks because else we will have more work in 4 years from now. " > > > > What do you mean ? > > > Stephane wants to facilitate migration of UPBE to Pharo 6/7/8/... For > that, the book should limit the number of screenshots and fine-grained > tutorials such as "Left click Here, press the button name 'That Way', > you will see a window looking like That". These fine-grained > instructions are a pain to update and need to change with each version > of Pharo. It is ok to have some, but not too much. > > -- > Damien Cassou > http://damiencassou.seasidehosting.st > > "Success is the ability to go from one failure to another without > losing enthusiasm." --Winston Churchill > >
Re: [Pharo-users] How to programatically select an item in a Spec TreeModel ?
Le 23/10/2015 21:01, Peter Uhnák a écrit : It's also possible that it is simply bugged. PackageRemotesManager doesn't use TreeModel, it uses different widget (whose API looks cleaner). I'll try to look at this tomorrow (unless someone else beats me to it) how this could be done (and maybe even take a stab at cleaning the API a bit...). I wrote my own API to be able to that properly with MorphTreeMorph. Fastest/easiest way to do that is to directly get the items morphs inside the tree and select them. Cleaning that up is ... well, good luck with that. I wouldn't bother. Waiting for the FT-based rewrite is the thing to do. Will make the application code dealing with that a lot leaner and cleaner to boot. Thierry Peter On Fri, Oct 23, 2015 at 5:17 PM, Edouard KLEIN> wrote: Hi ! I've been playing with Pharo again. In the application I'm building, I need to load a file from disk, and depending on what is inside this file, select an item in a tree that is displayed on the main window. The SearchableTree subclass I use is copied at the end of the email. It is nothing fancy, just creating the nodes from a fixed tree structure. The method selectedItemFRomPathArray (e.g. #('a' 'a1')) is the one that should be responsible for selecting the node, but for now it just returns the array of TreeNodeModel that correspond to the strings in the 'PathArray' given in argument. I tried the following in a PlayGround : w := CRPJCategories2 new. w openWithSpec. "Taken from packageRemotesManager without understanding it." w tree selectedItem:( (w roots) first "This line can also be : ((w selectedItemFromPathArray:#('a')) last)" selected:true; takeHighlight; yourself). Which works, but when I try to select something that is not a root node, then it does not work, and I've been pulling my hair trying to understand why. w := CRPJCategories2 new. w openWithSpec. "Taken from packageRemotesManager without understanding it." w tree selectedItem:( ((w selectedItemFromPathArray:#('a' 'a1')) last) "<- DOES NOT WORK" selected:true; takeHighlight; yourself). Any pointer would be very much appreciated. Thenks in advance. Edouard. --- 'From Pharo4.0 of 18 March 2013 [Latest update: #40623] on 23 October 2015 at 4:55:07.823126 pm'! SearchableTree subclass: #CRPJCategories2 instanceVariableNames: 'structure' classVariableNames: '' poolDictionaries: '' category: 'CRPJ'! !CRPJCategories2 methodsFor: 'as yet unclassified' stamp: 'EdouardKlein 10/23/2015 15:29'! nodeFromTreeStructure: anArray ^ (anArray collect:[:x| TreeNodeModel new content: (x at:1); children: [((x size = 1) ifTrue:[#()] ifFalse:[self nodeFromTreeStructure:(x at:2)])]; hasChildren:[x size > 1]]) asOrderedCollection.! ! !CRPJCategories2 methodsFor: 'as yet unclassified' stamp: 'EdouardKlein 10/23/2015 15:10'! initialize | | super initialize. structure := { {'a' . { {'a1'}. {'a2'}}}. {'b' . { {'b1' . { {'b1A'}. {'b1B'}}}. {'b2'}. {'b3' . { {'b3A'}. {'b3B'}. {'c' . { {'c1'}. {'c2'}. {'c3'. self roots:(self nodeFromTreeStructure: structure).! ! !CRPJCategories2 methodsFor: 'as yet unclassified' stamp: 'EdouardKlein 10/23/2015 16:54'! selectedItemFromPathArray:aPathArray "a string description of the currently selected item" | recurse | recurse := [:path :nodes| |nextNode| nextNode := (nodes select:[:n| n content = path first]) first. (path size = 1) ifTrue:[{nextNode}] ifFalse:[ {nextNode},(recurse value:(path allButFirst)value:(nextNode children value))]]. ^(recurse value: aPathArray value:(self roots)).! ! !CRPJCategories2 methodsFor: 'as yet unclassified' stamp: 'EdouardKlein 10/23/2015 16:53'! selectedItemAsPathArray "an array of the path to the currently selected item" | recurse | recurse := [:node| node ifNil:[{}] ifNotNil:[(recurse value:(node
Re: [Pharo-users] Updated Pharo By Example
On 23-10-15 19:15, Thierry Goubier wrote: Le 23 oct. 2015 7:00 PM, "Dimitris Chloupis"a écrit : I completely agree with Stef, I did actually removed some screenshots and someone put them pack Maybe I can create a pharo script to auto make them for each version Wasn't there a way to run Smalltalk code inside pillar? Code that would open windows, screenshot and return a png. Well, there is Documentation-Screenshots in StephanEggermont/Documentation You create a DOScreenshotExporter, set its directory and tell it which forms/morphs/nautilus/world you want stored there under which filename. I fixed a few remaining bugs today. I presume you should be able to use it in pillar. You can use it like so := DOScreenshotExporter new. so directory: FileLocator home. so writeNautilusMethod: DOScreenshotExporter>>#directory: as: 'directoryMethod.png' It has methods like DOScreenshotExporter>>writeNautilusMethod: aMethod as: aFileName self writeBlock: [(Nautilus openOnMethod: aMethod) ui window imageForm ] as: aFileName This makes sure to first rename an existing file before overwriting it. DOScreenshotExporter>>writeBlock: aBlock as: aFileName |temp| (directory / aFileName) exists ifTrue: [ temp := (directory / aFileName) renameTo: (aFileName,'tmp') ]. PNGReadWriter putForm: aBlock value onFileNamed: (directory / aFileName). temp ifNotNil: [ temp ensureDelete ] Stephan
Re: [Pharo-users] Matrix error
Hi, I made an small matrix implementation. Nothing fancy. Just an array of arrays and is working. Just curious now about the error message. Cheers, Offray On 23/10/15 19:56, Offray Vladimir Luna Cárdenas wrote: Hi, I was testing the code here: =[1]= | medMatrix | medMatrix := Matrix new. medMatrix numberOfColumns: 7; numberOfRows: 5. 1 to: medMatrix numberOfRows do: [:row | 1 to: medMatrix numberOfColumns do: [ :column | "medMatrix at: row at: column put: 0." Transcript show: row asString, ',', column asString, '|'. ]. Transcript show: cr. ]. medMatrix. === and I got a transcript like this: =[2]== 1,1|1,2|1,3|1,4|1,5|1,6|1,7|nil2,1|2,2|2,3|2,4|2,5|2,6|2,7|nil3,1|3,2|3,3|3,4|3,5|3,6|3,7|nil4,1|4,2|4,3|4,4|4,5|4,6|4,7|nil5,1|5,2|5,3|5,4|5,5|5,6|5,7|nil'[Spotter] Exception while collecting processors for : Error: Instances of UndefinedObject are not indexable' '[Spotter] Exception while collecting processors for : Error: Instances of UndefinedObject are not indexable' '[Spotter] Exception while collecting processors for : Error: Instances of UndefinedObject are not indexable' '[Spotter] Exception while collecting processors for : Error: Instances of UndefinedObject are not indexable' = I tried also with SciSmalltalk matrix, but they seem to be only square ones. What's is the problem with matrices? Why I'm getting Undefined Objects while trying to iterate or populate them? Thanks, Offray
Re: [Pharo-users] Fwd: FOSDEM 2016 devroom selection
On 23/10/15 12:07, Jose San Leandro wrote: Sad news. Indeed. I'll try again next year. There are of course several devrooms where we can propose talks, e.g. "Containers and Process Isolation" should be interested to hear about our long-time experience with images Stephan https://fosdem.org/2016/news/2015-10-22-accepted-devrooms/
Re: [Pharo-users] FOSDEM 2016 devroom selection
Not be discouraged! Go go go! Alexandre > On Oct 23, 2015, at 11:58 AM, Stephan Eggermontwrote: > > On 23/10/15 12:07, Jose San Leandro wrote: >> Sad news. > > Indeed. I'll try again next year. > There are of course several devrooms where we can propose talks, e.g. > "Containers and Process Isolation" should be interested to hear about our > long-time experience with images > > Stephan > > https://fosdem.org/2016/news/2015-10-22-accepted-devrooms/ > > -- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
[Pharo-users] How to programatically select an item in a Spec TreeModel ?
Hi ! I've been playing with Pharo again. In the application I'm building, I need to load a file from disk, and depending on what is inside this file, select an item in a tree that is displayed on the main window. The SearchableTree subclass I use is copied at the end of the email. It is nothing fancy, just creating the nodes from a fixed tree structure. The method selectedItemFRomPathArray (e.g. #('a' 'a1')) is the one that should be responsible for selecting the node, but for now it just returns the array of TreeNodeModel that correspond to the strings in the 'PathArray' given in argument. I tried the following in a PlayGround : w := CRPJCategories2 new. w openWithSpec. "Taken from packageRemotesManager without understanding it." w tree selectedItem:( (w roots) first "This line can also be : ((w selectedItemFromPathArray:#('a')) last)" selected:true; takeHighlight; yourself). Which works, but when I try to select something that is not a root node, then it does not work, and I've been pulling my hair trying to understand why. w := CRPJCategories2 new. w openWithSpec. "Taken from packageRemotesManager without understanding it." w tree selectedItem:( ((w selectedItemFromPathArray:#('a' 'a1')) last) "<- DOES NOT WORK" selected:true; takeHighlight; yourself). Any pointer would be very much appreciated. Thenks in advance. Edouard. --- 'From Pharo4.0 of 18 March 2013 [Latest update: #40623] on 23 October 2015 at 4:55:07.823126 pm'! SearchableTree subclass: #CRPJCategories2 instanceVariableNames: 'structure' classVariableNames: '' poolDictionaries: '' category: 'CRPJ'! !CRPJCategories2 methodsFor: 'as yet unclassified' stamp: 'EdouardKlein 10/23/2015 15:29'! nodeFromTreeStructure: anArray ^ (anArray collect:[:x| TreeNodeModel new content: (x at:1); children: [((x size = 1) ifTrue:[#()] ifFalse:[self nodeFromTreeStructure:(x at:2)])]; hasChildren:[x size > 1]]) asOrderedCollection.! ! !CRPJCategories2 methodsFor: 'as yet unclassified' stamp: 'EdouardKlein 10/23/2015 15:10'! initialize | | super initialize. structure := { {'a' . { {'a1'}. {'a2'}}}. {'b' . { {'b1' . { {'b1A'}. {'b1B'}}}. {'b2'}. {'b3' . { {'b3A'}. {'b3B'}. {'c' . { {'c1'}. {'c2'}. {'c3'. self roots:(self nodeFromTreeStructure: structure).! ! !CRPJCategories2 methodsFor: 'as yet unclassified' stamp: 'EdouardKlein 10/23/2015 16:54'! selectedItemFromPathArray:aPathArray "a string description of the currently selected item" | recurse | recurse := [:path :nodes| |nextNode| nextNode := (nodes select:[:n| n content = path first]) first. (path size = 1) ifTrue:[{nextNode}] ifFalse:[ {nextNode},(recurse value:(path allButFirst)value:(nextNode children value))]]. ^(recurse value: aPathArray value:(self roots)).! ! !CRPJCategories2 methodsFor: 'as yet unclassified' stamp: 'EdouardKlein 10/23/2015 16:53'! selectedItemAsPathArray "an array of the path to the currently selected item" | recurse | recurse := [:node| node ifNil:[{}] ifNotNil:[(recurse value:(node parentNode)),{node}]]. ^(recurse value:self selectedItem) collect:[:node| node content].! !
Re: [Pharo-users] Updated Pharo By Example
Dimitris Chloupiswrites: > "Yes we can ask oscar and after will host it also at books.pharo.org and in > HTML version too as for all the other books. please contact "Oscar Nierstrasz" to: - get the website sources - redirect pharobyexample.org to files.pharo.org/books/pharobyexample > "pay attention. I think that we should minimize UI elements and external > frameworks because else we will have more work in 4 years from now. " > > What do you mean ? Stephane wants to facilitate migration of UPBE to Pharo 6/7/8/... For that, the book should limit the number of screenshots and fine-grained tutorials such as "Left click Here, press the button name 'That Way', you will see a window looking like That". These fine-grained instructions are a pain to update and need to change with each version of Pharo. It is ok to have some, but not too much. -- Damien Cassou http://damiencassou.seasidehosting.st "Success is the ability to go from one failure to another without losing enthusiasm." --Winston Churchill
Re: [Pharo-users] #collect:as:Dictionary
> On 23 Oct 2015, at 07:12, Peter Uhnákwrote: > > Hi, > > is this intentional behavior? > > #(a b c) collect: [ :each | each -> each first asciiValue ] as: Dictionary. > "a Dictionary(1->#a->97 2->#b->98 3->#c->99 )" > > (#(a b c) collect: [ :each | each -> each first asciiValue ]) asDictionary. > "a Dictionary(#a->97 #b->98 #c->99 )" > > I would expect that collect:as: for Dictionaries would act in the same way as > #asDictionary. > Yes, I would expect the same… asDictionary is fairly recent, though. Before that, any kind of conversion would have been fine. Marcus
[Pharo-users] Matrix error
Hi, I was testing the code here: =[1]= | medMatrix | medMatrix := Matrix new. medMatrix numberOfColumns: 7; numberOfRows: 5. 1 to: medMatrix numberOfRows do: [:row | 1 to: medMatrix numberOfColumns do: [ :column | "medMatrix at: row at: column put: 0." Transcript show: row asString, ',', column asString, '|'. ]. Transcript show: cr. ]. medMatrix. === and I got a transcript like this: =[2]== 1,1|1,2|1,3|1,4|1,5|1,6|1,7|nil2,1|2,2|2,3|2,4|2,5|2,6|2,7|nil3,1|3,2|3,3|3,4|3,5|3,6|3,7|nil4,1|4,2|4,3|4,4|4,5|4,6|4,7|nil5,1|5,2|5,3|5,4|5,5|5,6|5,7|nil'[Spotter] Exception while collecting processors for : Error: Instances of UndefinedObject are not indexable' '[Spotter] Exception while collecting processors for : Error: Instances of UndefinedObject are not indexable' '[Spotter] Exception while collecting processors for : Error: Instances of UndefinedObject are not indexable' '[Spotter] Exception while collecting processors for : Error: Instances of UndefinedObject are not indexable' = I tried also with SciSmalltalk matrix, but they seem to be only square ones. What's is the problem with matrices? Why I'm getting Undefined Objects while trying to iterate or populate them? Thanks, Offray
Re: [Pharo-users] Pharo family update
Hello Adam, Some feedback about the visualization: - The OmniBrowser is not supported anymore in Pharo. You could add Nautilus which is the browser implementation (but not a browser library). - Monticello, Gofer and Metacello could be closer. I think Versionner and FileTree (or GitFileTree) should be in. - Finder could be in near Spotter (I never used Spotter). - Event "framework" is missing (Announcement). - Mondorian -> Mondrian. But I think that is part of Roassal now (same with Grapher). - There could be another category for Science with SciSmalltalk (and BioSmalltalk of course :) - CommandShell, OSProcess, ProcessWrapper, FFI. - Spec could be added too. - The Twitter Bootstrap is nice too. - Logging support? - VM packages? About categories I would group in different way but it's personal choice. Like Reflection, Code Analysis, Persistency, App Model Frameworks (Chalten, Aconcagua), etc Cheers, Hernán 2015-10-23 18:58 GMT-03:00 Adam: > Hello, > > I just updated drawing of projects around Pharo. > > Main idea is to guide people (new users of Pharo) through fields of > interests > - something they might be looking for. I choose these 10 fields devided > into > some specific subjects. Somewhere it is too detailed, while elsewhere it is > too fuzzy - it is just showing image of Pharo I have in my mind. > > It should help people to: > - identify important classes in Pharo, > - select right project, > - understand what is application, tool or framework, > - see what is allready inside main Pharo image. > > I would like to add links pointing to part of books or to videos where > specific projects are used. And maybe a star symbol for very important or > enterprise ready projects. > > As You can see I left few subjects empty. Maybe someone can help me fill > this. > But I will be happy for any type of correction - changing fields of > interest, > subjects, adding/removing projects etc... > > I prepared textual version on github - but right now it is not coherent > with > the drawing (I will correct this if needed). > > Adam.
Re: [Pharo-users] Pharo family update
Hi Adam, Thanks for this work. It helps a lot. Some suggestions: - I would put "(beginners) education" instead of learning for DrGeo and Phratch - I would add AidaWeb to the Web Development spot and put Import/Export and output near to data, because is closer to the path I have taken in my own newbie project. At some point I think that maybe in another graph, would be nice to put "problems" instead of themes. For example, for my problem (interactive writing) I have used Roassal, Spec, Ston, GT Browsers and I think that most of the times you're driven by problems more that themes. So may be, once you have your family diagram ready, we can see how to complement it showing problems related to the projects we're making. I wonder how can something like that be mapped on Roassal (but your SVG's are pretty fancy). Keep the good work, Offray On 23/10/15 18:24, Hernán Morales Durand wrote: Hello Adam, Some feedback about the visualization: - The OmniBrowser is not supported anymore in Pharo. You could add Nautilus which is the browser implementation (but not a browser library). - Monticello, Gofer and Metacello could be closer. I think Versionner and FileTree (or GitFileTree) should be in. - Finder could be in near Spotter (I never used Spotter). - Event "framework" is missing (Announcement). - Mondorian -> Mondrian. But I think that is part of Roassal now (same with Grapher). - There could be another category for Science with SciSmalltalk (and BioSmalltalk of course :) - CommandShell, OSProcess, ProcessWrapper, FFI. - Spec could be added too. - The Twitter Bootstrap is nice too. - Logging support? - VM packages? About categories I would group in different way but it's personal choice. Like Reflection, Code Analysis, Persistency, App Model Frameworks (Chalten, Aconcagua), etc Cheers, Hernán 2015-10-23 18:58 GMT-03:00 Adam>: Hello, I just updated drawing of projects around Pharo. Main idea is to guide people (new users of Pharo) through fields of interests - something they might be looking for. I choose these 10 fields devided into some specific subjects. Somewhere it is too detailed, while elsewhere it is too fuzzy - it is just showing image of Pharo I have in my mind. It should help people to: - identify important classes in Pharo, - select right project, - understand what is application, tool or framework, - see what is allready inside main Pharo image. I would like to add links pointing to part of books or to videos where specific projects are used. And maybe a star symbol for very important or enterprise ready projects. As You can see I left few subjects empty. Maybe someone can help me fill this. But I will be happy for any type of correction - changing fields of interest, subjects, adding/removing projects etc... I prepared textual version on github - but right now it is not coherent with the drawing (I will correct this if needed). Adam.
[Pharo-users] Would smart variable ordering improve performance?
Hi! It is known that increasing data locality is a good way to benefit from CPU caches. There has been some effort from the IBM’s JVM crew that aligns some frequently accessed variables at a particular offset to improve accesses. Would this approach works in Pharo? Other similar situation: will the expression “Object new yourself” be faster if the object (i.e., result of Object new) is physically close to the class Object in memory? Cheers, Alexandre -- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
Re: [Pharo-users] Pharo family update
Le 23/10/2015 23:58, Adam a écrit : > Hello, > > I just updated drawing of projects around Pharo. > > Main idea is to guide people (new users of Pharo) through fields of interests > - something they might be looking for. I choose these 10 fields devided into > some specific subjects. Somewhere it is too detailed, while elsewhere it is > too fuzzy - it is just showing image of Pharo I have in my mind. > > It should help people to: > - identify important classes in Pharo, > - select right project, > - understand what is application, tool or framework, > - see what is allready inside main Pharo image. > > I would like to add links pointing to part of books or to videos where > specific projects are used. And maybe a star symbol for very important or > enterprise ready projects. > > As You can see I left few subjects empty. Maybe someone can help me fill > this. > But I will be happy for any type of correction - changing fields of interest, > subjects, adding/removing projects etc... > > I prepared textual version on github - but right now it is not coherent with > the drawing (I will correct this if needed). > > Adam. > Hi, This is really great and valuable! I think this should be add to pharo.org because this is really helpful for new users that are not on the mailing list. Here some feedback: - I think Pillar is more an application than a Framework. - For the Games there is Metaborg I thank. - Maybe you should add the CatalogBrowser to "Deployment"? Or is it too small? - Maybe FFI should be added? - Maybe GitFileTree should be added? - Maybe OSProcess should be added? - Maybe Spec should be added? But you did a great job! :) -- Cyril Ferlicot http://www.synectique.eu 165 Avenue Bretagne Lille 59000 France signature.asc Description: OpenPGP digital signature