Re: [Pharo-users] Metacello with Git

2018-01-03 Thread Stephane Ducasse
>>
>> About pillar, we are working on a new pipeline and lot of cleaning
>> compared to the version available on smalltalkhub.
>> The new version Branch new pipeline seems broken (I will check it
>> tomorrow it cannot handle internal references).
>> I want to be able to build the old books with the new version. Now it
>> is not working.
>>
>> Stef
>
> Yep, I remember you also mentioning that you're planning to decouple
> the core Pillar from Magritte and Grease.  All of this will make our
> lives easier.

There were some real glitches in the newpipeline and now I'm ready to
produce a booklet.
Now I will check and fix some more...
And yes I want to remove the dependencies to Magritte and Grease and
get a modular core.
But first I want to arrive to a stable point and migrate all the books
and booklets to Pillar 70.

Then I will work on a new version of Cocoon and integrate it to pillar
and remove magritte.
Some I imagine that it may take me 6 months (because I'm doing far too
many things).

Stef



Re: [Pharo-users] How to justify text in pillar booklets ?

2018-01-03 Thread Stephane Ducasse
Hi steven

If I understand what you mean, you cannot from Pillar.

Pillar is agnotisc from a layout point of view. You can edit the sbabook cls.
We reply on a designer for the book and just use it without touching it.
We follow the design of damien.


Stef


On Wed, Jan 3, 2018 at 1:29 PM, Steven Costiou  wrote:
> Hi,
>
> i am using the pillar booklet tools from
> https://github.com/SquareBracketAssociates/Booklet-PublishingAPillarBooklet
>
>
>
> How can i justify all paragraphs in the generated spiral book, instead of
> having all of it aligned to left ?
>
> Steven.



Re: [Pharo-users] Object Persistence

2018-01-03 Thread Stephane Ducasse
Thanks manuel.


On Wed, Jan 3, 2018 at 2:14 PM, Manuel Leuenberger
 wrote:
> Hi Stef,
>
> The Neo4j Cypher queries express a subgraph/path that you want to match in
> the big graph (nodes and edges with attributes). No fragmentation due to
> normalization etc., so no joins, it’s more like a regex matcher:
>
> MATCH p=(x:PERSON)-[:KNOWS*]->(:PERSON)
> WHERE x.name = 'John'
> RETURN p;
>
> Will give you the graph of all persons John knows and all the persons they
> know (transitive closure). You can also combine multiple queries that one
> processes the result of the other (pipes and filters). See
> https://neo4j.com/developer/cypher-query-language/
>
> OutOfMemory only happens if your query selects more data (at any point) than
> you have memory, as the query execution happens entirely in memory, there
> seems to be no flush do disk. But there are ways to work around this (albeit
> resulting in uglier partitioned queries).
>
> You can see it in action for my KOWALSKI tool, collecting API clients and
> extracting call graphs: https://youtu.be/zdx28GnoSRQ
>
> Cheers,
> Manuel
>
> On 31 Dec 2017, at 11:19, Stephane Ducasse  wrote:
>
> Hi manuel
>
> what kind of queries can we express?
> Can be get select node?
> Now out of memory is a read falg for me (for moose because we do that
> all the time).
>
> Stef
>
>
> On Tue, Dec 26, 2017 at 10:03 PM, Manuel Leuenberger
>  wrote:
>
> I’ve always liked Neo4j to persist object graphs. Also has a nice query
> language. The database is not fool-proof (isolation issues, out of memory on
> expensive queries), but works fine for analytics.
>
> On 25 Dec 2017, at 10:43, Ian Ian  wrote:
>
> Hi All,
>
> Thoughts of a purely OO nature?
>
> :)
>
>
>
>
>



Re: [Pharo-users] Formatted print for Duration

2018-01-03 Thread Andreas Brodbeck
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] Examples of Garage for DB2

2018-01-03 Thread Esteban Lorenzano
I think if you use old compiler it will work: 

SmalltalkImage compilerClass: Compiler.

Esteban

