[Pharo-users] Call for little tasks for GCI
Hi guys We want to compete to a competition for newbies programming. We need to have at least 50 tasks. Right now the tasks are quite difficult to me :) Please help to get some tasks. I can be taken from exercisism.io or other little math problems. - Grab the Pharo logo from url and display it - We can turn some of the mooc challenges into tasks. http://mooc.pharo.org I have some ideas but I need your help because I want to finish the new chapter and book. https://github.com/jigyasa-grover/GCI-2017-with-Pharo Stef
Re: [Pharo-users] Bloc Space within a Space
Start to play with Bloc. This is the moment to play and give feedback. I will start around December/January. Stef On Tue, Sep 26, 2017 at 3:28 AM, Sean P. DeNigriswrote: > Stephane Ducasse-3 wrote >> with multiple little worlds showing windows inside and to control all >> the events. > > That sounds awesome! Smalltalk is at heart a simulation bench and the > inability to simulate the IDE itself has felt like heavy shackles when I > tried to implement several possible-blue-plane ideas in the past. If we had > a UI where we could sub out and control all the events/time/cursor, we would > have something unimaginably cool :) > > > > - > Cheers, > Sean > -- > Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html >
Re: [Pharo-users] Force headless mode
Out of curiosity... how does enforcing headlessness protects code? Wouldn't it be still accessible via e.g. TelePharo, or startup script override, or anything? Peter On Tue, Sep 26, 2017 at 7:04 PM, Sven Van Caekenberghewrote: > > > On 26 Sep 2017, at 18:06, Cyril Ferlicot > wrote: > > > > On Tue, Sep 26, 2017 at 5:59 PM, Esteban Lorenzano > wrote: > >> > >> > >> it is not. > >> specially on windows. > >> > >> vm handles the creation of host window and you will always have one. > >> > >> now… if you wait one week, I will have ready the (experimental) real > headless VMs. In my tests, they are working fine but we will still need to > work when we want to actually start a world window… but that’s another > story ;) > >> > > > > I don't think we can wait Pharo 7 before doing this task. But I can > > still try it when you're done. > > > > With this, will it be possible to totally disable the non headless > > mode in production? > > Why not do as follows: > > (1) add some startup code inside the image that tests if the image is > running headless, if not exit > (2) remove some of the command line handlers (especially the ones that > execute or load code) > > Problem is that you will lock yourself out as well ;-) > > >> Esteban > >> > >> > >> > > > > > > > > -- > > Cyril Ferlicot > > https://ferlicot.fr > > > > http://www.synectique.eu > > 2 rue Jacques Prévert 01, > > 59650 Villeneuve d'ascq France > > > > >
Re: [Pharo-users] About encoding
So it works now. I converted the files in utf8 and now the book is not broken anymore. Thanks sven for at least taking the time to reply to my email. I helps for my mental spirit. Stef On Tue, Sep 26, 2017 at 6:09 PM, Stephane Ducassewrote: > Here is a script that should work to convert from latin1 to utf-8. > Thanks to your book and trial and error. > > | str wstr | > str := ('listeDeMotsFrancaisFrGut.txt' asFileReference readStreamDo: [ :in | >(ZnCharacterReadStream on: in binary encoding: #latin1) > upToEnd ]) lines. > > 'listeDeMotsFrancaisFrGutUTF8.txt' asFileReference writeStreamDo: [ :out | >wstr := (ZnCharacterWriteStream on: out binary encoding: #utf8). > str do: [ :each | wstr nextPutAll: each. wstr crlf. ]. > ]. > > On Tue, Sep 26, 2017 at 6:01 PM, Stephane Ducasse > wrote: >> Now inspecting the file containent opens gtinspector and freezes Pharo :( >> I think that I will remove this part of my book. >> It is simpler. >> >> On Tue, Sep 26, 2017 at 5:53 PM, Stephane Ducasse >> wrote: >>> I'm reading your chapter :) >>> Now I understand the file I found is totally bogus :) >>> But the first one I found is indeed encoded in latin1. >>> So I'm trying to convert it. >>> >>> >>> >>> >>> On Tue, Sep 26, 2017 at 5:40 PM, Stephane Ducasse >>> wrote: > Any chance you can point me to the original file ? No they removed it May be I could try to convert it to utf-8 (I do not know how to do it) > The file is indeed in Latin1 encoded, but GitHub serves it as UTF-8 (it > did not change the contents, but the meta data). Ok I see the problem > > The default encoder option only works when the server says nothing, it > does not override what the server says. Ah ok. > The only way to read it, is by reading it binary (which basically ignores > the meta data) and then convert it manually: > > (ZnCharacterEncoder latin1 decodeBytes: > (ZnClient new > beBinary; > get: > 'https://raw.githubusercontent.com/SquareBracketAssociates/LearningOOPWithPharo/master/resources/listeDeMotsFrancaisFrGut.txt')) > lines. > > But this is very ugly. > > Best convert the original file to UTF-8 before uploading to GitHub. OK I will try to leanr how to do it. > > Sven > > >
Re: [Pharo-users] Testing a Unicode Character's Category
Andrew P. Black wrote > Hi Richard, > > Normally I agree with you, and prefer boolean methods > > inCatagoryCc: aChar > isCategorySm: aChar > to > categoryOf: aChar == #Cc > categoryOf: aChar == #Sm > > In this particular case, though, the category codes are part of the > Unicode Standard, so perhaps exposing them isn’t so bad. Moreover, there > is meaning encoded into the symbols — for example, all the letter > categories start with L. So one could write an isLetter test like this I understand this argument, but I cannot agree with it. If I were to ask you what code points were defined in character category Mx, you would immediately go to a web site that contained the Unicode categories to find the answer. In other words, you would "ask Unicode". In general, I would expect to see: Character>>#isCapitalLetter ^Unicode isCapitalLetter: self "actually, /self codePoint/" Character>>#isLetter ^Unicode isLetter: self Character>>#isMathSymbol Unicode isMathSymbol: self Unicode's methods would look at and interpret its category information for the character ... which might be internally managed via some kind of tree structure (who knows?). And I would definitely expect to *not* see a method name like "isCategorySm:". :-) Magic numbers, magic codes, etc.: you always want there to be one definitive expert (class) and you do not want other classes usurping its responsibilities. > Character >> isLetter > ^ (Unicode categoryOf: self) first == $L > > rather than > > Character >> isLetter > Unicode inCategoryLl ifTrue: [ ^ true ]. > Unicode inCategoryLm ifTrue: [ ^ true ]. > Unicode inCategoryLo ifTrue: [ ^ true ]. > Unicode inCategoryLt ifTrue: [ ^ true ]. > Unicode inCategoryLu ifTrue: [ ^ true ]. > ^ false > > There is still the disadvantage that a typo in the Category name (typing > #L1, for example, when one means #Ll) is likely to go undetected. > > Andrew -- Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
Re: [Pharo-users] Force headless mode
> On 26 Sep 2017, at 18:06, Cyril Ferlicotwrote: > > On Tue, Sep 26, 2017 at 5:59 PM, Esteban Lorenzano > wrote: >> >> >> it is not. >> specially on windows. >> >> vm handles the creation of host window and you will always have one. >> >> now… if you wait one week, I will have ready the (experimental) real >> headless VMs. In my tests, they are working fine but we will still need to >> work when we want to actually start a world window… but that’s another story >> ;) >> > > I don't think we can wait Pharo 7 before doing this task. But I can > still try it when you're done. > > With this, will it be possible to totally disable the non headless > mode in production? Why not do as follows: (1) add some startup code inside the image that tests if the image is running headless, if not exit (2) remove some of the command line handlers (especially the ones that execute or load code) Problem is that you will lock yourself out as well ;-) >> Esteban >> >> >> > > > > -- > Cyril Ferlicot > https://ferlicot.fr > > http://www.synectique.eu > 2 rue Jacques Prévert 01, > 59650 Villeneuve d'ascq France >
Re: [Pharo-users] About encoding
> On 26 Sep 2017, at 18:09, Stephane Ducassewrote: > > Here is a script that should work to convert from latin1 to utf-8. > Thanks to your book and trial and error. > > | str wstr | > str := ('listeDeMotsFrancaisFrGut.txt' asFileReference readStreamDo: [ :in | > (ZnCharacterReadStream on: in binary encoding: #latin1) > upToEnd ]) lines. > > 'listeDeMotsFrancaisFrGutUTF8.txt' asFileReference writeStreamDo: [ :out | > wstr := (ZnCharacterWriteStream on: out binary encoding: #utf8). > str do: [ :each | wstr nextPutAll: each. wstr crlf. ]. > ]. Yes, that is correct (and using the newer encoders in both directions) > On Tue, Sep 26, 2017 at 6:01 PM, Stephane Ducasse > wrote: >> Now inspecting the file containent opens gtinspector and freezes Pharo :( >> I think that I will remove this part of my book. >> It is simpler. >> >> On Tue, Sep 26, 2017 at 5:53 PM, Stephane Ducasse >> wrote: >>> I'm reading your chapter :) >>> Now I understand the file I found is totally bogus :) >>> But the first one I found is indeed encoded in latin1. >>> So I'm trying to convert it. >>> >>> >>> >>> >>> On Tue, Sep 26, 2017 at 5:40 PM, Stephane Ducasse >>> wrote: > Any chance you can point me to the original file ? No they removed it May be I could try to convert it to utf-8 (I do not know how to do it) > The file is indeed in Latin1 encoded, but GitHub serves it as UTF-8 (it > did not change the contents, but the meta data). Ok I see the problem > > The default encoder option only works when the server says nothing, it > does not override what the server says. Ah ok. > The only way to read it, is by reading it binary (which basically ignores > the meta data) and then convert it manually: > > (ZnCharacterEncoder latin1 decodeBytes: > (ZnClient new >beBinary; >get: > 'https://raw.githubusercontent.com/SquareBracketAssociates/LearningOOPWithPharo/master/resources/listeDeMotsFrancaisFrGut.txt')) > lines. > > But this is very ugly. > > Best convert the original file to UTF-8 before uploading to GitHub. OK I will try to leanr how to do it. > > Sven > > > >
Re: [Pharo-users] About encoding
Here is a script that should work to convert from latin1 to utf-8. Thanks to your book and trial and error. | str wstr | str := ('listeDeMotsFrancaisFrGut.txt' asFileReference readStreamDo: [ :in | (ZnCharacterReadStream on: in binary encoding: #latin1) upToEnd ]) lines. 'listeDeMotsFrancaisFrGutUTF8.txt' asFileReference writeStreamDo: [ :out | wstr := (ZnCharacterWriteStream on: out binary encoding: #utf8). str do: [ :each | wstr nextPutAll: each. wstr crlf. ]. ]. On Tue, Sep 26, 2017 at 6:01 PM, Stephane Ducassewrote: > Now inspecting the file containent opens gtinspector and freezes Pharo :( > I think that I will remove this part of my book. > It is simpler. > > On Tue, Sep 26, 2017 at 5:53 PM, Stephane Ducasse > wrote: >> I'm reading your chapter :) >> Now I understand the file I found is totally bogus :) >> But the first one I found is indeed encoded in latin1. >> So I'm trying to convert it. >> >> >> >> >> On Tue, Sep 26, 2017 at 5:40 PM, Stephane Ducasse >> wrote: Any chance you can point me to the original file ? >>> >>> No they removed it >>> May be I could try to convert it to utf-8 (I do not know how to do it) >>> The file is indeed in Latin1 encoded, but GitHub serves it as UTF-8 (it did not change the contents, but the meta data). >>> >>> Ok I see the problem The default encoder option only works when the server says nothing, it does not override what the server says. >>> >>> Ah ok. >>> The only way to read it, is by reading it binary (which basically ignores the meta data) and then convert it manually: (ZnCharacterEncoder latin1 decodeBytes: (ZnClient new beBinary; get: 'https://raw.githubusercontent.com/SquareBracketAssociates/LearningOOPWithPharo/master/resources/listeDeMotsFrancaisFrGut.txt')) lines. But this is very ugly. Best convert the original file to UTF-8 before uploading to GitHub. >>> >>> OK I will try to leanr how to do it. >>> >>> Sven
Re: [Pharo-users] Pharo 7 license question
On 09/26/2017 06:09 AM, Ben Coman wrote: On Mon, Sep 25, 2017 at 9:43 PM, Jimmie Houchin> wrote: Hello, thanks for the reply. I have thought about recursive and unfortunately it is not in my opinion an adequate or equivalent substitute. It may be inoffensive, but it is not accurate in conveying those properties or characteristics of the GPL. Something that is recursive generally makes repeated calls to itself. It is neatly contained and does not propagate outside of itself. Calling a recursive method does not make the call chain all the way up to main recursive. The recursive method does its recursion and generally returns its result back to the caller, ending the recursion. The only thing the caller receives is the results, not the recursion. There are many positive cultural references to something viral or infect(ious). For something to go viral, depends on what that something is. She has an infectious smile, or laugh. Even in biology where we get the term viral. It is not absolutely or always negative. There are things that scientist attempt to use viral characteristics to do good things. Context is everything. There are no words a GPL proponent could provide which adequately or otherwise describe the viral characteristic of the GPL that would be considered positive by a GPL opponent. Back to context. To a GPL proponent, the viral nature of the GPL is considered a positive and good thing. It is the primary reason to choose and use the GPL. To the GPL opponent, the viral nature of the GPL is considered a negative and bad thing. It is the primary reason to oppose and to avoid using the GPL. Two side both viewing the same exact thing and understanding it very differently. One positive, one negative. There is no positive spin for this aspect of the GPL for someone wishing to avoid that aspect. No matter what words are chosen. For the MIT/BSD person we don't necessarily care if you wish to license your software under the GPL. What we care is that your software is expressly and explicitly trying to override our choices and compel us to become GPL. That is what we don't like. The fact that GPL software is GPL software in perpetuity is okay. Just leave us alone. But we know that is not how the GPL works. A perspective occurred to me this morning. The original author of GPL software is not bound by the GPL. I think this thread has run its course for now, but just a quick clarification here. The above is only true up until they accept the first contribution from another party - so its not a good argument. cheers -ben . I agree that it has run its course. However, the original author still can do whatever they want with the code they wrote. They have copyright. But they can not undo what has been released. They cannot use any other contributors code without that code also affecting any of the other code they may have added to or modifications of the original. But the initial offering and any additions and modifications they do which does not other contributors GPLd code is still under their complete control to do as they wish. This is the only way anybody would be able to do dual licensing. As is the case in something like QT or other such projects. But anything they write which is without contributions is still totally within their control to do so as they please. And as I said, there are many projects who started out as GPL and switched to MIT. Yes, someone could still take what was released as GPL and keep it going. But it would then be competing with the MIT version. Nim and PicoLisp are two such projects that started as GPL and moved to MIT. They could even do so with contributed code if the contributors signed agreements assigning copyrights to the original author. Jimmie
Re: [Pharo-users] Force headless mode
On Tue, Sep 26, 2017 at 5:59 PM, Esteban Lorenzanowrote: > > > it is not. > specially on windows. > > vm handles the creation of host window and you will always have one. > > now… if you wait one week, I will have ready the (experimental) real headless > VMs. In my tests, they are working fine but we will still need to work when > we want to actually start a world window… but that’s another story ;) > I don't think we can wait Pharo 7 before doing this task. But I can still try it when you're done. With this, will it be possible to totally disable the non headless mode in production? > Esteban > > > -- Cyril Ferlicot https://ferlicot.fr http://www.synectique.eu 2 rue Jacques Prévert 01, 59650 Villeneuve d'ascq France
Re: [Pharo-users] About encoding
Now inspecting the file containent opens gtinspector and freezes Pharo :( I think that I will remove this part of my book. It is simpler. On Tue, Sep 26, 2017 at 5:53 PM, Stephane Ducassewrote: > I'm reading your chapter :) > Now I understand the file I found is totally bogus :) > But the first one I found is indeed encoded in latin1. > So I'm trying to convert it. > > > > > On Tue, Sep 26, 2017 at 5:40 PM, Stephane Ducasse > wrote: >>> Any chance you can point me to the original file ? >> >> No they removed it >> May be I could try to convert it to utf-8 (I do not know how to do it) >> >>> The file is indeed in Latin1 encoded, but GitHub serves it as UTF-8 (it did >>> not change the contents, but the meta data). >> >> Ok I see the problem >>> >>> The default encoder option only works when the server says nothing, it does >>> not override what the server says. >> >> Ah ok. >> >>> The only way to read it, is by reading it binary (which basically ignores >>> the meta data) and then convert it manually: >>> >>> (ZnCharacterEncoder latin1 decodeBytes: >>> (ZnClient new >>> beBinary; >>> get: >>> 'https://raw.githubusercontent.com/SquareBracketAssociates/LearningOOPWithPharo/master/resources/listeDeMotsFrancaisFrGut.txt')) >>> lines. >>> >>> But this is very ugly. >>> >>> Best convert the original file to UTF-8 before uploading to GitHub. >> >> OK I will try to leanr how to do it. >> >> >>> >>> Sven >>> >>> >>>
Re: [Pharo-users] Force headless mode
> On 26 Sep 2017, at 16:49, Cyril Ferlicotwrote: > > Hi, > > At Synectique we are working on the deployment of a web application > and we would like to force the headless mode. We tried to just > override the method SmalltalkImage>>#isHeadless to return true all the > time be it is not enough because the image is still opened. It is > probabaly the vm that open the window. > > I know we can add some arguments to the command line to open the image > as headless but we want to forbid the user to launch the image without > headless to protect the code. > > Is this possible? Do you have some pointers? it is not. specially on windows. vm handles the creation of host window and you will always have one. now… if you wait one week, I will have ready the (experimental) real headless VMs. In my tests, they are working fine but we will still need to work when we want to actually start a world window… but that’s another story ;) Esteban > > Thanks in advance. > > -- > Cyril Ferlicot > https://ferlicot.fr > > http://www.synectique.eu > 2 rue Jacques Prévert 01, > 59650 Villeneuve d'ascq France >
Re: [Pharo-users] About encoding
I'm reading your chapter :) Now I understand the file I found is totally bogus :) But the first one I found is indeed encoded in latin1. So I'm trying to convert it. On Tue, Sep 26, 2017 at 5:40 PM, Stephane Ducassewrote: >> Any chance you can point me to the original file ? > > No they removed it > May be I could try to convert it to utf-8 (I do not know how to do it) > >> The file is indeed in Latin1 encoded, but GitHub serves it as UTF-8 (it did >> not change the contents, but the meta data). > > Ok I see the problem >> >> The default encoder option only works when the server says nothing, it does >> not override what the server says. > > Ah ok. > >> The only way to read it, is by reading it binary (which basically ignores >> the meta data) and then convert it manually: >> >> (ZnCharacterEncoder latin1 decodeBytes: >> (ZnClient new >> beBinary; >> get: >> 'https://raw.githubusercontent.com/SquareBracketAssociates/LearningOOPWithPharo/master/resources/listeDeMotsFrancaisFrGut.txt')) >> lines. >> >> But this is very ugly. >> >> Best convert the original file to UTF-8 before uploading to GitHub. > > OK I will try to leanr how to do it. > > >> >> Sven >> >> >>
Re: [Pharo-users] Force headless mode
On Tue, Sep 26, 2017 at 5:13 PM, Christophe Demareywrote: > Hi > > What about deploying a minimal image without UI ? > But, as you probably know, headless mode does not prevent to dump the code. > I just tried to build our tools on a minimal image but it crash when trying to load a github's project. I now added a piece of code to update Metacello to a newer version but it just do nothing without any log. I know there is still some way to get the code but this is the first step to build a real delivery image. > Christophe > -- Cyril Ferlicot https://ferlicot.fr http://www.synectique.eu 2 rue Jacques Prévert 01, 59650 Villeneuve d'ascq France
Re: [Pharo-users] About encoding
You can convert it in Pharo, of course: (FileLocator desktop / 'mots.txt') writeStreamDo: [ :out | out << (ZnCharacterEncoder latin1 decodeBytes: (ZnClient new beBinary; get: 'https://raw.githubusercontent.com/SquareBracketAssociates/LearningOOPWithPharo/master/resources/listeDeMotsFrancaisFrGut.txt')) ]. You just take the string as it is in Pharo and write it out to a file, it is by default utf-8 encoded. > On 26 Sep 2017, at 17:40, Stephane Ducassewrote: > >> Any chance you can point me to the original file ? > > No they removed it > May be I could try to convert it to utf-8 (I do not know how to do it) > >> The file is indeed in Latin1 encoded, but GitHub serves it as UTF-8 (it did >> not change the contents, but the meta data). > > Ok I see the problem >> >> The default encoder option only works when the server says nothing, it does >> not override what the server says. > > Ah ok. > >> The only way to read it, is by reading it binary (which basically ignores >> the meta data) and then convert it manually: >> >> (ZnCharacterEncoder latin1 decodeBytes: >> (ZnClient new >>beBinary; >>get: >> 'https://raw.githubusercontent.com/SquareBracketAssociates/LearningOOPWithPharo/master/resources/listeDeMotsFrancaisFrGut.txt')) >> lines. >> >> But this is very ugly. >> >> Best convert the original file to UTF-8 before uploading to GitHub. > > OK I will try to leanr how to do it. > > >> >> Sven >> >> >> >
Re: [Pharo-users] About encoding
> Any chance you can point me to the original file ? No they removed it May be I could try to convert it to utf-8 (I do not know how to do it) > The file is indeed in Latin1 encoded, but GitHub serves it as UTF-8 (it did > not change the contents, but the meta data). Ok I see the problem > > The default encoder option only works when the server says nothing, it does > not override what the server says. Ah ok. > The only way to read it, is by reading it binary (which basically ignores the > meta data) and then convert it manually: > > (ZnCharacterEncoder latin1 decodeBytes: > (ZnClient new > beBinary; > get: > 'https://raw.githubusercontent.com/SquareBracketAssociates/LearningOOPWithPharo/master/resources/listeDeMotsFrancaisFrGut.txt')) > lines. > > But this is very ugly. > > Best convert the original file to UTF-8 before uploading to GitHub. OK I will try to leanr how to do it. > > Sven > > >
Re: [Pharo-users] Usability issues with Calypso
In fact I'm not sure that continuing to use the * is not a good idea. On Sun, Sep 24, 2017 at 2:46 PM, Denis Kudriashovwrote: > Hi Sean > > 2017-09-23 19:57 GMT+02:00 Sean P. DeNigris : >> >> Stephane Ducasse-3 wrote >> > Calypso is still an enfant and this is >> > IMPORTANT that people tell what >> > they do not like so that we can improve. >> >> A few more impressions now that I've been using Calypso as my default >> browser: >> - Overall really enjoying it! >> - When browsing a class from its own package, and then adding an extension >> protocol via '*...' in "New protocol" context menu, the dialog closes >> without objection, but then the new protocol doesn't seem to exist. I had >> to >> create a dummy protocol and then DND the methods into the >> package-to-be-extended. > > > In Calypso you should not create protocols with star. In method editor > status bar there is explicit checkbox "extension" to specify external > package for the method. > We should move away from star convention and work directly with packages. > Calypso gives you the tools for this. > > But I will add special notification when user creates new protocol with > star. I think it will help "old" Pharo users to adopt. > https://github.com/dionisiydk/Calypso/issues/96 > >> >> - When Calypso is set to be the default browser, it would be helpful if >> the >> World menu item changed from "Calypso Browser" to "Nautilus" >> - Lack of word wrapping is becoming teeedious >> >> >> >> - >> Cheers, >> Sean >> -- >> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html >> >
Re: [Pharo-users] About encoding
> On 26 Sep 2017, at 17:25, Stephane Ducassewrote: > > Hi sven > > the web site I was using remove the file for my book. > So I copied the file on github. > When I open the file with texmate it tells that the encoding is western-latin1 > but when I try to load it as follow I get an UTF-8 illegal error. > > | lines | > lines := (ZnDefaultCharacterEncoder > value: ZnCharacterEncoder latin1 > during: [ >ZnClient new > get: > 'https://raw.githubusercontent.com/SquareBracketAssociates/LearningOOPWithPharo/master/resources/listeDeMotsFrancaisFrGut.txt' > ]) lines. > > Do you have any idea? > > Tx > > Stef Any chance you can point me to the original file ? The file is indeed in Latin1 encoded, but GitHub serves it as UTF-8 (it did not change the contents, but the meta data). The default encoder option only works when the server says nothing, it does not override what the server says. The only way to read it, is by reading it binary (which basically ignores the meta data) and then convert it manually: (ZnCharacterEncoder latin1 decodeBytes: (ZnClient new beBinary; get: 'https://raw.githubusercontent.com/SquareBracketAssociates/LearningOOPWithPharo/master/resources/listeDeMotsFrancaisFrGut.txt')) lines. But this is very ugly. Best convert the original file to UTF-8 before uploading to GitHub. Sven
[Pharo-users] About encoding
Hi sven the web site I was using remove the file for my book. So I copied the file on github. When I open the file with texmate it tells that the encoding is western-latin1 but when I try to load it as follow I get an UTF-8 illegal error. | lines | lines := (ZnDefaultCharacterEncoder value: ZnCharacterEncoder latin1 during: [ ZnClient new get: 'https://raw.githubusercontent.com/SquareBracketAssociates/LearningOOPWithPharo/master/resources/listeDeMotsFrancaisFrGut.txt' ]) lines. Do you have any idea? Tx Stef
Re: [Pharo-users] Force headless mode
Or write a script that obfuscate the code. Not so hard to do. On Tue, Sep 26, 2017 at 5:13 PM, Christophe Demarey < christophe.dema...@inria.fr> wrote: > Hi > > What about deploying a minimal image without UI ? > But, as you probably know, headless mode does not prevent to dump the code. > > Christophe > - Cyril Ferlicota écrit : > > Hi, > > > > At Synectique we are working on the deployment of a web application > > and we would like to force the headless mode. We tried to just > > override the method SmalltalkImage>>#isHeadless to return true all the > > time be it is not enough because the image is still opened. It is > > probabaly the vm that open the window. > > > > I know we can add some arguments to the command line to open the image > > as headless but we want to forbid the user to launch the image without > > headless to protect the code. > > > > Is this possible? Do you have some pointers? > > > > Thanks in advance. > > > > -- > > Cyril Ferlicot > > https://ferlicot.fr > > > > http://www.synectique.eu > > 2 rue Jacques Prévert 01, > > 59650 Villeneuve d'ascq France > > > > >
[Pharo-users] Re : Force headless mode
Hi What about deploying a minimal image without UI ? But, as you probably know, headless mode does not prevent to dump the code. Christophe - Cyril Ferlicota écrit : > Hi, > > At Synectique we are working on the deployment of a web application > and we would like to force the headless mode. We tried to just > override the method SmalltalkImage>>#isHeadless to return true all the > time be it is not enough because the image is still opened. It is > probabaly the vm that open the window. > > I know we can add some arguments to the command line to open the image > as headless but we want to forbid the user to launch the image without > headless to protect the code. > > Is this possible? Do you have some pointers? > > Thanks in advance. > > -- > Cyril Ferlicot > https://ferlicot.fr > > http://www.synectique.eu > 2 rue Jacques Prévert 01, > 59650 Villeneuve d'ascq France >
[Pharo-users] Force headless mode
Hi, At Synectique we are working on the deployment of a web application and we would like to force the headless mode. We tried to just override the method SmalltalkImage>>#isHeadless to return true all the time be it is not enough because the image is still opened. It is probabaly the vm that open the window. I know we can add some arguments to the command line to open the image as headless but we want to forbid the user to launch the image without headless to protect the code. Is this possible? Do you have some pointers? Thanks in advance. -- Cyril Ferlicot https://ferlicot.fr http://www.synectique.eu 2 rue Jacques Prévert 01, 59650 Villeneuve d'ascq France
Re: [Pharo-users] Need help with NeoJSON reader definition
Hi Joachim, Have a look at this new example: === Name: Neo-JSON-Tests-SvenVanCaekenberghe.43 Author: SvenVanCaekenberghe Time: 26 September 2017, 2:14:01.71055 pm UUID: f40af758-7816-0d00-89cd-641e08d6220e Ancestors: Neo-JSON-Tests-SvenVanCaekenberghe.42 Add #testVirtualTransferObject as another mapping example === NeoJSONMappingTests>>#testVirtualTransferObject | data customMapping extraJson json result | data := NeoJSONObject new data: { 1@1. 2@2 }. extraJson := '{"foo":1,"data":[{"x":1,"y":1},{"x":2,"y":2,"z":-1}]}'. "The idea here is that we are not interested in the top level object just in its data property, which should be of a specific type, hence we create a virtual transfer object" customMapping := [ :mapper | mapper for: Point do: [ :mapping | mapping mapInstVars: #(x y) ]; for: #ArrayOfPoints customDo: [ :mapping | mapping listOfElementSchema: Point ]; for: #TransferObject do: [ :mapping | mapping subjectClass: NeoJSONObject. (mapping mapAccessor: #data) valueSchema: #ArrayOfPoints ]; yourself ]. "By using NeoJSONObject accessors (#data & #data:) are translated to generic #at:[put:] messages. A longer alternative is (mapping mapProperty: #data getter: [ :obj | obj at: #data ] setter: [ :obj :x | obj at: #data put: x]) valueSchema: #ArrayOfPoints where the blocks give you the flexibility to use a plain Dictionary for example" result := (customMapping value: (NeoJSONReader on: extraJson readStream)) nextAs: #TransferObject. self assert: result equals: data. json := String streamContents: [ :out | (customMapping value: (NeoJSONWriter on: out)) nextPut: data as: #TransferObject ]. result := (customMapping value: (NeoJSONReader on: json readStream)) nextAs: #TransferObject. self assert: result equals: data Does this help ? Sven > On 26 Sep 2017, at 12:01, jtuc...@objektfabrik.de wrote: > > I probably need to send a bit more info. > > My latest attempt was this: > > mapper := NeoJSONReader new. > > mapper for: #RootObject customDo: [:mapping | mapping mapWithValueSchema: > #TransferMessage]. > > mapper > > for: #TransferMessage > > do: [:mapping | > > (mapping mapInstVar: 'Data' to: 'Data') listOfElementSchema: > SomeExistingSmalltalkClass]. > > > which results in > > Symbol does not understand allInstVarNames > > Please note there is no class named #TransferMessage in my Image. This works > for things like #ArrayOfPoints in the examples on the NeoJSON git page and it > also works in some of my other JSON mappings in different contexts. > > I guess this is because I cannot map to instvars if there is no class/object > to store values into... > So do I really need to implement an otherwise useless Smalltalk class just to > have something to map the outermost {} object to? > > I also tried variations of for:customDo: for the mapping of the > #TransferMessage and had no success so far. > > Any ideas? > > > Joachim > > > Am 26.09.17 um 08:29 schrieb jtuc...@objektfabrik.de: >> Hi there, >> >> >> I am having a hard time configuring a NeoJSONReader for a JSON file like >> this: >> >> { >> "Paging": { someStuff >>}, >> "ErrorMessage": null, >> "ErrorCode": 0, >> "Data": [ >> {object1}, >> >> {object2} >> >> ] >> >> } >> >> >> Where I want to ignore everything but the list named "Data". (Of course I'll >> have to take a look at ErrorMessages later, but one step after the other...). >> >> I've tried several combinations of mappers and always end up with NoeJSON >> parsing Exceptions. I semm unable to see the obvious. >> >> In The end I just want to only use the contents of the Data list and map >> each entry in there to some smalltalk object. I was successful with other >> structures and lists, but this time I am unable to see the forest among all >> those trees. >> >> Any hints? >> >> >> Joachim >> >> >> >> >> > > -- > --- > Objektfabrik Joachim Tuchel mailto:jtuc...@objektfabrik.de > Fliederweg 1 http://www.objektfabrik.de > D-71640 Ludwigsburg http://joachimtuchel.wordpress.com > Telefon: +49 7141 56 10 86 0 Fax: +49 7141 56 10 86 1 > >
Re: [Pharo-users] Testing a Unicode Character's Category
Hi Richard, Normally I agree with you, and prefer boolean methods inCatagoryCc: aChar isCategorySm: aChar to categoryOf: aChar == #Cc categoryOf: aChar == #Sm In this particular case, though, the category codes are part of the Unicode Standard, so perhaps exposing them isn’t so bad. Moreover, there is meaning encoded into the symbols — for example, all the letter categories start with L. So one could write an isLetter test like this Character >> isLetter ^ (Unicode categoryOf: self) first == $L rather than Character >> isLetter Unicode inCategoryLl ifTrue: [ ^ true ]. Unicode inCategoryLm ifTrue: [ ^ true ]. Unicode inCategoryLo ifTrue: [ ^ true ]. Unicode inCategoryLt ifTrue: [ ^ true ]. Unicode inCategoryLu ifTrue: [ ^ true ]. ^ false There is still the disadvantage that a typo in the Category name (typing #L1, for example, when one means #Ll) is likely to go undetected. Andrew
Re: [Pharo-users] NeoJSON and polymorphism
> On 25 Sep 2017, at 17:14, Juraj Kubelkawrote: > > Hi Sven, > > thank you! > > In the NeoJSON repository, you likely want to merge > Neo-JSON-Core-SvenVanCaekenberghe.43 and 44. And the same for the test cases. I did, thanks ! >> On Sep 24, 2017, at 06:05, Sven Van Caekenberghe wrote: >> >> Hi Juraj, >> >> This would be a simpler form of the type/class tags that are often used in >> JSON encoding. Since there are many ways to do this, there cannot be one >> solution. NeoJSON mapping was not designed to cover these cases. Nor is JSON >> meant to do this. STON is one (rather elegant if I may say so) answer to >> this problem. Your example would be encoded as >> >> [ >> PngAttachement { #url:'http://example.com/random-name.txt', >> #fileName:'chapter-one.txt' }, >> TxtAttachement { #url:'http://example.com/random-name.png', >> #fileName:'image.png' } >> ] > > About STON usage, I wonder how it works in terms of a data structure > evolution. Currently I use JSON format to store a data permanently. The data > are supposed to be accesible for a long time (years). I am pretty sure that > the protocol will evolve and we will end up with several JSON versions. I > think that having different JSON mapping schemes will allow to map old JSON > versions to a latest object structure (or to several different versions if > necessary). > > For the example above, think of the scenario that PngAttachment does not > exist anymore. In a simple scenario there could be an ImageAttachment class > instead with the same instance variables. In a more complex scenario, there > could be a AttachmentTwo { #type: AttachmentTwoType { … instances … }, #path: > AttachmentTwoPath { … instances … } }. > > I can use JSON mappings that transform the old JSON version to the new class > structure. I am not sure if STON is that flexible. > What do you think? Do I miss something? STON has no options for more than one mapping (the 'system' one). Schema evolution is always a hard problem, using temporary structures seems the simplest solution. The STON specification has not changed significantly since I first wrote it years ago. The implementation and the number of cases handled has though. >> Still, the question of how to do this kind of dynamic decoding is an >> interesting challenge. Please update to the following commits: >> >> === >> Name: Neo-JSON-Core-SvenVanCaekenberghe.44 >> Author: SvenVanCaekenberghe >> Time: 22 September 2017, 3:24:51.679449 pm >> UUID: f1ebeade-2816-0d00-a04c-ae370e598362 >> Ancestors: Neo-JSON-Core-SvenVanCaekenberghe.42 >> >> Implement some missing code in NeoJSONCustomMapping (the writing part of >> #listOfElementSchema: #listOfType:andElementSchema: #mapWithValueSchema:) >> >> Add NeoJSONStreamingWriter>>#writeElementAs: >> >> Add NeoJSONMappingTests>>#testDynamicTyping as an example >> === >> Name: Neo-JSON-Tests-SvenVanCaekenberghe.41 >> Author: SvenVanCaekenberghe >> Time: 22 September 2017, 3:25:09.881494 pm >> UUID: a9a900e0-2816-0d00-a04d-a6fb0e598362 >> Ancestors: Neo-JSON-Tests-SvenVanCaekenberghe.39 >> >> Implement some missing code in NeoJSONCustomMapping (the writing part of >> #listOfElementSchema: #listOfType:andElementSchema: #mapWithValueSchema:) >> >> Add NeoJSONStreamingWriter>>#writeElementAs: >> >> Add NeoJSONMappingTests>>#testDynamicTyping as an example >> === >> >> Now you can do as follows: >> >> NeoJSONMappingTests>>#testDynamicTyping >> | data customMapping json result | >> data := Array with: #foo->1 with: #(foo 2). >> "The idea is to map a key value combination as either a classic association >> or a simple pair, >> using key & value properties as well as a type property to distinguish >> between the two" >> customMapping := [ :mapper | >> mapper >> for: #AssocOrPair customDo: [ :mapping | >> mapping >> encoder: [ :x | >> x isArray >> ifTrue: [ { #type->#pair. #key->x first. #value->x second } >> asDictionary ] >> ifFalse: [ { #type->#assoc. #key->x key. #value->x value } >> asDictionary ] ]; >> decoder: [ :x | >> (x at: #type) = #pair >> ifTrue: [ Array with: (x at: #key) with: (x at: #value) ] >> ifFalse: [ (x at: #key) -> (x at: #value)] ] ]; >> for: #ArrayOfAssocOrPair customDo: [ :mapping | >> mapping listOfType: Array andElementSchema: #AssocOrPair ]; >> yourself ]. >> json := String streamContents: [ :out | >> (customMapping value: (NeoJSONWriter on: out)) nextPut: data as: >> #ArrayOfAssocOrPair ]. >> result := (customMapping value: (NeoJSONReader on: json readStream)) nextAs: >> #ArrayOfAssocOrPair. >> self assert: result equals: data >> >> Everything is virtual (not implemented as methods on actual classes) which >> makes the example self contained and non intrusive, but not very elegant, >> nor object oriented or extendable. Also, it is not as efficient as
Re: [Pharo-users] Pharo 7 license question
On Mon, Sep 25, 2017 at 9:43 PM, Jimmie Houchinwrote: > Hello, thanks for the reply. > > I have thought about recursive and unfortunately it is not in my opinion > an adequate or equivalent substitute. It may be inoffensive, but it is not > accurate in conveying those properties or characteristics of the GPL. > Something that is recursive generally makes repeated calls to itself. It is > neatly contained and does not propagate outside of itself. Calling a > recursive method does not make the call chain all the way up to main > recursive. The recursive method does its recursion and generally returns > its result back to the caller, ending the recursion. The only thing the > caller receives is the results, not the recursion. > > There are many positive cultural references to something viral or > infect(ious). For something to go viral, depends on what that something is. > She has an infectious smile, or laugh. Even in biology where we get the > term viral. It is not absolutely or always negative. There are things that > scientist attempt to use viral characteristics to do good things. Context > is everything. > > There are no words a GPL proponent could provide which adequately or > otherwise describe the viral characteristic of the GPL that would be > considered positive by a GPL opponent. > > Back to context. > > To a GPL proponent, the viral nature of the GPL is considered a positive > and good thing. It is the primary reason to choose and use the GPL. > > To the GPL opponent, the viral nature of the GPL is considered a negative > and bad thing. It is the primary reason to oppose and to avoid using the > GPL. > > Two side both viewing the same exact thing and understanding it very > differently. One positive, one negative. There is no positive spin for this > aspect of the GPL for someone wishing to avoid that aspect. No matter what > words are chosen. > > For the MIT/BSD person we don't necessarily care if you wish to license > your software under the GPL. What we care is that your software is > expressly and explicitly trying to override our choices and compel us to > become GPL. That is what we don't like. The fact that GPL software is GPL > software in perpetuity is okay. Just leave us alone. But we know that is > not how the GPL works. > > > A perspective occurred to me this morning. The original author of GPL > software is not bound by the GPL. I think this thread has run its course for now, but just a quick clarification here. The above is only true up until they accept the first contribution from another party - so its not a good argument. cheers -ben . > They have freedoms the GPL takes away. They have the freedom to turn their > software into closed source, proprietary software. They have the freedom to > not release all of their modifications. They have the freedom to not infect > all their other software which may use this otherwise GPLd code. They have > freedom to relicense their software. They have many, many freedoms which > the GPL removes from everyone who receives the GPLd software. The original > author of GPL software has for himself MIT like freedoms. > > What we on the MIT/BSD side of things want is for everybody to have all of > the freedoms the original author of the software has. People who receive > our software maintain all freedoms. > > I have seen over the years many GPL licensed projects change to some more > permissive license. Once they did so, the success of the project improved. > They had greater buy in, and an increase in use. It increased the size of > the open source community and an increase in the code base of an open > source project. These are good things. > > Here I will let it rest. I don't know what else can be expressed to help > clarify both sides. > > Jimmie > > > > > > > > On 09/22/2017 03:27 AM, Hilaire wrote: > >> The appropriate and neutral term to describe GPL licence is "recursive". >> >> GPL licence was designed to build a better computing community, where >> freedom is 1st consideration, even at the expense of a lower acceptance. >> >> Hilaire >> >> >> Le 20/09/2017 à 21:30, Jimmie Houchin a écrit : >> >>> So my question to you. What words would you use instead of viral and >>> infection that equally describe that characteristic of the GPL and variants? >>> >> >> > >
Re: [Pharo-users] Need help with NeoJSON reader definition
I probably need to send a bit more info. My latest attempt was this: mapper := NeoJSONReader new. mapper for: #RootObject customDo: [:mapping | mapping mapWithValueSchema: #TransferMessage]. mapper for: #TransferMessage do: [:mapping | (mapping mapInstVar: 'Data' to: 'Data') listOfElementSchema: SomeExistingSmalltalkClass]. which results in Symbol does not understand allInstVarNames Please note there is no class named #TransferMessage in my Image. This works for things like #ArrayOfPoints in the examples on the NeoJSON git page and it also works in some of my other JSON mappings in different contexts. I guess this is because I cannot map to instvars if there is no class/object to store values into... So do I really need to implement an otherwise useless Smalltalk class just to have something to map the outermost {} object to? I also tried variations of for:customDo: for the mapping of the #TransferMessage and had no success so far. Any ideas? Joachim Am 26.09.17 um 08:29 schrieb jtuc...@objektfabrik.de: Hi there, I am having a hard time configuring a NeoJSONReader for a JSON file like this: { "Paging": { someStuff }, "ErrorMessage": null, "ErrorCode": 0, "Data": [ {object1}, {object2} ] } Where I want to ignore everything but the list named "Data". (Of course I'll have to take a look at ErrorMessages later, but one step after the other...). I've tried several combinations of mappers and always end up with NoeJSON parsing Exceptions. I semm unable to see the obvious. In The end I just want to only use the contents of the Data list and map each entry in there to some smalltalk object. I was successful with other structures and lists, but this time I am unable to see the forest among all those trees. Any hints? Joachim -- --- Objektfabrik Joachim Tuchel mailto:jtuc...@objektfabrik.de Fliederweg 1 http://www.objektfabrik.de D-71640 Ludwigsburg http://joachimtuchel.wordpress.com Telefon: +49 7141 56 10 86 0 Fax: +49 7141 56 10 86 1
Re: [Pharo-users] Usability issues with Calypso
2017-09-26 3:26 GMT+02:00 Sean P. DeNigris: > Denis Kudriashov wrote > > In Calypso you should not create protocols with star. In method editor > > status bar there is explicit checkbox "extension" to specify external > > package for the method. > > We should move away from star convention and work directly with packages. > > Calypso gives you the tools for this. > > Aha! Cool and agreed. However, when I check the box on an existing method > and select a package, the method doesn't seem to move to the over package > :/ > It needs more love. Now these options are working like code editing - you need accept changes of the method. And this logic has missing parts: - cmd+s do not work when status bar tools are in focus. - you should always make source code dirty to accept changes. - method editor does not mark tab as dirty when you edit method only with status bar tools. And it does not prevent browser closing in that case. > > > > - > Cheers, > Sean > -- > Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html > >
[Pharo-users] Need help with NeoJSON reader definition
Hi there, I am having a hard time configuring a NeoJSONReader for a JSON file like this: { "Paging": { someStuff }, "ErrorMessage": null, "ErrorCode": 0, "Data": [ {object1}, {object2} ] } Where I want to ignore everything but the list named "Data". (Of course I'll have to take a look at ErrorMessages later, but one step after the other...). I've tried several combinations of mappers and always end up with NoeJSON parsing Exceptions. I semm unable to see the obvious. In The end I just want to only use the contents of the Data list and map each entry in there to some smalltalk object. I was successful with other structures and lists, but this time I am unable to see the forest among all those trees. Any hints? Joachim