Re: [Pharo-users] [ARTICLE] Quick write me a Redis client

2017-06-14 Thread Sven Van Caekenberghe

> On 15 Jun 2017, at 00:20, Tim Mackinnon  wrote:
> 
> Hi Sven - another nice article.
> 
> 2 small typos I spotted:

Fixed, thanks !

> 1) requests) from the client to the server are sent as a array of bulk strings
> 
> Should be
> 
> requests) from the client to the server are sent as an array of bulk strings
> 
> 2) to interact with as much services and servers as possible
> 
> Is better as
> 
> to interact with as many services and servers as possible
> 
> 
> Tim
> 
> Sent from my iPhone
> 
> On 14 Jun 2017, at 13:31, Sven Van Caekenberghe  wrote:
> 
>> Hi,
>> 
>> I wrote another article in the 'Concerning Pharo' publication:
>> 
>> [TITLE] Quick write me a Redis client
>> [SUBTITLE] A beautiful protocol makes implementation easy
>> [URL] 
>> https://medium.com/concerning-pharo/quick-write-me-a-redis-client-5fbe4ddfb13d
>> [SOURCECODE] https://github.com/svenvc/SimpleRedisClient
>> 
>> Sven
>> 
>> 
>> --
>> Sven Van Caekenberghe
>> Proudly supporting Pharo
>> http://pharo.org
>> http://association.pharo.org
>> http://consortium.pharo.org
>> 
>> 
>> 
>> 
>> 




Re: [Pharo-users] Help in thinking about how to save a "program"

2017-06-14 Thread Glenn Hoetker
Hi Stephan,

Thank you for the helpful info and nice welcome to the Pharo community.  I’d 
not been using Citezen.  Since your email, I’ve found the Smalltalkhub site for 
it and had two quick questions. 1. Is it compatible with Pharo 6? 2. Is there a 
manual or getting started document you could point me to? (I love the ability 
in Pharo to peruse well-documented classes and methods in a package, but for a 
new user and big package, it’s hard to get started!).

I’ve made the jump to creating a class with methods for my small script.  Less 
work than I thought—it’s really just a change of thinking.

Again, thank you.

Glenn

Glenn Hoetker
ghoet...@me.com 
http://hoetker.faculty.asu.edu 



> On Jun 13, 2017, at 10:53 PM, Stephane Ducasse  > wrote:
> 
> Hi glenn
> 
> Do you use Citezen to parse?
> I create a class and put the script as methods and save. You should
> kill script as fast as possible
> up the give birth to nice method.
> 
> GHBibDesk new loadFrom: ''
> GHBibDesk new analysis
> 
> should be your scripts :)
> :)
> 
> 
> On Mon, Jun 12, 2017 at 1:22 AM, Glenn Hoetker  > wrote:
>> Hi all.  I’m new to Pharo and loving it.  As I transition from a text-file
>> based mindset, I’m a little stuck and would appreciate help in how to think
>> about a situation in a Pharonic (Pharo-ish, Pharoc?) way.
>> 
>> I”m crafting a short program to help me process a large text file
>> (specifically: extract, sorting, and regularizing the “keyword” fields of a
>> large BibTex file). Especially since I don’t really know what I’m doing,
>> working in a Playground has been a great development environment.  Now that
>> the program is complete (under 30 lines, wonderful), I want to be able to
>> save it for future reference (and perhaps for future use).  If I’d written a
>> shell script, I’d just save “fixBibDeskKeyWords.sh” to a directory. I’m not
>> sure what to do in the Pharo environment, thought.
>> 
>> At the moment, it just lives in the Playground I’ve developed it on.  I
>> could save the image and leave that Playground open, but I’m just positive
>> that’s not a best practice. I also worry about what happens if I
>> closed/cleared that Playground by accident.
>> 
>> I think I understand that, if I created a new package, I could use
>> Monticello to save it to a local cache and load it into a new image whenever
>> I needed it.  But, given that it’s short, highly specialized and fairly
>> linear, the idea of creating a “GHBibDeskStuff” package with one class
>> (“GBibDeskKeywordFixer” containing a single “FixFile” method seems really
>> heavy and awkward.
>> 
>> Can one save the contents of a Playground in a Pharonic way?  Is there a
>> better approach?
>> 
>> Thank you to all involved in this wonderful programming ecosystem. I
>> appreciate any advice.
>> 
>> Glenn
>> 
>> Glenn Hoetker
>> ghoet...@me.com 
>> http://hoetker.faculty.asu.edu
>> 
>> 
>> 
> 



Re: [Pharo-users] Help in thinking about how to save a "program"

2017-06-14 Thread Glenn Hoetker
H Offray,

Thanks for the helpful reply and nice welcome to the Pharo community. 
Grafoscopio looks wonderful and the Panama Papers application of it, in 
particular, is really impressive.  I look forward to experimenting with it.

Best wishes,

Glenn

p.s. Previously, I had actually Googled my way Grafoscopio’s Spanish language 
site and wasn’t aware it had a corresponding English site. Perhaps a link 
between the English/Spanish sites would be helpful for some?  If I just 
overlooked such a link, sorry to mention it.

Glenn Hoetker
ghoet...@me.com 
http://hoetker.faculty.asu.edu 



> On Jun 14, 2017, at 2:10 PM, Offray Vladimir Luna Cárdenas 
> > wrote:
> 
> Hi Glenn,
> 
> I made also the transition for the plain "dead" text-files based mindset to 
> live objects. My approach to bridge these two words was to create Grafoscopio 
> [1], where I can save my scripts and put them inside a broader 
> context/narrative. This environment let's me go from scripting/files to 
> objects / code browser and back and I have found this is useful for non 
> programmers (researchers, hacktivists, journalist), because they can have a 
> notebook for their explorations. For example, recently we started a pretty 
> specific project at [2] using this interactive notebook + code browser 
> approach (see screenshot attached below).
> [1] http://mutabit.com/grafoscopio/index.en.html 
> 
> [2] http://smalltalkhub.com/#!/~Offray/DPYA 
> 
> 
> 
> 
> If you're interested in Grafoscopio, please follow the manual and take into 
> account that now we're trying to migrate to Pharo 6.
> 
> Cheers,
> 
> Offray
> 
> On 11/06/17 18:22, Glenn Hoetker wrote:
>> Hi all.  I’m new to Pharo and loving it.  As I transition from a text-file 
>> based mindset, I’m a little stuck and would appreciate help in how to think 
>> about a situation in a Pharonic (Pharo-ish, Pharoc?) way.
>> 
>> I”m crafting a short program to help me process a large text file 
>> (specifically: extract, sorting, and regularizing the “keyword” fields of a 
>> large BibTex file). Especially since I don’t really know what I’m doing, 
>> working in a Playground has been a great development environment.  Now that 
>> the program is complete (under 30 lines, wonderful), I want to be able to 
>> save it for future reference (and perhaps for future use).  If I’d written a 
>> shell script, I’d just save “fixBibDeskKeyWords.sh” to a directory. I’m not 
>> sure what to do in the Pharo environment, thought.
>> 
>> At the moment, it just lives in the Playground I’ve developed it on.  I 
>> could save the image and leave that Playground open, but I’m just positive 
>> that’s not a best practice. I also worry about what happens if I 
>> closed/cleared that Playground by accident.
>> 
>> I think I understand that, if I created a new package, I could use 
>> Monticello to save it to a local cache and load it into a new image whenever 
>> I needed it.  But, given that it’s short, highly specialized and fairly 
>> linear, the idea of creating a “GHBibDeskStuff” package with one class 
>> (“GBibDeskKeywordFixer” containing a single “FixFile” method seems really 
>> heavy and awkward.
>> 
>> Can one save the contents of a Playground in a Pharonic way?  Is there a 
>> better approach?
>> 
>> Thank you to all involved in this wonderful programming ecosystem. I 
>> appreciate any advice.
>> 
>> Glenn
>> 
>> Glenn Hoetker
>> ghoet...@me.com 
>> http://hoetker.faculty.asu.edu 
>> 
>> 
>> 
> 



Re: [Pharo-users] [ARTICLE] Quick write me a Redis client

2017-06-14 Thread Tim Mackinnon
Hi Sven - another nice article.

2 small typos I spotted:

1) requests) from the client to the server are sent as a array of bulk strings

