Re: [Pharo-dev] How to debug code using DynamicVariable?

2014-06-24 Thread Norbert Hartl


 Am 24.06.2014 um 00:27 schrieb Eliot Miranda eliot.mira...@gmail.com:
 
 
 
 
 On Mon, Jun 23, 2014 at 3:04 PM, Norbert Hartl norb...@hartl.name wrote:
 The slice cannot be integrated automatically because there is a modal 
 popping up
 
 Warning: Process should not be redefined. Proceed to store over it.
 
 Not sure what to do. Manual integration?
 
 Can you not wrap that in [] valueSupplyingAnswer: true ? 
 
Sure. But I can only provide the monticello package and this code needs to go 
into the build process. Right? I just wanted to say it early. I think the guys 
know how to treat it. If there is anything I can do

Norbert
 Norbert
 
 Am 23.06.2014 um 23:55 schrieb Norbert Hartl norb...@hartl.name:
 
 https://pharo.fogbugz.com/default.asp?13378
 
 Btw. I tested this as well in 3.0 and a backport would be highly 
 appreciated.
 
 Norbert
 
 Am 23.06.2014 um 20:08 schrieb stepharo steph...@free.fr:
 
 Thanks Eliot.
 Sven, Norbert if you package that nicely (BTW having some tests would be 
 great) we can include that in 4.0
 
 Stef
 On 23/6/14 19:29, Eliot Miranda wrote:
 and here are the changes I've just committed to Squeak trunk.
 
 
 On Mon, Jun 23, 2014 at 10:05 AM, Eliot Miranda 
 eliot.mira...@gmail.com wrote:
 Hi Norbert,
 
 [ let me try again.  never try and get code out too early in the 
 morning ;-) ]
 
 it is the debugger that needs fixing, not your code !! :-).  The 
 debugger needs to respect process identity.  Andreas and I (mostly 
 Andreas) came up with the following changes at Qwaq.  Your message is a 
 good reminder that I need to add this to Squeak asap.
 
 The idea is for Process to have an additional inst var 
 'effectiveProcess' that holds the actual process running code.  For the 
 most part this is self, but in the debugger we substitute the process 
 being debugged:
 
 Process methods for accessing
 effectiveProcess
  effectiveProcess is a mechanism to allow process-faithful debugging.  
 The debugger executes code
   on behalf of processes, so unless some effort is made the identity of 
 Processor activeProcess is not
   correctly maintained when debugging code.  The debugger uses 
 evaluate:onBehalfOf: to assign the
   debugged process as the effectiveProcess of the process executing the 
 code, preserving process
   identity.
  ^effectiveProcess ifNil: [self]
 
 then the relevant methods in Process and processorScheduler defer to 
 effectiveProcess, e.g.
 
 ProcessorScheduler methods for process state change
 terminateActive
  Terminate the process that is currently running.
 
  activeProcess effectiveProcess terminate
 
 and the debugging methods use evaluate:onBehalfOf: to install the 
 process being debugged:
 
 Process methods for private
 evaluate: aBlock onBehalfOf: aProcess
  Evaluate aBlock setting effectiveProcess to aProcess.  Used
   in the execution simulation machinery to ensure that
   Processor activeProcess evaluates correctly when debugging.
  | oldEffectiveProcess |
  oldEffectiveProcess := effectiveProcess.
  effectiveProcess := aProcess.
  ^aBlock ensure: [effectiveProcess := oldEffectiveProcess]
 
 Process methods for changing suspended state
 step
 
  ^Processor activeProcess
  evaluate: [suspendedContext := suspendedContext step]
  onBehalfOf: self
 
 stepToCallee
  Step until top context changes
 
  Processor activeProcess
  evaluate:
  [| ctxt |
  ctxt := suspendedContext.
  [ctxt == suspendedContext] whileTrue: [
  suspendedContext := suspendedContext step]]
  onBehalfOf: self.
  ^suspendedContext
 
 etc.  Changes from a Qwaq image attached.
 
 HTH
 
 
 On Mon, Jun 23, 2014 at 4:50 AM, Norbert Hartl norb...@hartl.name 
 wrote:
 In my code I'm using a DynamicVariable to request a context object when 
 needed. Until now I knew the name DynamicVariable only from seaside. 
 There it is called WADynamicVariable and it is an exception. So I 
 blindly assumed the pharo DynamicVariable works the same.
 I thought this might be a good optimization not to travel the stack all 
 the time but put in the process.
 Now that I am using it I can see the difference. I find it real hard 
 using it because I don't know how to debug/step in code. 
 DynamicVariable is a process specific variable but as soon as a 
 debugger opens it is very likely to be in another process. This makes 
 stepping in method using the DynamicVariable impossible. The only way 
 round is to set break points after the dynamic lookup and step from 
 there. But this feels just wrong.
 What would be the best way to have DynamicVariable and be able to debug 
 anything? Or is there a variant that uses the stack instead of the 
 active process?
 
 thanks,
 
 Norbert
 
 
 
 
 
 -- 
 best,
 Eliot
 
 
 
 -- 
 best,
 Eliot
 
 
 
 
 
 
 -- 
 best,
 Eliot


[Pharo-dev] [pharo-project/pharo-core]

2014-06-24 Thread GitHub
  Branch: refs/tags/30850
  Home:   https://github.com/pharo-project/pharo-core


[Pharo-dev] [pharo-project/pharo-core] d8bb46: 30850

2014-06-24 Thread GitHub
  Branch: refs/heads/3.0
  Home:   https://github.com/pharo-project/pharo-core
  Commit: d8bb46043b0475cf1c01c3af5578c681f16aa668
  
https://github.com/pharo-project/pharo-core/commit/d8bb46043b0475cf1c01c3af5578c681f16aa668
  Author: Jenkins Build Server bo...@pharo-project.org
  Date:   2014-06-24 (Tue, 24 Jun 2014)

  Changed paths:
M 
ProfStef-Core.package/PharoSyntaxTutorial.class/instance/interactive/prepareDebuggerExample.st
A ScriptLoader30.package/ScriptLoader.class/instance/pharo - 
scripts/script112.st
A ScriptLoader30.package/ScriptLoader.class/instance/pharo - 
updates/update30850.st
M 
ScriptLoader30.package/ScriptLoader.class/instance/public/commentForCurrentUpdate.st

  Log Message:
  ---
  30850
13349 PackPort to 3: 11987 Launching ProfStef should not require initials
https://pharo.fogbugz.com/f/cases/13349

http://files.pharo.org/image/30/30850.zip




Re: [Pharo-dev] Handling keyboard events…

2014-06-24 Thread p...@highoctane.be
On Tue, Jun 24, 2014 at 10:07 AM, Yuriy Tymchuk yuriy.tymc...@me.com
wrote:

 Hi everyone,

 sorry, if I’m annoying with this question, but is there a way to handle
 keyboard events (on mac) in a normal way? Because keyUp and keyDown do not
 have any information about the key itself. I know that it’s a long story
 also related with vm but maybe someone made some hacks to solve this
 problem?

 Cheers
 Uko


The logic is in sqSqueakOSXApplication+events.m

Now, I do not have the latest version but it is true that keyUp and keyDown
are not handled very nicely there.

KeyDown doesn't seem to have any code (but one could set something there as
the code is available). KeyUp has something.

I do not know why things are done this way. There may be side effects in
the VM if one changes the way things are...

Good luck.

 (void) recordCharEvent:(NSString *) unicodeString fromView:
(NSViewsqSqueakOSXView *) mainView {
sqKeyboardEvent evt;
 unichar unicode;
unsigned char macRomanCharacter;
NSInteger i;
 NSRange picker;
NSUInteger totaLength;
 evt.type = EventTypeKeyboard;
 evt.timeStamp = (int) ioMSecs();
picker.location = 0;
picker.length = 1;
 totaLength = [unicodeString length];
for (i=0;i  totaLength;i++) {
  unicode = [unicodeString characterAtIndex: i];
 if ([mainView lastSeenKeyBoardStrokeDetails]) {
evt.modifiers = [self translateCocoaModifiersToSqueakModifiers: [[mainView
lastSeenKeyBoardStrokeDetails] modifierFlags]];
 evt.charCode = [[mainView lastSeenKeyBoardStrokeDetails] keyCode];
} else {
evt.modifiers = 0;
 evt.charCode = 0;
}
 if ((evt.modifiers  CommandKeyBit)  (evt.modifiers  ShiftKeyBit)) {
 /* command and shift */
if ((unicode = 97)  (unicode = 122)) {
/* convert ascii code of command-shift-letter to upper case */
unicode = unicode - 32;
}
}
 NSString *lookupString = [[NSString alloc] initWithCharacters: unicode
length: 1];
 [lookupString getBytes: macRomanCharacter maxLength: 1 usedLength: NULL
encoding: NSMacOSRomanStringEncoding
   options: 0 range: picker remainingRange: NULL];
 [lookupString release];
 evt.pressCode = EventKeyDown;
 unsigned short keyCodeRemembered = evt.charCode;
evt.utf32Code = 0;
evt.reserved1 = 0;
 evt.windowIndex = (int)[[mainView windowLogic] windowIndex];
[self pushEventToQueue: (sqInputEvent *)evt];
 evt.charCode = macRomanCharacter;
evt.pressCode = EventKeyChar;
 evt.modifiers = evt.modifiers;
evt.utf32Code = unicode;
 [self pushEventToQueue: (sqInputEvent *) evt];
 if (i  1 || ![mainView lastSeenKeyBoardStrokeDetails]) {
evt.pressCode = EventKeyUp;
evt.charCode = keyCodeRemembered;
 evt.utf32Code = 0;
[self pushEventToQueue: (sqInputEvent *) evt];
}
 }

interpreterProxy-signalSemaphoreWithIndex(gDelegateApp.squeakApplication.inputSemaphoreIndex);

}

