Re: [Pharo-users] FFI structs

2014-10-29 Thread Thomas Bany
Hi Annick ! I'll explain first why you got the error. The assignment time: ’05:45’ failed because you tried to put an array of char (of size 5*sizeof(char)) inside an address. At some point, you need to allocate the memory that will hold the data. In your case, you can do it quite easily with

Re: [Pharo-users] FFI structs

2014-10-29 Thread Thomas Bany
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.

Re: [Pharo-users] NativeBoost : optimisation of the machine code generation

2014-08-08 Thread Thomas Bany
once (the first time they are executed) and when sessionId changes (because you may be on a different platform). So this is already like that. The assembly code is cached in the method literal. Stef On 7/8/14 17:25, Thomas Bany wrote: Hi everyone, I'm trying to reduce the computation time

[Pharo-users] NativeBoost : optimisation of the machine code generation

2014-08-07 Thread Thomas Bany
Hi everyone, I'm trying to reduce the computation time of the following pseudo-code: - memory allocation (~40 doubles) - object heap to C heap copying - NativeBoost call (nbCall:) - memory freeing The time profiling results are bellow: - 24*3600 calls : 1 minute - 24*3600 calls with only

Re: [Pharo-users] NativeBoost : optimisation of the machine code generation

2014-08-07 Thread Thomas Bany
the code , preferably that contains only the problem would be easier to test , debug and investigate. On Thu, Aug 7, 2014 at 6:25 PM, Thomas Bany mun.sys...@gmail.com wrote: Hi everyone, I'm trying to reduce the computation time of the following pseudo-code: - memory allocation (~40 doubles

Re: [Pharo-users] NativeBoost : optimisation of the machine code generation

2014-08-07 Thread Thomas Bany
:= *NBExternalArrayOfDoubles *new: 4. 1 to: *self *internalArray size. do: [ :index | externalArray at: index (put: *self *internalArray at: index) ]. [self actualNBCallWith: externalArray adress storeResultIn: output adress] ensure: [externalArray free. output free]. Thomas. 2014-08-07 19:15 GMT+02:00 Thomas Bany

Re: [Pharo-users] Question on Spec

2014-08-06 Thread Thomas Bany
Hi ! Did you call 'super initailizeWidgets' in the 'initializeWidgets' method of all the subclass of AbstractPanel ? Thomas. 2014-08-06 11:16 GMT+02:00 Mark Rizun mri...@gmail.com: Actually in each:) I have a class AbstractPanel and there is: initializeWidgets self instantiateModels:

Re: [Pharo-users] Question on Spec

2014-08-06 Thread Thomas Bany
Okey, I hadn't read your question carefully :) Looking at TextModelsourceTextArea, it returns the widget of the model, meaning the adapter to PluggableTextMorph. The adapter (and the Morph behind) is instantiated during the building (called in openWithSpec) of the model, not its initialization.

Re: [Pharo-users] Question on Spec

2014-08-06 Thread Thomas Bany
Going through the execution of 'openWithSpec', it looks like the method you are looking for is 'buildWithSpec'. It definitely instantiate the adapters as well as the morphs, with the root of the morph tree being nil. I can't tell you if everything will work as intended though, but I don't see why

Re: [Pharo-users] NativeBoost: use of array

2014-08-05 Thread Thomas Bany
All right ! Tanks again for you answers and kudos for the NB plugin ! I was kinda scared of doing stuff outside of the image but everything went super smooth. 2014-08-05 16:45 GMT+02:00 Igor Stasenko siguc...@gmail.com: On 4 August 2014 16:45, Thomas Bany mun.sys...@gmail.com wrote: Hi

[Pharo-users] NativeBoost: structure with different types

2014-08-04 Thread Thomas Bany
Hi everyone ! I experience troubles with NBExternalStructure in NativeBoost when the structure modeled contains fields with different types. For example, manipulating the following structure poses no problem and I can manipulate the fields correctly: typedef struct abc_s { double a; double b;

Re: [Pharo-users] NativeBoost: structure with different types

2014-08-04 Thread Thomas Bany
of the structure might sovle it ! Thanks a lot for the quick response !! 2014-08-04 13:18 GMT+02:00 Igor Stasenko siguc...@gmail.com: On 4 August 2014 12:37, Thomas Bany mun.sys...@gmail.com wrote: Hi everyone ! I experience troubles with NBExternalStructure in NativeBoost when the structure

[Pharo-users] NativeBoost: use of array

2014-08-04 Thread Thomas Bany
Hi again ! I'm having trouble to call the function with the following prototype : void propagateTLE(orbit_t orb, double secondSince[], xyz_t * out, size_t nbEpoch) with the corresponding NB call: self nbCall: #( void propagateTLE(orbit_t orbit, double * secondSince, xyz_t * out, size_t

Re: [Pharo-users] Memory profiling: usage per class - instance in old memory

2014-04-11 Thread Thomas Bany
Okey so I have found the Class instance that was holding onto the data. I can now save my image after a parsing without tripling its size. But the VM's memory footprint (according to Windows task manager) does not falls back to normal after a parse. My guess is that now that the VM was allocated

[Pharo-users] Quit without asking to save

2014-04-10 Thread Thomas Bany
Hi ! I'm developping a desktop application for Windows and I want to prevent the user from saving the image. First off, setting the #canSaveImage permission to false does not seems to prevent saving. But it's okey since the user won't have access to the World Menu. However, upon quitting the

Re: [Pharo-users] Quit without asking to save

2014-04-10 Thread Thomas Bany
On 10 Apr 2014, at 11:09, Thomas Bany mun.sys...@gmail.com wrote: Hi ! I'm developping a desktop application for Windows and I want to prevent the user from saving the image. First off, setting the #canSaveImage permission to false does not seems to prevent saving. But it's okey

Re: [Pharo-users] open file in append mode

2014-04-09 Thread Thomas Bany
Hi ! I use #setToEnd. Cheers 2014-04-09 10:08 GMT+02:00 Norbert Hartl norb...@hartl.name: How can I open a file in append mode in order to start writing at the end of the file? thanks, Norbert

[Pharo-users] Memory profiling: usage per class - instance in old memory

2014-04-09 Thread Thomas Bany
Hi, My app is a parser/filter for binary files, that produces a bunch of ascii files. At the begining of the parsing, the filtering step involves the storage of the positions of 32 objects, each second for a whole day. So that's 32 Arrays with 86400 elements each. During this step, the memory

Re: [Pharo-users] Memory profiling: usage per class - instance in old memory

2014-04-09 Thread Thomas Bany
I meant a single array weight something like 300Kb with the 32 of them weighting arround 10Mb. I tried to look closely at the way the memory (with VirtualMachine#memoryEnd) was incrementing and it follows this pattern: - The memory costly function is defenitly the one storing my position

Re: [Pharo-users] Memory profiling: usage per class - instance in old memory

2014-04-09 Thread Thomas Bany
, at 12:54, Thomas Bany mun.sys...@gmail.com wrote: Hi, My app is a parser/filter for binary files, that produces a bunch of ascii files. At the begining of the parsing, the filtering step involves the storage of the positions of 32 objects, each second for a whole day. So that's 32 Arrays

[Pharo-users] Use of FileDialogWindow : getting the result

2014-04-07 Thread Thomas Bany
Hi ! I'm trying to fit a GUI in full screen mode, that uses a FileDialogWindow at some point. I'm able to recover the answer from FileDialogWindow when I it is opened modaly. However, since I would like to open it fullscreen with the selector #openFullScreen, the calling block does not wait and

Re: [Pharo-users] Use of FileDialogWindow : getting the result

2014-04-07 Thread Thomas Bany
Okey so I only needed to select a directory and needed to shrink the size of the widget anyway. So I opted for the sublass solution, got rid of the file pane and added an action block on the #ok method. 2014-04-07 16:12 GMT+02:00 Thomas Bany mun.sys...@gmail.com: Hi ! I'm trying to fit a GUI

Re: [Pharo-users] Few questions about Spec (instance specific layout and skinning)

2014-04-03 Thread Thomas Bany
The usual solution is to have a method looking like this on instance side rebuildMyLayout | layout | layout := self buildStateDependentLayout. self buildWithLayout: layout. buildStateDependentLayout ^ SpecLayout composed etc... I will defenitly look into that. The rebuild may be

Re: [Pharo-users] Few questions about Spec (instance specific layout and skinning)

2014-04-03 Thread Thomas Bany
Hey, I have a quick question. I'm trying to build an adapter (called MorphicSwitchAdapter) and a model for SimpleSwitchMorp. I based my layout on the ones in existing adapter (namely MorphicButtonAdapter). And I get stuck in an infinite loop during the interpretation of the layout of the

Re: [Pharo-users] Few questions about Spec (instance specific layout and skinning)

2014-04-03 Thread Thomas Bany
Hum, I was pondering the problem at home and started from scratch. I don't have the issue anymore ... 2014-04-03 18:40 GMT+02:00 Thomas Bany mun.sys...@gmail.com: Hey, I have a quick question. I'm trying to build an adapter (called MorphicSwitchAdapter) and a model for SimpleSwitchMorp. I

Re: [Pharo-users] Few questions about Spec (instance specific layout and skinning)

2014-04-03 Thread Thomas Bany
#addDependent: is send with a morph to the model and I needed the other way arround. Adding #beDependentTo: somewhere in the class hierarchy of SimpleSwitchMorph make it work but I'm not sure I should do that. 2014-04-03 20:37 GMT+02:00 Thomas Bany mun.sys...@gmail.com: Hum, I was pondering the problem

[Pharo-users] Few questions about Spec (instance specific layout and skinning)

2014-04-02 Thread Thomas Bany
Hi ! First, I apologyse for the wall of text. I'm trying my hands at Spec and I have few questions: - How can I implement an instance-dependent layout ? Regarding the layout method lookup, the documentation states that it starts on instance side, which allows a UI to have a more specific