Re: [Pharo-users] Question about dynamic spec

2013-07-08 Thread Andrei Vasile Chis
> It's a bit late today, so I will have a look tomorrow :)
>
> (If I forget, feel free to insult me ^^)
>

There's no rush :)

Andrei



>
> I've implemented a small UI using the dynamic features of spec and I'd
> like to know if there isn't a better way to do it. My use case is simple: I
> have a normal ComposableModel that has two models - a list and
> a DynamicComposableModel. The DynamicComposableModel should contain a list
> of buttons that should change every time the user selects an element in the
> list. I've implemented a demo that can be seen if you download the package
> DynamicSpec-Examples from
> http://www.smalltalkhub.com/mc/AndreiChis/Playground/main and execute the
> code from the class comment of DSChangingButtons.
>
> My problem is that the widget containing the buttons has to define a spec
> layout on the class side. I haven't found a way to tell the spec layout to
> add a widget and use a method on the object for constructing the layout.
> I've manage to get away by dynamically reconstructing the layout when the
> selection changes, however it's not that nice because I had to duplicate
> the layout of the main widget both on the class side and the object side.
> It would be nice to add a widget to the layout like this: 'aSpec
> dynamicAdd: modelGetter withSpec: aSymbol ' that would call aSymbol on the
> object and not on the class. This may or may not make sense :)
>
> To be concrete, the method DSToolbarModel>>updateButtons will call the
> method dynamicLayout on it's parent which in turn will
> call dynamicLayoutWithSpec: on the toolbar. I'd like to avoid this, and
> when specifying the layout of the parent widget to call a method on the
> instance side of it subwidgets to get their layout.
>
> Now I'll end here this rather long email :)
>
> Cheers,
> Andrei
>
>
>


Re: [Pharo-users] Question about dynamic spec

2013-07-08 Thread Benjamin
It's a bit late today, so I will have a look tomorrow :)

(If I forget, feel free to insult me ^^)

Ben

On Jul 8, 2013, at 11:05 PM, Andrei Vasile Chis  
wrote:

> Hi,
> 
> I've implemented a small UI using the dynamic features of spec and I'd like 
> to know if there isn't a better way to do it. My use case is simple: I have a 
> normal ComposableModel that has two models - a list and a 
> DynamicComposableModel. The DynamicComposableModel should contain a list of 
> buttons that should change every time the user selects an element in the 
> list. I've implemented a demo that can be seen if you download the package 
> DynamicSpec-Examples from 
> http://www.smalltalkhub.com/mc/AndreiChis/Playground/main and execute the 
> code from the class comment of DSChangingButtons.
> 
> My problem is that the widget containing the buttons has to define a spec 
> layout on the class side. I haven't found a way to tell the spec layout to 
> add a widget and use a method on the object for constructing the layout. I've 
> manage to get away by dynamically reconstructing the layout when the 
> selection changes, however it's not that nice because I had to duplicate the 
> layout of the main widget both on the class side and the object side. It 
> would be nice to add a widget to the layout like this: 'aSpec dynamicAdd: 
> modelGetter withSpec: aSymbol ' that would call aSymbol on the object and not 
> on the class. This may or may not make sense :)
> 
> To be concrete, the method DSToolbarModel>>updateButtons will call the method 
> dynamicLayout on it's parent which in turn will call dynamicLayoutWithSpec: 
> on the toolbar. I'd like to avoid this, and when specifying the layout of the 
> parent widget to call a method on the instance side of it subwidgets to get 
> their layout.
> 
> Now I'll end here this rather long email :)
> 
> Cheers,
> Andrei



[Pharo-users] Question about dynamic spec

2013-07-08 Thread Andrei Vasile Chis
Hi,

I've implemented a small UI using the dynamic features of spec and I'd like
to know if there isn't a better way to do it. My use case is simple: I have
a normal ComposableModel that has two models - a list and
a DynamicComposableModel. The DynamicComposableModel should contain a list
of buttons that should change every time the user selects an element in the
list. I've implemented a demo that can be seen if you download the package
DynamicSpec-Examples from
http://www.smalltalkhub.com/mc/AndreiChis/Playground/main and execute the
code from the class comment of DSChangingButtons.

My problem is that the widget containing the buttons has to define a spec
layout on the class side. I haven't found a way to tell the spec layout to
add a widget and use a method on the object for constructing the layout.
I've manage to get away by dynamically reconstructing the layout when the
selection changes, however it's not that nice because I had to duplicate
the layout of the main widget both on the class side and the object side.
It would be nice to add a widget to the layout like this: 'aSpec
dynamicAdd: modelGetter withSpec: aSymbol ' that would call aSymbol on the
object and not on the class. This may or may not make sense :)

To be concrete, the method DSToolbarModel>>updateButtons will call the
method dynamicLayout on it's parent which in turn will
call dynamicLayoutWithSpec: on the toolbar. I'd like to avoid this, and
when specifying the layout of the parent widget to call a method on the
instance side of it subwidgets to get their layout.

Now I'll end here this rather long email :)

Cheers,
Andrei


Re: [Pharo-users] [ANN] Pharo Launcher

2013-07-08 Thread Tudor Girba
Hi Damien,

Nice :).

I noticed two issues when playing with it:
- there is no feedback while downloading the image. This can be confusing.
- the launcher quits when launching another image (I am on Mac). This is 
actually interesting, but it was surprising. I am not sure what is the right 
solution here.

And a question: How can we get more images available through this interface?

Cheers,
Doru


On Jul 8, 2013, at 10:11 AM, Damien Cassou  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=bleedingEdge,VM=vm/lastSuccessfulBuild/artifact/PharoLauncher.zip
> 
> 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
> 

