Re: [Pharo-users] mentor question 2.

2020-04-27 Thread PBKResearch
Roelof

 

Sorry if I introduced unnecessary technicalities. Your solution to the
problem was in fact using a polynomial explicitly; that's what all the
powers of 2 were doing. But as long as you can follow how my version works,
that's all that matters.

 

Peter

 

From: Pharo-users  On Behalf Of Roelof
Wobben via Pharo-users
Sent: 27 April 2020 12:23
To: pharo-users@lists.pharo.org
Cc: Roelof Wobben 
Subject: Re: [Pharo-users] mentor question 2.

 

Op 27-4-2020 om 13:16 schreef PBKResearch:

Roelof

 

You maybe have enough mentors already, but there are some important features
of this problem which can be of use in future. Your code solves the problem,
but it could be improved in two ways, which make it simpler and clearer.

 

1.  What is the purpose of the local variable 'isValid'? It provides
somewhere to remember the result of your validity test. But you have no need
to remember it; all you want to do is evaluate it, use it to determine the
course of the program and then forget it. If you write:

(self isValidBinary: aString)

 ifTrue: [..]

   ifFalse: [^nil]

you will achieve the same result without introducing the local variable. It
probably reads more clearly, revealing the intention of the code. (You can
simplify further by replacing the ifFalse: clause with an unconditional
^nil; if the code reaches this point, we know it's false.) The general
principle is: only introduce a named local variable if you need to remember
something for later re-use.

 

2.  It is not necessary to reverse the string in order to evaluate it;
it is in fact easier to evaluate it from left to right. You have used the
withIndexDo: method to supply the index and know the appropriate power of
two to use. Instead you could multiply by two as you process each digit,
which will automatically use the right power of two without ever needing to
know what it is. You could write:

result := 0.

aString do:

   [:digit| result := result * 2 + digit digitValue].

^result.

This is a special case of a very useful general procedure for evaluating a
polynomial. The digits of a binary number are the coefficients of a
polynomial in x which is evaluated at x=2; similarly, a decimal number is a
polynomial evaluated at x=10.

 

I hope this is helpful.

 

Peter Kenny

 

From: Pharo-users  <mailto:pharo-users-boun...@lists.pharo.org>
 On Behalf Of Roelof Wobben via
Pharo-users
Sent: 26 April 2020 19:52
To: pharo-users@lists.pharo.org <mailto:pharo-users@lists.pharo.org> 
Cc: Roelof Wobben  <mailto:r.wob...@home.nl> 
Subject: Re: [Pharo-users] mentor question 2.

 

Op 26-4-2020 om 20:17 schreef Sven Van Caekenberghe:

> 

>> On 26 Apr 2020, at 20:10, Gabriel Cotelli mailto:g.cote...@gmail.com> > wrote:

>> 

>> In the first method you aren't doing an assignment, are sending the
message = to the temp isValid, if you change the method to:

>> decimalFromBinary: aString

>>   | result isValid |

>>   isValid := self isValidBinary: aString.

>>   isValid

>>   ifTrue: [ result := 0.

>>   aString reverse

>>   withIndexDo:

>>   [ :digit :index | result := result + (digit 

>> digitValue * (2 raisedTo: index - 1)) ].

>>   ^ result ]

>>   ifFalse: [ ^ nil ]

>> it should work.

> There is a #reverseWithIndexDo: method

> 

> Also, #digitValue might be considered a builtin method that you are 

> not allowed to use. Since you already did the #isValidBinary: test, 

> you could say

> 

>(digit charCode - $0 charCode)

> 

>> In the second one you're comparing characters with numbers, this will
always return false because the number 0 is not the same as the character 0.

>> Use

>> isValidBinary: aString

>>   ^ aString allSatisfy: [ :c | c = $0 or: [ c = $1 ] ] or 

>> something like

>> 

>> isValidBinary: aString

>>   ^ aString allSatisfy: [ :c | '01' includes: c ]

>> 

>> On Sun, Apr 26, 2020 at 2:52 PM Roelof Wobben via Pharo-users
mailto:pharo-users@lists.pharo.org> > wrote:

>> Hello,

>> 

>> I have to make some code that convert a binary to a decimal and im 

>> not allowed to use the convert methods that Pharo has.

>> 

>> So I have written this :

>> 

>> 

>> decimalFromBinary: aString

>>   | result isValid |

>>   isValid = self isValidBinary: aString.

>>   isValid

>>   ifTrue: [ result := 0.

>>   aString reverse

>>   withIndexDo:

>>   [ :digit :index | result := result + (digit 

>> digitValue * (2 raisedTo: index - 1)) ].

>>   ^ result ]

>>   ifFalse: [ ^ nil ]

>>

Re: [Pharo-users] mentor question 2.

2020-04-27 Thread PBKResearch
Roelof

 

You maybe have enough mentors already, but there are some important features
of this problem which can be of use in future. Your code solves the problem,
but it could be improved in two ways, which make it simpler and clearer.

 

1.  What is the purpose of the local variable 'isValid'? It provides
somewhere to remember the result of your validity test. But you have no need
to remember it; all you want to do is evaluate it, use it to determine the
course of the program and then forget it. If you write:

(self isValidBinary: aString)

 ifTrue: [..]

   ifFalse: [^nil]

you will achieve the same result without introducing the local variable. It
probably reads more clearly, revealing the intention of the code. (You can
simplify further by replacing the ifFalse: clause with an unconditional
^nil; if the code reaches this point, we know it's false.) The general
principle is: only introduce a named local variable if you need to remember
something for later re-use.

 

2.  It is not necessary to reverse the string in order to evaluate it;
it is in fact easier to evaluate it from left to right. You have used the
withIndexDo: method to supply the index and know the appropriate power of
two to use. Instead you could multiply by two as you process each digit,
which will automatically use the right power of two without ever needing to
know what it is. You could write:

result := 0.

aString do:

   [:digit| result := result * 2 + digit digitValue].

^result.

This is a special case of a very useful general procedure for evaluating a
polynomial. The digits of a binary number are the coefficients of a
polynomial in x which is evaluated at x=2; similarly, a decimal number is a
polynomial evaluated at x=10.

 

I hope this is helpful.

 

Peter Kenny

 

From: Pharo-users  On Behalf Of Roelof
Wobben via Pharo-users
Sent: 26 April 2020 19:52
To: pharo-users@lists.pharo.org
Cc: Roelof Wobben 
Subject: Re: [Pharo-users] mentor question 2.

 

Op 26-4-2020 om 20:17 schreef Sven Van Caekenberghe:

> 

>> On 26 Apr 2020, at 20:10, Gabriel Cotelli mailto:g.cote...@gmail.com> > wrote:

>> 

>> In the first method you aren't doing an assignment, are sending the
message = to the temp isValid, if you change the method to:

>> decimalFromBinary: aString

>>   | result isValid |

>>   isValid := self isValidBinary: aString.

>>   isValid

>>   ifTrue: [ result := 0.

>>   aString reverse

>>   withIndexDo:

>>   [ :digit :index | result := result + (digit 

>> digitValue * (2 raisedTo: index - 1)) ].

>>   ^ result ]

>>   ifFalse: [ ^ nil ]

>> it should work.

> There is a #reverseWithIndexDo: method

> 

> Also, #digitValue might be considered a builtin method that you are 

> not allowed to use. Since you already did the #isValidBinary: test, 

> you could say

> 

>(digit charCode - $0 charCode)

> 

>> In the second one you're comparing characters with numbers, this will
always return false because the number 0 is not the same as the character 0.

>> Use

>> isValidBinary: aString

>>   ^ aString allSatisfy: [ :c | c = $0 or: [ c = $1 ] ] or 

>> something like

>> 

>> isValidBinary: aString

>>   ^ aString allSatisfy: [ :c | '01' includes: c ]

>> 

>> On Sun, Apr 26, 2020 at 2:52 PM Roelof Wobben via Pharo-users
mailto:pharo-users@lists.pharo.org> > wrote:

>> Hello,

>> 

>> I have to make some code that convert a binary to a decimal and im 

>> not allowed to use the convert methods that Pharo has.

>> 

>> So I have written this :

>> 

>> 

>> decimalFromBinary: aString

>>   | result isValid |

>>   isValid = self isValidBinary: aString.

>>   isValid

>>   ifTrue: [ result := 0.

>>   aString reverse

>>   withIndexDo:

>>   [ :digit :index | result := result + (digit 

>> digitValue * (2 raisedTo: index - 1)) ].

>>   ^ result ]

>>   ifFalse: [ ^ nil ]

>> 

>> isValidBinary: aString

>>   ^ aString allSatisfy: [ :c | c = 0 or: [ c = 1 ] ]

>> 

>> 

>> but on the first method I see a message that the temp variables are 

>> read before written.

>> and the second one I see a message that I use a or instead of 

>> searching literals.

>> 

>> Where did  I think wrong here ?

>> 

>> Roelof

>> 

>> 

> 

 

 

Thanks,  this problem is solved.

 

Roelof

 

 

 



[Pharo-users] Problem switching from PetitParser to PetitParser2

2020-04-14 Thread PBKResearch
Hello

 

I have been switching part of a package called TextLint so that it uses
PetitParser2 as the parsing engine. For the most part it went fairly
smoothly, but I have one problem which occurs in many places. The original
parse rules had many conditional matching rules based on
PPPredicateObjectParser. I have changed this to PP2PredicateObjectNode,
using the same block as a predicate in each case. All of them fail when I
test run them in a playground; in every case the error message is of the
form: 'Character does not understand [some condition testing method]'. The
condition being tested is meaningless for a character - it applies to a
token produced by some earlier parsing. 

 

Looking at the code for PP2PredicateObjectNode>>#predicate:, I see that the
predicate is always treated as a PP2CharSetPredicate, which is claimed to be
a performance optimization. The error messages I have seen come from the
initialization of this, setting up the 255 precomputed results, because they
all relate to a character with asciiValue = 1.

 

All these rules worked in PetitParser, because the methods for
PPPredicateObjectParser allow one to distinguish between a character set
predicate and a general block; in fact, the class side contains a large
variety of methods for generating conditions. As far as I can see,
PP2PredicateObjectNode allows only one type of condition. Have I
misunderstood - is there some way to specify the condition is not a
character set?

 

Thanks for any help

 

Peter Kenny



Re: [Pharo-users] Pharo 8: What is the VM doing when I am doing nothing?

2020-04-11 Thread PBKResearch
I think some of the mystery is due to my not exploring enough. As I said, I 
have two windows open when I am doing the test: the Pharo 8 welcome window and 
a playground which is opened on a cache file.  I have now found that what 
happens depends on which is on top. If the welcome window is on top, the CPU 
usage is zero; if the playground is on top, CPU usage is about 3%, and stays at 
that even though I provide no input. The implication is that, when a playground 
is the active window, it is constantly doing something, presumably polling to 
see if the user is providing input. This did not seem to happen with a similar 
test on Pharo 6; even though a playground was on top, the CPU usage dropped to 
zero when I became inactive.

 

As I said, it’s not a problem, just a puzzle – but I would still like to know 
why.

 

Peter Kenny

 

From: Pharo-users  On Behalf Of Tim 
Mackinnon
Sent: 11 April 2020 12:42
To: Any question about pharo is welcome 
Subject: Re: [Pharo-users] Pharo 8: What is the VM doing when I am doing 
nothing?

 

Hi Peter - I had understood that this always a problem as Morphic is always 
polling for events (so am surprised you found an image where it’s not 
happening). I believe that recent work has almost got to a point where this can 
be resolved - there were some recent status reports on this, and maybe it might 
get into pharo9?

 

I’m sure someone has a much better explanation for you - and an explanation of 
what’s involved to fix it (I guess you have to block the event loop somehow so 
it waits vs polls).

 

Tim

 

On Sat, 11 Apr 2020, at 12:27 PM, PBKResearch wrote:

Hello. I have noticed a curiosity when I am running Pharo 8 on Windows 10. I am 
in the habit of leaving the Task Manager open when I am working, and it seems 
that Pharo 8 is using the CPU when I am doing nothing. When the image – which 
is exactly as first loaded, with only the welcome window visible – is loaded, 
CPU consumption is zero. I open a playground, get a list of recent files from 
the playground cache, open one of the files but do nothing with it; the CPU 
activity is constantly changing within the range 2.5% - 3.5%. After 5 mins of 
no Pharo activity by me, the CPU is still in the same range.

 

I reloaded an earlier image, which is Moose Suite 6.1 (Pharo 6) and opened a 
playground in the same way. After a few seconds, the CPU usage dropped to zero. 
This activity is a feature of the newest versions only.

 

It’s obviously not a major problem, but I would like to know, if just out of 
curiosity.

 

Thanks for any help.

 

Peter Kenny

 

My Pharo 8 details:

Build information: 
Pharo-8.0.0+build.1124.sha.0932da82f08175e906b0e2a8052120c823374e9f (32 Bit)

Installed from Pharo Launcher on 8 Apr 2020

VM details:

CoInterpreter * VMMaker-CompatibleUserName.1577968628 uuid: 
d729bf66-2ea7-5a6d-b1eb-fc005785636d Jan  3 2020

StackToRegisterMappingCogit * VMMaker-CompatibleUserName.1577968628 uuid: 
d729bf66-2ea7-5a6d-b1eb-fc005785636d Jan  3 2020

VM: 201911290039-dev-7 
admin@MacBook-Pro-de-admin.local:dev/Pharo/git-repos/pharo-vm/repo 
<mailto:admin@MacBook-Pro-de-admin.local:dev/Pharo/git-repos/pharo-vm/repo>  
Date: Thu Nov 28 21:39:57 2019 CommitHash: 9b6bd16d3 Plugins: 
201911290039-dev-7  
<mailto:admin@MacBook-Pro-de-admin.local:dev/Pharo/git-repos/pharo-vm/repo> 
admin@MacBook-Pro-de-admin.local:dev/Pharo/git-repos/pharo-vm/repo

 

 

 



[Pharo-users] Pharo 8: What is the VM doing when I am doing nothing?

2020-04-11 Thread PBKResearch
Hello. I have noticed a curiosity when I am running Pharo 8 on Windows 10. I
am in the habit of leaving the Task Manager open when I am working, and it
seems that Pharo 8 is using the CPU when I am doing nothing. When the image
- which is exactly as first loaded, with only the welcome window visible -
is loaded, CPU consumption is zero. I open a playground, get a list of
recent files from the playground cache, open one of the files but do nothing
with it; the CPU activity is constantly changing within the range 2.5% -
3.5%. After 5 mins of no Pharo activity by me, the CPU is still in the same
range.

 

I reloaded an earlier image, which is Moose Suite 6.1 (Pharo 6) and opened a
playground in the same way. After a few seconds, the CPU usage dropped to
zero. This activity is a feature of the newest versions only. 

 

It's obviously not a major problem, but I would like to know, if just out of
curiosity.

 

Thanks for any help.

 

Peter Kenny

 

My Pharo 8 details:

Build information:
Pharo-8.0.0+build.1124.sha.0932da82f08175e906b0e2a8052120c823374e9f (32 Bit)

Installed from Pharo Launcher on 8 Apr 2020

VM details:

CoInterpreter * VMMaker-CompatibleUserName.1577968628 uuid:
d729bf66-2ea7-5a6d-b1eb-fc005785636d Jan  3 2020

StackToRegisterMappingCogit * VMMaker-CompatibleUserName.1577968628 uuid:
d729bf66-2ea7-5a6d-b1eb-fc005785636d Jan  3 2020

VM: 201911290039-dev-7
admin@MacBook-Pro-de-admin.local:dev/Pharo/git-repos/pharo-vm/repo Date: Thu
Nov 28 21:39:57 2019 CommitHash: 9b6bd16d3 Plugins: 201911290039-dev-7
admin@MacBook-Pro-de-admin.local:dev/Pharo/git-repos/pharo-vm/repo
 

 

 



Re: [Pharo-users] Automation of MS Office from Pharo

2020-04-08 Thread PBKResearch
Hello Pablo

Success! I have rerun one of the troublesome cases, with no problem. I then 
re-ran the test on the latest 16 messages, collecting all the HTML outputs in 
an array, which took just over 5 secs total; quicker than I expected. The 
longest texts, from the most verbose newsletters, run from 267K to over 300K, 
so that is where they ran into the limit we found yesterday.

I now know that I can pass the HTML to the XMLHTMLParser in memory, without 
saving to file first; this will be more convenient. Thanks for the prompt help.

@Guillermo - All this is a proof of possibility, it will need to be combined 
with other bits I am working on to make the automated system I want. I shall 
let you know when it is worked out - but it won't be in the next few days!

Thanks to all

Peter Kenny

-Original Message-
From: Pharo-users  On Behalf Of Guillermo 
Polito
Sent: 08 April 2020 09:20
To: Tomaž Turk ; Any question about pharo is welcome 

Subject: Re: [Pharo-users] Automation of MS Office from Pharo

Cool, thanks to the three :)

@Peter, I’d like if you tell us at the end if you had success at automating you 
mail workflow ^^

> El 8 abr 2020, a las 10:15, Tomaž Turk  escribió:
> 
> Thanks Pablo for your quick response! I tested 32 and 64 bit images with 
> >1.000.000 strings and it works just fine.
> 
> Best wishes,
> Tomaz
> 
> 
> -- Original Message --
> From: "teso...@gmail.com" 
> To: "Any question about pharo is welcome" 
> Cc: "Tomaž Turk" 
> Sent: 8.4.2020 9:54:35
> Subject: Re: [Pharo-users] Automation of MS Office from Pharo
> 
>> Hi!!!
>>  This was a great report. I have submitted a fix in the master of Pharo-COM.
>> 
>> Basically the problem was to free twice the BSTR in the Variant.
>> It was being free in the access to the value and in the free of the struct.
>> Why it works with other BSTR when they are smaller, I cannot know.
>> 
>> I have added another smoke test using Word
>> 
>> Can you try the fix?
>> 
>> Thanks, both for helping me with the reports, they were great.
>> 
>> On Wed, Apr 8, 2020 at 9:37 AM PBKResearch  wrote:
>>> 
>>> Tomaz, that was my understanding from the VBA piece you cited yesterday. So 
>>> presumably it must be something in Pharo-Com which imposes the limits we 
>>> have seen. I am OK at the moment, because all this work is just an 
>>> exploration of possibilities; I can wait until you and Pablo have sorted it 
>>> out. But from the results of your tests, a maximum of 16K in 64-bit systems 
>>> must be a serious limitation, so something in Pharo-Com needs fixing.
>>> 
>>> 
>>> 
>>> For my immediate work, I shall continue exporting the full text using 
>>> MailItem.SaveAs; my further processing uses files I have exported manually 
>>> in this way, so it’s not a problem.
>>> 
>>> 
>>> 
>>> Thanks
>>> 
>>> 
>>> 
>>> Peter Kenny
>>> 
>>> 
>>> 
>>> From: Pharo-users  On Behalf Of Tomaž 
>>> Turk
>>> Sent: 08 April 2020 07:58
>>> To: Any question about pharo is welcome 
>>> Subject: Re: [Pharo-users] Automation of MS Office from Pharo
>>> 
>>> 
>>> 
>>> Thanks, Stephane, for the acknowledgement. Peter, as I understand, the 
>>> limits in COM BSTR data type are defined by the header's length prefix 
>>> (which is 4 bytes) and software implementatios - for instance, string data 
>>> type in Visual Basic for Applications is described as "a variable-length 
>>> string can contain up to approximately 2 billion (2^31) characters", which 
>>> is in line with the BSTR header. I'm not sure if the OS architecture (32 
>>> and 64 bit) influences these values.
>>> 
>>> 
>>> 
>>> Best wishes,
>>> 
>>> Tomaz
>>> 
>>> 
>>> 
>>> 
>> 
>> 
>> 
>> --
>> Pablo Tesone.
>> teso...@gmail.com
> 
> 





Re: [Pharo-users] Automation of MS Office from Pharo

2020-04-08 Thread PBKResearch
Tomaz, that was my understanding from the VBA piece you cited yesterday. So 
presumably it must be something in Pharo-Com which imposes the limits we have 
seen. I am OK at the moment, because all this work is just an exploration of 
possibilities; I can wait until you and Pablo have sorted it out. But from the 
results of your tests, a maximum of 16K in 64-bit systems must be a serious 
limitation, so something in Pharo-Com needs fixing.

 

For my immediate work, I shall continue exporting the full text using 
MailItem.SaveAs; my further processing uses files I have exported manually in 
this way, so it’s not a problem.

 

Thanks

 

Peter Kenny

 

From: Pharo-users  On Behalf Of Tomaž Turk
Sent: 08 April 2020 07:58
To: Any question about pharo is welcome 
Subject: Re: [Pharo-users] Automation of MS Office from Pharo

 

Thanks, Stephane, for the acknowledgement. Peter, as I understand, the limits 
in COM BSTR data type are defined by the header's length prefix (which is 4 
bytes) and software implementatios - for instance, string data type in Visual 
Basic for Applications is described as "a variable-length string can contain up 
to approximately 2 billion (2^31) characters", which is in line with the BSTR 
header. I'm not sure if the OS architecture (32 and 64 bit) influences these 
values. 

 

Best wishes,

Tomaz

 

 



Re: [Pharo-users] Automation of MS Office from Pharo

2020-04-07 Thread PBKResearch
Hi Tomaz

 

Yes, that is exactly the problem I had, and the limit of 260K characters is 
consistent with my tests. I can get round it by saving the HTML to disk using 
the MailItem.SaveAs method, and then reading the file back from disk. I would 
try doing that with a memory disk, but I suspect the SaveAs method will not 
like writing to it. An alternative would be to use the MailItem.Body property, 
which only has the text of the message and so is much shorter. I would really 
need my own parser to read such a file, and I can’t load PetitParser or 
PetitParser2 into Pharo 8.

 

Presumably Pharo-Com should handle a long string more gracefully than just 
crashing the VM. But if these limits are intrinsic to COM in Windows, rather 
than Pharo-Com, there may be no way round it so it’s back to SaveAs.

 

Thanks for confirming that it’s not down to an error of mine.

 

Peter Kenny

 

From: Pharo-users  On Behalf Of Tomaž Turk
Sent: 07 April 2020 21:27
To: Any question about pharo is welcome 
Subject: Re: [Pharo-users] Automation of MS Office from Pharo

 

Thanks, Peter. I checked out the Outlook COM interface, noticed that the 
MailItem.HTMLBody property returns a string, which is implemented as BSTR in 
COM (more on this here: 
https://bytecomb.com/vba-internals-string-variables-and-pointers-in-depth/).

 

I tested the maximum lengths of strings with Word and my images crash under 
these circumstances:

- Pharo 8.0 64 bit when returning ByteString is longer than 16.379 characters

- Pharo 8.0 32 bit when returning ByteString is longer than 260.080 characters 
(approximately).

 

64 bit image crashes without any warning, however the 32 bit one crashes with

 



 

I presume this is the same behaviour as you report, Peter. I'm attaching the 
crash.dmp from 32 bit image. I believe that the crash happens when calling 
COMDispatchInstance>>propertyNamed: with the lengthy string to be returned.

 

Pablo, I hope you have some time to check this, my knowledge ends somewhere 
here ... :-| 

 

Thanks and best wishes,

Tomaz

 

 

 

 

 



Re: [Pharo-users] Automation of MS Office from Pharo

2020-04-07 Thread PBKResearch
Hello Tomaž

 

I have been working out how to make your debugging easier. If you have MS 
Outlook to explore with, I have an extract from my Outlook Data File I can send 
you, together with a code snippet to run in a playground. With these it should 
be easy to reproduce the error.

 

HTH

 

Peter Kenny

 

From: Pharo-users  On Behalf Of PBKResearch
Sent: 07 April 2020 18:28
To: 'Tomaž Turk' ; 'Any question about pharo is 
welcome' 
Subject: Re: [Pharo-users] Automation of MS Office from Pharo

 

Hello Tomaž

 

I have been exploring today, to try to narrow down where the problem appears. 
It’s difficult to give you some code to reproduce the problem, because you 
would need to have my Outlook Data File, or an extract of it, plus MS Outlook 
to run it on. If you want that, I will try to work out how to produce a minimum 
extract to show the problem.

 

Meanwhile, I can describe what the problem seems to be. All my work has been 
done in a playground. I can set up a connection to my Outlook Data File and 
navigate through it to the folder of interest, which contains editions of a 
newsletter in German. I then inspect one of the items in the folder, which is a 
COMDispatchInstance and an instance of the object MailItem. My interest is the 
property HTMLBody of the MailItem, which is as you expect the complete code to 
display the newsletter. If I inspect the HTMLBody property for most MailItems, 
it displays with no problem. In some cases, however, as soon as I click 
‘inspect it’, there is a message saying the VM has crashed, and the system 
closes with a crash dump.

 

I don’t think there is a problem with the fact that I am displaying the 
property value in an inspector. I tried instead to assign it to a variable in 
the playground. As soon as I clicked ‘do it’ the whole Pharo app closed down, 
with no message or crash dump.

 

I have tried to find some common factor in the items which will cause the 
crash, and the one thing I can find is the size of HTMLBody, or equivalently 
the size of the MailItem. The HTMLBody displays as a WideString in the 
inspector, and it works fine for an object of about 230K characters. With 
another message about 10% larger, the VM crash occurred.

 

I have no knowledge of COM interfacing, except what I have picked up in the 
last two days, but I have been trying to find a general description of a 
problem which would give the results I have seen. If a COM object has a 
property which is a BSTRString, and if the string is a WideString with more 
than about 250K characters, is there some internal buffer overflow? – the crash 
dump has several mentions of ‘Stack Overflow’, though I can’t really follow it.

 

That is about all I can explain – sorry it’s a bit long-winded. If you want 
more information, or an extract of my Outlook data file, just let me know.

 

Thanks for your help.

 

Peter Kenny

 

 

 

From: Pharo-users mailto:pharo-users-boun...@lists.pharo.org> > On Behalf Of Tomaž Turk
Sent: 07 April 2020 16:30
To: Any question about pharo is welcome mailto:pharo-users@lists.pharo.org> >
Subject: Re: [Pharo-users] Automation of MS Office from Pharo

 

Dear Peter,

 

I'm glad that you find the package useful! Can you please explain a little bit 
more about your code, because it's not obvious from your description at which 
stage the problem occurs. Could you trace it with the debugger, and/or possibly 
post here the piece of code that fails? 

 

Thanks and best wishes,

Tomaz

 

-- Original Message ------

From: "PBKResearch" mailto:pe...@pbkresearch.co.uk> >

To: "Any question about pharo is welcome" mailto:pharo-users@lists.pharo.org> >

Sent: 6. 04. 2020 19:15:16

Subject: Re: [Pharo-users] Automation of MS Office from Pharo

 

Hello Pablo (and Tomaž)

 

You asked for feedback; after a day of experiments, I have good news and bad 
news.

 

The good news is that I have been able to navigate through my Outlook Data 
File, find my way to an e-mail of interest and examine the fields of interest. 
This means I am 90% of the way to my objective. All I want is to get the HTML 
code from the message body and pass it to XMLHTMLParser for further analysis. I 
found it not too difficult to work this out; the fact that a 
COMDispatchInstance can display all its internals in a playground page meant 
that I could work it out interactively as a playground exercise. I am still 
discovering things about the interface; I have only just found out that I can 
select an item from a list by quoting its name as an argument, rather than its 
number in the list. I am sure my clumsy code can be tidied up still.

 

I can get to the 100% point in the job by exporting the contents of the e-mail 
to disk in HTML format, using the SaveAs procedure of the MailItem object. I 
can then read it back from disk into the parser. But this seems a bit clunky. 
The content of an HTML mail item is available in the HTMLBody property o

Re: [Pharo-users] Automation of MS Office from Pharo

2020-04-07 Thread PBKResearch
Hello Tomaž

 

I have been exploring today, to try to narrow down where the problem appears. 
It’s difficult to give you some code to reproduce the problem, because you 
would need to have my Outlook Data File, or an extract of it, plus MS Outlook 
to run it on. If you want that, I will try to work out how to produce a minimum 
extract to show the problem.

 

Meanwhile, I can describe what the problem seems to be. All my work has been 
done in a playground. I can set up a connection to my Outlook Data File and 
navigate through it to the folder of interest, which contains editions of a 
newsletter in German. I then inspect one of the items in the folder, which is a 
COMDispatchInstance and an instance of the object MailItem. My interest is the 
property HTMLBody of the MailItem, which is as you expect the complete code to 
display the newsletter. If I inspect the HTMLBody property for most MailItems, 
it displays with no problem. In some cases, however, as soon as I click 
‘inspect it’, there is a message saying the VM has crashed, and the system 
closes with a crash dump.

 

I don’t think there is a problem with the fact that I am displaying the 
property value in an inspector. I tried instead to assign it to a variable in 
the playground. As soon as I clicked ‘do it’ the whole Pharo app closed down, 
with no message or crash dump.

 

I have tried to find some common factor in the items which will cause the 
crash, and the one thing I can find is the size of HTMLBody, or equivalently 
the size of the MailItem. The HTMLBody displays as a WideString in the 
inspector, and it works fine for an object of about 230K characters. With 
another message about 10% larger, the VM crash occurred.

 

I have no knowledge of COM interfacing, except what I have picked up in the 
last two days, but I have been trying to find a general description of a 
problem which would give the results I have seen. If a COM object has a 
property which is a BSTRString, and if the string is a WideString with more 
than about 250K characters, is there some internal buffer overflow? – the crash 
dump has several mentions of ‘Stack Overflow’, though I can’t really follow it.

 

That is about all I can explain – sorry it’s a bit long-winded. If you want 
more information, or an extract of my Outlook data file, just let me know.

 

Thanks for your help.

 

Peter Kenny

 

 

 

From: Pharo-users  On Behalf Of Tomaž Turk
Sent: 07 April 2020 16:30
To: Any question about pharo is welcome 
Subject: Re: [Pharo-users] Automation of MS Office from Pharo

 

Dear Peter,

 

I'm glad that you find the package useful! Can you please explain a little bit 
more about your code, because it's not obvious from your description at which 
stage the problem occurs. Could you trace it with the debugger, and/or possibly 
post here the piece of code that fails? 

 

Thanks and best wishes,

Tomaz

 

-- Original Message --

From: "PBKResearch" mailto:pe...@pbkresearch.co.uk> >

To: "Any question about pharo is welcome" mailto:pharo-users@lists.pharo.org> >

Sent: 6. 04. 2020 19:15:16

Subject: Re: [Pharo-users] Automation of MS Office from Pharo

 

Hello Pablo (and Tomaž)

 

You asked for feedback; after a day of experiments, I have good news and bad 
news.

 

The good news is that I have been able to navigate through my Outlook Data 
File, find my way to an e-mail of interest and examine the fields of interest. 
This means I am 90% of the way to my objective. All I want is to get the HTML 
code from the message body and pass it to XMLHTMLParser for further analysis. I 
found it not too difficult to work this out; the fact that a 
COMDispatchInstance can display all its internals in a playground page meant 
that I could work it out interactively as a playground exercise. I am still 
discovering things about the interface; I have only just found out that I can 
select an item from a list by quoting its name as an argument, rather than its 
number in the list. I am sure my clumsy code can be tidied up still.

 

I can get to the 100% point in the job by exporting the contents of the e-mail 
to disk in HTML format, using the SaveAs procedure of the MailItem object. I 
can then read it back from disk into the parser. But this seems a bit clunky. 
The content of an HTML mail item is available in the HTMLBody property of the 
MailItem, so I should be able to pass it programmatically to the parser without 
going near the disk. This is where I run into trouble.

 

In most of the cases I tried, this worked fine; I could display the HTML body 
text as a WideString in the playground, assign it to a variable and do whatever 
I wanted. However, for just one e-mail I tried, as soon as I selected ‘Do it 
and go’ in the playground, a message came up that the VM had crashed; the 
application closed, leaving only a crash dump. I cannot find anything unusual 
about the message that failed in this way, except that when I save it,

Re: [Pharo-users] Automation of MS Office from Pharo

2020-04-06 Thread PBKResearch
Hello Pablo (and Tomaž)

 

You asked for feedback; after a day of experiments, I have good news and bad 
news.

 

The good news is that I have been able to navigate through my Outlook Data 
File, find my way to an e-mail of interest and examine the fields of interest. 
This means I am 90% of the way to my objective. All I want is to get the HTML 
code from the message body and pass it to XMLHTMLParser for further analysis. I 
found it not too difficult to work this out; the fact that a 
COMDispatchInstance can display all its internals in a playground page meant 
that I could work it out interactively as a playground exercise. I am still 
discovering things about the interface; I have only just found out that I can 
select an item from a list by quoting its name as an argument, rather than its 
number in the list. I am sure my clumsy code can be tidied up still.

 

I can get to the 100% point in the job by exporting the contents of the e-mail 
to disk in HTML format, using the SaveAs procedure of the MailItem object. I 
can then read it back from disk into the parser. But this seems a bit clunky. 
The content of an HTML mail item is available in the HTMLBody property of the 
MailItem, so I should be able to pass it programmatically to the parser without 
going near the disk. This is where I run into trouble.

 

In most of the cases I tried, this worked fine; I could display the HTML body 
text as a WideString in the playground, assign it to a variable and do whatever 
I wanted. However, for just one e-mail I tried, as soon as I selected ‘Do it 
and go’ in the playground, a message came up that the VM had crashed; the 
application closed, leaving only a crash dump. I cannot find anything unusual 
about the message that failed in this way, except that when I save it, it 
produces a larger file than any of the others (just over 1MB, against up to 
300KB for the ones that worked). Could there be a limit on the size of some 
internal buffer?

 

I thought it worth while mentioning this now, because crashing the VM is 
generally undesirable. I can solve my problems safely using the SaveAs route, 
so it’s not a problem for me.

 

Hope this helps; if you want more details, let me know. Overall I am very happy 
with this library.

 

Peter Kenny

 

From: Pharo-users  On Behalf Of 
teso...@gmail.com
Sent: 06 April 2020 11:24
To: Any question about pharo is welcome 
Subject: Re: [Pharo-users] Automation of MS Office from Pharo

 

Hi Peter,

First, thanks to try to use Pharo-COM, that is great, I love to have users 
for it and find it is useful. 

Secondly, the Pharo 7 problem is an error I have introduced. It is clear that 
some changes I have done to support the new version of UFFI (the framework in 
Pharo to handle FFI calls) have broken the Pharo 7 version, so I will fix it to 
maintain compatibility.

 

It is great that you were able to make it work!

 

Cheers,

 

 

On Mon, Apr 6, 2020 at 12:18 PM PBKResearch mailto:pe...@pbkresearch.co.uk> > wrote:

Hello Tomaž

 

Many thanks for your patient explanation. I should have been able to work out 
for myself how the Word test works, and indeed I realized some of it when I 
came to shut down the Word instance and its two documents. But it was late at 
night, and I should have packed up before then.

 

My last test last night showed that basically I have cracked it for my job of 
automating Outlook. I have been able to connect to my running instance of 
Outlook, open my application and interrogate the names of my top-level folders. 
From now on it should be just a matter of understanding the MS documentation of 
the Outlook model.

 

However, all this is with Pharo-Com installed in a new Pharo 8 image. I have no 
idea what went wrong with my first effort on Pharo 7. But I shan’t worry about 
that – I shall gradually move all my bits and pieces to P8. I shall try to work 
it out myself from here, but I shall come back if I get stuck.

 

Thanks again

 

Peter Kenny

 

From: Pharo-users mailto:pharo-users-boun...@lists.pharo.org> > On Behalf Of Tomaž Turk
Sent: 06 April 2020 08:04
To: Any question about pharo is welcome mailto:pharo-users@lists.pharo.org> >
Subject: Re: [Pharo-users] Automation of MS Office from Pharo

 

Hello Peter,

 

If you look at the code in the Word test you will notice that the test firstly

- creates a new Word instance, 

- makes it visible to the end user, 

- then adds an empty document to the documents collection with the text "Hello 
from Pharo!"

- then it tests whether it can receive the same text back from Word.

 

After that, the test

- adds a new empty document to the documents collection with the text "Hello 
from Pharo! Some additional text. ", this time as an array of two texts

- it activates this second document (this imitates the end user's window 
activation on the desktop)

- then it tests whether it can receive the same text back from Word.

 

If you look at the Tas

Re: [Pharo-users] Automation of MS Office from Pharo

2020-04-06 Thread PBKResearch
Hello Tomaž

 

Many thanks for your patient explanation. I should have been able to work out 
for myself how the Word test works, and indeed I realized some of it when I 
came to shut down the Word instance and its two documents. But it was late at 
night, and I should have packed up before then.

 

My last test last night showed that basically I have cracked it for my job of 
automating Outlook. I have been able to connect to my running instance of 
Outlook, open my application and interrogate the names of my top-level folders. 
From now on it should be just a matter of understanding the MS documentation of 
the Outlook model.

 

However, all this is with Pharo-Com installed in a new Pharo 8 image. I have no 
idea what went wrong with my first effort on Pharo 7. But I shan’t worry about 
that – I shall gradually move all my bits and pieces to P8. I shall try to work 
it out myself from here, but I shall come back if I get stuck.

 

Thanks again

 

Peter Kenny

 

From: Pharo-users  On Behalf Of Tomaž Turk
Sent: 06 April 2020 08:04
To: Any question about pharo is welcome 
Subject: Re: [Pharo-users] Automation of MS Office from Pharo

 

Hello Peter,

 

If you look at the code in the Word test you will notice that the test firstly

- creates a new Word instance, 

- makes it visible to the end user, 

- then adds an empty document to the documents collection with the text "Hello 
from Pharo!"

- then it tests whether it can receive the same text back from Word.

 

After that, the test

- adds a new empty document to the documents collection with the text "Hello 
from Pharo! Some additional text. ", this time as an array of two texts

- it activates this second document (this imitates the end user's window 
activation on the desktop)

- then it tests whether it can receive the same text back from Word.

 

If you look at the Task Manager, you'll notice that you have one Word process 
with two open documents:

 



 

Namely, for each document Word creates a new, separate window - the documents 
are not displayed in one "Word application window", but separately - that's a 
normal behavior for some versions of MS Office, and it happens also if you open 
several documents directly in Word. So, there is just one Word instance.

 

'finalize' clears the references to the Word instance, it doesn't close the 
program by itself. If you want to do that, you can send Quit message to Word 
before you destroy the reference 
(https://docs.microsoft.com/en-us/office/vba/api/word.application.quit(method)).
 

 

Similar behaviour is with Outlook, here's one example: 
https://www.excelcommand.com/excel-help/excel-how-to.php?i=124116

 

The calling among COM objects is asynchronous, and it's usually wise to wrap it 
in error handling structures.

 

Please tell us how it goes.

 

Best wishes,

Tomaz

 

 

 

 

 

 

 

 

-- Original Message --

From: "PBKResearch" mailto:pe...@pbkresearch.co.uk> >

To: "Any question about pharo is welcome" mailto:pharo-users@lists.pharo.org> >

Sent: 5.4.2020 23:18:02

Subject: Re: [Pharo-users] Automation of MS Office from Pharo

 

Pablo - a final update before I close for the night. The Word test on the pharo 
8 version comes up green. The strange error message is nowhere to be seen in 
any Pharo 8 runs. The result is not what I expected; I finish up with two Word 
documents open, one with the first message, the other with the two messages. I 
thought the 'finalize' command would close it down.

 

Anyway, it looks as if I need to switch to P8 to use Pharo-Com. I shall 
continue testing tomorrow on P8.

 

Sorry for the late-night hassle.

 

Peter

 



Re: [Pharo-users] Automation of MS Office from Pharo

2020-04-05 Thread PBKResearch
Pablo - a final update before I close for the night. The Word test on the pharo 
8 version comes up green. The strange error message is nowhere to be seen in 
any Pharo 8 runs. The result is not what I expected; I finish up with two Word 
documents open, one with the first message, the other with the two messages. I 
thought the 'finalize' command would close it down.

Anyway, it looks as if I need to switch to P8 to use Pharo-Com. I shall 
continue testing tomorrow on P8.

Sorry for the late-night hassle.

Peter

-Original Message-
From: Pharo-users  On Behalf Of PBKResearch
Sent: 05 April 2020 21:57
To: 'Any question about pharo is welcome' 
Subject: Re: [Pharo-users] Automation of MS Office from Pharo

Pablo - Thanks for this. Just one bit of news. While I was waiting, I opened a 
new Pharo 8 image, installed Pharo-Com 9the right one!) and tried to run some 
of your tests. The Word test started to work, then stopped saying 'test took 
too long'. But it did open a Word document, and in one trial it printed the 
opening message. The variant tests were all green. So there are signs that the 
problem lies with P7. 

So don't worry too much about me - I probably fouled something up.

Peter.



-Original Message-
From: Pharo-users  On Behalf Of 
teso...@gmail.com
Sent: 05 April 2020 21:47
To: Any question about pharo is welcome 
Subject: Re: [Pharo-users] Automation of MS Office from Pharo

Ok, I was trying to find an easy solution. I will try tomorrow morning to see 
the problem.
Sorry,

On Sun, Apr 5, 2020 at 10:29 PM PBKResearch  wrote:
>
> Pablo – Yes, I saw the instruction. I used the quoted Metacello 
> procedure for P7 – I used copy and paste from the repo Readme. Peter
>
>
>
> From: Pharo-users  On Behalf Of 
> teso...@gmail.com
> Sent: 05 April 2020 21:19
> To: Any question about pharo is welcome 
> Subject: Re: [Pharo-users] Automation of MS Office from Pharo
>
>
>
> The install instructions are not the same for Pharo 7, or pharo 8/9
>
>
>
> On Sun, Apr 5, 2020, 22:18 teso...@gmail.com  wrote:
>
> If you are using pharo 7, you have to install a different branch of 
> the project. Check in the documentation of pharo-com(the read me in 
> the same repo)
>
>
>
> On Sun, Apr 5, 2020, 21:41 PBKResearch  wrote:
>
> Hello Pablo
>
> Many thanks for the suggestion. I have tried to use Pharo-Com to connect to 
> Outlook, and have now got myself into a complete tangle. I have been able to 
> connect to my already-running copy of Outlook, but when I tried to enter 
> propertyNamed: 'Folders', an error message appeared with the text: "Instance 
> of FFIExternalObjectType did not understand emitArgument:context:inCallout:".
> I could not understand this, so I closed the debugger, assuming the effects 
> would be unwound.
>
> I found that, whatever I tried after that, the same message appeared. In 
> desperation I closed down Pharo, without saving the image, and started again. 
> Whatever I tried in using Pharo-Com, the exact same message appeared. Even 
> when I tried running one of your tests, the same message.
>
> It seems clear that something in my system, not part of Pharo, has been 
> changed in a way which persists from one run of Pharo to another. I have no 
> idea what it can be, but I see that some parts of Pharo-Com address the 
> registry, so I wonder if I have corrupted that in some way.
>
> For the time being I have stopped work on Pharo-Com. I hope that a night's 
> sleep will bring inspiration. In case it means anything to you, I attach a 
> screenshot of the error stack when I try to run the testWord case in 
> PharoCOM-Tests.
>
> Thanks again
>
> Peter Kenny
>
> -Original Message-
> From: Pharo-users  On Behalf Of 
> teso...@gmail.com
> Sent: 05 April 2020 16:23
> To: Any question about pharo is welcome 
> Subject: Re: [Pharo-users] Automation of MS Office from Pharo
>
> Hello,
>One of the alternatives to integrate with Office is the use of the COM 
> interface. There is an implementation in 
> https://github.com/tesonep/pharo-com. In the test package, there are examples 
> to integrate with Word, Excell, Internet Explorer, and Access. Integration 
> with Outlook can be done in the same fashion. It is good that the API of all 
> the Office products is heavily documented.
>
> You can get more information about how to use Outlook here:
> https://docs.microsoft.com/en-us/office/vba/api/overview/outlook/objec
> t-model
>
> If you have any questions, please let me know.
> Cheers,
> Pablo.
>
> On Sun, Apr 5, 2020 at 2:44 PM PBKResearch  wrote:
> >
> > Hello All
> >
> >
> >
> > I am using Pharo (currently P7, moving to P8) under Windows 10. I have MS 
> > Office 365 on my system, and

Re: [Pharo-users] Automation of MS Office from Pharo

2020-04-05 Thread PBKResearch
Pablo - Thanks for this. Just one bit of news. While I was waiting, I opened a 
new Pharo 8 image, installed Pharo-Com 9the right one!) and tried to run some 
of your tests. The Word test started to work, then stopped saying 'test took 
too long'. But it did open a Word document, and in one trial it printed the 
opening message. The variant tests were all green. So there are signs that the 
problem lies with P7. 

