Re: [Pharo-users] mentor wanted

2020-04-24 Thread Hilaire

Hi Roelof,

I remember about a Smalltalk book presenting the CRC concept precisely 
used to cut complex problem in small chunks.


I can't find the reference right now but it is very likely among those 
books available online (http://stephane.ducasse.free.fr/FreeBooks.html). 
May be a member of the list remember about it.


Hilaire

Le 23/04/2020 à 12:31, Roelof Wobben via Pharo-users a écrit :

With complex problems I do not see how to solve things in small steps.


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





Re: [Pharo-users] mentor wanted

2020-04-24 Thread Hilaire

Find it.

It is a chapter of the book Squeak, Open Personal Computing and 
Multimedia 


http://sdmeta.gforge.inria.fr/FreeBooks/GuzdialBookDrafts/DesignObjects-ch4.pdf

Le 24/04/2020 à 09:39, Hilaire a écrit :
I remember about a Smalltalk book presenting the CRC concept precisely 
used to cut complex problem in small chunks.


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





[Pharo-users] Don't tell I sent that ;)

2020-04-24 Thread Cédrick Béler
Found the link. As I guess not legal, I send private.

I’ve the book. I liked it if I remember ;)

https://doc.lagout.org/programmation/Smalltalk/Smalltalk%20-%20Objects%20and%20Design.pdf

Cheers,
Cédrick


Re: [Pharo-users] Don't tell I sent that ;)

2020-04-24 Thread Cédrick Béler
And of course the email was intended to be private :s

Sorry for that.
Cédrick

> Le 24 avr. 2020 à 09:56, Cédrick Béler  a écrit :
> 
> Found the link. As I guess not legal, I send private.
> 
> I’ve the book. I liked it if I remember ;)
> 
> https://doc.lagout.org/programmation/Smalltalk/Smalltalk%20-%20Objects%20and%20Design.pdf
> 
> Cheers,
> Cédrick




Re: [Pharo-users] mentor wanted

2020-04-24 Thread Roelof Wobben via Pharo-users
--- Begin Message ---

Op 24-4-2020 om 09:49 schreef Hilaire:

Find it.

It is a chapter of the book Squeak, Open Personal Computing and 
Multimedia 


http://sdmeta.gforge.inria.fr/FreeBooks/GuzdialBookDrafts/DesignObjects-ch4.pdf 



Le 24/04/2020 à 09:39, Hilaire a écrit :
I remember about a Smalltalk book presenting the CRC concept 
precisely used to cut complex problem in small chunks.




Hilaire and Cedric thanks, I will also study those.



--- End Message ---


Re: [Pharo-users] Non-blocking IO

2020-04-24 Thread dturczanski
Thanks for pointing out the difference between non-blocking and async IO. I
think in Java NIO there is a thread that constantly calls the [e]poll() in
the background and this way the IO becomes non-blocking.




--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html



Re: [Pharo-users] Non-blocking IO

2020-04-24 Thread Daniel Turczański
Thanks. Are there any benchmarks available for Pharo HTTP servers? Is it
possible to achieve a performance similar to node.js? I know the biggest
selling point of Smalltalk is not perf but still I'm curious. 

The Concurrency book [1] says that Pharo's Process is like a fibre and is
lightweight. How big is the stack? Java Quasar's fibers are very lightweight
with a 400 byte stacks [2]. Can you have hundreds or thousands of processes
running blocking IO without much memory and performance penalty?

[1] http://books.pharo.org/booklet-ConcurrentProgramming/
[2]
https://docs.paralleluniverse.co/quasar/javadoc/co/paralleluniverse/fibers/Fiber.html



--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html



Re: [Pharo-users] Non-blocking IO

2020-04-24 Thread Sven Van Caekenberghe
Daniel,

> On 24 Apr 2020, at 12:35, Daniel Turczański  wrote:
> 
> Thanks. Are there any benchmarks available for Pharo HTTP servers? Is it
> possible to achieve a performance similar to node.js? I know the biggest
> selling point of Smalltalk is not perf but still I'm curious. 

Benchmarking is a black art with many pitfalls.

Let's say that Pharo HTTP performance is acceptable.

Here is a test that I just ran (on a LXC/LXD container on a big production 
server).

t3@t3-pharo-test:~/tmp/pharo9$ cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.4 LTS"

t3@t3-pharo-test:~/tmp/pharo9$ curl get.pharo.org/64/90+vm | bash
  % Total% Received % Xferd  Average Speed   TimeTime Time  Current
 Dload  Upload   Total   SpentLeft  Speed
