Re: [Pharo-users] Packaging Pharo for many distributions at once

2014-09-25 Thread Christophe Demarey

Le 24 sept. 2014 à 18:51, Damien Cassou a écrit :

 On Wed, Sep 24, 2014 at 12:47 PM, Thierry Goubier
 thierry.goub...@gmail.com wrote:
 All non-native package managers have that issue.
 
 
 nix included

I know ...
That's why native packages are still interesting even if it's difficult to 
manage various package descriptions and build.

smime.p7s
Description: S/MIME cryptographic signature


[Pharo-users] What to use?

2014-09-25 Thread Friedrich Dominicus
If one is intersted in graphics of diverse functions?

E.g plotting x^2,x^3 and the like. I checked the DrGeo stuff but that's
geometry and not just analysis of functions and the like?

Does there exist something for that?

Regards
Friedrich




Re: [Pharo-users] What to use?

2014-09-25 Thread Esteban Lorenzano
probably GraphET

https://www.facebook.com/media/set/?set=a.566523986767536.1073741839.340543479365589type=3


On 25 Sep 2014, at 09:08, Friedrich Dominicus fr...@q-software-solutions.de 
wrote:

 If one is intersted in graphics of diverse functions?
 
 E.g plotting x^2,x^3 and the like. I checked the DrGeo stuff but that's
 geometry and not just analysis of functions and the like?
 
 Does there exist something for that?
 
 Regards
 Friedrich
 
 




Re: [Pharo-users] What to use?

2014-09-25 Thread Friedrich Dominicus
Esteban Lorenzano esteba...@gmail.com writes:

 probably GraphET

 https://www.facebook.com/media/set/?set=a.566523986767536.1073741839.340543479365589type=3
Thanks, that seems to be it

Regards
Friedrich



Re: [Pharo-users] What to use?

2014-09-25 Thread Yuriy Tymchuk
There is a new Charter builder now. It’s not very stable yet as far as I can 
tell, but it’s the future of charts in Roassal

https://dl.dropboxusercontent.com/u/31543901/AgileVisualization/Charter/0202-Charter.html
 
https://dl.dropboxusercontent.com/u/31543901/AgileVisualization/Charter/0202-Charter.html

Uko



 On 25 Sep 2014, at 09:19, Friedrich Dominicus fr...@q-software-solutions.de 
 wrote:
 
 Esteban Lorenzano esteba...@gmail.com writes:
 
 probably GraphET
 
 https://www.facebook.com/media/set/?set=a.566523986767536.1073741839.340543479365589type=3
 Thanks, that seems to be it
 
 Regards
 Friedrich
 



[Pharo-users] Threaded callbacks with FFI

2014-09-25 Thread Annick Fron
Hi,

I am calling C from pharo with a callback,  and it seems the callback is called 
in another thread.
I can’t wrap the block in a process, because the return will be wrong, how can 
I do ???

Annick


[Pharo-users] Machine learning in Pharo?

2014-09-25 Thread Martin Dias
Hi all,

I'm playing with weka [1] for classifying data using data mining/machine
learning. I'm really new on this field so I want to give you a concrete
example of my use case to make it clear:

I have elements that can be classified as true or false. In a training
phase, I set up a bayesian network with elements that I manually
classified. Then, I can use such network for predicting the classification
of new elements.

--- my question is:
Do we have a package for replacing weka-in-my-use-case in Pharo? It doesn't
need to be exactly a bayesian network, it could be simpler.


I looked a bit in Moose-Algos and in BioSmalltalk but I think they don't
have what I need.

I would appreciate any help. Cheers.
Martín


[1]: http://www.cs.waikato.ac.nz/ml/weka/


Re: [Pharo-users] Threaded callbacks with FFI

2014-09-25 Thread p...@highoctane.be
Le 25 sept. 2014 11:32, Annick Fron l...@afceurope.com a écrit :

 Hi,

 I am calling C from pharo with a callback,  and it seems the callback is
called in another thread.
 I can’t wrap the block in a process, because the return will be wrong,
how can I do ???

Can you send us sample code ?
 Annick



[Pharo-users] Loading PetitParser loads a hell of a lot of things... is there a terser version?

2014-09-25 Thread p...@highoctane.be
I am loading PetitParser in my image but it takes a lng time to load
and below is what I see in my Jenkins console.

Build for that step starts at 13:48:51 and ends at 14:03:15. Phew!

Also a couple errors in loading examples.

What is recommended to use to not have all of this? I just need the parser
and tools to browse the grammars.


