Re: [Pharo-dev] How to create a 16x16 icon from a .png file?

2015-12-22 Thread stepharo

Look for users of ReadWriterPNG

ReadWriterPNG formFromStream: (Filesystem workingDirectory / 'blb.png)

Works

Le 22/12/15 14:11, Alexandre Bergel a écrit :

Hi!

A couple of month ago the following expression was working:
ThemeIcons new createIconMethodsFromFile: 'cube' directory: 
'/Users/alexandrebergel/Desktop/cube’

Now it does not. How can I import .png files in Pharo?

Cheers,
Alexandre





Re: [Pharo-dev] [Pharo-users] [ANN] Pharo Consortium Sponsored Development Effort

2015-12-22 Thread Mariano Martinez Peck
>
>
> >
> >
> > No, wait. You are getting down to the details so I want to discuss :)
> >
> > OSProcess does not use popen()/system() but rather fork()+exec(). That
> means
> > that OSProcess has implementing the very very low building blocks that
> would
> > allow you do to almost everything. But then it has it's complicated
> matters.
> > fork() + exec() cannot be implemented via FFI (this was already
> discussed in
> > another thread).
>
> Can you link that thread? I'm curious to learn this.



It's a bit long discussion, but here it is:
http://forum.world.st/ANN-Limbo-a-simple-shell-wrapper-for-NativeBoost-td4655894i20.html


  Is it
> multi-thread related?   I read [a]...
> ..."The biggest problem with using fork+exec in this way is that you
> can't guarantee *nothing* happens between the fork call and the exec
> call. If, for example, the JVM decides to GC or move memory around,
> you can have a fatal crash at the JVM process level. Because of that,
> I don't recommend using fork + exec via FFI in JRuby, even though it's
> pretty cool. "
>
>

Yes, exactly. Pretty much the same. Since fork() clones and both parent and
child execute same code (smalltalk vm in our case) until you call exec(),
for that period of time, you will have the child running too, and that can
screw up everything.


..."However, since this post I've learned of the "posix_spawn" [b]
> function available on most Unix variants. It's basically fork + exec
> in a single function, plus most of the typical security and IO tweaks
> you might do after forking and before execing. It's definitely my
> recommended alternative to fork+exec for JRuby."
>


*WOW. This seems to be one of the most useful recommendations I got. Thank
you VERY MUCH.*
I was thinking myself "how could I be the only one trying to call a
fork+exec kind of function from FFI". Here is the answer.
BTW...I have already started coding a FFI wrapper for such a function. I
have very basic first command working :)


>
> And posix_spawn also seems recommended for use with the JVM [d]
>


Nice.


> and that Windows and POSIX might have similar usage, and even better
> match Windows CreateProcess than fork/exec [f] [g] [h]
>
> And since with 64-bit Spur we can expect very large images, spawn may
> be preferred over fork/exec to minimize memory usage for creating
> application subprocesses [i]
>
>
Interesting.


>
> Fork versus threads section of [c]
>
> or should we be making use of pthread_atfork [e] ?
>
> Overall I learnt something new about forking in a multi-threaded
> environment
> "When fork() is called, only the calling thread is duplicated in the
> child process."
>

I learned that today too :)


>
> [a]
> http://blog.headius.com/2009/05/fork-and-exec-on-jvm-jruby-to-rescue.html
> [b]
> http://pubs.opengroup.org/onlinepubs/009695399/functions/posix_spawn.html
> [d] http://skife.org/java/2012/01/24/java_daemonization_with_gressil.html
> [c] http://repository.readscheme.org/ftp/papers/sw2002/gasbichler.pdf
> [e]
> http://stackoverflow.com/questions/4223553/c-does-exec-have-to-immediately-follow-fork-in-a-multi-threaded-process
> [f]
> http://stackoverflow.com/questions/33249253/what-is-the-difference-between-spawn-and-fork
> [g] http://stackoverflow.com/questions/5883462/linux-createprocess
> [h]
> http://www.linuxquestions.org/questions/programming-9/fork-exec-versus-posix_spawn-835385/
> [i]
> http://www.oracle.com/technetwork/server-storage/solaris10/subprocess-136439.html
>
>
Thanks for all the links, very useful!


> > However, there is a lot of other stuff that we believe it
> > could. So... what we wanted to see if it is possible is to have one only
> (or
> > very few) primitives (like forkAndExec) and all the rest via FFI. And
> then
> > all the features I listed in the first email of this thread.
> >
> > With that in mind, we believe that:
> >
> > 1) Before starting dealing with forkAndExec, we could try a first
> prototype
> > using popen(). That would allow us test a 100% FFI based approeach, deal
> > with writing and reading from pipes via stream, face the blocking issue,
> see
> > a prototype on how to read async from pipes etc etc etc. If we see this
> > works nicely, on a second step we can build another approach that
> instead of
> > popen() uses forkAndExec primitive.
>
> Is popen() being restricted to unidirectional part of this consideration
> [j] ?
>
>

Yep. You can either define the read more or the write mode (stdout vs
stdin) but not both, since popen() opens ONE pipe.



> Also I read [j] that a problem with popen is that you do not get pid
> of child so you cannot wait on command to complete.  Could posix_spawn
> be preferrable to popen?
>
>
Exactly. There is no standard way to get child pid from popen() so you
can't do polling in image side to wait it's completion.
So yeah, posix_spawn() does fix this issue as well as many many other.


> and just btw, mildly interesting is using sockets rather than pipes
> for interprocess communication [l]
>
> [j]

Re: [Pharo-dev] Can I access symbolic constants from NB FFI?

2015-12-22 Thread Mariano Martinez Peck
On Tue, Dec 22, 2015 at 5:50 PM, teso...@gmail.com 
wrote:

> Hi Mariano,
>   it is supossed to be Posix, but Posix.1, it's another revision.
>
> Since Solaris 10, it is supposed to supports all extensions of Posix (
> http://docs.oracle.com/cd/E19253-01/816-5175/standards-5/index.html) and
> Irix 6 (is discontinued, and is not Posix.1 compatible)
>
> Also I can say that the GHC (Haskell) implementation assumes the value 1
> for the constant, you can check the source code in:
>
>
> https://hackage.haskell.org/package/posix-waitpid-0.1/docs/src/System-Posix-Waitpid.html#c_waitpid
>
> I think is enough safe to have the 1 as a constant, if not you will have
> to generate a plugin for every platform.
>
>
Thanks Pablito. I assumed 1 for now and in fact it did work for OSX at
least :)


> The other alternative is to read the constant value from the C Header, but
> is maybe an overkill.
>
>
Yes, I thought the same...but I would need the sources...


> Chers,
>
> Pd: hace rato que estoy por aca, pero me cuesta responder, a veces va muy
> rapido y otras vuelan muy alto :).
>
>
jajajajaj groso



> On Tue, Dec 22, 2015 at 5:36 PM, Mariano Martinez Peck <
> marianop...@gmail.com> wrote:
>
>>
>>
>> On Tue, Dec 22, 2015 at 5:24 PM, teso...@gmail.com 
>> wrote:
>>
>>> Hello Mariano,
>>>  WNOHANG is a constant is defined in sys/wait.h, after the
>>> compilation is not included in the object file.
>>>
>>> You will have to duplicate its value in the Smalltalk Code. It's value
>>> is 1, in linux is defined in bits/waitflags.h as
>>>
>>> #define WNOHANG 1
>>>
>>>
>> mm but then I would need to take care about its different values in
>> different OS right?
>> I am reading for example this thread:
>> https://groups.google.com/forum/#!topic/comp.lang.python/_5rCpfYR_ZE
>>
>>  sunos 4.1.3 : #define WNOHANG 1
>> Solaris 2.4 : #define WNOHANG 0100
>> OSF1 2.0: #define WNOHANG 0x1
>> Ultrix 4.4: #define WNOHANG 1
>> irix 4.0.5C : #define WNOHANG 0x1
>> irix 5.2: #define WNOHANG 0100
>> irix 6.0.1  : #define WNOHANG 0100
>>
>> OK..the thread is from 1995... I thought the POSIX standard would
>> standardize that...
>>
>> I am now checking at
>> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/sys/wait.h
>>
>> and it says:
>>
>> #define WNOHANG 0x0001
>> But again..I wonder how portable is to stick to that...
>>
>> Ok...maybe I will need to go with a VM primitive as #primGetChildExitStatus:
>>   that way I can do the:
>>
>> self cCode: 'waitpid ( pidToHandle, &exitStatus, WNOHANG )'  inSmalltalk:
>> [ exitStatus := -1 ].
>>
>>
>> pd: que groso Pablito verte por aca
>>
>>
>>
>>> Cheers,
>>> Pablo
>>>
>>> On Tue, Dec 22, 2015 at 5:12 PM, Mariano Martinez Peck <
>>> marianop...@gmail.com> wrote:
>>>
 Hi guys,

 Say I want to call to waitpid like this:

 waitpid(childID, &status, WNOHANG);

 How can I do since I don't have access to WNOHANG int value in order to
 send it via argument  ???

 Any idea?

 Thanks in advance,

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

>>>
>>>
>>>
>>> --
>>> Pablo Tesone.
>>> teso...@gmail.com
>>>
>>
>>
>>
>> --
>> Mariano
>> http://marianopeck.wordpress.com
>>
>
>
>
> --
> Pablo Tesone.
> teso...@gmail.com
>



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


Re: [Pharo-dev] [Pharo-users] NeoJSON: parsing mapped nil fields

2015-12-22 Thread Sven Van Caekenberghe
Hi,

