Re: [Pharo-users] (no subject)

2017-09-19 Thread Ben Coman
On Wed, Sep 20, 2017 at 1:12 PM, Ben Coman  wrote:

> On Thu, Sep 14, 2017 at 8:25 PM, Christophe Demarey <
> christophe.dema...@inria.fr> wrote:
> > Hi,
> >
> > I published an update of the Launcher yesterday fixing some issues to run
> > Pharo images from Linux. You can find latest-versions (0.2.13) here:
> > http://files.pharo.org/platform/launcher/
> > It already propose to download Pharo 70 images. The VM is now downloaded
> > automatically if the adequate one is not available.
> > Let us know if everything is fine.
>
> Thanks Christophe for updating PharoLauncher.  I'm trying it with Pharo 7
> images for the first time.
> I hit a problem using Iceberg in downloaded images.
>
> $ unzip Pharo-linux-0.2.13.zip
> $ cd pharo
> $ unzip ../PharoLauncher-user-stable-2017.09.14.zip
> $ ./pharo
> + PharoLauncher > Settings > Enable development environment
> + World > Tools > Iceberg
> ==>  iceberg opens okay
> + PharoLauncher > Templates > Pharo 7.0(beta) > latest-32 
> '7latest32'
> + '7latest32' 
> + World > Tools > Iceberg
> ==>  "Error: EXternal module not found"
>
> $ uname -a
> ==> Linux 3.16.0-4-686-pae #1 SMP Debian 3.16.7-ckt25-2 (2016-04-08) i686
> GNU/Linux
>
>
but this works okay...
$ curl get.pharo.org/70+vm | bash
$ ./pharo-ui
+ World > Tools > Iceberg
==>  iceberg opens okay


while this PharoLauncher alternative fails...
$  curl get.pharo.org | bash
$ ./pharo-ui
+ World > Tools > Catalog > PharoLauncher 
+ World > PharoLauncher
==> Doesn't show Pharo 7 templates
+ World > Monticello > ...PharoLauncher/main 
+ ConfigurationOfPharoLauncher-ChristopheDemarey.56 
+ World > Playground > "ConfigurationOfPharoLauncher load" 
+ World > PharoLauncher > Settings > Hard reset persistant state
==> Pharo 7 templates showing
+ '7latest32'   "i.e. the previously downloaded image"
+ World > Tools > Iceberg
==>  "Error: External module not found"

+ World > Monticello... load latest mczs...
* PharoLauncher-Core-ChristopheDemarey.123
* PharoLauncher-Spec-ChristopheDemarey.51
+ '7latest32'   "i.e. the previously downloaded image"
==> "Fetching VM to run Pharo 70 images"
+ World > Tools > Iceberg
==>  "Error: External module not found"


Version comparison...

direct get.pharo.org/70+vm
  /home/ben/Pharo/adhoc/Pharo7/Pharo.image
Pharo7.0alpha.build.132.sha.4ea2f39a9f43185d31b844be5ad33b677f43bf17
  /home/ben/Pharo/adhoc/Pharo7/pharo-vm/lib/pharo/5.0-201708271955/pharo
CoInterpreter VMMaker.oscog-eem.2265 uuid:
76b62109-629a-4c39-9641-67b53321df9a Aug 27 2017

via PharoLauncher...
  /home/ben/Pharo/images/7latest32/7latest32.image
Pharo7.0alpha.build.132.sha.4ea2f39a9f43185d31b844be5ad33b677f43bf17
  /home/ben/Pharo/vms/70-x86/lib/pharo/5.0-201708271955/pharo
CoInterpreter VMMaker.oscog-eem.2265 uuid:
76b62109-629a-4c39-9641-67b53321df9a Aug 27 2017

Must be something environmental in lookup paths.  Can you reproduce or
suggest further investigation I can do?

cheers -ben


Re: [Pharo-users] (no subject)

2017-09-19 Thread Ben Coman
On Thu, Sep 14, 2017 at 8:25 PM, Christophe Demarey <
christophe.dema...@inria.fr> wrote:
> Hi,
>
> I published an update of the Launcher yesterday fixing some issues to run
> Pharo images from Linux. You can find latest-versions (0.2.13) here:
> http://files.pharo.org/platform/launcher/
> It already propose to download Pharo 70 images. The VM is now downloaded
> automatically if the adequate one is not available.
> Let us know if everything is fine.