[34m13:48:51 :  -- loadPetitParser step starting

Loading 1.6-baseline of ConfigurationOfPetitParser...
Fetched - ConfigurationOfGlamour-AndreiChis.158 ---
http://smalltalkhub.com/mc/Moose/Glamour/main/ ---
http://smalltalkhub.com/mc/Moose/Glamour/main/
Loaded - ConfigurationOfGlamour-AndreiChis.158 ---
http://smalltalkhub.com/mc/Moose/Glamour/main/ ---
/var/lib/jenkins/jobs/CXP Frontend/workspace/package-cache
Fetched - PetitParser-JanKurs.247 ---
http://smalltalkhub.com/mc/Moose/PetitParser/main/ ---
http://smalltalkhub.com/mc/Moose/PetitParser/main/
Fetched - PetitTests-JanKurs.59 ---
http://smalltalkhub.com/mc/Moose/PetitParser/main/ ---
http://smalltalkhub.com/mc/Moose/PetitParser/main/
Fetched - PetitAnalyzer-DiegoLont.46 ---
http://smalltalkhub.com/mc/Moose/PetitParser/main/ ---
http://smalltalkhub.com/mc/Moose/PetitParser/main/
Fetched - PetitSmalltalk-JanKurs.71 ---
http://smalltalkhub.com/mc/Moose/PetitParser/main/ ---
http://smalltalkhub.com/mc/Moose/PetitParser/main/
Fetched - PetitCSV-tg.7 ---
http://smalltalkhub.com/mc/Moose/PetitParser/main/ ---
http://smalltalkhub.com/mc/Moose/PetitParser/main/
Fetched - PetitJson-DamienCassou.8 ---
http://smalltalkhub.com/mc/Moose/PetitParser/main/ ---
http://smalltalkhub.com/mc/Moose/PetitParser/main/
Fetched - PetitMSE-AndreHora.21 ---
http://smalltalkhub.com/mc/Moose/PetitParser/main/ ---
http://smalltalkhub.com/mc/Moose/PetitParser/main/
Fetched - PetitManifestMf-tg.9 ---
http://smalltalkhub.com/mc/Moose/PetitParser/main/ ---
http://smalltalkhub.com/mc/Moose/PetitParser/main/
Fetched - PetitRegex-JanKurs.29 ---
http://smalltalkhub.com/mc/Moose/PetitParser/main/ ---
http://smalltalkhub.com/mc/Moose/PetitParser/main/
Fetched - PetitXml-JanKurs.36 ---
http://smalltalkhub.com/mc/Moose/PetitParser/main/ ---
http://smalltalkhub.com/mc/Moose/PetitParser/main/
Fetched - PetitXPath-EstebanLorenzano.7 ---
http://smalltalkhub.com/mc/Moose/PetitParser/main/ ---
http://smalltalkhub.com/mc/Moose/PetitParser/main/
Fetched - PetitIslands-JanKurs.9 ---
http://smalltalkhub.com/mc/Moose/PetitParser/main/ ---
http://smalltalkhub.com/mc/Moose/PetitParser/main/
Fetched - Factorial-Language-lr.6 ---
http://smalltalkhub.com/mc/Moose/PetitParser/main/ ---
http://smalltalkhub.com/mc/Moose/PetitParser/main/
Project: Glamour development [2.91-baseline]
Fetched - ConfigurationOfGraphET-TudorGirba.8 ---
http://smalltalkhub.com/mc/ObjectProfile/GraphET/main/ ---
http://smalltalkhub.com/mc/ObjectProfile/GraphET/main/
Loaded - ConfigurationOfGraphET-TudorGirba.8 ---
http://smalltalkhub.com/mc/ObjectProfile/GraphET/main/ ---
/var/lib/jenkins/jobs/CXP Frontend/workspace/package-cache
Fetched - ConfigurationOfRubric-AndreiChis.7 ---
http://smalltalkhub.com/mc/AlainPlantec/Rubric/main/ ---
http://smalltalkhub.com/mc/AlainPlantec/Rubric/main/
Loaded - ConfigurationOfRubric-AndreiChis.7 ---
http://smalltalkhub.com/mc/AlainPlantec/Rubric/main/ ---
/var/lib/jenkins/jobs/CXP Frontend/workspace/package-cache
Fetched - ConfigurationOfRoassal-StephaneDucasse.1195 ---
http://smalltalkhub.com/mc/ObjectProfile/Roassal/main/ ---
http://smalltalkhub.com/mc/ObjectProfile/Roassal/main/
Loaded - ConfigurationOfRoassal-StephaneDucasse.1195 ---
http://smalltalkhub.com/mc/ObjectProfile/Roassal/main/ ---
/var/lib/jenkins/jobs/CXP Frontend/workspace/package-cache
Fetched - Glamour-Announcements-TudorGirba.7 ---
http://smalltalkhub.com/mc/Moose/Glamour/main/ ---
http://smalltalkhub.com/mc/Moose/Glamour/main/
Fetched - Glamour-Helpers-AndreiChis.35 ---
http://smalltalkhub.com/mc/Moose/Glamour/main/ ---
http://smalltalkhub.com/mc/Moose/Glamour/main/
Fetched - Glamour-Core-AndreiChis.277 ---
http://smalltalkhub.com/mc/Moose/Glamour/main/ ---
http://smalltalkhub.com/mc/Moose/Glamour/main/
Fetched - Glamour-Presentations-TudorGirba.157 ---
http://smalltalkhub.com/mc/Moose/Glamour/main/ ---
http://smalltalkhub.com/mc/Moose/Glamour/main/
Fetched - Glamour-Browsers-TudorGirba.104 ---
http://smalltalkhub.com/mc/Moose/Glamour/main/ ---
http://smalltalkhub.com/mc/Moose/Glamour/main/
Fetched - Glamour-Examples-StephanEggermont.284 ---
http://smalltalkhub.com/mc/Moose/Glamour/main/ ---
http://smalltalkhub.com/mc/Moose/Glamour/main/
Project: Roassal for Glamour development [0.7-baseline]
Fetched - Roassal-AlexandreBergel.759 ---
http://smalltalkhub.com/mc/ObjectProfile/Roassal/main/ ---
http://smalltalkhub.com/mc/ObjectProfile/Roassal/main/
Fetched - RoassalMorphic-AlexandreBergel.175 ---
http://smalltalkhub.com/mc/ObjectProfile/Roassal/main/ ---
http://smalltalkhub.com/mc/ObjectProfile/Roassal/main/
Fetched - RoassalExtras-AlexandreBergel.61 ---

Re: [Pharo-users] Threaded callbacks with FFI

2014-09-25 Thread Annick Fron
OK I try do do that.

Le 25 sept. 2014 à 12:18, p...@highoctane.be a écrit :

 
 Le 25 sept. 2014 11:32, Annick Fron l...@afceurope.com a écrit :
 
  Hi,
 
  I am calling C from pharo with a callback,  and it seems the callback is 
  called in another thread.
  I can’t wrap the block in a process, because the return will be wrong, how 
  can I do ???
 
 Can you send us sample code ? 
  Annick
 



Re: [Pharo-users] Loading PetitParser loads a hell of a lot of things... is there a terser version?

2014-09-25 Thread Tudor Girba
Hi,

The dependencies are needed for the UI. If you can live without the UI, you
can load the 'Core' group from the configuration.

Cheers,
Doru



On Thu, Sep 25, 2014 at 2:07 PM, p...@highoctane.be p...@highoctane.be
wrote:

 I am loading PetitParser in my image but it takes a lng time to load
 and below is what I see in my Jenkins console.

 Build for that step starts at 13:48:51 and ends at 14:03:15. Phew!

 Also a couple errors in loading examples.

 What is recommended to use to not have all of this? I just need the parser
 and tools to browse the grammars.


 [34m13:48:51 :  -- loadPetitParser step starting

 Loading 1.6-baseline of ConfigurationOfPetitParser...
 Fetched - ConfigurationOfGlamour-AndreiChis.158 ---
 http://smalltalkhub.com/mc/Moose/Glamour/main/ ---
 http://smalltalkhub.com/mc/Moose/Glamour/main/
 Loaded - ConfigurationOfGlamour-AndreiChis.158 ---
 http://smalltalkhub.com/mc/Moose/Glamour/main/ ---
 /var/lib/jenkins/jobs/CXP Frontend/workspace/package-cache
 Fetched - PetitParser-JanKurs.247 ---
 http://smalltalkhub.com/mc/Moose/PetitParser/main/ ---
 http://smalltalkhub.com/mc/Moose/PetitParser/main/
 Fetched - PetitTests-JanKurs.59 ---
 http://smalltalkhub.com/mc/Moose/PetitParser/main/ ---
 http://smalltalkhub.com/mc/Moose/PetitParser/main/
 Fetched - PetitAnalyzer-DiegoLont.46 ---
 http://smalltalkhub.com/mc/Moose/PetitParser/main/ ---
 http://smalltalkhub.com/mc/Moose/PetitParser/main/
 Fetched - PetitSmalltalk-JanKurs.71 ---
 http://smalltalkhub.com/mc/Moose/PetitParser/main/ ---
 http://smalltalkhub.com/mc/Moose/PetitParser/main/
 Fetched - PetitCSV-tg.7 ---
 http://smalltalkhub.com/mc/Moose/PetitParser/main/ ---
 http://smalltalkhub.com/mc/Moose/PetitParser/main/
 Fetched - PetitJson-DamienCassou.8 ---
 http://smalltalkhub.com/mc/Moose/PetitParser/main/ ---
 http://smalltalkhub.com/mc/Moose/PetitParser/main/
 Fetched - PetitMSE-AndreHora.21 ---
 http://smalltalkhub.com/mc/Moose/PetitParser/main/ ---
 http://smalltalkhub.com/mc/Moose/PetitParser/main/
 Fetched - PetitManifestMf-tg.9 ---
 http://smalltalkhub.com/mc/Moose/PetitParser/main/ ---
 http://smalltalkhub.com/mc/Moose/PetitParser/main/
 Fetched - PetitRegex-JanKurs.29 ---
 http://smalltalkhub.com/mc/Moose/PetitParser/main/ ---
 http://smalltalkhub.com/mc/Moose/PetitParser/main/
 Fetched - PetitXml-JanKurs.36 ---
 http://smalltalkhub.com/mc/Moose/PetitParser/main/ ---
 http://smalltalkhub.com/mc/Moose/PetitParser/main/
 Fetched - PetitXPath-EstebanLorenzano.7 ---
 http://smalltalkhub.com/mc/Moose/PetitParser/main/ ---
 http://smalltalkhub.com/mc/Moose/PetitParser/main/
 Fetched - PetitIslands-JanKurs.9 ---
 http://smalltalkhub.com/mc/Moose/PetitParser/main/ ---
 http://smalltalkhub.com/mc/Moose/PetitParser/main/
 Fetched - Factorial-Language-lr.6 ---
 http://smalltalkhub.com/mc/Moose/PetitParser/main/ ---
 http://smalltalkhub.com/mc/Moose/PetitParser/main/
 Project: Glamour development [2.91-baseline]
 Fetched - ConfigurationOfGraphET-TudorGirba.8 ---
 http://smalltalkhub.com/mc/ObjectProfile/GraphET/main/ ---
 http://smalltalkhub.com/mc/ObjectProfile/GraphET/main/
 Loaded - ConfigurationOfGraphET-TudorGirba.8 ---
 http://smalltalkhub.com/mc/ObjectProfile/GraphET/main/ ---
 /var/lib/jenkins/jobs/CXP Frontend/workspace/package-cache
 Fetched - ConfigurationOfRubric-AndreiChis.7 ---
 http://smalltalkhub.com/mc/AlainPlantec/Rubric/main/ ---
 http://smalltalkhub.com/mc/AlainPlantec/Rubric/main/
 Loaded - ConfigurationOfRubric-AndreiChis.7 ---
 http://smalltalkhub.com/mc/AlainPlantec/Rubric/main/ ---
 /var/lib/jenkins/jobs/CXP Frontend/workspace/package-cache
 Fetched - ConfigurationOfRoassal-StephaneDucasse.1195 ---
 http://smalltalkhub.com/mc/ObjectProfile/Roassal/main/ ---
 http://smalltalkhub.com/mc/ObjectProfile/Roassal/main/
 Loaded - ConfigurationOfRoassal-StephaneDucasse.1195 ---
 http://smalltalkhub.com/mc/ObjectProfile/Roassal/main/ ---
 /var/lib/jenkins/jobs/CXP Frontend/workspace/package-cache
 Fetched - Glamour-Announcements-TudorGirba.7 ---
 http://smalltalkhub.com/mc/Moose/Glamour/main/ ---
 http://smalltalkhub.com/mc/Moose/Glamour/main/
 Fetched - Glamour-Helpers-AndreiChis.35 ---
 http://smalltalkhub.com/mc/Moose/Glamour/main/ ---
 http://smalltalkhub.com/mc/Moose/Glamour/main/
 Fetched - Glamour-Core-AndreiChis.277 ---
 http://smalltalkhub.com/mc/Moose/Glamour/main/ ---
 http://smalltalkhub.com/mc/Moose/Glamour/main/
 Fetched - Glamour-Presentations-TudorGirba.157 ---
 http://smalltalkhub.com/mc/Moose/Glamour/main/ ---
 http://smalltalkhub.com/mc/Moose/Glamour/main/
 Fetched - Glamour-Browsers-TudorGirba.104 ---
 http://smalltalkhub.com/mc/Moose/Glamour/main/ ---
 http://smalltalkhub.com/mc/Moose/Glamour/main/
 Fetched - Glamour-Examples-StephanEggermont.284 ---
 http://smalltalkhub.com/mc/Moose/Glamour/main/ ---
 http://smalltalkhub.com/mc/Moose/Glamour/main/
 Project: Roassal for Glamour development [0.7-baseline]
 Fetched - Roassal-AlexandreBergel.759 ---
 

[Pharo-users] invoking python from pharo

2014-09-25 Thread Pablo R. Digonzelli
Hi all , I need to invoke python rutines from Pharo. I need some orientation 
about the best way to do it. 
TIA 


Ing. Pablo Digonzelli 
Software Solutions 
IP-Solutiones SRL 
Metrotec SRL 
25 de Mayo 521 
Email: pdigonze...@softsargentina.com 
pdigonze...@gmail.com 
Cel: 5493815982714 


[Pharo-users] FFI on Linux again

2014-09-25 Thread Annick Fron
Hi,

I Have tried the following code on Linux , but the call breaks. Is it because 
of the X11Window structure missing or else ?

Annick

testGetOurWindowLocation
   self new testGetOurWindowLocation

   | display ourWindow aParent anX anY aWidth aHeight aBorderWidth aDepth |
   display := X11Display XOpenDisplay: nil.
   ourWindow := display ourWindow.
   (Alien lookup: 'XGetGeometry' inLibrary: 'X11')
   primFFICallResult: nil
   withArguments:
   {display.
   ourWindow.
   (aParent := Alien new: 4).
   (anX := Alien new: 4).
   (anY := Alien new: 4).
   (aWidth := Alien new: 4).
   (aHeight := Alien new: 4).
   (aBorderWidth := Alien new: 4).
   (aDepth := Alien new: 4)}.
   (anX unsignedLongAt: 1) inspect


Re: [Pharo-users] Ridiculous we are

2014-09-25 Thread Henrik Johansen

On 25 Sep 2014, at 5:00 , Hilaire Fernandes hila...@drgeo.eu wrote:

 Le 24/09/2014 18:48, Benjamin Pollack a écrit :
 On Tue, 23 Sep 2014 08:51:54 -0400, Hilaire hila...@drgeo.eu wrote:
 
 Le 23/09/2014 14:09, Damien Cassou a écrit :
 I recently read documents about utf-8 encoding. In all of them, the
 author says that pathnames should be kept as is because you never know
 which encoding the filesystem uses. So, a filename should probably be
 a bytearray.
 
 
 yes, but a #é should be encoded in two bytes.
 
 As noted in my previous message, é could be represented as either
 one or two Unicode code points, and these in turn could validly be
 either two or three bytes in UTF-8.  My gut says that $é should be
 U+00E9, because otherwise you should have to use two Characters ($e
 and $´), but you could legitimately argue otherwise as well, and at
 any rate, #é could definitely be either.  This is likely the core of
 the issue you're hitting.
 As I understand it, #é should be encoded on two bytes and only two byte.
 Only ASCII is coded as 1 byte with UTF-8.
 See ref. on Wikipedia

Hilaire: Benjamin is talking about which unicode normalization form é should be 
represented in, which is orthogonal to the encoding; 
http://en.wikipedia.org/wiki/Unicode_equivalence#Combining_and_precomposed_characters
 .
So é can indeed be encoded in two different ways in utf8 (as in any other 
encoding), both as #[c3 a9] (encoding U+E9, Latin small letter e with acute), 
and as #[65 cc 81] (encoding U+65, Latin small letter e, followed by U+0301, 
Combining accute accent)

Benjamin: Since the base path that contains the problematic character 
originates from a filesystem primitive, we can safely assume it's already in a 
canonical form*, Pharo does no automatic normalization. (that is, if the path 
would have been e + ´, the internal string would have two separate characters 
as well)

Cheers,
Henry

* Only Mac OSX defines a canonical form for its paths anyways, the others don't 
care


signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: [Pharo-users] Booting into Pharo!

2014-09-25 Thread Pierce Ng
On Sun, Sep 21, 2014 at 06:56:27PM -0400, David T. Lewis wrote:
 If you are booting directly into the image, you may find it useful to also
 load CommandShell/OSProcess into your image. This will let you open a
 Smalltalk shell window directly within your Squeak/Pharo boot image, so
 that you have access to the operating system with actually opening any
 windows or terminal sessions outside of your image.
 
   http://www.squeaksource.com/CommandShell
   http://www.squeaksource.com/OSProcess

In view of ShellShock, from a PipeableOSProcess example:

  | env |
  env := OSProcess thisOSProcess environment copy.
  env at: #SHOCKED put: '() { :;}; echo ShellShocked;'.
  (PipeableOSProcess command: 'echo Nah environment: env) output

This gives the following. (Yes, this is done on an unpatched bash for demo
purposes. Everyone should patch as soon as you can.)

  ShellShocked
  Nah

I have a webapp that shells out to some OS command line tool. I think I have
written it such that untrustworthy web input does not taint the command line
tool's environment and input. I think. Everyone doing similar may wish to
relook at it.

David, perhaps the code is already there, but can we run OS commands without
invoking the shell?

Pierce




Re: [Pharo-users] invoking python from pharo

2014-09-25 Thread Ben Coman




Pablo R. Digonzelli wrote:

  
  Hi all , I need to invoke python rutines from Pharo. I need some
orientation about the best way to do it.
  TIA
  
  
  
  
  Ing.
Pablo Digonzelli
  Software
Solutions
  IP-Solutiones
SRL
  Metrotec SRL
  25
de Mayo 521
  Email:
pdigonze...@softsargentina.com
  pdigonze...@gmail.com
  Cel:
5493815982714
  
  


Search the [pharo-dev] list for Ephestos by kilon.
cheers -ben





Re: [Pharo-users] Glorp + NBSQLite3

2014-09-25 Thread Pierce Ng
On Wed, Sep 24, 2014 at 01:33:02PM -0300, Esteban A. Maringolo wrote:
 How does SQLite scale in terms of table size and so on?

According to https://www.sqlite.org/whentouse.html:

An SQLite database is limited in size to 140 terabytes (2^47 bytes, 128
tibibytes). And even if it could handle larger databases, SQLite stores the
entire database in a single disk file and many filesystems limit the maximum
size of files to something less than this. 

SQLite will normally work fine as the database backend to a website. But if
you website is so busy that you are thinking of splitting the database
component off onto a separate machine, then you should definitely consider
using an enterprise-class client/server database engine instead of SQLite.


 I was surprised to know it is based on an old version of PostgreSQL
 according to this presentation:
 http://www.pgcon.org/2014/schedule/events/736.en.html

That is a very interesting talk. As it says, SQLite is a replacement for
fopen(), not a replacement for PostgreSQL. In the context of my writing tools
and applications in Smalltalk, I'd like to enjoy SQLite's robustness, hence
my interest in having/building a good Smalltalk wrapper.

Pierce




Re: [Pharo-users] Ridiculous we are

2014-09-25 Thread Henrik Johansen

On 22 Sep 2014, at 10:07 , Hilaire hila...@drgeo.eu wrote:

 
 However font path seems ok:
 File @ /home/hilaire/Téléchargements/DrGeo.app/Contents/Resources.
 Inspecting this path, it looks like 'Téléchargements' is 8 bits, but it
 should be utf-8, right?
 
 I think there are issue on Windows, as some user reported to me.


The fun thing about plugins calling external libraries, is that you have to 
find out what that library does to know the right answer to what encoding char* 
parameters are meant to be passed...

In the case of FreeType, after some digging*, it seems to me it ends up calling 
fopen on all platforms, which on windows... *drumroll*
... resolves to the legacy ANSI version** of the Windows file libraries. 
Hence, the correct encoding to use on Windows would be the locale legacy code 
page.
It also means that, on Windows, you *cannot* load fonts from a directory whose 
name is not encodable in the current codepage no matter what we do in Pharo. 
(short of submitting a bug-fix to the FreeType project)

Cheers,
Henry

*FT_New_Face 
(http://git.savannah.gnu.org/cgit/freetype/freetype2.git/tree/src/base/ftobjs.c)
 calls...
FT_Open_Face  (same) which calls...
FT_Stream_New  (same) which calls...
FT_Stream_Open 
(http://git.savannah.gnu.org/cgit/freetype/freetype2.git/tree/src/base/ftsystem.c)
 which calls...
ft_fopen 
(http://git.savannah.gnu.org/cgit/freetype/freetype2.git/tree/include/config/ftstdlib.h)
 which resolves to
f_open.

** http://msdn.microsoft.com/en-us/library/yeby3zcb.aspx , don't be fooled, the 
Unicode support section is about contents written/read to/from file, not the 
path parameter.


signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: [Pharo-users] Using themes and closing windows

2014-09-25 Thread Thierry Goubier

Le 25/09/2014 18:37, Annick Fron a écrit :

Is there a documentation how to use or write Themes ?

I would like to attach some method when I close a window, how I do that ?


You can register to the announcement sent by the window when closing.

| s |
s := SystemWindow new.
s onAnnouncement: WindowClosed do: [ Transcript show: 'Closing' ].
s openAsIs

Thierry




Re: [Pharo-users] FFI on Linux again

2014-09-25 Thread Nicolai Hess
Am 25.09.2014 17:25 schrieb Annick Fron l...@afceurope.com:

 Hi,

 I Have tried the following code on Linux , but the call breaks. Is it
because of the X11Window structure missing or else ?

 Annick
 
 testGetOurWindowLocation
self new testGetOurWindowLocation

| display ourWindow aParent anX anY aWidth aHeight aBorderWidth aDepth
|
display := X11Display XOpenDisplay: nil.
ourWindow := display ourWindow.
(Alien lookup: 'XGetGeometry' inLibrary: 'X11')
primFFICallResult: nil
withArguments:
{display.
ourWindow.
(aParent := Alien new: 4).
(anX := Alien new: 4).
(anY := Alien new: 4).
(aWidth := Alien new: 4).
(aHeight := Alien new: 4).
(aBorderWidth := Alien new: 4).
(aDepth := Alien new: 4)}.
(anX unsignedLongAt: 1) inspect

withArguments ...
ourWindow xid
...
?


Re: [Pharo-users] Booting into Pharo!

2014-09-25 Thread David T. Lewis
 On Sun, Sep 21, 2014 at 06:56:27PM -0400, David T. Lewis wrote:
 If you are booting directly into the image, you may find it useful to
 also
 load CommandShell/OSProcess into your image. This will let you open a
 Smalltalk shell window directly within your Squeak/Pharo boot image, so
 that you have access to the operating system with actually opening any
 windows or terminal sessions outside of your image.

   http://www.squeaksource.com/CommandShell
   http://www.squeaksource.com/OSProcess

 In view of ShellShock, from a PipeableOSProcess example:

   | env |
   env := OSProcess thisOSProcess environment copy.
   env at: #SHOCKED put: '() { :;}; echo ShellShocked;'.
   (PipeableOSProcess command: 'echo Nah environment: env) output

 This gives the following. (Yes, this is done on an unpatched bash for demo
 purposes. Everyone should patch as soon as you can.)

   ShellShocked
   Nah

 I have a webapp that shells out to some OS command line tool. I think I
 have
 written it such that untrustworthy web input does not taint the command
 line
 tool's environment and input. I think. Everyone doing similar may wish to
 relook at it.

 David, perhaps the code is already there, but can we run OS commands
 without
 invoking the shell?

 Pierce



Yes, you can run any executable command as an external OS process. It is
usually easier to run /bin/sh as the command and let the shell do the
parsing, but you can run any program you like. And you can also do the
shell in native Smalltalk with CommandShell, although this is not a
complete simulation of a unix shell, so sometimes it is better to use the
real /bin/sh program.

Dave





Re: [Pharo-users] Booting into Pharo!

2014-09-25 Thread Sven Van Caekenberghe

On 25 Sep 2014, at 18:27, Pierce Ng pie...@samadhiweb.com wrote:

 On Sun, Sep 21, 2014 at 06:56:27PM -0400, David T. Lewis wrote:
 If you are booting directly into the image, you may find it useful to also
 load CommandShell/OSProcess into your image. This will let you open a
 Smalltalk shell window directly within your Squeak/Pharo boot image, so
 that you have access to the operating system with actually opening any
 windows or terminal sessions outside of your image.
 
  http://www.squeaksource.com/CommandShell
  http://www.squeaksource.com/OSProcess
 
 In view of ShellShock, from a PipeableOSProcess example:
 
  | env |
  env := OSProcess thisOSProcess environment copy.
  env at: #SHOCKED put: '() { :;}; echo ShellShocked;'.
  (PipeableOSProcess command: 'echo Nah environment: env) output
 
 This gives the following. (Yes, this is done on an unpatched bash for demo
 purposes. Everyone should patch as soon as you can.)
 
  ShellShocked
  Nah
 
 I have a webapp that shells out to some OS command line tool. I think I have
 written it such that untrustworthy web input does not taint the command line
 tool's environment and input. I think. Everyone doing similar may wish to
 relook at it.

It is my understanding that the attack vector is cgi-bin which turns HTTP 
headers into environment variables, which are then interpreted as functions and 
executable shell code. [ which is pretty heavy/scary stuff ]

If you serve HTTP directly (Zinc/Seaside), or through a proxy (apache2 or 
nginx), no HTTP headers are turned into environment variables, so invoking a 
sub shell is safe (unless you make some other error of course). [ anyway, that 
is what I think ]

I disables all cgi[d] modules, we weren't using them anyway. [ but who knows 
what will turn up ]

 David, perhaps the code is already there, but can we run OS commands without
 invoking the shell?
 
 Pierce
 
 




Re: [Pharo-users] invoking python from pharo

2014-09-25 Thread kilon alios
Hi there, I promised to do this a long time ago, but since you asked it I
done it now.

So as Ben said I am the author of Ephestos, a communication bridge between
Blender and Pharo .

To go directly to the how to . Ephestos is basically a socket bridge that
send via sockets strings from pharo to python that then python executes as
python commands.

Ephestos is made so it works inside blender but I promised Atals a spin off
project that allows the same socket bridge to be used as a standalone. To
use do the following.

1) Get Ephestos , you can find it and install it with the configuration
browser in your image in Pharo 3 and Pharo 4. Make sure you have a recent
release though because I added it recently.

2) Get pyAtlas , this is the python side , you can get it from here --
https://github.com/kilon/pyAtlas

3)  in your command line cd to the pyAtlas directory and execute : python3
pyAtlas.py

4) in Pharo you can now try any python code you want

for example

Ephestos sendMessage: 'print(hello world)'.
Ephestos sendMessage: 'x = 3'.
x := Ephestos getValue: 'x'.
x inspect.

Ephestos sendMessage: string, basically sends the python command to be
executes while getValue: sends the command and returns a value as a string.

you can use string 'exit' to close the socket bridge but this part is buggy
as it seems to keep the binding of the sokcet active and I have to wait to
clean it up in macos to reopen the bridge.

You can also use pharo syntax and python errors will trigger the pharo
debugger with a title the python error itself.

You can find more information about Ephestos in my gitbook that can be read
here

https://www.gitbook.io/book/kilon/ephestos

Also I forgot to add that sendMessage can send multiline strings , so its
possible to send python class definitions and other stuff, you type the
string exactly as you would type python code respecting whitespaces. If you
want to execute loads of lines of python code then it would be better to
put your code in a python module and do

Ephestos sendMessage: 'import mymodule'

assuming your module is called 'mymodule' , python import basically are
executions of code.

If you have any questions just ask.

Bare in mind this is a socket bridge so its not ideal for sending thousands
of messages per second and you may run into the occasional bug or two which
I will fix if you report it. Nonetheless it should allow you to execute any
kind of code and not just call python functions or python methods.



On Thu, Sep 25, 2014 at 7:40 PM, Ben Coman b...@openinworld.com wrote:

  Pablo R. Digonzelli wrote:

  Hi all , I need to invoke python rutines from Pharo. I need some
 orientation about the best way to do it.
 TIA

   --
 *Ing. Pablo Digonzelli*
 Software Solutions
 IP-Solutiones SRL
 Metrotec SRL
 25 de Mayo 521
 Email: pdigonze...@softsargentina.com
 pdigonze...@gmail.com
 Cel: 5493815982714


 Search the [pharo-dev] list for Ephestos by kilon.
 cheers -ben



Re: [Pharo-users] invoking python from pharo

2014-09-25 Thread kilon alios
a minor correction to the previous email its

python3 pyatlas.py and not python3 pyAtlas.py

also I forgot to make clear that it works for pyhton 2.7 and python 3.

On Thu, Sep 25, 2014 at 8:11 PM, kilon alios kilon.al...@gmail.com wrote:

 Hi there, I promised to do this a long time ago, but since you asked it I
 done it now.

 So as Ben said I am the author of Ephestos, a communication bridge between
 Blender and Pharo .

 To go directly to the how to . Ephestos is basically a socket bridge that
 send via sockets strings from pharo to python that then python executes as
 python commands.

 Ephestos is made so it works inside blender but I promised Atals a spin
 off project that allows the same socket bridge to be used as a standalone.
 To use do the following.

 1) Get Ephestos , you can find it and install it with the configuration
 browser in your image in Pharo 3 and Pharo 4. Make sure you have a recent
 release though because I added it recently.

 2) Get pyAtlas , this is the python side , you can get it from here --
 https://github.com/kilon/pyAtlas

 3)  in your command line cd to the pyAtlas directory and execute : python3
 pyAtlas.py

 4) in Pharo you can now try any python code you want

 for example

 Ephestos sendMessage: 'print(hello world)'.
 Ephestos sendMessage: 'x = 3'.
 x := Ephestos getValue: 'x'.
 x inspect.

 Ephestos sendMessage: string, basically sends the python command to be
 executes while getValue: sends the command and returns a value as a string.

 you can use string 'exit' to close the socket bridge but this part is
 buggy as it seems to keep the binding of the sokcet active and I have to
 wait to clean it up in macos to reopen the bridge.

 You can also use pharo syntax and python errors will trigger the pharo
 debugger with a title the python error itself.

 You can find more information about Ephestos in my gitbook that can be
 read here

 https://www.gitbook.io/book/kilon/ephestos

 Also I forgot to add that sendMessage can send multiline strings , so its
 possible to send python class definitions and other stuff, you type the
 string exactly as you would type python code respecting whitespaces. If you
 want to execute loads of lines of python code then it would be better to
 put your code in a python module and do

 Ephestos sendMessage: 'import mymodule'

 assuming your module is called 'mymodule' , python import basically are
 executions of code.

 If you have any questions just ask.

 Bare in mind this is a socket bridge so its not ideal for sending
 thousands of messages per second and you may run into the occasional bug or
 two which I will fix if you report it. Nonetheless it should allow you to
 execute any kind of code and not just call python functions or python
 methods.



 On Thu, Sep 25, 2014 at 7:40 PM, Ben Coman b...@openinworld.com wrote:

  Pablo R. Digonzelli wrote:

  Hi all , I need to invoke python rutines from Pharo. I need some
 orientation about the best way to do it.
 TIA

   --
 *Ing. Pablo Digonzelli*
 Software Solutions
 IP-Solutiones SRL
 Metrotec SRL
 25 de Mayo 521
 Email: pdigonze...@softsargentina.com
 pdigonze...@gmail.com
 Cel: 5493815982714


 Search the [pharo-dev] list for Ephestos by kilon.
 cheers -ben





