Re: [Pharo-users] Ideas of web services that I could script in a couple of lines?

2016-03-13 Thread Hernán Morales Durand
This is because working with Pharo is becoming much easier every day :)

Hernán

2016-03-14 3:33 GMT-03:00 Sven Van Caekenberghe :

> Hernán,
>
> These are nice examples !
>
> Sven
>
> > On 14 Mar 2016, at 04:04, Hernán Morales Durand <
> hernan.mora...@gmail.com> wrote:
> >
> > Hi Stef,
> >
> > Here are some examples:
> >
> > Get world capitals:
> >
> > ((NeoJSONReader fromString: (
> > ZnEasy
> > get: 'http://api.geonames.org/countryInfoJSON'
> > username: 'demo'
> > password: '') contents) at: #geonames) collect: [ : d | d at:
> #capital ]
> >
> > Get poster of The Terminator movie:
> >
> > (ZnEasy getJpeg: ((NeoJSONReader fromString:
> > (ZnClient new
> > url: 'http://www.omdbapi.com/';
> > queryAt: 't' put: 'The Terminator';
> > get;
> > contents)) at: #Poster)) inspect
> >
> > Another one to WorldCat but this needs an API key (I cannot test it now)
> >
> > (ZnClient new
> > url: 'http://worldcat.org/webservices/kb/rest/collections';
> > addPathSegment: 'search';
> > queryAt: 'q' put: 'Plato';
> > queryAt: 'wskey' put: '...';
> > get;
> > contents)) inspect
> >
> > This is another wrapper for language detection (if you want to show a
> simple api wrapper)
> >
> >
> http://80738163270632.blogspot.com/2015/02/languagedetection-api-client-in.html
> >
> > Cheers,
> >
> > Hernán
> >
> >
> > 2016-03-13 17:52 GMT-03:00 stepharo :
> > Hi hernan and others
> >
> > I'm looking for ideas of simple services
> > capital, dictionaries
> > forecast that I could access using Zinc in a couple of lines.
> >
> > This is for challenges that I'm writing for the mooc.
> > Stef
> >
> >
> >
> >
>
>
>


Re: [Pharo-users] Ideas of web services that I could script in a couple of lines?

2016-03-13 Thread Sven Van Caekenberghe
Hernán,

These are nice examples !

Sven

> On 14 Mar 2016, at 04:04, Hernán Morales Durand  
> wrote:
> 
> Hi Stef,
> 
> Here are some examples:
> 
> Get world capitals:
> 
> ((NeoJSONReader fromString: (
> ZnEasy 
> get: 'http://api.geonames.org/countryInfoJSON'
> username: 'demo'
> password: '') contents) at: #geonames) collect: [ : d | d at: 
> #capital ]
> 
> Get poster of The Terminator movie:
> 
> (ZnEasy getJpeg: ((NeoJSONReader fromString: 
> (ZnClient new
> url: 'http://www.omdbapi.com/';
> queryAt: 't' put: 'The Terminator';
> get;
> contents)) at: #Poster)) inspect
> 
> Another one to WorldCat but this needs an API key (I cannot test it now)
> 
> (ZnClient new
> url: 'http://worldcat.org/webservices/kb/rest/collections';
> addPathSegment: 'search';
> queryAt: 'q' put: 'Plato';
> queryAt: 'wskey' put: '...';
> get;
> contents)) inspect
> 
> This is another wrapper for language detection (if you want to show a simple 
> api wrapper)
> 
> http://80738163270632.blogspot.com/2015/02/languagedetection-api-client-in.html
> 
> Cheers,
> 
> Hernán
> 
> 
> 2016-03-13 17:52 GMT-03:00 stepharo :
> Hi hernan and others
> 
> I'm looking for ideas of simple services
> capital, dictionaries
> forecast that I could access using Zinc in a couple of lines.
> 
> This is for challenges that I'm writing for the mooc.
> Stef
> 
> 
> 
> 




Re: [Pharo-users] Ideas of web services that I could script in a couple of lines?

2016-03-13 Thread stepharo

super!


Le 14/3/16 04:04, Hernán Morales Durand a écrit :

Hi Stef,

Here are some examples:

Get world capitals:

((NeoJSONReader fromString: (
ZnEasy
get: 'http://api.geonames.org/countryInfoJSON'
username: 'demo'
password: '') contents) at: #geonames) collect: [ : d | d at: 
#capital ]


Get poster of The Terminator movie:

(ZnEasy getJpeg: ((NeoJSONReader fromString:
(ZnClient new
url: 'http://www.omdbapi.com/';
queryAt: 't' put: 'The Terminator';
get;
contents)) at: #Poster)) inspect

Another one to WorldCat but this needs an API key (I cannot test it now)

(ZnClient new
url: 'http://worldcat.org/webservices/kb/rest/collections';
addPathSegment: 'search';
queryAt: 'q' put: 'Plato';
queryAt: 'wskey' put: '...';
get;
contents)) inspect

This is another wrapper for language detection (if you want to show a 
simple api wrapper)


http://80738163270632.blogspot.com/2015/02/languagedetection-api-client-in.html

Cheers,

Hernán


2016-03-13 17:52 GMT-03:00 stepharo >:


Hi hernan and others

I'm looking for ideas of simple services
capital, dictionaries
forecast that I could access using Zinc in a couple of lines.

This is for challenges that I'm writing for the mooc.
Stef








Re: [Pharo-users] Ideas of web services that I could script in a couple of lines?

2016-03-13 Thread stepharo



On 13 Mar 2016, at 22:42, Henrik Nergaard  wrote:

Correct, I used that for the example since it is by default in the Image .

And that is a pity, IMHO, it sneaked in, while others have asked for NeoJSON to 
be included in the past ;-)


Sven is STON able to replace MCFileTreeJsonParser
if so can you open a bug entry and we kill it. You know my point of view 
of such parsers


Stef


Anyway, STON, which is also part of the base image can parse JSON just as well.

   STON fromString: '[42, {"JSON":true}, -1.5]'.

You can also generate JSON.

   STON toJsonStringPretty: { 42. { 'JSON'->true } asDictionary. -1.5 }.

   STON toJsonString: { 42. { 'JSON'->true } asDictionary. -1.5 }.


Best regards,
Henrik  

-Original Message-
From: Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] On Behalf Of 
stepharo
Sent: Sunday, March 13, 2016 10:34 PM
To: Any question about pharo is welcome 
Subject: Re: [Pharo-users] Ideas of web services that I could script in a 
couple of lines?

Henrik

do you use MCFileTreeJsonParser
just because this was just the JSON parser you got at hand?

Stef

Le 13/3/16 22:24, Henrik Nergaard a écrit :

Accessing the Nominatim service: http://wiki.openstreetmap.org/wiki/Nominatim .

http://ws.stfx.eu/ATBXE2DN83CW

Best regards,
Henrik

-Original Message-
From: Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] On Behalf Of 
stepharo
Sent: Sunday, March 13, 2016 9:52 PM
To: Any question about pharo is welcome 
Subject: [Pharo-users] Ideas of web services that I could script in a couple of 
lines?

Hi hernan and others

I'm looking for ideas of simple services capital, dictionaries
forecast that I could access using Zinc in a couple of lines.

This is for challenges that I'm writing for the mooc.
Stef













Re: [Pharo-users] Ideas of web services that I could script in a couple of lines?

2016-03-13 Thread Hernán Morales Durand
Hi Stef,

Here are some examples:

Get world capitals:

((NeoJSONReader fromString: (
ZnEasy
get: 'http://api.geonames.org/countryInfoJSON'
username: 'demo'
password: '') contents) at: #geonames) collect: [ : d | d at:
#capital ]

Get poster of The Terminator movie:

(ZnEasy getJpeg: ((NeoJSONReader fromString:
(ZnClient new
url: 'http://www.omdbapi.com/';
queryAt: 't' put: 'The Terminator';
get;
contents)) at: #Poster)) inspect

Another one to WorldCat but this needs an API key (I cannot test it now)

(ZnClient new
url: 'http://worldcat.org/webservices/kb/rest/collections';
addPathSegment: 'search';
queryAt: 'q' put: 'Plato';
queryAt: 'wskey' put: '...';
get;
contents)) inspect

This is another wrapper for language detection (if you want to show a
simple api wrapper)

http://80738163270632.blogspot.com/2015/02/languagedetection-api-client-in.html

Cheers,

Hernán


2016-03-13 17:52 GMT-03:00 stepharo :

> Hi hernan and others
>
> I'm looking for ideas of simple services
> capital, dictionaries
> forecast that I could access using Zinc in a couple of lines.
>
> This is for challenges that I'm writing for the mooc.
> Stef
>
>
>
>


Re: [Pharo-users] Magritte Tutorial [Draft]

2016-03-13 Thread basilmir
Tried to access the link and it was dead. Apparently the name got reversed
along the way, walking the ci did the job.

https://ci.inria.fr/pharo-contribution/view/Books/job/Magritte/lastSuccessfulBuild/artifact/book-result/MagritteBooklet.pdf
  
-- is not dead

https://ci.inria.fr/pharo-contribution/view/Books/job/Magritte/lastSuccessfulBuild/artifact/book-result/BookletMagritte.pdf
  
-- works



--
View this message in context: 
http://forum.world.st/Magritte-Tutorial-Draft-tp4866792p4884387.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.



Re: [Pharo-users] Ideas of web services that I could script in a couple of lines?

2016-03-13 Thread Henrik Nergaard
Ahh!
I was looking at STON first but could not find any #parseJsonString: or similar.
Perhaps this should be mentioned in the class comment? :)

Best regards,
Henrik

-Original Message-
From: Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] On Behalf Of 
Sven Van Caekenberghe
Sent: Sunday, March 13, 2016 10:53 PM
To: Any question about pharo is welcome 
Subject: Re: [Pharo-users] Ideas of web services that I could script in a 
couple of lines?


> On 13 Mar 2016, at 22:42, Henrik Nergaard  wrote:
> 
> Correct, I used that for the example since it is by default in the Image .

And that is a pity, IMHO, it sneaked in, while others have asked for NeoJSON to 
be included in the past ;-)

Anyway, STON, which is also part of the base image can parse JSON just as well.

  STON fromString: '[42, {"JSON":true}, -1.5]'.

You can also generate JSON.

  STON toJsonStringPretty: { 42. { 'JSON'->true } asDictionary. -1.5 }.

  STON toJsonString: { 42. { 'JSON'->true } asDictionary. -1.5 }.

> Best regards,
> Henrik
> 
> -Original Message-
> From: Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] On Behalf Of 
> stepharo
> Sent: Sunday, March 13, 2016 10:34 PM
> To: Any question about pharo is welcome 
> Subject: Re: [Pharo-users] Ideas of web services that I could script in a 
> couple of lines?
> 
> Henrik
> 
> do you use MCFileTreeJsonParser
> just because this was just the JSON parser you got at hand?
> 
> Stef
> 
> Le 13/3/16 22:24, Henrik Nergaard a écrit :
>> Accessing the Nominatim service: 
>> http://wiki.openstreetmap.org/wiki/Nominatim .
>> 
>> http://ws.stfx.eu/ATBXE2DN83CW
>> 
>> Best regards,
>> Henrik
>> 
>> -Original Message-
>> From: Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] On Behalf Of 
>> stepharo
>> Sent: Sunday, March 13, 2016 9:52 PM
>> To: Any question about pharo is welcome 
>> Subject: [Pharo-users] Ideas of web services that I could script in a couple 
>> of lines?
>> 
>> Hi hernan and others
>> 
>> I'm looking for ideas of simple services capital, dictionaries
>> forecast that I could access using Zinc in a couple of lines.
>> 
>> This is for challenges that I'm writing for the mooc.
>> Stef
>> 
>> 
>> 
> 
> 




