Re: [Pharo-users] FFI structs

2014-10-30 Thread Tudor Girba
That is cool.

Doru

On Thu, Oct 30, 2014 at 11:37 PM, stepharo  wrote:

>  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
>> >>
>> >>
>> >>
>> >>
>> >>
>> >
>> >
>>
>>
>>
>
>


-- 
www.tudorgirba.com

"Every thing has its own flow"


Re: [Pharo-users] Bug? in Filein

2014-10-30 Thread José Comesaña
I see. But WATestError it is in the same package it is "Fileing", on line
3284 and is referenced many times before. I am sorry I have not enough
knowledge about the internals to do more debugging.

Seems to be a lack of coordination between FileOut and FileIn. Maybe
nothing to do...

Now a simpler and clearer test:

1. Back to the original situation.
2. FileOut *only* WAContextTest. It has a comment: "I am the base class for
all tests that need a WARequestContext present.", in .st file in line 8.
3. Remove it.
4. FileIn again. No errors on Transcript BUT no comment appears for
WAContextTest.

Maybe, if I get a couple of free hours I could dare to debug a little

Best


2014-10-30 23:30 GMT+01:00 stepharo :

>  It says that the class WATestError is not available.
>
>
>
>  Yes, I did. It is in the .st file
>
>
>
>> c. You get a bunch of errors in Transcript while filing in
>>>
>>  No magic ball so we cannot guess.
>>
>>
>  Example of Transcript messages (in case it helps):
> WADocumentHandlerResponseTest>>createAndVerifyBinaryDocumentNamed:hasAttachment:
> (WATestingFiles is Undeclared)
>
>  WAExceptionHandlerTest>>testCommaReturnsExceptionSet (WATestError is
> Undeclared)
>
>  WAExceptionHandlerTest>>testCommaReturnsExceptionSet (WATestError is
> Undeclared)
>
>  WAExceptionHandlerTest>>testCommaReturnsExceptionSet (WATestError is
> Undeclared)
>
>  WAExceptionHandlerTest>>testCommaReturnsExceptionSet (WATestError is
> Undeclared)
>
>  WAExceptionHandlerTest>>testInternalError (WATestError is Undeclared)
>
>
>  It happens in more cases. I just took this one because this is a package
> anyone can install in order to reproduce the problem.
>
>  Thanks
>
>
>


Re: [Pharo-users] FFI structs

2014-10-30 Thread stepharo
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 mailto:steph...@free.fr>> 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] AST tokens question

2014-10-30 Thread stepharo

this one is in SmaCC. I'll see if I can switch to your solution.

I had a look at Nautilus add protocol for fun. 2303 entries for a 
subclass of MorphTreeModel :( I reduce that to 11 entries in 
AltBrowser add protocol for the same use case.

:(
Same feeling here but we will live with it for now.
I started to change to the feel of the pop up.

Stef




Re: [Pharo-users] Bug? in Filein

2014-10-30 Thread stepharo

It says that the class WATestError is not available.




Yes, I did. It is in the .st file

c. You get a bunch of errors in Transcript while filing in

No magic ball so we cannot guess.


Example of Transcript messages (in case it helps):
WADocumentHandlerResponseTest>>createAndVerifyBinaryDocumentNamed:hasAttachment: 
(WATestingFiles is Undeclared)


WAExceptionHandlerTest>>testCommaReturnsExceptionSet (WATestError is 
Undeclared)


WAExceptionHandlerTest>>testCommaReturnsExceptionSet (WATestError is 
Undeclared)


WAExceptionHandlerTest>>testCommaReturnsExceptionSet (WATestError is 
Undeclared)


WAExceptionHandlerTest>>testCommaReturnsExceptionSet (WATestError is 
Undeclared)


WAExceptionHandlerTest>>testInternalError (WATestError is Undeclared)


It happens in more cases. I just took this one because this is a 
package anyone can install in order to reproduce the problem.


Thanks





Re: [Pharo-users] Bug? in Filein

2014-10-30 Thread José Comesaña
2014-10-30 13:16 GMT+01:00 stepharo :

>
> On 30/10/14 06:57, José Comesaña wrote:
>
>> I've found this problem in Pharo 3 (seems to happen in Pharo 4 too):
>>
>> Do:
>>
>> 1. Fileout Seaside-Tests-Core
>> 2. Remove Seaside-Test-Core
>> 3. File in the file created in step 1
>>
>> You will find:
>>
>> a. The structure of the package changes.
>>
> What do you mean by it changes?
> New packages? Removed packages? dirty ones?
>
>
New package: Seaside-Tests-Core-RequestHandling. WaContextText is now in
that package


>  b. Comments for WaContextTest are lost
>>
> May be the fileout does not export the comment. Did you check in the .st
> file?
>
>
>
Yes, I did. It is in the .st file



>  c. You get a bunch of errors in Transcript while filing in
>>
> No magic ball so we cannot guess.
>
>
Example of Transcript messages (in case it helps):
WADocumentHandlerResponseTest>>createAndVerifyBinaryDocumentNamed:hasAttachment:
(WATestingFiles is Undeclared)

WAExceptionHandlerTest>>testCommaReturnsExceptionSet (WATestError is
Undeclared)

WAExceptionHandlerTest>>testCommaReturnsExceptionSet (WATestError is
Undeclared)

WAExceptionHandlerTest>>testCommaReturnsExceptionSet (WATestError is
Undeclared)

WAExceptionHandlerTest>>testCommaReturnsExceptionSet (WATestError is
Undeclared)

WAExceptionHandlerTest>>testInternalError (WATestError is Undeclared)


It happens in more cases. I just took this one because this is a package
anyone can install in order to reproduce the problem.

Thanks


Re: [Pharo-users] nautilus plugin documentation

2014-10-30 Thread stepharo

Paul

I'm going over the plugin code and hierarchy and I will probably clean 
it a bit and publish real class comments.
I'm checking the plugin to see the ones that are working and the one we 
can remove or fix.
Writing what I'm learning in 
https://github.com/SquareBracketAssociates/PharoForTheEnterprise-english/tree/master/Nautilus


Stef

On 29/10/14 18:38, Paul DeBruicker wrote:

Hi -

Where is the content that was at this link:

http://rmod.inria.fr/web/pier/software/Tools-Improvement/NautilusDocumentation

?


Thanks

Paul







Re: [Pharo-users] Bug? in Filein

2014-10-30 Thread stepharo


On 30/10/14 06:57, José Comesaña wrote:

I've found this problem in Pharo 3 (seems to happen in Pharo 4 too):

Do:

1. Fileout Seaside-Tests-Core
2. Remove Seaside-Test-Core
3. File in the file created in step 1

You will find:

a. The structure of the package changes.

What do you mean by it changes?
New packages? Removed packages? dirty ones?


b. Comments for WaContextTest are lost
May be the fileout does not export the comment. Did you check in the .st 
file?




c. You get a bunch of errors in Transcript while filing in

No magic ball so we cannot guess.


Any ideas?

Thanks in advance.





[Pharo-users] Bug? in Filein

2014-10-30 Thread José Comesaña
I've found this problem in Pharo 3 (seems to happen in Pharo 4 too):

Do:

1. Fileout Seaside-Tests-Core
2. Remove Seaside-Test-Core
3. File in the file created in step 1

You will find:

a. The structure of the package changes.
b. Comments for WaContextTest are lost
c. You get a bunch of errors in Transcript while filing in

Any ideas?

Thanks in advance.


Re: [Pharo-users] [ANN] Pharo Days 2015

2014-10-30 Thread Robert Shiplett
How I do SO wish I could attend ( I even have old friends living in Lille !
)

And then a trip across to see and walk Rue Chifflet in Besancon and an
afternoon in Strasbourg ?

un
*rêve ...*

Robert Shiplett/Shifflet/Chifflet

On 29 October 2014 20:18, Sven Van Caekenberghe  wrote:

> We are excited to announce the details so far for the Pharo Days 2015, to
> be held on Thursday January 29 and Friday January 30 at INRIA, Lille,
> France.
>
>
>   https://medium.com/@svenvc/pharo-days-2015-6336d6ee2a23
>
>
> We’ll update this page moving forward. You can ask questions on the any of
> the Pharo mailing lists or you can email the Pharo Board.
>
>
> Official registration is not yet open, but there is a Doodle that should
> give an indication of who is coming and that can help us plan resources.
>
>
>   http://doodle.com/icxtazwfq76caxf8
>
>
> The Pharo Board
>


Re: [Pharo-users] nautilus plugin documentation

2014-10-30 Thread stepharo

Here is what I found.
I'm adding a doc into book garage (pharo for the entreprise)

How to create Nautilus-Plugins

Here we will give some brief explanations on how to create your own 
plugin. By the way there are only two requirements

to create a Nautilus-Plugin:

• the class should inherit from AbstractNautilusPlugin
• it should implement #registerTo: aModel

Announcement subscription

The method registerTo: is used by the plugin to register itself to 
aModel announcements.



Pharo by Example

MyPlugin>>registerTo: aModel

aModel announcer
on: NautilusKeyPressed send: #keyPressed: to: self


In this example, the instance of MyPlugin subscribe themselves to 
NautilusKeyPressed, and

tell aModel’s announcer to send: keyPressed to the instance.

Pharo by Example

So each time a key will be pressed in a Nautilus window the 
methodkeyPressed: will be called.


Pharo by Example

Display

If you want your plugin to add a graphical widget to Nautilus you should 
override the display method.
This method should return the Morphic element you want Nautilus to 
display. By default the method returns nil to

notify Nautilus not to display anything.

Pharo by Example

MyPlugin>>display

morph := LabelMorph new contents: '';
enabled: false; vResizing: #shrinkWrap; hResizing: #spaceFill; 
yourself.


^ morph


Pharo by Example

You can also redefine the following methods on the class side:

• #defaultPosition : defines the default position of the morph (pos- 
sible values are {#top, #middle, #bottom, #none}). The default value is 
#none.


• #possiblePositions:answersacollectionofthepossiblepositions the widget 
could adopt.


And finally you could redefine the name method to change the name 
displayed in the Nautilus Plugin Manager.



Pharo by Example


Re: [Pharo-users] AST tokens question

2014-10-30 Thread Thierry Goubier
Hi Stef,

this one is in SmaCC. I'll see if I can switch to your solution.

I had a look at Nautilus add protocol for fun. 2303 entries for a subclass
of MorphTreeModel :( I reduce that to 11 entries in AltBrowser add protocol
for the same use case.

Thierry