Thanks Christophe for updating PharoLauncher.  I'm trying it with Pharo 7
images for the first time.
I hit a problem using Iceberg in downloaded images.

$ unzip Pharo-linux-0.2.13.zip
$ cd pharo
$ unzip ../PharoLauncher-user-stable-2017.09.14.zip
$ ./pharo
+ PharoLauncher > Settings > Enable development environment
+ World > Tools > Iceberg
==>  iceberg opens okay
+ PharoLauncher > Templates > Pharo 7.0(beta) > latest-32 
'7latest32'
+ '7latest32' 
+ World > Tools > Iceberg
==>  "Error: EXternal module not found"

$ uname -a
==> Linux 3.16.0-4-686-pae #1 SMP Debian 3.16.7-ckt25-2 (2016-04-08) i686
GNU/Linux

cheers -ben


Re: [Pharo-users] Smalltalk gets a reference in fastcompany Kay interview

2017-09-19 Thread Holger Freyther

> On 20. Sep 2017, at 06:43, Offray  wrote:

Hey!



> Its a shame nog being able to read the article, because it is not posted in 
> the open web and I don't have Facebook or Google to pay with my privacy for 
> the "privilege" of reading Fast Company.


sign-up by email is possible as well, probably with a one time email address? 
The link is below their google sign-in button.


cheers
holger


Re: [Pharo-users] Smalltalk gets a reference in fastcompany Kay interview

2017-09-19 Thread Offray
Its a shame nog being able to read the article, because it is not posted in the 
open web and I don't have Facebook or Google to pay with my privacy for the 
"privilege" of reading Fast Company.

Anyway, I agree with Hilaire. It's pretty difficult to be between worlds trying 
to bridge education and informatics (or activisms) when one part is extremely 
focused in their own extreme of the bridge and the stuff at the other side is 
so alien.

Cheers,

Offray

El 19 de septiembre de 2017 14:37:19 GMT-05:00, Hilaire  
escribió:
>Thanks to share the article.
>
>Alan Kay thought can be hard to follow, especially considering, in one 
>hand, his main foci are education, educating, authoring media, and in 
>the other hand, his audience is mainly in the computer field without 
>much notion about education & al.
>
>His main vision, about computerized authoring tool to enlighten the
>mind 
>is a strong and exciting assertion. In this vision, the users will
>build 
>their own model to explore a given concept. Etoys was really what came 
>close to this idea, with medias you can interconnect to build 
>simulation, model, etc. It let you build these things more easily than 
>any programming tool. However I am wondering if even talented young 
>students or teachers can really embrace it. I know talented teachers
>and 
>I doubt they could do it with Etoys. May be Etoys was just itching the 
>surface of this vision.
>
>Hilaire
>
>
>Le 17/09/2017 à 14:34, Tim Mackinnon a écrit :
>> Interesting (although I found slightly rambling) interview with Alan 
>> Kay about personal computing. But Smalltalk does get a link.
>>
>>
>https://medium.com/fast-company/the-father-of-mobile-computing-is-not-impressed-9ab25dfff0c
>
>>
>
>>
>> Tim
>
>-- 
>Dr. Geo
>http://drgeo.eu

-- 
Enviado desde mi dispositivo Android con K-9 Mail. Por favor, disculpa mi 
brevedad.

Re: [Pharo-users] Help with Garage and sanitized strings

2017-09-19 Thread casimiro barreto
Problem solved. Question marks shouldn´t be inside apostrophes

'SELECT * FROM chaves_de_encriptacao WHERE numero_funcional = ?'

and not:

'SELECT * FROM chaves_de_encriptacao WHERE numero_funcional = ''?'''


2017-09-18 20:11 GMT-03:00 Casimiro de Almeida Barreto <
casimiro.barr...@gmail.com>:

