Re: [Pharo-users] Showcasing Pharo, Roassal and Grafoscopio at re:publica 2018

2018-04-27 Thread Tudor Girba
Excellent!

Doru


> On Apr 26, 2018, at 3:57 PM, Offray Vladimir Luna Cárdenas 
>  wrote:
> 
> Hi,
> 
> I will be showcasing Pharo, Roassal and Grafoscopio at re:publica 2018,
> next week. As you may know, re:publica[2] is one of the most important
> and visible media & digital culture conventions in Europe and is a good
> scenario for the Pharo community.  You can find details about my
> participation at [1]
> 
> [1]
> https://18.re-publica.com/en/session/data-clinic-twitter-data-selfies-data-portraits
> [2] https://18.re-publica.com/en
> 
> I will be making intensive refactoring on the Dataviz package to create
> some usual and unusual data visualizations from data exported from
> Twitter, so I may be more active those days in the Discord and mailing
> list channels, is some questions arise.
> 
> Thanks in advance for the Pharo communities support. I wouldn't be able
> to be there without it.
> 
> Cheers,
> 
> Offray
> 
> 
> 

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

"There are no old things, there are only old ways of looking at them."







Re: [Pharo-users] Showcasing Pharo, Roassal and Grafoscopio at re:publica 2018

2018-04-27 Thread Ben Coman
On 26 April 2018 at 21:57, Offray Vladimir Luna Cárdenas <
offray.l...@mutabit.com> wrote:

> Hi,
>
> I will be showcasing Pharo, Roassal and Grafoscopio at re:publica 2018,
> next week. As you may know, re:publica[2] is one of the most important
> and visible media & digital culture conventions in Europe and is a good
> scenario for the Pharo community.  You can find details about my
> participation at [1]
>
> [1]
> https://18.re-publica.com/en/session/data-clinic-twitter-
> data-selfies-data-portraits
> [2] https://18.re-publica.com/en
>
> I will be making intensive refactoring on the Dataviz package to create
> some usual and unusual data visualizations from data exported from
> Twitter, so I may be more active those days in the Discord and mailing
> list channels, is some questions arise.
>
> Thanks in advance for the Pharo communities support. I wouldn't be able
> to be there without it.
>
> Cheers,
>
> Offray
>

> Printed material will be shared on how to recreate this experience, so
your friends, family and fellow data activists can take and share their own
Twitter data selfies and data portraits, to visualize part of their online
presence and help to oversight public political discourse.

Do you need any review/testing of this material?

cheers -ben


Re: [Pharo-users] Showcasing Pharo, Roassal and Grafoscopio at re:publica 2018

2018-04-27 Thread p...@highoctane.be
On Thu, Apr 26, 2018 at 3:57 PM, Offray Vladimir Luna Cárdenas <
offray.l...@mutabit.com> wrote:

> Hi,
>
> I will be showcasing Pharo, Roassal and Grafoscopio at re:publica 2018,
> next week. As you may know, re:publica[2] is one of the most important
> and visible media & digital culture conventions in Europe and is a good
> scenario for the Pharo community.  You can find details about my
> participation at [1]
>

The "on how to use the Grafoscopio *pocket infrastructure* for data
activism and digital citizenship " soundbite just blew my mind.

"Pocket Infrastructure" hits the nail on the head for sure.
I positively love that angle.
Compared to python, node, etc, there is much less fuss to get started and
it allows to focus on the data narrative right away.

I regularly make folders in my Dropbox where I throw a pharo vm and a pharo
image I work on, saved using https://github.com/Pharophile/HOImageSaver so
that I can always go back in time easily (saved me more than once!). This
very handy for working on machine A, and resuming work on machine B, or C
etc.
And is indeed "Pocket Infrastructure".



> [1]
> https://18.re-publica.com/en/session/data-clinic-twitter-
> data-selfies-data-portraits
> [2] https://18.re-publica.com/en
>
> I will be making intensive refactoring on the Dataviz package to create
> some usual and unusual data visualizations from data exported from
> Twitter, so I may be more active those days in the Discord and mailing
> list channels, is some questions arise.
>

Do you already use DiscordSt?


>
> Thanks in advance for the Pharo communities support. I wouldn't be able
> to be there without it.
>

What you achieve with Pharo makes me proud of supporting Pharo.
Kudos Offray, we need more people like you in the world.

_/\_

Phil


>
> Cheers,
>
> Offray
>
>
>
>
>


[Pharo-users] UFFI - Could not coerce arguments

2018-04-27 Thread Serge Stinckwich
I would like to pass a pointer to an array of pointers to a FFI call and I
have problems ...

​I have this method:

runOutputs: aTF_OutputArray size: anInteger
| status outvalues |
status := TF_Status create.
outvalues := FFIExternalArray externalNewType: 'TF_Tensor*' size:
anInteger.
self library
runSession: self
options: FFIExternalObject null
inputs: FFIExternalObject null
values: FFIExternalObject null
count: 0
outputs: aTF_OutputArray getHandle
values: outvalues getHandle
count: anInteger
targets: FFIExternalObject null
count: 0
metadata: FFIExternalObject null
status: status.
status check.
^ outvalues

​the FFI call is like that :

runSession: aTF_Session
options: opsTF_Buffer
inputs: inTF_OutputArray values: inTF_TensorArray count: inCount
outputs: outTF_OutputArray values: outTF_TensorArrayPtr count: outCount
targets: aTF_OperationArray count: targetCount
metadata: metaTF_Buffer
status: aTF_Status

"F_CAPI_EXPORT extern void TF_SessionRun(
TF_Session* session,
// RunOptions
const TF_Buffer* run_options,
// Input tensors
const TF_Output* inputs, TF_Tensor* const* input_values, int ninputs,
// Output tensors
const TF_Output* outputs, TF_Tensor** output_values, int noutputs,
// Target operations
const TF_Operation* const* target_opers, int ntargets,
// RunMetadata
TF_Buffer* run_metadata,
// Output status
 TF_Status*);"

