[Pharo-users] NeoJSON "conditional" parsing/mapping

2017-07-25 Thread Esteban A. Maringolo
Hi Sven, all,

I'm working on a JSON-RPC client, I started using LtJsonRpcClient, but
since it's based on the "legacy" JSON package I decided to try to
adapt it to use NeoJSON. So I created a NeoJSONRPCClient based on
LtJson... because... why not.

At its core JSON-RPC is a pretty simple protocol, every response is a
JSON object with a 'result' attribute holding the returned object from
the RPC call, an 'error' one (nil if no error happened), and a few
other ones [1].

If I convert the response using the traditional `NeoJSONReader
fromString: responseObject` all the object three is converted to a
Dictionary, and what I want is to be able to:

1. Determine whether there was an error in the response
2. If there was no error, convert the 'result' field to my preferred
class of object instead of a Dictionary. I plan to make my classes
inherit from NeoJSONObject though.

All the above to avoid the use of an intermediate set of nested
dictionaries (which could be in the thousands).
I understand I could subclass NeoJSONReader to perform that at the
character stream level, but I wanted to ask first whether there is a
pattern/configuration of dealing with something like this.

Best regards!

[1] http://www.jsonrpc.org/specification#response_object

Esteban A. Maringolo



Re: [Pharo-users] Issue with the --headless option on Windows 10

2017-07-25 Thread Herby Vojčík

Sven Van Caekenberghe wrote:

Hi,

User Herby Vojčík seems to have an issue with the --headless option on Windows 
10

https://pharo.fogbugz.com/f/cases/20271/ZnServer-managedServers-disappear-when-headless-mode-used

I cannot reproduce his problem.

Maybe there are Windows users out there who can have a look and help him ?

Thx,

Sven



I changed ZnSingleThreadedServer >> stop: to this:

stop: unregister
"Stop me. I will stop listening on my port for incoming HTTP 
connections.
If unregister is true, unregister me from the list of managed instances.
Does nothing when I am not running"

