Pharo-users
By thread
pharo-users@lists.pharo.org
By month
Messages by month
- ----- 2026 -----
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- 7 participants
- 50354 messages
Re: [Pharo-users] Woden-Roassal 3d object rotations
by Lusa Nicolas
Hello it's me again,
I've been playing around a little and found a bug which makes all rotations the same. No matter which rotation you call it is always going to rotate around the X axis.
I guess that is due the fact that all the three rotations end up calling: (self class xrot: angle) * self, in the respective method. (i.e. WDMatrix3>>#RotatedByY:).
The fix is just to change the xrot with the respective rot of the axis that we are rotating.
Thanks again for the rotations.
Cheers,
Nicolas
On Apr 27, 2015, at 10:30 AM, Lusa Nicolas <nicolas.lusa(a)usi.ch<mailto:nicolas.lusa@usi.ch>>
wrote:
Hello mr. Salgado,
I've just tried it out really quickly and it looks awesome! Looking forward to use it in my project.
Thank you!
Cheers,
Nicolas
On Apr 27, 2015, at 9:36 AM, Ronie Salgado <roniesalg(a)gmail.com<mailto:roniesalg@gmail.com>>
wrote:
Hello Mr. Lusa,
Sorry for not answering earlier, I added the missing support for the rotations by adding some methods that changes the internal scene node orientation. I also did a small refactoring in the support for orientation, because I received email with an implementation of quaternions that I have review and integrate during the week.
Try the following in the playground:
v := RWView new.
element := RWCube element.
element rotateByXDegrees: 60.
v add: element.
v open.
Best regards,
Ronie
2015-04-27 3:55 GMT-03:00 Lusa Nicolas <nicolas.lusa(a)usi.ch<mailto:nicolas.lusa@usi.ch>>:
Hello mr. Bergel,
I actually have done something really simple. On the construction of a cube shape in WDGeometryBuilder I simply made a method looking as follows: WDGeometryBuilder>>#addCubeWithWidth: height: depth: rotatedBy: .
In the method I simply use the angle to compute the rotation when creating every single triangle (rotating every point of such triangle with respect to the y axis).
It would work smoothly if only few shapes would have been instantiated but unfortunately this results in a severe drop of performance since a new shape is created for every instance of an object (because the angle rotation is different for each shape).
If you still want the code I wrote for such rotation I can provide it to you, but probably that's not how proper rotations should be performed in woden.
Hopefully we can find a better solution that doesn't influence performance in such way.
Cheers,
Nicolas
P.S. I apologize for the misleading subject of the mail. I am not using Roassal3d but I am using a package called Woden-Roassal, which works almost exactly like Roassal3d (in fact I guess they are related somehow), that is in the Woden project as default. A more appropriate e-mail subject would have been: Woden-Roassal (3d object rotations).
On Apr 24, 2015, at 10:49 PM, Alexandre Bergel <alexandre.bergel(a)me.com<mailto:alexandre.bergel@me.com>>
wrote:
Hi Lusa,
Well spotted!
I worked on the connection Woden <â> Roassal3d. I should be able to hook your rotation into roassal. Can you provide your fix for the rotation please?
Cheers,
Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel http://www.bergel.eu<http://www.bergel.eu/>
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
On Apr 22, 2015, at 9:07 AM, Lusa Nicolas <nicolas.lusa(a)usi.ch<mailto:nicolas.lusa@usi.ch>> wrote:
Hi,
I am still working with Woden, in particular with Woden-Roassal and I noticed that rotations on objects are missing (I feel that this is weird that it doesn't have such feature so I am not excluding that I can be wrong but I didn't manage to find anything in the code to rotate objects).
Now if I would like to rotate objects it wouldn't be too bad if I were using Woden at his "lowest layer" but I am actually building cubes with Woden-Roassal and there I get lost.
I already made some rotations on Woden built arbitrary objects, now I would like to extend it to objects built from Woden-Roassal but I honestly miss on finding the connection between the two.
I saw that the base shape is built in: RWCube>>#createBaseShapeNode, I would be able to build a rotated shape from there but that would result in all shapes being rotated in such way since in RWSimpleShape>>#buildRenderableFor:view: when we select the shape:
baseShape := aView baseShapeNodeNamed: self baseShapeName ifAbsentPut: [ self createBaseShapeNode ].
we would get back the previous base shape defined.
Any suggestions on how to do it?
Cheers,
Nicolas
April 27, 2015
Re: [Pharo-users] The Pillar TextMate plugin can now preview Pillar files
by Luc Fabresse
ok Cyril was right, the problem was because of generated filename changes
in Pillar.
It is now fixed in the latest version of the plugin.
#Luc
2015-04-25 22:26 GMT+02:00 Luc Fabresse <luc.fabresse(a)gmail.com>:
>
> Perhaps I answered too fast and Cyril is right.
> Stef, tell me if this is the case and I will patch the plugin.
>
> #Luc
>
> 2015-04-25 22:21 GMT+02:00 Luc Fabresse <luc.fabresse(a)gmail.com>:
>
>> Hey, I wrote a six line README on
>> https://github.com/pillar-markup/Pillar.tmbundle
>> and you miss the latest step apparently ;-)
>>
>>
>> - Open TextMate preferences and add these 2 shell variables :
>> - PHARO_VM that gives the absolute path to the PharoVM Example:
>> /Users/bob/Pharo/VirtualMachines/pharo
>> - PILLAR_IMAGE that gives the absolute path to the image to use
>> for processing Pillar files Example:
>> /Users/bob/Repositories/PharoBooks/BookSkeleton.git/Pharo.image
>>
>>
>> #Luc
>>
>> 2015-04-25 22:15 GMT+02:00 stepharo <stepharo(a)free.fr>:
>>
>>> hi luc
>>>
>>> I did
>>>
>>> git clone https://github.com/pillar-markup/Pillar.tmbundle
>>> cd Pillar.tmbundle
>>> open .
>>> and mate asked me if I want to plugin
>>> did yes
>>>
>>> commd-R
>>>
>>> Typeset and view: line 15: pillar: command not found cat:
>>> /Users/ducasse/Workspace/FirstCircle/MyBooks/Bk-Writing/PharoBooks/FunWithPharo/TinyChat/TinyChat.pillar.html:
>>> No such file or directory
>>>
>>> What is the pillar command?
>>>
>>> Stef
>>>
>>> Le 25/4/15 11:42, Cyril Ferlicot a écrit :
>>>
>>> Thank you ! :)
>>>
>>> Le samedi 25 avril 2015, Luc Fabresse <luc.fabresse(a)gmail.com> a écrit :
>>>
>>>> Hi Happy Pharoers,
>>>>
>>>> Since I am editing more and more Pillar files these days, I enhanced
>>>> the Pillar TextMate2 plugin made by Uko (thanks ;-)) to easily have a web
>>>> preview (just by pressing âR).
>>>>
>>>> The plugin is here: https://github.com/pillar-markup/Pillar.tmbundle
>>>>
>>>> Have fun,
>>>>
>>>> #Luc
>>>>
>>>> [image: Images intégrées 2]Hi
>>>>
>>>
>>>
>>> --
>>> Cheers
>>> Cyril Ferlicot
>>>
>>>
>>>
>>
>
April 27, 2015
Question about Text Editor.
by Cyril Ferlicot
Hi,
I wanted to do a little text editor and I would like to know if
someone already did one with simple features like open a file, save a
file etc...
I don't want to lose too much time in something that already exist.
--
Cheers
Cyril Ferlicot
April 27, 2015
Re: [Pharo-users] Woden-Roassal 3d object rotations
by Lusa Nicolas
Hello mr. Salgado,
I've just tried it out really quickly and it looks awesome! Looking forward to use it in my project.
Thank you!
Cheers,
Nicolas
On Apr 27, 2015, at 9:36 AM, Ronie Salgado <roniesalg(a)gmail.com<mailto:roniesalg@gmail.com>>
wrote:
Hello Mr. Lusa,
Sorry for not answering earlier, I added the missing support for the rotations by adding some methods that changes the internal scene node orientation. I also did a small refactoring in the support for orientation, because I received email with an implementation of quaternions that I have review and integrate during the week.
Try the following in the playground:
v := RWView new.
element := RWCube element.
element rotateByXDegrees: 60.
v add: element.
v open.
Best regards,
Ronie
2015-04-27 3:55 GMT-03:00 Lusa Nicolas <nicolas.lusa(a)usi.ch<mailto:nicolas.lusa@usi.ch>>:
Hello mr. Bergel,
I actually have done something really simple. On the construction of a cube shape in WDGeometryBuilder I simply made a method looking as follows: WDGeometryBuilder>>#addCubeWithWidth: height: depth: rotatedBy: .
In the method I simply use the angle to compute the rotation when creating every single triangle (rotating every point of such triangle with respect to the y axis).
It would work smoothly if only few shapes would have been instantiated but unfortunately this results in a severe drop of performance since a new shape is created for every instance of an object (because the angle rotation is different for each shape).
If you still want the code I wrote for such rotation I can provide it to you, but probably that's not how proper rotations should be performed in woden.
Hopefully we can find a better solution that doesn't influence performance in such way.
Cheers,
Nicolas
P.S. I apologize for the misleading subject of the mail. I am not using Roassal3d but I am using a package called Woden-Roassal, which works almost exactly like Roassal3d (in fact I guess they are related somehow), that is in the Woden project as default. A more appropriate e-mail subject would have been: Woden-Roassal (3d object rotations).
On Apr 24, 2015, at 10:49 PM, Alexandre Bergel <alexandre.bergel(a)me.com<mailto:alexandre.bergel@me.com>>
wrote:
Hi Lusa,
Well spotted!
I worked on the connection Woden <â> Roassal3d. I should be able to hook your rotation into roassal. Can you provide your fix for the rotation please?
Cheers,
Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel http://www.bergel.eu<http://www.bergel.eu/>
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
On Apr 22, 2015, at 9:07 AM, Lusa Nicolas <nicolas.lusa(a)usi.ch<mailto:nicolas.lusa@usi.ch>> wrote:
Hi,
I am still working with Woden, in particular with Woden-Roassal and I noticed that rotations on objects are missing (I feel that this is weird that it doesn't have such feature so I am not excluding that I can be wrong but I didn't manage to find anything in the code to rotate objects).
Now if I would like to rotate objects it wouldn't be too bad if I were using Woden at his "lowest layer" but I am actually building cubes with Woden-Roassal and there I get lost.
I already made some rotations on Woden built arbitrary objects, now I would like to extend it to objects built from Woden-Roassal but I honestly miss on finding the connection between the two.
I saw that the base shape is built in: RWCube>>#createBaseShapeNode, I would be able to build a rotated shape from there but that would result in all shapes being rotated in such way since in RWSimpleShape>>#buildRenderableFor:view: when we select the shape:
baseShape := aView baseShapeNodeNamed: self baseShapeName ifAbsentPut: [ self createBaseShapeNode ].
we would get back the previous base shape defined.
Any suggestions on how to do it?
Cheers,
Nicolas
April 27, 2015
Re: [Pharo-users] Woden-Roassal 3d object rotations
by Ronie Salgado
Hello Mr. Lusa,
Sorry for not answering earlier, I added the missing support for the
rotations by adding some methods that changes the internal scene node
orientation. I also did a small refactoring in the support for orientation,
because I received email with an implementation of quaternions that I have
review and integrate during the week.
Try the following in the playground:
v := RWView new.
element := RWCube element.
element rotateByXDegrees: 60.
v add: element.
v open.
Best regards,
Ronie
2015-04-27 3:55 GMT-03:00 Lusa Nicolas <nicolas.lusa(a)usi.ch>:
> Hello mr. Bergel,
>
> I actually have done something really simple. On the construction of a
> cube shape in WDGeometryBuilder I simply made a method looking as follows:
> WDGeometryBuilder>>#addCubeWithWidth: height: depth: rotatedBy: .
> In the method I simply use the angle to compute the rotation when creating
> every single triangle (rotating every point of such triangle with respect
> to the y axis).
> It would work smoothly if only few shapes would have been instantiated but
> unfortunately this results in a severe drop of performance since a new
> shape is created for every instance of an object (because the angle
> rotation is different for each shape).
> If you still want the code I wrote for such rotation I can provide it to
> you, but probably that's not how proper rotations should be performed in
> woden.
>
> Hopefully we can find a better solution that doesn't influence
> performance in such way.
>
> Cheers,
> Nicolas
>
> P.S. I apologize for the misleading subject of the mail. I am not using
> Roassal3d but I am using a package called Woden-Roassal, which works almost
> exactly like Roassal3d (in fact I guess they are related somehow), that is
> in the Woden project as default. A more appropriate e-mail subject would
> have been: Woden-Roassal (3d object rotations).
>
> On Apr 24, 2015, at 10:49 PM, Alexandre Bergel <alexandre.bergel(a)me.com>
> wrote:
>
> Hi Lusa,
>
> Well spotted!
> I worked on the connection Woden <â> Roassal3d. I should be able to hook
> your rotation into roassal. Can you provide your fix for the rotation
> please?
>
> Cheers,
> Alexandre
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>
> On Apr 22, 2015, at 9:07 AM, Lusa Nicolas <nicolas.lusa(a)usi.ch> wrote:
>
> Hi,
>
> I am still working with Woden, in particular with Woden-Roassal and I
> noticed that rotations on objects are missing (I feel that this is weird
> that it doesn't have such feature so I am not excluding that I can be wrong
> but I didn't manage to find anything in the code to rotate objects).
>
> Now if I would like to rotate objects it wouldn't be too bad if I were
> using Woden at his "lowest layer" but I am actually building cubes with
> Woden-Roassal and there I get lost.
>
> I already made some rotations on Woden built arbitrary objects, now I
> would like to extend it to objects built from Woden-Roassal but I honestly
> miss on finding the connection between the two.
>
> I saw that the base shape is built in: RWCube>>#createBaseShapeNode, I
> would be able to build a rotated shape from there but that would result in
> all shapes being rotated in such way since in
> RWSimpleShape>>#buildRenderableFor:view: when we select the shape:
> baseShape := aView baseShapeNodeNamed: self baseShapeName ifAbsentPut: [
> self createBaseShapeNode ].
> we would get back the previous base shape defined.
>
> Any suggestions on how to do it?
>
> Cheers,
> Nicolas
>
>
>
>
April 27, 2015
Re: [Pharo-users] Woden-Roassal 3d object rotations
by Lusa Nicolas
Hello mr. Bergel,
I actually have done something really simple. On the construction of a cube shape in WDGeometryBuilder I simply made a method looking as follows: WDGeometryBuilder>>#addCubeWithWidth: height: depth: rotatedBy: .
In the method I simply use the angle to compute the rotation when creating every single triangle (rotating every point of such triangle with respect to the y axis).
It would work smoothly if only few shapes would have been instantiated but unfortunately this results in a severe drop of performance since a new shape is created for every instance of an object (because the angle rotation is different for each shape).
If you still want the code I wrote for such rotation I can provide it to you, but probably that's not how proper rotations should be performed in woden.
Hopefully we can find a better solution that doesn't influence performance in such way.
Cheers,
Nicolas
P.S. I apologize for the misleading subject of the mail. I am not using Roassal3d but I am using a package called Woden-Roassal, which works almost exactly like Roassal3d (in fact I guess they are related somehow), that is in the Woden project as default. A more appropriate e-mail subject would have been: Woden-Roassal (3d object rotations).
On Apr 24, 2015, at 10:49 PM, Alexandre Bergel <alexandre.bergel(a)me.com<mailto:alexandre.bergel@me.com>>
wrote:
Hi Lusa,
Well spotted!
I worked on the connection Woden <â> Roassal3d. I should be able to hook your rotation into roassal. Can you provide your fix for the rotation please?
Cheers,
Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel http://www.bergel.eu<http://www.bergel.eu/>
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
On Apr 22, 2015, at 9:07 AM, Lusa Nicolas <nicolas.lusa(a)usi.ch<mailto:nicolas.lusa@usi.ch>> wrote:
Hi,
I am still working with Woden, in particular with Woden-Roassal and I noticed that rotations on objects are missing (I feel that this is weird that it doesn't have such feature so I am not excluding that I can be wrong but I didn't manage to find anything in the code to rotate objects).
Now if I would like to rotate objects it wouldn't be too bad if I were using Woden at his "lowest layer" but I am actually building cubes with Woden-Roassal and there I get lost.
I already made some rotations on Woden built arbitrary objects, now I would like to extend it to objects built from Woden-Roassal but I honestly miss on finding the connection between the two.
I saw that the base shape is built in: RWCube>>#createBaseShapeNode, I would be able to build a rotated shape from there but that would result in all shapes being rotated in such way since in RWSimpleShape>>#buildRenderableFor:view: when we select the shape:
baseShape := aView baseShapeNodeNamed: self baseShapeName ifAbsentPut: [ self createBaseShapeNode ].
we would get back the previous base shape defined.
Any suggestions on how to do it?
Cheers,
Nicolas
April 27, 2015
{ANN] TMM (Teapot, Mustache, Mongo) web application stack
by Yanni Chiu
Hi,
I cleaned up and released some demo code I put together for a Smalltalk user group meeting. The code was extracted from a project Iâve been working on. It also uses Magritte3, Voyage, and ZincSSO, but thatâs too many pieces to include in the web-app-stack name
I was working in Pharo3, so I took the opportunity to upgrade to Pharo4. I had no problems with Pharo4 itself, but I had some minor issues with the updated Teapot and VoyageMongo versions:
- VoyageMongo - <mongoContainer> pragma is now expected on class-side, not the instance-side
- Teapot - To read/parse template files on each request (which is convenient during development) I had intercepted an internal API. This API changed slightly, which needed a simple fix, but it was hard to find
I also decided to use a âgitâ repository. This turned out to be one of the hardest parts, but I think it was worth the effort.
To try TMM, follow the instructions at:
https://github.com/yannij/TMM
Enhancements are welcome, but I donât quite know how this git workflow will pan out. Iâve already got a few changes to port over:
- a more integrated file upload example
- an email/passwordHash stored in the User object in mongo.
â
Yanni
April 27, 2015
Re: [Pharo-users] XMLParser GTInspector extensions
by Ben Coman
On Mon, Apr 27, 2015 at 3:19 AM, Tudor Girba <tudor(a)tudorgirba.com> wrote:
> Hi,
>
> There already exists a GT-InspectorExtensions-XML which is already
> published in the GT repository.
>
Cool. I'll revert my changes. However its not very discoverable that
people need to check that repository for any particular application. I
even took a few guesses to find the repository
Smalltalkhub/Moose/GToolkit. Also, I understand from...
http://pharo.gemtalksystems.com/book/LanguageAndLibraries/XML/XML-support-i…
that there are different XML packages, so its not obvious from your package
which system it applies to. Though from context here I guess it is
XML-Parser, others coming later won't have that context. (I guess a
separate GT-InspectorExtensions-* package is needed for each XML system.)
Now when I add some GT extensions to my own package, should I put my
GT-InspectorExtensions-MyApplication package in your repository? And can I
have write access to maintain it ;) ? It would be good to manage these
extensions consistently across the community.
So what do you think of...
* Updating ConfigurationOfXMLParser to automatically load the extensions
for Pharo4.
* Moving the package into the XML-Parser repository so it sits next to
other compatibility packages like XML-Parser-GemstoneCompatability -- and
possibly renaming it something like XML-Parser-GT-Extensions.
> I would prefer to qualify the extensions by the tool they refer to:
> GT-InspectorExtensions-*, GT-SpotterExtensions-* etc.
>
> gtDisplayOn: should be more in the inspector, but probably some were added
> mostly in the spotter so they ended up in the less optimal package.
>
okay. good to understand.
cheers -ben
>
> Cheers,
> Doru
>
>
>
> On Sun, Apr 26, 2015 at 8:30 PM, Ben Coman <btc(a)openinworld.com> wrote:
>
>> I happened to need to use and XML Parser for the first time and found
>> inspecting the structure awkward, so I added some GTInspector extensions to
>> XML-Parser. This is uploaded as XML-Parser-BenComan.304 to
>> http://smalltalkhub.com/#!/~PharoExtras/XMLParser. Could someone who
>> uses XML regularly check if these are reasonable?
>>
>> Now should these methods be packaged separately somehow, since they are
>> likely not of interest to other Smalltalk flavours?
>>
>> btw I gave them a protocol of "GT-Extensions" - but I also considered
>> "moldable-tools" and "tools-extensions". If there a preference? This will
>> likely be a common occurrence across the community, so we should try for a
>> consistent convention across the community for such extensions.
>>
>> btw2, I notice that #gtDisplayOn: implementors are fairly evenly split
>> between [GT-InspectorExtensions-Core] and [GT-SpotterExtensions-Core]. Are
>> they really separated like this in their use?
>>
>> cheers -ben
>>
>
>
>
> --
> www.tudorgirba.com
>
> "Every thing has its own flow"
>
April 27, 2015
Re: [Pharo-users] STON distributed control version and long lines (it was Re: Citizen example for manipulating a bibtex file)
by Sven Van Caekenberghe
Hi Offray,
In STON #bleedingEdge you will find:
===
Name: STON-Core-SvenVanCaekenberghe.57
Author: SvenVanCaekenberghe
Time: 26 April 2015, 11:53:58.308533 pm
UUID: f38b0222-94ea-4a0a-9878-03649843c97e
Ancestors: STON-Core-SvenVanCaekenberghe.56
Added STONReader>>#convertNewLines: and STONReader>>#newLine: to read and convert CR, LF, or CRLF inside strings and symbols as one chosen canonical newLine
Added STONWriter>>#keepNewLines: to write CR, LF or CRLF inside strings and symbols unencoded as one chosen canonical newLine
Add unit tests #testConvertingNewLine #testKeepingNewLines and #testIllegalCharacterEscapes
Added some more documentation
===
Name: STON-Tests-SvenVanCaekenberghe.52
Author: SvenVanCaekenberghe
Time: 26 April 2015, 11:54:29.166526 pm
UUID: 8b393798-e0e0-4ca4-9f54-64e487c228cc
Ancestors: STON-Tests-SvenVanCaekenberghe.51
Added STONReader>>#convertNewLines: and STONReader>>#newLine: to read and convert CR, LF, or CRLF inside strings and symbols as one chosen canonical newLine
Added STONWriter>>#keepNewLines: to write CR, LF or CRLF inside strings and symbols unencoded as one chosen canonical newLine
Add unit tests #testConvertingNewLine #testKeepingNewLines and #testIllegalCharacterEscapes
Added some more documentation
===
So, if you do
(STON writer on: ...)
newLine: String crlf;
keepNewLines: true;
nextPut: ...
any CR, LF or CRLF inside any String will no longer be written as \r, \n or \r\n but all as CRLF, a normal EOL.
Similarly, if you do
(STON reader on: ..)
newLine: String crlf;
convertNewLines: true;
next.
any CR, LF or CRLF seen while reading Strings will all be converted to the same EOL, CRLF.
Please have a look and see if this can help solve your problem. And let me know how it went.
Sven
> On 25 Apr 2015, at 00:12, Offray Vladimir Luna Cárdenas <offray(a)riseup.net> wrote:
>
> Hi Sven,
>
> I would like to retake this conversation. I wasn't able to answer before because I was trying to get minimal functionality for grafoscopio and now that is there, I would like to tackle the issue of long lines in STON, so it can become Distributed Version Control Systems friendly.
>
> To understand better your proposal, lets try it with a real "document" stored in STON, the one at [1]. This is the grafoscopio alpha manual in Spanish, with long lines. I would like to test it with your second propossal, and change the newline inside strings as CRLF. A successful test case after applying the change would be that I can diff two commits of the manual and compare them inside our DVCS (fossil-scm), without it getting the file confused with a binary file.
>
> [1] mutabit.com/deltas/repos.fossil/grafoscopio/doc/tip/Docs/Es/Manual/manual-g…
>
> I imagine you need to do some change to STON to implement this, but I'm willing to make any test from this side and report them back to you.
>
> Making STON DVCS friendly would open a lot of collaboration on interactive documentation and other places where STON can be used as an storage format (like we are doing).
>
> So, how can we proceed?
>
> Thanks,
>
> Offray
>
> El 26/11/14 a las 10:40, Sven Van Caekenberghe escribió:
>> Hi Offray,
>>
>> I think I better understand what you are doing now, and how you are using STON.
>>
>> What I think might help you (in your use case), is to add two options:
>>
>> 1 - to STONWriter #keepNewlines that converts any newline inside Strings to a newline as specified by #newline: instead of encoding it as unprintable
>> 2 - to STONReader #convertNewlines that converts any newline inside Strings to a newline as specified by #newline: instead of keeping it as is
>>
>> Now, 2 is already there, except that any newline read is kept as it is, while I think it would be better to convert CR, LF and CRLF to just one (to be specified).
>>
>> Similarly, 1 would convert CR, LF and CRLF to a single one (to be specified).
>>
>> Without these conversions, mixups between different line end conventions could easily happen. I think it is too much work to do this in your own models.
>>
>> If you think this would help, I'll put this on my todo.
>>
>> Sven
>>
>>> On 18 Nov 2014, at 02:50, Offray Vladimir Luna Cárdenas <offray(a)riseup.net> wrote:
>>>
>>> Hi Sven,
>>>
>>> Sorry for my late response. The constructive comments on the list and yours in particular are very valuable to my. I was finishing some details, so only until now I have the time to implement your suggestions. The new code for custom keys on bibtex files from pharo is published at [1] (by the grace of Doru's easy publishing of playgrounds on your stfx server)
>>>
>>> [1] http://ws.stfx.eu/3CEKQQQ3NL2E
>>>
>>> By the way the article I'm writing is about a tool for open, citizen, garage research and science developed in Pharo. It is published at [2] and was stored nicely using STON[3] and is superb. To test the tool, the article was wrote on it.
>>>
>>> [2] http://mutabit.com/deltas/repos.fossil/grafoscopio/doc/tip/Docs/Es/Articulo…
>>>
>>> [3] http://mutabit.com/deltas/repos.fossil/grafoscopio/doc/tip/Docs/Es/Articulo…
>>>
>>> [4] http://mutabit.com/deltas/repos.fossil/grafoscopio/doc/tip/Docs/Es/Articulo…
>>>
>>> The only thing I would add to STON would be an option to support line breaks so long character sequences can be broken to make the format DVCS friendly (git, fossil, etc) and support collaboration and changes tracking. At this moment, because of the long lines in STON, the files are treated as binaries by fossil :-/.
>>>
>>> Thanks for STON and your lessons,
>>>
>>> Offray
>>>
>>> El 22/10/14 a las #4, Sven Van Caekenberghe escribió:
>>>>
>>>>> On 22 Oct 2014, at 18:42, Offray Vladimir Luna Cárdenas <offray(a)riseup.net> wrote:
>>>>>
>>>>> Hi,
>>>>>
>>>>> Thanks again. I have a small script, using Citezen which does the trick. I can explore and modify the BibTeX File from the playground with this:
>>>>>
>>>>> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
>>>>> | bibFile bibliography bibStream bibOutputer |
>>>>> bibFile := ((FileLocator documents / 'U/Libertadores/Grafoscopio') children
>>>>> detect: [:each | each basename endsWith: 'bib' ]).
>>>>> bibliography := CZBibParser parse: bibFile contents.
>>>>> bibStream := '' writeStream.
>>>>> 1 to: (bibliography size) do: [:index |
>>>>> (((bibliography entries at: index) fields at: 2) key = 'shorttitle')
>>>>> ifTrue: [
>>>>> (bibliography entries at: index)
>>>>> key: ((bibliography entries at: index) fields at: 2) value].
>>>>> bibOutputer := CZBibtexOutputer new.
>>>>> bibStream nextPutAll:
>>>>> (bibOutputer entryToBibtexString:
>>>>> (bibliography entries at: index)); cr.].
>>>>> bibliography.
>>>>> bibFile writeStreamDo: [:stream |
>>>>> stream nextPutAll: bibStream contents withUnixLineEndings ].
>>>>> bibStream contents.
>>>>> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
>>>>
>>>> Some constructive comments about your code (smaller is always better, especially for interactive snippets):
>>>>
>>>> - you can change the #detect: to [ :each | each extension = #bib ]
>>>> - you can iterate directly over the entries with #do: as in bibliography entries do: [ :each | .. ] which saves you the #at: index
>>>> - there are handy unary shortcuts for accessing elements, like #first, #second and so on (up to #ninth) which also save you parenthesis
>>>> - you can also construct strings using the idiom String streamContents: [ :bibStream | .. ]
>>>>
>>>> Sorry, these jumped to me when I saw your code, I hope you don't mind ;-)
>>>>
>>>>> I will put some functionality inspired by this on my prototype this weekend.
>>>>>
>>>>> Cheers,
>>>>>
>>>>> Offray
>>>>>
>>>>> On 10/21/2014 01:20 AM, stepharo wrote:
>>>>>> Check in the tools there is a bib writer.
>>>>>>
>>>>>> Stef
>>>>>>
>>>>>> On 21/10/14 03:33, Offray Vladimir Luna Cárdenas wrote:
>>>>>>> Thanks Stef and Damien,
>>>>>>>
>>>>>>> I have this small script as a proof of concept:
>>>>>>>
>>>>>>> ===================================
>>>>>>> | bibFile bibliography |
>>>>>>> bibFile := ((FileLocator documents / 'U/Libertadores/Grafoscopio')
>>>>>>> children
>>>>>>> detect: [:each | each basename endsWith: 'bib' ]) contents.
>>>>>>> bibliography := CZBibParser parse: bibFile.
>>>>>>> 1 to: (bibliography size) do: [:index |
>>>>>>> (((bibliography entries at: index) fields at: 2) key = 'shorttitle')
>>>>>>> ifTrue: [
>>>>>>> (bibliography entries at: index)
>>>>>>> key: ((bibliography entries at: index) fields at: 2) value
>>>>>>> ]].
>>>>>>> bibliography.
>>>>>>> ===================================
>>>>>>>
>>>>>>> Now I want to write back the corrected file to the .bib ... just
>>>>>>> having problems finding which message does the job. I'll keep searching.
>>>>>>>
>>>>>>> Cheers,
>>>>>>>
>>>>>>> Offray
>>>>>>>
>>>>>>> On 10/16/2014 06:40 AM, Damien Cassou wrote:
>>>>>>>> from Damien Pollet:
>>>>>>>>
>>>>>>>> You will need to load the .bib file from zotero (read the file however
>>>>>>>> you like, then pass the stream to the CZ parser). You'll get a
>>>>>>>> CZBibSet (I don't recall the name exactly) which represents the
>>>>>>>> contents of the file. A Set is composed of entries, each of which has
>>>>>>>> a key and a set of fields. Finally, fields accept a few different
>>>>>>>> kinds of values.
>>>>>>>>
>>>>>>>> Your processing is just iterating a set then setting the key of each
>>>>>>>> entry (or possibly removing and re-adding the entry, I don't recall if
>>>>>>>> it's implemented like a dictionary or more like a list).
>>>>>>>>
>>>>>>>>
>>>>>>>> On Mon, Oct 13, 2014 at 2:57 AM, Offray Vladimir Luna Cárdenas
>>>>>>>> <offray(a)riseup.net <mailto:offray@riseup.net>> wrote:
>>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> I'm using a Zotero collection for keeping track of several
>>>>>>>> references I have
>>>>>>>> found for my article about the experience of the
>>>>>>>> outline/tree-like metaphor
>>>>>>>> for writing inside Pharo (as soon as I have a presentable
>>>>>>>> working draft I
>>>>>>>> hope to share it with you).
>>>>>>>>
>>>>>>>> Now I want to make a post-processing of the bibtex file exported
>>>>>>>> from
>>>>>>>> Zotero. The idea is to use "shorttitle" field instead to replace
>>>>>>>> the Zotero
>>>>>>>> auto-generated one and have custom keys. So for example instead of:
>>>>>>>>
>>>>>>>> =======
>>>>>>>> @misc{_holistic_????,
>>>>>>>> title = {Holistic software assessment (Uni Zurich -
>>>>>>>> 2011) on Vimeo},
>>>>>>>> shorttitle = {Girba-holistic-2011},
>>>>>>>> url = {http://vimeo.com/42073344?__from=outro-local
>>>>>>>> <http://vimeo.com/42073344?from=outro-local>},
>>>>>>>> urldate = {2014-08-19},
>>>>>>>> note = {00000}
>>>>>>>> }
>>>>>>>>
>>>>>>>> =======
>>>>>>>>
>>>>>>>>
>>>>>>>> I would like to have:
>>>>>>>>
>>>>>>>>
>>>>>>>> =======
>>>>>>>>
>>>>>>>> @misc{Girba-holistic-2011,
>>>>>>>> title = {Holistic software assessment (Uni Zurich -
>>>>>>>> 2011) on Vimeo},
>>>>>>>> shorttitle = {Girba-holistic-2011},
>>>>>>>> url = {http://vimeo.com/42073344?__from=outro-local
>>>>>>>> <http://vimeo.com/42073344?from=outro-local>},
>>>>>>>> urldate = {2014-08-19},
>>>>>>>> note = {00000}
>>>>>>>> }
>>>>>>>>
>>>>>>>> =======
>>>>>>>>
>>>>>>>>
>>>>>>>> I have already installed Citizen and open it on the browser to
>>>>>>>> see the code,
>>>>>>>> but I can find any place to start with examples.
>>>>>>>>
>>>>>>>> Any advice on how to solve this issue will be appreciated.
>>>>>>>>
>>>>>>>> Cheers,
>>>>>>>>
>>>>>>>> Offray
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> Damien Cassou
>>>>>>>> http://damiencassou.seasidehosting.st
>>>>>>>>
>>>>>>>> "Success is the ability to go from one failure to another without losing
>>>>>>>> enthusiasm."
>>>>>>>> Winston Churchill
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>>
>
>
April 26, 2015
Re: [Pharo-users] XMLParser GTInspector extensions
by Tudor Girba
Hi,
There already exists a GT-InspectorExtensions-XML which is already
published in the GT repository.
I would prefer to qualify the extensions by the tool they refer to:
GT-InspectorExtnesions-*, GT-SpotterExtensions-* etc.
gtDisplayOn: should be more in the inspector, but probably some were added
mostly in the spotter so they ended up in the less optimal package.
Cheers,
Doru
On Sun, Apr 26, 2015 at 8:30 PM, Ben Coman <btc(a)openinworld.com> wrote:
> I happened to need to use and XML Parser for the first time and found
> inspecting the structure awkward, so I added some GTInspector extensions to
> XML-Parser. This is uploaded as XML-Parser-BenComan.304 to
> http://smalltalkhub.com/#!/~PharoExtras/XMLParser. Could someone who
> uses XML regularly check if these are reasonable?
>
> Now should these methods be packaged separately somehow, since they are
> likely not of interest to other Smalltalk flavours?
>
> btw I gave them a protocol of "GT-Extensions" - but I also considered
> "moldable-tools" and "tools-extensions". If there a preference? This will
> likely be a common occurrence across the community, so we should try for a
> consistent convention across the community for such extensions.
>
> btw2, I notice that #gtDisplayOn: implementors are fairly evenly split
> between [GT-InspectorExtensions-Core] and [GT-SpotterExtensions-Core]. Are
> they really separated like this in their use?
>
> cheers -ben
>
--
www.tudorgirba.com
"Every thing has its own flow"
April 26, 2015