--Phil


[Pharo-dev] [pharo-project/pharo-core] 04f830: 40038

2014-06-24 Thread GitHub
  Branch: refs/heads/4.0
  Home:   https://github.com/pharo-project/pharo-core
  Commit: 04f830fd8e01b0bd1a187d5986d96cc87aae2358
  
https://github.com/pharo-project/pharo-core/commit/04f830fd8e01b0bd1a187d5986d96cc87aae2358
  Author: Jenkins Build Server bo...@pharo-project.org
  Date:   2014-06-24 (Tue, 24 Jun 2014)

  Changed paths:
M Kernel.package/Process.class/definition.st
A Kernel.package/Process.class/instance/accessing/effectiveProcess.st
M Kernel.package/Process.class/instance/changing suspended 
state/activateReturn_value_.st
M Kernel.package/Process.class/instance/changing suspended 
state/complete_.st
M Kernel.package/Process.class/instance/changing suspended state/popTo_.st
M Kernel.package/Process.class/instance/changing suspended 
state/popTo_value_.st
M Kernel.package/Process.class/instance/changing suspended 
state/return_value_.st
M Kernel.package/Process.class/instance/changing suspended state/step.st
M Kernel.package/Process.class/instance/changing suspended 
state/stepToCallee.st
M Kernel.package/Process.class/instance/changing suspended 
state/stepToSendOrReturn.st
M Kernel.package/Process.class/instance/changing suspended state/step_.st
A Kernel.package/Process.class/instance/private/evaluate_onBehalfOf_.st
M 
Kernel.package/ProcessorScheduler.class/instance/accessing/activePriority.st
M 
Kernel.package/ProcessorScheduler.class/instance/accessing/activeProcess.st
M Kernel.package/ProcessorScheduler.class/instance/process state 
change/terminateActive.st
A 
KernelTests.package/ProcessSpecificTest.class/instance/testing/testDynamicVariableAccessFromDifferentProcess.st
A ScriptLoader40.package/ScriptLoader.class/instance/pharo - 
scripts/script38.st
A ScriptLoader40.package/ScriptLoader.class/instance/pharo - 
updates/update40038.st
M 
ScriptLoader40.package/ScriptLoader.class/instance/public/commentForCurrentUpdate.st

  Log Message:
  ---
  40038
13378 DynamicVariable cannot be stepped in debugger 
https://pharo.fogbugz.com/f/cases/13378

http://files.pharo.org/image/40/40038.zip




[Pharo-dev] [pharo-project/pharo-core]

2014-06-24 Thread GitHub
  Branch: refs/tags/40038
  Home:   https://github.com/pharo-project/pharo-core


Re: [Pharo-dev] How to debug code using DynamicVariable?

2014-06-24 Thread stepharo


On 24/6/14 08:19, stepharo wrote:


The slice cannot be integrated automatically because there is a modal 
popping up



Warning: Process should not be redefined. Proceed to store
over it.


Not sure what to do. Manual integration?


We will check that :)



Norbert

Am 23.06.2014 um 23:55 schrieb Norbert Hartl norb...@hartl.name 
mailto:norb...@hartl.name:



https://pharo.fogbugz.com/default.asp?13378

Btw. I tested this as well in 3.0 and a backport would be highly 
appreciated.


Norbert

Am 23.06.2014 um 20:08 schrieb stepharo steph...@free.fr 
mailto:steph...@free.fr:



Thanks Eliot.
Sven, Norbert if you package that nicely (BTW having some tests 
would be great) we can include that in 4.0


Stef
On 23/6/14 19:29, Eliot Miranda wrote:

and here are the changes I've just committed to Squeak trunk.


On Mon, Jun 23, 2014 at 10:05 AM, Eliot Miranda 
eliot.mira...@gmail.com mailto:eliot.mira...@gmail.com wrote:


Hi Norbert,

[ let me try again.  never try and get code out too early
in the morning ;-) ]

it is the debugger that needs fixing, not your code !!
:-).  The debugger needs to respect process identity.  Andreas
and I (mostly Andreas) came up with the following changes at
Qwaq.  Your message is a good reminder that I need to add this
to Squeak asap.

The idea is for Process to have an additional inst var
'effectiveProcess' that holds the actual process running code.
 For the most part this is self, but in the debugger we
substitute the process being debugged:

/Process methods for accessing/
*effectiveProcess*
effectiveProcess is a mechanism to allow process-faithful
debugging.  The debugger executes code
 on behalf of processes, so unless some effort is made the
identity of Processor activeProcess is not
 correctly maintained when debugging code.  The debugger uses
evaluate:onBehalfOf: to assign the
 debugged process as the effectiveProcess of the process
executing the code, preserving process
 identity.
^effectiveProcess ifNil: [self]

then the relevant methods in Process and processorScheduler
defer to effectiveProcess, e.g.

/ProcessorScheduler methods for process state change/
*terminateActive*
Terminate the process that is currently running.

activeProcess effectiveProcess terminate

and the debugging methods use evaluate:onBehalfOf: to install
the process being debugged:

/Process methods for private/
*evaluate: aBlock onBehalfOf: aProcess*
Evaluate aBlock setting effectiveProcess to aProcess.  Used
 in the execution simulation machinery to ensure that
 Processor activeProcess evaluates correctly when debugging.
| oldEffectiveProcess |
oldEffectiveProcess := effectiveProcess.
effectiveProcess := aProcess.
^aBlock ensure: [effectiveProcess := oldEffectiveProcess]

/Process methods for changing suspended state/
*step*

^Processor activeProcess
evaluate: [suspendedContext := suspendedContext step]
onBehalfOf: self

*stepToCallee*
Step until top context changes

Processor activeProcess
evaluate:
[| ctxt |
ctxt := suspendedContext.
[ctxt == suspendedContext] whileTrue: [
suspendedContext := suspendedContext step]]
onBehalfOf: self.
^suspendedContext

etc.  Changes from a Qwaq image attached.

HTH


On Mon, Jun 23, 2014 at 4:50 AM, Norbert Hartl
norb...@hartl.name mailto:norb...@hartl.name wrote:

In my code I'm using a DynamicVariable to request a
context object when needed. Until now I knew the name
DynamicVariable only from seaside. There it is called
WADynamicVariable and it is an exception. So I blindly
assumed the pharo DynamicVariable works the same.
I thought this might be a good optimization not to travel
the stack all the time but put in the process.
Now that I am using it I can see the difference. I find it
real hard using it because I don't know how to debug/step
in code. DynamicVariable is a process specific variable
but as soon as a debugger opens it is very likely to be in
another process. This makes stepping in method using the
DynamicVariable impossible. The only way round is to set
break points after the dynamic lookup and step from there.
But this feels just wrong.
What would be the best way to have DynamicVariable and be
able to debug anything? Or is there a variant that uses
the stack instead of the active process?

thanks,

Norbert





-- 
best,

Eliot




--
best,
Eliot












Re: [Pharo-dev] is it save to always recompute a TextMorphs extent if the font changed

2014-06-24 Thread stepharo


On 24/6/14 08:14, stepharo wrote:

Hi nicolai

this is a couple of weeks were I'm thinking about the way widgets use 
fonts.
It is orthogonal to your mail but related. Most of the system is 
refering to fonts via a global variable.

And to me this is wrong.
I would like to experiment with a solution similar to Settings:
- 1Font should be hold by an instance variables of the widgets.
The code of the widgets should only refer to this state

- 2 Now there is the question of the propagation when we change
and there I would do the same as settings:
pragma + builder

What do the community think?

Stef




On 23/6/14 22:00, Nicolai Hess wrote:
About issue 13376 Wrong TextMorph extent for ButtonMorphs 
https://pharo.fogbugz.com/default.asp?13376 :


If you use different fonts as default font and button font, buttons 
labels may get truncated.


One solution would be to always recompute the TextMorphs extent when its
font changes, but I don't know if this is always desirable.

Otherwise, if we recompute the extent on the creation time of the button,
I am not sure if all buttonlabels have styled text.






Re: [Pharo-dev] Stepping through with GLORP Proxies

2014-06-24 Thread stepharo


On 24/6/14 08:18, stepharo wrote:

Esteban

I would like to know how different are the Glorp proxies from the ones 
of Mariano.

Because we are thinking about to get by default a nice proxy system.
Proxies in the sense of object representing one that is not in the 
system (and not proxies
as metaobject or representing an object that is around as in the JS 
literature). Ideally I would like

to unify both.

Stef

On 23/6/14 20:45, Esteban A. Maringolo wrote:

Eliot,

I never installed your proposed changes in a Pharo 3 image because
there is a significant change in ContextPart. Your proposed changeset
changes classVars of ContextPart.