Re: [Pharo-users] Ideas of web services that I could script in a couple of lines?

2016-03-13 Thread Sven Van Caekenberghe

> On 13 Mar 2016, at 22:42, Henrik Nergaard  wrote:
> 
> Correct, I used that for the example since it is by default in the Image .

And that is a pity, IMHO, it sneaked in, while others have asked for NeoJSON to 
be included in the past ;-)

Anyway, STON, which is also part of the base image can parse JSON just as well.

  STON fromString: '[42, {"JSON":true}, -1.5]'.

You can also generate JSON.

  STON toJsonStringPretty: { 42. { 'JSON'->true } asDictionary. -1.5 }.

  STON toJsonString: { 42. { 'JSON'->true } asDictionary. -1.5 }.

> Best regards,
> Henrik
> 
> -Original Message-
> From: Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] On Behalf Of 
> stepharo
> Sent: Sunday, March 13, 2016 10:34 PM
> To: Any question about pharo is welcome 
> Subject: Re: [Pharo-users] Ideas of web services that I could script in a 
> couple of lines?
> 
> Henrik
> 
> do you use MCFileTreeJsonParser
> just because this was just the JSON parser you got at hand?
> 
> Stef
> 
> Le 13/3/16 22:24, Henrik Nergaard a écrit :
>> Accessing the Nominatim service: 
>> http://wiki.openstreetmap.org/wiki/Nominatim .
>> 
>> http://ws.stfx.eu/ATBXE2DN83CW
>> 
>> Best regards,
>> Henrik
>> 
>> -Original Message-
>> From: Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] On Behalf Of 
>> stepharo
>> Sent: Sunday, March 13, 2016 9:52 PM
>> To: Any question about pharo is welcome 
>> Subject: [Pharo-users] Ideas of web services that I could script in a couple 
>> of lines?
>> 
>> Hi hernan and others
>> 
>> I'm looking for ideas of simple services capital, dictionaries
>> forecast that I could access using Zinc in a couple of lines.
>> 
>> This is for challenges that I'm writing for the mooc.
>> Stef
>> 
>> 
>> 
> 
> 