> By the way, the following script fails with the same Exception
> (mysql_stmt_send_long_data):
>
> | db str sttmt |
>
> db := GADriver
> connectToConnectionString:
> 'mysql://localhost:3306/leaincertezas?user=learoot&password=welcomeLEA'.
>
> str := 'INSERT INTO chaves_de_encriptacao (numero_funcional,
> chave_privada, chave_publica) VALUES (''?'', ''?'', ''?'')'.
>
> sttmt := db prepare: str.
> sttmt at: 1 bind: '10'.
> sttmt at: 2 bind: '0BC0DE0FG32A128AB2EF01'.
> sttmt at: 3 bind: 'BEC0D01279F92123FAB2E0'.
>
> sttmt execute.
>
> db close.
>
> But the script:
>
> | db str sttmt |
>
> db := GADriver
> connectToConnectionString:
> 'mysql://localhost:3306/leaincertezas?user=learoot&password=welcomeLEA'.
>
> str := 'INSERT INTO chaves_de_encriptacao (numero_funcional,
> chave_privada, chave_publica) VALUES (''10'', ''0BC0DE0FG32A128AB2EF01'',
> ''0BC0DE0FG32A128AB2EF01'')'.
>
> db execute: str.
>
> db close.
>
> Results:
>
> MariaDB [leaincertezas]> SELECT * FROM chaves_de_encriptacao;
> +--+++
> | numero_funcional | chave_privada  | chave_publica  |
> +--+++
> |   10 | 0BC0DE0FG32A128AB2EF01 | 0BC0DE0FG32A128AB2EF01 |
> +--+++
> 1 row in set (0.00 sec)
>
>


-- 
The information contained in this message is confidential and
intended to the recipients specified in the headers. If you received
this message by error, notify the sender immediately. The
unauthorized use, disclosure, copy or alteration of this message
are strictly forbidden and subjected to civil and criminal sanctions.


Re: [Pharo-users] Web stack practices (Glorp / QCMagritte)

2017-09-19 Thread Richard Sargent
laurent laffont wrote
> Hi all,
> 
> it's been a long time :) At work we are currently comparing several 
> technologies to start a business project that will hopefully be used by 
> thousands of people for several years ;)

