Re: [Pharo-users] Thinking aloud about project at hand

2020-04-11 Thread Tomaž Turk
Many thanks guys, you all gave me quite interesting suggestions. I'll 
explore most of them regarding the stability and "compactness" of the 
final solution as regards the deployment.


I have one really silly question - when you create an app (with Spec2), 
how can you made it start automatically when the image starts, and avoid 
displaying the World? I browsed through many of Pharo books and 
documentation recently and cannot remember if this is mentioned 
anywhere.


Best wishes,
Tomaz

Re: [Pharo-users] Thinking aloud about project at hand

2020-04-11 Thread Hilaire
Take a look at the DrGeo example app, it shows how to do that  (link 
bellow).


Hilaire

Le 11/04/2020 à 12:43, Tomaž Turk a écrit :
I have one really silly question - when you create an app (with 
Spec2), how can you made it start automatically when the image starts, 
and avoid displaying the World? I browsed through many of Pharo books 
and documentation recently and cannot remember if this is mentioned 
anywhere.



--
Dr. Geo
http://drgeo.eu





[Pharo-users] Pharo 8: What is the VM doing when I am doing nothing?

2020-04-11 Thread PBKResearch
Hello. I have noticed a curiosity when I am running Pharo 8 on Windows 10. I
am in the habit of leaving the Task Manager open when I am working, and it
seems that Pharo 8 is using the CPU when I am doing nothing. When the image
- which is exactly as first loaded, with only the welcome window visible -
is loaded, CPU consumption is zero. I open a playground, get a list of
recent files from the playground cache, open one of the files but do nothing
with it; the CPU activity is constantly changing within the range 2.5% -
3.5%. After 5 mins of no Pharo activity by me, the CPU is still in the same
range.

 

I reloaded an earlier image, which is Moose Suite 6.1 (Pharo 6) and opened a
playground in the same way. After a few seconds, the CPU usage dropped to
zero. This activity is a feature of the newest versions only. 

 

It's obviously not a major problem, but I would like to know, if just out of
curiosity.

 

Thanks for any help.

 

Peter Kenny

 

My Pharo 8 details:

Build information:
Pharo-8.0.0+build.1124.sha.0932da82f08175e906b0e2a8052120c823374e9f (32 Bit)

Installed from Pharo Launcher on 8 Apr 2020

VM details:

CoInterpreter * VMMaker-CompatibleUserName.1577968628 uuid:
d729bf66-2ea7-5a6d-b1eb-fc005785636d Jan  3 2020

StackToRegisterMappingCogit * VMMaker-CompatibleUserName.1577968628 uuid:
d729bf66-2ea7-5a6d-b1eb-fc005785636d Jan  3 2020

VM: 201911290039-dev-7
admin@MacBook-Pro-de-admin.local:dev/Pharo/git-repos/pharo-vm/repo Date: Thu
Nov 28 21:39:57 2019 CommitHash: 9b6bd16d3 Plugins: 201911290039-dev-7
admin@MacBook-Pro-de-admin.local:dev/Pharo/git-repos/pharo-vm/repo
 

 

 



Re: [Pharo-users] Pharo 8: What is the VM doing when I am doing nothing?

2020-04-11 Thread Tim Mackinnon
Hi Peter - I had understood that this always a problem as Morphic is always 
polling for events (so am surprised you found an image where it’s not 
happening). I believe that recent work has almost got to a point where this can 
be resolved - there were some recent status reports on this, and maybe it might 
get into pharo9?

I’m sure someone has a much better explanation for you - and an explanation of 
what’s involved to fix it (I guess you have to block the event loop somehow so 
it waits vs polls).

Tim

On Sat, 11 Apr 2020, at 12:27 PM, PBKResearch wrote:
> Hello. I have noticed a curiosity when I am running Pharo 8 on Windows 10. I 
> am in the habit of leaving the Task Manager open when I am working, and it 
> seems that Pharo 8 is using the CPU when I am doing nothing. When the image – 
> which is exactly as first loaded, with only the welcome window visible – is 
> loaded, CPU consumption is zero. I open a playground, get a list of recent 
> files from the playground cache, open one of the files but do nothing with 
> it; the CPU activity is constantly changing within the range 2.5% - 3.5%. 
> After 5 mins of no Pharo activity by me, the CPU is still in the same range.

> 

> I reloaded an earlier image, which is Moose Suite 6.1 (Pharo 6) and opened a 
> playground in the same way. After a few seconds, the CPU usage dropped to 
> zero. This activity is a feature of the newest versions only.

> 

> It’s obviously not a major problem, but I would like to know, if just out of 
> curiosity.

> 

> Thanks for any help.

> 

> Peter Kenny

> 

> My Pharo 8 details:

> Build information: 
> Pharo-8.0.0+build.1124.sha.0932da82f08175e906b0e2a8052120c823374e9f (32 Bit)

> Installed from Pharo Launcher on 8 Apr 2020

> VM details:

> CoInterpreter * VMMaker-CompatibleUserName.1577968628 uuid: 
> d729bf66-2ea7-5a6d-b1eb-fc005785636d Jan 3 2020

> StackToRegisterMappingCogit * VMMaker-CompatibleUserName.1577968628 uuid: 
> d729bf66-2ea7-5a6d-b1eb-fc005785636d Jan 3 2020

> VM: 201911290039-dev-7 
> admin@MacBook-Pro-de-admin.local:dev/Pharo/git-repos/pharo-vm/repo Date: Thu 
> Nov 28 21:39:57 2019 CommitHash: 9b6bd16d3 Plugins: 201911290039-dev-7 
> admin@MacBook-Pro-de-admin.local:dev/Pharo/git-repos/pharo-vm/repo

> 

> 



[Pharo-users] Using the compiler for scripts / logging statistics (learning)

2020-04-11 Thread Cédrick Béler
Hi, 

I’m playing with compiler with scripts. For instance:

result := OpalCompiler new
source: ‘3 + 1';
evaluate.

result2 := OpalCompiler new
source: 'self + 1';
receiver: 3;
evaluate.

I would eventually (as an exercice) try to log the time before and after the 
execution of the script.

Its possible to send #logged: true; to the compiler which basically is able to 
log doIt through SystemPresenter.

logDoIt
self compilationContext logged ifFalse: [ ^self ].
Smalltalk globals 
at: #SystemAnnouncer 
ifPresent: [ :sysAnn | 
sysAnn uniqueInstance evaluated: source 
contents context: context ].

Right now, it seems the logging mechanism is launched once the evaluation is 
done. 

So my question is would it be possible to log start and ent time execution 
through the compiler.


OpalCompiler>>evaluate
"Compiles the sourceStream into a parse tree, then generates code into
 a method. If aContext is not nil, the text can refer to temporaries in 
that
 context (the Debugger uses this). If aRequestor is not nil, then it 
will receive
 a notify:at: message before the attempt to evaluate is aborted. 
Finally, the 
 compiled method is invoked from here via withArgs:executeMethod:, hence
 the system no longer creates Doit method litter on errors."

| value |
self noPattern: true.
self getSourceFromRequestorSelection.
self class: (context ifNil: [ receiver class ] ifNotNil: [ context 
method methodClass ]).
=> here a kind of sell startLog.
"code execution" 
value := receiver withArgs: (context ifNil: [ #() ] ifNotNil: [ 
{context} ]) executeMethod: self compile.
"actual log call…. Only for doIt ?"
self logDoIt.
^ value

I wonder what would be the way of doing it ? Is it only for doIts ? 

Start/endLog could be calling log options #(logDoIt, logWhatever, …) ? Maybe 
doing ScriptEvaluated to differ from ExpressionEvaluated would be the solution ?
I imagine this has impact on performance too...  

My toy objective is to log statistic of scripts usage. Again this is just 
experiments, so happy to hear and learn from others. How would people do ?

Cheers, 
Cédrick





Re: [Pharo-users] Pharo 8: What is the VM doing when I am doing nothing?

2020-04-11 Thread PBKResearch
I think some of the mystery is due to my not exploring enough. As I said, I 
have two windows open when I am doing the test: the Pharo 8 welcome window and 
a playground which is opened on a cache file.  I have now found that what 
happens depends on which is on top. If the welcome window is on top, the CPU 
usage is zero; if the playground is on top, CPU usage is about 3%, and stays at 
that even though I provide no input. The implication is that, when a playground 
is the active window, it is constantly doing something, presumably polling to 
see if the user is providing input. This did not seem to happen with a similar 
test on Pharo 6; even though a playground was on top, the CPU usage dropped to 
zero when I became inactive.

 

As I said, it’s not a problem, just a puzzle – but I would still like to know 
why.

 

Peter Kenny

 

From: Pharo-users  On Behalf Of Tim 
Mackinnon
Sent: 11 April 2020 12:42
To: Any question about pharo is welcome 
Subject: Re: [Pharo-users] Pharo 8: What is the VM doing when I am doing 
nothing?

 

Hi Peter - I had understood that this always a problem as Morphic is always 
polling for events (so am surprised you found an image where it’s not 
happening). I believe that recent work has almost got to a point where this can 
be resolved - there were some recent status reports on this, and maybe it might 
get into pharo9?

 

I’m sure someone has a much better explanation for you - and an explanation of 
what’s involved to fix it (I guess you have to block the event loop somehow so 
it waits vs polls).

 

Tim

 

