Re: [Pharo-users] UFFI and Fortran

2017-11-02 Thread Todd Blanchard
Yes - the reason I've been trying to learn FFI is specifically to get 
TensorFlow integration.

I want a better ML workbench.

> On Nov 2, 2017, at 9:08 PM, Ben Coman  wrote:
> 
> 
> 
> On Fri, Nov 3, 2017 at 11:10 AM, horrido  > wrote:
> Sounds like it's possible to call into TensorFlow (Python) from Pharo. That
> would give Pharo a tremendous boost for machine learning applications.
> 
> Am I right?
> 
> Tensorflow has a C API for FFI from other languages.
> * https://www.tensorflow.org/install/install_c 
> 
> * https://www.tensorflow.org/extend/language_bindings 
> 
> 
> cheers -ben
> 
> 
> 
> kilon.alios wrote
> > Maybe you talk about TalkFFI which aumatically wrapped C libraries for
> > Pharo and i think Squeak as well but used Nativeboos, i think
> >
> > http://forum.world.st/TalkFFI-automatic-FFI-generation-for-Pharo-td4662239.html
> >  
> > 
> >
> > On the subject of Fortran yes you can use UFFI if Fortran code is compiled
> > as a DLL (or equivelant non Windoom OSes)
> >
> > https://software.intel.com/en-us/node/535305 
> > 
> >
> > Dynamic Library format are not exclusive to C for generation , many
> > languages can generate them so even though UFFI is used predominatly for C
> > any language that can generate a DLL without any name mangling should be
> > accessible via UFFI.
> >
> > if DLL generation is not possible, then you can drop down to my solution
> > of
> > Shared Memory Mapped Files. Which means you make an executable in Frotran
> > (or any other language)  that contains the code you want to access and
> > creates a shared memory region and you can access that region from Pharo
> > via UFFI.
> >
> > This is how I built my CPPBridge project. Which one can use as a template
> > for generating similar bridge for Fortran or any other language where the
> > generation of DLLs is not practical or possible.
> >
> > The shared memory region can be used also as a means of communication
> > additional to sharing live state, memory mapped files automatically save
> > the live state so next time you open the file it behaves as you would
> > expect a Pharo image to behave by restoring the live state. A means to
> > extend Pharo image to include memory not managed by the VM.
> >
> > Because memory mapped files is mechanism of the OS Kernel and is also the
> > mechanism used for the loading of dynamic libraries like DLLs there is
> > also
> > no loss of performance and is the fastest way of communication between
> > languages, libraries and applications.
> >
> > So yes using Fortran code is possible via UFFI in more than one way.
> >
> > But in the end it should be noted here that because IPC mechanisms (common
> > way of using libraries from other languages) are based on core OS
> > functionality like , memory managment, sockets , pipes, etc its not hard
> > to
> > use libraries from any language from inside any language.
> >
> > So Pharo can use Fortran libraries and Fortran can use Pharo libraries,
> > its
> > also possible to retain live coding even when executing code written in
> > another language through various means. Recently I was succesful in making
> > Python into a basic live coding enviroment , meaning code that when
> > changed
> > in the source file it updates also existing live intances as you expect in
> > Pharo. Python also supports memory mapped files so its possible to create
> > a
> > joined live coding enviroment and live image that containes both Pharo and
> > Python bytecode. Of course without touching VM source code.
> >
> > Even though live state is not tricky to retain for compiled languages,
> > live
> > code can be a bit trickier to do but still not impossible or that hard as
> > most would assume.
> >
> > Sky is the limit.
> >
> > Bottom line is that if you have a favorite library in any language you can
> > use it from inside Pharo with at worst a few hundrend lines of setup code
> > you can create as a library and of coure reuse next time you want to use
> > again a library from another language without having to write a line of
> > additional code. The technology is available is just a matter of learning
> > how to use it.  Especially if its a very large libraries it will be
> > thousands times easier than trying to replicate the functionality in
> > Pharo.
> >
> >
> >
> > On Fri, Oct 27, 2017 at 6:26 PM Sean P. DeNigris 
> 
> > sean@
> 
> > 
> > wrote:
> >
> >> Ben Coman wrote
> >> > it seems to hint how to do it from Pharo UFFI.
> >>
> >> Slightly OT: I remember years ago, someone (Dave Mason?) demoed a library
> >> which automatically created FFI wrappers for C libs. I never heard
> >> anything
> >> about it after that, which is sad, because I was amazed and 

Re: [Pharo-users] UFFI and Fortran

2017-11-02 Thread Ben Coman
On Fri, Nov 3, 2017 at 11:10 AM, horrido  wrote:

> Sounds like it's possible to call into TensorFlow (Python) from Pharo. That
> would give Pharo a tremendous boost for machine learning applications.
>
> Am I right?
>

Tensorflow has a C API for FFI from other languages.
* https://www.tensorflow.org/install/install_c
* https://www.tensorflow.org/extend/language_bindings

cheers -ben


>
> kilon.alios wrote
> > Maybe you talk about TalkFFI which aumatically wrapped C libraries for
> > Pharo and i think Squeak as well but used Nativeboos, i think
> >
> > http://forum.world.st/TalkFFI-automatic-FFI-generation-for-
> Pharo-td4662239.html
> >
> > On the subject of Fortran yes you can use UFFI if Fortran code is
> compiled
> > as a DLL (or equivelant non Windoom OSes)
> >
> > https://software.intel.com/en-us/node/535305
> >
> > Dynamic Library format are not exclusive to C for generation , many
> > languages can generate them so even though UFFI is used predominatly for
> C
> > any language that can generate a DLL without any name mangling should be
> > accessible via UFFI.
> >
> > if DLL generation is not possible, then you can drop down to my solution
> > of
> > Shared Memory Mapped Files. Which means you make an executable in Frotran
> > (or any other language)  that contains the code you want to access and
> > creates a shared memory region and you can access that region from Pharo
> > via UFFI.
> >
> > This is how I built my CPPBridge project. Which one can use as a template
> > for generating similar bridge for Fortran or any other language where the
> > generation of DLLs is not practical or possible.
> >
> > The shared memory region can be used also as a means of communication
> > additional to sharing live state, memory mapped files automatically save
> > the live state so next time you open the file it behaves as you would
> > expect a Pharo image to behave by restoring the live state. A means to
> > extend Pharo image to include memory not managed by the VM.
> >
> > Because memory mapped files is mechanism of the OS Kernel and is also the
> > mechanism used for the loading of dynamic libraries like DLLs there is
> > also
> > no loss of performance and is the fastest way of communication between
> > languages, libraries and applications.
> >
> > So yes using Fortran code is possible via UFFI in more than one way.
> >
> > But in the end it should be noted here that because IPC mechanisms
> (common
> > way of using libraries from other languages) are based on core OS
> > functionality like , memory managment, sockets , pipes, etc its not hard
> > to
> > use libraries from any language from inside any language.
> >
> > So Pharo can use Fortran libraries and Fortran can use Pharo libraries,
> > its
> > also possible to retain live coding even when executing code written in
> > another language through various means. Recently I was succesful in
> making
> > Python into a basic live coding enviroment , meaning code that when
> > changed
> > in the source file it updates also existing live intances as you expect
> in
> > Pharo. Python also supports memory mapped files so its possible to create
> > a
> > joined live coding enviroment and live image that containes both Pharo
> and
> > Python bytecode. Of course without touching VM source code.
> >
> > Even though live state is not tricky to retain for compiled languages,
> > live
> > code can be a bit trickier to do but still not impossible or that hard as
> > most would assume.
> >
> > Sky is the limit.
> >
> > Bottom line is that if you have a favorite library in any language you
> can
> > use it from inside Pharo with at worst a few hundrend lines of setup code
> > you can create as a library and of coure reuse next time you want to use
> > again a library from another language without having to write a line of
> > additional code. The technology is available is just a matter of learning
> > how to use it.  Especially if its a very large libraries it will be
> > thousands times easier than trying to replicate the functionality in
> > Pharo.
> >
> >
> >
> > On Fri, Oct 27, 2017 at 6:26 PM Sean P. DeNigris 
>
> > sean@
>
> > 
> > wrote:
> >
> >> Ben Coman wrote
> >> > it seems to hint how to do it from Pharo UFFI.
> >>
> >> Slightly OT: I remember years ago, someone (Dave Mason?) demoed a
> library
> >> which automatically created FFI wrappers for C libs. I never heard
> >> anything
> >> about it after that, which is sad, because I was amazed and wanted to
> use
> >> it!
> >>
> >>
> >>
> >> -
> >> Cheers,
> >> Sean
> >> --
> >> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
> >>
> >>
>
>
>
>
>
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>
>


[Pharo-users] NeoCSV #skipToNextLine or #skipRemainingColumns ?