^ self
ffiCall: #(void TF_SessionRun #(TF_Session * aTF_Session, TF_Buffer
* opsTF_Buffer, TF_Output * inTF_OutputArray, TF_Tensor * inTF_TensorArray,
int inCount, TF_Output * outTF_OutputArray, TF_Tensor *
outTF_TensorArrayPtr, int outCount, TF_Operation * aTF_OperationArray, int
targetCount, TF_Buffer * metaTF_Buffer, TF_Status * aTF_Status))
module: TensorFlowCAPI

TF_Tensor is an opaque object.

I have an error: "Could not coerce arguments".
I guess this is related to the way I pass arguments to the FFI function ?

-- 
Serge Stinckwich
UMI UMMISCO 209 (SU/IRD/UY1)
"Programs must be written for people to read, and only incidentally for
machines to execute."http://www.doesnotunderstand.org/


Re: [Pharo-users] UFFI - Could not coerce arguments

2018-04-27 Thread Esteban Lorenzano
hi,

it all depends on how you are declaring your types.

here, for example you are passing 

aTF_OutputArray getHandle

that’s a “void*” value (an ExternalAddress or ExternalData object), and in 
declaration you have (if I read correctly):

TF_Output * 

so, first question is: if TF_Output != void, then you have a coercing problem 
:).

you can fix that just changing the notation to receive a void * (in C is all 
the same, but not in pharo :)) 

note that this can be happening in a lot of places, since your function has a 
lot of arguments, I just put an example of what can be wrong. 

cheers, 
Esteban


> On 27 Apr 2018, at 11:23, Serge Stinckwich  wrote:
> 
> I would like to pass a pointer to an array of pointers to a FFI call and I 
> have problems ...
> 
> ​I have this method:
> 
> runOutputs: aTF_OutputArray size: anInteger
> | status outvalues |
> status := TF_Status create.
> outvalues := FFIExternalArray externalNewType: 'TF_Tensor*' size: 
> anInteger.
> self library
> runSession: self
> options: FFIExternalObject null
> inputs: FFIExternalObject null
> values: FFIExternalObject null
> count: 0
> outputs: aTF_OutputArray getHandle
> values: outvalues getHandle
> count: anInteger
> targets: FFIExternalObject null
> count: 0
> metadata: FFIExternalObject null
> status: status.
> status check.
> ^ outvalues
> 
> ​the FFI call is like that : 
> 
> runSession: aTF_Session
> options: opsTF_Buffer
> inputs: inTF_OutputArray values: inTF_TensorArray count: inCount
> outputs: outTF_OutputArray values: outTF_TensorArrayPtr count: outCount
> targets: aTF_OperationArray count: targetCount
> metadata: metaTF_Buffer
> status: aTF_Status
> 
> "F_CAPI_EXPORT extern void TF_SessionRun(
> TF_Session* session,
> // RunOptions
> const TF_Buffer* run_options,
> // Input tensors
> const TF_Output* inputs, TF_Tensor* const* input_values, int ninputs,
> // Output tensors
> const TF_Output* outputs, TF_Tensor** output_values, int noutputs,
> // Target operations
> const TF_Operation* const* target_opers, int ntargets,
> // RunMetadata
> TF_Buffer* run_metadata,
> // Output status
>  TF_Status*);"
> 
> ^ self
> ffiCall: #(void TF_SessionRun #(TF_Session * aTF_Session, TF_Buffer * 
> opsTF_Buffer, TF_Output * inTF_OutputArray, TF_Tensor * inTF_TensorArray, int 
> inCount, TF_Output * outTF_OutputArray, TF_Tensor * outTF_TensorArrayPtr, int 
> outCount, TF_Operation * aTF_OperationArray, int targetCount, TF_Buffer * 
> metaTF_Buffer, TF_Status * aTF_Status))
> module: TensorFlowCAPI
> 
> TF_Tensor is an opaque object.
> 
> I have an error: "Could not coerce arguments".
> I guess this is related to the way I pass arguments to the FFI function ?
> 
> -- 
> Serge Stinckwich
> UMI UMMISCO 209 (SU/IRD/UY1)
> "Programs must be written for people to read, and only incidentally for 
> machines to execute."
> http://www.doesnotunderstand.org/ 


Re: [Pharo-users] UFFI - Could not coerce arguments

2018-04-27 Thread Ben Coman
On 27 April 2018 at 17:23, Serge Stinckwich 
wrote:

> I would like to pass a pointer to an array of pointers to a FFI call and I
> have problems ...
>
> ​I have this method:
>
> runOutputs: aTF_OutputArray size: anInteger
> | status outvalues |
> status := TF_Status create.
> outvalues := FFIExternalArray externalNewType: 'TF_Tensor*' size:
> anInteger.
> self library
> runSession: self
> options: FFIExternalObject null
> inputs: FFIExternalObject null
> values: FFIExternalObject null
>

Sorry I'm (again) not addressing your question :P,
but please let me piggyback learning something.

@All, What is the advantage of "FFIExternalObject null" ?
I was under the impression that in general "nil" could be used in similar
situations.

cheers -ben