> On 22 Dec 2015, at 17:40, Skip Lentz  wrote:
> 
> Hi all,
> 
> When parsing with NeoJSON, I’m experiencing some problems.
> 
> If I parse a JSON representation using NeoJSONReader>>next (i.e. not 
> according to a schema), it parses nil fields just fine.
> But when I explicitly set a value schema, it won’t parse it in the case it is 
> nil (or “null” in JSON). Is there a way to let it return nil in the case the 
> parser encounters “null”, and otherwise serialize it as a value schema (e.g. 
> a Point class).
> 
> Taking the example from the paper 
> (https://github.com/svenvc/docs/blob/master/neo/neo-json-paper.md):
> (NeoJSONReader on: ’null' readStream)
> mapInstVarsFor: Point;
> nextAs: Point.
> 
> Is there a way to adapt the above snippet so that it evaluates to ‘nil’ 
> instead of resulting in an error? I ask because I am parsing an API response 
> which sometimes contains a “null” field, and sometimes a JSON object for that 
> field.
> 
> Thanks.

NeoJSON does have a bit of a split personality. 

When using #next it parses whatever is there and returns it as either 
primitives, a map or a list, nested to any depth.

When you use mappings and #nextAs: it tries to map a static type structure on 
what is coming in. As such it is not really prepared for dynamic surprises like 
objects being replaced by null. Do also note that the typing info is totally 
absent from the JSON itself, unlike STON for example. NeoJSON also tries (and 
succeeds) in maintaining a stream based parser that does not generate 
intermediate structures except your own domain models.

But your request does make sense and I will think about it. It might be 
possible. It has been a while that I really thought about the implementation.

Sven




Re: [Pharo-dev] How to create a 16x16 icon from a .png file?

2015-12-22 Thread Alexandre Bergel
Peter, I have updated the help based on your icon factory. Your code is very 
easy to use, and it is available from the catalog. Pretty cool!
https://pharo.fogbugz.com/f/cases/17291/The-ImportingResourceHelp-has-to-be-updated

The monkey will go over it soon I guess.

In case you wish to improve it, it would be great to have a resize function :-)

Cheers,
Alexandre


> On Dec 22, 2015, at 12:01 PM, Peter Uhnák  wrote:
> 
> Look at IconFactory http://smalltalkhub.com/#!/~peteruhnak/IconFactory
> 
> On Tue, Dec 22, 2015 at 2:11 PM, Alexandre Bergel
>  wrote:
>> Hi!
>> 
>> A couple of month ago the following expression was working:
>> ThemeIcons new createIconMethodsFromFile: 'cube' directory: 
>> '/Users/alexandrebergel/Desktop/cube’
>> 
>> Now it does not. How can I import .png files in Pharo?
>> 
>> Cheers,
>> Alexandre
>> --
>> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>> Alexandre Bergel  http://www.bergel.eu
>> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>> 
>> 
>> 
>> 
> 

-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.






Re: [Pharo-dev] How to create a 16x16 icon from a .png file?

2015-12-22 Thread Alexandre Bergel
Ah yes! 

Thanks!

Alexandre


> On Dec 22, 2015, at 12:01 PM, Peter Uhnák  wrote:
> 
> Look at IconFactory http://smalltalkhub.com/#!/~peteruhnak/IconFactory
> 
> On Tue, Dec 22, 2015 at 2:11 PM, Alexandre Bergel
>  wrote:
>> Hi!
>> 
>> A couple of month ago the following expression was working:
>> ThemeIcons new createIconMethodsFromFile: 'cube' directory: 
>> '/Users/alexandrebergel/Desktop/cube’
>> 
>> Now it does not. How can I import .png files in Pharo?
>> 
>> Cheers,
>> Alexandre
>> --
>> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>> Alexandre Bergel  http://www.bergel.eu
>> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>> 
>> 
>> 
>> 
> 

-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.






Re: [Pharo-dev] How to create a 16x16 icon from a .png file?

2015-12-22 Thread Alexandre Bergel
Exactly!


> On Dec 22, 2015, at 4:46 PM, Dimitris Chloupis  wrote:
> 
> please note that its not required to covnert a png to a method source if you 
> use git because git can handle versioning binary files just fine. All you 
> have to do is access your local github-cache and retrieve the image from 
> there (assuming the image has been added to your github repository). 
> 
> From there one is just a matter of using Form fromFileNamed: 
> aStringPathToYourPNG
> 
> if you dont use git, use Peter's IconFactory. 
> 
> On Tue, Dec 22, 2015 at 3:12 PM Alexandre Bergel  
> wrote:
> Hi!
> 
> A couple of month ago the following expression was working:
> ThemeIcons new createIconMethodsFromFile: 'cube' directory: 
> '/Users/alexandrebergel/Desktop/cube’
> 
> Now it does not. How can I import .png files in Pharo?
> 
> Cheers,
> Alexandre
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel  http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
> 
> 
> 
> 

-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.






Re: [Pharo-dev] Can I access symbolic constants from NB FFI?

2015-12-22 Thread Esteban Lorenzano
as Pablo says, you ask too much :)
basically, that’s a macro who is replaced by the C preprocessor, even before 
compiling it. 
So no, you cannot access it because it does not exist :)

the “official” recommendation for this is: Do a SharedPool. 
Also there is TalkFFI (look for it in sthub, my internet connection here is too 
slow and I cannot enter it).

I do not think it will work out of the box but basically, it imports header 
files :)

cheers,
Esteban

> On 22 Dec 2015, at 20:24, teso...@gmail.com wrote:
> 
> Hello Mariano, 
>  WNOHANG is a constant is defined in sys/wait.h, after the compilation is 
> not included in the object file. 
> 
> You will have to duplicate its value in the Smalltalk Code. It's value is 1, 
> in linux is defined in bits/waitflags.h as 
> 
> #define   WNOHANG 1   
> 
> Cheers, 
> Pablo
> 
> On Tue, Dec 22, 2015 at 5:12 PM, Mariano Martinez Peck  > wrote:
> Hi guys,
> 
> Say I want to call to waitpid like this:
> 
> waitpid(childID, &status, WNOHANG);
> 
> How can I do since I don't have access to WNOHANG int value in order to send 
> it via argument  ???
> 
> Any idea?
> 
> Thanks in advance, 
> 
> -- 
> Mariano
> http://marianopeck.wordpress.com 
> 
> 
> 
> -- 
> Pablo Tesone.
> teso...@gmail.com 


Re: [Pharo-dev] Can I access symbolic constants from NB FFI?

2015-12-22 Thread teso...@gmail.com
Hi Mariano,
  it is supossed to be Posix, but Posix.1, it's another revision.

Since Solaris 10, it is supposed to supports all extensions of Posix (
http://docs.oracle.com/cd/E19253-01/816-5175/standards-5/index.html) and
Irix 6 (is discontinued, and is not Posix.1 compatible)

Also I can say that the GHC (Haskell) implementation assumes the value 1
for the constant, you can check the source code in:

https://hackage.haskell.org/package/posix-waitpid-0.1/docs/src/System-Posix-Waitpid.html#c_waitpid

I think is enough safe to have the 1 as a constant, if not you will have to
generate a plugin for every platform.

The other alternative is to read the constant value from the C Header, but
is maybe an overkill.

Chers,

Pd: hace rato que estoy por aca, pero me cuesta responder, a veces va muy
rapido y otras vuelan muy alto :).

On Tue, Dec 22, 2015 at 5:36 PM, Mariano Martinez Peck <
marianop...@gmail.com> wrote:

>
>
> On Tue, Dec 22, 2015 at 5:24 PM, teso...@gmail.com 
> wrote:
>
>> Hello Mariano,
>>  WNOHANG is a constant is defined in sys/wait.h, after the
>> compilation is not included in the object file.
>>
>> You will have to duplicate its value in the Smalltalk Code. It's value is
>> 1, in linux is defined in bits/waitflags.h as
>>
>> #define WNOHANG 1
>>
>>
> mm but then I would need to take care about its different values in
> different OS right?
> I am reading for example this thread:
> https://groups.google.com/forum/#!topic/comp.lang.python/_5rCpfYR_ZE
>
>  sunos 4.1.3 : #define WNOHANG 1
> Solaris 2.4 : #define WNOHANG 0100
> OSF1 2.0: #define WNOHANG 0x1
> Ultrix 4.4: #define WNOHANG 1
> irix 4.0.5C : #define WNOHANG 0x1
> irix 5.2: #define WNOHANG 0100
> irix 6.0.1  : #define WNOHANG 0100
>
> OK..the thread is from 1995... I thought the POSIX standard would
> standardize that...
>
> I am now checking at
> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/sys/wait.h
>
> and it says:
>
> #define WNOHANG 0x0001
> But again..I wonder how portable is to stick to that...
>
> Ok...maybe I will need to go with a VM primitive as #primGetChildExitStatus:
>   that way I can do the:
>
> self cCode: 'waitpid ( pidToHandle, &exitStatus, WNOHANG )'  inSmalltalk:
> [ exitStatus := -1 ].
>
>
> pd: que groso Pablito verte por aca
>
>
>
>> Cheers,
>> Pablo
>>
>> On Tue, Dec 22, 2015 at 5:12 PM, Mariano Martinez Peck <
>> marianop...@gmail.com> wrote:
>>
>>> Hi guys,
>>>
>>> Say I want to call to waitpid like this:
>>>
>>> waitpid(childID, &status, WNOHANG);
>>>
>>> How can I do since I don't have access to WNOHANG int value in order to
>>> send it via argument  ???
>>>
>>> Any idea?
>>>
>>> Thanks in advance,
>>>
>>> --
>>> Mariano
>>> http://marianopeck.wordpress.com
>>>
>>
>>
>>
>> --
>> Pablo Tesone.
>> teso...@gmail.com
>>
>
>
>
> --
> Mariano
> http://marianopeck.wordpress.com
>



-- 
Pablo Tesone.
teso...@gmail.com


Re: [Pharo-dev] Can I access symbolic constants from NB FFI?

2015-12-22 Thread Mariano Martinez Peck
On Tue, Dec 22, 2015 at 5:24 PM, teso...@gmail.com 
wrote:

> Hello Mariano,
>  WNOHANG is a constant is defined in sys/wait.h, after the
> compilation is not included in the object file.
>
> You will have to duplicate its value in the Smalltalk Code. It's value is
> 1, in linux is defined in bits/waitflags.h as
>
> #define WNOHANG 1
>
>
mm but then I would need to take care about its different values in
different OS right?
I am reading for example this thread:
https://groups.google.com/forum/#!topic/comp.lang.python/_5rCpfYR_ZE

 sunos 4.1.3 : #define WNOHANG 1
Solaris 2.4 : #define WNOHANG 0100
OSF1 2.0: #define WNOHANG 0x1
Ultrix 4.4: #define WNOHANG 1
irix 4.0.5C : #define WNOHANG 0x1
irix 5.2: #define WNOHANG 0100
irix 6.0.1  : #define WNOHANG 0100

OK..the thread is from 1995... I thought the POSIX standard would
standardize that...

I am now checking at
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/sys/wait.h

and it says:

#define WNOHANG 0x0001
But again..I wonder how portable is to stick to that...

Ok...maybe I will need to go with a VM primitive as #primGetChildExitStatus:
  that way I can do the:

self cCode: 'waitpid ( pidToHandle, &exitStatus, WNOHANG )'  inSmalltalk: [
exitStatus := -1 ].


pd: que groso Pablito verte por aca



