Pharo-users
By thread
pharo-users@lists.pharo.org
By month
Messages by month
- ----- 2026 -----
- 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
July 2015
- 87 participants
- 663 messages
Re: [Pharo-users] NeoCSVReader and an empty field at the very end of a file
by Sean P. DeNigris
Hannes Hirzel wrote
> though Amber is said to be Pharo compatible there are some problems which
> I
> have to resolve first.
Pharo is the reference implementation, but is a subset. I guess technically
that's "compatible", but "compatible" is vague enough to be easily
misleading...
-----
Cheers,
Sean
--
View this message in context: http://forum.world.st/NeoCSVReader-and-an-empty-field-at-the-very-end-of-a-…
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
July 2, 2015
Re: [Pharo-users] NeoCSVReader and an empty field at the very end of a file
by H. Hirzel
Hello Joachim
In May I did a port of NeoCSV to Cuis Smalltalk.
I followed a process like this
1. download .mcz in its "original" version and unpack it to have the
st file only. Keep
the Core and the Tests st file in the target repository for reference.
2. Make a copy of the two files
3. Modify the st files with search/replace operations for obvious and
safe changes
4. Import and further modify on target platform
5. Run tests and resolve remaining issues
6. Publish on target platform's public repository
7. Document the process so that it can be redone from scratch much
faster by myself or somebody else in a semi-automatic way.
Remarks:
1) https://github.com/hhzl/Cuis-NeoCSV/blob/master/Neo-CSV-Core-orig.st
is 1011 LOC
https://github.com/hhzl/Cuis-NeoCSV/blob/master/Neo-CSV-Tests-orig.st
is 805 LOC
It took me two attempts to arrive at the goal
https://github.com/hhzl/Cuis-NeoCSV
In the first attempt nearly all tests failed. But this was because of
some minor differences which caused most of the problems. After having
them fixed the number of tests which passed raised quickly.
In the end it needed a combination of systematic changes and some
'compatibility layer' on Cuis which is necessary for the port. The
package used for that contains much more than needed, I did not take
the time yet to figure out which methods actually are needed. I think
only very few methods are needed.
I think the Neo-CSV package is very useful to do workspace based
applications for an explorative analysis of complex data. CSV data is
a representation of one of the most common file formats (Excel data).
And we need to be able to do this in various Smalltalk distributions.
The Neo-CSV package is well written and not all that complex. Porting
can be done in some hours. Sven was very helpful and added another
test for me to illustrate a particular use, actually my main use case.
Summary:
a) So the porting experience was good.
b) Porting the tests is a necessity to prove that the port has been done.
c) I think you can do the same thing quickly for VA Smalltalk if you
actually take the plunge.
Way forward:
It might be worthwile to consider to maintain a github repository with
steps 1,2 and 3 from above. FileOut format for ease of use. Using
another repo will distinguish the effort to be a modified _copy_ of
http://smalltalkhub.com/#!/~SvenVanCaekenberghe/Neo/
Actually Sven already has taken precautions to make the code
porting-friendly and he might want to further facilitate this.
I am considering a port to Amber Smalltalk, but interestingly though
Amber is said to be Pharo compatible there are some problems which I
have to resolve first.
HTH
Hannes
On 7/2/15, jtuchel(a)objektfabrik.de <jtuchel(a)objektfabrik.de> wrote:
> Sven,
>
> you are, of course, right!
> I should have checked in Pharo first. But since my version is old
> anyways, I would have to try with at least two versions in order to make
> sure if the bug is fixed or not. As long as keeping ports current is a
> lot of work due to (increasing) differences between Phar and most other
> dialects, this is hard work ;-) I should invest in it anyways, however,
> since I am using your code from Pharo and you didn't ask me to use it...
>
> So, to address this Array construction issue (as an example of others).
> This cannot be handled with Grease or the like, since what is in my way
> is the Smalltalk compiler (I am trying to concince Instantiations to
> support {} for literal Array construction, but until I'm successful...).
>
> Given somebody wrote RewriteRules to replace {} with "(Array new: x)
> addAll:", this should probably be used on non-Pharo-platforms as part of
> a port, so that the "original" code is still the Metacello version it
> was on Pharo.
>
> My plan for a port:
> 1. download .mcz in its "original" version and don't modify it
> 2. import and modify on target platform
> 3. test and publish on target platform's public repository
>
> What do you think would be a good process to porting when it involves
> such steps?
>
> The problem with Step 2 is: I am not sure if RewriteRules can work in
> code that's not compiled. (Well, I am mostly sure this won't work, just
> asking for confirmation) You cannot compile methods with Arrays
> constructed with curly braces on VAST.
>
> So another possible process would be:
> 1. use Pharo to modify downloaded code in order to make it importable on
> target platform
> 2. publish this code somewhere (not official Pharo repositories, maybe
> StHub)
> 3. Download the modified version and import into target dialect
> 4. Make final adjustments to make code and tests run
> 5. Publish to target platform's public repository
>
> Any thoughts or ideas? People interested in joining efforts?
>
> And, now that we're on a new topic anyways, misusing this thread (mea
> culpa):
>
> I still wonder how we could make it easier to contribute back. Every
> time I find a bug in some code from Pharo, there are several things to
> consider:
> 1. Is there a newer version on Pharo that doesn't have this bug?
> a) yes: port newer version
> b) no: I'm in trouble - see below
>
> in case of 1b), there are two options now:
> 1. I fire up Pharo and fix the bug in the original code, then commit the
> changes to the official repository/ies, and then port the fixed version
> 2. I contact the ML or the author/maintainer of the code and give them a
> bug report and hopefully a fix, which may or may not be compatible with
> Pharo. Then I can either port the fixed version or just keep my fixed
> version (if the fix is the same, this is not a problem from the code
> perspective, but maybe from a version numbering standpoint).
>
> I am interested in ideas here and would like to hear from people
> interested in discussing these issues. Maybe ESUG would be a good
> opportunity to start discussing. Maybe we can start a new initiative for
> this problem area...
>
> Joachim
>
>
>
> Am 01.07.15 um 21:27 schrieb Sven Van Caekenberghe:
>> But before you ask for help on the Pharo ML you should run the NeoCSV code
>> on Pharo to validate that your assumption hold there. If not, it is a
>> porting error/problem.
>>
>> And unit tests are *VERY IMPORTANT* to maintain our sanity across versions
>> and/or platforms.
>>
>> Again, what you report as a potential problem isn't one, I think. Please
>> test on Pharo itself.
>>
>>> On 01 Jul 2015, at 21:07, jtuchel(a)objektfabrik.de wrote:
>>>
>>> I gave up on porting tests. VAST doesn't support creating Arrays with
>>> curly braces, and they are used all over the place in Pharo code. I wuld
>>> use them if I had them, so this is not an accuse or anything. It's just a
>>> huge load of work to keep tests up to date when porting newer versions,
>>> so I just ignore tests when porting. A sad truth.
>>>
>>> Joachim
>>>
>>> Am 01.07.15 um 16:14 schrieb H. Hirzel:
>>>> Joachim,
>>>>
>>>> which results do you get on VA Smalltalk for the tests?
>>>>
>>>> Do they all pass?
>>>>
>>>> --Hannes
>>>>
>>>> On 7/1/15, jtuchel(a)objektfabrik.de <jtuchel(a)objektfabrik.de> wrote:
>>>>> I am not complaining. It just makes porting harder.
>>>>>
>>>>> What made the thing especially strange was that I only had that
>>>>> problem
>>>>> with uploaded files because the Browser removes the trailing CrLf (or
>>>>> better, doesn't add another one in the multipart form data). So
>>>>> reading
>>>>> from a file all works like a charm, but not when you process the same,
>>>>> uploaded file on the server side...
>>>>>
>>>>> Joachim
>>>>>
>>>>> Am 01.07.15 um 15:12 schrieb Sven Van Caekenberghe:
>>>>>> Yes, on Pharo, #next (and #peek or #peekFor:) all return nil when
>>>>>> #atEnd.
>>>>>>
>>>>>> It is the way it is (I am personally for stricter semantics), but
>>>>>> that
>>>>>> fact is certainly used in code all allround the place.
>>>>>>
>>>>>>> On 01 Jul 2015, at 15:06, jtuchel(a)objektfabrik.de wrote:
>>>>>>>
>>>>>>> Hi Sven,
>>>>>>>
>>>>>>> I didn't test on Pharo. But I remember seeing differences in the way
>>>>>>> Pharo and VAST react to reads beyond the end of a Stream.
>>>>>>> Not sure, but this could have been in NeoCSV context two or three
>>>>>>> years
>>>>>>> ago.
>>>>>>>
>>>>>>> So it is very likely I was bitten by platform differences.
>>>>>>>
>>>>>>> Thanks for answering.
>>>>>>>
>>>>>>> Joachim
>>>>>>>
>>>>>>> Am 01.07.15 um 14:05 schrieb Sven Van Caekenberghe:
>>>>>>>> Hi Joachim,
>>>>>>>>
>>>>>>>> First, thanks for the feedback.
>>>>>>>>
>>>>>>>> Second, since you are on a different platform, that might be a
>>>>>>>> factor.
>>>>>>>>
>>>>>>>> Did you test your problem on Pharo itself ?
>>>>>>>>
>>>>>>>> Because there are already unit tests specifically for the case you
>>>>>>>> describe:
>>>>>>>>
>>>>>>>> #testEmptyLastFieldUnquoted
>>>>>>>> #testEmptyLastFieldQuoted
>>>>>>>>
>>>>>>>> These obviously pass for Pharo, do they pass for you ?
>>>>>>>>
>>>>>>>> Maybe your problem case is slightly different though ?
>>>>>>>>
>>>>>>>> Sven
>>>>>>>>
>>>>>>>>> On 01 Jul 2015, at 13:40, jtuchel(a)objektfabrik.de wrote:
>>>>>>>>>
>>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>> I've tried porting SvenVanCaekenberghe.20 and see the same problems
>>>>>>>>> in
>>>>>>>>> this version. IN addition to the fix already mentioned, I also had
>>>>>>>>> to
>>>>>>>>> change readSeparator:
>>>>>>>>>
>>>>>>>>> readSeparator
>>>>>>>>>
>>>>>>>>> ^self atEnd ifFalse: [self peekFor: separator]
>>>>>>>>>
>>>>>>>>> As far as I can tell by now, this fixes the problem at hand. Any
>>>>>>>>> ideas
>>>>>>>>> if this is a safe fix?
>>>>>>>>>
>>>>>>>>> Joachim
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Am 01.07.15 um 12:35 schrieb jtuchel(a)objektfabrik.de:
>>>>>>>>>> Hi there,
>>>>>>>>>>
>>>>>>>>>> I am on VA Smalltalk and therefor using an older version of
>>>>>>>>>> NeoCSV
>>>>>>>>>> (SvenVanCaekenberghe.14). I found a bug in this old version that
>>>>>>>>>> is
>>>>>>>>>> somewhat special.
>>>>>>>>>>
>>>>>>>>>> It seems NeoCSV cannot handle the situation where the very last
>>>>>>>>>> field
>>>>>>>>>> is just empty AND if there is no trailing CRLF at the end of the
>>>>>>>>>> file.
>>>>>>>>>> Somethinng like this:
>>>>>>>>>>
>>>>>>>>>> SecondLastColumnValue;;<EOF>
>>>>>>>>>>
>>>>>>>>>> In that case, readField fails because it tries to do a
>>>>>>>>>> readQuotedField
>>>>>>>>>> or readUnquotedField, both of which try to read beyond EOF.
>>>>>>>>>>
>>>>>>>>>> So I changed readField to this:
>>>>>>>>>>
>>>>>>>>>> readField
>>>>>>>>>>
>>>>>>>>>> ^self atEnd "In case the very last field of a file is empty,
>>>>>>>>>> like
>>>>>>>>>> '45;56;;'"
>>>>>>>>>> ifTrue: ['']
>>>>>>>>>> ifFalse: [self peekQuote ifTrue: [self readQuotedField]
>>>>>>>>>> ifFalse: [self readUnquotedField]]
>>>>>>>>>>
>>>>>>>>>> and all seems fine so far.
>>>>>>>>>>
>>>>>>>>>> Side note: My original file has a trailing CrLf but if I upload it
>>>>>>>>>> via
>>>>>>>>>> a browser to a Seaside Server, the Browser cuts off the trailing
>>>>>>>>>> CrLf
>>>>>>>>>> (I can see this in the Browser's Network debugging tools - both in
>>>>>>>>>> IE
>>>>>>>>>> and FF) - so it seems NeoCSV has to be ready for this situation.
>>>>>>>>>>
>>>>>>>>>> Joachim
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> -----------------------------------------------------------------------
>>>>>>>>> Objektfabrik Joachim Tuchel
>>>>>>>>> mailto:jtuchel@objektfabrik.de
>>>>>>>>> Fliederweg 1 http://www.objektfabrik.de
>>>>>>>>> D-71640 Ludwigsburg
>>>>>>>>> http://joachimtuchel.wordpress.com
>>>>>>>>> Telefon: +49 7141 56 10 86 0 Fax: +49 7141 56 10 86 1
>>>>>>>>>
>>>>>>>>>
>>>>>>> --
>>>>>>> -----------------------------------------------------------------------
>>>>>>> Objektfabrik Joachim Tuchel mailto:jtuchel@objektfabrik.de
>>>>>>> Fliederweg 1 http://www.objektfabrik.de
>>>>>>> D-71640 Ludwigsburg
>>>>>>> http://joachimtuchel.wordpress.com
>>>>>>> Telefon: +49 7141 56 10 86 0 Fax: +49 7141 56 10 86 1
>>>>>>>
>>>>>>>
>>>>> --
>>>>> -----------------------------------------------------------------------
>>>>> Objektfabrik Joachim Tuchel mailto:jtuchel@objektfabrik.de
>>>>> Fliederweg 1 http://www.objektfabrik.de
>>>>> D-71640 Ludwigsburg
>>>>> http://joachimtuchel.wordpress.com
>>>>> Telefon: +49 7141 56 10 86 0 Fax: +49 7141 56 10 86 1
>>>>>
>>>>>
>>>>>
>>>
>>> --
>>> -----------------------------------------------------------------------
>>> Objektfabrik Joachim Tuchel mailto:jtuchel@objektfabrik.de
>>> Fliederweg 1 http://www.objektfabrik.de
>>> D-71640 Ludwigsburg http://joachimtuchel.wordpress.com
>>> Telefon: +49 7141 56 10 86 0 Fax: +49 7141 56 10 86 1
>>>
>>>
>>
>>
>
>
> --
> -----------------------------------------------------------------------
> Objektfabrik Joachim Tuchel mailto:jtuchel@objektfabrik.de
> Fliederweg 1 http://www.objektfabrik.de
> D-71640 Ludwigsburg http://joachimtuchel.wordpress.com
> Telefon: +49 7141 56 10 86 0 Fax: +49 7141 56 10 86 1
>
>
>
July 2, 2015
Re: [Pharo-users] NeoCSVReader and an empty field at the very end of a file
by Ben Coman
On Thu, Jul 2, 2015 at 3:48 PM, jtuchel(a)objektfabrik.de
<jtuchel(a)objektfabrik.de> wrote:
> Sven,
>
> you are, of course, right!
> I should have checked in Pharo first. But since my version is old anyways, I
> would have to try with at least two versions in order to make sure if the
> bug is fixed or not. As long as keeping ports current is a lot of work due
> to (increasing) differences between Pharo and most other dialects, this is
> hard work ;-) I should invest in it anyways, however, since I am using your
> code from Pharo and you didn't ask me to use it...
This reminds me of Joel Spolsky's article on "barriers to entry." He
makes an interesting point with his "PayMyBills" example that a hidden
barrier to entry is not how hard it is to switch in, but how hard it
is to switch out [or port].
cheers -ben
July 2, 2015
Re: [Pharo-users] does anybody use the AST navigation?
by Marcus Denker
> On 01 Jul 2015, at 23:30, stepharo <stepharo(a)free.fr> wrote:
>
>
>> > Because we could remove it.
>>
>> I think we never enabled it because we could not use good key combinations⦠the idea
>> was to use ctrl-arrow keys for itâ¦
>>
>> I still think that AST based navigation is a very good idea, removing it now without having
>> ever used it for real is not good.
>>
>> Marcus, would that make sense to:
>>
>> * extract the core of the AST navigation as an API onto the RB AST (the ability to go up, down, left and right in a RB AST, basically), i.e. trying to preserve that way a bit some of the patterns solved by the AST navigation...
>>
>> * and reduce whatever is linked with the GUI / text morph components ?
>>
>> Oh, looking at the code, the two aspects are implemented together, so it will be painfull to refactor. Looking a bit more at the code... I'm interested by the rationale for askForNodeSelectionFrom:
>>
>> Thierry
>>
>
> Marcus
>
> the problem is that the idea is cool but if nobody spent time making it useful for real then
> we will never know if it is working for real. I think that finding the right operations that makes sense
> can be probably difficult.
>
> Now we did the same analysis that thierry.
> The tree operations like parten children sibbling should not be on class side of nodes navigation
> but in the AST itself.
>
> We can keep used code in the image but I do not really understand why?
> So we have working tools such as the dependencies browser that could help us that
> were out of the image and things that nobody ever used in.
>
> For me I would unload the code and find a student or somebody interested to
> improve for real.
>
We could remove it for now⦠it makes only sens when we can use CTRL-arrow keys to navigate,
but there are problems with that related to the keyboard events, I think.
Marcus
July 2, 2015
Re: [Pharo-users] NeoCSVReader and an empty field at the very end of a file
by jtuchel@objektfabrik.de
Sven,
you are, of course, right!
I should have checked in Pharo first. But since my version is old
anyways, I would have to try with at least two versions in order to make
sure if the bug is fixed or not. As long as keeping ports current is a
lot of work due to (increasing) differences between Phar and most other
dialects, this is hard work ;-) I should invest in it anyways, however,
since I am using your code from Pharo and you didn't ask me to use it...
So, to address this Array construction issue (as an example of others).
This cannot be handled with Grease or the like, since what is in my way
is the Smalltalk compiler (I am trying to concince Instantiations to
support {} for literal Array construction, but until I'm successful...).
Given somebody wrote RewriteRules to replace {} with "(Array new: x)
addAll:", this should probably be used on non-Pharo-platforms as part of
a port, so that the "original" code is still the Metacello version it
was on Pharo.
My plan for a port:
1. download .mcz in its "original" version and don't modify it
2. import and modify on target platform
3. test and publish on target platform's public repository
What do you think would be a good process to porting when it involves
such steps?
The problem with Step 2 is: I am not sure if RewriteRules can work in
code that's not compiled. (Well, I am mostly sure this won't work, just
asking for confirmation) You cannot compile methods with Arrays
constructed with curly braces on VAST.
So another possible process would be:
1. use Pharo to modify downloaded code in order to make it importable on
target platform
2. publish this code somewhere (not official Pharo repositories, maybe
StHub)
3. Download the modified version and import into target dialect
4. Make final adjustments to make code and tests run
5. Publish to target platform's public repository
Any thoughts or ideas? People interested in joining efforts?
And, now that we're on a new topic anyways, misusing this thread (mea
culpa):
I still wonder how we could make it easier to contribute back. Every
time I find a bug in some code from Pharo, there are several things to
consider:
1. Is there a newer version on Pharo that doesn't have this bug?
a) yes: port newer version
b) no: I'm in trouble - see below
in case of 1b), there are two options now:
1. I fire up Pharo and fix the bug in the original code, then commit the
changes to the official repository/ies, and then port the fixed version
2. I contact the ML or the author/maintainer of the code and give them a
bug report and hopefully a fix, which may or may not be compatible with
Pharo. Then I can either port the fixed version or just keep my fixed
version (if the fix is the same, this is not a problem from the code
perspective, but maybe from a version numbering standpoint).
I am interested in ideas here and would like to hear from people
interested in discussing these issues. Maybe ESUG would be a good
opportunity to start discussing. Maybe we can start a new initiative for
this problem area...
Joachim
Am 01.07.15 um 21:27 schrieb Sven Van Caekenberghe:
> But before you ask for help on the Pharo ML you should run the NeoCSV code on Pharo to validate that your assumption hold there. If not, it is a porting error/problem.
>
> And unit tests are *VERY IMPORTANT* to maintain our sanity across versions and/or platforms.
>
> Again, what you report as a potential problem isn't one, I think. Please test on Pharo itself.
>
>> On 01 Jul 2015, at 21:07, jtuchel(a)objektfabrik.de wrote:
>>
>> I gave up on porting tests. VAST doesn't support creating Arrays with curly braces, and they are used all over the place in Pharo code. I wuld use them if I had them, so this is not an accuse or anything. It's just a huge load of work to keep tests up to date when porting newer versions, so I just ignore tests when porting. A sad truth.
>>
>> Joachim
>>
>> Am 01.07.15 um 16:14 schrieb H. Hirzel:
>>> Joachim,
>>>
>>> which results do you get on VA Smalltalk for the tests?
>>>
>>> Do they all pass?
>>>
>>> --Hannes
>>>
>>> On 7/1/15, jtuchel(a)objektfabrik.de <jtuchel(a)objektfabrik.de> wrote:
>>>> I am not complaining. It just makes porting harder.
>>>>
>>>> What made the thing especially strange was that I only had that problem
>>>> with uploaded files because the Browser removes the trailing CrLf (or
>>>> better, doesn't add another one in the multipart form data). So reading
>>>> from a file all works like a charm, but not when you process the same,
>>>> uploaded file on the server side...
>>>>
>>>> Joachim
>>>>
>>>> Am 01.07.15 um 15:12 schrieb Sven Van Caekenberghe:
>>>>> Yes, on Pharo, #next (and #peek or #peekFor:) all return nil when #atEnd.
>>>>>
>>>>> It is the way it is (I am personally for stricter semantics), but that
>>>>> fact is certainly used in code all allround the place.
>>>>>
>>>>>> On 01 Jul 2015, at 15:06, jtuchel(a)objektfabrik.de wrote:
>>>>>>
>>>>>> Hi Sven,
>>>>>>
>>>>>> I didn't test on Pharo. But I remember seeing differences in the way
>>>>>> Pharo and VAST react to reads beyond the end of a Stream.
>>>>>> Not sure, but this could have been in NeoCSV context two or three years
>>>>>> ago.
>>>>>>
>>>>>> So it is very likely I was bitten by platform differences.
>>>>>>
>>>>>> Thanks for answering.
>>>>>>
>>>>>> Joachim
>>>>>>
>>>>>> Am 01.07.15 um 14:05 schrieb Sven Van Caekenberghe:
>>>>>>> Hi Joachim,
>>>>>>>
>>>>>>> First, thanks for the feedback.
>>>>>>>
>>>>>>> Second, since you are on a different platform, that might be a factor.
>>>>>>>
>>>>>>> Did you test your problem on Pharo itself ?
>>>>>>>
>>>>>>> Because there are already unit tests specifically for the case you
>>>>>>> describe:
>>>>>>>
>>>>>>> #testEmptyLastFieldUnquoted
>>>>>>> #testEmptyLastFieldQuoted
>>>>>>>
>>>>>>> These obviously pass for Pharo, do they pass for you ?
>>>>>>>
>>>>>>> Maybe your problem case is slightly different though ?
>>>>>>>
>>>>>>> Sven
>>>>>>>
>>>>>>>> On 01 Jul 2015, at 13:40, jtuchel(a)objektfabrik.de wrote:
>>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> I've tried porting SvenVanCaekenberghe.20 and see the same problems in
>>>>>>>> this version. IN addition to the fix already mentioned, I also had to
>>>>>>>> change readSeparator:
>>>>>>>>
>>>>>>>> readSeparator
>>>>>>>>
>>>>>>>> ^self atEnd ifFalse: [self peekFor: separator]
>>>>>>>>
>>>>>>>> As far as I can tell by now, this fixes the problem at hand. Any ideas
>>>>>>>> if this is a safe fix?
>>>>>>>>
>>>>>>>> Joachim
>>>>>>>>
>>>>>>>>
>>>>>>>> Am 01.07.15 um 12:35 schrieb jtuchel(a)objektfabrik.de:
>>>>>>>>> Hi there,
>>>>>>>>>
>>>>>>>>> I am on VA Smalltalk and therefor using an older version of NeoCSV
>>>>>>>>> (SvenVanCaekenberghe.14). I found a bug in this old version that is
>>>>>>>>> somewhat special.
>>>>>>>>>
>>>>>>>>> It seems NeoCSV cannot handle the situation where the very last field
>>>>>>>>> is just empty AND if there is no trailing CRLF at the end of the file.
>>>>>>>>> Somethinng like this:
>>>>>>>>>
>>>>>>>>> SecondLastColumnValue;;<EOF>
>>>>>>>>>
>>>>>>>>> In that case, readField fails because it tries to do a readQuotedField
>>>>>>>>> or readUnquotedField, both of which try to read beyond EOF.
>>>>>>>>>
>>>>>>>>> So I changed readField to this:
>>>>>>>>>
>>>>>>>>> readField
>>>>>>>>>
>>>>>>>>> ^self atEnd "In case the very last field of a file is empty, like
>>>>>>>>> '45;56;;'"
>>>>>>>>> ifTrue: ['']
>>>>>>>>> ifFalse: [self peekQuote ifTrue: [self readQuotedField]
>>>>>>>>> ifFalse: [self readUnquotedField]]
>>>>>>>>>
>>>>>>>>> and all seems fine so far.
>>>>>>>>>
>>>>>>>>> Side note: My original file has a trailing CrLf but if I upload it via
>>>>>>>>> a browser to a Seaside Server, the Browser cuts off the trailing CrLf
>>>>>>>>> (I can see this in the Browser's Network debugging tools - both in IE
>>>>>>>>> and FF) - so it seems NeoCSV has to be ready for this situation.
>>>>>>>>>
>>>>>>>>> Joachim
>>>>>>>>>
>>>>>>>>>
>>>>>>>> --
>>>>>>>> -----------------------------------------------------------------------
>>>>>>>> Objektfabrik Joachim Tuchel mailto:jtuchel@objektfabrik.de
>>>>>>>> Fliederweg 1 http://www.objektfabrik.de
>>>>>>>> D-71640 Ludwigsburg
>>>>>>>> http://joachimtuchel.wordpress.com
>>>>>>>> Telefon: +49 7141 56 10 86 0 Fax: +49 7141 56 10 86 1
>>>>>>>>
>>>>>>>>
>>>>>> --
>>>>>> -----------------------------------------------------------------------
>>>>>> Objektfabrik Joachim Tuchel mailto:jtuchel@objektfabrik.de
>>>>>> Fliederweg 1 http://www.objektfabrik.de
>>>>>> D-71640 Ludwigsburg http://joachimtuchel.wordpress.com
>>>>>> Telefon: +49 7141 56 10 86 0 Fax: +49 7141 56 10 86 1
>>>>>>
>>>>>>
>>>> --
>>>> -----------------------------------------------------------------------
>>>> Objektfabrik Joachim Tuchel mailto:jtuchel@objektfabrik.de
>>>> Fliederweg 1 http://www.objektfabrik.de
>>>> D-71640 Ludwigsburg http://joachimtuchel.wordpress.com
>>>> Telefon: +49 7141 56 10 86 0 Fax: +49 7141 56 10 86 1
>>>>
>>>>
>>>>
>>
>> --
>> -----------------------------------------------------------------------
>> Objektfabrik Joachim Tuchel mailto:jtuchel@objektfabrik.de
>> Fliederweg 1 http://www.objektfabrik.de
>> D-71640 Ludwigsburg http://joachimtuchel.wordpress.com
>> Telefon: +49 7141 56 10 86 0 Fax: +49 7141 56 10 86 1
>>
>>
>
>
--
-----------------------------------------------------------------------
Objektfabrik Joachim Tuchel mailto:jtuchel@objektfabrik.de
Fliederweg 1 http://www.objektfabrik.de
D-71640 Ludwigsburg http://joachimtuchel.wordpress.com
Telefon: +49 7141 56 10 86 0 Fax: +49 7141 56 10 86 1
July 2, 2015
Re: [Pharo-users] HTTP file logging for Zinc
by Sven Van Caekenberghe
> On 02 Jul 2015, at 01:04, Ben Coman <btc(a)openinworld.com> wrote:
>
> On Thu, Jul 2, 2015 at 2:53 AM, Sven Van Caekenberghe <sven(a)stfx.eu> wrote:
>>
>>> On 01 Jul 2015, at 19:54, Esteban A. Maringolo <emaringolo(a)gmail.com> wrote:
>>>
>>> Thank you Sven!
>>
>> You're welcome.
>>
>> One thing that I did that I am not sure of is, whether Referer and User-Agent should be "-" or just "" when absent, I chose the first one but I am not sure.
>>
>>> How does it work with FileStreams when the requests come from different threads of the server? I mean, is FileStream thread safe? I guess that if I have multiple images I should have a file per image, otherwise I couldn't write to a single file.
>>
>> Everything goes through Announcer, but that does not seem to serialise access (but I might be wrong). It should technically be possible to add monitor on the receiving end.
>
> Announcer is only thread safe with respect to its own data structures.
> It does not make its users thread safe.
> cheers -ben
OK, that is what I thought.
>>
>> If you have multiple images, that you need to consolidate things yourself.
>>
>>> I will add the payload logging somehow. Maybe writing to an SQLite db.
>>
>> Let us know how it goes.
>>
>> I am especially interested if other tools dig the output.
>>
>>> Thank you again.
>>>
>>>
>>> Esteban A. Maringolo
>>>
>>> 2015-07-01 12:01 GMT-03:00 Sven Van Caekenberghe <sven(a)stfx.eu>:
>>> Esteban,
>>>
>>>> On 29 Jun 2015, at 21:40, Esteban A. Maringolo <emaringolo(a)gmail.com> wrote:
>>>>
>>>> Hello everyone,
>>>>
>>>> I want to record everything that goes in or out from our REST API servers, maybe including HTTP payload (JSON mostly).
>>>>
>>>> ZnLogEvent seems to have the basic building blocks for logging, but I want to know if there is
>>>> a package/project that already provides file logging, so I can not only have the logs, but also if the file format is compatible with other http logs I can run traditional web log tools on them, like Webalizer or AWStats.
>>>>
>>>> Thank you!
>>>>
>>>> Esteban A. Maringolo
>>>
>>> I committed the following:
>>>
>>> ===
>>> Name: Zinc-HTTP-SvenVanCaekenberghe.432
>>> Author: SvenVanCaekenberghe
>>> Time: 1 July 2015, 4:50:46.339985 pm
>>> UUID: 56da27df-1641-4b62-ba6d-34345f31a1af
>>> Ancestors: Zinc-HTTP-SvenVanCaekenberghe.431
>>>
>>> Added ZnCommonLogFormat, an object that formats ZnServerTransactionEvent log objects using the Apache Common Log Format (Combined)
>>> ===
>>>
>>> From the class comment:
>>>
>>> ===
>>> I am ZnCommonLogFormat, I can output ZnServerTransactionEvent objects using Apache Common Log Format (CLF).
>>>
>>> https://en.wikipedia.org/wiki/Common_Log_Format
>>> https://httpd.apache.org/docs/trunk/logs.html#common
>>>
>>>
>>> ===
>>>
>>> Which will give the following output:
>>>
>>> ===
>>> 127.0.0.1 - - [01/Jul/2015:16:35:36 +02:00] "GET /random HTTP/1.1" 200 64 "http://localhost:1701/help" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/600.7.12 (KHTML, like Gecko) Version/8.0.7 Safari/600.7.12"
>>> 127.0.0.1 - - [01/Jul/2015:16:35:37 +02:00] "GET /random HTTP/1.1" 200 64 "http://localhost:1701/help" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/600.7.12 (KHTML, like Gecko) Version/8.0.7 Safari/600.7.12"
>>> 127.0.0.1 - - [01/Jul/2015:16:36:20 +02:00] "GET / HTTP/1.1" 200 977 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/600.7.12 (KHTML, like Gecko) Version/8.0.7 Safari/600.7.12"
>>> 127.0.0.1 - - [01/Jul/2015:16:36:21 +02:00] "GET /echo HTTP/1.1" 200 674 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/600.7.12 (KHTML, like Gecko) Version/8.0.7 Safari/600.7.12"
>>> 127.0.0.1 - - [01/Jul/2015:16:36:25 +02:00] "GET /echo?foo=1 HTTP/1.1" 200 680 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/600.7.12 (KHTML, like Gecko) Version/8.0.7 Safari/600.7.12"
>>> 127.0.0.1 - - [01/Jul/2015:16:36:53 +02:00] "GET /echo?foo=12 HTTP/1.1" 200 681 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/600.7.12 (KHTML, like Gecko) Version/8.0.7 Safari/600.7.12"
>>> 127.0.0.1 - - [01/Jul/2015:16:39:13 +02:00] "GET /random HTTP/1.1" 200 64 "-" "curl/7.37.1"
>>> 127.0.0.1 - sven [01/Jul/2015:16:40:43 +02:00] "GET /random HTTP/1.1" 200 64 "-" "curl/7.37.1"
>>> 127.0.0.1 - - [01/Jul/2015:16:42:18 +02:00] "GET /bytes/256 HTTP/1.1" 200 256 "-" "Zinc HTTP Components 1.0"
>>> ===
>>>
>>> This still needs battle testing and feedback.
>>>
>>> HTH,
>>>
>>> Sven
July 2, 2015
Re: [Pharo-users] 1$ Recognizer in Pharo
by Peter Uhnák
This is cool indeed!
It would be interesting to integrate it with Roassal to drag elements
around. :)
Peter
On Thu, Jul 2, 2015 at 12:33 AM, Johan Fabry <jfabry(a)dcc.uchile.cl> wrote:
> Very cool !
>
> > On Jul 1, 2015, at 18:52, stepharo <stepharo(a)free.fr> wrote:
> >
> >
> > Now that we have gestures we can interface recognisers.
> > Thanks Thales for the sponsoring.
> >
> > http://youtu.be/Ghxgv8c9OWM
> >
> > Stef
> >
> >
>
>
>
> ---> Save our in-boxes! http://emailcharter.org <---
>
> Johan Fabry - http://pleiad.cl/~jfabry
> PLEIAD lab - Computer Science Department (DCC) - University of Chile
>
>
>
July 2, 2015
Re: [Pharo-users] an elegant way to return a result
by Joachim Tuchel
Just found this on twitter:
http://www.cs.wm.edu/~denys/pubs/ICSE%2715-BadSmells-CRC.pdf
Am 01.07.2015 23:35 schrieb stepharo <stepharo(a)free.fr>:
>
> I know :D
>
> Le 1/7/15 15:19, jtuchel(a)objektfabrik.de a écrit :
> > Stef,
> >
> > you're shooting the wrong man! ;-) The crime was committed in your
> > team ;-))))
> >
> > See you in Brescia
> >
> > Joachim
> >
> > Am 30.06.15 um 19:19 schrieb stepharo:
> >>
> >>
> >> Le 30/6/15 14:39, jtuchel(a)objektfabrik.de a écrit :
> >>> Ah, Okay, you are mentioning the one and only one case in which this
> >>> could make sense.... ;-)
> >>>
> >>> Something like
> >>>
> >>> stream next ifNil: [^stream next].
> >>
> >> so ugly.
> >> Please we should not teach how to do exception with blocks :)
> >>>
> >>> So there may be cases where the two sends do not return the same
> >>> result. But that is, of course, not what the OP suggested.
> >>> Nevertheless, I was too fast in criticizing ;-)
> >>>
> >>> I would consider code like that "less easy" to maintain, however.
> >>>
> >>> Nice thinking Kata ;-)
> >>>
> >>> Joachim
> >>>
> >>>
> >>>
> >>> Am 30.06.15 um 14:22 schrieb Esteban Lorenzano:
> >>>> ah yeah :)
> >>>>
> >>>> I assumed
> >>>>
> >>>> first "something aMsg" ~= second "something aMsgâ
> >>>>
> >>>> In case is the same, the correct way is as you say:
> >>>>
> >>>> ^ something aMsg ifNil: [ anotherResult ]
> >>>>
> >>>> (sorry, he :P)
> >>>>
> >>>>> On 30 Jun 2015, at 13:43, jtuchel(a)objektfabrik.de wrote:
> >>>>>
> >>>>> Am 30.06.15 um 13:40 schrieb Peter Uhnák:
> >>>>>> Make sense if there's code in between.
> >>>>> not sure what you're saying. I mean, sending the message twice
> >>>>> makes sense if you already know the outcome? Hmmm...
> >>>>>
> >>>>>> something aMsg ifNil:[ ^ something aMsg ]. "yay for guards!"
> >>>>>> "much more code"
> >>>>>> ^ aNotherResult
> >>>>>>
> >>>>>> Peter
> >>>>>
> >>>>> --
> >>>>> -----------------------------------------------------------------------
> >>>>>
> >>>>> Objektfabrik Joachim Tuchel mailto:jtuchel@objektfabrik.de
> >>>>> Fliederweg 1 http://www.objektfabrik.de
> >>>>> D-71640 Ludwigsburg http://joachimtuchel.wordpress.com
> >>>>> Telefon: +49 7141 56 10 86 0Â Â Â Â Â Â Â Â Fax: +49 7141 56 10 86 1
> >>>>>
> >>>>>
> >>>>
> >>>>
> >>>
> >>>
> >>
> >>
> >>
> >
> >
>
>
>
July 2, 2015
Phratch: Support for Spanish language in the interface
by Offray Vladimir Luna Cárdenas
Hi,
Some teachers are considering to make some field work with Phratch on
learning physics by modelling simple real world phenomena (uniform
accelerated movement, free fall etc). I downloaded it today and try to
change the interface to Spanish, but I couldn't find the proper place to
do it. Has Phratch support for a Spanish interface. If not, how
difficult will be to provide this and how can we help?
Cheers,
Offray
July 2, 2015
Re: [Pharo-users] HTTP file logging for Zinc
by Ben Coman
On Thu, Jul 2, 2015 at 2:53 AM, Sven Van Caekenberghe <sven(a)stfx.eu> wrote:
>
>> On 01 Jul 2015, at 19:54, Esteban A. Maringolo <emaringolo(a)gmail.com> wrote:
>>
>> Thank you Sven!
>
> You're welcome.
>
> One thing that I did that I am not sure of is, whether Referer and User-Agent should be "-" or just "" when absent, I chose the first one but I am not sure.
>
>> How does it work with FileStreams when the requests come from different threads of the server? I mean, is FileStream thread safe? I guess that if I have multiple images I should have a file per image, otherwise I couldn't write to a single file.
>
> Everything goes through Announcer, but that does not seem to serialise access (but I might be wrong). It should technically be possible to add monitor on the receiving end.
Announcer is only thread safe with respect to its own data structures.
It does not make its users thread safe.
cheers -ben
>
> If you have multiple images, that you need to consolidate things yourself.
>
>> I will add the payload logging somehow. Maybe writing to an SQLite db.
>
> Let us know how it goes.
>
> I am especially interested if other tools dig the output.
>
>> Thank you again.
>>
>>
>> Esteban A. Maringolo
>>
>> 2015-07-01 12:01 GMT-03:00 Sven Van Caekenberghe <sven(a)stfx.eu>:
>> Esteban,
>>
>> > On 29 Jun 2015, at 21:40, Esteban A. Maringolo <emaringolo(a)gmail.com> wrote:
>> >
>> > Hello everyone,
>> >
>> > I want to record everything that goes in or out from our REST API servers, maybe including HTTP payload (JSON mostly).
>> >
>> > ZnLogEvent seems to have the basic building blocks for logging, but I want to know if there is
>> > a package/project that already provides file logging, so I can not only have the logs, but also if the file format is compatible with other http logs I can run traditional web log tools on them, like Webalizer or AWStats.
>> >
>> > Thank you!
>> >
>> > Esteban A. Maringolo
>>
>> I committed the following:
>>
>> ===
>> Name: Zinc-HTTP-SvenVanCaekenberghe.432
>> Author: SvenVanCaekenberghe
>> Time: 1 July 2015, 4:50:46.339985 pm
>> UUID: 56da27df-1641-4b62-ba6d-34345f31a1af
>> Ancestors: Zinc-HTTP-SvenVanCaekenberghe.431
>>
>> Added ZnCommonLogFormat, an object that formats ZnServerTransactionEvent log objects using the Apache Common Log Format (Combined)
>> ===
>>
>> From the class comment:
>>
>> ===
>> I am ZnCommonLogFormat, I can output ZnServerTransactionEvent objects using Apache Common Log Format (CLF).
>>
>> https://en.wikipedia.org/wiki/Common_Log_Format
>> https://httpd.apache.org/docs/trunk/logs.html#common
>>
>>
>> ===
>>
>> Which will give the following output:
>>
>> ===
>> 127.0.0.1 - - [01/Jul/2015:16:35:36 +02:00] "GET /random HTTP/1.1" 200 64 "http://localhost:1701/help" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/600.7.12 (KHTML, like Gecko) Version/8.0.7 Safari/600.7.12"
>> 127.0.0.1 - - [01/Jul/2015:16:35:37 +02:00] "GET /random HTTP/1.1" 200 64 "http://localhost:1701/help" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/600.7.12 (KHTML, like Gecko) Version/8.0.7 Safari/600.7.12"
>> 127.0.0.1 - - [01/Jul/2015:16:36:20 +02:00] "GET / HTTP/1.1" 200 977 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/600.7.12 (KHTML, like Gecko) Version/8.0.7 Safari/600.7.12"
>> 127.0.0.1 - - [01/Jul/2015:16:36:21 +02:00] "GET /echo HTTP/1.1" 200 674 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/600.7.12 (KHTML, like Gecko) Version/8.0.7 Safari/600.7.12"
>> 127.0.0.1 - - [01/Jul/2015:16:36:25 +02:00] "GET /echo?foo=1 HTTP/1.1" 200 680 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/600.7.12 (KHTML, like Gecko) Version/8.0.7 Safari/600.7.12"
>> 127.0.0.1 - - [01/Jul/2015:16:36:53 +02:00] "GET /echo?foo=12 HTTP/1.1" 200 681 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/600.7.12 (KHTML, like Gecko) Version/8.0.7 Safari/600.7.12"
>> 127.0.0.1 - - [01/Jul/2015:16:39:13 +02:00] "GET /random HTTP/1.1" 200 64 "-" "curl/7.37.1"
>> 127.0.0.1 - sven [01/Jul/2015:16:40:43 +02:00] "GET /random HTTP/1.1" 200 64 "-" "curl/7.37.1"
>> 127.0.0.1 - - [01/Jul/2015:16:42:18 +02:00] "GET /bytes/256 HTTP/1.1" 200 256 "-" "Zinc HTTP Components 1.0"
>> ===
>>
>> This still needs battle testing and feedback.
>>
>> HTH,
>>
>> Sven
>>
>>
>>
>
>
July 1, 2015