> count: 0
> outputs: aTF_OutputArray getHandle
> values: outvalues getHandle
> count: anInteger
> targets: FFIExternalObject null
> count: 0
> metadata: FFIExternalObject null
> status: status.
> status check.
> ^ outvalues
>
> ​the FFI call is like that :
>
> runSession: aTF_Session
> options: opsTF_Buffer
> inputs: inTF_OutputArray values: inTF_TensorArray count: inCount
> outputs: outTF_OutputArray values: outTF_TensorArrayPtr count: outCount
> targets: aTF_OperationArray count: targetCount
> metadata: metaTF_Buffer
> status: aTF_Status
>
> "F_CAPI_EXPORT extern void TF_SessionRun(
> TF_Session* session,
> // RunOptions
> const TF_Buffer* run_options,
> // Input tensors
> const TF_Output* inputs, TF_Tensor* const* input_values, int ninputs,
> // Output tensors
> const TF_Output* outputs, TF_Tensor** output_values, int noutputs,
> // Target operations
> const TF_Operation* const* target_opers, int ntargets,
> // RunMetadata
> TF_Buffer* run_metadata,
> // Output status
>  TF_Status*);"
>
> ^ self
> ffiCall: #(void TF_SessionRun #(TF_Session * aTF_Session,
> TF_Buffer * opsTF_Buffer, TF_Output * inTF_OutputArray, TF_Tensor *
> inTF_TensorArray, int inCount, TF_Output * outTF_OutputArray, TF_Tensor *
> outTF_TensorArrayPtr, int outCount, TF_Operation * aTF_OperationArray, int
> targetCount, TF_Buffer * metaTF_Buffer, TF_Status * aTF_Status))
> module: TensorFlowCAPI
>
> TF_Tensor is an opaque object.
>
> I have an error: "Could not coerce arguments".
> I guess this is related to the way I pass arguments to the FFI function ?
>
> --
> Serge Stinckwich
> UMI UMMISCO 209 (SU/IRD/UY1)
> "Programs must be written for people to read, and only incidentally for
> machines to execute."http://www.doesnotunderstand.org/
>


Re: [Pharo-users] [Pharo-dev] libfreetype6 missing in the dependencies of ubuntu Pharo distribution

2018-04-27 Thread Peter Uhnák
I've installed both ( apt install pharo6-32-ui pharo6-64-ui  ), but the
font problem was present only for 32bit.

Note that I was launching the VM packaged with ZeroConf installation, I've
only used apt mainly to get all dependencies.

Now I tried to also run "pharo6-32-ui Pharo.image" (and "pharo6-64-ui
Pharo.image"),
and in both cases I got errror

"/usr/bin/pharo6-32-ui: line 6: /usr/lib/i386-linux-gnu/pharo6-vm/pharo: No
such file or directory

and

"/usr/bin/pharo6-64-ui: line 6: /usr/lib/x86_64-linux-gnu/pharo6-vm/pharo:
No such file or directory


Both directories contain the following files:
B3DAcceleratorPlugin.so
vm-display-fbdev.so
vm-display-X11.so
vm-sound-ALSA.so
vm-sound-OSS.so
vm-sound-pulse.so

There is no "pharo" file anywhere in /usr

Maybe elementary OS has some changes in the package manager, but I find
that unlikely. "uname -a" even reports it as "16.04.1-Ubuntu"

Peter


On Fri, Apr 27, 2018 at 5:19 AM, Holger Freyther  wrote:

>
>
> > On 27. Apr 2018, at 04:55, Peter Uhnák  wrote:
> >
> > Hi,
> >
> > I've just tried installing pharo from package manager on Elementary OS,
> which is a ubuntu derivative.
> >
> > All went well, except fonts weren't working in 32 bit version, and I had
> to install by hand "libfreetype6:i386" ... is it missing in the
> dependencies?
>
> which package did you install?
>
> holger
>


Re: [Pharo-users] UFFI - Could not coerce arguments

2018-04-27 Thread Esteban Lorenzano
hi,

> On 27 Apr 2018, at 13:06, Ben Coman  wrote:
> 
> 
> 
> On 27 April 2018 at 17:23, Serge Stinckwich  > wrote:
> I would like to pass a pointer to an array of pointers to a FFI call and I 
> have problems ...
> 
> ​I have this method:
> 
> runOutputs: aTF_OutputArray size: anInteger
> | status outvalues |
> status := TF_Status create.
> outvalues := FFIExternalArray externalNewType: 'TF_Tensor*' size: 
> anInteger.
> self library
> runSession: self
> options: FFIExternalObject null
> inputs: FFIExternalObject null
> values: FFIExternalObject null
> 
> Sorry I'm (again) not addressing your question :P, 
> but please let me piggyback learning something.
> 
> @All, What is the advantage of "FFIExternalObject null" ?
> I was under the impression that in general "nil" could be used in similar 
> situations.

nope.
NULL != nil. 
nil = the instance of UndefinedObject
NULL = external address pointing to 0.

cheers,
Esteban

> 
> cheers -ben
>  
> count: 0
> outputs: aTF_OutputArray getHandle
> values: outvalues getHandle
> count: anInteger
> targets: FFIExternalObject null
> count: 0
> metadata: FFIExternalObject null
> status: status.
> status check.
> ^ outvalues
> 
> ​the FFI call is like that : 
> 
> runSession: aTF_Session
> options: opsTF_Buffer
> inputs: inTF_OutputArray values: inTF_TensorArray count: inCount
> outputs: outTF_OutputArray values: outTF_TensorArrayPtr count: outCount
> targets: aTF_OperationArray count: targetCount
> metadata: metaTF_Buffer
> status: aTF_Status
> 
> "F_CAPI_EXPORT extern void TF_SessionRun(
> TF_Session* session,
> // RunOptions
> const TF_Buffer* run_options,
> // Input tensors
> const TF_Output* inputs, TF_Tensor* const* input_values, int ninputs,
> // Output tensors
> const TF_Output* outputs, TF_Tensor** output_values, int noutputs,
> // Target operations
> const TF_Operation* const* target_opers, int ntargets,
> // RunMetadata
> TF_Buffer* run_metadata,
> // Output status
>  TF_Status*);"
> 
> ^ self
> ffiCall: #(void TF_SessionRun #(TF_Session * aTF_Session, TF_Buffer * 
> opsTF_Buffer, TF_Output * inTF_OutputArray, TF_Tensor * inTF_TensorArray, int 
> inCount, TF_Output * outTF_OutputArray, TF_Tensor * outTF_TensorArrayPtr, int 
> outCount, TF_Operation * aTF_OperationArray, int targetCount, TF_Buffer * 
> metaTF_Buffer, TF_Status * aTF_Status))
> module: TensorFlowCAPI
> 
> TF_Tensor is an opaque object.
> 
> I have an error: "Could not coerce arguments".
> I guess this is related to the way I pass arguments to the FFI function ?
> 
> -- 
> Serge Stinckwich
> UMI UMMISCO 209 (SU/IRD/UY1)
> "Programs must be written for people to read, and only incidentally for 
> machines to execute."
> http://www.doesnotunderstand.org/ 