2017-11-02 Thread PAUL DEBRUICKER
Hi - 

I want to import the first and seventh column from a set of 50 csv files each 
of which could have 28 - 34 columns.  Is there a way to have NeoCSV skip the 
remaining columns automatically (e.g. 8 and up) ?

Thanks

Paul




Re: [Pharo-users] UFFI and Fortran

2017-11-02 Thread horrido
Sounds like it's possible to call into TensorFlow (Python) from Pharo. That
would give Pharo a tremendous boost for machine learning applications.

Am I right?


kilon.alios wrote
> Maybe you talk about TalkFFI which aumatically wrapped C libraries for
> Pharo and i think Squeak as well but used Nativeboos, i think
> 
> http://forum.world.st/TalkFFI-automatic-FFI-generation-for-Pharo-td4662239.html
> 
> On the subject of Fortran yes you can use UFFI if Fortran code is compiled
> as a DLL (or equivelant non Windoom OSes)
> 
> https://software.intel.com/en-us/node/535305
> 
> Dynamic Library format are not exclusive to C for generation , many
> languages can generate them so even though UFFI is used predominatly for C
> any language that can generate a DLL without any name mangling should be
> accessible via UFFI.
> 
> if DLL generation is not possible, then you can drop down to my solution
> of
> Shared Memory Mapped Files. Which means you make an executable in Frotran
> (or any other language)  that contains the code you want to access and
> creates a shared memory region and you can access that region from Pharo
> via UFFI.
> 
> This is how I built my CPPBridge project. Which one can use as a template
> for generating similar bridge for Fortran or any other language where the
> generation of DLLs is not practical or possible.
> 
> The shared memory region can be used also as a means of communication
> additional to sharing live state, memory mapped files automatically save
> the live state so next time you open the file it behaves as you would
> expect a Pharo image to behave by restoring the live state. A means to
> extend Pharo image to include memory not managed by the VM.
> 
> Because memory mapped files is mechanism of the OS Kernel and is also the
> mechanism used for the loading of dynamic libraries like DLLs there is
> also
> no loss of performance and is the fastest way of communication between
> languages, libraries and applications.
> 
> So yes using Fortran code is possible via UFFI in more than one way.
> 
> But in the end it should be noted here that because IPC mechanisms (common
> way of using libraries from other languages) are based on core OS
> functionality like , memory managment, sockets , pipes, etc its not hard
> to
> use libraries from any language from inside any language.
> 
> So Pharo can use Fortran libraries and Fortran can use Pharo libraries,
> its
> also possible to retain live coding even when executing code written in
> another language through various means. Recently I was succesful in making
> Python into a basic live coding enviroment , meaning code that when
> changed
> in the source file it updates also existing live intances as you expect in
> Pharo. Python also supports memory mapped files so its possible to create
> a
> joined live coding enviroment and live image that containes both Pharo and
> Python bytecode. Of course without touching VM source code.
> 
> Even though live state is not tricky to retain for compiled languages,
> live
> code can be a bit trickier to do but still not impossible or that hard as
> most would assume.
> 
> Sky is the limit.
> 
> Bottom line is that if you have a favorite library in any language you can
> use it from inside Pharo with at worst a few hundrend lines of setup code
> you can create as a library and of coure reuse next time you want to use
> again a library from another language without having to write a line of
> additional code. The technology is available is just a matter of learning
> how to use it.  Especially if its a very large libraries it will be
> thousands times easier than trying to replicate the functionality in
> Pharo.
> 
> 
> 
> On Fri, Oct 27, 2017 at 6:26 PM Sean P. DeNigris 

> sean@

> 
> wrote:
> 
>> Ben Coman wrote
>> > it seems to hint how to do it from Pharo UFFI.
>>
>> Slightly OT: I remember years ago, someone (Dave Mason?) demoed a library
>> which automatically created FFI wrappers for C libs. I never heard
>> anything
>> about it after that, which is sad, because I was amazed and wanted to use
>> it!
>>
>>
>>
>> -
>> Cheers,
>> Sean
>> --
>> 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] UFFI and Fortran

2017-11-02 Thread Todd Blanchard
SmalltalkAgents used to be able to point to any shared library and import all 
the functions.

> On Oct 27, 2017, at 8:26 AM, Sean P. DeNigris  wrote:
> 
> Ben Coman wrote
>> it seems to hint how to do it from Pharo UFFI.
> 
> Slightly OT: I remember years ago, someone (Dave Mason?) demoed a library
> which automatically created FFI wrappers for C libs. I never heard anything
> about it after that, which is sad, because I was amazed and wanted to use
> it!
> 
> 
> 
> -
> Cheers,
> Sean
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
> 




Re: [Pharo-users] Writing "powerpoint" like presentations in Pharo?

2017-11-02 Thread Tim Mackinnon
Thanks Stef - I’ll see if I can reincarnate it in the time that I have - if 
not, maybe this might be my next side project (just need to get my IntelliPharo 
keybindings over the hill).

It looks like it's just the basics right?

You add morphs in a script I'm guessing from the tests.

Although TextMorph seems broken in Pharo6 in that halos won't let you edit text 
(walkback) and halos won't let you set text size or bold (they do nothing)? 
Which is a shame for this kind application - but with Bric maybe it's expected?

Anyway - this gives me a head start.

Tim



Sent from my iPhone
> On 2 Nov 2017, at 17:25, Stephane Ducasse  wrote:
> 
> I did that (well argh more than 12 years ago) now I do not think that
> I can find the code I will try
> It looks like I loaded in Pharo some years ago.
> Here the latest code I found (At that time I developed test first).
> I'm not sure that I will have the time to get a look.
> 
> 
> Stef
> 
>> On Wed, Nov 1, 2017 at 7:35 PM, Tim Mackinnon  wrote:
>> Hi - has anyone made anything where you can create a full screen 
>> presentation in Pharo with slides with some large text, bullet points and 
>> embedded pictures - but then it’s a facade that lets you evaluate items in 
>> the slide or jump to any code mentioned?
>> 
>> Sort of like what Alan Kay does in the eToys images?
>> 
>> I need to do a presentation next week and I always loved it when I was 
>> fooled into thinking I was looking at a static’ish powerpoint and then 
>> suddenly realised it was a live environment.
>> 
>> It doesn’t sound that hard to do something simple - but I’m not sure if I 
>> can pull it off in time for my presentation. But am curious if we have 
>> something.
>> 
>> (For bonus points, GT-Spotter stuff would work in it over top of the 
>> presentation to demonstrate simple things)
>> 
>> Tim
> 





Re: [Pharo-users] LiteratureResearcher - where graphs, PDFs, and BibTex happily live together

2017-11-02 Thread Manuel Leuenberger
Hi Stef,

The PDF integration consists of three parts:

1. CERMINE (https://github.com/CeON/CERMINE ) 
is fed with the PDF and outputs metadata as BibTex and a structured XML (title, 
authors, affiliations, abstract, keyword, references, …). This is not perfect, 
but way better than any other metadata extractor I could find.
2. From the metadata I generate hyperlinks that are anchored in the PDF by a 
text key. pdf-linker (https://github.com/maenu/pdf-linker 
) then searches for the anchors in the PDF 
text, using heuristics, as PDF has a document model that is primarily intended 
for rendering and printing, but not for processing. The hyperlinks are then 
inserted using the awesome Apache PDFBox (https://pdfbox.apache.org/ 
).
3. Those hyperlinks point to an URI like 
“pharo://handle/clickReference.in.?args=1=2” to represent a reference 1 in 
the paper 2. Now comes the magic part: The OS allows you to register custom 
handlers for custom URI schemes like pharo://. For that I created a simple 
Objective-C app that handles the event and passes it over as a HTTP message to 
a server running in Pharo (https://github.com/maenu/PharoUriScheme 
). The OS will even start the 
application if it is not yet running.

While the custom URI scheme approach is super powerful, it has critical 
drawbacks. Any application can request to be the receiver of a URI scheme, just 
as browser are for http://. Especially on mobile devices with limited access to 
the OS, this opens up an attack point for malware apps that replicate original 
apps that make use of schemes like facebook:// and eavesdrop all interactions. 
If an original app transmits any unencrypted secrets or user data encoded in 
those URIs, malware can easily intercept it without the user noticing the leak. 
I guess this is the reason why many PDF viewer just support the standard 
http:// and mailto:// schemes. E.g., macOS Preview gives just an audible beep 
when I click on a pharo:// link, Chromes viewer doesn’t even bother giving any 
feedback. Only Adobe Acrobat allows you to relax security settings to make them 
work (How could it be someone else than Adobe, when it’s a security issue? ;).

I finished basic packaging today and will continue with some READMEs and a 
nearly-all-in-one distribution tomorrow, I’ll keep you posted in this thread.

Cheers,
Manuel

> On 2 Nov 2017, at 18:08, Stephane Ducasse  wrote:
> 
> Hi manuel
> 
> this is super cool :)
> Could you describe how you did the pdf integration?
> And yes please package it :)
> I want to try it.
> 
> Stef
> 
> On Wed, Nov 1, 2017 at 10:16 PM, Manuel Leuenberger
>  wrote:
>> Hi everyone,
>> 
>> I was experimenting in the last few weeks with my take on literature
>> research. For me, the corpus of scientific papers form an interconnected
>> graph, not those plain lists and tables we keep in our bibliographies. So,
>> here is the first prototype that has Google Scholar integration for search,
>> can fetch PDFs from IEEE and ACM, extracts metadata from PDFs - all this
>> results in hyperlinked PDFs!
>> 
>> See a demo here: https://youtu.be/EcK3Pt_WnEw
>> Also slides from the SCG seminar here:
>> http://scg.unibe.ch/download/softwarecomposition/2017-10-31-Leuenberger-ILE.pdf
>> 
>> I plan on packaging it, so that those who are interested can check it out
>> themselves (help wanted!). Currently, it only works on macOS.
>> 
>> What do you think of my approach? Which use cases should be added?
>> 
>> Cheers,
>> Manuel
>> 
> 