Your proposal:
classVariableNames: 'MaxLengthForASingleDebugLogReport
MaxStackDepthForASingleDebugLogReport PrimitiveFailToken QuickStep
ValueIndex'

Current vars:
classVariableNames: 'PrimitiveFailToken QuickStep
SpecialPrimitiveSimulators TryNamedPrimitiveTemplateMethod'

Would you mind adapting your mirror methods changes to work also in
Pharo 3 (and maybe in Pharo 4 too?).

Esteban A. Maringolo


2014-02-26 14:40 GMT-03:00 Eliot Miranda eliot.mira...@gmail.com:

Hi Esteban,

 find attached.  Let me know of any problems.


On Wed, Feb 26, 2014 at 8:32 AM, Esteban A. Maringolo 
emaring...@gmail.com

wrote:

Hi Eliot,


2013-11-30 18:30 GMT-03:00 Eliot Miranda eliot.mira...@gmail.com:

On Fri, Nov 29, 2013 at 2:22 PM, Esteban A. Maringolo
emaring...@gmail.com
wrote:

2013/11/29 Eliot Miranda eliot.mira...@gmail.com:

I'll either prepare a change set or submit.  It'll get done.

I can continue stepping into until the change is ready.
Please make it compatible with Pharo 2 (whatever that means in 
term of

code) :)


OK, the code is now in Squeak trunk.  What image should I use to
integrate
into Pharo 2?  A url please...

I'm coming back late to this. Because the change wasn't integrated in
Pharo 2.

Do you have the changeset applied to Squeak Trunk? I'd like to reapply
it in my Pharo 2 image (at my own risk).
Can you send it to may email address?

Thank you!

Esteban A. Maringolo




--
best,
Eliot









Re: [Pharo-dev] Stepping through with GLORP Proxies

2014-06-24 Thread stepharo

Esteban

I would like to know how different are the Glorp proxies from the ones 
of Mariano.

Because we are thinking about to get by default a nice proxy system.
Proxies in the sense of object representing one that is not in the 
system (and not proxies
as metaobject or representing an object that is around as in the JS 
literature). Ideally I would like

to unify both.

Stef

On 23/6/14 20:45, Esteban A. Maringolo wrote:

Eliot,

I never installed your proposed changes in a Pharo 3 image because
there is a significant change in ContextPart. Your proposed changeset
changes classVars of ContextPart.

Your proposal:
classVariableNames: 'MaxLengthForASingleDebugLogReport
MaxStackDepthForASingleDebugLogReport PrimitiveFailToken QuickStep
ValueIndex'

Current vars:
classVariableNames: 'PrimitiveFailToken QuickStep
SpecialPrimitiveSimulators TryNamedPrimitiveTemplateMethod'

Would you mind adapting your mirror methods changes to work also in
Pharo 3 (and maybe in Pharo 4 too?).

Esteban A. Maringolo


2014-02-26 14:40 GMT-03:00 Eliot Miranda eliot.mira...@gmail.com:

Hi Esteban,

 find attached.  Let me know of any problems.


On Wed, Feb 26, 2014 at 8:32 AM, Esteban A. Maringolo emaring...@gmail.com
wrote:

Hi Eliot,


2013-11-30 18:30 GMT-03:00 Eliot Miranda eliot.mira...@gmail.com:

On Fri, Nov 29, 2013 at 2:22 PM, Esteban A. Maringolo
emaring...@gmail.com
wrote:

2013/11/29 Eliot Miranda eliot.mira...@gmail.com:

I'll either prepare a change set or submit.  It'll get done.

I can continue stepping into until the change is ready.
Please make it compatible with Pharo 2 (whatever that means in term of
code) :)


OK, the code is now in Squeak trunk.  What image should I use to
integrate
into Pharo 2?  A url please...

I'm coming back late to this. Because the change wasn't integrated in
Pharo 2.

Do you have the changeset applied to Squeak Trunk? I'd like to reapply
it in my Pharo 2 image (at my own risk).
Can you send it to may email address?

Thank you!

Esteban A. Maringolo




--
best,
Eliot







Re: [Pharo-dev] How to debug code using DynamicVariable?

2014-06-24 Thread stepharo


The slice cannot be integrated automatically because there is a modal 
popping up



Warning: Process should not be redefined. Proceed to store
over it.


Not sure what to do. Manual integration?


We will check that :)



Norbert

Am 23.06.2014 um 23:55 schrieb Norbert Hartl norb...@hartl.name 
mailto:norb...@hartl.name:



https://pharo.fogbugz.com/default.asp?13378

Btw. I tested this as well in 3.0 and a backport would be highly 
appreciated.


Norbert

Am 23.06.2014 um 20:08 schrieb stepharo steph...@free.fr 
mailto:steph...@free.fr:



Thanks Eliot.
Sven, Norbert if you package that nicely (BTW having some tests 
would be great) we can include that in 4.0


Stef
On 23/6/14 19:29, Eliot Miranda wrote:

and here are the changes I've just committed to Squeak trunk.


On Mon, Jun 23, 2014 at 10:05 AM, Eliot Miranda 
eliot.mira...@gmail.com mailto:eliot.mira...@gmail.com wrote:


Hi Norbert,

[ let me try again.  never try and get code out too early
in the morning ;-) ]

  it is the debugger that needs fixing, not your code !! :-).
 The debugger needs to respect process identity.  Andreas and I
(mostly Andreas) came up with the following changes at Qwaq.
 Your message is a good reminder that I need to add this to
Squeak asap.

The idea is for Process to have an additional inst var
'effectiveProcess' that holds the actual process running code.
 For the most part this is self, but in the debugger we
substitute the process being debugged:

/Process methods for accessing/
*effectiveProcess*
effectiveProcess is a mechanism to allow process-faithful
debugging.  The debugger executes code
 on behalf of processes, so unless some effort is made the
identity of Processor activeProcess is not
 correctly maintained when debugging code.  The debugger uses
evaluate:onBehalfOf: to assign the
 debugged process as the effectiveProcess of the process
executing the code, preserving process
 identity.
^effectiveProcess ifNil: [self]

then the relevant methods in Process and processorScheduler
defer to effectiveProcess, e.g.

/ProcessorScheduler methods for process state change/
*terminateActive*
Terminate the process that is currently running.

activeProcess effectiveProcess terminate

and the debugging methods use evaluate:onBehalfOf: to install
the process being debugged:

/Process methods for private/
*evaluate: aBlock onBehalfOf: aProcess*
Evaluate aBlock setting effectiveProcess to aProcess.  Used
 in the execution simulation machinery to ensure that
 Processor activeProcess evaluates correctly when debugging.
| oldEffectiveProcess |
oldEffectiveProcess := effectiveProcess.
effectiveProcess := aProcess.
^aBlock ensure: [effectiveProcess := oldEffectiveProcess]

/Process methods for changing suspended state/
*step*

^Processor activeProcess
evaluate: [suspendedContext := suspendedContext step]
onBehalfOf: self

*stepToCallee*
Step until top context changes

Processor activeProcess
evaluate:
[| ctxt |
ctxt := suspendedContext.
[ctxt == suspendedContext] whileTrue: [
suspendedContext := suspendedContext step]]
onBehalfOf: self.
^suspendedContext

etc.  Changes from a Qwaq image attached.

HTH


On Mon, Jun 23, 2014 at 4:50 AM, Norbert Hartl
norb...@hartl.name mailto:norb...@hartl.name wrote:

In my code I'm using a DynamicVariable to request a context
object when needed. Until now I knew the name
DynamicVariable only from seaside. There it is called
WADynamicVariable and it is an exception. So I blindly
assumed the pharo DynamicVariable works the same.
I thought this might be a good optimization not to travel
the stack all the time but put in the process.
Now that I am using it I can see the difference. I find it
real hard using it because I don't know how to debug/step
in code. DynamicVariable is a process specific variable but
as soon as a debugger opens it is very likely to be in
another process. This makes stepping in method using the
DynamicVariable impossible. The only way round is to set
break points after the dynamic lookup and step from there.
But this feels just wrong.
What would be the best way to have DynamicVariable and be
able to debug anything? Or is there a variant that uses the
stack instead of the active process?

thanks,

Norbert





-- 
best,

Eliot




--
best,
Eliot










Re: [Pharo-dev] is it save to always recompute a TextMorphs extent if the font changed

2014-06-24 Thread stepharo

Hi nicolai

this is a couple of weeks were I'm thinking about the way widgets use fonts.
It is orthogonal to your mail but related. Most of the system is 
refering to fonts via a global variable.

And to me this is wrong.
I would like to experiment with a solution similar to Settings:
- 1Font should be hold by an instance variables of the widgets.
The code of the widgets should only refer to this state

- 2 Now there is the question of the propagation when we change
and there I would do the same as settings:
pragma + builder

What do the community think?

Stef




On 23/6/14 22:00, Nicolai Hess wrote:
About issue 13376 Wrong TextMorph extent for ButtonMorphs 
https://pharo.fogbugz.com/default.asp?13376 :


If you use different fonts as default font and button font, buttons 
labels may get truncated.


One solution would be to always recompute the TextMorphs extent when its
font changes, but I don't know if this is always desirable.

Otherwise, if we recompute the extent on the creation time of the button,
I am not sure if all buttonlabels have styled text.