100  3054  100  30540 0   198k  0 --:--:-- --:--:-- --:--:--  198k
Downloading the latest 90 Image:
http://files.pharo.org/get-files/90/pharo64.zip
Pharo.image
Downloading the latest pharoVM:
http://files.pharo.org/get-files/90/pharo64-linux-stable.zip
pharo-vm/pharo
Creating starter scripts pharo and pharo-ui

t3@t3-pharo-test:~/tmp/pharo9$ ./pharo Pharo.image printVersion
[version] 'Pharo9.0.0' 
'Pharo-9.0.0+build.252.sha.fe2815c89f309789cbfba9a1ce821fb959dfe987 (64 Bit)'

t3@t3-pharo-test:~/tmp/pharo9$ ./pharo Pharo.image eval --no-quit 'ZnServer 
startDefaultOn: 1701' &
[1] 32203
a ZnManagingMultiThreadedServer(running 1701)

t3@t3-pharo-test:~/tmp/pharo9$ curl http://localhost:1701/random
0BFE44ECF0BEEDDD949A8D5A363E5E6192A4B7CD4939E8BD7A7C7EC69995157

t3@t3-pharo-test:~/tmp/pharo9$ ab -k -n 1024 -c 8 http://localhost:1701/random
This is ApacheBench, Version 2.3 <$Revision: 1807734 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking localhost (be patient)
Completed 102 requests
Completed 204 requests
Completed 306 requests
Completed 408 requests
Completed 510 requests
Completed 612 requests
Completed 714 requests
Completed 816 requests
Completed 918 requests
Completed 1020 requests
Finished 1024 requests


Server Software:Zinc
Server Hostname:localhost
Server Port:1701

Document Path:  /random
Document Length:64 bytes

Concurrency Level:  8
Time taken for tests:   0.246 seconds
Complete requests:  1024
Failed requests:0
Keep-Alive requests:1024
Total transferred:  256000 bytes
HTML transferred:   65536 bytes
Requests per second:4155.22 [#/sec] (mean)
Time per request:   1.925 [ms] (mean)
Time per request:   0.241 [ms] (mean, across all concurrent requests)
Transfer rate:  1014.46 [Kbytes/sec] received


This is a small, do nothing request, tested locally, and so on.

I would say it is safe to say you can handle 100s to 1000s of requests per 
second on a single Pharo instance (which is using only a single core).

The good thing about HTTP is that you can normally scale horizontally by adding 
more and more worker instances under a load balancer -- these are standard 
techniques.

HTH,

Sven

> The Concurrency book [1] says that Pharo's Process is like a fibre and is
> lightweight. How big is the stack? Java Quasar's fibers are very lightweight
> with a 400 byte stacks [2]. Can you have hundreds or thousands of processes
> running blocking IO without much memory and performance penalty?
> 
> [1] http://books.pharo.org/booklet-ConcurrentProgramming/
> [2]
> https://docs.paralleluniverse.co/quasar/javadoc/co/paralleluniverse/fibers/Fiber.html
> 
> 
> 
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
> 




Re: [Pharo-users] Don't tell I sent that ;)

2020-04-24 Thread Bernardo Ezequiel Contreras
see
http://stephane.ducasse.free.fr/FreeBooks.html
that's a good link.


On Fri, Apr 24, 2020 at 4:57 AM Cédrick Béler  wrote:

> Found the link. As I guess not legal, I send private.
>
> I’ve the book. I liked it if I remember ;)
>
>
> https://doc.lagout.org/programmation/Smalltalk/Smalltalk%20-%20Objects%20and%20Design.pdf
>
> Cheers,
> Cédrick
>


-- 
Bernardo E.C.

Sent from a cheap desktop computer in South America.


Re: [Pharo-users] All file accesses get externalCalledFailed exceptions.

2020-04-24 Thread Michael Burns via Pharo-users
--- Begin Message ---
Thanks Tim!

Problem solved. 

I did as you suggest and added Pharo.app (and Squeak*.app) to the "Files and 
Folders” and tried again.
That resolved the primary issue but when opening File Browser I got a different 
exception referring to /.VolumeIcon.icns not being able to be opened.
The volume was my boot partition and in Catalina that is a readonly filesystem.
I looked at that file with ls and file commands, and it turns out that it was a 
broken link to the same file in the contained Data volume.
The destination does not exist:  
[graphe:/Volumes/Graphe6] Michael% file .VolumeIcon.icns
.VolumeIcon.icns: broken symbolic link to System/Volumes/Data/.VolumeIcon.icns

So, I created an empty file there:

[graphe:/Volumes/Graphe6] Michael% sudo touch .VolumeIcon.icns

And rechecked the link:

