[Pharo-users] Removing contents-changed marker from Rubric on save

2018-01-04 Thread Evan Donahue
Currently, if you add a "composite text" view using gtInspector, the editor
lets you use ctrl+s to save changes to the local inspector.

However, if you intercept ctrl+s to implement an actual save function, as
FileReference does, the text editor no longer knows to remove the
contents-changed indicator. You can see this in the current FileReference
inspector:

f := FileSystem disk / 'tmp' / 'filerefinspectortest.txt'.
f writeStreamDo: [ :s | s nextPutAll: 'test data' ].
f inspect. "Change the data and hit ctrl+s. The contents-changed indicator
is still there."
f inspect. "If you inspect again, you will see that the contents have
indeed been saved to disk."

How would I change code like the FileReference >> gtInspectorContentsIn:
code to make the content-changed indicator work properly? Who is in charge
of that indicator and how do I tell them to turn it off?

Thanks,
Evan


Re: [Pharo-users] [ANN] Python3Generator and MatplotLibBridge

2018-01-04 Thread Kjell Godo
did you use a socket to communicate from Pharo to Python?
 it does not sound like it it sounds more one way
 i am interested in using sockets to communicate between programs
  but i haven't done much with it yet
 maybe you can include sockets in your generated Python to talk
  back to Pharo ?
 i got Dolphin Smalltalk to talk to Pharo using a socket
  but i kind of forgot about it
did you look at Roassal ? Roassal does a lot of plotting they look very nice
 they have mouse interactions and lots of cool stuff
  but i don't know how they relate to other plotting programs
 i imagine that Roassal tries to do things not done in other programs
  but i don't really know i looked at some other plotting thing
also
  can't remember Sci something
 Roassal has a nice declarative style that is nice
  i want to use it a lot in future
  i use Roassal in the Moose Pharo image because it is pre installed
i have a rich text tree editing program in Dolphin Smalltalk
 that i use like a note taking program like everNote but as a great big
tree
  using the old Windows tree widget in Dolphin 6 which i like
  and i store a lot of my text stuff in there
 and i would like to store and edit Racket programs or lisp programs
  in there in a tree format
 and your project sounds interesting
  about how to maybe generate Racket code that will allow
  me to use Dolphin and Pharo and other Smalltalks as a front end
to
  Racket or commonLisp etc
  because i don't like the GUIs or IDEs of those things
   ( they're so primative )( but i don't know them well )( they
just look
brittle )( and C like )
 and i believe there is a command line interface in Pharo so you can
  execute external programs like generated scripts





On Tue, Jan 2, 2018 at 12:30 PM, Stephane Ducasse 
wrote:

> On Mon, Jan 1, 2018 at 8:22 PM, Julien  wrote:
> > Hello,
> >
> > My new year main resolution: stop keeping my side-projects for me.
>
> I ***LOVE IT***
> Last year I took as decision, release all the books that I had half
> finished :) and I ended up creating the booklets
> to flush my hardisc.
>
> Stef
>
>
>
>
>
>
> >
> > It’s been like 1 year that I created these two projects, one coming from
> a
> > refactoring of the other.
> > Now it is time to take time to announce them.
> >
> > I initially come from Python world and during my bachelor & master, I
> really
> > liked to use matplotlib to plot data using Python.
> >
> > So I wanted to be able to use this Python module from Pharo. I did it by
> > generating Python 3 code from Pharo and making Python 3 executing it. So,
> > first I implemented everything in MatplotLibBridge package and then I
> split
> > it in two package in order to be able to eventually create bridges to
> other
> > Python 3 modules.
> >
> > So, Python3Generator [1] is made for generating programatically Python 3
> > code from Pharo. Basically, it allows you to easily build a Python 3 AST,
> > to serialize it in Python 3 source code and eventually to execute it. For
> > now you can transfer data from Pharo to Python (e.g. providing arguments
> to
> > functions that are Pharo’s objects) but you can not retrieve data stored
> in
> > Python variable from Pharo (but it should be possible, just I don’t need
> to
> > do that for my bridge to matplotlib). Some examples are provided on the
> > github’s README.
> >
> > MatplotLibBridge [2] is made for creating plots using matplotlib [3] from
> > Pharo. There is a bunch of examples of what you can do on the README. The
> > two features from matplotlib I like the most are: 1. You can generate
> your
> > plot in a lot of file formats (png, pdf, svg, ps, etc…) 2. It allows to
> > embed LaTeX mathematical formulae everywhere in the plot (which can be
> > really cool). All the possible plots in matplotlib are not available in
> > Pharo’s side because I build parts of the bridge when I need them but it
> is
> > not hard to do. I someone is interested in a plot type not available yet,
> > please tell me.
> >
> > So, it is announced, if someone want to do something with those, please
> do
> > it!
> >
> > Happy new year.
> >
> > Regards,
> >
> > Julien
> >
> > [1]: https://github.com/juliendelplanque/Python3Generator
> > [2]: https://github.com/juliendelplanque/MatplotLibBridge
> > [3]: https://matplotlib.org
> >
> > ---
> > Julien Delplanque
> > Doctorant à l’Université de Lille 1
> > http://juliendelplanque.be/phd.html
> > Equipe Rmod, Inria
> > Bâtiment B 40, avenue Halley 59650 Villeneuve d'Ascq
> > Numéro de téléphone: +333 59 35 86 40
> >
>
>