Re: [Pharo-dev] How to debug code using DynamicVariable?

2014-06-24 Thread Norbert Hartl

Am 24.06.2014 um 08:19 schrieb stepharo steph...@free.fr:

 
 The slice cannot be integrated automatically because there is a modal 
 popping up
 
 Warning: Process should not be redefined. Proceed to store over it.
 
 Not sure what to do. Manual integration?
 
 We will check that :)
 
Marcus already integrated it. Thanks!

norbert
 
 Norbert
 
 Am 23.06.2014 um 23:55 schrieb Norbert Hartl norb...@hartl.name:
 
 https://pharo.fogbugz.com/default.asp?13378
 
 Btw. I tested this as well in 3.0 and a backport would be highly 
 appreciated.
 
 Norbert
 
 Am 23.06.2014 um 20:08 schrieb stepharo steph...@free.fr:
 
 Thanks Eliot.
 Sven, Norbert if you package that nicely (BTW having some tests would be 
 great) we can include that in 4.0
 
 Stef
 On 23/6/14 19:29, Eliot Miranda wrote:
 and here are the changes I've just committed to Squeak trunk.
 
 
 On Mon, Jun 23, 2014 at 10:05 AM, Eliot Miranda eliot.mira...@gmail.com 
 wrote:
 Hi Norbert,
 
 [ let me try again.  never try and get code out too early in the 
 morning ;-) ]
 
 it is the debugger that needs fixing, not your code !! :-).  The 
 debugger needs to respect process identity.  Andreas and I (mostly 
 Andreas) came up with the following changes at Qwaq.  Your message is a 
 good reminder that I need to add this to Squeak asap.
 
 The idea is for Process to have an additional inst var 'effectiveProcess' 
 that holds the actual process running code.  For the most part this is 
 self, but in the debugger we substitute the process being debugged:
 
 Process methods for accessing
 effectiveProcess
 
   effectiveProcess is a 
 mechanism to allow process-faithful debugging.  The debugger executes code
 
on behalf of processes, so 
 unless some effort is made the identity of Processor activeProcess is not
 
correctly maintained when 
 debugging code.  The debugger uses evaluate:onBehalfOf: to assign the
 
debugged process as the 
 effectiveProcess of the process executing the code, preserving process
 
identity.
 
   ^effectiveProcess ifNil: [self]
 
 then the relevant methods in Process and processorScheduler defer to 
 effectiveProcess, e.g.
 
 ProcessorScheduler methods for process state change
 terminateActive
 
   Terminate the process that is 
 currently running.
 
 
   activeProcess effectiveProcess 
 terminate
 
 and the debugging methods use evaluate:onBehalfOf: to install the process 
 being debugged:
 
 Process methods for private
 evaluate: aBlock onBehalfOf: aProcess
 
   Evaluate aBlock setting 
 effectiveProcess to aProcess.  Used
 
in the execution simulation 
 machinery to ensure that
 
Processor activeProcess 
 evaluates correctly when debugging.
 
   | oldEffectiveProcess |
 
   oldEffectiveProcess := 
 effectiveProcess.
 
   effectiveProcess := aProcess.
 
   ^aBlock ensure: 
 [effectiveProcess := oldEffectiveProcess]
 
 Process methods for changing suspended state
 step
 
 
   ^Processor activeProcess
 
   evaluate: [suspendedContext := 
 suspendedContext step]
 
   onBehalfOf: self
 
 stepToCallee
 
   Step until top context changes
 
 
   Processor activeProcess
 
   evaluate:
 
   [| ctxt |
 
   ctxt := suspendedContext.
 
   [ctxt == suspendedContext] 
 whileTrue: [
 
   suspendedContext := 
 suspendedContext step]]
 
   onBehalfOf: self.
 
   ^suspendedContext
 
 etc.  Changes from a Qwaq image attached.
 
 HTH
 
 
 On Mon, Jun 23, 2014 at 4:50 AM, Norbert Hartl norb...@hartl.name wrote:
 In my code I'm using a DynamicVariable to request a context object when 
 needed. Until now I knew the name DynamicVariable only from seaside. 
 There it is called WADynamicVariable and it is an exception. So I blindly 
 assumed the pharo DynamicVariable works the same.
 I thought this might be a good optimization not to travel the stack all 
 the time but put in the process.
 Now that I am using it I can see the difference. I find it real hard 
 using it 

Re: [Pharo-dev] Stepping through with GLORP Proxies

2014-06-24 Thread Esteban A. Maringolo
Hi Stef,

2014-06-24 3:18 GMT-03:00 stepharo steph...@free.fr:
 Esteban

 I would like to know how different are the Glorp proxies from the ones of
 Mariano.
 Because we are thinking about to get by default a nice proxy system.
 Proxies in the sense of object representing one that is not in the system
 (and not proxies
 as metaobject or representing an object that is around as in the JS
 literature). Ideally I would like
 to unify both.

There's nothing much special about GLORP proxies, and maybe Mariano
knows better.
They have a common superclass named AbstractProxy (no NS), and they
work more like remote references than anything else.

They are true proxies, it is, they hold a reference to the realobject,
but no #become is involved in the process.
Also proxies can release the referenced object and materialize it
back when needed (according to the proxy strategy).

Proxy#class returns Proxy, but Proxy#isKindOf: aClass returns
whether the referenced class is aClass (it is, aProxy isKindOf: Proxy
false), #= and #hash causes materialization of the referenced
object.

Other than that I couldn't find anything else, it's a classical proxy,
with some ORM related stuff.

Regards!



Re: [Pharo-dev] Stepping through with GLORP Proxies

2014-06-24 Thread Esteban Lorenzano

On 24 Jun 2014, at 09:58, Esteban A. Maringolo emaring...@gmail.com wrote:

 Hi Stef,
 
 2014-06-24 3:18 GMT-03:00 stepharo steph...@free.fr:
 Esteban
 
 I would like to know how different are the Glorp proxies from the ones of
 Mariano.
 Because we are thinking about to get by default a nice proxy system.
 Proxies in the sense of object representing one that is not in the system
 (and not proxies
 as metaobject or representing an object that is around as in the JS
 literature). Ideally I would like
 to unify both.
 
 There's nothing much special about GLORP proxies, and maybe Mariano
 knows better.
 They have a common superclass named AbstractProxy (no NS), and they
 work more like remote references than anything else.
 
 They are true proxies, it is, they hold a reference to the realobject,
 but no #become is involved in the process.
 Also proxies can release the referenced object and materialize it
 back when needed (according to the proxy strategy).
 
 Proxy#class returns Proxy, but Proxy#isKindOf: aClass returns
 whether the referenced class is aClass (it is, aProxy isKindOf: Proxy
 false), #= and #hash causes materialization of the referenced
 object.
 
 Other than that I couldn't find anything else, it's a classical proxy,
 with some ORM related stuff.

yeah, that’s why I said is not a problem of GLORP proxies but about our 
treatment of proxies in general :)

Esteban

 
 Regards!
 




Re: [Pharo-dev] SystemWindow instances can't be garbage-collected

2014-06-24 Thread Max Leske
For documentation purposes, this is what I found to be necessary to really 
clean all window instances. Note that this only works reliably when invoked 
from a non-UI process (e.g. via WAKom).


cleanupWindows
in general: the gabage collector seems to be unable to resolve all 
circular dependencies with weak pointers.
This forces us to explicitly remove the weak pointers to enable garbage 
colltection.
It also seems to be a problem to invoke the cleanup from within a UI 
process (e.g. from a workspace). 
Ergo: 
- when invoked from a workspace not all instances may be 
garbage collected
- when invoked from a non UI process (e.g. WAKom) all instances 
should have been collected
- performning a manual garbage collection after having invoked 
this code from a workspace will
(usually) remove the pending instances (new process 
context)
| count |
count := 1.
self
cleanupEvents;
cleanupWorkspaces;
cleanupSystemWindows.
[ Smalltalk garbageCollect. count := count + 1 ] doWhileFalse: [
SystemWindow allSubInstances isEmpty or: [ count  5 arbitrary 
number ] ]

cleanupWorkspaces
PluggableTextMorph allSubInstances do: [ :each | each  
hasUnacceptedEdits: false;
askBeforeDiscardingEdits: false;
myDependents: nil ]