On Sat, 11 Apr 2020, at 12:27 PM, PBKResearch wrote:

Hello. I have noticed a curiosity when I am running Pharo 8 on Windows 10. I am 
in the habit of leaving the Task Manager open when I am working, and it seems 
that Pharo 8 is using the CPU when I am doing nothing. When the image – which 
is exactly as first loaded, with only the welcome window visible – is loaded, 
CPU consumption is zero. I open a playground, get a list of recent files from 
the playground cache, open one of the files but do nothing with it; the CPU 
activity is constantly changing within the range 2.5% - 3.5%. After 5 mins of 
no Pharo activity by me, the CPU is still in the same range.

 

I reloaded an earlier image, which is Moose Suite 6.1 (Pharo 6) and opened a 
playground in the same way. After a few seconds, the CPU usage dropped to zero. 
This activity is a feature of the newest versions only.

 

It’s obviously not a major problem, but I would like to know, if just out of 
curiosity.

 

Thanks for any help.

 

Peter Kenny

 

My Pharo 8 details:

Build information: 
Pharo-8.0.0+build.1124.sha.0932da82f08175e906b0e2a8052120c823374e9f (32 Bit)

Installed from Pharo Launcher on 8 Apr 2020

VM details:

CoInterpreter * VMMaker-CompatibleUserName.1577968628 uuid: 
d729bf66-2ea7-5a6d-b1eb-fc005785636d Jan  3 2020

StackToRegisterMappingCogit * VMMaker-CompatibleUserName.1577968628 uuid: 
d729bf66-2ea7-5a6d-b1eb-fc005785636d Jan  3 2020

VM: 201911290039-dev-7 
admin@MacBook-Pro-de-admin.local:dev/Pharo/git-repos/pharo-vm/repo 
  
Date: Thu Nov 28 21:39:57 2019 CommitHash: 9b6bd16d3 Plugins: 
201911290039-dev-7  
 
admin@MacBook-Pro-de-admin.local:dev/Pharo/git-repos/pharo-vm/repo

 

 

 



Re: [Pharo-users] Problem downloading images

2020-04-11 Thread Vitor Medina Cruz
OK, it downloaded perfectly on my cell phone with the same ISP connected. I
did some testing, and the server is fine, now why my windows installation
is failing to access this server is beyond me. I will try to figure out,
but, anyways, it is not a problem with pharo server.

On Fri, Apr 10, 2020 at 10:43 PM Vitor Medina Cruz 
wrote:

> That's odd, everything is working perfectly fine, except from downloading
> Pharo. Here is the result of tracert (in portuguese, sorry, but the format
> is well know, so...)
>
>
> [image: image.png]
>
>
> C:\Users\Vitor>tracert files.pharo.org
>>
>> Rastreando a rota para files.pharo.org [164.132.235.17]
>> com no máximo 30 saltos:
>>
>>   1<1 ms<1 ms<1 ms  192.168.0.1
>>   2 1 ms 1 ms 1 ms  100.64.0.1
>>   3 1 ms 2 ms 2 ms  192.168.22.32
>>   4 2 ms 1 ms 2 ms  fttx-177126217.usr.predialnet.com.br
>> [177.12.62.17]
>>   5 2 ms 1 ms 2 ms  5.178.44.8
>>   6   105 ms   279 ms   204 ms  et9-3-0.miami15.mia.seabone.net
>> [195.22.199.179]
>>   7 **  185 ms  be100-155.mia-mi1-bb1-a9.fl.us
>> [178.32.135.208]
>>   8 **  200 ms  ash-1-a9.fl.us [142.44.208.189]
>>   9 *  191 ms * be100-1039.nwk-1-a9.nj.us [198.27.73.202]
>>  10   278 ms *  278 ms  be100-1295.ldn-1-a9.uk.eu
>> [192.99.146.126]
>>  11   273 ms *  273 ms  be103.gra-g1-nc5.fr.eu [91.121.215.178]
>>  12 *** Esgotado o tempo limite do pedido.
>>  13 *** Esgotado o tempo limite do pedido.
>>  14 *** Esgotado o tempo limite do pedido.
>>  15   273 ms *  269 ms  cluster023.hosting.ovh.net
>> [164.132.235.17]
>>
>> Rastreamento concluído.
>>
>
> tracert for pharo.org is fine, the problem is at files.pharo.org. You can
> see I am at Brazil, so the >200 overseas is normal, the problem seems when
> reaching cluster023.hosting.ovh.net.
>
>
> On Fri, Apr 10, 2020 at 9:48 PM tbrunz  wrote:
>
>> Probably your ISP.  I was able to download this morning (in Los Angeles),
>> and
>> just downloaded a new image now, late afternoon.  Everything running
>> quick &
>> smooth...
>>
>>
>>
>> --
>> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>>
>>