Pharo-users
By thread
pharo-users@lists.pharo.org
By month
Messages by month
- ----- 2026 -----
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- 3 participants
- 50348 messages
Re: [Pharo-users] More than 500MB for windows
by Sven Van Caekenberghe
Hi Usman,
On 08 Jul 2013, at 13:05, Usman Bhatti <usman.bhatti(a)gmail.com> wrote:
> [I know there were some discussions on the topic and the topic of 64-bit VM but I'm not sure where we stand today].
> I would like to know if we can allocate more than 500MB for pharo virtual machine in Windows? I am getting an "Out Of memory" msg and the following VM statistics when trying to parse a large application with Moose. Increasing the size would be the cheapest option (in terms of effort) before trying other optimizations.
>
> tx
>
> <Screen Shot 2013-07-08 at 12.31.38 PM.png>
I know nothing about the (extra) limitations of the Windows VM.
But on Linux you can allocate close to 1GB (see mailing list).
On Mac you seem to be able to get pretty close to that (see Phil's answers).
So switching hardware/OS is an option too ;-)
Sven
--
Sven Van Caekenberghe
Proudly supporting Pharo
http://pharo.org
http://association.pharo.org
http://consortium.pharo.org
July 8, 2013
More than 500MB for windows
by Usman Bhatti
[I know there were some discussions on the topic and the topic of 64-bit VM
but I'm not sure where we stand today].
I would like to know if we can allocate more than 500MB for pharo virtual
machine in Windows? I am getting an "Out Of memory" msg and the following
VM statistics when trying to parse a large application with Moose.
Increasing the size would be the cheapest option (in terms of effort)
before trying other optimizations.
tx
[image: Inline image 1]
July 8, 2013
Re: [Pharo-users] [Voyage] #selectOne: and #selectMany: with a block as the argument
by Bernat Romagosa
Also, how does one query a referenced object?
MyClass selectMany: { 'project.name' -> 'Test' } asDictionary. "<-- Works
only if project is an embedded object, but it doesn't if it's a reference."
2013/7/8 Bernat Romagosa <tibabenfortlapalanca(a)gmail.com>
> Sorry for being lazy, but how does one use logical operators in dictionary
> queries?
>
> I'm trying something like:
>
> (User selectMany: { 'profile.firstName' -> { '$regex' -> '^.*na.*'.
> '$options' -> 'i'} asDictionary } asDictionary).
>
> And I'd like to *$or* this with:
>
> 'profile.surname' -> { '$regex' -> '^.*ve.*'. '$options' -> 'i'}
> asDictionary.
>
>
> 2013/7/6 Stéphane Ducasse <stephane.ducasse(a)inria.fr>
>
>>
>> On Jul 6, 2013, at 11:16 AM, Esteban Lorenzano <estebanlm(a)gmail.com>
>> wrote:
>>
>> > sure :)
>> >
>> > I will add a blog post on "voyage advanced queries" too :)
>>
>> too if you want but we could also focus on the chapter because we can be
>> multiple people to edit it
>> while your blog you are alone.
>>
>> Stef
>>
>> >
>> > Esteban
>> >
>> > On Jul 6, 2013, at 10:52 AM, Stéphane Ducasse <
>> stephane.ducasse(a)inria.fr> wrote:
>> >
>> >> esteban could you take some time to add this information to the Voyage
>> chapter?
>> >>
>> >> https://ci.inria.fr/pharo-contribution/job/PharoForTheEnterprise/
>> >>
>> >> add the information in any format and I can make it run.
>> >>
>> >>
>> https://github.com/SquareBracketAssociates/PharoForTheEnterprise-english
>> >>
>> >> Stef
>> >>
>> >>
>> >>
>> >> On Jul 4, 2013, at 7:49 PM, Esteban Lorenzano <estebanlm(a)gmail.com>
>> wrote:
>> >>
>> >>> you have different constructions:
>> >>>
>> >>> { $gt: { "number_field": 42 } }
>> >>>
>> >>> and so on... always with dictionaries (bah, json structs).
>> >>>
>> >>> as a query language it kinda sucks... but well... is how it is :)
>> >>>
>> >>> On Jul 4, 2013, at 7:34 PM, Stéphane Ducasse <
>> stephane.ducasse(a)inria.fr> wrote:
>> >>>
>> >>>> Ok but how do I map conceptual a query to a dictionary
>> >>>>
>> >>>> Do I guess right that there is an exact match
>> >>>>
>> >>>> selectOne: { id -> 10} asDictionary
>> >>>>
>> >>>> will match id = 10
>> >>>>
>> >>>> Now we can only do exact mathc?
>> >>>>
>> >>>> name matches: 'stef*'
>> >>>>
>> >>>>
>> >>>> On Jul 4, 2013, at 6:04 PM, Esteban A. Maringolo <
>> emaringolo(a)gmail.com> wrote:
>> >>>>
>> >>>>> Stef,
>> >>>>>
>> >>>>> You're asking the other Esteban, but having used Voyage and Mongo I
>> >>>>> think I can answer this.
>> >>>>>
>> >>>>> Mongo receives a JSON object to do all the query filtering. For a
>> >>>>> simple lookup it is has a simple structre, as the query gets more
>> >>>>> complex it gets esoteric as well (with "special" MongoDB keys in the
>> >>>>> format of "$key").
>> >>>>>
>> >>>>> Because the simplest map we have to a JSON Object is the
>> Dictionary, I
>> >>>>> guess that's why it ends up being converted to a Dictionary, which
>> in
>> >>>>> turn gets converted to JSON and/or BSON.
>> >>>>>
>> >>>>> Regards,
>> >>>>>
>> >>>>> Esteban A. Maringolo
>> >>>>>
>> >>>>>
>> >>>>> 2013/7/4 Stéphane Ducasse <stephane.ducasse(a)inria.fr>:
>> >>>>>>
>> >>>>>> On Jul 4, 2013, at 2:58 PM, Esteban Lorenzano <estebanlm(a)gmail.com>
>> wrote:
>> >>>>>>
>> >>>>>> Hi :)
>> >>>>>>
>> >>>>>> can you check if you have the "MongoQueries" package installed?
>> >>>>>>
>> >>>>>> cheers,
>> >>>>>> Esteban
>> >>>>>>
>> >>>>>> ps: please notice that in anycase you will not be able to execute
>> >>>>>>
>> >>>>>> [ :each | each name first = $X ]
>> >>>>>>
>> >>>>>> because the MongoQueries package just translates the block into a
>> >>>>>> mongo-query which is a dictionary (a JSON expression). But you
>> will found
>> >>>>>> some ways to help you, some special keywords like #in: and #where:
>> (you can
>> >>>>>> see how they work in the tests)
>> >>>>>>
>> >>>>>>
>> >>>>>> esteban
>> >>>>>> how a dictionary is used to work as a block for a query?
>> >>>>>> Can you explain because I would have thought that the first line
>> did not
>> >>>>>> work and the second would work.
>> >>>>>>
>> >>>>>> Stef
>> >>>>>>
>> >>>>>>
>> >>>>>>
>> >>>>>>
>> >>>>>> On Jul 4, 2013, at 2:17 PM, Bernat Romagosa <
>> tibabenfortlapalanca(a)gmail.com>
>> >>>>>> wrote:
>> >>>>>>
>> >>>>>> Hi!
>> >>>>>>
>> >>>>>> I realize probably only Esteban will be able to answer, but I
>> prefer to
>> >>>>>> write to the list so the mail is logged and other people can
>> benefit from
>> >>>>>> it.
>> >>>>>>
>> >>>>>> I'm trying to use blocks as arguments for #selectOne: and
>> #selectMany:, but
>> >>>>>> it doesn't seem to work. Here's my code:
>> >>>>>>
>> >>>>>> MyClass selectOne: { #name -> 'Some name' } asDictionary.
>> >>>>>> MyClass selectOne: [ :each | each name = 'Some name' ].
>> >>>>>>
>> >>>>>>
>> >>>>>> The first one works, but the second one raises a
>> VOMongoConnectionError.
>> >>>>>>
>> >>>>>> Also:
>> >>>>>>
>> >>>>>> MyClass selectMany: { #name -> 'Some name' } asDictionary.
>> >>>>>> MyClass selectMany: [ :each | each name = 'Some name' ].
>> >>>>>>
>> >>>>>>
>> >>>>>> The first does work, the second one doesn't, which prevents me
>> from writing
>> >>>>>> more useful stuff like:
>> >>>>>>
>> >>>>>> MyClass selectMany: [ :each | each name first = $P ].
>> >>>>>>
>> >>>>>> Any idea why this could be failing? I've the latest stable version
>> loaded
>> >>>>>> via:
>> >>>>>>
>> >>>>>> Gofer it
>> >>>>>> url: 'http://smalltalkhub.com/mc/estebanlm/Voyage/main';
>> >>>>>> package: 'ConfigurationOfVoyageMongo';
>> >>>>>> load.
>> >>>>>> (Smalltalk at: #ConfigurationOfVoyageMongo) load.
>> >>>>>>
>> >>>>>> Thanks! :)
>> >>>>>>
>> >>>>>> Bernat.
>> >>>>>>
>> >>>>>> --
>> >>>>>> Bernat Romagosa.
>> >>>>>>
>> >>>>>>
>> >>>>>>
>> >>>>>
>> >>>>
>> >>>>
>> >>>
>> >>>
>> >>
>> >>
>> >
>> >
>>
>>
>>
>
>
> --
> Bernat Romagosa.
>
--
Bernat Romagosa.
July 8, 2013
Re: [Pharo-users] [Voyage] #selectOne: and #selectMany: with a block as the argument
by Bernat Romagosa
Sorry for being lazy, but how does one use logical operators in dictionary
queries?
I'm trying something like:
(User selectMany: { 'profile.firstName' -> { '$regex' -> '^.*na.*'.
'$options' -> 'i'} asDictionary } asDictionary).
And I'd like to *$or* this with:
'profile.surname' -> { '$regex' -> '^.*ve.*'. '$options' -> 'i'}
asDictionary.
2013/7/6 Stéphane Ducasse <stephane.ducasse(a)inria.fr>
>
> On Jul 6, 2013, at 11:16 AM, Esteban Lorenzano <estebanlm(a)gmail.com>
> wrote:
>
> > sure :)
> >
> > I will add a blog post on "voyage advanced queries" too :)
>
> too if you want but we could also focus on the chapter because we can be
> multiple people to edit it
> while your blog you are alone.
>
> Stef
>
> >
> > Esteban
> >
> > On Jul 6, 2013, at 10:52 AM, Stéphane Ducasse <stephane.ducasse(a)inria.fr>
> wrote:
> >
> >> esteban could you take some time to add this information to the Voyage
> chapter?
> >>
> >> https://ci.inria.fr/pharo-contribution/job/PharoForTheEnterprise/
> >>
> >> add the information in any format and I can make it run.
> >>
> >>
> https://github.com/SquareBracketAssociates/PharoForTheEnterprise-english
> >>
> >> Stef
> >>
> >>
> >>
> >> On Jul 4, 2013, at 7:49 PM, Esteban Lorenzano <estebanlm(a)gmail.com>
> wrote:
> >>
> >>> you have different constructions:
> >>>
> >>> { $gt: { "number_field": 42 } }
> >>>
> >>> and so on... always with dictionaries (bah, json structs).
> >>>
> >>> as a query language it kinda sucks... but well... is how it is :)
> >>>
> >>> On Jul 4, 2013, at 7:34 PM, Stéphane Ducasse <
> stephane.ducasse(a)inria.fr> wrote:
> >>>
> >>>> Ok but how do I map conceptual a query to a dictionary
> >>>>
> >>>> Do I guess right that there is an exact match
> >>>>
> >>>> selectOne: { id -> 10} asDictionary
> >>>>
> >>>> will match id = 10
> >>>>
> >>>> Now we can only do exact mathc?
> >>>>
> >>>> name matches: 'stef*'
> >>>>
> >>>>
> >>>> On Jul 4, 2013, at 6:04 PM, Esteban A. Maringolo <
> emaringolo(a)gmail.com> wrote:
> >>>>
> >>>>> Stef,
> >>>>>
> >>>>> You're asking the other Esteban, but having used Voyage and Mongo I
> >>>>> think I can answer this.
> >>>>>
> >>>>> Mongo receives a JSON object to do all the query filtering. For a
> >>>>> simple lookup it is has a simple structre, as the query gets more
> >>>>> complex it gets esoteric as well (with "special" MongoDB keys in the
> >>>>> format of "$key").
> >>>>>
> >>>>> Because the simplest map we have to a JSON Object is the Dictionary,
> I
> >>>>> guess that's why it ends up being converted to a Dictionary, which in
> >>>>> turn gets converted to JSON and/or BSON.
> >>>>>
> >>>>> Regards,
> >>>>>
> >>>>> Esteban A. Maringolo
> >>>>>
> >>>>>
> >>>>> 2013/7/4 Stéphane Ducasse <stephane.ducasse(a)inria.fr>:
> >>>>>>
> >>>>>> On Jul 4, 2013, at 2:58 PM, Esteban Lorenzano <estebanlm(a)gmail.com>
> wrote:
> >>>>>>
> >>>>>> Hi :)
> >>>>>>
> >>>>>> can you check if you have the "MongoQueries" package installed?
> >>>>>>
> >>>>>> cheers,
> >>>>>> Esteban
> >>>>>>
> >>>>>> ps: please notice that in anycase you will not be able to execute
> >>>>>>
> >>>>>> [ :each | each name first = $X ]
> >>>>>>
> >>>>>> because the MongoQueries package just translates the block into a
> >>>>>> mongo-query which is a dictionary (a JSON expression). But you will
> found
> >>>>>> some ways to help you, some special keywords like #in: and #where:
> (you can
> >>>>>> see how they work in the tests)
> >>>>>>
> >>>>>>
> >>>>>> esteban
> >>>>>> how a dictionary is used to work as a block for a query?
> >>>>>> Can you explain because I would have thought that the first line
> did not
> >>>>>> work and the second would work.
> >>>>>>
> >>>>>> Stef
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>> On Jul 4, 2013, at 2:17 PM, Bernat Romagosa <
> tibabenfortlapalanca(a)gmail.com>
> >>>>>> wrote:
> >>>>>>
> >>>>>> Hi!
> >>>>>>
> >>>>>> I realize probably only Esteban will be able to answer, but I
> prefer to
> >>>>>> write to the list so the mail is logged and other people can
> benefit from
> >>>>>> it.
> >>>>>>
> >>>>>> I'm trying to use blocks as arguments for #selectOne: and
> #selectMany:, but
> >>>>>> it doesn't seem to work. Here's my code:
> >>>>>>
> >>>>>> MyClass selectOne: { #name -> 'Some name' } asDictionary.
> >>>>>> MyClass selectOne: [ :each | each name = 'Some name' ].
> >>>>>>
> >>>>>>
> >>>>>> The first one works, but the second one raises a
> VOMongoConnectionError.
> >>>>>>
> >>>>>> Also:
> >>>>>>
> >>>>>> MyClass selectMany: { #name -> 'Some name' } asDictionary.
> >>>>>> MyClass selectMany: [ :each | each name = 'Some name' ].
> >>>>>>
> >>>>>>
> >>>>>> The first does work, the second one doesn't, which prevents me from
> writing
> >>>>>> more useful stuff like:
> >>>>>>
> >>>>>> MyClass selectMany: [ :each | each name first = $P ].
> >>>>>>
> >>>>>> Any idea why this could be failing? I've the latest stable version
> loaded
> >>>>>> via:
> >>>>>>
> >>>>>> Gofer it
> >>>>>> url: 'http://smalltalkhub.com/mc/estebanlm/Voyage/main';
> >>>>>> package: 'ConfigurationOfVoyageMongo';
> >>>>>> load.
> >>>>>> (Smalltalk at: #ConfigurationOfVoyageMongo) load.
> >>>>>>
> >>>>>> Thanks! :)
> >>>>>>
> >>>>>> Bernat.
> >>>>>>
> >>>>>> --
> >>>>>> Bernat Romagosa.
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>
> >>>>
> >>>>
> >>>
> >>>
> >>
> >>
> >
> >
>
>
>
--
Bernat Romagosa.
July 8, 2013
Re: [Pharo-users] [Pharo-dev] [ANN] Pharo Launcher
by Damien Cassou
On Mon, Jul 8, 2013 at 10:35 AM, Serge Stinckwich
<serge.stinckwich(a)gmail.com> wrote:
> a more deeper integration with ZeroConf so we can do use it on the command line.
Camillo and Damien P have started looking at that
--
Damien Cassou
http://damiencassou.seasidehosting.st
"Success is the ability to go from one failure to another without
losing enthusiasm."
Winston Churchill
July 8, 2013
Re: [Pharo-users] [Pharo-dev] [ANN] Pharo Launcher
by Serge Stinckwich
On Mon, Jul 8, 2013 at 10:11 AM, Damien Cassou <damien.cassou(a)gmail.com> wrote:
> Dear list,
>
> Erwan and I are proud to announce the first release of the Pharo
> Launcher, a cross-platform application that
>
> - lets you manage your Pharo images (launch, rename, copy and delete);
> - lets you download image templates (i.e., zip archives) from many
> different sources (Jenkins, files.pharo.org, and your local cache);
> - lets you create new images from any template.
>
> A screenshot is attached to this email.
>
> The idea behind the Pharo Launcher is that you should be able to
> access it very rapidly from your OS application launcher. As a result,
> launching any image is never more than 3 clicks away.
>
> Download: https://ci.inria.fr/pharo-contribution/job/PharoLauncher/PHARO=30,VERSION=b…
>
> Please report bugs on the 'Launcher' project at https://pharo.fogbugz.org
>
> You can contribute to this project. All classes and most methods are
> commented. There are unit tests. Please contribute!
>
> Source code: http://www.smalltalkhub.com/#!/~Pharo/PharoLauncher
> CI: https://ci.inria.fr/pharo-contribution/job/PharoLauncher
>
> Things you can do to improve the system:
>
> - check if a template is already downloaded before downloading it
> - add a preference mechanism (for, e.g., quit after launch, definition
> of your own template groups, location of downloaded templates and
> images)
> - put the launcher in the Pharo Ubuntu package so that the launcher
> becomes a registered appliation of the system
> (https://launchpad.net/~pharo/+archive/stable)
> - make sure the pharo launcher does not load your personal scripts
> (like fonts and MC configuration)
> - add a toolbar to enhance the discoverability of the features
> (currently everything is in contextual menus)
> - make sure rename and copy actions propose default values
> - make sure no debugger pops up when a user press cancels or enter an
> invalid name
> - propose multiple kinds of sorting (last used, most frequently used,
> alphabetically on the name)
> - give some information about each template (build date, pharo version)
Great Job Damien and Erwan !
This will definitively help me to solve the images mess issue on my disk ;-)
What could be nice in the future is the possibility to choose the VM
also and maybe
a more deeper integration with ZeroConf so we can do use it on the command line.
Regards,
--
Serge Stinckwich
UCBN & UMI UMMISCO 209 (IRD/UPMC)
Every DSL ends up being Smalltalk
http://www.doesnotunderstand.org/
July 8, 2013
[ANN] Pharo Launcher
by Damien Cassou
Dear list,
Erwan and I are proud to announce the first release of the Pharo
Launcher, a cross-platform application that
- lets you manage your Pharo images (launch, rename, copy and delete);
- lets you download image templates (i.e., zip archives) from many
different sources (Jenkins, files.pharo.org, and your local cache);
- lets you create new images from any template.
A screenshot is attached to this email.
The idea behind the Pharo Launcher is that you should be able to
access it very rapidly from your OS application launcher. As a result,
launching any image is never more than 3 clicks away.
Download: https://ci.inria.fr/pharo-contribution/job/PharoLauncher/PHARO=30,VERSION=b…
Please report bugs on the 'Launcher' project at https://pharo.fogbugz.org
You can contribute to this project. All classes and most methods are
commented. There are unit tests. Please contribute!
Source code: http://www.smalltalkhub.com/#!/~Pharo/PharoLauncher
CI: https://ci.inria.fr/pharo-contribution/job/PharoLauncher
Things you can do to improve the system:
- check if a template is already downloaded before downloading it
- add a preference mechanism (for, e.g., quit after launch, definition
of your own template groups, location of downloaded templates and
images)
- put the launcher in the Pharo Ubuntu package so that the launcher
becomes a registered appliation of the system
(https://launchpad.net/~pharo/+archive/stable)
- make sure the pharo launcher does not load your personal scripts
(like fonts and MC configuration)
- add a toolbar to enhance the discoverability of the features
(currently everything is in contextual menus)
- make sure rename and copy actions propose default values
- make sure no debugger pops up when a user press cancels or enter an
invalid name
- propose multiple kinds of sorting (last used, most frequently used,
alphabetically on the name)
- give some information about each template (build date, pharo version)
--
Damien Cassou
http://damiencassou.seasidehosting.st
"Success is the ability to go from one failure to another without
losing enthusiasm."
Winston Churchill
July 8, 2013
Re: [Pharo-users] [Voyage] #selectOne: and #selectMany: with a block as the argument
by Stéphane Ducasse
On Jul 6, 2013, at 11:16 AM, Esteban Lorenzano <estebanlm(a)gmail.com> wrote:
> sure :)
>
> I will add a blog post on "voyage advanced queries" too :)
too if you want but we could also focus on the chapter because we can be multiple people to edit it
while your blog you are alone.
Stef
>
> Esteban
>
> On Jul 6, 2013, at 10:52 AM, Stéphane Ducasse <stephane.ducasse(a)inria.fr> wrote:
>
>> esteban could you take some time to add this information to the Voyage chapter?
>>
>> https://ci.inria.fr/pharo-contribution/job/PharoForTheEnterprise/
>>
>> add the information in any format and I can make it run.
>>
>> https://github.com/SquareBracketAssociates/PharoForTheEnterprise-english
>>
>> Stef
>>
>>
>>
>> On Jul 4, 2013, at 7:49 PM, Esteban Lorenzano <estebanlm(a)gmail.com> wrote:
>>
>>> you have different constructions:
>>>
>>> { $gt: { "number_field": 42 } }
>>>
>>> and so on... always with dictionaries (bah, json structs).
>>>
>>> as a query language it kinda sucks... but well... is how it is :)
>>>
>>> On Jul 4, 2013, at 7:34 PM, Stéphane Ducasse <stephane.ducasse(a)inria.fr> wrote:
>>>
>>>> Ok but how do I map conceptual a query to a dictionary
>>>>
>>>> Do I guess right that there is an exact match
>>>>
>>>> selectOne: { id -> 10} asDictionary
>>>>
>>>> will match id = 10
>>>>
>>>> Now we can only do exact mathc?
>>>>
>>>> name matches: 'stef*'
>>>>
>>>>
>>>> On Jul 4, 2013, at 6:04 PM, Esteban A. Maringolo <emaringolo(a)gmail.com> wrote:
>>>>
>>>>> Stef,
>>>>>
>>>>> You're asking the other Esteban, but having used Voyage and Mongo I
>>>>> think I can answer this.
>>>>>
>>>>> Mongo receives a JSON object to do all the query filtering. For a
>>>>> simple lookup it is has a simple structre, as the query gets more
>>>>> complex it gets esoteric as well (with "special" MongoDB keys in the
>>>>> format of "$key").
>>>>>
>>>>> Because the simplest map we have to a JSON Object is the Dictionary, I
>>>>> guess that's why it ends up being converted to a Dictionary, which in
>>>>> turn gets converted to JSON and/or BSON.
>>>>>
>>>>> Regards,
>>>>>
>>>>> Esteban A. Maringolo
>>>>>
>>>>>
>>>>> 2013/7/4 Stéphane Ducasse <stephane.ducasse(a)inria.fr>:
>>>>>>
>>>>>> On Jul 4, 2013, at 2:58 PM, Esteban Lorenzano <estebanlm(a)gmail.com> wrote:
>>>>>>
>>>>>> Hi :)
>>>>>>
>>>>>> can you check if you have the "MongoQueries" package installed?
>>>>>>
>>>>>> cheers,
>>>>>> Esteban
>>>>>>
>>>>>> ps: please notice that in anycase you will not be able to execute
>>>>>>
>>>>>> [ :each | each name first = $X ]
>>>>>>
>>>>>> because the MongoQueries package just translates the block into a
>>>>>> mongo-query which is a dictionary (a JSON expression). But you will found
>>>>>> some ways to help you, some special keywords like #in: and #where: (you can
>>>>>> see how they work in the tests)
>>>>>>
>>>>>>
>>>>>> esteban
>>>>>> how a dictionary is used to work as a block for a query?
>>>>>> Can you explain because I would have thought that the first line did not
>>>>>> work and the second would work.
>>>>>>
>>>>>> Stef
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Jul 4, 2013, at 2:17 PM, Bernat Romagosa <tibabenfortlapalanca(a)gmail.com>
>>>>>> wrote:
>>>>>>
>>>>>> Hi!
>>>>>>
>>>>>> I realize probably only Esteban will be able to answer, but I prefer to
>>>>>> write to the list so the mail is logged and other people can benefit from
>>>>>> it.
>>>>>>
>>>>>> I'm trying to use blocks as arguments for #selectOne: and #selectMany:, but
>>>>>> it doesn't seem to work. Here's my code:
>>>>>>
>>>>>> MyClass selectOne: { #name -> 'Some name' } asDictionary.
>>>>>> MyClass selectOne: [ :each | each name = 'Some name' ].
>>>>>>
>>>>>>
>>>>>> The first one works, but the second one raises a VOMongoConnectionError.
>>>>>>
>>>>>> Also:
>>>>>>
>>>>>> MyClass selectMany: { #name -> 'Some name' } asDictionary.
>>>>>> MyClass selectMany: [ :each | each name = 'Some name' ].
>>>>>>
>>>>>>
>>>>>> The first does work, the second one doesn't, which prevents me from writing
>>>>>> more useful stuff like:
>>>>>>
>>>>>> MyClass selectMany: [ :each | each name first = $P ].
>>>>>>
>>>>>> Any idea why this could be failing? I've the latest stable version loaded
>>>>>> via:
>>>>>>
>>>>>> Gofer it
>>>>>> url: 'http://smalltalkhub.com/mc/estebanlm/Voyage/main';
>>>>>> package: 'ConfigurationOfVoyageMongo';
>>>>>> load.
>>>>>> (Smalltalk at: #ConfigurationOfVoyageMongo) load.
>>>>>>
>>>>>> Thanks! :)
>>>>>>
>>>>>> Bernat.
>>>>>>
>>>>>> --
>>>>>> Bernat Romagosa.
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>
July 6, 2013
Re: [Pharo-users] [Voyage] #selectOne: and #selectMany: with a block as the argument
by Esteban Lorenzano
sure :)
I will add a blog post on "voyage advanced queries" too :)
Esteban
On Jul 6, 2013, at 10:52 AM, Stéphane Ducasse <stephane.ducasse(a)inria.fr> wrote:
> esteban could you take some time to add this information to the Voyage chapter?
>
> https://ci.inria.fr/pharo-contribution/job/PharoForTheEnterprise/
>
> add the information in any format and I can make it run.
>
> https://github.com/SquareBracketAssociates/PharoForTheEnterprise-english
>
> Stef
>
>
>
> On Jul 4, 2013, at 7:49 PM, Esteban Lorenzano <estebanlm(a)gmail.com> wrote:
>
>> you have different constructions:
>>
>> { $gt: { "number_field": 42 } }
>>
>> and so on... always with dictionaries (bah, json structs).
>>
>> as a query language it kinda sucks... but well... is how it is :)
>>
>> On Jul 4, 2013, at 7:34 PM, Stéphane Ducasse <stephane.ducasse(a)inria.fr> wrote:
>>
>>> Ok but how do I map conceptual a query to a dictionary
>>>
>>> Do I guess right that there is an exact match
>>>
>>> selectOne: { id -> 10} asDictionary
>>>
>>> will match id = 10
>>>
>>> Now we can only do exact mathc?
>>>
>>> name matches: 'stef*'
>>>
>>>
>>> On Jul 4, 2013, at 6:04 PM, Esteban A. Maringolo <emaringolo(a)gmail.com> wrote:
>>>
>>>> Stef,
>>>>
>>>> You're asking the other Esteban, but having used Voyage and Mongo I
>>>> think I can answer this.
>>>>
>>>> Mongo receives a JSON object to do all the query filtering. For a
>>>> simple lookup it is has a simple structre, as the query gets more
>>>> complex it gets esoteric as well (with "special" MongoDB keys in the
>>>> format of "$key").
>>>>
>>>> Because the simplest map we have to a JSON Object is the Dictionary, I
>>>> guess that's why it ends up being converted to a Dictionary, which in
>>>> turn gets converted to JSON and/or BSON.
>>>>
>>>> Regards,
>>>>
>>>> Esteban A. Maringolo
>>>>
>>>>
>>>> 2013/7/4 Stéphane Ducasse <stephane.ducasse(a)inria.fr>:
>>>>>
>>>>> On Jul 4, 2013, at 2:58 PM, Esteban Lorenzano <estebanlm(a)gmail.com> wrote:
>>>>>
>>>>> Hi :)
>>>>>
>>>>> can you check if you have the "MongoQueries" package installed?
>>>>>
>>>>> cheers,
>>>>> Esteban
>>>>>
>>>>> ps: please notice that in anycase you will not be able to execute
>>>>>
>>>>> [ :each | each name first = $X ]
>>>>>
>>>>> because the MongoQueries package just translates the block into a
>>>>> mongo-query which is a dictionary (a JSON expression). But you will found
>>>>> some ways to help you, some special keywords like #in: and #where: (you can
>>>>> see how they work in the tests)
>>>>>
>>>>>
>>>>> esteban
>>>>> how a dictionary is used to work as a block for a query?
>>>>> Can you explain because I would have thought that the first line did not
>>>>> work and the second would work.
>>>>>
>>>>> Stef
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On Jul 4, 2013, at 2:17 PM, Bernat Romagosa <tibabenfortlapalanca(a)gmail.com>
>>>>> wrote:
>>>>>
>>>>> Hi!
>>>>>
>>>>> I realize probably only Esteban will be able to answer, but I prefer to
>>>>> write to the list so the mail is logged and other people can benefit from
>>>>> it.
>>>>>
>>>>> I'm trying to use blocks as arguments for #selectOne: and #selectMany:, but
>>>>> it doesn't seem to work. Here's my code:
>>>>>
>>>>> MyClass selectOne: { #name -> 'Some name' } asDictionary.
>>>>> MyClass selectOne: [ :each | each name = 'Some name' ].
>>>>>
>>>>>
>>>>> The first one works, but the second one raises a VOMongoConnectionError.
>>>>>
>>>>> Also:
>>>>>
>>>>> MyClass selectMany: { #name -> 'Some name' } asDictionary.
>>>>> MyClass selectMany: [ :each | each name = 'Some name' ].
>>>>>
>>>>>
>>>>> The first does work, the second one doesn't, which prevents me from writing
>>>>> more useful stuff like:
>>>>>
>>>>> MyClass selectMany: [ :each | each name first = $P ].
>>>>>
>>>>> Any idea why this could be failing? I've the latest stable version loaded
>>>>> via:
>>>>>
>>>>> Gofer it
>>>>> url: 'http://smalltalkhub.com/mc/estebanlm/Voyage/main';
>>>>> package: 'ConfigurationOfVoyageMongo';
>>>>> load.
>>>>> (Smalltalk at: #ConfigurationOfVoyageMongo) load.
>>>>>
>>>>> Thanks! :)
>>>>>
>>>>> Bernat.
>>>>>
>>>>> --
>>>>> Bernat Romagosa.
>>>>>
>>>>>
>>>>>
>>>>
>>>
>>>
>>
>>
>
>
July 6, 2013
Re: [Pharo-users] [Voyage] #selectOne: and #selectMany: with a block as the argument
by Stéphane Ducasse
Sorry but I hate this!
We should be better at writing doc. I do not want to learn this because I ask in the mailing-list if you see
what I mean.
Now that Gutenberg is working we should use it for real
It is based on github so people should be happy and it delivers pdf and html (and whatever will be needed)
So please join and help us building a real system.
Stef
> Good to know!
>
>
> 2013/7/4 Esteban Lorenzano <estebanlm(a)gmail.com>
> you also have regexp expressions (and I think they are better than the where clause):
>
> {
> #name -> {
> '$regex' -> '^P*'.
> '$options' -> 'i'
> } asDictionary
> } asDictionary
>
> there is no support for it with MongoQueries, but they work fine with dictionaries :)
>
> Esteban
>
> On Jul 4, 2013, at 7:36 PM, Bernat Romagosa <tibabenfortlapalanca(a)gmail.com> wrote:
>
>> For other kinds of matches, you need javascript queries, if I understood:
>>
>> User selectOne: [ :each | each where: 'this.name[0] == "s"' ]
>>
>> Right?
>>
>>
>> 2013/7/4 Stéphane Ducasse <stephane.ducasse(a)inria.fr>
>> Ok but how do I map conceptual a query to a dictionary
>>
>> Do I guess right that there is an exact match
>>
>> selectOne: { id -> 10} asDictionary
>>
>> will match id = 10
>>
>> Now we can only do exact mathc?
>>
>> name matches: 'stef*'
>>
>>
>> On Jul 4, 2013, at 6:04 PM, Esteban A. Maringolo <emaringolo(a)gmail.com> wrote:
>>
>> > Stef,
>> >
>> > You're asking the other Esteban, but having used Voyage and Mongo I
>> > think I can answer this.
>> >
>> > Mongo receives a JSON object to do all the query filtering. For a
>> > simple lookup it is has a simple structre, as the query gets more
>> > complex it gets esoteric as well (with "special" MongoDB keys in the
>> > format of "$key").
>> >
>> > Because the simplest map we have to a JSON Object is the Dictionary, I
>> > guess that's why it ends up being converted to a Dictionary, which in
>> > turn gets converted to JSON and/or BSON.
>> >
>> > Regards,
>> >
>> > Esteban A. Maringolo
>> >
>> >
>> > 2013/7/4 Stéphane Ducasse <stephane.ducasse(a)inria.fr>:
>> >>
>> >> On Jul 4, 2013, at 2:58 PM, Esteban Lorenzano <estebanlm(a)gmail.com> wrote:
>> >>
>> >> Hi :)
>> >>
>> >> can you check if you have the "MongoQueries" package installed?
>> >>
>> >> cheers,
>> >> Esteban
>> >>
>> >> ps: please notice that in anycase you will not be able to execute
>> >>
>> >> [ :each | each name first = $X ]
>> >>
>> >> because the MongoQueries package just translates the block into a
>> >> mongo-query which is a dictionary (a JSON expression). But you will found
>> >> some ways to help you, some special keywords like #in: and #where: (you can
>> >> see how they work in the tests)
>> >>
>> >>
>> >> esteban
>> >> how a dictionary is used to work as a block for a query?
>> >> Can you explain because I would have thought that the first line did not
>> >> work and the second would work.
>> >>
>> >> Stef
>> >>
>> >>
>> >>
>> >>
>> >> On Jul 4, 2013, at 2:17 PM, Bernat Romagosa <tibabenfortlapalanca(a)gmail.com>
>> >> wrote:
>> >>
>> >> Hi!
>> >>
>> >> I realize probably only Esteban will be able to answer, but I prefer to
>> >> write to the list so the mail is logged and other people can benefit from
>> >> it.
>> >>
>> >> I'm trying to use blocks as arguments for #selectOne: and #selectMany:, but
>> >> it doesn't seem to work. Here's my code:
>> >>
>> >> MyClass selectOne: { #name -> 'Some name' } asDictionary.
>> >> MyClass selectOne: [ :each | each name = 'Some name' ].
>> >>
>> >>
>> >> The first one works, but the second one raises a VOMongoConnectionError.
>> >>
>> >> Also:
>> >>
>> >> MyClass selectMany: { #name -> 'Some name' } asDictionary.
>> >> MyClass selectMany: [ :each | each name = 'Some name' ].
>> >>
>> >>
>> >> The first does work, the second one doesn't, which prevents me from writing
>> >> more useful stuff like:
>> >>
>> >> MyClass selectMany: [ :each | each name first = $P ].
>> >>
>> >> Any idea why this could be failing? I've the latest stable version loaded
>> >> via:
>> >>
>> >> Gofer it
>> >> url: 'http://smalltalkhub.com/mc/estebanlm/Voyage/main';
>> >> package: 'ConfigurationOfVoyageMongo';
>> >> load.
>> >> (Smalltalk at: #ConfigurationOfVoyageMongo) load.
>> >>
>> >> Thanks! :)
>> >>
>> >> Bernat.
>> >>
>> >> --
>> >> Bernat Romagosa.
>> >>
>> >>
>> >>
>> >
>>
>>
>>
>>
>>
>> --
>> Bernat Romagosa.
>
>
>
>
> --
> Bernat Romagosa.
July 6, 2013