[Pharo-users] Passed by references and by value

2014-09-25 Thread nacho
Hi,
In PBE says that ordinary objects' ivars are passed by references and small
integers are passed by value.
Is there a way to know if a class is passed by reference or by value?
Only small integers are passed as value?
Thanks in advance
Nacho





-
Nacho
Smalltalker apprentice.
Buenos Aires, Argentina.
--
View this message in context: 
http://forum.world.st/Passed-by-references-and-by-value-tp4780289.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.



Re: [Pharo-users] Passed by references and by value

2014-09-25 Thread Mark Rizun
Hi,

Most classes are passed by reference including those that were defined by
user.
But classes like integer are passed by value.
I think it's similar to C#.
I may be wrong, so better wait for another more competent reply:)

Best,
Mark

2014-09-25 21:14 GMT+03:00 nacho 0800na...@gmail.com:

 Hi,
 In PBE says that ordinary objects' ivars are passed by references and small
 integers are passed by value.
 Is there a way to know if a class is passed by reference or by value?
 Only small integers are passed as value?
 Thanks in advance
 Nacho





 -
 Nacho
 Smalltalker apprentice.
 Buenos Aires, Argentina.
 --
 View this message in context:
 http://forum.world.st/Passed-by-references-and-by-value-tp4780289.html
 Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.