Re: [Pharo-users] Ideas of web services that I could script in a couple of lines?

2016-03-13 Thread Henrik Nergaard
Correct, I used that for the example since it is by default in the Image .

Best regards,
Henrik  

-Original Message-
From: Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] On Behalf Of 
stepharo
Sent: Sunday, March 13, 2016 10:34 PM
To: Any question about pharo is welcome 
Subject: Re: [Pharo-users] Ideas of web services that I could script in a 
couple of lines?

Henrik

do you use MCFileTreeJsonParser
just because this was just the JSON parser you got at hand?

Stef

Le 13/3/16 22:24, Henrik Nergaard a écrit :
> Accessing the Nominatim service: http://wiki.openstreetmap.org/wiki/Nominatim 
> .
>
> http://ws.stfx.eu/ATBXE2DN83CW
>
> Best regards,
> Henrik
>
> -Original Message-
> From: Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] On Behalf Of 
> stepharo
> Sent: Sunday, March 13, 2016 9:52 PM
> To: Any question about pharo is welcome 
> Subject: [Pharo-users] Ideas of web services that I could script in a couple 
> of lines?
>
> Hi hernan and others
>
> I'm looking for ideas of simple services capital, dictionaries
> forecast that I could access using Zinc in a couple of lines.
>
> This is for challenges that I'm writing for the mooc.
> Stef
>
>
>




Re: [Pharo-users] Ideas of web services that I could script in a couple of lines?

2016-03-13 Thread stepharo

Henrik

do you use MCFileTreeJsonParser
just because this was just the JSON parser you got at hand?

Stef

Le 13/3/16 22:24, Henrik Nergaard a écrit :

Accessing the Nominatim service: http://wiki.openstreetmap.org/wiki/Nominatim .

http://ws.stfx.eu/ATBXE2DN83CW

Best regards,
Henrik

-Original Message-
From: Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] On Behalf Of 
stepharo
Sent: Sunday, March 13, 2016 9:52 PM
To: Any question about pharo is welcome 
Subject: [Pharo-users] Ideas of web services that I could script in a couple of 
lines?

Hi hernan and others

I'm looking for ideas of simple services capital, dictionaries
forecast that I could access using Zinc in a couple of lines.

This is for challenges that I'm writing for the mooc.
Stef








Re: [Pharo-users] Ideas of web services that I could script in a couple of lines?

2016-03-13 Thread stepharo

TX!!

Le 13/3/16 22:24, Henrik Nergaard a écrit :

Accessing the Nominatim service: http://wiki.openstreetmap.org/wiki/Nominatim .

http://ws.stfx.eu/ATBXE2DN83CW

Best regards,
Henrik

-Original Message-
From: Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] On Behalf Of 
stepharo
Sent: Sunday, March 13, 2016 9:52 PM
To: Any question about pharo is welcome 
Subject: [Pharo-users] Ideas of web services that I could script in a couple of 
lines?

Hi hernan and others

I'm looking for ideas of simple services capital, dictionaries
forecast that I could access using Zinc in a couple of lines.

This is for challenges that I'm writing for the mooc.
Stef








Re: [Pharo-users] Ideas of web services that I could script in a couple of lines?

2016-03-13 Thread stepharo

I found

http://www.webservicex.net/globalweather.asmx/GetCitiesByCountry?CountryName=France

Now I do not get why the output is so bad? It looks like they do say 
that the serve XML but this is not true

;(


http://www.webserviceX.NET";>
  FranceLe Touquet
France

Re: [Pharo-users] Ideas of web services that I could script in a couple of lines?

Accessing the Nominatim service: http://wiki.openstreetmap.org/wiki/Nominatim .

http://ws.stfx.eu/ATBXE2DN83CW

Best regards,
Henrik

-Original Message-
From: Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] On Behalf Of 
stepharo
Sent: Sunday, March 13, 2016 9:52 PM
To: Any question about pharo is welcome 
Subject: [Pharo-users] Ideas of web services that I could script in a couple of 
lines?

Hi hernan and others

I'm looking for ideas of simple services capital, dictionaries
forecast that I could access using Zinc in a couple of lines.

This is for challenges that I'm writing for the mooc.
Stef





[Pharo-users] Ideas of web services that I could script in a couple of lines?


Hi hernan and others

I'm looking for ideas of simple services
capital, dictionaries
forecast that I could access using Zinc in a couple of lines.

This is for challenges that I'm writing for the mooc.
Stef





Re: [Pharo-users] Beginner's question on morphs


Thanks for your question and thank you guys for the answer.
I'm turning in into a small challenges (how to) for the mooc :)

Stef

Le 13/3/16 14:48, Markus Stumptner a écrit :
Hi, I'm trying to refamiliarize with Pharo again after a few years... 
trying to set up a simple game window  that uses a very large 
scrollable game board with a huge image as the background, so that 
game pieces placed on that background would scroll in and out of view. 
Any hints as how to best set that up in Morphic?


Thanks
Markus







Re: [Pharo-users] Beginner's question on morphs


Clement

you will have (after the deadline) to publish your code :)

Stef

Le 13/3/16 16:31, Clément Bera a écrit :
Alternatively, I do that using a SDL window. This way, the production 
game can be launched using SDL and pharo headless, and not have the 
overhead of the morphic rendering loop.


2016-03-13 15:22 GMT+01:00 Henrik Nergaard >:


http://ws.stfx.eu/1RCNV18R5J7E

Best regards,
Henrik

-Original Message-
From: Pharo-users [mailto:pharo-users-boun...@lists.pharo.org
] On Behalf Of Markus
Stumptner
Sent: Sunday, March 13, 2016 2:49 PM
To: pharo-users@lists.pharo.org 
Subject: [Pharo-users] Beginner's question on morphs

Hi, I'm trying to refamiliarize with Pharo again after a few years...
trying to set up a simple game window  that uses a very large
scrollable game board with a huge image as the background, so that
game pieces placed on that background would scroll in and out of
view. Any hints as how to best set that up in Morphic?

Thanks
Markus






Re: [Pharo-users] How to access XML tag name?




Le 13/3/16 18:46, Tudor Girba a écrit :

Hi,

I did OPAX :).


:)
So I'm doing a pass and cleaned it.
I created a small builder to generate subclasses and tags. I will 
release it soon.

I will play with the FILMS xml to understand what can be a solution.

Then after I will check a bit more the pluggable.


At one point there was an effort around NodeFactory, and we chose to improve 
that one.

Cheers,
Doru


On Mar 13, 2016, at 4:57 PM, stepharo  wrote:

So I wonder why Fabrizio did OPAX do you have an idea?
You get a simple tree but it is worth?
I will finish my improvement on OPAX.

Stef

This class is a pluggable factory that can map elements to different XMLElement 
subclasses based on the name and namespace information of those elements. You 
have to create an instance, configure it to handle certain elements with 
certain classes, and then inject your instance into a DOM parser using 
#nodeFactory: before parsing. Here is an example of its use:

