Re: [Pharo-users] Another 32-bit on a 64 bit machine question.

2013-07-04 Thread Friedrich Dominicus
Mariano Martinez Peck  writes:

> Yes, there was an old SerialPlugin bug which I think it was reported
> by Friedrich Dominicus  himself...but I am not sure if it was
> integrated.
Sorry for the noise but there still is a problem in the code.

At least here I can show you:
sp := SerialPort new.
sp openPort: '/dev/ttyUSB0'


SerialPort(Object)>>error:
SerialPort>>openPort:
UndefinedObject>>DoIt
Compiler>>evaluate:in:to:notifying:ifFail:logged:
SmalltalkEditor>>evaluateSelectionAndDo: in Block: [rcvr class
evaluatorClass new...

but
sp := SerialPort new.
sp openPort: '/dev//ttyUSB0'

works !!!

Two / instead of just one

I've not the slightes idea on why two slashes are needed. 
I just found out by accident.

Can anyone confirm that?

Regards
Friedrich

-- 
Q-Software Solutions GmbH; Sitz: Bruchsal; Registergericht: Mannheim 
Registriernummer: HRB232138; Geschaeftsfuehrer: Friedrich Dominicus



Re: [Pharo-users] documentation for refactoring tools in Pharo 2

2013-07-04 Thread Stéphane Ducasse

On Jul 4, 2013, at 12:04 AM, Paul DeBruicker  wrote:

> Is there any documentation on the changes between 1.4 and 2 for the
> refactoring tools? Or how to use them effectively to refactor code?
> 
> I'm familiar with Lukas Renggli's writing on them and used them
> regularly in 1.4.
> 
> I'm just trying to use the RBParseTreeRewriter from within a workspace
> but with it limited to a package or class heirarchy.


Normally nothing change.
In addition gisela is working on a new tool to help us as well as a 
documentation.

> 
> Thanks
> 
> Paul
> 




Re: [Pharo-users] Pharo 2.0 and ODBC

2013-07-04 Thread Friedrich Dominicus
To everyone intersted/involved. I downloaded a new virtual machine today
and the same code which has crashed the virtual machine, simply works on
the new Virtual machine. The machine I'm using is:
'NBCoInterpreter NativeBoost-CogPlugin-GuillermoPolito.19 uuid: 
acc98e51-2fba-4841-a965-2975997bba66 May 31 2013
NBCogit NativeBoost-CogPlugin-GuillermoPolito.19 uuid: 
acc98e51-2fba-4841-a965-2975997bba66 May 31 2013
git://gitorious.org/cogvm/blessed.git Commit: 
0f562e0afe14e533470278943b5d65d42ea133c2 Date: 2013-05-30 16:38:08 +0200 By: 
Igor Stasenko  Jenkins build #14595
'

So well it seems it was not my 32-bit libraries but something broken
withing Pharo and/or the FFI area. I'm sorry, but I do not know the
changes  applied to my last used VirtualMachine

Anyway i can use the ODBC stuff from withing Pharo on my Linux box now
to access an .mdb file

Regards
Friedrich

-- 
Q-Software Solutions GmbH; Sitz: Bruchsal; Registergericht: Mannheim 
Registriernummer: HRB232138; Geschaeftsfuehrer: Friedrich Dominicus



Re: [Pharo-users] Pharo 2.0 and ODBC

2013-07-04 Thread Stéphane Ducasse
Thanks for your feedback.
We would love to provide a better infrastructure. It just takes time.

Stef

On Jul 4, 2013, at 12:02 PM, Friedrich Dominicus 
 wrote:

> To everyone intersted/involved. I downloaded a new virtual machine today
> and the same code which has crashed the virtual machine, simply works on
> the new Virtual machine. The machine I'm using is:
> 'NBCoInterpreter NativeBoost-CogPlugin-GuillermoPolito.19 uuid: 
> acc98e51-2fba-4841-a965-2975997bba66 May 31 2013
> NBCogit NativeBoost-CogPlugin-GuillermoPolito.19 uuid: 
> acc98e51-2fba-4841-a965-2975997bba66 May 31 2013
> git://gitorious.org/cogvm/blessed.git Commit: 
> 0f562e0afe14e533470278943b5d65d42ea133c2 Date: 2013-05-30 16:38:08 +0200 By: 
> Igor Stasenko  Jenkins build #14595
> '
> 
> So well it seems it was not my 32-bit libraries but something broken
> withing Pharo and/or the FFI area. I'm sorry, but I do not know the
> changes  applied to my last used VirtualMachine
> 
> Anyway i can use the ODBC stuff from withing Pharo on my Linux box now
> to access an .mdb file
> 
> Regards
> Friedrich
> 
> -- 
> Q-Software Solutions GmbH; Sitz: Bruchsal; Registergericht: Mannheim 
> Registriernummer: HRB232138; Geschaeftsfuehrer: Friedrich Dominicus
> 




Re: [Pharo-users] Pharo 2.0 and ODBC

2013-07-04 Thread Friedrich Dominicus
Stéphane Ducasse  writes:

> Thanks for your feedback.
> We would love to provide a better infrastructure. It just takes time.
Well I remember Matinez writing about hacking the vm. Something about
how to debug the VM and libraries and FFI, would have helped me (I
guess) I'm not that afraid of C but at the edge between Pharo Smalltalk
and C libraries ... Well I guess that simple is not something for the
faint of heart ;-)