So don't worry too much about me - I probably fouled something up.

Peter.



-Original Message-
From: Pharo-users  On Behalf Of 
teso...@gmail.com
Sent: 05 April 2020 21:47
To: Any question about pharo is welcome 
Subject: Re: [Pharo-users] Automation of MS Office from Pharo

Ok, I was trying to find an easy solution. I will try tomorrow morning to see 
the problem.
Sorry,

On Sun, Apr 5, 2020 at 10:29 PM PBKResearch  wrote:
>
> Pablo – Yes, I saw the instruction. I used the quoted Metacello 
> procedure for P7 – I used copy and paste from the repo Readme. Peter
>
>
>
> From: Pharo-users  On Behalf Of 
> teso...@gmail.com
> Sent: 05 April 2020 21:19
> To: Any question about pharo is welcome 
> Subject: Re: [Pharo-users] Automation of MS Office from Pharo
>
>
>
> The install instructions are not the same for Pharo 7, or pharo 8/9
>
>
>
> On Sun, Apr 5, 2020, 22:18 teso...@gmail.com  wrote:
>
> If you are using pharo 7, you have to install a different branch of 
> the project. Check in the documentation of pharo-com(the read me in 
> the same repo)
>
>
>
> On Sun, Apr 5, 2020, 21:41 PBKResearch  wrote:
>
> Hello Pablo
>
> Many thanks for the suggestion. I have tried to use Pharo-Com to connect to 
> Outlook, and have now got myself into a complete tangle. I have been able to 
> connect to my already-running copy of Outlook, but when I tried to enter 
> propertyNamed: 'Folders', an error message appeared with the text: "Instance 
> of FFIExternalObjectType did not understand emitArgument:context:inCallout:".
> I could not understand this, so I closed the debugger, assuming the effects 
> would be unwound.
>
> I found that, whatever I tried after that, the same message appeared. In 
> desperation I closed down Pharo, without saving the image, and started again. 
> Whatever I tried in using Pharo-Com, the exact same message appeared. Even 
> when I tried running one of your tests, the same message.
>
> It seems clear that something in my system, not part of Pharo, has been 
> changed in a way which persists from one run of Pharo to another. I have no 
> idea what it can be, but I see that some parts of Pharo-Com address the 
> registry, so I wonder if I have corrupted that in some way.
>
> For the time being I have stopped work on Pharo-Com. I hope that a night's 
> sleep will bring inspiration. In case it means anything to you, I attach a 
> screenshot of the error stack when I try to run the testWord case in 
> PharoCOM-Tests.
>
> Thanks again
>
> Peter Kenny
>
> -Original Message-
> From: Pharo-users  On Behalf Of 
> teso...@gmail.com
> Sent: 05 April 2020 16:23
> To: Any question about pharo is welcome 
> Subject: Re: [Pharo-users] Automation of MS Office from Pharo
>
> Hello,
>One of the alternatives to integrate with Office is the use of the COM 
> interface. There is an implementation in 
> https://github.com/tesonep/pharo-com. In the test package, there are examples 
> to integrate with Word, Excell, Internet Explorer, and Access. Integration 
> with Outlook can be done in the same fashion. It is good that the API of all 
> the Office products is heavily documented.
>
> You can get more information about how to use Outlook here:
> https://docs.microsoft.com/en-us/office/vba/api/overview/outlook/objec
> t-model
>
> If you have any questions, please let me know.
> Cheers,
> Pablo.
>
> On Sun, Apr 5, 2020 at 2:44 PM PBKResearch  wrote:
> >
> > Hello All
> >
> >
> >
> > I am using Pharo (currently P7, moving to P8) under Windows 10. I have MS 
> > Office 365 on my system, and use it regularly for non-Smalltalk tasks. It 
> > would be very convenient if I could issue commands to MS Office components 
> > from within Pharo. My current interest is to manage my incoming e-mails in 
> > Outlook, but I can see many other applications. I have a recollection of 
> > seeing a reference to automation of Excel to transfer data both ways, but I 
> > cannot recall where. I have searched the catalog, but could not see 
> > anything that looked relevant. I have also read the uFFI booklet, but again 
> > no luck. Could anyone point me to any information or examples of such 
> > control, please? It would not have to be Outlook, though that is my main 
> > interest; given examples for other Office components, I should be able to 
> > follow the pattern.
> >
> >
> >
> > TIA
> >
> >
> >
> > Peter Kenny
>
>
>
> --
> Pablo Tesone.
> teso...@gmail.com



--
Pablo Tesone.
teso...@gmail.com




Re: [Pharo-users] Automation of MS Office from Pharo

2020-04-05 Thread PBKResearch
Pablo – Yes, I saw the instruction. I used the quoted Metacello procedure for 
P7 – I used copy and paste from the repo Readme. Peter

 

From: Pharo-users  On Behalf Of 
teso...@gmail.com
Sent: 05 April 2020 21:19
To: Any question about pharo is welcome 
Subject: Re: [Pharo-users] Automation of MS Office from Pharo

 

The install instructions are not the same for Pharo 7, or pharo 8/9

 

On Sun, Apr 5, 2020, 22:18 teso...@gmail.com <mailto:teso...@gmail.com>  
mailto:teso...@gmail.com> > wrote:

If you are using pharo 7, you have to install a different branch of the 
project. Check in the documentation of pharo-com(the read me in the same repo) 

 

On Sun, Apr 5, 2020, 21:41 PBKResearch mailto:pe...@pbkresearch.co.uk> > wrote:

Hello Pablo

Many thanks for the suggestion. I have tried to use Pharo-Com to connect to 
Outlook, and have now got myself into a complete tangle. I have been able to 
connect to my already-running copy of Outlook, but when I tried to enter 
propertyNamed: 'Folders', an error message appeared with the text: "Instance of 
FFIExternalObjectType did not understand emitArgument:context:inCallout:".
I could not understand this, so I closed the debugger, assuming the effects 
would be unwound. 

I found that, whatever I tried after that, the same message appeared. In 
desperation I closed down Pharo, without saving the image, and started again. 
Whatever I tried in using Pharo-Com, the exact same message appeared. Even when 
I tried running one of your tests, the same message. 

It seems clear that something in my system, not part of Pharo, has been changed 
in a way which persists from one run of Pharo to another. I have no idea what 
it can be, but I see that some parts of Pharo-Com address the registry, so I 
wonder if I have corrupted that in some way. 

For the time being I have stopped work on Pharo-Com. I hope that a night's 
sleep will bring inspiration. In case it means anything to you, I attach a 
screenshot of the error stack when I try to run the testWord case in 
PharoCOM-Tests.

Thanks again

Peter Kenny

-Original Message-
From: Pharo-users mailto:pharo-users-boun...@lists.pharo.org> > On Behalf Of teso...@gmail.com 
<mailto:teso...@gmail.com> 
Sent: 05 April 2020 16:23
To: Any question about pharo is welcome mailto:pharo-users@lists.pharo.org> >
Subject: Re: [Pharo-users] Automation of MS Office from Pharo

Hello,
   One of the alternatives to integrate with Office is the use of the COM 
interface. There is an implementation in https://github.com/tesonep/pharo-com. 
In the test package, there are examples to integrate with Word, Excell, 
Internet Explorer, and Access. Integration with Outlook can be done in the same 
fashion. It is good that the API of all the Office products is heavily 
documented.

You can get more information about how to use Outlook here:
https://docs.microsoft.com/en-us/office/vba/api/overview/outlook/object-model

If you have any questions, please let me know.
Cheers,
Pablo.

On Sun, Apr 5, 2020 at 2:44 PM PBKResearch mailto:pe...@pbkresearch.co.uk> > wrote:
>
> Hello All
>
>
>
> I am using Pharo (currently P7, moving to P8) under Windows 10. I have MS 
> Office 365 on my system, and use it regularly for non-Smalltalk tasks. It 
> would be very convenient if I could issue commands to MS Office components 
> from within Pharo. My current interest is to manage my incoming e-mails in 
> Outlook, but I can see many other applications. I have a recollection of 
> seeing a reference to automation of Excel to transfer data both ways, but I 
> cannot recall where. I have searched the catalog, but could not see anything 
> that looked relevant. I have also read the uFFI booklet, but again no luck. 
> Could anyone point me to any information or examples of such control, please? 
> It would not have to be Outlook, though that is my main interest; given 
> examples for other Office components, I should be able to follow the pattern.
>
>
>
> TIA
>
>
>
> Peter Kenny



--
Pablo Tesone.
teso...@gmail.com <mailto:teso...@gmail.com> 



[Pharo-users] Automation of MS Office from Pharo

2020-04-05 Thread PBKResearch
Hello All

 

I am using Pharo (currently P7, moving to P8) under Windows 10. I have MS
Office 365 on my system, and use it regularly for non-Smalltalk tasks. It
would be very convenient if I could issue commands to MS Office components
from within Pharo. My current interest is to manage my incoming e-mails in
Outlook, but I can see many other applications. I have a recollection of
seeing a reference to automation of Excel to transfer data both ways, but I
cannot recall where. I have searched the catalog, but could not see anything
that looked relevant. I have also read the uFFI booklet, but again no luck.
Could anyone point me to any information or examples of such control,
please? It would not have to be Outlook, though that is my main interest;
given examples for other Office components, I should be able to follow the
pattern.

 

TIA

 

Peter Kenny



Re: [Pharo-users] How should XMLHTMLParser handle strange HTML?

2020-04-03 Thread PBKResearch
<pre>Hello Michal

 

Many thanks for your comprehensive explanation. I am using these translations 
just as a vehicle to get the text of my incoming e-mails into Pharo, so the 
conditional comments have no relevance to my use and are just clutter. I shall 
therefore continue preprocessing the received HTML to turn them into legal 
comments. I have found that they come with various forms of ‘if’, so the 
rewriting just turns ‘<![‘ into ‘<!--[‘ and ‘]>’ into ‘]-->’. I do this with 
String>>replaceAll:with:, but it might be interesting to write a PetitParser 
job to eliminate them completely. We can only hope that MS will sometime 
realise the meaning of the word ‘deprecated’; I am using the latest Outlook in 
Office 365, and these forms are only relevant to long-dead versions of IE.

 

Probably you are right that XMLHTMLParser should handle them tidily, but 
whether it is worth the effort depends on how often they turn up in the wild. 
It appears I may be the only person so far to have hit this, just because of my 
combination of Outlook with Pharo. I shan’t be clamouring for any quick change.

 

Thanks again for your help.

 

Peter Kenny

 

From: Pharo-users <pharo-users-boun...@lists.pharo.org> On Behalf Of Michal 
Balda
Sent: 03 April 2020 16:45
To: pharo-users@lists.pharo.org
Subject: Re: [Pharo-users] How should XMLHTMLParser handle strange HTML?

 

Hello Peter,

Those are called conditional comments. They come from MS Word which is used as 
the HTML rendering engine for MS Outlook. There is not much documentation 
available online specifically for MS Word but they were also implemented in 
older versions of MS Internet Explorer and used commonly by web designers to 
fix bugs and quirks in IE's rendering. See Wikipedia: 
<<a  rel="nofollow" href="https://en.wikipedia.org/wiki/Conditional_comment">https://en.wikipedia.org/wiki/Conditional_comment</a>> 


<a  rel="nofollow" href="https://en.wikipedia.org/wiki/Conditional_comment">https://en.wikipedia.org/wiki/Conditional_comment</a>

Or just search for "internet explorer conditional comments", you will find 
plenty of resources.

The ones in your example are the "downlevel-revealed" sort of conditional 
comments meaning that the content between the "if" and "endif" is visible to 
all browsers. The "if" and "endif" themselves are recognized by MS Word (and MS 
Internet Explorer) and evaluated as conditions while they are ignored by other 
web browsers.

The syntax is based on the original SGML syntax which is the precursor to HTML. 
In this form it is invalid in HTML but standard browsers can handle it and do 
the meaningful thing. There exists an alternative form (also described by the 
Wikipedia page) which is valid HTML and still works as a conditional comment:

<!--[if !supportLists]><!-->
<!--<![endif]-->

Just converting it to "<!--[if !supportLists]-->" causes it to lose its 
meaning: it won't be recognized any more but if you don't need to open it in MS 
Word again it doesn't matter.

To answer your question: What should an HTML parser do? I think it depends on 
the use case. What XMLHTMLParser does now is wrong. To be correct, it could 
signal an error since it's invalid HTML (like an HTML validator would), or it 
could ignore the syntax error in an unknown element and continue parsing (like 
a browser would). Standard HTML processors choose the second approach and try 
to fix what they can to produce what they think is most meaningful. In this 
case they are smart enough to realize that it's probably meant to be a comment. 
To me, something like a resumable exception would be acceptable: one could make 
two wrappers, a strict one and a loose one, and choose the one that better fits 
the situation.

(An XML parser, on the other hand, must always signal an exception and abort 
parsing in case of a syntax error, as per the specification.)

 

Michal

 

 

On 2.4.2020 19:16, PBKResearch wrote:

Hello

 

I have come across a strange problem in using XMLHTMLParser to parse some HTML 
files which use strange constructions. The input files have been generated by 
using MS Outlook to translate incoming messages, stored in .msg files, into 
HTML. The translated files display normally in Firefox, and the XMLHTMLParser 
appears to generate a normal parse, but examination of the parse output shows 
that the structure is distorted, and about half the input text has been put 
into one string node.

 

Hunting around, I am convinced that the trouble lies in the presence in the 
HTML source of pairs of comment-like tags, with this form:

<![if !supportLists]>

<![endif]>

since the distorted parse starts at the first occurrence of one of these tags.

 

I don’t know whether these are meant to be a structure in some programming 
language

Re: [Pharo-users] How should XMLHTMLParser handle strange HTML?

2020-04-02 Thread PBKResearch
Hi Esteban

Thanks for the suggestion. I have skimmed through the description of tidy. I 
think the things it puts right (mis-matched tags etc.) are exactly the things 
that XMLHTMLParser looks for and fixes. For example, in my distorted parses, 
the final  and  tags had been absorbed into the massive string 
node that contains most of the input text; the parser detected this and 
inserted them at the right point to close the parse correctly. 
Since my workaround, of editing out the specific features that cause the parse 
to go wrong, seems to fix the problem, I shall probably continue with it.

Thanks for your help

Peter Kenny

-Original Message-
From: Pharo-users  On Behalf Of Esteban 
Maringolo
Sent: 02 April 2020 19:53
To: Any question about pharo is welcome 
Subject: Re: [Pharo-users] How should XMLHTMLParser handle strange HTML?

Hi Peter,


Just in case it helps you parsing the files...

I had to parse HTML with a XMLParser (no XMLHTMLParser) so what I did was to 
pass it first through html tidy [1] converting it to xhtml which is compatible 
with XML parsers (it is XML, after all).

Regards,

[1] http://www.html-tidy.org/

Esteban A. Maringolo

On Thu, Apr 2, 2020 at 2:17 PM PBKResearch  wrote:
>
> Hello
>
>
>
> I have come across a strange problem in using XMLHTMLParser to parse some 
> HTML files which use strange constructions. The input files have been 
> generated by using MS Outlook to translate incoming messages, stored in .msg 
> files, into HTML. The translated files display normally in Firefox, and the 
> XMLHTMLParser appears to generate a normal parse, but examination of the 
> parse output shows that the structure is distorted, and about half the input 
> text has been put into one string node.
>
>
>
> Hunting around, I am convinced that the trouble lies in the presence in the 
> HTML source of pairs of comment-like tags, with this form:
>
> 
>
> 
>
> since the distorted parse starts at the first occurrence of one of these tags.
>
>
>
> I don’t know whether these are meant to be a structure in some programming 
> language – there is no reference to supportLists anywhere in the source code. 
> When it is displayed in Firefox, use of the ‘Inspect Element’ option shows 
> that the browser has treated them as comments, displaying them with the 
> necessary dashes as e.g. . I edited the source code 
> by inserting the dashes, and XMLHTMLParser parsed everything correctly.
>
>
>
> I have a workaround, therefore; either edit in the dashes to make them into 
> legitimate comments, or equivalently edit out these tags completely. The only 
> question of general interest is whether XMLHTMLParser should be expected to 
> handle these in some other way, rather than produce a distorted parse without 
> comment. The Firefox approach, turning them into comments, seems sensible. It 
> would also be interesting if anyone has any idea what is going on in the 
> source code.
>
>
>
> Thanks for any help
>
>
>
> Peter Kenny




[Pharo-users] How should XMLHTMLParser handle strange HTML?

2020-04-02 Thread PBKResearch
Hello

 

I have come across a strange problem in using XMLHTMLParser to parse some
HTML files which use strange constructions. The input files have been
generated by using MS Outlook to translate incoming messages, stored in .msg
files, into HTML. The translated files display normally in Firefox, and the
XMLHTMLParser appears to generate a normal parse, but examination of the
parse output shows that the structure is distorted, and about half the input
text has been put into one string node.

 

Hunting around, I am convinced that the trouble lies in the presence in the
HTML source of pairs of comment-like tags, with this form:





since the distorted parse starts at the first occurrence of one of these
tags.

 

I don't know whether these are meant to be a structure in some programming
language - there is no reference to supportLists anywhere in the source
code. When it is displayed in Firefox, use of the 'Inspect Element' option
shows that the browser has treated them as comments, displaying them with
the necessary dashes as e.g. . I edited the source
code by inserting the dashes, and XMLHTMLParser parsed everything correctly.


 

I have a workaround, therefore; either edit in the dashes to make them into
legitimate comments, or equivalently edit out these tags completely. The
only question of general interest is whether XMLHTMLParser should be
expected to handle these in some other way, rather than produce a distorted
parse without comment. The Firefox approach, turning them into comments,
seems sensible. It would also be interesting if anyone has any idea what is
going on in the source code.

 

Thanks for any help

 

Peter Kenny



Re: [Pharo-users] Json encoding

2020-03-20 Thread PBKResearch
Vitor

 

First clarification: There are two different serialization formats, json and 
STON. The content of a json file can only be number, Boolean, string, array, 
dictionary. STON is an extended form based on json, designed to represent 
(almost) any Smalltalk object.

 

Second clarification: What are you trying to do? Do you want to serialize data 
for your own use, to read back into your own Pharo app? Or do you want to 
export data in json format, so that other users, not using necessarily using 
Pharo, can import it? For the first case, STON is a very flexible and 
convenient system. For the second case, you must stick to strict json, using 
only the classes allowed in json.

 

Coming to your specific examples, Date is not a class allowed in json. This is 
not a limitation of NeoJson or STON, it is a limitation of the definition of 
json. If you want to include a Date in a json file, you must turn it into an 
instance of a permitted class. So you could write:

 

STON toJsonString: Date today asString.

 

The only complication here is, if the json is read by other users, they must 
understand the format generated by Date>>asString.

 

If you are using STON to serialise objects for your own use, you may want to 
exclude some instvars (e.g. block closures). This is described in the class 
comments to the STON-Core package. You need to include a class side message 
#stonAllInstVarNames in the class, which lists the names of the instvars that 
are to be serialized.

 

If you want to go deeper into STON, I think Sven has an article on his website 
telling the whole story. This maybe enough to get you started.

 

HTH

 

Peter Kenny

 

From: Pharo-users  On Behalf Of Vitor 
Medina Cruz
Sent: 20 March 2020 01:20
To: Any question about pharo is welcome 
Subject: [Pharo-users] Json encoding

 

Hello,

 

I know two projects of json encoding/decoding — NeoJson and STON.

 

In Java I have two most used ones too: Gson and Jackson. Using those I can 
simply pass any object and it they can convert to a json string, the former 
can't deal with cycles, the latter can with some little config.

 

NeoJson seems to be limited to primitives, for example, in Pharo 8 I can't run 

 

NeoJSONWriter toString: (Date today)

 

Since I got:

 

NeoJSONMappingNotFound: No mapping found for Date in NeoJSONWriter

 

 

STON works fine with 

 

STON toString: (Date today).

 

but fail with:

 

STON toJsonString: (Date today).

 

Also, STON fails if I try to serialize an object which contains an instance 
variable pointing to a block closure. I didn't find out how to ignore these 
instance variable as it is unnecessary for what I need at the moment. 

 

So, which lib for json or some object/string encoding/decoding should I be 
using on Pharo? Is there something better than those libs? Am I doing something 
wrong? My experience tells this should be simple, but it is not.

 

Thanks in advance,

Vitor



Re: [Pharo-users] can I somehow test the contents of a package

2020-02-14 Thread PBKResearch
Hello everyone

I have received this e-mail, and another one from Phil quoting the same 
download link in an entirely different context. I have not downloaded it, 
because I think there is something suspicious about it. Has anyone else any 
suspicions? Has someone hacked into my e-mail, or is it this list that has been 
hacked? Or am I just neurotic?

Peter Kenny

-Original Message-
From: Pharo-users  On Behalf Of 
p...@highoctane.be
Sent: 14 February 2020 18:45
To: pharo-users@lists.pharo.org
Subject: Re: [Pharo-users] can I somehow test the contents of a package

I have made some edits. Please check.
https://drive.google.com/uc?id=1yjAdoDnfoMvxGf9KG2RGedjXvNQdwOee=download
Archive password: 






Re: [Pharo-users] NeoJSONParseError: invalid input: ' while parsing a Wikipedia exported article.

2020-02-08 Thread PBKResearch
Offray

I have a workaround, not an explanation. I don't use NeoJSON, because for me 
the JSON facilities of STON are sufficient. So I tried you script with 
'NeoJSONReader fromString:' replaced by 'STON fromString:' - everything worked 
perfectly, no parsing error. So clearly there is nothing wrong with your input 
file. If you have STON installed, or think it worth installing, this could get 
you moving.

HTH

Peter Kenny

-Original Message-
From: Pharo-users  On Behalf Of Offray 
Vladimir Luna Cárdenas
Sent: 08 February 2020 07:38
To: Any question about pharo is welcome 
Subject: [Pharo-users] NeoJSONParseError: invalid input: ' while parsing a 
Wikipedia exported article.

Hi,

I'm trying to read the contents of a Wikipedia article that was exported from 
there using Wikipedias JSON API.

The script I'm trying is:

NeoJSONReader fromString:
'https://mutabit.com/repos.fossil/pharopedia/doc/tip/docs/wikipedia.org/wiki/en/Pharo/contents.json'
asUrl retrieveContents utf8Decoded

But I get "NeoJSONParseError: invalid input: '". As far as I can tell, the file 
at [1] seems like valid JSON, as is the one that Wikipedia API exports

[1]
'https://mutabit.com/repos.fossil/pharopedia/doc/tip/docs/wikipedia.org/wiki/en/Pharo/contents.json'

Could anybody point me to a solution?

Thanks,

Offray





Re: [Pharo-users] Fuzzy Thinking in Smalltalk

2020-02-05 Thread PBKResearch
Norbert

 