cleanupSystemWindows
[ [ SystemWindow allSubInstances do: [ :window |
window 
makeClosable;
delete ] ] 
on: Error 
do: [ :ex | 
may get here because we're trying to 
delete a window which has been deleted already.
ex return  ].
Smalltalk garbageCollect.
already deleted but still hanging aroung (also see #cleanupEvents and 
#cleanupWorkspaces)
SystemWindow allSubInstances 
select: [ :e | e model isNil and: [ e owner isNil ] ]
thenDo: [ :e |
clean some known places where references can prevent 
GC
UITheme current focusIndicator: nil.
ActiveHand mouseOverHandler initialize.
ActiveHand keyboardFocus: nil.
World cleanseStepList.
e.g. Workspace has a dependents array wich can point 
to the window
 (PointerFinder pointersTo: e) do: [ :p | 
p class = DependentsArray ifTrue: [
the first pointer is the 'main' 
pointer in about 99% of the cases
(PointerFinder pointersTo: p) first 
removeDependent: e ] ] ] 
] on: Error do: [ ignore” ]


On 21.06.2014, at 23:11, Max Leske maxle...@gmail.com wrote:

 Found the problem, documenting it here in case anybody else ever needs this 
 (remember, this is 1.1.1).
 
 Open a debugger (e.g. by evaluating 1/0), then click into the lower right 
 workspace and type something. OCompletion will now have added an entry to the 
 EventManager actionMap with a ContextVariablesInspector instance as the key. 
 There seems to be a cycle there that can’t be resolved by the garbage 
 collector, since I wasn’t able to find any non weak global pointers (an 
 OContext is referenced by an MessageSend in the action map. The OContext 
 references a morph which is connected to the SystemWindow. Some of those 
 morphs reference the ContextVariablesInspector as their model).
 Anyhow, it should be safe to send EventManagercleanUp: with argument true 
 (actionMaps and their contents get recreated on demand), which will release 
 those entries and allow the garbage collector to collect the SystemWindows, 
 other morphs and the Debugger instances.
 
 Note that this is probably not an issue in later versions (e.g. 3.0 doesn’t 
 include EventManager anymore) but it might be relevant for later 1.x versions.
 
 Max
 
 
 On 21.06.2014, at 20:44, Max Leske maxle...@gmail.com wrote:
 
 
 On 21.06.2014, at 18:53, Marcus Denker marcus.den...@inria.fr wrote:
 
 
 On 21 Jun 2014, at 17:36, kilon alios kilon.al...@gmail.com wrote:
 
 First off:
 rantwhy do we have an IRC channel if nobody seems to be 
 listening??/rant
 
 too small community for an irc channel. My experience with irc is that 
 90-99% of people logged in at least are idle. For its size #pharo is quite 
 active actually.  
 
 
 I am IRC when at work (and not forgetting to start the IRC client). But 
 often when people ask questions it is exactly the wrong moment in time.
 I just *can’t*  instantly drop what I am doing an tend to the IRC channel… 
 I really wonder how people do it… do they really stop their work right in 
 the
 miiddle to answer questions? 

Re: [Pharo-dev] SystemWindow instances can't be garbage-collected

2014-06-24 Thread Max Leske

On 24.06.2014, at 15:30, Max Leske maxle...@gmail.com wrote:

 For documentation purposes, this is what I found to be necessary to really 
 clean all window instances. Note that this only works reliably when invoked 
 from a non-UI process (e.g. via WAKom).
 
 
 cleanupWindows
   in general: the gabage collector seems to be unable to resolve all 
 circular dependencies with weak pointers.
   This forces us to explicitly remove the weak pointers to enable garbage 
 colltection.
   It also seems to be a problem to invoke the cleanup from within a UI 
 process (e.g. from a workspace). 
   Ergo: 
   - when invoked from a workspace not all instances may be 
 garbage collected
   - when invoked from a non UI process (e.g. WAKom) all instances 
 should have been collected
   - performning a manual garbage collection after having invoked 
 this code from a workspace will
   (usually) remove the pending instances (new process 
 context)
   | count |
   count := 1.
   self
   cleanupEvents;

I forgot: #cleanupEvents is simply “EventManager cleanUp: true”

   cleanupWorkspaces;
   cleanupSystemWindows.
   [ Smalltalk garbageCollect. count := count + 1 ] doWhileFalse: [
   SystemWindow allSubInstances isEmpty or: [ count  5 arbitrary 
 number ] ]
 
 cleanupWorkspaces
   PluggableTextMorph allSubInstances do: [ :each | each  
   hasUnacceptedEdits: false;
   askBeforeDiscardingEdits: false;
   myDependents: nil ]
 
 cleanupSystemWindows
   [ [ SystemWindow allSubInstances do: [ :window |
   window 
   makeClosable;
   delete ] ] 
   on: Error 
   do: [ :ex | 
   may get here because we're trying to 
 delete a window which has been deleted already.
   ex return  ].
   Smalltalk garbageCollect.
   already deleted but still hanging aroung (also see #cleanupEvents and 
 #cleanupWorkspaces)
   SystemWindow allSubInstances 
   select: [ :e | e model isNil and: [ e owner isNil ] ]
   thenDo: [ :e |
   clean some known places where references can prevent 
 GC
   UITheme current focusIndicator: nil.
   ActiveHand mouseOverHandler initialize.
   ActiveHand keyboardFocus: nil.
   World cleanseStepList.
   e.g. Workspace has a dependents array wich can point 
 to the window
(PointerFinder pointersTo: e) do: [ :p | 
   p class = DependentsArray ifTrue: [
   the first pointer is the 'main' 
 pointer in about 99% of the cases
   (PointerFinder pointersTo: p) first 
 removeDependent: e ] ] ] 
   ] on: Error do: [ ignore” ]
 
 
 On 21.06.2014, at 23:11, Max Leske maxle...@gmail.com wrote:
 
 Found the problem, documenting it here in case anybody else ever needs this 
 (remember, this is 1.1.1).
 
 Open a debugger (e.g. by evaluating 1/0), then click into the lower right 
 workspace and type something. OCompletion will now have added an entry to 
 the EventManager actionMap with a ContextVariablesInspector instance as the 
 key. There seems to be a cycle there that can’t be resolved by the garbage 
 collector, since I wasn’t able to find any non weak global pointers (an 
 OContext is referenced by an MessageSend in the action map. The OContext 
 references a morph which is connected to the SystemWindow. Some of those 
 morphs reference the ContextVariablesInspector as their model).
 Anyhow, it should be safe to send EventManagercleanUp: with argument true 
 (actionMaps and their contents get recreated on demand), which will release 
 those entries and allow the garbage collector to collect the SystemWindows, 
 other morphs and the Debugger instances.
 
 Note that this is probably not an issue in later versions (e.g. 3.0 doesn’t 
 include EventManager anymore) but it might be relevant for later 1.x 
 versions.
 
 Max
 
 
 On 21.06.2014, at 20:44, Max Leske maxle...@gmail.com wrote:
 
 
 On 21.06.2014, at 18:53, Marcus Denker marcus.den...@inria.fr wrote:
 
 
 On 21 Jun 2014, at 17:36, kilon alios kilon.al...@gmail.com wrote:
 
 First off:
 rantwhy do we have an IRC channel if nobody seems to be 
 listening??/rant
 
 too small community for an irc channel. My experience with irc is that 
 90-99% of people logged in at least are idle. For its size #pharo is 
 quite active actually.  
 
 
 I am IRC when at work (and not forgetting to start the IRC client). But 
 often when people ask questions it is exactly the wrong moment in time.
 I just *can’t*  instantly drop what I am doing an tend to the IRC channel… 

Re: [Pharo-dev] Handling keyboard events…

2014-06-24 Thread Stephan Eggermont
This pull request might be relevant:

https://github.com/pharo-project/pharo-vm/pull/49



[Pharo-dev] A Smalltalk job at Yesplan?

2014-06-24 Thread Johan Brichau
Dear Smalltalkers,

The Yesplan team is looking for a new development colleague!

This is a full time position to be performed on site. We are not looking for a 
freelancer.
Please see [1] for the full description of the vacancy. Dutch speakers can 
check out the Dutch version [2].

If you are interested, or if you have additional questions, please contact me 
via jo...@yesplan.be
Also, do not hesitate to forward this email to potential candidates.

best regards
Johan

[1] http://yesplan.be/docs/vacancy-software-engineer.pdf
[2] http://yesplan.be/docs/vacature-software-engineer.pdf


[Pharo-dev] [ANN] Dr. Geo 17.07b

2014-06-24 Thread Hilaire Fernandes
Another release:
https://dl.dropboxusercontent.com/u/21633199/DrGeo.app-14.07c.zip


I will be happy to read comments from Mac OS X users regarding this bug
https://bugs.launchpad.net/drgeo/+bug/1331559

Thanks

-- 
Dr. Geo http://drgeo.eu
iStoa - https://launchpad.net/istoa




Re: [Pharo-dev] TaskIT Revealed

2014-06-24 Thread Max Leske
Looks really cool!  Everything’s an object :)

Does it run in older images? How hard, do you reckon, would it be to backport 
TaskIT to e.g. Pharo 1.4?

Cheers,
Max


On 23.06.2014, at 00:39, Santiago Bragagnolo santiagobragagn...@gmail.com 
wrote:

 
 Hi all, im glad to announce TaskIT. You may already knew about, after all 
 it's not confidential ;) and it has documentation on-going since some months 
 ago. 
 
 Task IT is package that provides a cool way to deal with processes. Even when 
 this version is stable, it still in design and we want to make it consistent 
 and powerfull. 
 
 It counts with a chapter in pharo enterprise book and some cool tests. 
 
 We have moved the main distribution repo to CAR 
 
 http://smalltalkhub.com/#!/~CAR/TaskIT/
 
 
 The main easy things to do with this revision are: 
 
  closures 
 val := [ 2+2 ] shootIt.
 val isKindOf: TKTFuture.
 val onSuccess: [: rslt | rslt == 4 ] async
 val value == 4.  sync 
 
 rslt := [ 2+2 ] shootIt asResult. 
 rslt == 4 sync on demand
 
  objects 
 
 val := 2 paralellize + 2.
 val == 4 sync on demand
 
 
  staying in tune 
 
 val := [ some task ] shootIt asStickyReference. 
 
 val := nil. 
  sticky means that if this future is taken by the GC, it will kill the 
 process
 
 
 
  looping  
 
 
 val := server paralellize looping serveOnce: anyParameter asStickyReference. 
 
 this will execute in a new process, in a loop, server serveOnce: 
 anyParameter.
 
 You can stop it by doing
 val:= nil. 
 
 or using a disgusting magic variable, for that check the samples :). But do 
 not rely on that kind of things, because it will not be supported 
 
 
 
 For more advanced and cool usages, check the Doc. 
 
 
 FAQ: 
 
 1- Yes, the sync on demand is implemented with a proxy and a become. 
 2- Yes, we are changing the API of the processes that persist in time. 
 
 CREDITS 
   All CAR team in general was great inspiration, particularly, Guille Polito 
 full operational commiter and  of course is always a good idea to discuss 
 with him,  Nick Papoylias, is also great to discuss with him. Luc, Noury, 
 Jannik: several ideas are discussed with them as well, and they always gave 
 me support.
 
 and from RMOD Esteban Lorenzano, also discussing and proposing.
 
 Thanks all :).
 
 
  OTHERS:
 If you want to go to the darkside (dark because is not documented yet, but in 
 the case of PoolIT, that it has some doc ) you can also add to your combo: 
 ActIT: a simple Actor extention for taskit.
 ForkIT: an extention that runs blocks in background image (it adds a nice 
 button to the test runner, letting you run all your tests in a background 
 image and installing the results after the execution) 
 PoolIT: it adds a pool of workers, it consumes tasks and ensure you a limited 
 amount of threads. 
 PlanIT: a basic and not yet full developed algebra for composing processes. 
 
 
 
 I encourage you to use it, it is being used in PhaROS since a lot  of time. 
 And please any bug and enhancements, you can contact us. Since we are working 
 on the next version is a good time to define what features are really needed. 
 
 
 Salut. 
 
 
 Santiago. .
 
 
 
 
 
 



