Pharo-users
By thread
pharo-users@lists.pharo.org
By month
Messages by month
- ----- 2026 -----
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- 6 participants
- 50352 messages
Re: [Pharo-users] [Pharo-dev] Clickable class side example and initialize methods in Pharo 4.0
by Thierry Goubier
Le 22/10/2014 21:14, stepharo a écrit :
> I agree with Thierry but I disagree with Alex :)
> What is cool is that when you browse a widget class that you get all the
> examples for this class.
I use browse class refs for that. Works on average pretty well; if it
doesn't I throw away the code and reuse something else ;)
Thierry
>
> Stef
>> I am also not a big fan of using pragmas. To me, it looks like an ad
>> hoc approach to have examples close to the class. In the same spirit:
>> Why not having tests in the same class? Would it not be cool? Of
>> course not.
>> In Roassal we have a class for examples (similar to TestCase).
>>
>> Alexandre
>>
>>> Le 22-10-2014 Ã 14:51, Thierry Goubier <thierry.goubier(a)gmail.com> a
>>> écrit :
>>>
>>> Hi all,
>>>
>>> by principle, I'd be against extending so much the pragmas... from a
>>> design point of view they look like #defines and macros, that is an
>>> additional language to learn, without a correct support of the tools
>>> (no debug on pragmas, non-obvious behavior triggers, search for
>>> pragma users difficult, not documented).
>>>
>>> Alexandre, your idea of infering properties from the source code
>>> looks a lot more interesting (and with a lot more potential).
>>>
>>> Thierry
>>>
>>> Le 22/10/2014 19:38, Alexandre Bergel a écrit :
>>>> Hi!
>>>>
>>>> I have doubt that #example: will be enough in the case of Roassal.
>>>> Having a code example browser is indeed important and having a
>>>> descent way to search for the examples is also important. I am
>>>> thinking to stick to #example and infer some categories from the
>>>> source code (e.g., if the method contains a Zinc class, then it may
>>>> be categorized in network).
>>>>
>>>>
>>>> Cheers,
>>>> Alexandre
>>>>
>>>>> Le 22-10-2014 à 7:38, Torsten Bergmann <astares(a)gmx.de> a écrit :
>>>>>
>>>>> Hi Tudor,
>>>>>
>>>>> that should be easy now: look at CompiledMethod>>#isExampleMethod
>>>>> which can be adopted as needed.
>>>>>
>>>>> Checking for the <example> pragma could be done this way:
>>>>>
>>>>> self pragmas anySatisfy: [:pragma | pragma keyword = #example ]
>>>>>
>>>>> but we should think first if this is enough.
>>>>>
>>>>> I already proposed to not only annotate with a pragma <example> but
>>>>> additionally give a category.
>>>>> Like this:
>>>>>
>>>>> <example: 'Graphics'>
>>>>> <example: 'Network'>
>>>>>
>>>>> This way we can easily build an example browser for our users where
>>>>> people can go through
>>>>> their point of interest and browse the examples.
>>>>>
>>>>> Maybe we should also rethink pragmas (in Pharo 5.0?) in general to
>>>>> be more Smalltalk
>>>>> like:
>>>>>
>>>>> <Example category: 'Graphics'>
>>>>>
>>>>> where Example is a real class in the system (!). One can even make
>>>>> it more explicit
>>>>> then
>>>>>
>>>>> <ExampleCategory graphics>
>>>>>
>>>>> with ExampleCategory(class)>>graphics returning a translateable
>>>>> string. People can add
>>>>> own categories and one easily knows about already available ones.
>>>>>
>>>>>
>>>>> Now that classes can have properties in Pharo 4.0 already I would
>>>>> like to see a unification
>>>>> for methods and classes here (with the general concept of an
>>>>> "Annotation" in our metamodel).
>>>>>
>>>>> In my opinion a method pragma is just a special form of annotating
>>>>> a method.
>>>>>
>>>>> And annotating classes is usefull as well (for instance you want to
>>>>> annotate a class with
>>>>> the appropriate Table name in an ORM framework, ...)
>>>>>
>>>>> A comment (in a method or in a class) is also nothing more than a
>>>>> special annotation.
>>>>> A class/method category is also an annotation. If unified a method
>>>>> or a class could
>>>>> be in one or more categories. Even a break point for an expression
>>>>> is IMHO just an
>>>>> annotation.
>>>>>
>>>>> Bye
>>>>> T.
>>>>>
>>>>>
>>>>> Gesendet: Mittwoch, 22. Oktober 2014 um 10:43 Uhr
>>>>> Von: "Tudor Girba" <tudor(a)tudorgirba.com>
>>>>> An: "Pharo Development List" <pharo-dev(a)lists.pharo.org>
>>>>> Cc: "Any question about pharo is welcome"
>>>>> <pharo-users(a)lists.pharo.org>
>>>>> Betreff: Re: [Pharo-dev] Clickable class side example and
>>>>> initialize methods in Pharo 4.0
>>>>>
>>>>> Hi Torsten,
>>>>>
>>>>> Thanks for this. This is indeed the way to go.
>>>>>
>>>>> Just to let you know, the example infrastructure is also being
>>>>> developed in the context of GT, so we have a healthy interest
>>>>> overlap which is great. Only in our case, the discovery of the
>>>>> example happens through an <example> pragma. Would it be possible
>>>>> to change your slice to use this pragma instead of the example*
>>>>> convention?
>>>>>
>>>>> Cheers,
>>>>> Doru
>>>>>
>>>>>
>>>>>
>>>>> On Wed, Oct 22, 2014 at 9:19 AM, Torsten Bergmann <astares(a)gmx.de>
>>>>> wrote:One addition I implemented for Nautilus is that one can run
>>>>> examples directly
>>>>> in the browser just by clicking on class side example methods icons.
>>>>>
>>>>> See
>>>>> https://pharo.fogbugz.com/f/cases/13892/Example-methods-should-be-runnable-…
>>>>>
>>>>> for a picture.
>>>>>
>>>>>
>>>>> SO PLEASE: WHEN YOU PROVIDE EXAMPLES IN CLASSES PLEASE PUT THEM ON
>>>>> THE CLASS SIDE
>>>>> AND LET THE SELECTOR START WITH "example".
>>>>>
>>>>> This way people will easily see that it is an example and can run
>>>>> them. Additionally it
>>>>> would help to put them into a category like "examples". So be a
>>>>> good citized and
>>>>> provide not only class comments but also examples for others to study.
>>>>>
>>>>>
>>>>> Side note:
>>>>> ==========
>>>>> It is also possible to click on the icon of class side initialize
>>>>> methods so the
>>>>> class get reinitialized (after a confirmation to avoid false
>>>>> clicking).
>>>>>
>>>>> https://pharo.fogbugz.com/f/cases/13894/Class-side-initialize-methods-shoul…
>>>>>
>>>>>
>>>>> Both issues are already integrated.
>>>>>
>>>>> --
>>>>> www.tudorgirba.com[http://www.tudorgirba.com]
>>>>>
>>>>> "Every thing has its own flow"
>>>
>>
>
>
>
>
Oct. 22, 2014
Re: [Pharo-users] [Pharo-dev] Clickable class side example and initialize methods in Pharo 4.0
by stepharo
I agree with Thierry but I disagree with Alex :)
What is cool is that when you browse a widget class that you get all the
examples for this class.
Stef
> I am also not a big fan of using pragmas. To me, it looks like an ad hoc approach to have examples close to the class. In the same spirit: Why not having tests in the same class? Would it not be cool? Of course not.
> In Roassal we have a class for examples (similar to TestCase).
>
> Alexandre
>
>> Le 22-10-2014 à 14:51, Thierry Goubier <thierry.goubier(a)gmail.com> a écrit :
>>
>> Hi all,
>>
>> by principle, I'd be against extending so much the pragmas... from a design point of view they look like #defines and macros, that is an additional language to learn, without a correct support of the tools (no debug on pragmas, non-obvious behavior triggers, search for pragma users difficult, not documented).
>>
>> Alexandre, your idea of infering properties from the source code looks a lot more interesting (and with a lot more potential).
>>
>> Thierry
>>
>> Le 22/10/2014 19:38, Alexandre Bergel a écrit :
>>> Hi!
>>>
>>> I have doubt that #example: will be enough in the case of Roassal.
>>> Having a code example browser is indeed important and having a descent way to search for the examples is also important. I am thinking to stick to #example and infer some categories from the source code (e.g., if the method contains a Zinc class, then it may be categorized in network).
>>>
>>>
>>> Cheers,
>>> Alexandre
>>>
>>>> Le 22-10-2014 à 7:38, Torsten Bergmann <astares(a)gmx.de> a écrit :
>>>>
>>>> Hi Tudor,
>>>>
>>>> that should be easy now: look at CompiledMethod>>#isExampleMethod which can be adopted as needed.
>>>>
>>>> Checking for the <example> pragma could be done this way:
>>>>
>>>> self pragmas anySatisfy: [:pragma | pragma keyword = #example ]
>>>>
>>>> but we should think first if this is enough.
>>>>
>>>> I already proposed to not only annotate with a pragma <example> but additionally give a category.
>>>> Like this:
>>>>
>>>> <example: 'Graphics'>
>>>> <example: 'Network'>
>>>>
>>>> This way we can easily build an example browser for our users where people can go through
>>>> their point of interest and browse the examples.
>>>>
>>>> Maybe we should also rethink pragmas (in Pharo 5.0?) in general to be more Smalltalk
>>>> like:
>>>>
>>>> <Example category: 'Graphics'>
>>>>
>>>> where Example is a real class in the system (!). One can even make it more explicit
>>>> then
>>>>
>>>> <ExampleCategory graphics>
>>>>
>>>> with ExampleCategory(class)>>graphics returning a translateable string. People can add
>>>> own categories and one easily knows about already available ones.
>>>>
>>>>
>>>> Now that classes can have properties in Pharo 4.0 already I would like to see a unification
>>>> for methods and classes here (with the general concept of an "Annotation" in our metamodel).
>>>>
>>>> In my opinion a method pragma is just a special form of annotating a method.
>>>>
>>>> And annotating classes is usefull as well (for instance you want to annotate a class with
>>>> the appropriate Table name in an ORM framework, ...)
>>>>
>>>> A comment (in a method or in a class) is also nothing more than a special annotation.
>>>> A class/method category is also an annotation. If unified a method or a class could
>>>> be in one or more categories. Even a break point for an expression is IMHO just an
>>>> annotation.
>>>>
>>>> Bye
>>>> T.
>>>>
>>>>
>>>> Gesendet: Mittwoch, 22. Oktober 2014 um 10:43 Uhr
>>>> Von: "Tudor Girba" <tudor(a)tudorgirba.com>
>>>> An: "Pharo Development List" <pharo-dev(a)lists.pharo.org>
>>>> Cc: "Any question about pharo is welcome" <pharo-users(a)lists.pharo.org>
>>>> Betreff: Re: [Pharo-dev] Clickable class side example and initialize methods in Pharo 4.0
>>>>
>>>> Hi Torsten,
>>>>
>>>> Thanks for this. This is indeed the way to go.
>>>>
>>>> Just to let you know, the example infrastructure is also being developed in the context of GT, so we have a healthy interest overlap which is great. Only in our case, the discovery of the example happens through an <example> pragma. Would it be possible to change your slice to use this pragma instead of the example* convention?
>>>>
>>>> Cheers,
>>>> Doru
>>>>
>>>>
>>>>
>>>> On Wed, Oct 22, 2014 at 9:19 AM, Torsten Bergmann <astares(a)gmx.de> wrote:One addition I implemented for Nautilus is that one can run examples directly
>>>> in the browser just by clicking on class side example methods icons.
>>>>
>>>> See https://pharo.fogbugz.com/f/cases/13892/Example-methods-should-be-runnable-…
>>>> for a picture.
>>>>
>>>>
>>>> SO PLEASE: WHEN YOU PROVIDE EXAMPLES IN CLASSES PLEASE PUT THEM ON THE CLASS SIDE
>>>> AND LET THE SELECTOR START WITH "example".
>>>>
>>>> This way people will easily see that it is an example and can run them. Additionally it
>>>> would help to put them into a category like "examples". So be a good citized and
>>>> provide not only class comments but also examples for others to study.
>>>>
>>>>
>>>> Side note:
>>>> ==========
>>>> It is also possible to click on the icon of class side initialize methods so the
>>>> class get reinitialized (after a confirmation to avoid false clicking).
>>>>
>>>> https://pharo.fogbugz.com/f/cases/13894/Class-side-initialize-methods-shoul…
>>>>
>>>> Both issues are already integrated.
>>>>
>>>> --
>>>> www.tudorgirba.com[http://www.tudorgirba.com]
>>>>
>>>> "Every thing has its own flow"
>>
>
Oct. 22, 2014
Re: [Pharo-users] [Pharo-dev] Clickable class side example and initialize methods in Pharo 4.0
by Alexandre Bergel
I am also not a big fan of using pragmas. To me, it looks like an ad hoc approach to have examples close to the class. In the same spirit: Why not having tests in the same class? Would it not be cool? Of course not.
In Roassal we have a class for examples (similar to TestCase).
Alexandre
> Le 22-10-2014 à 14:51, Thierry Goubier <thierry.goubier(a)gmail.com> a écrit :
>
> Hi all,
>
> by principle, I'd be against extending so much the pragmas... from a design point of view they look like #defines and macros, that is an additional language to learn, without a correct support of the tools (no debug on pragmas, non-obvious behavior triggers, search for pragma users difficult, not documented).
>
> Alexandre, your idea of infering properties from the source code looks a lot more interesting (and with a lot more potential).
>
> Thierry
>
> Le 22/10/2014 19:38, Alexandre Bergel a écrit :
>> Hi!
>>
>> I have doubt that #example: will be enough in the case of Roassal.
>> Having a code example browser is indeed important and having a descent way to search for the examples is also important. I am thinking to stick to #example and infer some categories from the source code (e.g., if the method contains a Zinc class, then it may be categorized in network).
>>
>>
>> Cheers,
>> Alexandre
>>
>>> Le 22-10-2014 à 7:38, Torsten Bergmann <astares(a)gmx.de> a écrit :
>>>
>>> Hi Tudor,
>>>
>>> that should be easy now: look at CompiledMethod>>#isExampleMethod which can be adopted as needed.
>>>
>>> Checking for the <example> pragma could be done this way:
>>>
>>> self pragmas anySatisfy: [:pragma | pragma keyword = #example ]
>>>
>>> but we should think first if this is enough.
>>>
>>> I already proposed to not only annotate with a pragma <example> but additionally give a category.
>>> Like this:
>>>
>>> <example: 'Graphics'>
>>> <example: 'Network'>
>>>
>>> This way we can easily build an example browser for our users where people can go through
>>> their point of interest and browse the examples.
>>>
>>> Maybe we should also rethink pragmas (in Pharo 5.0?) in general to be more Smalltalk
>>> like:
>>>
>>> <Example category: 'Graphics'>
>>>
>>> where Example is a real class in the system (!). One can even make it more explicit
>>> then
>>>
>>> <ExampleCategory graphics>
>>>
>>> with ExampleCategory(class)>>graphics returning a translateable string. People can add
>>> own categories and one easily knows about already available ones.
>>>
>>>
>>> Now that classes can have properties in Pharo 4.0 already I would like to see a unification
>>> for methods and classes here (with the general concept of an "Annotation" in our metamodel).
>>>
>>> In my opinion a method pragma is just a special form of annotating a method.
>>>
>>> And annotating classes is usefull as well (for instance you want to annotate a class with
>>> the appropriate Table name in an ORM framework, ...)
>>>
>>> A comment (in a method or in a class) is also nothing more than a special annotation.
>>> A class/method category is also an annotation. If unified a method or a class could
>>> be in one or more categories. Even a break point for an expression is IMHO just an
>>> annotation.
>>>
>>> Bye
>>> T.
>>>
>>>
>>> Gesendet: Mittwoch, 22. Oktober 2014 um 10:43 Uhr
>>> Von: "Tudor Girba" <tudor(a)tudorgirba.com>
>>> An: "Pharo Development List" <pharo-dev(a)lists.pharo.org>
>>> Cc: "Any question about pharo is welcome" <pharo-users(a)lists.pharo.org>
>>> Betreff: Re: [Pharo-dev] Clickable class side example and initialize methods in Pharo 4.0
>>>
>>> Hi Torsten,
>>>
>>> Thanks for this. This is indeed the way to go.
>>>
>>> Just to let you know, the example infrastructure is also being developed in the context of GT, so we have a healthy interest overlap which is great. Only in our case, the discovery of the example happens through an <example> pragma. Would it be possible to change your slice to use this pragma instead of the example* convention?
>>>
>>> Cheers,
>>> Doru
>>>
>>>
>>>
>>> On Wed, Oct 22, 2014 at 9:19 AM, Torsten Bergmann <astares(a)gmx.de> wrote:One addition I implemented for Nautilus is that one can run examples directly
>>> in the browser just by clicking on class side example methods icons.
>>>
>>> See https://pharo.fogbugz.com/f/cases/13892/Example-methods-should-be-runnable-…
>>> for a picture.
>>>
>>>
>>> SO PLEASE: WHEN YOU PROVIDE EXAMPLES IN CLASSES PLEASE PUT THEM ON THE CLASS SIDE
>>> AND LET THE SELECTOR START WITH "example".
>>>
>>> This way people will easily see that it is an example and can run them. Additionally it
>>> would help to put them into a category like "examples". So be a good citized and
>>> provide not only class comments but also examples for others to study.
>>>
>>>
>>> Side note:
>>> ==========
>>> It is also possible to click on the icon of class side initialize methods so the
>>> class get reinitialized (after a confirmation to avoid false clicking).
>>>
>>> https://pharo.fogbugz.com/f/cases/13894/Class-side-initialize-methods-shoul…
>>>
>>> Both issues are already integrated.
>>>
>>> --
>>> www.tudorgirba.com[http://www.tudorgirba.com]
>>>
>>> "Every thing has its own flow"
>
>
Oct. 22, 2014
Re: [Pharo-users] Citizen example for manipulating a bibtex file
by Sven Van Caekenberghe
> On 22 Oct 2014, at 18:42, Offray Vladimir Luna Cárdenas <offray(a)riseup.net> wrote:
>
> Hi,
>
> Thanks again. I have a small script, using Citezen which does the trick. I can explore and modify the BibTeX File from the playground with this:
>
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> | bibFile bibliography bibStream bibOutputer |
> bibFile := ((FileLocator documents / 'U/Libertadores/Grafoscopio') children
> detect: [:each | each basename endsWith: 'bib' ]).
> bibliography := CZBibParser parse: bibFile contents.
> bibStream := '' writeStream.
> 1 to: (bibliography size) do: [:index |
> (((bibliography entries at: index) fields at: 2) key = 'shorttitle')
> ifTrue: [
> (bibliography entries at: index)
> key: ((bibliography entries at: index) fields at: 2) value].
> bibOutputer := CZBibtexOutputer new.
> bibStream nextPutAll:
> (bibOutputer entryToBibtexString:
> (bibliography entries at: index)); cr.].
> bibliography.
> bibFile writeStreamDo: [:stream |
> stream nextPutAll: bibStream contents withUnixLineEndings ].
> bibStream contents.
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Some constructive comments about your code (smaller is always better, especially for interactive snippets):
- you can change the #detect: to [ :each | each extension = #bib ]
- you can iterate directly over the entries with #do: as in bibliography entries do: [ :each | .. ] which saves you the #at: index
- there are handy unary shortcuts for accessing elements, like #first, #second and so on (up to #ninth) which also save you parenthesis
- you can also construct strings using the idiom String streamContents: [ :bibStream | .. ]
Sorry, these jumped to me when I saw your code, I hope you don't mind ;-)
> I will put some functionality inspired by this on my prototype this weekend.
>
> Cheers,
>
> Offray
>
> On 10/21/2014 01:20 AM, stepharo wrote:
>> Check in the tools there is a bib writer.
>>
>> Stef
>>
>> On 21/10/14 03:33, Offray Vladimir Luna Cárdenas wrote:
>>> Thanks Stef and Damien,
>>>
>>> I have this small script as a proof of concept:
>>>
>>> ===================================
>>> | bibFile bibliography |
>>> bibFile := ((FileLocator documents / 'U/Libertadores/Grafoscopio')
>>> children
>>> detect: [:each | each basename endsWith: 'bib' ]) contents.
>>> bibliography := CZBibParser parse: bibFile.
>>> 1 to: (bibliography size) do: [:index |
>>> (((bibliography entries at: index) fields at: 2) key = 'shorttitle')
>>> ifTrue: [
>>> (bibliography entries at: index)
>>> key: ((bibliography entries at: index) fields at: 2) value
>>> ]].
>>> bibliography.
>>> ===================================
>>>
>>> Now I want to write back the corrected file to the .bib ... just
>>> having problems finding which message does the job. I'll keep searching.
>>>
>>> Cheers,
>>>
>>> Offray
>>>
>>> On 10/16/2014 06:40 AM, Damien Cassou wrote:
>>>> from Damien Pollet:
>>>>
>>>> You will need to load the .bib file from zotero (read the file however
>>>> you like, then pass the stream to the CZ parser). You'll get a
>>>> CZBibSet (I don't recall the name exactly) which represents the
>>>> contents of the file. A Set is composed of entries, each of which has
>>>> a key and a set of fields. Finally, fields accept a few different
>>>> kinds of values.
>>>>
>>>> Your processing is just iterating a set then setting the key of each
>>>> entry (or possibly removing and re-adding the entry, I don't recall if
>>>> it's implemented like a dictionary or more like a list).
>>>>
>>>>
>>>> On Mon, Oct 13, 2014 at 2:57 AM, Offray Vladimir Luna Cárdenas
>>>> <offray(a)riseup.net <mailto:offray@riseup.net>> wrote:
>>>>
>>>> Hi,
>>>>
>>>> I'm using a Zotero collection for keeping track of several
>>>> references I have
>>>> found for my article about the experience of the
>>>> outline/tree-like metaphor
>>>> for writing inside Pharo (as soon as I have a presentable
>>>> working draft I
>>>> hope to share it with you).
>>>>
>>>> Now I want to make a post-processing of the bibtex file exported
>>>> from
>>>> Zotero. The idea is to use "shorttitle" field instead to replace
>>>> the Zotero
>>>> auto-generated one and have custom keys. So for example instead of:
>>>>
>>>> =======
>>>> @misc{_holistic_????,
>>>> title = {Holistic software assessment (Uni Zurich -
>>>> 2011) on Vimeo},
>>>> shorttitle = {Girba-holistic-2011},
>>>> url = {http://vimeo.com/42073344?__from=outro-local
>>>> <http://vimeo.com/42073344?from=outro-local>},
>>>> urldate = {2014-08-19},
>>>> note = {00000}
>>>> }
>>>>
>>>> =======
>>>>
>>>>
>>>> I would like to have:
>>>>
>>>>
>>>> =======
>>>>
>>>> @misc{Girba-holistic-2011,
>>>> title = {Holistic software assessment (Uni Zurich -
>>>> 2011) on Vimeo},
>>>> shorttitle = {Girba-holistic-2011},
>>>> url = {http://vimeo.com/42073344?__from=outro-local
>>>> <http://vimeo.com/42073344?from=outro-local>},
>>>> urldate = {2014-08-19},
>>>> note = {00000}
>>>> }
>>>>
>>>> =======
>>>>
>>>>
>>>> I have already installed Citizen and open it on the browser to
>>>> see the code,
>>>> but I can find any place to start with examples.
>>>>
>>>> Any advice on how to solve this issue will be appreciated.
>>>>
>>>> Cheers,
>>>>
>>>> Offray
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Damien Cassou
>>>> http://damiencassou.seasidehosting.st
>>>>
>>>> "Success is the ability to go from one failure to another without losing
>>>> enthusiasm."
>>>> Winston Churchill
>>>>
>>>
>>>
>>>
>>
>>
>>
>
>
Oct. 22, 2014
Re: [Pharo-users] [Pharo-dev] Clickable class side example and initialize methods in Pharo 4.0
by Thierry Goubier
Hi all,
by principle, I'd be against extending so much the pragmas... from a
design point of view they look like #defines and macros, that is an
additional language to learn, without a correct support of the tools (no
debug on pragmas, non-obvious behavior triggers, search for pragma users
difficult, not documented).
Alexandre, your idea of infering properties from the source code looks a
lot more interesting (and with a lot more potential).
Thierry
Le 22/10/2014 19:38, Alexandre Bergel a écrit :
> Hi!
>
> I have doubt that #example: will be enough in the case of Roassal.
> Having a code example browser is indeed important and having a descent way to search for the examples is also important. I am thinking to stick to #example and infer some categories from the source code (e.g., if the method contains a Zinc class, then it may be categorized in network).
>
>
> Cheers,
> Alexandre
>
>> Le 22-10-2014 à 7:38, Torsten Bergmann <astares(a)gmx.de> a écrit :
>>
>> Hi Tudor,
>>
>> that should be easy now: look at CompiledMethod>>#isExampleMethod which can be adopted as needed.
>>
>> Checking for the <example> pragma could be done this way:
>>
>> self pragmas anySatisfy: [:pragma | pragma keyword = #example ]
>>
>> but we should think first if this is enough.
>>
>> I already proposed to not only annotate with a pragma <example> but additionally give a category.
>> Like this:
>>
>> <example: 'Graphics'>
>> <example: 'Network'>
>>
>> This way we can easily build an example browser for our users where people can go through
>> their point of interest and browse the examples.
>>
>> Maybe we should also rethink pragmas (in Pharo 5.0?) in general to be more Smalltalk
>> like:
>>
>> <Example category: 'Graphics'>
>>
>> where Example is a real class in the system (!). One can even make it more explicit
>> then
>>
>> <ExampleCategory graphics>
>>
>> with ExampleCategory(class)>>graphics returning a translateable string. People can add
>> own categories and one easily knows about already available ones.
>>
>>
>> Now that classes can have properties in Pharo 4.0 already I would like to see a unification
>> for methods and classes here (with the general concept of an "Annotation" in our metamodel).
>>
>> In my opinion a method pragma is just a special form of annotating a method.
>>
>> And annotating classes is usefull as well (for instance you want to annotate a class with
>> the appropriate Table name in an ORM framework, ...)
>>
>> A comment (in a method or in a class) is also nothing more than a special annotation.
>> A class/method category is also an annotation. If unified a method or a class could
>> be in one or more categories. Even a break point for an expression is IMHO just an
>> annotation.
>>
>> Bye
>> T.
>>
>>
>> Gesendet: Mittwoch, 22. Oktober 2014 um 10:43 Uhr
>> Von: "Tudor Girba" <tudor(a)tudorgirba.com>
>> An: "Pharo Development List" <pharo-dev(a)lists.pharo.org>
>> Cc: "Any question about pharo is welcome" <pharo-users(a)lists.pharo.org>
>> Betreff: Re: [Pharo-dev] Clickable class side example and initialize methods in Pharo 4.0
>>
>> Hi Torsten,
>>
>> Thanks for this. This is indeed the way to go.
>>
>> Just to let you know, the example infrastructure is also being developed in the context of GT, so we have a healthy interest overlap which is great. Only in our case, the discovery of the example happens through an <example> pragma. Would it be possible to change your slice to use this pragma instead of the example* convention?
>>
>> Cheers,
>> Doru
>>
>>
>>
>> On Wed, Oct 22, 2014 at 9:19 AM, Torsten Bergmann <astares(a)gmx.de> wrote:One addition I implemented for Nautilus is that one can run examples directly
>> in the browser just by clicking on class side example methods icons.
>>
>> See https://pharo.fogbugz.com/f/cases/13892/Example-methods-should-be-runnable-…
>> for a picture.
>>
>>
>> SO PLEASE: WHEN YOU PROVIDE EXAMPLES IN CLASSES PLEASE PUT THEM ON THE CLASS SIDE
>> AND LET THE SELECTOR START WITH "example".
>>
>> This way people will easily see that it is an example and can run them. Additionally it
>> would help to put them into a category like "examples". So be a good citized and
>> provide not only class comments but also examples for others to study.
>>
>>
>> Side note:
>> ==========
>> It is also possible to click on the icon of class side initialize methods so the
>> class get reinitialized (after a confirmation to avoid false clicking).
>>
>> https://pharo.fogbugz.com/f/cases/13894/Class-side-initialize-methods-shoul…
>>
>> Both issues are already integrated.
>>
>> --
>> www.tudorgirba.com[http://www.tudorgirba.com]
>>
>> "Every thing has its own flow"
>>
>
>
>
Oct. 22, 2014
Re: [Pharo-users] [Pharo-dev] Clickable class side example and initialize methods in Pharo 4.0
by Alexandre Bergel
Hi!
I have doubt that #example: will be enough in the case of Roassal.
Having a code example browser is indeed important and having a descent way to search for the examples is also important. I am thinking to stick to #example and infer some categories from the source code (e.g., if the method contains a Zinc class, then it may be categorized in network).
Cheers,
Alexandre
> Le 22-10-2014 à 7:38, Torsten Bergmann <astares(a)gmx.de> a écrit :
>
> Hi Tudor,
>
> that should be easy now: look at CompiledMethod>>#isExampleMethod which can be adopted as needed.
>
> Checking for the <example> pragma could be done this way:
>
> self pragmas anySatisfy: [:pragma | pragma keyword = #example ]
>
> but we should think first if this is enough.
>
> I already proposed to not only annotate with a pragma <example> but additionally give a category.
> Like this:
>
> <example: 'Graphics'>
> <example: 'Network'>
>
> This way we can easily build an example browser for our users where people can go through
> their point of interest and browse the examples.
>
> Maybe we should also rethink pragmas (in Pharo 5.0?) in general to be more Smalltalk
> like:
>
> <Example category: 'Graphics'>
>
> where Example is a real class in the system (!). One can even make it more explicit
> then
>
> <ExampleCategory graphics>
>
> with ExampleCategory(class)>>graphics returning a translateable string. People can add
> own categories and one easily knows about already available ones.
>
>
> Now that classes can have properties in Pharo 4.0 already I would like to see a unification
> for methods and classes here (with the general concept of an "Annotation" in our metamodel).
>
> In my opinion a method pragma is just a special form of annotating a method.
>
> And annotating classes is usefull as well (for instance you want to annotate a class with
> the appropriate Table name in an ORM framework, ...)
>
> A comment (in a method or in a class) is also nothing more than a special annotation.
> A class/method category is also an annotation. If unified a method or a class could
> be in one or more categories. Even a break point for an expression is IMHO just an
> annotation.
>
> Bye
> T.
>
>
> Gesendet: Mittwoch, 22. Oktober 2014 um 10:43 Uhr
> Von: "Tudor Girba" <tudor(a)tudorgirba.com>
> An: "Pharo Development List" <pharo-dev(a)lists.pharo.org>
> Cc: "Any question about pharo is welcome" <pharo-users(a)lists.pharo.org>
> Betreff: Re: [Pharo-dev] Clickable class side example and initialize methods in Pharo 4.0
>
> Hi Torsten,
>
> Thanks for this. This is indeed the way to go.
>
> Just to let you know, the example infrastructure is also being developed in the context of GT, so we have a healthy interest overlap which is great. Only in our case, the discovery of the example happens through an <example> pragma. Would it be possible to change your slice to use this pragma instead of the example* convention?
>
> Cheers,
> Doru
>
>
>
> On Wed, Oct 22, 2014 at 9:19 AM, Torsten Bergmann <astares(a)gmx.de> wrote:One addition I implemented for Nautilus is that one can run examples directly
> in the browser just by clicking on class side example methods icons.
>
> See https://pharo.fogbugz.com/f/cases/13892/Example-methods-should-be-runnable-…
> for a picture.
>
>
> SO PLEASE: WHEN YOU PROVIDE EXAMPLES IN CLASSES PLEASE PUT THEM ON THE CLASS SIDE
> AND LET THE SELECTOR START WITH "example".
>
> This way people will easily see that it is an example and can run them. Additionally it
> would help to put them into a category like "examples". So be a good citized and
> provide not only class comments but also examples for others to study.
>
>
> Side note:
> ==========
> It is also possible to click on the icon of class side initialize methods so the
> class get reinitialized (after a confirmation to avoid false clicking).
>
> https://pharo.fogbugz.com/f/cases/13894/Class-side-initialize-methods-shoul…
>
> Both issues are already integrated.
>
> --
> www.tudorgirba.com[http://www.tudorgirba.com]
>
> "Every thing has its own flow"
>
Oct. 22, 2014
Re: [Pharo-users] Pharo - OpenDBXDriver: Unsupported data type: UNKNOWN
by bsselfridge@gmail.com
Thank you for responding so quickly. The column in the database is defined as
a time stamp. It seems as though OpenDBX doesn't understand that type. I'll
try setting up date, date time, time, and timestamp columns and see what
happens.
-----
Brad Selfridge
--
View this message in context: http://forum.world.st/Pharo-OpenDBXDriver-Unsupported-data-type-UNKNOWN-tp4…
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
Oct. 22, 2014
Re: [Pharo-users] Citizen example for manipulating a bibtex file
by Offray Vladimir Luna Cárdenas
Hi,
Thanks again. I have a small script, using Citezen which does the trick.
I can explore and modify the BibTeX File from the playground with this:
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
| bibFile bibliography bibStream bibOutputer |
bibFile := ((FileLocator documents / 'U/Libertadores/Grafoscopio') children
detect: [:each | each basename endsWith: 'bib' ]).
bibliography := CZBibParser parse: bibFile contents.
bibStream := '' writeStream.
1 to: (bibliography size) do: [:index |
(((bibliography entries at: index) fields at: 2) key = 'shorttitle')
ifTrue: [
(bibliography entries at: index)
key: ((bibliography entries at: index) fields at: 2) value].
bibOutputer := CZBibtexOutputer new.
bibStream nextPutAll:
(bibOutputer entryToBibtexString:
(bibliography entries at: index)); cr.].
bibliography.
bibFile writeStreamDo: [:stream |
stream nextPutAll: bibStream contents withUnixLineEndings ].
bibStream contents.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
I will put some functionality inspired by this on my prototype this weekend.
Cheers,
Offray
On 10/21/2014 01:20 AM, stepharo wrote:
> Check in the tools there is a bib writer.
>
> Stef
>
> On 21/10/14 03:33, Offray Vladimir Luna Cárdenas wrote:
>> Thanks Stef and Damien,
>>
>> I have this small script as a proof of concept:
>>
>> ===================================
>> | bibFile bibliography |
>> bibFile := ((FileLocator documents / 'U/Libertadores/Grafoscopio')
>> children
>> detect: [:each | each basename endsWith: 'bib' ]) contents.
>> bibliography := CZBibParser parse: bibFile.
>> 1 to: (bibliography size) do: [:index |
>> (((bibliography entries at: index) fields at: 2) key = 'shorttitle')
>> ifTrue: [
>> (bibliography entries at: index)
>> key: ((bibliography entries at: index) fields at: 2) value
>> ]].
>> bibliography.
>> ===================================
>>
>> Now I want to write back the corrected file to the .bib ... just
>> having problems finding which message does the job. I'll keep searching.
>>
>> Cheers,
>>
>> Offray
>>
>> On 10/16/2014 06:40 AM, Damien Cassou wrote:
>>> from Damien Pollet:
>>>
>>> You will need to load the .bib file from zotero (read the file however
>>> you like, then pass the stream to the CZ parser). You'll get a
>>> CZBibSet (I don't recall the name exactly) which represents the
>>> contents of the file. A Set is composed of entries, each of which has
>>> a key and a set of fields. Finally, fields accept a few different
>>> kinds of values.
>>>
>>> Your processing is just iterating a set then setting the key of each
>>> entry (or possibly removing and re-adding the entry, I don't recall if
>>> it's implemented like a dictionary or more like a list).
>>>
>>>
>>> On Mon, Oct 13, 2014 at 2:57 AM, Offray Vladimir Luna Cárdenas
>>> <offray(a)riseup.net <mailto:offray@riseup.net>> wrote:
>>>
>>> Hi,
>>>
>>> I'm using a Zotero collection for keeping track of several
>>> references I have
>>> found for my article about the experience of the
>>> outline/tree-like metaphor
>>> for writing inside Pharo (as soon as I have a presentable
>>> working draft I
>>> hope to share it with you).
>>>
>>> Now I want to make a post-processing of the bibtex file exported
>>> from
>>> Zotero. The idea is to use "shorttitle" field instead to replace
>>> the Zotero
>>> auto-generated one and have custom keys. So for example instead of:
>>>
>>> =======
>>> @misc{_holistic_????,
>>> title = {Holistic software assessment (Uni Zurich -
>>> 2011) on Vimeo},
>>> shorttitle = {Girba-holistic-2011},
>>> url = {http://vimeo.com/42073344?__from=outro-local
>>> <http://vimeo.com/42073344?from=outro-local>},
>>> urldate = {2014-08-19},
>>> note = {00000}
>>> }
>>>
>>> =======
>>>
>>>
>>> I would like to have:
>>>
>>>
>>> =======
>>>
>>> @misc{Girba-holistic-2011,
>>> title = {Holistic software assessment (Uni Zurich -
>>> 2011) on Vimeo},
>>> shorttitle = {Girba-holistic-2011},
>>> url = {http://vimeo.com/42073344?__from=outro-local
>>> <http://vimeo.com/42073344?from=outro-local>},
>>> urldate = {2014-08-19},
>>> note = {00000}
>>> }
>>>
>>> =======
>>>
>>>
>>> I have already installed Citizen and open it on the browser to
>>> see the code,
>>> but I can find any place to start with examples.
>>>
>>> Any advice on how to solve this issue will be appreciated.
>>>
>>> Cheers,
>>>
>>> Offray
>>>
>>>
>>>
>>>
>>> --
>>> Damien Cassou
>>> http://damiencassou.seasidehosting.st
>>>
>>> "Success is the ability to go from one failure to another without losing
>>> enthusiasm."
>>> Winston Churchill
>>>
>>
>>
>>
>
>
>
Oct. 22, 2014
Re: [Pharo-users] Pharo - OpenDBXDriver: Unsupported data type: UNKNOWN
by Esteban Lorenzano
I do not remember exactly, but I think that the type of the column you are trying to parse is not known by the DBXTalk driver.
The type looks like a DateAndTime so you should check whatâs the code it comes and maybe add the type in the conversion table.
Sorry not been able to be more clear, but Iâm talking by memory here :)
Esteban
> On 21 Oct 2014, at 23:47, bsselfridge(a)gmail.com wrote:
>
> Whenever I try to select a table that has timestamp defined columns I'm
> getting the following error:
>
> "OpenDBXDriverError: OpenDBXDriver: Unsupported data type: UNKNOWN, trying
> to parse 2011-03-31 17:38:35"
>
>
> I've traced this down into the NBOpenDBX_ApiH>>odbx_column_type:pos: method.
> I don't know if this is a DBXTalk problem or an OpenDBX problem, or simply
> that OpenDBX does not support timestamp column types for MySQL database.
>
> My system is:
>
> Pharo 3.0.
> MySql
> DBXTalk
>
>
> Thanks,
>
> B Selfridge
>
>
>
> --
> View this message in context: http://forum.world.st/Pharo-OpenDBXDriver-Unsupported-data-type-UNKNOWN-tp4…
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>
Oct. 22, 2014
Re: [Pharo-users] Package Browser 4
by Sven Van Caekenberghe
> On 22 Oct 2014, at 16:17, Hans Schueren <werbung(a)hans-schueren.de> wrote:
>
>
>
>
> Thank you for the information :
>
>
> Yes , the File with the extension .st is in the Pharo directory.
>
> First i couldn't find it by supposing a .txt File.
Good that you found it, these things are so obvious to us that we fail to explain them.
> I have opened the file with a office tool JARTE.
>
> Now it is easy to print my new class out.
>
>
> Remember back when you are a beginner in programming.
>
>
> I realised that Pharo has a huge "Tracking Tools" for engineering concepts and code.
>
> Only step by step learning is possible.
>
>
> Thanks again , and have a nice week.
>
> See you next time , for other Pharo matters , in this "Cinema".
No problem, have fun !
>
> Hello again ,
>
>
> i have searched for a new text file in the Pharo Image folder
>
> that contains the printed version of my class.
>
> There is no text file.
>
>
> I have chosen the "file out " option in Pharo version 3.0
>
> and the book version PBE one click 1.1.
>
>
> At the moment i have only PBE in use for learning.
> There is my new class created.
>
>
> If you want i can make a screen video and sending with e-mail
> of the "File out" session ,
>
> that you can see , that there is no new text file.
>
>
>
>
> regards
>
> hans
>
>
>
>
>
>
>
>
>
>
>
> Just one thing for description of the hardcopy :
>
> Yes ; a browser inside the system is much better.
>
>
> The only reason to make a hardcopy in the form of a list is to
>
> have a "Analog view" of the interdependencies of the whole package.
>
>
> You know that in the job as electrician.
>
> You can measure the power from a plug with
>
> a digital or with a analog meter. Or with a combination of that.
>
>
> I am only a beginner. But to have paper makes the opportunity to
>
> make lines and notes with interdependencies REAL in ONE view.
>
>
> Such like to make a flow diagram of the whole Software
>
> in Basic language. ( My languages are Smalltalk 80 and Liberty Basic. )
>
>
>
> Regards
>
> Hans
>
>
>
>
>
>
>
>
>
>
>
> Thank you for the answer.
>
> I have chosen " FILE OUT ".
>
> Let me aks : Who is the file then. On what location ? "
>
> I only have seen that Pharo has make a snapshot of the
>
> " Package-Class-Protokoll-Methods".
>
> After this snapshot the printer is not started.
>
> Therfore i suppose that a File has been made in any Folder.
>
>
> Regards
>
> Hans
>
>
>
>
>
>
>
> Hallo fellows,
>
> i have just started with smalltalk programming Pharo.
>
> Could you help me in one question please ?
>
> Its simple :
>
> After already performed a own NEW CLASS in the class browser ,
>
> it is very convenient to PRINT OUT the complete Class ,
>
> together with protokoll and methods in a LIST FORM ,
>
> in HARD COPY on a Printer.
>
>
> Just to "have" the class and see it on real paper.
>
>
> I couldnt find any advice in books or help.
>
>
>
>
> regards
>
> Hans
>
>
>
>
>
>
Oct. 22, 2014