> Cheers,
> Pablo
>
> On Tue, Dec 22, 2015 at 5:12 PM, Mariano Martinez Peck <
> marianop...@gmail.com> wrote:
>
>> Hi guys,
>>
>> Say I want to call to waitpid like this:
>>
>> waitpid(childID, &status, WNOHANG);
>>
>> How can I do since I don't have access to WNOHANG int value in order to
>> send it via argument  ???
>>
>> Any idea?
>>
>> Thanks in advance,
>>
>> --
>> Mariano
>> http://marianopeck.wordpress.com
>>
>
>
>
> --
> Pablo Tesone.
> teso...@gmail.com
>



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


Re: [Pharo-dev] Can I access symbolic constants from NB FFI?

2015-12-22 Thread Chris Cunningham
I was going to point out SharedPool and defining it as a poolDictionary in
the class definition, but you already know that, right?
Is what you are pointing out is that once you have all of that setup, that
NB doesn't allow you to use it by argument (but only by value)?
The former I might help; the later is beyond me.

-cbc

On Tue, Dec 22, 2015 at 12:12 PM, Mariano Martinez Peck <
marianop...@gmail.com> wrote:

> Hi guys,
>
> Say I want to call to waitpid like this:
>
> waitpid(childID, &status, WNOHANG);
>
> How can I do since I don't have access to WNOHANG int value in order to
> send it via argument  ???
>
> Any idea?
>
> Thanks in advance,
>
> --
> Mariano
> http://marianopeck.wordpress.com
>


Re: [Pharo-dev] Can I access symbolic constants from NB FFI?

2015-12-22 Thread teso...@gmail.com
Hello Mariano,
 WNOHANG is a constant is defined in sys/wait.h, after the compilation
is not included in the object file.

You will have to duplicate its value in the Smalltalk Code. It's value is
1, in linux is defined in bits/waitflags.h as

#define WNOHANG 1

Cheers,
Pablo

On Tue, Dec 22, 2015 at 5:12 PM, Mariano Martinez Peck <
marianop...@gmail.com> wrote:

> Hi guys,
>
> Say I want to call to waitpid like this:
>
> waitpid(childID, &status, WNOHANG);
>
> How can I do since I don't have access to WNOHANG int value in order to
> send it via argument  ???
>
> Any idea?
>
> Thanks in advance,
>
> --
> Mariano
> http://marianopeck.wordpress.com
>



-- 
Pablo Tesone.
teso...@gmail.com


Re: [Pharo-dev] [Pharo-users] [ANN] Pharo Consortium Sponsored Development Effort

2015-12-22 Thread Robert Withers



On 12/22/2015 03:12 PM, Esteban Lorenzano wrote:


On 22 Dec 2015, at 19:45, Robert Withers > wrote:


Hi Esteban,

I guess it sounded to me RMoD is the backbone team.  :)


I think you are into the VM, right?  Is there any chance you could 
build the pharo5.0 crypto plugins for me on 32bit Ubuntu? l I am 
unable to build myself right now. The package CryptographyPlugins on 
the Cryptography squeak source has them. This would really help me.


I am the overseer (like that guy in Fallout Shelter) ;)


Not sure but I can relate!

No, really: I’m a bit over everything and step into things when they 
need more time than the one people can usually invest in their free time.

Now is VM :)


And you are super busy with Spr, which I am looking forward to getting 
on my machine!



About your plugins: they are in my TODO list.
They will be eventually, but I cannot tell you exactly when 
(hopefully, soon (™)) :)


I liek eventually and have a great holidays. We've plenty of time and it 
is all temporary.  On reflection, what I would really and truly love is 
for Crypto and SecureSession, image code and plugins and tests all 
become a part of your CI. That is what I would really want for 
Christmas!  ;)



Thanks to everyone who is a part of being great!

best,
robert



cheers!
Esteban



thank you,
Robert

On 12/22/2015 01:30 PM, Esteban Lorenzano wrote:


On 21 Dec 2015, at 20:55, Robert Withers 
 wrote:




On 12/21/2015 03:31 PM, Denis Kudriashov wrote:


2015-12-21 19:07 GMT+01:00 Robert Withers 
mailto:robert.w.with...@gmail.com>>:


What are you and the RMOD team doing, I am curious?


RMOD is research team at INRIA university. We develop Pharo.


Yes, absolutely! I did not know it but I am glad to hear it. RMOD 
is the Pharo team.  You all keep going for excellence, every day.


No it is not :)
the "Pharo team” includes many people outside RMoD:

- Sven
- Doru and the glamour team (Andrei, Alexei and others I do not 
remember their names, sorry… they work undercover)

- Alain
- People doing things in Lugano (like Yuri, who now is going to 
Bern)… Tommasso, etc.

- Or course Eliot who works on the VM (not just for Pharo).
- And we also consider as part of the “pharo team”: Nicolai (Hess), 
Sean and people who contributes a lot: Thierry, Norbert, Torsten 
(even if he probably does not know we consider him part of the team 
:P), etc., etc., etc.
- Essentially, if you contribute in any way with Pharo and you 
participate on discussions, etc., you can consider yourself part of 
the Pharo team :)


Of course in the RMOD team there are people doing and contributing 
to Pharo (but they do other things too, like Moose and even things 
nobody ever sees)… Pharo is a much more complex and human-sparse 
project :)


cheers!
Esteban



robert
--
. ..  ...   ^,^robert
Go Panthers!




--
. ..  ...   ^,^robert
Go Panthers!




--
. ..  ...   ^,^robert
Go Panthers!



Re: [Pharo-dev] [Pharo-users] [ANN] Pharo Consortium Sponsored Development Effort

2015-12-22 Thread Esteban Lorenzano
yeah, I’m aware of that but I wanted to express what we feel about being “pharo 
team” and I thought naming people (even if, of course, is far from exhaustive) 
was more explicit. 

cheers,
Esteban

> On 22 Dec 2015, at 19:28, Sven Van Caekenberghe  wrote:
> 
>> 
>> On 22 Dec 2015, at 19:30, Esteban Lorenzano  wrote:
>> 
>>> 
>>> On 21 Dec 2015, at 20:55, Robert Withers  wrote:
>>> 
>>> 
>>> 
>>> On 12/21/2015 03:31 PM, Denis Kudriashov wrote:
 
 2015-12-21 19:07 GMT+01:00 Robert Withers :
 What are you and the RMOD team doing, I am curious?
 
 RMOD is research team at INRIA university. We develop Pharo.
>>> 
>>> Yes, absolutely! I did not know it but I am glad to hear it. RMOD is the 
>>> Pharo team.  You all keep going for excellence, every day.
>> 
>> No it is not :)
>> the "Pharo team” includes many people outside RMoD:
>> 
>> - Sven
>> - Doru and the glamour team (Andrei, Alexei and others I do not remember 
>> their names, sorry… they work undercover)
>> - Alain
>> - People doing things in Lugano (like Yuri, who now is going to Bern)… 
>> Tommasso, etc.
>> - Or course Eliot who works on the VM (not just for Pharo).
>> - And we also consider as part of the “pharo team”: Nicolai (Hess), Sean and 
>> people who contributes a lot: Thierry, Norbert, Torsten (even if he probably 
>> does not know we consider him part of the team :P), etc., etc., etc.
>> - Essentially, if you contribute in any way with Pharo and you participate 
>> on discussions, etc., you can consider yourself part of the Pharo team :)
>> 
>> Of course in the RMOD team there are people doing and contributing to Pharo 
>> (but they do other things too, like Moose and even things nobody ever sees)… 
>> Pharo is a much more complex and human-sparse project :)
> 
> Well said: Pharo is the result of a continuous effort of a large group of 
> people. INRIA/RMOD is like the backbone.
> 
> It is dangerous to list names, because you always forget people. Like you 
> did, but I am not going to try to correct you, because I will forget many 
> people as well.
> 
> Every contribution: asking questions, entering in conversations, answering 
> questions, helping others, writing blog posts and articles, reporting bugs, 
> writing documentation, fixing bugs, it all counts, it all helps, a lot. 
> 
>> cheers!
>> Esteban
>> 
>>> 
>>> robert
>>> -- 
>>> . ..  ...   ^,^robert
>>> Go Panthers!



Re: [Pharo-dev] [Pharo-users] [ANN] Pharo Consortium Sponsored Development Effort

2015-12-22 Thread Esteban Lorenzano

> On 22 Dec 2015, at 19:45, Robert Withers  wrote:
> 
> Hi Esteban,
> 
> I guess it sounded to me RMoD is the backbone team.  :)
> 
> 
> I think you are into the VM, right?  Is there any chance you could build the 
> pharo5.0 crypto plugins for me on 32bit Ubuntu? l I am unable to build myself 
> right now. The package CryptographyPlugins on the Cryptography squeak source 
> has them. This would really help me.

I am the overseer (like that guy in Fallout Shelter) ;)
No, really: I’m a bit over everything and step into things when they need more 
time than the one people can usually invest in their free time. 
Now is VM :)
About your plugins: they are in my TODO list. 
They will be eventually, but I cannot tell you exactly when (hopefully, soon 
(™)) :)

cheers!
Esteban

> 
> thank you,
> Robert
> 
> On 12/22/2015 01:30 PM, Esteban Lorenzano wrote:
>> 
>>> On 21 Dec 2015, at 20:55, Robert Withers < 
>>> robert.w.with...@gmail.com 
>>> > wrote:
>>> 
>>> 
>>> 
>>> On 12/21/2015 03:31 PM, Denis Kudriashov wrote:
 
 2015-12-21 19:07 GMT+01:00 Robert Withers >>> >:
 What are you and the RMOD team doing, I am curious?
 
 RMOD is research team at INRIA university. We develop Pharo.
>>> 
>>> Yes, absolutely! I did not know it but I am glad to hear it. RMOD is the 
>>> Pharo team.  You all keep going for excellence, every day.
>> 
>> No it is not :)
>> the "Pharo team” includes many people outside RMoD:
>> 
>> - Sven
>> - Doru and the glamour team (Andrei, Alexei and others I do not remember 
>> their names, sorry… they work undercover)
>> - Alain
>> - People doing things in Lugano (like Yuri, who now is going to Bern)… 
>> Tommasso, etc.
>> - Or course Eliot who works on the VM (not just for Pharo).
>> - And we also consider as part of the “pharo team”: Nicolai (Hess), Sean and 
>> people who contributes a lot: Thierry, Norbert, Torsten (even if he probably 
>> does not know we consider him part of the team :P), etc., etc., etc.
>> - Essentially, if you contribute in any way with Pharo and you participate 
>> on discussions, etc., you can consider yourself part of the Pharo team :)
>> 
>> Of course in the RMOD team there are people doing and contributing to Pharo 
>> (but they do other things too, like Moose and even things nobody ever sees)… 
>> Pharo is a much more complex and human-sparse project :)
>> 
>> cheers!
>> Esteban
>> 
>>> 
>>> robert
>>> -- 
>>> . ..  ...   ^,^robert
>>> Go Panthers!
>> 
> 
> -- 
> . ..  ...   ^,^robert
> Go Panthers!