Re: [Pharo-users] LiteratureResearcher - where graphs, PDFs, and BibTex happily live together

2017-11-02 Thread Manuel Leuenberger
Hi Offray,

That’s a lot to process for me, I need some time to inspect your workflow to 
find the possible connections with the ILE. I will do that in the next few days 
and give you more detailed feedback.

As for the Linux testers, I will gladly come back to you. I think it won’t be 
too hard to make the ILE support Linux and Windows. The platform dependency is 
only induced by the way an OS allows one to register custom URI schemes.

Cheers,
Manuel

> On 2 Nov 2017, at 18:03, Offray Vladimir Luna Cárdenas 
>  wrote:
> 
> Hi Manuel,
> 
> This is really interesting! I like the idea of a graph and the way ILE 
> manages metadata importation. Grafoscopio [1][2][3], is the software I'm 
> creating for reproducible research and literate computing (mixing prose, 
> code, queries, data and visualizations). It has alpha support for Zotero and 
> I think that ILE and Grafoscopio could work together to provide researcher 
> support for creating and working with research literature.
> 
> [1] http://mutabit.com/grafoscopio/index.en.html 
> 
> [2] http://mutabit.com/repos.fossil/alvicoda/doc/tip/index.html 
> 
> [3] http://joss.theoj.org/papers/c92ed13fa746bc681081f9b31678841b 
> 
> Now my research workflow includes Pharo, TeXStudio, Grafoscopio, Zotero, 
> Docear[4] and Hypothesis[5] to map and annotate research literature, but 
> there is a lot of context switching, as you point in your presentation, and 
> lack of moldability that we could get rid of, if those tools were integrated 
> into Pharo. To manage this, I usually have two screens (see screenshot below) 
> where I made annotated reading (in hypothesis) and map readings (in Docear). 
> That is because Docear is not integrated (yet) with Hypothesis, which has a 
> superb annotation system.
> 
> [4] http://www.docear.org/ 
> [5] https://web.hypothes.is/ 
> I would like to have a similar tree like Docear reading interface , connected 
> with the annotated reading of hypothesis (tags and comments), inside 
> Pharo/Grafoscopio. In my ideal workflow I would add a bibliography item to 
> Zotero (using add item by ID or dropping the URL/PDF), open it (getting the 
> table of contents map inside Pharo, ala Docear and thanks to Hypothesis) and 
> I would start to annotate and tag my readings. After that, some DSL would 
> allow me to recover, visualize and export such annotations to be put inside 
> of or connected with a Grafoscopio notebook and there I would finish the 
> research writing. 
> What do you think of this workflow? Could ILE support or be part of it in 
> some way?
> 
> Once you have packaged ILE, I could help as a tester in Gnu/Linux.
> Cheers,
> 
> Offray
> 
> 
> On 01/11/17 16:16, Manuel Leuenberger wrote:
>> Hi everyone,
>> 
>> I was experimenting in the last few weeks with my take on literature 
>> research. For me, the corpus of scientific papers form an interconnected 
>> graph, not those plain lists and tables we keep in our bibliographies. So, 
>> here is the first prototype that has Google Scholar integration for search, 
>> can fetch PDFs from IEEE and ACM, extracts metadata from PDFs - all this 
>> results in hyperlinked PDFs!
>> 
>> See a demo here: https://youtu.be/EcK3Pt_WnEw 
>> Also slides from the SCG seminar here: 
>> http://scg.unibe.ch/download/softwarecomposition/2017-10-31-Leuenberger-ILE.pdf
>>  
>> 
>> 
>> I plan on packaging it, so that those who are interested can check it out 
>> themselves (help wanted!). Currently, it only works on macOS.
>> 
>> What do you think of my approach? Which use cases should be added?
>> 
>> Cheers,
>> Manuel
>> 
> 



Re: [Pharo-users] LiteratureResearcher - where graphs, PDFs, and BibTex happily live together

2017-11-02 Thread Manuel Leuenberger
Hi Bernardo,

Thanks for the Xanadu hint. Indeed I made similar observations as Ted Nelson: 
We use desktop machines to replicate physical paper on the screen, blatantly 
ignoring that we can easily break the constraints of paper on a computer. This 
reminds a bit of Roy Fieldings thesis about REST, where he clearly defined what 
REST is. Yet, most implementations tagging themselves with REST are just RPC. 
People seem to look at technological concepts, take out all the good parts, 
only keep the name and claims, yet doing something different, but still 
marketing it as innovative and modern.

Cheers,
Manuel

> On 2 Nov 2017, at 00:06, Bernardo Ezequiel Contreras  
> wrote:
> 
> really nice! ted nelson talks about something like that in his xanadu project.
> 
> On Wed, Nov 1, 2017 at 6:16 PM, Manuel Leuenberger  > wrote:
> Hi everyone,
> 
> I was experimenting in the last few weeks with my take on literature 
> research. For me, the corpus of scientific papers form an interconnected 
> graph, not those plain lists and tables we keep in our bibliographies. So, 
> here is the first prototype that has Google Scholar integration for search, 
> can fetch PDFs from IEEE and ACM, extracts metadata from PDFs - all this 
> results in hyperlinked PDFs!
> 
> See a demo here: https://youtu.be/EcK3Pt_WnEw 
> Also slides from the SCG seminar here: 
> http://scg.unibe.ch/download/softwarecomposition/2017-10-31-Leuenberger-ILE.pdf
>  
> 
> 
> I plan on packaging it, so that those who are interested can check it out 
> themselves (help wanted!). Currently, it only works on macOS.
> 
> What do you think of my approach? Which use cases should be added?
> 
> Cheers,
> Manuel
> 
> 
> 
> 
> -- 
> Bernardo E.C.
> 
> Sent from a cheap desktop computer in South America.



Re: [Pharo-users] New Pharo Booklet

2017-11-02 Thread Stephane Ducasse
Hi renaud

thanks for the feedback. Settings is way to describe settings.
Now once you have a settings and save it you can take the setting code
and wrap it into a startUpLoader actions.
So there are really complementary.

Ok I did not know that we change the class name. I will check because
my preferences seems to work in pharo 70.
Can you do pull requests for your suggestions so that the chapter gets
improved.




On Wed, Nov 1, 2017 at 6:34 PM, Renaud de Villemeur
 wrote:
> Hi Stephane
>
> Your booklet is very usefull, and show stuff that can only be done by code.
>
> However, in your example, you show how to change syntax style, or enable
> freetype, which can also be done using the setting framework, so I was
> wondering, how would you position Startup Loader with the settings framework
> ?
>
> Next, you always use StartupLoader. In my recent Pharo 6.1 image, this seems
> to be replaced by class  StartupPreferencesLoader. Not a big deal, I was
> able to find the correct class through the message, but quite confusing if
> you only read the booklet.
>
> I tend to use raw image, and load everything from scratch, instead of
> keeping multiple image around. So I try to clean things, or put things
> automatically at startup
>
> How to remove automatically at startup the welcome windows (probably
> specific to Pharo 6)
> World submorphs
>   select: [ :sm | sm isSystemWindow and: [ sm label = ((Character value: 0)
> asString, 'Welcome')]]
>   thenDo: [ :window | window delete ].
> ]
>
> Open browser automatically on package specific to my (little) projects
> |browser|
> browser := Smalltalk tools openClassBrowser.
> browser open.
> browser ui packageSearchUpdate: 'MyPack'
>
> Cheers
> Renaud
>
>
> 2017-10-29 16:53 GMT-04:00 Stephane Ducasse :
>>
>> Hi guys
>>
>> I just published a new little booklet on Pharo tips and tricks!
>> Available at: http://books.pharo.org
>>
>> Feedback and contributions are welcome as usual.
>>
>> Stef
>>
>



