Re: [Pharo-users] Crash or locked VM

2016-01-07 Thread Hilaire
What is really strange in the VM crash, is I can't even step in the
recursive block. When stepping in the tree call (last line of the script
bellow), the VM crash.


| canvas tree angl angr fac|
canvas := DrGeoCanvas new fullscreen.
fac := (canvas freeValue: 2/3) hide.
angl := (canvas freeValue: 2.8) hide.
angr := (canvas freeValue: -2.8) hide.

tree := [ ].
tree := [ :a :b :k | | ab  m v bm lbc rbc lb rb mb |
"construction of the tree"
ab := canvas segment: a to: b.
m := (canvas middleOf: ab) hide.
v := (canvas vector: b to: m) hide.
bm := (canvas scale:  ab center: b factor: fac) hide.
lbc := canvas rotate: bm center: b angle: angr.
rbc := canvas rotate: bm center:  b angle: angl.
canvas translate:  lbc vector: v.
lb := (canvas rotate: m center: b angle: angr) .
rb := (canvas rotate: m center: b angle: angl) .
mb := (canvas translate: rb vector: v) .
k > 0 ifTrue: [
tree value: m value: mb value: k - 1.
tree value: b value: lb value: k - 1.
tree value: b value: rb value: k - 1]].
tree value:  0@0 value: 0@6 value: 5



Crash dump:
last object overwritten

/home/hilaire/Travaux/Developpement/DrGeoII/trunk/build/tmp/DrGeo.appCrash/Contents/Linux/pharo
pharo VM version: 3.9-7 #1 Sat Jun 14 17:26:13 CEST 2014 gcc 4.6.3
[Production ITHB VM]
Built from: NBCoInterpreter NativeBoost-CogPlugin-EstebanLorenzano.20
uuid: cf2a-897d-48fd-8251-6789dd21d958 Jun 14 2014
With: NBCogit NativeBoost-CogPlugin-EstebanLorenzano.20 uuid:
cf2a-897d-48fd-8251-6789dd21d958 Jun 14 2014
Revision: https://github.com/pharo-project/pharo-vm.git Commit:
0e8bbfbaeb03237fa6bb63ba834773fab18ca307 Date: 2014-06-14 12:20:21 -0300
By: Esteban Lorenzano  Jenkins build #14833
Build host: Linux pharo-linux 3.2.0-31-generic-pae #50-Ubuntu SMP Fri
Sep 7 16:39:45 UTC 2012 i686 i686 i386 GNU/Linux
plugin path:
/home/hilaire/Travaux/Developpement/DrGeoII/trunk/build/tmp/DrGeo.appCrash/Contents/Linux
[default:
/home/hilaire/Travaux/Developpement/DrGeoII/trunk/build/tmp/DrGeo.appCrash/Contents/Linux/]


C stack backtrace & registers:
*/home/hilaire/Travaux/Developpement/DrGeoII/trunk/build/tmp/DrGeo.appCrash/Contents/Linux/pharo[0x809fc8c]
/home/hilaire/Travaux/Developpement/DrGeoII/trunk/build/tmp/DrGeo.appCrash/Contents/Linux/pharo(error+0x17)[0x809fe97]
/home/hilaire/Travaux/Developpement/DrGeoII/trunk/build/tmp/DrGeo.appCrash/Contents/Linux/pharo[0x8074a98]
/home/hilaire/Travaux/Developpement/DrGeoII/trunk/build/tmp/DrGeo.appCrash/Contents/Linux/pharo[0x8074bf0]
/home/hilaire/Travaux/Developpement/DrGeoII/trunk/build/tmp/DrGeo.appCrash/Contents/Linux/pharo(interpret+0x2de0)[0x8093640]
/home/hilaire/Travaux/Developpement/DrGeoII/trunk/build/tmp/DrGeo.appCrash/Contents/Linux/pharo(enterSmalltalkExecutiveImplementation+0x59)[0x8095d79]
/home/hilaire/Travaux/Developpement/DrGeoII/trunk/build/tmp/DrGeo.appCrash/Contents/Linux/pharo(interpret+0x1de)[0x8090a3e]
/home/hilaire/Travaux/Developpement/DrGeoII/trunk/build/tmp/DrGeo.appCrash/Contents/Linux/pharo(main+0x2b2)[0x805b842]
/lib/i386-linux-gnu/libc.so.6(__libc_start_main+0xf3)[0xf74dfa83]
/home/hilaire/Travaux/Developpement/DrGeoII/trunk/build/tmp/DrGeo.appCrash/Contents/Linux/pharo[0x805bb61]
[0x0]