[Pharo-users] [Voyage] Possible to save an OrderedCollection?

2018-04-27 Thread sergio ruiz

For some reason, I am not able to do this:

Object subclass: #TestBox
instanceVariableNames: 'origin corner pointList'
classVariableNames: ''
poolDictionaries: ''
category: 'PrintBot-Models’!

initialize
pointList := OrderedCollection new.


If i do something like below, I don’t see the list of points ever show up in 
mongo..

Ideas?

b := TestBox new.
b save.
p1 := Point x:0 y:0.
p1 save.
p2 := Point x:12 y:343.
p2 save.

b origin: p1.
b corner: p2.

b save.

b pointList add: p1.
b save.
b pointList add: p2.
b save.




peace,
sergio
photographer, journalist, visionary

Public Key: http://bit.ly/29z9fG0
#BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV
http://www.codeandmusic.com
http://www.twitter.com/sergio_101
http://www.facebook.com/sergio101

signature.asc
Description: Message signed with OpenPGP using AMPGpg


Re: [Pharo-users] [Voyage] Possible to save an OrderedCollection?

2018-04-27 Thread Esteban Lorenzano
hi,

what you need to save is the persistent object, the one marked as 
“isVoyageRoot” in class side.

cheers,
Esteban

> On 27 Apr 2018, at 14:44, sergio ruiz  wrote:
> 
> 
> For some reason, I am not able to do this:
> 
> Object subclass: #TestBox
>   instanceVariableNames: 'origin corner pointList'
>   classVariableNames: ''
>   poolDictionaries: ''
>   category: 'PrintBot-Models’!
> 
> initialize
>   pointList := OrderedCollection new.
> 
> 
> If i do something like below, I don’t see the list of points ever show up in 
> mongo..
> 
> Ideas?
> 
> b := TestBox new.
> b save.
> p1 := Point x:0 y:0.
> p1 save.
> p2 := Point x:12 y:343.
> p2 save.
> 
> b origin: p1.
> b corner: p2.
> 
> b save.
> 
> b pointList add: p1.
> b save.
> b pointList add: p2.
> b save.
> 
> 
> 
> 
> peace,
> sergio
> photographer, journalist, visionary
> 
> Public Key: http://bit.ly/29z9fG0 
> #BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV
> http://www.codeandmusic.com 
> http://www.twitter.com/sergio_101 
> http://www.facebook.com/sergio101 


[Pharo-users] FileStream deprecation in Pharo7

2018-04-27 Thread Holger Freyther
tl;dr could we extend PackageManifest>>#isDeprecated to provide reasoning and 
pointers to potential replacements?

I was loading some of my code into a Pharo7 image and while debugging noticed 
that FileStream is deprecated (text stroke through in the Playground). But 
neither the FileStream class comment nor the the ManifestDeprecatedFileStream 
have an indication of what to use instead.

What do you think of making the deprecation notice carry more signal? E.g. 
provide reasoning of why it was removed ("simplification", "no replacement for 
XYZ", "Look at XYZ")?





Re: [Pharo-users] FileStream deprecation in Pharo7

2018-04-27 Thread Sven Van Caekenberghe
Holger,

> On 27 Apr 2018, at 15:01, Holger Freyther  wrote:
> 
> tl;dr could we extend PackageManifest>>#isDeprecated to provide reasoning and 
> pointers to potential replacements?
> 
> I was loading some of my code into a Pharo7 image and while debugging noticed 
> that FileStream is deprecated (text stroke through in the Playground). But 
> neither the FileStream class comment nor the the ManifestDeprecatedFileStream 
> have an indication of what to use instead.
> 
> What do you think of making the deprecation notice carry more signal? E.g. 
> provide reasoning of why it was removed ("simplification", "no replacement 
> for XYZ", "Look at XYZ")?

The answer is simple: use FileSystem, it has been in the image for years. 

The 'Deep into Pharo' book has a chapter about it.

Sven

(Apart from that, you are right: we can always write more documentation).




[Pharo-users] Literals

2018-04-27 Thread Debiller 777
You know, literals are quite useful in case when you want to shorten some
object initialization. For example #() and {} for arrays and $[]for byte
arrays. However, if there is a way to add custom literals, for example for
sets (something like #{} I guess)? how to do it? and can some special kind
of objects for creating literals easily be added to Pharo?


Re: [Pharo-users] FileStream deprecation in Pharo7

2018-04-27 Thread Holger Freyther


> On 27. Apr 2018, at 21:13, Sven Van Caekenberghe  wrote:
> 
> Holger,

Sven!


> The answer is simple: use FileSystem, it has been in the image for years. 
> 
> The 'Deep into Pharo' book has a chapter about it.
> 
> Sven
> 
> (Apart from that, you are right: we can always write more documentation).

thank you for the answer and the pointer. I wondered how we could make the 
replacement discoverable in the image? It can be documentation but maybe we can 
make the Manifest more expressive?

holger


Re: [Pharo-users] FileStream deprecation in Pharo7

2018-04-27 Thread Sean P. DeNigris
Sven Van Caekenberghe-2 wrote
> The answer is simple: use FileSystem, it has been in the image for years. 

IIUC the thrust of the question was how to get exactly that info most
effectively to a naive user who runs into the deprecation…



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



Re: [Pharo-users] [Voyage] Possible to save an OrderedCollection?

2018-04-27 Thread sergio ruiz
Hi, esteban..

In this case, the persisted object is TestBox..

it does show up just fine in Mongo, but the OrderedCollection of points does 
not.

On April 27, 2018 at 8:57:26 AM, Esteban Lorenzano (esteba...@gmail.com) wrote:


what you need to save is the persistent object, the one marked as 
“isVoyageRoot” in class side.

peace,
sergio
photographer, journalist, visionary

Public Key: http://bit.ly/29z9fG0
#BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV
http://www.codeandmusic.com
http://www.twitter.com/sergio_101
http://www.facebook.com/sergio101

signature.asc
Description: Message signed with OpenPGP using AMPGpg


Re: [Pharo-users] [Pharo-dev] libfreetype6 missing in the dependencies of ubuntu Pharo distribution

2018-04-27 Thread Holger Freyther


> On 27. Apr 2018, at 19:22, Peter Uhnák  wrote:


> I've installed both ( apt install pharo6-32-ui pharo6-64-ui  ), but the font 
> problem was present only for 32bit.
> 
> Note that I was launching the VM packaged with ZeroConf installation, I've 
> only used apt mainly to get all dependencies.
> 
> Now I tried to also run "pharo6-32-ui Pharo.image" (and "pharo6-64-ui 
> Pharo.image"),
> and in both cases I got errror
> 
> "/usr/bin/pharo6-32-ui: line 6: /usr/lib/i386-linux-gnu/pharo6-vm/pharo: No 
> such file or directory
> 
> and
> 
> "/usr/bin/pharo6-64-ui: line 6: /usr/lib/x86_64-linux-gnu/pharo6-vm/pharo: No 
> such file or directory 

What's missing is that pharo6-32-ui should depend on pharo6-32. And the later 
package has the dependency on libssl and libfreetype and provides the "pharo" 
binary.

thanks for pointing that out and sorry you had to experience it.





Re: [Pharo-users] Literals

2018-04-27 Thread Clément Bera
Not really.

You can use ClassVariables though. Here's an example for Sets:

Object subclass: #MyClass
instanceVariableNames: ''
classVariableNames: 'MyClassVar'
package: 'MyPackage'

MyClass class>>initialize
super initialize.
MyClassVar := Set new.

MyClass>>foo
self bar: MyClassVar

Obviously sets are not as easy to deal with. You cannot mutate empty
arrays/bytearrays, if you concatenate something it creates a new object.
You can add things in sets. So you need to be careful... You can make the
object read-only to avoid issues (MyClassVar beReadOnlyObject).



On Fri, Apr 27, 2018 at 3:19 PM, Debiller 777 
wrote:

> You know, literals are quite useful in case when you want to shorten some
> object initialization. For example #() and {} for arrays and $[]for byte
> arrays. However, if there is a way to add custom literals, for example for
> sets (something like #{} I guess)? how to do it? and can some special kind
> of objects for creating literals easily be added to Pharo?
>



-- 
Clément Béra
https://clementbera.github.io/
https://clementbera.wordpress.com/


Re: [Pharo-users] FileStream deprecation in Pharo7

2018-04-27 Thread Sven Van Caekenberghe


> On 27 Apr 2018, at 15:28, Sean P. DeNigris  wrote:
> 
> Sven Van Caekenberghe-2 wrote
>> The answer is simple: use FileSystem, it has been in the image for years. 
> 
> IIUC the thrust of the question was how to get exactly that info most
> effectively to a naive user who runs into the deprecation…

Yes, I understand that that was part of the question, but I don't know what to 
say about that.


Re: [Pharo-users] [Pharo-dev] libfreetype6 missing in the dependencies of ubuntu Pharo distribution

2018-04-27 Thread Peter Uhnák
Thanks :)
I was testing it on behalf of someone else, so no problems for me. :)

Cheers,
Peter

On Fri, Apr 27, 2018 at 3:30 PM, Holger Freyther  wrote:

>
>
> > On 27. Apr 2018, at 19:22, Peter Uhnák  wrote:
>
>
> > I've installed both ( apt install pharo6-32-ui pharo6-64-ui  ), but the
> font problem was present only for 32bit.
> >
> > Note that I was launching the VM packaged with ZeroConf installation,
> I've only used apt mainly to get all dependencies.
> >
> > Now I tried to also run "pharo6-32-ui Pharo.image" (and "pharo6-64-ui
> Pharo.image"),
> > and in both cases I got errror
> >
> > "/usr/bin/pharo6-32-ui: line 6: /usr/lib/i386-linux-gnu/pharo6-vm/pharo:
> No such file or directory
> >
> > and
> >
> > "/usr/bin/pharo6-64-ui: line 6: /usr/lib/x86_64-linux-gnu/pharo6-vm/pharo:
> No such file or directory
>
> What's missing is that pharo6-32-ui should depend on pharo6-32. And the
> later package has the dependency on libssl and libfreetype and provides the
> "pharo" binary.
>
> thanks for pointing that out and sorry you had to experience it.
>
>
>
>


Re: [Pharo-users] UFFI - Could not coerce arguments

2018-04-27 Thread Serge Stinckwich
On Fri, Apr 27, 2018 at 10:45 AM, Esteban Lorenzano 
wrote:

> hi,
>
> it all depends on how you are declaring your types.
>
> here, for example you are passing
>
> aTF_OutputArray getHandle
>
> that’s a “void*” value (an ExternalAddress or ExternalData object), and in
> declaration you have (if I read correctly):
>
> TF_Output *
>
> so, first question is: if TF_Output != void, then you have a coercing
> problem :).
>
>
​TF_Output != void, because this is a subclass of FFIOpaqueObject
​


> you can fix that just changing the notation to receive a void * (in C is
> all the same, but not in pharo :))
>
> note that this can be happening in a lot of places, since your function
> has a lot of arguments, I just put an example of what can be wrong.
>
>
​

I try to replace all types by void* here:


TF_Session>>runSession: aTF_Session
options: opsTF_Buffer
inputs: inTF_OutputArray values: inTF_TensorArray count: inCount
outputs: outTF_OutputArray values: outTF_TensorArrayPtr count: outCount
targets: aTF_OperationArray count: targetCount
metadata: metaTF_Buffer
status: aTF_Status

"F_CAPI_EXPORT extern void TF_SessionRun(
TF_Session* session,
// RunOptions
const TF_Buffer* run_options,
// Input tensors
const TF_Output* inputs, TF_Tensor* const* input_values, int ninputs,
// Output tensors
const TF_Output* outputs, TF_Tensor** output_values, int noutputs,
// Target operations
const TF_Operation* const* target_opers, int ntargets,
// RunMetadata
TF_Buffer* run_metadata,
// Output status
 TF_Status*);"

^ self
ffiCall: #(void TF_SessionRun #(void* aTF_Session, void*
opsTF_Buffer, void* inTF_OutputArray, void* inTF_TensorArray, int inCount,
void* outTF_OutputArray, void* outTF_TensorArrayPtr, int outCount, void*
aTF_OperationArray, int targetCount, void* metaTF_Buffer, void* aTF_Status))
module: TensorFlowCAPI

but still have some error: "Could not coerce arguments" 

First method was called by :

TF_Session>>runOutputs: aTF_OutputArray size: anInteger
| status outvalues |
status := TF_Status create.
outvalues := FFIExternalArray externalNewType: 'TF_Tensor*' size:
anInteger.
self library
runSession: self getHandle
options: FFIExternalObject null
inputs: FFIExternalObject null
values: FFIExternalObject null
count: 0
outputs: aTF_OutputArray getHandle
values: outvalues getHandle
count: anInteger
targets: FFIExternalObject null
count: 0
metadata: FFIExternalObject null
status: status getHandle.
status check.
^ outvalues


called by:

TF_Session>>runOutputs: anArrayOfTF_Outputs
| outputs |
outputs := FFIExternalArray externalNewType: 'TF_Output' fromArray:
anArrayOfTF_Outputs.
^ self runOutputs: outputs size: anArrayOfTF_Outputs size

called by :

TF_Session>>runOutput: aTF_Output
| results |
results := self runOutputs: {aTF_Output}.
^ results first

called by :

testGraphZeros
| graph session result zeros values |
graph := TF_Graph create.
zeros := graph zerosShaped: #(100 100 10).
session := TF_Session on: graph.
result := session runOutput: (zeros output: 0).
values := result allFloats.
self assert: #(100 100 10) equals: result shape.
self assert: 100 * 100 * 10 equals: values size.
self assert: 0 equals: values min.
self assert: 0 equals: values max


I'm a bit desperated :-(
And impossible to know where the problem come from ...


-- 
Serge Stinckwich
UMI UMMISCO 209 (SU/IRD/UY1)
"Programs must be written for people to read, and only incidentally for
machines to execute."http://www.doesnotunderstand.org/


Re: [Pharo-users] SortedCollection>>reverse answers an inconsistent object in Pharo 6

2018-04-27 Thread Richard O'Keefe
You wrote "In general reversed/converse has no meaning for block."
That's entirely an artefact of representing blocks of different
arities by the same class.  In my own Smalltalk, NiladicBlock,
MonadicBlock, DyadicBlock, ... are different classes.  To put it
another way, your statement has exactly the same status as
"In general #value:value: has no meaning for block."
#converse has meaning for *all* DyadicBlocks, it is the
combinator flip f x y = f y x.  For that matter, it could
be generalised to all blocks of arity >= 2 as
[:a1 :a2 ... :an | body] converse
=> [:a2 :a1 ... :an | body]
i.e., flip the first two arguments.

My original implementation of #converse was
DyadicBlock
  methods for: 'combinators'
converse
  ^[:x :y | self value: y value: x]
"other combinators"

With a suitable set of combinators, I can do things like
#name ascending thenBy: #age descending thenBy: #weight ascending nilsFirst
without needing a SortFunction class.

​I do like the fact that SortFunction can support both 2-way and 3-way​
comparison.


Re: [Pharo-users] Literals

2018-04-27 Thread Esteban A. Maringolo
Hi Clément,

On 27/04/2018 10:32, Clément Bera wrote:
> Obviously sets are not as easy to deal with. You cannot mutate empty
> arrays/bytearrays, if you concatenate something it creates a new object.
> You can add things in sets. So you need to be careful... You can make
> the object read-only to avoid issues (MyClassVar beReadOnlyObject).

Sorry, but I can't understand how a class variable could allow you to
use a new literal.

As far as I knew the only way to have new literals was to modify the
compiler.

So if you want #{} to create a new empty set, or #{1 1 2} to create a
Set with 1 and 2 as elements, there is no way to do it.

Or this %{$a -> 1. 'foo' -> false. 'baz' -> #{1 1 2}} to create a
dictionary with such set as literal. :)

Regards,

-- 
Esteban A. Maringolo



Re: [Pharo-users] Literals

2018-04-27 Thread Richard Sargent
On Fri, Apr 27, 2018 at 2:08 PM, Esteban A. Maringolo 
wrote:

> Hi Clément,
>
> On 27/04/2018 10:32, Clément Bera wrote:
> > Obviously sets are not as easy to deal with. You cannot mutate empty
> > arrays/bytearrays, if you concatenate something it creates a new object.
> > You can add things in sets. So you need to be careful... You can make
> > the object read-only to avoid issues (MyClassVar beReadOnlyObject).
>
> Sorry, but I can't understand how a class variable could allow you to
> use a new literal.
>
> As far as I knew the only way to have new literals was to modify the
> compiler.
>

Yes.

VA Smalltalk has an interesting syntax extension which allows an arbitrary
expression to be a compile-time literal.
Going by memory, something like ##(Dictionary new at: #a put: self
something; at: #b put: self somethingElse; yourself).

Of course, the problem with that is it will not change if the
implementations of the messages it sends entail some changes over time.


> So if you want #{} to create a new empty set, or #{1 1 2} to create a
> Set with 1 and 2 as elements, there is no way to do it.
>
> Or this %{$a -> 1. 'foo' -> false. 'baz' -> #{1 1 2}} to create a
> dictionary with such set as literal. :)
>
> Regards,
>
> --
> Esteban A. Maringolo
>
>


Re: [Pharo-users] Literals

2018-04-27 Thread Esteban A. Maringolo
On 27/04/2018 15:35, Richard Sargent wrote:
> On Fri, Apr 27, 2018 at 2:08 PM, Esteban A. Maringolo
> mailto:emaring...@gmail.com>> wrote:

> As far as I knew the only way to have new literals was to modify the
> compiler.
> 
> 
> Yes.
> 
> VA Smalltalk has an interesting syntax extension which allows an
> arbitrary expression to be a compile-time literal.
> Going by memory, something like ##(Dictionary new at: #a put: self
> something; at: #b put: self somethingElse; yourself).

Dolphin Smalltalk provides that ##() literal as well since a decade at
least, so you have the full expression that gave origin to that literal,
but you don't need to compute it every time it is accessed.

Although I don't remember seeing it with Dictionaries, but more with
string concatenations or "magic numbers" like seconds in a day stored as
##(24 * 60 * 60).

Regards,


-- 
Esteban A. Maringolo



Re: [Pharo-users] Literals

2018-04-27 Thread Clément Bera
The guy who asked the question said: "...when you want to shorten some
object initialization"

Using ClassVariable is an alternative way to shorten object initialization,
reading a ClassVariable is almost the same performance as reading a
literal, so that looked like a good alternative to me. Both the
ClassVariable and the literal have the same issues (same object so if you
mutate it you have to deal with it).

But yes, it's not a new literal.

For new literals, you can extend the compiler or hard patch thing:

MyClass>>foo
^ #bar

(MyClass>>#foo) literalAt: ((MyClass>>#foo) literals indexOf: #bar) put:
Set new.

MyClass new foo

>>> a Set ()

Obviously it depends what you mean by literal, the latter code uses the
literal bytecode instruction, which does not make the pushed object a
literal object...

On Fri, Apr 27, 2018 at 8:59 PM, Esteban A. Maringolo 
wrote:

> On 27/04/2018 15:35, Richard Sargent wrote:
> > On Fri, Apr 27, 2018 at 2:08 PM, Esteban A. Maringolo
> > mailto:emaring...@gmail.com>> wrote:
>
> > As far as I knew the only way to have new literals was to modify the
> > compiler.
> >
> >
> > Yes.
> >
> > VA Smalltalk has an interesting syntax extension which allows an
> > arbitrary expression to be a compile-time literal.
> > Going by memory, something like ##(Dictionary new at: #a put: self
> > something; at: #b put: self somethingElse; yourself).
>
> Dolphin Smalltalk provides that ##() literal as well since a decade at
> least, so you have the full expression that gave origin to that literal,
> but you don't need to compute it every time it is accessed.
>
> Although I don't remember seeing it with Dictionaries, but more with
> string concatenations or "magic numbers" like seconds in a day stored as
> ##(24 * 60 * 60).
>
> Regards,
>
>
> --
> Esteban A. Maringolo
>
>


-- 
Clément Béra
https://clementbera.github.io/
https://clementbera.wordpress.com/


Re: [Pharo-users] #ast vs. #parseTree

2018-04-27 Thread Sean P. DeNigris
Marcus Denker-4 wrote
> I will add comments…

I got confused by this again and created an issue:
https://pharo.manuscript.com/f/cases/21806/Document-Difference-between-ast-and-parseTree

And then Peter Uhnak reminded me on Discord about this thread. I'm happy to
add the comments, but not sure I understand the issue well enough. IIUC #ast
is cached, but #parseTree is not. What I don't understand is the purpose of
this difference and when one would use one over the other. For example,
when, if ever, would a user want to access a CM's #ast (as opposed to
#parseTree) and could modifying it create problems?





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



Re: [Pharo-users] [Voyage] Possible to save an OrderedCollection?

2018-04-27 Thread Esteban Lorenzano


> On 27 Apr 2018, at 15:30, sergio ruiz  wrote:
> 
> Hi, esteban..
> 
> In this case, the persisted object is TestBox..
> 
> it does show up just fine in Mongo, but the OrderedCollection of points does 
> not.

did you add the property after doing some tests? 
in that case, you need to reset Voyage caché.

usually, 

VORepository current flush

will do it

Esteban
> 
> On April 27, 2018 at 8:57:26 AM, Esteban Lorenzano (esteba...@gmail.com 
> ) wrote:
> 
>> 
>> what you need to save is the persistent object, the one marked as 
>> “isVoyageRoot” in class side.
> 
> peace,
> sergio
> photographer, journalist, visionary
> 
> Public Key: http://bit.ly/29z9fG0 
> #BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV
> http://www.codeandmusic.com 
> http://www.twitter.com/sergio_101 
> http://www.facebook.com/sergio101 


Re: [Pharo-users] [Voyage] Possible to save an OrderedCollection?

2018-04-27 Thread sergio ruiz
Ah.. ok. this did it..

So, this works, meaning that the production code i have in place is the 
problem..

I must have a loop somewhere..

I can’t find it for the life of me..



On April 27, 2018 at 4:10:53 PM, Esteban Lorenzano (esteba...@gmail.com) wrote:

did you add the property after doing some tests? 
in that case, you need to reset Voyage caché.

peace,
sergio
photographer, journalist, visionary

Public Key: http://bit.ly/29z9fG0
#BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV
http://www.codeandmusic.com
http://www.twitter.com/sergio_101
http://www.facebook.com/sergio101

signature.asc
Description: Message signed with OpenPGP using AMPGpg


Re: [Pharo-users] Literals

2018-04-27 Thread Esteban A. Maringolo
oh, you were talking about how te VM views the object,
I was thinking in terms of how the compiler sees the text.

So I'm talking about literals "syntax".

Thanks anyway for the "trick" :)