Re: [Pharo-users] invoking python from pharo

2014-09-25 Thread Pablo R. Digonzelli
Yes , I was aware of the excellent work of kilon. 
I was hoping that this be the way to solve my issue. 

Thanks kilon, I will follow your instructions and comment the results into the 
list. 



Ing. Pablo Digonzelli 
Software Solutions 
IP-Solutiones SRL 
Metrotec SRL 
25 de Mayo 521 
Email: pdigonze...@softsargentina.com 
pdigonze...@gmail.com 
Cel: 5493815982714 


De: kilon alios kilon.al...@gmail.com 
Para: Any question about pharo is welcome pharo-users@lists.pharo.org 
Enviados: Jueves, 25 de Septiembre 2014 14:13:34 
Asunto: Re: [Pharo-users] invoking python from pharo 

a minor correction to the previous email its 
python3 pyatlas.py and not python3 pyAtlas.py 

also I forgot to make clear that it works for pyhton 2.7 and python 3. 

On Thu, Sep 25, 2014 at 8:11 PM, kilon alios  kilon.al...@gmail.com  wrote: 



Hi there, I promised to do this a long time ago, but since you asked it I done 
it now. 
So as Ben said I am the author of Ephestos, a communication bridge between 
Blender and Pharo . 

To go directly to the how to . Ephestos is basically a socket bridge that send 
via sockets strings from pharo to python that then python executes as python 
commands. 

