[Pharo-users] gtInspector override default select behavior

2017-08-06 Thread Evan Donahue
Hello,

I have a gtInspector extension a tree-structured object. By default, when I
click on one of the objects in the gtInspector, the inspector opens up
another inspector on that node (using the finder-style display).

What I would like to know is, is it possible to override the default click
behavior so that, instead of opening the next inspector on that node of the
tree, it opens on the result of a block run on that tree. Specifically, I
have this:

gtInspectorSource: composite


composite tree
title: 'Source';
children: [ :r | r sourceChildren ];
format: [ :r | r sourceName ];
display: self

and I was hoping there was some way I could do something like this:

...
display: self;
onSelectAction: [ :r | r next ]

so when I click, I get an inspector not on the node of the tree r, but on r
next.

Thanks,

Evan


Re: [Pharo-users] Glorp: `session login` fails for Garage SQLite

2017-08-06 Thread Herby Vojčík

Esteban A. Maringolo wrote:

2017-08-06 8:05 GMT-03:00 Herby Vojčík:

Guillermo Polito wrote:

How did you install garage and glorp? Catalog, configurations? Can you
paste here the installation instructions you followed?


Just adding GarageGlorp as dependency:
 configuration: 'GarageGlorp' with: [ spec
 version: #stable;
 repository:



I presume this is how it should be done?


It is. [1]



In fact, from what I saw, it seems Glorp accumulated its share of technical
debt, drivers came and went, platforms, too, dialects on which it runs, too.
It seems to me it needs serious detanglement. Get rid of ifs, structure
clenly, change ifs comparing to hardcoded symbols with double dispatch, etc.


Glorp as a project accumulates technical debt because it is an old
framework, which in the last years has received maintenance in its
main trunk but is missing several refactorings and a good
re-architecture of its internals.

Also, since there wasn't an official maintenance of the ports from VW
to other languages, there are many "old" ports still around, some
work, some doesn't, but they add to the confusion. Think of Seaside
being ported several times from Pharo to, let's say, VW, and many of
those ports were abandoned for a long time.

I attach a screenshot from the latest version of Glorp in VisualWorks
8 (the main trunk), it has the same login methods as the Pharo
version.


Yeah, those probably aren't a problem (though, sometime self accessor, 
sometimes accessor), it's PharoDatabaseAccessor >> encoding which sends 
the mythical #queryEncoding.



[1] See: 
http://files.pharo.org/books-pdfs/booklet-Glorp/2017-05-02-Glorp-Spiral.pdf


Yeah, thanks, without that book I would be hardly be able to use Glorp 
at all.



Regards,

Esteban A. Maringolo





Re: [Pharo-users] Best Practices for Bundling Documentation

2017-08-06 Thread Offray Vladimir Luna Cárdenas
Hi Evan,

I have been working on the issue of documentation in Pharo, including
bundling. So here comes my take on that. Sorry if it sounds a little bit
self-promotional, but I'm really passionate about the almost unknown and
unexplored possibilities of Pharo for documentation.

Grafoscopio is a tool for interactive documentation, data storytelling
and reproducible research made in Pharo [1]. You can see a short video
of how it looks and what it does in [1a].  With Grafoscopio, you can
have a single document for your different documentation tasks from a
complete book, to a small tutorial, to something in between, to a small
outline with just notes and links, etc. Documents in Grafoscopio are
organized as structured as trees, which gives them hierarchy and
sequence. Grafoscopio User Manual [2] was made, of course, in
Grafoscopio (we love self-referential systems :-P). Grafoscopio uses the
powerful, versatile, well maintained, easy to setup and configure Pandoc
[3] to export documents to several formats. You can add custom templates
and options to your documents in several formats (see for example [4]).
All document information, including setup options can be hold in a
single Grafoscopio file, called notebook, and you can even choose if you
want to keep something in the notebook that will be hidden in some
exportation format and use/define special words and tags to control the
way the documents are traversed and exported (see the %keywords part of
the manual). Grafoscopio has preliminary integration with the minimalist
and self contained Fossil[5], to support collaboration and reproducible
research and also with Zotero bibliographic management system.