Is that really all you can see? If you trace back this thread, it began with a 
post (less than 24 hours ago) by Richard Kenneth Eng, drawing attention to a 
blog post by Lorenzo, whose title is also the subject of the thread:

https://smalltalk.tech.blog/2020/02/04/fuzzy-thinking-in-smalltalk/ 

Everything since then has been talking about that or about finding a link to an 
earlier post by Lorenzo.

 

I found the post interesting; my reaction is to wish there were more details. 
It is not Pharo, but is a Smalltalk application. I see no reason why you and 
Serge should say this is not suitable for this group; there are many posts here 
about non-Pharo Smalltalk activities.

 

Peter Kenny

 

 

From: Pharo-users  On Behalf Of Norbert 
Hartl
Sent: 05 February 2020 11:23
To: Pharo users users 
Subject: Re: [Pharo-users] Fuzzy Thinking in Smalltalk

 

 





Am 05.02.2020 um 10:53 schrieb Lorenzo <  
lore...@edor.it>:

 

I am sorry; I was not awer of this kind of problem.

Do you think that an application in Smalltalk is not interesting for Pharo 
users even if it has been developped in Pharo?

 

which application? I just read about things you've lost and wordpress problems 
regarding a blog.

 

Norbert





Lorenzo

 

  Mehr anzeigen von Norbert Hartl

 

 

​h​

 

  Mehr anzeigen von Norbert Hartl

 

 

Int. Research Unit

 on Modelling/Simulation of Complex Systems (UMMISCO)

​Sorbonne University

 (SU)

French National Research Institute for Sustainable Development (IRD)​

U

​niversity of Yaoundé I​

 

  Mehr anzeigen von Norbert Hartl

 

 


"Programs must be written for people to read, and only incidentally for 
machines to execute."
  https://twitter.com/SergeStinckwich

​

 



Re: [Pharo-users] Dictionary removeKey: very low

2020-02-03 Thread PBKResearch
Pierre

 

It’s all to do with rehashing. A dictionary is stored as an Array of 
Association. After a key and its corresponding association is removed, the 
remaining entries are rehashed from the removal point to the end of the array. 
By doing the removals in natural order, you rehash the whole of the remaining 
array after each removal. Try doing the removals in reverse order; on my 
machine it reduces the time from 6 seconds to 6 milliseconds. 

 

HTH

 

Peter Kenny

 

From: Pharo-users  On Behalf Of LABORDE 
Pierre
Sent: 03 February 2020 10:18
To: pharo-users@lists.pharo.org
Subject: [Pharo-users] Dictionary removeKey: very low

 

Hi all,

 

I have a problem with Dictionaries : 

 

dic := Dictionary new: 1.

 

1 to: 1 do:[ :i |

dic at: i put: i printString.

].

 

1 to: 1 do:[ :i |

dic removeKey: i.  

]

 

Removing each keys is very slooow, time execution difference between add and 
remove is crazy.

Any idea for fix that ? Can I use another Dictionary implementation or settings 
?

 

Thanks.

 

Pierre

 



Re: [Pharo-users] [ANN] XMLParserHTML moved to GitHub

2020-01-07 Thread PBKResearch
I agree it makes no sense. I repeated exactly what you describe in a new 
playground (in Pharo 6.1 on Windows 10) and all worked as expected – 
essentially the same result as Torsten reported in his first post. I wonder if 
it might be something Mac related in the operation of Playground.

 

As a desperate try to explain it, please see what happens if you open a 
Playground with just your single line

ingredientsXML := XMLHTMLParser parseURL: ' 
<https://ndb.nal.usda.gov/ndb/search/list?sort=ndb=Standard+Reference’> 
https://ndb.nal.usda.gov/ndb/search/list?sort=ndb=Standard+Reference’

and then select ‘do it and go’. You should find an inspector pane opening to 
the right in the Playground, with the result of the parse. If this fails, the 
standard suggestion is to open a debugger on you error message and try to work 
back through the stack to see how execution got there.

 

Just to discourage you further, when you do get to read the contents of the 
URL, you will find that the USDA have changed everything. All the data are now 
on a separate web site, probably in a new layout. This is one of the perpetual 
hassles of web scraping – the web site authors have to justify their existence 
by rewriting everything. I wrote this section of the scraping booklet, working 
up something I had done as a one-off a year or so earlier, and then I found 
that the USDA had changed the layout in the interim and much needed to be 
rewritten.

 

HTH – in part at least.

 

Peter Kenny

 

To Torsten – I agree I was slipshod in my drafting – I was in a hurry. Instead 
of saying ‘can screw things up’ I should have said ‘can produce 
counter-intuitive results’, as exemplified by the fact that, in your first 
example, ‘ingredientsXML’ can mean different things depending on whether you 
execute it all in one go or a line at a time.

 

From: Pharo-users  On Behalf Of 
LawsonEnglish
Sent: 07 January 2020 20:55
To: Any question about pharo is welcome 
Subject: Re: [Pharo-users] [ANN] XMLParserHTML moved to GitHub

 

I deleted the playground and entered the text thusly

 

ingredientsXML := XMLHTMLParser parseURL: 
'https://ndb.nal.usda.gov/ndb/search/list?sort=ndb 
<https://ndb.nal.usda.gov/ndb/search/list?sort=ndb=Standard+Reference’> 
=Standard+Reference’. 

 

“do it” has no complaints

 

ingredientsXML = nil 

 

yields “false"

 

ingredientsXML inspect

 

has errors: #new sent to nil

 

 

.

 

This makes no sense at all.

 

 

L

 





On Jan 7, 2020, at 1:55 AM, PBKResearch mailto:pe...@pbkresearch.co.uk> > wrote:

 

It may be a quirk of how Pharo Playground works. It doesn't need local variable 
declarations - which is convenient - but putting them in can screw things up. 
Try your snippet again without the first line. Compare Torsten's code.

HTH

Peter Kenny

-Original Message-
From: Pharo-users mailto:pharo-users-boun...@lists.pharo.org> > On Behalf Of Torsten Bergmann
Sent: 07 January 2020 07:47
To: pharo-users@lists.pharo.org <mailto:pharo-users@lists.pharo.org> 
Cc: pharo-users@lists.pharo.org <mailto:pharo-users@lists.pharo.org> 
Subject: Re: [Pharo-users] [ANN] XMLParserHTML moved to GitHub

Works without a problem (Pharo 8 on Windows), see attached. So it looks like a 
local problem.

Just check the debugger and compare to the squeak version where you run in 
trouble.
Maybe the document could not be retrieved on your machine.

Bye
T.




Gesendet: Dienstag, 07. Januar 2020 um 04:42 Uhr
Von: "LawsonEnglish" mailto:lengli...@cox.net> >
An: pharo-users@lists.pharo.org <mailto:pharo-users@lists.pharo.org> 
Betreff: Re: [Pharo-users] [ANN] XMLParserHTML moved to GitHub

Torsten Bergmann wrote



Hi,


You can load using

  Metacello new
   baseline: 'XMLParserHTML';
   repository: 'github://pharo-contributions/XML-XMLParserHTML/src';
   load.


Bye
T.


Hi,

I'm trying to use the sample code in the pharo screen scraping booklet 
— 
http://books.pharo.org/booklet-Scraping/pdf/2018-09-02-scrapingbook.pdf — but 
while everything appears to load, I'm getting an odd behavior from:

/| ingredientsXML |
ingredientsXML := XMLHTMLParser parseURL:
'https://ndb.nal.usda.gov/ndb/search/list?sort=ndb 
<https://ndb.nal.usda.gov/ndb/search/list?sort=ndb=Standard+Reference> 
=Standard+Reference'.
ingredientsXML inspect/

"#new was sent to nil"

No matter what URL I use, I get the same message.

I'm using Mac OS Catalina so I thought I might have some strange Mac 
OS security issue (like it was quietly refusing to allow Pharo to 
access the internet), but I tested with squeak and the old

/html :=(HtmlParser parse:
'https://ndb.nal.usda.gov/ndb/search/list?sort=ndb 
<https://ndb.nal.usda.gov/ndb/search/list?sort=ndb=Standard+Reference> 
=Standard+Reference'
asUrl retrieveContents content)/

and that returns actual html without any problems.


Suggestions?


Thanks.

L




--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html



 

 



Re: [Pharo-users] [ANN] XMLParserHTML moved to GitHub

2020-01-07 Thread PBKResearch
It may be a quirk of how Pharo Playground works. It doesn't need local variable 
declarations - which is convenient - but putting them in can screw things up. 
Try your snippet again without the first line. Compare Torsten's code.

HTH

Peter Kenny

-Original Message-
From: Pharo-users  On Behalf Of Torsten 
Bergmann
Sent: 07 January 2020 07:47
To: pharo-users@lists.pharo.org
Cc: pharo-users@lists.pharo.org
Subject: Re: [Pharo-users] [ANN] XMLParserHTML moved to GitHub

Works without a problem (Pharo 8 on Windows), see attached. So it looks like a 
local problem.

Just check the debugger and compare to the squeak version where you run in 
trouble.
Maybe the document could not be retrieved on your machine.

Bye
T.

> Gesendet: Dienstag, 07. Januar 2020 um 04:42 Uhr
> Von: "LawsonEnglish" 
> An: pharo-users@lists.pharo.org
> Betreff: Re: [Pharo-users] [ANN] XMLParserHTML moved to GitHub
>
> Torsten Bergmann wrote
> > Hi,
> > 
> > 
> > You can load using
> > 
> >Metacello new
> > baseline: 'XMLParserHTML';
> > repository: 'github://pharo-contributions/XML-XMLParserHTML/src';
> > load.
> > 
> > 
> > Bye
> > T.
> 
> Hi,
> 
> I'm trying to use the sample code in the pharo screen scraping booklet 
> — 
> http://books.pharo.org/booklet-Scraping/pdf/2018-09-02-scrapingbook.pdf — but 
> while everything appears to load, I'm getting an odd behavior from:
> 
> /| ingredientsXML |
> ingredientsXML := XMLHTMLParser parseURL:
> 'https://ndb.nal.usda.gov/ndb/search/list?sort=ndb=Standard+Reference'.
> ingredientsXML inspect/
> 
> "#new was sent to nil"
> 
> No matter what URL I use, I get the same message.
> 
> I'm using Mac OS Catalina so I thought I might have some strange Mac 
> OS security issue (like it was quietly refusing to allow Pharo to 
> access the internet), but I tested with squeak and the old
> 
> /html :=(HtmlParser parse:
> 'https://ndb.nal.usda.gov/ndb/search/list?sort=ndb=Standard+Reference'
> asUrl retrieveContents content)/
> 
> and that returns actual html without any problems.
> 
> 
> Suggestions?
> 
> 
> Thanks.
> 
> L
> 
> 
> 
> 
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
> 
>




Re: [Pharo-users] [ANN] XMLParserHTML moved to GitHub

2019-11-30 Thread PBKResearch
Sean

I used Soup a few times, but found it difficult to interpret the output,
because the parse did not seem to reflect the hierarchy of the nodes in the
original; in particular, sibling nodes were not necessarily at the same
level in the Soup. XMLHTMLParser always gets the structure right, in my
experience. I think this is essential if you want to use Xpath to process
the parse. The worked examples in the scraping booklet show how the parser
and Xpath can work together.

HTH

Peter Kenny

-Original Message-
From: Pharo-users  On Behalf Of Sean P.
DeNigris
Sent: 30 November 2019 16:43
To: pharo-users@lists.pharo.org
Subject: Re: [Pharo-users] [ANN] XMLParserHTML moved to GitHub

cedreek wrote
> To me, far better than using Soup. 

Ah, interesting! I use Soup almost exclusively. What did you find superior
about XMLParserHTML? I may give it a try...


cedreek wrote
> Google chrome pharo integration helps top to scrap complex full JS web 
> site like google ;)

Also interesting! Any publicly available examples? How does one load "Google
chrome pharo integration"? Also, there is often the "poor man's" way (albeit
requiring manual intervention) by inspecting the Ajax http requests in a
developer console and then recreating directly in Pharo.



-
Cheers,
Sean
--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html




Re: [Pharo-users] Strategy for investigating test failures

2019-10-20 Thread PBKResearch
Tim: No, on P6 the test took 11-12 seconds (judged on my ability to count 
seconds) and the same on P7. Presumably P6 did not have a limit, or it was over 
10s. Peter

-Original Message-
From: Pharo-users  On Behalf Of Tim 
Mackinnon
Sent: 20 October 2019 22:35
To: Any question about pharo is welcome 
Subject: Re: [Pharo-users] Strategy for investigating test failures


Confusion of failing test aside - is this something that got worse in Pharo 7? 
Did these tests pass in under 10s in 6 and take longer in 7? This would be a 
concrete thing to address, and something to check in 8.

Tim
 
Sent from my iPhone

> On 20 Oct 2019, at 20:11, PBKResearch  wrote:
> 
> Sven
> 
> Thanks - the real problem is my unfamiliarity with P7, so hints like this are 
> helpful. I am happier with familiar systems, but I will switch to the latest 
> Moose suite soon.
> 
> Peter
> 
> -Original Message-
> From: Pharo-users  On Behalf Of Sven Van 
> Caekenberghe
> Sent: 20 October 2019 17:31
> To: Any question about pharo is welcome 
> Subject: Re: [Pharo-users] Strategy for investigating test failures
> 
> Peter,
> 
> You can override #defaultTimeLimit on the class side of the offending test.
> 
> Yes, this can be confusing.
> 
> There is a new test runner under development, DrTest, in Pharo 8.
> 
> Sven
> 
>> On 20 Oct 2019, at 16:37, PBKResearch  wrote:
>> 
>> Hello all
>> 
>> I have done some experiments, and basically all the questions in my previous 
>> mail can be ignored. I think it is all a question of timing, which I sort of 
>> understand. Perhaps someone can clarify for me.
>> 
>> All my previous tests involved running the whole test suite, to ensure the 
>> set-up and tear-down methods were run. As an experiment, I selected the one 
>> red method and clicked ‘Run Tests’. After about 10 seconds, a halt appeared 
>> with the message ‘Test took too long’. When I clicked ‘Proceed’, the green 
>> appeared almost immediately. I tried again several times with similar 
>> results, although the halt occurred at different places in the code. I went 
>> back to my old P6 version and tried running tests on the one method; each 
>> time, it ran to green in about 11-12 seconds.
>> 
>> So back now to the P7 version; wondered if there is now a setting for 
>> permitted test duration. Eventually found it under ‘System’, default 10 
>> secs. Changed to 15 secs, re-run red test, now comes up green. Re-run whole 
>> test suite, all green.
>> 
>> So it all comes down to my ignorance of test settings. But Pharo is less 
>> than helpful; if you run the whole test suite, there is no way to 
>> distinguish a test which failed due to a wrong assertion from one which was 
>> terminated for taking too long – or did I miss something?
>> 
>> Peter Kenny
> 
> 
> 





Re: [Pharo-users] Strategy for investigating test failures

2019-10-20 Thread PBKResearch
Tim: No, on P6 the test took 11-12 seconds (judged on my ability to count 
seconds) and the same on P7. Presumably P6 did not have a limit, or it was over 
10s. Peter

-Original Message-
From: Pharo-users  On Behalf Of Tim 
Mackinnon
Sent: 20 October 2019 22:35
To: Any question about pharo is welcome 
Subject: Re: [Pharo-users] Strategy for investigating test failures


Confusion of failing test aside - is this something that got worse in Pharo 7? 
Did these tests pass in under 10s in 6 and take longer in 7? This would be a 
concrete thing to address, and something to check in 8.

Tim
 
Sent from my iPhone

> On 20 Oct 2019, at 20:11, PBKResearch  wrote:
> 
> Sven
> 
> Thanks - the real problem is my unfamiliarity with P7, so hints like this are 
> helpful. I am happier with familiar systems, but I will switch to the latest 
> Moose suite soon.
> 
> Peter
> 
> -Original Message-
> From: Pharo-users  On Behalf Of Sven Van 
> Caekenberghe
> Sent: 20 October 2019 17:31
> To: Any question about pharo is welcome 
> Subject: Re: [Pharo-users] Strategy for investigating test failures
> 
> Peter,
> 
> You can override #defaultTimeLimit on the class side of the offending test.
> 
> Yes, this can be confusing.
> 
> There is a new test runner under development, DrTest, in Pharo 8.
> 
> Sven
> 
>> On 20 Oct 2019, at 16:37, PBKResearch  wrote:
>> 
>> Hello all
>> 
>> I have done some experiments, and basically all the questions in my previous 
>> mail can be ignored. I think it is all a question of timing, which I sort of 
>> understand. Perhaps someone can clarify for me.
>> 
>> All my previous tests involved running the whole test suite, to ensure the 
>> set-up and tear-down methods were run. As an experiment, I selected the one 
>> red method and clicked ‘Run Tests’. After about 10 seconds, a halt appeared 
>> with the message ‘Test took too long’. When I clicked ‘Proceed’, the green 
>> appeared almost immediately. I tried again several times with similar 
>> results, although the halt occurred at different places in the code. I went 
>> back to my old P6 version and tried running tests on the one method; each 
>> time, it ran to green in about 11-12 seconds.
>> 
>> So back now to the P7 version; wondered if there is now a setting for 
>> permitted test duration. Eventually found it under ‘System’, default 10 
>> secs. Changed to 15 secs, re-run red test, now comes up green. Re-run whole 
>> test suite, all green.
>> 
>> So it all comes down to my ignorance of test settings. But Pharo is less 
>> than helpful; if you run the whole test suite, there is no way to 
>> distinguish a test which failed due to a wrong assertion from one which was 
>> terminated for taking too long – or did I miss something?
>> 
>> Peter Kenny
> 
> 
> 





Re: [Pharo-users] Strategy for investigating test failures

2019-10-20 Thread PBKResearch
Sven

Thanks - the real problem is my unfamiliarity with P7, so hints like this are 
helpful. I am happier with familiar systems, but I will switch to the latest 
Moose suite soon.

Peter

-Original Message-
From: Pharo-users  On Behalf Of Sven Van 
Caekenberghe
Sent: 20 October 2019 17:31
To: Any question about pharo is welcome 
Subject: Re: [Pharo-users] Strategy for investigating test failures

Peter,

You can override #defaultTimeLimit on the class side of the offending test.

Yes, this can be confusing.

There is a new test runner under development, DrTest, in Pharo 8.

Sven

> On 20 Oct 2019, at 16:37, PBKResearch  wrote:
> 
> Hello all
>  
> I have done some experiments, and basically all the questions in my previous 
> mail can be ignored. I think it is all a question of timing, which I sort of 
> understand. Perhaps someone can clarify for me.
>  
> All my previous tests involved running the whole test suite, to ensure the 
> set-up and tear-down methods were run. As an experiment, I selected the one 
> red method and clicked ‘Run Tests’. After about 10 seconds, a halt appeared 
> with the message ‘Test took too long’. When I clicked ‘Proceed’, the green 
> appeared almost immediately. I tried again several times with similar 
> results, although the halt occurred at different places in the code. I went 
> back to my old P6 version and tried running tests on the one method; each 
> time, it ran to green in about 11-12 seconds.
>  
> So back now to the P7 version; wondered if there is now a setting for 
> permitted test duration. Eventually found it under ‘System’, default 10 secs. 
> Changed to 15 secs, re-run red test, now comes up green. Re-run whole test 
> suite, all green.
>  
> So it all comes down to my ignorance of test settings. But Pharo is less than 
> helpful; if you run the whole test suite, there is no way to distinguish a 
> test which failed due to a wrong assertion from one which was terminated for 
> taking too long – or did I miss something?
>  
> Peter Kenny





[Pharo-users] Strategy for investigating test failures

2019-10-20 Thread PBKResearch
Hello all

 

I have done some experiments, and basically all the questions in my previous
mail can be ignored. I think it is all a question of timing, which I sort of
understand. Perhaps someone can clarify for me.

 

All my previous tests involved running the whole test suite, to ensure the
set-up and tear-down methods were run. As an experiment, I selected the one
red method and clicked 'Run Tests'. After about 10 seconds, a halt appeared
with the message 'Test took too long'. When I clicked 'Proceed', the green
appeared almost immediately. I tried again several times with similar
results, although the halt occurred at different places in the code. I went
back to my old P6 version and tried running tests on the one method; each
time, it ran to green in about 11-12 seconds.

 

So back now to the P7 version; wondered if there is now a setting for
permitted test duration. Eventually found it under 'System', default 10
secs. Changed to 15 secs, re-run red test, now comes up green. Re-run whole
test suite, all green.

 

So it all comes down to my ignorance of test settings. But Pharo is less
than helpful; if you run the whole test suite, there is no way to
distinguish a test which failed due to a wrong assertion from one which was
terminated for taking too long - or did I miss something?

 

Peter Kenny

 



[Pharo-users] Strategy for investigating test failures

2019-10-20 Thread PBKResearch
Hello all

 

I would be grateful for hints on strategy in investigating test failures on
upgrade. It is an area in which I have no experience; I can see some brute
force approaches, but I suspect there are cleverer ways to do it.

 