Smalltalk stack dump:
0xffcd7858 I EventManager class>actionMapFor: 0xb4cc1a40: a(n)
EventManager class
0xffcd787c I DebugSession(Object)>actionMap 0xb65028a8: a(n) DebugSession
0xffcd78a0 I DebugSession(Object)>actionForEvent: 0xb65028a8: a(n)
DebugSession
0xffcd78c4 I DebugSession(Object)>triggerEvent: 0xb65028a8: a(n)
DebugSession
0xffcd78e8 I DebugSession>stepInto: 0xb65028a8: a(n) DebugSession
0xffcd7904 M StepIntoDebugAction>executeAction 0xb676297c: a(n)
StepIntoDebugAction
0xffcd7924 I StepIntoDebugAction(DebugAction)>execute 0xb676297c: a(n)
StepIntoDebugAction
0xffcd7940 M [] in SpecDebugActionButton>update 0xb6768a38: a(n)
SpecDebugActionButton
0xffcd7960 I SpecDebugActionButton(ButtonModel)>performAction
0xb6768a38: a(n) SpecDebugActionButton
0xffcd797c M MorphicButtonAdapter>action 0xb677ed78: a(n)
MorphicButtonAdapter
0xffcd799c I PluggableButtonMorph>performAction: 0xb677edac: a(n)
PluggableButtonMorph
0xffcd6814 M [] in PluggableButtonMorph>mouseUp: 0xb677edac: a(n)
PluggableButtonMorph
0xffcd6838 M Array(SequenceableCollection)>do: 0xb6834688: a(n) Array
0xffcd6858 M PluggableButtonMorph>mouseUp: 0xb677edac: a(n)
PluggableButtonMorph
0xffcd6884 I PluggableButtonMorph(Morph)>handleMouseUp: 0xb677edac: a(n)
PluggableButtonMorph
0xffcd68a0 M MouseButtonEvent>sentTo: 0xb6834660: a(n) MouseButtonEvent
0xffcd68bc M PluggableButtonMorph(Morph)>handleEvent: 0xb677edac: a(n)
PluggableButtonMorph
0xffcd68d8 M PluggableButtonMorph(Morph)>handleFocusEvent: 0xb677edac:
a(n) PluggableButtonMorph
0xffcd6900 M [] in HandMorph>sendFocusEvent:to:clear: 0xb4f45f38: a(n)
HandMorph
0xffcd691c M BlockClosure>on:do: 0xb68345c8: a(n) BlockClosure
0xffcd6948 M WorldMorph(PasteUpMorph)>becomeActiveDuring: 0xb4f45e50:
a(n) Wor

[Pharo-users] Spec: Populating a playground with a particular content (was Re: Spec: Binding widgets how to)

2016-01-07 Thread Offray Vladimir Luna Cárdenas

Hi,

Thanks to NIcolai's help with his minimalist example I'm on track now 
and finally I have started to understand better the events in Spec. My 
problem was in the incorrect use of whenHighlightedItemChanged. Now the 
code its working fine and I can browse the tree and see the related 
contents on the respective UI panels (see attached screenshot and code 
at [*] at the end to see how was solved).


Now I'm facing another issue: As you can see in the attached screenshot 
the UI has four parts: A tool bar above all, a tree with the node title 
(called node header) at left and a bigger panel at right with node 
contents (called node body). I would like to make the node body behave 
in a similar way as in my previous non-Spec interface, so it can react 
differently according to the node tags. If the node is tagged as code, 
it will become a playground with node contents inside such playground. 
If node is not tagged it will be a text like now (this is already 
working). So my questions are:


1) How can I populate a Spec-Glamour playground with a particular text code?
2) How can I initializeWidgets with some kind of conditions depending on 
the kind of selection I have done on the tree? At this moment my 
initializeWidgets look like this:


==[2a]===
GrafoscopioGUI>>initializeWidgets
"Buils graphical interface elements"

windowMainMenu := self windowMainMenu.
tree := self tree.
nodeHeader := self newTextInput.
nodeBody :=
tree selectedItem notNil
ifTrue: [ self updateBody ]
ifFalse: [nodeBody := self newText].
windowMainMenu applyTo: self.
self focusOrder
add: windowMainMenu;
add: tree;
add: nodeHeader;
add: nodeBody.


and my updataBody (where I think that this conditional behavior could be 
looks like this:


==[2b]===
GrafoscopioGUI>>updateBody
"update the displayed content associated to the body of a node"

(tree selectedItem content tags = 'código')
ifTrue: [
^ nodeBody text: 'I should be playground because I am 
tagged as ', tree selectedItem content tags

]
ifFalse: [
^ nodeBody text: tree selectedItem content body
]


So, more precisely, what I need to put in the ifTrue part of [2b] to 
make the interface to return a playground with pre-populated code? (is 
it the proper place?)


Finally, here is the code that made the tree update properly, just for 
the curious ones.


==[*]
GrafoscopioGUI>>tree
| notebook |
notebook := GrafoscopioNode new becomeDefaultTestTree.
tree := TreeModel new.
tree
roots: notebook children;
childrenBlock: [:node | node children];
displayBlock: [:node | node title ].
tree whenHighlightedItemChanged:
 [tree selectedItem notNil
ifTrue: [
self updateHeader.
self updateBody.
]
 ].
^ tree


Cheers,

Offray


On 03/01/16 18:33, Offray Vladimir Luna Cárdenas wrote:

Thanks again Nicolai! I will start from here :-).

Offray

On 03/01/16 18:20, Nicolai Hess wrote:



2016-01-03 23:52 GMT+01:00 Offray Vladimir Luna Cárdenas 
:


Hi,

On 03/01/16 08:45, Nicolai Hess wrote:



There is any way to run a minimal GUI with a tree using your
example? I'm still missing a key concept on how to use spec
and binding between widgets.


what is missing ? this is a minimal gui with a tree component.


Ohh, what is missing is not in the example, but in my
understanding on how to use/start it. I would expect for
something like "example openWithSpec" to start deconstructing it,
but I'm still lost about it. I will be working on it today and
tomorrow to see if I can come with better questions.


Ok, for this example you can just start it with:

TreeDemo new openWithSpec

It opens a window with two panes, the upper pane shows a tree with 
some nodes (subclasses of class Morph)
The lower pane shows the text(name) of the selected node. You can 
change and accept (cmd+s) the text in the

lower pane, which will update the name of the tree node.


Cheers,

Offray








[Pharo-users] Pine64

2016-01-07 Thread John Pfersich
I've pre-ordered a Pine64 SBC. The write up says it's got a "1.2 Ghz Quad-Core 
ARM Cortex A53 64-Bit Processor. It has 64 and 32 Bit execution states for 
scalable high performance power – including a NEON Multimedia processing 
engine."

Does anybody have an idea whether the vm for the raspberry pi will work with 
this new computer? 

This is what the ARM site says about the A53 processor:

As well as running 64-bit applications, the Cortex-A53 seamlessly and 
efficiently runs legacy ARM 32-bit applications. It is highly scalable, from a 
single multi-core CPU cluster, to a dual-cluster big.LITTLE CPU subsystem in 
combination with the Cortex-A72or Cortex-A57 processor, to a multi-cluster 
enterprise system connected through AMBA® 5 CHI Coherent 
Interconnecttechnology. Full ARMv8-A support in a small and highly configurable 
package means that the Cortex-A53 is highly suited to a broad range of mobile, 
consumer, general purpose, and enterprise applications.

Sent from my iPad


Sent from my iPad