Laurent, I realize you are asking this on the Pharo list, looking for a
Pharo-specific answer. You should also post your requirements on the GLASS
list (http://forum.world.st/GLASS-f1460844.html). A number of
people/businesses there use a /develop on Pharo, deploy on GemStone
approach/. They will be able to give you some good advice on using
GemStone/S for your database.



> We need a web stack and we put Pharo & co in the comparative process. 
> My team have strong experience in  load-balanced php / mysql deployment 
> that handles millions of records  but we are ready to build on 
> something else though MySQL is still a requirement.
> 
> Thanks for Garage + Glorp, I can prototype things. I wonder how to 
> handle database schema migrations. With our PHP projects we have 
> versionned PHP scripts that are automatically run given a database 
> revision number ( see 
> http://git.afi-sa.fr/afi/opacce/tree/master/cosmogramme/sql/patch ). 
> What are the practices with Glorp ?
> 
> 
> We try QCMagritte and we enjoy what we see so far. What are the best 
> practices to glue Magritte and Glorp together ? Especially when you 
> load-balance requests on several images. Some examples ?
> 
> ( FYI, I cannot load QCMagritte in a fresh Pharo 6 image ( for #stable 
> version, MADescriptionBuilder missing. For #development versions of 
> Magritte and QCMagritte, QCConfiguration missing ). So actually I use 
> the one built on CI. )
> 
> 
> May be you have some other suggestions on a framework you love ?
> 
> 
> Best regards,
> 
> Laurent Laffont





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



Re: [Pharo-users] Continued Fractions

2017-09-19 Thread p...@highoctane.be
I need to match print ads sizes from various publications with a
standardized list of ratios (e.g. 2:1, 1:1, 2:7...) plus a bunch of other
metrics.

So  a rect of 1543@331 gives a float value that has can be best
approximated by a continued fraction approach.

But there are other complications. Now I am using a lookup table and try to
match with just a distance.

I am using DataFrame and hopefully more Roassal for all of this.

Pharo can be a good tool to manage the object model of this problem space.
I am prototyping something. We'll see how far I can get.

Phil

On Tue, Sep 19, 2017 at 9:30 PM, Stephane Ducasse 
wrote:

> Hi phil
>
> just out of sane curiosity do you have a pointer on ratio and
> rectangle and continued fraction?
>
> Stef
>
> On Mon, Sep 18, 2017 at 12:40 PM, werner kassens 
> wrote:
> > Hi Phil,
> > yes, in polymath it is the the object PMContinuedFraction.
> > werner
> >
> >
> > On 09/17/2017 08:38 PM, p...@highoctane.be wrote:
> >
> > Ah, I see there is something in the Numerical Methods book. :rolleyes:
> >
> > Phil
> >
> > On Sun, Sep 17, 2017 at 8:30 PM, p...@highoctane.be 
> > wrote:
> >>
> >> Do we have anything related to continued fractions in Pharo?
> >>
> >> https://en.wikipedia.org/wiki/Continued_fraction
> >>
> >> I need that to match rectanges to aspect ratios etc.
> >>
> >> TIA
> >> Phil
> >
> >
> >
>
>
>


Re: [Pharo-users] Smalltalk gets a reference in fastcompany Kay interview

2017-09-19 Thread Hilaire

Thanks to share the article.

Alan Kay thought can be hard to follow, especially considering, in one 
hand, his main foci are education, educating, authoring media, and in 
the other hand, his audience is mainly in the computer field without 
much notion about education & al.


His main vision, about computerized authoring tool to enlighten the mind 
is a strong and exciting assertion. In this vision, the users will build 
their own model to explore a given concept. Etoys was really what came 
close to this idea, with medias you can interconnect to build 
simulation, model, etc. It let you build these things more easily than 
any programming tool. However I am wondering if even talented young 
students or teachers can really embrace it. I know talented teachers and 
I doubt they could do it with Etoys. May be Etoys was just itching the 
surface of this vision.


Hilaire


Le 17/09/2017 à 14:34, Tim Mackinnon a écrit :
Interesting (although I found slightly rambling) interview with Alan 
Kay about personal computing. But Smalltalk does get a link.


https://medium.com/fast-company/the-father-of-mobile-computing-is-not-impressed-9ab25dfff0c 



Tim


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





Re: [Pharo-users] Continued Fractions

2017-09-19 Thread Stephane Ducasse
Hi phil

just out of sane curiosity do you have a pointer on ratio and
rectangle and continued fraction?

Stef

On Mon, Sep 18, 2017 at 12:40 PM, werner kassens  wrote:
> Hi Phil,
> yes, in polymath it is the the object PMContinuedFraction.
> werner
>
>
> On 09/17/2017 08:38 PM, p...@highoctane.be wrote:
>
> Ah, I see there is something in the Numerical Methods book. :rolleyes:
>
> Phil
>
> On Sun, Sep 17, 2017 at 8:30 PM, p...@highoctane.be 
> wrote:
>>
>> Do we have anything related to continued fractions in Pharo?
>>
>> https://en.wikipedia.org/wiki/Continued_fraction
>>
>> I need that to match rectanges to aspect ratios etc.
>>
>> TIA
>> Phil
>
>
>



Re: [Pharo-users] Web stack practices (Glorp / QCMagritte)

2017-09-19 Thread Stephane Ducasse
Hi laurent

Let us know how we can help. If necessary we can send our 15 year
experience Java Architect and nearly the same in  Pharo (Esteban) to
meet you at Annecy.

Did you see that Sven released also a native driver for SQL30? I do
not remember.

I do not know if you see but sorabito deploys everything in Pharo and
they mixed also mustache and Seaside.
BTW I know a german company that got a nice and large project for a
large train company and they will use Pharo on the server (plus mobile
apps and others). I can put you in contact also.

Mariano and Quuve used Gemstone + magritte. But this is not the same techno :)

Stef


On Mon, Sep 18, 2017 at 12:22 PM, laurent  wrote:
> Hi all,
>
> it's been a long time :) At work we are currently comparing several
> technologies to start a business project that will hopefully be used by
> thousands of people for several years ;)
>
> We need a web stack and we put Pharo & co in the comparative process. My
> team have strong experience in  load-balanced php / mysql deployment that
> handles millions of records  but we are ready to build on something else
> though MySQL is still a requirement.
>
> Thanks for Garage + Glorp, I can prototype things. I wonder how to handle
> database schema migrations. With our PHP projects we have versionned PHP
> scripts that are automatically run given a database revision number ( see
> http://git.afi-sa.fr/afi/opacce/tree/master/cosmogramme/sql/patch ). What
> are the practices with Glorp ?
>
>
> We try QCMagritte and we enjoy what we see so far. What are the best
> practices to glue Magritte and Glorp together ? Especially when you
> load-balance requests on several images. Some examples ?
>
> ( FYI, I cannot load QCMagritte in a fresh Pharo 6 image ( for #stable
> version, MADescriptionBuilder missing. For #development versions of Magritte
> and QCMagritte, QCConfiguration missing ). So actually I use the one built
> on CI. )
>
>
> May be you have some other suggestions on a framework you love ?
>
>
> Best regards,
>
> Laurent Laffont
>
>
>
>
>



[Pharo-users] Help with Garage and sanitized strings

2017-09-19 Thread Casimiro de Almeida Barreto
By the way, the following script fails with the same Exception 
(mysql_stmt_send_long_data):


| db str sttmt |

    db := GADriver
                connectToConnectionString:
'mysql://localhost:3306/leaincertezas?user=learoot&password=welcomeLEA'.

    str := 'INSERT INTO chaves_de_encriptacao (numero_funcional, 
chave_privada, chave_publica) VALUES (''?'', ''?'', ''?'')'.


    sttmt := db prepare: str.
    sttmt at: 1 bind: '10'.
    sttmt at: 2 bind: '0BC0DE0FG32A128AB2EF01'.
    sttmt at: 3 bind: 'BEC0D01279F92123FAB2E0'.

    sttmt execute.

    db close.