Regards
Friedrich


-- 
Q-Software Solutions GmbH; Sitz: Bruchsal; Registergericht: Mannheim 
Registriernummer: HRB232138; Geschaeftsfuehrer: Friedrich Dominicus



Re: [Pharo-users] Pharo 2.0 and ODBC

2013-07-04 Thread Stephan Eggermont
Good to see it working.
Where do I find the announcements of changes to the VM?  
In Pharo-Dev there are the nice mails by Marcus for the image changes.

Stephan



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

2013-07-04 Thread Bernat Romagosa
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.


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

2013-07-04 Thread Esteban Lorenzano
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)



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:
> 
> 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.



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

2013-07-04 Thread Bernat Romagosa
Hi Esteban,

I installed MongoQueries-NicolasPetton.6, but I did it manually, should I
have used some Monticello configuration perhaps?

Thanks!


2013/7/4 Esteban Lorenzano 

> 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)
>
>
>
> 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! :)
>
> Bernat.
>
> --
> Bernat Romagosa.
>
>
>


-- 
Bernat Romagosa.


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

2013-07-04 Thread Bernat Romagosa
Hmm, none of the MongoQueries tests pass, giving the following #dnu:

MessageNotUnderstood: BlockClosure>>bsonTypeCode

I guess I'm missing some packages?


2013/7/4 Bernat Romagosa 

> Hi Esteban,
>
> I installed MongoQueries-NicolasPetton.6, but I did it manually, should I
> have used some Monticello configuration perhaps?
>
> Thanks!
>
>
> 2013/7/4 Esteban Lorenzano 
>
>> 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)
>>
>>
>>
>> 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! :)
>>
>> Bernat.
>>
>> --
>> Bernat Romagosa.
>>
>>
>>
>
>
> --
> Bernat Romagosa.
>



-- 
Bernat Romagosa.


[Pharo-users] Pharo on Fedora 19

2013-07-04 Thread Daniel Miranda
Hello,

I tried to set up Pharo 2.0 on Fedora 19 x86-64, and for that I needed the
32-bit libraries.

Using ldd I could figure out most of them: glibc (obviously), X11, OpenGL
libs, ALSA, libSM, libICE. All the bundled executables/libs are okay
according to ldd.

