Re: [Pharo-users] Create png from pdf

2017-01-18 Thread Stephane Ducasse
Ah you want to convert pdf to png I thought graphics to png.
PDF to png means that we would need a pdf renderer and this is not an easy
task.

On Mon, Jan 16, 2017 at 10:26 AM, Sabine Manaa 
wrote:

> Hi,
>
> currently, I create pdfs with Artefact and it works fine.
> For displaying previews of the pdf reports, I use  Apache PDFBox to
> generate
> pngs from the pdfs.
> This works, too.
>
> But I would prefer to generate the pngs directly from pharo and do not call
> external libraries.
>
> Stephane told me that "there is a form in a morph and it can be converted
> in
> png".
>
> Can anyone give me a small entry point or has done similar and provide some
> code snippet?
>
> Regards
> Sabine
>
>
>
>
>
> --
> View this message in context: http://forum.world.st/Create-
> png-from-pdf-tp4929722.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>
>


Re: [Pharo-users] [Deployement] Apache rewrite rules for Pharo

2017-01-18 Thread Sven Van Caekenberghe
There is also this chapter:

https://ci.inria.fr/pharo-contribution/job/EnterprisePharoBook/lastSuccessfulBuild/artifact/book-result/DeploymentWeb/DeployForProduction.html

which contains the same solution and more.

> On 18 Jan 2017, at 19:04, Steven Costiou  wrote:
> 
> Hi,
> 
> not sure that's what you are looking for but for my Pharo images with Iliad 
> applications i just add the following to my website vhost in the /etc/apache 
> directory:
> 
> ProxyPass / http://localhost:/
> ProxyPassReverse / http://localhost:/
> 
> That redirects all queries to my domain to this local url, for example 
> http://my-domain.com/iliad => http://localhost:/iliad
> 
> Works fine but i don't even know if its the right thing to do (security 
> blabla...). I'm interested if someone knows a simpler procedure.
> 
> Steven.
> 
>  
> Le 2017-01-18 18:22, Blondeau Vincent a écrit :
> 
>> Hi,
>> I need to put on the same server and access through the port 80 several 
>> Pharo images.
>> I know that it is possible to do it thanks to the apache rewrite rules to 
>> redirect outside urls http://myserver:80/myservice to internal ones: 
>> http://localhost:8080.
>> Did someone already make such a config and can share the xml of the 
>> configuration file?
>> Thanks in advance,
>> Cheers,
>> Vincent Blondeau
>> 
>>  
>> 
>> 
>> !!!*
>> "Ce message et les pièces jointes sont confidentiels et réservés à l'usage 
>> exclusif de ses destinataires. Il peut également être protégé par le secret 
>> professionnel. Si vous recevez ce message par erreur, merci d'en avertir 
>> immédiatement l'expéditeur et de le détruire. L'intégrité du message ne 
>> pouvant être assurée sur Internet, la responsabilité de Worldline ne pourra 
>> être recherchée quant au contenu de ce message. Bien que les meilleurs 
>> efforts soient faits pour maintenir cette transmission exempte de tout 
>> virus, l'expéditeur ne donne aucune garantie à cet égard et sa 
>> responsabilité ne saurait être recherchée pour tout dommage résultant d'un 
>> virus transmis.
>> 
>> This e-mail and the documents attached are confidential and intended solely 
>> for the addressee; it may also be privileged. If you receive this e-mail in 
>> error, please notify the sender immediately and destroy it. As its integrity 
>> cannot be secured on the Internet, the Worldline liability cannot be 
>> triggered for the message content. Although the sender endeavours to 
>> maintain a computer virus-free network, the sender does not warrant that 
>> this transmission is virus-free and will not be liable for any damages 
>> resulting from any virus transmitted.!!!"
>  
>  




Re: [Pharo-users] [Deployement] Apache rewrite rules for Pharo

2017-01-18 Thread Steven Costiou
Hi, 

not sure that's what you are looking for but for my Pharo images with
Iliad applications i just add the following to my website vhost in the
/etc/apache directory: 

ProxyPass / http://localhost:/
ProxyPassReverse / http://localhost:/ 

That redirects all queries to my domain to this local url, for example
http://my-domain.com/iliad => http://localhost:/iliad 

Works fine but i don't even know if its the right thing to do (security
blabla...). I'm interested if someone knows a simpler procedure. 

Steven. 

Le 2017-01-18 18:22, Blondeau Vincent a écrit :