But the script:

| db str sttmt |

    db := GADriver
                connectToConnectionString:
'mysql://localhost:3306/leaincertezas?user=learoot&password=welcomeLEA'.

    str := 'INSERT INTO chaves_de_encriptacao (numero_funcional, 
chave_privada, chave_publica) VALUES (''10'', 
''0BC0DE0FG32A128AB2EF01'', ''0BC0DE0FG32A128AB2EF01'')'.


    db execute: str.

    db close.

Results:

MariaDB [leaincertezas]> SELECT * FROM chaves_de_encriptacao;
+--+++
| numero_funcional | chave_privada  | chave_publica  |
+--+++
|   10 | 0BC0DE0FG32A128AB2EF01 | 0BC0DE0FG32A128AB2EF01 |
+--+++
1 row in set (0.00 sec)




[Pharo-users] Help with Garage and sanitized strings...

2017-09-19 Thread Casimiro de Almeida Barreto

  
  
Good evening,
  
  
  
  I was trying to sanitize statements, but something went awkward.
  The following non sanitized codelet works ok:
  
  
      str := 'INSERT INTO chaves_de_encriptacao (
  
                      numero_funcional,
  
                      chave_privada,
  
                      chave_publica) VALUES (''',
  
                      self personId leaId asString,''',
''',
  
                      self keyPair privateKey
asAsn1DerBytes asByteArray hex,''', ''',
  
                      self keyPair publicKey asAsn1DerBytes
asByteArray hex,''')'.
  
  
  
      [ dbConnection execute: str ] on: Exception do: [ ^
false ].
  
  
  
  But sanitized one:
  
  
      str := dbConnection createStatement: 'INSERT INTO
chaves_de_encriptacao (
  
                      numero_funcional,
  
                      chave_privada,
  
                          chave_publica) VALUES (''?'',
''?'', ''?'')'.
  
  
  
      str prepare.
  
  
  
      str at: 1 bind: self personId leaId asString.
  
      str at: 2 bind: self keyPair privateKey
asAsn1DerBytes asByteArray hex.
  
      str at: 3 bind: self keyPair publicKey asAsn1DerBytes
asByteArray hex.
  
  
  
  
  
      str execute.
  
  
  
  returns exception mysqld_stmt_send_long_data (obviously
  same thing happens with the shorthand
  
  
      str := dbConnection prepare: ...
  
  
  
  And I inspect most things but could not understand what's going
  bad.
  

numero_funcional is INT(11)
chave_privada is VARBINARY(4096)
chave_publica is VARBINARY(4096)
Currently private and public keys are RSA 2048 keys (so, easilly
  under the 4096 bytes available).
I wonder if the at: bind: consider that the parameter is a string
  ended by \0 or something like that (that would explain the error
  message).

As SQL is not my field, I wonder if someone could help to
  elucidate what's going on.
  


  
  Best regards,
  
  
  
  Casimiro Barreto
  




Re: [Pharo-users] Standalone HTML Model

2017-09-19 Thread Sean P. DeNigris
Craig Latta wrote
>  Oh, it wasn't clear to me that this was one of Sean's requirements.

I would say "sorry" but I'm glad I wasn't clear because I learned something
cool from your reply ;)



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