I have OmniBase working successfully on Moose Suite 6.1 (Pharo 6.0, Latest
update: #60541, 32-bit) on Windows 10. All the tests are green, and
everything I have tried for my own data works well. To get a bit nearer to
the state of the art, I tried to load OmniBase into a new 32-bit Pharo 7
image, created via Pharo Launcher a few days ago. I now have all tests green
except one - named 'testBTreeKeyLocking'. Since I am working in single-user
mode, I do not expect to need key locking, so I could go on without worrying
about it. But I am left with a nagging worry, and I would like to find out
what is wrong. The test method has altogether 8 assert/deny statements, so I
do not know where to start. 

 

1.  Is there any obvious reason why the upgrade should make working code
fail? Does P7 have a different compiler? If so, can I switch to an older
compiler and see if it is that? (On P6 andP7, the code mentor complains that
it should use 'assert:equals:' rather than 'assert:' and = , but that is
true in all the other test methods.)
2.  Is there any easy way in the test framework to work out which
assert/deny has failed?
3.  I could insert 'self halt' all over the place and use the debugger,
or run the method in debug mode; would this be an approved way of doing it?
The test suite creates and manipulates tiny databases; I am not sure whether
there might be timing issues in stepping through the code.

 

Any help or suggestions gratefully received.

 

Peter Kenny

 



Re: [Pharo-users] voyage mongo and transactionality

2019-10-10 Thread PBKResearch
Hi Jonathan

 

If you are interested in OmniBase on Pharo, there was a port by Sebastian 
Sastre in about 2010, which was forked and updated by Esteban Lorenzano in June 
2018 (https://github.com/estebanlm/OmniBase). There were a few bugs in the 
port, which were sorted out by Matias Maretto, ma...@omeleon.de 
<mailto:ma...@omeleon.de>  and myself. I have all these corrections in my local 
repo, but they have never been ported back to Esteban’s github repo, because I 
don’t know how to do it. So do not use Esteban’s repo until updated.

Esteban’s port was for Pharo 6, and in the case of marco and me was only tried 
on 32 bits. If you decided to install on 64-bit Pharo 7, you would be on new 
territory. The only problems are likely to be interactions with the file 
system. As a quick test, I installed Omnibase and tests in 32-bit Pharo 7. One 
test (#testBTreeKeyLocking) was red, all the rest green – I have not yet traced 
the cause. 

The biggest problem is likely to be documentation. I have tried only the 
simplest uses, because that is all I can work out from the slide-show notes. 
Maybe someone else who has used it more extensively might still have fuller 
documentation – e.g. Bruno, who also contributed to this thread.

 

Peter Kenny

 

 

 

From: Pharo-users  On Behalf Of Jonathan 
van Alteren
Sent: 10 October 2019 11:39
To: Any question about pharo is welcome 
Subject: Re: [Pharo-users] voyage mongo and transactionality

 

Hi Peter, 

 

Thanks for your reply.

 

That sounds very interesting. For similar reasons, I tried to check out Magma. 
However, since I'm still a novice in Pharo/Smalltalk and it's not very well 
documented (and mostly refers to Squeak), it's quite painful to figure out how 
it works and how to get it going in Pharo. Not to mention actually using it in 
production for an 'enterprise' application for an actual customer... I haven't 
given that up yet, but currently don't have the time.

 

I will look into OmniBase. Anything you're willing to share about getting it up 
and running (in Pharo 7.0 64-bit) is greatly appreciated!

 

 

Kind regards,

Jonathan van Alteren

Founding Member | Object Guild
jvalte...@objectguild.com <mailto:jvalte...@objectguild.com> 

On 9 Oct 2019, 20:34 +0200, PBKResearch mailto:pe...@pbkresearch.co.uk> >, wrote:



It may be irrelevant, but I have been playing recently with OmniBase, which is 
a fully object-oriented database system, now over 20 years old, but it still 
works very well for my uses. David Gorišek, the author, claims that it has ACID 
properties. From my reading, updates operate on a proxy object, which is not 
written to the database until an explicit commit is given. A second transaction 
accessing the same object will still see the original until the change is 
committed. What happens to a proxy which is never committed is not clear, but 
if Gorišek is right, the stored data can never be contaminated. I think a proxy 
in this sense is equivalent to a memento.

 

Thanks to Esteban Lorenzano, OmniBase is now available on Pharo. The code is 
ancient, there is no documentation and obviously no support, but it might be 
worth while for someone to try some software archaeology and put it to use. I 
have found it possible to create and maintain a small database of natural 
language information, and access is fairly quick and easy – and it’s all 
Smalltalk.

It claims to store all kinds of Smalltalk objects, except block closures, and 
skimming through the code it seems to incorporate a serializer similar to Fuel.

 

The only documentation I have found is a slideshow at  
<https://www.slideshare.net/esug/omni-baseobjectdatabase> 
https://www.slideshare.net/esug/omni-baseobjectdatabase. I have found out a few 
things about it, if anyone is interested.

 

Peter Kenny

 

 

From: Pharo-users < <mailto:pharo-users-boun...@lists.pharo.org> 
pharo-users-boun...@lists.pharo.org> On Behalf Of Norbert Hartl
Sent: 09 October 2019 18:08
To: Any question about pharo is welcome < <mailto:pharo-users@lists.pharo.org> 
pharo-users@lists.pharo.org>
Subject: Re: [Pharo-users] voyage mongo and transactionality

 

 


Am 09.10.2019 um 16:48 schrieb " <mailto:jtuc...@objektfabrik.de> 
jtuc...@objektfabrik.de" < <mailto:jtuc...@objektfabrik.de> 
jtuc...@objektfabrik.de>:

 

This is a tricky mine field. Sometimes you need a lot of business functionality 
in objects referenced in your objects that are currently in the editor. So I'm 
still to see a project in which the memento pattern really worked for more 
complex scenarios. How deep do you dive to have enough memento objects to 
provide the functionality needed. I guess you can do that with some sort of 
object-level transaction framework that automatically creates mementos of 
whatever object is being navigated to during some kind of processing-context. I 
guess slots could be of use here. But this is not trivial for 

Re: [Pharo-users] voyage mongo and transactionality

2019-10-09 Thread PBKResearch
It may be irrelevant, but I have been playing recently with OmniBase, which is 
a fully object-oriented database system, now over 20 years old, but it still 
works very well for my uses. David Gorišek, the author, claims that it has ACID 
properties. From my reading, updates operate on a proxy object, which is not 
written to the database until an explicit commit is given. A second transaction 
accessing the same object will still see the original until the change is 
committed. What happens to a proxy which is never committed is not clear, but 
if Gorišek is right, the stored data can never be contaminated. I think a proxy 
in this sense is equivalent to a memento.

 

Thanks to Esteban Lorenzano, OmniBase is now available on Pharo. The code is 
ancient, there is no documentation and obviously no support, but it might be 
worth while for someone to try some software archaeology and put it to use. I 
have found it possible to create and maintain a small database of natural 
language information, and access is fairly quick and easy – and it’s all 
Smalltalk.

It claims to store all kinds of Smalltalk objects, except block closures, and 
skimming through the code it seems to incorporate a serializer similar to Fuel.

 

The only documentation I have found is a slideshow at 
https://www.slideshare.net/esug/omni-baseobjectdatabase. I have found out a few 
things about it, if anyone is interested.

 

Peter Kenny

 

 

From: Pharo-users  On Behalf Of Norbert 
Hartl
Sent: 09 October 2019 18:08
To: Any question about pharo is welcome 
Subject: Re: [Pharo-users] voyage mongo and transactionality

 

 


Am 09.10.2019 um 16:48 schrieb "jtuc...@objektfabrik.de 
 " mailto:jtuc...@objektfabrik.de> >:

 

This is a tricky mine field. Sometimes you need a lot of business functionality 
in objects referenced in your objects that are currently in the editor. So I'm 
still to see a project in which the memento pattern really worked for more 
complex scenarios. How deep do you dive to have enough memento objects to 
provide the functionality needed. I guess you can do that with some sort of 
object-level transaction framework that automatically creates mementos of 
whatever object is being navigated to during some kind of processing-context. I 
guess slots could be of use here. But this is not trivial for general cases.

 

Yes it is tricky. You can have copies of business objects but you have always 
references to the business objects not pointing to the copy. 

And you need to know which objects should be tracked. In Gemstone IIRC it is 
easy as it is the time the object is copied from the stone to the gem it is 
registered in the current transaction. So you can check it and committing if it 
changed because you have to write it back. The important point here might be 
get noticed when a reference is acquired. In pharo it is not that easy but 
could be done if object would be reified and interceptable. 

In my experience, this problem area makes for the other 70% of the time spent 
on developing GUI or Web applications, besides the 60% for GUI design and 
implementation and 25% business logic...

70% + 60% + 25% + 30% = 185%

 

sounds indeed very realistic if it comes to project planning. There is even a 
rule saying that for the first 90% of the project you need the first 90% of 
time and for the last 10% of the project you need the second 90% of time. 



I'd be interested to learn about patterns to handle such more complex things. 
We constantly travel back and forth between implementing stuff in the GUI 
handlers (copying values to the GUI classes that access themselves during GUI 
operations and push values to the business objects when the users clicks on 
OK), using mementos (which most of the times are nets of mementos that are 
created manually - "we know what we'll touch in this Editor") and operating on 
business objects directly and relying on the persistence mechanism (Glorp in 
our case) and its rollback behaviour. All three have lots of weaknesses and 
seem to have their place nevertheless.

So this is a very interesting discussion and I think this is an area that has 
not been solved yet.

I think it isn‘t solved and I find every piece of information about it very 
interesting.

 

Norbert



Joachim

 

 

 

 

 

 

Am 09.10.19 um 16:25 schrieb James Foster:

Thanks for the explanation. And, yes, this is an artifact of your design; if 
you put intermediate values into domain objects then they will remain in your 
domain objects to be seen later. From what you’ve described, I don’t see how it 
would be any different in a non-image environment (Java, C#, etc.), unless you 
re-read the entire object graph from the database. As someone else mentioned, 
this would be a good place for the Memento Pattern. 

 

James





On Oct 9, 2019, at 1:59 AM, Jonathan van Alteren mailto:jvalte...@objectguild.com> > wrote:

 

Hi James, 

 

I see how my explanation might be unclear.

 

Re: [Pharo-users] [ ANN ] Neo Universal Binary JSON

2019-10-09 Thread PBKResearch
Sven

Excellent. Can the same idea be extended to STON - or is it there already?

Peter Kenny

-Original Message-
From: Pharo-users  On Behalf Of Sven
Van Caekenberghe
Sent: 09 October 2019 13:29
To: Any question about pharo is welcome 
Subject: [Pharo-users] [ ANN ] Neo Universal Binary JSON

Hi,

I just published an implementation of Universal Binary JSON (UBJSON) for
Pharo.

https://github.com/svenvc/NeoUniversalBinaryJSON

Universal Binary JSON (UBJSON) is a computer data interchange format. It is
a binary form directly imitating JSON, but requiring fewer bytes of data. It
aims to achieve the generality of JSON, combined with being easier and more
efficient to process than JSON.

http://ubjson.org
https://en.wikipedia.org/wiki/UBJSON

The size/speed/efficiency differences are minor for typical JSON payloads,
especially compared with compacted JSON. The implementation is simpler,
though, as there is no string escaping and no number parsing.

UBJSON is making a larger difference when dealing with arrays containing
numbers. Especially with ByteArrays, UBJSON makes a huge difference, since
these are essentially stored natively.

Sven





Re: [Pharo-users] How to zip a WideString

2019-10-03 Thread PBKResearch
Richard

I don't think so. The case being considered for my problem is the compression 
of a ByteArray produced by applying #utf8Encoded to a WideString, but it 
extends to any other form of ByteArray. If you substitute ByteArray for 
SomeClass in your examples, I think you will see why the chosen interface was 
used.

Peter Kenny


-Original Message-
From: Pharo-users  On Behalf Of Richard 
O'Keefe
Sent: 03 October 2019 23:08
To: Any question about pharo is welcome 
Subject: Re: [Pharo-users] How to zip a WideString

The interface should surely be
   SomeClass
 methods for: 'compression'
   zipped "return a byte array"

class methods for: 'decompression'
  unzip: aByteArray "return an instance of SomeClass"




Re: [Pharo-users] How to zip a WideString

2019-10-03 Thread PBKResearch
Thanks Sven. Just 5 hours from when I raised the question, there is a solution 
in place for everyone. This group is amazing!

-Original Message-
From: Pharo-users  On Behalf Of Sven Van 
Caekenberghe
Sent: 03 October 2019 15:28
To: Any question about pharo is welcome 
Subject: Re: [Pharo-users] How to zip a WideString

https://github.com/pharo-project/pharo/pull/4812

> On 3 Oct 2019, at 14:05, Sven Van Caekenberghe  wrote:
> 
> https://github.com/pharo-project/pharo/issues/4806
> 
> PR will follow
> 
>> On 3 Oct 2019, at 13:49, PBKResearch  wrote:
>> 
>> Sven, Tomo
>> 
>> Thanks for this discussion. I shall bear in mind Sven's proposed extension 
>> to ByteArray - this is exactly the sort of neater solution I was hoping for. 
>> Any chance this might make it into standard Pharo (perhaps inP8)?
>> 
>> Peter Kenny
>> 
>> -Original Message-
>> From: Pharo-users  On Behalf Of 
>> Tomohiro Oda
>> Sent: 03 October 2019 12:22
>> To: Any question about pharo is welcome 
>> Subject: Re: [Pharo-users] How to zip a WideString
>> 
>> Sven,
>> 
>> Yes, ByteArray>>zipped/unzipped are simple, neat and intuitive way of 
>> zipping/unzipping binary data.
>> I also love the new idioms. They look clean and concise.
>> 
>> Best Regards,
>> ---
>> tomo
>> 
>> 2019年10月3日(木) 20:14 Sven Van Caekenberghe :
>>> 
>>> Actually, thinking about this a bit more, why not add #zipped #unzipped to 
>>> ByteArray ?
>>> 
>>> 
>>> ByteArray>>#zipped
>>> "Return a GZIP compressed version of the receiver as a ByteArray"
>>> 
>>> ^ ByteArray streamContents: [ :out |
>>> (GZipWriteStream on: out) nextPutAll: self; close ]
>>> 
>>> ByteArray>>#unzipped
>>> "Assuming the receiver contains GZIP encoded data,  return the 
>>> decompressed data as a ByteArray"
>>> 
>>> ^ (GZipReadStream on: self) upToEnd
>>> 
>>> 
>>> The original oneliner then becomes
>>> 
>>> 'string' utf8Encoded zipped.
>>> 
>>> and
>>> 
>>> data unzipped utf8Decoded
>>> 
>>> which is pretty clear, simple and intention-revealing, IMHO.
>>> 
>>>> On 3 Oct 2019, at 13:04, Sven Van Caekenberghe  wrote:
>>>> 
>>>> Hi Tomo,
>>>> 
>>>> Indeed, I stand corrected, it does indeed seem possible to use the 
>>>> existing gzip classes to work from bytes to bytes, this works fine:
>>>> 
>>>> data := ByteArray streamContents: [ :out | (GZipWriteStream on: out) 
>>>> nextPutAll: 'foo 10 €' utf8Encoded; close ].
>>>> 
>>>> (GZipReadStream on: data) upToEnd utf8Decoded.
>>>> 
>>>> Now regarding the encoding option, I am not so sure that is really 
>>>> necessary (though nice to have). Why would anyone use anything except UTF8 
>>>> (today).
>>>> 
>>>> Thanks again for the correction !
>>>> 
>>>> Sven
>>>> 
>>>>> On 3 Oct 2019, at 12:41, Tomohiro Oda  wrote:
>>>>> 
>>>>> Peter and Sven,
>>>>> 
>>>>> zip API from string to string works fine except that aWideString 
>>>>> zipped generates malformed zip string.
>>>>> I think it might be a good guidance to define
>>>>> String>>zippedWithEncoding: and ByteArray>>unzippedWithEncoding: .
>>>>> Such as
>>>>> String>>zippedWithEncoding: encoder
>>>>> zippedWithEncoding: encoder
>>>>> ^ ByteArray
>>>>> streamContents: [ :stream |
>>>>> | gzstream |
>>>>> gzstream := GZipWriteStream on: stream.
>>>>> encoder
>>>>> next: self size
>>>>> putAll: self
>>>>> startingAt: 1
>>>>> toStream: gzstream.
>>>>> gzstream close ]
>>>>> 
>>>>> and ByteArray>>unzippedWithEncoding: encoder
>>>>> unzippedWithEncoding: encoder
>>>>> | byteStream |
>>>>> byteStream := GZipReadStream on: self.
>>>>> ^ String
>>>>> streamContents: [ :stream |
>>>>> [ byteStream atEnd ]
>>>>> whileFalse: [ stream nextPut: (encoder nextFromStream:
>>>>> byteStream) ] ]
>>>

Re: [Pharo-users] How to zip a WideString

2019-10-03 Thread PBKResearch
Sven, Tomo

Thanks for this discussion. I shall bear in mind Sven's proposed extension to 
ByteArray - this is exactly the sort of neater solution I was hoping for. Any 
chance this might make it into standard Pharo (perhaps inP8)?

Peter Kenny

-Original Message-
From: Pharo-users  On Behalf Of Tomohiro 
Oda
Sent: 03 October 2019 12:22
To: Any question about pharo is welcome 
Subject: Re: [Pharo-users] How to zip a WideString

Sven,

Yes, ByteArray>>zipped/unzipped are simple, neat and intuitive way of 
zipping/unzipping binary data.
I also love the new idioms. They look clean and concise.

Best Regards,
---
tomo

2019年10月3日(木) 20:14 Sven Van Caekenberghe :
>
> Actually, thinking about this a bit more, why not add #zipped #unzipped to 
> ByteArray ?
>
>
> ByteArray>>#zipped
>   "Return a GZIP compressed version of the receiver as a ByteArray"
>
>   ^ ByteArray streamContents: [ :out |
>   (GZipWriteStream on: out) nextPutAll: self; close ]
>
> ByteArray>>#unzipped
>   "Assuming the receiver contains GZIP encoded data,
>return the decompressed data as a ByteArray"
>
>   ^ (GZipReadStream on: self) upToEnd
>
>
> The original oneliner then becomes
>
>   'string' utf8Encoded zipped.
>
> and
>
>   data unzipped utf8Decoded
>
> which is pretty clear, simple and intention-revealing, IMHO.
>
> > On 3 Oct 2019, at 13:04, Sven Van Caekenberghe  wrote:
> >
> > Hi Tomo,
> >
> > Indeed, I stand corrected, it does indeed seem possible to use the existing 
> > gzip classes to work from bytes to bytes, this works fine:
> >
> > data := ByteArray streamContents: [ :out | (GZipWriteStream on: out) 
> > nextPutAll: 'foo 10 €' utf8Encoded; close ].
> >
> > (GZipReadStream on: data) upToEnd utf8Decoded.
> >
> > Now regarding the encoding option, I am not so sure that is really 
> > necessary (though nice to have). Why would anyone use anything except UTF8 
> > (today).
> >
> > Thanks again for the correction !
> >
> > Sven
> >
> >> On 3 Oct 2019, at 12:41, Tomohiro Oda  wrote:
> >>
> >> Peter and Sven,
> >>
> >> zip API from string to string works fine except that aWideString 
> >> zipped generates malformed zip string.
> >> I think it might be a good guidance to define
> >> String>>zippedWithEncoding: and ByteArray>>unzippedWithEncoding: .
> >> Such as
> >> String>>zippedWithEncoding: encoder
> >> zippedWithEncoding: encoder
> >>   ^ ByteArray
> >>   streamContents: [ :stream |
> >>   | gzstream |
> >>   gzstream := GZipWriteStream on: stream.
> >>   encoder
> >>   next: self size
> >>   putAll: self
> >>   startingAt: 1
> >>   toStream: gzstream.
> >>   gzstream close ]
> >>
> >> and ByteArray>>unzippedWithEncoding: encoder
> >> unzippedWithEncoding: encoder
> >>   | byteStream |
> >>   byteStream := GZipReadStream on: self.
> >>   ^ String
> >>   streamContents: [ :stream |
> >>   [ byteStream atEnd ]
> >>   whileFalse: [ stream nextPut: (encoder nextFromStream:
> >> byteStream) ] ]
> >>
> >> Then, you can write something like
> >> zipped := yourLongWideString zippedWithEncoding: ZnCharacterEncoder utf8.
> >> unzipped := zipped unzippedWithEncoding: ZnCharacterEncoder utf8.
> >>
> >> This will not affect the existing zipped/unzipped API and you can 
> >> handle other encodings.
> >> This zippedWithEncoding: generates a ByteArray, which is kind of 
> >> conformant to the encoding API.
> >> And you don't have to create many intermediate byte arrays and byte 
> >> strings.
> >>
> >> I hope this helps.
> >> ---
> >> tomo
> >>
> >> 2019/10/3(Thu) 18:56 Sven Van Caekenberghe :
> >>>
> >>> Hi Peter,
> >>>
> >>> About #zipped / #unzipped and the inflate / deflate classes: your 
> >>> observation is correct, these work from string to string, while clearly 
> >>> the compressed representation should be binary.
> >>>
> >>> The contents (input, what is inside the compressed data) can be anything, 
> >>> it is not necessarily a string (it could be an image, so also something 
> >>> binary). Only the creator of the compressed data knows, you cannot assume 
> >>> to know in general.
> >>

Re: [Pharo-users] How to zip a WideString

2019-10-03 Thread PBKResearch
Hi Sven

The DB system I am using at the moment is OmniBase - despite Todd Blanchard's 
warning, I have decided to experiment with it. It has the advantage of being 
fully object based, though I am not yet using anything more elaborate than 
strings, dictionaries and arrays as the data types. One secondary advantage is 
that I still use Dolphin occasionally, and my version of Dolphin 6.1 comes with 
OmniBase built in. I have checked that an OmniBase DB built in Pharo can be 
read in Dolphin.

As to size, there is no problem with storing large strings in OmniBase, except 
for the amount of disk space occupied in total. I am looking far ahead - my toy 
development DB is only about 15MB, but if I get to where I want to be, it could 
be tens of GB. With modern machines this may not be a problem, but I thought 
there might come a time when I want to think about trade-offs between storage 
space and unzipping time. I had a few qualms when I looked inside my 
development DB; it seems that an OmniBase DB consists of a few smallish index 
files and one ginormous file called 'objects'. I am not sure how the OS will 
get on with a huge single file.

But all this is speculative at the moment. For now I shall continue with 
storing the strings unzipped (but utf8Encoded - thanks for such a neat 
facility), bearing in mind that if I need to save space later, my method as 
described will work.

Peter Kenny

-Original Message-
From: Pharo-users  On Behalf Of Sven Van 
Caekenberghe
Sent: 03 October 2019 10:56
To: Any question about pharo is welcome 
Subject: Re: [Pharo-users] How to zip a WideString

Hi Peter,

About #zipped / #unzipped and the inflate / deflate classes: your observation 
is correct, these work from string to string, while clearly the compressed 
representation should be binary.

The contents (input, what is inside the compressed data) can be anything, it is 
not necessarily a string (it could be an image, so also something binary). Only 
the creator of the compressed data knows, you cannot assume to know in general.

It would be possible (and it would be very nice) to change this, however that 
will have serious impact on users (as the contract changes).

About your use case: why would your DB not be capable of storing large strings 
? A good DB should be capable of storing any kind of string (full unicode) 
efficiently.

What DB and what sizes are we talking about ?

Sven

> On 3 Oct 2019, at 11:06, PBKResearch  wrote:
> 
> Hello
>  
> I have a problem with text storage, to which I seem to have found a solution, 
> but it’s a bit clumsy-looking. I would be grateful for confirmation that (a) 
> there is no neater solution, (b) I can rely on this to work – I only know 
> that it works in a few test cases.
>  
> I need to store a large number of text strings in a database. To avoid the 
> database files becoming too large, I am thinking of zipping the strings, or 
> at least the less frequently accessed ones. Depending on the source, some of 
> the strings will be instances of ByteString, some of WideString (because they 
> contain characters not representable in one byte). Storing a WideString 
> uncompressed seems to occupy 4 bytes per character, so I decided, before 
> thinking of compression, to store the strings utf8Encoded, which yields a 
> ByteArray. But zipped can only be applied to a String, not a ByteArray.
>  
> So my proposed solution is:
>  
> For compression: myZipString := myWideString utf8Encoded asString 
> zipped.
> For decompression: myOutputString := myZipString unzipped asByteArray 
> utf8Decoded.
>  
> As I said, it works in all the cases I tried, whether WideString or not, but 
> the chains of transformations look clunky somehow. Can anyone see a neater 
> way of doing it? And can I rely on it working, especially when I am handling 
> foreign texts with many multi-byte characters?
>  
> Thanks in advance for any help.
>  
> Peter Kenny





[Pharo-users] How to zip a WideString

2019-10-03 Thread PBKResearch
Hello

 

I have a problem with text storage, to which I seem to have found a
solution, but it's a bit clumsy-looking. I would be grateful for
confirmation that (a) there is no neater solution, (b) I can rely on this to
work - I only know that it works in a few test cases.

 

I need to store a large number of text strings in a database. To avoid the
database files becoming too large, I am thinking of zipping the strings, or
at least the less frequently accessed ones. Depending on the source, some of
the strings will be instances of ByteString, some of WideString (because
they contain characters not representable in one byte). Storing a WideString
uncompressed seems to occupy 4 bytes per character, so I decided, before
thinking of compression, to store the strings utf8Encoded, which yields a
ByteArray. But zipped can only be applied to a String, not a ByteArray.

 

So my proposed solution is:

 

For compression: myZipString := myWideString utf8Encoded
asString zipped.

For decompression: myOutputString := myZipString unzipped
asByteArray utf8Decoded.

 

As I said, it works in all the cases I tried, whether WideString or not, but
the chains of transformations look clunky somehow. Can anyone see a neater
way of doing it? And can I rely on it working, especially when I am handling
foreign texts with many multi-byte characters?

 

Thanks in advance for any help.

 

Peter Kenny

 



Re: [Pharo-users] Code of Conduct

2019-09-24 Thread PBKResearch
These discussions are interesting, but they have nothing to do with Pharo – I’m 
surprised we have not had a moderator intervening to say they are off-topic and 
political. The subject line says ‘Code of Conduct’, meaning the proposed Pharo 
Code of Conduct, so please can we keep the discussion about conduct in the 
Pharo community.

 

Offray complains that he has encountered discriminatory behaviour on account of 
his identity, specifically in immigration contexts. I can assure him he is not 
the only one. I have gone through US immigration with a British passport; I 
have met long waiting times and obvious suspicion from the officers – and US 
and UK are supposed to be close allies. But I accept that there is 
discrimination in the world; my question to Offray is: have you encountered 
discrimination, harassment or any other unpleasant behaviour on account of your 
identity in the Pharo community? My impression is that you had helpful answers 
to all your questions as you learned Pharo and developed Grafoscopio; the only 
way your identity came into the matter was when people thought: ‘Oh, so Pharo 
is being used in Colombia – that’s interesting.’

 

My observation suggests that is typical of the community. We are all human, so 
we are all sinners (that’s what a Catholic education does for you), but I think 
the community is as inclusive, diverse and respectful as you can expect any 
human organisation to be. This is one of my objections to having a code at all 
– the implication that we need an explicit code to continue to behave decently.

 

In his post announcing the new code of conduct, Esteban Lorenzano said: “…we 
have decided to retract the code. But sadly, we cannot just remove it and let 
things continue as before…”. Well, I too think it’s sad, but I don’t see why we 
cannot continue as before. What specifically would go wrong if we just canned 
it? In the past we had what Sven called ‘implicit rules of engagement’, and if 
problems arose – about once every five years – the board worked it out ad hoc. 
This left the board as ‘benevolent dictators’, but we trusted them.

 

Please could someone explain why the board chose to do this. I simply do not 
understand Esteban’s ‘bigger can of worms’ metaphor. Is there some external 
pressure which is compelling the board to have a code?

 

Peter Kenny

 

From: Pharo-users  On Behalf Of Steve 
Quezadas
Sent: 24 September 2019 04:32
To: Any question about pharo is welcome 
Subject: Re: [Pharo-users] Code of Conduct

 

Thank you for that well-stated argument. I agree, offray's argument is silly. 
It's like saying that there aren't many male kindergarten teachers and that 
this is evidence that the school system is "sexist".

 

- Steve

 

PS Can we please just kill the CoC  it's making this maillist political.

 

On Mon, Sep 23, 2019 at 8:25 PM Richard O'Keefe mailto:rao...@gmail.com> > wrote:

Let's look at some official numbers.

Looking at 
https://www.hesa.ac.uk/news/11-01-2018/sfr247-higher-education-student-statistics/qualifications
we see that overall, female graduates outnumbered male graduates about
4 to 3 in each of the three years
recorded.  The imbalance in science graduates was less, but it was
still consistently women significantly
outnumbering men.  Computer science stood out as consistently about 4
men to 1 woman, and Computer
Science departments are tying themselves into knots trying to figure
out what to do about it.  Meanwhile,
nobody worries that "subjects allied to medicine" was about 4 women to 1 man.

If there are models explaining that "colleges" are set up to favour
white males, why are women succeeding
so much more than men?

In my own country, ten years ago the main newspaper ran an article
pointing out that "Two-thirds of bachelor
degrees last year went to women, the highest figure on record" and
that "Women have outnumbered men
in the tertiary sector for more than a decade", blaming "a secondary
school system which may discourage
or poorly prepare boys for further learning".

Look now at Canada.
https://www.conferenceboard.ca/hcp/Details/education/gender-gap-tertiary.aspx?AspxAutoDetectCookieSupport=1
tells us that "Canadian women aged 25 to 64 are 17 per cent more
likely than Canadian men to have a tertiary education.
The imbalance in educational attainment between Canadian men and women
has increased over the past decade,
raising questions about whether higher education in Canada is becoming
less hospitable to male learners."  This is not new.
"the overall gender imbalance tipped in women’s favour in Canada in
the early 1990s.  ...
Many are asking whether there is a 'boy crisis' in education and
wondering what can be done to address it. In fact, a
growing 'boy gap' in education can be seen across OECD countries, with
the problem beginning long before students
 reach post-secondary age. According to a recent report, 'boys, as a
group, rank behind girls by nearly every measure
of scholastic achievement'—including 

[Pharo-users] Playground - retrieving pages from play-cache

2019-09-22 Thread PBKResearch
I have a mystery when using the 'Play Pages' button on the top right of the
playground. One particular file, which has been through several versions,
never appears in the drop-down list on clicking this button. It is in the
play-cache, and I access it by opening the file from the file explorer with
WordPad, then copying and pasting into the playground. 

More mysteriously, having got at in this way, as a test I closed the
playground containing it, then clicked the 'Play Pages' button in a new
empty playground; the mystery file was there at the top of the list. Close
down Pharo and restart, click 'Play Pages' in a new playground, the file is
missing again.

Is there anything I should be doing to ensure it is accessible? I have tried
closing the playground before I shut down Pharo, and alternatively leaving
it open and letting the Pharo shut-down close it. Does 'Play Pages' work by
examining the contents of the 'play-cache' folder, or does it maintain its
own list of files?

I am using 32-bit Moose Suite 6.1 (Pharo 6.0 Latest update: #60541) on
Windows 10.

Many thanks for any help

 

Peter Kenny

 



Re: [Pharo-users] Code of Conduct

2019-09-20 Thread PBKResearch
Sven
I think all your complaints against John Pfersich are misconceived:
1. He is talking about the content of the code, which is exactly the topic of 
the thread.
2. He is claiming that the code as drafted has a political slant. This may be 
true, false or a matter of opinion, but to discuss whether it is so is not in 
any way introducing politics.
3. I see nothing in his words which makes a value judgement about anybody.
I see a censoriousness in your comments which is worrying. Just recently you 
said, 'Guns have no place in a civilised society', which was certainly a value 
judgement, specifically about John Pfersich. Please stop.

Peter Kenny

-Original Message-
From: Pharo-users  On Behalf Of Sven Van 
Caekenberghe
Sent: 20 September 2019 10:11
To: Any question about pharo is welcome 
Subject: Re: [Pharo-users] Code of Conduct



> On 20 Sep 2019, at 06:17, john pfersich  wrote:
> 
> I have no interest in supporting a left-wing snowflake “Code of Conduct”. 

You are violating the implicit rules of engagement in this mailing list: you 
are going off topic, you are using this platform to talk about politics and you 
are giving value judgements about others. Please stop.




Re: [Pharo-users] Code of Conduct

2019-09-19 Thread PBKResearch
Well , if I was too touchy, I’m sorry. I accept the clarification. However, I 
am still no clearer about the Code of Conduct. It is still there on Github. Is 
it in effect as the official Code for the Pharo community, or is it not? My 
request in my first post today was for someone, on behalf of the board, to tell 
us.

 

Peter Kenny

 

From: Pharo-users  On Behalf Of Esteban 
Lorenzano
Sent: 19 September 2019 14:49
To: Any question about pharo is welcome 
Subject: Re: [Pharo-users] Code of Conduct

 

Offray is right.

And no, I was not referring to you but in general :)

 

Esteban





On 19 Sep 2019, at 15:32, PBKResearch mailto:pe...@pbkresearch.co.uk> > wrote:

 

Offray

 

You may be right, though I don’t think so. But ‘You have been warned’ was aimed 
at me; I’m sure of that.

 

Peter Kenny

 

From: Pharo-users mailto:pharo-users-boun...@lists.pharo.org> > On Behalf Of Offray Vladimir 
Luna Cárdenas
Sent: 19 September 2019 14:26
To: pharo-users@lists.pharo.org <mailto:pharo-users@lists.pharo.org> 
Subject: Re: [Pharo-users] Code of Conduct

 

Peter,

I think that the comment was referred to the comment made on the PR (not on 
this list) that was insulting Serge (which I will not repeat). It has been 
deleted now and only Stephan's response remains[1]. As you can see is 
addressing someone different, who has no contributions and no name and seemed 
to create the account just to insult and you can see by his/her empty account 
without any info and any contributions[2].

[1]  <https://github.com/pharo-project/pharo/pull/4637#issuecomment-532815478> 
https://github.com/pharo-project/pharo/pull/4637#issuecomment-532815478
[2]  <https://github.com/eleitl> https://github.com/eleitl

So, in my interpretation, Stephan's comment was referred to the user at [2] and 
Esteban warning was referred to the closing of the issue because of it, so the 
"you" in the warning was not the singular "you", but the plural one. Because 
conversation has been split in two places, these mistakes can be done. I think 
that you raised a valid concern in a civilized manner, are a recognized member 
of the community and did not insulted Serge, so the comments were not 
addressing you.

This can be a very sensible approach, as the discussion on the list so far have 
shown, so the more clarity we can have to elevate the conversation and be 
respectful with the participants, the better.

Cheers,

Offray

On 19/09/19 8:02 a. m., PBKResearch wrote:

I think the comments about “someone that has no name, no repositories, not 
anything that makes you think is a real member of the community or just a 
troll” are directed at me. My e-mail address is based on the trading name I 
used at the time I was doing consulting work; my actual name is Peter Kenny, 
and I use it to sign everything I post in this forum. I have no repositories, 
because the only code I write is of no general interest. As a member of the 
community, I was invited by Stephane Ducasse to work up a post I had written to 
help someone into a pamphlet on web scraping; I think that is still available 
in Pharo publications. So I am not a troll; I am an elderly but still active 
user of Pharo, and concerned about developments. There is an English saying 
about pots and kettles, which Mr Lorenzano might consider before making 
personal attacks on me.

 

I did not say anything insulting about Serge Stinckwich. I asked whether he 
acted with authority when he posted the code, because I genuinely don’t know 
what official position he has in the Pharo world. I still don’t know whether 
the code is in effect as a result of being posted.

 

‘You have been warned’ seems like a threat. I do not like being threatened. If 
comments here, which are relevant to the topic and expressed in moderate 
language, are no longer welcome, I shall absent myself without waiting to be 
banned.

 

Peter Kenny

 

From: Pharo-users  <mailto:pharo-users-boun...@lists.pharo.org> 
 On Behalf Of Esteban Lorenzano
Sent: 19 September 2019 12:49
To: Any question about pharo is welcome  <mailto:pharo-users@lists.pharo.org> 

Subject: Re: [Pharo-users] Code of Conduct

 

 







On 19 Sep 2019, at 12:22, PBKResearch < <mailto:pe...@pbkresearch.co.uk> 
pe...@pbkresearch.co.uk> wrote:

 

I don’t think this conversation can be closed while things are in the present 
unclear situation. The github entry at  
<https://github.com/pharo-project/pharo/blob/Pharo8.0/CODE_OF_CONDUCT.md> 
https://github.com/pharo-project/pharo/blob/Pharo8.0/CODE_OF_CONDUCT.md is 
still there, and has been there since last May. The github discussion on  
<https://github.com/pharo-project/pharo/pull/4637> 
https://github.com/pharo-project/pharo/pull/4637 was abruptly closed by 
Stephane Ducasse, after some intemperate comments about Serge Stinckwich. 

 

Yes it can be closed. 

As we will close ANY thread/issue/PR that directly insults one of th

Re: [Pharo-users] Code of Conduct

2019-09-19 Thread PBKResearch
Offray

 

You may be right, though I don’t think so. But ‘You have been warned’ was aimed 
at me; I’m sure of that.

 

Peter Kenny

 

From: Pharo-users  On Behalf Of Offray 
Vladimir Luna Cárdenas
Sent: 19 September 2019 14:26
To: pharo-users@lists.pharo.org
Subject: Re: [Pharo-users] Code of Conduct

 

Peter,

I think that the comment was referred to the comment made on the PR (not on 
this list) that was insulting Serge (which I will not repeat). It has been 
deleted now and only Stephan's response remains[1]. As you can see is 
addressing someone different, who has no contributions and no name and seemed 
to create the account just to insult and you can see by his/her empty account 
without any info and any contributions[2].

[1] https://github.com/pharo-project/pharo/pull/4637#issuecomment-532815478
[2] https://github.com/eleitl

So, in my interpretation, Stephan's comment was referred to the user at [2] and 
Esteban warning was referred to the closing of the issue because of it, so the 
"you" in the warning was not the singular "you", but the plural one. Because 
conversation has been split in two places, these mistakes can be done. I think 
that you raised a valid concern in a civilized manner, are a recognized member 
of the community and did not insulted Serge, so the comments were not 
addressing you.

This can be a very sensible approach, as the discussion on the list so far have 
shown, so the more clarity we can have to elevate the conversation and be 
respectful with the participants, the better.

Cheers,

Offray

On 19/09/19 8:02 a. m., PBKResearch wrote:

I think the comments about “someone that has no name, no repositories, not 
anything that makes you think is a real member of the community or just a 
troll” are directed at me. My e-mail address is based on the trading name I 
used at the time I was doing consulting work; my actual name is Peter Kenny, 
and I use it to sign everything I post in this forum. I have no repositories, 
because the only code I write is of no general interest. As a member of the 
community, I was invited by Stephane Ducasse to work up a post I had written to 
help someone into a pamphlet on web scraping; I think that is still available 
in Pharo publications. So I am not a troll; I am an elderly but still active 
user of Pharo, and concerned about developments. There is an English saying 
about pots and kettles, which Mr Lorenzano might consider before making 
personal attacks on me.

 

I did not say anything insulting about Serge Stinckwich. I asked whether he 
acted with authority when he posted the code, because I genuinely don’t know 
what official position he has in the Pharo world. I still don’t know whether 
the code is in effect as a result of being posted.

 

‘You have been warned’ seems like a threat. I do not like being threatened. If 
comments here, which are relevant to the topic and expressed in moderate 
language, are no longer welcome, I shall absent myself without waiting to be 
banned.

 

Peter Kenny

 

From: Pharo-users  <mailto:pharo-users-boun...@lists.pharo.org> 
 On Behalf Of Esteban Lorenzano
Sent: 19 September 2019 12:49
To: Any question about pharo is welcome  <mailto:pharo-users@lists.pharo.org> 

Subject: Re: [Pharo-users] Code of Conduct

 

 






On 19 Sep 2019, at 12:22, PBKResearch mailto:pe...@pbkresearch.co.uk> > wrote:

 

I don’t think this conversation can be closed while things are in the present 
unclear situation. The github entry at  
<https://github.com/pharo-project/pharo/blob/Pharo8.0/CODE_OF_CONDUCT.md> 
https://github.com/pharo-project/pharo/blob/Pharo8.0/CODE_OF_CONDUCT.md is 
still there, and has been there since last May. The github discussion on  
<https://github.com/pharo-project/pharo/pull/4637> 
https://github.com/pharo-project/pharo/pull/4637 was abruptly closed by 
Stephane Ducasse, after some intemperate comments about Serge Stinckwich. 

 

Yes it can be closed. 

As we will close ANY thread/issue/PR that directly insults one of the members 
of the community. 

Even more important: We can close it if thread has been highjacked by someone 
that has no name, no repositories, not anything that makes you think is a real 
member of the community or just a troll.

 

Members can do things right or wrong, as they are human beings. But emitting 
opinions in the way they were emitted about what they did is a no-go. 

 

So yes, you can discuss anything you want. 

But I personally will moderate any thread that does not discusses things in a 
civilised way.

 

So you have been warned :)

 

Esteban

 

PS: I will also remember you that the purpose of this community is to make 
Pharo a great development environment. 

And we are all here because we all pursue that.

 We create a software that is open source and wants to have some social value 
added.

 

This is therefore the only place questions can be asked.

 

We now know that Serge posted the Code wit

Re: [Pharo-users] Code of Conduct

2019-09-19 Thread PBKResearch
I think the comments about “someone that has no name, no repositories, not 
anything that makes you think is a real member of the community or just a 
troll” are directed at me. My e-mail address is based on the trading name I 
used at the time I was doing consulting work; my actual name is Peter Kenny, 
and I use it to sign everything I post in this forum. I have no repositories, 
because the only code I write is of no general interest. As a member of the 
community, I was invited by Stephane Ducasse to work up a post I had written to 
help someone into a pamphlet on web scraping; I think that is still available 
in Pharo publications. So I am not a troll; I am an elderly but still active 
user of Pharo, and concerned about developments. There is an English saying 
about pots and kettles, which Mr Lorenzano might consider before making 
personal attacks on me.

 

I did not say anything insulting about Serge Stinckwich. I asked whether he 
acted with authority when he posted the code, because I genuinely don’t know 
what official position he has in the Pharo world. I still don’t know whether 
the code is in effect as a result of being posted.

 

‘You have been warned’ seems like a threat. I do not like being threatened. If 
comments here, which are relevant to the topic and expressed in moderate 
language, are no longer welcome, I shall absent myself without waiting to be 
banned.

 

Peter Kenny

 

From: Pharo-users  On Behalf Of Esteban 
Lorenzano
Sent: 19 September 2019 12:49
To: Any question about pharo is welcome 
Subject: Re: [Pharo-users] Code of Conduct

 

 





On 19 Sep 2019, at 12:22, PBKResearch mailto:pe...@pbkresearch.co.uk> > wrote:

 

I don’t think this conversation can be closed while things are in the present 
unclear situation. The github entry at  
<https://github.com/pharo-project/pharo/blob/Pharo8.0/CODE_OF_CONDUCT.md> 
https://github.com/pharo-project/pharo/blob/Pharo8.0/CODE_OF_CONDUCT.md is 
still there, and has been there since last May. The github discussion on  
<https://github.com/pharo-project/pharo/pull/4637> 
https://github.com/pharo-project/pharo/pull/4637 was abruptly closed by 
Stephane Ducasse, after some intemperate comments about Serge Stinckwich. 

 

Yes it can be closed. 

As we will close ANY thread/issue/PR that directly insults one of the members 
of the community. 

Even more important: We can close it if thread has been highjacked by someone 
that has no name, no repositories, not anything that makes you think is a real 
member of the community or just a troll.

 

Members can do things right or wrong, as they are human beings. But emitting 
opinions in the way they were emitted about what they did is a no-go. 

 

So yes, you can discuss anything you want. 

But I personally will moderate any thread that does not discusses things in a 
civilised way.

 

So you have been warned :)

 

Esteban

 

PS: I will also remember you that the purpose of this community is to make 
Pharo a great development environment. 

And we are all here because we all pursue that.

 We create a software that is open source and wants to have some social value 
added.

 

This is therefore the only place questions can be asked.

 

We now know that Serge posted the Code without prior discussion with the board. 
Did he have authority to do this on behalf of the Pharo community? Does the 
fact that he did so mean it is officially adopted by the community – not just 
for this mailing list, but for all Pharo activities? If Serge did not have 
authority, shouldn’t it just be removed, at least until the board have 
discussed it?

 

The PR mentioned above was a proposal by James Foster that, if we need a code 
of conduct, it should be the ACM code. The PR has now been closed. Does that 
mean that James’s proposal has been rejected? If so, why?

 

If the conversation is closed now, that means that we are tacitly accepting 
that the code is there and in force, and also tacitly accepting how it got 
there. What is necessary is for the board collectively, or someone representing 
the board, to tell us what the situation is and what is going to happen next – 
preferably with justifications.

 

Peter Kenny 

 

From: Pharo-users < <mailto:pharo-users-boun...@lists.pharo.org> 
pharo-users-boun...@lists.pharo.org> On Behalf Of Steve Quezadas
Sent: 19 September 2019 03:35
To: Any question about pharo is welcome < <mailto:pharo-users@lists.pharo.org> 
pharo-users@lists.pharo.org>
Subject: Re: [Pharo-users] R: Code of Conduct

 

Yeah, I agree. Why is this even here? The thing I like about this maillist is 
that its very community oriented and everyone here helps each other. It's 
devoid of all the political-soapbox nonsense that I would find on, say, 
facebook. Which is why I don't deal with that platform anymore. 

 

And most of this is common sense anyway. Yeah, don't harass people and make fun 
of them or whatever, Like most people on this list

Re: [Pharo-users] Code of Conduct

2019-09-19 Thread PBKResearch
I don’t think this conversation can be closed while things are in the present 
unclear situation. The github entry at 
https://github.com/pharo-project/pharo/blob/Pharo8.0/CODE_OF_CONDUCT.md is 
still there, and has been there since last May. The github discussion on 
https://github.com/pharo-project/pharo/pull/4637 was abruptly closed by 
Stephane Ducasse, after some intemperate comments about Serge Stinckwich. This 
is therefore the only place questions can be asked.

 

We now know that Serge posted the Code without prior discussion with the board. 
Did he have authority to do this on behalf of the Pharo community? Does the 
fact that he did so mean it is officially adopted by the community – not just 
for this mailing list, but for all Pharo activities? If Serge did not have 
authority, shouldn’t it just be removed, at least until the board have 
discussed it?

 

The PR mentioned above was a proposal by James Foster that, if we need a code 
of conduct, it should be the ACM code. The PR has now been closed. Does that 
mean that James’s proposal has been rejected? If so, why?

 

If the conversation is closed now, that means that we are tacitly accepting 
that the code is there and in force, and also tacitly accepting how it got 
there. What is necessary is for the board collectively, or someone representing 
the board, to tell us what the situation is and what is going to happen next – 
preferably with justifications.

 

Peter Kenny 

 

From: Pharo-users  On Behalf Of Steve 
Quezadas
Sent: 19 September 2019 03:35
To: Any question about pharo is welcome 
Subject: Re: [Pharo-users] R: Code of Conduct

 

Yeah, I agree. Why is this even here? The thing I like about this maillist is 
that its very community oriented and everyone here helps each other. It's 
devoid of all the political-soapbox nonsense that I would find on, say, 
facebook. Which is why I don't deal with that platform anymore. 

 

And most of this is common sense anyway. Yeah, don't harass people and make fun 
of them or whatever, Like most people on this list doesn't already know that. 
Im very vocal about certain political and social opinions, am not ashamed about 
my opinions, am open about it, is currently "unpopular" but don't discuss them 
here because it's offtopic and I don't want to piss off people in any event. I 
don't want it turning into another facebook basically. 

 

I think we should all close this conversation, it's offtopic and not relevant 
to any problems this list has in any meaningful  way. 

 

- Steve

 

On Wed, Sep 18, 2019 at 1:07 PM Kasper Østerbye mailto:kasper.oster...@gmail.com> > wrote:

When I read the Code of conduct which is part of Pharo, my reaction was "OK, I 
don't expect to run into trouble over that one, so no worries".  

After having read the discussion here I would rather it was not there.

-- Kasper 



Re: [Pharo-users] Code of Conduct

2019-09-18 Thread PBKResearch
Serge

 

Your post does not really answer James’s questions about the status of the 
Code. It seems you personally posted the Code on Github, without prior 
discussion with the Board. Is this a proposal by you, for discussion by the 
Board, or does posting it there mean it is adopted as the effective Code for 
the Pharo community? The github post just quotes the code, without explanation.

 

As to the content of the code, I still believe that, if the board can undertake 
punitive actions like banning, there must be some concept of ‘due process’, 
with the right to defend oneself. The referenced FAQ suggests that, if one is 
accused of a breach, the only response is to admit guilt and work with the 
accusers to reform. I am also worried by the suggestions that complaints can be 
anonymous, and that the anonymity of the complainant must be protected.

 

Peter Kenny

 

From: Pharo-users  On Behalf Of Serge 
Stinckwich
Sent: 18 September 2019 08:33
To: Any question about pharo is welcome 
Subject: Re: [Pharo-users] Code of Conduct

 

 

 

On Wed, Sep 18, 2019 at 2:11 AM James Foster mailto:smallt...@jgfoster.net> > wrote:

One side-effect of the “Covenant” discussion is that it is necessarily 
political, which is something that many (rightly, in my view) are trying to 
avoid. While I agree with most of the views expressed so far, I cringe because 
I anticipate that someone who disagrees will feel the compulsion to tell us 
that we are wrong, and things will go bad from there.

 

I haven’t reviewed the full email chain, but I’ve spent a few minutes searching 
pharo.org   for “code of conduct” and “covenant” and come up 
empty. Before we continue the discussion of how “woke" (politically correct) we 
want to be, could someone confirm that this "dastardly deed" (imposing a 
progressive “Covenant” without asking for agreement) was actually done? Maybe a 
troll has just dropped a fire cracker on us and is sitting back, enjoying 
watching us run around screaming!

 

If there was, indeed, adoption of a “Covenant” it should have been done by the 
board whose role “is to make decisions if in the future the community can't 
decide on a course of action” (https://pharo.org/about). 

 

I suggest that we suspend discussion of the politics of speech codes until we 
confirm that there is one for Pharo. At that point we politely (but pointedly) 
ask the board (publicly and privately) to explain what prompted the decision to 
adopt a Code (is it really necessary?) and how this one was selected. Note that 
part of the reason for limiting discussion is to avoid attracting attention of 
outsiders who will want to shape the discussion. Let’s stop kicking up dust for 
the moment!

 

 

Dear James,

I'm the one who submit the PR for the CoC. Similar text are adopted by a lot of 
open-source communities or conferences in order to enhance diversity.

I read again this morning the document here: 
https://github.com/pharo-project/pharo/blob/Pharo8.0/CODE_OF_CONDUCT.md

and for me this quite neutral and I see nothing political here.

I agree with you that this kind of document should have been discussed by the 
Pharo board and you can propose it for the next meeting.

 

I'm a bit suprised by some overeactions here on the mailing-list.

Apparently the Pharo community will be soon be doomed or under attack of nasty 
leftist activists ...

But I will not discuss endlessly about that.

 

If we need a Code of Conduct, I respectfully suggest we start with ACM 
(https://www.acm.org/code-of-ethics) which has what should be adequate 
anti-discrimination provisions (see 1.4 for a list of “underrepresented” 
groups) to satisfy the progressives among us.

 

 

Thank you James to move the discussion on github.

 

Cheers,

-- 

Serge Stinckwic

h

 

Int. Research Unit

 on Modelling/Simulation of Complex Systems (UMMISCO)

Sorbonne University

 (SU)

French National Research Institute for Sustainable Development (IRD)

U

niversity of Yaoundé I, Cameroon


"Programs must be written for people to read, and only incidentally for 
machines to execute."
https://twitter.com/SergeStinckwich

 



Re: [Pharo-users] Code of Conduct

2019-09-11 Thread PBKResearch
First, apologies for the shambles of formatting this post.

 

Secondly, having re-read it, I think it was inappropriate to mention Sven in 
the way I did. I still maintain that there are problems with the code, but I 
wish to retract the comments about Sven, and I apologise for including them.

 

Peter Kenny

 

From: Pharo-users  On Behalf Of Peter Kenny
Sent: 11 September 2019 22:02
To: pharo-users@lists.pharo.org
Subject: Re: [Pharo-users] Code of Conduct

 

I see no problem with having *a* code of conduct, but there are some worrying 
aspects of *this* code. Clearly there is a need for generality in any code, but 
the vagueness of the drafting seems to me to open it up to all sorts of 
mischief. Consider the paragraph: " Project maintainers have the right and 
responsibility to remove, edit, or reject comments, commits, code, wiki edits, 
issues, and other contributions that are not aligned to this Code of Conduct, 
or to ban temporarily or permanently any contributor for other behaviors that 
they deem inappropriate, threatening, offensive, or harmful." The bits I have 
bolded mean that the maintainers can apply punitive measures based on what they 
deem inappropriate. Shouldn't the concept of "due process" come into this? The 
FAQ section, under the heading "What should I do if I have been accused of 
violating the code of conduct?", makes no mention of defending ones actions; 
the only option is to admit guilt and work with the accusers to reform. The 
inclusion of the words "they deem" opens the way to all sort of subjectivity. 
Just for one instance, Sven recently thought it inappropriate that John 
Pfersich mentioned in passing in this list that, besides programming, his 
hobbies include shooting, which is a legal activity in most countries and an 
Olympic sport. Others disagreed in the thread, but Sven's message remained 
"don't do it." If John mentioned it again, could that be a violation of the 
code? The fact that this particular code, evidently the creation of one person, 
is accepted by others should not mean it is automatically accepted. There is an 
obligation to look at it in detail; when I do, I think there are problems. 
Peter Kenny 

Sven Van Caekenberghe-2 wrote

> On 11 Sep 2019, at 19:07, James Foster <[hidden email]> wrote: > > >> On Sep 
> 11, 2019, at 8:17 AM, Offray Vladimir Luna Cárdenas <[hidden email]> wrote: 
> >> >> On 11/09/19 9:14 a. m., Herby Vojčík wrote: >>> I found Contributor 
> Covenant-derived Code of Conduct was added to >>> Pharo, three months ago. 
> This is unacceptable under any circumstances. >>> >>> Have fun in your woke 
> hell. >> >> I would like to have more details about this. For those of us who 
> don't >> believe in hell, what is the problem of an explicit Code of Conduct? 
> > > More specifically, what behavior does the Code prohibit that you would 
> otherwise do? > > For my part, while I might not subscribe to the full 
> progressive agenda, I wasn’t planning any racial or ethnic slurs (or a 
> theological discussion of the afterlife—but feel free to ask me privately!), 
> so don’t find this “woke” agenda too constricting. > > James Indeed. For 
> those new to the discussion, we are talking about 
> https://www.contributor-covenant.org/version/1/4/code-of-conduct - which is 
> quite popular and generally accepted. Sven 

 

  _  

Sent from the Pharo Smalltalk Users mailing list archive 
  at Nabble.com.



Re: [Pharo-users] "whenSelectedItemChanged:" in Spec

2019-07-16 Thread PBKResearch
Steve

How did you get the source code for the examples? Pages 12-13 of the "Spec UI 
Framework" booklet give the code for the methods of class WidgetClassList, and 
there we find:

WidgetClassList >> whenSelectedItemChanged: aBlock
list whenSelectedItemChanged: aBlock

This looks very much like the 'when' methods of all the other subclasses of 
ComposablePresenter. It should at least do something when activated.

HTH

Peter Kenny

-Original Message-
From: Pharo-users  On Behalf Of Ben Coman
Sent: 16 July 2019 15:42
To: Any question about pharo is welcome 
Subject: Re: [Pharo-users] "whenSelectedItemChanged:" in Spec

On Tue, 16 Jul 2019 at 12:49, Steve Quezadas  wrote:
>
> I am running through the "Spec UI Framework" tutorial, and in it has a widget 
> class inherited from "ComposablePresenter" (ComposablePresenter subclass: 
> #WidgetClassList). But for some reason the "whenSelectedItemChanged:" method 
> call does not execute when I select any item on the GUI list. Is there 
> anything I'm missing?
>
> I posted this earlier on the list, and someone suggested I try  
> "whenActivatedDo:" or "whenSelectionChangedDo:", but it doesn't do anything 
> as well. The code looks like this:
>
> whenSelectedItemChanged: aBlock
> Transcript show: 'should get here; cr.
>
> I am using Pharo 7.

Can you FileOut the entire sample class and attached it?

cheers -ben




Re: [Pharo-users] [ANN] (Re)Introducing Mars (Spec 2.0 Gtk3 bindings)

2019-04-18 Thread PBKResearch
+1 to Norbert. In particular, does it mean that, from Pharo 8, we will be 
*required* to install Gtk3 backend to use Pharo?

 

Peter Kenny

 

From: Pharo-users  On Behalf Of Norbert 
Hartl
Sent: 18 April 2019 11:58
To: Pharo users users 
Cc: Pharo Dev 
Subject: Re: [Pharo-users] [ANN] (Re)Introducing Mars (Spec 2.0 Gtk3 bindings)

 

Great!

 

Can you explain what is there, what somebody can load and what to expect. And 
even more important: what not to expect?

 

I don’t get any of the essential details from this mail.

 

Norbert

 

 

Am 18.04.2019 um 12:08 schrieb Esteban Lorenzano <  
esteba...@gmail.com>:

 

People that assisted to Pharo Days 2019 (or that follow my twitter account) 
already know this, but it needs to be formally announced: 

 

We are working on Spec 2.0, and it will provide not just the classic Morphic 
bindings but also a new option for developers: Gtk3 bindings!

 

Why we want a Spec 2.0 with different backends?

 

There are reasons that converged to decide us to make it:

 

*   First, to provide a validated abstract Spec 2.0 that can be used with 
different backends, preparing Pharo to be able to switch backends without 
needing to recreate the full IDE from scratch each time (a problem we have 
partially now in our way to deprecate Morphic).
*   Second, because we receive from different sources the requirement of 
having the possibility of developing real native-looking desktop applications. 
Yes, in moment where people talk about the cloud, SaaS and web-applications as 
the "next big thing" (something that is been declared since years, by the way), 
we believe is important to provide this, for two big reasons: 

1.  Because there is still an important place for desktop applications 
market and most medium-size to big business still require them.
2.  Because Pharo itself is a desktop application! (And we need to provide 
the best experience possible on it).

 

For us, this is a fundamental step to continue improving Pharo itself, and it 
matches also the work we are doing on going real-headless:  Pharo users will be 
able to start the Morphic world, a Gtk application or the next backend to come.

 

Why Gtk3?

 

There are some other important players in the "native widgets scene", so why we 
choose Gtk3? 

 

Again, several reasons  were taken into account: 

 

*   Gtk3 is cross platform. Yes, technically is just "native" in linux, but 
it works on Windows and macOS too. 
*   It is very mature and popular.
*   It is made in plain C.

 

Next step: tool migration

 

The only way to know if you have covered what is needed is actually taking 
real-life use cases and implementing them. We have a list of tools that needs 
to be migrated and we are starting from them: 

 

1.  Old GT tools will be replaced by new Spec tools (while preserving its 
power).
2.  Calypso UI needs to be rewritten in Spec 2.0 (it is in plain Morphic 
now).
3.  Pharo launcher as a standalone application is a good example of what 
you can do with the Gtk3 bindings.

 

And that's it. Pharo 8.0 will come with Spec 2.0 and users will be able to 
benefit of it immediately :)

 

 

A small screenshot of the new Inspector (WIP): 

 



 

Esteban

 



Re: [Pharo-users] ZnURL and parsing URL with diacritics

2019-03-26 Thread PBKResearch
Sven

Well RFCs are unreadable - I know, because I looked at 3986 while looking at 
this question - but OK, I get your point. I suppose I should be looking for 
something that makes it easier to provide similar convenience features in 
Pharo. As you say, if this issue is cracked, that is a step on the way.

Peter

-Original Message-
From: Pharo-users  On Behalf Of Sven Van 
Caekenberghe
Sent: 26 March 2019 15:08
To: Any question about pharo is welcome 
Subject: Re: [Pharo-users] ZnURL and parsing URL with diacritics

Peter,

It *is* a bogus URL, please go and read some RFCs.

A browser's address/search box is an entirely different thing that adds 
convenience features, such as the issue we are discussing here.

Sven

> On 26 Mar 2019, at 16:02, PBKResearch  wrote:
> 
> Sven
> 
> That would certainly work, and represents the most liberal possible 
> approach. An equivalent, keeping entirely within Zinc, would be to use 
> a special-purpose instance of ZnPercentEncoder, in which the safe set 
> is defined as all characters between code points 33 and 126 inclusive. 
> (Starting at 33 fixes your space point.)
> 
> Using 'bogusUrl' as a variable name seems a bit pejorative. I am looking up 
> French and German words in Wiktionary all the time, and I am building a Pharo 
> app to do it for me. The version of the url with the accented characters will 
> not work in Zinc until I have urlEncoded it, but it works perfectly well in a 
> browser and is much easier to read.
> 
> Peter Kenny
> 
> 
> -Original Message-
> From: Pharo-users  On Behalf Of 
> Sven Van Caekenberghe
> Sent: 26 March 2019 12:26
> To: Any question about pharo is welcome 
> Subject: Re: [Pharo-users] ZnURL and parsing URL with diacritics
> 
> I would use a variant of your original transformation.
> 
> The issue (the error in the URL) is that all kinds of non-ASCII characters 
> occur unencoded. We should/could assume that other special/reserved ASCII 
> characters _are_ properly encoded (so we do not need to handle them).
> 
> So I would literally patch/fix the problem, like this:
> 
> | bogusUrl fixedUrl url |
> bogusUrl := 'https://en.wikipedia.org/wiki/Česká republika'.
> fixedUrl := String streamContents: [ :out |
>   bogusUrl do: [ :each |
>   (each codePoint < 127 and: [ each ~= $ ])
>   ifTrue: [ out nextPut: each ]
>   ifFalse: [ out nextPutAll: each asString urlEncoded ] ] 
> ].
> fixedUrl asUrl retrieveContents.
> 
> I made and extra case for the space character, it works either way in the 
> example given, but a space cannot occur freely.
> 
>> On 26 Mar 2019, at 12:53, PBKResearch  wrote:
>> 
>> Sean
>> 
>> I have realized that the method I proposed can be expressed entirely within 
>> the Zinc system, which may make it a bit neater and easier to follow. There 
>> probably is no completely general solution, but there is a completely 
>> general way of finding a solution for your problem domain.
>> 
>> It is important to realize that String>>urlEncoded is defined as:
>>  ZnPercentEncoder new encode: self.
>> ZnPercentEncoder does not attempt to parse the input string as a url. It 
>> scans the entire string, and percent encodes any character that is not in 
>> its safe set (see the comment to ZnPercentEncoder>>encode:). Sven has given 
>> as default a minimum safe set, which does not include slash, but there is a 
>> setter method to redefine the safe set.
>> 
>> So the general way to find a solution for your domain is to collect a 
>> representative set of the url strings, apply String>>urlEncoded to each, and 
>> work out which characters have been percent encoded wrongly for your domain. 
>> For any url cases this is likely to include ':/?#', as well as '%' if it 
>> includes things already percent encoded, but there may be others specific to 
>> your domain. Now construct an instance of ZnPercentEncoder with the safe set 
>> extended to include these characters - note that the default safe set is 
>> given by the class method ZnPercentEncoder class>> 
>> rfc3986UnreservedCharacters. Apply this instance to encode all your test 
>> incoming url strings and verify that they work. Iterate, extending the safe 
>> set, until everything passes.
>> 
>> If you want to keep the neatness being able to write something like 
>> 'incomingString urlEncoded asZnUrl', you can add a method to String; for the 
>> case of the common url characters mentioned above:
>> 
>> String>> urlEncodedMyWay
>> 
>> "As urlEncoded, but with the safe set extended to include characters 
>> comm

Re: [Pharo-users] ZnURL and parsing URL with diacritics

2019-03-26 Thread PBKResearch
Sven

That would certainly work, and represents the most liberal possible approach. 
An equivalent, keeping entirely within Zinc, would be to use a special-purpose 
instance of ZnPercentEncoder, in which the safe set is defined as all 
characters between code points 33 and 126 inclusive. (Starting at 33 fixes your 
space point.)

Using 'bogusUrl' as a variable name seems a bit pejorative. I am looking up 
French and German words in Wiktionary all the time, and I am building a Pharo 
app to do it for me. The version of the url with the accented characters will 
not work in Zinc until I have urlEncoded it, but it works perfectly well in a 
browser and is much easier to read.

Peter Kenny


-Original Message-
From: Pharo-users  On Behalf Of Sven Van 
Caekenberghe
Sent: 26 March 2019 12:26
To: Any question about pharo is welcome 
Subject: Re: [Pharo-users] ZnURL and parsing URL with diacritics

I would use a variant of your original transformation.

The issue (the error in the URL) is that all kinds of non-ASCII characters 
occur unencoded. We should/could assume that other special/reserved ASCII 
characters _are_ properly encoded (so we do not need to handle them).

So I would literally patch/fix the problem, like this:

| bogusUrl fixedUrl url |
bogusUrl := 'https://en.wikipedia.org/wiki/Česká republika'.
fixedUrl := String streamContents: [ :out |
bogusUrl do: [ :each |
(each codePoint < 127 and: [ each ~= $ ])
ifTrue: [ out nextPut: each ]
ifFalse: [ out nextPutAll: each asString urlEncoded ] ] 
].
fixedUrl asUrl retrieveContents.

I made and extra case for the space character, it works either way in the 
example given, but a space cannot occur freely.

> On 26 Mar 2019, at 12:53, PBKResearch  wrote:
> 
> Sean
> 
> I have realized that the method I proposed can be expressed entirely within 
> the Zinc system, which may make it a bit neater and easier to follow. There 
> probably is no completely general solution, but there is a completely general 
> way of finding a solution for your problem domain.
> 
> It is important to realize that String>>urlEncoded is defined as:
>   ZnPercentEncoder new encode: self.
> ZnPercentEncoder does not attempt to parse the input string as a url. It 
> scans the entire string, and percent encodes any character that is not in its 
> safe set (see the comment to ZnPercentEncoder>>encode:). Sven has given as 
> default a minimum safe set, which does not include slash, but there is a 
> setter method to redefine the safe set.
> 
> So the general way to find a solution for your domain is to collect a 
> representative set of the url strings, apply String>>urlEncoded to each, and 
> work out which characters have been percent encoded wrongly for your domain. 
> For any url cases this is likely to include ':/?#', as well as '%' if it 
> includes things already percent encoded, but there may be others specific to 
> your domain. Now construct an instance of ZnPercentEncoder with the safe set 
> extended to include these characters - note that the default safe set is 
> given by the class method ZnPercentEncoder class>> 
> rfc3986UnreservedCharacters. Apply this instance to encode all your test 
> incoming url strings and verify that they work. Iterate, extending the safe 
> set, until everything passes.
> 
> If you want to keep the neatness being able to write something like 
> 'incomingString urlEncoded asZnUrl', you can add a method to String; for the 
> case of the common url characters mentioned above:
> 
> String>> urlEncodedMyWay
> 
> "As urlEncoded, but with the safe set extended to include characters commonly 
> found in a url"
> 
> ^ ZnPercentEncoder new safeSet: ':/?#%', (ZnPercentEncoder 
> rfc3986UnreservedCharacters);
>   encode: self
> 
> This works in much the same way as the snippet I posted originally, because 
> my code simply reproduces the essentials of ZnPercentEncoder>>encode:.
> 
> I seem to be trying to monopolize this thread, so I shall shut up now.
> 
> HTH
> 
> Peter Kenny
> 
> -Original Message-
> From: Pharo-users  On Behalf Of 
> PBKResearch
> Sent: 24 March 2019 15:36
> To: 'Any question about pharo is welcome' 
> 
> Subject: Re: [Pharo-users] ZnURL and parsing URL with diacritics
> 
> Well it didn't take long to find a potential problem in what I wrote, at 
> least as a general solution. If the input string contains something which has 
> already been percent encoded, it will re-encode the percent signs. In this 
> case, decoding will recover the once-encoded version, but we need to decode 
> twice to recover the original text. Any web site receiving this version will 
> almost certainly decode once only, and so 

Re: [Pharo-users] ZnURL and parsing URL with diacritics

2019-03-26 Thread PBKResearch
Sean

I have realized that the method I proposed can be expressed entirely within the 
Zinc system, which may make it a bit neater and easier to follow. There 
probably is no completely general solution, but there is a completely general 
way of finding a solution for your problem domain.

It is important to realize that String>>urlEncoded is defined as:
ZnPercentEncoder new encode: self.
ZnPercentEncoder does not attempt to parse the input string as a url. It scans 
the entire string, and percent encodes any character that is not in its safe 
set (see the comment to ZnPercentEncoder>>encode:). Sven has given as default a 
minimum safe set, which does not include slash, but there is a setter method to 
redefine the safe set.

So the general way to find a solution for your domain is to collect a 
representative set of the url strings, apply String>>urlEncoded to each, and 
work out which characters have been percent encoded wrongly for your domain. 
For any url cases this is likely to include ':/?#', as well as '%' if it 
includes things already percent encoded, but there may be others specific to 
your domain. Now construct an instance of ZnPercentEncoder with the safe set 
extended to include these characters - note that the default safe set is given 
by the class method ZnPercentEncoder class>> rfc3986UnreservedCharacters. Apply 
this instance to encode all your test incoming url strings and verify that they 
work. Iterate, extending the safe set, until everything passes.

If you want to keep the neatness being able to write something like 
'incomingString urlEncoded asZnUrl', you can add a method to String; for the 
case of the common url characters mentioned above:

String>> urlEncodedMyWay

"As urlEncoded, but with the safe set extended to include characters commonly 
found in a url"

^ ZnPercentEncoder new safeSet: ':/?#%', (ZnPercentEncoder 
rfc3986UnreservedCharacters);
encode: self

This works in much the same way as the snippet I posted originally, because my 
code simply reproduces the essentials of ZnPercentEncoder>>encode:.

I seem to be trying to monopolize this thread, so I shall shut up now.

HTH

Peter Kenny

-Original Message-----
From: Pharo-users  On Behalf Of PBKResearch
Sent: 24 March 2019 15:36
To: 'Any question about pharo is welcome' 
Subject: Re: [Pharo-users] ZnURL and parsing URL with diacritics

Well it didn't take long to find a potential problem in what I wrote, at least 
as a general solution. If the input string contains something which has already 
been percent encoded, it will re-encode the percent signs. In this case, 
decoding will recover the once-encoded version, but we need to decode twice to 
recover the original text. Any web site receiving this version will almost 
certainly decode once only, and so will not see the right details.

The solution is simple - just include the percent sign in the list of excluded 
characters in the third line, so it becomes:
url asString do: [ :ch|(':/?%' includes: ch )

-Original Message-----
From: Pharo-users  On Behalf Of PBKResearch
Sent: 24 March 2019 12:11
To: 'Any question about pharo is welcome' 
Subject: Re: [Pharo-users] ZnURL and parsing URL with diacritics

Sean, Sven

Thinking about this, I have found a simple (maybe too simple) way round it. The 
obvious first approach is to apply 'urlEncoded' to the received url string, but 
this fails because it also encodes the slashes and other segment dividers. A 
simple-minded approach is to scan the received string, copy the slashes and 
other segment dividers unchanged and percent encode everything else. I cobbled 
together the following in a playground, but it could easily be turned into a 
method in String class.

urlEncodedSegments := [ :url||outStream|
outStream := String new writeStream.
url asString do: [ :ch|(':/?' includes: ch )
ifTrue: [ outStream nextPut: ch ]
ifFalse:[outStream nextPutAll: ch asString urlEncoded ] ]. 
outStream contents].

urlEncodedSegments value: 'https://fr.wiktionary.org/wiki/péripétie'
=> https://fr.wiktionary.org/wiki/p%C3%A9rip%C3%A9tie

This may fail if a slash can occur in a url other than as a segment divider. I 
am not sure if this is possible - could there be some sort of escaped slash 
within a segment? Anyway, if the received url strings are well-behaved, apart 
from the diacritics, this approach could be used as a hack for Sean's problem.

HTH

Peter Kenny

Note to Sven: The comment to String>>urlEncoded says: ' This is an encoding 
where characters that are illegal in a URL are escaped.' Slashes are escaped 
but are quite legal. Should the comment be changed, or the method?



-Original Message-
From: Pharo-users  On Behalf Of Sven Van 
Caekenberghe
Sent: 23 March 2019 20:03
To: Any question about pharo is welcome 
Subject: Re: [Pharo-users] ZnURL and parsing URL with diacritics

Re: [Pharo-users] ZnURL and parsing URL with diacritics

2019-03-24 Thread PBKResearch
Well it didn't take long to find a potential problem in what I wrote, at least 
as a general solution. If the input string contains something which has already 
been percent encoded, it will re-encode the percent signs. In this case, 
decoding will recover the once-encoded version, but we need to decode twice to 
recover the original text. Any web site receiving this version will almost 
certainly decode once only, and so will not see the right details.

The solution is simple - just include the percent sign in the list of excluded 
characters in the third line, so it becomes:
url asString do: [ :ch|(':/?%' includes: ch )

-Original Message-
From: Pharo-users  On Behalf Of PBKResearch
Sent: 24 March 2019 12:11
To: 'Any question about pharo is welcome' 
Subject: Re: [Pharo-users] ZnURL and parsing URL with diacritics

Sean, Sven

Thinking about this, I have found a simple (maybe too simple) way round it. The 
obvious first approach is to apply 'urlEncoded' to the received url string, but 
this fails because it also encodes the slashes and other segment dividers. A 
simple-minded approach is to scan the received string, copy the slashes and 
other segment dividers unchanged and percent encode everything else. I cobbled 
together the following in a playground, but it could easily be turned into a 
method in String class.

urlEncodedSegments := [ :url||outStream|
outStream := String new writeStream.
url asString do: [ :ch|(':/?' includes: ch )
ifTrue: [ outStream nextPut: ch ]
ifFalse:[outStream nextPutAll: ch asString urlEncoded ] ]. 
outStream contents].

urlEncodedSegments value: 'https://fr.wiktionary.org/wiki/péripétie'
=> https://fr.wiktionary.org/wiki/p%C3%A9rip%C3%A9tie

This may fail if a slash can occur in a url other than as a segment divider. I 
am not sure if this is possible - could there be some sort of escaped slash 
within a segment? Anyway, if the received url strings are well-behaved, apart 
from the diacritics, this approach could be used as a hack for Sean's problem.

HTH

Peter Kenny

Note to Sven: The comment to String>>urlEncoded says: ' This is an encoding 
where characters that are illegal in a URL are escaped.' Slashes are escaped 
but are quite legal. Should the comment be changed, or the method?



-Original Message-
From: Pharo-users  On Behalf Of Sven Van 
Caekenberghe
Sent: 23 March 2019 20:03
To: Any question about pharo is welcome 
Subject: Re: [Pharo-users] ZnURL and parsing URL with diacritics



> On 23 Mar 2019, at 20:53, Sean P. DeNigris  wrote:
> 
> Peter Kenny wrote
>> And when I inspect the result, it is the address of a non-existent 
>> file in my image directory.
> 
> Ah, no. I see the same result. By "worked" I meant that it created a 
> URL that safari accepted, but I see now it's not the same as correctly 
> parsing it.
> 
> 
> Peter Kenny wrote
>> Incidentally, I tried the other trick Sven cites in the same thread. 
>> The same url as above can be written:
>> 'https://fr.wiktionary.org/wiki' asUrl / 'péripétie'.
> 
> Yes, this works if you are assembling the URL, but several people 
> presented the use case of processing URLs from elsewhere, leaving one 
> in a chicken-and-egg situation where one can't parse due to the 
> diacritics and can't escape the diacritics (i.e. without incorrectly 
> escaping other things) without parsing :/

Yes, that is pretty close to a catch 22. Strictly speaking, such URLs are 
incorrect and can't be parsed.

I do understand that sometimes these URLs occur in the wild, but again, 
strictly speaking they are in error.

The fact that browser search boxes accept them is a service on top of the 
strict URL syntax, I am not 100% sure how they do it, but it probably involves 
a lot of heuristics and trial and error.

The parser of ZnUrl is just 3 to 4 methods. There is nothing preventing 
somebody from making a new ZnLoseUrlParser, but it won't be easy.

> -
> Cheers,
> Sean
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
> 






Re: [Pharo-users] ZnURL and parsing URL with diacritics

2019-03-24 Thread PBKResearch
Sean, Sven

Thinking about this, I have found a simple (maybe too simple) way round it. The 
obvious first approach is to apply 'urlEncoded' to the received url string, but 
this fails because it also encodes the slashes and other segment dividers. A 
simple-minded approach is to scan the received string, copy the slashes and 
other segment dividers unchanged and percent encode everything else. I cobbled 
together the following in a playground, but it could easily be turned into a 
method in String class.

urlEncodedSegments := [ :url||outStream|
outStream := String new writeStream.
url asString do: [ :ch|(':/?' includes: ch )
ifTrue: [ outStream nextPut: ch ]
ifFalse:[outStream nextPutAll: ch asString urlEncoded ] ]. 
outStream contents].

urlEncodedSegments value: 'https://fr.wiktionary.org/wiki/péripétie'
=> https://fr.wiktionary.org/wiki/p%C3%A9rip%C3%A9tie

This may fail if a slash can occur in a url other than as a segment divider. I 
am not sure if this is possible - could there be some sort of escaped slash 
within a segment? Anyway, if the received url strings are well-behaved, apart 
from the diacritics, this approach could be used as a hack for Sean's problem.

HTH

Peter Kenny

Note to Sven: The comment to String>>urlEncoded says: ' This is an encoding 
where characters that are illegal in a URL are escaped.' Slashes are escaped 
but are quite legal. Should the comment be changed, or the method?



-Original Message-
From: Pharo-users  On Behalf Of Sven Van 
Caekenberghe
Sent: 23 March 2019 20:03
To: Any question about pharo is welcome 
Subject: Re: [Pharo-users] ZnURL and parsing URL with diacritics



> On 23 Mar 2019, at 20:53, Sean P. DeNigris  wrote:
> 
> Peter Kenny wrote
>> And when I inspect the result, it is the address of a non-existent 
>> file in my image directory.
> 
> Ah, no. I see the same result. By "worked" I meant that it created a 
> URL that safari accepted, but I see now it's not the same as correctly 
> parsing it.
> 
> 
> Peter Kenny wrote
>> Incidentally, I tried the other trick Sven cites in the same thread. 
>> The same url as above can be written:
>> 'https://fr.wiktionary.org/wiki' asUrl / 'péripétie'.
> 
> Yes, this works if you are assembling the URL, but several people 
> presented the use case of processing URLs from elsewhere, leaving one 
> in a chicken-and-egg situation where one can't parse due to the 
> diacritics and can't escape the diacritics (i.e. without incorrectly 
> escaping other things) without parsing :/

Yes, that is pretty close to a catch 22. Strictly speaking, such URLs are 
incorrect and can't be parsed.

I do understand that sometimes these URLs occur in the wild, but again, 
strictly speaking they are in error.

The fact that browser search boxes accept them is a service on top of the 
strict URL syntax, I am not 100% sure how they do it, but it probably involves 
a lot of heuristics and trial and error.

The parser of ZnUrl is just 3 to 4 methods. There is nothing preventing 
somebody from making a new ZnLoseUrlParser, but it won't be easy.

> -
> Cheers,
> Sean
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
> 





Re: [Pharo-users] ZnURL and parsing URL with diacritics

2019-03-23 Thread PBKResearch
I recall seeing this trick when Sven published it, but I have never tried it. 
Trying it now, I get strange results. I entered:
'https://fr.wiktionary.org/wiki/péripétie' asFileReference asUrl.
And when I inspect the result, it is the address of a non-existent file in my 
image directory. I am using Moose 6.1 ( Pharo 6.0
Latest update: #60541) on Windows 10. This is not a current image, I know, but 
it is more recent than the date of Sven's post (Dec 2014). Has something 
changed since 2014?

Incidentally, I tried the other trick Sven cites in the same thread. The same 
url as above can be written:
'https://fr.wiktionary.org/wiki' asUrl / 'péripétie'.
This works fine, and is neater than the alternative with explicit percent 
encoding which I currently use. So thanks Sean for pointing me to the thread.

Peter Kenny

-Original Message-
From: Pharo-users  On Behalf Of Sean P. 
DeNigris
Sent: 23 March 2019 04:00
To: pharo-users@lists.pharo.org
Subject: Re: [Pharo-users] ZnURL and parsing URL with diacritics

Pharo Smalltalk Users mailing list wrote
> OK. Thanks for examples. But in my case, the bad URL (with diacritics) 
> comes directly from the Zomato.com REST API (they probably do not read 
> specs), so I'll end up with a few "hacks" with strings.

Sven actually found a trick to handle this case and then forgot he he [1].
Just in case you still have the issue:

'http://myhost/path/with/umlaut/äöü.txt' asFileReference asUrl.

1. http://forum.world.st/Umlauts-in-ZnUrl-tp4793736.html



-
Cheers,
Sean
--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html




Re: [Pharo-users] How to get to the bottom of the spinning beach ball when first entering Pharo

2019-03-13 Thread PBKResearch
Tim

I have never seen a spinning beach ball, but I often find, when coming back to 
Pharo after using some other application, that there is a delay of a few 
seconds, during which time I see the standard Windows 'hang on a bit' signal, 
which is a blue ring near the cursor. My assumption is that this is the effect 
of swapping from virtual memory - my machine has only(!) 4GB of real Ram. Could 
the beach ball be something generated by your OS in a similar situation? - 
which OS are you on, by the way?

HTH

Peter Kenny

-Original Message-
From: Pharo-users  On Behalf Of Tim 
Mackinnon
Sent: 13 March 2019 10:10
To: Pharo Users Newsgroup 
Subject: [Pharo-users] How to get to the bottom of the spinning beach ball when 
first entering Pharo

Hi guys - this has come up before in the past - but I’m really noticing it now 
having worked on a project for a few weeks. Every time I go into my image (by 
go into - I mean unsuspend my laptop and start using as its the current app, OR 
flipping to it from say reading email) I get a shining beach ball for 5-10 
seconds and then the app is responsive and I can work on it. It’s not all of 
the time, but I’ve noticed its not just my laptop warming up - as several times 
a day I see it when flipping back to it.

How do I trouble shoot what is going on - does the system reporter tool tell me 
anything useful? I did notice my image has grown quite large - is it just that?

Virtual Machine Statistics
--
uptime  89h58m32s
memory  409,608,192 bytes
old 400,656,160 bytes (97.81%)
young   3,931,080 bytes (1.0%)
used317,989,144 bytes (77.61%)
free86,598,096 bytes (21.1%)


If it is memory - what would I look at to see why my memory usage is so large 
on a relatively small app with few dependencies (although I have been doing 
lots of iceberg commits and running tests, and using the debugger to explore 
etc)

Tim




Re: [Pharo-users] Parsing text to discover general data of interest (phone, email, address, ...)

2019-03-07 Thread PBKResearch
Cedrick

 

Sorry for not answering sooner. You have probably found what you want. I meant 
that ‘island + sea’ is now a standard pattern. Follow the link to the tutorial 
from the readme you referenced – the example of javascript in HTML might carry 
over well enough to your situation.

 

Peter

 

From: Pharo-users  On Behalf Of Cédrick 
Béler
Sent: 07 March 2019 11:20
To: Any question about pharo is welcome 
Subject: Re: [Pharo-users] Parsing text to discover general data of interest 
(phone, email, address, ...)

 







When you say  "unstructured material ... is now a standard pattern in 
PetitParser », how could I begin exploring that ? Any tutorials ?

 

I’ll load it and play around. 

https://github.com/kursjan/petitparser2/blob/master/README.md



Re: [Pharo-users] Parsing text to discover general data of interest (phone, email, address, ...)

2019-03-07 Thread PBKResearch
Cédrick

In principle, what you are asking for is to identify 'islands' of structured 
information in a 'sea' of otherwise unstructured material, which is now a 
standard pattern in PetitParser. You could imagine a parser spec of the form:

(sea optional, (email/phone/address/), sea optional) plus

Where email etc are parsers for the individual structures. As a parser this 
would probably lead to lots of backtracking and be hideously inefficient, but 
for a short text like an e-mail it could be usable. This also assumes that the 
items of interest are really structured; there could be many ways of writing 
phone numbers, for instance.

HTH

Peter Kenny

-Original Message-
From: Pharo-users  On Behalf Of Cédrick 
Béler
Sent: 07 March 2019 09:52
To: Any question about pharo is welcome 
Cc: Tudor Girba 
Subject: [Pharo-users] Parsing text to discover general data of interest 
(phone, email, address, ...)

Hi all,

I’ve often got the need to analyse some random unstructured text to discover 
(structured) information (in email for instance), to extract :
- emails
- telephone numbers
- addresses
- events
- person names (according to a list of known persons),
- etc… 

Apple do it in email for instance (strangely, this is not generalized).


So my questions are :
- do we have something equivalent in Smalltalk/Pharo ? (I didn’t find)
- if not, what strategy would you use ?
=> I do really stupid text analysis (substrings, finding @, …, parsing 
according to the text structure when there is… kind of Soup parsing…) => I feel 
this is a job for PetitParser ? And would be a nice feet to the new GToolkit.

All ideas or suggestions are welcome ;-)


TIA,

Cédrick 






Re: [Pharo-users] Pharo Object Serialization

2019-02-22 Thread PBKResearch
Bruno

OmniBase was ported to Pharo 6+ in Jun 2018. The original porting work was
done by Esteban Lorenzano, but he pointed out that, as a non-user, he is not
in a position to provide any support. It was used to a small extent by me,
and much more by Matias Maretto. The repo is at
https://github.com/estebanlm/OmniBase. There were a couple of tweaks needed
to get it fully working; I don't know whether they were incorporated in the
repo version.

I haven't really used it much - my project got overtaken by other work. I
think Matias used it more. You can see the whole story if you search for the
subject 'OmniBase for Pharo 6' in this forum.

HTH

Peter Kenny

-Original Message-
From: Pharo-users  On Behalf Of BrunoBB
Sent: 22 February 2019 03:05
To: pharo-users@lists.pharo.org
Subject: [Pharo-users] Pharo Object Serialization

Hi,

Which are the options for serialize objects in Pharo ?

I know there is Fuel (https://rmod.inria.fr/web/software/Fuel).

OmniBase is not supported any more. OmniBase was pretty cool even
transactional !!!

What are you using ? (of course there is GemStone/S but i was not able to
convince my client yet :)

regards,
bruno



--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html




Re: [Pharo-users] Pharo 7 - RFB

2018-11-25 Thread PBKResearch
Sanjay

You may find more information at:
https://en.wikipedia.org/wiki/RFB_protocol
https://en.wikipedia.org/wiki/Virtual_Network_Computing

Do you want to use 'remote access to graphical user interfaces'?  If not,
maybe you can ignore it.

Peter Kenny

-Original Message-
From: Pharo-users  On Behalf Of Paul
DeBruicker
Sent: 25 November 2018 21:34
To: pharo-users@lists.pharo.org
Subject: Re: [Pharo-users] Pharo 7 - RFB


http://www.samadhiweb.com/tags/VNC



Sanjay Minni wrote
> OK loaded RFB in pharo 7.0 Thru Monticello
> 
> is there any documentation somewhere
> 
> 
> Sanjay Minni wrote
>> what is RFB used for ? and can I load it in Pharo 7.
>> I could not find any documentation anywhere
>> 
>> When migrating an earlier application (pharo 6.1 to 7.0) RFB was 
>> loaded in the ConfigurationOfApplication,(in 6.1) However in Pharo 7, 
>> I manually loaded the required packages and loading seems complete 
>> without RFB so am trying to figure out what is RFB and what was it 
>> used for (application loaded fine).
>> 
>> any inputs pls how to go about it
>> (off course I can try running and just see if anything crashes while 
>> running but so many things may cause crashes and want to know before 
>> proceeding)
>> 
>> 
>> 
>> -
>> cheers,
>> Sanjay
>> --
>> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
> 
> 
> 
> 
> 
> -
> cheers,
> Sanjay
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html





--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html




Re: [Pharo-users] Windows 10 double-click issue + solution

2018-11-25 Thread PBKResearch
John

 

Many thanks for the tip. I have always found double click very erratic on
Windows 7 and now on W10. It would eventually work, but was critically
dependent on getting the right timing for the click interval. Pushing the
pointer towards 'slow' on the mouse settings has improved things a lot.

 

Peter Kenny

 

From: Pharo-users  On Behalf Of John
Kimber via Pharo-users
Sent: 24 November 2018 23:06
To: pharo-users@lists.pharo.org
Cc: John Kimber 
Subject: [Pharo-users] Windows 10 double-click issue + solution

 

 



Re: [Pharo-users] Installing SmaCC

2018-10-16 Thread PBKResearch
Dimitris

 

If you download the latest Moose Suite 6.1, you will have Pharo 6.1 with lots 
of extra packages, including SmaCC. The SmaCC includes compilers for C, 
Smalltalk and Java, among others, but with little or no documentation. I am not 
a SmaCC expert, so I can’t say whether it will do what you want, but at least 
it will give you a start. Moose also includes PetitParser and PP2,if you want 
to try other parsing approaches. Of course, the Windows version is 32-bit only, 
for reasons explained elsewhere in this thread.

 

HTH

 

Peter Kenny

 

From: Pharo-users  On Behalf Of Dimitris 
Chloupis
Sent: 16 October 2018 15:40
To: Any question about pharo is welcome 
Subject: [Pharo-users] Installing SmaCC

 

Hey guys 

 

I downloaded the latest Pharo 6.1 64bit for Windows and tried to install SmaCC 
through the catalog browser but it failed 

 

I did manage to install it following the instruction in the github repo but I 
see that I am missing most parser packages. 

 

The languages I am interested are Smalltalk (which is included) and C (if 
possible C++ too) cause I will be creating a new language which will be a cross 
between C and Smalltalk (very similar to smalltalk syntax but with the addtion 
of C types and no GC and dynamic typing and also a partial implementation of 
OOP that is quite diffirent). My goal is compilation of my language to readable 
C code so the ability to parse also existing C code is needed. 

 

Any help is greatly appreciated , thanks :) 



Re: [Pharo-users] [vwnc] Parsing in Smalltalk

2018-10-11 Thread PBKResearch
Steffen

I do most of my work using Moose Suite 6.1, which is Pharo 6.1 with a lot of
extras, because it comes with the tools I want (PetitParser, PP2 and
XMLParser) already loaded. The image is huge, but if that's not a problem
for you it could be an easy way to get PP2.

Best wishes

Peter Kenny

-Original Message-
From: Pharo-users  On Behalf Of Steffen
Märcker
Sent: 11 October 2018 16:11
To: pharo-users@lists.pharo.org
Subject: Re: [Pharo-users] [vwnc] Parsing in Smalltalk

I am using MacOS 10.13.6 and the 32bit VM:

Pharo 6.0
Latest update: #60546

... the String in about is wrong, it should be 6.1. I installed it via the
launcher as "Official Distribution: Pharo 6.1 - 32Bit (stable)" I just
noticed, that the sources file is missing from vms/private/6521/, too.

Am .10.2018, 17:02 Uhr, schrieb Sean P. DeNigris :

> Steffen Märcker wrote
>> I did the following:
>> 1)  Download and start Pharo 6.1 stable via the launcher.
>> 2b) Attempt to install PP2 via the scripts from GitHub:
>>  Metacello new
>>  baseline: 'PetitParser2';
>>  repository: 'github://kursjan/petitparser2';
>>  load.
>>  Metacello new
>>  baseline: 'PetitParser2Gui';
>>  repository: 'github://kursjan/petitparser2';
>>  load.
>
> This way worked for me in Pharo #60546 (check in World->System->About).  
> What
> exact Pharo version/OS are you on? 32 or 64-bit
>
>
>
> -
> Cheers,
> Sean
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>






Re: [Pharo-users] Query on Pharo syntax

2018-09-10 Thread PBKResearch
Thanks Ben – it’s all clear now. Thanks also to Esteban, who spared my blushes 
by answering direct!

Peter Kenny

 

From: Pharo-users  On Behalf Of Ben Coman
Sent: 10 September 2018 19:56
To: Any question about pharo is welcome 
Subject: Re: [Pharo-users] Query on Pharo syntax

 

 

On Tue, 11 Sep 2018 at 02:44, PBKResearch mailto:pe...@pbkresearch.co.uk> > wrote:

Hi All

 

This is an idiot question, I should know the answer, but I have looked around 
and can’t find relevant documentation. I’m not asking for a full answer, just a 
pointer as to where to start looking.

 

I have seen from examples in this forum that an expression like the following:

 

paras collect: [para| para prettyPrinted]

 

can be written more concisely as:

 

paras collect: #prettyPrinted

 

which obviously works when I try it. It doesn’t seem to fit in with the 
definition of #collect:, which requires a block as argument. Where can I find 
the relevant definition, either in method comments or in some general manual? 
Can the notation be extended,

 

Its not special notation.  Just a normal object (a Symbol) passed via a normal 
message.

 

for example to #select: - obviously with an argument which returns a Boolean? 
Can it be used with a method which requires an argument, e.g. as myArray 
collect: (#myMethod: arg)? Are there any other extensions?

 

Any help gratefully received.

 

Peter Kenny

 

Full answer ;)

Its a combination of the following two methods...

 

Collection >> collect: aBlock 

   | newCollection |

   newCollection := self species new.

   self do: [:each | newCollection add: (aBlock value: each)].

   ^ newCollection 

 

Symbol value: anObject 

   ^anObject perform: self.

 

When /aBlock/ is a symbol, that symbol is performed on /each/ element.

And looking at  #select:  , yes it works the same... 

 

Collection >> select: aBlock 

   | newCollection |

   newCollection := self copyEmpty.

   self do: [ :each | 

  (aBlock value: each) 

 ifTrue: [ newCollection add: each 
]].

   ^newCollection

 

cheers -ben



[Pharo-users] Query on Pharo syntax

2018-09-10 Thread PBKResearch
Hi All

 

This is an idiot question, I should know the answer, but I have looked
around and can't find relevant documentation. I'm not asking for a full
answer, just a pointer as to where to start looking.

 

I have seen from examples in this forum that an expression like the
following:

 

paras collect: [para| para prettyPrinted]

 

can be written more concisely as:

 

paras collect: #prettyPrinted

 

which obviously works when I try it. It doesn't seem to fit in with the
definition of #collect:, which requires a block as argument. Where can I
find the relevant definition, either in method comments or in some general
manual? Can the notation be extended, for example to #select: - obviously
with an argument which returns a Boolean? Can it be used with a method which
requires an argument, e.g. as myArray collect: (#myMethod: arg)? Are there
any other extensions?

 

Any help gratefully received.

 

Peter Kenny

 



Re: [Pharo-users] ZnURL and parsing URL with diacritics

2018-09-10 Thread PBKResearch
Hi Petr

 

I have used #urlEncoded in the past, with success, to deal with German
umlauts. The secret is to urlEncode just the part containing the diacritics.
If you encode the whole url, the slashes are encoded, and this confuses
Zinc, which segments the url before decoding.

 

So I would expect you to be able to read your file with:

 

ZnEasy get: 'http://domain.com/','ěščýž.html' urlEncoded.

 

However, this also fails with 'ASCII character expected', and I can't
understand why. The debug trace has too many levels for me to understand.
Zinc is evidently getting in a mess trying to decode the urlEncoded string,
but if we try:

 

'ěščýž.html' urlEncoded urlDecoded

 

as a separate operation, it works OK.

 

I think only Sven can explain this for you.

 

HTH

 

Peter Kenny

 

 

From: Pharo-users  On Behalf Of Petr
Fischer via Pharo-users
Sent: 10 September 2018 10:07
To: pharo-users@lists.pharo.org
Cc: Petr Fischer 
Subject: [Pharo-users] ZnURL and parsing URL with diacritics

 

Hello, 

 

when I try to parse this URL asUrl, error "ZnCharacterEncodingError: ASCII
character expected" occurs:

 

'http://domain.com/ěščýž.html' asUrl.

 

this also does not work:

 

ZnEasy get: 'http://domain.com/ěščýž.html'

 

How to solve this? In the web browser, URL with diacritics is OK. 

 

I tried also this:

 

ZnEasy get: 'http://domain.com/ěščýž.html' urlEncoded.

 

but this cripples the whole URL.

 

Thanks! Petr Fischer

 



Re: [Pharo-users] Moose Java AST?

2018-07-31 Thread PBKResearch
Peter

 

How about PPJavaParser or SmaCC-Java?

 

Peter Kenny

 

From: Pharo-users  On Behalf Of Peter Uhnák
Sent: 31 July 2018 09:44
To: Any question about pharo is welcome ; 
Moose-related development 
Subject: [Pharo-users] Moose Java AST?

 

Hi,

 

is there a Java AST parser in Pharo?

 

I imagine that jdt2famix must have something inside, but as far as I 
understand, it just extracts some information from the source code and throws 
the AST away.

 

Thanks,

Peter



Re: [Pharo-users] OmniBase for Pharo 6

2018-07-28 Thread PBKResearch
Marco

Thanks again. I was apprehensive about using OmniBase for real. With all
green tests I am much happier.

Peter Kenny

-Original Message-
From: Pharo-users  On Behalf Of marco
Sent: 27 July 2018 14:51
To: pharo-users@lists.pharo.org
Subject: Re: [Pharo-users] OmniBase for Pharo 6

Peter,

yes, tested windows (10) and unix/linux (32-bit). It works, green light.

With the 2010 "fix" at least the garbage collection will not work on any OS.

The logic tries to lock the same file twice. 




--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html




Re: [Pharo-users] OmniBase for Pharo 6

2018-07-25 Thread PBKResearch
Marco

 

Thanks for this. Just for curiosity, did you test it just on Windows, or on
other OSs as well. The logic of the Dec 2010 fix was that David Gorisek’s
original, being developed on Dolphin, could not be guaranteed to work except
on Windows. I only use Windows, so it is just curiosity.

 

BTW, the author of the Dec 2010 fix, ‘sas’, is Sebastian Sastre, so
definitely ‘he’.

 

Peter Kenny

 

 

From: Pharo-users  On Behalf Of Matias
Maretto
Sent: 25 July 2018 13:34
To: Any question about pharo is welcome 
Subject: Re: [Pharo-users] OmniBase for Pharo 6

 

Marco: thank you for this. A few weeks ago when I was trying to find the
"lock" problem I saw this method but I did not dare to change it; and just
as you said I  been using OminBase with no problem, but never runned the
Garbage Collector, Surely I was going to have a bigger problem in the future
for not running the garbageCollect. 

 

I have just update this method on my project and tried both the
garbageCollect and the reorganize method , both worked fine (win 7 32bits,
later I am going to test on Win 10 64 bits).

 

Thanks again.

 

Matías.

 

 

  _  

De: Pharo-users mailto:pharo-users-boun...@lists.pharo.org> > en nombre de marco
mailto:ma...@omeleon.de> >
Enviado: miércoles, 25 de julio de 2018 10:23 a. m.
Para: pharo-users@lists.pharo.org  
Asunto: Re: [Pharo-users] OmniBase for Pharo 6 

 

One serious problem left: OmniBaseTest>>testGC fails.

Have a look at the 2 methods

/ODBContainer>>lockDataFile
"Dec, 2010 sas: this code was relying in evaluating a block that was
happening only in win32
but not in *nix. So now I'm making it wait for the lock and then execute
the code normally
because it seems the intention was the same."
| currentSpace defaultSpace |

activeDataFile waitForAddingLock.
currentSpace := activeDataFile == dataFileA ifTrue: [0] ifFalse: [1].
defaultSpace := objectManager defaultObjectSpace.
currentSpace == defaultSpace
ifFalse:
[defaultSpace == 0
ifTrue:
[dataFileA isNil ifTrue: [dataFileA := ODBObjectStorage
openOn: self dataFileNameA].
activeDataFile := dataFileA]
ifFalse:
[dataFileB isNil ifTrue: [dataFileB := ODBObjectStorage
openOn: self dataFileNameB].
activeDataFile := dataFileB].
^self lockDataFile]


ODBFile>>waitForLockAt: pos length: length whileWaitingDo: aBlock
"Wait for lock at given position.
Evaluate aBlock in each iteration."

"Dec, 2010. sas: evaluating code in each iteration while waiting sounds
weird but whatever.
I think this was designed on the wrong assumption that the OS always
will provide a false
in the first try but what actually happens is that in win32 you always
will
get at least one false but in *nixes you don't do see that happening
(which is totally reasonable).
BEWARE of stupid code relying on this stupid assumption (I've already
patched #lockDataFile because of this)."
   
| startTime currentTime |
(stream lockAt: pos length: length) ifFalse: [
startTime := Time totalSeconds.
[stream lockAt: pos length: length] whileFalse: [
aBlock value.
currentTime := Time totalSeconds.
currentTime - startTime < self timeOutLength
ifFalse: [
ODBLockNotification signal
ifTrue: [startTime := currentTime]
ifFalse: [^ODBCannotLock signal
/

So "sas" did a refactoring in 2010 because he/she thought it is stupid code.
This code change breaks the GarbageCollection of Omnibase.

I reverted the first method to the original code of the Omnibase author,
David Gorisek:

/lockDataFile

| currentSpace defaultSpace |

activeDataFile waitForAddingLockWhileWaitingDo:
[currentSpace := activeDataFile == dataFileA ifTrue: [0] ifFalse: [1].
defaultSpace := objectManager defaultObjectSpace.
currentSpace == defaultSpace
ifFalse:
[defaultSpace == 0
ifTrue:
[dataFileA isNil ifTrue: [dataFileA := ODBObjectStorage
openOn: self dataFileNameA].
activeDataFile := dataFileA]
ifFalse:
[dataFileB isNil ifTrue: [dataFileB := ODBObjectStorage
openOn: self dataFileNameB].
activeDataFile := dataFileB].
^self lockDataFile]]
/ 
I removed the comment of "sas" from the second method. It is wrong.


The garbage collection works again and the test is green. GC is an important
feature of Omnibase.
It creates a new repository/database file and copies the data into the new
file, compressing the data.
It keeps your database compact and clean. If you don't run it (frequently)
your db files keep on growing...  

Matias, your fixes are absolutely valid and should be published - together
with the 

Re: [Pharo-users] NeoJSON sorting instance variables/properties

2018-07-25 Thread PBKResearch
Just as a comment to Henrik, NeoJSON will already preserve the order of an
OrderedDictionary. When working with Stef on the HTML scraping booklet, I
decided to find a way to preserve the order of the selected items, partly
for aesthetic reasons, but mainly to demonstrate that the output matched the
problem specification. I switched the collection of the output items to an
OrderedDictionary, not knowing whether it would work, and it came out as
expected. Building an OrderedDictionary of just the required instvars would
solve both the OP's problems, though perhaps less elegantly.

Peter Kenny

-Original Message-
From: Pharo-users  On Behalf Of Sven
Van Caekenberghe
Sent: 25 July 2018 17:49
To: Any question about pharo is welcome 
Subject: Re: [Pharo-users] NeoJSON sorting instance variables/properties



> On 25 Jul 2018, at 17:54, Henrik-Nergaard  wrote:
> 
> Hi Peter,
> 
> This functionallity is already available in STON where it preserves 
> the order when you use an OrderedDictionary.
> And was implemented for the usecase of dealing with fileout and
versioning.
> Perhaps the same could be added to NeoJson so that instead of some 
> magic flag you provide an OrderedDictionary sorted as you would like 
> and it would then preserve the order.

You are right, using OrderedDictionaries would fix the order. 

But I don't think that is what he wants: to fix the order of arbitrary
objects being mapped.

Even in STON the order of properties of objects is undefined (as it is in
JSON).

> If you aim to use it to preserve metada for filetree then there is a 
> patch for that which can be found at 
> https://github.com/DraagrenKirneh/PharoUtilities/tree/master/FileTreeF
> ix
> 
> Best regards,
> Henrik
> 
> 
> 
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
> 





Re: [Pharo-users] Pharo 6 Freetype plugin stopped working after Windows update

2018-07-14 Thread PBKResearch
More specifically, it was suggested (by Herby, I think) that it is a timing 
problem with Windows loading several .dll files at the same time. If the loads 
complete in the right order, all is well; but in some cases, loading one .dll 
takes a bit longer, and it is not available when called by another. If correct, 
this explains why it happens intermittently. It also explains why it is so 
difficult to debug.

 

Peter Kenny

 

From: Pharo-users  On Behalf Of Peter Uhnák
Sent: 14 July 2018 22:31
To: Any question about pharo is welcome 
Subject: Re: [Pharo-users] Pharo 6 Freetype plugin stopped working after 
Windows update

 

This is not FT plugin problem. This is Windows failing to load a proper dll for 
Pharo. Happens regularly at least with FT and Cairo.

 

Peter

 

On Fri, Jul 13, 2018 at 10:00 AM, webwarrior mailto:r...@webwarrior.ws> > wrote:

Peter Kenny wrote
> Hello
> 
> This seems exactly like a problem I reported almost exactly a year ago -
> 15 July 2017. Peter Uhnak reported then that he saw it regularly. The only
> sure remedy we found is to reboot the machine - occasionally reboot twice.
> I am using Pharo 6.1 on Windows 10. Since that report, I have seen it very
> rarely. Most recently I found that the Pharo window appearance was
> distorted - wrong font size etc - but I did not see the debug console
> error message.
> 
> Advice to Webwarrior - reboot machine and see if it goes away.
> 
> HTH
> 
> Peter Kenny

Rebooted, and the problem did go away.




--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html

 



Re: [Pharo-users] Pharo 6 Freetype plugin stopped working after Windows update

2018-07-12 Thread PBKResearch
Hello

This seems exactly like a problem I reported almost exactly a year ago - 15 
July 2017. Peter Uhnak reported then that he saw it regularly. The only sure 
remedy we found is to reboot the machine - occasionally reboot twice. I am 
using Pharo 6.1 on Windows 10. Since that report, I have seen it very rarely. 
Most recently I found that the Pharo window appearance was distorted - wrong 
font size etc - but I did not see the debug console error message.

Advice to Webwarrior - reboot machine and see if it goes away.

HTH

Peter Kenny

-Original Message-
From: Pharo-users  On Behalf Of Ben Coman
Sent: 12 July 2018 22:20
To: Any question about pharo is welcome 
Subject: Re: [Pharo-users] Pharo 6 Freetype plugin stopped working after 
Windows update

Seems similar...
http://forum.world.st/Win10-Launcher-Pharo7-1122-ZdcPluginMissing-SSL-TLS-plugin-initailization-failed-VM-plugin-missing-O-tp5081539p5081573.html

cheers -ben

On 13 July 2018 at 03:09, webwarrior  wrote:
> LoadLibrary(FT2Plugin.dll) (998: Invalid access to memory location.
>
> )
>
> Windows 10.
>
> Win32 built on May 31 2017 03:09:04 GMT Compiler: 5.4.0 VMMaker 
> versionString VM: 201705310241
>
> Tried latest stable VM - same error.
>
> Pharo 7 works normally.
>
>
>
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>




Re: [Pharo-users] XML support for pharo

2018-07-12 Thread PBKResearch
Hi Oswall

 

Well, you have located the correct node, which is some kind of XMLNode, so
all you need is to access its content. If you browse the class and look at
its ‘accessing’ protocol, you see the method XMLNode>>#contentString, which
will give you, in your test case, ‘2014’ as a string. If you want to enter
it in the database as a number, asNumber will do that’

 

HTH

 

Peter Kenny

 

From: Pharo-users  On Behalf Of oswall
arguedas
Sent: 12 July 2018 18:35
To: 'Any question about pharo is welcome' 
Subject: Re: [Pharo-users] XML support for pharo

 

Hello Peter,

Thanks for your help.

 

The value I get is:

  2014 

 

What I need is to extract the atomic value of the node, which is:

 

 2014

 

To assign it to variables and create objects. I can not find how to obtain
that punctual value 2014.

 

The main purpose is to read many xml files and create smalltak objects with
that data, then save them in DB and process the data.

  _  

De: Pharo-users mailto:pharo-users-boun...@lists.pharo.org> > en nombre de PBKResearch
mailto:pe...@pbkresearch.co.uk> >
Enviado: jueves, 12 de julio de 2018 11:17:41
Para: 'Any question about pharo is welcome'
Asunto: Re: [Pharo-users] XML support for pharo 

 

Hi Oswall

 

What sort of failure did you get? It helps with this sort of thing to
execute the code in a playground and inspect the result. 

 

One thing you need to know is that the result of xpath is almost always some
sort of XMLCollection, even when there is only one element. I would expect
the result you want if you write yearmem := (tree xpath:
‘cardset/card/year’) first.

 

Note that you should not need a slash at the start; xpath starts searching
in the children of the top node.

 

Also you do not need to give every step of the hierarchy; you can always
skip levels provided the result specifies a unique route to the node you
want. So in this case you can write:

 

yearmem := (tree xpath: ‘//year’) first.

 

Hope this helps

 

Peter Kenny

 

From: Pharo-users mailto:pharo-users-boun...@lists.pharo.org> > On Behalf Of oswall arguedas
Sent: 12 July 2018 17:09
To: pharo-users@lists.pharo.org <mailto:pharo-users@lists.pharo.org> 
Subject: Re: [Pharo-users] XML support for pharo

 

Regards,

I practice with the example of the book. I can not read the atomic values of
the nodes.

For example, with this piece of the example:

 



 

  Arcane Lighthouse 

  Land 

  2014 

 

To get the atomic value of the node year and assign it to the variable
yearmem, I do it like this:

 

yearmem: = tree xpath: '/ cardset / card / year'.

 

But it fails. How do I get the 2014 value?

 

Thank you

Oswall

 

  _  

De: Pharo-users mailto:pharo-users-boun...@lists.pharo.org> > en nombre de oswall arguedas
mailto:oswal...@hotmail.com> >
Enviado: miércoles, 11 de julio de 2018 20:17:55
Para: pharo-users@lists.pharo.org <mailto:pharo-users@lists.pharo.org> 
Asunto: Re: [Pharo-users] XML support for pharo 

 

Thanks Franz and Monty. I'm working on it, everything is going very well.

The feedback when I master it.

 

Oswall

 

 

  _  

De: Pharo-users mailto:pharo-users-boun...@lists.pharo.org> > en nombre de monty
mailto:mon...@programmer.net> >
Enviado: miércoles, 11 de julio de 2018 03:32
Para: pharo-users@lists.pharo.org <mailto:pharo-users@lists.pharo.org> 
Asunto: Re: [Pharo-users] XML support for pharo 

 

This is the latest version of the XML/XPath Scraping Booklet:
<https://files.pharo.org/books-pdfs/booklet-Scraping/2018-01-07-scrapingbook
.pdf> 


 
<https://files.pharo.org/books-pdfs/booklet-Scraping/2018-01-07-scrapingbook
.pdf> Scraping HTML with XPath - files.pharo.org

files.pharo.org

1.6 Alargeexample •
Siblings.Siblingsarechildnodesthathavethesameparent.Thecard-name,types,year,
rarity,expansionandcardtextelementsareallsib-




___
montyos.wordpress.com



Re: [Pharo-users] XML support for pharo

2018-07-12 Thread PBKResearch
Hi Oswall

 

What sort of failure did you get? It helps with this sort of thing to
execute the code in a playground and inspect the result. 

 

One thing you need to know is that the result of xpath is almost always some
sort of XMLCollection, even when there is only one element. I would expect
the result you want if you write yearmem := (tree xpath:
‘cardset/card/year’) first.

 

Note that you should not need a slash at the start; xpath starts searching
in the children of the top node.

 

Also you do not need to give every step of the hierarchy; you can always
skip levels provided the result specifies a unique route to the node you
want. So in this case you can write:

 

yearmem := (tree xpath: ‘//year’) first.

 

Hope this helps

 

Peter Kenny

 

From: Pharo-users  On Behalf Of oswall
arguedas
Sent: 12 July 2018 17:09
To: pharo-users@lists.pharo.org
Subject: Re: [Pharo-users] XML support for pharo

 

Regards,

I practice with the example of the book. I can not read the atomic values of
the nodes.

For example, with this piece of the example:

 



 

  Arcane Lighthouse 

  Land 

  2014 

 

To get the atomic value of the node year and assign it to the variable
yearmem, I do it like this:

 

yearmem: = tree xpath: '/ cardset / card / year'.

 

But it fails. How do I get the 2014 value?

 

Thank you

Oswall

 

  _  

De: Pharo-users mailto:pharo-users-boun...@lists.pharo.org> > en nombre de oswall arguedas
mailto:oswal...@hotmail.com> >
Enviado: miércoles, 11 de julio de 2018 20:17:55
Para: pharo-users@lists.pharo.org  
Asunto: Re: [Pharo-users] XML support for pharo 

 

Thanks Franz and Monty. I'm working on it, everything is going very well.

The feedback when I master it.

 

Oswall

 

 

  _  

De: Pharo-users mailto:pharo-users-boun...@lists.pharo.org> > en nombre de monty
mailto:mon...@programmer.net> >
Enviado: miércoles, 11 de julio de 2018 03:32
Para: pharo-users@lists.pharo.org  
Asunto: Re: [Pharo-users] XML support for pharo 

 

This is the latest version of the XML/XPath Scraping Booklet:
 


 
 Scraping HTML with XPath - files.pharo.org

files.pharo.org

1.6 Alargeexample •
Siblings.Siblingsarechildnodesthathavethesameparent.Thecard-name,types,year,
rarity,expansionandcardtextelementsareallsib-




___
montyos.wordpress.com



Re: [Pharo-users] OmniBase for Pharo 6

2018-06-25 Thread PBKResearch
Todd

 

Many thanks for these useful pointers – I had thought of asking you for a hint 
of where problems can occur, but you beat me to it. At present I am just 
playing, to get the feel of what it can do, but when it gets to real data I 
will consider defensive measures – backups and change logs, for example.

 

The application I am considering involves reading and storing quite large 
documents, which are input as XML. Presumably it would be safer to store the 
XML in the database. Similarly, with other complex objects, we could consider a 
hybrid system in which objects are serialized with some other mechanism, e.g. 
STON, and OmniBase is just used to store and manage them. All speculation until 
we try it out.

 

Thanks again

 

Peter Kenny

 

From: Pharo-users  On Behalf Of Todd 
Blanchard
Sent: 25 June 2018 07:31
To: Any question about pharo is welcome 
Subject: Re: [Pharo-users] OmniBase for Pharo 6

 

I will just add that the failures I was experiencing involved storing 
"documents" with deep hierarchies of heterogeneous items.  Something along the 
lines of EMR's (electronic medical records - which if you have any experience 
in that domain - are very complex).

 

The failures would manifest as randomly thrown exceptions while trying to read 
a particularly large and complex hierarchy - which would result in documents 
missing segments when rendered.  Rescuing the data took a couple weeks of 
constantly trying to read smaller chunks and retrying when exceptions were 
thrown.

 

So I would include tests along those lines before trusting it with important 
data.  The database I was working with was quite large when reads began to fail.

 

On Jun 24, 2018, at 3:33 PM, Matias Maretto mailto:mgmare...@hotmail.com> > wrote:

 

Thank you for the info Peter ; I have been working storing and retrieving data 
, everything works fine. I have an ODBPErsistDictionary with almost 20.000 
objects on it, I really get sorprised of how fast can resolve "select:[] 
commands"; I know it is not related with the subjet we are working, but well 

 

 

 


  _  


De: Pharo-users mailto:pharo-users-boun...@lists.pharo.org> > en nombre de PBKResearch 
mailto:pe...@pbkresearch.co.uk> >
Enviado: domingo, 24 de junio de 2018 05:54 p. m.
Para: 'Any question about pharo is welcome'
Asunto: Re: [Pharo-users] OmniBase for Pharo 6

 

Hi Matias (and EstebanLM)

 

I have explained the problem with storing and retrieving Date. Looking through 
the OmniBase code in the repository, I see that there is a whole series of 
extensions for many of the standard classes, which provide methods for 
serializing and deserializing instances of those classes. The extension for 
Date class ignores the start time, and simply saves the day number; the 
retrieval method can only use the days, and so cannot take account of the 
offset for the time zone. If it is necessary to save and restore dates in a way 
which is time-zone sensitive, it will be necessary to modify the code for 
serializing dates to store day and offset. I have not yet worked out how the 
methods are structured, so I have not tried to recode, but all the methods I 
have looked at are only one or two lines, so it should not be difficult.

 

Looking through the classes with extensions, I realise that we may need to 
check rather more examples to be sure that everything is handled correctly. I 
did one little test with String. The standard test in TestEquality just stores 
and retrieves ‘Hello World’. To check that it could handle other encodings, I 
tried the test with a German string encoded in utf8. This worked OK. So thus 
far everything is fine, but it would be a good idea to check correct retrieval 
each time we persist a new class of object.

 

Best wishes

 

Peter Kenny

 

From: Pharo-users mailto:pharo-users-boun...@lists.pharo.org> > On Behalf Of Matias Maretto
Sent: 23 June 2018 19:40
To: Any question about pharo is welcome mailto:pharo-users@lists.pharo.org> >
Subject: Re: [Pharo-users] OmniBase for Pharo 6

 

Hi Peter, thanks for the news. I have been doing some tests, persisting 
diferent kind of objects and until now everythings works fine.

If you find anything else, please let me now.

 

Thanks.

Matias.

 

 


  _  


De: Pharo-users mailto:pharo-users-boun...@lists.pharo.org> > en nombre de PBKResearch 
mailto:pe...@pbkresearch.co.uk> >
Enviado: sábado, 23 de junio de 2018 05:18 p. m.
Para: 'Any question about pharo is welcome'
Asunto: Re: [Pharo-users] OmniBase for Pharo 6

 

Hi Matias

 

A further report. I have worked through the test suite in OmniBaseTests, 
running each test individually. I now have all green except two – testEquality, 
which fails on the storage and retrieval of ‘Date today’, and testGC, which 
fails for reasons I have not yet found.

 

The worrying thing is the apparent change in the instance variables of Date – 
see my exchange with Alistair

Re: [Pharo-users] OmniBase for Pharo 6

2018-06-24 Thread PBKResearch
Matias

 

Thanks for your report. Since it is working so well for you, I think it is time 
for me to give up working on the test suite and start using it for real. That 
will be for tomorrow (it’s almost midnight here now!).

 

I have realised, by the way, that there is an easy work round for the Date 
problem. If you need to persist a Date with full time-zone consistency, just 
apply ‘start’ to it, which gives a DateAndTime. This will be stored and 
retrieved correctly. When it has been retrieved, just send asDate  to recover 
the correct date.

 

Best wishes

 

Peter Kenny

 

From: Pharo-users  On Behalf Of Matias 
Maretto
Sent: 24 June 2018 23:33
To: Any question about pharo is welcome 
Subject: Re: [Pharo-users] OmniBase for Pharo 6

 

Thank you for the info Peter ; I have been working storing and retrieving data 
, everything works fine. I have an ODBPErsistDictionary with almost 20.000 
objects on it, I really get sorprised of how fast can resolve "select:[] 
commands"; I know it is not related with the subjet we are working, but well  

 

 

 

  _  

De: Pharo-users mailto:pharo-users-boun...@lists.pharo.org> > en nombre de PBKResearch 
mailto:pe...@pbkresearch.co.uk> >
Enviado: domingo, 24 de junio de 2018 05:54 p. m.
Para: 'Any question about pharo is welcome'
Asunto: Re: [Pharo-users] OmniBase for Pharo 6 

 

Hi Matias (and EstebanLM)

 

I have explained the problem with storing and retrieving Date. Looking through 
the OmniBase code in the repository, I see that there is a whole series of 
extensions for many of the standard classes, which provide methods for 
serializing and deserializing instances of those classes. The extension for 
Date class ignores the start time, and simply saves the day number; the 
retrieval method can only use the days, and so cannot take account of the 
offset for the time zone. If it is necessary to save and restore dates in a way 
which is time-zone sensitive, it will be necessary to modify the code for 
serializing dates to store day and offset. I have not yet worked out how the 
methods are structured, so I have not tried to recode, but all the methods I 
have looked at are only one or two lines, so it should not be difficult.

 

Looking through the classes with extensions, I realise that we may need to 
check rather more examples to be sure that everything is handled correctly. I 
did one little test with String. The standard test in TestEquality just stores 
and retrieves ‘Hello World’. To check that it could handle other encodings, I 
tried the test with a German string encoded in utf8. This worked OK. So thus 
far everything is fine, but it would be a good idea to check correct retrieval 
each time we persist a new class of object.

 

Best wishes

 

Peter Kenny

 

From: Pharo-users mailto:pharo-users-boun...@lists.pharo.org> > On Behalf Of Matias Maretto
Sent: 23 June 2018 19:40
To: Any question about pharo is welcome mailto:pharo-users@lists.pharo.org> >
Subject: Re: [Pharo-users] OmniBase for Pharo 6

 

Hi Peter, thanks for the news. I have been doing some tests, persisting 
diferent kind of objects and until now everythings works fine.

If you find anything else, please let me now.

 

Thanks.

Matias.

 

 

  _  

De: Pharo-users mailto:pharo-users-boun...@lists.pharo.org> > en nombre de PBKResearch 
mailto:pe...@pbkresearch.co.uk> >
Enviado: sábado, 23 de junio de 2018 05:18 p. m.
Para: 'Any question about pharo is welcome'
Asunto: Re: [Pharo-users] OmniBase for Pharo 6 

 

Hi Matias

 

A further report. I have worked through the test suite in OmniBaseTests, 
running each test individually. I now have all green except two – testEquality, 
which fails on the storage and retrieval of ‘Date today’, and testGC, which 
fails for reasons I have not yet found.

 

The worrying thing is the apparent change in the instance variables of Date – 
see my exchange with Alistair Grant in another thread. I shall try to work 
through the way OmniBase saves and resets the instvars, just in case it might 
be a general problem.

 

I shall let you know of anything else I find.

 

Peter Kenny

 

From: Pharo-users mailto:pharo-users-boun...@lists.pharo.org> > On Behalf Of PBKResearch
Sent: 23 June 2018 09:18
To: 'Any question about pharo is welcome' mailto:pharo-users@lists.pharo.org> >
Subject: Re: [Pharo-users] OmniBase for Pharo 6

 

Matias

 

Thanks. I have made this change, but it does not affect the tests I have run.

 

I have focused on getting the test suite in OmniBaseTests to run. So far I 
still have 5 greens, 7 reds and one orange. The greens are all the first five 
test methods in the browser list; it seems it half fails on the sixth one 
(TestEquality), hence the orange, and then red for all the rest.

 

One problem is that the test database is created at the start of the test 
suite, and then not removed at the end. This seems to mess up the next attempt 
to run the t

Re: [Pharo-users] OmniBase for Pharo 6

2018-06-24 Thread PBKResearch
Hi Matias (and EstebanLM)

 

I have explained the problem with storing and retrieving Date. Looking
through the OmniBase code in the repository, I see that there is a whole
series of extensions for many of the standard classes, which provide methods
for serializing and deserializing instances of those classes. The extension
for Date class ignores the start time, and simply saves the day number; the
retrieval method can only use the days, and so cannot take account of the
offset for the time zone. If it is necessary to save and restore dates in a
way which is time-zone sensitive, it will be necessary to modify the code
for serializing dates to store day and offset. I have not yet worked out how
the methods are structured, so I have not tried to recode, but all the
methods I have looked at are only one or two lines, so it should not be
difficult.

 

Looking through the classes with extensions, I realise that we may need to
check rather more examples to be sure that everything is handled correctly.
I did one little test with String. The standard test in TestEquality just
stores and retrieves ‘Hello World’. To check that it could handle other
encodings, I tried the test with a German string encoded in utf8. This
worked OK. So thus far everything is fine, but it would be a good idea to
check correct retrieval each time we persist a new class of object.

 

Best wishes

 

Peter Kenny

 

From: Pharo-users  On Behalf Of Matias
Maretto
Sent: 23 June 2018 19:40
To: Any question about pharo is welcome 
Subject: Re: [Pharo-users] OmniBase for Pharo 6

 

Hi Peter, thanks for the news. I have been doing some tests, persisting
diferent kind of objects and until now everythings works fine.

If you find anything else, please let me now.

 

Thanks.

Matias.

 

 

  _  

De: Pharo-users mailto:pharo-users-boun...@lists.pharo.org> > en nombre de PBKResearch
mailto:pe...@pbkresearch.co.uk> >
Enviado: sábado, 23 de junio de 2018 05:18 p. m.
Para: 'Any question about pharo is welcome'
Asunto: Re: [Pharo-users] OmniBase for Pharo 6 

 

Hi Matias

 

A further report. I have worked through the test suite in OmniBaseTests,
running each test individually. I now have all green except two –
testEquality, which fails on the storage and retrieval of ‘Date today’, and
testGC, which fails for reasons I have not yet found.

 

The worrying thing is the apparent change in the instance variables of Date
– see my exchange with Alistair Grant in another thread. I shall try to work
through the way OmniBase saves and resets the instvars, just in case it
might be a general problem.

 

I shall let you know of anything else I find.

 

Peter Kenny

 

From: Pharo-users mailto:pharo-users-boun...@lists.pharo.org> > On Behalf Of PBKResearch
Sent: 23 June 2018 09:18
To: 'Any question about pharo is welcome' mailto:pharo-users@lists.pharo.org> >
Subject: Re: [Pharo-users] OmniBase for Pharo 6

 

Matias

 

Thanks. I have made this change, but it does not affect the tests I have
run.

 

I have focused on getting the test suite in OmniBaseTests to run. So far I
still have 5 greens, 7 reds and one orange. The greens are all the first
five test methods in the browser list; it seems it half fails on the sixth
one (TestEquality), hence the orange, and then red for all the rest.

 

One problem is that the test database is created at the start of the test
suite, and then not removed at the end. This seems to mess up the next
attempt to run the tests. I tried to run the OmniBaseTests>>#tearDown
manually, but it fails, so I have to exit Pharo and delete the test database
in Windows.

 

I intend to continue running the test suite, but I shall run the tests
individually, and put breakpoints in those that fail. I shall report here if
I make any progress.

 

Best wishes

 

Peter Kenny

 

From: Pharo-users mailto:pharo-users-boun...@lists.pharo.org> > On Behalf Of Matias Maretto
Sent: 23 June 2018 01:37
To: Any question about pharo is welcome mailto:pharo-users@lists.pharo.org> >
Subject: Re: [Pharo-users] OmniBase for Pharo 6

 

Peter: I think I found the problem. On ODBFileStream class >>
accessModeReadOnly the "o" on "only" is not capital. It is
^#accessModeReadonly  when should be ^#accessModeReadOnly ; so on the
ODBWin32FileStream >> createOn:  createMode:  accessMode:  shareMode:
cacheMode:  this part fails:

accessMode = #accessModeReadOnly ifTrue: [acMode := 2147483648
"GENERIC_READ"].

So it cant open the users file for read.  I have fix it and at least for now
I didn't get any "block" error. 

 

 

 

  _  

De: Pharo-users mailto:pharo-users-boun...@lists.pharo.org> > en nombre de PBKResearch
mailto:pe...@pbkresearch.co.uk> >
Enviado: viernes, 22 de junio de 2018 10:39 p. m.
Para: 'Any question about pharo is welcome'
Asunto: Re: [Pharo-users] OmniBase for Pharo 6 

 

Matias

 

Thanks for the hints. I now have 5 greens, b

Re: [Pharo-users] OmniBase for Pharo 6

2018-06-23 Thread PBKResearch
Hi Matias

 

A further report. I have worked through the test suite in OmniBaseTests,
running each test individually. I now have all green except two -
testEquality, which fails on the storage and retrieval of 'Date today', and
testGC, which fails for reasons I have not yet found.

 

The worrying thing is the apparent change in the instance variables of Date
- see my exchange with Alistair Grant in another thread. I shall try to work
through the way OmniBase saves and resets the instvars, just in case it
might be a general problem.

 

I shall let you know of anything else I find.

 

Peter Kenny

 

From: Pharo-users  On Behalf Of
PBKResearch
Sent: 23 June 2018 09:18
To: 'Any question about pharo is welcome' 
Subject: Re: [Pharo-users] OmniBase for Pharo 6

 

Matias

 

Thanks. I have made this change, but it does not affect the tests I have
run.

 

I have focused on getting the test suite in OmniBaseTests to run. So far I
still have 5 greens, 7 reds and one orange. The greens are all the first
five test methods in the browser list; it seems it half fails on the sixth
one (TestEquality), hence the orange, and then red for all the rest.

 

One problem is that the test database is created at the start of the test
suite, and then not removed at the end. This seems to mess up the next
attempt to run the tests. I tried to run the OmniBaseTests>>#tearDown
manually, but it fails, so I have to exit Pharo and delete the test database
in Windows.

 

I intend to continue running the test suite, but I shall run the tests
individually, and put breakpoints in those that fail. I shall report here if
I make any progress.

 

Best wishes

 

Peter Kenny

 

From: Pharo-users mailto:pharo-users-boun...@lists.pharo.org> > On Behalf Of Matias Maretto
Sent: 23 June 2018 01:37
To: Any question about pharo is welcome mailto:pharo-users@lists.pharo.org> >
Subject: Re: [Pharo-users] OmniBase for Pharo 6

 

Peter: I think I found the problem. On ODBFileStream class >>
accessModeReadOnly the "o" on "only" is not capital. It is
^#accessModeReadonly  when should be ^#accessModeReadOnly ; so on the
ODBWin32FileStream >> createOn:  createMode:  accessMode:  shareMode:
cacheMode:  this part fails:

accessMode = #accessModeReadOnly ifTrue: [acMode := 2147483648
"GENERIC_READ"].

So it cant open the users file for read.  I have fix it and at least for now
I didn't get any "block" error. 

 

 

 

  _  

De: Pharo-users mailto:pharo-users-boun...@lists.pharo.org> > en nombre de PBKResearch
mailto:pe...@pbkresearch.co.uk> >
Enviado: viernes, 22 de junio de 2018 10:39 p. m.
Para: 'Any question about pharo is welcome'
Asunto: Re: [Pharo-users] OmniBase for Pharo 6 

 

Matias

 

Thanks for the hints. I now have 5 greens, but all the rest are red. I am
still getting the 'File cannot be locked' message. Are you doing better than
that? I may try a few trials using it for real, rather than the test suite.

 

Thanks again

 

Peter Kenny

 

From: Pharo-users mailto:pharo-users-boun...@lists.pharo.org> > On Behalf Of Matias Maretto
Sent: 22 June 2018 22:54
To: Any question about pharo is welcome mailto:pharo-users@lists.pharo.org> >
Subject: Re: [Pharo-users] OmniBase for Pharo 6

 

Hi Peter, yes I had the same error at the beginning. I have done 2 minor
changes. Now it seems to be working fine (Although I am still running more
tests). Here: 

 

ODBWin32FileStream >> 

closeHandle: aHandle

"Close an open Win32 object handle, freeing any resources held by it.

Once closed a handle is no longer valid. Answer whether the function

succeeds.

See Win32 SDK help for more information.

 

BOOL CloseHandle(

HANDLE  hObject 

// handle of object to close  

);"

 

""

^ self ffiCall: #(ulong CloseHandle(long aHandle))

 

 

 

ODBWin32FileStream >> 

lockFile: aHandle offsetLow: loPos offsetHigh: hiPos lengthLow: loLength
lengthHigh: hiLength

""

 

^ self

ffiCall: #(long LockFile #(long aHandle , ulong loPos , ulong hiPos , ulong
loLength , ulong hiLength))

 

 

 

  _  

De: Pharo-users mailto:pharo-users-boun...@lists.pharo.org> > en nombre de PBKResearch
mailto:pe...@pbkresearch.co.uk> >
Enviado: viernes, 22 de junio de 2018 09:45 p. m.
Para: 'Any question about pharo is welcome'
Asunto: Re: [Pharo-users] OmniBase for Pharo 6 

 

Matias

 

I have just loaded Esteban's package in a new Pharo 6.1 under Windows 10. I
get an error message saying 'File cannot be locked. Try again?'. When I
select 'no', all tests are run and give red. Are you still running on win 7?
If so, I must be doing something wrong. Can you give more details of the FFI
corrections you made, please?

 

Many thanks

 

Peter Kenny

 

From: Pharo-users mailto:pharo-users-boun...@lists.pharo.org> > On Behalf Of Matias Maretto
Sent: 22 June 2018 21:07
To: Any question about pharo is welcome mailto:pharo

Re: [Pharo-users] Strange Result - OmniBase bug or Date feature?

2018-06-23 Thread PBKResearch
Hi Alistair

I am not trying to compare dates, I just want to be sure that OmniBase stores 
and retrieves dates without altering them. I have done further tests which show 
that this is not so. By looking at the start time, I find that the original 
date for today starts at 00:00:00 BST (as it should in London!), whereas after 
storing and retrieving by OmniBase it starts at 00:00:00 UTC (or GMT), i.e. it 
has shifted by an hour. This is not very important in itself, but it is 
worrying that OmniBase can change things. It may be a quirk of the way Date is 
handled by OmniBase, but it needs further investigation.

I can see I shall have endless fun probing how OmniBase stores and retrieves 
instance variables - luckily I did not have anything major planned for the 
weekend! Or else I should just follow Todd's advice.

Peter Kenny

-Original Message-
From: Pharo-users  On Behalf Of Alistair 
Grant
Sent: 23 June 2018 17:15
To: Pharo-Users 
Subject: Re: [Pharo-users] Strange Result - OmniBase bug or Date feature?

Hi Peter,

On Sat, 23 Jun 2018 at 17:47, PBKResearch  wrote:
>
> Hello All
>
>
>
> I am experimenting with the version of OmniBase which Esteban 
> Lorenzano posted a few days ago. With corrections posted by Matias 
> Moretto, who is working on the same track, I have got the first five 
> tests all green. On the sixth test, OmniBaseTest>>#testEquality, I 
> have run into a strange failure. I don’t know whether it shows that 
> OmniBase is not recovering data correctly, or whether it is a feature 
> of the way Date is implemented in Pharo. (I still have Dolphin 6 on my 
> machine, including OmniBase, and there the same test passes.)
>
>
>
> The test simply constructs a collection of various types of object, stores 
> the whole collection on the database, retrieves it and compares each 
> retrieved element with the corresponding element of the original collection. 
> One element is obtained by evaluating ‘Date today’, and that is the one that 
> fails. The test failure description is: ‘Got 23 June 2018 instead of 23 June 
> 2018.’ Using the inspector, I can see that the retrieved date differs from 
> the original in that the instvar ‘start’ has a Julian Day Number which is one 
> greater, but seconds as zero instead of 82800 and an offset of zero instead 
> of 1:00:00. In fact 82800 seconds is 23 hours, so all these add up to the 
> same start time, just differently represented.
>
>
>
> To get round the failure, I changed the constructor of the test collection to 
> use ‘Date today printString’, which of course meant it worked perfectly. My 
> worry is whether in some other context the change of the innards of the 
> object might have an adverse effect. I don’t understand why the Date 
> constructor represents the start of today as 23 hours after 1 a.m. yesterday. 
> Is the change something OmniBase has done in storing and retrieving, or is it 
> due to the way the Date is reconstructed?

A Date in Pharo is a 24 hour period and thus the timezone is important, e.g. 
the start of 23 Jun in London is not the same as 23 Jun in Melbourne.

If you want to compare the date using day / month / year and not as a
24 hour period, try using #equals: instead of #=.

HTH,
Alistair




[Pharo-users] Strange Result - OmniBase bug or Date feature?

2018-06-23 Thread PBKResearch
Retransmit with additional information: All tests with Windows 10 with all
recent updates

 

Hello All

 

I am experimenting with the version of OmniBase which Esteban Lorenzano
posted a few days ago. With corrections posted by Matias Moretto, who is
working on the same track, I have got the first five tests all green. On the
sixth test, OmniBaseTest>>#testEquality, I have run into a strange failure.
I don't know whether it shows that OmniBase is not recovering data
correctly, or whether it is a feature of the way Date is implemented in
Pharo. (I still have Dolphin 6 on my machine, including OmniBase, and there
the same test passes.)

 

The test simply constructs a collection of various types of object, stores
the whole collection on the database, retrieves it and compares each
retrieved element with the corresponding element of the original collection.
One element is obtained by evaluating 'Date today', and that is the one that
fails. The test failure description is: 'Got 23 June 2018 instead of 23 June
2018.' Using the inspector, I can see that the retrieved date differs from
the original in that the instvar 'start' has a Julian Day Number which is
one greater, but seconds as zero instead of 82800 and an offset of zero
instead of 1:00:00. In fact 82800 seconds is 23 hours, so all these add up
to the same start time, just differently represented.

 

To get round the failure, I changed the constructor of the test collection
to use 'Date today printString', which of course meant it worked perfectly.
My worry is whether in some other context the change of the innards of the
object might have an adverse effect. I don't understand why the Date
constructor represents the start of today as 23 hours after 1 a.m.
yesterday. Is the change something OmniBase has done in storing and
retrieving, or is it due to the way the Date is reconstructed?

 

Just for fun, I used Fuel to serialize and re-materialize Date today; it did
not make any changes.

 

Does this reinforce Todd's suggestion that OmniBase is not reliable, or is
it just a quirk?

 

Any ideas gratefully received

 

Peter Kenny

 



[Pharo-users] Strange Result - OmniBase bug or Date feature?

2018-06-23 Thread PBKResearch
Hello All

 

I am experimenting with the version of OmniBase which Esteban Lorenzano
posted a few days ago. With corrections posted by Matias Moretto, who is
working on the same track, I have got the first five tests all green. On the
sixth test, OmniBaseTest>>#testEquality, I have run into a strange failure.
I don't know whether it shows that OmniBase is not recovering data
correctly, or whether it is a feature of the way Date is implemented in
Pharo. (I still have Dolphin 6 on my machine, including OmniBase, and there
the same test passes.)

 

The test simply constructs a collection of various types of object, stores
the whole collection on the database, retrieves it and compares each
retrieved element with the corresponding element of the original collection.
One element is obtained by evaluating 'Date today', and that is the one that
fails. The test failure description is: 'Got 23 June 2018 instead of 23 June
2018.' Using the inspector, I can see that the retrieved date differs from
the original in that the instvar 'start' has a Julian Day Number which is
one greater, but seconds as zero instead of 82800 and an offset of zero
instead of 1:00:00. In fact 82800 seconds is 23 hours, so all these add up
to the same start time, just differently represented.

 

To get round the failure, I changed the constructor of the test collection
to use 'Date today printString', which of course meant it worked perfectly.
My worry is whether in some other context the change of the innards of the
object might have an adverse effect. I don't understand why the Date
constructor represents the start of today as 23 hours after 1 a.m.
yesterday. Is the change something OmniBase has done in storing and
retrieving, or is it due to the way the Date is reconstructed?

 

Just for fun, I used Fuel to serialize and re-materialize Date today; it did
not make any changes.

 

Does this reinforce Todd's suggestion that OmniBase is not reliable, or is
it just a quirk?

 

Any ideas gratefully received

 

Peter Kenny



Re: [Pharo-users] OmniBase for Pharo 6

2018-06-23 Thread PBKResearch
Matias

 

Thanks. I have made this change, but it does not affect the tests I have
run.

 

I have focused on getting the test suite in OmniBaseTests to run. So far I
still have 5 greens, 7 reds and one orange. The greens are all the first
five test methods in the browser list; it seems it half fails on the sixth
one (TestEquality), hence the orange, and then red for all the rest.

 

One problem is that the test database is created at the start of the test
suite, and then not removed at the end. This seems to mess up the next
attempt to run the tests. I tried to run the OmniBaseTests>>#tearDown
manually, but it fails, so I have to exit Pharo and delete the test database
in Windows.

 

I intend to continue running the test suite, but I shall run the tests
individually, and put breakpoints in those that fail. I shall report here if
I make any progress.

 

Best wishes

 

Peter Kenny

 

From: Pharo-users  On Behalf Of Matias
Maretto
Sent: 23 June 2018 01:37
To: Any question about pharo is welcome 
Subject: Re: [Pharo-users] OmniBase for Pharo 6

 

Peter: I think I found the problem. On ODBFileStream class >>
accessModeReadOnly the "o" on "only" is not capital. It is
^#accessModeReadonly  when should be ^#accessModeReadOnly ; so on the
ODBWin32FileStream >> createOn:  createMode:  accessMode:  shareMode:
cacheMode:  this part fails:

accessMode = #accessModeReadOnly ifTrue: [acMode := 2147483648
"GENERIC_READ"].

So it cant open the users file for read.  I have fix it and at least for now
I didn't get any "block" error. 

 

 

 

  _  

De: Pharo-users mailto:pharo-users-boun...@lists.pharo.org> > en nombre de PBKResearch
mailto:pe...@pbkresearch.co.uk> >
Enviado: viernes, 22 de junio de 2018 10:39 p. m.
Para: 'Any question about pharo is welcome'
Asunto: Re: [Pharo-users] OmniBase for Pharo 6 

 

Matias

 

Thanks for the hints. I now have 5 greens, but all the rest are red. I am
still getting the 'File cannot be locked' message. Are you doing better than
that? I may try a few trials using it for real, rather than the test suite.

 

Thanks again

 

Peter Kenny

 

From: Pharo-users mailto:pharo-users-boun...@lists.pharo.org> > On Behalf Of Matias Maretto
Sent: 22 June 2018 22:54
To: Any question about pharo is welcome mailto:pharo-users@lists.pharo.org> >
Subject: Re: [Pharo-users] OmniBase for Pharo 6

 

Hi Peter, yes I had the same error at the beginning. I have done 2 minor
changes. Now it seems to be working fine (Although I am still running more
tests). Here: 

 

ODBWin32FileStream >> 

closeHandle: aHandle

"Close an open Win32 object handle, freeing any resources held by it.

Once closed a handle is no longer valid. Answer whether the function

succeeds.

See Win32 SDK help for more information.

 

BOOL CloseHandle(

HANDLE  hObject 

// handle of object to close  

);"

 

""

^ self ffiCall: #(ulong CloseHandle(long aHandle))

 

 

 

ODBWin32FileStream >> 

lockFile: aHandle offsetLow: loPos offsetHigh: hiPos lengthLow: loLength
lengthHigh: hiLength

""

 

^ self

ffiCall: #(long LockFile #(long aHandle , ulong loPos , ulong hiPos , ulong
loLength , ulong hiLength))

 

 

 

  _  

De: Pharo-users mailto:pharo-users-boun...@lists.pharo.org> > en nombre de PBKResearch
mailto:pe...@pbkresearch.co.uk> >
Enviado: viernes, 22 de junio de 2018 09:45 p. m.
Para: 'Any question about pharo is welcome'
Asunto: Re: [Pharo-users] OmniBase for Pharo 6 

 

Matias

 

I have just loaded Esteban's package in a new Pharo 6.1 under Windows 10. I
get an error message saying 'File cannot be locked. Try again?'. When I
select 'no', all tests are run and give red. Are you still running on win 7?
If so, I must be doing something wrong. Can you give more details of the FFI
corrections you made, please?

 

Many thanks

 

Peter Kenny

 

From: Pharo-users mailto:pharo-users-boun...@lists.pharo.org> > On Behalf Of Matias Maretto
Sent: 22 June 2018 21:07
To: Any question about pharo is welcome mailto:pharo-users@lists.pharo.org> >
Subject: Re: [Pharo-users] OmniBase for Pharo 6

 

Esteban: it's working fine, I had to made a minor corrections on 2 FFI calls
and now everithing seems to be working fine.

For What I saw with Voyage-UnqLite only String Objects can be used to
searilize; Omnibase allow to persist almost any kind of objects, thats the
part I like about it. 

 

 

 

  _  

De: Pharo-users mailto:pharo-users-boun...@lists.pharo.org> > en nombre de Esteban
Lorenzano mailto:esteba...@gmail.com> >
Enviado: jueves, 21 de junio de 2018 08:19 p. m.
Para: Any question about pharo is welcome
Asunto: Re: [Pharo-users] OmniBase for Pharo 6 

 

I did it manually and I took like 5 min :P
but this was really easy, just a bunch of FFI calls.

Esteban

> On 21 Jun 2018, at 15:31, Sean P. DeNigris mailto:s...@clipperadams.com> > w

Re: [Pharo-users] OmniBase for Pharo 6

2018-06-22 Thread PBKResearch
Matias

 

Thanks for the hints. I now have 5 greens, but all the rest are red. I am
still getting the 'File cannot be locked' message. Are you doing better than
that? I may try a few trials using it for real, rather than the test suite.

 

Thanks again

 

Peter Kenny

 

From: Pharo-users  On Behalf Of Matias
Maretto
Sent: 22 June 2018 22:54
To: Any question about pharo is welcome 
Subject: Re: [Pharo-users] OmniBase for Pharo 6

 

Hi Peter, yes I had the same error at the beginning. I have done 2 minor
changes. Now it seems to be working fine (Although I am still running more
tests). Here: 

 

ODBWin32FileStream >> 

closeHandle: aHandle

"Close an open Win32 object handle, freeing any resources held by it.

Once closed a handle is no longer valid. Answer whether the function

succeeds.

See Win32 SDK help for more information.

 

BOOL CloseHandle(

HANDLE  hObject 

// handle of object to close  

);"

 

""

^ self ffiCall: #(ulong CloseHandle(long aHandle))

 

 

 

ODBWin32FileStream >> 

lockFile: aHandle offsetLow: loPos offsetHigh: hiPos lengthLow: loLength
lengthHigh: hiLength

""

 

^ self

ffiCall: #(long LockFile #(long aHandle , ulong loPos , ulong hiPos , ulong
loLength , ulong hiLength))

 

 

 

  _  