> On 3 Jan 2018, at 17:42, Andrei Stebakov  wrote:
> 
> I tried before to install odbc.
> Gofer new
>   squeaksource: 'ODBC';
>   package: 'ConfigurationOfODBC'; load.
>   (Smalltalk at: #ConfigurationOfODBC) load.
> 
> When I execute the code above I got an exception doesNotUnderstand: #selector 
> in RBParser>>externalFunctionDeclaration. Looks like currentScope variable is 
> not defined.
> Also if I install ODBC from the catalog it also fails.
> I still don't see how postgres can help but I'll give it another try.
> 
> On Jan 3, 2018 11:05, "Pierce Ng"  > wrote:
> On Wed, Jan 03, 2018 at 10:12:32AM -0500, Andrei Stebakov wrote:
> > Pierce, I couldn't find any smalltalk framework to work with DB2 at this
> > point. I couldn't also find any Pharo odbc library. That's why at this
> > point I am looking for any ideas how to connect to DB2 from Pharo.
> 
> I suppose Instantiations VA Smalltalk will be able to talk to DB2. I'm quite
> sure Dolphin Smalltalk does ODBC too.
> 
> Staying with Pharo, assuming you have known-working DB2 ODBC driver for 
> Windows
> installed and ODBC to DB2 configured, try this:
> 
>   http://smalltalkhub.com/#!/~PharoExtras/ODBC/ 
> 
> 
> Most recent commit was in Apr 2015 by Torsten 'switching to newer FFI'. So
> hopefully this works with Pharo 6.1.
> 
> If the above doesn't work, but you know that the Windows DB2 ODBC driver 
> works,
> then - I'm not being facetious - install PostgreSQL, set up PostgreSQL foreign
> data wrapper to ODBC, and talk to PostgreSQL using Pharo.
> 
>
> http://www.postgresonline.com/journal/archives/372-ODBC-FDW-now-supports-9.5-and-9.6.html
>  
> 
> 
> Or, set up Python's SQL Alchemy for DB2, install PostgreSQL, set up PostgreSQL
> foreign data wrapper to SQL Alchemy, and talk to PostgreSQL using Pharo.
> 
>   https://wiki.postgresql.org/wiki/Foreign_data_wrappers 
> 
>   https://github.com/Kozea/Multicorn 
> 
> HTH.
> 
> 



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

2018-01-03 Thread Andrei Stebakov
I tried before to install odbc.
Gofer new
  squeaksource: 'ODBC';
  package: 'ConfigurationOfODBC'; load.
  (Smalltalk at: #ConfigurationOfODBC) load.

When I execute the code above I got an exception doesNotUnderstand:
#selector in RBParser>>externalFunctionDeclaration. Looks like currentScope
variable is not defined.
Also if I install ODBC from the catalog it also fails.
I still don't see how postgres can help but I'll give it another try.

On Jan 3, 2018 11:05, "Pierce Ng"  wrote:

> On Wed, Jan 03, 2018 at 10:12:32AM -0500, Andrei Stebakov wrote:
> > Pierce, I couldn't find any smalltalk framework to work with DB2 at this
> > point. I couldn't also find any Pharo odbc library. That's why at this
> > point I am looking for any ideas how to connect to DB2 from Pharo.
>
> I suppose Instantiations VA Smalltalk will be able to talk to DB2. I'm
> quite
> sure Dolphin Smalltalk does ODBC too.
>
> Staying with Pharo, assuming you have known-working DB2 ODBC driver for
> Windows
> installed and ODBC to DB2 configured, try this:
>
>   http://smalltalkhub.com/#!/~PharoExtras/ODBC/
>
> Most recent commit was in Apr 2015 by Torsten 'switching to newer FFI'. So
> hopefully this works with Pharo 6.1.
>
> If the above doesn't work, but you know that the Windows DB2 ODBC driver
> works,
> then - I'm not being facetious - install PostgreSQL, set up PostgreSQL
> foreign
> data wrapper to ODBC, and talk to PostgreSQL using Pharo.
>
>http://www.postgresonline.com/journal/archives/372-ODBC-FDW-
> now-supports-9.5-and-9.6.html
>
> Or, set up Python's SQL Alchemy for DB2, install PostgreSQL, set up
> PostgreSQL
> foreign data wrapper to SQL Alchemy, and talk to PostgreSQL using Pharo.
>
>   https://wiki.postgresql.org/wiki/Foreign_data_wrappers
>   https://github.com/Kozea/Multicorn
>
> HTH.
>
>
>


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

2018-01-03 Thread Pierce Ng
On Wed, Jan 03, 2018 at 10:12:32AM -0500, Andrei Stebakov wrote:
> Pierce, I couldn't find any smalltalk framework to work with DB2 at this
> point. I couldn't also find any Pharo odbc library. That's why at this
> point I am looking for any ideas how to connect to DB2 from Pharo.

I suppose Instantiations VA Smalltalk will be able to talk to DB2. I'm quite
sure Dolphin Smalltalk does ODBC too.

Staying with Pharo, assuming you have known-working DB2 ODBC driver for Windows
installed and ODBC to DB2 configured, try this:

  http://smalltalkhub.com/#!/~PharoExtras/ODBC/

Most recent commit was in Apr 2015 by Torsten 'switching to newer FFI'. So
hopefully this works with Pharo 6.1.

If the above doesn't work, but you know that the Windows DB2 ODBC driver works,
then - I'm not being facetious - install PostgreSQL, set up PostgreSQL foreign
data wrapper to ODBC, and talk to PostgreSQL using Pharo.

   
http://www.postgresonline.com/journal/archives/372-ODBC-FDW-now-supports-9.5-and-9.6.html

Or, set up Python's SQL Alchemy for DB2, install PostgreSQL, set up PostgreSQL
foreign data wrapper to SQL Alchemy, and talk to PostgreSQL using Pharo.

  https://wiki.postgresql.org/wiki/Foreign_data_wrappers
  https://github.com/Kozea/Multicorn

HTH.




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

2018-01-03 Thread Andrei Stebakov
Pierce, I couldn't find any smalltalk framework to work with DB2 at this
point. I couldn't also find any Pharo odbc library. That's why at this
point I am looking for any ideas how to connect to DB2 from Pharo.

On Jan 3, 2018 09:52, "Pierce Ng"  wrote:

> On Tue, Jan 02, 2018 at 02:10:03PM -0500, Andrei Stebakov wrote:
> > I downloaded Garage to my Pharo 6.1 on windows. But in Garage I only see
> > drivers for MySql, Postgres and Sqlite3.
> > Does it mean that for DB2 I should look somewhere else or there is a way
> to
> > create a connection for DB2 using existing Garage functionality?
>
> Garage uses the OpenDBX C language database access library underneath.
> Looking
> at https://linuxnetworks.de/doc/index.php?title=OpenDBX/Support, it
> doesn't
> look OpenDBX supports DB2.
>
> Does the Windows DB2 ODBC driver work? Does Pharo successfully use the ODBC
> driver to talk to DB2?
>
> Pierce
>
>


Re: [Pharo-users] Metacello with Git

2018-01-03 Thread Alistair Grant
Hi Stef,

On 2 January 2018 at 20:11, Stephane Ducasse  wrote:
> Hi Alistair
>
> About pillar, we are working on a new pipeline and lot of cleaning
> compared to the version available on smalltalkhub.
> The new version Branch new pipeline seems broken (I will check it
> tomorrow it cannot handle internal references).
> I want to be able to build the old books with the new version. Now it
> is not working.
>
> Stef

Yep, I remember you also mentioning that you're planning to decouple
the core Pillar from Magritte and Grease.  All of this will make our
lives easier.

Thanks,
Alistair



> On Tue, Jan 2, 2018 at 6:08 PM, Alistair Grant  wrote:
>> Hi Sean,
>>
>> On 2 January 2018 at 18:00, Sean P. DeNigris  wrote:
>>> EstebanLM wrote
 if you have iceberg metacello integration enabled… Then it works on
 baselines, etc.
>>>
>>> Strange. I did `Iceberg enableMetacelloIntegration: true.` first and still
>>> got the error. I can't easily test in 7 because it depends on Magritte which
>>> depends on Grease which doesn't seem to load yet. Maybe I can cobble
>>> together a simpler test case.
>>
>> This may not help, but...
>>
>> Pharo 7.0
>> Build information:
>> Pharo-7.0+alpha.build.398.sha.52a28a857deec25612d302aba8ab09bdd6212b31
>> (32 Bit)
>>
>> I have Pillar loaded, which in turn loads:
>>
>> ConfigurationOfMagritte3-topa.126
>> Magritte-Model-SeanDeNigris.465
>> Magritte-Morph-SeanDeNigris.95
>> Magritte-Pharo3-Model-JohnCBorden.4
>> ConfigurationOfGrease-StephanEggermont.348
>> Grease-Core-JohanBrichau.97
>> Grease-Pharo30-Core-PavelKrivanek.22
>>
>> The image was built about 4 days ago.
>>
>> HTH,
>> Alistair
>>
>>
>>
>>> The Git error I mentioned in my OP was caused because `LGitRepository >>
>>> clone:options:to:` is trying to clone
>>> 'g...@bitbucket.org:nDeNigris/Quote-Me.git' based on
>>> `gitlab://SeanDeNigris/Quote-Me:master/repository` from the baseline spec.
>>> Earlier in the stack, `IceProviderRepositoryType >> mcRepository` is using
>>> `MCBitbucketRepository` which is hardcoded.
>>>
>>> All of the above is with iceberg metacello integration enabled.
>>>
>>>
>>>
>>> -
>>> Cheers,
>>> Sean
>>> --
>>> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>>>
>>
>



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

2018-01-03 Thread Pierce Ng
On Tue, Jan 02, 2018 at 02:10:03PM -0500, Andrei Stebakov wrote:
> I downloaded Garage to my Pharo 6.1 on windows. But in Garage I only see
> drivers for MySql, Postgres and Sqlite3.
> Does it mean that for DB2 I should look somewhere else or there is a way to
> create a connection for DB2 using existing Garage functionality?

Garage uses the OpenDBX C language database access library underneath.  Looking
at https://linuxnetworks.de/doc/index.php?title=OpenDBX/Support, it doesn't
look OpenDBX supports DB2.

Does the Windows DB2 ODBC driver work? Does Pharo successfully use the ODBC
driver to talk to DB2?

Pierce



Re: [Pharo-users] Object Persistence

2018-01-03 Thread Manuel Leuenberger
Hi Stef,

The Neo4j Cypher queries express a subgraph/path that you want to match in the 
big graph (nodes and edges with attributes). No fragmentation due to 
normalization etc., so no joins, it’s more like a regex matcher:

MATCH p=(x:PERSON)-[:KNOWS*]->(:PERSON)
WHERE x.name = 'John'
RETURN p;

Will give you the graph of all persons John knows and all the persons they know 
(transitive closure). You can also combine multiple queries that one processes 
the result of the other (pipes and filters). See 
https://neo4j.com/developer/cypher-query-language/

OutOfMemory only happens if your query selects more data (at any point) than 
you have memory, as the query execution happens entirely in memory, there seems 
to be no flush do disk. But there are ways to work around this (albeit 
resulting in uglier partitioned queries).

You can see it in action for my KOWALSKI tool, collecting API clients and 
extracting call graphs: https://youtu.be/zdx28GnoSRQ 


Cheers,
Manuel

> On 31 Dec 2017, at 11:19, Stephane Ducasse  wrote:
> 
> Hi manuel
> 
> what kind of queries can we express?
> Can be get select node?
> Now out of memory is a read falg for me (for moose because we do that
> all the time).
> 
> Stef
> 
> 
> On Tue, Dec 26, 2017 at 10:03 PM, Manuel Leuenberger
>  wrote:
>> I’ve always liked Neo4j to persist object graphs. Also has a nice query 
>> language. The database is not fool-proof (isolation issues, out of memory on 
>> expensive queries), but works fine for analytics.
>> 
>>> On 25 Dec 2017, at 10:43, Ian Ian  wrote:
>>> 
>>> Hi All,
>>> 
>>> Thoughts of a purely OO nature?
>>> 
>>> :)
>> 
>> 
> 



[Pharo-users] Formatted print for Duration

2018-01-03 Thread 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?

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



[Pharo-users] How to justify text in pillar booklets ?

2018-01-03 Thread Steven Costiou
Hi, 

i am using the pillar booklet tools from
https://github.com/SquareBracketAssociates/Booklet-PublishingAPillarBooklet


How can i justify all paragraphs in the generated spiral book, instead
of having all of it aligned to left ? 

Steven.