> Hi, 
> 
> I need to put on the same server and access through the port 80 several Pharo 
> images. 
> 
> I know that it is possible to do it thanks to the apache rewrite rules to 
> redirect outside urls http://myserver:80/myservice to internal ones: 
> http://localhost:8080 [1]. 
> 
> Did someone already make such a config and can share the xml of the 
> configuration file? 
> 
> Thanks in advance, 
> 
> Cheers, 
> 
> Vincent Blondeau 
> 
> !!!*
> "Ce message et les pièces jointes sont confidentiels et réservés à l'usage 
> exclusif de ses destinataires. Il peut également être protégé par le secret 
> professionnel. Si vous recevez ce message par erreur, merci d'en avertir 
> immédiatement l'expéditeur et de le détruire. L'intégrité du message ne 
> pouvant être assurée sur Internet, la responsabilité de Worldline ne pourra 
> être recherchée quant au contenu de ce message. Bien que les meilleurs 
> efforts soient faits pour maintenir cette transmission exempte de tout virus, 
> l'expéditeur ne donne aucune garantie à cet égard et sa responsabilité ne 
> saurait être recherchée pour tout dommage résultant d'un virus transmis.
> 
> This e-mail and the documents attached are confidential and intended solely 
> for the addressee; it may also be privileged. If you receive this e-mail in 
> error, please notify the sender immediately and destroy it. As its integrity 
> cannot be secured on the Internet, the Worldline liability cannot be 
> triggered for the message content. Although the sender endeavours to maintain 
> a computer virus-free network, the sender does not warrant that this 
> transmission is virus-free and will not be liable for any damages resulting 
> from any virus transmitted.!!!"

  

Links:
--
[1] http://monserver:8080


[Pharo-users] [Deployement] Apache rewrite rules for Pharo

2017-01-18 Thread Blondeau Vincent
Hi,
I need to put on the same server and access through the port 80 several Pharo 
images.
I know that it is possible to do it thanks to the apache rewrite rules to 
redirect outside urls http://myserver:80/myservice to internal ones: 
http://localhost:8080.
Did someone already make such a config and can share the xml of the 
configuration file?
Thanks in advance,
Cheers,
Vincent Blondeau


!!!*
"Ce message et les pi?ces jointes sont confidentiels et r?serv?s ? l'usage 
exclusif de ses destinataires. Il peut ?galement ?tre prot?g? par le secret 
professionnel. Si vous recevez ce message par erreur, merci d'en avertir 
imm?diatement l'exp?diteur et de le d?truire. L'int?grit? du message ne pouvant 
?tre assur?e sur Internet, la responsabilit? de Worldline ne pourra ?tre 
recherch?e quant au contenu de ce message. Bien que les meilleurs efforts 
soient faits pour maintenir cette transmission exempte de tout virus, 
l'exp?diteur ne donne aucune garantie ? cet ?gard et sa responsabilit? ne 
saurait ?tre recherch?e pour tout dommage r?sultant d'un virus transmis.

This e-mail and the documents attached are confidential and intended solely for 
the addressee; it may also be privileged. If you receive this e-mail in error, 
please notify the sender immediately and destroy it. As its integrity cannot be 
secured on the Internet, the Worldline liability cannot be triggered for the 
message content. Although the sender endeavours to maintain a computer 
virus-free network, the sender does not warrant that this transmission is 
virus-free and will not be liable for any damages resulting from any virus 
transmitted.!!!"


Re: [Pharo-users] STON encoding of slashes

2017-01-18 Thread Sven Van Caekenberghe

> On 18 Jan 2017, at 16:20, Peter Uhnak  wrote:
> 
> On Wed, Jan 18, 2017 at 03:38:17PM +0100, Sven Van Caekenberghe wrote:
>> So talking only about the encoding/writing phase, the conclusion would be 
> 
> 10.  Generators
> 
>   A JSON generator produces JSON text.  The resulting text MUST
>   strictly conform to the JSON grammar.
> 
> I guess the ABNF table is the best reference; but we want to generate the 
> most compact form available (=that still conforms to the syntax).
> 
>> - not to escape $/
> 
> For covenience's sake compact is better
>   * I guess the speciality of \/ is somehow related to JavaScript strings 
> interpreting both '/' and '\/' into '/'?
> 
>> - escape everything with code points [0,31], using named escapes if they 
>> exist, else \u
> 
> yes, the named ones have Pharo equivalent too
> 
> s := STON fromString: '"\b\f\n\r\t"'.
> s asArray "{Character backspace. Character newPage. Character lf. Character 
> cr. Character tab}"
> 
>> - escape $\ itself
> 
> yes
> 
>> 
>> That leaves the question about $' and $". 
>> 
>> $' is used in STON as string delimiter, so it has to be escaped.
>> 
>> - escape $' 
> 
> We already had discussion about $' and JSON 
> http://forum.world.st/STON-doesn-t-produce-valid-JSON-it-shouldn-t-escape-quation-mark-td4923777.html

