Re: [Pharo-users] Parsing SQL in a Pharo system

2014-10-03 Thread Pierce Ng
On Thu, Oct 02, 2014 at 03:43:05PM -0300, Esteban A. Maringolo wrote:
 Is the V2/V3 spec a PostgreSQL protocol spec or something made up in
 the Squeak community?

V2/V3 are PostgreSQL wire protocol versions. V3 supports parameter binding
and bulk copying, whereas V2 does not. 

There is some additional info at this squeak-dev thread:

  http://forum.world.st/Status-of-PostgresV3-td4780110.html

Looking at the updated packages, there seems to be support in PostgresV3 (here
meaning the Smalltalk software) for parameter binding at the protocol level,
but the API does not provide any facility to use it.

Pierce



Re: [Pharo-users] Parsing SQL in a Pharo system

2014-10-03 Thread Stephan Eggermont
PostgresV3-Core/Pool looks perfectly usable. 

There is 
PG3Connectionmd5HashMessage: aString

^Smalltalk globals
at: #MD5
ifPresent: [ :md5 | (md5 hashMessage: aString) hex asLowercase ]
ifAbsent: [ WebUtils md5Digest: aString ]

Which works in Pharo 4, though WebUtils doesn't exist anymore.
Replacing it is trivial

md5HashMessage: aString

^Smalltalk globals
at: #MD5
ifPresent: [ :md5 | (md5 hashMessage: aString) hex asLowercase ]
ifAbsent: [ (Smalltalk globals at: #WebUtils) md5Digest: 
aString ] 

Stephan



Re: [Pharo-users] Parsing SQL in a Pharo system

2014-10-03 Thread Esteban A. Maringolo
2014-10-02 17:26 GMT-03:00 Sven Van Caekenberghe s...@stfx.eu:
 Esteban,

 On 02 Oct 2014, at 20:43, Esteban A. Maringolo emaring...@gmail.com wrote:

 2014-10-02 15:19 GMT-03:00 Stephan Eggermont step...@stack.nl:
 Esteban wrote:
 Are you using/planning to use PostgresV3?

 What are its advantages over current driver (PostgresV2)?

 I was puzzled that a smart developer like Levente
 decides not to use Glorp.

 I don't want to sound harsh, but there is no VISIBLE interest from the
 Pharo board/committee regarding ORM and/or RDBMS support other than a
 CI task. Few days ago I asked a question in the Pharo-Business
 regarding this, and got NO REPLY.

 This week I was looking into Python's SQLAlchemy [1] to find how close
 it is to GLORP current features, and also found out how far it
 seems/feels to a small
 community like ours. Not to mention things like jOOQ[2] ([1] provides
 some of its features though).

 I'm making no demands here, just giving my opinion about a business
 feature (DBs) that I'd like better supported.

 I understand your pain, you're looking for people that are in the same boat, 
 apparently there aren't that many. But there certainly are some (I use(d) 
 Glorp+PostgresV2 myself, I believe Mariano does too), but it seems nobody 
 wants to take the lead to push this (even) further. I am not sure this is 
 necessarily bad, RDBMS does not move that much, but it would obviously be 
 better to have more users.

 We are a small(er) community, it is what it is, but we are growing.

The quid here is who takes the lead, I said I could contribute and
code, but taking the lead on a project requires more than coding
skills.

The point that RDBMS is a stable thing a benefit in this case, and
that's why those who use GLORP today (like me), only got
bitten by a few bugs due to an outdated port.
And as long as we use PostgreSQL we'll be in the safer zone.

 Is the V2/V3 spec a PostgreSQL protocol spec or something made up in
 the Squeak community?
 I know something changed in PgSQL protocols around version 7.2.

 V2 and V3 are indeed two different wire level protocols for a DB client to 
 talk to PostgreSQL. Obviously, V3 came after V2, it should be considered an 
 improvement, but V2 remains supported. As far as I understood it, V3 is 
 binary while V2 is text oriented, the former should be faster. I am sure 
 there are feature lists comparing the two somewhere out there.
 Of course, the implementation quality of the driver is important too to get 
 good performance.

I haven't reached any limits of the V2 driver yet. If I have a
bottleneck it is down the DB or at the app level.

Thank you!



Re: [Pharo-users] Parsing SQL in a Pharo system

2014-10-03 Thread Stephan Eggermont
PostgresV3-CodeMirror is very interesting.
7 classes and less than 1K lines of code. 