Re: [Pharo-users] Examples of Garage for DB2

2018-01-04 Thread Andrei Stebakov
Thank you, Pierce

I got similar ffi exceptions when I call

Gofer new

  smalltalkhubUser: 'PharoExtras' project: 'ODBC';

  package: 'ConfigurationOfODBC'; load.

  (Smalltalk at: #ConfigurationOfODBC) load.

On Jan 4, 2018 11:41 AM, "Pierce Ng"  wrote:

> On Wed, Jan 03, 2018 at 11:42:22AM -0500, Andrei Stebakov wrote:
> > I tried before to install odbc.
> > Gofer new
> >   squeaksource: 'ODBC';
>
> Not Squeaksource. Load the version from Smalltalkhub:
>
>   Gofer new
> smalltalkhubUser: 'PharoExtras' project: 'ODBC';
> ...
>
> Hopefully this version works with or without Esteban's suggestion.
>
> > I still don't see how postgres can help but I'll give it another try.
>
> I suggested PostgreSQL FDW because I know PostgreSQL. If you are not
> familiar
> with PostgreSQL, then setting it up, setting up its FDW, and finally
> setting up
> programmatic access to PostgreSQL to get at the FDW data is probably more
> work
> than it is worth.
>
> Pierce
>
>
>


Re: [Pharo-users] Examples of Garage for DB2

2018-01-04 Thread Pierce Ng
On Wed, Jan 03, 2018 at 11:42:22AM -0500, Andrei Stebakov wrote:
> I tried before to install odbc.
> Gofer new
>   squeaksource: 'ODBC';

Not Squeaksource. Load the version from Smalltalkhub:

  Gofer new
smalltalkhubUser: 'PharoExtras' project: 'ODBC';
...

Hopefully this version works with or without Esteban's suggestion.

> I still don't see how postgres can help but I'll give it another try.

I suggested PostgreSQL FDW because I know PostgreSQL. If you are not familiar
with PostgreSQL, then setting it up, setting up its FDW, and finally setting up
programmatic access to PostgreSQL to get at the FDW data is probably more work
than it is worth.

Pierce




Re: [Pharo-users] Solver for the Stable Marriage problem in Pharo

2018-01-04 Thread Julien
Oh, maybe it would have helped then… :-)

Julien

---
Julien Delplanque
Doctorant à l’Université de Lille 1
http://juliendelplanque.be/phd.html
Equipe Rmod, Inria
Bâtiment B 40, avenue Halley 59650 Villeneuve d'Ascq
Numéro de téléphone: +333 59 35 86 40