[Pharo-dev] Inspecting an OrderPreservingDictionary entries show as nil and self prints entries

2014-06-24 Thread p...@highoctane.be
Kind of weird.

Anyone knowing how to deal with that? Bug?

Phil


Re: [Pharo-dev] Inspecting an OrderPreservingDictionary entries show as nil and self prints entries

2014-06-24 Thread Sven Van Caekenberghe
We need to add

OrderPreservingDictionary class#inspectorClass
  ^ EyeDictionaryInspector

On 24 Jun 2014, at 17:49, p...@highoctane.be wrote:

 Kind of weird.
 
 Anyone knowing how to deal with that? Bug?
 
 Phil




Re: [Pharo-dev] Inspecting an OrderPreservingDictionary entries show as nil and self prints entries

2014-06-24 Thread p...@highoctane.be
Perfect!

tThanks you Sven.

Phil


On Tue, Jun 24, 2014 at 5:54 PM, Sven Van Caekenberghe s...@stfx.eu wrote:

 We need to add

 OrderPreservingDictionary class#inspectorClass
   ^ EyeDictionaryInspector

 On 24 Jun 2014, at 17:49, p...@highoctane.be wrote:

  Kind of weird.
 
  Anyone knowing how to deal with that? Bug?
 
  Phil





Re: [Pharo-dev] TaskIT Revealed

2014-06-24 Thread Santiago Bragagnolo

 There is actually a version of taskit for 1.4, but is not the last one.
 Honestly, i did not tested on 1.4, then i don't know :). If you run on it,
 make me know. i will try to run this week if not.



2014-06-24 17:23 GMT+02:00 Max Leske maxle...@gmail.com:

 Looks really cool!  Everything’s an object :)

 Does it run in older images? How hard, do you reckon, would it be to
 backport TaskIT to e.g. Pharo 1.4?

 Cheers,
 Max


 On 23.06.2014, at 00:39, Santiago Bragagnolo santiagobragagn...@gmail.com
 wrote:


 Hi all, im glad to announce TaskIT. You may already knew about, after all
 it's not confidential ;) and it has documentation on-going since some
 months ago.

 Task IT is package that provides a cool way to deal with processes. Even
 when this version is stable, it still in design and we want to make it
 consistent and powerfull.

 It counts with a chapter in pharo enterprise book and some cool tests.

 We have moved the main distribution repo to CAR

 http://smalltalkhub.com/#!/~CAR/TaskIT/


 The main easy things to do with this revision are:

  closures 
 val := [ 2+2 ] shootIt.
 val isKindOf: TKTFuture.
 val onSuccess: [: rslt | rslt == 4 ] async
 val value == 4.  sync 

 rslt := [ 2+2 ] shootIt asResult.
 rslt == 4 sync on demand

  objects 

 val := 2 paralellize + 2.
 val == 4 sync on demand


  staying in tune 

 val := [ some task ] shootIt asStickyReference.

 val := nil.
  sticky means that if this future is taken by the GC, it will kill the
 process



  looping  


 val := server paralellize looping serveOnce: anyParameter
 asStickyReference.

 this will execute in a new process, in a loop, server serveOnce:
 anyParameter.

 You can stop it by doing
 val:= nil.

 or using a disgusting magic variable, for that check the samples :). But
 do not rely on that kind of things, because it will not be supported 



 For more advanced and cool usages, check the Doc.


 FAQ:

 1- Yes, the sync on demand is implemented with a proxy and a become.
 2- Yes, we are changing the API of the processes that persist in time.

 CREDITS
   All CAR team in general was great inspiration, particularly, Guille
 Polito full operational commiter and  of course is always a good idea to
 discuss with him,  Nick Papoylias, is also great to discuss with him. Luc,
 Noury, Jannik: several ideas are discussed with them as well, and they
 always gave me support.

 and from RMOD Esteban Lorenzano, also discussing and proposing.

 Thanks all :).


  OTHERS:
 If you want to go to the darkside (dark because is not documented yet, but
 in the case of PoolIT, that it has some doc ) you can also add to your
 combo:
 ActIT: a simple Actor extention for taskit.
 ForkIT: an extention that runs blocks in background image (it adds a nice
 button to the test runner, letting you run all your tests in a background
 image and installing the results after the execution)
 PoolIT: it adds a pool of workers, it consumes tasks and ensure you a
 limited amount of threads.
 PlanIT: a basic and not yet full developed algebra for composing
 processes.



 I encourage you to use it, it is being used in PhaROS since a lot  of
 time. And please any bug and enhancements, you can contact us. Since we are
 working on the next version is a good time to define what features are
 really needed.


 Salut.


 Santiago. .










Re: [Pharo-dev] TaskIT Revealed

2014-06-24 Thread Max Leske

On 24.06.2014, at 19:14, Santiago Bragagnolo santiagobragagn...@gmail.com 
wrote:

 There is actually a version of taskit for 1.4, but is not the last one. 
 Honestly, i did not tested on 1.4, then i don't know :). If you run on it, 
 make me know. i will try to run this week if not. 

Good stuff! Thanks.

 
 
 2014-06-24 17:23 GMT+02:00 Max Leske maxle...@gmail.com:
 Looks really cool!  Everything’s an object :)
 
 Does it run in older images? How hard, do you reckon, would it be to backport 
 TaskIT to e.g. Pharo 1.4?
 
 Cheers,
 Max
 
 
 On 23.06.2014, at 00:39, Santiago Bragagnolo santiagobragagn...@gmail.com 
 wrote:
 
 
 Hi all, im glad to announce TaskIT. You may already knew about, after all 
 it's not confidential ;) and it has documentation on-going since some months 
 ago. 
 
 Task IT is package that provides a cool way to deal with processes. Even 
 when this version is stable, it still in design and we want to make it 
 consistent and powerfull. 
 
 It counts with a chapter in pharo enterprise book and some cool tests. 
 
 We have moved the main distribution repo to CAR 
 
 http://smalltalkhub.com/#!/~CAR/TaskIT/
 
 
 The main easy things to do with this revision are: 
 
  closures 
 val := [ 2+2 ] shootIt.
 val isKindOf: TKTFuture.
 val onSuccess: [: rslt | rslt == 4 ] async
 val value == 4.  sync 
 
 rslt := [ 2+2 ] shootIt asResult. 
 rslt == 4 sync on demand
 
  objects 
 
 val := 2 paralellize + 2.
 val == 4 sync on demand
 
 
  staying in tune 
 
 val := [ some task ] shootIt asStickyReference. 
 
 val := nil. 
  sticky means that if this future is taken by the GC, it will kill the 
 process
 
 
 
  looping  
 
 
 val := server paralellize looping serveOnce: anyParameter asStickyReference. 
 
 this will execute in a new process, in a loop, server serveOnce: 
 anyParameter.
 
 You can stop it by doing
 val:= nil. 
 
 or using a disgusting magic variable, for that check the samples :). But do 
 not rely on that kind of things, because it will not be supported 
 
 
 
 For more advanced and cool usages, check the Doc. 
 
 
 FAQ: 
 
 1- Yes, the sync on demand is implemented with a proxy and a become. 
 2- Yes, we are changing the API of the processes that persist in time. 
 
 CREDITS 
   All CAR team in general was great inspiration, particularly, Guille Polito 
 full operational commiter and  of course is always a good idea to discuss 
 with him,  Nick Papoylias, is also great to discuss with him. Luc, Noury, 
 Jannik: several ideas are discussed with them as well, and they always gave 
 me support.
 
 and from RMOD Esteban Lorenzano, also discussing and proposing.
 
 Thanks all :).
 
 
  OTHERS:
 If you want to go to the darkside (dark because is not documented yet, but 
 in the case of PoolIT, that it has some doc ) you can also add to your 
 combo: 
 ActIT: a simple Actor extention for taskit.
 ForkIT: an extention that runs blocks in background image (it adds a nice 
 button to the test runner, letting you run all your tests in a background 
 image and installing the results after the execution) 
 PoolIT: it adds a pool of workers, it consumes tasks and ensure you a 
 limited amount of threads. 
 PlanIT: a basic and not yet full developed algebra for composing processes. 
 
 
 
 I encourage you to use it, it is being used in PhaROS since a lot  of time. 
 And please any bug and enhancements, you can contact us. Since we are 
 working on the next version is a good time to define what features are 
 really needed. 
 
 
 Salut. 
 
 
 Santiago. .
 
 
 
 
 
 
 
 



