Re: [Pharo-users] Understanding DateTime and Locale and formatting times in a locale?

2017-07-14 Thread Norbert Hartl
Have a look at #asLocal

Norbert

> Am 14.07.2017 um 23:04 schrieb Tim Mackinnon :
> 
> Hi - I’m really confused about DateAndTime support in Pharo?
> 
> If I have a server app running in the EU, and a user makes a request from 
> Canada, and I want to format the time they see to be in their timezone - how 
> do I do that with the classes in Pharo?
> 
> I can ask for a DataAndTime nowUTC, and if I know the user is in en-CA, I can 
> create a Locale for them - but then how do I get the correct time offset, or 
> how to I format that UTC date in their locale?
> 
> Tim



Re: [Pharo-users] installing iceberg

2017-07-08 Thread Norbert Hartl


> Am 08.07.2017 um 08:24 schrieb Stephane Ducasse :
> 
> Sergio
> 
> You should pay attention we discovered incompatibilities in the libgit lib.
> So we will produce a Pharo 6.0.1.

I hope it is 6.1
> 
> Now did you try the latest VM because it should contain the latest
> version of the plugin.
> Now I do not know what is the status of the of the 64bits. Sven
> mentioned that he was using it with iceberg.
> 
32bits works fine. 64 bits needs to reinstall iceberg but works fine then. The 
6.1 willmake that integration so 64 bits will be just fine

Norbert
> Stef
> 
> 
>> On Thu, Jul 6, 2017 at 11:02 PM, sergio ruiz  wrote:
>> Hi, all..
>> 
>> I am trying to install iceberg, and am running into a problem finding
>> iceberg..
>> 
>> looks like i am missing ibgit2.dylib' 'libgit2.0.dylib’
>> 
>> running macOS..
>> 
>> any ideas? thanks!
>> 
>> 
>> peace,
>> sergio
>> photographer, journalist, visionary
>> 
>> Public Key: http://bit.ly/29z9fG0
>> #BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV
>> http://www.Village-Buzz.com
>> http://www.ThoseOptimizeGuys.com
>> http://www.coffee-black.com
>> http://www.painlessfrugality.com
>> http://www.twitter.com/sergio_101
>> http://www.facebook.com/sergio101



Re: [Pharo-users] PharoJS

2017-06-28 Thread Norbert Hartl
Sorry for being late with my reply. Comments at the bottom.

> Am 22.06.2017 um 20:01 schrieb askoh :
> 
> Norbert:
> 
> I appreciate you explanation of Amber and PharoJS. I feel at a lost
> understanding the plethora of Smalltalk + Web frameworks. Is there a place
> where there is a pros and cons comparison of frameworks:
> Seaside, SqueakJS, PharoJS, Amber, Caffeine, VisualWorks Appex, Illiad,
> Aida, Teapot, etc?
> 
> The sheer number of frameworks just makes it difficult for anyone to commit.
> It is terrifying. Can we discuss and consolidate the best features into one
> or two and kill the rest?
> 

No, I don't think that would work. The web is a combination of resource linking 
and remote procedure calls. Web technology is really complex and is able to 
serve a huge amount of use cases. I don't think there can be one framework 
solving all the problems for all the use cases. So every framework focusses on 
a different aspect. 
I would turn your comment around. If you want to be successful in the web 
environment you need to learn about the fibres it is made of. As soon as you 
dive into I think all those frameworks will separate before your eyes quickly.

Maybe it is good that you first come up with a problem you want to solve. With 
that specific information there are a lot of people here that can guide you. 
I'm being one of them. So just ask.

Hope that helps,

Norbert



Re: [Pharo-users] [ANN] success story: surgery appointments digitalised

2017-06-23 Thread Norbert Hartl

> Am 22.06.2017 um 14:45 schrieb Sven Van Caekenberghe <s...@stfx.eu>:
> 
>> 
>> On 22 Jun 2017, at 14:40, Norbert Hartl <norb...@hartl.name> wrote:
>> 
>> I'm sorry I forgot to post this much earlier. Anyway….
>> 
>> We are proud to add another success story to the pharo portfolio
>> 
>> http://zweidenker.de/en/project/operationstermine-digitalisiert
>> 
>> It is an operation planning tool for an eye surgery clinic. The core system 
>> is pharo4 and voyage (using mongo). The user interface is done with seaside. 
>> It interfaces with a legacy patient information system, microsoft exchange 
>> and other stuff in order to orchestrate the arrangement of surgery dates. 
>> The tool automates planning (which doctor works on which day and has still 
>> time to do the operation,….). Finalized plans are produced in PDF an printed 
>> by the staff.
> 
> Very nice, well done !
> 
>> This as a short info. If you have question don't hesitate to ask.
> 
> Yes, what's up with the hipster photographs at 
> http://zweidenker.de/en/about-us <http://zweidenker.de/en/about-us> ? 
> Just kidding, nice website !
> 
thanks!

Norbert


>> Implanting more pharo everywhere :)
>> 
>> Norbert



Re: [Pharo-users] [ANN] success story: surgery appointments digitalised

2017-06-23 Thread Norbert Hartl

> Am 22.06.2017 um 17:43 schrieb Ben Coman <b...@openinworld.com>:
> 
> 
> On Thu, Jun 22, 2017 at 8:40 PM, Norbert Hartl <norb...@hartl.name 
> <mailto:norb...@hartl.name>> wrote:
> It interfaces with a legacy patient information system, microsoft exchange 
> and other stuff in order to orchestrate the arrangement of surgery dates. The 
> tool automates planning (which doctor works on which day and has still time 
> to do the operation,….). Finalized plans are produced in PDF an printed by 
> the staff.
> 
> This as a short info. If you have question don't hesitate to ask.
> 
> Implanting more pharo everywhere :)
> 
> Great to hear of your success here.  
> 
> There must be a massive market like this...   "Unfortunately XXX didn't offer 
> a proper interface, so we had to dive into the depths of their data base for 
> reverse engineering, to be able to reconstruct functionalities" 
> and if Pharo's liveness helped in this reverse engineering, that would make a 
> great marketing blog post fro you and Pharo... "How a niche language gives us 
> the superpowers to do what others can't."  hehe...
> 
Indeed the market is huge. Pharo was of help here but would have been a huge 
help if an oracle driver would have been existed. The biggest problem so far is 
that it seems they managed to get mixed character encoding in their database. 
That is close to impossible to solve. 

Norbert


  



Re: [Pharo-users] PharoJS

2017-06-22 Thread Norbert Hartl

> Am 22.06.2017 um 17:53 schrieb Ben Coman :
> 
> 
> 
> On Thu, Jun 22, 2017 at 9:38 PM, andrew glynn  > wrote:
> I was wondering:
> 
> a) I'm assuming PharoJS would be much like Amber but inside the Pharo VM.
> 
> I'm only slightly familiar with PharoJS, but I believe its quite different...
> https://www.youtube.com/watch?v=XWd2mCQPZUU 
> 
> 
It is. Amber bootstraps a complete smalltalk system in javascript. Even the IDE 
is done that way so you have everything in the browser. It is a nice idea but 
suffers from the lack of development around the IDE. So the tools while being 
impressive are not pure fun to work with. That is the point PharoJS does 
better. It works with pharo connects to a web browser or node.js instance. It 
takes smalltalk code and transpiles them to javascript removing the need to 
have the complete smalltalk environment with the generated javascript. PharoJS 
uses a socket connection between the browser and the pharo image so you can 
inject and inspect things on the page. The code gets transpiled and transmitted 
whenver something changes. IMHO PharoJS lacks a definition of a browser DOM so 
you can develop nicer. But it is quite impressive though.

Norbert




Re: [Pharo-users] [Pharo-dev] vested interest in PharoJS?

2017-06-22 Thread Norbert Hartl

> Am 22.06.2017 um 13:57 schrieb Siemen Baader <siemenbaa...@gmail.com>:
> 
> Very cool, Norbert. I have been watching what you are doing at 2denker and 
> thought you might be interested ;)
> 
> What is holding you back - do you need more from PharoJS before starting to 
> use it commercially, or are you waiting for a (paid) project before you can 
> start?
> 
What is keeping me? A project and the feasibility. The amber project we could 
do because the project was more of a research project so I said "why not". For 
anything serious you need to check if it is feasible to use. And my trials with 
PharoJS were only little so I don't have the feeling, yet, if it is a huge 
benefit using it. But I feel a huge potential in it so it is on my list of 
things I wanna try but not on top.

Norbert


> -- Siemen
> 
> On Thu, Jun 22, 2017 at 1:08 PM, Norbert Hartl <norb...@hartl.name 
> <mailto:norb...@hartl.name>> wrote:
> I thought I responded already. We are interested in pharoJS. We developed 
> stuff with amber but stopped using it. We have one app in the app store with 
> ionic and amber and I'd like to do another one with pharoJS. Additionally I 
> think that combining pharoJS with electron could be a nice thing to have in 
> order to create desktop apps. And finally I was shortly researching native 
> callouts from javascript with javascript core on ios and it seems you can do 
> pharo code, transpile to javascript that calls javascript functions which are 
> OS-native functions.
> 
> Norbert
> 
> > Am 14.06.2017 um 11:46 schrieb Siemen Baader <siemenbaa...@gmail.com 
> > <mailto:siemenbaa...@gmail.com>>:
> >
> > Hi all,
> >
> > Is anyone else interested in PharoJS and making it mature for their own 
> > commercial mobile and single page web app (and node.js) development?
> >
> > I think it has a huge potential because it brings the browser runtime and 
> > many libraries and online services from the JS world to us Smalltalkers 
> > while letting us keep our agile development and good CS practices. But it 
> > does not yet have the necessary features and documentation to work smoothly.
> >
> > -- Siemen
> 
> 



[Pharo-users] [ANN] success story: surgery appointments digitalised

2017-06-22 Thread Norbert Hartl
I'm sorry I forgot to post this much earlier. Anyway….

We are proud to add another success story to the pharo portfolio

http://zweidenker.de/en/project/operationstermine-digitalisiert 


It is an operation planning tool for an eye surgery clinic. The core system is 
pharo4 and voyage (using mongo). The user interface is done with seaside. It 
interfaces with a legacy patient information system, microsoft exchange and 
other stuff in order to orchestrate the arrangement of surgery dates. The tool 
automates planning (which doctor works on which day and has still time to do 
the operation,….). Finalized plans are produced in PDF an printed by the staff.

This as a short info. If you have question don't hesitate to ask.

Implanting more pharo everywhere :)

Norbert



Re: [Pharo-users] [Pharo-dev] vested interest in PharoJS?

2017-06-22 Thread Norbert Hartl
I thought I responded already. We are interested in pharoJS. We developed stuff 
with amber but stopped using it. We have one app in the app store with ionic 
and amber and I'd like to do another one with pharoJS. Additionally I think 
that combining pharoJS with electron could be a nice thing to have in order to 
create desktop apps. And finally I was shortly researching native callouts from 
javascript with javascript core on ios and it seems you can do pharo code, 
transpile to javascript that calls javascript functions which are OS-native 
functions.

Norbert

> Am 14.06.2017 um 11:46 schrieb Siemen Baader :
> 
> Hi all, 
> 
> Is anyone else interested in PharoJS and making it mature for their own 
> commercial mobile and single page web app (and node.js) development?
> 
> I think it has a huge potential because it brings the browser runtime and 
> many libraries and online services from the JS world to us Smalltalkers while 
> letting us keep our agile development and good CS practices. But it does not 
> yet have the necessary features and documentation to work smoothly.
> 
> -- Siemen



Re: [Pharo-users] Pharo Catalog tags

2017-06-16 Thread Norbert Hartl
It appears for pharo6 if the ConfigurationOf is put in the MetaRepoForPharo6. 
On the next day it should appear because the catalog process runs at midnight

Norbert

> Am 16.06.2017 um 09:42 schrieb Johan Brichau :
> 
> Hi,
> 
> Does anyone know why Grease does not show ‘Pharo6’ tag in the Pharo catalog 
> browser?
> Seaside3 does… 
> 
> I don’t know what needs to be done for that..
> 
> cheers
> Johan



Re: [Pharo-users] [ANN] Pharo 6.0 released!

2017-06-06 Thread Norbert Hartl
It is really great! Thank you all! I'm glad the struggles with 32 bit libraries 
will have an end for normal deployments. The same goes for uFFI that makes 
things so much easier. And of course the rest of the list of changes is 
impressive as always.

Glad to be part of this community. You rock!

Norbert