But when I start pharo I get a blank screen with no response of any kind.
Only Ctrl-C still works. Breaking into a debugger seems to show me the VM
is stuck in an infinite loop in
findMethodWithPrimitiveFromContextUpToContext() function.

Am I missing a library? Has anyone had success with Pharo on Fedora yet?

Thanks,
Daniel


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

2013-07-04 Thread Esteban Lorenzano
Mmm... no idea... you could try by updating all the MongoTalk package, probably 
is out of sync :)

On Jul 4, 2013, at 4:28 PM, Bernat Romagosa  
wrote:

> Hmm, none of the MongoQueries tests pass, giving the following #dnu:
> 
> MessageNotUnderstood: BlockClosure>>bsonTypeCode
> 
> I guess I'm missing some packages?
> 
> 
> 2013/7/4 Bernat Romagosa 
> Hi Esteban,
> 
> I installed MongoQueries-NicolasPetton.6, but I did it manually, should I 
> have used some Monticello configuration perhaps?
> 
> Thanks!
> 
> 
> 2013/7/4 Esteban Lorenzano 
> 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)
> 
> 
> 
> 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:
>> 
>> 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.



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

2013-07-04 Thread Bernat Romagosa
I'm so ashamed I hadn't tried this before asking... a simple
*ConfigurationOfMongoTalk
load* did the job ¬¬

Thanks a lot!


2013/7/4 Esteban Lorenzano 

> Mmm... no idea... you could try by updating all the MongoTalk package,
> probably is out of sync :)
>
> On Jul 4, 2013, at 4:28 PM, Bernat Romagosa <
> tibabenfortlapala...@gmail.com> wrote:
>
> Hmm, none of the MongoQueries tests pass, giving the following #dnu:
>
> MessageNotUnderstood: BlockClosure>>bsonTypeCode
>
> I guess I'm missing some packages?
>
>
> 2013/7/4 Bernat Romagosa 
>
>> Hi Esteban,
>>
>> I installed MongoQueries-NicolasPetton.6, but I did it manually, should I
>> have used some Monticello configuration perhaps?
>>
>> Thanks!
>>
>>
>> 2013/7/4 Esteban Lorenzano 
>>
>>> 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)
>>>
>>>
>>>
>>> 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! :)
>>>
>>> Bernat.
>>>
>>> --
>>> Bernat Romagosa.
>>>
>>>
>>>
>>
>>
>> --
>> Bernat Romagosa.
>>
>
>
>
> --
> Bernat Romagosa.
>
>
>


-- 
Bernat Romagosa.


Re: [Pharo-users] Pharo on Fedora 19

2013-07-04 Thread Pavel Krivanek
Hi,

for me Pharo fully works after upgrade to Fedora 19. With this packages:
glibc-devel.i686 mesa-libGLU.i686 libICE-devel.i686 libSM-devel.i686
I use XFCE without accelerated desktop.

Cheers,
-- Pavel

On Thu, Jul 4, 2013 at 4:35 PM, Daniel Miranda  wrote:

> Hello,
>
> I tried to set up Pharo 2.0 on Fedora 19 x86-64, and for that I needed the
> 32-bit libraries.
>
> Using ldd I could figure out most of them: glibc (obviously), X11, OpenGL
> libs, ALSA, libSM, libICE. All the bundled executables/libs are okay
> according to ldd.
>
> But when I start pharo I get a blank screen with no response of any kind.
> Only Ctrl-C still works. Breaking into a debugger seems to show me the VM
> is stuck in an infinite loop in
> findMethodWithPrimitiveFromContextUpToContext() function.
>
> Am I missing a library? Has anyone had success with Pharo on Fedora yet?
>
> Thanks,
> Daniel
>


Re: [Pharo-users] Pharo on Fedora 19

2013-07-04 Thread Pavel Krivanek
On KDE with acceleration it works fine too. Maybe some video card driver
problem?

-- Pavel

On Thu, Jul 4, 2013 at 4:52 PM, Pavel Krivanek wrote:

> Hi,
>
> for me Pharo fully works after upgrade to Fedora 19. With this packages:
> glibc-devel.i686 mesa-libGLU.i686 libICE-devel.i686 libSM-devel.i686
> I use XFCE without accelerated desktop.
>
> Cheers,
> -- Pavel
>
>
> On Thu, Jul 4, 2013 at 4:35 PM, Daniel Miranda wrote:
>
>> Hello,
>>
>> I tried to set up Pharo 2.0 on Fedora 19 x86-64, and for that I needed
>> the 32-bit libraries.
>>
>> Using ldd I could figure out most of them: glibc (obviously), X11, OpenGL
>> libs, ALSA, libSM, libICE. All the bundled executables/libs are okay
>> according to ldd.
>>
>> But when I start pharo I get a blank screen with no response of any kind.
>> Only Ctrl-C still works. Breaking into a debugger seems to show me the VM
>> is stuck in an infinite loop in
>> findMethodWithPrimitiveFromContextUpToContext() function.
>>
>> Am I missing a library? Has anyone had success with Pharo on Fedora yet?
>>
>> Thanks,
>> Daniel
>>
>
>


Re: [Pharo-users] documentation for refactoring tools in Pharo 2

2013-07-04 Thread Paul DeBruicker
On 07/03/2013 10:43 PM, Marcus Denker wrote:
> 
> On Jul 4, 2013, at 12:04 AM, Paul DeBruicker  wrote:
> 
>> Is there any documentation on the changes between 1.4 and 2 for the
>> refactoring tools? Or how to use them effectively to refactor code?
>>
>> I'm familiar with Lukas Renggli's writing on them and used them
>> regularly in 1.4.
>>
>> I'm just trying to use the RBParseTreeRewriter from within a workspace
>> but with it limited to a package or class hierarchy.
>>
> 
> There should be no changes on that level. The difference just is that we use
> another UI.
> 
>   Marcus
> 
> 
> 