> Le 4 janv. 2018 à 15:12, Guillermo Polito  a écrit 
> :
> 
> It depends. I wanted to customize the process a bit, and avoid that some 
> people make gifts to some specific people.
> 
> On Thu, Jan 4, 2018 at 2:26 PM, Julien  > wrote:
> Not sure you can use it for that.
> 
> I mean, you wanted random pairs of people no?
> 
> So no need to rank people according to some preferences?
> 
> Julien
> 
> ---
> Julien Delplanque
> Doctorant à l’Université de Lille 1
> http://juliendelplanque.be/phd.html 
> Equipe Rmod, Inria
> Bâtiment B 40, avenue Halley 59650 
> 
>  Villeneuve 
> 
>  d'Ascq 
> 
> Numéro de téléphone: +333 59 35 86 40 
>> Le 4 janv. 2018 à 10:08, Guillermo Polito > > a écrit :
>> 
>> Nice! But late :P I was looking for something like this to organize secret 
>> santa a couple of weeks ago. I'll star it though :)
>> 
>> Tx!
>> 
>> On Wed, Jan 3, 2018 at 12:23 AM, Sean P. DeNigris > > wrote:
>> Julien wrote
>> > Continuing to announce what I have.
>> 
>> Hooray!!
>> 
>> 
>> 
>> -
>> Cheers,
>> Sean
>> --
>> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html 
>> 
>> 
>> 
>> 
>> 
>> -- 
>>
>> Guille Polito
>> Research Engineer
>> 
>> Centre de Recherche en Informatique, Signal et Automatique de Lille
>> CRIStAL - UMR 9189
>> French National Center for Scientific Research - http://www.cnrs.fr 
>> 
>> 
>> Web: http://guillep.github.io 
>> Phone: +33 06 52 70 66 13 
> 
> 
> 
> -- 
>
> Guille Polito
> Research Engineer
> 
> Centre de Recherche en Informatique, Signal et Automatique de Lille
> CRIStAL - UMR 9189
> French National Center for Scientific Research - http://www.cnrs.fr 
> 
> 
> Web: http://guillep.github.io 
> Phone: +33 06 52 70 66 13



Re: [Pharo-users] Solver for the Stable Marriage problem in Pharo

2018-01-04 Thread Guillermo Polito
It depends. I wanted to customize the process a bit, and avoid that some
people make gifts to some specific people.

On Thu, Jan 4, 2018 at 2:26 PM, Julien  wrote:

> Not sure you can use it for that.
>
> I mean, you wanted random pairs of people no?
>
> So no need to rank people according to some preferences?
>
> Julien
>
> ---
> Julien Delplanque
> Doctorant à l’Université de Lille 1
> http://juliendelplanque.be/phd.html
> Equipe Rmod, Inria
> Bâtiment B 40, avenue Halley 59650
> 
>  Villeneuve
> 
>  d'Ascq
> 
> Numéro de téléphone: +333 59 35 86 40 <+33%203%2059%2035%2086%2040>
>
> Le 4 janv. 2018 à 10:08, Guillermo Polito  a
> écrit :
>
> Nice! But late :P I was looking for something like this to organize secret
> santa a couple of weeks ago. I'll star it though :)
>
> Tx!
>
> On Wed, Jan 3, 2018 at 12:23 AM, Sean P. DeNigris 
> wrote:
>
>> Julien wrote
>> > Continuing to announce what I have.
>>
>> Hooray!!
>>
>>
>>
>> -
>> Cheers,
>> Sean
>> --
>> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>>
>>
>
>
> --
>
> Guille Polito
> Research Engineer
>
>
> Centre de Recherche en Informatique, Signal et Automatique de Lille
> CRIStAL - UMR 9189
> French National Center for Scientific Research - *http://www.cnrs.fr
> *
>
> *Web:* *http://guillep.github.io* 
> *Phone: *+33 06 52 70 66 13 <+33%206%2052%2070%2066%2013>
>
>
>


-- 



Guille Polito

Research Engineer

Centre de Recherche en Informatique, Signal et Automatique de Lille

CRIStAL - UMR 9189

French National Center for Scientific Research - *http://www.cnrs.fr
*


*Web:* *http://guillep.github.io* 

*Phone: *+33 06 52 70 66 13


Re: [Pharo-users] Formatted print for Duration

2018-01-04 Thread Julien
I chosen something like the second solution to avoid adding a dependency to my 
project (it is a bit overkill for what I wanted to achieve). But shouldn’t this 
formatted-print feature be added in Duration?

Julien

---
Julien Delplanque
Doctorant à l’Université de Lille 1
http://juliendelplanque.be/phd.html
Equipe Rmod, Inria
Bâtiment B 40, avenue Halley 59650 Villeneuve d'Ascq
Numéro de téléphone: +333 59 35 86 40