--
www.tudorgirba.com

"To utilize feedback, you first have to acquire it."




Re: [Pharo-users] More than 500MB for windows

2013-07-08 Thread Mariano Martinez Peck
I am with Doru here.
Today, 500MB is NOTHINGG.
NOTHING.
NOTHING.
A LATOP comes with 8GB. 16x more than the max the VM can allocate.
For one of my clients, I have just set up a server with 32GB. It has 64x
than the max a Pharo VM can allocate. Really?
Going to disk is not always a possibility for many many reasons.
And even if it were possibleif I have to spent XXX hours to workaround
Pharo because it cannot use more than 500MB, then people will simply move
to another language.
And finally, wasn't a language like Smalltalk prepare for you and let you
only focus in your app blah blah blah.. ?  having to go to disk doesn't
sound like that...

So, Igor, I cannot stand that point of view. I can stand many others, like
explaining why it's not Pharo fault, the problem window has, the money/time
it would take for an engineer to fix it, etc etc etc. But not your position.

Cheers,




On Mon, Jul 8, 2013 at 5:43 PM, Tudor Girba  wrote:

> Hi,
>
> Igor, please get this point of view out of your system :).
>
> First, not all programming languages are like this: You can easily run
> other VMs (e.g., Java) with more than 3 GB. But, let's not even go there: I
> can run Pharo with 1Gb on Mac without problems. According to your reasoning
> we might end up downgrading the Mac VM. Some data does not fit in memory,
> but if I can get all my data in my image, I will choose to do it.
>
> I am not saying that we should compare with Java, or that it is the end of
> the world that the Windows VM is highly restricted. I am simply saying that
> we should not dismiss this as a problem just because we do not know how, or
> do not have the resources to solve it right now.
>
> After all, we are here to change the world :).
>
> Cheers,
> Doru
>
>
> On Jul 8, 2013, at 4:50 PM, Igor Stasenko  wrote:
>
> > Same question again. And same answer (i have no other yet).
> >
> > Why just don't use disk memory?
> > I know it is extra effort, but that's what all software does, when it
> has to deal with big amounts of data.
> > Why in smalltalk it should be different?
> >
> > Of course, on your place, i would also prefer that there is some magic
> fairy waves its magic wand and problem solved, but it is not going to be
> solved.
> > If today you need >512Mb for your data, tomorrow you will need twice as
> much, and after tomorrow it will double again.
> > So, let us be realistic: the solution to your problem lies not in VM,
> but in a way how to manage the data.
> >
> > --
> > Best regards,
> > Igor Stasenko.
>
> --
> www.tudorgirba.com
>
> "Sometimes the best solution is not the best solution."
>
>
>


-- 
Mariano
http://marianopeck.wordpress.com


Re: [Pharo-users] More than 500MB for windows

2013-07-08 Thread Tudor Girba
Hi,

Igor, please get this point of view out of your system :).

First, not all programming languages are like this: You can easily run other 
VMs (e.g., Java) with more than 3 GB. But, let's not even go there: I can run 
Pharo with 1Gb on Mac without problems. According to your reasoning we might 
end up downgrading the Mac VM. Some data does not fit in memory, but if I can 
get all my data in my image, I will choose to do it.

I am not saying that we should compare with Java, or that it is the end of the 
world that the Windows VM is highly restricted. I am simply saying that we 
should not dismiss this as a problem just because we do not know how, or do not 
have the resources to solve it right now.

After all, we are here to change the world :).

Cheers,
Doru


On Jul 8, 2013, at 4:50 PM, Igor Stasenko  wrote:

> Same question again. And same answer (i have no other yet).
> 
> Why just don't use disk memory?
> I know it is extra effort, but that's what all software does, when it has to 
> deal with big amounts of data.
> Why in smalltalk it should be different?
> 
> Of course, on your place, i would also prefer that there is some magic fairy 
> waves its magic wand and problem solved, but it is not going to be solved.
> If today you need >512Mb for your data, tomorrow you will need twice as much, 
> and after tomorrow it will double again.
> So, let us be realistic: the solution to your problem lies not in VM, but in 
> a way how to manage the data.
> 
> -- 
> Best regards,
> Igor Stasenko.

--
www.tudorgirba.com

"Sometimes the best solution is not the best solution."




Re: [Pharo-users] [Voyage] #selectOne: and #selectMany: with a block as the argument

2013-07-08 Thread Stéphane Ducasse
estebanS
could you do me one favor:
build a kind of list of questions and answers 

so that I can add that to the voyage chapter?
Else I will do it but …

Stef 


On Jul 8, 2013, at 2:38 PM, Esteban A. Maringolo  wrote:

> But, as far as I know, Mongo will create an _id key with an Mongo OID
> for every document that doesn't have one.
> You can use _id without having to use an OID, you can use plain
> strings or integers.
> 
> So I guess it is safe to use _id. I'll change it in my tests and then
> let you know.
> 
> :)
> Esteban A. Maringolo
> 
> 
> 2013/7/8 Esteban Lorenzano :
>> Because _id is internally used by mongo and I didn't wanted to risk any 
>> collision :)
>> 
>> On Jul 8, 2013, at 2:26 PM, "Esteban A. Maringolo"  
>> wrote:
>> 
>>> Esteban,
>>> 
>>> Why do you use __id: (double underscore) instead of the _id (single
>>> underscore) key?
>>> 
>>> Regards,
>>> Esteban A. Maringolo
>>> 
>>> 
>>> 2013/7/8 Esteban Lorenzano :
 Hi again,
 
 sadly, there is no direct support for referenced queries yet.
 
 however, you can workaround the problem by doing:
 
 
 {
 'referenceField.__id' -> (VORepository current keyOf: referenceObject)
 } asDictionary.
 
 or with MongoQueries:
 
 [ :each | (each at: 'referenceField.__id') =  (VORepository current keyOf:
 referenceObject) ]
 
 Some internal info:
 in Voyage, all references are kept in mongo as sub-documents with this
 structure:
 
 {
 '__id': OID(1234567890).
 '#collection': 'theNameOfTheCollection'.
 }
 
 so, you always can construct queries  knowing that :)
 
 Esteban
 
 On Jul 8, 2013, at 12:58 PM, Bernat Romagosa
  wrote:
 
 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 