[Pharo-dev] Can I access symbolic constants from NB FFI?

2015-12-22 Thread Mariano Martinez Peck
Hi guys,

Say I want to call to waitpid like this:

waitpid(childID, &status, WNOHANG);

How can I do since I don't have access to WNOHANG int value in order to
send it via argument  ???

Any idea?

Thanks in advance,

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


Re: [Pharo-dev] How to create a 16x16 icon from a .png file?

2015-12-22 Thread Dimitris Chloupis
please note that its not required to covnert a png to a method source if
you use git because git can handle versioning binary files just fine. All
you have to do is access your local github-cache and retrieve the image
from there (assuming the image has been added to your github repository).

>From there one is just a matter of using Form fromFileNamed:
aStringPathToYourPNG

if you dont use git, use Peter's IconFactory.

On Tue, Dec 22, 2015 at 3:12 PM Alexandre Bergel 
wrote:

> Hi!
>
> A couple of month ago the following expression was working:
> ThemeIcons new createIconMethodsFromFile: 'cube' directory:
> '/Users/alexandrebergel/Desktop/cube’
>
> Now it does not. How can I import .png files in Pharo?
>
> Cheers,
> Alexandre
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel  http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>
>
>


Re: [Pharo-dev] [Pharo-users] [ANN] Pharo Consortium Sponsored Development Effort

2015-12-22 Thread Robert Withers

Hi Esteban,

I guess it sounded to me RMoD is the backbone team.  :)


I think you are into the VM, right?  Is there any chance you could build 
the pharo5.0 crypto plugins for me on 32bit Ubuntu? l I am unable to 
build myself right now. The package CryptographyPlugins on the 
Cryptography squeak source has them. This would really help me.


thank you,
Robert

On 12/22/2015 01:30 PM, Esteban Lorenzano wrote:


On 21 Dec 2015, at 20:55, Robert Withers > wrote:




On 12/21/2015 03:31 PM, Denis Kudriashov wrote:


2015-12-21 19:07 GMT+01:00 Robert Withers 
mailto:robert.w.with...@gmail.com>>:


What are you and the RMOD team doing, I am curious?


RMOD is research team at INRIA university. We develop Pharo.


Yes, absolutely! I did not know it but I am glad to hear it. RMOD is 
the Pharo team.  You all keep going for excellence, every day.


No it is not :)
the "Pharo team” includes many people outside RMoD:

- Sven
- Doru and the glamour team (Andrei, Alexei and others I do not 
remember their names, sorry… they work undercover)

- Alain
- People doing things in Lugano (like Yuri, who now is going to Bern)… 
Tommasso, etc.

- Or course Eliot who works on the VM (not just for Pharo).
- And we also consider as part of the “pharo team”: Nicolai (Hess), 
Sean and people who contributes a lot: Thierry, Norbert, Torsten (even 
if he probably does not know we consider him part of the team :P), 
etc., etc., etc.
- Essentially, if you contribute in any way with Pharo and you 
participate on discussions, etc., you can consider yourself part of 
the Pharo team :)


Of course in the RMOD team there are people doing and contributing to 
Pharo (but they do other things too, like Moose and even things nobody 
ever sees)… Pharo is a much more complex and human-sparse project :)


cheers!
Esteban



robert
--
. ..  ...   ^,^robert
Go Panthers!




--
. ..  ...   ^,^robert
Go Panthers!



Re: [Pharo-dev] [Pharo-users] [ANN] Pharo Consortium Sponsored Development Effort

2015-12-22 Thread Sven Van Caekenberghe

> On 22 Dec 2015, at 19:30, Esteban Lorenzano  wrote:
> 
>> 
>> On 21 Dec 2015, at 20:55, Robert Withers  wrote:
>> 
>> 
>> 
>> On 12/21/2015 03:31 PM, Denis Kudriashov wrote:
>>> 
>>> 2015-12-21 19:07 GMT+01:00 Robert Withers :
>>> What are you and the RMOD team doing, I am curious?
>>> 
>>> RMOD is research team at INRIA university. We develop Pharo.
>> 
>> Yes, absolutely! I did not know it but I am glad to hear it. RMOD is the 
>> Pharo team.  You all keep going for excellence, every day.
> 
> No it is not :)
> the "Pharo team” includes many people outside RMoD:
> 
> - Sven
> - Doru and the glamour team (Andrei, Alexei and others I do not remember 
> their names, sorry… they work undercover)
> - Alain
> - People doing things in Lugano (like Yuri, who now is going to Bern)… 
> Tommasso, etc.
> - Or course Eliot who works on the VM (not just for Pharo).
> - And we also consider as part of the “pharo team”: Nicolai (Hess), Sean and 
> people who contributes a lot: Thierry, Norbert, Torsten (even if he probably 
> does not know we consider him part of the team :P), etc., etc., etc.
> - Essentially, if you contribute in any way with Pharo and you participate on 
> discussions, etc., you can consider yourself part of the Pharo team :)
> 
> Of course in the RMOD team there are people doing and contributing to Pharo 
> (but they do other things too, like Moose and even things nobody ever sees)… 
> Pharo is a much more complex and human-sparse project :)

Well said: Pharo is the result of a continuous effort of a large group of 
people. INRIA/RMOD is like the backbone.

It is dangerous to list names, because you always forget people. Like you did, 
but I am not going to try to correct you, because I will forget many people as 
well.

Every contribution: asking questions, entering in conversations, answering 
questions, helping others, writing blog posts and articles, reporting bugs, 
writing documentation, fixing bugs, it all counts, it all helps, a lot. 

> cheers!
> Esteban
> 
>> 
>> robert
>> -- 
>> . ..  ...   ^,^robert
>> Go Panthers!
>> 




Re: [Pharo-dev] [Pharo-users] [ANN] Pharo Consortium Sponsored Development Effort

2015-12-22 Thread Esteban Lorenzano

> On 21 Dec 2015, at 20:55, Robert Withers  wrote:
> 
> 
> 
> On 12/21/2015 03:31 PM, Denis Kudriashov wrote:
>> 
>> 2015-12-21 19:07 GMT+01:00 Robert Withers > >:
>> What are you and the RMOD team doing, I am curious?
>> 
>> RMOD is research team at INRIA university. We develop Pharo.
> 
> Yes, absolutely! I did not know it but I am glad to hear it. RMOD is the 
> Pharo team.  You all keep going for excellence, every day.

No it is not :)
the "Pharo team” includes many people outside RMoD:

- Sven
- Doru and the glamour team (Andrei, Alexei and others I do not remember their 
names, sorry… they work undercover)
- Alain
- People doing things in Lugano (like Yuri, who now is going to Bern)… 
Tommasso, etc.
- Or course Eliot who works on the VM (not just for Pharo).
- And we also consider as part of the “pharo team”: Nicolai (Hess), Sean and 
people who contributes a lot: Thierry, Norbert, Torsten (even if he probably 
does not know we consider him part of the team :P), etc., etc., etc.
- Essentially, if you contribute in any way with Pharo and you participate on 
discussions, etc., you can consider yourself part of the Pharo team :)

Of course in the RMOD team there are people doing and contributing to Pharo 
(but they do other things too, like Moose and even things nobody ever sees)… 
Pharo is a much more complex and human-sparse project :)

cheers!
Esteban

> 
> robert
> -- 
> . ..  ...   ^,^robert
> Go Panthers!



[Pharo-dev] NeoJSON: parsing mapped nil fields

2015-12-22 Thread Skip Lentz
Hi all,

When parsing with NeoJSON, I’m experiencing some problems.

If I parse a JSON representation using NeoJSONReader>>next (i.e. not according 
to a schema), it parses nil fields just fine.
But when I explicitly set a value schema, it won’t parse it in the case it is 
nil (or “null” in JSON). Is there a way to let it return nil in the case the 
parser encounters “null”, and otherwise serialize it as a value schema (e.g. a 
Point class).