Camillo and I deteremined that its probably a Nautilus bug that prevents
the "Code Rewriting" tools from working in Pharo 2 (I'm using 20606)
from within the browser (see
http://forum.world.st/how-to-use-RBClassRegexRefactoring-in-Pharo-2-td4695780.html).
 But in 1.4 you could use Omnibrowser & the Code rewriting tools.

Since writing the original email in this thread I figured out that in a
Workspace you could do this:




environment := RBBrowserEnvironment new forClasses: Collection
withAllSubclasses.

rule := RBTransformationRule new.
rule rewriteRule replace: '`@object isEmpty' with: '`@object isNotEmpty'.

RBSmalllintChecker runRule: rule onEnvironment: environment.

change := RBCompositeRefactoryChange new.
change changes: rule changes.
change execute


to rewrite code.



[Pharo-users] Convert 'è' to 'e'

2013-07-04 Thread Davide Varvello
Hi there,
 Is there any method to convert an accented char (or string) to the not
accented one?

I.e from 'àéìòü' to 'aeiou'

Thanks
Davide 



--
View this message in context: 
http://forum.world.st/Convert-e-to-e-tp4697373.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.



Re: [Pharo-users] Convert 'è' to 'e'

2013-07-04 Thread Norbert Hartl

Am 04.07.2013 um 17:24 schrieb Davide Varvello :

> Hi there,
> Is there any method to convert an accented char (or string) to the not
> accented one?
> 
> I.e from 'àéìòü' to 'aeiou'
> 
I think your best bet when it comes to transliteration is the ICU library. 
There is some adaption for it. Please have a look at

http://ss3.gemstone.com/ss/ICU.html/Overview
http://ss3.gemstone.com/ss/ICU-V2.html/Overview

Norbert





Re: [Pharo-users] Convert 'è' to 'e'

2013-07-04 Thread Sebastian Tleye
Mmmm, i don't think so. I haven't seen anything in Character class, i think
you have to do it.


2013/7/4 Davide Varvello 

> Hi there,
>  Is there any method to convert an accented char (or string) to the not
> accented one?
>
> I.e from 'àéìòü' to 'aeiou'
>
> Thanks
> Davide
>
>
>
> --
> View this message in context:
> http://forum.world.st/Convert-e-to-e-tp4697373.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>
>


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

2013-07-04 Thread 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:
>> 
>> 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.
> 



[Pharo-users] New Consortium Member: Debris Publishing

2013-07-04 Thread Marcus Denker
New Consortium Member: Debris Publishing

The Pharo Consortium welcomes a new member company:

Debris Publishing Inc. : http://debrispublishing.com

Debris is joining as a Silver Member.

More about...
- Debris Publishing Inc.: http://debrispublishing.com
- Pharo: http://pharo.org 
- Pharo Consortium: http://consortium.pharo.org



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

2013-07-04 Thread Esteban A. Maringolo
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:
>
> 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.
>
>
>



Re: [Pharo-users] documentation for refactoring tools in Pharo 2

2013-07-04 Thread Benjamin
It is, And we fixed that in 3.0 a month ago.

The problem is that a special behaviour is needed when the code is accepted.
The fix could be back ported without too much problem I think


Ben

On Jul 4, 2013, at 5:11 PM, Paul DeBruicker  wrote:

> On 07/03/2013 10:43 PM, Marcus Denker wrote:
>> 
>> On Jul 4, 2013, at 12:04 AM, Paul DeBruicker  wrote:
>> 
>>> Is there any documentation on the changes between 1.4 and 2 for the
>>> refactoring tools? Or how to use them effectively to refactor code?
>>> 
>>> I'm familiar with Lukas Renggli's writing on them and used them
>>> regularly in 1.4.
>>> 
>>> I'm just trying to use the RBParseTreeRewriter from within a workspace
>>> but with it limited to a package or class hierarchy.
>>> 
>> 
>> There should be no changes on that level. The difference just is that we use
>> another UI.
>> 
>>  Marcus
>> 
>> 
>> 
> 
> Camillo and I deteremined that its probably a Nautilus bug that prevents
> the "Code Rewriting" tools from working in Pharo 2 (I'm using 20606)
> from within the browser (see
> http://forum.world.st/how-to-use-RBClassRegexRefactoring-in-Pharo-2-td4695780.html).
> But in 1.4 you could use Omnibrowser & the Code rewriting tools.
> 
> Since writing the original email in this thread I figured out that in a
> Workspace you could do this:
> 
> 
> 
> 
> environment := RBBrowserEnvironment new forClasses: Collection
> withAllSubclasses.
> 
> rule := RBTransformationRule new.
> rule rewriteRule replace: '`@object isEmpty' with: '`@object isNotEmpty'.
> 
> RBSmalllintChecker runRule: rule onEnvironment: environment.
> 
> change := RBCompositeRefactoryChange new.
> change changes: rule changes.
> change execute
> 
> 
> to rewrite code.
> 



Re: [Pharo-users] [Pharo-dev] New Consortium Member: Debris Publishing

2013-07-04 Thread Mariano Martinez Peck
Cool! I am working for them and it is a very nice company!
Thanks for supporting Pharo.


On Thu, Jul 4, 2013 at 12:41 PM, Marcus Denker wrote:

> New Consortium Member: Debris Publishing
>
> The Pharo Consortium welcomes a new member company:
>
> Debris Publishing Inc. : http://debrispublishing.com
>
> Debris is joining as a Silver Member.
>
> More about...
> - Debris Publishing Inc.: http://debrispublishing.com
> - Pharo: http://pharo.org
> - Pharo Consortium: http://consortium.pharo.org
>
>


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


Re: [Pharo-users] Convert 'è' to 'e'

2013-07-04 Thread Hernán Morales Durand

http://www.squeaksource.com/DiacriticSupport

El 04/07/2013 12:24, Davide Varvello escribió:

Hi there,
  Is there any method to convert an accented char (or string) to the not
accented one?

I.e from 'àéìòü' to 'aeiou'

Thanks
Davide



--
View this message in context: 
http://forum.world.st/Convert-e-to-e-tp4697373.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.

.






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

2013-07-04 Thread Esteban Lorenzano
yes, is like my homonym says :)

of course, this is restricted to Voyage and because of how Mongo works..

Esteban

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:
>> 
>> 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.
>> 
>> 
>> 
> 




Re: [Pharo-users] Convert 'è' to 'e'

2013-07-04 Thread Davide Varvello
Thanks guys, I'll look at the ICU library and DiacriticSupport.
Cheers
Davide



--
View this message in context: 
http://forum.world.st/Convert-e-to-e-tp4697373p4697407.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.



Re: [Pharo-users] Convert 'è' to 'e'

2013-07-04 Thread Hilaire Fernandes
Yes, but sorry I forgot it was a long time ago for a seaside
application, in a previous life.
But digging a bit you should find, may be in the String methods.

Hilaire

Le 04/07/2013 17:24, Davide Varvello a écrit :
> Hi there,
>  Is there any method to convert an accented char (or string) to the not
> accented one?
> 
> I.e from 'àéìòü' to 'aeiou'
> 
> Thanks
> Davide 
> 
> 
> 
> --
> View this message in context: 
> http://forum.world.st/Convert-e-to-e-tp4697373.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
> 
> 


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




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

2013-07-04 Thread Stéphane Ducasse
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:
>> 
>> 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.
>> 
>> 
>> 
> 




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

2013-07-04 Thread Bernat Romagosa
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 

> 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 <
> 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! :)
> >>
> >> Bernat.
> >>
> >> --
> >> Bernat Romagosa.
> >>
> >>
> >>
> >
>
>
>


-- 
Bernat Romagosa.


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

2013-07-04 Thread Esteban Lorenzano
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:
>>> 
>>> 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.
>>> 
>>> 
>>> 
>> 
> 
> 




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

2013-07-04 Thread Esteban Lorenzano
oops, is 

{  "number_field":  { $gt:  42  } }

but well, you got the idea :)



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:
 
 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.
 
 
 
>>> 
>> 
>> 
> 




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

2013-07-04 Thread Esteban A. Maringolo
2013/7/4 Bernat Romagosa :
> For other kinds of matches, you need javascript queries, if I understood:
>
> User selectOne: [ :each | each where: 'this.name[0] == "s"' ]
>
> Right?

Just as a side note.

Beware of the "$where" filter (it is: { "$where": this.that == 's' }),
it deserializes the BSON for every value, converts it to the
JavaScript object and then performs the comparison, it is not
efficient in any way.

There are lots of ways to perform the query using built-in operators
instead of $where. (*)

(*) Disclaimer: None of it is pretty in any way. Actually they're
ugly. It's like specifiying an SQL WHERE statement with dictionaries,
or worst, an Excel formula with Dictionaries.

Having some sort of "intelligence" from the Smalltalk side converting
comparison operators to their MongoDB counterparts is really useful.

Regards,



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

2013-07-04 Thread Esteban Lorenzano
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  
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 
> 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:
> >>
> >> 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.



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

2013-07-04 Thread Bernat Romagosa
Good to know!


2013/7/4 Esteban Lorenzano 

> 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 <
> tibabenfortlapala...@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 
>
>> 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 <
>> 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! :)
>> >>
>> >> Bernat.
>> >>
>> >> --
>> >> Bernat Romagosa.
>> >>
>> >>
>> >>
>> >
>>
>>
>>
>
>
> --
> Bernat Romagosa.
>
>
>