> 
> 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 
>> 
>> 
>> On Jul 6, 2013, at 11:16 AM, Esteban Lorenzano 
>> 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
>>>  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 
 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
>  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
>>  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,

Re: [Pharo-users] [ANN] Pharo Launcher

2013-07-08 Thread Stéphane Ducasse
Thanks!
I have to try :)

Stef

On Jul 8, 2013, at 10:11 AM, Damien Cassou  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=bleedingEdge,VM=vm/lastSuccessfulBuild/artifact/PharoLauncher.zip
> 
> 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
> 




Re: [Pharo-users] NeoCSV on Pharo 1.4 - codepoint MNU?

2013-07-08 Thread p...@highoctane.be
Thanks Stephan.


---
Philippe Back
Dramatic Performance Improvements
Mob: +32(0) 478 650 140 | Fax: +32 (0) 70 408 027
Mail:p...@highoctane.be | Web: http://philippeback.eu
Blog: http://philippeback.be | Twitter: @philippeback
Youtube: http://www.youtube.com/user/philippeback/videos

High Octane SPRL
rue cour Boisacq 101 | 1301 Bierges | Belgium

Featured on the Software Process and Measurement Cast
http://spamcast.libsyn.com
Sparx Systems Enterprise Architect and Ability Engineering EADocX Value
Added Reseller




On Mon, Jul 8, 2013 at 5:48 PM, Stephan Eggermont  wrote:

> Some snippets of a working glamour application loading excel files (Moose
> 4.8)
> MNU on SmallInteger could be a broken VM
>
> A separate class to represent the csv file, storing the rows:
>
> ANExcelModel >> on: aFilename
> ^self new
> rows: (NeoCSVReader on: (FileSystem root / aFilename)
> readStream) upToEnd ;
> yourself
>
> The domain model has an announcer letting the browser know when something
> changed
>
> AModel>loadFrom: aFileName
> |excel regel|
> excel := ANExcelModel on: aFileName .
> excel rows allButFirstDo: [ :row |
> regel := ANRegel new.
> regel thema: (self findIn: row at: 1 key: #thema).
> regel onderwerp: (self findIn: row at: 3 key: #onderwerp).
> regel addTo: self.
>  ].
> self announce: ANChanged
>
>
> ANModel>announce: anAnnouncement
> ^self announcer announce: anAnnouncement
>
>
> Part of the browser construction, loading a file:
>
> browser transmit to: #thema; andShow: [ :a |
> a list
> title: 'Themas';
> display: [ (self model dimensies at: #thema) items
> ];
> updateOn: SVChanged from: SVModel default
> announcer;
> act: [ : b | self loadExcel ] entitled: 'Laad csv';
> selectionAct: [ :list |
> self addOnderwerpTo: list selection]
> on: $o
> entitled: 'Voeg onderwerp toe'.
> a text
> title: '?';
> display: [ self helpThema ].
> ].
>
>
> ANBrowser>loadExcel
> |excel|
> excel := MorphicUIManager new chooseFullFileName:  'Selecteer een
> .csv bestand' extensions: nil path: nil preview: nil.
>
> excel isEmptyOrNil ifFalse:[
> self model loadFrom: excel]
>
>


Re: [Pharo-users] NeoCSV on Pharo 1.4 - codepoint MNU?

2013-07-08 Thread Stephan Eggermont
Some snippets of a working glamour application loading excel files (Moose 4.8)
MNU on SmallInteger could be a broken VM

A separate class to represent the csv file, storing the rows:

ANExcelModel >> on: aFilename 
^self new 
rows: (NeoCSVReader on: (FileSystem root / aFilename) 
readStream) upToEnd ;
yourself

The domain model has an announcer letting the browser know when something 
changed

AModel>loadFrom: aFileName 
|excel regel|
excel := ANExcelModel on: aFileName .
excel rows allButFirstDo: [ :row |
regel := ANRegel new.
regel thema: (self findIn: row at: 1 key: #thema).
regel onderwerp: (self findIn: row at: 3 key: #onderwerp).
regel addTo: self.
 ].
self announce: ANChanged


ANModel>announce: anAnnouncement
^self announcer announce: anAnnouncement


Part of the browser construction, loading a file:

browser transmit to: #thema; andShow: [ :a |
a list 
title: 'Themas';
display: [ (self model dimensies at: #thema) items ];
updateOn: SVChanged from: SVModel default announcer;
act: [ : b | self loadExcel ] entitled: 'Laad csv';
selectionAct: [ :list | 
self addOnderwerpTo: list selection]
on: $o
entitled: 'Voeg onderwerp toe'.
a text
title: '?';
display: [ self helpThema ].
].


ANBrowser>loadExcel
|excel|
excel := MorphicUIManager new chooseFullFileName:  'Selecteer een .csv 
bestand' extensions: nil path: nil preview: nil.

excel isEmptyOrNil ifFalse:[
self model loadFrom: excel]


Re: [Pharo-users] More than 500MB for windows

2013-07-08 Thread Igor Stasenko
Same question again. And same answer (i have no other yet).

Why just don't use disk memory?
I know it is extra effort, but that's what all software does, when it has
to deal with big amounts of data.
Why in smalltalk it should be different?

Of course, on your place, i would also prefer that there is some magic
fairy waves its magic wand and problem solved, but it is not going to be
solved.
If today you need >512Mb for your data, tomorrow you will need twice as
much, and after tomorrow it will double again.
So, let us be realistic: the solution to your problem lies not in VM, but
in a way how to manage the data.

-- 
Best regards,
Igor Stasenko.


Re: [Pharo-users] [Voyage] #selectOne: and #selectMany: with a block as the argument

2013-07-08 Thread Esteban Lorenzano
no, don't do it

regular _id are taken as usual. 
__id fields are references to another collection documents inside one document 
(something that  mongo does not have by itself). 

And I like like that :)

Esteban

On Jul 8, 2013, at 2:38 PM, Esteban A. Maringolo  wrote:

> But, as far as I know, Mongo will create an _id key with an Mongo OID
> for every document that doesn't have one.
> You can use _id without having to use an OID, you can use plain
> strings or integers.
> 
> So I guess it is safe to use _id. I'll change it in my tests and then
> let you know.
> 
> :)
> Esteban A. Maringolo
> 
> 
> 2013/7/8 Esteban Lorenzano :
>> Because _id is internally used by mongo and I didn't wanted to risk any 
>> collision :)
>> 
>> On Jul 8, 2013, at 2:26 PM, "Esteban A. Maringolo"  
>> wrote:
>> 
>>> Esteban,
>>> 
>>> Why do you use __id: (double underscore) instead of the _id (single
>>> underscore) key?
>>> 
>>> Regards,
>>> Esteban A. Maringolo
>>> 
>>> 
>>> 2013/7/8 Esteban Lorenzano :
 Hi again,
 
 sadly, there is no direct support for referenced queries yet.
 
 however, you can workaround the problem by doing:
 
 
 {
 'referenceField.__id' -> (VORepository current keyOf: referenceObject)
 } asDictionary.
 
 or with MongoQueries:
 
 [ :each | (each at: 'referenceField.__id') =  (VORepository current keyOf:
 referenceObject) ]
 
 Some internal info:
 in Voyage, all references are kept in mongo as sub-documents with this
 structure:
 
 {
 '__id': OID(1234567890).
 '#collection': 'theNameOfTheCollection'.
 }
 
 so, you always can construct queries  knowing that :)
 
 Esteban
 
 On Jul 8, 2013, at 12:58 PM, Bernat Romagosa
  wrote:
 
 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 
> 
> 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 
>> 
>> 
>> On Jul 6, 2013, at 11:16 AM, Esteban Lorenzano 
>> 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
>>>  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 
 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
>  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
>>  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

Re: [Pharo-users] [Pharo-dev] MongoTalk: new place on smalltalkhub

2013-07-08 Thread Nicolas Petton
nice!

Nico

On Jul 8, 2013, at 2:45 PM, François Stephany  wrote:

> Hi,
> 
> I've just created a new team for MongoTalk on SmalltalkHub: 
> 
> http://www.smalltalkhub.com/#!/~MongoTalkTeam
> 
> The old repo (http://www.smalltalkhub.com/#!/~francois/MongoTalk) will stay 
> just in case some scripts rely on it but you should update to the new repo:
> 
> http://www.smalltalkhub.com/#!/~MongoTalkTeam/mongotalk
> 
> I've created a version 1.5.1 in the Metacello configuration to reflect the 
> repo migration.
> Shout at me if I missed something!
> 
> Cheers,
> Fa
> 
> (Many thanks to Norbert for pushing the migration ;)

--
Nicolas Petton
http://www.nicolas-petton.fr



Re: [Pharo-users] NeoCSV on Pharo 1.4 - codepoint MNU?

2013-07-08 Thread Sven Van Caekenberghe

On 08 Jul 2013, at 15:02, "p...@highoctane.be"  wrote:

> Maybe I'm just doing something silly (like reading binary instead of text).

I vaguely remember FileSystem doing something weird like that long ago, maybe 
in 1.4.

In any case, 

'file.csv' asFileReference readStream

gives a character stream, if you want a binary one, you have to convert 
explicitly, using #binary.

Was there already FileSystem in 1.4 ?




Re: [Pharo-users] NeoCSV on Pharo 1.4 - codepoint MNU?

2013-07-08 Thread p...@highoctane.be
It works now.

Looks like that:

1- I needed to do an asString on the content being read. (I'd like to know
how to read a text file this way - as a text file)

2- as my separator was $;, not specifying one led NeoCSVReader to fail for
some strange reason (it should have given me a single field and values in
an array, which it didn't).


allObjects
| stream reader contents |
stream := self allObjectsDataFile asFileReference readStream.
 contents := stream contents asString.
stream close.
reader := NeoCSVReader on: contents readStream.
 reader separator: $;.
reader upToEnd.


Re: [Pharo-users] NeoCSV on Pharo 1.4 - codepoint MNU?

2013-07-08 Thread p...@highoctane.be
It complains with a DNU on a SmallInteger codepoint, not a Character.

I'll look further.

Maybe I'm just doing something silly (like reading binary instead of text).

allObjects
| stream reader |
stream := self allObjectsDataFile asFileReference readStream.
 reader := NeoCSVReader on: stream.
reader upToEnd.

allObjectsDataFile

^ self dataLocation / 'Application profile_XXX-AllObjects.csv'

dataLocation

^'/Users/philippeback/Documents/HomeHighOctane/Projects_Customers/XXX/Work/Task-StudyAsIs'
asPath.


Phil

On Mon, Jul 8, 2013 at 2:56 PM, Sven Van Caekenberghe  wrote:

> Phil,
>
> On 08 Jul 2013, at 14:39, "p...@highoctane.be"  wrote:
>
> > Hello,
> >
> > I am currently working with a dataset in CSV format and am trying to
> load it in to Moose for visualizations with Mondrian.
> >
> > Now, I am facing an issue with NeoCSV.
> >
> > I loaded the Configuration in Moose without trouble.
> >
> > Now, when loading my file, I do get a MNU with SmallInteger codepoint
> >
> > Is this a Moose issue or a NeoCSV issue ?
> >
> > I've tried to comment out the codepoint message to see where this was
> going but to no avail.
>
> As far as I know Character>>#codePoint is a standard message, it is in 2.0
> and 3.0, I just checked. Do not tell me you are working in an even older
> image ;-)
>
> #asciiValue would be an alternative I guess
>
> Sven
>
> > Clues?
> >
> > TIA
> >
> > Phil
> > 
>
> --
> Sven Van Caekenberghe
> Proudly supporting Pharo
> http://pharo.org
> http://association.pharo.org
> http://consortium.pharo.org
>
>
>
>
>
>
>


Re: [Pharo-users] NeoCSV on Pharo 1.4 - codepoint MNU?

2013-07-08 Thread Sven Van Caekenberghe
Phil,

On 08 Jul 2013, at 14:39, "p...@highoctane.be"  wrote:

> Hello,
> 
> I am currently working with a dataset in CSV format and am trying to load it 
> in to Moose for visualizations with Mondrian.
> 
> Now, I am facing an issue with NeoCSV.
> 
> I loaded the Configuration in Moose without trouble.
> 
> Now, when loading my file, I do get a MNU with SmallInteger codepoint
> 
> Is this a Moose issue or a NeoCSV issue ?
> 
> I've tried to comment out the codepoint message to see where this was going 
> but to no avail.

As far as I know Character>>#codePoint is a standard message, it is in 2.0 and 
3.0, I just checked. Do not tell me you are working in an even older image ;-)

#asciiValue would be an alternative I guess

Sven

> Clues?
> 
> TIA
> 
> Phil
> 

--
Sven Van Caekenberghe
Proudly supporting Pharo
http://pharo.org
http://association.pharo.org
http://consortium.pharo.org







[Pharo-users] MongoTalk: new place on smalltalkhub

2013-07-08 Thread François Stephany
Hi,

I've just created a new team for MongoTalk on SmalltalkHub:

http://www.smalltalkhub.com/#!/~MongoTalkTeam

The old repo (http://www.smalltalkhub.com/#!/~francois/MongoTalk) will stay
just in case some scripts rely on it but you should update to the new repo:

http://www.smalltalkhub.com/#!/~MongoTalkTeam/mongotalk

I've created a version 1.5.1 in the Metacello configuration to reflect the
repo migration.
Shout at me if I missed something!

Cheers,
Fa

(Many thanks to Norbert for pushing the migration ;)


Re: [Pharo-users] [Voyage] #selectOne: and #selectMany: with a block as the argument

2013-07-08 Thread Esteban A. Maringolo
But, as far as I know, Mongo will create an _id key with an Mongo OID
for every document that doesn't have one.
You can use _id without having to use an OID, you can use plain
strings or integers.

So I guess it is safe to use _id. I'll change it in my tests and then
let you know.

:)
Esteban A. Maringolo


2013/7/8 Esteban Lorenzano :
> Because _id is internally used by mongo and I didn't wanted to risk any 
> collision :)
>
> On Jul 8, 2013, at 2:26 PM, "Esteban A. Maringolo"  
> wrote:
>
>> Esteban,
>>
>> Why do you use __id: (double underscore) instead of the _id (single
>> underscore) key?
>>
>> Regards,
>> Esteban A. Maringolo
>>
>>
>> 2013/7/8 Esteban Lorenzano :
>>> Hi again,
>>>
>>> sadly, there is no direct support for referenced queries yet.
>>>
>>> however, you can workaround the problem by doing:
>>>
>>>
>>> {
>>> 'referenceField.__id' -> (VORepository current keyOf: referenceObject)
>>> } asDictionary.
>>>
>>> or with MongoQueries:
>>>
>>> [ :each | (each at: 'referenceField.__id') =  (VORepository current keyOf:
>>> referenceObject) ]
>>>
>>> Some internal info:
>>> in Voyage, all references are kept in mongo as sub-documents with this
>>> structure:
>>>
>>> {
>>> '__id': OID(1234567890).
>>> '#collection': 'theNameOfTheCollection'.
>>> }
>>>
>>> so, you always can construct queries  knowing that :)
>>>
>>> Esteban
>>>
>>> On Jul 8, 2013, at 12:58 PM, Bernat Romagosa
>>>  wrote:
>>>
>>> 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 

 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 