[graphe:/Volumes/Graphe6] Michael% file .VolumeIcon.icns
.VolumeIcon.icns: empty


File Browser now opens and lets me navigate around.  

All is well. 


> On Apr 22, 2020, at 5:40 AM, Tim Mackinnon  wrote:
> 
> H Michael- that seems strange, I just tried the following on a Pharo8 with 
> Catalina: 
> 
> OSPlatform current currentWorkingDirectoryPath.
> 
> > /Users/macta/Dev/Smalltalk/Pharo/Pharo 8.0 - 64bit
> 
> I’m using PharoLauncher, although my images are not stored in Documents, but 
> ~/Dev/Smalltalk/Pharo (I adjusted the launcher settings). Not sure if that 
> makes a difference? Or - perhaps you didn’t allow Pharo disk read privileges 
> (that is a new security check in Catalina - see the OSX System Preferences, 
> Security and Privacy, Files and Folders. Mine has a pharo entry with access 
> to Downloads, Documents and Desktop).
> 
> Tim
> 
>> On 22 Apr 2020, at 10:25, Michael Burns via Pharo-users 
>> mailto:pharo-users@lists.pharo.org>> wrote:
>> 
>> 
>> From: Michael Burns mailto:michaelbu...@mac.com>>
>> Subject: All file accesses get externalCalledFailed exceptions.
>> Date: 22 April 2020 at 10:25:56 BST
>> To: Pharo users > >
>> 
>> 
>> Newbie to Pharo
>> Just installed the latest 8.0 stable image.
>> Some things work, but anything I do to access any files gets an exception 
>> dealing with getcwd in libc.dylib.
>> 
>> I am running MacOS Catalina.
>> I searched and found the lib.dylib file and it is an alias to another .dylib 
>> file. 
>> 
>> Is there something else I need to install or configure?
>> 
>> 
>> Sent from my iPad
>> 
> 

--- End Message ---


Re: [Pharo-users] mentor wanted

2020-04-24 Thread Richard O'Keefe
Roelof, I don't think CRC cards or the GRASP patterns or anything like that
addresses your immediate needs.  Based on other questions of yours it
seems to me that your problem is not *organising* the responsibilities in an
OO program, but decomposing a problem into responsibilities in the first
place.  I think this is perhaps the most important part of programming, and
the hardest to learn, not least because very few of us are good at teaching
it.  We're not very good at teaching it in mathematics either.  I do not think
your issues are anything to do with Pharo, Smalltalk, OOP, or programming
as such.

One symptom of the general problem that I've noticed is that I see code as
a very fluid sort of thing where pieces can be moved around and recombined,
while many people think of code as something solid and rather brittle.

I was thinking of writing up a short description of what I was thinking for a
RosettaCode example anyway.  Would that help?



On Thu, 23 Apr 2020 at 23:16, Roelof Wobben via Pharo-users
 wrote:
>
> Hello,
>
> I like Pharo a lot but I hit a wall very often.
> With complex problems I do not see how to solve things in small steps.
>
> Is there somewhere who is willing to mentor me in how I can overcome
> that problem.
>
> Roelof
>
>



Re: [Pharo-users] mentor wanted

2020-04-24 Thread Richard Sargent
On Fri, Apr 24, 2020, 22:25 Richard O'Keefe  wrote:

> Roelof, I don't think CRC cards or the GRASP patterns or anything like that
> addresses your immediate needs.  Based on other questions of yours it
> seems to me that your problem is not *organising* the responsibilities in
> an
> OO program, but decomposing a problem into responsibilities in the first
> place.  I think this is perhaps the most important part of programming, and
> the hardest to learn, not least because very few of us are good at teaching
> it.  We're not very good at teaching it in mathematics either.  I do not
> think
> your issues are anything to do with Pharo, Smalltalk, OOP, or programming
> as such.
>
> One symptom of the general problem that I've noticed is that I see code as
> a very fluid sort of thing where pieces can be moved around and recombined,
> while many people think of code as something solid and rather brittle.
>
> I was thinking of writing up a short description of what I was thinking
> for a
> RosettaCode example anyway.  Would that help?
>

Thank you, Richard. I appreciate your offering this. I am not a teacher, so
your help is truly appreciated!



>
>
> On Thu, 23 Apr 2020 at 23:16, Roelof Wobben via Pharo-users
>  wrote:
> >
> > Hello,
> >
> > I like Pharo a lot but I hit a wall very often.
> > With complex problems I do not see how to solve things in small steps.
> >
> > Is there somewhere who is willing to mentor me in how I can overcome
> > that problem.
> >
> > Roelof
> >
> >
>
>