Re: [Pharo-users] "Leaking" CommandLineHandler when running headless image

2017-09-19 Thread Tim Mackinnon
There was a long post from Guille about how to sort this. It had to do with 
altering the priority of shutdown code - I'm not sure if we resolved it, but we 
should go back and see as it was well reasoned.

Tim 

Sent from my iPhone

> On 19 Sep 2017, at 14:20, Denis Kudriashov  wrote:
> 
> Hi.
> 
> It is probably related to issue 20309
> 
> 2017-09-19 15:02 GMT+02:00 Holger Freyther :
>> Hi,
>> 
>> I am currently trying to run one of my images as non-root and related to 
>> that look into keeping changes in a different directory or not writing them 
>> at all. While looking at a write failure I saw some paths being logged that 
>> I used during CI to load code and should have been GCed.
>> 
>> 
>> Observation:
>> 
>> 
>> Pharo --headless My.image eval "Smalltalk garbageCollect. CommandLineHandler 
>> allSubInstances size"
>> 84
>> 
>> Pharo --headfull My.image eval "Smalltalk garbageCollect. CommandLineHandler 
>> allSubInstances size"
>> 2
>> 
>> 
>> As part of the CommandLineHandler allSubInstances there are eight 
>> LoadUpdatesCommandLineHandler still active. I would assume that a full GC 
>> should have collected them by now (some of them being created in May). In a 
>> headfull image they disappear quickly
>> 
>> I varied the execution a bit:
>> 
>> Pharo --headless RoamingHub.image eval --no-quit "[ Smalltalk 
>> garbageCollect. FileStream stdout print: CommandLineHandler allSubInstances 
>> size; lf. Smalltalk snapshot: false andQuit: true] fork"
>> 0
>> 
>> 
>> Hypothesis:
>> 
>> 
>> * Command line handlers call >>#snapshot:andQuit:.
>> * Image resumes in this process
>> * New session created
>> * Command line handlers execute
>> * Calls snapshot:andQuit:
>> * Image resumes..
>> * New session created
>> * Command line handlers execute
>> ...
>> 
>> 
>> Can this be true? I think the proposal to start the image differently would 
>> help here? Any comments/ideas?
>> 
>> holger
> 


Re: [Pharo-users] "Leaking" CommandLineHandler when running headless image

2017-09-19 Thread Denis Kudriashov
Hi.

It is probably related to issue 20309


2017-09-19 15:02 GMT+02:00 Holger Freyther :

> Hi,
>
> I am currently trying to run one of my images as non-root and related to
> that look into keeping changes in a different directory or not writing them
> at all. While looking at a write failure I saw some paths being logged that
> I used during CI to load code and should have been GCed.
>
>
> Observation:
>
>
> Pharo --headless My.image eval "Smalltalk garbageCollect.
> CommandLineHandler allSubInstances size"
> 84
>
> Pharo --headfull My.image eval "Smalltalk garbageCollect.
> CommandLineHandler allSubInstances size"
> 2
>
>
> As part of the CommandLineHandler allSubInstances there are eight
> LoadUpdatesCommandLineHandler still active. I would assume that a full GC
> should have collected them by now (some of them being created in May). In a
> headfull image they disappear quickly
>
> I varied the execution a bit:
>
> Pharo --headless RoamingHub.image eval --no-quit "[ Smalltalk
> garbageCollect. FileStream stdout print: CommandLineHandler allSubInstances
> size; lf. Smalltalk snapshot: false andQuit: true] fork"
> 0
>
>
> Hypothesis:
>
>
> * Command line handlers call >>#snapshot:andQuit:.
> * Image resumes in this process
> * New session created
> * Command line handlers execute
> * Calls snapshot:andQuit:
> * Image resumes..
> * New session created
> * Command line handlers execute
> ...
>
>
> Can this be true? I think the proposal to start the image differently
> would help here? Any comments/ideas?
>
> holger
>