>
>
> On Jul 6, 2013, at 11:16 AM, Esteban Lorenzano 
> 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
>>  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 
>>> 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
  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
>  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 :
>>>
>>> On Jul 4, 2013, at 2:58 PM, Esteban Lorenzano
>>>  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
>>>

Re: [Pharo-users] [Voyage] #selectOne: and #selectMany: with a block as the argument

2013-07-08 Thread Esteban Lorenzano
Because _id is internally used by mongo and I didn't wanted to risk any 
collision :)

On Jul 8, 2013, at 2:26 PM, "Esteban A. Maringolo"  wrote:

> Esteban,
> 
> Why do you use __id: (double underscore) instead of the _id (single
> underscore) key?
> 
> Regards,
> Esteban A. Maringolo
> 
> 
> 2013/7/8 Esteban Lorenzano :
>> Hi again,
>> 
>> sadly, there is no direct support for referenced queries yet.
>> 
>> however, you can workaround the problem by doing:
>> 
>> 
>> {
>> 'referenceField.__id' -> (VORepository current keyOf: referenceObject)
>> } asDictionary.
>> 
>> or with MongoQueries:
>> 
>> [ :each | (each at: 'referenceField.__id') =  (VORepository current keyOf:
>> referenceObject) ]
>> 
>> Some internal info:
>> in Voyage, all references are kept in mongo as sub-documents with this
>> structure:
>> 
>> {
>> '__id': OID(1234567890).
>> '#collection': 'theNameOfTheCollection'.
>> }
>> 
>> so, you always can construct queries  knowing that :)
>> 
>> Esteban
>> 
>> On Jul 8, 2013, at 12:58 PM, Bernat Romagosa
>>  wrote:
>> 
>> 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 
>>> 
>>> 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 
 
 
 On Jul 6, 2013, at 11:16 AM, Esteban Lorenzano 
 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