Re: [Pharo-users] New Pharo Booklet

2017-11-02 Thread Stephane Ducasse
Toc, list of figures are managed by the latex template. So yes you
have them if you template use it.

In fact a template is just a latex with {{{title}}}, {{{attribution}}}
We are working with guille in making pillar simpler to change.
Students were not really well supervised by damien and they produce
rather difficiult to understand and extend
design so I'm slowly going over the points.


Usually we can do the following
- first level, renewcommand in latex so like that we do not have to
extend the syntax of pillar
- second level, we can use the option of a command such as ${cite:}$ I
should check because for example we should be able to specify
the bib file but we should extend the nodes and model of pillar.
- third level we change the syntax but I would like to avoid it.

What I can try is to convert one of your document and check how it goes.
Now I'm really busy.

How do they do it in pandoc? In pillar now you can embed plain latex
using {{{}}} I guess  but it means that you cannot export that nicely
to HTML. I want to find a good css to produce a lot sexier output.









Stef

On Wed, Nov 1, 2017 at 7:44 PM, Hernán Morales Durand
 wrote:
> Hi Stef,
>
> 2017-11-01 8:11 GMT-03:00 Stephane Ducasse :
>>> I wrote documentation for my packages in Markdown + pandoc + LaTeX.
>>>
>>> The TeX macros contains syntax colorization for Smalltalk code which
>>> can be easily added to Pillar (I suppose)
>>> Would you consider adding the syntax coloring from the TeX macros I sent to 
>>> you?
>>
>> Sure now I'm not a latex expert and I want to keep dependencies to a minimum
>
> Yes, LaTeX is complicated and ugly.
>
>> What you can do is
>>
>>>
>>> I have some silly questions about Pillar:
>>>
>>> The documents can be integrated with toc through pandoc, can this be
>>> done in Pillar?
>>
>> I do not understand what you mean here.
>>
>
> When creating PDF document with pandoc command line I use the
> parameter "--toc" to automatically create Table of Contents from the
> document titles and subtitles. For example from command line:
>
> pandoc --toc --latex-engine=xelatex --listings -H macros.tex
> BioSmalltalk.md -s -o BioSmalltalk.pdf
>
> I don't know if "toc" is supported in Pillar. As I understand a Pillar
> book can contain multiple chapters, but a chapter may include a table
> of contents on its own?
>
>>> For tables I use tabu, longtable, booktabs, what to use in Pillar?
>> In pillar you have
>>
>> | a column | a column |
>>
>
> Ok, what I mean is for example with the "longtabu" LaTeX package I can
> specify column width individually:
>
> \begin{longtabu} to \linewidth{X[1.5,l,m] X[.3,m] X[.3,m] X[.5,m]
> X[c,m] X[c,m] X[c,m]}
>
> And many other table spacing properties :
> https://en.wikibooks.org/wiki/LaTeX/Tables
>
> I guess to add more advanced features one should edit Pillar templates
> with archetype?
>
>>> For multiple language suppor I use fontspec and lmodern, what to use in 
>>> Pillar?
>>
>> I do not know that. And what are the use. In pillar we have utf-8
>>
>>> For link I use hyperref, what to use in Pillar?
>>
>> * *
>>
>
> I would love to have linkcolor, anchorcolor, citecolor, etc :)
>
> What I found is
> https://github.com/pillar-markup/Pillar-Archetype/blob/master/book/support/latex/common.tex
>
> So I could inject my own LaTeX styles/commands/sections in common.tex?
> Or should I go through PRLaTeXWriter?
>
> Then if you like it you may integrate into Pillar in the future?
>
>>> I have some chapters ready and I would love to be published in a book,
>>> under the umbrella of Pharo Books:
>>>
>>> https://github.com/hernanmd/Territorial/raw/master/Territorial.pdf
>>> http://biosmalltalk.github.io/web/doc/BioSmalltalk-1.0.pdf
>>> https://github.com/PhyloclassTalk/phyloclasstalk.github.io/raw/master/doc/PhyloclassTalk-1.0.pdf
>>>
>>> What do you think?
>>
>> Good!
>> now I would start simple in plain pillar and avoid as much as possible
>> to use specific latex function
>> and see if this is really a problem and then we can see if we need to
>> extend the latex template or pillar.
>>
>> Pillar is not latex. We want to keep agnostic about latex.
>>
>>
>
> Thanks for your comments Stef.
>
> Cheers,
>
> Hernán
>>>
>>> Cheers
>>>
>>> Hernán
>>>
>>>
>>> 2017-10-29 17:53 GMT-03:00 Stephane Ducasse :
 Hi guys

 I just published a new little booklet on Pharo tips and tricks!
 Available at: http://books.pharo.org

 Feedback and contributions are welcome as usual.

 Stef

>>>
>>
>



Re: [Pharo-users] LiteratureResearcher - where graphs, PDFs, and BibTex happily live together

2017-11-02 Thread Manuel Leuenberger
Hi Dimitris,

I looked around for a way to integrate PDF into Pharo. But as long as we don’t 
have a way to natively display interactive multimedia (maybe Bloc will at some 
point support something like this?), I consider it not worth the effort to come 
up with a half-baked (note to self: watch that movie again) solution that is 
hard to implement and cannot even remotely support all the use cases as an 
external tool that have been crafted for years. Just rendering bitmaps loses so 
much information (full text) and actionability (hyperlinks). If I wanted to 
have interactive PDFs inside Pharo, I had to invest so much time to replicate 
functionality that has been implemented before. So, I chose the path of the 
least resistance by pushing this responsibility to a specialized tool. I think 
Pharo is great for modelling, exploration, and inspection, but OS integration 
is not really a selling point, and it doesn’t have to be. By using a standard 
PDF viewer I also gain that users are already familiar with them and have their 
own workflow that I can extend.

As a side note, I think that being able to embed a web browser inside Pharo 
would open up a whole new world of applications, as web browsers are currently 
the vehicles for content distribution. But as long as there is no project where 
this is a critical feature, I can live without it.

Cheers,
Manuel

> On 1 Nov 2017, at 22:39, Dimitris Chloupis  wrote:
> 
> Super cool more detailed recommendations when I try it on practice 
> 
> A cheap pdf viewer in Pharo would be to turn pdf pages to JPG images which 
> you can load via image morph so you won’t have to have two separate windows. 
> There are ton of converters out there that can do this. 
> On Wed, 1 Nov 2017 at 23:17, Manuel Leuenberger  > wrote:
> Hi everyone,
> 
> I was experimenting in the last few weeks with my take on literature 
> research. For me, the corpus of scientific papers form an interconnected 
> graph, not those plain lists and tables we keep in our bibliographies. So, 
> here is the first prototype that has Google Scholar integration for search, 
> can fetch PDFs from IEEE and ACM, extracts metadata from PDFs - all this 
> results in hyperlinked PDFs!
> 
> See a demo here: https://youtu.be/EcK3Pt_WnEw 
> Also slides from the SCG seminar here: 
> http://scg.unibe.ch/download/softwarecomposition/2017-10-31-Leuenberger-ILE.pdf
>  
> 
> 
> I plan on packaging it, so that those who are interested can check it out 
> themselves (help wanted!). Currently, it only works on macOS.
> 
> What do you think of my approach? Which use cases should be added?
> 
> Cheers,
> Manuel
> 



Re: [Pharo-users] LiteratureResearcher - where graphs, PDFs, and BibTex happily live together

2017-11-02 Thread Tudor Girba
Really nice work!

Indeed, the PDF integration can be quite interesting to people.

Doru


> On Nov 2, 2017, at 6:08 PM, Stephane Ducasse  wrote:
> 
> Hi manuel
> 
> this is super cool :)
> Could you describe how you did the pdf integration?
> And yes please package it :)
> I want to try it.
> 
> Stef
> 
> On Wed, Nov 1, 2017 at 10:16 PM, Manuel Leuenberger
>  wrote:
>> Hi everyone,
>> 
>> I was experimenting in the last few weeks with my take on literature
>> research. For me, the corpus of scientific papers form an interconnected
>> graph, not those plain lists and tables we keep in our bibliographies. So,
>> here is the first prototype that has Google Scholar integration for search,
>> can fetch PDFs from IEEE and ACM, extracts metadata from PDFs - all this
>> results in hyperlinked PDFs!
>> 
>> See a demo here: https://youtu.be/EcK3Pt_WnEw
>> Also slides from the SCG seminar here:
>> http://scg.unibe.ch/download/softwarecomposition/2017-10-31-Leuenberger-ILE.pdf
>> 
>> I plan on packaging it, so that those who are interested can check it out
>> themselves (help wanted!). Currently, it only works on macOS.
>> 
>> What do you think of my approach? Which use cases should be added?
>> 
>> Cheers,
>> Manuel
>> 
> 

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