De: Pharo-users mailto:pharo-users-boun...@lists.pharo.org> > en nombre de PBKResearch
mailto:pe...@pbkresearch.co.uk> >
Enviado: viernes, 22 de junio de 2018 09:45 p. m.
Para: 'Any question about pharo is welcome'
Asunto: Re: [Pharo-users] OmniBase for Pharo 6 

 

Matias

 

I have just loaded Esteban's package in a new Pharo 6.1 under Windows 10. I
get an error message saying 'File cannot be locked. Try again?'. When I
select 'no', all tests are run and give red. Are you still running on win 7?
If so, I must be doing something wrong. Can you give more details of the FFI
corrections you made, please?

 

Many thanks

 

Peter Kenny

 

From: Pharo-users mailto:pharo-users-boun...@lists.pharo.org> > On Behalf Of Matias Maretto
Sent: 22 June 2018 21:07
To: Any question about pharo is welcome mailto:pharo-users@lists.pharo.org> >
Subject: Re: [Pharo-users] OmniBase for Pharo 6

 

Esteban: it's working fine, I had to made a minor corrections on 2 FFI calls
and now everithing seems to be working fine.

For What I saw with Voyage-UnqLite only String Objects can be used to
searilize; Omnibase allow to persist almost any kind of objects, thats the
part I like about it. 

 

 

 

  _  