>  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 
>> 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
>>>  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
  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 :
>> 
>> On Jul 4, 2013, at 2:58 PM, Esteban Lorenzano
>>  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

Re: [Pharo-users] [Voyage] #selectOne: and #selectMany: with a block as the argument

2013-07-08 Thread Esteban A. Maringolo
Esteban,

Why do you use __id: (double underscore) instead of the _id (single
underscore) key?

Regards,
Esteban A. Maringolo


2013/7/8 Esteban Lorenzano :
> Hi again,
>
> sadly, there is no direct support for referenced queries yet.
>
> however, you can workaround the problem by doing:
>
>
> {
> 'referenceField.__id' -> (VORepository current keyOf: referenceObject)
> } asDictionary.
>
> or with MongoQueries:
>
> [ :each | (each at: 'referenceField.__id') =  (VORepository current keyOf:
> referenceObject) ]
>
> Some internal info:
> in Voyage, all references are kept in mongo as sub-documents with this
> structure:
>
> {
> '__id': OID(1234567890).
> '#collection': 'theNameOfTheCollection'.
> }
>
> so, you always can construct queries  knowing that :)
>
> Esteban
>
> On Jul 8, 2013, at 12:58 PM, Bernat Romagosa
>  wrote:
>
> 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 
>>
>> 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 
>>>
>>>
>>> On Jul 6, 2013, at 11:16 AM, Esteban Lorenzano 
>>> 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
>>> >  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 
>>> >> 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
>>> >>>  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
>>>   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 :
>>> >>
>>> >> On Jul 4, 2013, at 2:58 PM, Esteban Lorenzano
>>> >>  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
>>> 

Re: [Pharo-users] [Voyage] #selectOne: and #selectMany: with a block as the argument

2013-07-08 Thread Esteban Lorenzano
your query is almost fine: 
the unique problem is with the argument for the $or expression, which should 
not be another dictionary but a collection: 

{ 
'$or' -> (Array 
with: 'profile.firstName' -> { '$regex' -> '^.*na.*'. 
'$options' -> 'i'} asDictionary
with: 'profile.surname' -> { '$regex' -> '^.*ve.*'. 
'$options' -> 'i'} asDictionary)
} asDictionary.

On Jul 8, 2013, at 2:16 PM, Bernat Romagosa  
wrote:

> Thanks! The reference thing is exactly what I needed :)
> 
> However, I'm not managing very well with the $or query... how would one add a 
> regex in there?
> 
> I've tried:
> 
> User selectMany: 
>   { 
>   '$or' -> 
>   {
>   'profile.firstName' -> { '$regex' -> '^.*na.*'. 
> '$options' -> 'i'} asDictionary.
>   'profile.surname' -> { '$regex' -> '^.*ve.*'. 
> '$options' -> 'i'} asDictionary.
>   } asDictionary
>   } asDictionary.
> 
> But it's obviously wrong... :(
> 
> 
> 2013/7/8 Esteban Lorenzano 
> Hi,
> 
> something like this:
> 
> {
>   '$or'-> { 
>   { $field1 -> value1 } asDictionary. "expression 1"
>   { $field2 -> value2 } asDictionary. "expression 2"
>   ...
>   { $fieldN -> valueN } asDictionary. "expression N"
>   }
> } asDictionary
> 
> cheers, 
> Esteban
> 
> On Jul 8, 2013, at 12:16 PM, Bernat Romagosa  
> wrote:
> 
>> 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 
>> 
>> On Jul 6, 2013, at 11:16 AM, Esteban Lorenzano  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  
>> > 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  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  
>> >>> 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  
>>  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 :
>> >>
>> >> On Jul 4, 2013, at 2:58 PM, Esteban Lorenzano  
>> >> 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

Re: [Pharo-users] More than 500MB for windows

2013-07-08 Thread CHRIS BAILEY
It's bound to be the same. I encountered this quite extensively when 
using VSE on Win32. There were normally a couple of system DLL's that 
got plonked into the middle of it's address range and just moving those 
to one of the outer edges would mean the image could be started with a 
much bigger address space. Some would move without issues, some would 
just refuse to budge and some would appear to work until you actually 
called something in the offending dll :)