Taking the example from the paper 
(https://github.com/svenvc/docs/blob/master/neo/neo-json-paper.md 
):
(NeoJSONReader on: ’null' readStream)
mapInstVarsFor: Point;
nextAs: Point.
Is there a way to adapt the above snippet so that it evaluates to ‘nil’ instead 
of resulting in an error? I ask because I am parsing an API response which 
sometimes contains a “null” field, and sometimes a JSON object for that field.

Thanks.

[Pharo-dev] [pharo-project/pharo-core] 317ca8: 50509

2015-12-22 Thread GitHub
  Branch: refs/heads/5.0
  Home:   https://github.com/pharo-project/pharo-core
  Commit: 317ca8b4c21dff0d48cdd2f16fdec4bbf9ea76cc
  
https://github.com/pharo-project/pharo-core/commit/317ca8b4c21dff0d48cdd2f16fdec4bbf9ea76cc
  Author: Jenkins Build Server 
  Date:   2015-12-22 (Tue, 22 Dec 2015)

  Changed paths:
M 
Monticello.package/MCVersionLoader.class/instance/loading/loadWithNameLike_.st
A 
Monticello.package/MCVersionLoader.class/instance/private/announceLoadStart_.st
A 
Monticello.package/MCVersionLoader.class/instance/private/announceLoadStop_.st
A 
Monticello.package/MCVersionLoader.class/instance/private/announceLoad_do_.st
A 
Monticello.package/MCVersionLoader.class/instance/private/basicLoadWithNameLike_.st
A Monticello.package/MCVersionLoaderStarted.class/README.md
A Monticello.package/MCVersionLoaderStarted.class/definition.st
A 
Monticello.package/MCVersionLoaderStarted.class/instance/accessing/label.st
A 
Monticello.package/MCVersionLoaderStarted.class/instance/accessing/label_.st
A 
Monticello.package/MCVersionLoaderStarted.class/instance/accessing/versionLoader.st
A 
Monticello.package/MCVersionLoaderStarted.class/instance/accessing/versionLoader_.st
A Monticello.package/MCVersionLoaderStopped.class/README.md
A Monticello.package/MCVersionLoaderStopped.class/definition.st
A 
Monticello.package/MCVersionLoaderStopped.class/instance/accessing/label.st
A 
Monticello.package/MCVersionLoaderStopped.class/instance/accessing/label_.st
A 
Monticello.package/MCVersionLoaderStopped.class/instance/accessing/versionLoader.st
A 
Monticello.package/MCVersionLoaderStopped.class/instance/accessing/versionLoader_.st
M 
Morphic-Widgets-Basic.package/SimpleButtonMorph.class/instance/accessing/label.st
R ScriptLoader50.package/ScriptLoader.class/instance/pharo - 
scripts/script50508.st
A ScriptLoader50.package/ScriptLoader.class/instance/pharo - 
scripts/script50509.st
R ScriptLoader50.package/ScriptLoader.class/instance/pharo - 
updates/update50508.st
A ScriptLoader50.package/ScriptLoader.class/instance/pharo - 
updates/update50509.st
M 
ScriptLoader50.package/ScriptLoader.class/instance/public/commentForCurrentUpdate.st
A 
Spec-MorphicAdapters.package/MorphicTextAdapter.class/instance/accessing/acceptAllowed.st

  Log Message:
  ---
  50509
17287 SimpleButtonMorph>>#label is really bad for nothing…
https://pharo.fogbugz.com/f/cases/17287

17186 Monticello Load-Announcements
https://pharo.fogbugz.com/f/cases/17186

16887 Debugger context menu broken
https://pharo.fogbugz.com/f/cases/16887

http://files.pharo.org/image/50/50509.zip




[Pharo-dev] [pharo-project/pharo-core]

2015-12-22 Thread GitHub
  Branch: refs/tags/50509
  Home:   https://github.com/pharo-project/pharo-core


Re: [Pharo-dev] How to create a 16x16 icon from a .png file?

2015-12-22 Thread Peter Uhnák
Look at IconFactory http://smalltalkhub.com/#!/~peteruhnak/IconFactory

On Tue, Dec 22, 2015 at 2:11 PM, Alexandre Bergel
 wrote:
> Hi!
>
> A couple of month ago the following expression was working:
> ThemeIcons new createIconMethodsFromFile: 'cube' directory: 
> '/Users/alexandrebergel/Desktop/cube’
>
> Now it does not. How can I import .png files in Pharo?
>
> Cheers,
> Alexandre
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel  http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>
>



Re: [Pharo-dev] [OT] SpaceX's Falcon 9 - There and back again

2015-12-22 Thread Sven Van Caekenberghe

> On 22 Dec 2015, at 15:31, Hilaire  wrote:
> 
> Le 22/12/2015 14:02, Sven Van Caekenberghe a écrit :
>> This is a really great achievement: SpaceX successfully launched a rocket 
>> and deployed 11 satellites after failing earlier this year. But best of all, 
>> they landed the first stage back on earth! Consider the actual physics 
>> involved, mind boggling.
>> 
>> http://www.wired.com/2015/12/spacex-just-landed-rocket-ground-first-time/
>> 
>> http://arstechnica.com/science/2015/12/by-making-a-historic-landing-spacex-launches-new-age-of-spaceflight/
>> 
>> Sven
>> 
>> 
>> 
>> 
> It is a nice achievement indeed. However not sure it is a good idea on
> the long term.
> The main idea behind the Space shuttle was planed to be cheaper with
> reusable components: it proves to be both more expensive and less safe.
> Time will tell us.

Yes, you are right, they still have to prove they can safely and economically 
reuse them. 

But each time throwing away the main stage including a bunch of very expensive 
rocket engines is not very scaleable either.

And agreed, the Space Shuttle's cost/performance is hard to judge, still they 
flew 135 missions using 4/5 vehicles, making important things possible in 
space. But it sadly enough did not end well.

It is fair to say that space is pretty hard.

> Hilaire
> 
> -- 
> Dr. Geo
> http://drgeo.eu
> http://google.com/+DrgeoEu
> 
> 
> 




Re: [Pharo-dev] [OT] SpaceX's Falcon 9 - There and back again

2015-12-22 Thread Hilaire
Le 22/12/2015 14:02, Sven Van Caekenberghe a écrit :
> This is a really great achievement: SpaceX successfully launched a rocket and 
> deployed 11 satellites after failing earlier this year. But best of all, they 
> landed the first stage back on earth! Consider the actual physics involved, 
> mind boggling.
>
> http://www.wired.com/2015/12/spacex-just-landed-rocket-ground-first-time/
>
> http://arstechnica.com/science/2015/12/by-making-a-historic-landing-spacex-launches-new-age-of-spaceflight/
>
> Sven
>
>
>
>
It is a nice achievement indeed. However not sure it is a good idea on
the long term.
The main idea behind the Space shuttle was planed to be cheaper with
reusable components: it proves to be both more expensive and less safe.
Time will tell us.

Hilaire

-- 
Dr. Geo
http://drgeo.eu
http://google.com/+DrgeoEu





Re: [Pharo-dev] [OT] SpaceX's Falcon 9 - There and back again

2015-12-22 Thread Dimitris Chloupis
absolutely phenomenal landing, I did not even see it coming that was
blazzing fast.

My mind was blown thanks for sharing. SpaceX made history once more . Mars
here we come, lets send Pharo to mars too :D

On Tue, Dec 22, 2015 at 3:03 PM Sven Van Caekenberghe  wrote:

> This is a really great achievement: SpaceX successfully launched a rocket
> and deployed 11 satellites after failing earlier this year. But best of
> all, they landed the first stage back on earth! Consider the actual physics
> involved, mind boggling.
>
> http://www.wired.com/2015/12/spacex-just-landed-rocket-ground-first-time/
>
>
> http://arstechnica.com/science/2015/12/by-making-a-historic-landing-spacex-launches-new-age-of-spaceflight/
>
> Sven
>
>
>
>


[Pharo-dev] How to create a 16x16 icon from a .png file?

2015-12-22 Thread Alexandre Bergel
Hi!

A couple of month ago the following expression was working:
ThemeIcons new createIconMethodsFromFile: 'cube' directory: 
'/Users/alexandrebergel/Desktop/cube’

Now it does not. How can I import .png files in Pharo? 

Cheers,
Alexandre
-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.






[Pharo-dev] [OT] SpaceX's Falcon 9 - There and back again

2015-12-22 Thread Sven Van Caekenberghe
This is a really great achievement: SpaceX successfully launched a rocket and 
deployed 11 satellites after failing earlier this year. But best of all, they 
landed the first stage back on earth! Consider the actual physics involved, 
mind boggling.

http://www.wired.com/2015/12/spacex-just-landed-rocket-ground-first-time/

http://arstechnica.com/science/2015/12/by-making-a-historic-landing-spacex-launches-new-age-of-spaceflight/

Sven





Re: [Pharo-dev] Object graph stream/visitor implementation?

2015-12-22 Thread Mariano Martinez Peck
Denis,

The DeepTraverser was a little easy hack I shared years ago to Tudor Girba
which he then (improved it?) put it in Moose.
While it works is still very limited. You can give it a try. And if not,
please spend some time checking the graph traverser we have in Fuel. I
suspect it could be easily adapted for custom code, but I am not sure ;)

Basically, check FLAnalysis >> run, which has a stack and starts the trace
via #mapAndTrace:

Cheers,

On Tue, Dec 22, 2015 at 6:20 AM, Denis Kudriashov 
wrote:

> I found this: http://smalltalkhub.com/#!/~Moose/DeepTraverser
>
> 2015-12-22 10:05 GMT+01:00 Marcus Denker :
>
>>
>> > On 22 Dec 2015, at 09:46, Denis Kudriashov 
>> wrote:
>> >
>> > Hello.
>> >
>> > Do we have way to traverse object graph?
>> >
>> > I want stream which iterate object graph through instance variables
>> with knowledge about path at every step.
>> >
>> > Maybe Fuel has classes for this ?
>> >
>>
>> yes, I think so.. there is #fuelAccept:, but I am not sure how general it
>> is.
>>
>> I remember that Doru did some object graph iteration experiments, too?
>> (I can’t find it).
>>
>> But I think we should actually add a general “object graph iterator” to
>> the reflective
>> features of the language. It seems very useful to have, and for sure Fuel
>> could just
>> use it.
>>
>> Marcus
>>
>>
>>
>>
>>
>


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


Re: [Pharo-dev] VM error in Arch Linux

2015-12-22 Thread Ben Coman
You just happen to coincide with a transition point from V3 system to new
Spur system, which gets us ready for native 64-bit. Just as a point of
experiment, try Pharo build 50495 rather than (presumably) Pharo-latest.
Then look at upgrading PharoLauncher as others described.

Cheers -ben

On Tuesday, December 22, 2015, nacho <0800na...@gmail.com> wrote:

> Hi Folks,
> I've installed pharo-vm and pharo-launcher from AUR as stated in the pharo
> site.
> Everything works fine for Pharo 4.
> But when I try to load a Pharo 5 image I get the following error:
> This interpreter (vers. 6502) cannot read file image (vers. 6521)
>
> and when I do  pharo --version:
> 3.9-7 #1 Thu Dec 17 00:38:38 CET 2015 gcc 4.6.3 [Production ITHB VM]
> NBCoInterpreter NativeBoost-CogPlugin-EstebanLorenzano.21 uuid:
> 4d9b9bdf-2dfa-4c0b-99eb-5b110dadc697 Dec 17 2015
> NBCogit NativeBoost-CogPlugin-EstebanLorenzano.21 uuid:
> 4d9b9bdf-2dfa-4c0b-99eb-5b110dadc697 Dec 17 2015
> https://github.com/pharo-project/pharo-vm.git Commit:
> bad6fa2684afcf1d7cdb485f11049a4a4290fbc8 Date: 2015-12-14 12:47:06 +0100
> By:
> Esteban Lorenzano > Jenkins build
> #15024
> Linux pharo-linux 3.2.0-31-generic-pae #50-Ubuntu SMP Fri Sep 7 16:39:45
> UTC
> 2012 i686 i686 i386 GNU/Linux
> plugin path: /usr/share/pharo-vm/ [default: /usr/share/pharo-vm/]
>
>
> Any clues?
>
> Thanks in advance
> Nacho
>
>
>
> -
> Nacho
> Smalltalker apprentice.
> Buenos Aires, Argentina.
> --
> View this message in context:
> http://forum.world.st/VM-error-in-Arch-Linux-tp4868239.html
> Sent from the Pharo Smalltalk Developers mailing list archive at
> Nabble.com.
>
>


Re: [Pharo-dev] #sum:, #detectSum:, #sumNumbers:

2015-12-22 Thread Ferlicot D. Cyril
Le 20/12/2015 12:59, Max Leske a écrit :
> I would like to wrap up this discussion. 
> 
> 
> While I think that iterators are an intriguing idea I also believe that
> they are beyond the scope of this issue. If anybody wants to follow up
> on iterators (or unit types for that matter) please start a new thread /
> issue.
> 
> 
> I propose to use Sven’s version for #sum:ifEmpty:. The result would be
> these three methods:
> 
> sum
> ^ self
> sum: [ :each | each ]
> ifEmpty: [ 0 ]
> 
> sum: aBlock
> ^ self
> sum: aBlock
> ifEmpty: [ self errorEmptyCollection ]
> 
> sum: aBlock ifEmpty: emptyBlock
> | sum sample |
> self isEmpty ifTrue: [ ^ emptyBlock value ].
> sample := self anyOne.
> sum := self
> inject: sample
> into: [ :accum :each | accum + (aBlock value: each) ].
> ^ sum - sample
> 
> 
> I’ve attached a couple of benchmark results below. To me they show that
> 1. the new implementation is maybe a tiny bit slower but insignificantly
> so (if you’re going for performance you’ll probably write your own
> optimised version anyway)
> 2. there is no need to duplicate the code (like #sum and #sum: currently
> do). It’s perfectly fine to delegate to #sum:ifEmpty:
> 
> 
> 
> In addition to the above changes I would like to remove #detectSum: (->
> #sum:) and #sumNumbers (-> #sum).
> 
> 
> Note that once we agree on changing this API, we will need to also
> change #detectMin:, #detectMax:, #min, #max as well as all overrides
> (e.g. RunArray, Interval) of these and of #sum et. al. to stay
> consistent. The changes would of course be in line with this change,
> such that every operation has a unary selector with a sensible default,
> one that takes a block and throws an error for empty collections and a
> third that takes a block for the iteration and one for the empty case.
> 
> 
> Please cast your vote for these changes:
> 
> 1. Do you agree to changing #sum and #sum: in the suggested way?
> 

Yes

> 2. Do you agree to the removal of #detectSum:?
> 

Yes

> 3. Do you agree to the removal of #sumNumbers?
> 

Yes

> 4. Do you agree that the #max and #min selectors also need to be adapted?
> 

Yes

> 
> 
> Thanks for you help.
> 
> Cheers,
> Max
> 
> 
> 
> 
> 
> Benchmarks
> 
> (Note that these aren’t very good benchmarks. There’s quite some
> variation on each run.)
> 
> 
> Machine:
> MacBook Pro (15-inch, Early 2011)
> CPU: 2.2 GHz Intel Core i7
> Memory: 8 GB 1333 MHz DDR3
> Disk: APPLE SSD TS512C (500 GB)
> 
> 
> Benchmarks of the current versions:
> 
> [ (1 to: 100) asArray sum ] benchFor: 10 seconds.
> 75 iterations, 7.470 per second
> 
> [ (1 to: 100) asArray sum: [ :e | e ] ] benchFor: 10 seconds.
> 72 iterations, 7.128 per second
> 
> 
> [ (1 to: 100) asArray sum ] benchFor: 10 seconds.
> 1,189,477 iterations, 118,912 per second
> 
> 
> [ (1 to: 100) asArray sum: [ :e | e ] ] benchFor: 10 seconds.
> 1,171,467 iterations, 117,112 per second
> 
> 
> 
> Benchmarks of the new versions:
> 
> [ (1 to: 100) asArray sum ] benchFor: 10 seconds.
> 73 iterations, 7.244 per second
> 
> [ (1 to: 100) asArray sum: [ :e | e ] ] benchFor: 10 seconds.
> 75 iterations, 7.480 per second
> 
> [ (1 to: 100) asArray sum: [ :e | e ] ifEmpty: [ 0 ] ] benchFor: 10
> seconds.
> 72 iterations, 7.141 per second
> 
> 
> [ (1 to: 100) asArray sum ] benchFor: 10 seconds.
> 1,115,827 iterations, 111,560 per second
> 
> [ (1 to: 100) asArray sum: [ :e | e ] ] benchFor: 10 seconds.
> 1,154,595 iterations, 115,425 per second
> 
> [ (1 to: 100) asArray sum: [ :e | e ] ifEmpty: [ 0 ] ] benchFor: 10 seconds.
> 1,102,358 iterations, 110,203 per second
> 


-- 
Cyril Ferlicot

http://www.synectique.eu

165 Avenue Bretagne
Lille 59000 France



signature.asc
Description: OpenPGP digital signature


Re: [Pharo-dev] #sum:, #detectSum:, #sumNumbers:

2015-12-22 Thread Nicolai Hess
2015-12-20 12:59 GMT+01:00 Max Leske :

>
>
> I propose to use Sven’s version for #sum:ifEmpty:. The result would be
> these three methods:
>
> sum
> ^ self
> sum: [ :each | each ]
> ifEmpty: [ 0 ]
>
> sum: aBlock
> ^ self
> sum: aBlock
> ifEmpty: [ self errorEmptyCollection ]
>
> sum: aBlock ifEmpty: emptyBlock
> | sum sample |
> self isEmpty ifTrue: [ ^ emptyBlock value ].
> sample := self anyOne.
> sum := self
> inject: sample
> into: [ :accum :each | accum + (aBlock value: each) ].
> ^ sum - sample
>
>
> I’ve attached a couple of benchmark results below. To me they show that
> 1. the new implementation is maybe a tiny bit slower but insignificantly
> so (if you’re going for performance you’ll probably write your own
> optimised version anyway)
> 2. there is no need to duplicate the code (like #sum and #sum: currently
> do). It’s perfectly fine to delegate to #sum:ifEmpty:
>
>
>
> In addition to the above changes I would like to remove #detectSum: (->
> #sum:) and #sumNumbers (-> #sum).
>

there is no #sumNumbers, only #sumNumbers:


>
>
> Note that once we agree on changing this API, we will need to also change
> #detectMin:, #detectMax:, #min, #max as well as all overrides (e.g.
> RunArray, Interval) of these and of #sum et. al. to stay consistent. The
> changes would of course be in line with this change, such that every
> operation has a unary selector with a sensible default, one that takes a
> block and throws an error for empty collections and a third that takes a
> block for the iteration and one for the empty case.
>
>
> Please cast your vote for these changes:
>
> 1. Do you agree to changing #sum and #sum: in the suggested way?
>

yes


>
> 2. Do you agree to the removal of #detectSum:?
>

yes


>
> 3. Do you agree to the removal of #sumNumbers?
>

yes


>
> 4. Do you agree that the #max and #min selectors also need to be adapted?
>

hm. I like the "detect". If

aCollection detectMax: aBlock
becomes

aCollection max: aBlock

it looks too similar  to
aCollection size max: aValue

But  I could live with that :)


>
>
> Thanks for you help.
>
> Cheers,
> Max
>
>
>
>
>
> Benchmarks
> 
> (Note that these aren’t very good benchmarks. There’s quite some variation
> on each run.)
>
>
> Machine:
> MacBook Pro (15-inch, Early 2011)
> CPU: 2.2 GHz Intel Core i7
> Memory: 8 GB 1333 MHz DDR3
> Disk: APPLE SSD TS512C (500 GB)
>
>
> Benchmarks of the current versions:
>
> [ (1 to: 100) asArray sum ] benchFor: 10 seconds.
> 75 iterations, 7.470 per second
>
> [ (1 to: 100) asArray sum: [ :e | e ] ] benchFor: 10 seconds.
> 72 iterations, 7.128 per second
>
>
> [ (1 to: 100) asArray sum ] benchFor: 10 seconds.
> 1,189,477 iterations, 118,912 per second
>
>
> [ (1 to: 100) asArray sum: [ :e | e ] ] benchFor: 10 seconds.
> 1,171,467 iterations, 117,112 per second
>
>
>
> Benchmarks of the new versions:
>
> [ (1 to: 100) asArray sum ] benchFor: 10 seconds.
> 73 iterations, 7.244 per second
>
> [ (1 to: 100) asArray sum: [ :e | e ] ] benchFor: 10 seconds.
> 75 iterations, 7.480 per second
>
> [ (1 to: 100) asArray sum: [ :e | e ] ifEmpty: [ 0 ] ] benchFor: 10
> seconds.
> 72 iterations, 7.141 per second
>
>
> [ (1 to: 100) asArray sum ] benchFor: 10 seconds.
> 1,115,827 iterations, 111,560 per second
>
> [ (1 to: 100) asArray sum: [ :e | e ] ] benchFor: 10 seconds.
> 1,154,595 iterations, 115,425 per second
>
> [ (1 to: 100) asArray sum: [ :e | e ] ifEmpty: [ 0 ] ] benchFor: 10
> seconds.
> 1,102,358 iterations, 110,203 per second
>
>


Re: [Pharo-dev] VM error in Arch Linux

2015-12-22 Thread Ferlicot D. Cyril
Le 22/12/2015 11:14, nacho a écrit :
> Hi Folks,
> I've installed pharo-vm and pharo-launcher from AUR as stated in the pharo
> site.
> Everything works fine for Pharo 4.
> But when I try to load a Pharo 5 image I get the following error:
> This interpreter (vers. 6502) cannot read file image (vers. 6521)
> 
> and when I do  pharo --version:
> 3.9-7 #1 Thu Dec 17 00:38:38 CET 2015 gcc 4.6.3 [Production ITHB VM]
> NBCoInterpreter NativeBoost-CogPlugin-EstebanLorenzano.21 uuid:
> 4d9b9bdf-2dfa-4c0b-99eb-5b110dadc697 Dec 17 2015
> NBCogit NativeBoost-CogPlugin-EstebanLorenzano.21 uuid:
> 4d9b9bdf-2dfa-4c0b-99eb-5b110dadc697 Dec 17 2015
> https://github.com/pharo-project/pharo-vm.git Commit:
> bad6fa2684afcf1d7cdb485f11049a4a4290fbc8 Date: 2015-12-14 12:47:06 +0100 By:
> Esteban Lorenzano  Jenkins build #15024
> Linux pharo-linux 3.2.0-31-generic-pae #50-Ubuntu SMP Fri Sep 7 16:39:45 UTC
> 2012 i686 i686 i386 GNU/Linux
> plugin path: /usr/share/pharo-vm/ [default: /usr/share/pharo-vm/]
> 
> 
> Any clues?
> 

Hi,

Since last week a new VM is use for Pharo 5 beta.
You need to download the new VM on http://files.pharo.org/vm/pharo-spur32/.