Should be

requests) from the client to the server are sent as an array of bulk strings

2) to interact with as much services and servers as possible

Is better as

to interact with as many services and servers as possible


Tim

Sent from my iPhone

> On 14 Jun 2017, at 13:31, Sven Van Caekenberghe  wrote:
> 
> Hi,
> 
> I wrote another article in the 'Concerning Pharo' publication:
> 
> [TITLE] Quick write me a Redis client
> [SUBTITLE] A beautiful protocol makes implementation easy
> [URL] 
> https://medium.com/concerning-pharo/quick-write-me-a-redis-client-5fbe4ddfb13d
> [SOURCECODE] https://github.com/svenvc/SimpleRedisClient
> 
> Sven
> 
> 
> --
> Sven Van Caekenberghe
> Proudly supporting Pharo
> http://pharo.org
> http://association.pharo.org
> http://consortium.pharo.org
> 
> 
> 
> 
> 


Re: [Pharo-users] Help in thinking about how to save a "program"

2017-06-14 Thread Offray Vladimir Luna Cárdenas
Hi Glenn,

I made also the transition for the plain "dead" text-files based mindset
to live objects. My approach to bridge these two words was to create
Grafoscopio [1], where I can save my scripts and put them inside a
broader context/narrative. This environment let's me go from
scripting/files to objects / code browser and back and I have found this
is useful for non programmers (researchers, hacktivists, journalist),
because they can have a notebook for their explorations. For example,
recently we started a pretty specific project at [2] using this
interactive notebook + code browser approach (see screenshot attached
below).

[1] http://mutabit.com/grafoscopio/index.en.html
[2] http://smalltalkhub.com/#!/~Offray/DPYA



If you're interested in Grafoscopio, please follow the manual and take
into account that now we're trying to migrate to Pharo 6.

Cheers,

Offray

On 11/06/17 18:22, Glenn Hoetker wrote:
> Hi all.  I’m new to Pharo and loving it.  As I transition from a
> text-file based mindset, I’m a little stuck and would appreciate help
> in how to think about a situation in a Pharonic (Pharo-ish, Pharoc?) way.
>
> I”m crafting a short program to help me process a large text file
> (specifically: extract, sorting, and regularizing the “keyword” fields
> of a large BibTex file). Especially since I don’t really know what I’m
> doing, working in a Playground has been a great development
> environment.  Now that the program is complete (under 30 lines,
> wonderful), I want to be able to save it for future reference (and
> perhaps for future use).  If I’d written a shell script, I’d just save
> “fixBibDeskKeyWords.sh” to a directory. I’m not sure what to do in the
> Pharo environment, thought.
>
> At the moment, it just lives in the Playground I’ve developed it on.
>  I could save the image and leave that Playground open, but I’m just
> positive that’s not a best practice. I also worry about what happens
> if I closed/cleared that Playground by accident.
>
> I think I understand that, if I created a new package, I could use
> Monticello to save it to a local cache and load it into a new image
> whenever I needed it.  But, given that it’s short, highly specialized
> and fairly linear, the idea of creating a “GHBibDeskStuff” package
> with one class (“GBibDeskKeywordFixer” containing a single “FixFile”
> method seems really heavy and awkward.
>
> Can one save the contents of a Playground in a Pharonic way?  Is there
> a better approach?
>
> Thank you to all involved in this wonderful programming ecosystem. I
> appreciate any advice.
>
> Glenn
>
> Glenn Hoetker
> ghoet...@me.com 
> http://hoetker.faculty.asu.edu
>
>
>



Re: [Pharo-users] About how to benchmark the lookup speed...

2017-06-14 Thread werner kassens

On 06/14/2017 09:12 PM, Steven Costiou wrote:
repetitions timesRepeat:[ results add: [100 timesRepeat:[o m]] 
timeToRun].


Hi Steven,

the influence of the garbage collector is in cases like these often 
somewhat difficult to forecast. i would eventually change the code to:


repetitions timesRepeat:[ Smalltalk garbageCollect. results add: 
[100 timesRepeat:[o m]] timeToRun].


and if i wanted to see the influence of the garbage collector i would 
enlarge repetitions and diminish 100 in such a way that the product 
remains constant. of course one would not want to destroy that influence 
completely as in the real world it always takes its toll.

werner



Re: [Pharo-users] About how to benchmark the lookup speed...

2017-06-14 Thread Steven Costiou
Thanks Peter :) 