[Pharo-users] "Leaking" CommandLineHandler when running headless image

2017-09-19 Thread Holger Freyther
Hi,

I am currently trying to run one of my images as non-root and related to that 
look into keeping changes in a different directory or not writing them at all. 
While looking at a write failure I saw some paths being logged that I used 
during CI to load code and should have been GCed.


Observation:


Pharo --headless My.image eval "Smalltalk garbageCollect. CommandLineHandler 
allSubInstances size"
84

Pharo --headfull My.image eval "Smalltalk garbageCollect. CommandLineHandler 
allSubInstances size"
2


As part of the CommandLineHandler allSubInstances there are eight 
LoadUpdatesCommandLineHandler still active. I would assume that a full GC 
should have collected them by now (some of them being created in May). In a 
headfull image they disappear quickly

I varied the execution a bit:

Pharo --headless RoamingHub.image eval --no-quit "[ Smalltalk garbageCollect. 
FileStream stdout print: CommandLineHandler allSubInstances size; lf. Smalltalk 
snapshot: false andQuit: true] fork"
0


Hypothesis:


* Command line handlers call >>#snapshot:andQuit:.
* Image resumes in this process
* New session created
* Command line handlers execute
* Calls snapshot:andQuit:
* Image resumes..
* New session created
* Command line handlers execute
...


Can this be true? I think the proposal to start the image differently would 
help here? Any comments/ideas?

holger


Re: [Pharo-users] Web stack practices (Glorp / QCMagritte)

2017-09-19 Thread laurent

Thank you Esteban & Joachim for your answers.

Laurent


Le lun. 18 sept. 2017 à 14:58, jtuc...@objektfabrik.de 
 a écrit :

Laurent,

I don't have answers to all your questions, but we use Glorp & 
Seaside (no Magritte) on VA Smalltalk for our cloud service 
(http://kontolino.de).




Am 18.09.17 um 12:22 schrieb laurent:

Hi all,

it's been a long time :) At work we are currently comparing several 
technologies to start a business project that will hopefully be used 
by thousands of people for several years ;)


We need a web stack and we put Pharo & co in the comparative 
process. My team have strong experience in  load-balanced php / 
mysql deployment that handles millions of records  but we are ready 
to build on something else though MySQL is still a requirement.

Sounds interesting.



Thanks for Garage + Glorp, I can prototype things. I wonder how to 
handle database schema migrations. With our PHP projects we have 
versionned PHP scripts that are automatically run given a database 
revision number ( see 
http://git.afi-sa.fr/afi/opacce/tree/master/cosmogramme/sql/patch ). 
What are the practices with Glorp ?


We use a similar approach: our Descriptor class has a method called 
schemaVersion, which just returns the current version number. We also 
have a "magic" table for settings in our DB, just holding a "name" 
and a "value" column, both being Varchars. One of the rows has a name 
of "SchemaVersion" and the value is (you guessed it) the printString 
of the version number.


Our images accept a few command line paramters, one of them being 
--upgradeSchema. It compoares the number in the DB with the one 
provided by the descriptor. If they match, the image quits. If not, 
it calls all methods named #upgradeSchemaToVersionXXX until it 
reaches the number in the Descriptor. Thus we can do both SQL based 
migrations, like DDL stuff, as well as Smalltalk object based 
migrations (which can be sooo much faster to implement for complex 
cases). And we have all versioned and maintained in our beloved Envy 
repository ;-) .
The rest is just bash script magic (like only starting one image with 
the --upgradeSchema parameter and only start the real web workers 
once that one has ended succesfully).



About load balancing: You need Sticky sessions, so no failover 
between images. If one image crashes, the user must re-logon on a new 
image. Works nicely with Apache, I guess nginx works as least as 
well. For Apache, look for mod_prox_balancer to learn more.



Hope I could give you a few starting points for your research. And I 
also hope you'll find Pharo+Garage+Glorp+QCMagritte a good fit for 
your project. We all want success stories ;-)



Joachim

--
---
Objektfabrik Joachim Tuchel  mailto:jtuc...@objektfabrik.de
Fliederweg 1 http://www.objektfabrik.de
D-71640 Ludwigsburg  
http://joachimtuchel.wordpress.com

Telefon: +49 7141 56 10 86 0 Fax: +49 7141 56 10 86 1