Re: [Pharo-dev] Inspecting an OrderPreservingDictionary entries show as nil and self prints entries

2014-06-24 Thread stepharo

Where which package?
Because we should track it and publish a new package.


Stef
On 24/6/14 17:54, Sven Van Caekenberghe wrote:

We need to add

OrderPreservingDictionary class#inspectorClass
   ^ EyeDictionaryInspector

On 24 Jun 2014, at 17:49, p...@highoctane.be wrote:


Kind of weird.

Anyone knowing how to deal with that? Bug?

Phil








Re: [Pharo-dev] [ANN] Dr. Geo 17.07b

2014-06-24 Thread stepharo

I could not succeed to make it crash


On 24/6/14 17:11, Hilaire Fernandes wrote:

Another release:
https://dl.dropboxusercontent.com/u/21633199/DrGeo.app-14.07c.zip


I will be happy to read comments from Mac OS X users regarding this bug
https://bugs.launchpad.net/drgeo/+bug/1331559

Thanks






Re: [Pharo-dev] Inspecting an OrderPreservingDictionary entries show as nil and self prints entries

2014-06-24 Thread Sven Van Caekenberghe
Like all the #inspectorClass methods, *Spec-inspector, it was just an oversight.

On 24 Jun 2014, at 21:52, stepharo steph...@free.fr wrote:

 Where which package?
 Because we should track it and publish a new package.
 
 
 Stef
 On 24/6/14 17:54, Sven Van Caekenberghe wrote:
 We need to add
 
 OrderPreservingDictionary class#inspectorClass
   ^ EyeDictionaryInspector
 
 On 24 Jun 2014, at 17:49, p...@highoctane.be wrote:
 
 Kind of weird.
 
 Anyone knowing how to deal with that? Bug?
 
 Phil
 
 
 
 




Re: [Pharo-dev] Cloudfork HMAC-SHA256 in System-Hashing

2014-06-24 Thread Sven Van Caekenberghe
Hi Jan,

I loaded just the class CFSHA256 and it worked perfectly (I didn't expect 
anything else).