I will make these computations tomorrow at the lab and see what the
confidence interval looks like. 

Steven. 

Le 2017-06-14 20:03, PBKResearch a écrit :

> Steven 
> 
> The question you need to consider is how much the results vary from one 
> repetition to another. If they are very variable, then the average will still 
> be variable. In the case of your 100 repetitions, for instance, you can work 
> out a confidence interval for the mean quite easily. Find the mean and 
> standard deviation of the 100 repetitions; the standard error of the mean is 
> the sample standard deviation divided by the square root of the number of 
> values averaged (i.e. 10 in this case); the approximate 95% confidence 
> interval is the mean +/- twice the standard error of the mean. (This makes a 
> lot of simplifying assumptions, but should be sufficient for your purposes.) 
> 
> If, as I suspect, the width of the confidence interval is quite large in 
> relation to the mean, this means that you cannot consistently measure the 
> speed of operations like this. You could try greatly increasing the number of 
> repetitions, but the square root law is working against you. 10,000 
> repetitions would give you an interval about 10% of the width of 100 
> repetitions, 1,000,000 repetitions would reduce it to 1%. 
> 
> Hope this is helpful 
> 
> Peter Kenny 
> 
> FROM: Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] ON BEHALF OF 
> Steven Costiou
> SENT: 14 June 2017 18:14
> TO: Pharo users users 
> SUBJECT: [Pharo-users] About how to benchmark the lookup speed... 
> 
> Hi, 
> 
> i'm having trouble doing benchmarks in Pharo, at least i don't understand the 
> results (maybe i'm missing something). I want to compare anonymous subclasses 
> lookup speed with standard pharo classes lookup speed. 
> 
> I have a method m and a method m2 that execute the following code: ^ 100 
> printString. I have implemented these 2 methods in one class then in one 
> anonymous subclass. I thought that measuring the execution speed of the same 
> code in these two different cases would give me different times if the lookup 
> speed was not the same. 
> 
> So I did the following: 
> 
> |o results repetitions | 
> 
> o := theClass new. 
> 
> results := OrderedCollection new. 
> 
> repetitions := 100. 
> 
> repetitions timesRepeat:[ results add: [100 timesRepeat:[o m]] 
> timeToRun]. 
> 
> I do the same for m2, and then i compute an average of all the values 
> measured in results. 
> 
> What i don't understand is that, for example, for an average on 100 
> measurements, m is 1% slower and m2 is 2% faster in the Pharo class case than 
> with anonymous subclasses. But for 1 000 measurements, m is 11% faster but m2 
> is 3% slower. Results continue to vary as i change the number of 
> measurements, but they do not increase with it (seems not to be linear). 
> 
> I don't have enough knowledge about how to benchmark code, or what will make 
> a difference in Pharo. For now the only explanations i have is that maybe the 
> results are too slow to be significant and then they can vary, or i have done 
> something wrong in how i measure it. 
> 
> How would you measure the lookup speed of a method ? 
> 
> Steven.
 

Re: [Pharo-users] About how to benchmark the lookup speed...

2017-06-14 Thread PBKResearch
Steven

 

The question you need to consider is how much the results vary from one 
repetition to another. If they are very variable, then the average will still 
be variable. In the case of your 100 repetitions, for instance, you can work 
out a confidence interval for the mean quite easily. Find the mean and standard 
deviation of the 100 repetitions; the standard error of the mean is the sample 
standard deviation divided by the square root of the number of values averaged 
(i.e. 10 in this case); the approximate 95% confidence interval is the mean +/- 
twice the standard error of the mean. (This makes a lot of simplifying 
assumptions, but should be sufficient for your purposes.)

 

If, as I suspect, the width of the confidence interval is quite large in 
relation to the mean, this means that you cannot consistently measure the speed 
of operations like this. You could try greatly increasing the number of 
repetitions, but the square root law is working against you. 10,000 repetitions 
would give you an interval about 10% of the width of 100 repetitions, 1,000,000 
repetitions would reduce it to 1%.

 

Hope this is helpful

 

Peter Kenny

 

From: Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] On Behalf Of 
Steven Costiou
Sent: 14 June 2017 18:14
To: Pharo users users 
Subject: [Pharo-users] About how to benchmark the lookup speed...

 

Hi,