> Am 06.06.2017 um 17:11 schrieb Esteban Lorenzano <esteba...@gmail.com>:
> 
> Dear World,
> 
> The time has come for Pharo 6.0!
> 
> Pharo is a pure object-oriented programming language and a powerful 
> environment, focused on simplicity and immediate feedback.
> 
> This is our most significant release yet. Here are some highlights:
> 
> - Pharo is now provided in 64-bit version in Linux and OSX and brings even 
> better performance and stability (beware, 64bits version is a new technology 
> and a small amount of tests is still failing)
> - A new code changes management system named Epicea for easier reviewing and 
> recovering of your code easily
> - Integrated support for Git through an easy-to-use tool for repositories and 
> commits management named Iceberg (as a preview for Pharo 6, it will be the 
> default in Pharo 7)
> - The unified foreign function interface (UnifiedFFI) for interfacing with 
> the outside world is significantly improved
> - The PharoVM is now part of OpenSmalltalk initiative
> - Introduction of object immutability, alternative bytecode sets and block 
> closures independent of outer context
> - Pharo can now be bootstrapped from source code managed by Git
> - Pharo modularity is improved
> - Pharo is faster
> - The Dark Theme was improved and set as default color theme of Pharo
> 
> 
> 
> These are just the more prominent highlights, but the details are just as 
> important. We have closed 1474 issues in Pharo 6.0 (a more complete changelog 
> can be found at 
> https://github.com/pharo-project/pharo-changelogs/blob/master/Pharo60ChangeLogs.md
>  
> <https://github.com/pharo-project/pharo-changelogs/blob/master/Pharo60ChangeLogs.md>).
>  
> 
> While the technical improvements are significant (starting the transition to 
> 64bits is a remarkable achievement), still the most impressive fact is that 
> the new code that got in the main Pharo 6.0 image was contributed by more 
> than 80 people.
> 
> Pharo is more than code. It is an exciting project involving energetic 
> people. We thank all the contributors of this release:
> 
> Alberto Bacchelli, Alejandro Infante, Alexandre Bergel, Aliaksei Syrel, 
> Alistair Grant, Andrei Chis, Ben Coman, Bernardo Contreras, Bernhard Pieber, 
> Boris Spasojevic, Christophe Demarey, Clement Bera, Cyril Ferlicot, Dale 
> Henrichs, Damien Cassou, Damien Pollet, Dave Lewis, Denis Kudriashov, Dirk 
> Roeleveld, Eliot Miranda, Esteban Lorenzano, Esteban Maringolo, Evan Donahue, 
> Federico Balaguer, Franck Warlouzet, Glenn Cavarle, Guillermo Polito, Gustavo 
> Santos, Henrik Johansen, Henrik Nergaard, Hilaire Fernandes, Holger Hans, Jan 
> Kurs, Jan van de Sandt, Johan Fabry, Juraj Kubelka, K. K. Subramaniam, Ken 
> Causey, Kris Gybels, Lionel Akue, Luc Fabresse, Lucas Godoy, Marcus Denker, 
> Mariano Martinez Peck, Marion Noirbent, Martin Dias, Max Leske, Maxime 
> Roelandt, Merwan Ouddane, Matteo Bellotto, Miguel Campusano, Milton Mamani, 
> Myroslava Romaniuk, Nicolai Hess, Nicolas Cellier, Nicolas Passerini, Norbert 
> Hartl, Offray Luna, Pablo Tesone, Paul De Bruicker, Pavel Krivanek, Peter 
> Uhnak, Philippe Back, Roger Stebler, Ronie Salgado, Sean DeNigris, Serge 
> Stinckwich, Skip Lentz, Sophie Kaleba, Stefan Reichhart, Stephan Eggermont, 
> Stephane Ducasse, Sven Van Caekenberghe, Thibault Arloing, Thibault Arloing, 
> Thibault Raffaillac, Thierry Goubier, Thomas Heniart, Tommaso Dal Sasso, 
> Torsten Bergmann, Tudor Girba, Udo Schneider, Valentin Ryckewaert, Vincent 
> Blondeau, Werner Kassens, Yuriy Tymchuk
> 
> (If you contributed with Pharo 6.0 development in any way and we missed your 
> name, please send us a mail and we will add you).
> 
> Enjoy!
> 
> The Pharo Team
> 
> Try Pharo: http://pharo.org/download <http://pharo.org/download>
> Learn Pharo: http://pharo.org/documentation <http://pharo.org/documentation>


Re: [Pharo-users] Mustache: Making a conditional section show its values.

2017-05-30 Thread Norbert Hartl
Offray,

> Am 30.05.2017 um 02:45 schrieb Offray Vladimir Luna Cárdenas 
> <offray.l...@mutabit.com>:
> 
> Norbert,
> 
> Dot notation solves the issue and [1] works as expected.
> 
> =[1]
> 
> '{{#twitter}}
>  
>
>  Twitter  
>
>  https://twitter.com/{{.}};>
>{{.}}
>  
> {{/twitter}}' asMustacheTemplate value: { #twitter -> '@offrayLC'   }
> asDictionary
> 
> ===
> 
> Thanks for the work on Mustache and the Enterprise Pharo chapter. Is a
> really good written book (so far I have read the Mustache, Teapot and
> ZnServer chapters). I wonder if there is a place for extensions and
> clarifications of this book in its online version, for example,
> regarding dot notation.
> 
the credits for the enterprise chapter go to Stef. He does the annoying task of 
collecting information and make them publishable. 
The book is supposed to be a community effort. So if you have something to add 
I think pull requests are highly welcomed. And the dot notation is good thing 
to add You can just add a few sentences...

glad it works for you,

Norbert
> Cheers,
> 
> Offray
> 
>> On 29/05/17 16:48, Norbert Hartl wrote:
>> Offray,
>> 
>> I think I didn't get what you want at first. When using a section in 
>> mustache {{#twitter}} then the object value of the key twitter becomes the 
>> current context. Every property is resolved relative to this current 
>> context. If you want to use the current context itself as value you can use 
>> the dot notation {{ . }}. There was a problem when this context itself is a 
>> string. I solved that a year ago but I've seen that the newest configuration 
>> was not in the MetaRepo. It means if you loaded mustache from the catalog 
>> then you loaded a slightly older version that doesn't include that fix. I've 
>> update all MetaRepos from pharo4 to pharo6 for the newest configuration. If 
>> you load it now it should work.
>> 
>> hope that helps,
>> 
>> Norbert
>> 
>>> Am 29.05.2017 um 17:15 schrieb Offray Vladimir Luna Cárdenas 
>>> <offray.l...@mutabit.com>:
>>> 
>>> Yes I can share the data. Please load Brea project from [1] and do:
>>> 
>>> =
>>> 
>>> | testUser  |
>>> testUser := BreaMember new createTestUser.
>>> testUser html
>>> 
>>> =
>>> 
>>> [1] http://smalltalkhub.com/#!/~Offray/Brea
>>> 
>>> 
>>> You will see that the twitter portion of the row is showed, but without
>>> any actual data inside. You can also try this:
>>> 
>>> =
>>> '{{#twitter}}
>>>
>>>  >> class="mdl-data-table__cell--non-numeric">Twitter  
>>>      
>>>>> href="https://twitter.com/{{twitter}};>{{twitter}}
>>>
>>> {{/twitter}}' asMustacheTemplate value: { #twitter -> '@offrayLC'   }
>>> asDictionary
>>> =
>>> 
>>> with the same behavior.
>>> 
>>> I think that the proper output will be the row showed with the data
>>> inside filled.
>>> 
>>> Let me know how can I help to debug this.
>>> 
>>> Thanks,
>>> 
>>> Offray
>>> 
>>>> On 29/05/17 09:26, Norbert Hartl wrote:
>>>> To clarify. If the object you inject has a value which either does not 
>>>> contain the key twitter or it does container the key twitter but its value 
>>>> is nil then the section won't be shown.
>>>> 
>>>> '{{#twitter}}
>>>>
>>>>  >>> class="mdl-data-table__cell--non-numeric">Twitter   
>>>>  
>>>>>>> href="https://twitter.com/{{twitter}};>{{twitter}}
>>>>
>>>> {{/twitter}}' asMustacheTemplate value: { #twitter -> nil   } asDictionary
>>>> 
>>>> gives empty string in my case.
>>>> 
>>>> Norbert
>>>> 
>>>>> Am 29.05.2017 um 16:20 schrieb Norbert Hartl <norb...@hartl.name>:
>>>>> 
>>>>> Can you show some data you are injecting? It should work as you expect it.
>>>>> 
>>>>> Norbert
>>>>> 
>>>>>> Am 29.05.2017 um 15:26 schrieb Offray Vladimir Luna Cárdenas 
>>>>>> <offray.l...@mutabit.com>:
>>>>>> 
>>>>>> Hi,
>>>>>> 
>>>>>> I'm using Mustache for a project to build a dynamic distributed web site
>>>>>> generator for public & open data, backed by Fossil and using Material
>>>>>> Design Lite. I have a template like this:
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> {{#twitter}}
>>>>>>   
>>>>>> >>>>> class="mdl-data-table__cell--non-numeric">Twitter   
>>>>>> 
>>>>>>   >>>>> href="https://twitter.com/{{twitter}};>{{twitter}}
>>>>>>   
>>>>>> {{/twitter}}
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> that is mean to show or hide a row in a table, depending on if Twitter
>>>>>> data for a profile is found in a user profile. When the profile doesn't
>>>>>> have twitter data, the row is hidden, as supposed, and when it has, the
>>>>>> row is shown, but without any actual twitter data. What I'm missing?
>>>>>> Should I use partials in this case and how?
>>>>>> 
>>>>>> Thanks,
>>>>>> 
>>>>>> Offray
>>>>>> 
>>>>>> 
>>>>>> 
>>>> 
>>> 
>>> 
>> 
>> 
> 
> 




Re: [Pharo-users] Mustache: Making a conditional section show its values.

2017-05-29 Thread Norbert Hartl
Offray,

I think I didn't get what you want at first. When using a section in mustache 
{{#twitter}} then the object value of the key twitter becomes the current 
context. Every property is resolved relative to this current context. If you 
want to use the current context itself as value you can use the dot notation {{ 
. }}. There was a problem when this context itself is a string. I solved that a 
year ago but I've seen that the newest configuration was not in the MetaRepo. 
It means if you loaded mustache from the catalog then you loaded a slightly 
older version that doesn't include that fix. I've update all MetaRepos from 
pharo4 to pharo6 for the newest configuration. If you load it now it should 
work.

hope that helps,

Norbert
 
> Am 29.05.2017 um 17:15 schrieb Offray Vladimir Luna Cárdenas 
> <offray.l...@mutabit.com>:
> 
> Yes I can share the data. Please load Brea project from [1] and do:
> 
> =
> 
> | testUser  |
> testUser := BreaMember new createTestUser.
> testUser html
> 
> =
> 
> [1] http://smalltalkhub.com/#!/~Offray/Brea
> 
> 
> You will see that the twitter portion of the row is showed, but without
> any actual data inside. You can also try this:
> 
> =
> '{{#twitter}}
> 
>class="mdl-data-table__cell--non-numeric">Twitter  
>   
>  href="https://twitter.com/{{twitter}};>{{twitter}}
> 
> {{/twitter}}' asMustacheTemplate value: { #twitter -> '@offrayLC'   }
> asDictionary
> =
> 
> with the same behavior.
> 
> I think that the proper output will be the row showed with the data
> inside filled.
> 
> Let me know how can I help to debug this.
> 
> Thanks,
> 
> Offray
> 
> On 29/05/17 09:26, Norbert Hartl wrote:
>> To clarify. If the object you inject has a value which either does not 
>> contain the key twitter or it does container the key twitter but its value 
>> is nil then the section won't be shown.
>> 
>> '{{#twitter}}
>> 
>>   > class="mdl-data-table__cell--non-numeric">Twitter   
>>   
>> > href="https://twitter.com/{{twitter}};>{{twitter}}
>> 
>> {{/twitter}}' asMustacheTemplate value: { #twitter -> nil   } asDictionary
>> 
>> gives empty string in my case.
>> 
>> Norbert
>> 
>>> Am 29.05.2017 um 16:20 schrieb Norbert Hartl <norb...@hartl.name>:
>>> 
>>> Can you show some data you are injecting? It should work as you expect it.
>>> 
>>> Norbert
>>> 
>>>> Am 29.05.2017 um 15:26 schrieb Offray Vladimir Luna Cárdenas 
>>>> <offray.l...@mutabit.com>:
>>>> 
>>>> Hi,
>>>> 
>>>> I'm using Mustache for a project to build a dynamic distributed web site
>>>> generator for public & open data, backed by Fossil and using Material
>>>> Design Lite. I have a template like this:
>>>> 
>>>> 
>>>> 
>>>> {{#twitter}}
>>>>
>>>>  >>> class="mdl-data-table__cell--non-numeric">Twitter   
>>>>  
>>>>>>> href="https://twitter.com/{{twitter}};>{{twitter}}
>>>>
>>>> {{/twitter}}
>>>> 
>>>> 
>>>> 
>>>> that is mean to show or hide a row in a table, depending on if Twitter
>>>> data for a profile is found in a user profile. When the profile doesn't
>>>> have twitter data, the row is hidden, as supposed, and when it has, the
>>>> row is shown, but without any actual twitter data. What I'm missing?
>>>> Should I use partials in this case and how?
>>>> 
>>>> Thanks,
>>>> 
>>>> Offray
>>>> 
>>>> 
>>>> 
>>> 
>> 
>> 
> 
> 
> 




Re: [Pharo-users] Mustache: Making a conditional section show its values.

2017-05-29 Thread Norbert Hartl
To clarify. If the object you inject has a value which either does not contain 
the key twitter or it does container the key twitter but its value is nil then 
the section won't be shown.

'{{#twitter}}
 
   Twitter   
   
 https://twitter.com/{{twitter}};>{{twitter}}
 
{{/twitter}}' asMustacheTemplate value: { #twitter -> nil   } asDictionary

gives empty string in my case.

Norbert
 
> Am 29.05.2017 um 16:20 schrieb Norbert Hartl <norb...@hartl.name>:
> 
> Can you show some data you are injecting? It should work as you expect it.
> 
> Norbert
> 
>> Am 29.05.2017 um 15:26 schrieb Offray Vladimir Luna Cárdenas 
>> <offray.l...@mutabit.com>:
>> 
>> Hi,
>> 
>> I'm using Mustache for a project to build a dynamic distributed web site
>> generator for public & open data, backed by Fossil and using Material
>> Design Lite. I have a template like this:
>> 
>> 
>> 
>> {{#twitter}}
>> 
>>   > class="mdl-data-table__cell--non-numeric">Twitter   
>>   
>> > href="https://twitter.com/{{twitter}};>{{twitter}}
>> 
>> {{/twitter}}
>> 
>> 
>> 
>> that is mean to show or hide a row in a table, depending on if Twitter
>> data for a profile is found in a user profile. When the profile doesn't
>> have twitter data, the row is hidden, as supposed, and when it has, the
>> row is shown, but without any actual twitter data. What I'm missing?
>> Should I use partials in this case and how?
>> 
>> Thanks,
>> 
>> Offray
>> 
>> 
>> 
> 
> 




Re: [Pharo-users] Mustache: Making a conditional section show its values.

2017-05-29 Thread Norbert Hartl
Can you show some data you are injecting? It should work as you expect it.

Norbert

> Am 29.05.2017 um 15:26 schrieb Offray Vladimir Luna Cárdenas 
> :
> 
> Hi,
> 
> I'm using Mustache for a project to build a dynamic distributed web site
> generator for public & open data, backed by Fossil and using Material
> Design Lite. I have a template like this:
> 
> 
> 
> {{#twitter}}
>  
> class="mdl-data-table__cell--non-numeric">Twitter   
>
>   href="https://twitter.com/{{twitter}};>{{twitter}}
>  
> {{/twitter}}
> 
> 
> 
> that is mean to show or hide a row in a table, depending on if Twitter
> data for a profile is found in a user profile. When the profile doesn't
> have twitter data, the row is hidden, as supposed, and when it has, the
> row is shown, but without any actual twitter data. What I'm missing?
> Should I use partials in this case and how?
> 
> Thanks,
> 
> Offray
> 
> 
> 




Re: [Pharo-users] mustache questions

2017-05-25 Thread Norbert Hartl

> Am 25.05.2017 um 17:00 schrieb Stephane Ducasse :
> 
> Hi Norbert
> 
> Pillar uses Mustache: it generate a json file and take the template and ask 
> mustache to do the inlining. 
> Now I just hate the idea that we have objects that we should save in file to 
> produce other files...
> 
> Do you know if we could use mustache directly: i.e., get the text from 
> object, get the template and inject it directly without saving to json files, 
> loading from json files
> 
Sure, that is the normal behavior.

'Hello {{ name }} !' asMustacheTemplate value: { 'name' -> 'Stef' } 
asDictionary 

if the template is in a file

'hello.templ' asFileReference asMustacheTemplate value: { 'name' -> 'Stef' } 
asDictionary .

I talked to Damien back then but I never understood why that configuration file 
was so important. For that they needed to add a CLI option for mustache. But I 
cannot recall exactly what were the reasons.

Does that answer your question?

Norbert


[Pharo-users] Pharo 6

2017-05-25 Thread Norbert Hartl
What happened to Pharo 6. Postponing is understandable while not dropping a 
note about it, is not.
What is the next best release date?

Or did I just miss something?

Norbert



Re: [Pharo-users] [Zinc] ZnInvalidUTF8: Illegal leading byte for utf-8 encoding

2017-05-12 Thread Norbert Hartl
Just to mention. If you are not interested in the content body you could do a 
HEAD request instead of GET. 

Norbert

> Am 11.05.2017 um 22:44 schrieb Udo Schneider :
> 
> Hi Sven,
> 
> that's perfect. To be honest I don't care about the content - I'm just 
> parsing the header. And even if there is a wrong decoding in there... I can 
> live with that.
> 
> Thank you very very much! For your help but also your stuff in general.
> 
> CU,
> 
> Udo
> 
> 
>> Am 11/05/17 um 22:35 schrieb Sven Van Caekenberghe:
>> Hi Udo,
>>> On 11 May 2017, at 21:37, Udo Schneider  
>>> wrote:
>>> 
>>> All,
>>> 
>>> I'm hitting an error where fetching web content fails. The website does 
>>> indeed use invalid characters.
>>> 
>>> The easiest way to reproduce:
>>> 
>>> ZnEasy get: 
>>> 'http://www.darkreading.com/partner-perspectives/malwarebytes/locky-returns-with-a-new-(borrowed)-distribution-method/a/d-id/1328723'
>>> 
>>> Is there any way to tell Zinc to simply ignore that error and to continue?
>>> 
>>> CU,
>>> 
>>> Udo
>> That server/page has a mime-type text/plain with no explicit encoding 
>> (charset) setting, so we have to guess. Like utf-8, pure latin1/iso88591 
>> does not work. The following does work, but you can't be sure everything 
>> went well (beLenient takes some bytes as they are).
>> ZnDefaultCharacterEncoder
>>   value: ZnCharacterEncoder latin1 beLenient
>>   during: [
>> ZnClient new
>>   get: 
>> 'http://www.darkreading.com/partner-perspectives/malwarebytes/locky-returns-with-a-new-(borrowed)-distribution-method/a/d-id/1328723';
>>   yourself ].
>> I added some API earlier today, so that the following should also work (you 
>> need to load Zn #bleedingEdge first).
>>  ZnClient new
>>   defaultEncoder: ZnCharacterEncoder latin1 beLenient;
>>   get: 
>> 'http://www.darkreading.com/partner-perspectives/malwarebytes/locky-returns-with-a-new-(borrowed)-distribution-method/a/d-id/1328723';
>>   yourself.
>> HTH,
>> Regards,
>> Sven
> 
> 
> 




[Pharo-users] Not much longer...

2017-05-11 Thread Norbert Hartl
On my vacation I saw this progress bar about pharo. So looks close to 6 for me 
:)





Re: [Pharo-users] Petri nets and workflow patterns

2017-05-11 Thread Norbert Hartl

> Am 11.05.2017 um 09:59 schrieb Serge Stinckwich :
> 
> On Wed, May 10, 2017 at 10:09 PM, Stephane Ducasse
>  wrote:
>> Norbert
>> 
>> I know petri nets and I was wondering if you were interested in worklow (as
>> in microworkflow).
>> because I think that a simple extensible workflow library is missing in
>> Pharo
> 
> I guess you talk about this: http://micro-workflow.com/phdthesis/
> 
Is the source code available somewhere?

Norbert




Re: [Pharo-users] Petri nets and workflow patterns

2017-05-11 Thread Norbert Hartl

> Am 11.05.2017 um 09:58 schrieb Serge Stinckwich <serge.stinckw...@gmail.com>:
> 
> On Wed, May 10, 2017 at 6:13 PM, Norbert Hartl <norb...@hartl.name> wrote:
>> 
>>> Am 10.05.2017 um 17:46 schrieb Serge Stinckwich 
>>> <serge.stinckw...@gmail.com>:
>>> 
>>> On Wed, May 10, 2017 at 5:36 PM, Norbert Hartl <norb...@hartl.name> wrote:
>>>> Are there any resources regarding petri nets or control flow…/workflow 
>>>> patterns in pharo or smalltalk?
>>> 
>>> We have done some work with one student of Alexandre about BPMN:
>>> http://a4bp.com/
>>> 
>> I downloaded the app but it opens with a black screen on my Mac laptop.
> 
> Yes this is the usual story  software rots at the end.
> I guess you are using last version of mac os x and the VM provided on
> the web site does not work anymore.
> 
Ah, right. I just need to use my own vm to start it. I'll try again :)

Norbert

> Give me 3 students and I will change this situation ;-)
> I want to continue this work but I have to find motivated students.
> 
>>> and there is PNTalk also:
>>> https://github.com/SergeStinckwich/PNTalk
>>> 
>> Thanks, that is what I was looking for.
>> 
>>> Long time ago I was able to do process mining from logs and generate Petri 
>>> Nets:
>>> https://www.youtube.com/watch?v=wdf80t32v-0
>> 
>> That is really close to what I want to play with. Did you ever encounter van 
>> der Aalst workflow pattern in that context. Do you know any material 
>> comparing the approaches?
> 
> I know van der Aalst work but I don't know exactly what do you mean by
> workflow pattern. The one described here:
> http://www.workflowpatterns.com/patterns/control/index.php
> 
> Regards,
> -- 
> Serge Stinckwich
> UCN & UMI UMMISCO 209 (IRD/UPMC)
> Every DSL ends up being Smalltalk
> http://www.doesnotunderstand.org/
> 




Re: [Pharo-users] Intro to git-only Pharo

2017-05-11 Thread Norbert Hartl

> Am 11.05.2017 um 08:54 schrieb jtuc...@objektfabrik.de:
> 
> Hi Norbert,
> 
> thanks for your explanations. 
> So it seems liek I should start by using Pharo6 and load Iceberg and just 
> take a look.
> 
Yes, iceberg has still some issues but is usable and it will evolve quickly. If 
you are the brave type of guy you can start with pharo6 64bits ;)

Norbert

> Joachim
> 
> 
> 
> Am 10.05.17 um 10:34 schrieb Norbert Hartl:
>> Hi Joachim,
>> 
>> I think your timing is quite good. We had some changes in the last years and 
>> it is getting better now. 
>> Before we had only monticello. Monticello is a zip container that contains a 
>> version number in the filename and prior version pointer inside the 
>> repository. Regarding dependencies there was nothing that was used widely. 
>> Then Metacello appeared and solved the problem by providing dependency 
>> management and versioning of dependencies. Dependency management works good, 
>> the integrated versioning has issues. Especially when you look at a system 
>> like git you can see that versioning is solved there. Filetree is needed 
>> because git and other vcs systems are file based so you need to layout your 
>> code in files (how quaint!)
>> To make a long story short: The best thing to use is git with Metacello 
>> Baselines. Filetree is used to store code. Versioning you do with git tags 
>> that can be used in Baselines. Now we have a decent UI (iceberg) that 
>> supports the most needed workflow items. 
>> We have a UI for the dependency management as well (versionner) but it sadly 
>> targets ConfigurationOfs and not BaselineOfs. That needs to be changed.
>> 
>> my 2 cents,
>> 
>> Norbert
>> 
>>> Am 10.05.2017 um 07:56 schrieb Joachim Tuchel <jtuc...@objektfabrik.de 
>>> <mailto:jtuc...@objektfabrik.de>>:
>>> 
>>> Hi guys,
>>> 
>>> please forgive me if this mail is a sign of ignorance. I am not a regular 
>>> Pharo user and one of the reasons for this is that I didn't like most of 
>>> the source management tools around Monticello. Coming from an envy 
>>> background, it feels like not being ready for prime time. Of course you 
>>> guys have been proving you can work with these tools quite well, but still 
>>> I'd be interested in using Pharo in a pure git-based environment, as it 
>>> most closely resembles some of the most-beloved features of envy.
>>> 
>>> Over the years there was a lot of work and discussion on filetree, 
>>> gitfiletree, iceberg, cypress and maybe quite a few other projects that 
>>> sounded promising and interesting. But I must admit I lost track of what 
>>> was really done and how far things went in the last years.
>>> 
>>> So are there any pointers to info material that I could look at to see what 
>>> the current status of source control in Pharo 5 and Pharo 6 is and/or will 
>>> be soon?
>>> 
>>> I am mostly interested in these topics:
>>> 
>>> git only - no monticello meta info any more - possible?
>>> tools like merge/diff, committing from within the image
>>> dependencies within my own project as well as dependencies on external code 
>>> in - possibly multiple - external repositories
>>> what is the current "most official" source repository for open source code?
>>> best practices for managing complex projects and keeping old versions 
>>> reproducible at any time
>>> tutorial for git newbies in a Pharo context? (Like, how do I start with a 
>>> new packege - create folder first and do git init, or start in the image 
>>> and push into repo later? as I said: beginners' stuff)
>>> Thanks for pointers and help
>>> 
>>> Joachim
>>> 
>> 
> 
> 
> -- 
> ---
> Objektfabrik Joachim Tuchel  mailto:jtuc...@objektfabrik.de 
> <mailto:jtuc...@objektfabrik.de>
> Fliederweg 1 http://www.objektfabrik.de 
> <http://www.objektfabrik.de/>
> D-71640 Ludwigsburg  http://joachimtuchel.wordpress.com 
> <http://joachimtuchel.wordpress.com/>
> Telefon: +49 7141 56 10 86 0 Fax: +49 7141 56 10 86 1
> 



Re: [Pharo-users] Petri nets and workflow patterns

2017-05-11 Thread Norbert Hartl
Hi Stef,

> Am 10.05.2017 um 22:09 schrieb Stephane Ducasse <stepharo.s...@gmail.com>:
> 
> Norbert 
> 
> I know petri nets and I was wondering if you were interested in worklow (as 
> in microworkflow). 
> because I think that a simple extensible workflow library is missing in Pharo

I'm interested in workflow but came to petri nets as they are similar. But I 
don't know what is the real difference between those two. I've read a bit about 
van der Aalst workflow patterns and a revision of Bröger for them. But I know 
too little of the topic. 
We have more projects where we choose a state machine in order to properly 
manage state changes in our applications. In some projects the transitions are 
simple and clear so that they can be described generically. And that brings me 
to workflow and petri nets. A more generic approach will lower the amount of 
code to be written and opens a way to serialize the flow, have a DSL for it or 
use it together with Roassal.

Norbert
 
> Stef
> 
> On Wed, May 10, 2017 at 6:13 PM, Norbert Hartl <norb...@hartl.name 
> <mailto:norb...@hartl.name>> wrote:
> 
> > Am 10.05.2017 um 17:46 schrieb Serge Stinckwich <serge.stinckw...@gmail.com 
> > <mailto:serge.stinckw...@gmail.com>>:
> >
> > On Wed, May 10, 2017 at 5:36 PM, Norbert Hartl <norb...@hartl.name 
> > <mailto:norb...@hartl.name>> wrote:
> >> Are there any resources regarding petri nets or control flow…/workflow 
> >> patterns in pharo or smalltalk?
> >
> > We have done some work with one student of Alexandre about BPMN:
> > http://a4bp.com/ <http://a4bp.com/>
> >
> I downloaded the app but it opens with a black screen on my Mac laptop.
> 
> > and there is PNTalk also:
> > https://github.com/SergeStinckwich/PNTalk 
> > <https://github.com/SergeStinckwich/PNTalk>
> >
> Thanks, that is what I was looking for.
> 
> > Long time ago I was able to do process mining from logs and generate Petri 
> > Nets:
> > https://www.youtube.com/watch?v=wdf80t32v-0 
> > <https://www.youtube.com/watch?v=wdf80t32v-0>
> 
> That is really close to what I want to play with. Did you ever encounter van 
> der Aalst workflow pattern in that context. Do you know any material 
> comparing the approaches?
> 
> thank you very much,
> 
> Norbert
> 
> 
> 



Re: [Pharo-users] Petri nets and workflow patterns

2017-05-10 Thread Norbert Hartl

> Am 10.05.2017 um 17:46 schrieb Serge Stinckwich <serge.stinckw...@gmail.com>:
> 
> On Wed, May 10, 2017 at 5:36 PM, Norbert Hartl <norb...@hartl.name> wrote:
>> Are there any resources regarding petri nets or control flow…/workflow 
>> patterns in pharo or smalltalk?
> 
> We have done some work with one student of Alexandre about BPMN:
> http://a4bp.com/
> 
I downloaded the app but it opens with a black screen on my Mac laptop.

> and there is PNTalk also:
> https://github.com/SergeStinckwich/PNTalk
> 
Thanks, that is what I was looking for. 

> Long time ago I was able to do process mining from logs and generate Petri 
> Nets:
> https://www.youtube.com/watch?v=wdf80t32v-0

That is really close to what I want to play with. Did you ever encounter van 
der Aalst workflow pattern in that context. Do you know any material comparing 
the approaches?

thank you very much,

Norbert




[Pharo-users] Petri nets and workflow patterns

2017-05-10 Thread Norbert Hartl
Are there any resources regarding petri nets or control flow…/workflow patterns 
in pharo or smalltalk?

thanks,

Norbert




Re: [Pharo-users] Intro to git-only Pharo

2017-05-10 Thread Norbert Hartl
Hi Joachim,

I think your timing is quite good. We had some changes in the last years and it 
is getting better now. 
Before we had only monticello. Monticello is a zip container that contains a 
version number in the filename and prior version pointer inside the repository. 
Regarding dependencies there was nothing that was used widely. Then Metacello 
appeared and solved the problem by providing dependency management and 
versioning of dependencies. Dependency management works good, the integrated 
versioning has issues. Especially when you look at a system like git you can 
see that versioning is solved there. Filetree is needed because git and other 
vcs systems are file based so you need to layout your code in files (how 
quaint!)
To make a long story short: The best thing to use is git with Metacello 
Baselines. Filetree is used to store code. Versioning you do with git tags that 
can be used in Baselines. Now we have a decent UI (iceberg) that supports the 
most needed workflow items. 
We have a UI for the dependency management as well (versionner) but it sadly 
targets ConfigurationOfs and not BaselineOfs. That needs to be changed.

my 2 cents,

Norbert

> Am 10.05.2017 um 07:56 schrieb Joachim Tuchel :
> 
> Hi guys,
> 
> please forgive me if this mail is a sign of ignorance. I am not a regular 
> Pharo user and one of the reasons for this is that I didn't like most of the 
> source management tools around Monticello. Coming from an envy background, it 
> feels like not being ready for prime time. Of course you guys have been 
> proving you can work with these tools quite well, but still I'd be interested 
> in using Pharo in a pure git-based environment, as it most closely resembles 
> some of the most-beloved features of envy.
> 
> Over the years there was a lot of work and discussion on filetree, 
> gitfiletree, iceberg, cypress and maybe quite a few other projects that 
> sounded promising and interesting. But I must admit I lost track of what was 
> really done and how far things went in the last years.
> 
> So are there any pointers to info material that I could look at to see what 
> the current status of source control in Pharo 5 and Pharo 6 is and/or will be 
> soon?
> 
> I am mostly interested in these topics:
> 
> git only - no monticello meta info any more - possible?
> tools like merge/diff, committing from within the image
> dependencies within my own project as well as dependencies on external code 
> in - possibly multiple - external repositories
> what is the current "most official" source repository for open source code?
> best practices for managing complex projects and keeping old versions 
> reproducible at any time
> tutorial for git newbies in a Pharo context? (Like, how do I start with a new 
> packege - create folder first and do git init, or start in the image and push 
> into repo later? as I said: beginners' stuff)
> Thanks for pointers and help
> 
> Joachim
> 



Re: [Pharo-users] How to detect encoding of a file

2017-05-03 Thread Norbert Hartl


> Am 03.05.2017 um 18:10 schrieb Cyril Ferlicot D. :
> 
>> Le 03/05/2017 à 16:41, Sven Van Caekenberghe a écrit :
>> 
>>> On 3 May 2017, at 12:18, Sven Van Caekenberghe  wrote:
>>> 
>>> Hi Cyril,
>>> 
>>> I want to try to write such a detector. I'll get back to you.
>> 
>> I added the following (Zn #bleedingEdge):
>> 
>> ===
>> Name: Zinc-Character-Encoding-Core-SvenVanCaekenberghe.49
>> Author: SvenVanCaekenberghe
>> Time: 3 May 2017, 4:30:44.081888 pm
>> UUID: fe8b083d-010b-0d00-9df5-fde304bccfdc
>> Ancestors: Zinc-Character-Encoding-Core-SvenVanCaekenberghe.48
>> 
>> Add ZnCharacterEncoder class>>#detectEncoding: to try to heuristically and 
>> unreliably guess the encoding used by a collection of bytes
>> 
>> Add ZnCharacterEncoderTests>>#testDetectEncoding
>> 
>> Add #= and #hash to ZnSimplifiedByteEncoder and ZnEndianSensitiveUTFEncoder
>> 
>> Always use canonical name in ZnSimplifiedByteEncoder class>>#newForEncoding:
>> ===
>> Name: Zinc-Character-Encoding-Tests-SvenVanCaekenberghe.31
>> Author: SvenVanCaekenberghe
>> Time: 3 May 2017, 4:31:09.469852 pm
>> UUID: 30ef8b3e-010b-0d00-9df6-4a9304bccfdc
>> Ancestors: Zinc-Character-Encoding-Tests-SvenVanCaekenberghe.30
>> 
>> Add ZnCharacterEncoder class>>#detectEncoding: to try to heuristically and 
>> unreliably guess the encoding used by a collection of bytes
>> 
>> Add ZnCharacterEncoderTests>>#testDetectEncoding
>> 
>> Add #= and #hash to ZnSimplifiedByteEncoder and ZnEndianSensitiveUTFEncoder
>> 
>> Always use canonical name in ZnSimplifiedByteEncoder class>>#newForEncoding:
>> ===
>> 
>> 
>> Now you can do the following:
>> 
>> ZnCharacterEncoder detectEncoding: ((FileLocator desktop / 'some.data') 
>> binaryReadStreamDo: [ :in | in upToEnd ]).
>> 
>> (FileLocator desktop / 'some.data') binaryReadStreamDo: [ :in |
>>| bytes encoder |
>>bytes := in upToEnd.
>>encoder := ZnCharacterEncoder detectEncoding: bytes.
>>encoder decodeBytes: bytes ].
>> 
>> It works on the test file you gave me, but this process is just a guess, a 
>> heuristic that is unreliable and often wrong (especially for very similar 
>> byte encodings), see https://en.wikipedia.org/wiki/Charset_detection.
>> 
>> You can give the whole contents to the detector, or just a header.
>> 
>> I was a bit too optimistic though, this is basically an unsolvable problem. 
>> It is MUCH better to somehow know up front what the encoding used is, or to 
>> know something useable about the contents (like the header of HTML or XML).
>> 
>> Sven
>> 
> 
> Thank you! I'll try this tomorrow. If it works well I wonder if we can
> still includes it in Pharo6. Since it's only a little feature unused in
> Pharo it should not break anything but it would be cool addition for Moose.
> 
> But since it is feature freeze if people do not want I'll not push it
> for Pharo 6 :)
> 
It shouldn't be included. There no such thing as side-effect-free change. Moose 
can load a newer version of zinc. That is how it is supposed to be.

Norbert
> -- 
> Cyril Ferlicot
> https://ferlicot.fr
> 
> http://www.synectique.eu
> 2 rue Jacques Prévert 01,
> 59650 Villeneuve d'ascq France
> 




Re: [Pharo-users] Voyage and attributes references

2017-04-06 Thread Norbert Hartl


> Am 06.04.2017 um 18:41 schrieb Hilaire <hila...@drgeo.eu>:
> 
> Le 06/04/2017 à 16:14, Norbert Hartl a écrit :
>>> One idea will be to have collection of Address, but this really looks
>>> strange to me.
>>> 
>> why?
>> 
> 
> It looks like a painful scenario: Address is most of the time referenced
> by only one object, but in one scenario I need a shared attributes.
> Because of this it implies to overlook for #save and #remove messages to
> Address instances all around, forgetting some leading to bugs. But there
> are not alternative I guess? Or to have two Address class, one set as a
> root. Not sure what is the best practice.
> 
Not sure either. But I think having a SharedAddress class is worth a try. The 
other possibility would be if #voyageRoot would be also instance side. Right 
now I don't have a computer to check.

Norbert
> Hilaire
> 
> -- 
> Dr. Geo
> http://drgeo.eu
> 
> 




Re: [Pharo-users] Voyage and attributes references

2017-04-06 Thread Norbert Hartl
Hi,

> Am 06.04.2017 um 15:54 schrieb Hilaire :
> 
> Hi,
> 
> Here is another scenario where I have trouble with Voyage:
> 
> Let's an object A, with an attribute an object Address.
> Then I create B, a copy of A.
> 
> Of course the object Address is both an attribute of A and B. (no deep
> copy).
> 
> As long as my Voyage repo is running, editing Address from A or B is
> doing fine: when editing Address from A, I can see this reflected in B's
> Address, as expected.
> 
> Sadly, this Object scheme is lost in the persistency: when I reset the
> repo, shutdown it, restart it, to force a full retrieve from the Mongo
> repo, object A and B do not share anymore the Address object has it
> should be.
> 
> I understand Voyage is not a true really Object Oriented repository, but
> is it possible to overcome such limitation?
> 
The Adress object must voyageRoot in order for this to work. If an object is 
voyageRoot it is kept as identity being a separate object living in a 
collection that can be referenced. If it is not voyageRoot you store a copy of 
the object each them because that object gets embedded into the container 
object. 

> One idea will be to have collection of Address, but this really looks
> strange to me.
> 
why?

> I think Fuel was doing just fine with such scenario, but sadly Fuel is
> not reliable between images.
> 
Fuel stores the object graph as it is. It is hard to compare because you cannot 
search a fuel dump. I think the question is what you need. If it is having a 
partial graph in memory that has been extracted from the whole graph through 
query then you have a pretty decent need for a database and a tool like voyage. 
If you just need to persist you are better off with fuel. And if you need the 
same to be reliable between two images use STON.

> Thanks to read up to here.
> 
You're welcome! :)

Norbert

> Hilaire
> 
> -- 
> Dr. Geo
> http://drgeo.eu
> 
> 




Re: [Pharo-users] Voyage, DateAndTime and UTC

2017-03-31 Thread Norbert Hartl
Hi,

> Am 31.03.2017 um 17:16 schrieb Hilaire :
> 
> Hi,
> 
> As far as I see when I store a DateAndTime with local time,
> "2017-03-31T17:10:46.137086+02:00", then I fetch it back, I got an UTC
> DateAndTime  "2017-03-31T15:10:46.137086+00:00".
> 
> Am I doing something wrong or do I need to use a mongo description to
> correct that. But wait, even so, I will not know what was the initial
> local time.
> 
> How do you usually deal such issue?
> 
it's a pitty. BSON only supports a date type which is date and time in UTC. So 
the offset information is stripped off and that is the reason why you get it 
this way. I fell over this a lot. Especially when you use a local midnight 
DateAndTime store it in mongo, read it and then do #asDate you will end up 
having one day before. Very annoying.
I think we shouldn't store DateAndTime as BSON date. We should create a custom 
type that includes timezone offset information.

Norbert




Re: [Pharo-users] Installing Voyage ??

2017-03-27 Thread Norbert Hartl
Thanks for the tip but I know that. I have full access to the voyage code. 
Without knowing the reason and context an issue is useless.

Norbert

> Am 26.03.2017 um 19:35 schrieb Stephane Ducasse <stepharo.s...@gmail.com>:
> 
> Add an issue in the Voyage github repo and do a pull request to push esteban 
> releasing a new version. 
> 
> 
> On Sun, Mar 26, 2017 at 1:15 PM, Norbert Hartl <norb...@hartl.name 
> <mailto:norb...@hartl.name>> wrote:
> I get that same problem, too, every time I do "Software update". But never 
> understood the rationale of dropping a database at this point. I think we 
> should remove this line
> 
> Norbert
> 
> > Am 25.03.2017 um 22:04 schrieb Hilaire <hila...@drgeo.eu 
> > <mailto:hila...@drgeo.eu>>:
> >
> > ah yeah, I wrote an internal durty hack to get it rolling
> >
> > cleanUp: aRepository
> > (aRepository isKindOf: Boolean) ifFalse: [ aRepository dropDatabase]
> >
> >
> >> Le 25/03/2017 à 21:46, Hilaire a écrit :
> >> It occurs in Pharo5, likely not in Pharo4, or may be I fixed in my
> >> image, I don't remember.
> >
> > --
> > Dr. Geo
> > http://drgeo.eu <http://drgeo.eu/>
> >
> >
> 
> 
> 



Re: [Pharo-users] Installing Voyage ??

2017-03-26 Thread Norbert Hartl
I get that same problem, too, every time I do "Software update". But never 
understood the rationale of dropping a database at this point. I think we 
should remove this line

Norbert

> Am 25.03.2017 um 22:04 schrieb Hilaire :
> 
> ah yeah, I wrote an internal durty hack to get it rolling
> 
> cleanUp: aRepository
> (aRepository isKindOf: Boolean) ifFalse: [ aRepository dropDatabase]
> 
> 
>> Le 25/03/2017 à 21:46, Hilaire a écrit :
>> It occurs in Pharo5, likely not in Pharo4, or may be I fixed in my
>> image, I don't remember.
> 
> -- 
> Dr. Geo
> http://drgeo.eu
> 
> 




Re: [Pharo-users] Magritte extension

2017-03-21 Thread Norbert Hartl
Hi,

> Am 21.03.2017 um 08:04 schrieb Stephan Eggermont <step...@stack.nl>:
> 
> On 19/03/17 14:14, Norbert Hartl wrote:
>> I never managed to take a look at QCMagritte but it sounds as an extension. 
>> Why was it never integrated?
> 
> It is rather a monolitical extension. And it was mostly in heavy development. 
> We never stopped to make a real release. Somehow the tutorial code and the 
> demo's were not enough to get traction in the community. Probably too much 
> change at a time. I think the design is sound but we never got into 
> discussions/feedback about that.
> 
do you have any documentation that summarizes the changes you did. With all the 
new mails about magritte and problems it might be time to form a new group 
caring about a new implementation of a meta-object layer. I think now that we 
have slots the implementation can be made much more powerful than magritte is 
today.

> We ran into the instance side problem too, and solved that with
> prototypes. You need them anyway to get better memento's.
> 
Same here. There are times where it seems cumbersome to use the instance side 
descriptions. But the benefits outweigh that problem by far (for me at least). 
But I do like the idea that instance _and_ class side descriptions are taken 
into account. Feels right at first.

Norbert




Re: [Pharo-users] Class versions

2017-03-21 Thread Norbert Hartl
Stef,

> Am 21.03.2017 um 07:53 schrieb Stephane Ducasse <stepharo.s...@gmail.com>:
> 
> What are multiple versions of a classes?
> 
it is what I wrote to Dale. Multiple versions of a class are different classes 
with the same name in the same image. And in a way that one class can access 
the other of same name. This way the two classes can build a context like 
old/new version or something else. It would also need to VM support of having a 
image side interception method while migration is done.

> We are working on a module system for Pharo. The prototype is making 
> progress. You will be able to have different classes with the same name in 
> different classes. 
> 
I don't understand that sentence. The last work is supposed to be 
"environments"? 

How far is that prototype?

thanks,

Norbert

> Stef
> 
> On Sun, Mar 19, 2017 at 2:16 PM, Norbert Hartl <norb...@hartl.name 
> <mailto:norb...@hartl.name>> wrote:
> How far are we to support multiple versions of the same class in an image? 
> Are there existing approaches?
> 
> Norbert
> 
> 
> 
> 
> Von meinem iPad gesendet
> 
> 



Re: [Pharo-users] Class versions

2017-03-21 Thread Norbert Hartl
Hi Dale,

> Am 20.03.2017 um 19:30 schrieb Dale Henrichs 
> <dale.henri...@gemtalksystems.com>:
> 
> Norbert.
> 
> Are you thinking of GemStone-style class versions for Pharo?
> 
I was thinking of something less elaborate. The first thing that should be 
possible is that two classes with different shape of the same name can co-exist 
in the image.That might be provided by #environment. The next step would be to 
have something like #migrateTo: in GemStone. Meaning that in case of a 
class/shape change the old instance is called with the new shape as parameter 
so I can intercept the process of object migration. 

The #history case of GemStone would be nice of it would be modular and could be 
loaded. I think it can be done. But the points above need to be done first.

Norbert

> Dale
> 
> On 03/19/2017 06:16 AM, Norbert Hartl wrote:
>> How far are we to support multiple versions of the same class in an image? 
>> Are there existing approaches?
>> 
>> Norbert
>> 
>> 
>> 
>> 
>> Von meinem iPad gesendet
>> 
> 
> 




[Pharo-users] Class versions

2017-03-19 Thread Norbert Hartl
How far are we to support multiple versions of the same class in an image? Are 
there existing approaches?

Norbert




Von meinem iPad gesendet



Re: [Pharo-users] Magritte extension

2017-03-19 Thread Norbert Hartl
I never managed to take a look at QCMagritte but it sounds as an extension. Why 
was it never integrated?

Norbert

Von meinem iPad gesendet

> Am 19.03.2017 um 10:06 schrieb Stephan Eggermont :
> 
>> On 18/03/17 18:40, Mariano Martinez Peck wrote:
>> Some answers below. But a general comment is that the typical case to
>> customize magritte is by subclassing and then somehow use your own
>> subclasses instead of magritte ones.
> 
> Well, there are lots of ways to customize magritte. So many actually, that it 
> is definitely non-trivial to decide where to extend what. For your first 
> experiments with extending magritte, just subclassing is definitely the way 
> to go. You need a way to understand how the different parts in magritte 
> interact, and the easiest way is to change something and see what it does.
> 
> In QCMagritte we've gone much farther. Some problems (access control, 
> translation) are much easier solved by modifying the visitor used to render 
> the html. By chaining multiple visitors, it becomes easy to translate all 
> labels and help-texts without polluting the magritte descriptions or the 
> domain objects. The same goes for access control.
> 
> Stephan
> 
> 
> 
> 




[Pharo-users] iceberg

2017-03-16 Thread Norbert Hartl
Sometimes tools change and you feel the change like a quantum leap. For me it 
is the case when using iceberg. 

Well done, thank you very much for that. 

If Versionner would be able to edit baselines we would have a really rich 
workflow for developing.

Norbert
 




Re: [Pharo-users] Easy question about syntax.

2017-03-12 Thread Norbert Hartl


> Am 11.03.2017 um 04:57 schrieb sergio ruiz :
> 
> I have a simple one, but i need to understand what is going on..
> 
> i have something like
> 
> Tree
> 
> with a class method
> 
> trees
> ^ trees ifNil: [OrderedCollection new]
> 
> i initially ran into trouble with it locking my image up because i wrote it 
> as:
> 
> trees
> ^ self trees ifNil: [OrderedCollection new]
> 
> what is the semantic difference between these two calls?
> 
The first one accesses the instance variable. The second one calls the method 
tress (same method) which results in an endless loop.

Norbert

> THanks!
> 
>  
> 
> 
> peace,
> sergio
> photographer, journalist, visionary
> 
> Public Key: http://bit.ly/29z9fG0
> #BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV
> http://www.Village-Buzz.com
> http://www.ThoseOptimizeGuys.com
> http://www.coffee-black.com
> http://www.painlessfrugality.com
> http://www.twitter.com/sergio_101
> http://www.facebook.com/sergio101


Re: [Pharo-users] Voyage and duplicated entry

2017-03-06 Thread Norbert Hartl

> Am 06.03.2017 um 18:10 schrieb jtuc...@objektfabrik.de:
> 
> Hilaire,
> 
> as soon as the hash of an object changes because you change an attribute that 
> is used in the hash function, the object is not identical to its older ego 
> any more, so Voyage cannot know it still is the same object (nor any other 
> caching solution).
> Or am I wrong about this whole hash/= thing?
> 
Yes :) You are mixing equality and identity. An object is identical if the 
memory location is the same. An object is equal whatever is defined in =/hash. 
In the default case classes do not overwrite =/hash so = and == return the same 
value. If you change the state of an object you might change the hash but not 
the identityHash. So it is identical but different to the version in the 
database hence should update the existing object and not creating a new one.

> The only thing I could imagine is that Voyage somewhere uses = where it 
> should use ==. But wouldn't many more people have problems then?
> 
The problem is that we often use equality based collections where we should use 
identity based ones. These problems are hidden because = and == are the same 
for normal classes. As soon as you overwrite =/hash you experience problems 
because of that. 

So I have the impression that in general overwriting =/hash is not a good idea. 
Most of the time you mean "equal regarding to some context". In this case it is 
better to have your own equality selector like #isSameX:, #hasSameX: etc. 
Because the kernel classes rely on = equality you tear the semantics apart if 
yoou overwrite.

Norbert

 
> Joachim
> 
> 
> 
> Am 06.03.17 um 18:03 schrieb Hilaire:
>> The more I think the more it seems wrong to me. Whenever you ask an
>> instance to save itself, if already in repo it should not duplicate
>> itself whenever hash/= is overrided in this object. It does not sound as
>> an expected behaviour.
>> 
>> Hilaire
>> 
>> Le 05/03/2017 à 14:51, Hilaire a écrit :
>>> Understood.
>>> My use/understanding of hash and =, true in DrGeo, was more like unique
>>> identifier regarding its ontological characteristics (what distinguish
>>> it from other). So an exact same Point in DrGeo will have different hash
>>> value depending on its position on the plane, or it being free on a
>>> line, etc.  May be I got it biased here.
>>> 
>>> Anyway problem solved, comparing protocol was just rampant code.
> 
> 
> -- 
> ---
> Objektfabrik Joachim Tuchel  mailto:jtuc...@objektfabrik.de 
> 
> Fliederweg 1 http://www.objektfabrik.de 
> 
> D-71640 Ludwigsburg  http://joachimtuchel.wordpress.com 
> 
> Telefon: +49 7141 56 10 86 0 Fax: +49 7141 56 10 86 1



Re: [Pharo-users] Voyage and duplicated entry

2017-03-06 Thread Norbert Hartl
Hilaire,

I think you are right and I wonder why we didn't change it, yet. I can remember 
talking with Esteban about it. The culprit is that in VOCache the 
reversedObjects instance variable is a WeakKeyDictionary and not a 
WeakIdentityKeyDictionary. 
That is the reason why #isNew on an object returns true if equality is not the 
same. And this leads to object duplication. The whole purpose of the VOCache is 
to keep "identity" for the objects. So using an equality based collection is 
plain wrong.

Norbert

> Am 06.03.2017 um 18:03 schrieb Hilaire :
> 
> The more I think the more it seems wrong to me. Whenever you ask an
> instance to save itself, if already in repo it should not duplicate
> itself whenever hash/= is overrided in this object. It does not sound as
> an expected behaviour.
> 
> Hilaire
> 
> Le 05/03/2017 à 14:51, Hilaire a écrit :
>> Understood.
>> My use/understanding of hash and =, true in DrGeo, was more like unique
>> identifier regarding its ontological characteristics (what distinguish
>> it from other). So an exact same Point in DrGeo will have different hash
>> value depending on its position on the plane, or it being free on a
>> line, etc.  May be I got it biased here.
>> 
>> Anyway problem solved, comparing protocol was just rampant code.
> 
> -- 
> Dr. Geo
> http://drgeo.eu
> 
> 




Re: [Pharo-users] Voyage and Date

2017-03-04 Thread Norbert Hartl
I think sticking to a date string is the safest thing to do. Especially if you 
use iso -mm-dd because the database indexes are predix based and are able 
to sort and build ranges. So you don't loose much.
The problem is regarding the conceptually incompatible offset and #asDate. 
#asDate just cuts off minutes hours and seconds from am DateAndTime. So if the 
offset has a startDate of yesterday asDate will give a date yesterday. In my 
code I either use "asLocal asDate" or date as string. No better solution so far

> Am 04.03.2017 um 12:15 schrieb Sabine Manaa :
> 
> Hi Hilaire,
> 
> it is interesting to see your posts and having similar topics as me when 
> starting to use voyage.
> I ended up with saving ZTimestamps. But I will think about storing strings 
> too, because this is more readable when having direct look into mongo.
> There was a discussion in slack a few days ago (February, 21st) about saving 
> Dates in voyage.
> 
> Regards 
> Sabine
> 
> 
> 
> 2017-03-04 11:21 GMT+01:00 HilaireFernandes [via Smalltalk] <[hidden email]>:
>> Concerning this problem, one option I found is to get far away of the 
>> Voyage/Mongo Date/DateAndTime representation/conversion and stick to 
>> string, not really efficience, but well... 
>> 
>> mongoBirthday 
>>  
>> ^ VOToOneDescription new 
>> attributeName: 'birthday'; 
>> accessor: (MAPluggableAccessor 
>> read: [:person | person birthday ifNotNil: [person birthday 
>> mmdd]] 
>> write: [:person :string |string ifNotNil: [person birthday: 
>> string 
>> asDate]]); 
>> yourself 
>> 
>> 
>> Le 03/03/2017 à 21:12, Hilaire a écrit : 
>> > Not sure it is related to this: 
>> > http://forum.world.st/Possible-bug-with-Voyage-Mongo-date-tt4735597.html
>> 
>> -- 
>> Dr. Geo 
>> http://drgeo.eu
>> 
>> 
>> http://drgeo.eu
>> 
>> 
>> If you reply to this email, your message will be added to the discussion 
>> below:
>> http://forum.world.st/Voyage-and-Date-tp4937235p4937262.html
>> To start a new topic under Pharo Smalltalk Users, email [hidden email] 
>> To unsubscribe from Pharo Smalltalk Users, click here.
>> NAML
> 
> 
> View this message in context: Re: Voyage and Date
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.


Re: [Pharo-users] [Pharo-dev] [ANN] Regex Tester Tool for Pharo

2017-03-02 Thread Norbert Hartl

> Am 02.03.2017 um 09:54 schrieb Peter Uhnak :
> 
> On Thu, Mar 02, 2017 at 09:20:12AM +0100, Esteban Lorenzano wrote:
>> 
>>> On 1 Mar 2017, at 22:40, stepharong  wrote:
>>> 
>>> 
>>> And I think that his remark makes sense. I was wondering if we should not 
>>> ressurect
>>> the RePlugin to make sure that users can use perlish regexp and do not feel 
>>> that our world is strange.
>> 
>> +1
>> 
> 
> +23
> 
> I've been using regexes casually for years and yet every time I use them in 
> Pharo I have to open the help and end up using PetitParser or parsing it 
> manually anyway…
> 
Which are good reasons not to improve regex support ;)

Norbert


Re: [Pharo-users] spotting methods with TODO, FIXME, etc. comments?

2017-03-01 Thread Norbert Hartl
Yes, #flag: is the way to go. I often use something like

self flag: #needsWork

If you use symbols then you can just mark the needsWork and search for senders 
(cmd-n on Mac). That gives you all of the locations in the image where it is 
used.

Norbert

> Am 01.03.2017 um 19:06 schrieb Peter Uhnak :
> 
> On Wed, Mar 01, 2017 at 06:53:16PM +0100, Raffaello Giulietti wrote:
>> Hi community,
>> 
>> many IDEs for other language usually offer a way to annotate methods
>> with special comments like "TODO ...", "FIXME ...". Such methods can
>> then be later retrieved easily in task lists and selected by simple
>> clicks.
>> 
>> Is there something similar in Pharo?
>> 
>> Thanks
>> 
> 
> The most common is `self flag: 'text'`. This will give you an icon in 
> Nautilus browser.
> 
> But keep in mind that IDEs impose special syntax because they do not provide 
> you with option to retrieve it yourself.
> In Pharo there is no such restriction, so you can do whatever you find most 
> practical to you and then just collect the places yourself.
> 
> E.g. you can trivally retrieve all methods that have "todo" anywhere in 
> method comment:
> 
> ('My-Package' asPackage classes flatCollect: #methods)
>   select: [ :each | each comment isNotNil and: [ each comment 
> includesSubstring: 'todo' ] ]
> 
> Peter
> 




Re: [Pharo-users] Team programming with Smalltalk

2017-02-25 Thread Norbert Hartl


Von meinem iPad gesendet

> Am 17.02.2017 um 18:27 schrieb Hilaire :
> 
> You have a very strong point.
> The problem you emphasised, without explicitly naming it, comes from the
> image. Because the image preserves state it is also a great receptacle
> and accumulator for entropies, and as we know entropies only increase,
> never decrease!
> The direct consequence is that, at some time, after some interactions,
> installing code in some order, or installing broken code, an image
> breaks, hit the ground and becomes unusable. The image limit is always
> the chaos (as long as it is used as a living thing and its evolving
> state is preserved, saved),
> 
I do not understand why we should keep entropy low. There are a lot of side 
effects that occur in a program. It is not only code changes, it is also 
creating objects, load external data, etc. Is it possible to draw a clear 
boundary? If not the side effects collect in every image that does something. 
So having an image that collects huge amounts of side effects and still runs as 
expected could be seen as robust system, no? 
Software does not need to fail immediately, it can also when side effects 
collect. This you cannot easily catch with tests. Trying to keep side effects 
low could also mean that you should restart your images often in order to get 
rid of side effects. So keep an image running and operate with it can be seen 
as stress test for the software.
A usual workflow is to commit code changes, having something like jenkins 
building your image from scratch. You then copy the built image to server and 
never save it again. To me it has to do with reproducibility that you need in 
order to have deployment process. 
To me it is important to have a working image that collects side effects as 
well as having a process that builds an image from scratch. 

Norbert
> Entropies always comes with interacting 'living' system.
> 
> So Smalltalk image comes with this downside of entropies. I don't see
> how you can bring argument against that to developer team, because it is
> the Smalltalk weakness, as well its strong point. Very funny.
> 
> Of course you can try to limit entropies. Versioning your image is
> probably what to do, for example host task could save version of your
> image every two hours, daily, etc.
> 
> GNU Smalltalk took an original approach: it ships a minimal image you
> don't modify and you install code on top of it. So really you never save
> your image, entropies remains constant over time. This approach is not
> really possible with Pharo.
> 
> Best wishes
> 
> Hilaire
> 
>> Le 15/02/2017 à 23:43, horrido a écrit :
>> In file-based word, the answer is tests and CI. What is the smalltalk way?
>> And please do not say "It's in the conceptual nature of programming" -- if
>> the scenario makes no sense in the smalltalk world (maybe you are not
>> supposed to have 20 people working on the same project?) please say this.
>> 
>> -
>> 
>> How would you respond? I know Smalltalk can be used in large team
>> programming, but since I personally have no experience with this, I cannot
>> respond intelligently.
> 
> -- 
> Dr. Geo
> http://drgeo.eu
> 
> 




Re: [Pharo-users] [Teapot and Voyage] sending over the voyageId

2017-02-09 Thread Norbert Hartl
NeoJSON is not bound to use instVars. Look at the method mapAccessor: and 
friends.

Norbert

> Am 09.02.2017 um 22:50 schrieb sergio ruiz :
> 
> 
> I am working on the U of the CRUD part of my Teapot/Voyage REST interface, 
> and found that I cannot get the voyageId to be delivered as part of the REST 
> response..
> 
> in order to do RUD, I will need that in the feed.
> 
> the problem is that NeoJSON uses the instance variables to JSON encode the 
> object.
> 
> to circumvent this, i made an instance variable called ‘id’.. and made an 
> accessor like so:
> 
> id
>   ^ self voyageId value
> 
> so i can do something like
> 
> station id -> ‘23434234234243423432’
> 
> but when i inspect the object, or send it back from voyage, id is nil..
> 
> rather than mirror voyage’s _id, i would like access to it in JSON encoding, 
> but i can see that might be a problem..
> 
> any ideas?
> 
> thanks!
> 
> 
> peace,
> sergio
> photographer, journalist, visionary
> 
> Public Key: http://bit.ly/29z9fG0
> #BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV
> http://www.Village-Buzz.com
> http://www.ThoseOptimizeGuys.com
> http://www.coffee-black.com
> http://www.painlessfrugality.com
> http://www.twitter.com/sergio_101
> http://www.facebook.com/sergio101


Re: [Pharo-users] [Voyage] Accessing ObjectID(_id) when retrieving objects.

2017-02-01 Thread Norbert Hartl

> Am 01.02.2017 um 17:02 schrieb sergio ruiz <sergio@gmail.com>:
> 
> Got it..
> 
> Smalltalk is one language where it ALWAYS seems that there is a more clever 
> way to do anything than the way i am doing it..
> 
> I’ll try this..
> 

Don't worry. That is the experience we all had (and have). You look for a 
method (most probably it exists alreay) but you cannot find because you are not 
thinking the straight way ;)

Norbert

> Thanks!
> 
> On February 1, 2017 at 10:43:36 AM, Norbert Hartl (norb...@hartl.name 
> <mailto:norb...@hartl.name>) wrote:
> 
>> 
>> MyClass selectOne: {
>> '_id' -> (OID value: 16r) } asDictionary
>> 
> 
> peace,
> sergio
> photographer, journalist, visionary
> 
> Public Key: http://bit.ly/29z9fG0 <http://bit.ly/29z9fG0>
> #BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV
> http://www.Village-Buzz.com <http://www.village-buzz.com/>
> http://www.ThoseOptimizeGuys.com <http://www.thoseoptimizeguys.com/>
> http://www.coffee-black.com <http://www.coffee-black.com/>
> http://www.painlessfrugality.com <http://www.painlessfrugality.com/>
> http://www.twitter.com/sergio_101 <http://www.twitter.com/sergio_101>
> http://www.facebook.com/sergio101 <http://www.facebook.com/sergio101>


Re: [Pharo-users] [Voyage] Accessing ObjectID(_id) when retrieving objects.

2017-02-01 Thread Norbert Hartl

> Am 01.02.2017 um 16:11 schrieb sergio ruiz <sergio@gmail.com>:
> 
> hmmm.. can you query for an object with that voyageId?

Sure. I don't know if there is a more clever way to do but this will work in 
any case

MyClass selectOne: {
'_id' -> (OID value: 16r) } asDictionary

Norbert

> 
> On February 1, 2017 at 9:37:43 AM, Norbert Hartl (norb...@hartl.name 
> <mailto:norb...@hartl.name>) wrote:
> 
>> You can ask every voyage object for its id. Just do 
>> 
>> anObject voyageId
>> 
>> you get an OID object which you can ask for its #value to get the numeric id.
>> 
>> Norbert
> 
> peace,
> sergio
> photographer, journalist, visionary
> 
> Public Key: http://bit.ly/29z9fG0 <http://bit.ly/29z9fG0>
> #BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV
> http://www.Village-Buzz.com <http://www.village-buzz.com/>
> http://www.ThoseOptimizeGuys.com <http://www.thoseoptimizeguys.com/>
> http://www.coffee-black.com <http://www.coffee-black.com/>
> http://www.painlessfrugality.com <http://www.painlessfrugality.com/>
> http://www.twitter.com/sergio_101 <http://www.twitter.com/sergio_101>
> http://www.facebook.com/sergio101 <http://www.facebook.com/sergio101>


Re: [Pharo-users] [Voyage] Accessing ObjectID(_id) when retrieving objects.

2017-02-01 Thread Norbert Hartl

> Am 01.02.2017 um 15:25 schrieb sergio ruiz :
> 
> Hi, all..
> 
> I am working on a Teapot REST interface, and am getting ready to implement 
> the create, read, and update methods for the objects, and I need a way to 
> refer to the objects. I figured that since Voyage was already creating _id 
> through MongoDB, I could just pass that on when I retrieved that object, but 
> I don’t see how to do that.
> 
> Is this possible? Would I need to create my own numerical indexes to my 
> objects and just retrieve them as part of the object query?
> 
> 
You can ask every voyage object for its id. Just do 

anObject voyageId

you get an OID object which you can ask for its #value to get the numeric id.

Norbert

> Thanks!
> 
> 
> peace,
> sergio
> photographer, journalist, visionary
> 
> Public Key: http://bit.ly/29z9fG0 
> #BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV
> http://www.Village-Buzz.com 
> http://www.ThoseOptimizeGuys.com 
> http://www.coffee-black.com 
> http://www.painlessfrugality.com 
> http://www.twitter.com/sergio_101 
> http://www.facebook.com/sergio101 


Re: [Pharo-users] Deployment pharo with multiple instances and voyage

2017-01-25 Thread Norbert Hartl
Hi,

> Am 25.01.2017 um 01:30 schrieb Alejandro Infante 
> :
> 
> Hi!
> 
> I’m close to deploy a web service using Pharo with Voyage and MongoDB. I have 
> been playing with it and everything works ok with a single Pharo image.
> 
> Couple of days ago I started questioning myself about how voyage behaves when 
> you have multiple pharo images using the same mongo database (horizontal 
> scaling). I want to know how the cache of voyage behaves in a scenario with 
> object updates.
> 
> Example: —— 
> Imagine I have two images A and B.
> 
> - Image A query for object o and voyage put it in the cache.
> - Image B query for object o and voyage put it in the cache.
> - Image A updates object o and push it into the database calling #save.
> - Image B query for object o that should be already in the cache.
> 
> In this case, does Image B see the changes performed by image A?
> —— 
> 
> All ideas are welcome :)
> 
the only problems you have with the cache is its name :) It isn't really a 
cache. If you request an object a query is issued to the database. So your 
scenario is no problem because in the last step when B queries the object it 
queries the database, will see that the version number of the objects changed 
and will update the object in the cache. The sole purpose of the cache is to 
enable identity of database objects.
Nevertheless you can have problems if you use references. Voyage can handle 
references pretty well. But each class might be stored in another 
document/collection. As in mongo only the storage of a single document is 
atomic you need to be careful when doing concurrent updates with references.

Norbert





Re: [Pharo-users] is PetitParser eager by default?

2017-01-20 Thread Norbert Hartl

> Am 20.01.2017 um 15:24 schrieb Peter Uhnak :
> 
> Is PetitParser eager by default?
> 
> I've used PetitParser countless times so I am really baffled why this doesn't 
> work
> 
> str := 'a0b'.
> #any asParser star, #digit asParser, #any asParser star parse: str.
> 
> -> PPFailure (input expected at: 3)
> 

PetitParser is not greedy per default. But back tracking only works if a parser 
fails. Using , creates a sequence of combined parsers. If one fails the whole 
sequence fails. As a star parser always succeeds it would be huge luck if your 
rule would succeed. The probability that the parser consumes exactly one 
character is not high. Maybe negating the first sequence part is what you want

Norbert




Re: [Pharo-users] About Git

2017-01-15 Thread Norbert Hartl


> Am 15.01.2017 um 10:29 schrieb "itli...@schrievkrom.de" 
> :
> 
> I would give you many more "+" - if you wish - for your opinion:
> 
> 
> 
> 
> Another point I would like to mention: keep the source code locally or
> at least have an easy option to hold all source code locally.
> 
> I've seen so many times, that git or one of the other git repositories
> are down - that's a very critical point.
> 
Butthat's always the case with git. You have always all the code plus 
history locally. Plus you can commit while being offline. Which is exactly one 
point where git excels. Even envy cannot do that if I understood it correctly.


> I would like to have a local repository, where I can import external
> packages and I work locally only.
> 
You can do that with metacello.

> I also have thought several times that it would be nice to have a SQLite
> database holding all sources/packages. How much easier life would be
> with that.
> 
I cannot see how using an in-memory sql database can make your life easier. To 
do what? 

Norbert
> Other than that: I prefer my simple server directory holding monticello
> packages - in the Gemstone/S area.
> 
> But I have to admit, that all the source code management stuff I've seen
> since ENVY in the Smalltalk community are pretty poor stuff - and even
> considering integrating git is not a step forward in terms of technical
> improvements, but only in terms of marketing and mainstream technology.
> 
> 
> Marten
> 
> 
> 
>> Am 14.01.2017 um 18:44 schrieb werner kassens:
>> Hi Dimitris,
>> i as a simple user tend to think about these things in simple terms: i
>> download a program, add something, upload my addition. lets take an
>> upload step, _one_ simple step with monticello: i upload something once
>> (git add), i upload it a second time (git commit), i upload it a third
>> time (git push), i try to upload it a fourth time (pull request), only
>> then i'm done (yes, there are possible shortcuts but so what). i'm sure
>> all this makes sense for the seasoned coder, but i certainly won't learn
>> that.  just as a small example how a user like me thinks
>> about this.
>> werner
>> 
> 
> 
> 
> -- 
> Marten Feldtmann
> 




Re: [Pharo-users] Google visibility?

2017-01-13 Thread Norbert Hartl

> Am 13.01.2017 um 09:36 schrieb jtuc...@objektfabrik.de:
> 
> ... it's official now: I don't know the difference between discussion groups 
> and a chat
> 
> So forget my last post, or simply accept that I'm not a chat fan.
> Often enough, I hardly understand what I am talking about, so a typical chat 
> session is far beyond my horizon ;-)
> 
So, the chat might be exactly the medium for you because you can edit messages 
afterwards ;)

Norbert





Re: [Pharo-users] TTFB, Apache, Seaside Performance Problem

2017-01-05 Thread Norbert Hartl
It is hard to guess. Can you try changing the rewrite rules to

RewriteRule ^/rka(.*)$ http://127.0.0.1:8085/RKA/$1 [proxy,last]
RewriteRule ^/hello(.*)$ http://127.0.0.1:8085/HelloWorld/$1 [proxy,last]

It is "127.0.0.1" instead of "localhost"

It is trial and error anyway ;)

Norbert

> Am 05.01.2017 um 12:10 schrieb Sabine Manaa :
> 
> Hi,
> 
> I need the help of the community. 
> 
> I am not succeding in making our app faster.
> The problem is the Time to first Byte (TTFB). It is always more than one
> second which is much to much.
> We reduced the problem to a *problem between apache and pharo/seaside*.
> 
> For this, I have a test application which only renders "hello World". So I
> am sure it is not my code, my database, my css, my js, my ssl :-)
> 
> I optimized and learned a lot for my app, but it did not solve the TTFB
> problem, which costs 1 additional sec for each click of the user which is
> inaceptable.
> 
> Please follow this tests to see the problem:
> 
> ===>>> Test 1: test.html without Pharo/seaside 
> https://tools.keycdn.com/performance?url=http://app.spesenfuchs.de/test.html
> TTFB in Frankfurt below 10 ms -> this proves that the server and
> configuration is fast.
> 
> ===>>> Test 2: hello world, simple seaside page
> https://tools.keycdn.com/performance?url=app.spesenfuchs.de/hello
> TTFB in Frankfurt more than 1 second! -> this proves that it is not my
> application :-) it is only a hello world seaside page...
> 
> ===>>> Test 3: my login page
> https://tools.keycdn.com/performance?url=app.spesenfuchs.de/rka
> TTFB in Frankfurt more than 1 second!
> 
> (alternative: enter the urls into https://gtmetrix.com/)
> 
> In Apache, we enabled tracing of the rewrite and this tells me (i assume),
> that apache makes the rewrite very fast, within the same millisecond :-)
> [Thu Jan 05 12:14:35.243400 2017] [rewrite:trace2] [pid 1288:tid 1692]
> mod_rewrite.c(477): [client 91.89.219.232:52272] 91.89.219.232 - -
> [app.spesenfuchs.de/sid#66c848][rid#20bc4c8/initial] init rewrite engine
> with requested uri /hello
> [Thu Jan 05 12:14:35.243400 2017] [rewrite:trace3] [pid 1288:tid 1692]
> mod_rewrite.c(477): [client 91.89.219.232:52272] 91.89.219.232 - -
> [app.spesenfuchs.de/sid#66c848][rid#20bc4c8/initial] applying pattern
> '^/rka(.*)$' to uri '/hello'
> [Thu Jan 05 12:14:35.243400 2017] [rewrite:trace3] [pid 1288:tid 1692]
> mod_rewrite.c(477): [client 91.89.219.232:52272] 91.89.219.232 - -
> [app.spesenfuchs.de/sid#66c848][rid#20bc4c8/initial] applying pattern
> '^/hello(.*)$' to uri '/hello'
> [Thu Jan 05 12:14:35.243400 2017] [rewrite:trace2] [pid 1288:tid 1692]
> mod_rewrite.c(477): [client 91.89.219.232:52272] 91.89.219.232 - -
> [app.spesenfuchs.de/sid#66c848][rid#20bc4c8/initial] rewrite '/hello' ->
> 'http://localhost:8085/HelloWorld/'
> [Thu Jan 05 12:14:35.243400 2017] [rewrite:trace2] [pid 1288:tid 1692]
> mod_rewrite.c(477): [client 91.89.219.232:52272] 91.89.219.232 - -
> [app.spesenfuchs.de/sid#66c848][rid#20bc4c8/initial] forcing
> proxy-throughput with http://localhost:8085/HelloWorld/
> [Thu Jan 05 12:14:35.243400 2017] [rewrite:trace1] [pid 1288:tid 1692]
> mod_rewrite.c(477): [client 91.89.219.232:52272] 91.89.219.232 - -
> [app.spesenfuchs.de/sid#66c848][rid#20bc4c8/initial] go-ahead with proxy
> request proxy:http://localhost:8085/HelloWorld/ [OK]
> 
> So, I assume that there is problem between Apache and Seaside
> 
> My questiond are:   
> what can I do to find the bottleneck?
> what is the reason that is so slow?
> your help is very appreciated because I have run out of ideas what it could
> be and I was investigating it several days now.
> 
> Concerning the system:
> The server is at Amazon ec2 windows Server 2009 R2 SP1
> The Apache version is 2.4.23
> The configuration of the apache is like this (as described in the seaside
> book
> http://book.seaside.st/book/advanced/deployment/deployment-apache/configure-apache)
> 
> 
>  ProxyPreserveHost On
>  ServerName app.spesenfuchs.de
>  RewriteEngine On
> 
>Require all granted
> 
> DocumentRoot "C:\xampp\htdocs"
> RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
> 
>RewriteRule ^/rka(.*)$ http://localhost:8085/RKA/$1 [proxy,last]
>   RewriteRule ^/hello(.*)$ http://localhost:8085/HelloWorld/$1 [proxy,last]
> 
> 
> 
> 
> --
> View this message in context: 
> http://forum.world.st/TTFB-Apache-Seaside-Performance-Problem-tp4928839.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
> 




Re: [Pharo-users] selectAllSortBy: usage

2017-01-03 Thread Norbert Hartl
Try

selectAllSortBy: {
   'date' -> 1 .
   'time' -> 1 } asDictionary

where 1 means ascending and -1 means descending

Norbert

> Am 03.01.2017 um 19:56 schrieb Asbath Sama biyalou :
> 
> Hi everybody. I have an object and I want to select all of them sorting
> them by date (Date) and hour(Time). But I don't know to tell that
> condition to selectAllSortBy:  I tried some things but no result. I am
> using Voyage with mongoDB.
> 
> Thanks
> 
> Asbath
> 
> 




Re: [Pharo-users] real world pharo web application set ups

2016-12-16 Thread Norbert Hartl

> Am 16.12.2016 um 11:50 schrieb Sven Van Caekenberghe <s...@stfx.eu>:
> 
> 
>> On 16 Dec 2016, at 11:33, Volkert <volk...@nivoba.de> wrote:
>> 
>> come on, i am only interested in what set up Pharo is currently used (as 
>> mentioned in my initial question).
>> This gives me a feeling, if my requirements are nearby the requirement found 
>> in current pharo
>> based systems ... if i am complete out of population of current pharo 
>> systems, this is for me a good
>> indication to bet not on it ...
> 
> Well, yes.
> 
> Norbert's conclusion (last two points) was spot on.
> 
> You can do in the order of 1K req/s on a single image. If you want more, you 
> need to scale (horizontally). Either you don't share state and you can do 
> that easily. Or you do share state and you will have to build something 
> custom (perfectly doable, but you will have to architect/design for that, 
> preferably upfront).
> 
> Note that the initial versions of all successful web apps that now serve 
> millions of people on thousands of servers all started with very simple, 
> inferior technology stacks. Make something great first, scale later.

So true! Because there is nothing that just scales. The perfect solution for 
100 concurrent requests is likely to be very different to the perfect solution 
for 1000 concurrent requests etc. And expect to discover bottlenecks you 
couldn't really anticipate. 

Norbert

> 
>> On 16.12.2016 10:41, Norbert Hartl wrote:
>>> I'm still not sure about what we are talking. There are some many opinions 
>>> regarding totally different things.
>>> 
>>> These benchmark don't say much. As Sven and you did the benchmark on 
>>> different machines they are hard to compare in numbers. It is not that 
>>> important because you can not make many conclusions from a micro benchmark. 
>>> So what Sven has proven is the fact that there is no limit for pharo per se 
>>> to handle 1k requests per second and more.
>>> 
>>> From these 1k req/s to Joachims 5 reqs/s is big difference. You can always 
>>> assume there is something blocking the vm or a synchron I/O call takes a 
>>> lot of time. But it is not helpful either because that is an edge case like 
>>> Svens test with an app that does nothing. I would even state that it is not 
>>> that easy to produce a situation like Joachim describes. If you have that 
>>> kind of a problem than I'm pretty sure the reasons are mostly not pharo 
>>> related. Sure if it comes to blocking I/O then it is pharo's fault because 
>>> it cannot do async I/O, yet. But a slow database query is not the fault of 
>>> pharo and you will experience the exact same thing in any other runtime.
>>> 
>>> Whatever it will be there is no other way then to measure your exact use 
>>> case and find the bottlenecks that prevent your app from being able to 
>>> handle 1000 concurrent requests. While I agree with a lot of points 
>>> mentioned in this thread I cannot share the general notion of saying that 
>>> you reduce the number of requests per image and "just" use more images and 
>>> more machines. That is not true.
>>> The moment you cannot deal with all your requests in a single image you are 
>>> in trouble. As soon as there is a second image you need to make sure there 
>>> is no volatile shared state between those images. You need to take caution 
>>> then. Scaling up using more images and more machines shifts problem to the 
>>> database because it is a central component that is not easy to scale. But 
>>> again it is not pharo's fault either.
>>> 
>>> So I would state two things:
>>> 
>>> - We are talking about really high numbers of requests/s. The odds you are 
>>> getting in this kind of scaling trouble are usually close to zero. It means 
>>> you need to generate an application that has really many users. Most 
>>> projects we know end up using a single image for everything.
>>> - Whenever you have performance problems in your application architecture 
>>> I'm pretty sure pharo is not in the top of the list of bottlenecks.
>>> 
>>> So yes, you can handle pretty huge numbers using pharo.
>>> 
>>> Norbert
>>> 
>>>> Am 16.12.2016 um 09:57 schrieb volkert <volk...@nivoba.de>:
>>>> 
>>>> Sven,
>>>> 
>>>> compare with an erlang vm (Cowboy) on a standard pc, i5-4570 CPU @ 3.20GHz 
>>>> × 4, on linux ...
>>>> 
>>>> Conncurrent request: 8
>>>&g

Re: [Pharo-users] real world pharo web application set ups

2016-12-16 Thread Norbert Hartl
I'm still not sure about what we are talking. There are some many opinions 
regarding totally different things. 

These benchmark don't say much. As Sven and you did the benchmark on different 
machines they are hard to compare in numbers. It is not that important because 
you can not make many conclusions from a micro benchmark. So what Sven has 
proven is the fact that there is no limit for pharo per se to handle 1k 
requests per second and more.

From these 1k req/s to Joachims 5 reqs/s is big difference. You can always 
assume there is something blocking the vm or a synchron I/O call takes a lot of 
time. But it is not helpful either because that is an edge case like Svens test 
with an app that does nothing. I would even state that it is not that easy to 
produce a situation like Joachim describes. If you have that kind of a problem 
than I'm pretty sure the reasons are mostly not pharo related. Sure if it comes 
to blocking I/O then it is pharo's fault because it cannot do async I/O, yet. 
But a slow database query is not the fault of pharo and you will experience the 
exact same thing in any other runtime. 

Whatever it will be there is no other way then to measure your exact use case 
and find the bottlenecks that prevent your app from being able to handle 1000 
concurrent requests. While I agree with a lot of points mentioned in this 
thread I cannot share the general notion of saying that you reduce the number 
of requests per image and "just" use more images and more machines. That is not 
true. 
The moment you cannot deal with all your requests in a single image you are in 
trouble. As soon as there is a second image you need to make sure there is no 
volatile shared state between those images. You need to take caution then. 
Scaling up using more images and more machines shifts problem to the database 
because it is a central component that is not easy to scale. But again it is 
not pharo's fault either.

So I would state two things:

- We are talking about really high numbers of requests/s. The odds you are 
getting in this kind of scaling trouble are usually close to zero. It means you 
need to generate an application that has really many users. Most projects we 
know end up using a single image for everything. 
- Whenever you have performance problems in your application architecture I'm 
pretty sure pharo is not in the top of the list of bottlenecks. 

So yes, you can handle pretty huge numbers using pharo. 

Norbert

> Am 16.12.2016 um 09:57 schrieb volkert :
> 
> Sven,
> 
> compare with an erlang vm (Cowboy) on a standard pc, i5-4570 CPU @ 3.20GHz × 
> 4, on linux ...
> 
> Conncurrent request: 8
> 
> $ ab -k -c 8 -n 10240 http://127.0.0.1:8080/
> This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
> Licensed to The Apache Software Foundation, http://www.apache.org/
> 
> Benchmarking 127.0.0.1 (be patient)
> Completed 1024 requests
> Completed 2048 requests
> Completed 3072 requests
> Completed 4096 requests
> Completed 5120 requests
> Completed 6144 requests
> Completed 7168 requests
> Completed 8192 requests
> Completed 9216 requests
> Completed 10240 requests
> Finished 10240 requests
> 
> 
> Server Software:
> Server Hostname:127.0.0.1
> Server Port:8080
> 
> Document Path:  /
> Document Length:7734 bytes
> 
> Concurrency Level:  8
> Time taken for tests:   0.192 seconds
> Complete requests:  10240
> Failed requests:0
> Keep-Alive requests:10143
> Total transferred:  80658152 bytes
> HTML transferred:   79196160 bytes
> Requests per second:53414.29 [#/sec] (mean)
> Time per request:   0.150 [ms] (mean)
> Time per request:   0.019 [ms] (mean, across all concurrent requests)
> Transfer rate:  410871.30 [Kbytes/sec] received
> 
> Connection Times (ms)
>  min  mean[+/-sd] median   max
> Connect:00   0.0  0   0
> Processing: 00   0.2  0   3
> Waiting:00   0.2  0   3
> Total:  00   0.2  0   3
> 
> Percentage of the requests served within a certain time (ms)
>  50%  0
>  66%  0
>  75%  0
>  80%  0
>  90%  0
>  95%  1
>  98%  1
>  99%  1
> 100%  3 (longest request)
> 
> 
> And here with 1000 concurrent request ...
> 
> $ab -k -c 1000 -n 10240 http://127.0.0.1:8080/
> This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
> Licensed to The Apache Software Foundation, http://www.apache.org/
> 
> Benchmarking 127.0.0.1 (be patient)
> Completed 1024 requests
> Completed 2048 requests
> Completed 3072 requests
> Completed 4096 requests
> Completed 5120 requests
> Completed 6144 requests
> Completed 7168 requests
> Completed 8192 requests
> Completed 9216 requests
> Completed 10240 requests
> Finished 10240 requests
> 
> 

Re: [Pharo-users] What can we look forward to in 2017?

2016-12-14 Thread Norbert Hartl


> Am 14.12.2016 um 18:00 schrieb Ben Coman :
> 
> 
> 
>> On Thu, Dec 15, 2016 at 12:38 AM, Dimitris Chloupis  
>> wrote:
>> 
>>> On Wed, Dec 14, 2016 at 5:35 PM Offray Vladimir Luna Cárdenas 
>>>  wrote:
>>> This is a good example of the "empowering map" I talk about about 
>>> "Pharo/Smalltalk places for you". What we can look forward in 2017 is 
>>> different for different people, so going beyond the "most exiting 
>>> developments", hype and shiny new things is also a way to show how 
>>> Pharo/Smalltalk are different. We can provide shine and hype, but also 
>>> we're building stuff for different interests and people and that is even 
>>> more worthy to look for the upcoming times (2017 and beyond).
>>> 
>>> Cheers,
>>> 
>>> Offray
>>> 
>> 
>> I think there is big difference between doing something exciting versus 
>> doing something useful. Excitement dies out but usefulness does not. I don't 
>> do it to make Pharo look cool, I do it because I need it. I also do not like 
>> to do something and then abandon it like it happens for 99% of the open 
>> source software. 
>> 
>> Also maintenance becomes a big issue if the scope is wide. Of course you can 
>> also combine excitement with usefulness and still keep the scope reasonably 
>> achievable. 
>> 
>> A thing I love about Pharo is because its so limited third party library 
>> wise it forces me to go do that stuff myself and this definitely builds 
>> confidence in one's coding skills. I really like this DYI approach and I am 
>> definitely moving to the opposite direction of "do not reinvent the wheel". 
>> This would have been unthinkable in communities of very popular languages. I 
>> really like that Pharo forces me to be much less lazy as a coder.
> 
> Because reinventing the wheel is a good way to learn about wheels...

I like that argument. I copy that 

Norbert
> cheers -ben
>  
>> 
>> Its also impressive to see the things that other people do by themselves too 
>> and be inspired by it. 
>> 
>> The real problem is that this work is not really visible, I think Pharo 
>> needs something like a magazine and people should be encouraged to share 
>> their work even if it is in early stage because you never know who will find 
>> it useful. I feel the things we see in the mailing list is only the tip of 
>> the iceberg of what people work on and is pity all this code to be lost in 
>> obscurity. 
> 


Re: [Pharo-users] real world pharo web application set ups

2016-12-12 Thread Norbert Hartl

> Am 12.12.2016 um 19:16 schrieb Volkert :
> 
> After reading reading "Enterprise Pharo a Web perspective", i am curious to 
> learn more about current real world pharo web application set ups. any case 
> studies or blue prints around? i am interested in application domain, system 
> architecture, infrastructure (HW/OS/DB),  performance goals (concurrent 
> users, transactions, ...), system sizing, scalability strategies, 
> 
> everything which could important to convince "me" to select pharo as a 
> platform for a saas solution …
> 
What you really want to know? All the things you mentioned above are not pharo 
related at all! Can you at least roughly sketch in which area you would 
consider to use pharo? 

Norbert






Re: [Pharo-users] Mustache and section

2016-12-06 Thread Norbert Hartl
I want to keep mustache to work as the other mustache implementations.
I agree choosing a different name for an enhanced version would be feasible. 
That happened in the javascript world several times. One example is handlebars. 
Much better is not that easy. In most implementations I know better is 
something like adding poor duplicates of functionalities of your programming 
language to the template engine. Does not work in the end. So better you need 
to prove if this one is not good enough.

Norbert

> Am 06.12.2016 um 03:24 schrieb Stephane Ducasse <stepharo.s...@gmail.com>:
> 
> You mean that you would like to invent a much better mustache. 
> We could keep mustache as it is and invent Beard or rouquaflette :)
> 
>> On Mon, Dec 5, 2016 at 12:35 PM, Norbert Hartl <norb...@hartl.name> wrote:
>> I agree. But there is also a point in sharing mustache templates between  
>> different runtimes. Altering mustache does not make it very mustache 
>> anymore. And it will make it slower. I put that on my ever growing list of 
>> things to do. Maybe a switch could bring the best of both worlds.
>> 
>> Norbert
>> 
>>> Am 05.12.2016 um 16:24 schrieb Stephane Ducasse <stepharo.s...@gmail.com>:
>>> 
>>> having a nicer mustache can be cool :)
>>> 
>>>> On Mon, Dec 5, 2016 at 6:25 AM, Norbert Hartl <norb...@hartl.name> wrote:
>>>> Ok. I think about that again. It might be a useful thing to have although 
>>>> not supported IMHO by other mustache implementations.
>>>> 
>>>> Norbert
>>>> 
>>>> > Am 04.12.2016 um 18:19 schrieb Hilaire <hila...@drgeo.eu>:
>>>> >
>>>> > Okay.
>>>> > Indeed, my bypass was to copy the label in the list.
>>>> >
>>>> > Thank you for your answer.
>>>> >
>>>> > Hilaire
>>>> >
>>>> >> Le 04/12/2016 à 08:14, Norbert Hartl a écrit :
>>>> >>>> So far in my attempt the #label tag is not processed.
>>>> >>>>
>>>> >>>> Am I interpreting something wrongly?
>>>> >>>>
>>>> >> No, what you want is not possible. To achieve it you should copy label 
>>>> >> into the elements of the list section.
>>>> >>
>>>> >> Norbert
>>>> >
>>>> > --
>>>> > Dr. Geo
>>>> > http://drgeo.eu
>>>> >
>>>> >
>>>> 
>>>> 
>>> 
> 


Re: [Pharo-users] Debugger and stepping over a function that will have a DNU

2016-12-05 Thread Norbert Hartl
I think it is known. But there seem to be more problems in the debugger when 
stepping. So not easy to find the exact culprit

Norbert

> Am 04.12.2016 um 14:34 schrieb Holger Freyther :
> 
> Hi,
> 
> before I try to reproduce this exactly I wondered if the following is a known 
> issue with Pharo5. If I am in the debugger and try to step over a message 
> send and that would generate a DNU, Pharo starts taking 99% cpu time. If I 
> use CMD+./CTRL+. to interrupt it doesn't really work either. I get it to 
> repaint the screen once and see a lot of message boxes with errors but the 
> system remains unresponsive.
> 
> Is that known?
> 
>holger
> 
> 
> 




Re: [Pharo-users] Mustache and section

2016-12-05 Thread Norbert Hartl
I agree. But there is also a point in sharing mustache templates between  
different runtimes. Altering mustache does not make it very mustache anymore. 
And it will make it slower. I put that on my ever growing list of things to do. 
Maybe a switch could bring the best of both worlds.

Norbert

> Am 05.12.2016 um 16:24 schrieb Stephane Ducasse <stepharo.s...@gmail.com>:
> 
> having a nicer mustache can be cool :)
> 
>> On Mon, Dec 5, 2016 at 6:25 AM, Norbert Hartl <norb...@hartl.name> wrote:
>> Ok. I think about that again. It might be a useful thing to have although 
>> not supported IMHO by other mustache implementations.
>> 
>> Norbert
>> 
>> > Am 04.12.2016 um 18:19 schrieb Hilaire <hila...@drgeo.eu>:
>> >
>> > Okay.
>> > Indeed, my bypass was to copy the label in the list.
>> >
>> > Thank you for your answer.
>> >
>> > Hilaire
>> >
>> >> Le 04/12/2016 à 08:14, Norbert Hartl a écrit :
>> >>>> So far in my attempt the #label tag is not processed.
>> >>>>
>> >>>> Am I interpreting something wrongly?
>> >>>>
>> >> No, what you want is not possible. To achieve it you should copy label 
>> >> into the elements of the list section.
>> >>
>> >> Norbert
>> >
>> > --
>> > Dr. Geo
>> > http://drgeo.eu
>> >
>> >
>> 
>> 
> 


Re: [Pharo-users] Mustache and section

2016-12-04 Thread Norbert Hartl
Ok. I think about that again. It might be a useful thing to have although not 
supported IMHO by other mustache implementations.

Norbert

> Am 04.12.2016 um 18:19 schrieb Hilaire <hila...@drgeo.eu>:
> 
> Okay.
> Indeed, my bypass was to copy the label in the list.
> 
> Thank you for your answer.
> 
> Hilaire
> 
>> Le 04/12/2016 à 08:14, Norbert Hartl a écrit :
>>>> So far in my attempt the #label tag is not processed.
>>>> 
>>>> Am I interpreting something wrongly?
>>>> 
>> No, what you want is not possible. To achieve it you should copy label into 
>> the elements of the list section.
>> 
>> Norbert
> 
> -- 
> Dr. Geo
> http://drgeo.eu
> 
> 




Re: [Pharo-users] Mustache and section

2016-12-03 Thread Norbert Hartl


> Am 02.12.2016 um 15:56 schrieb Hilaire :
> 
> Hello,
> 
> While iterating within a Mustache section is it possible to refer to a
> tag defined out of the list.
> 
> For example, is it possible to do so:
> 
> templateString := 'A list of numbers
> {{#list}}
> Number {{label}} : {{number}} <= #label in section
> {{/list}}'.
> 
> context := {
>   'label' -> 'fine.
>   'list' -> {
>  { 'number' -> 1 } asDictionary.
>  { 'number' -> 2 } asDictionary.
>}
> } asDictionary
> 
> 
> to get output as:
> 'A list of numbers
> Number fine: 1
> Number fine: 2
> '
> 
> So far in my attempt the #label tag is not processed.
> 
> Am I interpreting something wrongly?
> 
No, what you want is not possible. To achieve it you should copy label into the 
elements of the list section.

Norbert
> Thanks
> 
> Hilaire
> 
> -- 
> Dr. Geo
> http://drgeo.eu
> 
> 




Re: [Pharo-users] Mongo with Voyage

2016-11-17 Thread Norbert Hartl
That would be something like "cannot connect to..." aka connection refused



> Am 17.11.2016 um 20:57 schrieb stepharo :
> 
> Did you check that your mongodb is running?
> 
> 
> 
> Le 17/11/16 à 14:23, Asbath Sama biyalou via Pharo-users a écrit :
> 
> 




Re: [Pharo-users] Mongo with Voyage

2016-11-17 Thread Norbert Hartl


> Am 17.11.2016 um 13:12 schrieb Asbath Sama biyalou <asamabiya...@yahoo.com>:
> 
> Please Not very clear. Then I just execute that method in the playground and 
> It is good.
> 
yes

Norbert
>> On 17/11/2016 12:55, Norbert Hartl wrote:
>> Ahh, I see. Your initializeMongo is actually a configuration of the system. 
>> That configuration you do once in the image, hence the name #enableSingleton 
>> because it is accessible as singleton from everywhere. 
>> 
>> Norbert
>> 
>>> Am 17.11.2016 um 12:44 schrieb Asbath Sama biyalou <asamabiya...@yahoo.com>:
>>> 
>>> Thanks. Just look my function look like this: 
>>> initializeMongo
>>> | repository |
>>> repository := VOMongoRepository 
>>> host: 'example.com'
>>> port: 27017
>>> database: 'example_name'.
>>> repository enableSingleton.
>>> 
>>> "Collections are created automatically as soon as you access them the first 
>>> time."  That is true but to connect to the 
>>> database.
>>> 
>>> In which I have to implement that method : all the root classes or what.
>>>> On 17/11/2016 12:34, Norbert Hartl wrote:
>>>> I'm not sure what you mean with initialize. If you think about creating 
>>>> the collections in mongo then you have to do nothing. Collections are 
>>>> created automatically as soon as you access them the first time. 
>>>> 
>>>> Norbert
>>>> 
>>>> 
>>>>> Am 17.11.2016 um 12:29 schrieb Asbath Sama biyalou via Pharo-users 
>>>>> <pharo-users@lists.pharo.org>:
>>>>> 
>>>>> 
>>>>> Von: Asbath Sama biyalou <asamabiya...@yahoo.com>
>>>>> Betreff: Mongo with Voyage
>>>>> Datum: 17. November 2016 um 12:29:24 MEZ
>>>>> An: pharo-users@lists.pharo.org
>>>>> 
>>>>> 
>>>>> Hello.
>>>>> I'am using pharo 4.0 with external mongo database (mongolab.com)
>>>>> I have like 7 classes which are voyageRoot.
>>>>> I want to know if I will initialize mongo in each class or in which
>>>>> class I can implement it.
>>>>> Thanks
>>>>> 
>>>>> 
>>>>> 
>>>> 
>>> 
>> 
> 


Re: [Pharo-users] Mongo with Voyage

2016-11-17 Thread Norbert Hartl
Ahh, I see. Your initializeMongo is actually a configuration of the system. 
That configuration you do once in the image, hence the name #enableSingleton 
because it is accessible as singleton from everywhere. 

Norbert

> Am 17.11.2016 um 12:44 schrieb Asbath Sama biyalou <asamabiya...@yahoo.com>:
> 
> Thanks. Just look my function look like this: 
> initializeMongo
> | repository |
> repository := VOMongoRepository 
> host: 'example.com'
> port: 27017
> database: 'example_name'.
> repository enableSingleton.
> 
> "Collections are created automatically as soon as you access them the first 
> time."  That is true but to connect to the 
> database.
> 
> In which I have to implement that method : all the root classes or what.
> On 17/11/2016 12:34, Norbert Hartl wrote:
>> I'm not sure what you mean with initialize. If you think about creating the 
>> collections in mongo then you have to do nothing. Collections are created 
>> automatically as soon as you access them the first time. 
>> 
>> Norbert
>> 
>> 
>>> Am 17.11.2016 um 12:29 schrieb Asbath Sama biyalou via Pharo-users 
>>> <pharo-users@lists.pharo.org <mailto:pharo-users@lists.pharo.org>>:
>>> 
>>> 
>>> Von: Asbath Sama biyalou <asamabiya...@yahoo.com 
>>> <mailto:asamabiya...@yahoo.com>>
>>> Betreff: Mongo with Voyage
>>> Datum: 17. November 2016 um 12:29:24 MEZ
>>> An: pharo-users@lists.pharo.org <mailto:pharo-users@lists.pharo.org>
>>> 
>>> 
>>> Hello.
>>> I'am using pharo 4.0 with external mongo database (mongolab.com 
>>> <http://mongolab.com/>)
>>> I have like 7 classes which are voyageRoot.
>>> I want to know if I will initialize mongo in each class or in which
>>> class I can implement it.
>>> Thanks
>>> 
>>> 
>>> 
>> 
> 



Re: [Pharo-users] Mongo with Voyage

2016-11-17 Thread Norbert Hartl
I'm not sure what you mean with initialize. If you think about creating the 
collections in mongo then you have to do nothing. Collections are created 
automatically as soon as you access them the first time. 

Norbert


> Am 17.11.2016 um 12:29 schrieb Asbath Sama biyalou via Pharo-users 
> :
> 
> 
> Von: Asbath Sama biyalou 
> Betreff: Mongo with Voyage
> Datum: 17. November 2016 um 12:29:24 MEZ
> An: pharo-users@lists.pharo.org
> 
> 
> Hello.
> I'am using pharo 4.0 with external mongo database (mongolab.com)
> I have like 7 classes which are voyageRoot.
> I want to know if I will initialize mongo in each class or in which
> class I can implement it.
> Thanks
> 
> 
> 



Re: [Pharo-users] QCMagritte question- does it have undo?

2016-11-11 Thread Norbert Hartl


> Am 11.11.2016 um 06:03 schrieb PAUL DEBRUICKER :
> 
> I've never used magritte or QC magritte and was wondering whether with the 
> momento it qas also possible to get multi step undo cheaply if it didn't 
> already exist.
> 
I don't know if it exists. But you just need to save the current memento, copy 
it (make sure the dictionary inside is another instance) and use that. This 
would work before a commit has been done. Do you want to undo even commited 
stuff?

Norbert





[Pharo-users] AWS libraries

2016-11-10 Thread Norbert Hartl
What libraries exist these days for amazon services? I may need a library for 
SNS service so is there anybody working on it?

thanks,

Norbert


Re: [Pharo-users] Can pharo association web page point to association.pharo.org, like the consortium one?

2016-11-10 Thread Norbert Hartl

> Am 10.11.2016 um 09:44 schrieb Marcus Denker :
> 
> 
>> On 5 Nov 2016, at 12:31, Marcus Denker > > wrote:
>> 
>> Hi,
>> 
>> Current Status:
>> 
>> - SPF record DONE, mails are now send from @association.pharo.org
>> - DNS setup now uses association.pharo.org  
>> for normal viewing, just forms forward to https://pharo. 
>> wildapricot.org 
>> This will change as soon as the SSL certificate setup is completed, which 
>> will be next week.
>> 
> 
> 
> SSL setup is DONE.
> 
>   https://association.pharo.org 
> 
> 
> The site is now fully operational.
> 
great!

Norbert




Re: [Pharo-users] About balkanisation

2016-11-07 Thread Norbert Hartl

> Am 07.11.2016 um 10:40 schrieb Dale Henrichs 
> :
> 
> 
> 
> On 11/7/16 2:59 AM, Tudor Girba wrote:
>> Hi Dale,
>> 
>> I think I missed your mails. I would be interested in hearing your opinion. 
>> Let’s aim for a chat sometime next week. Would this work for you?
> You're not the only one :) Yes it would ... Monday is a travel day so Tuesday 
> or beyond would work for me …
> 
Would it make sense to make that a group conversation?

Norbert






Re: [Pharo-users] about balkanisation

2016-11-07 Thread Norbert Hartl

> Am 07.11.2016 um 10:28 schrieb Esteban Lorenzano :
> 
> 
>> On 7 Nov 2016, at 10:17, Sven Van Caekenberghe  wrote:
>> 
>> 
>>> On 7 Nov 2016, at 10:13, Thierry Goubier  wrote:
>>> 
>>> I've seen over the years many, many attempts at replacing the filetree 
>>> format. I used to contest and debate, now I just let them go and die a few 
>>> months later. Because none of the alternatives are clearly superior, and it 
>>> is not worth the effort to reimplement.
>>> 
>>> (I quite enjoy reading filetree-based code on github: it is layed out like 
>>> my browser, neat and clean. Moreover, all my code involve multiple classes, 
>>> which means switching between files anyway. Given that reading those !! was 
>>> never a pleasure, even when I started using Smalltalk in 1991)
>> 
>> Indeed. I agree 100%.
> 
> I was even thinking on propose someone (a student project, maybe?) to do an 
> embeddable browser people could put in their README.md, to browse sources “as 
> in Pharo” :) 
> a Seaside app to do that would not be hard, I think… and can be hosted on 
> PharoCloud (or whatever you want). 
> 
I fully agree to your previous mail (the long one) but want to add that it is 
not only the number of things to maintain that plays an important role in 
taming complexity. You can count the complexity of each project into that 
calculation. And proposing something using seaside is not an approach according 
to this rule ;)

Norbert




Re: [Pharo-users] Pecha Kucha alike presentation powered by Pharo

2016-10-31 Thread Norbert Hartl
It is maybe the easiest way to use a meta refresh tag.

http://www.w3schools.com/tags/att_meta_http_equiv.asp

Norbert

> Am 31.10.2016 um 18:58 schrieb Offray Vladimir Luna Cárdenas 
> :
> 
> Hi,
> 
> I will be doing next Wednesday a Pecha Kucha[1]  alike presentation (yep, 
> they told me just recently) and I would like a different kind of 
> presentation: Keeping the constrains of "20 slides, each 20 seconds", but 
> using kind of a comic grid (powered by Material Design Light[2]), instead of 
> a single slide. The idea is to have 20 html files that show progressions and 
> transitions in the comic grid while the talk advances. For that I would like 
> to use Zinc or Teapot in my local machine and make it go automatically over 
> the next file, each 20 seconds and reload the page showed in the web browser. 
> All will be running locally on my machine.
> 
> [1] https://en.wikipedia.org/wiki/PechaKucha
> [2] https://getmdl.io/
> 
> There is any way to tell Zinc/Teapot to load the next file in a list of them, 
> each 20 seconds?
> 
> Thanks,
> 
> Offray
> 
> 


Re: [Pharo-users] How does Boolean ifTrue work?

2016-10-31 Thread Norbert Hartl

> Am 31.10.2016 um 15:59 schrieb p...@highoctane.be:
> 
> but you should use myCollection ifEmpty: [ ... ]
> 
Why? 

Norbert

> Phil
> 
> On Mon, Oct 31, 2016 at 3:25 PM, Sven Van Caekenberghe  > wrote:
> myCollection isEmpty ifTrue: [ self inform: 'The collection is empty' ].
> 
> First #isEmpty is sent to myCollection which results in either true or false 
> as value.
> 
> Then #ifTrue: is sent to this value.
> 
> Now, if the value was true (the sole instance of class True), the code in 
> True>>#ifTrue: is executed, which will evaluate the block by sending it 
> #value. If the value was false, the code in False>>#ifTrue: is executed, and 
> nil is returned and the block is not executed.
> 
> Like others said, it is just polymorphism at work.
> 
> (And yes, the compiler optimises some of this logic a bit, but the effect is 
> the same).
> 
> > On 31 Oct 2016, at 14:58, CodeDmitry  > > wrote:
> >
> > But still, how is the actual argument "alternativeBlock" passed to the
> > True/False from a Boolean?
> >
> > The message does not cache the message inside itself before passing the
> > message, and it does not pass the alternative block along with the message.
> >
> >
> >
> > --
> > View this message in context: 
> > http://forum.world.st/How-does-Boolean-ifTrue-work-tp4920873p4920886.html 
> > 
> > Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
> >
> 
> 
> 
> 



Re: [Pharo-users] [vwnc] small examples to show the tools

2016-10-30 Thread Norbert Hartl
Relax! 45 minutes is so less time. If you have more than one topic you will 
have a stressed schedule. Basic things of the language are good because that is 
what people are interested in. Using a complexer thing to show make sure most 
of the audience have understood the basics. Doing something across computers is 
not amazing at all if you do not know some of computer and network basics.

Hope that helps a bit,

Norbert

> Am 30.10.2016 um 15:03 schrieb Stephan Eggermont :
> 
> I see the next talk is about docker, so live updating  images sounds like the 
> right thing to do. In Pharo I mostly show glamour, roassal and seaside. The 
> rewrite engine might also be interesting to show. 
> 
> Stephan
> 
> Verstuurd vanaf mijn iPhone
> 
>> Op 30 okt. 2016 om 08:39 heeft Christian Haider 
>>  het volgende geschreven:
>> 
>> Hi all,
>>  
>> in two weeks, I am going to give a little talk about Smalltalk: 
>> http://metameute.de/nook2016/ .
>> It is 45 min with students who probably never heard of Smalltalk.
>> I want to concentrate on the liveliness of the environment with the tools: 
>> Workspace, Inspector, Browser and Debugger.
>>  
>> For this, I need a simple but nice example.
>>  
>> I will use VisualWorks 8.2 and Mirko, a new Smalltalk lover, will use Pharo 
>> 5.
>> We want to have the computers connected, maybe also a Pi, to show the 
>> platform independence of the image concept.
>>  
>> The first idea was a chat client. A client and a server in one image. Then 
>> in two images on one machine, on two machines (also the Pi), maybe in two 
>> dialects (VW, Pharo).
>> Possible to transfer code (blocks) across images (that should blow their 
>> minds J).
>> This is cool, but I am not sure if this is not too much and distracting with 
>> other technologies.
>>  
>> Another is to read a csv file or web service and parse it into objects. With 
>> the right kind of cool data it is fun to mold these objects for the tools.
>> This not so sexy, but easy to do from scratch. Unfortunately, the different 
>> computers would not play a role.
>>  
>> As you see, I am a bit lost and wanted to ask you guys for ideas.
>>  
>> Happy hacking,
>> Christian
>>  
>> P.S. Here in Lübeck, a town in northern Germany, the attitude towards 
>> Smalltalk is generally positive, interested and curious. Maybe it is time 
>> for a Smalltalk renaissance?


Re: [Pharo-users] OSProcess missing from Pharo 6 image

2016-10-28 Thread Norbert Hartl
 loaded by default in a Pharo image. What is 
>>> wrong with OSSubprocess or OSProcess so that they can't be treated the same?
>>>  
>>> What is wrong in executing a simple Metacello command to load it?
>>> 
>>> The fact the image doesn't come as a one download / ready to use for an 
>>> average user?
>>> 
>>> Thierry
>>>  
>>> 
>>>  Original Message 
>>>> I have a love and hate relationship with Pharo
>>>> this one I will put in the hate category
>>>> 
>>>> You expect people to use pharo when you do not offer functionality they 
>>>> come to expect from the language they already use and not even offer an 
>>>> altervative, say a library with similar command line functionality (See 
>>>> Scale).
>>>> 
>>>>> On Fri, Oct 28, 2016 at 2:59 PM Norbert Hartl <norb...@hartl.name> wrote:
>>>>> 
>>>>> Am 28.10.2016 um 13:17 schrieb Dimitris Chloupis <kilon.al...@gmail.com>:
>>>>> 
>>>>> I just noticed that OSProcess misses from Pharo 6 image, it was supposed 
>>>>> to be replaced by OSSubProcess but this not in the image either ? What we 
>>>>> suppose to use to execute bash from inside pharo ?
>>>> It was never in the image. You need to install it in order to use it.
>>>> 
>>>> Norbert
>>>> 
>>>> 
>> 
>> 
> 
> 




Re: [Pharo-users] OSProcess missing from Pharo 6 image

2016-10-28 Thread Norbert Hartl

> Am 28.10.2016 um 13:17 schrieb Dimitris Chloupis :
> 
> I just noticed that OSProcess misses from Pharo 6 image, it was supposed to 
> be replaced by OSSubProcess but this not in the image either ? What we 
> suppose to use to execute bash from inside pharo ? 

It was never in the image. You need to install it in order to use it.

Norbert




Re: [Pharo-users] [Voyage] Question about update of an object

2016-10-22 Thread Norbert Hartl


> Am 22.10.2016 um 13:54 schrieb Cyril Ferlicot D. :
> 
> Hi!
> 
> I have an application with Users that are voyage roots. Those Users can
> have a object X that is also voyage roots.
> 
> I created a web application where a User can create an object X and save
> it. But now I want to adapt the component to edit an existing X object.
> What I have in mind is that I can copy the instance of X, let the user
> change it and save the changes if the user click on "Edit" or discard
> the changes if it click on "Cancel".
> 
> But I don't know how really works the update in Voyage. If I send "save"
> to the copy of X, will it replace X inside the DB? Or should I create a
> method "updateFrom:" in X to change all his variable to match the ones
> from the parameter and then send "save" to the real X object?
> 
Voyage is about identity. If you copy an object then you have a second object 
and voyage will create a new one in the database. If you want update an object 
you need to update the object ;) and not a copy of it. If you have control of 
all the data updated in the UI then an approach like mementos might be 
appropriate. You can look at Magritte how it is done there. With immutable 
objects we'll have other options dealing with that. 

Norbert

> Thanks
> 
> -- 
> Cyril Ferlicot
> 
> http://www.synectique.eu
> 
> 2 rue Jacques Prévert 01,
> 59650 Villeneuve d'ascq France
> 




Re: [Pharo-users] [Seaside] Seaside can not be used with Pharo 60261

2016-10-20 Thread Norbert Hartl
Hi Johan,

can you please upload the ConfigurationOfSeaside3 I've sent in this thread?

thanks,

Norbert

> Am 18.10.2016 um 17:20 schrieb Johan Brichau <jo...@inceptive.be>:
> 
> 
>> On 18 Oct 2016, at 16:36, Norbert Hartl <norb...@hartl.name 
>> <mailto:norb...@hartl.name>> wrote:
>> 
>> (ConfigurationOfAster project version: #development) load
> 
> There are issues with this ‘old’ way of Metacello loading. Can you try:
> 
> Metacello new
>   configuration:’Aster’;
>   version: #development;
>   load.
> 
> (Maybe you need to add the repo to, don’t know).
> 
> Cheers
> Johan



[Pharo-users] Garage sqlite on pharo > 5

2016-10-17 Thread Norbert Hartl
Does anyone use Garage SQL drivers with sqlite in pharo >= 5?

thanks,

Norbert





Re: [Pharo-users] [Pharo-dev] [ANN] New "DarkMetalTheme" for Pharo

2016-10-06 Thread Norbert Hartl
You should call it Insomnia!

Norbert

> Am 06.10.2016 um 10:36 schrieb Esteban Lorenzano :
> 
> Hi, 
> 
> I took some time to extract the ==MUDDarkTheme== I made for my 
> *MUDClient>https://github.com/estebanlm/MUDClient* 
> , 
> repackage it, rebrand it and make it available for everybody. 
> 
> So behold, the new DarkMetalTheme  ! 
> 
> https://github.com/estebanlm/themes  
> 
> 



Re: [Pharo-users] About Seaside3.2

2016-09-30 Thread Norbert Hartl
Stef,

> Am 30.09.2016 um 08:47 schrieb stepharo :
> 
> Hi guys
> 
> I wanted to show latest version of Seaside and I took Seaside on CI
> 
> and I do not get ZincAdaptor. Seaside looks dying to me sadly.
> 
> What should I do ?
> 
seaside is not (!!) dying. 

If you do 

Metacello new
configuration: 'Seaside3';
repository:
'http://www.smalltalkhub.com/mc/Seaside/MetacelloConfigurations/main';
version: '3.2.0';
load.

you load everything needed. I must confess I'm always confused about that, too. 
Meaning from where to load which configuration. In this regard seaside is a 
complete mess.
Seems like the catalog does not point to the right version, not good.

After that….You open the World menu->tools->seaside control panel. 
Right-click->add-adaptor und choose ZnZincServerAdaptor. Enter port 8080 
(alread there) and ok. Point your browser to http://localhost:8080/ et voilà

Norbert


Re: [Pharo-users] Mustache templates listed the in Mustache site

2016-09-27 Thread Norbert Hartl
Thanks for doing it. I wrote them a few yeaes ago but there was no response.

Norbert

> Am 26.09.2016 um 20:20 schrieb Ben Coman <b...@openinworld.com>:
> 
> Cool!  We should do more of that.  Part of building exposure.
> 
> Is it known to work on more than "pharo smalltalk 2.0" ? Perhaps an
> "Update" can be inserted on the page.
> 
> cheers -ben
> 
> On Mon, Sep 26, 2016 at 9:28 PM, Esteban A. Maringolo
> <emaring...@gmail.com> wrote:
>> Some months ago I sent a pull request [1] to add Smalltalk/Pharo to the list
>> of supported languages in Mustache home page <http://mustache.github.io/>.
>> 
>> Took some time but now it is in the front page.
>> 
>> Thank you Norbert Hartl for this useful library.
>> 
>> Regards!
>> 
>> Esteban A. Maringolo
>> 
>> [1] https://github.com/mustache/mustache.github.com/pull/77
> 


[Pharo-users] Strange behavior with software update

2016-09-23 Thread Norbert Hartl
My project I load via filetree so for every package I have a filetree repo 
assigned. I have a code snippet that changes all the filetree repos to 
gitfiletree ones. But when I do System->Software update the repositories are 
back to the filetree ones. Anyone has an idea what could cause this?

thanks,

Norbert




Re: [Pharo-users] "self problem" with Ghost (virus)

2016-07-28 Thread Norbert Hartl

> Am 28.07.2016 um 12:56 schrieb Esteban Lorenzano :
> 
> I do not like either the “virus” name. 
> not just because is negative in a subjective way… also it hides what it does 
> inside a fantasy name, and that IMO is negative to self discovery of the 
> system. 
> 
> I mean… a framework can have a fantasy name… but a class? A method name? 
> (#infect:… come on!) 
> 
> I know is “cool", but if I read the code below, I have NO CLUE of what is 
> going to happen, and that’s not good.
> 
+100

Norbert

> Esteban
> 
>> On 28 Jul 2016, at 12:33, Steven Costiou > > wrote:
>> 
>> Hi,
>> 
>> I think i am missing something.
>> 
>> For example in the following code (took from the tests):
>> 
>> | victim virus actual |
>> virus := GHObjectVirus behaviour: GHGhostBehaviourStub new.
>> 
>> victim := 0@0 corner: 3@4.
>> virus infect: victim.
>> victim corner
>> 
>> The evaluation is trapped by the send:to: method in the behavior (i've put a 
>> halt there). However if i replace the "corner" message by an inspect of the 
>> victim, and if i evaluate "self corner", then the message is processed 
>> without going through the send:to: method of the behavior. It is not halted 
>> and the victim responds immediately to the message. I have also tried to add 
>> a new method in the Rectangle class that calls "self corner". When called in 
>> the playground, my new message is trapped but not the "corner" sent to self.
>> 
>> From what i understand it could be related to the behavior i use, but i 
>> don't see what's missing.   
>> 
>>  
>> Le 2016-07-28 11:35, Denis Kudriashov a écrit :
>> 
>>> I think I not understood second part of "self problem" in this paper. But 
>>> self sends are covered by virus as I described.
>>> 
>>> 2016-07-28 11:30 GMT+02:00 Denis Kudriashov >> >:
>>> Hi
>>> 
>>> 2016-07-27 22:19 GMT+02:00 Steven Costiou >> >:
>>> Hi,
>>> 
>>> I use virus from Ghost to intercept messages sent to a given object and 
>>> adapt methods behaviors for this particular object only. However it would 
>>> seems that doing interception this way is subject to the "self problem" 
>>> described in this paper from Stéphane (DUCASSE, Stéphane. Evaluating 
>>> message passing control techniques in Smalltalk. JOURNAL OF OBJECT ORIENTED 
>>> PROGRAMMING, 1999, vol. 12, p. 39-50).
>>> 
>>> I understand i could do instance based adaptation using an other technique, 
>>> but i wonder if there is any way with Ghost to deal with this "self 
>>> problem" problem ?
>>> 
>>> I think "self problem" is only related to classic proxies when objects stay 
>>> behind them. But ObjectVirus is not proxy in this meaning. When you infect 
>>> your object by virus it is not replaced by somebody else. It is same 
>>> original instance but with overridden behaviour. That's why I call it virus 
>>> without any relation to proxies.
>>> Any message to infected object is processed by your behaviour. All self 
>>> sends are intercepted. But there are few exceptions:
>>> - special messages like ==,ifTrue/ifNil are not intercepted
>>> - meta messages are not intercepted. They processed by Ghost mechanics but 
>>> they not passed to your behaviour. Meta messages defined by 
>>> #currentMetaLevel of your behaviour. You could implement it like:
>>>  
>>> YourGhostBehaviour>>currentMetaLevel
>>>  ^GHMetaLevel empty
>>>  
>>> Empty meta level means that all messages will be passed to your behaviour. 
>>> There is also "GHMetaLevel standard" which is default one. It makes most of 
>>> "tool messages" not interceptable. For example #printString, #class, 
>>> #instVarAt: will be not intercepted. It's messages which are usually used 
>>> by tools like inspector and debugger. 
>>> Standard meta level simplifies debugging of new behaviours. If you make 
>>> mistake somewhere standard messages will be not broken and you could debug 
>>> error by tools.
>>>  
> 



Re: [Pharo-users] UPnP/IGD implementation

2016-07-26 Thread Norbert Hartl
Thanks,

I think I need to read a bit further in order to understand how it works 
really. Didn't know SSDP ist used when tweaking things with IGD.

Norbert

> Am 25.07.2016 um 17:01 schrieb Henrik Johansen <henrik.s.johan...@veloxit.no>:
> 
> SSDP covers discovery of the services and how they are set up; SOAP and XML 
> are then used to access the service.
> IANAE, but; I think as long as you restrict yourself to implement use of the 
> particular service (IGD) you are interested in, it shouldn't be all that bad;
> the use of SSDP discovery data should be fairly straigh forward the way its 
> modelled; you provide the client with callbacks that run when a service of 
> the type you've specified you're interested in becomes available/unavailable.
> 
> The main problem with UPnP (well, other than accessing services involving 
> SOAP and XML instead of REST) is its size; a callback handling "IGD service 
> discovered" should be much simpler than if one wanted to handle "UPnP device 
> discovered" (or, if that's the pattern, restricting UPnP device discovery 
> handling to check if IGD is available).
> 
> (You might want a separate Service subclass to ease access / document what 
> the different fields are though, IIRC, the current Service follows the 
> MorphicExtension pattern of putting anything that does not have a 
> well-defined meaning in SSDP in a dictionary)
> 
> Cheers,
> Henry
> 
>> On 25 Jul 2016, at 3:29 , Norbert Hartl <norb...@hartl.name> wrote:
>> 
>> Thanks,
>> 
>> am I wrong in assuming the UPnP and IGD are rather huge and complicated 
>> things to implement? I just want to figure out if there is a clear answer to 
>> the question if implementing a subset or using a library (mini upnp) through 
>> FFI is more feasible.
>> 
>> Norbert
>>> Am 25.07.2016 um 16:10 schrieb Henrik Johansen 
>>> <henrik.s.johan...@veloxit.no>:
>>> 
>>> 
>>>> On 25 Jul 2016, at 12:13 , Norbert Hartl <norb...@hartl.name> wrote:
>>>> 
>>>> Does anyone know some code or person that did something with UPnP/IGD in 
>>>> pharo?
>>>> 
>>>> thanks,
>>>> 
>>>> Norbert
>>> 
>>> 
>>> I've done an SSDP client/server, but not gone so far as to build a full 
>>> UPnP model on top of it, since I just needed a discovery protocol.
>>> http://smalltalkhub.com/#!/~henriksp/SSDP.
>>> 
>>> Should be possible to use as a base though; you can make a client with type 
>>> ssdp:all, and get some fun replies indicating the services available on 
>>> UPnP routers.
>>> 
>>> Caveats apply to the socket init code which is really ugly, it attempts to 
>>> listen on all the interfaces present at the time of client creation, but 
>>> the correct primitives aren't really exposed from the plugin, the results 
>>> can be a bit hit and miss depending on OS/Distribution; nor are there hooks 
>>> to get notified when interfaces go up/down, so accounting for such 
>>> currently comes down to manual resets.
>>> 
>>> Cheers,
>>> Henry
>> 
>> 
> 




Re: [Pharo-users] UPnP/IGD implementation

2016-07-25 Thread Norbert Hartl
Thanks,

am I wrong in assuming the UPnP and IGD are rather huge and complicated things 
to implement? I just want to figure out if there is a clear answer to the 
question if implementing a subset or using a library (mini upnp) through FFI is 
more feasible.

Norbert
> Am 25.07.2016 um 16:10 schrieb Henrik Johansen <henrik.s.johan...@veloxit.no>:
> 
> 
>> On 25 Jul 2016, at 12:13 , Norbert Hartl <norb...@hartl.name> wrote:
>> 
>> Does anyone know some code or person that did something with UPnP/IGD in 
>> pharo?
>> 
>> thanks,
>> 
>> Norbert
> 
> 
> I've done an SSDP client/server, but not gone so far as to build a full UPnP 
> model on top of it, since I just needed a discovery protocol.
> http://smalltalkhub.com/#!/~henriksp/SSDP.
> 
> Should be possible to use as a base though; you can make a client with type 
> ssdp:all, and get some fun replies indicating the services available on UPnP 
> routers.
> 
> Caveats apply to the socket init code which is really ugly, it attempts to 
> listen on all the interfaces present at the time of client creation, but the 
> correct primitives aren't really exposed from the plugin, the results can be 
> a bit hit and miss depending on OS/Distribution; nor are there hooks to get 
> notified when interfaces go up/down, so accounting for such currently comes 
> down to manual resets.
> 
> Cheers,
> Henry




[Pharo-users] UPnP/IGD implementation

2016-07-25 Thread Norbert Hartl
Does anyone know some code or person that did something with UPnP/IGD in pharo?

thanks,

Norbert





Re: [Pharo-users] Changing method definition at runtime

2016-07-23 Thread Norbert Hartl
Can you elaborate on the reason why want to modify behaviour? And how you would 
like it to happen? 
If the code you want to modify is your own code than you can solve that most of 
time with the things you already have. Your example using a block might be 
altered to be a strategy pattern. That means you keep one ore more instance 
variables for strategy objects. Then you delegate parts of your behaviour to 
those objects. You can based on context exchange those objects to adjust 
behaviour.
If it is not feasible to change the internal state of an object but you know 
all possible variants you can implement all variations as methods in the 
object. The right method can be invoked by doing a double dispatch with another 
object providing contextual information.
There are plenty of possibilities so you need to know what is the context that 
is responsible for switching behaviour and the requirements of the behaviour 
modifications. Can you alter the object? Is the number of modifications a fixed 
number? Does the modification need to be thread safe?

Norbert

> Am 23.07.2016 um 00:41 schrieb Eric Velten de Melo :
> 
> Hello,
> 
> One thing I try to do often is changing the behaviour of a method dynamically 
> at runtime. The current way I do this is by having a block as an instance 
> variable and having the method call this block, but I find this approach a 
> bit cumbersome. Is there some other way or is this the recommended approach?
> 
> I mean, I suppose methods could be changed dynamically by means of reflection 
> somehow, but is this an easy or recommended way of programming in Smalltalk? 
> Should slots make things easier?
> 
> Eric




Re: [Pharo-users] [ANN] JSONWebToken

2016-07-22 Thread Norbert Hartl
Hey Johan,

didn't find it when starting my own. Mine is between 2 and 3 years old. Maybe 
parallel development ;)
Mine is pretty basic and uses only SHA256. I implemented for internal use and 
just released as sven was asking. 

Norbert

> Am 22.07.2016 um 19:20 schrieb Johan Brichau <jo...@inceptive.be>:
> 
> Hey Norbert,
> 
> Also see here: http://smalltalkhub.com/#!/~JohanBrichau/Json-WebToken
> 
> ;)
> 
> Are you using cryptography package?
> 
> Cheers,
> Johan
> 
>> On 22 Jul 2016, at 10:17, Norbert Hartl <norb...@hartl.name> wrote:
>> 
>> Hi,
>> 
>> thanks to the inquiry of Sven I published an implementation of JSONWebToken 
>> to smalltalkhub. It is available at
>> 
>> http://smalltalkhub.com/#!/~NorbertHartl/JSONWebToken
>> 
>> For those who don't know JSONWebToken or short JWT pronounced "jot" is a 
>> token format suitable for authentication and authorization. The token 
>> consist of a header, a payload and a signature. The header defines crypto 
>> algorithms, compression and other things needed to read a token on 
>> reception. The payload is called a claim set which is basically a dictionary 
>> with well-known and custom keys. If we think about OAuth or OpenId the 
>> values contained map directly to JWT claims. For OpenID connect which is an 
>> identification mechanism on top of OAuth the usage of JWT is one of the 
>> building blocks. 
>> 
>> What are the advantages in using JWT?
>> 
>> - it defines a header for encoding the content so it is quite flexible in 
>> the ways compression and encryption of the key is done
>> - defines a payload which maps arbitrary keys and there is a set of 
>> well-known keys that implementations of OAuth, OpenID can understand
>> - defines a signature that makes it easy to trust the information contained 
>> or to give the token to someone who is not trusted
>> - token format is a single line string so it can be used e.g. in HTTP 
>> authentication headers
>> 
>> A problem JWT can solve:
>> 
>> In our company we have a lot of little REST servers serving some duties. To 
>> minimize the chaos I want to have a central authentication and authorization 
>> point. If we assume having 20 images running and we look at typical way how 
>> authorization works:
>> 
>> there is image A (Authentication), image S (Service) und client C. Client C 
>> wants to use the service S
>> 
>> 1. client C authenticates and retrieves authorization information from A (or 
>> from S which redirects him to A)
>> 2. client C hands out the authorization information to S
>> 3. S needs to check at A if the information is valid (client C could have 
>> modified it or generated it)
>> 4. S grants C access
>> 
>> Taking the assumption of having 20 service images, every image would need to 
>> get back to A in order to check authorization information. The more services 
>> images you have the more load it will put on A. In a JWT use case scenario 
>> the same would look like
>> 
>> 1. client C authenticates and receives a JWT containing authorization 
>> information. The token is signed by A
>> 2. client C hands out JWT to service S
>> 3. S checks the signature of A and knows that the authorization information 
>> contained is valid. 
>> 4. S grants C access
>> 
>> FYI,
>> 
>> Norbert
>> 


Re: [Pharo-users] [Pharo-dev] [ANN] JSONWebToken

2016-07-22 Thread Norbert Hartl

> Am 22.07.2016 um 11:47 schrieb Holger Freyther <hol...@freyther.de>:
> 
> 
>> On 22 Jul 2016, at 16:17, Norbert Hartl <norb...@hartl.name> wrote:
>> 
> 
> 
> Hi!
> 
>> Taking the assumption of having 20 service images, every image would need to 
>> get back to A in order to check authorization information. The more services 
>> images you have the more load it will put on A. In a JWT use case scenario 
>> the same would look like
>> 
>> 1. client C authenticates and receives a JWT containing authorization 
>> information. The token is signed by A
>> 2. client C hands out JWT to service S
>> 3. S checks the signature of A and knows that the authorization information 
>> contained is valid. 
>> 4. S grants C access
> 
> thank you for the information! I have one rather specific question. How is 
> the token normally transported from C to S? Part of the body/data of a 
> POST/PUT/GET? A custom header inside the HTTP request?

It is up to you how you like to do it. It could be:

- Client C asks A for authorization and gets back a JWT in the response body
- Client C adds the JWT token as HTTP Header "Authorization: Bearer [token]" to 
ask the service in a usual fashion
- Service S checks signature of token and extracts permission set and grants 
them

or 

- Client C asks service S to do something
- Service S redirects C to A giving a redirect_url as query parameter in the url
- A checks authorization with C and then redirects the request to the 
request_uri having the token as query parameter of the uri

or 

- Client C asks service S to do something
- Service S redirects C to A giving a redirect_url as query parameter in the url
- A checks authorization with C and then redirects the request to the 
request_uri having an exchange code in the query parameters
- S exchange at A the exchange code with authorization token

There are plenty of scenarios possible. It depends if it is about authorization 
or authentication and which "standard" to use. You can always roll your own. If 
you have many services it could be feasible to combine all permissions you need 
into one JWT then send it to A. If your claims are valid you get back the 
signed token from A. You could then use the same token for all your services….

Hope this helps,

Norbert





[Pharo-users] [ANN] JSONWebToken

2016-07-22 Thread Norbert Hartl
Hi,

thanks to the inquiry of Sven I published an implementation of JSONWebToken to 
smalltalkhub. It is available at

http://smalltalkhub.com/#!/~NorbertHartl/JSONWebToken 


For those who don't know JSONWebToken or short JWT pronounced "jot" is a token 
format suitable for authentication and authorization. The token consist of a 
header, a payload and a signature. The header defines crypto algorithms, 
compression and other things needed to read a token on reception. The payload 
is called a claim set which is basically a dictionary with well-known and 
custom keys. If we think about OAuth or OpenId the values contained map 
directly to JWT claims. For OpenID connect which is an identification mechanism 
on top of OAuth the usage of JWT is one of the building blocks. 

What are the advantages in using JWT?

- it defines a header for encoding the content so it is quite flexible in the 
ways compression and encryption of the key is done
- defines a payload which maps arbitrary keys and there is a set of well-known 
keys that implementations of OAuth, OpenID can understand
- defines a signature that makes it easy to trust the information contained or 
to give the token to someone who is not trusted
- token format is a single line string so it can be used e.g. in HTTP 
authentication headers

A problem JWT can solve:

In our company we have a lot of little REST servers serving some duties. To 
minimize the chaos I want to have a central authentication and authorization 
point. If we assume having 20 images running and we look at typical way how 
authorization works:

there is image A (Authentication), image S (Service) und client C. Client C 
wants to use the service S

1. client C authenticates and retrieves authorization information from A (or 
from S which redirects him to A)
2. client C hands out the authorization information to S
3. S needs to check at A if the information is valid (client C could have 
modified it or generated it)
4. S grants C access

Taking the assumption of having 20 service images, every image would need to 
get back to A in order to check authorization information. The more services 
images you have the more load it will put on A. In a JWT use case scenario the 
same would look like

1. client C authenticates and receives a JWT containing authorization 
information. The token is signed by A
2. client C hands out JWT to service S
3. S checks the signature of A and knows that the authorization information 
contained is valid. 
4. S grants C access

FYI,

Norbert



Re: [Pharo-users] An Implementation of JSON Web Tokens

2016-07-22 Thread Norbert Hartl
Hi Sean,

> Am 21.07.2016 um 18:00 schrieb Sean Glazier <sglazier...@gmail.com>:
> 
> Hi,
> 
> Thank you so much. did you use it in a seaside widget as well? if so could I 
> see it? If this is a dumb question please forgive me. I will also see if I 
> need additional code and will update it as well as corresponding tests. I 
> have been working balls to the walls cause we have little time to port things 
> tes then deploy. 
> 
> Of course, they never give us enough time and we start off 2 weeks behind 
> just like engineering school. ( RPI for me).
> 
> I am really looking forward to getting a great project done though and when I 
> succeed I will put links to it so folk can see what we did.
> 
> Again Thank you!
> 
I never used it together for seaside just to authenticate REST based stuff. The 
solution should be similar. It would be a good idea to describe what you are 
trying to achieve. Otherwise it is really hard to give proper advize.

Norbert

>  
> Kind Regards,
>  
> Sean Glazier
>  
> 
> On Thu, Jul 21, 2016 at 6:04 AM, Norbert Hartl <norb...@hartl.name 
> <mailto:norb...@hartl.name>> wrote:
> I uploaded an old implementation of mine. It is not fully implemented but 
> usable for the easy case. 
> 
> http://smalltalkhub.com/#!/~NorbertHartl/JSONWebToken 
> <http://smalltalkhub.com/#!/~NorbertHartl/JSONWebToken>
> 
> Hope it helps,
> 
> Norbert
> 
>> Am 21.07.2016 um 10:04 schrieb Sven Van Caekenberghe <s...@stfx.eu 
>> <mailto:s...@stfx.eu>>:
>> 
>> Hi,
>> 
>> Sean Glazier (who has trouble subscribing to the mailing lists, in CC) is 
>> looking for an implementation of JSON Web Tokens 
>> (https://tools.ietf.org/html/rfc7519 <https://tools.ietf.org/html/rfc7519>). 
>> Is there anyone who can help him ?
>> 
>> He is doing his first Pharo project coming from VW, and of course he has 
>> time constraints.
>> 
>> Thanks,
>> 
>> Sven
>> 
>> 
> 
> 



Re: [Pharo-users] An Implementation of JSON Web Tokens

2016-07-21 Thread Norbert Hartl
I uploaded an old implementation of mine. It is not fully implemented but 
usable for the easy case. 

http://smalltalkhub.com/#!/~NorbertHartl/JSONWebToken 


Hope it helps,

Norbert

> Am 21.07.2016 um 10:04 schrieb Sven Van Caekenberghe :
> 
> Hi,
> 
> Sean Glazier (who has trouble subscribing to the mailing lists, in CC) is 
> looking for an implementation of JSON Web Tokens 
> (https://tools.ietf.org/html/rfc7519). Is there anyone who can help him ?
> 
> He is doing his first Pharo project coming from VW, and of course he has time 
> constraints.
> 
> Thanks,
> 
> Sven
> 
> 



Re: [Pharo-users] How do I convert a FileTree project to Metadataless GitFileTree project?

2016-06-30 Thread Norbert Hartl


> Am 30.06.2016 um 01:26 schrieb Dale Henrichs 
> :
> 
> 
> 
>> On 6/29/16 3:44 PM, Ben Coman wrote:
>> On Thu, Jun 30, 2016 at 3:04 AM, Dale Henrichs
>>  wrote:
>>> 
 On 6/29/16 1:00 AM, Thierry Goubier wrote:
 Le 29/06/2016 00:55, Dale Henrichs a écrit :
 ...
> I'm pretty certain the MCLazyVersionInfo is the real culprit here ...
> while reading the code I recognized that many of the basic patterns were
> exactly as I had remembered them from years ago ... however ...
> MCLazyVersionInfo this puppy with its "default behavior" to scan the
> universe is the real culprit ... I would think that at a minimum the
> repository or repository group would/could be know at the time that the
> MCLazyVersionInfo was created and a scan of just those repositories ---
> already associated with the project --- would not be nearly as bad as
> when we have now ...
 
 The MCLazyVersionInfo thing is mine too; it was a solution to avoid
 keeping MBs of version info kept inside the image memory, with the cost of
 having to reload that information when you access the ancestry.
 
 Now, the approach needs to be tuned to avoid spurious "query the world"
 searches, but, as you point out, I hasn't been too successfull yet. And one
 of the thing MC lack, is that link between a repository and a working copy.
>>> That's not true. Each working copy has repository group where either the
>>> developer has either explicitly declared the set of repositories that are
>>> associated with the working copy and/or the system has recorded the set of
>>> repositories from which the package has been loaded ... you should restrict
>>> the search to the repos in the repository group.
 
 (at the same time, restricting version number determination to a subset of
 the repositories is against MC principles when numbering versions).
>>> In principle, yes, but from a practical point of view, the version number
>>> search was "always" restricted to the set of repositories in the repository
>>> group for the working copy ... keep in mind that putting version numbers in
>>> the package name is a _convention_. I don't think that Monticello ever
>>> defined a package name syntax ... Technically, Monticello is supposed to use
>>> the UUID to disambiguate between to packages with the same name, but as you
>>> and I know, this is not really enforced in the code --- Monticello evolved
>>> to rely on the version number for ordering package versions, but I don't
>>> think that was ever part of the design of Monticello ... if you look at the
>>> older implementations of the tools, there was no enformcement of any
>>> rationale package naming scheme ...
>>> 
>>> I agree that today when looking at the point to which Monticello usage has
>>> evolved that the statement:
>>> 
>>>   "the only way to guarantee a unique version number for a package is to
>>> scan all available repositories"
>> What if rather than being incremental the Monticello number what
>> generated YYMMDDhhmmss?  Should be reasonably compatible with that
>> scope creep of version numbers into Monticello tools.
>> 
>> Maybe the length is a bit ugly and by convention we can condense it a
>> bit.  Does that timestamp in the filename need to be human decodable?
>> YY-->alpha character, e.g. 2016-->F  (these sort after existing numeric 
>> numbers)
>> MM-->hex e.g. Jan-->1  Oct-->A  Dec-->C
>> DD-->extended hex 1-->1, 16-->F,   30-->T
>> hh-->extended hex e.g. 1-->1, 16-->F, 23-->M
>> mm-->standard number
>> ss-->divide by 2 then extended hex, e.g. 8-->4, 32-->F
>> 
>> Today 2016-06-30  23:15:32  --> F6TM15F
>> e.g. Collections-Native.BenComan.F6TM15F.mcz
> 
> Ben,
> 
> the "unique version number" was in reference to the current scheme of 
> incrementing the version number ... the truth is that I don't think it is 
> necessary to "guarantee a unique version number" for Monticello purposes ... 
> it is sufficient to take the latest version number or the package from the 
> set of: the image and repositories in repository group... which is the 
> technique that was used for years ...
> 
> The bug in MCLazyVersionInfo is that it is scanning all repositories 
> connected to the image, when it is sufficient to scan the repositories in the 
> working copy repository group to get a reasonably unique version number ...
> 
Can this be fixed easily? 

thanks, Norbert
> Dale
> 




[Pharo-users] The myth of a small deployment image using metacello

2016-06-24 Thread Norbert Hartl
I have a seaside project that will be installed in a typical fashion headless 
on a server somewhere on the net. The project is in its final stage so I 
started to care about the size of the image. Or better: The size of the image 
is not my main concern but the number of packages installed. The less packages 
you load the better it is, it is that simple. 
This time I encountered a problem that I often see but this particular one 
explains in a very good way that how we use metacello can be improved.

In my project I load only Seaside-Core. This has the advantage of loading far 
less packages and I don't have the need to remove a bunch of registered web 
applications that registered themselves when being loaded. 
I make use of a bootstrap template bought somewhere on the net. I use magritte 
a lot so I was happy to see that there is a package called BootstrapMagritte. 
The package extends some magritte ui classes and overwrites some methods to add 
specific classes to HTML tags. Basically not very much code. 
What happended after I added the package as a dependency to my own project you 
can see here in the load directive of metacello

linear load : 
explicit load : 0.2.3 [ConfigurationOfBootstrapMagritte]
linear load : 0.2.3 [ConfigurationOfBootstrapMagritte]
linear load : 3.5.0 [ConfigurationOfMagritte3]
linear load : 1.1.0 
[ConfigurationOfMagritteGlamourForPharo40]
load : 
Glamour-Presentations.issue_1126-SeanDeNigris.178
load : 
Glamour-Morphic-Renderer.issue_1126-SeanDeNigris.325
explicit load : 3.1.5 [ConfigurationOfSeaside3]
linear load : 3.1.5 [ConfigurationOfSeaside3]
explicit load : 0.26 [ConfigurationOfParasol]
linear load : 0.26 [ConfigurationOfParasol]
linear load : 3.2.0 
[ConfigurationOfSeaside3]
load : 
Seaside-Tests-REST-Core-EstebanMaringolo.34

This is wrong in so many ways. I load a little extensions to my web application 
and end up loading _all_ of seaside which loads beach parasol (a ui testing 
framework), _all_ of magritte which in turn loads glamour packages (a ui 
toolkit). So at this point I think WTF?

Why does this happen? Because the "default" group in many projects contains all 
of the packages and dependencies of the project. I thought at first this is 
wrong but in the meantime I think it is right. Whenever a configuration is 
loaded without additional parameters the "default" group gets loaded. This is 
the best scenario for newcomers (e.g. using the catalog to load). They don't 
know better but want to see what the package has to offer. Fine, we should 
support that. 

For managing projects this gets annoying really quick like you can see above. 
It would always load all dependencies and all packages of every project that 
your own project depends. This is a no-go. To circumvent this a lot of people 
add a "core" group to their configurations (loading the essential parts). This 
is great because in my own project I can add a dependency to a project and load 
only the "core" group. This works if the dependency chain is not very long (at 
best it works in depth 1 ;) ). As soon as a project has two interesting groups 
the problem gets worse. A good example is magritte. It is useful for describing 
your model as well as it contains useful seaside components. The moment I add a 
dependency from my model package to magritte seaside I know it is wrong. I find 
myself sometimes duplicating dependencies just to mitigate the effect. I do 
something like

project: 'Magritte3Seaside' with: [
spec
className: #ConfigurationOfMagritte3;
versionString: #'stable';
loads: #('Seaside' );
repository: 
'http://smalltalkhub.com/mc/Magritte/Magritte3/main/' ];
project: 'Magritte3Core' with: [
spec
className: #ConfigurationOfMagritte3;
versionString: #'stable';
loads: #('Core' );
repository: 
'http://smalltalkhub.com/mc/Magritte/Magritte3/main/' ];

and…
package: #'MyProject-Model-Core' with: [
spec requires: #( 'Magritte3Core' ). ];
package: #'MyProject-UI-Core' with: [
spec requires: #( 'Seaside3' 'Magritte3Seaside' 
'BootstrapMagritte'  ). ];


just to be able to put the right dependencies. But this way is cumbersome to do 
and not support by tools like 

[Pharo-users] [ANN] pharo-vm on ubuntu updated

2016-06-10 Thread Norbert Hartl
There are new pharo vms (non-spur) available with updated sources. As a side 
effect the pharo vm is now available on ubuntu 16.04 LTS as well. The created 
vms are in the unstable channel of the pharo ppa. It would be good if a few 
people could test the packages. If nothing is broken with the packages I can 
move them to the stable channel.

To test the packages you need to do:

$ apt-add-respository ppa:pharo/unstable
$ apt-get update
$ apt-get install pharo-vm-core

or 

$ apt-get install pharo-vm-desktop

I hope the packages for the spur vm don't take a long time to come along as 
well.

Happy to get feedback,

Norbert




Re: [Pharo-users] OSProcess command with german umlaut does not work

2016-06-06 Thread Norbert Hartl
Dave,

> Am 06.06.2016 um 18:13 schrieb David T. Lewis :
> 
> Hi Sabine,
> 
> That's great that #utf8Encoded is working, thanks for confirming.
> 
> I'll look and see if I can add that to OSProcess (I'm traveling and cannot
> look at it right now).
> 
> Mariano - this thread probably applies to OSSubProcess also.
> 
that would just work if the system locale is utf8, right? Wouldn't it be better 
to making that a setting?

Norbert

> Dave
> 
>> Hi Sven,
>> 
>> why ByteArray?
>> 
>> does not work (Improper store into indexable object):
>> OSProcess   command: ('cp  /Library/WebServer/Documents/reports/bär.pdf
>> /Library/WebServer/Documents/reports/test-a.pdf' utf8Encoded asString).
>> 
>> works:
>> OSProcess   command: ('cp  /Library/WebServer/Documents/reports/bär.pdf
>> /Library/WebServer/Documents/reports/test-a.pdf' utf8Encoded)
>> 
>> Perhaps David can add this here:
>> 
>> command: aCommandString
>> "Run a command in a shell process. Similar to the system(3) call in the
>> standard C library,
>> except that aCommandString runs asynchronously in a child process. The
>> command is
>> run by a ConnectedUnixProcess in order to facilitate command pipelines
>> within Squeak."
>> 
>> "UnixProcess thisOSProcess command: 'ls -l /etc'"
>> 
>> | proc |
>> pid isNil
>> ifTrue:
>> [self class noAccessorAvailable. ^nil]
>> ifFalse:
>> [proc := self
>> forkJob: ExternalUnixOSProcess defaultShellPath
>> arguments: (Array with: '-c' with: aCommandString utf8Encoded asString)
>> <<<===
>> environment: nil
>> descriptors: nil.
>> proc ifNil: [self class noAccessorAvailable].
>> ^ proc]
>> 
>> 
>> regards
>> Sabine
>> 
>> 
>>> 
>>> 
>> 
>> 2016-06-06 8:41 GMT+02:00 Sabine Manaa :
>> 
>>> Hi Dave,
>>> 
>>> I get the german ä with:
>>> 
>>> (Character value: 228) asString
>>> 
>>> Do you want me to go in it and suggest a solution or do you want to try
>>> to
>>> fix it and I test it?
>>> 
>>> Thanks for helping!
>>> 
>>> Regards Sabine
>>> 
>>> 2016-06-05 23:08 GMT+02:00 David T. Lewis [via Smalltalk] <[hidden
>>> email]
>>> >:
>>> 
 
 
 --
 If you reply to this email, your message will be added to the
 discussion
 below:
 
 http://forum.world.st/OSProcess-command-with-german-umlaut-does-not-work-tp4899285p4899301.html
 To start a new topic under Pharo Smalltalk Users, email [hidden email]
 
 To unsubscribe from Pharo Smalltalk Users, click here.
 NAML
 
 
>>> 
>>> 
>>> --
>>> View this message in context: Re: OSProcess command with german umlaut
>>> does not work
>>> 
>>> Sent from the Pharo Smalltalk Users mailing list archive
>>>  at
>>> Nabble.com.
>>> 
>> 
> 
> 
> 




Re: [Pharo-users] Tables in Pillar

2016-03-31 Thread Norbert Hartl

> Am 31.03.2016 um 12:39 schrieb Damien Cassou :
> 
> "Esteban A. Maringolo"  writes:
> 
>> Was this fixed, considered for a roadmap (if there is one), etc?
> 
> an issue is in the tracker. 2 brilliant students will work on Pillar for
> the next 5 months starting next Monday. I'm quite sure we will see a lot
> of new stuff.

Wow that sounds a lot of things are possible. Do you have a roadmap?

Norbert




<    1   2   3   4   5   6   7   >