[1] http://mutabit.com/grafoscopio/index.en.html
[1a] http://mutabit.com/repos.fossil/alvicoda/
[2]
http://mutabit.com/repos.fossil/grafoscopio/doc/tip/Docs/En/Books/Manual/manual.pdf
[3] http://pandoc.org/
[4] http://mutabit.com/repos.fossil/piamed/doc/tip/Libro/libro.pdf
[5] http://fossil-scm.org/
[6] https://www.zotero.org/

To package manuals and tutorials, there is a GrafoscopioDocumentation
object that defines a (Fossil) documentation repository and the files
there that are part of a documentation project. GrafoscopioDocumentation
knows how to query and update the repositories using the standard Fossil
JSON API. That's the way I use to package documents about several
projects made in Grafoscopio, including its manual, and the Dataviz[6]
project and the upcoming Data Journalism Manual [7].

[6]
http://mutabit.com/repos.fossil/grafoscopio/doc/tip/Packages/Dataviz/intro.md
[7] http://mutabit.com/repos.fossil/mapeda/index

We have an small, active and diverse community of people using and
extending Grafoscopio in our hackerspace [8], that includes librarians,
journalists, activists, philosophers and others and in our Spanish
mailing list we also get and answer English mail, if you need any
support (see [1] for community links).

[8] http://hackbo.co/

So, give a look to Grafoscopio for your documentation needs and let us
know if you need any help with it.

Cheers,

Offray

On 04/08/17 19:19, Evan Donahue wrote:
> Hello,
>
> I'm working on cleaning up a couple of projects for release, and I was
> wondering what the best practices were for including appropriate
> documentation with projects. Should I just drop a text blob in a
> prominent class comment? Is there a tool for structuring
> documentation? Is documentation typically kept separate from the code?
> Seems natural to include it so you never have to leave the image, but
> I'm not sure what most people do.
>
> Thanks,
> Evan





Re: [Pharo-users] PetitParser: Parse X as long as it's not Y

2017-08-06 Thread PBKResearch
Sean

A supplementary point I have just realised. The basic 'and' idea is correct,
but my example is over-simplified. As written, it will reject any string
beginning with 'Bar' or 'Baz'. If you use this pattern, you will need to be
careful how you define the exclusion. 

Peter


-Original Message-
From: Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] On Behalf Of
PBKResearch
Sent: 06 August 2017 13:28
To: 'Any question about pharo is welcome' 
Subject: Re: [Pharo-users] PetitParser: Parse X as long as it's not Y

Sean

This seems to be what the PPAndParser is designed for. I tried the
following:

identifier := #letter asParser plus flatten.
exclusion := ('Bar' asParser / 'Baz' asParser) negate.
restricted := identifier and, exclusion.

restricted matches: 'abc'. "--> true"
restricted matches: 'Baz'. "--> false"

(Note the comma after 'and' is necessary - this wasted me a few minutes in
trying.)

Hope this helps

Peter Kenny

-Original Message-
From: Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] On Behalf Of
Sean P. DeNigris
Sent: 05 August 2017 21:26
To: pharo-users@lists.pharo.org
Subject: [Pharo-users] PetitParser: Parse X as long as it's not Y

How do I tell Petit Parser to parse a string of certain allowable characters
as long as the final result isn't a particular string? E.g. consume an
identifier as long as it's not 'Baz' or 'Bar'

Thanks



-
Cheers,
Sean
--
View this message in context:
http://forum.world.st/PetitParser-Parse-X-as-long-as-it-s-not-Y-tp4958895.ht
ml
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.





Re: [Pharo-users] Glorp: `session login` fails for Garage SQLite