i'm having trouble doing benchmarks in Pharo, at least i don't understand the 
results (maybe i'm missing something). I want to compare anonymous subclasses 
lookup speed with standard pharo classes lookup speed.

I have a method m and a method m2 that execute the following code: ^ 100 
printString. I have implemented these 2 methods in one class then in one 
anonymous subclass. I thought that measuring the execution speed of the same 
code in these two different cases would give me different times if the lookup 
speed was not the same.

So I did the following:

|o results repetitions |

o := theClass new.

results := OrderedCollection new.

repetitions := 100.

repetitions timesRepeat:[ results add: [100 timesRepeat:[o m]] timeToRun].

I do the same for m2, and then i compute an average of all the values measured 
in results.

What i don't understand is that, for example, for an average on 100 
measurements, m is 1% slower and m2 is 2% faster in the Pharo class case than 
with anonymous subclasses. But for 1 000 measurements, m is 11% faster but m2 
is 3% slower. Results continue to vary as i change the number of measurements, 
but they do not increase with it (seems not to be linear).

 

I don't have enough knowledge about how to benchmark code, or what will make a 
difference in Pharo. For now the only explanations i have is that maybe the 
results are too slow to be significant and then they can vary, or i have done 
something wrong in how i measure it.

 

How would you measure the lookup speed of a method ?

 

Steven.



[Pharo-users] About how to benchmark the lookup speed...

2017-06-14 Thread Steven Costiou
Hi, 

i'm having trouble doing benchmarks in Pharo, at least i don't
understand the results (maybe i'm missing something). I want to compare
anonymous subclasses lookup speed with standard pharo classes lookup
speed. 

I have a method m and a method m2 that execute the following code: ^
100 printString. I have implemented these 2 methods in one class then in
one anonymous subclass. I thought that measuring the execution speed of
the same code in these two different cases would give me different times
if the lookup speed was not the same. 

So I did the following: 

|o results repetitions | 

o := theClass new. 

results := OrderedCollection new. 

repetitions := 100. 

repetitions timesRepeat:[ results add: [100 timesRepeat:[o m]]
timeToRun]. 

I do the same for m2, and then i compute an average of all the values
measured in results. 

What i don't understand is that, for example, for an average on 100
measurements, m is 1% slower and m2 is 2% faster in the Pharo class case
than with anonymous subclasses. But for 1 000 measurements, m is 11%
faster but m2 is 3% slower. Results continue to vary as i change the
number of measurements, but they do not increase with it (seems not to
be linear). 

I don't have enough knowledge about how to benchmark code, or what will
make a difference in Pharo. For now the only explanations i have is that
maybe the results are too slow to be significant and then they can vary,
or i have done something wrong in how i measure it. 

How would you measure the lookup speed of a method ? 

Steven. 

Re: [Pharo-users] Zink geo location data reading

2017-06-14 Thread Sven Van Caekenberghe
Hi,

> On 14 Jun 2017, at 17:23, bachitoph  wrote:
> 
> Hi,
> I'm playing around with Zink reading the geo location of any IP-address.
> Evaluating the code below in a playground works fine. But what is the best
> way to read the entity data of the ZnResponse instance I get back. Have I to
> parse it, with an self written parser, or is there anything available.
> 
> |client znResponse location|
> client := ZnClient new.
> client host: 'www.geoplugin.net'.
> client addPathSegment: 'php.gp'.
> client queryAt: 'ip' put: '188.194.228.195'.
> znResponse := client get; response.
> 
> The code should anyhow look like this.
> AnyParser parse: (ReadStream on: znResponse contents).
> 
> In PHP the example code is at http://www.geoplugin.com/webservices/php
> var_export(unserialize(file_get_contents('http://www.geoplugin.net/php.gp?ip=188.194.228.195])));
> I'm searching for the unserialize of the php, which delivers an array with
> key value pairs.

The result looks to be PHP's own serialisation format as described here:

http://php.net/manual/en/function.serialize.php 

See the first comment which describes the format a bit.

I don't know if anyone ever implemented a parser for that. You will most 
probably have to write it yourself.

However, the service you are using can also return its results in JSON, which 
we can parse out of the box.

|client znResponse location|
client := ZnClient new.
client host: 'www.geoplugin.net'.
client addPathSegment: 'json.gp'.
client queryAt: 'ip' put: '188.194.228.195'.
client contentReader: [ :entity | STONJSON fromString: entity contents ].
znResponse := client get; contents.

HTH,

Sven

PS: it is Zinc not Zink ;-)

> The response entity contents looks somehow like the bottom string without
> the newlines.
> 'a:18:{
> s:17:"geoplugin_request";s:15:"188.194.228.195";
> s:16:"geoplugin_status";i:200;
> s:16:"geoplugin_credit";s:145:"Some of the returned data includes GeoLite
> data created by MaxMind, available from  http://www.maxmind.com
> <\'http://www.maxmind.com\'>  .";
> s:14:"geoplugin_city";s:6:"Passau";
> s:16:"geoplugin_region";s:7:"Bavaria";
> s:18:"geoplugin_areaCode";s:1:"0";
> s:17:"geoplugin_dmaCode";s:1:"0";
> s:21:"geoplugin_countryCode";s:2:"DE";
> s:21:"geoplugin_countryName";s:7:"Germany";
> s:23:"geoplugin_continentCode";s:2:"EU";
> s:18:"geoplugin_latitude";s:7:"48.5833";
> s:19:"geoplugin_longitude";s:7:"13.4833";
> s:20:"geoplugin_regionCode";s:2:"02";
> s:20:"geoplugin_regionName";s:7:"Bavaria";
> s:22:"geoplugin_currencyCode";s:3:"EUR";
> s:24:"geoplugin_currencySymbol";s:7:"";
> s:29:"geoplugin_currencySymbol_UTF8";s:3:"€";
> s:27:"geoplugin_currencyConverter";s:6:"0.9348";}'
> 
> Thanks for any help
> cjb
> 
> 
> 
> 
> 
> --
> View this message in context: 
> http://forum.world.st/Zink-geo-location-data-reading-tp4951446.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
> 




Re: [Pharo-users] I want to get in contact with raphael luque from madrid :)

2017-06-14 Thread Offray Vladimir Luna Cárdenas
Yep. I meet him recently. I'll put try you in contact.

Cheers,

Offray


On 14/06/17 07:11, Stephane Ducasse wrote:
> Hi guys.
>
> I tried to get in contact with raphael but my emails do not seem to go
> to destination.
> Do you have the email of raph/fael luque from madrid?
>
> Stef
>
>




Re: [Pharo-users] Porting Transducers to Pharo

2017-06-14 Thread Damien Pollet
On 14 June 2017 at 17:21, Steffen Märcker  wrote:

> I played a bit with Iceberg in Pharo, managed to check out the repository,
> and load Transducers-Core. As a bit of a surprise, multiple packages show
> up in the SystemBrowser; one for each method category, e.g.,
> Transducers-accessing and Transducers-class initialization. Is this
> expected? Maybe I am just missing something obvious here since I am not
> familiar with the tools.
>

Looks like a bug… not sure if I've seen this one being discussed recently
or if it's a new one, though.


> Did you rename the main package from Transducers to Transducers-Core for a
> special reason? And is it a convention in Pharo to use the dash '-' instead
> of space to separate parts of a package name?
>

Yes, that's the Pharo naming convention.


[Pharo-users] Zink geo location data reading

2017-06-14 Thread bachitoph
Hi,
I'm playing around with Zink reading the geo location of any IP-address.
Evaluating the code below in a playground works fine. But what is the best
way to read the entity data of the ZnResponse instance I get back. Have I to
parse it, with an self written parser, or is there anything available.

|client znResponse location|
client := ZnClient new.
client host: 'www.geoplugin.net'.
client addPathSegment: 'php.gp'.
client queryAt: 'ip' put: '188.194.228.195'.
znResponse := client get; response.

The code should anyhow look like this.
AnyParser parse: (ReadStream on: znResponse contents).

In PHP the example code is at http://www.geoplugin.com/webservices/php
var_export(unserialize(file_get_contents('http://www.geoplugin.net/php.gp?ip=188.194.228.195])));
I'm searching for the unserialize of the php, which delivers an array with
key value pairs.


The response entity contents looks somehow like the bottom string without
the newlines.
'a:18:{
s:17:"geoplugin_request";s:15:"188.194.228.195";
s:16:"geoplugin_status";i:200;
s:16:"geoplugin_credit";s:145:"Some of the returned data includes GeoLite
data created by MaxMind, available from  http://www.maxmind.com
<\'http://www.maxmind.com\'>  .";
s:14:"geoplugin_city";s:6:"Passau";
s:16:"geoplugin_region";s:7:"Bavaria";
s:18:"geoplugin_areaCode";s:1:"0";
s:17:"geoplugin_dmaCode";s:1:"0";
s:21:"geoplugin_countryCode";s:2:"DE";
s:21:"geoplugin_countryName";s:7:"Germany";
s:23:"geoplugin_continentCode";s:2:"EU";
s:18:"geoplugin_latitude";s:7:"48.5833";
s:19:"geoplugin_longitude";s:7:"13.4833";
s:20:"geoplugin_regionCode";s:2:"02";
s:20:"geoplugin_regionName";s:7:"Bavaria";
s:22:"geoplugin_currencyCode";s:3:"EUR";
s:24:"geoplugin_currencySymbol";s:7:"";
s:29:"geoplugin_currencySymbol_UTF8";s:3:"€";
s:27:"geoplugin_currencyConverter";s:6:"0.9348";}'

Thanks for any help
cjb





--
View this message in context: 
http://forum.world.st/Zink-geo-location-data-reading-tp4951446.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.



Re: [Pharo-users] Porting Transducers to Pharo

2017-06-14 Thread Steffen Märcker

Hi Phil,


Tell me how it goes for you.


I played a bit with Iceberg in Pharo, managed to check out the repository,  
and load Transducers-Core. As a bit of a surprise, multiple packages show  
up in the SystemBrowser; one for each method category, e.g.,  
Transducers-accessing and Transducers-class initialization. Is this  
expected? Maybe I am just missing something obvious here since I am not  
familiar with the tools.


However, I think Iceberg will facilitate a nice way exchange code between  
VW an Pharo. I managed to export the packages using STIG from VW and the  
differences seem to be sufficiently small.



I've put a README. md with your notes, and under packages/ you'll find 3
packages:

Transducers-Core
Transducers-Examples
Transducers-Tests


Did you rename the main package from Transducers to Transducers-Core for a  
special reason? And is it a convention in Pharo to use the dash '-'  
instead of space to separate parts of a package name?


Cheers!
Steffen



Re: [Pharo-users] STON Question

2017-06-14 Thread Guillermo Polito
That's what we call a DTO

On Wed, Jun 14, 2017 at 3:01 PM, Christophe Demarey <
christophe.dema...@inria.fr> wrote:

> +1
> It is exactly what i've done with Cargo. Define your own specific object
> for serialization / deserialization. It is the simplest way to have a human
> readable conf file (e.g. urls, pathes default serialization is not what you
> expect)
>
> Christophe
> - Sven Van Caekenberghe  a écrit :
> > STON cannot be used to write partial, manual output because it needs to
> see the full object graph (like FUEL does).
> >
> > If I would want to use STON for prettier looking config files, I would
> make an object just for that external representation, converting it where
> necessary to better internal objects (like from String to FileReference).
> >
> > > On 5 Jun 2017, at 08:58, Stephane Ducasse 
> wrote:
> > >
> > > Sven I know what Ston is :)
> > >
> > > Now Pillar dev used Ston as input and it works. Then with some hooks
> they let the user convert the strings
> > > into specific objects and this is ok.
> > > Now I want to add export in Ston and for configurations I need to
> control for the application and not as a ston object the value saved.
> > > For example a file reference should not be just a file reference in
> Ston but
> > > a string relative the the baseDirectory of the configuration.
> > >
> > > So I thought that I can build a hook and control the call to Ston
> (convert the object before to the correct values) and export.
> > > It should be working now doing this I found myself redoing the output
> of Ston.
> > > So I will do it. Then I thought that may be I could reuse this logic.
> > >
> > > Stef
> > >
> > >
> > >
> > > On Sun, Jun 4, 2017 at 11:49 PM, Sven Van Caekenberghe 
> wrote:
> > > Stef,
> > >
> > > STON is like FUEL, it can write any object to a stream and read it
> back. Although you can customise how this is done, only one way of doing so
> is supported (i.e. you cannot change the format for each application).
> > >
> > > People have used STON for various applications now, including for
> configuration stuff (because it is a textual format that is easy to read).
> > >
> > > I would suggest you just try to see what your config looks like once
> you have the objects in Pharo.
> > >
> > >   STON toStringPretty: myConfig.
> > >
> > > Then we can see how to tune the representation.
> > >
> > > Sven
> > >
> > > > On 4 Jun 2017, at 22:58, Stephane Ducasse 
> wrote:
> > > >
> > > > Hi sven
> > > >
> > > > I'm working on a new configuration frameworks similar to the one use
> pillar.conf.
> > > >
> > > > So basically I have
> > > >
> > > > ston := '{
> > > >"newLine":#unix,
> > > >   "separateOutputFiles":true
> > > >   }'.
> > > > and I want to recreate it.
> > > >
> > > > So I did
> > > >
> > > > Object >> toConfigurationString
> > > >
> > > >   ^ STON toString: self
> > > >
> > > > SimpleConfiguration >> exportStream
> > > >
> > > >   ^ String streamContents: [ :str |
> > > >   str << '{' .
> > > >   self propertiesKeysAndValuesDo: [ :key :value|
> > > >   str << key toConfigurationString.
> > > >   str << ':'.
> > > >   str << value toConfigurationString.
> > > >   str << ','.
> > > >   str lf.
> > > >   ].
> > > >   str << '}'.
> > > >   str contents
> > > >   ]
> > > >
> > > > The idea is that for special configuration values people should be
> able to define
> > > > how to go from the object to configuration.
> > > > For example for some FileReference I want to have just the path up
> to the baseDirectory.
> > > >
> > > > Now I wonder if I could not better reuse ston.
> > > > I saw the stonOn:
> > > > but I did not look further because I was wondering how the writer
> where passed.
> > > >
> > > > Any feedback is welcome.
> > > >
> > > > Stef (now bed time).
> > > >
> > >
> > >
> > >
> >
> >
>
>
>


-- 



Guille Polito


Research Engineer

French National Center for Scientific Research - *http://www.cnrs.fr*




*Web:* *http://guillep.github.io* 

*Phone: *+33 06 52 70 66 13


Re: [Pharo-users] STON Question

2017-06-14 Thread Guillermo Polito
that's what is called a DTO

Le 14 juin 2017 15:27, "Sven Van Caekenberghe"  a écrit :

>
> > On 14 Jun 2017, at 15:01, Christophe Demarey <
> christophe.dema...@inria.fr> wrote:
> >
> > +1
> > It is exactly what i've done with Cargo. Define your own specific object
> for serialization / deserialization. It is the simplest way to have a human
> readable conf file (e.g. urls, pathes default serialization is not what you
> expect)
>
> Maybe Steph can have a look at your approach.
>
> > Christophe
> > - Sven Van Caekenberghe  a écrit :
> >> STON cannot be used to write partial, manual output because it needs to
> see the full object graph (like FUEL does).
> >>
> >> If I would want to use STON for prettier looking config files, I would
> make an object just for that external representation, converting it where
> necessary to better internal objects (like from String to FileReference).
> >>
> >>> On 5 Jun 2017, at 08:58, Stephane Ducasse 
> wrote:
> >>>
> >>> Sven I know what Ston is :)
> >>>
> >>> Now Pillar dev used Ston as input and it works. Then with some hooks
> they let the user convert the strings
> >>> into specific objects and this is ok.
> >>> Now I want to add export in Ston and for configurations I need to
> control for the application and not as a ston object the value saved.
> >>> For example a file reference should not be just a file reference in
> Ston but
> >>> a string relative the the baseDirectory of the configuration.
> >>>
> >>> So I thought that I can build a hook and control the call to Ston
> (convert the object before to the correct values) and export.
> >>> It should be working now doing this I found myself redoing the output
> of Ston.
> >>> So I will do it. Then I thought that may be I could reuse this logic.
> >>>
> >>> Stef
> >>>
> >>>
> >>>
> >>> On Sun, Jun 4, 2017 at 11:49 PM, Sven Van Caekenberghe 
> wrote:
> >>> Stef,
> >>>
> >>> STON is like FUEL, it can write any object to a stream and read it
> back. Although you can customise how this is done, only one way of doing so
> is supported (i.e. you cannot change the format for each application).
> >>>
> >>> People have used STON for various applications now, including for
> configuration stuff (because it is a textual format that is easy to read).
> >>>
> >>> I would suggest you just try to see what your config looks like once
> you have the objects in Pharo.
> >>>
> >>>  STON toStringPretty: myConfig.
> >>>
> >>> Then we can see how to tune the representation.
> >>>
> >>> Sven
> >>>
>  On 4 Jun 2017, at 22:58, Stephane Ducasse 
> wrote:
> 
>  Hi sven
> 
>  I'm working on a new configuration frameworks similar to the one use
> pillar.conf.
> 
>  So basically I have
> 
>  ston := '{
>    "newLine":#unix,
>   "separateOutputFiles":true
>   }'.
>  and I want to recreate it.
> 
>  So I did
> 
>  Object >> toConfigurationString
> 
>   ^ STON toString: self
> 
>  SimpleConfiguration >> exportStream
> 
>   ^ String streamContents: [ :str |
>   str << '{' .
>   self propertiesKeysAndValuesDo: [ :key :value|
>   str << key toConfigurationString.
>   str << ':'.
>   str << value toConfigurationString.
>   str << ','.
>   str lf.
>   ].
>   str << '}'.
>   str contents
>   ]
> 
>  The idea is that for special configuration values people should be
> able to define
>  how to go from the object to configuration.
>  For example for some FileReference I want to have just the path up to
> the baseDirectory.
> 
>  Now I wonder if I could not better reuse ston.
>  I saw the stonOn:
>  but I did not look further because I was wondering how the writer
> where passed.
> 
>  Any feedback is welcome.
> 
>  Stef (now bed time).
> 
> >>>
> >>>
> >>>
> >>
> >>
> >
> >
>
>
>