Then you need to update Pharo Launcher.

For now the easiest way I think is to enable the development mode in
PharoLauncher, go in Monticello, and load the last version of Pharo
Launcher core.

Later I think that a new release of Pharo Launcher will make thing easier.

Then you can disable the development mode and do Alt + Shift + S to save
you image.

After this everything should be fine.

> Thanks in advance
> Nacho
> 
> 
> 
> -
> Nacho
> Smalltalker apprentice.
> Buenos Aires, Argentina.
> --
> View this message in context: 
> http://forum.world.st/VM-error-in-Arch-Linux-tp4868239.html
> Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
> 


-- 
Cyril Ferlicot

http://www.synectique.eu

165 Avenue Bretagne
Lille 59000 France



signature.asc
Description: OpenPGP digital signature


Re: [Pharo-dev] VM error in Arch Linux

2015-12-22 Thread p...@highoctane.be
I guess that that image is a Spur one, requiring a Spur VM.

Phil

On Tue, Dec 22, 2015 at 11:14 AM, nacho <0800na...@gmail.com> wrote:

> Hi Folks,
> I've installed pharo-vm and pharo-launcher from AUR as stated in the pharo
> site.
> Everything works fine for Pharo 4.
> But when I try to load a Pharo 5 image I get the following error:
> This interpreter (vers. 6502) cannot read file image (vers. 6521)
>
> and when I do  pharo --version:
> 3.9-7 #1 Thu Dec 17 00:38:38 CET 2015 gcc 4.6.3 [Production ITHB VM]
> NBCoInterpreter NativeBoost-CogPlugin-EstebanLorenzano.21 uuid:
> 4d9b9bdf-2dfa-4c0b-99eb-5b110dadc697 Dec 17 2015
> NBCogit NativeBoost-CogPlugin-EstebanLorenzano.21 uuid:
> 4d9b9bdf-2dfa-4c0b-99eb-5b110dadc697 Dec 17 2015
> https://github.com/pharo-project/pharo-vm.git Commit:
> bad6fa2684afcf1d7cdb485f11049a4a4290fbc8 Date: 2015-12-14 12:47:06 +0100
> By:
> Esteban Lorenzano  Jenkins build #15024
> Linux pharo-linux 3.2.0-31-generic-pae #50-Ubuntu SMP Fri Sep 7 16:39:45
> UTC
> 2012 i686 i686 i386 GNU/Linux
> plugin path: /usr/share/pharo-vm/ [default: /usr/share/pharo-vm/]
>
>
> Any clues?
>
> Thanks in advance
> Nacho
>
>
>
> -
> Nacho
> Smalltalker apprentice.
> Buenos Aires, Argentina.
> --
> View this message in context:
> http://forum.world.st/VM-error-in-Arch-Linux-tp4868239.html
> Sent from the Pharo Smalltalk Developers mailing list archive at
> Nabble.com.
>
>


[Pharo-dev] VM error in Arch Linux

2015-12-22 Thread nacho
Hi Folks,
I've installed pharo-vm and pharo-launcher from AUR as stated in the pharo
site.
Everything works fine for Pharo 4.
But when I try to load a Pharo 5 image I get the following error:
This interpreter (vers. 6502) cannot read file image (vers. 6521)

and when I do  pharo --version:
3.9-7 #1 Thu Dec 17 00:38:38 CET 2015 gcc 4.6.3 [Production ITHB VM]
NBCoInterpreter NativeBoost-CogPlugin-EstebanLorenzano.21 uuid:
4d9b9bdf-2dfa-4c0b-99eb-5b110dadc697 Dec 17 2015
NBCogit NativeBoost-CogPlugin-EstebanLorenzano.21 uuid:
4d9b9bdf-2dfa-4c0b-99eb-5b110dadc697 Dec 17 2015
https://github.com/pharo-project/pharo-vm.git Commit:
bad6fa2684afcf1d7cdb485f11049a4a4290fbc8 Date: 2015-12-14 12:47:06 +0100 By:
Esteban Lorenzano  Jenkins build #15024
Linux pharo-linux 3.2.0-31-generic-pae #50-Ubuntu SMP Fri Sep 7 16:39:45 UTC
2012 i686 i686 i386 GNU/Linux
plugin path: /usr/share/pharo-vm/ [default: /usr/share/pharo-vm/]


Any clues?

Thanks in advance
Nacho



-
Nacho
Smalltalker apprentice.
Buenos Aires, Argentina.
--
View this message in context: 
http://forum.world.st/VM-error-in-Arch-Linux-tp4868239.html
Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.



Re: [Pharo-dev] #sum:, #detectSum:, #sumNumbers:

2015-12-22 Thread Denis Kudriashov
Hi

My vote:


> 1. Do you agree to changing #sum and #sum: in the suggested way?
>

yes but I prefer #sum: return zero too for empty collections


> 2. Do you agree to the removal of #detectSum:?
>

yes


>
> 3. Do you agree to the removal of #sumNumbers?
>

yes


>
> 4. Do you agree that the #max and #min selectors also need to be adapted?
>

yes


Re: [Pharo-dev] #sum:, #detectSum:, #sumNumbers:

2015-12-22 Thread Nicolas Cellier
2015-12-22 10:37 GMT+01:00 Sven Van Caekenberghe :

>
> > On 22 Dec 2015, at 10:22, Nicolas Cellier <
> nicolas.cellier.aka.n...@gmail.com> wrote:
> >
> >
> >
> > 2015-12-22 3:46 GMT+01:00 Ben Coman :
> > On Wed, Dec 2, 2015 at 3:38 AM, Tudor Girba 
> wrote:
> > > I am saying that if you want sum: to be generic, it cannot assume a
> *specific* Zero object.
> > > And sum:  should be generic because of its name.
> >
> > This seems the crux of the disparate viewpoints, which is why I
> > suggested return a *generic* Zero object as follows...
> >
> > > On 04 Dec 2015, at 01:49, Ben Coman  wrote:
> > > do something like...
> > >
> > >Collection>>sum
> > >   | sum sample |
> > >   self isEmpty ifTrue: [ ^ ArithmeticZero ].
> > >   sample := self anyOne.
> > >   sum := self inject: sample into: [ :accum :each | accum + each ].
> > >^ sum - sample
> >
> >
> > Nice, but generic zero can't work: you sometimes need to decide if it is
> the zero of vector space, or of associated field.
> > The generic zero can't behave as both say a matrix and a scalar...
>
> Indeed, that is what I said the first time Ben proposed this.
>
> But I am curious, Nicolas, what you think of this, with your math
> background/interest ?
>
>
This is what I had in old app (in the 90s):

SequenceableCollection>>sum: aBlock
"answer the sum of all elements after applying a Block"
| sum |
self isEmpty ifTrue: [^0].
sum := aBlock value: (self at: 1).
2 to: self size do: [:i | sum := sum + (aBlock value: (self at: i))].
^sum

Collection>>sum: aBlock
"answer the sum of all elements after applying a Block"
| sum |
sum := 0.
self do: [:e | sum := sum + (aBlock value: e)].
^sum

I find sum: much more expressive than inject:into:

If we really find that it adds semantic value to inject:into: we may also
implement optionnal:

Collection>>sum: aBlock to: initialValue
"answer the sum of all elements after applying a Block"
| sum |
sum := initialValue.
self do: [:e | sum := sum + (aBlock value: e)].
^sum
Collection>>sum: aBlock
^self sum: aBlock to: 0

This way, no (#anyOne,#-) trick required, that's why I prefer sum:to: to
sum:ifEmpty:...
For example, I had symbolic algebra, and the #- trick would have required
further simplification of the sum.

So I don't have any mathematical solution, just pragmatic ones:
- I agree on this: no need for many selectors, one or maximum two should be
enough
- I wouldn't care too much and would just answer 0 for empty collection
because we have inject:into: or optionnally sum:to: for exotic cases


Re: [Pharo-dev] Any thread-safe collection for Pharo?

2015-12-22 Thread Denis Kudriashov
2015-12-22 10:28 GMT+01:00 Sven Van Caekenberghe :

> There is SharedQueue that I know of.
>
> LRUCache and TTLCache can #beThreadSafe.
>
> In general it is easy enough to put something in front of your collection
> access.
>

I want something more simple which not force me to remember what is
semaphore, monitor, mutex  or whatever. Something like this:

threadSafeCollection := AnyCollectionClass threadSafe.

or

threadSafeCollection := AnyCollectionInstance threadSafe.

or more general

threadSafeObject := AnyObjectInstance threadSafe


Thread safe wrappers should allow concurrent reads which blocked on writes
and writes which blocked on anything.
For example collection #add: method should wait until current #do: or #add:
completes.  And #do: should wait until current #add: completes.


Re: [Pharo-dev] #sum:, #detectSum:, #sumNumbers:

2015-12-22 Thread Sven Van Caekenberghe

> On 22 Dec 2015, at 10:22, Nicolas Cellier 
>  wrote:
> 
> 
> 
> 2015-12-22 3:46 GMT+01:00 Ben Coman :
> On Wed, Dec 2, 2015 at 3:38 AM, Tudor Girba  wrote:
> > I am saying that if you want sum: to be generic, it cannot assume a 
> > *specific* Zero object.
> > And sum:  should be generic because of its name.
> 
> This seems the crux of the disparate viewpoints, which is why I
> suggested return a *generic* Zero object as follows...
> 
> > On 04 Dec 2015, at 01:49, Ben Coman  wrote:
> > do something like...
> >
> >Collection>>sum
> >   | sum sample |
> >   self isEmpty ifTrue: [ ^ ArithmeticZero ].
> >   sample := self anyOne.
> >   sum := self inject: sample into: [ :accum :each | accum + each ].
> >^ sum - sample
> 
> 
> Nice, but generic zero can't work: you sometimes need to decide if it is the 
> zero of vector space, or of associated field.
> The generic zero can't behave as both say a matrix and a scalar...

Indeed, that is what I said the first time Ben proposed this.

But I am curious, Nicolas, what you think of this, with your math 
background/interest ?

> On Sat, Dec 5, 2015 at 3:12 AM, Max Leske  wrote:
> > While I think you might be on to something, I think we should take small
> > steps. I’d be happy already if we can just get rid of one superfluous method
> > and provide a better API without starting to think about the deeper
> > semantics.
> 
> Sure, small steps are better, except when this hits a sticking point
> that the bigger step may overcome.  I think returning a generic zero
> allowing the program to proceed is better than throwing an generic
> error that the programmer needs to explicitly deal with.  The concept
> of zero is well defined for the common arithmetic functions.  Just for
> a thought experiment, what arithmetic functions would need to be dealt
> with.
> 
> >ArithmeticZero class >> + anObject
> >^anObject
> 
> AritmeticZero class >> * anObject
>  ^ anObject zero
> 
> AritmeticZero class >> - anObject
>  ^ anObject zero - anObject
> 
> 
> > Also, I think there’s a reason why Aconcagua is an external package:
> > developers usually are happy to work with numbers (which are already objects
> > in Smalltalk anyway) and they’re fast.
> 
> Sure its an external package, but when you have a collection of weight
> readings for example, you want to use the internal convenient #sum
> method...
>{ 4 kg . 5 kg . 6 kg } sum--> 16kg
>{ } sum + 1 kg --> 1kg
>{ } sum * 1 kg--> 0 kg^2   "hmmm, zero with units and
> multiplication starts getting more complicated - maybe should be left
> out of this discussion"
> 
> > While #sumNumbers may *technically* be the best name (which
> > we can’t seem to agree on…), #sum, #sum: and #sum:ifEmpty:
> > form a triple that naturally fits into the naming protocol applied
> > elsewhere.
> 
> So maybe alternative naming of the generic zero...
> #sum  (empty --> EmptyAggregateZero)
> #sum:   (empty --> EmptyAggregateZero)
> #sum: ifEmpty:   (empty --> whatever)
> 
> 
> > On Mon, Dec 21, 2015 at 12:43 AM, Sven Van Caekenberghe 
> > wrote:
> > Doru,
> >
> > For me this whole discussion started because you (the standpoint that you
> > take) hijacked the best selector (#sum) for a use case that is much less
> > common than adding a collection of numbers which should give 0 when empty
> > (you hijack it by not wanting to return 0, which I totally understand, but
> > doing so you redefine the meaning/semantics).
> >
> > Max's point is to make everything more consistent and remove some API. I
> > support that too.
> >
> > Now, I like Max's proposal.
> >
> > But, you know, my conclusion when the thread ended was that it might be
> > better to throw all these selectors away, since #inject:into: covers most
> > use cases at least as well and at least as clear.
> 
> #sum is very convenient and that lowers the barrier of entry for
> newcomers over the relatively exotic #inject:into:We should keep
> trying to work through the sticky points, but maybe you guys getting
> together IRL is better than continuing on the mail list.
> 
> cheers -ben




Re: [Pharo-dev] Any thread-safe collection for Pharo?

2015-12-22 Thread Sven Van Caekenberghe
There is SharedQueue that I know of.

LRUCache and TTLCache can #beThreadSafe.

In general it is easy enough to put something in front of your collection 
access.

If you want concurrent and interleaved access to the same collection by 
multiple threads while modifying the collection, that is something else ;-)