2017-08-06 Thread Esteban A. Maringolo
2017-08-06 8:05 GMT-03:00 Herby Vojčík :
> Guillermo Polito wrote:
>>
>> How did you install garage and glorp? Catalog, configurations? Can you
>> paste here the installation instructions you followed?
>
>
> Just adding GarageGlorp as dependency:
> configuration: 'GarageGlorp' with: [ spec
> version: #stable;
> repository:

> I presume this is how it should be done?

It is. [1]


> In fact, from what I saw, it seems Glorp accumulated its share of technical
> debt, drivers came and went, platforms, too, dialects on which it runs, too.
> It seems to me it needs serious detanglement. Get rid of ifs, structure
> clenly, change ifs comparing to hardcoded symbols with double dispatch, etc.

Glorp as a project accumulates technical debt because it is an old
framework, which in the last years has received maintenance in its
main trunk but is missing several refactorings and a good
re-architecture of its internals.

Also, since there wasn't an official maintenance of the ports from VW
to other languages, there are many "old" ports still around, some
work, some doesn't, but they add to the confusion. Think of Seaside
being ported several times from Pharo to, let's say, VW, and many of
those ports were abandoned for a long time.

I attach a screenshot from the latest version of Glorp in VisualWorks
8 (the main trunk), it has the same login methods as the Pharo
version.

[1] See: 
http://files.pharo.org/books-pdfs/booklet-Glorp/2017-05-02-Glorp-Spiral.pdf

Regards,

Esteban A. Maringolo


Re: [Pharo-users] PetitParser: Parse X as long as it's not Y

2017-08-06 Thread PBKResearch
Sean

This seems to be what the PPAndParser is designed for. I tried the
following:

identifier := #letter asParser plus flatten.
exclusion := ('Bar' asParser / 'Baz' asParser) negate.
restricted := identifier and, exclusion.

restricted matches: 'abc'. "--> true"
restricted matches: 'Baz'. "--> false"

(Note the comma after 'and' is necessary - this wasted me a few minutes in
trying.)

Hope this helps

Peter Kenny

-Original Message-
From: Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] On Behalf Of
Sean P. DeNigris
Sent: 05 August 2017 21:26
To: pharo-users@lists.pharo.org
Subject: [Pharo-users] PetitParser: Parse X as long as it's not Y

How do I tell Petit Parser to parse a string of certain allowable characters
as long as the final result isn't a particular string? E.g. consume an
identifier as long as it's not 'Baz' or 'Bar'

Thanks



-
Cheers,
Sean
--
View this message in context:
http://forum.world.st/PetitParser-Parse-X-as-long-as-it-s-not-Y-tp4958895.ht
ml
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.




Re: [Pharo-users] Glorp: `session login` fails for Garage SQLite

2017-08-06 Thread Herby Vojčík

Guillermo Polito wrote:

How did you install garage and glorp? Catalog, configurations? Can you
paste here the installation instructions you followed?


Just adding GarageGlorp as dependency:

baseline: spec
   
spec for: #common do: [ spec