Re: [Pharo-users] STON Question

2017-06-14 Thread Sven Van Caekenberghe

> On 14 Jun 2017, at 15:01, Christophe Demarey  
> wrote:
> 
> +1
> It is exactly what i've done with Cargo. Define your own specific object for 
> serialization / deserialization. It is the simplest way to have a human 
> readable conf file (e.g. urls, pathes default serialization is not what you 
> expect)

Maybe Steph can have a look at your approach.

> Christophe
> - Sven Van Caekenberghe  a écrit :
>> STON cannot be used to write partial, manual output because it needs to see 
>> the full object graph (like FUEL does).
>> 
>> If I would want to use STON for prettier looking config files, I would make 
>> an object just for that external representation, converting it where 
>> necessary to better internal objects (like from String to FileReference).
>> 
>>> On 5 Jun 2017, at 08:58, Stephane Ducasse  wrote:
>>> 
>>> Sven I know what Ston is :) 
>>> 
>>> Now Pillar dev used Ston as input and it works. Then with some hooks they 
>>> let the user convert the strings
>>> into specific objects and this is ok. 
>>> Now I want to add export in Ston and for configurations I need to control 
>>> for the application and not as a ston object the value saved.
>>> For example a file reference should not be just a file reference in Ston 
>>> but 
>>> a string relative the the baseDirectory of the configuration. 
>>> 
>>> So I thought that I can build a hook and control the call to Ston (convert 
>>> the object before to the correct values) and export. 
>>> It should be working now doing this I found myself redoing the output of 
>>> Ston. 
>>> So I will do it. Then I thought that may be I could reuse this logic. 
>>> 
>>> Stef
>>> 
>>> 
>>> 
>>> On Sun, Jun 4, 2017 at 11:49 PM, Sven Van Caekenberghe  wrote:
>>> Stef,
>>> 
>>> STON is like FUEL, it can write any object to a stream and read it back. 
>>> Although you can customise how this is done, only one way of doing so is 
>>> supported (i.e. you cannot change the format for each application).
>>> 
>>> People have used STON for various applications now, including for 
>>> configuration stuff (because it is a textual format that is easy to read).
>>> 
>>> I would suggest you just try to see what your config looks like once you 
>>> have the objects in Pharo.
>>> 
>>>  STON toStringPretty: myConfig.
>>> 
>>> Then we can see how to tune the representation.
>>> 
>>> Sven
>>> 
 On 4 Jun 2017, at 22:58, Stephane Ducasse  wrote:
 
 Hi sven
 
 I'm working on a new configuration frameworks similar to the one use 
 pillar.conf.
 
 So basically I have
 
 ston := '{
   "newLine":#unix,
  "separateOutputFiles":true
  }'.
 and I want to recreate it.
 
 So I did
 
 Object >> toConfigurationString
 
  ^ STON toString: self
 
 SimpleConfiguration >> exportStream
 
  ^ String streamContents: [ :str |
  str << '{' .
  self propertiesKeysAndValuesDo: [ :key :value|
  str << key toConfigurationString.
  str << ':'.
  str << value toConfigurationString.
  str << ','.
  str lf.
  ].
  str << '}'.
  str contents
  ]
 
 The idea is that for special configuration values people should be able to 
 define
 how to go from the object to configuration.
 For example for some FileReference I want to have just the path up to the 
 baseDirectory.
 
 Now I wonder if I could not better reuse ston.
 I saw the stonOn:
 but I did not look further because I was wondering how the writer where 
 passed.
 
 Any feedback is welcome.
 
 Stef (now bed time).
 