De: Pharo-users mailto:pharo-users-boun...@lists.pharo.org> > en nombre de Esteban
Lorenzano mailto:esteba...@gmail.com> >
Enviado: jueves, 21 de junio de 2018 08:19 p. m.
Para: Any question about pharo is welcome
Asunto: Re: [Pharo-users] OmniBase for Pharo 6 

 

I did it manually and I took like 5 min :P
but this was really easy, just a bunch of FFI calls.

Esteban

> On 21 Jun 2018, at 15:31, Sean P. DeNigris mailto:s...@clipperadams.com> > wrote:
> 
> EstebanLM wrote
>> I just made a "blind port". migrated the old FFI to new UFFI
> 
> Did you do this manually or use some migration tool? How long did it take?
> 
> 
> 
> -
> Cheers,
> Sean
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html 


 <http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html> Smalltalk -
Pharo Smalltalk Users | Mailing List Archive

forum.world.st

Pharo Smalltalk Users forum and mailing list archive. Pharo User Forum



> 



Re: [Pharo-users] OmniBase for Pharo 6

2018-06-22 Thread PBKResearch
Matias

 

I have just loaded Esteban's package in a new Pharo 6.1 under Windows 10. I
get an error message saying 'File cannot be locked. Try again?'. When I
select 'no', all tests are run and give red. Are you still running on win 7?
If so, I must be doing something wrong. Can you give more details of the FFI
corrections you made, please?

 