In the base class PG3SchemaMirror, the
compilerClass, parserClass, sourceCodeTemplate
and shoutParserClass are overridden to return
PG3-specific classes. That allows simple
integration with other languages, in this case
plsql.

In Pharo we don't have shoutParserClass 
defined on Behavior. Where do I set
what highlighter is to be used for a method?

Stephan



Re: [Pharo-users] Versioneer. nice. mmMmmm...

2014-10-03 Thread Christophe Demarey
Hi Kilon,

Le 30 sept. 2014 à 15:53, kilon alios a écrit :

 Actually the best thing to do when you 2 choices is to pick the third one. In 
 this case its what I call double mode , you see it quite frequently with 
 software synthesizer, as you can imagine a synthesizer is a complex 
 electronic music instrument that can reach up to thousand of parameters 
 easily so what designers have done is to create an easy mode and an advanced 
 mode. In easy mode is for those that want to create sounds on the go, usually 
 that means around 10-30 parameters buttons and advanced mode is divided into 
 panels that can expanded collapse to control the complexity of the GUI that 
 may contain even thousands of parameters. 
 
 GUI design is a science and an art but yes you can have your cake and eat it 
 too. 
 
 I think with Versioner we can keep it small for now and then if it get a bit 
 more complex go for a double mode. 
 
 About collaboration  if you are familiar with git and github then nothing can 
 beat this workflow . You create a repo in gihub, I fork it, and I then send 
 pull requests to you, pull requests do not affect your code and you can 
 choose what to merge and not to merge giving you complete control and me the 
 safety that I wont brake anything. You can also comment the code directly 
 using github web interface and of course the issue tracker for any issue that 
 may be reported. If you are not familiar with git  or dont want to us it , I 
 have no issues committing to smalltalkhub , I will create a mirror repo in 
 github anyway for my work since this is how I work when it comes to my Pharo 
 projects.  
 
 The choice is your, I will now start studying the code and see what I can 
 bring to it. 

Sorry for the delay. I was about to move Versionner to git but finally, I 
prefer to wait a bit before switching.
I cleaned up Versionner repository, i.e. give right package names so that we 
can easily catch branches.
I think it will be the best way to collaborate for now: commit in a branch in 
the current repository on SmalltalkHub. Please, create a new branch for your 
contributions, and ping me if you have something to show or if you need help.

Best regards,
Christophe.

smime.p7s
Description: S/MIME cryptographic signature


[Pharo-users] Official academic consortium members

2014-10-03 Thread stepharo

Hi guys

we are really happy to welcome

University of Bern
Uqbar
Reveal from Lugano

as official academic member of the pharo consortium.
I know that some other entities are following the same path and this is 
really great.


Stef



[Pharo-users] How to create a package via code correctly ?

2014-10-03 Thread itli...@schrievkrom.de
How can I create a package correctly via code ?

I tried stuff like

PackageOrganizer default registerPackageNamed: 'Keks4'

SystemOrganization addCategory: 'Keks4'

but the package does not appear in the browser.


Marten


-- 
Marten Feldtmann



Re: [Pharo-users] invoking python from pharo

2014-10-03 Thread Hernán Morales Durand
I would use only the Python bridge but not the Blender features (Cube,
etc). Will be the Python bridge and parser contained in its own package?

I have started from MinGW and evaluated

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

$ python pyAtlas.py
creating thread
calling create_socket_connection
hello world
('pherror : ', ['', 'no error\n'])
I have sent err : ---no error
  and removed it from the list of errors
('pherror : ', ['', 'no error\n'])
I have sent err : ---no error
  and removed it from the list of errors
('eval with pherror: ', ['', 'RetValue:3'])
('pherror : ', ['', 'RetValue:3'])
I have sent err : ---RetValue:3  and removed it from the list of
errors

Is this expected?

I don't know if there are other reasons but you could download the raw .py
file from https://raw.githubusercontent.com/kilon/pyAtlas/master/pyatlas.py
using Metacello Configuration and start the script using OSProcess or
ProcessWrapper. This is how I do it for BioSmalltalk:

...
spec for: #'common' do: [
spec blessing: #'baseline'.
spec preLoadDoIt: #preLoad.

preLoad
| urlIndex |
urlIndex := 1.
[ self downloadFiles: urlIndex ]
on: ZdcPluginMissing
do: [ : ex |
urlIndex := urlIndex + 1.
ex retry ].