>>> 
>>> 
>>> 
>> 
>> 
> 
> 




[Pharo-users] Re : Re: STON Question

2017-06-14 Thread Christophe Demarey
+1
It is exactly what i've done with Cargo. Define your own specific object for 
serialization / deserialization. It is the simplest way to have a human 
readable conf file (e.g. urls, pathes default serialization is not what you 
expect)

Christophe
- Sven Van Caekenberghe  a écrit :
> STON cannot be used to write partial, manual output because it needs to see 
> the full object graph (like FUEL does).
> 
> If I would want to use STON for prettier looking config files, I would make 
> an object just for that external representation, converting it where 
> necessary to better internal objects (like from String to FileReference).
> 
> > On 5 Jun 2017, at 08:58, Stephane Ducasse  wrote:
> > 
> > Sven I know what Ston is :) 
> > 
> > Now Pillar dev used Ston as input and it works. Then with some hooks they 
> > let the user convert the strings
> > into specific objects and this is ok. 
> > Now I want to add export in Ston and for configurations I need to control 
> > for the application and not as a ston object the value saved.
> > For example a file reference should not be just a file reference in Ston 
> > but 
> > a string relative the the baseDirectory of the configuration. 
> > 
> > So I thought that I can build a hook and control the call to Ston (convert 
> > the object before to the correct values) and export. 
> > It should be working now doing this I found myself redoing the output of 
> > Ston. 
> > So I will do it. Then I thought that may be I could reuse this logic. 
> > 
> > Stef
> > 
> > 
> > 
> > On Sun, Jun 4, 2017 at 11:49 PM, Sven Van Caekenberghe  wrote:
> > Stef,
> > 
> > STON is like FUEL, it can write any object to a stream and read it back. 
> > Although you can customise how this is done, only one way of doing so is 
> > supported (i.e. you cannot change the format for each application).
> > 
> > People have used STON for various applications now, including for 
> > configuration stuff (because it is a textual format that is easy to read).
> > 
> > I would suggest you just try to see what your config looks like once you 
> > have the objects in Pharo.
> > 
> >   STON toStringPretty: myConfig.
> > 
> > Then we can see how to tune the representation.
> > 
> > Sven
> > 
> > > On 4 Jun 2017, at 22:58, Stephane Ducasse  wrote:
> > >
> > > Hi sven
> > >
> > > I'm working on a new configuration frameworks similar to the one use 
> > > pillar.conf.
> > >
> > > So basically I have
> > >
> > > ston := '{
> > >"newLine":#unix,
> > >   "separateOutputFiles":true
> > >   }'.
> > > and I want to recreate it.
> > >
> > > So I did
> > >
> > > Object >> toConfigurationString
> > >
> > >   ^ STON toString: self
> > >
> > > SimpleConfiguration >> exportStream
> > >
> > >   ^ String streamContents: [ :str |
> > >   str << '{' .
> > >   self propertiesKeysAndValuesDo: [ :key :value|
> > >   str << key toConfigurationString.
> > >   str << ':'.
> > >   str << value toConfigurationString.
> > >   str << ','.
> > >   str lf.
> > >   ].
> > >   str << '}'.
> > >   str contents
> > >   ]
> > >
> > > The idea is that for special configuration values people should be able 
> > > to define
> > > how to go from the object to configuration.
> > > For example for some FileReference I want to have just the path up to the 
> > > baseDirectory.
> > >
> > > Now I wonder if I could not better reuse ston.
> > > I saw the stonOn:
> > > but I did not look further because I was wondering how the writer where 
> > > passed.
> > >
> > > Any feedback is welcome.
> > >
> > > Stef (now bed time).
> > >
> > 
> > 
> > 
> 
> 