-- 
Bernat Romagosa.


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

2013-07-04 Thread Esteban Lorenzano
and btw, AFAIK MongoQueries does not  have support for regexp, but would be 
easy to extend them to support it, something like: 

[ :each | each name regexpMatch: '^P*'  options: 'i'  ]

which is of course more expressive than the dictionary :)

Esteban

On Jul 4, 2013, at 8:29 PM, Esteban Lorenzano  wrote:

> 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  
> 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 
>> 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:
>> >>
>> >> 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.
> 



[Pharo-users] Regex question

2013-07-04 Thread jannik.laval
Hi guys,

Just a simple question about regex:

'a' matchesRegex: '.' --> true
'aa' matchesRegex: '.' --> false

As '.' represents any character, the two previous lines are ok. Now, if I test 
with a cr, it returns true:

String cr matchesRegex: '.' --> true.

Is it the expected behavior ?

Cheers,
Jannik


Re: [Pharo-users] Regex question

2013-07-04 Thread Camillo Bruni
Yes this is ok, '.' matches only a single character.
The alternatives you might be looking for are #prefixMatchesRegex: or '.*'

On 2013-07-05, at 00:03, "jannik.laval"  wrote:
> Hi guys,
> 
> Just a simple question about regex:
> 
> 'a' matchesRegex: '.' --> true
> 'aa' matchesRegex: '.' --> false
> 
> As '.' represents any character, the two previous lines are ok. Now, if I 
> test with a cr, it returns true:
> 
> String cr matchesRegex: '.' --> true.
> 
> Is it the expected behavior ?
> 
> Cheers,
> Jannik