doc := (XMLDOMParser on: someXML)
nodeFactory:
(XMLPluggableElementFactory new
elementClass: GenericElement;
handleElement: 'user' withClass: UserElement;
handleElement: 'report' withClass: ReportElement;
handleElement: 'report' namespaceURI: 'urn:specialreprot' 
withClass: SpecialReportElement)
parseDocument.

The #handleElementsMatchingClass*: forms try to match elements to the specified classes 
based on the names of those classes when stripped of any prefix (like XML) and 
"Element" suffix and converted to both camel case and a hyphenated form. So 
this:
XMLPluggableElementFactory new
handleElementsMatchingClass: MYRootUserElement

will handle 'rootUser' and 'root-user' elements with the MYRootUserElement 
class.


--
www.tudorgirba.com
www.feenk.com

"Next time you see your life passing by, say 'hi' and get to know her."











Re: [Pharo-users] How to access XML tag name?

Hi,

I did OPAX :). At one point there was an effort around NodeFactory, and we 
chose to improve that one.

Cheers,
Doru

> On Mar 13, 2016, at 4:57 PM, stepharo  wrote:
> 
> So I wonder why Fabrizio did OPAX do you have an idea?
> You get a simple tree but it is worth?
> I will finish my improvement on OPAX.
> 
> Stef
> 
> This class is a pluggable factory that can map elements to different 
> XMLElement subclasses based on the name and namespace information of those 
> elements. You have to create an instance, configure it to handle certain 
> elements with certain classes, and then inject your instance into a DOM 
> parser using #nodeFactory: before parsing. Here is an example of its use:
> 
>doc := (XMLDOMParser on: someXML)
>nodeFactory:
>(XMLPluggableElementFactory new
>elementClass: GenericElement;
>handleElement: 'user' withClass: UserElement;
>handleElement: 'report' withClass: ReportElement;
>handleElement: 'report' namespaceURI: 'urn:specialreprot' 
> withClass: SpecialReportElement)
>parseDocument.
> 
> The #handleElementsMatchingClass*: forms try to match elements to the 
> specified classes based on the names of those classes when stripped of any 
> prefix (like XML) and "Element" suffix and converted to both camel case and a 
> hyphenated form. So this:
>XMLPluggableElementFactory new
>handleElementsMatchingClass: MYRootUserElement
>
> will handle 'rootUser' and 'root-user' elements with the MYRootUserElement 
> class.
> 

--
www.tudorgirba.com
www.feenk.com

"Next time you see your life passing by, say 'hi' and get to know her."







Re: [Pharo-users] How to access XML tag name?




Le 13/3/16 14:33, Tudor Girba a écrit :

XPath is better than Pastell. That is why in Moose we now have XPath.\


Yes this is my impression and I checked the implementation and there is 
only one class

extending XPath.

Stef


Doru


On Mar 13, 2016, at 1:49 PM, stepharo  wrote:

Alex

I saw that Pastell is only tagged for Pharo30 and has not metadata.
It would be good to revise it.

Stef


--
www.tudorgirba.com
www.feenk.com

"Every successful trip needs a suitable vehicle."












Re: [Pharo-users] How to access XML tag name?


Ok I checked it and there is only one class in the package.

Stef

Le 13/3/16 16:27, Alexandre Bergel a écrit :

Pastell is an implementation of XPath. But I had a look at it many years ago 
(when I was extracting data from srcML xml files, you remember? :-)

Alexandre



On Mar 13, 2016, at 1:39 PM, stepharo  wrote:

Alex

what Pastell brings compared to XPath?

Stef






Re: [Pharo-users] How to access XML tag name?


So I wonder why Fabrizio did OPAX do you have an idea?
You get a simple tree but it is worth?
I will finish my improvement on OPAX.

Stef

This class is a pluggable factory that can map elements to different 
XMLElement subclasses based on the name and namespace information of 
those elements. You have to create an instance, configure it to handle 
certain elements with certain classes, and then inject your instance 
into a DOM parser using #nodeFactory: before parsing. Here is an example 
of its use:


doc := (XMLDOMParser on: someXML)
nodeFactory:
(XMLPluggableElementFactory new
elementClass: GenericElement;
handleElement: 'user' withClass: UserElement;
handleElement: 'report' withClass: ReportElement;
handleElement: 'report' namespaceURI: 
'urn:specialreprot' withClass: SpecialReportElement)

parseDocument.

The #handleElementsMatchingClass*: forms try to match elements to the 
specified classes based on the names of those classes when stripped of 
any prefix (like XML) and "Element" suffix and converted to both camel 
case and a hyphenated form. So this:

XMLPluggableElementFactory new
handleElementsMatchingClass: MYRootUserElement

will handle 'rootUser' and 'root-user' elements with the 
MYRootUserElement class.




Re: [Pharo-users] Beginner's question on morphs

Alternatively, I do that using a SDL window. This way, the production game
can be launched using SDL and pharo headless, and not have the overhead of
the morphic rendering loop.

2016-03-13 15:22 GMT+01:00 Henrik Nergaard :

> http://ws.stfx.eu/1RCNV18R5J7E
>
> Best regards,
> Henrik
>
> -Original Message-
> From: Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] On Behalf
> Of Markus Stumptner
> Sent: Sunday, March 13, 2016 2:49 PM
> To: pharo-users@lists.pharo.org
> Subject: [Pharo-users] Beginner's question on morphs
>
> Hi, I'm trying to refamiliarize with Pharo again after a few years...
> trying to set up a simple game window  that uses a very large scrollable
> game board with a huge image as the background, so that game pieces placed
> on that background would scroll in and out of view. Any hints as how to
> best set that up in Morphic?
>
> Thanks
> Markus
>
>


Re: [Pharo-users] How to access XML tag name?

Oh cool! I did not know there was a project XPath in Pharo.
I learnt something.

Cheers,
Alexandre


> On Mar 13, 2016, at 2:33 PM, Tudor Girba  wrote:
> 
> XPath is better than Pastell. That is why in Moose we now have XPath.
> 
> Doru
> 
>> On Mar 13, 2016, at 1:49 PM, stepharo  wrote:
>> 
>> Alex
>> 
>> I saw that Pastell is only tagged for Pharo30 and has not metadata.
>> It would be good to revise it.
>> 
>> Stef
>> 
> 
> --
> www.tudorgirba.com
> www.feenk.com
> 
> "Every successful trip needs a suitable vehicle."
> 
> 
> 
> 
> 
> 

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






Re: [Pharo-users] How to access XML tag name?

Pastell is an implementation of XPath. But I had a look at it many years ago 
(when I was extracting data from srcML xml files, you remember? :-)

Alexandre


> On Mar 13, 2016, at 1:39 PM, stepharo  wrote:
> 
> Alex
> 
> what Pastell brings compared to XPath?
> 
> Stef
> 

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






Re: [Pharo-users] Roassal2 on Ubuntu 64

>
> $ sudo apt-get install libcairo2:i386
>

This is sufficient for both Ubuntu and Debian (and probably their forks,
such as Mint).