downloadFiles: urlIndex
| url response |
url := (self platformFilesUrl at: urlIndex) asZnUrl.
fileRef := FileSystem disk workingDirectory / url pathSegments last.
(response := ZnEasy get: url) isSuccess
ifTrue: [ fileRef writeStreamDo: [ : stream | stream nextPutAll:
response contents ] ]
ifFalse: [ self error: 'Cannot download files' ]

platformFilesUrl
 Answer a Collection of download URLs for the current platform 

^ Smalltalk os isWin32
ifTrue: [ #('http://...zip'
'http://...zip') ]
ifFalse: [ #('http://tar.gz'
'http://tar.gz') ].

Cheers,

Hernán



2014-09-25 14:11 GMT-03:00 kilon alios kilon.al...@gmail.com:

 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


 

[Pharo-users] Spur images

2014-10-03 Thread Benjamin Pollack
My apologies if this is already spelled out somewhere and I simply can't
find it, but are there any Spur images for Pharo yet?  I can only find
Squeak ones.  It's not a big deal either way; I was just playing with an
algorithm that, after very heavy optimization, I was able to get down to
about 278ms per pass (from ~700ms initially from a naive
implementation).  For contrast, the equivalent Python runs in ~80ms. 
Looking at MessageTally, it seems at least half of that 278ms is spent
noodling around in WideStrings and other small things that the Spur
object format ought to help with, so it'd be interesting to see how much
of a speed boost that gives without any further work.



Re: [Pharo-users] Spur images

2014-10-03 Thread stepharo
Pharo has a new classbuilder with first class instance variables so the 
bootstrap took longer and
doing so esteban and guille found bugs in Spur. So regularly but hidden 
from the fame, esteban goes over it.

and we hope soon to have some images to beta testers.

My apologies if this is already spelled out somewhere and I simply can't
find it, but are there any Spur images for Pharo yet?  I can only find
Squeak ones.  It's not a big deal either way; I was just playing with an
algorithm that, after very heavy optimization, I was able to get down to
about 278ms per pass (from ~700ms initially from a naive
implementation).  For contrast, the equivalent Python runs in ~80ms.
Looking at MessageTally, it seems at least half of that 278ms is spent
noodling around in WideStrings and other small things that the Spur
object format ought to help with, so it'd be interesting to see how much
of a speed boost that gives without any further work.

tell us more about your algo because we want to know.





Re: [Pharo-users] Pharo days: date proposal

2014-10-03 Thread stepharo
thanks so we will communicate and set up all the boring ticketing and 
web page I guess



On 2/10/14 18:30, Stephan Eggermont wrote:

That combines well with FOSDEM, which is the next two days in Bruxelles.
Yesterday I got a mail that we'll be having a smalltalk room on Sunday.

Stephan







Re: [Pharo-users] [ANN] JSON datatype support in PostgresV2 package

2014-10-03 Thread stepharo


On 30/9/14 21:02, Esteban A. Maringolo wrote:

As a side note to this discussion:

Postgres Outperforms MongoDB and Ushers in New Developer Reality
http://blogs.enterprisedb.com/2014/09/24/postgres-outperforms-mongodb-and-ushers-in-new-developer-reality/

Maybe there could be a VoyagePostgresql alternative for anyone insterested ;-)


I would love now Voyage looks more for noSQL.
Did you check ROE for RDB? Avi used it as a way to compose queries.

Stef



Regards!

Esteban A. Maringolo


2014-09-05 10:23 GMT-03:00 Esteban A. Maringolo emaring...@gmail.com:

2014-09-05 4:18 GMT-03:00 Sven Van Caekenberghe s...@stfx.eu:

On 04 Sep 2014, at 21:43, Esteban A. Maringolo emaring...@gmail.com wrote:


Even though I don't use PharoExtras/JSON for my daily JSON
manipulation (I use Seaside-JSON and NeoJSON), I found it to be the
most modular/independent JSON package out there.

I don't see how the JSON and NeoJSON package differ in that respect. NeoJSON 
has no dependencies. Could you explain this point ?

My Bad, I didn't mean exactly that.
When I wrote the above paragraph I thought NeoJSON required the
specification of a schema and couldn't simply convert JSON strings to
Dictionaries.

The only thing I like about PharoExtras/JSON is the fact JsonObject
allows its direct manipulation without having to use dictionary
accessors, but still allowing for it (because JsonObject IS a
Dictionary).