Re: [Pharo-users] Pharo on Fedora 19

2013-07-04 Thread danielkza
I'll try reinstalling the libraries as instructed. I'm currently using the
latest proprietary NVIDIA drivers, they may the problem. I suspect not
because I tried the 3.0 alpha and it ran fine.



--
View this message in context: 
http://forum.world.st/Pharo-on-Fedora-19-tp4697358p4697455.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.



Re: [Pharo-users] Pharo on Fedora 19

2013-07-04 Thread Daniel Miranda
Libraries reinstaller, problem persists, Pharo is definitely stuck on
findMethodWithPrimitiveFromContextUpToContext(). It looks like a problem
during initialization, way before graphics drivers would get in the way. As
I mentioned the 3.0 alpha runs OK, which further raises my suspicions of a
VM bug (what would be special about my system to cause is a more complex
matter).

Daniel


On Thu, Jul 4, 2013 at 11:22 PM, danielkza  wrote:

> I'll try reinstalling the libraries as instructed. I'm currently using the
> latest proprietary NVIDIA drivers, they may the problem. I suspect not
> because I tried the 3.0 alpha and it ran fine.
>
>
>
> --
> View this message in context:
> http://forum.world.st/Pharo-on-Fedora-19-tp4697358p4697455.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>
>


Re: [Pharo-users] Regex question

2013-07-04 Thread jannik.laval
Yes, now in the chapter on Regex, it is written that '.' matches only a single 
character except cr.

So, the command "String cr matchesRegex: '.'" should return false in this case.
But since at least Pharo1.3 (I don't try previous version), it returns true.

Jannik



On Jul 5, 2013, at 12:33 AM, Camillo Bruni  wrote:

> Yes this is ok, '.' matches only a single character.
> The alternatives you might be looking for are #prefixMatchesRegex: or '.*'
> 
> On 2013-07-05, at 00:03, "jannik.laval"  wrote:
>> Hi guys,
>> 
>> Just a simple question about regex:
>> 
>> 'a' matchesRegex: '.' --> true
>> 'aa' matchesRegex: '.' --> false
>> 
>> As '.' represents any character, the two previous lines are ok. Now, if I 
>> test with a cr, it returns true:
>> 
>> String cr matchesRegex: '.' --> true.
>> 
>> Is it the expected behavior ?
>> 
>> Cheers,
>> Jannik
> 
>