"Be rather willing to give than demanding to get."







Re: [Pharo-users] Writing "powerpoint" like presentations in Pharo?

2017-11-02 Thread Stephane Ducasse
I did that (well argh more than 12 years ago) now I do not think that
I can find the code I will try
It looks like I loaded in Pharo some years ago.
Here the latest code I found (At that time I developed test first).
I'm not sure that I will have the time to get a look.


Stef

On Wed, Nov 1, 2017 at 7:35 PM, Tim Mackinnon  wrote:
> Hi - has anyone made anything where you can create a full screen presentation 
> in Pharo with slides with some large text, bullet points and embedded 
> pictures - but then it’s a facade that lets you evaluate items in the slide 
> or jump to any code mentioned?
>
> Sort of like what Alan Kay does in the eToys images?
>
> I need to do a presentation next week and I always loved it when I was fooled 
> into thinking I was looking at a static’ish powerpoint and then suddenly 
> realised it was a live environment.
>
> It doesn’t sound that hard to do something simple - but I’m not sure if I can 
> pull it off in time for my presentation. But am curious if we have something.
>
> (For bonus points, GT-Spotter stuff would work in it over top of the 
> presentation to demonstrate simple things)
>
> Tim


Morphic-Slideshow-StephaneDucasse.27.mcz
Description: Binary data


Re: [Pharo-users] Permancy of booklet links

2017-11-02 Thread Offray Vladimir Luna Cárdenas
In the case of Grafoscopio Manual, the URL is fixed [1] and the manual
advices to use a unique identifier (version + revision) that appears in
the front page and in the low corner of each page to report issues [2].

[1]
http://mutabit.com/repos.fossil/grafoscopio/doc/tip/Docs/En/Books/Manual/manual.pdf
[2] http://mutabit.com/repos.fossil/grafoscopio/ticket

Maybe this approach could be followed by other publications. We have
done it for the Spanish Data Driven Journalism Handbook [3]

[3] http://mutabit.com/repos.fossil/mapeda/

Cheers,

Offray

On 01/11/17 21:24, Ben Coman wrote:
>
> This link turned up in a google search on... Web Scraping Pharo, which
> is great, 
>  
> http://files.pharo.org/books-pdfs/booklet-Scraping/2017-09-29-scrapingbook.pdf
> but with the date I'm wondering how permanent the link is, for if I
> use it the respond to someone's question in a forum? 
>
> Will you be keeping years of pdfs?  
> For now I'll just use the directory url, but future missing files will
> frustrate user searches.
>
> Perhaps a sitemap is needed (though I'm not familiar with the details)...
> https://support.google.com/webmasters/answer/183668?hl=en
>
> cheers -ben





Re: [Pharo-users] LiteratureResearcher - where graphs, PDFs, and BibTex happily live together

2017-11-02 Thread Stephane Ducasse
Hi manuel

this is super cool :)
Could you describe how you did the pdf integration?
And yes please package it :)
I want to try it.

Stef

On Wed, Nov 1, 2017 at 10:16 PM, Manuel Leuenberger
 wrote:
> Hi everyone,
>
> I was experimenting in the last few weeks with my take on literature
> research. For me, the corpus of scientific papers form an interconnected
> graph, not those plain lists and tables we keep in our bibliographies. So,
> here is the first prototype that has Google Scholar integration for search,
> can fetch PDFs from IEEE and ACM, extracts metadata from PDFs - all this
> results in hyperlinked PDFs!
>
> See a demo here: https://youtu.be/EcK3Pt_WnEw
> Also slides from the SCG seminar here:
> http://scg.unibe.ch/download/softwarecomposition/2017-10-31-Leuenberger-ILE.pdf
>
> I plan on packaging it, so that those who are interested can check it out
> themselves (help wanted!). Currently, it only works on macOS.
>
> What do you think of my approach? Which use cases should be added?
>
> Cheers,
> Manuel
>



Re: [Pharo-users] Permancy of booklet links

2017-11-02 Thread Stephane Ducasse
for now I will keep the versions and see.