Peter


Re: [Pharo-users] Beginner's question on morphs


http://ws.stfx.eu/4I40UQDA50U0

shows how to add scaling.

Stephan




Re: [Pharo-users] Beginner's question on morphs

http://ws.stfx.eu/1RCNV18R5J7E

Best regards,
Henrik

-Original Message-
From: Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] On Behalf Of 
Markus Stumptner
Sent: Sunday, March 13, 2016 2:49 PM
To: pharo-users@lists.pharo.org
Subject: [Pharo-users] Beginner's question on morphs

Hi, I'm trying to refamiliarize with Pharo again after a few years... 
trying to set up a simple game window  that uses a very large scrollable game 
board with a huge image as the background, so that game pieces placed on that 
background would scroll in and out of view. Any hints as how to best set that 
up in Morphic?

Thanks
Markus



[Pharo-users] Beginner's question on morphs

Hi, I'm trying to refamiliarize with Pharo again after a few years... 
trying to set up a simple game window  that uses a very large scrollable 
game board with a huge image as the background, so that game pieces 
placed on that background would scroll in and out of view. Any hints as 
how to best set that up in Morphic?


Thanks
Markus



Re: [Pharo-users] How to access XML tag name?

XPath is better than Pastell. That is why in Moose we now have XPath.

Doru

> On Mar 13, 2016, at 1:49 PM, stepharo  wrote:
> 
> Alex
> 
> I saw that Pastell is only tagged for Pharo30 and has not metadata.
> It would be good to revise it.
> 
> Stef
> 

--
www.tudorgirba.com
www.feenk.com

"Every successful trip needs a suitable vehicle."








Re: [Pharo-users] How to access XML tag name?

Hi,

Yes, exactly. You get a qualified DOM with a hierarchy that you can afterwards 
visit.

Only the current implementation only works only with the XMLDOMParser. It does 
not work with SAX.

Cheers,
Doru

> On Mar 13, 2016, at 12:55 PM, stepharo  wrote:
> 
> I have the impression that I should also look at 
> 
> XMLPluggableElementFactory new handleElement: 'NOM' withClass: AAAName.
> 
> Because it looks like that I inject my nodes inside the dom
> 
> Am I correct?
> 
> 
> Le 12/3/16 21:59, Tudor Girba a écrit :
>> Hi,
>> 
>> My original work only survived for the XMLDOMParser. See this example:
>> http://ws.stfx.eu/NK2WLSW99X10
>> (paste this in Spotter :))
>> 
>> For an XMLDOMParser, you can say that you want to instantiate a node in the 
>> DOM with an custom instance. For example, here I instantiate  with 
>> AAAName:
>> 
>> 
>> 
>> You are looking for something a bit different. In a way you want to 
>> associate the triggering of a specific handler when some XPath like 
>> expression is being matched for the current element. I think something like 
>> this should go in the main implementation.
>> 
>> Cheers,
>> Doru
>> 
>> 
>> 
>>> On Mar 12, 2016, at 9:33 AM, stepharo  wrote:
>>> 
>>> This is more complex than that.
>>> Because I would like to have a visitor generated from the token I give.
>>> 
>>> And this
>>>start
>>>character
>>>end
>>> 
>>> does not really help me.
>>> 
>>> Because in SAXHandler I have
>>>start
>>>where I should store the properties
>>>   same in characters:
>>>to store the name
>>>   end
>>>where I should invoke the visitor
>>> 
>>> Now it means that I should only store the information for the tag I want.
>>> Does anybody already did that and publish it?
>>> I know doru did that in the past.
>>> I will try.
>>> 
>>> Stef
>>> 
>>> 
>>> 
>>> Le 11/3/16 14:17, Blondeau Vincent a écrit :
 Hi,
 
 The qualified name in function startElement: aQualifiedName attributes: 
 aDictionary, will be FILMS and after FILM and after TITRE,...etc...
 So, you have to tell to your shouldVisit: method to accept TITRE too and 
 get in and after you should implement characters: to get the content on 
 the tag.
 
 Vincent
 
> -Message d'origine-
> De : Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] De la part 
> de
> stepharo
> Envoyé : vendredi 11 mars 2016 14:04
> À : Any question about pharo is welcome
> Objet : [Pharo-users] How to access XML tag name?
> 
> Hi
> 
> Yesterday I started to hack a smart SAX handler. The idea is that I want 
> to just
> specify the tags I want to visit and the SAX handler should invoke 
> (generated)
> visit methods. Like that I can easily get visitors on XML domain.
> 
> Here is an example of what I did.
> 
>  | h |
>  h := SmartSAXHandler new
>  visitor: (MyFilmVisitor new visitTags: #(FILM ROLE));
>  on: FileSystem workingDirectory / 'FILMS.XML'.
>  h parseDocument.
>  ^ h
> 
> 
> 
> SmartSAXHAndler >> startElement: aQualifiedName attributes: aDictionary
> 
>  (visitor shouldVisit: aQualifiedName)
>  ifTrue: [
>  visitor
>  perform: (visitor createdVisitSelector: 
> aQualifiedName)
>  with: aQualifiedName
>  with: aDictionary
>  ]
> 
> 
> Object subclass: #GenericTagSAXVisitor
>  instanceVariableNames: 'visitTag visitTags'
>  classVariableNames: ''
>  category: 'SmartXMLHandler'
> 
> 
> GenericTagSAXVisitor>>visitTags: aCollection
>  "set the tags that will lead to a call to a visitTag:with: method in 
> the visitor"
> 
>  visitTags := aCollection collect: [ :each | each asLowercase ].
>  self createVisitMethods.
> 
> and in a subclass the visit* methods automatically generated
> 
> 
> Now I could not get when I have a Vertigo where I can get 
> the
> Vertigo information.
> I redefined several methods of SAXhandler but without success.
> 
> 
> 
> 
>
>  Vertigo
>  Drame
>  USA
>  
>  
>
>  James
>  Stewart
>  John Ferguson
>
>
>  Kim
>  Novak
>  Madeleine Elster
>
>  
>  Scottie Ferguson, ancien inspecteur de police, est sujet
> au vertige depuis qu'il a vu mourir son
>   collegue. Elster, son ami, le charge de surveiller sa femme,
> Madeleine, ayant des tendances
>   suicidaires. Amoureux de la jeune femme Scottie ne remarque pas le
> piege qui se trame autour
>   de lui et dont il va etre la victime... 
>
 

Re: [Pharo-users] Re RFC Minecraft Server


One guy told me that he is using with his kids

http://www.minetest.net/



Le 13/3/16 13:44, Andy Burnett a écrit :

Ben said
>>>
Which one?
<<<

The one people seem to use is called pocket mine. 
(https://www.pocketmine.net). There may be others.


>>>
I was thinking of the standard PC version since I understood the PE
version was not so amenable to mods. Actually my kids have been
playing PE edition on iPads, and I bought them second hand laptops to
run the PC edition to do modding. Still discovering how it all works.
<<<

The PE (iPad etc) version seems to be catching up in terms of 
features, and it does allow some level of mods. However, I agree that 
the full PC version is probably the better target.


I wonder if there are any docs that list the Api we need to support.





Re: [Pharo-users] How to access XML tag name?


Alex

I saw that Pastell is only tagged for Pharo30 and has not metadata.
It would be good to revise it.

Stef



Re: [Pharo-users] How to access XML tag name?




Le 13/3/16 13:33, stepharo a écrit :

Hi alex

I do not know :)
I like visitor because they are better than a series of if.
So I will see. I would like to help people to extract their 
information easily.
May be inside the visitNode I could use XPath (do you know what is the 
constraint to use XPath)

does it work on dom objects?

I would like to have something like that (being able to use some node 
to perform custom actions)
Now I do not see how from one visit method I can access the other. and 
if I do not do it in the visit
what is the information I should store (like parent link) to be able 
to identify that a given role is associated to a given film.


visitFilm
title := self extractFromChildren: #Titre.
pays := self extractFromChildren: #Pays.
self newFilm: title from: pays.
in fact for subnodes like role I should just continue the visit 
flow and get


But I will keep in mind XPath. It would be grtea to have tutorial on all 
these XML technologies



- SAX
- DOM
- PullParser
- XPath queries / Pastell
- Opax

It could be XML in Pharo a nice book





visitRole

 
 Vertigo
 Drame
 USA
 
 
   
 James
 Stewart
 John Ferguson
   
   
 Kim
 Novak
 Madeleine Elster
   



Stef


Le 13/3/16 11:26, Alexandre Bergel a écrit :

Hi Stef,

I have the impression that a visitor is not the ideal solution to 
query XML tree. It works well in some case, and it is disastrous in 
some other.
XPath is the way to query XML data. As far as I know, there is no 
complete support. Pastell was a nice try however...


Alexandre



On Mar 12, 2016, at 8:11 AM, stepharo  wrote:

Thanks

Ok it was characters: I will try it
What a bad name!

I will probably have to build a stack or dictionary of dictionary of 
the part that I will not want to visit but this is another story :)