[Pharo-users] [ARTICLE] Quick write me a Redis client

2017-06-14 Thread Sven Van Caekenberghe
Hi,

I wrote another article in the 'Concerning Pharo' publication:

[TITLE] Quick write me a Redis client
[SUBTITLE] A beautiful protocol makes implementation easy
[URL] 
https://medium.com/concerning-pharo/quick-write-me-a-redis-client-5fbe4ddfb13d
[SOURCECODE] https://github.com/svenvc/SimpleRedisClient

Sven


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







Re: [Pharo-users] STON Question

2017-06-14 Thread Stephane Ducasse
Thanks Sven.
I'm checking the STONWriter path with some tricks.

On Wed, Jun 14, 2017 at 11:06 AM, Sven Van Caekenberghe  wrote:
> STON cannot be used to write partial, manual output because it needs to see 
> the full object graph (like FUEL does).
>
> If I would want to use STON for prettier looking config files, I would make 
> an object just for that external representation, converting it where 
> necessary to better internal objects (like from String to FileReference).
>
>> On 5 Jun 2017, at 08:58, Stephane Ducasse  wrote:
>>
>> Sven I know what Ston is :)
>>
>> Now Pillar dev used Ston as input and it works. Then with some hooks they 
>> let the user convert the strings
>> into specific objects and this is ok.
>> Now I want to add export in Ston and for configurations I need to control 
>> for the application and not as a ston object the value saved.
>> For example a file reference should not be just a file reference in Ston but
>> a string relative the the baseDirectory of the configuration.
>>
>> So I thought that I can build a hook and control the call to Ston (convert 
>> the object before to the correct values) and export.
>> It should be working now doing this I found myself redoing the output of 
>> Ston.
>> So I will do it. Then I thought that may be I could reuse this logic.
>>
>> Stef
>>
>>
>>
>> On Sun, Jun 4, 2017 at 11:49 PM, Sven Van Caekenberghe  wrote:
>> Stef,
>>
>> STON is like FUEL, it can write any object to a stream and read it back. 
>> Although you can customise how this is done, only one way of doing so is 
>> supported (i.e. you cannot change the format for each application).
>>
>> People have used STON for various applications now, including for 
>> configuration stuff (because it is a textual format that is easy to read).
>>
>> I would suggest you just try to see what your config looks like once you 
>> have the objects in Pharo.
>>
>>   STON toStringPretty: myConfig.
>>
>> Then we can see how to tune the representation.
>>
>> Sven
>>
>> > On 4 Jun 2017, at 22:58, Stephane Ducasse  wrote:
>> >
>> > Hi sven
>> >
>> > I'm working on a new configuration frameworks similar to the one use 
>> > pillar.conf.
>> >
>> > So basically I have
>> >
>> > ston := '{
>> >"newLine":#unix,
>> >   "separateOutputFiles":true
>> >   }'.
>> > and I want to recreate it.
>> >
>> > So I did
>> >
>> > Object >> toConfigurationString
>> >
>> >   ^ STON toString: self
>> >
>> > SimpleConfiguration >> exportStream
>> >
>> >   ^ String streamContents: [ :str |
>> >   str << '{' .
>> >   self propertiesKeysAndValuesDo: [ :key :value|
>> >   str << key toConfigurationString.
>> >   str << ':'.
>> >   str << value toConfigurationString.
>> >   str << ','.
>> >   str lf.
>> >   ].
>> >   str << '}'.
>> >   str contents
>> >   ]
>> >
>> > The idea is that for special configuration values people should be able to 
>> > define
>> > how to go from the object to configuration.
>> > For example for some FileReference I want to have just the path up to the 
>> > baseDirectory.
>> >
>> > Now I wonder if I could not better reuse ston.
>> > I saw the stonOn:
>> > but I did not look further because I was wondering how the writer where 
>> > passed.
>> >
>> > Any feedback is welcome.
>> >
>> > Stef (now bed time).
>> >
>>
>>
>>
>
>



