Re: [Pharo-users] Embedded PDF viewer?

2018-02-05 Thread Ben Coman
On 14 November 2017 at 00:18, Sean P. DeNigris  wrote:
> Ben Coman wrote
>> I've wanted PDF rendering inside Pharo for *years* and finally got a
>> sniff of a solid possibility - so I'm chasing it down.  It might not pan
>> out like I imagine, but "Live programming PDF documents" seems like a
>> catchy meme that the broader community may find intriguing.
>
> Go, go, go!!
>
>
>
> -
> Cheers,
> Sean

I've been distracted from this to play around with Bittrex trading.
In case someone feels inclined to take up the reins, I've blogged
about where I got up to.

Pharo PDF Rendering, part 1, building PDFium
http://blog.openinworld.com/2017/11/pharo-pdf-part-1/

Pharo PDF Rendering, part 2, UFFI interfacing PDFium
http://blog.openinworld.com/2018/02/pharo-pdf-part-2/

cheers -ben



Re: [Pharo-users] From Roassal RTView to html

2018-02-05 Thread Andrei Stebakov
Now it takes me to the right page, thanks!
One small glitch though, looks like after mouse click the UI element gets
grabbed by the mouse as if I pressed "click and hold".
So the only way to dis-engage the mouse from the element is to refresh the
html page.

On Mon, Feb 5, 2018 at 3:21 PM, milton mamani  wrote:

> Could you please use this script
>
> Gofer it
> smalltalkhubUser: 'ObjectProfile' project: 'Roassal2';
> package: 'Roassal2';
> package: 'Roassal2GT';
> package: 'Trachel';
> load.
>
> 2018-02-05 17:12 GMT-03:00 Andrei Stebakov :
>
>> Updated roassal via:
>> Gofer new smalltalkhubUser: 'ObjectProfile'
>> project: 'Roassal';
>> package: 'ConfigurationOfRoassal';
>> load.
>> (Smalltalk at: #ConfigurationOfRoassal) load
>>
>> The problems is still the same: added ".html" suffix.
>>
>> On Mon, Feb 5, 2018 at 3:09 PM, Alexandre Bergel > > wrote:
>>
>>> Andrei, let us know how it goes
>>>
>>> Cheers
>>> Alexandre
>>>
>>> Envoyé de mon iPad
>>>
>>> Le 5 févr. 2018 à 16:51, milton mamani  a écrit :
>>>
>>> Your need to load the last version of roassal, I change it that
>>>
>>> 2018-02-05 16:44 GMT-03:00 Andrei Stebakov :
>>>
 Milton, thanks for the example.
 I wonder why the link it takes me to has an appended ".html" at the end
 like "https://twitter.com.html;?

 On Mon, Feb 5, 2018 at 12:55 PM, milton mamani 
 wrote:

> Hi Andrei,
>
> This is some example.
>
> Let me know if this is what you want.
>
> Run this in a playground with the last version of roassal:
>
>
> .=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=.
> .=..=..=..=..=..=..=..=..=.
>
> b := RTMondrian new.
> b shape text color: [Color random].
> b nodes: { 'https://facebook.com'. 'https://twitter.com'. '
> https://plus.google.com' }.
> b build.
> link := RTLinkView new
> name: [ :model | model ] "#yourself";
> view: nil.
> b view elements @ link.
>
> RTHTML5Exporter new
> fileName: 'roassalfile.html';
> export: b view.
> b view
>
> .=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=.
> .=..=..=..=..=..=..=..=..=.
>
> Best regards,
> Milton
>
>
>
>
>
> 2018-02-05 14:16 GMT-03:00 Andrei Stebakov :
>
>> I'll try to find if there is a way to embed a clickable interaction.
>> Looks like since there is no response to the topic, I was wondering
>> if it's a non-pharo/roassal way to do it or it's just not so many people
>> tried it.
>>
>> On Sat, Feb 3, 2018 at 5:42 AM, Alexandre Bergel <
>> alexandre.ber...@me.com> wrote:
>>
>>> Hi Milton,
>>>
>>> Can you answer to Andrei please?
>>> I know in Roassal there is a way to embed clickable interaction.
>>>
>>> Cheers,
>>> Alexandre
>>>
>>> Begin forwarded message:
>>>
>>> *From: *Andrei Stebakov 
>>> *Subject: **[Pharo-users] From Roassal RTView to html*
>>> *Date: *February 2, 2018 at 1:53:50 PM GMT-3
>>> *To: *Any question about pharo is welcome <
>>> pharo-users@lists.pharo.org>
>>> *Reply-To: *Any question about pharo is welcome <
>>> pharo-users@lists.pharo.org>
>>>
>>> I was wondering if it's a good idea to expose some of the Roassal
>>> models via web (say Seaside) using the ability of Roassal to generate 
>>> HTML
>>> for the view.
>>> In this case how could I "spice up" the HTML making for example
>>> those ellipces or lablels clickabe so the click could take me to some 
>>> web
>>> page bases on the data in the model?
>>>
>>>
>>>
>>
>

>>>
>>
>


Re: [Pharo-users] From Roassal RTView to html

2018-02-05 Thread Andrei Stebakov
Updated roassal via:
Gofer new smalltalkhubUser: 'ObjectProfile'
project: 'Roassal';
package: 'ConfigurationOfRoassal';
load.
(Smalltalk at: #ConfigurationOfRoassal) load

The problems is still the same: added ".html" suffix.

On Mon, Feb 5, 2018 at 3:09 PM, Alexandre Bergel 
wrote:

> Andrei, let us know how it goes
>
> Cheers
> Alexandre
>
> Envoyé de mon iPad
>
> Le 5 févr. 2018 à 16:51, milton mamani  a écrit :
>
> Your need to load the last version of roassal, I change it that
>
> 2018-02-05 16:44 GMT-03:00 Andrei Stebakov :
>
>> Milton, thanks for the example.
>> I wonder why the link it takes me to has an appended ".html" at the end
>> like "https://twitter.com.html;?
>>
>> On Mon, Feb 5, 2018 at 12:55 PM, milton mamani 
>> wrote:
>>
>>> Hi Andrei,
>>>
>>> This is some example.
>>>
>>> Let me know if this is what you want.
>>>
>>> Run this in a playground with the last version of roassal:
>>>
>>>
>>> .=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=.
>>> .=..=..=..=..=..=..=..=.
>>>
>>> b := RTMondrian new.
>>> b shape text color: [Color random].
>>> b nodes: { 'https://facebook.com'. 'https://twitter.com'. '
>>> https://plus.google.com' }.
>>> b build.
>>> link := RTLinkView new
>>> name: [ :model | model ] "#yourself";
>>> view: nil.
>>> b view elements @ link.
>>>
>>> RTHTML5Exporter new
>>> fileName: 'roassalfile.html';
>>> export: b view.
>>> b view
>>>
>>> .=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=.
>>> .=..=..=..=..=..=..=..=.
>>>
>>> Best regards,
>>> Milton
>>>
>>>
>>>
>>>
>>>
>>> 2018-02-05 14:16 GMT-03:00 Andrei Stebakov :
>>>
 I'll try to find if there is a way to embed a clickable interaction.
 Looks like since there is no response to the topic, I was wondering if
 it's a non-pharo/roassal way to do it or it's just not so many people tried
 it.

 On Sat, Feb 3, 2018 at 5:42 AM, Alexandre Bergel <
 alexandre.ber...@me.com> wrote:

> Hi Milton,
>
> Can you answer to Andrei please?
> I know in Roassal there is a way to embed clickable interaction.
>
> Cheers,
> Alexandre
>
> Begin forwarded message:
>
> *From: *Andrei Stebakov 
> *Subject: **[Pharo-users] From Roassal RTView to html*
> *Date: *February 2, 2018 at 1:53:50 PM GMT-3
> *To: *Any question about pharo is welcome  >
> *Reply-To: *Any question about pharo is welcome <
> pharo-users@lists.pharo.org>
>
> I was wondering if it's a good idea to expose some of the Roassal
> models via web (say Seaside) using the ability of Roassal to generate HTML
> for the view.
> In this case how could I "spice up" the HTML making for example those
> ellipces or lablels clickabe so the click could take me to some web page
> bases on the data in the model?
>
>
>

>>>
>>
>


Re: [Pharo-users] From Roassal RTView to html

2018-02-05 Thread Alexandre Bergel
Andrei, let us know how it goes

Cheers
Alexandre 

Envoyé de mon iPad

> Le 5 févr. 2018 à 16:51, milton mamani  a écrit :
> 
> Your need to load the last version of roassal, I change it that
> 
> 2018-02-05 16:44 GMT-03:00 Andrei Stebakov :
>> Milton, thanks for the example.
>> I wonder why the link it takes me to has an appended ".html" at the end like 
>> "https://twitter.com.html;?
>> 
>>> On Mon, Feb 5, 2018 at 12:55 PM, milton mamani  wrote:
>>> Hi Andrei,
>>> 
>>> This is some example.
>>> 
>>> Let me know if this is what you want.
>>> 
>>> Run this in a playground with the last version of roassal:
>>> 
>>> 
>>> .=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=.
>>> 
>>> b := RTMondrian new.
>>> b shape text color: [Color random].
>>> b nodes: { 'https://facebook.com'. 'https://twitter.com'. 
>>> 'https://plus.google.com' }.
>>> b build.
>>> link := RTLinkView new 
>>> name: [ :model | model ] "#yourself";
>>> view: nil.
>>> b view elements @ link.
>>> 
>>> RTHTML5Exporter new
>>> fileName: 'roassalfile.html';
>>> export: b view.
>>> b view
>>> 
>>> .=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=.
>>> 
>>> Best regards,
>>> Milton
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 2018-02-05 14:16 GMT-03:00 Andrei Stebakov :
 I'll try to find if there is a way to embed a clickable interaction. 
 Looks like since there is no response to the topic, I was wondering if 
 it's a non-pharo/roassal way to do it or it's just not so many people 
 tried it.
 
> On Sat, Feb 3, 2018 at 5:42 AM, Alexandre Bergel 
>  wrote:
> Hi Milton,
> 
> Can you answer to Andrei please?
> I know in Roassal there is a way to embed clickable interaction.
> 
> Cheers,
> Alexandre
> 
>> Begin forwarded message:
>> 
>> From: Andrei Stebakov 
>> Subject: [Pharo-users] From Roassal RTView to html
>> Date: February 2, 2018 at 1:53:50 PM GMT-3
>> To: Any question about pharo is welcome 
>> Reply-To: Any question about pharo is welcome 
>> 
>> 
>> I was wondering if it's a good idea to expose some of the Roassal models 
>> via web (say Seaside) using the ability of Roassal to generate HTML for 
>> the view. 
>> In this case how could I "spice up" the HTML making for example those 
>> ellipces or lablels clickabe so the click could take me to some web page 
>> bases on the data in the model?
>> 
> 
 
>>> 
>> 
> 


Re: [Pharo-users] From Roassal RTView to html

2018-02-05 Thread Andrei Stebakov
Milton, thanks for the example.
I wonder why the link it takes me to has an appended ".html" at the end
like "https://twitter.com.html;?

On Mon, Feb 5, 2018 at 12:55 PM, milton mamani  wrote:

> Hi Andrei,
>
> This is some example.
>
> Let me know if this is what you want.
>
> Run this in a playground with the last version of roassal:
>
>
> .=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=.
> .=..=..=..=..=..=..=..=.
>
> b := RTMondrian new.
> b shape text color: [Color random].
> b nodes: { 'https://facebook.com'. 'https://twitter.com'. '
> https://plus.google.com' }.
> b build.
> link := RTLinkView new
> name: [ :model | model ] "#yourself";
> view: nil.
> b view elements @ link.
>
> RTHTML5Exporter new
> fileName: 'roassalfile.html';
> export: b view.
> b view
>
> .=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=..=.
> .=..=..=..=..=..=..=..=.
>
> Best regards,
> Milton
>
>
>
>
>
> 2018-02-05 14:16 GMT-03:00 Andrei Stebakov :
>
>> I'll try to find if there is a way to embed a clickable interaction.
>> Looks like since there is no response to the topic, I was wondering if
>> it's a non-pharo/roassal way to do it or it's just not so many people tried
>> it.
>>
>> On Sat, Feb 3, 2018 at 5:42 AM, Alexandre Bergel > > wrote:
>>
>>> Hi Milton,
>>>
>>> Can you answer to Andrei please?
>>> I know in Roassal there is a way to embed clickable interaction.
>>>
>>> Cheers,
>>> Alexandre
>>>
>>> Begin forwarded message:
>>>
>>> *From: *Andrei Stebakov 
>>> *Subject: **[Pharo-users] From Roassal RTView to html*
>>> *Date: *February 2, 2018 at 1:53:50 PM GMT-3
>>> *To: *Any question about pharo is welcome 
>>> *Reply-To: *Any question about pharo is welcome <
>>> pharo-users@lists.pharo.org>
>>>
>>> I was wondering if it's a good idea to expose some of the Roassal models
>>> via web (say Seaside) using the ability of Roassal to generate HTML for the
>>> view.
>>> In this case how could I "spice up" the HTML making for example those
>>> ellipces or lablels clickabe so the click could take me to some web page
>>> bases on the data in the model?
>>>
>>>
>>>
>>
>


Re: [Pharo-users] From Roassal RTView to html

2018-02-05 Thread Andrei Stebakov
I'll try to find if there is a way to embed a clickable interaction.
Looks like since there is no response to the topic, I was wondering if it's
a non-pharo/roassal way to do it or it's just not so many people tried it.

On Sat, Feb 3, 2018 at 5:42 AM, Alexandre Bergel 
wrote:

> Hi Milton,
>
> Can you answer to Andrei please?
> I know in Roassal there is a way to embed clickable interaction.
>
> Cheers,
> Alexandre
>
> Begin forwarded message:
>
> *From: *Andrei Stebakov 
> *Subject: **[Pharo-users] From Roassal RTView to html*
> *Date: *February 2, 2018 at 1:53:50 PM GMT-3
> *To: *Any question about pharo is welcome 
> *Reply-To: *Any question about pharo is welcome <
> pharo-users@lists.pharo.org>
>
> I was wondering if it's a good idea to expose some of the Roassal models
> via web (say Seaside) using the ability of Roassal to generate HTML for the
> view.
> In this case how could I "spice up" the HTML making for example those
> ellipces or lablels clickabe so the click could take me to some web page
> bases on the data in the model?
>
>
>


[Pharo-users] image lockdown/deployment mode

2018-02-05 Thread Baveco, Hans
Is there a way to disable the programmer facilities and produce a locked image 
for an end user? I would be happy if I could at least replace the world menu 
with a custom menu.
In the developers-list archives I only found an old discussion (May 26 2010 
Image Lockdown/Deployment mode), without actual solutions. Maybe these are 
available now?
TIA
Hans



Re: [Pharo-users] Neural Network - Handwritten Digit Recognition

2018-02-05 Thread francesco agati
nice,
the model can also be serialized for loading in other vm?

2018-02-04 13:42 GMT+01:00 Pierce Ng :

> Hi all,
>
> I've written a blog post on recognizing handwritten digits using neural
> networks in Pharo.
>
>   http://www.samadhiweb.com/blog/2018.02.04.neural.networks.html
>
> I attach here two screenshots built using Roassal showing good and bad
> recognition outcomes. I must say Roassal is great!
>
> Comments welcome here or on my blog.
>
> Pierce
>
>


Re: [Pharo-users] Pharo things analog reads ?

2018-02-05 Thread Denis Kudriashov
Hi Steven.

I added I2C support
 to
PharoThings and WiringPi.

Now you can ask the board instance for I2C connection:

i2cConnection := board connectToI2CDevice: 4.


And then read/write data using wiringpi functions like:

i2cConnection readData.
i2cConnection read8BitsAt: 16r32 "register".

i2cConnection writeData: 16rAB.
i2cConnection write8BitsAt: 16r32 "register" data: 16rA5.


Also I added I2CDevice as superclass for simple i2c devices. There is
example of accelerometer ADXL345. Look for details.


Best regards,
Denis


2017-12-19 23:20 GMT+01:00 Steven Costiou :

> hi,
>
> i've tried i2c and added ffi calls in WiringPiLibrary.
>
> *wiringPiI2cSetup: devId*
>
> ^self ffiCall: #(int wiringPiI2CSetup (int devId) )
>
> *readI2C: fd*
>
> ^self ffiCall: #(int wiringPiI2CRead (int fd))
>
> Then the following script is able to read a byte from a connected device
> (i tried with a trinket https://learn.adafruit.com/introducing-trinket/
> introduction):
> 
>
> |lib addr val|
>
> lib := WiringPiLibrary uniqueInstance.
>
> addr := self wiringPiSetupI2C: 4. *“Setup the i2c to the 0x04 address”*
> val := self readI2C: addr. *“Read a byte from the i2c address”*
>
> val inspect
>
> So connecting an Arduino-like device to the raspberry that is configured
> as an i2c slave, Pharo can ask for analog values. I will try tomorrow with
> analog sensors, I will share if i manage to build nice examples.
>
> Seems to be even easier using a special chip: https://learn.adafruit.com/
> reading-a-analog-in-and-controlling-audio-volume-with-
> the-raspberry-pi?view=all
>
> but it uses more pins on the board.
>
> Steven.
>
>
>
> Le 2017-12-17 19:48, Denis Kudriashov a écrit :
>
> Hi Steven
>
> 2017-12-17 12:40 GMT+01:00 Steven Costiou :
>
>> Hi,
>>
>> For what i know, raspberry pi boards cannot read analog sensors (which
>> are the most interesting imo), except by connecting to some kind of bridges
>> or to Arduino boards.
>>
>> In the PharoTHings code i see that there are Arduino classes, and also it
>> is based on wiringpi and wiringpi provides support for i2c which is needed
>> to connect to an Arduino and perform analog reads.
>>
>> I'm exploring the wiringpi doc to see if there is an example for that,
>> but in the meantime, would someone already have an example of analog reads
>> with PharoThings, with working code (even simple) ?
>>
> It is in my todo. I need to build example with temperature sensor. I will
> continue work on it next year.
> Now feel free to contribute to the project.
>
> About Arduino: it is not finished. Problem that I use Mac but serial port
> is not working there (it is required for Firmata)
>
>>
>>
>> Steven.
>>
>


Re: [Pharo-users] How can a Morph display a context menu on a mouse click?

2018-02-05 Thread Stephan Eggermont
Juraj Kubelka 
wrote:
>> morph := 'Hello' asMorph.
>> morph on: #mouseUp send: #traceCr: to: morph.
>> morph openInWindow.
>> 
> 
> This does not work for me either. 
> I am fine with the MorphicEventHandler solution.

Not at all? Or do you just need to use the variant sending #value: to a
block with the morph as an argument?

Stephan





Re: [Pharo-users] How can a Morph display a context menu on a mouse click?

2018-02-05 Thread Juraj Kubelka


> El 03-02-2018, a las 07:26, stephan  escribió:
> 
> On 02-02-18 15:19, Juraj Kubelka wrote:
>> Thank you Stephan!
>> There is my exercise:
>> “when:send:to"
>> morph := 'Hello' asMorph.
>> morph when: #click send: #traceCr: to: morph.
>> morph openInWindow.
> 
> Sorry
> 
> morph := 'Hello' asMorph.
> morph on: #mouseUp send: #traceCr: to: morph.
> morph openInWindow.
> 

This does not work for me either. 
I am fine with the MorphicEventHandler solution.

Thanks!
Juraj


Re: [Pharo-users] global exception handler mechanism

2018-02-05 Thread Igor Stasenko
On 5 February 2018 at 10:17, Marcus Denker  wrote:

> Hello,
>
> The Sunit-Debugger does a stack search on startup to find the test related
> exception.
>
> It might be good to do it better, especially as the debug process starts
> from the exception
> I might be a good idea to actually keep a reference to it.
>
> Would there be any downside of Exception>>debug passing a reference to the
> Debugger?
>
> Marcus
>
>
> > On 2 Feb 2018, at 17:19, Peter Uhnák  wrote:
> >
> > Hi,
> >
> > is there a way to install a global handler for exceptions?
> >
> > Right now if I want to log all exceptions, I use approach from ShoreLine
> and create a PreDebugAction which is activated when any "unhandled"
> exception occurs.
> >
> > That would be good enough, however the Debugger has zero knowledge of
> the exception that is actually occuring, as Exception>>debug passes on only
> the title. So if I want to get back to the original exception and maybe log
> it with beacon, I need to do a lot of stack and context shenanigans:
> >
> > MyPreDebugAction>>logException
> >   MyLogger
> >   runDuring: [ (debugger session interruptedProcess
> suspendedContext stack
> >   detect: [ :context | context receiver
> isKindOf: Exception ]) receiver emit ]
> >
> >
> > Is there a better way to approach this?
>

if you own a process (you creating it) , then it is just a piece of cake,
just make a topmost block
with #on:do:
if you don't own a process (suppose you wanna watch already existing one) ,
it can be done by injecting own context at the bottom of stack ,
well, unless there are exception handler(s) upper, that catch any
exception(s) before you can see them.

I think a much better way would be to watch exceptions even before they
being handled,
for this, i would override Exception>>#signal
and add some kind of logging or notification .. well, anything you see fit.
That's, of course, a kind of dangerous, be careful. Do not attempt to throw
new exceptions while processing just signaled one, else
you'll get infinite recursion :)


>
> > Thanks,
> > Peter
>
>
>


-- 
Best regards,
Igor Stasenko.


Re: [Pharo-users] global exception handler mechanism

2018-02-05 Thread Marcus Denker
Hello,

The Sunit-Debugger does a stack search on startup to find the test related 
exception.

It might be good to do it better, especially as the debug process starts from 
the exception
I might be a good idea to actually keep a reference to it.

Would there be any downside of Exception>>debug passing a reference to the 
Debugger?

Marcus


> On 2 Feb 2018, at 17:19, Peter Uhnák  wrote:
> 
> Hi,
> 
> is there a way to install a global handler for exceptions?
> 
> Right now if I want to log all exceptions, I use approach from ShoreLine and 
> create a PreDebugAction which is activated when any "unhandled" exception 
> occurs.
> 
> That would be good enough, however the Debugger has zero knowledge of the 
> exception that is actually occuring, as Exception>>debug passes on only the 
> title. So if I want to get back to the original exception and maybe log it 
> with beacon, I need to do a lot of stack and context shenanigans:
> 
> MyPreDebugAction>>logException
>   MyLogger
>   runDuring: [ (debugger session interruptedProcess 
> suspendedContext stack
>   detect: [ :context | context receiver isKindOf: 
> Exception ]) receiver emit ]
> 
> 
> Is there a better way to approach this?
> 
> Thanks,
> Peter