We can perfectly replace it by NeoJSON. Mine was a proof of concept,
which once I debugged through a lot types of PGPacket ended up being
simpler than thought. Supporting parametrized statements with JSON is
something I would like to check (I guess it is only text). Adding
support to jsonb type is linear too on the client side, just replicate
what I did for json.



I did a quick benchmark comparing JSON parsers and NeoJSON gets
slightly faster as the stream gets larger. I didn't profile them
memorywise.

31bytes JSON:
NeoJSON: 73,600 per second.
JSON: 42,700 per second.
WAJsonParser: 79,400 per second.

309bytes JSON:
NeoJSON: 14,200 per second.
JSON: 12,400 per second.
WAJsonParser: 13,900 per second.

17215bytes JSON:
NeoJSON: 277 per second.
JSON: 194 per second.
WAJsonParser: 255 per second.

https://gist.github.com/eMaringolo/5e7c865188036faa7202#file-json-bench








Re: [Pharo-users] Parsing SQL in a Pharo system

2014-10-03 Thread stepharo


On 3/10/14 14:32, Stephan Eggermont wrote:

PostgresV3-Core/Pool looks perfectly usable.

There is
PG3Connectionmd5HashMessage: aString

^Smalltalk globals
at: #MD5
ifPresent: [ :md5 | (md5 hashMessage: aString) hex asLowercase ]
ifAbsent: [ WebUtils md5Digest: aString ]

Which works in Pharo 4, though WebUtils doesn't exist anymore.
Replacing it is trivial

md5HashMessage: aString

^Smalltalk globals
at: #MD5
ifPresent: [ :md5 | (md5 hashMessage: aString) hex asLowercase ]
ifAbsent: [ (Smalltalk globals at: #WebUtils) md5Digest: 
aString ]


What was webUtils?
Because I would raise an error instead.



Re: [Pharo-users] Parsing SQL in a Pharo system

2014-10-03 Thread stepharo

Thanks for the information.
May be Olivier could help us there.


On 3/10/14 12:59, Pierce Ng wrote:

On Thu, Oct 02, 2014 at 03:43:05PM -0300, Esteban A. Maringolo wrote:

Is the V2/V3 spec a PostgreSQL protocol spec or something made up in
the Squeak community?

V2/V3 are PostgreSQL wire protocol versions. V3 supports parameter binding
and bulk copying, whereas V2 does not.

There is some additional info at this squeak-dev thread:

   http://forum.world.st/Status-of-PostgresV3-td4780110.html

Looking at the updated packages, there seems to be support in PostgresV3 (here
meaning the Smalltalk software) for parameter binding at the protocol level,
but the API does not provide any facility to use it.

Pierce







Re: [Pharo-users] Parsing SQL in a Pharo system

2014-10-03 Thread stepharo



Do you really mean that the board is a kind of jerks and idiots that are
lazy bastards?

Please slow down, I never, ever, suggested even remotely that.


I know but do not say that the board is not interested. We just issue 
today a roadmap to inria and database is one of the items.



If people that have interest in ORM do not help us how can make progress.
When did you send a fix to Pharo? Remember Pharo is Yours.

I use it daily for my business, which on some aspects of its
technology stack like DB feels more like a bet than a safe decision.


???


I submitted a few commits to GLORP and PostgresV2 packages, does that count?


Yes it does. This is important.

Esteban is working like a mad on making sure that Spur is coming to us.
May be we can say to esteban to stop Spur and 64 bits after and some
VM bug fix and support for integrating better and 
to focus on Glorp and DBTalk.

I know, and I understand the priorities given the limited manpower.
That's why I mentioned I was making no demands, I was simply giving my opinion.


Ok


Sept 30, subject Better ORM tools/alternatives


I will check. Too busy with something else.



I'm making no demands here, just giving my opinion about a business
feature (DBs) that I'd like better supported.

This is on our roadmap.

Not in https://github.com/pharo-project/pharo-workingRoadmaps.

No these ones are just random notes about what we should not forget.
Like cleaning the huge mess in Fonts that produced mess in Roassal and 
Moose.





May pythoners are cooler than Pharoers when it comes to helping write code
and documentation?

I have no idea, I don't participate in any Python community.

But please consider that accusing me (or anybody) of treating you as
jerks or suggesting that if I don't send fixes I shouldn't emit
opinions is totally discouraging.


OK I was in attacking mode.


I know you're passionate and you livelove Pharo, and hence you speak
that way, and I can understand that, but even if I understand who, how
and why you're saying something it somehow hurts the feeling of
belonging to the community (to which I feel part of).


Ok I will be nicer in the future.
But my point is that the best way to help you is to start on what is 
important for you and try to make it work better.
We can offer jenkins servers, disc space and some help but we cannot do 
everything.


Stef




Re: [Pharo-users] [ANN] JSON datatype support in PostgresV2 package

2014-10-03 Thread Esteban A. Maringolo
2014-10-03 17:22 GMT-03:00 stepharo steph...@free.fr:

 On 30/9/14 21:02, Esteban A. Maringolo wrote:

 As a side note to this discussion:

 Postgres Outperforms MongoDB and Ushers in New Developer Reality

 http://blogs.enterprisedb.com/2014/09/24/postgres-outperforms-mongodb-and-ushers-in-new-developer-reality/

 Maybe there could be a VoyagePostgresql alternative for anyone insterested
 ;-)

 I would love now Voyage looks more for noSQL.