self isRunning ifFalse: [ ^ self ].
	unregister ifTrue: [ Error signal: 'stop: true was sent to running 
server!' ].

process terminate.
process := nil.
unregister ifTrue: [ self unregister ].
self closeDelegate.
self logStopped

As a result, different PharoDebug.log was generated (only in headless 
case, of course), which shows the server was indeed saved with both 
process and serverSocket being notNil.


Attached.

Herby
THERE_BE_DRAGONS_HERE
Error: stop: true was sent to running server!
25 July 2017 10:28:58.7226 pm

VM: Win32 - IX86 - 10.0 - CoInterpreter VMMaker.oscog-eem.2254 uuid: 
4f2c2cce-f4a2-469a-93f1-97ed941df0ad Jul 20 2017
StackToRegisterMappingCogit VMMaker.oscog-eem.2252 uuid: 
2f3e9b0e-ecd3-4adf-b092-cce2e2587a5c Jul 20 2017
VM: 201707201942 https://github.com/OpenSmalltalk/opensmalltalk-vm.git $ Date: 
Thu Jul 20 12:42:21 2017 -0700 $ Plugins: 201707201942 
https://github.com/OpenSmalltalk/opensmalltalk-vm.git $

Image: Pharo6.0 [Latest update: #60510]

ZnManagingMultiThreadedServer(ZnSingleThreadedServer)>>stop:
Receiver: a ZnManagingMultiThreadedServer(running 4998)
Arguments and temporary variables: 
unregister: true
Receiver's instance variables: 
options:a Dictionary(#delegate->a TowergameDelegate 
#port->4998 )
sessionManager: nil
process:a Process in [ self schedule.
"It is critical that the following has n...etc...
serverSocket:   a Socket[waitingForConnection]
logLevel:   3
lock:   nil
connections:an OrderedCollection()


ZnManagingMultiThreadedServer>>stop:
Receiver: a ZnManagingMultiThreadedServer(running 4998)
Arguments and temporary variables: 
unregister: true
Receiver's instance variables: 
options:a Dictionary(#delegate->a TowergameDelegate 
#port->4998 )
sessionManager: nil
process:a Process in [ self schedule.
"It is critical that the following has n...etc...
serverSocket:   a Socket[waitingForConnection]
logLevel:   3
lock:   nil
connections:an OrderedCollection()


ZnManagingMultiThreadedServer(ZnServer)>>stop
Receiver: a ZnManagingMultiThreadedServer(running 4998)
Arguments and temporary variables: 

Receiver's instance variables: 
options:a Dictionary(#delegate->a TowergameDelegate 
#port->4998 )
sessionManager: nil
process:a Process in [ self schedule.
"It is critical that the following has n...etc...
serverSocket:   a Socket[waitingForConnection]
logLevel:   3
lock:   nil
connections:an OrderedCollection()


ZnManagingMultiThreadedServer(ZnSingleThreadedServer)>>start
Receiver: a ZnManagingMultiThreadedServer(running 4998)
Arguments and temporary variables: 

Receiver's instance variables: 
options:a Dictionary(#delegate->a TowergameDelegate 
#port->4998 )
sessionManager: nil
process:a Process in [ self schedule.
"It is critical that the following has n...etc...
serverSocket:   a Socket[waitingForConnection]
logLevel:   3
lock:   nil
connections:an OrderedCollection()


[ :each | each start ] in [ self managedServers do: [ :each | each start ] ] in 
[ :manager | 
manager default currentSession
addDeferredStartupAction: [ self managedServers do: [ :each | each 
start ] ] ] in ZnServer class>>startUp:
Receiver: ZnServer
Arguments and temporary variables: 
resuming:   true
manager:SessionManager
each:   a ZnManagingMultiThreadedServer(running 4998)
Receiver's instance variables: 
superclass: Object
methodDict: a 
MethodDictionary(#authenticator->ZnServer>>#authenticator #authen...etc...
format: 65538
layout: a FixedLayout
   

Re: [Pharo-users] Issue with the --headless option on Windows 10

2017-07-25 Thread Herby Vojčík

Sven Van Caekenberghe wrote:

Hi,

User Herby Vojčík seems to have an issue with the --headless option on Windows 
10

https://pharo.fogbugz.com/f/cases/20271/ZnServer-managedServers-disappear-when-headless-mode-used

I cannot reproduce his problem.

Maybe there are Windows users out there who can have a look and help him ?

Thx,

Sven




But from the PharoDebug.log I sent to the issue (and send here as you 
wanted to continue discussion here) it should be clear self isRunning 
wasn't false, even if both process and serverSocket are shown as nil.


Very strange.

Somewhere between headless W10 shutdown and W10 ui startup something 
must be broken that made Zinc unregister the running and registered server.


Herby
THERE_BE_DRAGONS_HERE
Error: Unregistering a server!
25 July 2017 8:49:38.139084 pm

VM: Win32 - IX86 - 10.0 - CoInterpreter VMMaker.oscog-eem.2254 uuid: 
4f2c2cce-f4a2-469a-93f1-97ed941df0ad Jul 20 2017
StackToRegisterMappingCogit VMMaker.oscog-eem.2252 uuid: 
2f3e9b0e-ecd3-4adf-b092-cce2e2587a5c Jul 20 2017
VM: 201707201942 https://github.com/OpenSmalltalk/opensmalltalk-vm.git $ Date: 
Thu Jul 20 12:42:21 2017 -0700 $ Plugins: 201707201942 
https://github.com/OpenSmalltalk/opensmalltalk-vm.git $

Image: Pharo6.0 [Latest update: #60510]

ZnManagingMultiThreadedServer class(ZnServer class)>>unregister:
Receiver: ZnManagingMultiThreadedServer
Arguments and temporary variables: 
server: a ZnManagingMultiThreadedServer(stopped 4998)
Receiver's instance variables: 
superclass: ZnMultiThreadedServer
methodDict: a 
MethodDictionary(#closeConnections->ZnManagingMultiThreadedServer...etc...
format: 65543
layout: a FixedLayout
instanceVariables:  nil
organization:   a ClassOrganization
subclasses: nil
name:   #ZnManagingMultiThreadedServer
classPool:  a Dictionary()
sharedPools:nil
environment:a SystemDictionary(lots of globals)
category:   #'Zinc-HTTP-Client-Server'
traitComposition:   {}
localSelectors: nil
Default:nil


ZnManagingMultiThreadedServer(ZnServer)>>unregister
Receiver: a ZnManagingMultiThreadedServer(stopped 4998)
Arguments and temporary variables: 

Receiver's instance variables: 
options:a Dictionary(#delegate->a TowergameDelegate 
#port->4998 )
sessionManager: nil
process:nil
serverSocket:   nil
logLevel:   3
lock:   nil
connections:an OrderedCollection()


ZnManagingMultiThreadedServer(ZnSingleThreadedServer)>>stop:
Receiver: a ZnManagingMultiThreadedServer(stopped 4998)
Arguments and temporary variables: 
unregister: true
Receiver's instance variables: 
options:a Dictionary(#delegate->a TowergameDelegate 
#port->4998 )
sessionManager: nil
process:nil
serverSocket:   nil
logLevel:   3
lock:   nil
connections:an OrderedCollection()


ZnManagingMultiThreadedServer>>stop:
Receiver: a ZnManagingMultiThreadedServer(stopped 4998)
Arguments and temporary variables: 
unregister: true
Receiver's instance variables: 
options:a Dictionary(#delegate->a TowergameDelegate 
#port->4998 )
sessionManager: nil
process:nil
serverSocket:   nil
logLevel:   3
lock:   nil
connections:an OrderedCollection()


ZnManagingMultiThreadedServer(ZnServer)>>stop
Receiver: a ZnManagingMultiThreadedServer(stopped 4998)
Arguments and temporary variables: 

Receiver's instance variables: 
options:a Dictionary(#delegate->a TowergameDelegate 
#port->4998 )
sessionManager: nil
process:nil
serverSocket:   nil
logLevel:   3
lock:   nil
connections:an OrderedCollection()


ZnManagingMultiThreadedServer(ZnSingleThreadedServer)>>start
Receiver: a ZnManagingMultiThreadedServer(stopped 4998)
Arguments and temporary variables: 

Receiver's instance variables: 
options:a Dictionary(#delegate->a TowergameDelegate 
#port->4998 )
sessionManager: nil
process:nil
serverSocket:   nil
logLevel:   3
lock:   nil
connections:an 

Re: [Pharo-users] Reef examples?

2017-07-25 Thread Stephane Ducasse
I tried to write something but I failed because this is too complex to
have to understand first a frameworks and then write a real
documentation.
This costs me too much I cannot do it anymore.

Stef

On Tue, Jul 25, 2017 at 3:16 PM, Martin Dias  wrote:
> Hello,
>
> I've downloaded Reef following esteban's website [1] and wonder if there are
> some examples of use to try it faster. For the moment I just did the
> tutorial in the website and it works fine.
>
> [1]: http://smallworks.eu/web/projects/reef
>
> Cheers,
> Martín
>
>



Re: [Pharo-users] Issue with the --headless option on Windows 10

2017-07-25 Thread Cyril Ferlicot D.
Le 25/07/2017 à 19:37, Sven Van Caekenberghe a écrit :
> Hi,
> 
> User Herby Vojčík seems to have an issue with the --headless option on 
> Windows 10
> 
> https://pharo.fogbugz.com/f/cases/20271/ZnServer-managedServers-disappear-when-headless-mode-used
> 
> I cannot reproduce his problem.
> 
> Maybe there are Windows users out there who can have a look and help him ?
> 
> Thx,
> 
> Sven
> 
> 

Hi,

I am not sure but I think that in Windows the option to use is not
--headless but --nodisplay.

-- 
Cyril Ferlicot
https://ferlicot.fr

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



signature.asc
Description: OpenPGP digital signature


[Pharo-users] Issue with the --headless option on Windows 10

2017-07-25 Thread Sven Van Caekenberghe
Hi,

User Herby Vojčík seems to have an issue with the --headless option on Windows 
10

https://pharo.fogbugz.com/f/cases/20271/ZnServer-managedServers-disappear-when-headless-mode-used

I cannot reproduce his problem.

Maybe there are Windows users out there who can have a look and help him ?

Thx,

Sven




Re: [Pharo-users] Looking for small boards and tiny computers which can run Pharo

2017-07-25 Thread Bruce O'Neel

Hi,  
  
With a bit of work it probably fits on one of these:  
  
[https://onion.io/omega2/](https://onion.io/omega2/)  
  
If you feel on really wasting space this would work as well, though it would 
need some porting if you wanted to run it locally.  
  
[https://getchip.com/pages/pocketchip](https://getchip.com/pages/pocketchip)  
  
If you don't want the display and keyboard and want to run it remote this will 
work then, it's the CPU from the above.  
  
[https://getchip.com/pages/chip](https://getchip.com/pages/chip)  
  
If I get some free time I can poke at these and see how well Squeak etc runs.  
  
cheers  
  
bruce  
  
  

> Hi,  
> i am looking for:  
> - small hardware, boards/computers, "embeddable" devices, etc. that can run 
> Pharo (except Raspberry pi that i already know)  
> - robots, flying drones or things alike with an open linux which can possibly 
> run Pharo  
> Could somebody points me to documentation or web sites where such things can 
> be found ?  
> Thanks,  
> Steven.
  
  



Re: [Pharo-users] [Pharo-dev] [ANN] Pharo 6.1 (summer) released!

2017-07-25 Thread Esteban Lorenzano

> On 25 Jul 2017, at 17:29, Hilaire  wrote:
> 
> As the P6.1 change log is not complete enough I have to try out to discover:
> 
> - fix for PNG regression is included
> 
> - the Athen Wrap regression is still present :(
> 

is very complete. Is just that it does not has so many changes :)
this was a version we told it was going to be made available to update iceberg 
(as we use iceberg for develop P7, we need to have recurrent updates even in 
Pharo 6). And since there was important modifications, we needed to change the 
backend library. And since we changed the backend library, we needed to change 
the vm. Finally, since we changed the VM, we were unable to apply this update 
as a “hot-fix” (what we do regularly, but version number does not change, just 
build number). 

So, Pharo 6.1 is exactly the same as before, but with: new iceberg, new vm, new 
backend library. 

cheers!
Esteban

ps: the other regressions, when fixed, can be applied as we usual apply 
backported hot-fixes.

> 
> Le 25/07/2017 à 08:59, Hilaire a écrit :
>> Meaning these tow ones ?
>> 
>> http://forum.world.st/Regression-with-PNGReaderWriter-in-P6-td4951796.html#a4952046
>>  
>> 
>> http://forum.world.st/WrapAthen-World-coordinate-td4951750.html#a4951966 
>> 
> -- 
> Dr. Geo
> http://drgeo.eu 


Re: [Pharo-users] Looking for small boards and tiny computers which can run Pharo

2017-07-25 Thread Attila Magyar
The esp32 is not capable of running Pharo unfortunatelly. It's not Linux
based, it has a realtime operating system called FreeRTOS and the amount of
memory it has is also quite limited. It's more like a microcontroller than a
single board computer.



--
View this message in context: 
http://forum.world.st/Looking-for-small-boards-and-tiny-computers-which-can-run-Pharo-tp4956582p4956674.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.



Re: [Pharo-users] Looking for small boards and tiny computers which can run Pharo

2017-07-25 Thread Tim Mackinnon
Wasn’t there another board that Ben was talking about recently - 
http://blog.openinworld.com/2017/06/evening-with-pharo-esp32/ 
 (esp32?)

> On 25 Jul 2017, at 09:14, Denis Kudriashov  wrote:
> 
> Hi.
> 
> Pharo works on Beaglebone. And I am pretty sure that it will work on other 
> ARM/Linux based computers 
> 
> 2017-07-24 21:30 GMT+02:00 Steven Costiou  >:
> Hi,
> 
> i am looking for:
> 
> - small hardware, boards/computers, "embeddable" devices, etc. that can run 
> Pharo (except Raspberry pi that i already know)
> 
> - robots, flying drones or things alike with an open linux which can possibly 
> run Pharo
> 
> Could somebody points me to documentation or web sites where such things can 
> be found ?
> 
> Thanks,
> 
> Steven.
> 
> 



Re: [Pharo-users] Looking for small boards and tiny computers which can run Pharo

2017-07-25 Thread Denis Kudriashov
Hi.

Pharo works on Beaglebone. And I am pretty sure that it will work on other
ARM/Linux based computers

2017-07-24 21:30 GMT+02:00 Steven Costiou :

> Hi,
>
> i am looking for:
>
> - small hardware, boards/computers, "embeddable" devices, etc. that can
> run Pharo (except Raspberry pi that i already know)
>
> - robots, flying drones or things alike with an open linux which can
> possibly run Pharo
>
> Could somebody points me to documentation or web sites where such things
> can be found ?
>
> Thanks,
>
> Steven.
>


Re: [Pharo-users] Compiling documents with Pillar

2017-07-25 Thread p...@highoctane.be
https://github.com/cdlm/docker-texlive



On Jul 23, 2017 8:38 PM, "Glenn Hoetker"  wrote:

> Thanks goodness I'm not the only one who had trouble finding how to do
> this. I also look forward to the answer.
>
> Glenn
>
>
>
> Sent from my iPad
>
> > On Jul 23, 2017, at 11:29 AM, Myroslava Romaniuk 
> wrote:
> >
> > Hi,
> >
> > how do I compile a document using Pillar if I want to get a PDF? I tried
> googling but didn't get anything helpful. Btw I'm using Windows.
> >
> > Thanks,
> > Myroslava
>
>
>