Yes, I know, that change was OK.

> It must not be escaped in JSON, but that raises question about STON being 
> superset of JSON; is such thing achievable given this disparity?
> 
>> 
>> Right now, $" is also escaped. Should that remain the case, or only in JSON 
>> compatibility mode (where $" is used as string delimiter) ?
>> 
>> - do not escape $"
>> 
>> In JSON mode, escape $" and not $' then ?
> 
> That's how it should be in JSON.
> 
>> When parsing, all named and other escapes are always accepted, as they are 
>> now.
> 
> 9.  Parsers
> 
>   A JSON parser MUST accept all texts that conform to the JSON grammar.
>   A JSON parser MAY accept non-JSON forms or extensions.
> 
> My question about STON and JSON: What is the benefit of STON being superset 
> of JSON? To me it feels like an arbitrary restriction for STON; would STON 
> benefit from dropping this requirement and instead only worry about good 
> smalltalk object representation? (And leave JSON to NeoJSON or something.)

Being a superset means that you get a simple JSON parser (and even limited 
writer) for free once you install STON (or once it is part of the Pharo image, 
as it is now). It also means that we can fall back to the JSON spec as a guide 
in discussion like this one. It also helps people understand what STON is, by 
analogy but also differences with JSON.

So my conclusion would be (while writing), always escape $\ and not $/, in pure 
STON mode (the default), escape $' and not $", in JSON mode, escape $" and not 
$'. Those would be the changes. Agreed ?

> Peter
> 
>>> On 18 Jan 2017, at 15:25, Peter Uhnak  wrote:
>>> 
>>> On Wed, Jan 18, 2017 at 11:11:06AM +0100, Christophe Demarey wrote:
 
> Le 18 janv. 2017 à 09:51, Sven Van Caekenberghe  a écrit :
> 
> Hi Christophe,
> 
>> STON toString: 'g...@github.com:foo/bar.git’ => 
>> ''g...@github.com:foo\/bar.git’'
>> It used to be ''g...@github.com:foo/bar.git’’.
>>> 
> In other words, it was an implementation error (omission). Note that JSON 
> also has this escape.
>>> 
>>> Yes and no for JSON.
>>> 
>>> Only " and \ has to be escaped. Escaping anything else will give it special 
>>> meaning with the exception of / which will just produce the same thing, 
>>> because it is a special snowflake. :)
>>> 
>>> quoted from https://tools.ietf.org/html/rfc7159#section-7:
>>> 
>>> - Unicode characters may be placed within the quotation marks, except for 
>>> the characters that must be escaped: quotation mark, reverse solidus, and 
>>> the control characters (U+ through U+001F).
>>> - Alternatively, there are two-character sequence escape representations of 
>>> some popular characters.
>>> 
>>> "/" (U+002F) doesn't fall into control character range, but the alternative 
>>> section does permit it escaping it.
>>> 
>>> In other words, JSON strings "\/", and "/", and "\u002f" are equivalent.
>>> 
>>> But JSON itself doesn't require you to escape "/" (just like you are not 
>>> required to escape "hi" into "\u0068\u0069", although you can).
>>> 
>>> Note that other systems do not escape / by default:
>>> 
>>> (Pharo)
>>> NeoJSONWriter toString: 'g...@github.com:foo/bar.git' => 
>>> "g...@github.com:foo/bar.git"
>>> 
>>> (JavaScript)
>>> JSON.stringify('g...@github.com:foo/bar.git') => 
>>> "g...@github.com:foo/bar.git"
>>> 
>>> (Ruby)
>>> require 'json'
>>> puts 'g...@github.com:foo/bar.git'.to_json => "g...@github.com:foo/bar.git"
>>> 
>>> Peter
>>> 
>> 
>> 
> 




Re: [Pharo-users] STON encoding of slashes

2017-01-18 Thread Peter Uhnak
On Wed, Jan 18, 2017 at 03:38:17PM +0100, Sven Van Caekenberghe wrote:
> So talking only about the encoding/writing phase, the conclusion would be 

10.  Generators

   A JSON generator produces JSON text.  The resulting text MUST
   strictly conform to the JSON grammar.

I guess the ABNF table is the best reference; but we want to generate the most 
compact form available (=that still conforms to the syntax).

>  - not to escape $/

For covenience's sake compact is better
* I guess the speciality of \/ is somehow related to JavaScript strings 
interpreting both '/' and '\/' into '/'?