The simplest quick gain I
 could get was to use the Windows /3gb switch. This would give you an 
extra gb of contiguous memory and mean you could run an image just shy 
of 1gb. This increases to just under 2gb when you run it on a 64-bit 
machine. Even though the VM itself wasn't 64-bit, you still get the 
memory benefits.




 From: Mariano Martinez Peck 
To: Any question about pharo is welcome  
Cc: CHRIS BAILEY  
Sent: Monday, 8 July 2013, 12:46
Subject: Re: [Pharo-users] More than 500MB for windows
 


I remember there was a thread where Andreas explains why the windows VM would 
not alloc more than 500 MB. I think it's quite similar if not the same to what 
Chris has said. If this is the case, MAYBE, depending on which dlls/plugins you 
use, you may be safe and alloc more??? Don't know...
I can search the email if you want. 

Cheers,



On Mon, Jul 8, 2013 at 8:33 AM, Usman Bhatti  wrote:

On Mon, Jul 8, 2013 at 1:26 PM, CHRIS BAILEY  wrote:
>
>This is a standard problem on Windows whenever something tries to allocate 
>contiguous memory due to the way it fragments your exe's memory with it's own 
>dlls. I was able to get 1.4gb with some pretty nasty hacking of an exe once by 
>rebasing the biggest offending dlls  (it wasn't Pharo but the same principles 
>should apply). You can find them using dependency walker. Be aware it can come 
>with side effects as some really don't want to be moved, and as such I second 
>Sven's OS comment ;-)
>>
>
>
>Tx for the hint. I'll first try image level optimizations before descending 
>down to OS-level.
> 
>
>>
>>
>>
>>
>>
>> From: Usman Bhatti 
>>To: Any question about pharo is welcome  
>>Sent: Monday, 8 July 2013, 12:05
>>Subject: [Pharo-users] More than 500MB for windows
>> 
>>
>>
>>[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
>>
>>
>>
>>
>>
>>
>>
>


-- 
Mariano
http://marianopeck.wordpress.com

Re: [Pharo-users] [Voyage] #selectOne: and #selectMany: with a block as the argument

2013-07-08 Thread Bernat Romagosa
Thanks! The reference thing is exactly what I needed :)

However, I'm not managing very well with the $or query... how would one add
a regex in there?

I've tried:

User selectMany:
{
'$or' ->
{
 'profile.firstName' -> { '$regex' -> '^.*na.*'. '$options' -> 'i'}
asDictionary.
 'profile.surname' -> { '$regex' -> '^.*ve.*'. '$options' -> 'i'}
asDictionary.
 } asDictionary
} asDictionary.

But it's obviously wrong... :(


2013/7/8 Esteban Lorenzano 

> Hi,
>
> something like this:
>
> {
> '$or'-> {
> { $field1 -> value1 } asDictionary. "expression 1"
>  { $field2 -> value2 } asDictionary. "expression 2"
> ...
> { $fieldN -> valueN } asDictionary. "expression N"
>  }
> } asDictionary
>
> cheers,
> Esteban
>
> On Jul 8, 2013, at 12:16 PM, Bernat Romagosa <
> tibabenfortlapala...@gmail.com> wrote:
>
> 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 
>
>>
>> On Jul 6, 2013, at 11:16 AM, Esteban Lorenzano 
>> 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.duca...@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 
>> 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.duca...@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 <
>> emaring...@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 :
>> >>
>> >> On Jul 4, 2013, at 2:58 PM, Esteban Lorenzano 
>> 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 <
>> tibabenfortlapala...@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 t

Re: [Pharo-users] [Voyage] #selectOne: and #selectMany: with a block as the argument

2013-07-08 Thread Esteban Lorenzano
Hi again, 

sadly, there is no direct support for referenced queries yet. 

however, you can workaround the problem by doing:


{  
'referenceField.__id' -> (VORepository current keyOf: referenceObject)
} asDictionary. 

or with MongoQueries:

[ :each | (each at: 'referenceField.__id') =  (VORepository current keyOf: 
referenceObject) ]

Some internal info: 
in Voyage, all references are kept in mongo as sub-documents with this 
structure: 

{
'__id': OID(1234567890).
'#collection': 'theNameOfTheCollection'.
} 

so, you always can construct queries  knowing that :)

Esteban

On Jul 8, 2013, at 12:58 PM, Bernat Romagosa  
wrote:

> 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 
> 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 
> 
> On Jul 6, 2013, at 11:16 AM, Esteban Lorenzano  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  
> > 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  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  
> >>> 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  
>  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 :
> >>
> >> On Jul 4, 2013, at 2:58 PM, Esteban Lorenzano  
> >> 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 
> >> 
> >> 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 -

Re: [Pharo-users] [Voyage] #selectOne: and #selectMany: with a block as the argument

2013-07-08 Thread Esteban Lorenzano
Hi,

something like this:

{
'$or'-> { 
{ $field1 -> value1 } asDictionary. "expression 1"
{ $field2 -> value2 } asDictionary. "expression 2"
...
{ $fieldN -> valueN } asDictionary. "expression N"
}
} asDictionary

cheers, 
Esteban

On Jul 8, 2013, at 12:16 PM, Bernat Romagosa  
wrote:

> 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 
> 
> On Jul 6, 2013, at 11:16 AM, Esteban Lorenzano  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  
> > 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  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  
> >>> 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  
>  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 :
> >>
> >> On Jul 4, 2013, at 2:58 PM, Esteban Lorenzano  
> >> 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 
> >> 
> >> 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:
> >>
> 

Re: [Pharo-users] More than 500MB for windows