Stef


Le 11/3/16 14:17, Blondeau Vincent a écrit :

Hi,

The qualified name in function startElement: aQualifiedName 
attributes: aDictionary, will be FILMS and after FILM and after 
TITRE,...etc...
So, you have to tell to your shouldVisit: method to accept TITRE 
too and get in and after you should implement characters: to get 
the content on the tag.


Vincent


-Message d'origine-
De : Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] De 
la part de

stepharo
Envoyé : vendredi 11 mars 2016 14:04
À : Any question about pharo is welcome
Objet : [Pharo-users] How to access XML tag name?

Hi

Yesterday I started to hack a smart SAX handler. The idea is that 
I want to just
specify the tags I want to visit and the SAX handler should invoke 
(generated)

visit methods. Like that I can easily get visitors on XML domain.

Here is an example of what I did.

  | h |
  h := SmartSAXHandler new
  visitor: (MyFilmVisitor new visitTags: #(FILM 
ROLE));

  on: FileSystem workingDirectory / 'FILMS.XML'.
  h parseDocument.
  ^ h



SmartSAXHAndler >> startElement: aQualifiedName attributes: 
aDictionary


  (visitor shouldVisit: aQualifiedName)
  ifTrue: [
  visitor
  perform: (visitor createdVisitSelector: 
aQualifiedName)

  with: aQualifiedName
  with: aDictionary
  ]


Object subclass: #GenericTagSAXVisitor
  instanceVariableNames: 'visitTag visitTags'
  classVariableNames: ''
  category: 'SmartXMLHandler'


GenericTagSAXVisitor>>visitTags: aCollection
  "set the tags that will lead to a call to a visitTag:with: 
method in the visitor"


  visitTags := aCollection collect: [ :each | each asLowercase ].
  self createVisitMethods.

and in a subclass the visit* methods automatically generated


Now I could not get when I have a Vertigo where I 
can get the

Vertigo information.
I redefined several methods of SAXhandler but without success.





  Vertigo
  Drame
  USA
  
  

  James
  Stewart
  John Ferguson


  Kim
  Novak
  Madeleine Elster

  
  Scottie Ferguson, ancien inspecteur de police, est 
sujet

au vertige depuis qu'il a vu mourir son
   collegue. Elster, son ami, le charge de surveiller sa femme,
Madeleine, ayant des tendances
   suicidaires. Amoureux de la jeune femme Scottie ne remarque pas le
piege qui se trame autour
   de lui et dont il va etre la victime... 

!!!* 

"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

[Pharo-users] Re RFC Minecraft Server

Ben said
>>>
Which one?
<<<

The one people seem to use is called pocket mine. (https://www.pocketmine.net). 
There may be others.

>>>
I was thinking of the standard PC version since I understood the PE
version was not so amenable to mods. Actually my kids have been
playing PE edition on iPads, and I bought them second hand laptops to
run the PC edition to do modding. Still discovering how it all works.
<<<

The PE (iPad etc) version seems to be catching up in terms of features, and it 
does allow some level of mods. However, I agree that the full PC version is 
probably the better target.

I wonder if there are any docs that list the Api we need to support.



Re: [Pharo-users] How to access XML tag name?


Alex

what Pastell brings compared to XPath?

Stef



Re: [Pharo-users] How to access XML tag name?


Hi alex

I do not know :)
I like visitor because they are better than a series of if.
So I will see. I would like to help people to extract their information 
easily.
May be inside the visitNode I could use XPath (do you know what is the 
constraint to use XPath)

does it work on dom objects?

I would like to have something like that (being able to use some node to 
perform custom actions)
Now I do not see how from one visit method I can access the other. and 
if I do not do it in the visit
what is the information I should store (like parent link) to be able to 
identify that a given role is associated to a given film.


visitFilm
title := self extractFromChildren: #Titre.
pays := self extractFromChildren: #Pays.
self newFilm: title from: pays.


visitRole

 
 Vertigo
 Drame
 USA
 
 
   
 James
 Stewart
 John Ferguson
   
   
 Kim
 Novak
 Madeleine Elster
   



Stef


Le 13/3/16 11:26, Alexandre Bergel a écrit :

Hi Stef,

I have the impression that a visitor is not the ideal solution to query XML 
tree. It works well in some case, and it is disastrous in some other.
XPath is the way to query XML data. As far as I know, there is no complete 
support. Pastell was a nice try however...

Alexandre



On Mar 12, 2016, at 8:11 AM, stepharo  wrote:

Thanks

Ok it was characters: I will try it
What a bad name!

I will probably have to build a stack or dictionary of dictionary of the part 
that I will not want to visit but this is another story :)

Stef


Le 11/3/16 14:17, Blondeau Vincent a écrit :

Hi,

The qualified name in function startElement: aQualifiedName attributes: 
aDictionary, will be FILMS and after FILM and after TITRE,...etc...
So, you have to tell to your shouldVisit: method to accept TITRE too and get in 
and after you should implement characters: to get the content on the tag.