>  - escape everything with code points [0,31], using named escapes if they 
> exist, else \u

yes, the named ones have Pharo equivalent too

s := STON fromString: '"\b\f\n\r\t"'.
s asArray "{Character backspace. Character newPage. Character lf. Character cr. 
Character tab}"

>  - escape $\ itself

yes

> 
> That leaves the question about $' and $". 
> 
> $' is used in STON as string delimiter, so it has to be escaped.
> 
>  - escape $' 

We already had discussion about $' and JSON 
http://forum.world.st/STON-doesn-t-produce-valid-JSON-it-shouldn-t-escape-quation-mark-td4923777.html

It must not be escaped in JSON, but that raises question about STON being 
superset of JSON; is such thing achievable given this disparity?

> 
> Right now, $" is also escaped. Should that remain the case, or only in JSON 
> compatibility mode (where $" is used as string delimiter) ?
> 
>  - do not escape $"
> 
> In JSON mode, escape $" and not $' then ?

That's how it should be in JSON.

> When parsing, all named and other escapes are always accepted, as they are 
> now.

9.  Parsers

   A JSON parser MUST accept all texts that conform to the JSON grammar.
   A JSON parser MAY accept non-JSON forms or extensions.

My question about STON and JSON: What is the benefit of STON being superset of 
JSON? To me it feels like an arbitrary restriction for STON; would STON benefit 
from dropping this requirement and instead only worry about good smalltalk 
object representation? (And leave JSON to NeoJSON or something.)

Peter

> > On 18 Jan 2017, at 15:25, Peter Uhnak  wrote:
> > 
> > On Wed, Jan 18, 2017 at 11:11:06AM +0100, Christophe Demarey wrote:
> >> 
> >>> Le 18 janv. 2017 à 09:51, Sven Van Caekenberghe  a écrit :
> >>> 
> >>> Hi Christophe,
> >>> 
>  STON toString: 'g...@github.com:foo/bar.git’ => 
>  ''g...@github.com:foo\/bar.git’'
>  It used to be ''g...@github.com:foo/bar.git’’.
> > 
> >>> In other words, it was an implementation error (omission). Note that JSON 
> >>> also has this escape.
> > 
> > Yes and no for JSON.
> > 
> > Only " and \ has to be escaped. Escaping anything else will give it special 
> > meaning with the exception of / which will just produce the same thing, 
> > because it is a special snowflake. :)
> > 
> > quoted from https://tools.ietf.org/html/rfc7159#section-7:
> > 
> > - Unicode characters may be placed within the quotation marks, except for 
> > the characters that must be escaped: quotation mark, reverse solidus, and 
> > the control characters (U+ through U+001F).
> > - Alternatively, there are two-character sequence escape representations of 
> > some popular characters.
> > 
> > "/" (U+002F) doesn't fall into control character range, but the alternative 
> > section does permit it escaping it.
> > 
> > In other words, JSON strings "\/", and "/", and "\u002f" are equivalent.
> > 
> > But JSON itself doesn't require you to escape "/" (just like you are not 
> > required to escape "hi" into "\u0068\u0069", although you can).
> > 
> > Note that other systems do not escape / by default:
> > 
> > (Pharo)
> > NeoJSONWriter toString: 'g...@github.com:foo/bar.git' => 
> > "g...@github.com:foo/bar.git"
> > 
> > (JavaScript)
> > JSON.stringify('g...@github.com:foo/bar.git') => 
> > "g...@github.com:foo/bar.git"
> > 
> > (Ruby)
> > require 'json'
> > puts 'g...@github.com:foo/bar.git'.to_json => "g...@github.com:foo/bar.git"
> > 
> > Peter
> > 
> 
> 



Re: [Pharo-users] STON encoding of slashes

2017-01-18 Thread Sven Van Caekenberghe
So talking only about the encoding/writing phase, the conclusion would be 

 - not to escape $/
 - escape everything with code points [0,31], using named escapes if they 
exist, else \u
 - escape $\ itself

That leaves the question about $' and $". 

$' is used in STON as string delimiter, so it has to be escaped.

 - escape $' 