Many thanks

 

Peter Kenny

 

From: Pharo-users  On Behalf Of Matias
Maretto
Sent: 22 June 2018 21:07
To: Any question about pharo is welcome 
Subject: Re: [Pharo-users] OmniBase for Pharo 6

 

Esteban: it's working fine, I had to made a minor corrections on 2 FFI calls
and now everithing seems to be working fine.

For What I saw with Voyage-UnqLite only String Objects can be used to
searilize; Omnibase allow to persist almost any kind of objects, thats the
part I like about it. 

 

 

 

  _  

De: Pharo-users mailto:pharo-users-boun...@lists.pharo.org> > en nombre de Esteban
Lorenzano mailto:esteba...@gmail.com> >
Enviado: jueves, 21 de junio de 2018 08:19 p. m.
Para: Any question about pharo is welcome
Asunto: Re: [Pharo-users] OmniBase for Pharo 6 

 

I did it manually and I took like 5 min :P
but this was really easy, just a bunch of FFI calls.

Esteban

> On 21 Jun 2018, at 15:31, Sean P. DeNigris mailto:s...@clipperadams.com> > wrote:
> 
> EstebanLM wrote
>> I just made a "blind port". migrated the old FFI to new UFFI
> 
> Did you do this manually or use some migration tool? How long did it take?
> 
> 
> 
> -
> Cheers,
> Sean
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html 


  Smalltalk -