Ephestos is made so it works inside blender but I promised Atals a spin off 
project that allows the same socket bridge to be used as a standalone. To use 
do the following. 

1) Get Ephestos , you can find it and install it with the configuration browser 
in your image in Pharo 3 and Pharo 4. Make sure you have a recent release 
though because I added it recently. 

2) Get pyAtlas , this is the python side , you can get it from here -- 
https://github.com/kilon/pyAtlas 

3) in your command line cd to the pyAtlas directory and execute : python3 
pyAtlas.py 

4) in Pharo you can now try any python code you want 

for example 

Ephestos sendMessage: 'print(hello world)'. 
Ephestos sendMessage: 'x = 3'. 
x := Ephestos getValue: 'x'. 
x inspect. 

Ephestos sendMessage: string, basically sends the python command to be executes 
while getValue: sends the command and returns a value as a string. 

you can use string 'exit' to close the socket bridge but this part is buggy as 
it seems to keep the binding of the sokcet active and I have to wait to clean 
it up in macos to reopen the bridge. 

You can also use pharo syntax and python errors will trigger the pharo debugger 
with a title the python error itself. 

You can find more information about Ephestos in my gitbook that can be read 
here 

https://www.gitbook.io/book/kilon/ephestos 

Also I forgot to add that sendMessage can send multiline strings , so its 
possible to send python class definitions and other stuff, you type the string 
exactly as you would type python code respecting whitespaces. If you want to 
execute loads of lines of python code then it would be better to put your code 
in a python module and do 