Vincent


-Message d'origine-
De : Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] De la part de
stepharo
Envoyé : vendredi 11 mars 2016 14:04
À : Any question about pharo is welcome
Objet : [Pharo-users] How to access XML tag name?

Hi

Yesterday I started to hack a smart SAX handler. The idea is that I want to just
specify the tags I want to visit and the SAX handler should invoke (generated)
visit methods. Like that I can easily get visitors on XML domain.

Here is an example of what I did.

  | h |
  h := SmartSAXHandler new
  visitor: (MyFilmVisitor new visitTags: #(FILM ROLE));
  on: FileSystem workingDirectory / 'FILMS.XML'.
  h parseDocument.
  ^ h



SmartSAXHAndler >> startElement: aQualifiedName attributes: aDictionary

  (visitor shouldVisit: aQualifiedName)
  ifTrue: [
  visitor
  perform: (visitor createdVisitSelector: aQualifiedName)
  with: aQualifiedName
  with: aDictionary
  ]


Object subclass: #GenericTagSAXVisitor
  instanceVariableNames: 'visitTag visitTags'
  classVariableNames: ''
  category: 'SmartXMLHandler'


GenericTagSAXVisitor>>visitTags: aCollection
  "set the tags that will lead to a call to a visitTag:with: method in the 
visitor"

  visitTags := aCollection collect: [ :each | each asLowercase ].
  self createVisitMethods.

and in a subclass the visit* methods automatically generated


Now I could not get when I have a Vertigo where I can get the
Vertigo information.
I redefined several methods of SAXhandler but without success.





  Vertigo
  Drame
  USA
  
  

  James
  Stewart
  John Ferguson


  Kim
  Novak
  Madeleine Elster

  
  Scottie Ferguson, ancien inspecteur de police, est sujet
au vertige depuis qu'il a vu mourir son
   collegue. Elster, son ami, le charge de surveiller sa femme,
Madeleine, ayant des tendances
   suicidaires. Amoureux de la jeune femme Scottie ne remarque pas le
piege qui se trame autour
   de lui et dont il va etre la victime... 


!!!*
"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

Re: [Pharo-users] [Pillar] Ascii doc


AsciiDoc has other exporters.


Le 8/3/16 11:21, Dimitris Chloupis a écrit :

Why Ascii is important ? Whats its advantages ?

On Tue, Mar 8, 2016 at 11:42 AM Damien Cassou > wrote:


Thibault ARLOING mailto:thibault.arlo...@hotmail.fr>> writes:

> Yann Dubois and me were working on an asciidoc exporter for
Pillar, he is now ready and available in the development version
of Pillar.
> We will be gratefull for any feedbacks, thanks


that's great news. Asciidoc is getting traction as far as I can tell.
Thank you guys. One more exporter for Pillar!

--
Damien Cassou
http://damiencassou.seasidehosting.st

"Success is the ability to go from one failure to another without
losing enthusiasm." --Winston Churchill





Re: [Pharo-users] How to access XML tag name?


Hi hernan

I do not what I want :).
Irina a woman learning Pharo has a xml output from a tool (I have no 
idea what is inside :)

and I thought ok this is a good idea to check a bit the solutions in Pharo.

I will add your example to the PullParser Chapter. Because I like the 
Pull approach

I'm doing a pass on OPAX package because it was cool too.

Stef

Le 12/3/16 09:53, Hernán Morales Durand a écrit :

Hi Stephane,

Do you want to extract subtree from a XML?
Or just extract the text in specific nodes?

I think StAX parser is more friendly for selecting nodes (you don't 
have to subclass), i.e.:


| parser doc |
doc := '

  
Vertigo
Drame
USA


  
James
Stewart
John Ferguson
  
  
Kim
Novak
Madeleine Elster
  

Scottie Ferguson, ancien inspecteur de police, est sujet
au vertige depuis qu''il a vu mourir son
 collegue. Elster, son ami, le charge de surveiller sa femme, 
Madeleine, ayant des tendances
 suicidaires. Amoureux de la jeune femme Scottie ne remarque pas le 
piege qui se trame autour

 de lui et dont il va etre la victime... 
  
'.
parser := XMLPullParser parse: doc.
[ parser isEndDocument ] whileFalse: [
parser
if: 'FILM'
peek: [ : found |
Transcript show: found name , ' -> ' , found attributes 
asString; cr.

parser next.
Transcript show: parser tagName ].
parser next ]