2013-07-08 Thread Mariano Martinez Peck
I remember there was a thread where Andreas explains why the windows VM
would not alloc more than 500 MB. I think it's quite similar if not the
same to what Chris has said. If this is the case, MAYBE, depending on which
dlls/plugins you use, you may be safe and alloc more??? Don't know...
I can search the email if you want.

Cheers,


On Mon, Jul 8, 2013 at 8:33 AM, Usman Bhatti  wrote:

> On Mon, Jul 8, 2013 at 1:26 PM, CHRIS BAILEY wrote:
>
>> This is a standard problem on Windows whenever something tries to
>> allocate contiguous memory due to the way it fragments your exe's memory
>> with it's own dlls. I was able to get 1.4gb with some pretty nasty hacking
>> of an exe once by rebasing the biggest offending dlls (it wasn't Pharo but
>> the same principles should apply). You can find them using dependency
>> walker. Be aware it can come with side effects as some really don't want to
>> be moved, and as such I second Sven's OS comment ;-)
>>
>
> Tx for the hint. I'll first try image level optimizations before
> descending down to OS-level.
>
>
>>
>>
>>   --
>>  *From:* Usman Bhatti 
>> *To:* Any question about pharo is welcome 
>> *Sent:* Monday, 8 July 2013, 12:05
>> *Subject:* [Pharo-users] More than 500MB for windows
>>
>> [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]
>>
>>
>>
>>
>


-- 
Mariano
http://marianopeck.wordpress.com


Re: [Pharo-users] More than 500MB for windows

2013-07-08 Thread Usman Bhatti
On Mon, Jul 8, 2013 at 1:26 PM, CHRIS BAILEY wrote:

> This is a standard problem on Windows whenever something tries to allocate
> contiguous memory due to the way it fragments your exe's memory with it's
> own dlls. I was able to get 1.4gb with some pretty nasty hacking of an exe
> once by rebasing the biggest offending dlls (it wasn't Pharo but the same
> principles should apply). You can find them using dependency walker. Be
> aware it can come with side effects as some really don't want to be moved,
> and as such I second Sven's OS comment ;-)
>

Tx for the hint. I'll first try image level optimizations before descending
down to OS-level.


>
>
>   --
>  *From:* Usman Bhatti 
> *To:* Any question about pharo is welcome 
> *Sent:* Monday, 8 July 2013, 12:05
> *Subject:* [Pharo-users] More than 500MB for windows
>
> [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]
>
>
>
>


Re: [Pharo-users] More than 500MB for windows

2013-07-08 Thread Usman Bhatti
On Mon, Jul 8, 2013 at 1:11 PM, Sven Van Caekenberghe  wrote:

> Hi Usman,
>
> On 08 Jul 2013, at 13:05, Usman Bhatti  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
> >
> > 
>
> 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 ;-)
>

I would be surprised if the client agrees to it :). So that I can't (SAS
will take some time to come).
So, may be currently, we'll have to resort to some optimizations through
serialization and de-serialization, but memory limitation is going to be a
recurrent problem for us.



>
> Sven
>
>
> --
> Sven Van Caekenberghe
> Proudly supporting Pharo
> http://pharo.org
> http://association.pharo.org
> http://consortium.pharo.org
>
>
>
>
>
>


Re: [Pharo-users] More than 500MB for windows

2013-07-08 Thread CHRIS BAILEY
This is a standard problem on Windows whenever something tries to allocate contiguous memory due to the way it fragments your exe's memory with it's own dlls. I was able to get 1.4gb with some pretty nasty hacking of an exe once by rebasing the biggest offending dlls  (it wasn't Pharo but the same principles should apply). You can find them using dependency walker. Be aware it can come with side effects as some really don't want to be moved, and as such I second Sven's OS comment ;-)From: Usman Bhatti
  To: Any question about pharo is welcome   Sent: Monday, 8 July 2013, 12:05 Subject: [Pharo-users] More than 500MB for windows   [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



Re: [Pharo-users] More than 500MB for windows

2013-07-08 Thread Sven Van Caekenberghe
Hi Usman,

On 08 Jul 2013, at 13:05, Usman Bhatti  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
> 
> 

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







[Pharo-users] More than 500MB for windows

2013-07-08 Thread 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]
<>

Re: [Pharo-users] [Voyage] #selectOne: and #selectMany: with a block as the argument

2013-07-08 Thread 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 

> 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 
>
>>
>> On Jul 6, 2013, at 11:16 AM, Esteban Lorenzano 
>> 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.duca...@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 
>> 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.duca...@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 <
>> emaring...@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 :
>> >>
>> >> On Jul 4, 2013, at 2:58 PM, Esteban Lorenzano 
>> 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 <
>> tibabenfortlapala...@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 st

Re: [Pharo-users] [Voyage] #selectOne: and #selectMany: with a block as the argument

2013-07-08 Thread 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 

>
> On Jul 6, 2013, at 11:16 AM, Esteban Lorenzano 
> 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 
> 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 
> 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.duca...@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 <
> emaring...@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 :
> >>
> >> On Jul 4, 2013, at 2:58 PM, Esteban Lorenzano 
> 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 <
> tibabenfortlapala...@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! :)

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

2013-07-08 Thread Damien Cassou
On Mon, Jul 8, 2013 at 10:35 AM, Serge Stinckwich
 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



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

2013-07-08 Thread Serge Stinckwich
On Mon, Jul 8, 2013 at 10:11 AM, Damien Cassou  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=bleedingEdge,VM=vm/lastSuccessfulBuild/artifact/PharoLauncher.zip
>
> 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/