Ephestos sendMessage: 'import mymodule' 

assuming your module is called 'mymodule' , python import basically are 
executions of code. 

If you have any questions just ask. 

Bare in mind this is a socket bridge so its not ideal for sending thousands of 
messages per second and you may run into the occasional bug or two which I will 
fix if you report it. Nonetheless it should allow you to execute any kind of 
code and not just call python functions or python methods. 



On Thu, Sep 25, 2014 at 7:40 PM, Ben Coman  b...@openinworld.com  wrote: 

BQ_BEGIN

Pablo R. Digonzelli wrote: 
BQ_BEGIN

Hi all , I need to invoke python rutines from Pharo. I need some orientation 
about the best way to do it. 
TIA 


Ing. Pablo Digonzelli 
Software Solutions 
IP-Solutiones SRL 
Metrotec SRL 
25 de Mayo 521 
Email: pdigonze...@softsargentina.com 
pdigonze...@gmail.com 
Cel: 5493815982714 



Search the [pharo-dev] list for Ephestos by kilon. 
cheers -ben 

BQ_END



BQ_END




Re: [Pharo-users] Passed by references and by value

2014-09-25 Thread Esteban A. Maringolo
2014-09-25 15:14 GMT-03:00 nacho 0800na...@gmail.com:
 Hi,
 In PBE says that ordinary objects' ivars are passed by references and small
 integers are passed by value.
 Is there a way to know if a class is passed by reference or by value?

 Only small integers are passed as value?

Yes.

It has to do with the object headers, SmallIntegers are embedded in the OH.


Esteban A. Maringolo



Re: [Pharo-users] Passed by references and by value

2014-09-25 Thread Mark Rizun

  Only small integers are passed as value?

 Yes.

 It has to do with the object headers, SmallIntegers are embedded in the OH.


What about Float, for example?


Re: [Pharo-users] Ridiculous we are

2014-09-25 Thread Alain Rastoul

Le 25/09/2014 07:23, Sven Van Caekenberghe a écrit :


On 25 Sep 2014, at 01:04, Alain Rastoul alf.mmm@gmail.com wrote:


Le 25/09/2014 00:06, Sven Van Caekenberghe a écrit :

Alain,



The character encoding situation in Pharo is pretty good actually. The only 
problem is that there is some old school code left that encodes strings into 
strings, but today you can easily write much better and conceptually correct 
code.

You could have a look at this draft chapter of the upcoming 'Enterprise Pharo' 
book that I am currently writing:

   http://stfx.eu/EnterprisePharo/Zinc-Encoding-Meta/

Concerning file system paths, FilePathEncoder and FilePluginPrimitives already 
do the right thing.

Now, your idea about using UTF-8 to represent internal Strings is something 
that has been discussed before and in many other languages as well. The short 
answer is that due to it being variable length, the inefficiency is (probably) 
just too high. Simple indexed access becomes a problem, let alone more complex 
string manipulations. I am not saying that it cannot be done, I think it is 
just not worth the trouble. The current solution in Pharo with ByteString and 
WideString is quite nice (check the chapter I mentioned before).

Sven


Very interesting !
It seems that most of what I was saying is already here :)
I was not saying that Pharo should use utf8 (I mentionned utf8 because it is a 
standard, but I find the variable length encoding very weird), I was rather 
talking of using WideString in UTF 16 or 32 and that's done.
I saw asWideString but didn't know about automatic convertion or codepoint 
selector and internal wide string support.
Does it means that Pharo Greek users (for example) use WideString for Strings 
without having to specify it or make explicit convertions (except of course 
when dealing with bytes if they want to) ?
If yes, very good, job is almost done :)
(personnally I would also deprecate ByteString, and get rid of it, just my 
opinion).
Thanks for the link, another good chapter .

Regards,

Alain


ByteString is important because it is an optimalization of the most common case.


I understand the point here, memory/data footprint, cpu cache and so on 
(not talking of encoding/decoding).
I think that's why Microsoft choosed UTF16 (old UCS2) as a middle 
solution because it covers most of character sets with 2 bytes.
May be I'm excessive but I have reasons, once had to debug a french 
program used in China by a Chinese user who was seeing weird 
characters on a (weird-to-me) chinese windows xp ... a missing 
WideString and a great moment of loneliness :)
As a normal user you should only think of abstract Strings and never use 
#asByteString (but use proper encoding).


Feedback on the chapter is always welcome.

Sven


Agree.
Your chapter is excellent, I played a bit with Zn encoders.
I look forward to Pharo for the enterprise on Lulu.