IMHO NoSQL hype has already peaked, now it is settling at a more
reasonable usage: a) document oriented, b) schemaless data, c) easy
horizontal scaling. With PgSQL JSON you can achieve a) and b) pretty
easily, having a single server if you already have data in it :)

 Did you check ROE for RDB? Avi used it as a way to compose queries.

It is the first time I hear about it. It isn't listed in SmalltalkHub.


Regards!


Esteban A. Maringolo



Re: [Pharo-users] Glorp + NBSQLite3

2014-10-03 Thread stepharo


On 24/9/14 18:17, Pierce Ng wrote:

Hello,

I am pleased to report that I have gotten Glorp working with NBSQLite3
enough to run Sven's Reddit.st.


Cool what is NBSQLite3 (a nativeboost version)? Nice. Would be nice once 
you API stabilize that

we get a chapter or on NBSQLite3 :)


As mentioned in my blog post, there is more work to be done to get
Glorp fully integrated with NBSQLite3, but preliminary results are
encouraging.

   http://www.samadhiweb.com/blog/2014.09.24.glorp.nbsqlite3.html

Pierce








Re: [Pharo-users] Pharo Glorp 1.7 - VisualWorks

2014-10-03 Thread stepharo



Unfortunately, we don't have the manpower to maintain such
a beast, are there many people using glorp in production? With PostgresV2?

I am making a living out of two projects using GLORP+PostgresV2 since
almost a year. So me, and my company, depends on it.

I'd join an community driven ORM Task Force for Pharo. IMHO merging
VW's and Pharo's version won't be an easy quest.
While debugging GLORP I learnt a few things about its internals, and I
think other users share the same learning process.
So I am willing to spend some time on this. :)


At annecy 2013 I asked nail ross to organize a glorp tutorial and I 
gathered some
text. what would be good is to have some chapters on Glorp (to 
complement the reddit.st chapter of sven.

Getting a nice doc is a way to get more people and more interest.

I can look for the files I have around. I cannot work on something I 
never used.





Re: [Pharo-users] invoking python from pharo

2014-10-03 Thread kilon alios
Everything you done is correct.

all this information you see in your terminal is debugging of error
reporting. Python errors are send back to Pharo and trigger pharo debugger.
So yes everything you see is to be expected. I use it to check that
everything goes as planned with python execution.

if you want to disable it just do the following

Ephestos sendMessage: 'alogging = False'.

It will stop typing / logging all this info and instead print what you want
to print. Your can turn it back to true of course

pyAtlas runs the python side as standalone so there is no need to use
Blender , pyAtlas works both with py 2.7 and python 3

thanks for the information on how to download the py on the go. I will
definetly integrate it.



On Fri, Oct 3, 2014 at 10:40 PM, Hernán Morales Durand 
hernan.mora...@gmail.com wrote:

 I would use only the Python bridge but not the Blender features (Cube,
 etc). Will be the Python bridge and parser contained in its own package?

 I have started from MinGW and evaluated

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

 $ python pyAtlas.py
 creating thread
 calling create_socket_connection
 hello world
 ('pherror : ', ['', 'no error\n'])
 I have sent err : ---no error
   and removed it from the list of errors
 ('pherror : ', ['', 'no error\n'])
 I have sent err : ---no error
   and removed it from the list of errors
 ('eval with pherror: ', ['', 'RetValue:3'])
 ('pherror : ', ['', 'RetValue:3'])
 I have sent err : ---RetValue:3  and removed it from the list of
 errors

 Is this expected?

 I don't know if there are other reasons but you could download the raw .py
 file from
 https://raw.githubusercontent.com/kilon/pyAtlas/master/pyatlas.py using
 Metacello Configuration and start the script using OSProcess or
 ProcessWrapper. This is how I do it for BioSmalltalk:

 ...
 spec for: #'common' do: [
 spec blessing: #'baseline'.
 spec preLoadDoIt: #preLoad.

 preLoad
 | urlIndex |
 urlIndex := 1.
 [ self downloadFiles: urlIndex ]
 on: ZdcPluginMissing
 do: [ : ex |
 urlIndex := urlIndex + 1.
 ex retry ].

 downloadFiles: urlIndex
 | url response |
 url := (self platformFilesUrl at: urlIndex) asZnUrl.
 fileRef := FileSystem disk workingDirectory / url pathSegments
 last.
 (response := ZnEasy get: url) isSuccess
 ifTrue: [ fileRef writeStreamDo: [ : stream | stream nextPutAll:
 response contents ] ]
 ifFalse: [ self error: 'Cannot download files' ]

 platformFilesUrl
  Answer a Collection of download URLs for the current platform 

 ^ Smalltalk os isWin32
 ifTrue: [ #('http://...zip'
 'http://...zip') ]
 ifFalse: [ #('http://tar.gz'
 'http://tar.gz') ].

 Cheers,

 Hernán



 2014-09-25 14:11 GMT-03:00 kilon alios kilon.al...@gmail.com:

 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: 