On Thu, Nov 2, 2017 at 3:24 AM, Ben Coman  wrote:
>
> This link turned up in a google search on... Web Scraping Pharo, which is
> great,
>
> http://files.pharo.org/books-pdfs/booklet-Scraping/2017-09-29-scrapingbook.pdf
> but with the date I'm wondering how permanent the link is, for if I use it
> the respond to someone's question in a forum?
>
> Will you be keeping years of pdfs?
> For now I'll just use the directory url, but future missing files will
> frustrate user searches.
>
> Perhaps a sitemap is needed (though I'm not familiar with the details)...
> https://support.google.com/webmasters/answer/183668?hl=en
>
> cheers -ben



Re: [Pharo-users] Extending Calypso

2017-11-02 Thread Denis Kudriashov
2017-11-02 16:50 GMT+01:00 Juraj Kubelka :

> Thanks! It works.
>
> Then I have two more questions:
>
> 1. How it is done that ‘should be implemented’ has red color?
>

Any method group can implement class side method:

#decorateTableCell: anItemCellMorph of: groupItem

Look at implementors for examples


>
> 2. Then let’s say I want a message group that display all messages in the
> environment that refers to a selected class.
>
> I found `ClyClassReferences to: classes`, but I miss how to use it in that
> case. My class ClyClassReferencesMethodGroup should use it in
> #includesMethod: and #methods. What is the right way to use
> ClyClassReferences or access environment to make the query?
>

Right now queries are not reused by groups. Each group directly retrieves
information from selected classes. So there is no access to the full
environment.
I am working on the model refactoring. And it is one of the parts which I
want to improve. I want method group to be based on query for methods and
query for subgroups. So it will be straightforward to get what you want.

Now you can implement it in global way like:

YourMethodGroup>>methods

cursor := ClySystemNavigationEnvironment queryCurrentImageFor:
(ClyClassReferences of: classes).

^cursor retrieveAllActualObjects


But to make it usable you should always show this group:

YourMethodGroupProvider>>buildGroupItemsOn: items

items add: (YourMethodGroup classes: classes) asEnvironmentItem

because by default provider adds only not empty groups where empty check
can lead to long computation


> Cheers,
> Juraj
>
> On Nov 2, 2017, at 12:23, Denis Kudriashov  wrote:
>
> Hi
>
> There is no real documentation for now. Only examples on my slides.
>
> 2017-11-02 16:16 GMT+01:00 Juraj Kubelka :
>
>> Hi,
>>
>> Are there any examples (documentation) how to extend Calipso?
>>
>> I have tried to create a simple (demo) method group, but I miss
>> something, because it is not called.
>>
>> I have created three subclasses of:
>> ClyMethodGroup (with #name and #includesMethod:),
>> ClySingleMethodGroupProvider (with #methodGroupClass), and
>> ClyEnvironmentPlugin (with #collectMethodGroupProvidersFor:).
>>
>> What do I miss?
>>
>
> Looks good. But to activate this plugin on current system environment you
> need to reset it:
>
>
> ClySystemNavigationEnvironment reset.
>
>
> Or manually add new plugin:
>
> ClySystemNavigationEnvironment currentImage addPlugin: ClyYourPlugin new.
>
>
> Let’s say that I want a new method group that displays all methods of a
>> selected class that include substring ‘foo’.
>>
>> Thanks!
>> Juraj
>>
>>
>>
>
>


Re: [Pharo-users] Extending Calypso

2017-11-02 Thread Juraj Kubelka
Thanks! It works. 

Then I have two more questions: 

1. How it is done that ‘should be implemented’ has red color? 

2. Then let’s say I want a message group that display all messages in the 
environment that refers to a selected class. 

I found `ClyClassReferences to: classes`, but I miss how to use it in that 
case. My class ClyClassReferencesMethodGroup should use it in #includesMethod: 
and #methods. What is the right way to use ClyClassReferences or access 
environment to make the query? 

Cheers,
Juraj

> On Nov 2, 2017, at 12:23, Denis Kudriashov  wrote:
> 
> Hi
> 
> There is no real documentation for now. Only examples on my slides.
> 
> 2017-11-02 16:16 GMT+01:00 Juraj Kubelka  >:
> Hi,
> 
> Are there any examples (documentation) how to extend Calipso?
> 
> I have tried to create a simple (demo) method group, but I miss something, 
> because it is not called.
> 
> I have created three subclasses of:
> ClyMethodGroup (with #name and #includesMethod:),
> ClySingleMethodGroupProvider (with #methodGroupClass), and
> ClyEnvironmentPlugin (with #collectMethodGroupProvidersFor:).
> 
> What do I miss?
> 
> Looks good. But to activate this plugin on current system environment you 
> need to reset it:
> 
> ClySystemNavigationEnvironment reset.
> 
> Or manually add new plugin:
> 
> ClySystemNavigationEnvironment currentImage addPlugin: ClyYourPlugin new.
> 
> Let’s say that I want a new method group that displays all methods of a 
> selected class that include substring ‘foo’.
> 
> Thanks!
> Juraj
> 
> 
> 



Re: [Pharo-users] Extending Calypso

2017-11-02 Thread Denis Kudriashov
Hi

There is no real documentation for now. Only examples on my slides.

2017-11-02 16:16 GMT+01:00 Juraj Kubelka :

> Hi,
>
> Are there any examples (documentation) how to extend Calipso?
>
> I have tried to create a simple (demo) method group, but I miss something,
> because it is not called.
>
> I have created three subclasses of:
> ClyMethodGroup (with #name and #includesMethod:),
> ClySingleMethodGroupProvider (with #methodGroupClass), and
> ClyEnvironmentPlugin (with #collectMethodGroupProvidersFor:).
>
> What do I miss?
>

Looks good. But to activate this plugin on current system environment you
need to reset it:


ClySystemNavigationEnvironment reset.


Or manually add new plugin:

ClySystemNavigationEnvironment currentImage addPlugin: ClyYourPlugin new.


Let’s say that I want a new method group that displays all methods of a
> selected class that include substring ‘foo’.
>
> Thanks!
> Juraj
>
>
>


[Pharo-users] Extending Calypso

2017-11-02 Thread Juraj Kubelka
Hi,

Are there any examples (documentation) how to extend Calipso? 

I have tried to create a simple (demo) method group, but I miss something, 
because it is not called. 

I have created three subclasses of: 
ClyMethodGroup (with #name and #includesMethod:), 
ClySingleMethodGroupProvider (with #methodGroupClass), and 
ClyEnvironmentPlugin (with #collectMethodGroupProvidersFor:).

What do I miss? 
Let’s say that I want a new method group that displays all methods of a 
selected class that include substring ‘foo’. 

Thanks!
Juraj




Re: [Pharo-users] Fwd: GitHub

2017-11-02 Thread hamdi gabsi
Thank you very much for your kindly response.


2017-11-02 15:40 GMT+01:00 Ben Coman :

>
>
> On Thu, Nov 2, 2017 at 10:28 PM, hamdi gabsi 
> wrote:
>
>>
>> -- Forwarded message --
>> From: hamdi gabsi 
>> Date: 2017-11-02 14:30 GMT+01:00
>> Subject: Re: GitHub
>> To: pharo-users@lists.pharo.org
>>
>>
>> For resolving my problem. I knew that it was when pushing my code, that's
>> mean that the commit was well done. So I pushed it from my Terminal. I went
>> to my Pharo local repository and I tapped git status then git push.
>>
>> After that in iceberg ,setting I introduced my user name and password. so
>> that he remembered me.  And it work from my VM no need to go to the
>> Terminal.
>>
>
> Glad to hear it resolved.
>
> Just to check your terminology.  Usually we say we are working "in the
> Image".  The VM runs the Image but we don't work "in the VM" (normally,
> unless your are modifying the virtual machine itself, which would be
> cool.).Although if the VM crashes, the Image dies with it, and you need
> to resort to Epicea to recover you recent changes.
>
> hope you enjoy your coming experience with Pharo,
> cheers -ben
>
>
>
>>
>> We can find answers in https://github.com/pharo-vcs/iceberg
>>
>> Thank you.
>>
>> 2017-11-02 14:06 GMT+01:00 hamdi gabsi :
>>
>>> I am working with Pharo 6.0
>>>
>>> 2017-11-02 14:05 GMT+01:00 hamdi gabsi :
>>>
 Hello,

 I'am Hamdi, I am doing an internship  with Rmod Team. I have a problem
 with pushing my code in Github, In fact, when I wont to push my code my VM
 bug and I will be obliged to kill it, so I loose my code.

 Thank you for helping me.


>>>
>>
>>
>


Re: [Pharo-users] Peeking at a stream

2017-11-02 Thread henry
How about #peekAhead?

- HH

>  Original Message 
> Subject: Re: [Pharo-users] Peeking at a stream
> Local Time: November 2, 2017 9:28 AM
> UTC Time: November 2, 2017 1:28 PM
> From: aglyn...@gmail.com
> To: Any question about pharo is welcome 
>
> Perhaps #keepStateWhile or something similar might be better than 
> #unchangedDuring ?
>
> Sent from [Mail](https://go.microsoft.com/fwlink/?LinkId=550986) for Windows 
> 10
>
> From: [Prof. Andrew P. Black](mailto:bl...@cs.pdx.edu)
> Sent: Thursday, November 2, 2017 5:00 AM
> To: [Any question about pharo is welcome](mailto:pharo-users@lists.pharo.org)
> Subject: [Pharo-users] Peeking at a stream
>
> I sometimes find, when working with a stream, that I need to "peek ahead” a 
> few items, without disturbing the state of the stream. The message stream 
> peek gives me the next item, but doesn’t generalize to multiple items,   So I 
> end up writing code like this:
>
> findSomething
>
>   | savedPosition result |
>
>   savedPosition := stream position.
>   stream position: start.
>   “code involving various manipulations of stream, including 
> stream next"
>   result := stream position + 1.
>   stream position: savedPosition.
>
>   ^ result
>
> This code involves at least two temps, is not very easy to read, and risks 
> not resetting the stream properly if I do a return.
>
> It seems to me that a better solution would be what Kent Beck calls an 
> “execute around” method:
>
> findSomething
>
>   ^ stream unchangedDuring: [ :s |
>
>“code involving various manipulations of stream, 
> including stream next"
>
>stream position + 1 ]
>
> I’m not sure that I like the name #unchangedDuring:; perhaps you can think of 
> a better one?
>
> The  implementation of this would be
>
>   PositionableStream >> #unchangedDuring: aBlock
>
>"execute aBlock with self as argument. Ensure that 
> when this method returns,
>
>I still have my current state."
>
>| savedPosition |
>
>savedPosition := self position.
> ^ [ aBlock value: self ] ensure: [ self position: 
> savedPosition ]
>
> or perhaps
>
>   PositionableStream >> #unchangedDuring: aBlock
>"execute aBlock with self as argument. Ensure that 
> when this method returns,
>
>I still have my current state."
>
>^ [ aBlock value: self copy ]
>
> which might be better in the case that the stream is a file stream and aBlock 
> causes the buffer to be refreshed from the disk.
>
> - Do other Smalltalks have a method like this?
> - Does it already exist in Pharo, somewhere that I’ve failed to look?
> - Would it be a worthwhile addition to Pharo?
> - What would be a good name?

Re: [Pharo-users] Fwd: GitHub

2017-11-02 Thread Ben Coman
On Thu, Nov 2, 2017 at 10:28 PM, hamdi gabsi  wrote:

>
> -- Forwarded message --
> From: hamdi gabsi 
> Date: 2017-11-02 14:30 GMT+01:00
> Subject: Re: GitHub
> To: pharo-users@lists.pharo.org
>
>
> For resolving my problem. I knew that it was when pushing my code, that's
> mean that the commit was well done. So I pushed it from my Terminal. I went
> to my Pharo local repository and I tapped git status then git push.
>
> After that in iceberg ,setting I introduced my user name and password. so
> that he remembered me.  And it work from my VM no need to go to the
> Terminal.
>

Glad to hear it resolved.

Just to check your terminology.  Usually we say we are working "in the
Image".  The VM runs the Image but we don't work "in the VM" (normally,
unless your are modifying the virtual machine itself, which would be
cool.).Although if the VM crashes, the Image dies with it, and you need
to resort to Epicea to recover you recent changes.

hope you enjoy your coming experience with Pharo,
cheers -ben



>
> We can find answers in https://github.com/pharo-vcs/iceberg
>
> Thank you.
>
> 2017-11-02 14:06 GMT+01:00 hamdi gabsi :
>
>> I am working with Pharo 6.0
>>
>> 2017-11-02 14:05 GMT+01:00 hamdi gabsi :
>>
>>> Hello,
>>>
>>> I'am Hamdi, I am doing an internship  with Rmod Team. I have a problem
>>> with pushing my code in Github, In fact, when I wont to push my code my VM
>>> bug and I will be obliged to kill it, so I loose my code.
>>>
>>> Thank you for helping me.
>>>
>>>
>>
>
>


Re: [Pharo-users] Fwd: GitHub

2017-11-02 Thread hamdi gabsi
sorry, I want to say crashes, it 's a mistake , Thank you very much

2017-11-02 15:32 GMT+01:00 Ben Coman :

>
> As a backup, select your package in System Browser and choose ,
> so at least your code is safe.
>
> If you VM crashes, you can recover code using Epicia. From the World Menu
> > Tools > Recover changes (from memory)
>
> I'm not clear what you mean by "VM plante"
>
> cheers -ben
>
> On Thu, Nov 2, 2017 at 10:28 PM, hamdi gabsi 
> wrote:
>
>>
>> -- Forwarded message --
>> From: hamdi gabsi 
>> Date: 2017-11-02 14:05 GMT+01:00
>> Subject: GitHub
>> To: pharo-users@lists.pharo.org
>>
>>
>> Hello,
>>
>> I'am Hamdi, I am doing an internship  with Rmod Team. I have a problem
>> with pushing my code in Github, In fact, Iam using Pharo 6 when I wont to
>> push my code my VM plante  and I will be obliged to kill it, so I loose my
>> code.
>>
>> Thank you for helping me.
>>
>>
>>
>


Re: [Pharo-users] Fwd: GitHub

2017-11-02 Thread Ben Coman
As a backup, select your package in System Browser and choose ,
so at least your code is safe.

If you VM crashes, you can recover code using Epicia. From the World Menu >
Tools > Recover changes (from memory)

I'm not clear what you mean by "VM plante"

cheers -ben

On Thu, Nov 2, 2017 at 10:28 PM, hamdi gabsi  wrote:

>
> -- Forwarded message --
> From: hamdi gabsi 
> Date: 2017-11-02 14:05 GMT+01:00
> Subject: GitHub
> To: pharo-users@lists.pharo.org
>
>
> Hello,
>
> I'am Hamdi, I am doing an internship  with Rmod Team. I have a problem
> with pushing my code in Github, In fact, Iam using Pharo 6 when I wont to
> push my code my VM plante  and I will be obliged to kill it, so I loose my
> code.
>
> Thank you for helping me.
>
>
>


Re: [Pharo-users] Peeking at a stream

2017-11-02 Thread Ben Coman
On Thu, Nov 2, 2017 at 9:28 PM, Andrew Glynn  wrote:

> Perhaps #keepStateWhile or something similar might be better than
> #unchangedDuring ?
>

Something like "keepState" was also my first impression,
but "During" seems to be the convention for restoring things after a code
block completes.  Are there methods breaking that convention?

cheers -ben

*From: *Prof. Andrew P. Black 
> *Sent: *Thursday, November 2, 2017 5:00 AM
> *To: *Any question about pharo is welcome 
> *Subject: *[Pharo-users] Peeking at a stream
>
>
>
> I sometimes find, when working with a stream, that I need to "peek ahead”
> a few items, without disturbing the state of the stream. The message stream
> peek gives me the next item, but doesn’t generalize to multiple items,   So
> I end up writing code like this:
>
>
>
> findSomething
>
>   | savedPosition result |
>
>   savedPosition := stream position.
>   stream position: start.
>   “code involving various manipulations of stream, including
> stream next"
>   result := stream position + 1.
>   stream position: savedPosition.
>
>   ^ result
>
>
>
> This code involves at least two temps, is not very easy to read, and risks
> not resetting the stream properly if I do a return.
>
>
>
> It seems to me that a better solution would be what Kent Beck calls an
> “execute around” method:
>
>
>
> findSomething
>
>   ^ stream unchangedDuring: [ :s |
>
>“code involving various manipulations of
> stream, including stream next"
>
>stream position + 1 ]
>
>
>
> I’m not sure that I like the name #unchangedDuring:; perhaps you can think
> of a better one?
>
>
>
> The  implementation of this would be
>
>
>
>   PositionableStream >> #unchangedDuring: aBlock
>
>"execute aBlock with self as argument. Ensure
> that when this method returns,
>
>I still have my current state."
>
>
>
>| savedPosition |
>
>savedPosition := self position.
> ^ [ aBlock value: self ] ensure: [ self
> position: savedPosition ]
>
>
>
> or perhaps
>
>
>
>   PositionableStream >> #unchangedDuring: aBlock
>"execute aBlock with self as argument. Ensure
> that when this method returns,
>
>I still have my current state."
>
>
>^ [ aBlock value: self copy ]
>
>
>
> which might be better in the case that the stream is a file stream and
> aBlock causes the buffer to be refreshed from the disk.
>
>
>
>- Do other Smalltalks have a method like this?
>- Does it already exist in Pharo, somewhere that I’ve failed to look?
>- Would it be a worthwhile addition to Pharo?
>- What would be a good name?
>
>
>
>
>
>
>
>
>


[Pharo-users] Fwd: GitHub

2017-11-02 Thread hamdi gabsi
-- Forwarded message --
From: hamdi gabsi 
Date: 2017-11-02 14:30 GMT+01:00
Subject: Re: GitHub
To: pharo-users@lists.pharo.org


For resolving my problem. I knew that it was when pushing my code, that's
mean that the commit was well done. So I pushed it from my Terminal. I went
to my Pharo local repository and I tapped git status then git push.

After that in iceberg ,setting I introduced my user name and password. so
that he remembered me.  And it work from my VM no need to go to the
Terminal.

We can find answers in https://github.com/pharo-vcs/iceberg

Thank you.

2017-11-02 14:06 GMT+01:00 hamdi gabsi :

> I am working with Pharo 6.0
>
> 2017-11-02 14:05 GMT+01:00 hamdi gabsi :
>
>> Hello,
>>
>> I'am Hamdi, I am doing an internship  with Rmod Team. I have a problem
>> with pushing my code in Github, In fact, when I wont to push my code my VM
>> bug and I will be obliged to kill it, so I loose my code.
>>
>> Thank you for helping me.
>>
>>
>


[Pharo-users] Fwd: GitHub

2017-11-02 Thread hamdi gabsi
-- Forwarded message --
From: hamdi gabsi 
Date: 2017-11-02 14:05 GMT+01:00
Subject: GitHub
To: pharo-users@lists.pharo.org


Hello,

I'am Hamdi, I am doing an internship  with Rmod Team. I have a problem with
pushing my code in Github, In fact, Iam using Pharo 6 when I wont to push
my code my VM plante  and I will be obliged to kill it, so I loose my code.

Thank you for helping me.


Re: [Pharo-users] Exchanging information between 2 pharo applications (2 images running on two different computers)

2017-11-02 Thread Denis Kudriashov
To load such code switch to old compiler in settings browser. It supports
old FFI syntax. Then you can manually adopt all ffi calls to UFFI and
commit new version.

2017-10-29 15:09 GMT+01:00 Paulo R. Dellani :

> Dear all,
>
> I would like to give ZeroMQ a try in Smalltalk, but am unable to
> load it on a new image successfully. In Pharo 5, I loaded the package
> ConfigurationOfZeroMQ from the repository in smalltalkhub
>  and
> evaluated the following to load the code:
>
> ConfigurationOfZeroMQ loadBleedingEdge
>
> It seems to load everything well, but when I try to look at the source
> code of the methods that call the C routines from libzmq using the
> system browser, the system exhibits the following error message:
>
> UndefinedObject(Object)>>doesNotUnderstand: #keywords
> RBFFICallPragma(RBPragmaNode)>>selectorParts
> RubSHTextStylerST80(SHRBTextStyler)>>visitPragmaNode:
> RBFFICallPragma(RBPragmaNode)>>acceptVisitor:
> RubSHTextStylerST80(SHRBTextStyler)>>visitNode:
> [ :each | self visitNode: each ] in RubSHTextStylerST80>>visitMethodNode:
> in Block: [ :each | self visitNode: each ]
> OrderedCollection>>do:
>
> (its a long stack, cutting here)
>
> When loading ZeroMQ on Pharo 6, a window pops-up with the title
> 'Syntax Error: Literal constant expected' showing the source code
> of a method defining a call to a routine from a C library:
>
> apiDeleteDC: aHDC
>  bool 'DeleteDC' (Win32HDC)
> module:'gdi32.dll'>
> ^self externalCallFailed
>
> If I update the syntax, re-writing the code above as
>
> apiDeleteDC: aHDC
> ^self ffiCall: #( bool DeleteDC (Win32HDC aHDC) ) module:'gdi32.dll'
>
> the compiler accepts it and the process can go on, but eventually
> the system will become unstable...
>
> Any ideas on how to solve this problems? Is this syntax still supported
> in Pharo5 & 6?
>
> Cheers,
>
> Paulo
>
> On 10/25/2017 03:47 PM, Sebastian Heidbrink via Pharo-users wrote:
>
> ForwardedMessage.eml
>
> Subject:
> Re: [Pharo-users] Exchanging information between 2 pharo applications (2
> images running on two different computers)
>
> From:
> Sebastian Heidbrink  
>
> Date:
> 10/25/2017 03:47 PM
>
> To:
> pharo-users@lists.pharo.org
> Hi Cederik,
>
> you should have a look at http://smalltalkhub.com/#!/~panuw/zeromq
> ZeroMQ is a networking library. Nice thing about it is that all the
> networking related workload is dealt with in a second process. That can
> save you some resources within Smalltalk.
>
>
>


Re: [Pharo-users] Peeking at a stream

2017-11-02 Thread Andrew Glynn
Perhaps #keepStateWhile or something similar might be better than 
#unchangedDuring ?

Sent from Mail for Windows 10

From: Prof. Andrew P. Black
Sent: Thursday, November 2, 2017 5:00 AM
To: Any question about pharo is welcome
Subject: [Pharo-users] Peeking at a stream

I sometimes find, when working with a stream, that I need to "peek ahead” a few 
items, without disturbing the state of the stream. The message stream peek 
gives me the next item, but doesn’t generalize to multiple items,   So I end up 
writing code like this:

    findSomething
| savedPosition result |
savedPosition := stream position.
stream position: start.
“code involving various manipulations of stream, including stream next"
result := stream position + 1.
stream position: savedPosition.
^ result

This code involves at least two temps, is not very easy to read, and risks not 
resetting the stream properly if I do a return.

It seems to me that a better solution would be what Kent Beck calls an “execute 
around” method:

    findSomething
^ stream unchangedDuring: [ :s |
“code involving various manipulations of stream, including 
stream next"
stream position + 1 ]

I’m not sure that I like the name #unchangedDuring:; perhaps you can think of a 
better one? 

The  implementation of this would be

PositionableStream >> #unchangedDuring: aBlock
"execute aBlock with self as argument. Ensure that when this 
method returns,
I still have my current state."

| savedPosition |
savedPosition := self position.
^ [ aBlock value: self ] ensure: [ self position: savedPosition 
]

or perhaps

PositionableStream >> #unchangedDuring: aBlock
"execute aBlock with self as argument. Ensure that when this 
method returns,
I still have my current state."

^ [ aBlock value: self copy ]

which might be better in the case that the stream is a file stream and aBlock 
causes the buffer to be refreshed from the disk.

• Do other Smalltalks have a method like this?  
• Does it already exist in Pharo, somewhere that I’ve failed to look? 
• Would it be a worthwhile addition to Pharo?  
• What would be a good name?






Re: [Pharo-users] Peeking at a stream

2017-11-02 Thread Denis Kudriashov
Hi.

In XStreams this method called #explore: .

2017-11-02 9:59 GMT+01:00 Prof. Andrew P. Black :

> I sometimes find, when working with a stream, that I need to "peek ahead”
> a few items, without disturbing the state of the stream. The message stream
> peek gives me the next item, but doesn’t generalize to multiple items,   So
> I end up writing code like this:
>
> findSomething
> | savedPosition result |
> savedPosition := stream position.
> stream position: start.
> “code involving various manipulations of stream, including stream next"
> result := stream position + 1.
> stream position: savedPosition.
> ^ result
>
> This code involves at least two temps, is not very easy to read, and risks
> not resetting the stream properly if I do a return.
>
> It seems to me that a better solution would be what Kent Beck calls an
> “execute around” method:
>
> findSomething
> ^ stream unchangedDuring: [ :s |
> “code involving various manipulations of stream, including stream next"
> stream position + 1 ]
>
> I’m not sure that I like the name #unchangedDuring:; perhaps you can think
> of a better one?
>
> The  implementation of this would be
>
> PositionableStream >> #unchangedDuring: aBlock
> "execute aBlock with self as argument. Ensure that when this method
> returns,
> I still have my current state."
> | savedPosition |
> savedPosition := self position.
> ^ [ aBlock value: self ] ensure: [ self position: savedPosition ]
>
> or perhaps
>
> PositionableStream >> #unchangedDuring: aBlock
> "execute aBlock with self as argument. Ensure that when this method
> returns,
> I still have my current state."
>
> ^ [ aBlock value: self copy ]
>
> which might be better in the case that the stream is a file stream and
> aBlock causes the buffer to be refreshed from the disk.
>
>
>- Do other Smalltalks have a method like this?
>- Does it already exist in Pharo, somewhere that I’ve failed to look?
>- Would it be a worthwhile addition to Pharo?
>- What would be a good name?
>
>
>
>
>


Re: [Pharo-users] Peeking at a stream

2017-11-02 Thread Guillermo Polito
Hi Andrew,

My first hunch is that you don't want to change PositionableStream. Because
it works on collections and files (because of inheritance). But not on
other kind of streams that are not part of the hierarchy, such as sockets.
And we are cleaning that part.

Instead, some time ago Sven produced a really nice hierarchy of stream
decorators. Check the package:

Zinc-Character-Encoding-Core

There you have

ZnBufferedReadStream

That implements buffering in an orthogonal way. Maybe it makes more sense
to put such method there?

Guille

On Thu, Nov 2, 2017 at 9:59 AM, Prof. Andrew P. Black 
wrote:

> I sometimes find, when working with a stream, that I need to "peek ahead”
> a few items, without disturbing the state of the stream. The message stream
> peek gives me the next item, but doesn’t generalize to multiple items,   So
> I end up writing code like this:
>
> findSomething
> | savedPosition result |
> savedPosition := stream position.
> stream position: start.
> “code involving various manipulations of stream, including stream next"
> result := stream position + 1.
> stream position: savedPosition.
> ^ result
>
> This code involves at least two temps, is not very easy to read, and risks
> not resetting the stream properly if I do a return.
>
> It seems to me that a better solution would be what Kent Beck calls an
> “execute around” method:
>
> findSomething
> ^ stream unchangedDuring: [ :s |
> “code involving various manipulations of stream, including stream next"
> stream position + 1 ]
>
> I’m not sure that I like the name #unchangedDuring:; perhaps you can think
> of a better one?
>
> The  implementation of this would be
>
> PositionableStream >> #unchangedDuring: aBlock
> "execute aBlock with self as argument. Ensure that when this method
> returns,
> I still have my current state."
> | savedPosition |
> savedPosition := self position.
> ^ [ aBlock value: self ] ensure: [ self position: savedPosition ]
>
> or perhaps
>
> PositionableStream >> #unchangedDuring: aBlock
> "execute aBlock with self as argument. Ensure that when this method
> returns,
> I still have my current state."
>
> ^ [ aBlock value: self copy ]
>
> which might be better in the case that the stream is a file stream and
> aBlock causes the buffer to be refreshed from the disk.
>
>
>- Do other Smalltalks have a method like this?
>- Does it already exist in Pharo, somewhere that I’ve failed to look?
>- Would it be a worthwhile addition to Pharo?
>- What would be a good name?
>
>
>
>
>


-- 



Guille Polito

Research Engineer

Centre de Recherche en Informatique, Signal et Automatique de Lille

CRIStAL - UMR 9189

French National Center for Scientific Research - *http://www.cnrs.fr
*


*Web:* *http://guillep.github.io* 

*Phone: *+33 06 52 70 66 13


[Pharo-users] Peeking at a stream

2017-11-02 Thread Prof. Andrew P. Black
I sometimes find, when working with a stream, that I need to "peek ahead” a few 
items, without disturbing the state of the stream. The message stream peek 
gives me the next item, but doesn’t generalize to multiple items,   So I end up 
writing code like this:

findSomething
| savedPosition result |
savedPosition := stream position.
stream position: start.
“code involving various manipulations of stream, including stream next"
result := stream position + 1.
stream position: savedPosition.
^ result

This code involves at least two temps, is not very easy to read, and risks not 
resetting the stream properly if I do a return.

It seems to me that a better solution would be what Kent Beck calls an “execute 
around” method:

findSomething
^ stream unchangedDuring: [ :s |
“code involving various manipulations of stream, including 
stream next"
stream position + 1 ]

I’m not sure that I like the name #unchangedDuring:; perhaps you can think of a 
better one? 

The  implementation of this would be

PositionableStream >> #unchangedDuring: aBlock
"execute aBlock with self as argument. Ensure that when this 
method returns,
I still have my current state."

| savedPosition |
savedPosition := self position.
^ [ aBlock value: self ] ensure: [ self position: savedPosition 
]

or perhaps

PositionableStream >> #unchangedDuring: aBlock
"execute aBlock with self as argument. Ensure that when this 
method returns,
I still have my current state."

^ [ aBlock value: self copy ]

which might be better in the case that the stream is a file stream and aBlock 
causes the buffer to be refreshed from the disk.

Do other Smalltalks have a method like this?  
Does it already exist in Pharo, somewhere that I’ve failed to look? 
Would it be a worthwhile addition to Pharo?  
What would be a good name?