However, I'm wondering , WideString beeing a variableWordSubclass: with 
32 bits words on a 32 bits vm, what will it become on a 64 bits vm ? 32 
bits words or 64 bit words ? immediate characters  (seen on Clément 
Bera's blog about Spur and new object format) ?


Alain




Re: [Pharo-users] Machine learning in Pharo?

2014-09-25 Thread Hernán Morales Durand
In BioSmalltalk you can do something like this:

| cluster classifier trainedData observations|
 cluster := BioGroupOrganization forSimilarityOn: #value.
trainedData := { 'Polaromonas naphthalenivorans CJ2' .
'Polaromonas sp. JS666' .
'Planctomyces limnophilus DSM 3776' .
'Nautilia' .
'Lactobacillus crispatus ST1' .
'Acidithiobacillus ferrooxidans' }.
trainedData do: [ : feature | cluster addOrganization: (BioOrganization new
feature: feature) ].
classifier := BioClassifier new organization: cluster.
observations := 'Acidithiobacillus ferrooxidans ATCC 53993 chromosome,
complete genome
Lactobacillus crispatus ST1, complete genome
Nautilia profundicola AmH chromosome, complete genome
Planctomyces limnophilus DSM 3776 plasmid pPLIM01, complete sequence
Planctomyces limnophilus DSM 3776 chromosome, complete genome
Polaromonas sp. JS666 plasmid 2, complete sequence
Polaromonas sp. JS666 plasmid 1, complete sequence
Polaromonas sp. JS666, complete genome
Polaromonas naphthalenivorans CJ2, complete genome
Polaromonas naphthalenivorans CJ2 plasmid pPNAP08, complete sequence
Polaromonas naphthalenivorans CJ2 plasmid pPNAP07, complete sequence
Polaromonas naphthalenivorans CJ2 plasmid pPNAP06, complete sequence
Polaromonas naphthalenivorans CJ2 plasmid pPNAP05, complete sequence
Polaromonas naphthalenivorans CJ2 plasmid pPNAP04, complete sequence
' lines.
observations do: [ : obs | classifier classify: obs ].
classifier classesSize = 6.
classifier maxClasses = 6.
classifier maxClass feature = 'Polaromonas naphthalenivorans CJ2'.
classifier minClasses = 1.
classifier minClass feature = 'Nautilia'.

Hernán

2014-09-25 7:08 GMT-03:00 Martin Dias tinchod...@gmail.com:

 Hi all,

 I'm playing with weka [1] for classifying data using data mining/machine
 learning. I'm really new on this field so I want to give you a concrete
 example of my use case to make it clear:

 I have elements that can be classified as true or false. In a training
 phase, I set up a bayesian network with elements that I manually
 classified. Then, I can use such network for predicting the classification
 of new elements.

 --- my question is:
 Do we have a package for replacing weka-in-my-use-case in Pharo? It
 doesn't need to be exactly a bayesian network, it could be simpler.


 I looked a bit in Moose-Algos and in BioSmalltalk but I think they don't
 have what I need.

 I would appreciate any help. Cheers.
 Martín


 [1]: http://www.cs.waikato.ac.nz/ml/weka/





Re: [Pharo-users] Passed by references and by value

2014-09-25 Thread Alexandre Bergel
Floats are passed as values.
Objects that are passed as values should be immutable, as floats and integers.

Alexandre
-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.



On Sep 25, 2014, at 3:35 PM, Mark Rizun mri...@gmail.com wrote:

  Only small integers are passed as value?
 
 Yes.
 
 It has to do with the object headers, SmallIntegers are embedded in the OH.
 
 What about Float, for example? 
 



Re: [Pharo-users] invoking python from pharo

2014-09-25 Thread kilon alios
Its far from excellent. Its not as tested as I want it to be, and the code
could be much better but it works and makes interfacing with python code
very easy.

Its also an ongoing project that I will keep adding feature to , for
example I would like to extend pharo syntax to more complex stuff than
calling python methods like defining python classes etc so you wont have to
use sendMessage and getValue at all and not have to write a line of python
code. In short do all your python coding using 100% pharo syntax. But that
will take a lot of time to do because it will require a fully python syntax
parser.

I have updated the code to resolve the error when issuing a command to
close the bridge with

Ephestos sendMessage:'exit'.

This command basically terminate pyAtlas and closes it server socket.

I dont know if its Pharo or Python or Macos but it looks like it takes time
to free up the socket address so you will need 20 seconds to restart
pyAtlas again. I tried to set the timeout of the socket to 1 second but it
looks to me it still uses the default 20 seconds timeout. I guess 20 sec is
not that bad for a pre alpha software :D

But anyway that should not be a problem since you will have to rerun
pyatlas every 20 sec , which is something you would not want to do .

I was actually planning to test Ephestos with pyQT and pyCuda and make a
youtube video about it but have not found the time yet. Probably in the
weekend.

On Thu, Sep 25, 2014 at 9:23 PM, Pablo R. Digonzelli pdigonze...@gmail.com
wrote:

 Yes , I was aware of the excellent work of kilon.
 I was hoping that this be the way to solve my issue.

 Thanks kilon, I will follow your instructions and comment the results into
 the list.


 --
 *Ing. Pablo Digonzelli*
 Software Solutions
 IP-Solutiones SRL
 Metrotec SRL
 25 de Mayo 521
 Email: pdigonze...@softsargentina.com
 pdigonze...@gmail.com
 Cel: 5493815982714

 --
 *De: *kilon alios kilon.al...@gmail.com
 *Para: *Any question about pharo is welcome pharo-users@lists.pharo.org
 
 *Enviados: *Jueves, 25 de Septiembre 2014 14:13:34
 *Asunto: *Re: [Pharo-users] invoking python from pharo

 a minor correction to the previous email its
 python3 pyatlas.py and not python3 pyAtlas.py

 also I forgot to make clear that it works for pyhton 2.7 and python 3.

 On Thu, Sep 25, 2014 at 8:11 PM, kilon alios kilon.al...@gmail.com
 wrote:

 Hi there, I promised to do this a long time ago, but since you asked it I
 done it now.
 So as Ben said I am the author of Ephestos, a communication bridge
 between Blender and Pharo .

 To go directly to the how to . Ephestos is basically a socket bridge that
 send via sockets strings from pharo to python that then python executes as
 python commands.

 Ephestos is made so it works inside blender but I promised Atals a spin
 off project that allows the same socket bridge to be used as a standalone.
 To use do the following.

 1) Get Ephestos , you can find it and install it with the configuration
 browser in your image in Pharo 3 and Pharo 4. Make sure you have a recent
 release though because I added it recently.

 2) Get pyAtlas , this is the python side , you can get it from here --
 https://github.com/kilon/pyAtlas

 3)  in your command line cd to the pyAtlas directory and execute :
 python3 pyAtlas.py

 4) in Pharo you can now try any python code you want

 for example

 Ephestos sendMessage: 'print(hello world)'.
 Ephestos sendMessage: 'x = 3'.
 x := Ephestos getValue: 'x'.
 x inspect.

 Ephestos sendMessage: string, basically sends the python command to be
 executes while getValue: sends the command and returns a value as a string.

 you can use string 'exit' to close the socket bridge but this part is
 buggy as it seems to keep the binding of the sokcet active and I have to
 wait to clean it up in macos to reopen the bridge.

 You can also use pharo syntax and python errors will trigger the pharo
 debugger with a title the python error itself.

 You can find more information about Ephestos in my gitbook that can be
 read here

 https://www.gitbook.io/book/kilon/ephestos

 Also I forgot to add that sendMessage can send multiline strings , so its
 possible to send python class definitions and other stuff, you type the
 string exactly as you would type python code respecting whitespaces. If you
 want to execute loads of lines of python code then it would be better to
 put your code in a python module and do

 Ephestos sendMessage: 'import mymodule'

 assuming your module is called 'mymodule' , python import basically are
 executions of code.

 If you have any questions just ask.

 Bare in mind this is a socket bridge so its not ideal for sending
 thousands of messages per second and you may run into the occasional bug or
 two which I will fix if you report it. Nonetheless it should allow you to
 execute any kind of code and not just call python functions or python
 methods.



 On Thu, Sep 25, 2014 at 7:40 PM, Ben Coman 

Re: [Pharo-users] Passed by references and by value

2014-09-25 Thread Esteban A. Maringolo
I forgot. Floats too.

And I think that's it.



Esteban A. Maringolo


2014-09-25 15:35 GMT-03:00 Mark Rizun mri...@gmail.com:
  Only small integers are passed as value?

 Yes.

 It has to do with the object headers, SmallIntegers are embedded in the
 OH.


 What about Float, for example?




Re: [Pharo-users] Passed by references and by value

2014-09-25 Thread stepharo



Hi,
In PBE says that ordinary objects' ivars are passed by references and small
integers are passed by value.


Strange I do not remember having written that.
Especially because in Smalltalk this has no real interest.


Is there a way to know if a class is passed by reference or by value?
In Smalltalk consider that everything is an object and that you pass a 
reference to the object.

Only small integers are passed as value?
Thanks in advance
Nacho





-
Nacho
Smalltalker apprentice.
Buenos Aires, Argentina.
--
View this message in context: 
http://forum.world.st/Passed-by-references-and-by-value-tp4780289.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.







Re: [Pharo-users] BLOG: Block Translators - parsing magic

2014-09-25 Thread stepharo

Hi udo

I agree with sven :)

We could easily turn your blog into a chapter for a future book :)
I have the impression that the blog is how to avoid parsing and still 
get translation done!


Stef

Hi Sven,

thanks for the feedback.

 Keep that kind of stuff coming, it is very helpful.
I'll try to. It just always takes so long to write stuff. But I think 
you know that, don't you? :-)


CU,

Udo

On 23.09.14 16:00, Sven Van Caekenberghe wrote:

Hi Udo,

This is really an excellent article: I enjoyed reading it a lot.

It is well written, has lots of relevant code examples and a nice 
pace, but above all it is really interesting.


Thanks a lot.

Keep that kind of stuff coming, it is very helpful.

Sven

On 23 Sep 2014, at 01:48, Udo Schneider 
udo.schnei...@homeaddress.de wrote:



All,

I just finished a blog entry. It shows how to use Smalltalk blocks 
as parsers/translators. E.g. translating a Block


[:customer | (customer joinDate year is: Date today year)]

into an SQL-like String

(YEAR(customers.joinDate) = 2014)

The SQL stuff is just an example - you can create nearly any output.

Check out 
http://readthesourceluke.blogspot.de/2014/09/block-translators-parsing-magic.html


Maybe that's old stuff for some of you - but I hope it's interesting 
for some at least :-)


Comments and feedback appreciated.

CU,

Udo
















Re: [Pharo-users] BLOG: Block Translators - parsing magic

2014-09-25 Thread stepharo



Yes I do, but you also know (it was clear from the article) that you learn a 
lot yourself from writing something for public consumption. Most people 
underestimate how powerful that is.


:)

In fact I only write for that: to force myself to deeply understand 
something and be able to forget it :)


Stef



Re: [Pharo-users] invoking python from pharo

2014-09-25 Thread Pablo R. Digonzelli
Excellent, I will waiting ... 



Ing. Pablo Digonzelli 
Software Solutions 
IP-Solutiones SRL 
Metrotec SRL 
25 de Mayo 521 
Email: pdigonze...@softsargentina.com 
pdigonze...@gmail.com 
Cel: 5493815982714 