> On 22 Dec 2015, at 09:41, Denis Kudriashov  wrote:
> 
> Hello.
> 
> Anybody know thread-safe collections project?




Re: [Pharo-dev] #sum:, #detectSum:, #sumNumbers:

2015-12-22 Thread Nicolas Cellier
2015-12-22 3:46 GMT+01:00 Ben Coman :

> On Wed, Dec 2, 2015 at 3:38 AM, Tudor Girba  wrote:
> > I am saying that if you want sum: to be generic, it cannot assume a
> *specific* Zero object.
> > And sum:  should be generic because of its name.
>
> This seems the crux of the disparate viewpoints, which is why I
> suggested return a *generic* Zero object as follows...
>
> > On 04 Dec 2015, at 01:49, Ben Coman  wrote:
> > do something like...
> >
> >Collection>>sum
> >   | sum sample |
> >   self isEmpty ifTrue: [ ^ ArithmeticZero ].
> >   sample := self anyOne.
> >   sum := self inject: sample into: [ :accum :each | accum + each ].
> >^ sum - sample
>
>
Nice, but generic zero can't work: you sometimes need to decide if it is
the zero of vector space, or of associated field.
The generic zero can't behave as both say a matrix and a scalar...


> On Sat, Dec 5, 2015 at 3:12 AM, Max Leske  wrote:
> > While I think you might be on to something, I think we should take small
> > steps. I’d be happy already if we can just get rid of one superfluous
> method
> > and provide a better API without starting to think about the deeper
> > semantics.
>
> Sure, small steps are better, except when this hits a sticking point
> that the bigger step may overcome.  I think returning a generic zero
> allowing the program to proceed is better than throwing an generic
> error that the programmer needs to explicitly deal with.  The concept
> of zero is well defined for the common arithmetic functions.  Just for
> a thought experiment, what arithmetic functions would need to be dealt
> with.
>
> >ArithmeticZero class >> + anObject
> >^anObject
>
> AritmeticZero class >> * anObject
>  ^ anObject zero
>
> AritmeticZero class >> - anObject
>  ^ anObject zero - anObject
>
>
> > Also, I think there’s a reason why Aconcagua is an external package:
> > developers usually are happy to work with numbers (which are already
> objects
> > in Smalltalk anyway) and they’re fast.
>
> Sure its an external package, but when you have a collection of weight
> readings for example, you want to use the internal convenient #sum
> method...
>{ 4 kg . 5 kg . 6 kg } sum--> 16kg
>{ } sum + 1 kg --> 1kg
>{ } sum * 1 kg--> 0 kg^2   "hmmm, zero with units and
> multiplication starts getting more complicated - maybe should be left
> out of this discussion"
>
> > While #sumNumbers may *technically* be the best name (which
> > we can’t seem to agree on…), #sum, #sum: and #sum:ifEmpty:
> > form a triple that naturally fits into the naming protocol applied
> > elsewhere.
>
> So maybe alternative naming of the generic zero...
> #sum  (empty --> EmptyAggregateZero)
> #sum:   (empty --> EmptyAggregateZero)
> #sum: ifEmpty:   (empty --> whatever)
>
>
> > On Mon, Dec 21, 2015 at 12:43 AM, Sven Van Caekenberghe 
> > wrote:
> > Doru,
> >
> > For me this whole discussion started because you (the standpoint that you
> > take) hijacked the best selector (#sum) for a use case that is much less
> > common than adding a collection of numbers which should give 0 when empty
> > (you hijack it by not wanting to return 0, which I totally understand,
> but
> > doing so you redefine the meaning/semantics).
> >
> > Max's point is to make everything more consistent and remove some API. I
> > support that too.
> >
> > Now, I like Max's proposal.
> >
> > But, you know, my conclusion when the thread ended was that it might be
> > better to throw all these selectors away, since #inject:into: covers most
> > use cases at least as well and at least as clear.
>
> #sum is very convenient and that lowers the barrier of entry for
> newcomers over the relatively exotic #inject:into:We should keep
> trying to work through the sticky points, but maybe you guys getting
> together IRL is better than continuing on the mail list.
>
> cheers -ben
>
>


Re: [Pharo-dev] Object graph stream/visitor implementation?

2015-12-22 Thread Denis Kudriashov
I found this: http://smalltalkhub.com/#!/~Moose/DeepTraverser

2015-12-22 10:05 GMT+01:00 Marcus Denker :

>
> > On 22 Dec 2015, at 09:46, Denis Kudriashov  wrote:
> >
> > Hello.
> >
> > Do we have way to traverse object graph?
> >
> > I want stream which iterate object graph through instance variables with
> knowledge about path at every step.
> >
> > Maybe Fuel has classes for this ?
> >
>
> yes, I think so.. there is #fuelAccept:, but I am not sure how general it
> is.
>
> I remember that Doru did some object graph iteration experiments, too?
> (I can’t find it).
>
> But I think we should actually add a general “object graph iterator” to
> the reflective
> features of the language. It seems very useful to have, and for sure Fuel
> could just
> use it.
>
> Marcus
>
>
>
>
>


Re: [Pharo-dev] Object graph stream/visitor implementation?

2015-12-22 Thread Robert Withers
I'm sorry, this is with Fuel loaded. These are extensions to Fuel 
serialization and materialization.



b, robert


On 12/22/2015 03:55 AM, Robert Withers wrote:
I managed to get per object substitution callbacks working in 
Mushroom. Please take a look in http://www.squeaksource.com/Mushroom 
and load Mushr00m-Pharo on top of MushrOOm (after installing 
Cryptography and SecureSession from 
http://www.squeaksource.com/Cryptography).


Then look at the classes in the Utility category.

HTH,

Robert



On 12/22/2015 03:46 AM, Denis Kudriashov wrote:

Hello.

Do we have way to traverse object graph?

I want stream which iterate object graph through instance variables 
with knowledge about path at every step.


Maybe Fuel has classes for this ?

Best regards,
Denis




--
. ..  ...   ^,^robert
Go Panthers!




Re: [Pharo-dev] Object graph stream/visitor implementation?

2015-12-22 Thread Marcus Denker

> On 22 Dec 2015, at 09:46, Denis Kudriashov  wrote:
> 
> Hello.
> 
> Do we have way to traverse object graph?
> 
> I want stream which iterate object graph through instance variables with 
> knowledge about path at every step.
> 
> Maybe Fuel has classes for this ?
> 

yes, I think so.. there is #fuelAccept:, but I am not sure how general it is.

I remember that Doru did some object graph iteration experiments, too?
(I can’t find it).

But I think we should actually add a general “object graph iterator” to the 
reflective 
features of the language. It seems very useful to have, and for sure Fuel could 
just
use it.

Marcus






Re: [Pharo-dev] Object graph stream/visitor implementation?

2015-12-22 Thread Robert Withers
I managed to get per object substitution callbacks working in Mushroom. 
Please take a look in http://www.squeaksource.com/Mushroom and load 
Mushr00m-Pharo on top of MushrOOm (after installing Cryptography and 
SecureSession from http://www.squeaksource.com/Cryptography).


Then look at the classes in the Utility category.

HTH,

Robert



On 12/22/2015 03:46 AM, Denis Kudriashov wrote:

Hello.

Do we have way to traverse object graph?

I want stream which iterate object graph through instance variables 
with knowledge about path at every step.


Maybe Fuel has classes for this ?

Best regards,
Denis


--
. ..  ...   ^,^robert
Go Panthers!




[Pharo-dev] Object graph stream/visitor implementation?

2015-12-22 Thread Denis Kudriashov
Hello.

Do we have way to traverse object graph?

I want stream which iterate object graph through instance variables with
knowledge about path at every step.

Maybe Fuel has classes for this ?

Best regards,
Denis


[Pharo-dev] Any thread-safe collection for Pharo?

2015-12-22 Thread Denis Kudriashov
Hello.

Anybody know thread-safe collections project?