[Pharo-users] I want to get in contact with raphael luque from madrid :)

2017-06-14 Thread Stephane Ducasse
Hi guys.

I tried to get in contact with raphael but my emails do not seem to go
to destination.
Do you have the email of raph/fael luque from madrid?

Stef



[Pharo-users] vested interest in PharoJS?

2017-06-14 Thread Siemen Baader
Hi all,

Is anyone else interested in PharoJS and making it mature for their own
commercial mobile and single page web app (and node.js) development?

I think it has a huge potential because it brings the browser runtime and
many libraries and online services from the JS world to us Smalltalkers
while letting us keep our agile development and good CS practices. But it
does not yet have the necessary features and documentation to work smoothly.

-- Siemen


Re: [Pharo-users] STON Question

2017-06-14 Thread Sven Van Caekenberghe
STON cannot be used to write partial, manual output because it needs to see the 
full object graph (like FUEL does).

If I would want to use STON for prettier looking config files, I would make an 
object just for that external representation, converting it where necessary to 
better internal objects (like from String to FileReference).

> On 5 Jun 2017, at 08:58, Stephane Ducasse  wrote:
> 
> Sven I know what Ston is :) 
> 
> Now Pillar dev used Ston as input and it works. Then with some hooks they let 
> the user convert the strings
> into specific objects and this is ok. 
> Now I want to add export in Ston and for configurations I need to control for 
> the application and not as a ston object the value saved.
> For example a file reference should not be just a file reference in Ston but 
> a string relative the the baseDirectory of the configuration. 
> 
> So I thought that I can build a hook and control the call to Ston (convert 
> the object before to the correct values) and export. 
> It should be working now doing this I found myself redoing the output of 
> Ston. 
> So I will do it. Then I thought that may be I could reuse this logic. 
> 
> Stef
> 
> 
> 
> On Sun, Jun 4, 2017 at 11:49 PM, Sven Van Caekenberghe  wrote:
> Stef,
> 
> STON is like FUEL, it can write any object to a stream and read it back. 
> Although you can customise how this is done, only one way of doing so is 
> supported (i.e. you cannot change the format for each application).
> 
> People have used STON for various applications now, including for 
> configuration stuff (because it is a textual format that is easy to read).
> 
> I would suggest you just try to see what your config looks like once you have 
> the objects in Pharo.
> 
>   STON toStringPretty: myConfig.
> 
> Then we can see how to tune the representation.
> 
> Sven
> 
> > On 4 Jun 2017, at 22:58, Stephane Ducasse  wrote:
> >
> > Hi sven
> >
> > I'm working on a new configuration frameworks similar to the one use 
> > pillar.conf.
> >
> > So basically I have
> >
> > ston := '{
> >"newLine":#unix,
> >   "separateOutputFiles":true
> >   }'.
> > and I want to recreate it.
> >
> > So I did
> >
> > Object >> toConfigurationString
> >
> >   ^ STON toString: self
> >
> > SimpleConfiguration >> exportStream
> >
> >   ^ String streamContents: [ :str |
> >   str << '{' .
> >   self propertiesKeysAndValuesDo: [ :key :value|
> >   str << key toConfigurationString.
> >   str << ':'.
> >   str << value toConfigurationString.
> >   str << ','.
> >   str lf.
> >   ].
> >   str << '}'.
> >   str contents
> >   ]
> >
> > The idea is that for special configuration values people should be able to 
> > define
> > how to go from the object to configuration.
> > For example for some FileReference I want to have just the path up to the 
> > baseDirectory.
> >
> > Now I wonder if I could not better reuse ston.
> > I saw the stonOn:
> > but I did not look further because I was wondering how the writer where 
> > passed.
> >
> > Any feedback is welcome.
> >
> > Stef (now bed time).
> >
> 
> 
>