On 27/04/2018 16:34, Clément Bera wrote:
> The guy who asked the question said: "...when you want to shorten some
> object initialization"
> 
> Using ClassVariable is an alternative way to shorten object
> initialization, reading a ClassVariable is almost the same performance
> as reading a literal, so that looked like a good alternative to me. Both
> the ClassVariable and the literal have the same issues (same object so
> if you mutate it you have to deal with it).
> 
> But yes, it's not a new literal.
> 
> For new literals, you can extend the compiler or hard patch thing:
> 
> MyClass>>foo
> ^ #bar
> 
> (MyClass>>#foo) literalAt: ((MyClass>>#foo) literals indexOf: #bar) put:
> Set new.
> 
> MyClass new foo 
> 
 a Set ()
> 
> Obviously it depends what you mean by literal, the latter code uses the
> literal bytecode instruction, which does not make the pushed object a
> literal object...


-- 
Esteban A. Maringolo



Re: [Pharo-users] Literals

2018-04-27 Thread Richard Sargent
On Fri, Apr 27, 2018 at 3:58 PM, Esteban A. Maringolo 
wrote:

> oh, you were talking about how te VM views the object,
> I was thinking in terms of how the compiler sees the text.
>
> So I'm talking about literals "syntax".
>
> Thanks anyway for the "trick" :)
>

Another common technique is a "once block". Teach Block how to evaluate
itself once and to use its cached result the next time.

It's not as fast as a literal, but it is a pretty effective way to have a
clean implementation with as complex code as one could wish.
Clear the cache when saving the image or at image start up or ... whenever
seems good (such as when you change the implementation of what was cached.

e.g.
[Dictionary new
at: #a put: self something;
at: #b put: self somethingElse;
yourself]
once



>
> On 27/04/2018 16:34, Clément Bera wrote:
> > The guy who asked the question said: "...when you want to shorten some
> > object initialization"
> >
> > Using ClassVariable is an alternative way to shorten object
> > initialization, reading a ClassVariable is almost the same performance
> > as reading a literal, so that looked like a good alternative to me. Both
> > the ClassVariable and the literal have the same issues (same object so
> > if you mutate it you have to deal with it).
> >
> > But yes, it's not a new literal.
> >
> > For new literals, you can extend the compiler or hard patch thing:
> >
> > MyClass>>foo
> > ^ #bar
> >
> > (MyClass>>#foo) literalAt: ((MyClass>>#foo) literals indexOf: #bar) put:
> > Set new.
> >
> > MyClass new foo
> >
>  a Set ()
> >
> > Obviously it depends what you mean by literal, the latter code uses the
> > literal bytecode instruction, which does not make the pushed object a
> > literal object...
>
>
> --
> Esteban A. Maringolo
>
>


Re: [Pharo-users] Literals

2018-04-27 Thread Ben Coman
On 28 April 2018 at 03:34, Clément Bera  wrote:

> The guy who asked the question said: "...when you want to shorten some
> object initialization"
>
> Using ClassVariable is an alternative way to shorten object
> initialization, reading a ClassVariable is almost the same performance as
> reading a literal, so that looked like a good alternative to me. Both the
> ClassVariable and the literal have the same issues (same object so if you
> mutate it you have to deal with it).
>
> But yes, it's not a new literal.
>
> For new literals, you can extend the compiler or hard patch thing:
>
> MyClass>>foo
> ^ #bar
>
> (MyClass>>#foo) literalAt: ((MyClass>>#foo) literals indexOf: #bar) put:
> Set new.
>
> MyClass new foo
>
> >>> a Set ()
>
> Obviously it depends what you mean by literal, the latter code uses the
> literal bytecode instruction, which does not make the pushed object a
> literal object...
>
> Maybe pool dictionaries provide a half-way house...
http://www.instantiations.com/PDFs/Smalltalk-Report/pools.pdf
http://files.pharo.org/books-pdfs/updated-pharo-by-example/2017-01-14-UpdatedPharoByExample.pdf

cheers -ben


Re: [Pharo-users] Literals

2018-04-27 Thread lb
Hi,
I think the question is 
How automaticly create literal's objects , not initialize.
e.g
'aString'
#aSymbol
{ anArray}
#[]



Cheers  Liang



Re: [Pharo-users] Literals

2018-04-27 Thread Richard O'Keefe
The ## syntax that some Smalltalks have (Smalltalk/X, for
example, which calls it a Dolphin extension) is related
to Common Lisp's
   #.e  the result of evaluating e at *read* time,
taken as a literal
   #,e  the result of evaluating e at *load* time,
taken as a literal.
This reminds us there are several times that a ## form
could be evaluated:
 - in the parser, when a method is parsed (before code
   generation)
 - when code is generated
 - when code is generated AND whenever the image is
   restored
 - when the value is first needed (I'd prefer this)
 - when the value is first needed in a thread (that
   is, each thread that encounters it will evaluate
   it just once, so each thread may see a different
   value).

One continuing annoyance in Smalltalk is that I cannot
put a Fraction, a Date, a Time, or a DateAndTime in a
literal.  It would be nice to have #1969-07-20 or #1/2
or #16:40:32 as literals and they contain no expressions
that could result in any confusion about when they are
evaluated and cannot be changed any more than a character
literal can.

Curly brace syntax {e1. ... en} is an expression form,
not a literal form.  Similar forms for sets of several
kinds and dictionaries of several kinds are supported
in my Smalltalk, and they are indeed useful, but they
are especially useful because they are *not* literals
but create new values every time.


On 28 April 2018 at 16:13, lb  wrote:

> Hi,
> I think the question is
> How automaticly create literal's objects , not initialize.
> e.g
> 'aString'
> #aSymbol
> { anArray}
> #[]
> 
>
> Cheers  Liang
>
>