I tried some examples from Wikipedia 
(http://en.wikipedia.org/wiki/Sha256#Examples_of_SHA-2_variants):

(CFSHA256 hashMessage: 'The quick brown fox jumps over the lazy dog') hex. 
'd7a8fbb307d7809469ca9abcb0082e4f8d5651e46d3cdb762d02d0bf37c9e592'

(CFSHA256 hashMessage: 'The quick brown fox jumps over the lazy dog.') hex. 
'ef537f25c895bfa782526529a9b63d97aa631564d5d789c2b765448c8635fb6c'

So I will rename the class to SHA256, moving it to System-Hashing and add 
SHA256Tests for starters. 

Sven

On 20 Jun 2014, at 17:01, Jan van de Sandt jvdsa...@gmail.com wrote:

 Hello,
 
 I added the SHA256 class to Cloudfork a few years ago. The class was mostly 
 copied from the Cryptography [1] project.
 
 Cheers,
 Jan.
 
 [1] http://www.squeaksource.com/Cryptography/
 
 
 On Fri, Jun 20, 2014 at 10:56 AM, François Stephany 
 tulipe.mouta...@gmail.com wrote:
 Max,
 
 Yes, it's usable as the SHA1 package already there (without HMAC so). I'm no 
 expert in those stuff but I don't get SHA256 base implementation. Someone 
 with more knowledge can probably tell ;)
 
 Sven, 
 
 The bare minimum to load it is:
 
 Gofer it
 smalltalkhubUser: 'JanVanDeSandt' project: 'Cloudfork';
 package: 'Cloudfork-Common';
 package: 'Cloudfork-Pharo-Platform';
 load.
 
 The implementation is in Cloudfork-Pharo-Platform.
 
 
 
 On Thu, Jun 19, 2014 at 6:20 PM, Sven Van Caekenberghe s...@stfx.eu wrote:
 I want to have a look, if you tell me where to look...
 
 On 19 Jun 2014, at 18:03, Max Leske maxle...@gmail.com wrote:
 
 
  On 19.06.2014, at 17:59, François Stephany tulipe.mouta...@gmail.com 
  wrote:
 
  Does it make sense from a license point of view and practical point of 
  view to include the CloudFork HMAC-SHA256 implementation (CFSH256 class) 
  in the System-Hashing package (in  where there's already SHA1 and MD5) ?
 
  Can Cloudfork HMAC-SHA256 be easily parameterized with, say, an SHA256 base 
  implementation? Or does it require extra stuff? In the former case I 
  probably wouldn’t add it. In the latter case it’s open for discussion. 
  Personally, I think it belongs into a separate package, not into 
  System-Hashing.
 
  Cheers,
  Max
 
 
 
 




Re: [Pharo-dev] Cloudfork HMAC-SHA256 in System-Hashing

2014-06-24 Thread Sven Van Caekenberghe
https://pharo.fogbugz.com/f/cases/13395/Add-SHA256-HashFunction

cleaned up, documented, properly packaged.

Passes some test vectors.

I changed the handling of the empty stream.

On 24 Jun 2014, at 23:03, Sven Van Caekenberghe s...@stfx.eu wrote:

 Hi Jan,
 
 I loaded just the class CFSHA256 and it worked perfectly (I didn't expect 
 anything else).
 
 I tried some examples from Wikipedia 
 (http://en.wikipedia.org/wiki/Sha256#Examples_of_SHA-2_variants):
 
 (CFSHA256 hashMessage: 'The quick brown fox jumps over the lazy dog') hex. 
 'd7a8fbb307d7809469ca9abcb0082e4f8d5651e46d3cdb762d02d0bf37c9e592'
 
 (CFSHA256 hashMessage: 'The quick brown fox jumps over the lazy dog.') hex. 
 'ef537f25c895bfa782526529a9b63d97aa631564d5d789c2b765448c8635fb6c'
 
 So I will rename the class to SHA256, moving it to System-Hashing and add 
 SHA256Tests for starters. 
 
 Sven
 
 On 20 Jun 2014, at 17:01, Jan van de Sandt jvdsa...@gmail.com wrote:
 
 Hello,
 
 I added the SHA256 class to Cloudfork a few years ago. The class was mostly 
 copied from the Cryptography [1] project.
 
 Cheers,
 Jan.
 
 [1] http://www.squeaksource.com/Cryptography/
 
 
 On Fri, Jun 20, 2014 at 10:56 AM, François Stephany 
 tulipe.mouta...@gmail.com wrote:
 Max,
 
 Yes, it's usable as the SHA1 package already there (without HMAC so). I'm no 
 expert in those stuff but I don't get SHA256 base implementation. Someone 
 with more knowledge can probably tell ;)
 
 Sven, 
 
 The bare minimum to load it is:
 
 Gofer it
smalltalkhubUser: 'JanVanDeSandt' project: 'Cloudfork';
package: 'Cloudfork-Common';
package: 'Cloudfork-Pharo-Platform';
load.
 
 The implementation is in Cloudfork-Pharo-Platform.
 
 
 
 On Thu, Jun 19, 2014 at 6:20 PM, Sven Van Caekenberghe s...@stfx.eu wrote:
 I want to have a look, if you tell me where to look...
 
 On 19 Jun 2014, at 18:03, Max Leske maxle...@gmail.com wrote:
 
 
 On 19.06.2014, at 17:59, François Stephany tulipe.mouta...@gmail.com 
 wrote:
 
 Does it make sense from a license point of view and practical point of 
 view to include the CloudFork HMAC-SHA256 implementation (CFSH256 class) 
 in the System-Hashing package (in  where there's already SHA1 and MD5) ?
 
 Can Cloudfork HMAC-SHA256 be easily parameterized with, say, an SHA256 base 
 implementation? Or does it require extra stuff? In the former case I 
 probably wouldn’t add it. In the latter case it’s open for discussion. 
 Personally, I think it belongs into a separate package, not into 
 System-Hashing.
 
 Cheers,
 Max
 
 
 
 
 




Re: [Pharo-dev] How to convert properyl an Athens Surface to a Form

2014-06-24 Thread Igor Stasenko
On 21 June 2014 09:23, Hilaire Fernandes hilaire.fernan...@gmail.com
wrote:

 Hello,


 I tried this but it produces empty form.

 |canvas |
 canvas := (Form extent: aDrgeo area athensSurface extent depth: 32)
 getCanvas.
 aDrgeo area athensSurface displayOnMorphicCanvas: canvas at: 0@0.
 canvas form

 should not..
try to #flush operations on surface before blitting it to form.




 Hilaire

 Le 20/06/2014 12:55, Igor Stasenko a écrit :
  the best way is to blit surface on the morphic canvas
  using
  displayOnMorphicCanvas: canvas at: aPoint
  method.
 

 --
 Dr. Geo http://drgeo.eu
 iStoa - https://launchpad.net/istoa





-- 
Best regards,
Igor Stasenko.


Re: [Pharo-dev] Spec Button Shortcut Indication

2014-06-24 Thread Nicolai Hess
2014-06-23 22:53 GMT+02:00 Sven Van Caekenberghe s...@stfx.eu:

 Hi,

 The following looks different in my Dark Theme image vs a Standard image
 (same version #30848):

 ButtonModel new
   label: 'Click Me';
   shortcut: $C asShortcut;
   action: [ self inform: 'OK, you clicked me !' ];
   openWithSpec.

 The difference is the C that is underlined. Is this intentional ?

 Is there a way to have a shortcut, but not the underlining ?

 Thx,

 Sven






I don't see any difference in 30848 and 40038.
Both show underlined char. (even with the dark theme).
It is intentional, and new (this year).
I don't think it is possible to suppress the underlining.


Re: [Pharo-dev] Cloudfork HMAC-SHA256 in System-Hashing

2014-06-24 Thread Norbert Hartl
thank you, Sven. Did you try this in 3.0, too. I would need it there!

Norbert

 Am 25.06.2014 um 00:11 schrieb Sven Van Caekenberghe s...@stfx.eu:
 
 https://pharo.fogbugz.com/f/cases/13395/Add-SHA256-HashFunction
 
 cleaned up, documented, properly packaged.
 
 Passes some test vectors.
 
 I changed the handling of the empty stream.
 
 On 24 Jun 2014, at 23:03, Sven Van Caekenberghe s...@stfx.eu wrote:
 
 Hi Jan,
 
 I loaded just the class CFSHA256 and it worked perfectly (I didn't expect 
 anything else).
 
 I tried some examples from Wikipedia 
 (http://en.wikipedia.org/wiki/Sha256#Examples_of_SHA-2_variants):
 
 (CFSHA256 hashMessage: 'The quick brown fox jumps over the lazy dog') hex. 
 'd7a8fbb307d7809469ca9abcb0082e4f8d5651e46d3cdb762d02d0bf37c9e592'
 
 (CFSHA256 hashMessage: 'The quick brown fox jumps over the lazy dog.') hex. 
 'ef537f25c895bfa782526529a9b63d97aa631564d5d789c2b765448c8635fb6c'
 
 So I will rename the class to SHA256, moving it to System-Hashing and add 
 SHA256Tests for starters. 
 
 Sven
 
 On 20 Jun 2014, at 17:01, Jan van de Sandt jvdsa...@gmail.com wrote:
 
 Hello,
 
 I added the SHA256 class to Cloudfork a few years ago. The class was mostly 
 copied from the Cryptography [1] project.
 
 Cheers,
 Jan.
 
 [1] http://www.squeaksource.com/Cryptography/
 
 
 On Fri, Jun 20, 2014 at 10:56 AM, François Stephany 
 tulipe.mouta...@gmail.com wrote:
 Max,
 
 Yes, it's usable as the SHA1 package already there (without HMAC so). I'm 
 no expert in those stuff but I don't get SHA256 base implementation. 
 Someone with more knowledge can probably tell ;)
 
 Sven, 
 
 The bare minimum to load it is:
 
 Gofer it
   smalltalkhubUser: 'JanVanDeSandt' project: 'Cloudfork';
   package: 'Cloudfork-Common';
   package: 'Cloudfork-Pharo-Platform';
   load.
 
 The implementation is in Cloudfork-Pharo-Platform.
 
 
 
 On Thu, Jun 19, 2014 at 6:20 PM, Sven Van Caekenberghe s...@stfx.eu wrote:
 I want to have a look, if you tell me where to look...
 
 On 19 Jun 2014, at 18:03, Max Leske maxle...@gmail.com wrote:
 
 
 On 19.06.2014, at 17:59, François Stephany tulipe.mouta...@gmail.com 
 wrote:
 
 Does it make sense from a license point of view and practical point of 
 view to include the CloudFork HMAC-SHA256 implementation (CFSH256 class) 
 in the System-Hashing package (in  where there's already SHA1 and MD5) ?
 
 Can Cloudfork HMAC-SHA256 be easily parameterized with, say, an SHA256 
 base implementation? Or does it require extra stuff? In the former case I 
 probably wouldn’t add it. In the latter case it’s open for discussion. 
 Personally, I think it belongs into a separate package, not into 
 System-Hashing.
 
 Cheers,
 Max
 
 



Re: [Pharo-dev] How to convert properyl an Athens Surface to a Form

2014-06-24 Thread Nicolai Hess
2014-06-25 0:21 GMT+02:00 Igor Stasenko siguc...@gmail.com:




 On 21 June 2014 09:23, Hilaire Fernandes hilaire.fernan...@gmail.com
 wrote:

 Hello,


 I tried this but it produces empty form.

 |canvas |
 canvas := (Form extent: aDrgeo area athensSurface extent depth: 32)
 getCanvas.
 aDrgeo area athensSurface displayOnMorphicCanvas: canvas at: 0@0.
 canvas form

 should not..
 try to #flush operations on surface before blitting it to form.




 Hilaire

 Le 20/06/2014 12:55, Igor Stasenko a écrit :
  the best way is to blit surface on the morphic canvas
  using
  displayOnMorphicCanvas: canvas at: aPoint
  method.
 

 --
 Dr. Geo http://drgeo.eu
 iStoa - https://launchpad.net/istoa





 --
 Best regards,
 Igor Stasenko.




This works for me:

| sur form |
sur := AthensCairoSurface extent: 300 @ 300.
sur
drawDuring: [ :can |
can pathTransform
restoreAfter: [
can surface clear: Color black.
can pathTransform translateX: 150 Y: 150.
can setPaint: (Color green alpha: 0.1).
can setShape: (-150 @ -150 corner: 150 @ 150).
20
timesRepeat: [
can draw.
can pathTransform scaleBy: 0.85.
can pathTransform rotateByDegrees: 10.
 ] ] ].

form := Form extent: sur extent depth: 32.

sur displayOnMorphicCanvas: form getCanvas at: 0 @ 0.
(ImageMorph withForm: form) openInHand


Re: [Pharo-dev] Stepping through with GLORP Proxies

2014-06-24 Thread Eliot Miranda
On Mon, Jun 23, 2014 at 11:45 AM, Esteban A. Maringolo emaring...@gmail.com
 wrote:

 Eliot,

 I never installed your proposed changes in a Pharo 3 image because
 there is a significant change in ContextPart. Your proposed changeset
 changes classVars of ContextPart.

 Your proposal:
 classVariableNames: 'MaxLengthForASingleDebugLogReport
 MaxStackDepthForASingleDebugLogReport PrimitiveFailToken QuickStep
 ValueIndex'

 Current vars:
 classVariableNames: 'PrimitiveFailToken QuickStep
 SpecialPrimitiveSimulators TryNamedPrimitiveTemplateMethod'


Obviously my change set was for Squeak, and the def above is for Pharo.  So
the two definitions need to be merged.  Did you try the union of the class
variable names?



 Would you mind adapting your mirror methods changes to work also in
 Pharo 3 (and maybe in Pharo 4 too?).

 Esteban A. Maringolo


 2014-02-26 14:40 GMT-03:00 Eliot Miranda eliot.mira...@gmail.com:
  Hi Esteban,
 
  find attached.  Let me know of any problems.
 
 
  On Wed, Feb 26, 2014 at 8:32 AM, Esteban A. Maringolo 
 emaring...@gmail.com
  wrote:
 
  Hi Eliot,
 
 
  2013-11-30 18:30 GMT-03:00 Eliot Miranda eliot.mira...@gmail.com:
   On Fri, Nov 29, 2013 at 2:22 PM, Esteban A. Maringolo
   emaring...@gmail.com
   wrote:
   2013/11/29 Eliot Miranda eliot.mira...@gmail.com:
 
I'll either prepare a change set or submit.  It'll get done.
 
   I can continue stepping into until the change is ready.
 
   Please make it compatible with Pharo 2 (whatever that means in term
 of
   code) :)
  
  
   OK, the code is now in Squeak trunk.  What image should I use to
   integrate
   into Pharo 2?  A url please...
 
  I'm coming back late to this. Because the change wasn't integrated in
  Pharo 2.
 
  Do you have the changeset applied to Squeak Trunk? I'd like to reapply
  it in my Pharo 2 image (at my own risk).
  Can you send it to may email address?
 
  Thank you!
 
  Esteban A. Maringolo
 
 
 
 
  --
  best,
  Eliot




-- 
best,
Eliot