package: 'Towergame' with: [ spec
requires: #('GarageGlorp' 'NeoJSON') ];
package: 'Towergame-Tests' with: [ spec
requires: #('Towergame' 'Mocketry') ];

configuration: 'GarageGlorp' with: [ spec
version: #stable;
repository: 
'http://smalltalkhub.com/mc/Pharo/MetaRepoForPharo60/main' ];
configuration: 'NeoJSON' with: [ spec
version: #stable;
repository: 
'http://smalltalkhub.com/mc/Pharo/MetaRepoForPharo60/main' ];
baseline: 'Mocketry' with: [ spec
repository: 'github://dionisiydk/Mocketry:v4.0.x' ];

group: 'default' with: #('Core');
group: 'development' with: #('Core' 'Tests');
group: 'Core' with: #('Towergame');
group: 'Tests' with: #('Towergame-Tests') ]

and loading it in script via

Metacello new baseline: 'Towergame'; repository: 'gitlocal:///', 
(hereRef / 'src') fullName; load: 'development'.


I presume this is how it should be done?

---

But, does that affect the presence of queryEncoding? It's the mythincal 
creature, I have browsed repos out there, history of development of 
Glorp and found it nowhere.


Did it actually exist? :-)

In fact, from what I saw, it seems Glorp accumulated its share of 
technical debt, drivers came and went, platforms, too, dialects on which 
it runs, too. It seems to me it needs serious detanglement. Get rid of 
ifs, structure clenly, change ifs comparing to hardcoded symbols with 
double dispatch, etc. :-(


Herby

P.S.: And most of all, add one smoke test to test it with each login 
type that actually uses `session login`, not database accessor's one 
(not seen, but it was mention in this thread or the one linked below no 
test actually sends `session login`).




On Sun, Aug 6, 2017 at 1:37 AM, Herby Vojčík > wrote:

Herby Vojčík wrote:

Guillermo Polito wrote:

AFAIR, PharoDatabaseAccessor was meant to work with
SqueakDBX/DBXTalk
driver. No other driver should use it. At the time Garage
did not even
exist.

So I'd say that you should not use PharoDatabaseAccessor
with another
driver than the one it was originally mean to? I do not know
exactly
your setup, I was not following this thread.

Really I cannot tell much more. This was really long time ago.


Great to know!

I am not using it consciously, though. System somehow selects it and
uses it in the background (I just do MyDescriptorSystem
sessionForLogin:
myLoginObject; and before that I set GarageGlorpDrive to be the
default).

This seems to be the actual fix (make Glorp with Garage not use
PharoDatabaseAccessor).


Actually, probably not. It is more in, it should be fixed to work
with Garage. It has lots of functionality there... :-(



Herby


On Sun, Aug 6, 2017 at 12:20 AM, Herby Vojčík

>> wrote:

Esteban A. Maringolo wrote:

Herby,

I regularly use `session login`, but I don't use SQLite in
Pharo, but I
do in VisualWorks and it works just fine.
Maybe if there is a bug we should fix it. Even with a no-op
method.

Regards!

Esteban A. Maringolo


It's hard. The problem is

PharoDatabaseAccessor >> encoding
^self connection queryEncoding

which overrides parent, which is atm:

encoding
"The connection is specific to the dialect; some dialects
will need
to override this method."

^connection encoding

The former was added at GuillermoPolito.73 back in 2011 (and the
latter was the same back then). It probably fixed something,
but I
don't see any implementors of queryEncoding atm (definitely
not in
Garage). From the diff it is clear lots of databases and drivers
have gone. Now, why was it change for Pharo (and does it
need to be
changed in 2017)?

Ccing Guillermo Polito.

Herby

P.S.: I wonder how it is that no one actually had problem
with this?
This predictably fails on `session login` 

Re: [Pharo-users] PetitParser: Parse X as long as it's not Y

2017-08-06 Thread Jan Kurš
Hi, not sure if I understand your requirement, but you can try:

Y not, chars star

Is this what you need?

Cheers Jan

On Sun, Aug 6, 2017, 04:47 Sean P. DeNigris  wrote:

> vonbecmann wrote
> > did you try with negate?
>
> That is the standard trick with PP, but the problem here is that I'm trying
> to say, not just "anything which is not Y", but "any string of these
> characters as long is it doesn't also match Y"
>
>
>
> -
> Cheers,
> Sean
> --
> View this message in context:
> http://forum.world.st/PetitParser-Parse-X-as-long-as-it-s-not-Y-tp4958895p4958912.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>
>


Re: [Pharo-users] Best Practices for Bundling Documentation

2017-08-06 Thread Stephane Ducasse
or
   MyStuff
   MyStuff/Tutorial

On Sun, Aug 6, 2017 at 11:00 AM, Stephane Ducasse
 wrote:
> Hello evan
>
> Cool I want to read them!
> If you have your code in github you can include pillar files there and
> with travis build the pdf as I did for the booklets.
> I prefer to separate tutorials from code.
>
> I would go for
>  MyStuff
>  MyStuffTutorial
> or
>
>
> This way readers can get the pdf
> https://github.com/SquareBracketAssociates/Booklet-BuildingMemoryGameWithBloc
> or
> https://github.com/SquareBracketAssociates/Booklet-Mocking
>
> I can help you to set it up.
> After you booklet can be published on the Pharo books page too.
>
> stef
>
>
> On Sun, Aug 6, 2017 at 1:34 AM, Evan Donahue  wrote:
>> Hello,
>>
>> The projects are a logic programming and machine learning system
>> respectively, so they probably warrant more involved tutorial-style
>> documentation. I will take a look at the Pillar docs, but just to think
>> ahead a bit, assuming I write up some docs in Pillar, what would be the best
>> way to distribute those? Can they be packaged with the code or would the
>> docs be outside the image? If outside, where do people tend to host them?
>>
>> Thanks,
>> Evan
>>
>>
>>
>> --
>> View this message in context: 
>> http://forum.world.st/Best-Practices-for-Bundling-Documentation-tp4958788p4958910.html
>> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>>



Re: [Pharo-users] Best Practices for Bundling Documentation

2017-08-06 Thread Stephane Ducasse
Hello evan

Cool I want to read them!
If you have your code in github you can include pillar files there and
with travis build the pdf as I did for the booklets.
I prefer to separate tutorials from code.

I would go for
 MyStuff
 MyStuffTutorial
or


This way readers can get the pdf
https://github.com/SquareBracketAssociates/Booklet-BuildingMemoryGameWithBloc
or
https://github.com/SquareBracketAssociates/Booklet-Mocking

I can help you to set it up.
After you booklet can be published on the Pharo books page too.

stef


On Sun, Aug 6, 2017 at 1:34 AM, Evan Donahue  wrote:
> Hello,
>
> The projects are a logic programming and machine learning system
> respectively, so they probably warrant more involved tutorial-style
> documentation. I will take a look at the Pillar docs, but just to think
> ahead a bit, assuming I write up some docs in Pillar, what would be the best
> way to distribute those? Can they be packaged with the code or would the
> docs be outside the image? If outside, where do people tend to host them?
>
> Thanks,
> Evan
>
>
>
> --
> View this message in context: 
> http://forum.world.st/Best-Practices-for-Bundling-Documentation-tp4958788p4958910.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>



Re: [Pharo-users] Glorp: `session login` fails for Garage SQLite

2017-08-06 Thread Pierce Ng
On Sun, Aug 06, 2017 at 12:54:41AM +0200, Herby Vojčík wrote:
> Pharo is 6.1, Glorp, Garage etc. are #stable loaded from Pharo60
> catalog (see attachment).

You may want to try GlorpSQLite. Load from Catalog Browser into a fresh 60510
image. All 889 tests should pass, as has been the case since Pharo 5. In
GlorpSQLite, #encoding is implemented by UDBCDatabaseDriver.

Pierce




Re: [Pharo-users] Glorp: `session login` fails for Garage SQLite

2017-08-06 Thread Guillermo Polito
How did you install garage and glorp? Catalog, configurations? Can you
paste here the installation instructions you followed?

On Sun, Aug 6, 2017 at 1:37 AM, Herby Vojčík  wrote:

> Herby Vojčík wrote:
>
>> Guillermo Polito wrote:
>>
>>> AFAIR, PharoDatabaseAccessor was meant to work with SqueakDBX/DBXTalk
>>> driver. No other driver should use it. At the time Garage did not even
>>> exist.
>>>
>>> So I'd say that you should not use PharoDatabaseAccessor with another
>>> driver than the one it was originally mean to? I do not know exactly
>>> your setup, I was not following this thread.
>>>
>>> Really I cannot tell much more. This was really long time ago.
>>>
>>
>> Great to know!
>>
>> I am not using it consciously, though. System somehow selects it and
>> uses it in the background (I just do MyDescriptorSystem sessionForLogin:
>> myLoginObject; and before that I set GarageGlorpDrive to be the default).
>>
>> This seems to be the actual fix (make Glorp with Garage not use
>> PharoDatabaseAccessor).
>>
>
> Actually, probably not. It is more in, it should be fixed to work with
> Garage. It has lots of functionality there... :-(
>
>
>
>> Herby
>>
>>
>>> On Sun, Aug 6, 2017 at 12:20 AM, Herby Vojčík >> > wrote:
>>>
>>> Esteban A. Maringolo wrote:
>>>
>>> Herby,
>>>
>>> I regularly use `session login`, but I don't use SQLite in
>>> Pharo, but I
>>> do in VisualWorks and it works just fine.
>>> Maybe if there is a bug we should fix it. Even with a no-op method.
>>>
>>> Regards!
>>>
>>> Esteban A. Maringolo
>>>
>>>
>>> It's hard. The problem is
>>>
>>> PharoDatabaseAccessor >> encoding
>>> ^self connection queryEncoding
>>>
>>> which overrides parent, which is atm:
>>>
>>> encoding
>>> "The connection is specific to the dialect; some dialects will need
>>> to override this method."
>>>
>>> ^connection encoding
>>>
>>> The former was added at GuillermoPolito.73 back in 2011 (and the
>>> latter was the same back then). It probably fixed something, but I
>>> don't see any implementors of queryEncoding atm (definitely not in
>>> Garage). From the diff it is clear lots of databases and drivers
>>> have gone. Now, why was it change for Pharo (and does it need to be
>>> changed in 2017)?
>>>
>>> Ccing Guillermo Polito.
>>>
>>> Herby
>>>
>>> P.S.: I wonder how it is that no one actually had problem with this?
>>> This predictably fails on `session login` on pharo, unless
>>> queryEncoding is somehow magically present without seeing it in
>>> source code for other platforms?
>>>
>>>
>>> 2017-08-05 15:52 GMT-03:00 Herby Vojčík >> 
>>> >>:
>>>
>>> Alistair Grant wrote:
>>>
>>> Hi Herby,
>>>
>>> On 5 August 2017 at 18:09, Herby
>>> Vojčík
>>> >> wrote:
>>>
>>> Hello!
>>>
>>> First of all, what is preferred way to (first time)
>>> login
>>> into database? I
>>> had the impression that `aDatabaseAccessor login`
>>> is sorta
>>> low-level, and
>>> one should do `session login` (after all, it is
>>> session you
>>> get to work
>>> with, not an accessor).
>>>
>>> But with Garage SQLite, `session login`, when
>>> accessor is
>>> not logged, always
>>> fails with "MessageNotUnderstood:
>>> GASqlite3Driver>>queryEncoding".
>>>
>>> Should one not use `session login` at all, then (when
>>> accessor is logged, it
>>> just does nothing, if it isn't, it connects the
>>> accessor,
>>> but tries to do
>>> some additional work which always fails)?
>>>
>>> Herby
>>>
>>>
>>> From memory this is caused by differences between
>>> VisualWorks
>>> and Pharo.
>>>
>>> Anyway, it is discussed and resolved in:
>>>
>>> http://forum.world.st/Glorp-SQLite3-issue-td4899792.html
>>> 
>>> >> >
>>>
>>>
>>> Doesn't look like solved to me. Anyway, at least I know it
>>> is known
>>> for year and no-one seemed to see it as a bug.
>>>
>>> I think it is one (you cannot just send queryEncoding where
>>> no class
>>> implements it and be fine, imo).
>>>
>>> So what is the state of `session login`? Is it meant to be
>>> used, or
>>> everyone just took a step down to low-level and uses `accessor
>>> login` instead? :-(
>>>
>>>
>>> Cheers,
>>> Alistair
>>>
>>>
>>> Thanks, Herby
>>>
>>>
>>>
>>>
>>>
>>>
>>> --
>>>
>>>
>>>
>>> Guille Polito
>>>
>>>
>>> Research Engineer
>>>
>>> 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

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




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

*Phone: