[Pharo-users] Seaside memory leaks ?

2017-03-08 Thread Annick Fron
Hi,

Has anybody investigated whether Seaside has memory leaks using Jquery ? I have 
suspicions about dirty blocks holding variables …
I crashed my server with 170 000 connections...
Annick


Re: [Pharo-users] Pharo on Raspberry Pi 2

2015-02-04 Thread Annick Fron
There is a Jenkins build for Pharo done by Jean-Baptiste Arnaud. The usability 
is mainly hindered by the windowing system, which is VERY slow. On the 
raspberry, there is the possibility to replace X11 by wayland, and I read 
wrappers should exist to move from one to the other. Wayland  can use the 
Raspberry GPU, which is VERY fast.
Besides, JB’s version relies on pharoS and not pharo, so remains behind the 
main pharo development.
But nobody has done that yet.

Annick

Le 2 févr. 2015 à 16:11, Thierry Goubier  a écrit :

> 
> 
> 2015-02-02 16:01 GMT+01:00 Ben Coman :
> Which platform ?...
> http://dev.windows.com/en-us/featured/raspberrypi2support 
> 
> Oh, Linux for me will be perfect, thanks :)
>  
> 
> On Mon, Feb 2, 2015 at 9:21 PM, Ignacio Sniechowski <0800na...@gmail.com> 
> wrote:
> Thierry,
> Pharo runs in the previous RPI, the problem actually is not more horsepower 
> but a JIT VM.
> I think Tim was working in that, but the VM is not quiet there yet.
> From my experience, Pharo at this stage is only barely usable.  But if the VM 
> was similar in specification to that of the x86 architecture I can bet that 
> Pharo will run perfectly well doing some tricks.
> 
> I guessed as well. I was just considering how much more powerfull (and closer 
> to standard ARM platforms?) the version 2 of the Pi seems to be.
> 
> Thierry



Re: [Pharo-users] Opentalk or remoting libraries

2014-11-17 Thread Annick Fron
Thank you,
My need is on a local network from machine to machine, in real time is 
possible, so no security involved. 
I would have preferred something more performant than web services or XMLRPC, 
since both serialization and XML serialization are slow.
Annick
Le 13 nov. 2014 à 20:17, Sven Van Caekenberghe  a écrit :

> Nice.
> 
> It is of course also important to note the security risks involved: the 
> client can execute absolutely anything.
> 
> One partial solution is to bind the server only to the localhost.
> 
>> On 13 Nov 2014, at 19:17, Alain Rastoul  wrote:
>> 
>> Hi,
>> CORBA main focus is about interoperability between systems, languages (don't 
>> know about opentalk).
>> If you want smalltalk only remote execution, you can very easily do your own 
>> on Pharo with Zinc http components and Fuel serializer: a small server that 
>> reads smalltalk blocks, evaluates them and return the result (see below an 
>> example of server and client).
>> I don't know if Zinc and Fuel run on Squeak, but I guess if not, they are 
>> equivalents ones or you could do the same.
>> Beware that Fuel builds a graph of the objects touched by the object it 
>> serializes (the block) and serialize them along the way, that may be a 
>> problem if you have references to other big objects of your image.
>> 
>> " = RPC server"
>> " start Zn server in background "
>> ZnServer startDefaultOn: 1701.
>> ZnServer default delegate: (ZnWebSocketDelegate handler:
>>  ([ :webSocket |
>>  [   [ | serializedRequest request 
>> response serializedResponse  |
>>  serializedRequest := 
>> webSocket readMessage.
>>  request := 
>> FLMaterializer materializeFromByteArray: serializedRequest.
>>  "execute block and it's 
>> value to response byte array"
>>  response := [ request 
>> value ]
>>  
>> on: Exception do: [ :ex | ex resume: 'Exception ',ex class name , ' - ', ex 
>> messageText ].
>>  serializedResponse := 
>> FLSerializer serializeToByteArray: response .
>>  webSocket sendMessage: 
>> serializedResponse .
>>  ] repeat.
>>   ]
>>  on: ConnectionClosed, ConnectionTimedOut
>>  do: [ self crLog: 'Ignoring connection 
>> or timeout' ]
>>  ]) ).
>> "="
>> 
>> " to stop the server"
>> ZnServer stopDefault .
>> 
>> 
>> 
>> "= RPC CLIENT"
>> 
>> " Client call to server: calculate factorial 100 on the other side"
>> | webSocket |
>> webSocket := ZnWebSocket to: 'ws://127.0.0.1:1701'.
>> [ | request serializedRequest serializedResponse response |
>>  request := [  100 factorial ] . 
>> " the request is the block to evaluate"
>>  serializedRequest := FLSerializer serializeToByteArray: request 
>> . "serialize the block"
>>  webSocket sendMessage: serializedRequest .  
>> "send it"
>>  serializedResponse := webSocket readMessage .   
>> " read response"
>>  response := FLMaterializer materializeFromByteArray: 
>> serializedResponse. "deserialize to object"
>>  Transcript show: response asString ; cr  ]
>>  on: ConnectionClosed
>>  do: [ self crLog: 'Ignoring connection close, done' ]
>> 
>> 
>> regards,
>> 
>> Alain
>> 
>> 
>> Le 12/11/2014 18:17, Annick Fron a écrit :
>>> Hi,
>>> 
>>> Are there some libraries in pharo to do remote calls like in Opentalk or 
>>> Corba ?
>>> 
>>> Annick
>>> 
>> 
>> 
>> 
> 
> 




[Pharo-users] Opentalk or remoting libraries

2014-11-12 Thread Annick Fron
Hi,

Are there some libraries in pharo to do remote calls like in Opentalk or Corba ?

Annick


Re: [Pharo-users] FFI structs

2014-11-05 Thread Annick Fron
This is good news !
Annick

Le 30 oct. 2014 à 23:37, stepharo  a écrit :

> Ronie is working on unifying all the api and proposing one syntax mechanism 
> for 
> - nativeBoost back-end
> - FFI 
> and may be Alien
> 
> The FFI situation is not good and we know we should improve it.
> 
> On 29/10/14 20:18, Thomas Bany wrote:
>> Oops, sorry, I was misslead by Steph reply.
>> 
>> Some of the comments might still hold. For the time: ’05:45’ code to work, 
>> you would need FFI to handle all the hassle of memory management and 
>> actually allocate the memory for 5 characters and copying it. I never used 
>> FFI but I doubt it does this.
>> 
>> Looking at FFI library, you both have ExternalAddress (for the struct with 
>> char*) and ExternalType (for the struct with char[5]) that you can use. For 
>> the later solution, it still looks like you should define a specific 5 bytes 
>> ArrayOf5Char type.
>> 
>> 2014-10-29 18:34 GMT+01:00 Annick Fron :
>> I can’t use NativeBoost on the Raspberry, I would be glad if I could !!!
>> 
>> 
>> Le 29 oct. 2014 à 12:18, stepharo  a écrit :
>> 
>> > did you read the NativeBoost tutorial on the PharoForTheEntreprise book?
>> > If you do please report potential mistakes so that we can improve.
>> >
>> >
>> > On 29/10/14 05:59, Annick Fron wrote:
>> >> I I have a C struct with a char*
>> >>
>> >> struct result {
>> >>  char* time }
>> >>
>> >> I define an ExternalStructure in FFI , with one field of type char* (note 
>> >> that the syntax char [5] is not accepted ! ).
>> >>
>> >> defineFields generates the accessors time and time:
>> >>
>> >> If I use
>> >> time: ’05:45’
>> >>
>> >> I get an error.
>> >> How do I set a string value in an ExternalStructure ?
>> >>
>> >> Annick
>> >>
>> >>
>> >>
>> >>
>> >>
>> >
>> >
>> 
>> 
>> 
> 



Re: [Pharo-users] FFI structs

2014-10-29 Thread Annick Fron
I can’t use NativeBoost on the Raspberry, I would be glad if I could !!!


Le 29 oct. 2014 à 12:18, stepharo  a écrit :

> did you read the NativeBoost tutorial on the PharoForTheEntreprise book?
> If you do please report potential mistakes so that we can improve.
> 
> 
> On 29/10/14 05:59, Annick Fron wrote:
>> I I have a C struct with a char*
>> 
>> struct result {
>>  char* time }
>> 
>> I define an ExternalStructure in FFI , with one field of type char* (note 
>> that the syntax char [5] is not accepted ! ).
>> 
>> defineFields generates the accessors time and time:
>> 
>> If I use
>> time: ’05:45’
>> 
>> I get an error.
>> How do I set a string value in an ExternalStructure ?
>> 
>> Annick
>> 
>> 
>> 
>> 
>> 
> 
> 




[Pharo-users] Teaching fork

2014-10-24 Thread Annick Fron

Here is a simple example about fork.

Try the following :

10 timesRepeat: [ (Delay forSeconds: 1) wait. Transcript show: ‘hello’;cr].

Then the following :
[10 timesRepeat: [ (Delay forSeconds: 1) wait. Transcript show: ‘hello’;cr]] 
fork.

I think this should go in an introduction to Pharo.

Annick


[Pharo-users] How to force FFI to load a library

2014-10-22 Thread Annick Fron
Hi,

I have one library which depends from another one.
How can I force pharo to load the dependent library ?

Annick



Re: [Pharo-users] UDP example

2014-10-21 Thread Annick Fron

I think the following code does polling :
>> [ result := socket receiveUDPDataInto: buffer.
>>   result first > 0 ] whileFalse: [ (Delay forMilliseconds: 10) wait ].

and it is preferable to use semaphores, which are more efficient.
Is it possible to replace it by :

socket waitForData.
result :- socket receiveUDPDataInto: buffer  ???

Annick

PS : I have successfully used broadcast UDP on Raspberry

Le 21 oct. 2014 à 16:08, Henrik Johansen  a écrit 
:

> 
>> On 21 Oct 2014, at 3:52 , Luc Fabresse  wrote:
>> 
>> 
>> 
>> 2014-10-21 15:40 GMT+02:00 Sven Van Caekenberghe :
>> 
>> > On 21 Oct 2014, at 15:29, Luc Fabresse  wrote:
>> >
>> >
>> > yes examples are good.
>> > but I also suggest to use a stream on a UDPSocket instead of manipulating 
>> > the socket directly in the model code.
>> > Usually, it lowers the code complexity.
>> 
>> Hmm, are you sure that is even possible with UDP sockets ?
>> 
>> I was thinking of using a stream on the data part of the datagram packets.
>> If you have structured data it simpler to use #next or #nextImage, ...
>> 
>> And if the data part is bigger than one datagram packet (65535 IIRC), you 
>> can append to the stream as soon as you receive the next packet.
>> 
>> Does it sounds good?
>> 
>> Cheers,
>> 
>> Luc
> 
> UDP delivery isn't ordered, nor reliable.
> Build those into a Stream wrapper in order to reliably reconstruct a data 
> stream from the sender, and you're almost back to TCP...
> 
> Cheers,
> Henry



Re: [Pharo-users] UDP example

2014-10-21 Thread Annick Fron
OK super, this example works. I got confused because I did not understand that 
you had 2 variables, buffer passed as argument and result as return.

Annick 
Le 21 oct. 2014 à 09:53, Sven Van Caekenberghe  a écrit :

> The buffer that you supply to #receiveUDPDataInto: is either a String or a 
> ByteArray, preallocated to a certain size. It gets filled with the incoming 
> data part of the datagram. It should be large enough, it never overflows, if 
> it is too small, you simply miss data (it is lost). If you preallocate N 
> bytes, the result, the incoming data, might be less.
> 
> The result from #receiveUDPDataInto: is a 4 element array, that I described 
> before. The fields you are looking for are in the second (the ip address of 
> the sender, a 4 element byte array) and in third (the port of the sender) 
> slot. The first element is the actual number of bytes read. You need to copy 
> from 1 to that size out of the buffer.
> 
> The other fields that are in a datagram, outside the user data, are not 
> accessible. You don't need them, unless you are implementing a TCP/IP stack 
> yourself.
> 
> Did you try this example ?
> 
> "An UDP echo server on port "
> [ Socket newUDP in: [ :socket |
> | loop buffer result input |
> buffer := String new: 256.
> loop := true.
> socket setPort: .
> [ loop ] whileTrue: [ 
>   [ result := socket receiveUDPDataInto: buffer.
> result first > 0 ] whileFalse: [ (Delay forMilliseconds: 10) wait ].
>   input := buffer copyFrom: 1 to: result first.
>   socket sendUDPData: input toHost: result second port: result third.
>   (input beginsWith: #quit) ifTrue: [ loop := false ] ]. 
>   socket closeAndDestroy ] ] forkAt: Processor userBackgroundPriority named: 
> 'UDP echo server'.
> 
> "Any message sent gets echoed back"
> Socket newUDP in: [ :socket |
> | buffer result | 
> socket sendUDPData: 'testing ', 99 atRandom asString toHost: NetNameResolver 
> localHostAddress port: .
> buffer := String new: 256.
> [ result := socket receiveUDPDataInto: buffer.
>   result first > 0 ] whileFalse: [ (Delay forMilliseconds: 10) wait ].
> socket closeAndDestroy.
> { result. buffer. buffer copyFrom: 1 to: result first } ].
> 
> "Send quit to stop the server"
> Socket newUDP in: [ :socket |
> | buffer result | 
> socket sendUDPData: 'quit' toHost: NetNameResolver localHostAddress port: 
> .
> buffer := String new: 256.
> [ result := socket receiveUDPDataInto: buffer.
>   result first > 0 ] whileFalse: [ (Delay forMilliseconds: 10) wait ].
> socket closeAndDestroy.
> { result. buffer. buffer copyFrom: 1 to: result first } ].
> 
> In a terminal (OSX or Linux), you can send a message like this:
> 
> $ nc -u 127.0.0.1 
> foo bar
> foo bar
> quit
> quit
> 
>> On 21 Oct 2014, at 09:31, Annick Fron  wrote:
>> 
>> Sven,
>> 
>> I have put a halt in your sync method, but receiveUDPData comes with 64 
>> bytes in your app, whereas you have provisioned 48 bytes.
>> So since you start data at 33, I guess what you receive is the usual 
>> datagram IP header on 16 bytes, then the UDP header on 16 bytes.
>> http://fr.wikipedia.org/wiki/Internet_Protocol#mediaviewer/File:Ipv4_header.svg
>> http://fr.wikipedia.org/wiki/User_Datagram_Protocol
>> 
>> If this is correct, I should see the source IP address on 4 bytes starting 
>> at byte 9, and the total length should be on 4 bytes starting at byte 5, and 
>> not at byte 1.
>> 
>> Annick
>> 
>> Le 20 oct. 2014 à 17:29, Sven Van Caekenberghe  a écrit :
>> 
>>> Annick,
>>> 
>>>> On 20 Oct 2014, at 17:12, Annick Fron  wrote:
>>>> 
>>>> Thank you but your explanation does not explain what is the type (signed 
>>>> unsigned) and the size of each header component.
>>>> Thus it is impossible to work with that.
>>> 
>>> I think you are making this way more difficult than it is.
>>> 
>>> ZTimestampSNTPClient>>#sync contains a simple, runnable example of using 
>>> datagrams (with a busy wait blocking the calling thread, which is only good 
>>> for something simple, because normally datagrams are asynchronous, but that 
>>> is another story).
>>> 
>>> What you get back from #receiveUDPDataInto: is an Array with 4 elements:
>>> 
>>> - number of bytes received, Integer
>>> - address of sender, ByteArray (use NetNameResolver if necessary)
>>> - port of sender, Integer
>>> - whether more datagrams are available for reading, Boolean
>>> 
>>> The data is 

Re: [Pharo-users] UDP example

2014-10-21 Thread Annick Fron
Sven,

I have put a halt in your sync method, but receiveUDPData comes with 64 bytes 
in your app, whereas you have provisioned 48 bytes.
So since you start data at 33, I guess what you receive is the usual datagram 
IP header on 16 bytes, then the UDP header on 16 bytes.
http://fr.wikipedia.org/wiki/Internet_Protocol#mediaviewer/File:Ipv4_header.svg
http://fr.wikipedia.org/wiki/User_Datagram_Protocol

If this is correct, I should see the source IP address on 4 bytes starting at 
byte 9, and the total length should be on 4 bytes starting at byte 5, and not 
at byte 1.

Annick

Le 20 oct. 2014 à 17:29, Sven Van Caekenberghe  a écrit :

> Annick,
> 
>> On 20 Oct 2014, at 17:12, Annick Fron  wrote:
>> 
>> Thank you but your explanation does not explain what is the type (signed 
>> unsigned) and the size of each header component.
>> Thus it is impossible to work with that.
> 
> I think you are making this way more difficult than it is.
> 
> ZTimestampSNTPClient>>#sync contains a simple, runnable example of using 
> datagrams (with a busy wait blocking the calling thread, which is only good 
> for something simple, because normally datagrams are asynchronous, but that 
> is another story).
> 
> What you get back from #receiveUDPDataInto: is an Array with 4 elements:
> 
> - number of bytes received, Integer
> - address of sender, ByteArray (use NetNameResolver if necessary)
> - port of sender, Integer
> - whether more datagrams are available for reading, Boolean
> 
> The data is in the reallocated buffer that you supplied, aStringOrByteArray.
> 
> This is all perfectly useable at the Pharo level.
> 
> The question about signed/unsigned sounds like a C question, for which this 
> is the wrong list, no ? I am sure it is quite easy to find C code that works 
> with datagrams on your platform. A byte array is an unsigned char array as 
> far as I remember ...
> 
> What you put inside the datagram, is up to you and your application.
> 
> HTH,
> 
> Sven
> 
>> Annick
>> 
>> Le 17 oct. 2014 à 19:09, Sven Van Caekenberghe  a écrit :
>> 
>>> Yes, you have to use the methods in the protocol 'datagrams' of Socket.
>>> 
>>> When you receive a datagram, the IP:PORT of the other party is included, 
>>> see #receiveUDPDataInto:'c comment.
>>> 
>>> It is all a bit low level, but it works well.
>>> 
>>> On 17 Oct 2014, at 18:15, Annick Fron  wrote:
>>> 
>>>> Thank you, but I am confused.
>>>> I have checked your NTP code, and it uses 
>>>> sendUDPData and not sendData. Same for receiveUDPData.
>>>> Besides how is it possible to know where the message comes from in a 
>>>> broadcast mode ??
>>>> Annick
>>>> Le 17 oct. 2014 à 17:35, Sven Van Caekenberghe  a écrit :
>>>> 
>>>>> UDP is pretty easy, just send and receive byte arrays basically, mostly 
>>>>> non-blocking.
>>>>> 
>>>>> http://forum.world.st/UDP-Listener-example-td4362851.html
>>>>> http://forum.world.st/SysLogSender-UDP-td4745862.html
>>>>> 
>>>>> The API is all in Socket.
>>>>> 
>>>>> On 17 Oct 2014, at 17:09, Annick Fron  wrote:
>>>>> 
>>>>>> Hi,
>>>>>> 
>>>>>> I was not able to find a UDP example in pharo.
>>>>>> 
>>>>>> There are only TCP examples.
>>>>>> 
>>>>>> Any pointer ?
>>>>>> 
>>>>>> Annick
>>>>>> 
>>>>> 
>>>>> 
>>>> 
>>> 
>> 
> 




Re: [Pharo-users] GUI Frameworks Choice

2014-10-20 Thread Annick Fron
Hi Steph,

I sent a correction of the ImageSpec example some time ago.

Don’t forget to mention how to put a white background ….

Annick

Le 20 oct. 2014 à 22:00, stepharo  a écrit :

> I should do a pass on the Spec chapters.
> So if you have feedback I'm interested.
> I plan to integrate the contributions made by Stefan Eggermont which were 
> never considered.
> 
> Stef
> 
>>> Hi craig
>>> 
>>> The examples are in the class WidgetExample or ExampleWidget. Now we are 
>>> not happy from a design point of view of having all these widgets creation 
>>> on UITheme.
>>> You can also use Spec. There is a draft of chapters on 
>>> https://ci.inria.fr/pharo-contribution/job/PharoForTheEnterprise/838/artifact/
>>> 
>>> Stef
>> 
>> Thanks Stef, this documentation will make it lot easier to use Spec.
>> 
>> Craig
>> 
>> 
>> 
>> 
>> 
>> 
>> 
> 
> 




Re: [Pharo-users] Socket plugin signature - Urgent

2014-10-20 Thread Annick Fron
In your answer you mention 1 2 3 4 data, without specifying how many bytes they 
have.
Typically the IP address needs 4 bytes, so your answer 1 2 3 4 is quite 
incomplete.
When I receive data like that 

[28 0 203 204 …….]

I don’t know if I have only the datagram or if I have also the IP header.
So my question is how do you group the bytes to get the IP address ???
Where do the data start ? What headers do I have and with which syntax 

Annick


Le 20 oct. 2014 à 17:32, Sven Van Caekenberghe  a écrit :

> I don't understand why you would need it, see my previous reply to your other 
> message.
> 
>> On 20 Oct 2014, at 17:23, Annick Fron  wrote:
>> 
>> Hi,
>> 
>> Is it possible to get the documentation of the socket api signature, because 
>> otherwise I am unable to setup a UDP server ?
>> 
>> Annick
> 
> 




[Pharo-users] Socket plugin signature - Urgent

2014-10-20 Thread Annick Fron
Hi,

Is it possible to get the documentation of the socket api signature, because 
otherwise I am unable to setup a UDP server ?

Annick


Re: [Pharo-users] UDP example

2014-10-20 Thread Annick Fron
Thank you but your explanation does not explain what is the type (signed 
unsigned) and the size of each header component.
Thus it is impossible to work with that.

Annick

Le 17 oct. 2014 à 19:09, Sven Van Caekenberghe  a écrit :

> Yes, you have to use the methods in the protocol 'datagrams' of Socket.
> 
> When you receive a datagram, the IP:PORT of the other party is included, see 
> #receiveUDPDataInto:'c comment.
> 
> It is all a bit low level, but it works well.
> 
> On 17 Oct 2014, at 18:15, Annick Fron  wrote:
> 
>> Thank you, but I am confused.
>> I have checked your NTP code, and it uses 
>> sendUDPData and not sendData. Same for receiveUDPData.
>> Besides how is it possible to know where the message comes from in a 
>> broadcast mode ??
>> Annick
>> Le 17 oct. 2014 à 17:35, Sven Van Caekenberghe  a écrit :
>> 
>>> UDP is pretty easy, just send and receive byte arrays basically, mostly 
>>> non-blocking.
>>> 
>>> http://forum.world.st/UDP-Listener-example-td4362851.html
>>> http://forum.world.st/SysLogSender-UDP-td4745862.html
>>> 
>>> The API is all in Socket.
>>> 
>>> On 17 Oct 2014, at 17:09, Annick Fron  wrote:
>>> 
>>>> Hi,
>>>> 
>>>> I was not able to find a UDP example in pharo.
>>>> 
>>>> There are only TCP examples.
>>>> 
>>>> Any pointer ?
>>>> 
>>>> Annick
>>>> 
>>> 
>>> 
>> 
> 




Re: [Pharo-users] UDP example

2014-10-17 Thread Annick Fron
Thank you, but I am confused.
I have checked your NTP code, and it uses 
sendUDPData and not sendData. Same for receiveUDPData.
Besides how is it possible to know where the message comes from in a broadcast 
mode ??
Annick
Le 17 oct. 2014 à 17:35, Sven Van Caekenberghe  a écrit :

> UDP is pretty easy, just send and receive byte arrays basically, mostly 
> non-blocking.
> 
> http://forum.world.st/UDP-Listener-example-td4362851.html
> http://forum.world.st/SysLogSender-UDP-td4745862.html
> 
> The API is all in Socket.
> 
> On 17 Oct 2014, at 17:09, Annick Fron  wrote:
> 
>> Hi,
>> 
>> I was not able to find a UDP example in pharo.
>> 
>> There are only TCP examples.
>> 
>> Any pointer ?
>> 
>> Annick
>> 
> 
> 




Re: [Pharo-users] FFI on Linux again

2014-10-17 Thread Annick Fron
I have the same problem with myWindow xid.

« bad argument ».

Yet I have used all the other methods which also use myWindow xid and display 
as arguments. I think the problem is from the other arguments passed by 
reference, not by value.
I have seen a new version of Alien from Sept 30, but I don’t know if it works 
in pharo.
Annick

Le 25 sept. 2014 à 18:56, Nicolai Hess  a écrit :

> 
> Am 25.09.2014 17:25 schrieb "Annick Fron" :
> >
> > Hi,
> >
> > I Have tried the following code on Linux , but the call breaks. Is it 
> > because of the X11Window structure missing or else ?
> >
> > Annick
> > 
> > testGetOurWindowLocation
> >"self new testGetOurWindowLocation"
> >
> >| display ourWindow aParent anX anY aWidth aHeight aBorderWidth aDepth |
> >display := X11Display XOpenDisplay: nil.
> >ourWindow := display ourWindow.
> >(Alien lookup: 'XGetGeometry' inLibrary: 'X11')
> >primFFICallResult: nil
> >withArguments:
> >{display.
> >ourWindow.
> >(aParent := Alien new: 4).
> >(anX := Alien new: 4).
> >(anY := Alien new: 4).
> >(aWidth := Alien new: 4).
> >(aHeight := Alien new: 4).
> >(aBorderWidth := Alien new: 4).
> >(aDepth := Alien new: 4)}.
> >(anX unsignedLongAt: 1) inspect
> 
> withArguments ...
> ourWindow xid
> ...
> ?
> 



[Pharo-users] UDP example

2014-10-17 Thread Annick Fron
Hi,

I was not able to find a UDP example in pharo.

There are only TCP examples.

Any pointer ?

Annick



Re: [Pharo-users] Android VM update

2014-10-06 Thread Annick Fron
Hi,

Should I load the new versions of FFI and Alien as well ? from 
September 30th ?

Annick

Le 6 oct. 2014 à 11:30, Jean Baptiste Arnaud  a 
écrit :

> Hi,
> I just comeback from holiday, and I realise that I do not have done a 
> announcement yet.
> Now the prototype of the Pharo Android VM work.
>   - Event is managed
>   - Resolution up to 1080p is managed.
>   - Most of the plugins seems worked.
>   - File plugin allow you to browse the sd card.
> Next:
>   - fix the generator then jenkins. Merge with Pharo/Cog main and Make it 
> available for the public.
>   - die under the mountain of bug entry open by the first public release. 
> First release will be perfect and bugless.
>   - allow easy personalisation of the packaging, allow you to rename and 
> change icon easily (for your own application, Squeak/Pharo Android VM, 
> Phratch, DR geo, etc.).
>   - refined the jumpout logic for have a better graphical update and a 
> better idle process (less consumption, faster reactive UI, UI updating during 
> heavy computation, etc. ).
>   - package the android feature in the android plugin, show/hide the 
> keyboard via primitive, etc. etc. + init configuration.
>   - a lot of cool idea but later
> 
> Here is a youtube video to show the result:
> http://youtu.be/lB9UV9Z7Kss
> 
> You can forward this to other mailing list, I do not have access to all of 
> them.
> 
> Best Regards
> Dr Arnaud
> jbaptiste.arn...@gmail.com
> 
> 
> 
> 
> 
> 
> 
> 



[Pharo-users] Alien datasize

2014-09-30 Thread Annick Fron
Hi,

I am very surprised to see that :
Alien newC:
has 8 bytes (data size = 8) , which is consistent with a 64 bit architecture 
but not with a 32 one !

What is the problem ?

Annick


Re: [Pharo-users] Pharo 32 bits

2014-09-30 Thread Annick Fron
Thank you.
I have just discovered that my C library uses 64 bit integers on a 32 bits 
platform …But Alien is resilient to that !
Annick

Le 29 sept. 2014 à 13:05, Sven Van Caekenberghe  a écrit :

> This is on a 32-bit Ubuntu 13.10
> 
> $ uname -a
> Linux stfx 3.8.0-19-generic #30-Ubuntu SMP Wed May 1 16:36:13 UTC 2013 i686 
> i686 i686 GNU/Linux
> 
> $ curl get.pharo.org/30+vm | bash
>  % Total% Received % Xferd  Average Speed   TimeTime Time  Current
> Dload  Upload   Total   SpentLeft  Speed
> 100  2885  100  28850 0  19171  0 --:--:-- --:--:-- --:--:-- 19233
> Downloading the latest 30 Image:
>http://files.pharo.org/image/30/latest.zip
> Pharo.image
> Downloading the latest pharoVM:
>   http://files.pharo.org/vm/pharo/linux/stable.zip
> pharo-vm/pharo
> Downloading PharoV10.sources:
>   http://files.pharo.org/sources//PharoV10.sources.zip
> Downloading PharoV20.sources:
>   http://files.pharo.org/sources//PharoV20.sources.zip
> Downloading PharoV30.sources:
>   http://files.pharo.org/sources//PharoV30.sources.zip
> Creating starter scripts pharo and pharo-ui
> 
> $ file pharo-vm/pharo 
> pharo-vm/pharo: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), 
> dynamically linked (uses shared libs), for GNU/Linux 2.6.24, 
> BuildID[sha1]=0xd88118f34ce96590cabfada3172b5f153b92e88e, not stripped
> 
> On 29 Sep 2014, at 13:01, Sven Van Caekenberghe  wrote:
> 
>> AFAIK the Pharo VM *is* 32-bit.
>> 
>> On 29 Sep 2014, at 12:57, Annick Fron  wrote:
>> 
>>> Is it possible to download a 32 bits linux pharo vm ?
>>> 
>>> Annick
>>> 
>> 
> 
> 




[Pharo-users] Pharo 32 bits

2014-09-29 Thread Annick Fron
Is it possible to download a 32 bits linux pharo vm ?

Annick



[Pharo-users] How to set a white background with Spec ?

2014-09-26 Thread Annick Fron
Hi,

I am using a window with spec, where can I define a white background 
for it ?

Annick


[Pharo-users] Using themes and closing windows

2014-09-25 Thread Annick Fron
Is there a documentation how to use or write Themes ?

I would like to attach some method when I close a window, how I do that ?

Annick



[Pharo-users] FFI on Linux again

2014-09-25 Thread Annick Fron
Hi,

I Have tried the following code on Linux , but the call breaks. Is it because 
of the X11Window structure missing or else ?

Annick

testGetOurWindowLocation
   "self new testGetOurWindowLocation"

   | display ourWindow aParent anX anY aWidth aHeight aBorderWidth aDepth |
   display := X11Display XOpenDisplay: nil.
   ourWindow := display ourWindow.
   (Alien lookup: 'XGetGeometry' inLibrary: 'X11')
   primFFICallResult: nil
   withArguments:
   {display.
   ourWindow.
   (aParent := Alien new: 4).
   (anX := Alien new: 4).
   (anY := Alien new: 4).
   (aWidth := Alien new: 4).
   (aHeight := Alien new: 4).
   (aBorderWidth := Alien new: 4).
   (aDepth := Alien new: 4)}.
   (anX unsignedLongAt: 1) inspect


Re: [Pharo-users] Threaded callbacks with FFI

2014-09-25 Thread Annick Fron
OK I try do do that.

Le 25 sept. 2014 à 12:18, p...@highoctane.be a écrit :

> 
> Le 25 sept. 2014 11:32, "Annick Fron"  a écrit :
> >
> > Hi,
> >
> > I am calling C from pharo with a callback,  and it seems the callback is 
> > called in another thread.
> > I can’t wrap the block in a process, because the return will be wrong, how 
> > can I do ???
> >
> Can you send us sample code ? 
> > Annick
> >



[Pharo-users] Threaded callbacks with FFI

2014-09-25 Thread Annick Fron
Hi,

I am calling C from pharo with a callback,  and it seems the callback is called 
in another thread.
I can’t wrap the block in a process, because the return will be wrong, how can 
I do ???

Annick


Re: [Pharo-users] FFI examples on Linux don't work

2014-09-23 Thread Annick Fron
Thank you your examples work for me as well, and it’s pretty fast drawing !
Annick
Le 23 sept. 2014 à 01:04, p...@highoctane.be a écrit :

> 
> 
> I've got the 32 bit ones. I checked.
> 
> Nicolas got it working, I'll check.
> 
> Phil
>  
> 
> 
> On Tue, Sep 23, 2014 at 12:32 AM, Casimiro de Almeida Barreto 
>  wrote:
> Sometimes the problem is that you have Linux x86_64 and only the 64bit 
> libraries. When using squeak it is necessary to have the proper 32bit 
> libraries to have the system working.
> 
> On 22-09-2014 18:10, p...@highoctane.be wrote:
>> I passed 'localhost:0:0' in the XWindows example and this gave me a window 
>> reference.
>> 
>> The next problem was that it broke after that. But I got the handle.
>> 
>> Try with that, it may help.
>> 
>> Phil
>> 
>> 
>> On Mon, Sep 22, 2014 at 10:02 PM, Annick Fron  wrote:
>> Thanks you
>> The problem is I wanted to use X windows !
>> Otherwise I have managed to use FFI on Linux.
>> Perhaps there is a glitch when passing nil as argument. It is not clear 
>> whether we have to use nil or 0 (as a null pointer).
>> This is really my point, I sometimes need to pass NULL.
>> Annick
>> 
>> Le 22 sept. 2014 à 21:22, Nicolai Hess  a écrit :
>> 
>>> 
>>> 2014-09-22 18:10 GMT+02:00 p...@highoctane.be :
>>> I've been able to reproduce this.
>>> 
>>> Well, my CentOS thing requires me for some reason to put 
>>> /usr/lib/libX11.so.6 in the module name (doing these kind of things looks 
>>> like usual for lib names with FFI from what I saw from old Squeak threads).
>>> 
>>> Yes, I read this threads too, I solved it by
>>> LD_LIBRARY_PATH= ./pharo 
>>> 
>>> but no matter which of this (LD_LIBRARY_PATH or full name in the ffi 
>>> pragma) the call throws the
>>> "could not coerce arguments"- error.
>>> 
>>> But the Sample class>>callC: method you wrote in the other mail works.
>>> 
>>> 
>>> 
>>> XCreateGC: xDisplay with: aDrawable with: valueMask with: values
>>> 
>>> >> (X11Display* X11Drawable ulong long*) module: '/usr/lib/libX11.so.6'>
>>> 
>>> Now, other internal FFIPrims tests do work.
>>> 
>>> So, it is X11 or something else, I do not know.
>>> 
>>> Phil
>>> 
>>> 
>>> On Mon, Sep 22, 2014 at 4:39 PM, Ben Coman  wrote:
>>> Annick Fron wrote:
>>> Hi,
>>> 
>>> I have posted a bug about this in fogbugz.
>>> FFI example on Linux don’t work
>>> 
>>> X11Display coloredRectangles 
>>> raises an error « coud not coerce arguments ».
>>> In fogbugz, I was asked to raise this question in the mailing list, to know 
>>> if it comes from the VM or from FFI.
>>> 
>>> Annick
>>> 
>>>   
>>> Hi Annick, 
>>> Sorry I don't know anything about this topic to help, just a minor 
>>> observation that a link to the fogbugz issue would help streamline things 
>>> for someone who does.
>>> :)
>>> cheers -ben
>>> 
>>> 
>>> 
>>> 
>>> 
>> 
>> 
> 
> 



Re: [Pharo-users] Forcing a library to load

2014-09-23 Thread Annick Fron
And with FFI and Alien ? Do FFI Alien and NativeBoost share the same libraries ?

Le 22 sept. 2014 à 21:19, p...@highoctane.be a écrit :

> NativeBoost has loadModule: aModuleName which should do the trick.
> 
> Phil
> ​




Re: [Pharo-users] FFI examples on Linux don't work

2014-09-22 Thread Annick Fron
Thanks you
The problem is I wanted to use X windows !
Otherwise I have managed to use FFI on Linux.
Perhaps there is a glitch when passing nil as argument. It is not clear whether 
we have to use nil or 0 (as a null pointer).
This is really my point, I sometimes need to pass NULL.
Annick

Le 22 sept. 2014 à 21:22, Nicolai Hess  a écrit :

> 
> 2014-09-22 18:10 GMT+02:00 p...@highoctane.be :
> I've been able to reproduce this.
> 
> Well, my CentOS thing requires me for some reason to put /usr/lib/libX11.so.6 
> in the module name (doing these kind of things looks like usual for lib names 
> with FFI from what I saw from old Squeak threads).
> 
> Yes, I read this threads too, I solved it by
> LD_LIBRARY_PATH= ./pharo 
> 
> but no matter which of this (LD_LIBRARY_PATH or full name in the ffi pragma) 
> the call throws the
> "could not coerce arguments"- error.
> 
> But the Sample class>>callC: method you wrote in the other mail works.
> 
> 
> 
> XCreateGC: xDisplay with: aDrawable with: valueMask with: values
>'/usr/lib/libX11.so.6'>
> 
> Now, other internal FFIPrims tests do work.
> 
> So, it is X11 or something else, I do not know.
> 
> Phil
> 
> 
> On Mon, Sep 22, 2014 at 4:39 PM, Ben Coman  wrote:
> Annick Fron wrote:
> Hi,
> 
> I have posted a bug about this in fogbugz.
> FFI example on Linux don’t work
> 
> X11Display coloredRectangles 
> raises an error « coud not coerce arguments ».
> In fogbugz, I was asked to raise this question in the mailing list, to know 
> if it comes from the VM or from FFI.
> 
> Annick
> 
>   
> Hi Annick, 
> Sorry I don't know anything about this topic to help, just a minor 
> observation that a link to the fogbugz issue would help streamline things for 
> someone who does.
> :)
> cheers -ben
> 
> 
> 
> 
> 



[Pharo-users] Forcing a library to load

2014-09-22 Thread Annick Fron
Hi,

How is it possible to force a library to load ? Namely I have large libraries 
on linux which depend on each other.
 I discovered that the equivalent code in C runs, but not in pharo using FFI, 
and one problem was that a dependent library was not loaded.


Annick


[Pharo-users] FFI examples on Linux don't work

2014-09-22 Thread Annick Fron
Hi,

I have posted a bug about this in fogbugz.
FFI example on Linux don’t work

X11Display coloredRectangles 

raises an error « coud not coerce arguments ».
In fogbugz, I was asked to raise this question in the mailing list, to know if 
it comes from the VM or from FFI.

Annick


Re: [Pharo-users] Module not found in FFI

2014-09-19 Thread Annick Fron
Oh it’s possible the dependent libraries have problems

Le 19 sept. 2014 à 10:40, Annick Fron  a écrit :

> I constantly get an error « module not found » in FFI using the latest 3.0 VM 
> from yesterday.
> 
> Yet my link does exist, and I have used that a lot of time before.
> 
> Annick




[Pharo-users] Module not found in FFI

2014-09-19 Thread Annick Fron
I constantly get an error « module not found » in FFI using the latest 3.0 VM 
from yesterday.

Yet my link does exist, and I have used that a lot of time before.

Annick


[Pharo-users] Calling Pharo from C

2014-09-18 Thread Annick Fron

Is it possible to call pharo from C ?

Annick



[Pharo-users] callback failed to own the VM

2014-09-17 Thread Annick Fron

Hi,

I get a message when using a callback in Alien.
callback failed to own the VM

Any idea ?

Annick



[Pharo-users] Looking for contracts

2014-09-17 Thread Annick Fron
Hi,

I am looking for contracts right now.

Annick Fron



> =
> Annick Fron - 04 93 22 88 18
> AFC Europe
> B.P. 111
> 977 avenue du Docteur Julien Lefebvre
> 06271 Villeneuve-Loubet Cedex France
> http://www.afceurope.com
> Livre "Architectures Reparties en Java" paru le 5/09/2012
> http://www.dunod.com/pages/ouvrages/ficheouvrage.asp?id=5114






[Pharo-users] Cast in FFI

2014-09-16 Thread Annick Fron
How is it possible to do a cast in FFI ?

Annick



[Pharo-users] Frame Buffer

2014-09-12 Thread Annick Fron
Any body knows how to map a frame buffer /dev/fb0 under linux to a morph ?

Annick



Re: [Pharo-users] FFI signatures

2014-09-09 Thread Annick Fron
If I have 
ulong ulong long long ulong
should I look in
unsignedLongAt: 
1 
5
9
13 
17 
(with an increment of 4)
??

Le 9 sept. 2014 à 15:43, Esteban Lorenzano  a écrit :

> it doesn’t really matters. 
> what you need to be sure for alien is that you have an “evaluator” for that 
> callback. 
> 
> for example, the 
> 
> exampleCqsort
> 
> uses this callback: 
> 
> int (*)(const void *, const void *)
> 
> so, in “Callback” instance side, you can find this definition: 
> 
> voidstarvoidstarRetint: callbackContext sp: spAlien
>   
>   ^callbackContext wordResult:
>   (block
>   value: (Alien forPointer: (spAlien unsignedLongAt: 1))
>   value: (Alien forPointer: (spAlien unsignedLongAt: 5)))
> 
> So, you need to add a method extension, something like: 
> 
> ulongulongRetulong: callbackContext sp: spAlien
>   
>   ^callbackContext wordResult:
>   (block
>   value: (spAlien unsignedLongAt: 1)
>   value: (spAlien unsignedLongAt: 5))
> 
> then you can declare your callback something like: 
> 
>   cb := Callback
>   signature: 'ulong (*)(ulong, ulong)'
>   block: [ :arg1 :arg2 | ... ].
> 
> that has to work :)
> 
> yes, is pretty complicated, and yes, you need to do a method for each kind of 
> different signature you want to use. 
> but well, is the way it works now :)
> 
> Esteban 
> 
> 
> On 09 Sep 2014, at 12:00, Annick Fron  wrote:
> 
>> What signature should I use for a callback ? 
>> ‘ulong’ does not seem to work
>> 
>> Annick
> 




[Pharo-users] FFI signatures

2014-09-09 Thread Annick Fron
What signature should I use for a callback ? 
‘ulong’ does not seem to work

Annick


[Pharo-users] FFI signatures

2014-09-09 Thread Annick Fron
What signature should I use for a callback ? 
‘ulong’ does not seem to work

Annick


[Pharo-users] FFI callbacks

2014-09-09 Thread Annick Fron
In order to use the callbacks, I need to write a pragma in the Callback class 
for the signature.

My signature is something like (where ulong means pointer)

void (ulong ulong long long ulong)

Can you help me ?

Here is an example for another signature :

!Callback methodsFor: 'signatures' stamp: 'eem 11/1/2010 16:40'!
intcharstarRetint: callbackContext sp: spAlien

^callbackContext wordResult:
((block
value: (spAlien signedLongAt: 1) ~= 0
value: (Alien forPointer: (spAlien unsignedLongAt: 5)) 
strcpyUTF8)
ifNil: [0]
ifNotNil:
[:result|
result isInteger
ifTrue: [result]
ifFalse: [result == true 
ifTrue: [1] ifFalse: [0]]])! !




[Pharo-users] Arrays in FFI

2014-09-08 Thread Annick Fron
How would you describe in FFI the fields of an External Structure with a field 
as an array of long of length 4 ?


int format[4]

Annick


[Pharo-users] Timeout when loading FFI

2014-09-08 Thread Annick Fron
Hi,

I have tried to load FFI stable version using the configuration browser and I 
get a timeout.
What is the problem ?

Annick


Re: [Pharo-users] PharoS

2014-09-08 Thread Annick Fron
Thanks to all

Le 8 sept. 2014 à 10:14, Sven Van Caekenberghe  a écrit :

> Hi Annick,
> 
> On 08 Sep 2014, at 09:26, Annick Fron  wrote:
> 
>> What is the difference between pharoS and pharo ?
>> Annick
> 
> At one point there was just the standard Squeak VM. Then Eliot started the 
> CogVM project, whose ultimate goal was to have a JIT compiler. That meant 
> that he had to change part the way the image interacted with the VM, 
> especially around stack and closure/block usage [this is not 100% accurate, 
> but the details are complex]. So he decided to tackle this in two broad 
> steps: first make the just mentioned changes, test that part and then do the 
> JIT part.
> 
> So the Pharo S (aka Stack) VM and the Pharo (COG/JIT) VM are brothers, with 
> the old Squeak VM being their ancestor.
> 
> Practically, the S VM is slower (because it does not do JIT compilation), but 
> much more portable (because it does not have to generate machine code). The S 
> VM is often used to decided whether a VM problem is JIT related or not.
> 
> HTH,
> 
> Sven
> 
> 
> 




[Pharo-users] PharoS

2014-09-08 Thread Annick Fron
What is the difference between pharoS and pharo ?
Annick



[Pharo-users] Smalltalk platform

2014-09-05 Thread Annick Fron
I have a bug on OldAlien on pharo 3 because it is asking
SmalltalkImage current platformName

What is the replacement ?
Annick



[Pharo-users] ImageSpecExample open does not work

2014-08-25 Thread Annick Fron
ImageSpecExample open

raises many bugs, I was not able to correct them.

Annick



Re: [Pharo-users] FFI with compile flags

2014-08-15 Thread Annick Fron
Steph

We had a Skype call yesterday with JB, and we made progress.
The problem is I have several libraries, and it was not easy to find because 
they don’t export symbols and use pkg-config.

See you in Cambridge
Annick
Le 15 août 2014 à 12:36, stepharo  a écrit :

> Annick 
> 
> FFI can call a function but it needs to know where is your library.
> 
> Stef
> 
> On 13/8/14 15:46, Annick Fron wrote:
>> I want to interface some pharo code with gstreamer. But gstreamer does not 
>> come up with a dylib, it requires compilation flags for instance for a C 
>> program.
>> The compile options are :
>> -pthread -I/usr/include/gstreamer-1.0 -I/usr/include/glib-2.0 
>> -I/usr/lib/i386-linux-gnu/glib-2.0/include -lgstreamer-1.0 -lgobject-2.0 
>> -lglib-2.0
>> 
>> so if I don’t know which module to use in FFI. If I put 
>> /usr/lib/gstreamer-1.0
>>  I get an error « module not found ».
>> Since it is handled by pragmas it is very difficult to debug.
>> 
>> Annick
>> Le 13 août 2014 à 13:11, Clément Bera  a écrit :
>> 
>>> I don't understand, do you want to compile your library using FFI or do you 
>>> want to bind a library compiled your way with FFI ?
>>> 
>>> If you want to compile your library using FFI, then use OSProcess to run 
>>> the compilation line you showed.
>>> 
>>> If you want to bind a library compiled your way with FFI, the easiest way 
>>> is to compile the C files as a dylib with something like:
>>> 
>>> gcc -shared -m32 -Wall helloworld.c -o helloworld.dylib $(pkg-config 
>>> --cflags --libs gstreamer-1.0)
>>> 
>>> (replace .dylib by .so or .dll if you're on windows or on Mac).
>>> Then you can bind the dynamic library generated with FFI. I am not sure 
>>> about the FFI syntax but with NativeBoost it would look like:
>>> Integer>>fib4NB
>>> >> errorCode>
>>> ^ self
>>> nbCall: #( int functionToCall (int self) )
>>> module: '/Users/myName/Desktop/helloWorld.dylib'
>>> 
>>> Regards,
>>> 
>>> Clement
>>> 
>>> 
>>> 2014-08-13 11:55 GMT+02:00 Annick Fron :
>>> Hi,
>>> 
>>> I would like to compile a FFI program but the compiling implies compile 
>>> flags like in the following :
>>> 
>>> gcc -Wall helloworld.c -o helloworld $(pkg-config --cflags --libs 
>>> gstreamer-1.0)
>>> 
>>> How do I do this with FFI ?
>>> 
>>> Annick
>>> 
>> 
> 



Re: [Pharo-users] FFI with compile flags

2014-08-13 Thread Annick Fron
I want to interface some pharo code with gstreamer. But gstreamer does not come 
up with a dylib, it requires compilation flags for instance for a C program.
The compile options are :
-pthread -I/usr/include/gstreamer-1.0 -I/usr/include/glib-2.0 
-I/usr/lib/i386-linux-gnu/glib-2.0/include -lgstreamer-1.0 -lgobject-2.0 
-lglib-2.0

so if I don’t know which module to use in FFI. If I put 
/usr/lib/gstreamer-1.0
 I get an error « module not found ».
Since it is handled by pragmas it is very difficult to debug.

Annick
Le 13 août 2014 à 13:11, Clément Bera  a écrit :

> I don't understand, do you want to compile your library using FFI or do you 
> want to bind a library compiled your way with FFI ?
> 
> If you want to compile your library using FFI, then use OSProcess to run the 
> compilation line you showed.
> 
> If you want to bind a library compiled your way with FFI, the easiest way is 
> to compile the C files as a dylib with something like:
> 
> gcc -shared -m32 -Wall helloworld.c -o helloworld.dylib $(pkg-config --cflags 
> --libs gstreamer-1.0)
> 
> (replace .dylib by .so or .dll if you're on windows or on Mac).
> Then you can bind the dynamic library generated with FFI. I am not sure about 
> the FFI syntax but with NativeBoost it would look like:
> Integer>>fib4NB
>  errorCode>
> ^ self
> nbCall: #( int functionToCall (int self) )
> module: '/Users/myName/Desktop/helloWorld.dylib'
> 
> Regards,
> 
> Clement
> 
> 
> 2014-08-13 11:55 GMT+02:00 Annick Fron :
> Hi,
> 
> I would like to compile a FFI program but the compiling implies compile flags 
> like in the following :
> 
> gcc -Wall helloworld.c -o helloworld $(pkg-config --cflags --libs 
> gstreamer-1.0)
> 
> How do I do this with FFI ?
> 
> Annick
> 



[Pharo-users] FFI with compile flags

2014-08-13 Thread Annick Fron
Hi,

I would like to compile a FFI program but the compiling implies compile flags 
like in the following :

gcc -Wall helloworld.c -o helloworld $(pkg-config --cflags --libs gstreamer-1.0)

How do I do this with FFI ?

Annick

Re: [Pharo-users] Using FFI

2014-07-11 Thread Annick Fron
Actually the problem was I had forgotten to put the right number of arguments 
in the Smalltalk method … Too bad …

Le 10 juil. 2014 à 11:54, Esteban Lorenzano  a écrit :

> 
> On 10 Jul 2014, at 02:32, Andres Valloud  
> wrote:
> 
>> On 64 bit Windows a long is 32 bits and pointers are 64 bits, so that type 
>> of replacement is not going to work in the long run…
> 
> Of course, but let’s take care about that problem when actually become a 
> problem :)
> Hopefully, for when we finally have a 64bits with FFI, we will have a proper 
> ** interpretation, but the workaround is the fastest solution you can have 
> for now. 
> 
> Esteban
> 
>> 
>> On 7/9/14 8:20 , Esteban Lorenzano wrote:
>>> yes, FFI does not handle ** arguments.
>>> I always replace it by ulong instead (it is the same, after all)
>>> 
>>> Esteban
>>> 
>>> On 09 Jul 2014, at 17:17, Clément Bera >> <mailto:bera.clem...@gmail.com>> wrote:
>>> 
>>>> Hello,
>>>> 
>>>> This bug happen both with the old and new compiler.
>>>> 
>>>> The error tells you that the number of arguments of your smalltalk
>>>> method does not match the number of argument of the C method you want
>>>> to call (but it seemsthe number of arguments is correct).
>>>> 
>>>> This works fine:
>>>> 
>>>> >>> 'libgstreamer1.0-0.so <http://libgstreamer1.0-0.so/>'>
>>>> ^self externalCallFailed
>>>> 
>>>> This works fine too:
>>>> 
>>>> >>> 'libgstreamer1.0-0.so <http://libgstreamer1.0-0.so/>'>
>>>> ^self externalCallFailed
>>>> 
>>>> So it seems the bug comes from the parser missparsing ** . I am not
>>>> familiar with C enough to help, I don't know what means ** (Is it a
>>>> pointer pointing to a pointer pointing to the actual data ?).
>>>> 
>>>> Perhaps someone who knows how to use FFI can give a better answer.
>>>> 
>>>> Esteban ? Guille ?
>>>> 
>>>> 
>>>> 2014-07-09 16:39 GMT+02:00 Annick Fron >>> <mailto:i...@afceurope.com>>:
>>>> 
>>>> 
>>>> Hi,
>>>> 
>>>> 
>>>> 
>>>> I am trying to use FFI on linux with pharo 3 using version
>>>> 31 of FFI.
>>>> 
>>>>   I have written the following method :
>>>> 
>>>> 
>>>>  >>> 'libgstreamer1.0-0.so <http://libgstreamer1.0-0.so/>'>
>>>> 
>>>>   ^self externalCallFailed
>>>> 
>>>> 
>>>>   
>>>> 
>>>>   but when accepting it I get a syntax error « matching number of
>>>>   arguments »
>>>>   Annick Fron
>>>> 
>>>> 
>>> 
>> 
> 
> 




[Pharo-users] FFI on Linux

2014-07-11 Thread Annick Fron
What should be the name of the module in FFI on Linux ?
For instance, if there is a shared lib under 
/usr/lib named gstreamer-1.0
should it be the name of the shared lib or of a module like libgstreamer-1.0.so 
?

Do I need to put the full path to the lib or is /usr/lib understood by the call 
?

Annick


[Pharo-users] FFI Basic

2014-07-10 Thread Annick Fron

Hi,

I made another attempt , a very basic one on window : trying to use the abs 
method in the standard lib.

abs: aNumber


self externalCallFailed

I get the error ‘cannot return the given type’.

But now if I use long as argument and long as return  it works.

Annick


[Pharo-users] MNU: RBParser>>ExternalFunctionDeclaration

2014-07-10 Thread Annick Fron
Hi,

I have made simple trials using the StandardLib.
I get this error :
RBParser does not understand externalFunctionDeclaration.
I might be missing something …

Annick

Le 9 juil. 2014 à 17:20, Esteban Lorenzano  a écrit :

> yes, FFI does not handle ** arguments. 
> I always replace it by ulong instead (it is the same, after all) 
> 
> Esteban
> 
> On 09 Jul 2014, at 17:17, Clément Bera  wrote:
> 
>> Hello,
>> 
>> This bug happen both with the old and new compiler.
>> 
>> The error tells you that the number of arguments of your smalltalk method 
>> does not match the number of argument of the C method you want to call (but 
>> it seemsthe number of arguments is correct).
>> 
>> This works fine:
>> 
>>  > 'libgstreamer1.0-0.so'>
>>  ^self externalCallFailed   
>> 
>> This works fine too:
>> 
>> > 'libgstreamer1.0-0.so'>
>>  ^self externalCallFailed   
>> 
>> So it seems the bug comes from the parser missparsing ** . I am not familiar 
>> with C enough to help, I don't know what means ** (Is it a pointer pointing 
>> to a pointer pointing to the actual data ?). 
>> 
>> Perhaps someone who knows how to use FFI can give a better answer.
>> 
>> Esteban ? Guille ?
>> 
>> 
>> 2014-07-09 16:39 GMT+02:00 Annick Fron :
>> Hi,
>> 
>> 
>> 
>> I am trying to use FFI on linux with pharo 3 using version 31 of FFI.
>> 
>> I have written the following method :
>>  > 'libgstreamer1.0-0.so'>
>> 
>> ^self externalCallFailed
>> 
>> 
>> 
>> 
>> but when accepting it I get a syntax error « matching number of arguments »
>> Annick Fron
>> 
> 



[Pharo-users] Using FFI

2014-07-09 Thread Annick Fron
Hi,



I am trying to use FFI on linux with pharo 3 using version 31 of FFI.

I have written the following method :
 

^self externalCallFailed




but when accepting it I get a syntax error « matching number of arguments »
Annick Fron

[Pharo-users] Dependencies in Monticello

2014-07-09 Thread Annick Fron
Hi,

I am trying to load Gstreamer from squeak source in Pharo 3.0, but it depends 
on VMMaker, and I don’t know how to get the whole dependency tree.
Has anybody tried it ?

Annick Fron


[Pharo-users] French OS

2014-05-28 Thread Annick Fron
On ne rigole pas …

http://www.programmez.com/node/20771


Le 28 mai 2014 à 09:49, Jean Baptiste Arnaud  a 
écrit :

> So the code has not been ported ... yet.
> StateTracker is a Roassal3D mecanism, that should not been used in standards 
> OpenGL.
> Using R3StateTracker here introduce a dependency between NBOpenGL from 
> Roassal3D that is really bad, as Roassal3D has one from NBOpenGL. 
> The additional risk is to blur the line between OpenGL and Roassal3D.
> But in curent state, I am not sure there another way.
> My demo are completely deprecated because do not used the R3 entity at all. 
> so do not used it, il will put energy to solve that. By reinvent the wheels.
> 
> 
> 
> 
> On 27 May 2014, at 01:10, darrinm  wrote:
> 
>> OK, I've found the R3StateTracker and am working from that.
>> 
>> 
>> 
>> --
>> View this message in context: 
>> http://forum.world.st/3D-with-Pharo-and-OpenGL-tp4760029p4760466.html
>> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>> 
> 
> 
> 
> Best Regards
> Jean Baptiste Arnaud
> jbaptiste.arn...@gmail.com
> 
> 
> 
> 
> 
> 
> 



Re: [Pharo-users] Using FFI

2013-11-08 Thread Annick Fron
I have answered I think

Envoyé de mon iPod

> Le 9 nov. 2013 à 02:01, Stéphane Ducasse  a écrit :
> 
> Annick
> 
> You cannot expect people to respond to you if you do not provide 
> full context + information.
> On the long term people will stop to reply to you. 
> Repeat after me:
>   which image?
>   which OS version?
>   which vm version?
> 
> I think that we are pretty nice people but do not force us to always ask the 
> same questions.
> We are all busy.
> 
> 
> Stef
> 
> 
>> On Nov 6, 2013, at 6:15 PM, Annick Fron  wrote:
>> 
>> I am using the latest download from version 2
>> Annick
>> 
>>> Le 31 oct. 2013 à 18:47, Esteban Lorenzano  a écrit :
>>> 
>>> ok... then we have a problem. 
>>> but we need more data... 
>>> 
>>> which image version are you using?
>>> and which vm version?
>>> 
>>> cheers, 
>>> Esteban
>>>  
>>>> On Oct 31, 2013, at 11:24 AM, Annick Fron  wrote:
>>>> 
>>>> I hâve thé error on Windows
>>>> 
>>>> Envoyé de mon iPod
>>>> 
>>>>> Le 31 oct. 2013 à 14:51, Igor Stasenko  a écrit :
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>>> On 31 October 2013 11:23, Annick Fron  wrote:
>>>>>> Hi Igor
>>>>>> 
>>>>>> I have done that, but still gets an error, do I need to remove 
>>>>>> NativeBoost ?
>>>>>> Annick
>>>>> 
>>>>> FFI not supported on ARM
>>>>>  
>>>>>>> Le 30 oct. 2013 à 14:12, Igor Stasenko  a écrit :
>>>>>>> 
>>>>>>> AFAIK, it should be in Configurations browser.
>>>>>>> Else try this:
>>>>>>> 
>>>>>>> Gofer new
>>>>>>>   squeaksource: 'MetacelloRepository';
>>>>>>> 
>>>>>>>   package: 'ConfigurationOfFFI';
>>>>>>>   load.
>>>>>>> (Smalltalk at: #ConfigurationOfFFI) project lastVersion load
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>>> On 30 October 2013 09:41, Annick Fron  wrote:
>>>>>>>> My problem is that the Raspberry does not support native boost (as yet 
>>>>>>>> !).
>>>>>>>> Where can I load the old FFI ?
>>>>>>>> 
>>>>>>>>> Le 29 oct. 2013 à 16:57, Igor Stasenko  a écrit :
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>>> On 29 October 2013 16:27, Annick Fron  wrote:
>>>>>>>>>> Hi
>>>>>>>>>> 
>>>>>>>>>> I want to launch a simple init with the following C signature :
>>>>>>>>>> 
>>>>>>>>>> void gst_init (int *argc, char **argv[])
>>>>>>>>>> 
>>>>>>>>>> If I write
>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>>> I get a Smalltalk syntax error
>>>>>>>>>> 
>>>>>>>>>> Annick Fron
>>>>>>>>> 
>>>>>>>>> To use this syntax, you must load old FFI implementation.
>>>>>>>>> Or use NativeBoost:
>>>>>>>>> 
>>>>>>>>> init: intarg with: chararg
>>>>>>>>>  
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>> self nbCall: 'void gst_init (int * intarg, char ** chararg)' module: 
>>>>>>>>> 'blaba'
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>> -- 
>>>>>>>>> Best regards,
>>>>>>>>> Igor Stasenko.
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> -- 
>>>>>>> Best regards,
>>>>>>> Igor Stasenko.
>>>>> 
>>>>> 
>>>>> 
>>>>> -- 
>>>>> Best regards,
>>>>> Igor Stasenko.
> 


Re: [Pharo-users] Using FFI

2013-11-06 Thread Annick Fron
I am using the latest download from version 2
Annick

Le 31 oct. 2013 à 18:47, Esteban Lorenzano  a écrit :

> ok... then we have a problem. 
> but we need more data... 
> 
> which image version are you using?
> and which vm version?
> 
> cheers, 
> Esteban
>  
> On Oct 31, 2013, at 11:24 AM, Annick Fron  wrote:
> 
>> I hâve thé error on Windows
>> 
>> Envoyé de mon iPod
>> 
>> Le 31 oct. 2013 à 14:51, Igor Stasenko  a écrit :
>> 
>>> 
>>> 
>>> 
>>> On 31 October 2013 11:23, Annick Fron  wrote:
>>> Hi Igor
>>> 
>>> I have done that, but still gets an error, do I need to remove NativeBoost ?
>>> Annick
>>> 
>>> 
>>> FFI not supported on ARM
>>>  
>>> Le 30 oct. 2013 à 14:12, Igor Stasenko  a écrit :
>>> 
>>>> AFAIK, it should be in Configurations browser.
>>>> Else try this:
>>>> 
>>>> Gofer new
>>>>   squeaksource: 'MetacelloRepository';
>>>> 
>>>>   package: 'ConfigurationOfFFI';
>>>>   load.
>>>> (Smalltalk at: #ConfigurationOfFFI) project lastVersion load
>>>> 
>>>> 
>>>> 
>>>> On 30 October 2013 09:41, Annick Fron  wrote:
>>>> My problem is that the Raspberry does not support native boost (as yet !).
>>>> Where can I load the old FFI ?
>>>> 
>>>> Le 29 oct. 2013 à 16:57, Igor Stasenko  a écrit :
>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> On 29 October 2013 16:27, Annick Fron  wrote:
>>>>> Hi
>>>>> 
>>>>> I want to launch a simple init with the following C signature :
>>>>> 
>>>>> void gst_init (int *argc, char **argv[])
>>>>> 
>>>>> If I write
>>>>> 
>>>>> 
>>>>> 
>>>>> I get a Smalltalk syntax error
>>>>> 
>>>>> Annick Fron
>>>>> 
>>>>> 
>>>>> To use this syntax, you must load old FFI implementation.
>>>>> Or use NativeBoost:
>>>>> 
>>>>> init: intarg with: chararg
>>>>>  
>>>>> 
>>>>> 
>>>>> 
>>>>> self nbCall: 'void gst_init (int * intarg, char ** chararg)' module: 
>>>>> 'blaba'
>>>>> 
>>>>> 
>>>>> -- 
>>>>> Best regards,
>>>>> Igor Stasenko.
>>>> 
>>>> 
>>>> 
>>>> 
>>>> -- 
>>>> Best regards,
>>>> Igor Stasenko.
>>> 
>>> 
>>> 
>>> 
>>> -- 
>>> Best regards,
>>> Igor Stasenko.
> 



Re: [Pharo-users] Using FFI

2013-10-31 Thread Annick Fron
I hâve thé error on Windows

Envoyé de mon iPod

> Le 31 oct. 2013 à 14:51, Igor Stasenko  a écrit :
> 
> 
> 
> 
>> On 31 October 2013 11:23, Annick Fron  wrote:
>> Hi Igor
>> 
>> I have done that, but still gets an error, do I need to remove NativeBoost ?
>> Annick
> 
> FFI not supported on ARM
>  
>>> Le 30 oct. 2013 à 14:12, Igor Stasenko  a écrit :
>>> 
>>> AFAIK, it should be in Configurations browser.
>>> Else try this:
>>> 
>>> Gofer new
>>>   squeaksource: 'MetacelloRepository';
>>> 
>>>   package: 'ConfigurationOfFFI';
>>>   load.
>>> (Smalltalk at: #ConfigurationOfFFI) project lastVersion load
>>> 
>>> 
>>> 
>>>> On 30 October 2013 09:41, Annick Fron  wrote:
>>>> My problem is that the Raspberry does not support native boost (as yet !).
>>>> Where can I load the old FFI ?
>>>> 
>>>>> Le 29 oct. 2013 à 16:57, Igor Stasenko  a écrit :
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>>> On 29 October 2013 16:27, Annick Fron  wrote:
>>>>>> Hi
>>>>>> 
>>>>>> I want to launch a simple init with the following C signature :
>>>>>> 
>>>>>> void gst_init (int *argc, char **argv[])
>>>>>> 
>>>>>> If I write
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> I get a Smalltalk syntax error
>>>>>> 
>>>>>> Annick Fron
>>>>> 
>>>>> To use this syntax, you must load old FFI implementation.
>>>>> Or use NativeBoost:
>>>>> 
>>>>> init: intarg with: chararg
>>>>>  
>>>>> 
>>>>> 
>>>>> 
>>>>> self nbCall: 'void gst_init (int * intarg, char ** chararg)' module: 
>>>>> 'blaba'
>>>>> 
>>>>> 
>>>>> -- 
>>>>> Best regards,
>>>>> Igor Stasenko.
>>> 
>>> 
>>> 
>>> -- 
>>> Best regards,
>>> Igor Stasenko.
> 
> 
> 
> -- 
> Best regards,
> Igor Stasenko.


Re: [Pharo-users] Using FFI

2013-10-31 Thread Annick Fron
Hi Igor

I have done that, but still gets an error, do I need to remove NativeBoost ?
Annick

Le 30 oct. 2013 à 14:12, Igor Stasenko  a écrit :

> AFAIK, it should be in Configurations browser.
> Else try this:
> 
> Gofer new
>   squeaksource: 'MetacelloRepository';
> 
>   package: 'ConfigurationOfFFI';
>   load.
> (Smalltalk at: #ConfigurationOfFFI) project lastVersion load
> 
> 
> 
> On 30 October 2013 09:41, Annick Fron  wrote:
> My problem is that the Raspberry does not support native boost (as yet !).
> Where can I load the old FFI ?
> 
> Le 29 oct. 2013 à 16:57, Igor Stasenko  a écrit :
> 
>> 
>> 
>> 
>> On 29 October 2013 16:27, Annick Fron  wrote:
>> Hi
>> 
>> I want to launch a simple init with the following C signature :
>> 
>> void gst_init (int *argc, char **argv[])
>> 
>> If I write
>> 
>> 
>> 
>> I get a Smalltalk syntax error
>> 
>> Annick Fron
>> 
>> 
>> To use this syntax, you must load old FFI implementation.
>> Or use NativeBoost:
>> 
>> init: intarg with: chararg
>>  
>> 
>> 
>> self nbCall: 'void gst_init (int * intarg, char ** chararg)' module: 'blaba'
>> 
>> 
>> -- 
>> Best regards,
>> Igor Stasenko.
> 
> 
> 
> 
> -- 
> Best regards,
> Igor Stasenko.



Re: [Pharo-users] Using FFI

2013-10-30 Thread Annick Fron
My problem is that the Raspberry does not support native boost (as yet !).
Where can I load the old FFI ?

Le 29 oct. 2013 à 16:57, Igor Stasenko  a écrit :

> 
> 
> 
> On 29 October 2013 16:27, Annick Fron  wrote:
> Hi
> 
> I want to launch a simple init with the following C signature :
> 
> void gst_init (int *argc, char **argv[])
> 
> If I write
> 
> 
> 
> I get a Smalltalk syntax error
> 
> Annick Fron
> 
> 
> To use this syntax, you must load old FFI implementation.
> Or use NativeBoost:
> 
> init: intarg with: chararg
>  
> 
> self nbCall: 'void gst_init (int * intarg, char ** chararg)' module: 'blaba'
> 
> 
> -- 
> Best regards,
> Igor Stasenko.



[Pharo-users] Using FFI

2013-10-29 Thread Annick Fron
Hi

I want to launch a simple init with the following C signature :

void gst_init (int *argc, char **argv[])

If I write



I get a Smalltalk syntax error

Annick Fron



[Pharo-users] Gstreamer

2013-10-18 Thread Annick Fron
Hi,

I would like to know whether somebody knows about the gstreamer  
plugin. I would like to make it run on the Raspberry.
I have already worked on a Java mapping here :
http://code.google.com/p/gstreamer-java/
But it addresses only version 0.10 and not version 1.0.
I will be in the Gstreamer conference next week in Edimburg.

Annick Fron