Right now, $" is also escaped. Should that remain the case, or only in JSON 
compatibility mode (where $" is used as string delimiter) ?

 - do not escape $"

In JSON mode, escape $" and not $' then ?

When parsing, all named and other escapes are always accepted, as they are now.

> On 18 Jan 2017, at 15:25, Peter Uhnak  wrote:
> 
> On Wed, Jan 18, 2017 at 11:11:06AM +0100, Christophe Demarey wrote:
>> 
>>> Le 18 janv. 2017 à 09:51, Sven Van Caekenberghe  a écrit :
>>> 
>>> Hi Christophe,
>>> 
 STON toString: 'g...@github.com:foo/bar.git’ => 
 ''g...@github.com:foo\/bar.git’'
 It used to be ''g...@github.com:foo/bar.git’’.
> 
>>> In other words, it was an implementation error (omission). Note that JSON 
>>> also has this escape.
> 
> Yes and no for JSON.
> 
> Only " and \ has to be escaped. Escaping anything else will give it special 
> meaning with the exception of / which will just produce the same thing, 
> because it is a special snowflake. :)
> 
> quoted from https://tools.ietf.org/html/rfc7159#section-7:
> 
> - Unicode characters may be placed within the quotation marks, except for the 
> characters that must be escaped: quotation mark, reverse solidus, and the 
> control characters (U+ through U+001F).
> - Alternatively, there are two-character sequence escape representations of 
> some popular characters.
> 
> "/" (U+002F) doesn't fall into control character range, but the alternative 
> section does permit it escaping it.
> 
> In other words, JSON strings "\/", and "/", and "\u002f" are equivalent.
> 
> But JSON itself doesn't require you to escape "/" (just like you are not 
> required to escape "hi" into "\u0068\u0069", although you can).
> 
> Note that other systems do not escape / by default:
> 
> (Pharo)
> NeoJSONWriter toString: 'g...@github.com:foo/bar.git' => 
> "g...@github.com:foo/bar.git"
> 
> (JavaScript)
> JSON.stringify('g...@github.com:foo/bar.git') => "g...@github.com:foo/bar.git"
> 
> (Ruby)
> require 'json'
> puts 'g...@github.com:foo/bar.git'.to_json => "g...@github.com:foo/bar.git"
> 
> Peter
> 




Re: [Pharo-users] STON encoding of slashes

2017-01-18 Thread Peter Uhnak
On Wed, Jan 18, 2017 at 11:11:06AM +0100, Christophe Demarey wrote:
> 
> > Le 18 janv. 2017 à 09:51, Sven Van Caekenberghe  a écrit :
> > 
> > Hi Christophe,
> > 
> >> STON toString: 'g...@github.com:foo/bar.git’ => 
> >> ''g...@github.com:foo\/bar.git’'
> >> It used to be ''g...@github.com:foo/bar.git’’.

> > In other words, it was an implementation error (omission). Note that JSON 
> > also has this escape.

Yes and no for JSON.

Only " and \ has to be escaped. Escaping anything else will give it special 
meaning with the exception of / which will just produce the same thing, because 
it is a special snowflake. :)

quoted from https://tools.ietf.org/html/rfc7159#section-7:

- Unicode characters may be placed within the quotation marks, except for the 
characters that must be escaped: quotation mark, reverse solidus, and the 
control characters (U+ through U+001F).
- Alternatively, there are two-character sequence escape representations of 
some popular characters.

"/" (U+002F) doesn't fall into control character range, but the alternative 
section does permit it escaping it.

In other words, JSON strings "\/", and "/", and "\u002f" are equivalent.

But JSON itself doesn't require you to escape "/" (just like you are not 
required to escape "hi" into "\u0068\u0069", although you can).

Note that other systems do not escape / by default:

(Pharo)
NeoJSONWriter toString: 'g...@github.com:foo/bar.git' => 
"g...@github.com:foo/bar.git"

(JavaScript)
JSON.stringify('g...@github.com:foo/bar.git') => "g...@github.com:foo/bar.git"

(Ruby)
require 'json'
puts 'g...@github.com:foo/bar.git'.to_json => "g...@github.com:foo/bar.git"

Peter



[Pharo-users] Pharo not opening my image automatically

2017-01-18 Thread Dimitris Chloupis
Hey guys, I have a makefile that downloads Pharo with

curl get.pharo.org/alpha+vmLatest | bash

I then move pharo.app from the pharo-vm subfolder to the parent folder that
contains my Ephestos.image , together with Pharo50.sources the problem is
that when I double click on it instead of opening my image automatically as
Squeak used to do , it does not and instead it prompts me which image to
choose even though there is no other image in folder and no other changes
file (Ephestos.changes)

Am I doing something wrong ? Should it not open the image automatically
without asking me ?


[Pharo-users] STON encoding of slashes

2017-01-18 Thread Christophe Demarey
Hi,

I just noticed that STON encoding of forward slashes changed.

STON toString: 'g...@github.com:foo/bar.git’ => ''g...@github.com:foo\/bar.git’'

It used to be ''g...@github.com:foo/bar.git’’.

Is it on purpose?

Thanks,
Christophe