Pharo Smalltalk Users | Mailing List Archive

forum.world.st

Pharo Smalltalk Users forum and mailing list archive. Pharo User Forum



> 





Re: [Pharo-users] How to fix the Pharo launcher Windows installation! (WAS: Windows installation broken?)

2018-06-18 Thread PBKResearch
Vincent

 

Many thanks - at last a clear explanation of how to get it going. I tried
this with the Launcher I downloaded yesterday, and was able to launch the
template versions of Pharo 6.1 and Pharo 7. The only problem was that I am
not familiar with the Launcher interface, and I had to search around to open
the settings menu - but that was my stupidity. Plus I *hate* the dark theme
- but that's just my weird taste.

 

So going back to the original post in this thread, with this tweak the
Launcher is not broken as regards actually launching images. I have not
checked whether it is possible to uninstall it, as I found it was not
possible yesterday and Petr Fischer also had difficulty with. At present I
do not *want* to uninstall it, so that's OK.

 

All my tests on Windows 10 with all recent updates, on a 64-bit Intel Core
i3 processor.

 

Hope this helps

 

Peter Kenny

 

From: Pharo-users  On Behalf Of
vincent.blond...@lamresearch.com
Sent: 18 June 2018 20:28
To: pharo-users@lists.pharo.org
Subject: Re: [Pharo-users] How to fix the Pharo launcher Windows
installation! (WAS: Windows installation broken?)

 

Hi all,

 

Indeed, the Windows environment is not the one where Pharo is working the
best. Last week, I tried to install it on one of my coworker desktop and
there was some issues that was solvable with some workarounds, it is
temporary and the windows support will be improved soon: I'm currently
working on it, especially on making the Pharo launcher in a read only mode.
This way, no administrative privileges will be required to run the launcher.

 

In the meantime, to make the launcher working under Windows:

 

1.  Run with administrative privileges
2.  Uncheck: 

 

If you are in a mood to help and contribute to this project (I hope you
are!), please report the issues there:

https://github.com/pharo-project/pharo-launcher/issues and feel free to
suggest some fixes to them :)

 

And please, keep this thread related to Pharo.

 

Thanks,

 

Vincent Blondeau 
Software Engineer, Software and Controls | Global Product Group 
Desk +1 510.572.7499


Lam Research Corporation
4650 Cushing Pkwy, Fremont, CA 94538 USA | www.lamresearch.com
Connect with Lam Research:
 Facebook |
 Twitter |
 LinkedIn

  _  

 

NOTICE: This e-mail transmission may contain confidential information. If
you are not the intended recipient, or a person responsible for delivering
it to the intended recipient, you are hereby notified that any disclosure,
copying, distribution or use of any of the information contained in or
attached to this message is STRICTLY PROHIBITED. If you have received this
transmission in error, please immediately notify the sender and destroy the
original transmission and its attachments without reading them or saving
them to disk. Thank you.

 

 

 

-Original Message-
From: Pharo-users [ 
mailto:pharo-users-boun...@lists.pharo.org] On Behalf Of horrido
Sent: Sunday, June 17, 2018 15:04
To:   pharo-users@lists.pharo.org
Subject: Re: [Pharo-users] Windows installation broken?

 

This is what concerns me. I don't care that there are workarounds
(undocumented or hard to find).

 

I care that Windows is a most popular development platform. I care that
newcomers to Pharo easily find what they need to get started. I care about
Pharo's reputation.

 

The last thing Pharo needs is a black eye.

 

 

Travis Ayres wrote

> I wonder how many people tried Pharo, thought "Oh this is totally broken"

> and are never going to give it a second (or third) chance.

> 

> On Sun, Jun 17, 2018 at 11:26 AM,

 

> phil@

 

>  

 

> phil@

 

> 

> wrote:

> 

>> The current website shows the wrong link, the installer for the 

>> bleeding edge is the wrong one in files.

>> The situation on the Windows front is very very bad and not really 

>> improving.

>> 

>> That being said, the installer on the CI is the right one and works.

>> 

>> so, steal the installer from here: 

>>  
https://urldefense.proofpoint.com/v2/url?u=https-3A__ci.inria.fr_phar

>> o-2Dci-2D=DwICAg=RWI7EqL8K9lqtga8KxgfzvOYoob76EZWE0yAO85PVMQ=kI

>> ZIYXBAA3fhM7P5HOuTC5w6mnEApTfXPTq3lR34ZiY=klRHeEtFlmi7VP-TR5D2bSZ_E

>> UF1hAdJcuTH4GnReBY=xfU91HKFoB5JIZXWRUqBvOkomomuAqWw_gQvBmGRwiw=

>> jenkins2/job/PharoLauncher

>> 

>> This is the one you want:

>> 

>>  
https://urldefense.proofpoint.com/v2/url?u=https-3A__ci.inria.fr_phar

>> o-2Dci-2Djenkins2_job_PharoLauncher_=DwICAg=RWI7EqL8K9lqtga8Kxgfz

>> vOYoob76EZWE0yAO85PVMQ=kIZIYXBAA3fhM7P5HOuTC5w6mnEApTfXPTq3lR34ZiY&

>> 

Re: [Pharo-users] Windows installation broken?

2018-06-17 Thread PBKResearch
Tried ‘Run as administrator’ – same result. Also tried to uninstall launcher, 
both by double-clicking ‘uninstall.exe’ and via Windows settings menu. Nothing 
happens. It really is broken.

 

Peter Kenny

 

From: Richard Sargent  
Sent: 17 June 2018 17:42
To: Any question about pharo is welcome ; 
PBKResearch ; 'Any question about pharo is welcome' 

Subject: Re: [Pharo-users] Windows installation broken?

 

Try running the launcher as administrator.
It may not help, but I recall this was a problem not long ago.

On June 17, 2018 9:08:50 AM PDT, PBKResearch mailto:pe...@pbkresearch.co.uk> > wrote:

I tried downloading the standalone version of Pharo 6.1 in a fresh folder, and 
everything seems fine.

I then tried the Pharo Launcher, which I have never used before. I installed 
the template for Pharo 6.1 (stable) and tried to launch it. The launcher window 
closed, and nothing happened. The Task Manager confirms that it is not running 
invisibly in the background. So for me the launcher is not working, though the 
standalone version is fine.

I am using Windows 10 with all recent updates, on a 4GB machine with Intel Core 
i3 processor.

Hope this helps

Peter Kenny

-Original Message-
From: Pharo-users mailto:pharo-users-boun...@lists.pharo.org> > On Behalf Of Hernán Morales 
Durand
Sent: 17 June 2018 05:50
To: Any question about pharo is welcome mailto:pharo-users@lists.pharo.org> >
Subject: Re: [Pharo-users] Windows installation broken?

It is broken. I always use the ZeroConf CLI through wget or curl.

Cheers,

Hernan
El dom., 17 jun. 2018 a las 0:40, horrido
(mailto:horrido.hobb...@gmail.com> >) escribió:


 Someone told me that they had difficulties installing Pharo under 
 Windows. So I had to see for myself.

 I booted my Mac mini into Windows 7 Ultimate (using Boot Camp), 
 downloaded and installed Pharo Launcher.

 That person was indeed correct. The Windows version of Pharo is badly 
 broken. I created images for Pharo 5.0, 6.1, and 7.0, and all three 
 refused to open (presumably, they just crash).

 Am I missing something? What am I doing wrong?



 --
 Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html







Re: [Pharo-users] Windows installation broken?

2018-06-17 Thread PBKResearch
I tried downloading the standalone version of Pharo 6.1 in a fresh folder, and 
everything seems fine.

I then tried the Pharo Launcher, which I have never used before. I installed 
the template for Pharo 6.1 (stable) and tried to launch it. The launcher window 
closed, and nothing happened. The Task Manager confirms that it is not running 
invisibly in the background. So for me the launcher is not working, though the 
standalone version is fine.

I am using Windows 10 with all recent updates, on a 4GB machine with Intel Core 
i3 processor.

Hope this helps

Peter Kenny

-Original Message-
From: Pharo-users  On Behalf Of Hernán 
Morales Durand
Sent: 17 June 2018 05:50
To: Any question about pharo is welcome 
Subject: Re: [Pharo-users] Windows installation broken?

It is broken. I always use the ZeroConf CLI through wget or curl.

Cheers,

Hernan
El dom., 17 jun. 2018 a las 0:40, horrido
() escribió:
>
> Someone told me that they had difficulties installing Pharo under 
> Windows. So I had to see for myself.
>
> I booted my Mac mini into Windows 7 Ultimate (using Boot Camp), 
> downloaded and installed Pharo Launcher.
>
> That person was indeed correct. The Windows version of Pharo is badly 
> broken. I created images for Pharo 5.0, 6.1, and 7.0, and all three 
> refused to open (presumably, they just crash).
>
> Am I missing something? What am I doing wrong?
>
>
>
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>




Re: [Pharo-users] min:max:

2018-04-21 Thread PBKResearch
I can find no reference to #min:max: in Dolphin X6.1. 

Peter Kenny

-Original Message-
From: Pharo-users  On Behalf Of Hilaire
Sent: 21 April 2018 17:36
To: pharo-users@lists.pharo.org
Subject: Re: [Pharo-users] min:max:

The #min:max: message is present in the Squeak/Pharo/Cuis familly but not in 
GNU Smalltalk for example. No idea about the other ones.


Le 21/04/2018 à 00:12, Chris Cunningham a écrit :
> A name like this would be clearer (although much more annoying):
>
> returnAtLeast: minValue butNoMoreThan: maxValue
> 10 returnAtLeast: 12 butNoMoreThan: 48
>

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






Re: [Pharo-users] unsolicited package-cache use

2018-01-18 Thread PBKResearch
Are you sure it's a bot? Google the name - there is a real person living near 
Seattle, with an interest in Smalltalk. I think the same person posts on the 
Dolphin list using the name picoVerse. Granted the style is weird and it often 
doesn't seem to make sense, but it's a person.

Peter Kenny

-Original Message-
From: Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] On Behalf Of 
Marcus Denker
Sent: 18 January 2018 12:47
To: Any question about pharo is welcome 
Subject: Re: [Pharo-users] unsolicited package-cache use

yes, I will do that. I definitely is a bot I think the same that posted 
nonsense to Discord and years ago already to this list.

Marcus

> On 18 Jan 2018, at 12:08, Tudor Girba  wrote:
> 
> Should we not block this account? It looks generated … although it is quite 
> scary how not easy it is to not figure this out.
> 
> Cheers,
> Doru
> 
> 
>> On Jan 18, 2018, at 12:04 PM, Kjell Godo  wrote:
>> 
>> it’s those weight limits on the luggage they spook you
>> they spooked me they spooked us
>> but they are not really limits you just have to pay more
>> but you don’t actually find that out until you get there
>> or if you want to spend an hour on the phone asking about it
>>  well probably only 20 minutes actually 
>>  but you have to know that you can ask this question
>>   that it is a valid question to ask
>>   which apparently we did not
>> so i left something behind Won’t do that again
>> 
>> On Thu, Jan 18, 2018 at 02:45 Kjell Godo  wrote:
>> i want it I’m going to get it if i can click download on it
>> i don’t care about 43MB
>> 
>> is there an image stripper? ( Dolphin has an image stripper you can modify.
>> after stripping the .exe file was about 6MB )
>> 
>> if this is 43MB of just DrGeo then i think it’s fine
>> i don’t know what anybody else thinks and i don’t know much but
>> it takes a few minutes to download 
>> at 1.5Mbits / second
>> not really noticeable
>> it has to be above 100MB at that speed to be noticeable
>> in my opinion
>> 
>> so can i do differential geometry in DrGeo?
>> like general relativity? that would be cool.
>> can it do Tensors? i have this 
>>  book : einstein gravity in a nutshell
>>  and i have always wanted a numerical graphical way to go through
>>  these equations in there
>> i guess there is that numerical package i got, is there a tensor package?
>> i tried to write a tensor thing once
>> i tried to boil it down to the minimum number of lines of 
>>  KEGGenerator code and that was like 10 or less
>>  to do a tensor multiply
>>  but i never tested it yet Test first!
>> 
>> so i want to get DrGeo now and i don’t care about 43MB
>> now or soon it’s not really possible right now
>> usually it would be but i am out of my usual country
>> 
>> 
>> On Thu, Jan 18, 2018 at 00:33 Hilaire  wrote:
>> Le 18/01/2018 à 05:30, Hernán Morales Durand a écrit :
>>> Which Pharo version?
>> P7
>>> Have you found any solution to this?
>> 
>> I find a workaround.  My bash script to build DrGeo image just remove 
>> the content of the package-cache directory.
>>> In Gofer there was #disablePackageCache, in Metacello I don't know, 
>>> maybe experimenting with MetacelloLoaderPolicy but there are no 
>>> class comments.
>> 
>> I am now done with this problem, and I will not get back to it right now.
>> Thanks to ask and the suggestion, it could be useful to other.
>> 
>> I have other serious concern as the resulting size of the DrGeo image 
>> built against P7, 43MB. I feel ashame to make any public DrGeo 
>> release with such an important image size.
>> 
>> Hilaire
>> 
>> 
>> 
>> 
>> --
>> Dr. Geo
>> http://drgeo.eu
>> 
>> 
>> 
> 
> --
> www.tudorgirba.com
> www.feenk.com
> 
> "Speaking louder won't make the point worthier."
> 
> 





Re: [Pharo-users] Pharo 7 image cannot write changes message on startup

2018-01-14 Thread PBKResearch
Sanjay

I don't know how to identify the VM version - it is the one which was
current when I downloaded my current image in July 2017; the .exe has a
creation date of 31 May 2017.

The point of my comment was that this message does not only come from a
conflict of access permissions. In my situation, it arises because the
program knows that another program has exclusive write access to the changes
file. In your situation, could it be that the program is wrongly coming to
the same conclusion? I don't know how Pharo reaches that conclusion; I just
thought that it might give a clue to anyone trying to locate the bug.

Best wishes

Peter Kenny

PS. Sorry for splitting this into two threads - my spelling checker insisted
on correcting the typo in the subject line.

-Original Message-
From: Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] On Behalf Of
Sanjay Minni
Sent: 14 January 2018 05:04
To: pharo-users@lists.pharo.org
Subject: Re: [Pharo-users] Pharo 7 image cannot write changes message on
startup

Peter,

this is the only image (re-checked)
However this seems to be a reported issue.

which version of VM are you using

Regards
Sanjay



-
---
Regards, Sanjay
--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html




Re: [Pharo-users] Pharo 7 image cannot write changes message on startup

2018-01-13 Thread PBKResearch
Sanjay

I have had messages like this when I inadvertently tried to start two copies
of the same image (in my case pharo 6.1). The first image was running
happily in the background, the second gave this message (but still seemed to
start OK). I am also on Windows 10, using 32-bit Pharo.

HTH

Peter Kenny

-Original Message-
From: Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] On Behalf Of
Sanjay Minni
Sent: 13 January 2018 05:50
To: pharo-users@lists.pharo.org
Subject: Re: [Pharo-users] Pharo 7 image cannot write changes message on
starup

Hi Richard,

the path for the image/changes/sources is 

   C:\Users\Myself\Documents\DevArea\p7\Pharo7.0-32bit-eb0a6fb.changes.

in which I have all the rights (this is a desktop in which I have admin
rights)
the pharo image messages also shows the same path (in my earlier post I had
replaced with ...)

the VM is is a separate directory which is in the path

so what could be the issue here


Richard Sargent wrote
> Hi Sanjay,
> 
> It depends on where you installed Pharo. The ... in the path cited is 
> important. (And maybe Pharo elided the path.)
> 
> If the path involves either of the Program Files directories, they 
> cannot be written by an unprivileged user/program.
> 
> Check your access rights on each directory or file in the path via 
> their properties.
> 
> 
> On Jan 12, 2018 21:09, "Sanjay Minni" 

> sm@

>  wrote:
> 
>> Hi
>>
>> I get the following message when I try to startup the latest Pharo 7 
>> image
>> (32 bit VM in Windows).
>>
>> "Information
>>  Pharo cannot write to the changes file named 
>> C:\...\Pharo7.0-32bit-eb0a6fb.changes.
>>  Please check that you have write permission for this file."
>>
>> This is a desktop and there is really no issues o permissions What is 
>> wrong here
>>
>> regards
>> Sanjay
>>
>>
>>
>> -
>> ---
>> Regards, Sanjay
>> --
>> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>>
>>





-
---
Regards, Sanjay
--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html




Re: [Pharo-users] ZnUrls with Non-ASCII characters

2017-12-07 Thread PBKResearch
Sean

The trick is to url encode the bit that contains the accented characters. In 
your case, try:
('https://en.wiktionary.org/wiki/','prêt#French' urlEncoded ) asUrl

If you use urlEncoded on the whole string, the encoded slashes seem to confuse 
things.

HTH

Peter Kenny


-Original Message-
From: Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] On Behalf Of 
Sean P. DeNigris
Sent: 07 December 2017 14:49
To: pharo-users@lists.pharo.org
Subject: [Pharo-users] ZnUrls with Non-ASCII characters

'https://en.wiktionary.org/wiki/prêt#French' asUrl ==>
ZnCharacterEncodingError: ASCII character expected. Ideas?



-
Cheers,
Sean
--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html




Re: [Pharo-users] Soup bug(fix)

2017-11-08 Thread PBKResearch
Kjell

 

Almost certainly the HTML files will not contain the code for the actual 
pictures; they will just contain an ‘href’ node with the address to load the 
picture file from. If the web pages are built to a regular pattern, you should 
be able to parse them and locate the href nodes you want. 

 

I haven’t found any problem with the parse from XMLHTMLParser taking up too 
much memory. My machine has 4GB ram; if you have much less than that, you might 
have trouble. If you have found a systematic way to locate the picture file, 
you could minimise the size of the DOM the parser creates, by using a streaming 
parser. The streaming version of Monty’s parser is called StAXHTMLParser.

 

I have a bit of experience playing with these parsers. If you get stuck, ask 
again here with more details; I may be able to help.

 

Peter Kenny

 

From: Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] On Behalf Of 
Kjell Godo
Sent: 08 November 2017 23:00
To: Any question about pharo is welcome 
Subject: Re: [Pharo-users] Soup bug(fix)

 

i like to collect some newspaper comics from an online newspaper

 but it takes really long to do it by hand by hand

i tried Soup but i didn’t get anywhere

 the pictures were hidden behind a script or something

is there anything to do about that? i don’t want to collect them all

i have the XPath .pdf but i haven’t read it yet

 

these browsers seem to gobble up memory

 and while open they just keep getting bigger till the OS session crash

 might there be a browser that is more minimal?

 

Vivaldi seems better at not bloating up RAM



Re: [Pharo-users] Soup bug(fix)

2017-11-08 Thread PBKResearch
Siemen

Stef should have added that XPath depends on using Monty's XMLParser suite. I 
tried your snippet on XMLDOMParser, and it parses correctly. I always use 
XMLHTMLParser for parsing HTML, because I can always see the exact relationship 
between the parsed structure and the original HTML. With Soup I often found the 
match difficult or even impossible.

HTH

Peter Kenny

-Original Message-
From: Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] On Behalf Of 
Stephane Ducasse
Sent: 08 November 2017 21:19
To: Any question about pharo is welcome 
Subject: Re: [Pharo-users] Soup bug(fix)

Hi Siemen

let me know your loging and I can add you to commit. Paul is also taking care 
of Soup.
Now I like XPath for scraping. Did you see the tutorial I wrote with Peter.


STef

On Wed, Nov 8, 2017 at 2:17 PM, Siemen Baader  wrote:
> Hi all,
>
> who maintains Soup, the HTML parser? Stef?
>
> It seems to auto-close  (and ) tags when nested inside 
> another element. I wrote this test that fails:
>
> testNestedButton
> "this works with nested  tags instead of  and when 
> there is no enclosing  at all. but here  is auto-closed."
>
> "a does not work either"
>
> | soup |
> soup := Soup
> fromString:
> '
> text
>
> '.
> self assert: soup div button span string equals: 'text'
>
> 
>
>
> Where should I look to prevent Soup from auto-closing the tag, and 
> where & how should I submit my fix?
>
> cheers,
> Siemen




Re: [Pharo-users] [Pharo7.0a] Next batch of enhancements

2017-11-05 Thread PBKResearch
I don’t see why there is a flame potential here; I certainly won’t start a 
flame war. My previous post was a bit heated, as a protest against the abuse of 
language; removing a facility may make Pharo easier to maintain, but it is not 
an enhancement for the user. I wasn’t aware that the theme is broken; it seems 
to work well whenever I use it.

 

It may be that I am the only one weird enough to continue with this theme 
(which was the standard Pharo theme when I first met it). If so, I shall have 
to accept the majority view. I shall keep a note of the .st package you 
supplied, and try filing it in when I have to move on to Pharo 7. I don’t think 
keeping it as an optional extra will really work. It will be an orphan, because 
no-one other than the existing Pharo maintainers will have the knowledge to 
maintain it. It will presumably only need maintenance if there is some change 
in the superclass UITheme, and only those responsible for the change will know 
where the consequential effects will be seen.

 

There is one possibility which occurs to me. You have presumably refactored the 
subclasses of UITheme, so that it no longer matters to the other themes whether 
watery is present or absent. So you could file it in again, marking it as 
deprecated and not to be maintained, and strange people like me could use it at 
our own risk. When some other change occurs which makes this theme 
irretrievably broken, perhaps in Pharo 8, 9 or 10, it could then be deleted.

 

Definitely no flame – just a serious suggestion of a compromise.

 

Peter Kenny

 

From: Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] On Behalf Of 
Pavel Krivanek
Sent: 05 November 2017 12:48
To: Any question about pharo is welcome <pharo-users@lists.pharo.org>
Subject: Re: [Pharo-users] [Pharo7.0a] Next batch of enhancements

 

Removing of the Watery theme is an enhancement in sense of "cleanup". The code 
was not maintained and partly broken. To have this theme in the image was a 
problem for management of the two default Pharo themes because the Watery theme 
was superclass of them and added a significant level of complexity and mess.

 

But let's be positive. I can imagine that this thread has a huge flame 
potential so I spent a few minutes to prepare Watery Theme as a standalone 
package (see the attached *.st file). And no, it was not a simple file-out 
operation. So I hope that people that want to use the Watery Theme will rather 
discuss in what repository to place it and who will maintain it. In Pharo we 
want to focus on two basic themes - one white and one dark. We simply see no 
reason why this theme should not be an optional external package.

 

Cheers,

-- Pavel

 

 

2017-11-05 12:00 GMT+01:00 PBKResearch <pe...@pbkresearch.co.uk 
<mailto:pe...@pbkresearch.co.uk> >:

I waded through the list of 'enhancements', and was astonished to find this. Is 
there to be an alternative way of producing the same appearance as the 'Watery' 
theme? If not, how can the removal of a facility be called an 'enhancement'? I 
always switch to this theme when I load a new image, because I find the plain 
buttons in the standard theme ugly.

I managed to find the fogbugz entry - not easy, because it has been closed, so 
clicking on the link gives 404 - and it just says 'UIThemeWatery should be 
removed according to the current Pharo 7 plans.' I can't recall seeing these 
plans put up for discussion; if I had, I would certainly have protested then. 
Does having this theme as an option cause any problems elsewhere, so as to 
justify removing a facility. If not, can I put in a plea to have this so-called 
enhancement reverted? It has been installed only a week ago, so it can't be a 
major problem.

Peter Kenny

-Original Message-
From: Pharo-users [mailto:pharo-users-boun...@lists.pharo.org 
<mailto:pharo-users-boun...@lists.pharo.org> ] On Behalf Of Stephane Ducasse
Sent: 05 November 2017 09:08
To: Pharo Development List <pharo-...@lists.pharo.org 
<mailto:pharo-...@lists.pharo.org> >; Any question about pharo is welcome 
<pharo-users@lists.pharo.org <mailto:pharo-users@lists.pharo.org> >
Subject: [Pharo-users] [Pharo7.0a] Next batch of enhancements

Report period: 23 October 2017 to 5 November 2017

*  20587-remove-UIThemeWatery
 >> https://pharo.fogbugz.com/f/cases/20587-remove-UIThemeWatery

  Issue URL: https://pharo.fogbugz.com/f/cases/20587
  PR URL: https://github.com/pharo-project/pharo/pull/395
  Diff URL: https://github.com/pharo-project/pharo/pull/395/files

  Thanks to pavel-krivanek





 



Re: [Pharo-users] [Pharo7.0a] Next batch of enhancements

2017-11-05 Thread PBKResearch
I waded through the list of 'enhancements', and was astonished to find this. Is 
there to be an alternative way of producing the same appearance as the 'Watery' 
theme? If not, how can the removal of a facility be called an 'enhancement'? I 
always switch to this theme when I load a new image, because I find the plain 
buttons in the standard theme ugly. 

I managed to find the fogbugz entry - not easy, because it has been closed, so 
clicking on the link gives 404 - and it just says 'UIThemeWatery should be 
removed according to the current Pharo 7 plans.' I can't recall seeing these 
plans put up for discussion; if I had, I would certainly have protested then. 
Does having this theme as an option cause any problems elsewhere, so as to 
justify removing a facility. If not, can I put in a plea to have this so-called 
enhancement reverted? It has been installed only a week ago, so it can't be a 
major problem.

Peter Kenny

-Original Message-
From: Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] On Behalf Of 
Stephane Ducasse
Sent: 05 November 2017 09:08
To: Pharo Development List ; Any question about 
pharo is welcome 
Subject: [Pharo-users] [Pharo7.0a] Next batch of enhancements

Report period: 23 October 2017 to 5 November 2017

*  20587-remove-UIThemeWatery
 >> https://pharo.fogbugz.com/f/cases/20587-remove-UIThemeWatery

  Issue URL: https://pharo.fogbugz.com/f/cases/20587
  PR URL: https://github.com/pharo-project/pharo/pull/395
  Diff URL: https://github.com/pharo-project/pharo/pull/395/files

  Thanks to pavel-krivanek






Re: [Pharo-users] Problem with input to XML Parser - 'Invalid UTF8 encoding'

2017-10-08 Thread PBKResearch
Paul

Good to have found the charset discrepancy - that may have something to do with 
it. But I don't think it has to do with the C’è in the body of the page. I have 
just parsed another page published today, with the same error, and again it 
fails in parsing the  node, so it has not even reached the body. The 
 contains a meta which describes the article - a sort of paraphrase of 
the article headline - and it fails in the middle of decoding that. The 
character at which it fails is again $«, so that is definitely the cause. Maybe 
the wrong charset is the explanation of why it messes up that - but I don't 
know enough about the different charsets to know. Does ISO-8859-1 even contain 
$«?

Peter

-Original Message-
From: Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] On Behalf Of 
Paul DeBruicker
Sent: 08 October 2017 18:41
To: pharo-users@lists.pharo.org
Subject: Re: [Pharo-users] Problem with input to XML Parser - 'Invalid UTF8 
encoding'

in the HEAD tag of that page with the article they declare it is ISO-8859-1 and 
not UTF-8.  In the page they have a  

C’è 

The little back-tick next to the C is UTF8 8217
(http://www.codetable.net/decimal/8217)


So their encoding is messed up, and maybe the XMLHTMLParser should throw a 
warning or something if there is a mismatch.  


Glad you found a work around. 








In another thread (on SVG Icons) Sven referred to ways of getting input from a 
URL for XMLDOMParser. I have recently had some problems doing this. I have 
found a workaround, so it is not urgent, but I thought I should put it on 
record in case anyone else is bitten by it, and so maybe Monty can look at it.

 

I am using the subclass XMLHTMLParser, and my usual way of invoking it was:

1.  XMLHTMLParser parseURL: .

This works in most cases, but with one particular site - 
http://www.corriere.it/., which is an Italian newspaper - I had frequent 
failures, with the error message 'Invalid UTF8 encoding'. The parser has the 
option of parsing a string, which is obtained by other means, so I tried 
reading it in with Zinc:

2.  XMLHTMLParser parse:  asZnUrl retrieveContents.

And this worked, so clearly the encoding on the site is OK. I realised that the 
XML-Parser package has its own methods, which reproduce a lot of the 
functionality of Zinc, so I tried the equivalent:

3.  XMLHTMLParser parse:  asXMLURI get.

To my surprise, this worked equally well. I had expected problems, because 
presumably forms (1) and (3) use the same UTF8 decoding.

 

For now, I am using the form (3) for all my work, and have not had any problems 
since. So the message to anyone who is using the form (1) and getting problems 
is to try (2) or (3) instead.

 

I am using Moose 6.1 (Pharo 6.0 Latest update: #60486) on Windows 10. I think 
most articles on the Corriere web site will generate the error, but one which 
has always failed for me is:

http://www.corriere.it/esteri/17_ottobre_03/felipe-spagna-catalogna-discorso
-8f7ac0d6-a86d-11e7-a090-96160224e787.shtml

I tried to trace through the error using the debugger, but it got too 
confusing. However, I did establish that the failure occurred early in decoding 
the HTML , in the line beginning 




--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html




[Pharo-users] Problem with input to XML Parser - 'Invalid UTF8 encoding'

2017-10-08 Thread PBKResearch
In another thread (on SVG Icons) Sven referred to ways of getting input from
a URL for XMLDOMParser. I have recently had some problems doing this. I have
found a workaround, so it is not urgent, but I thought I should put it on
record in case anyone else is bitten by it, and so maybe Monty can look at
it.

 

I am using the subclass XMLHTMLParser, and my usual way of invoking it was:

1.  XMLHTMLParser parseURL: .

This works in most cases, but with one particular site -
http://www.corriere.it/., which is an Italian newspaper - I had frequent
failures, with the error message 'Invalid UTF8 encoding'. The parser has the
option of parsing a string, which is obtained by other means, so I tried
reading it in with Zinc:

2.  XMLHTMLParser parse:  asZnUrl retrieveContents.

And this worked, so clearly the encoding on the site is OK. I realised that
the XML-Parser package has its own methods, which reproduce a lot of the
functionality of Zinc, so I tried the equivalent:

3.  XMLHTMLParser parse:  asXMLURI get.

To my surprise, this worked equally well. I had expected problems, because
presumably forms (1) and (3) use the same UTF8 decoding.

 

For now, I am using the form (3) for all my work, and have not had any
problems since. So the message to anyone who is using the form (1) and
getting problems is to try (2) or (3) instead.

 

I am using Moose 6.1 (Pharo 6.0 Latest update: #60486) on Windows 10. I
think most articles on the Corriere web site will generate the error, but
one which has always failed for me is:

http://www.corriere.it/esteri/17_ottobre_03/felipe-spagna-catalogna-discorso
-8f7ac0d6-a86d-11e7-a090-96160224e787.shtml

I tried to trace through the error using the debugger, but it got too
confusing. However, I did establish that the failure occurred early in
decoding the HTML , in the line beginning 

  1   2   >