Re: [Pharo-users] Pharo Glorp 1.7 - VisualWorks

2014-10-03 Thread stepharo



Many of them are here, AFAIR they were Lorenzano, Polito, Peck.


Paid by ESUG because we already wre convinced that databse support is 
important.


Even with its outdated condition, ORM hasn't changed much in the past
years, so current GLORP fits most of the needs, it's proven, it's
tested and it's reliable.



Where is the best place to ask about Glorp by the way?

I wonder the same.

The official discussion group is
https://groups.google.com/forum/#!forum/glorp-group
But it is not very active.

So IMHO, for Pharo use this is the best place, and for VisualWorks its
own mailing list.


Regards!



Esteban.







Re: [Pharo-users] Spur images

2014-10-03 Thread Esteban Lorenzano
as Stef says, we are close, but not there yet. 
I’m working on it and I hope to have something really soon. 

Esteban

 On 03 Oct 2014, at 22:13, stepharo steph...@free.fr wrote:
 
 Pharo has a new classbuilder with first class instance variables so the 
 bootstrap took longer and
 doing so esteban and guille found bugs in Spur. So regularly but hidden from 
 the fame, esteban goes over it.
 and we hope soon to have some images to beta testers.
 My apologies if this is already spelled out somewhere and I simply can't
 find it, but are there any Spur images for Pharo yet?  I can only find
 Squeak ones.  It's not a big deal either way; I was just playing with an
 algorithm that, after very heavy optimization, I was able to get down to
 about 278ms per pass (from ~700ms initially from a naive
 implementation).  For contrast, the equivalent Python runs in ~80ms.
 Looking at MessageTally, it seems at least half of that 278ms is spent
 noodling around in WideStrings and other small things that the Spur
 object format ought to help with, so it'd be interesting to see how much
 of a speed boost that gives without any further work.
 tell us more about your algo because we want to know.
 
 
 




[Pharo-users] NeoCSVReader skipEmptyLines?

2014-10-03 Thread Esteban A. Maringolo
Sven,

Is it possible to skip blank/empty lines in NeoCSVReader?

So if a line is empty or contains  it would be skipped from
the iteration.

Does it already provider such feature? (I couldn't find any setting
related with this).

Esteban A. Maringolo



Re: [Pharo-users] Glorp + NBSQLite3

2014-10-03 Thread Sanjay-M
There is a discussion on developing client/server in Dolphin Smalltalk's
online documentation
http://www.object-arts.com/downloads/docs/index.html - Appendix B -
Application Patterns - New Application #consequences.

I was wondering if this approach could be adopted in developing a
Client/Server application with a separate server component accessing the
SQLite database (on a separate machine).

If a template / model can be developed i am sure this can be very useful in
creating larger multi-user applications even at the cost of some duplication
/ redundant effort.

Regards
Sanjay



-
---
Regards, Sanjay
--
View this message in context: 
http://forum.world.st/Glorp-NBSQLite3-tp4779996p4782468.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.