> Le 3 janv. 2018 à 23:02, Andreas Brodbeck  a écrit :
> 
> Am 03.01.18 um 14:07 schrieb Julien:
>> Hello,
>> 
>> I do not see how to do a formatted print from a duration.
>> 
>> I would like to be able to do something like:
>> 
>> String streamContents: [ :s | 90 minutes formatted: ‘hh:mm’ printOn: s ]
>> 
>> The Duration>>#printOn: method prints the ANSI 5.8.2.16 format: 
>> [-]D:HH:MM:SS[.S]
>> 
>> The Duration>>#printHumanReadableOn: is not printing in the format I want.
>> 
>> Am I missing something or such feature does not exist actually?
> 
> Hi Julien
> 
> I did not find a ready made method for that, either. Probably because
> there is no standard way to print a *Duration* as minutes and seconds,
> because it is not obvious how to print it (Compared to instances of the
> *Time* class).
> 
> My solution would be to implement your own printing method using the
> GRPrinter from the Grease package (Installable through Catalog Browser
> in Pharo 6):
> 
> *
> 
> | hoursPrinter minutesPrinter printer |
> 
> "Note: you can not use 'duration minutes', since this will give you only
> the partial minutes inside a day"
> hoursPrinter := GRMappedPrinter
>   block: [ :duration | duration asMinutes // 60 ]
>   next: (GRNumberPrinter new).
> 
> minutesPrinter := GRMappedPrinter
>   block: [ :duration | duration minutes ]
>   next: (GRPrinter numberWithAtLeastDigits: 2).
> 
> printer := hoursPrinter, $:, minutesPrinter.
>   
> ^printer print: (9876 minutes) "Will result in '164:36'"
> 
> *
> 
> 
> 
> 2. solution: Or just dead simple:
> 
> *
> 
> | duration |
> duration := (9876 minutes).
> 
> ^(duration asMinutes // 60) asString, ':',
> duration minutes asTwoCharacterString
> 
> *
> 
> 
> Cheers, Andreas
> 
> -- 
> Andreas Brodbeck
> www.mindclue.ch 


Re: [Pharo-users] Solver for the Stable Marriage problem in Pharo

2018-01-04 Thread Julien
Not sure you can use it for that.

I mean, you wanted random pairs of people no?

So no need to rank people according to some preferences?

Julien

---
Julien Delplanque
Doctorant à l’Université de Lille 1
http://juliendelplanque.be/phd.html
Equipe Rmod, Inria
Bâtiment B 40, avenue Halley 59650 Villeneuve d'Ascq
Numéro de téléphone: +333 59 35 86 40

> Le 4 janv. 2018 à 10:08, Guillermo Polito  a écrit 
> :
> 
> Nice! But late :P I was looking for something like this to organize secret 
> santa a couple of weeks ago. I'll star it though :)
> 
> Tx!
> 
> On Wed, Jan 3, 2018 at 12:23 AM, Sean P. DeNigris  > wrote:
> Julien wrote
> > Continuing to announce what I have.
> 
> Hooray!!
> 
> 
> 
> -
> Cheers,
> Sean
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html 
> 
> 
> 
> 
> 
> -- 
>
> Guille Polito
> Research Engineer
> 
> Centre de Recherche en Informatique, Signal et Automatique de Lille
> CRIStAL - UMR 9189
> French National Center for Scientific Research - http://www.cnrs.fr 
> 
> 
> Web: http://guillep.github.io 
> Phone: +33 06 52 70 66 13



Re: [Pharo-users] Solver for the Stable Marriage problem in Pharo

2018-01-04 Thread Guillermo Polito
Nice! But late :P I was looking for something like this to organize secret
santa a couple of weeks ago. I'll star it though :)

Tx!

On Wed, Jan 3, 2018 at 12:23 AM, Sean P. DeNigris 
wrote:

> Julien wrote
> > Continuing to announce what I have.
>
> Hooray!!
>
>
>
> -
> Cheers,
> Sean
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>
>


-- 



Guille Polito

Research Engineer

Centre de Recherche en Informatique, Signal et Automatique de Lille

CRIStAL - UMR 9189

French National Center for Scientific Research - *http://www.cnrs.fr
*


*Web:* *http://guillep.github.io* 

*Phone: *+33 06 52 70 66 13