De: kilon alios kilon.al...@gmail.com 
Para: Any question about pharo is welcome pharo-users@lists.pharo.org 
Enviados: Jueves, 25 de Septiembre 2014 16:01:08 
Asunto: Re: [Pharo-users] invoking python from pharo 

Its far from excellent. Its not as tested as I want it to be, and the code 
could be much better but it works and makes interfacing with python code very 
easy. 
Its also an ongoing project that I will keep adding feature to , for example I 
would like to extend pharo syntax to more complex stuff than calling python 
methods like defining python classes etc so you wont have to use sendMessage 
and getValue at all and not have to write a line of python code. In short do 
all your python coding using 100% pharo syntax. But that will take a lot of 
time to do because it will require a fully python syntax parser. 
I have updated the code to resolve the error when issuing a command to close 
the bridge with 

Ephestos sendMessage:'exit'. 

This command basically terminate pyAtlas and closes it server socket. 

I dont know if its Pharo or Python or Macos but it looks like it takes time to 
free up the socket address so you will need 20 seconds to restart pyAtlas 
again. I tried to set the timeout of the socket to 1 second but it looks to me 
it still uses the default 20 seconds timeout. I guess 20 sec is not that bad 
for a pre alpha software :D 

But anyway that should not be a problem since you will have to rerun pyatlas 
every 20 sec , which is something you would not want to do . 

I was actually planning to test Ephestos with pyQT and pyCuda and make a 
youtube video about it but have not found the time yet. Probably in the 
weekend. 

On Thu, Sep 25, 2014 at 9:23 PM, Pablo R. Digonzelli  pdigonze...@gmail.com  
wrote: 



Yes , I was aware of the excellent work of kilon. 
I was hoping that this be the way to solve my issue. 

Thanks kilon, I will follow your instructions and comment the results into the 
list. 



Ing. Pablo Digonzelli 
Software Solutions 
IP-Solutiones SRL 
Metrotec SRL 
25 de Mayo 521 
Email: pdigonze...@softsargentina.com 
pdigonze...@gmail.com 
Cel: 5493815982714 


De: kilon alios  kilon.al...@gmail.com  
Para: Any question about pharo is welcome  pharo-users@lists.pharo.org  
Enviados: Jueves, 25 de Septiembre 2014 14:13:34 
Asunto: Re: [Pharo-users] invoking python from pharo 

a minor correction to the previous email its 
python3 pyatlas.py and not python3 pyAtlas.py 

also I forgot to make clear that it works for pyhton 2.7 and python 3. 

On Thu, Sep 25, 2014 at 8:11 PM, kilon alios  kilon.al...@gmail.com  wrote: 

BQ_BEGIN

Hi there, I promised to do this a long time ago, but since you asked it I done 
it now. 
So as Ben said I am the author of Ephestos, a communication bridge between 
Blender and Pharo . 

To go directly to the how to . Ephestos is basically a socket bridge that send 
via sockets strings from pharo to python that then python executes as python 
commands. 

Ephestos is made so it works inside blender but I promised Atals a spin off 
project that allows the same socket bridge to be used as a standalone. To use 
do the following. 

1) Get Ephestos , you can find it and install it with the configuration browser 
in your image in Pharo 3 and Pharo 4. Make sure you have a recent release 
though because I added it recently. 

2) Get pyAtlas , this is the python side , you can get it from here -- 
https://github.com/kilon/pyAtlas 

3) in your command line cd to the pyAtlas directory and execute : python3 
pyAtlas.py 

4) in Pharo you can now try any python code you want 

for example 

Ephestos sendMessage: 'print(hello world)'. 
Ephestos sendMessage: 'x = 3'. 
x := Ephestos getValue: 'x'. 
x inspect. 

Ephestos sendMessage: string, basically sends the python command to be executes 
while getValue: sends the command and returns a value as a string. 

you can use string 'exit' to close the socket bridge but this part is buggy as 
it seems to keep the binding of the sokcet active and I have to wait to clean 
it up in macos to reopen the bridge. 

You can also use pharo syntax and python errors will trigger the pharo debugger 
with a title the python error itself. 

You can find more information about Ephestos in my gitbook that can be read 
here 

https://www.gitbook.io/book/kilon/ephestos 

Also I forgot to add that sendMessage can send multiline strings , so its 
possible to send python class definitions and other stuff, you type the string 
exactly as you would type python code respecting whitespaces. If you want to 
execute loads of lines of python code then it would be better to put your code 
in a python module and do 

Ephestos sendMessage: 'import mymodule' 

assuming your module is called 'mymodule' , python import basically are 
executions of 

Re: [Pharo-users] BLOG: Block Translators - parsing magic

2014-09-25 Thread Udo Schneider

Hi Stef,

 We could easily turn your blog into a chapter for a future book :)
Wow! I didn't really expect that! But I'd happy to help any way I can. 
Maybe by adding some bits an pieces how to parse blocks with multiple 
expressions?
I have that working for a project I'm working on - but it isn't nice 
enough for an article (yet).


 I have the impression that the blog is how to avoid parsing and still
 get translation done!
Let me put it that way: I love using PetitParser - but sometimes parsing 
an expression compared to full code is more than enough.


It also has the benefit of blending nicely with regular Smalltalk tools 
(code, not Strings!) w/o hooking into the compiler - which makes it more 
portable by default.


So you're right - it provides a kind of AST which allows you to reason 
about some Smalltalk expression w/o relying on a full parser. I'll use 
it for translating only though...


The limitations of this approach are clear - but if you need more than 
the tools you'll need are clear and known as well.


CU,

Udo



On 25.09.14 22:06, stepharo wrote:

Hi udo

I agree with sven :)

We could easily turn your blog into a chapter for a future book :)
I have the impression that the blog is how to avoid parsing and still
get translation done!

Stef

Hi Sven,

thanks for the feedback.

 Keep that kind of stuff coming, it is very helpful.
I'll try to. It just always takes so long to write stuff. But I think
you know that, don't you? :-)

CU,

Udo

On 23.09.14 16:00, Sven Van Caekenberghe wrote:

Hi Udo,

This is really an excellent article: I enjoyed reading it a lot.

It is well written, has lots of relevant code examples and a nice
pace, but above all it is really interesting.

Thanks a lot.

Keep that kind of stuff coming, it is very helpful.

Sven

On 23 Sep 2014, at 01:48, Udo Schneider
udo.schnei...@homeaddress.de wrote:


All,

I just finished a blog entry. It shows how to use Smalltalk blocks
as parsers/translators. E.g. translating a Block

[:customer | (customer joinDate year is: Date today year)]

into an SQL-like String

(YEAR(customers.joinDate) = 2014)

The SQL stuff is just an example - you can create nearly any output.

Check out
http://readthesourceluke.blogspot.de/2014/09/block-translators-parsing-magic.html


Maybe that's old stuff for some of you - but I hope it's interesting
for some at least :-)

Comments and feedback appreciated.

CU,

Udo





















Re: [Pharo-users] Loading PetitParser loads a hell of a lot of things... is there a terser version?

2014-09-25 Thread Sean P. DeNigris
Tudor Girba-2 wrote
 If you can live without the UI, you
 can load the 'Core' group from the configuration.

+1. That's what I usually do.



-
Cheers,
Sean
--
View this message in context: 
http://forum.world.st/Loading-PetitParser-loads-a-hell-of-a-lot-of-things-is-there-a-terser-version-tp4780159p4780340.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.



[Pharo-users] Your picture on Pharo contributors :)

2014-09-25 Thread stepharo

Hi guys

do not forget to sign the license agreement
http://files.pharo.org/media/PharoSoftwareDistributionAgreement.pdf
and send us your picture to be added to
http://pharo.org/about

Stef





Re: [Pharo-users] Your picture on Pharo contributors :)

2014-09-25 Thread Sven Van Caekenberghe

On 26 Sep 2014, at 07:25, stepharo steph...@free.fr wrote:

 Hi guys
 
 do not forget to sign the license agreement
 http://files.pharo.org/media/PharoSoftwareDistributionAgreement.pdf
 and send us your picture to be added to
http://pharo.org/about
 
 Stef

The picture should be a 70x70 PNG.