Anyway if you want to try with SAX, have a look at #test01ParsingNodes 
and add some halts in BioNCBIBlastSAXParser to see it in action 
(that's in BioSmalltalk). I didn't used visitors though.


Hernán

2016-03-12 5:33 GMT-03:00 stepharo >:


This is more complex than that.
Because I would like to have a visitor generated from the token I
give.

And this
start
character
end

does not really help me.

Because in SAXHandler I have
start
where I should store the properties
   same in characters:
to store the name
   end
where I should invoke the visitor

Now it means that I should only store the information for the tag
I want.
Does anybody already did that and publish it?
I know doru did that in the past.
I will try.

Stef



Le 11/3/16 14:17, Blondeau Vincent a écrit :

Hi,


The qualified name in function startElement: aQualifiedName
attributes: aDictionary, will be FILMS and after FILM and
after TITRE,...etc...
So, you have to tell to your shouldVisit: method to accept
TITRE too and get in and after you should implement
characters: to get the content on the tag.

Vincent

-Message d'origine-
De : Pharo-users
[mailto:pharo-users-boun...@lists.pharo.org
] De la part de
stepharo
Envoyé : vendredi 11 mars 2016 14:04
À : Any question about pharo is welcome
Objet : [Pharo-users] How to access XML tag name?

Hi

Yesterday I started to hack a smart SAX handler. The idea
is that I want to just
specify the tags I want to visit and the SAX handler
should invoke (generated)
visit methods. Like that I can easily get visitors on XML
domain.

Here is an example of what I did.

  | h |
  h := SmartSAXHandler new
  visitor: (MyFilmVisitor new visitTags:
#(FILM ROLE));
  on: FileSystem workingDirectory /
'FILMS.XML'.
  h parseDocument.
  ^ h



SmartSAXHAndler >> startElement: aQualifiedName
attributes: aDictionary

  (visitor shouldVisit: aQualifiedName)
  ifTrue: [
  visitor
  perform: (visitor
createdVisitSelector: aQualifiedName)
  with: aQualifiedName
  with: aDictionary
  ]


Object subclass: #GenericTagSAXVisitor
  instanceVariableNames: 'visitTag visitTags'
  classVariableNames: ''
  category: 'SmartXMLHandler'


GenericTagSAXVisitor>>visitTags: aCollection
  "set the tags that will lead to a call to a
visitTag:with: method in the visitor"

  visitTags := aCollection collect: [ :each | each
asLowercase ].
  self createVisitMethods.

and in a subclass the visit* methods automatically generated


Now I could not get when I have a Vertigo
where I can get the
Vertigo infor

Re: [Pharo-users] Roassal2 on Ubuntu 64

I have just updated:
https://dl.dropboxusercontent.com/u/31543901/AgileVisualization/QuickStart/0101-QuickStart.html

Let me know if something is missing

Cheers,
Alexandre


> On Mar 12, 2016, at 10:54 PM, Evan Donahue  wrote:
> 
> Aha, I followed the Quick Start at 
> https://dl.dropboxusercontent.com/u/31543901/AgileVisualization/QuickStart/0101-QuickStart.html
> and didn't notice anything there.
> 
> Cheers,
> Evan
> 
> 
> 
> --
> View this message in context: 
> http://forum.world.st/Roassal2-on-Ubuntu-64-tp4883675p4884245.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
> 

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






Re: [Pharo-users] Roassal2 on Ubuntu 64

I would like to improve the documentation. However, there is no linux around I 
can play with. 
What is the necessary steps to have Cairo on Ubuntu, only executing:

$ sudo apt-get install libcairo2:i386

Or is there anything more to be done?

Cheers,
Alexandre

> On Mar 12, 2016, at 10:54 PM, Evan Donahue  wrote:
> 
> Aha, I followed the Quick Start at 
> https://dl.dropboxusercontent.com/u/31543901/AgileVisualization/QuickStart/0101-QuickStart.html
> and didn't notice anything there.
> 
> Cheers,
> Evan
> 
> 
> 
> --
> View this message in context: 
> http://forum.world.st/Roassal2-on-Ubuntu-64-tp4883675p4884245.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
> 

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






Re: [Pharo-users] How to access XML tag name?

Hi Stef,

I have the impression that a visitor is not the ideal solution to query XML 
tree. It works well in some case, and it is disastrous in some other.
XPath is the way to query XML data. As far as I know, there is no complete 
support. Pastell was a nice try however...

Alexandre


> On Mar 12, 2016, at 8:11 AM, stepharo  wrote:
> 
> Thanks
> 
> Ok it was characters: I will try it
> What a bad name!
> 
> I will probably have to build a stack or dictionary of dictionary of the part 
> that I will not want to visit but this is another story :)
> 
> Stef
> 
> 
> Le 11/3/16 14:17, Blondeau Vincent a écrit :
>> Hi,
>> 
>> The qualified name in function startElement: aQualifiedName attributes: 
>> aDictionary, will be FILMS and after FILM and after TITRE,...etc...
>> So, you have to tell to your shouldVisit: method to accept TITRE too and get 
>> in and after you should implement characters: to get the content on the tag.
>> 
>> Vincent
>> 
>>> -Message d'origine-
>>> De : Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] De la part de
>>> stepharo
>>> Envoyé : vendredi 11 mars 2016 14:04
>>> À : Any question about pharo is welcome
>>> Objet : [Pharo-users] How to access XML tag name?
>>> 
>>> Hi
>>> 
>>> Yesterday I started to hack a smart SAX handler. The idea is that I want to 
>>> just
>>> specify the tags I want to visit and the SAX handler should invoke 
>>> (generated)
>>> visit methods. Like that I can easily get visitors on XML domain.
>>> 
>>> Here is an example of what I did.
>>> 
>>>  | h |
>>>  h := SmartSAXHandler new
>>>  visitor: (MyFilmVisitor new visitTags: #(FILM ROLE));
>>>  on: FileSystem workingDirectory / 'FILMS.XML'.
>>>  h parseDocument.
>>>  ^ h
>>> 
>>> 
>>> 
>>> SmartSAXHAndler >> startElement: aQualifiedName attributes: aDictionary
>>> 
>>>  (visitor shouldVisit: aQualifiedName)
>>>  ifTrue: [
>>>  visitor
>>>  perform: (visitor createdVisitSelector: aQualifiedName)
>>>  with: aQualifiedName
>>>  with: aDictionary
>>>  ]
>>> 
>>> 
>>> Object subclass: #GenericTagSAXVisitor
>>>  instanceVariableNames: 'visitTag visitTags'
>>>  classVariableNames: ''
>>>  category: 'SmartXMLHandler'
>>> 
>>> 
>>> GenericTagSAXVisitor>>visitTags: aCollection
>>>  "set the tags that will lead to a call to a visitTag:with: method in 
>>> the visitor"
>>> 
>>>  visitTags := aCollection collect: [ :each | each asLowercase ].
>>>  self createVisitMethods.
>>> 
>>> and in a subclass the visit* methods automatically generated
>>> 
>>> 
>>> Now I could not get when I have a Vertigo where I can get the
>>> Vertigo information.
>>> I redefined several methods of SAXhandler but without success.
>>> 
>>> 
>>> 
>>> 
>>>
>>>  Vertigo
>>>  Drame
>>>  USA
>>>  
>>>  
>>>
>>>  James
>>>  Stewart
>>>  John Ferguson
>>>
>>>
>>>  Kim
>>>  Novak
>>>  Madeleine Elster
>>>
>>>  
>>>  Scottie Ferguson, ancien inspecteur de police, est sujet
>>> au vertige depuis qu'il a vu mourir son
>>>   collegue. Elster, son ami, le charge de surveiller sa femme,
>>> Madeleine, ayant des tendances
>>>   suicidaires. Amoureux de la jeune femme Scottie ne remarque pas le
>>> piege qui se trame autour
>>>   de lui et dont il va etre la victime... 
>>>
>> 
>> !!!*
>> "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.!!!"
> 
> 

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

Re: [Pharo-users] [FUN] Fibonacci spiral

Ah, thanks

Hilaire

Le 10/03/2016 22:18, Offray Vladimir Luna Cárdenas a écrit :
> Nice. May be there is a typo on the phrase "mathematician from the XIIIe
> century" (the "e" at the end of XIII looks strange).

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




Re: [Pharo-users] Desktop unrefresh bug on 4.0

I fixed differently, I open the process browser and terminate one UI
process.

Hilaire

Le 13/03/2016 10:54, Esteban Lorenzano a écrit :
> you have an UI thread extra there :)
> “common” fix is to spawn dome cmd+. until you get the debugger, close all 
> that and you are done :)
> 
> Esteban

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




Re: [Pharo-users] Desktop unrefresh bug on 4.0

you have an UI thread extra there :)
“common” fix is to spawn dome cmd+. until you get the debugger, close all that 
and you are done :)

Esteban

> On 13 Mar 2016, at 10:35, Hilaire  wrote:
> 
> 




Re: [Pharo-users] Desktop unrefresh bug on 4.0

Oops, forgot to join a screen capture of the pharo dekstop.

Oh, by the way, the short cut for screen udpate does not work (alt+r or
ctrl+r).

Hilaire

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


[Pharo-users] Desktop unrefresh bug on 4.0

Hello,

Under 4.0, the Pharo desktop suddenly get unrefreshed, so you can
imagine the mess. See enclosed screenshot.

Do any of you meet this problem?

How to solve it?

I did not find any related bug report.


Thanks

Hilaire

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