Pharo-users
By thread
pharo-users@lists.pharo.org
By month
Messages by month
- ----- 2026 -----
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
May 2015
- 100 participants
- 788 messages
Re: [Pharo-users] Enhancing ICal library
by Damien Cassou
Hi Julien,
Julien Delplanque <julien(a)tamere.eu> writes:
> Hi everyone,
>
> I took a little time to enhance the ICal library and to make it work
> with Pharo 4!
>
> So I forked the one on smalltalkhub
> (http://smalltalkhub.com/#!/~pdebruic/iCal) and put all the modified
> code on github https://github.com/juliendelplanque/pharo-ical.
that's great news, thank you very much for this work. This kind of
library is very important. 2 suggestions:
- could you please create a Jenkins job at
https://ci.inria.fr/pharo-contribution/ to monitor the project?
- if you write your documentation in the next few weeks and in Pillar
(http://www.smalltalkhub.com/#!/~Pier/Pillar) we might include the
chapter in the next EnterprisePharo book (no promise, but iCal would
fit well in the book theme). If you are not fast enough, we could
still include it in one of the next books.
> I already added a GTInspector extension to have better representation
> of iCalendar when inspecting them in Pharo.
A calendar view would be awesome (but probably a lot of work too :-)).
A list of nicely-formatted events would already be great. Something
along the lines of
http://getandroidstuff.com/wp-content/uploads/2013/01/Chronus-CM-10-Clock-C…
Best,
--
Damien Cassou
http://damiencassou.seasidehosting.st
"Success is the ability to go from one failure to another without
losing enthusiasm." --Winston Churchill
May 13, 2015
Re: [Pharo-users] Image growing size
by phil@highoctane.be
I am using TWM and yes it gobbles memory.
Disable/GC/Enable is indeed aomething do every once in a while.
No need for snapshots for this to occur.
A couple of Nautilus windows do the same.
Youcan close them all in TWM and still have them eat memory.
Phil
Le 13 mai 2015 01:50, "Cameron Sanders via Pharo-users" <
pharo-users(a)lists.pharo.org> a écrit :
>
>
> ---------- Forwarded message ----------
> From: Cameron Sanders <camsanders(a)aol.com>
> To: Any question about pharo is welcome <pharo-users(a)lists.pharo.org>
> Cc:
> Date: Tue, 3 Feb 2015 23:11:12 -0500
> Subject: Re: [Pharo-users] Image growing size
> Do any of your (class/pool variable) singleton instances store data? add a
> #clearAll or #reset (mySingletonVar := nil) to the class side -- or
> whatever fits your app -- and do that before that #garbageCollect block.
> [In fact, put that in some XXXAdmin class]
>
> Good Luck,
> Cam
>
> On Tue, Feb 3, 2015 at 12:31 PM, phil(a)highoctane.be <phil(a)highoctane.be>
> wrote:
>
>> Try to open monticello and select any repo, right click and clear the
>> package cache.
>>
>> If you are using monticello that is.
>>
>> Also close all windows, open a workspace and do the
>>
>> 10 timesRepeat: [ Smalltalk garbageCollect].
>>
>> HTH
>> Phil
>> Le 3 févr. 2015 17:49, "Laura Risani" <laura.risani(a)gmail.com> a écrit :
>>
>>> Hi all,
>>>
>>> The official image i've downloaded weighted about 40 MB. Now its size is
>>> about 200 MB. What is the explanation? Is this normal or have i done
>>> something wrong?
>>>
>>> I haven't been using globals, just downloaded and defined some packages.
>>> The only over persistent thing i've done is to keep an instance variable in
>>> some classes i wanted to have a unique instance.
>>>
>>>
>>> Best,
>>> Laura
>>>
>>
>
>
May 13, 2015
Re: [Pharo-users] protobufs for Pharo
by Dmitri Zagidulin
I'm pretty sure there isn't a protobuf library for Pharo.
If you're planning on implementing one, I'd love to collaborate (I could
certainly use one for Phriak (driver for the Riak nosql db)).
On Mon, May 11, 2015 at 2:46 PM, Benjamin Pollack <benjamin(a)bitquabit.com>
wrote:
> On Mon, May 11, 2015, at 12:27 PM, Paul DeBruicker wrote:
> > If you've gotta have prorobuf then you've gotta have protobuf but there
> > is a
> > thrift implementation (https://thrift.apache.org/) and also a message
> > pack
> > implementation (https://code.google.com/p/stomp-serializer/)
> >
>
> There are unfortunately a lot of protocols (including the one I
> mentioned used by RethinkDb) that are protobuf-based, so using one of
> those won't work too well. If interfacing with a third-party tool
> *weren't* necessary, I'd honestly probably just use Fuel, anyway.
>
> --Benjamin
>
>
May 13, 2015
Re: [Pharo-users] mac address on windows
by Nicolai Hess
I had a #asString method in the BYTE_8 class that I put by accident in the
*generated-code... protocol
This method will be removed if the generated methods are regenerated.
Just add a new method:
BYTE_8>>asString
^ self address hex
The address has 8 bytes because this is the max number of bytes reserved
for the address.
The IP_ADAPTER_INFO struct has a field for the actually used number of
bytes.
You can read that field and just read this number of bytes.
2015-05-12 21:32 GMT+02:00 Usman Bhatti <usman.bhatti(a)gmail.com>:
> Hi Nicolas,
>
> Thank you for looking at the code.
> I was away and could not try your code.
>
> On Thu, May 7, 2015 at 9:27 AM, phil(a)highoctane.be <phil(a)highoctane.be>
> wrote:
>
>>
>>
>> On Thu, May 7, 2015 at 1:06 AM, Nicolai Hess <nicolaihess(a)web.de> wrote:
>>
>>>
>>>
>>> 2015-05-06 22:47 GMT+02:00 Henrik Sperre Johansen <
>>> henrik.s.johansen(a)veloxit.no>:
>>>
>>>> A few easily fixed Type/pointers to Types mixups, and a slipup where
>>>> two different classes are confused for the same aside, the real show
>>>> stopper, if I haven't missed something entirely, is that the struct
>>>> parser/NB in general does not handle const sized arrays*, which is used in
>>>> a few of the required structs.
>>>>
>>>> Extending the parser should be relatively straight forward, along the
>>>> lines of adding
>>>> stream peek: #'[' ifTrue: [stream next.
>>>> type := SizedExternalArrayType type: type size: stream next.
>>>> stream next = #']' ifFalse: [self error: 'Missing closing bracket
>>>> for ', type printString]]
>>>> to NBExtenralStructureFields >> #parseFields:... after the name is read.
>>>>
>>>> Coding SizedExternalArrayType is a bit more work though...
>>>>
>>>> Cheers,
>>>> Henry
>>>>
>>>>
>>>> *The end goal would be to be able to generate accessors/read/write for
>>>> a simple test-struct such as
>>>> #fieldsDesc
>>>> ^#(
>>>> char ip[MyClassVar +2];
>>>> )
>>>>
>>>
>>> Yes, a parser for this would be great.
>>>
>>> I tried it with a little hack
>>>
>>> NBExternalStructure subclass: #Char_260 ...
>>>
>>> Char_260 class>>#fieldDesc
>>> ^ #(char data)
>>>
>>> Char_260 class>>instanceSize
>>> ^ 260
>>>
>>> You need another accessor for accessing the data, otherwise you'll only
>>> get the first char. AND I don't know how
>>> the external memory is handle, probably it is never freed :)
>>>
>>> Now a complete example (attached code) call it with
>>> GetMacWin32 getMacAddress
>>>
>>
>>
>> Code loads fine on my 3.0
>>
>
> same here.
>
>
>>
>> But hiccup on:
>>
>
>> resolveType: aTypeName
>> " a type name could be
>> - a class variable name
>> - a class name
>> - a type name
>> - a type name, followed by arbitrary number pointer chars - $*"
>>
>> | name newName resolver binding ptrArity |
>> newName := aTypeName.
>> ptrArity := 0.
>> "resolve aliases and pointers"
>> [
>> name := newName trimRight. <<<--------------- HERE - as newName is a
>> subclass of NBExternalStructure, so no trimRight
>> newName := self aliasForType: name.
>> newName last = $* ifTrue: [
>> ptrArity := ptrArity + 1.
>> newName := newName allButLast ].
>> name = newName ] whileFalse.
>>
>> I changed to name := newName asString trimRight.
>>
>
> this worked for me.
>
>
>>
>> Call worked then but output gives this:
>>
>> GetMacWin32 getMacAddress 'BYTE_8 (
>> data: $¼ <-- some weird string here
>> )'
>>
>
> It worked for me, I didn't encounter the problem of strange characters.
> I get:
> 000c29ab70960000
> The last 4 trailing zeros are not the part of the mac address and I am not
> sure why these are getting added. I'll have a look at your code.
>
> thanks again.
>
> usman
>
>
>> Also, I wonder why you call the primGet... twice
>>
>> getMacAddressOf: iInterface
>> | ptr ptr2 nul ret |
>> ptr := NativeBoost allocate: 4.
>> nul := NativeBoost allocate: 0.
>> ptr nbUInt32AtOffset: 0 put: 0.
>> ret := self primGetAdaptersInfo: nul length: ptr.
>> ret = 111 "ERROR_BUFFER_OVERFLOW"
>> ifTrue: [
>> | size |
>> size := ptr nbUInt32AtOffset: 0.
>> ptr2 := NativeBoost allocate: size.
>> ret := self primGetAdaptersInfo: ptr2 length: ptr.
>> ret = 0 "NO_ERROR"
>> ifTrue: [
>> | pip numberOfInterfaces|
>> numberOfInterfaces := size / IpAdapterInfo instanceSize.
>> (iInterface between:1 and: numberOfInterfaces) ifFalse:[ ^ nil].
>> pip := (NBExternalArray ofType: IpAdapterInfo) onAddress: ptr2 size:
>> numberOfInterfaces.
>> ^ (pip at:iInterface ) Address asString]].
>> ^ nil
>>
>> Phil
>>
>>
>>
>>
>>
>>>
>>>
>>>>
>>>> On Wed, May 6, 2015 at 5:28 PM, Esteban Lorenzano <estebanlm(a)gmail.com>
>>>> wrote:
>>>>
>>>>>
>>>>> On 06 May 2015, at 17:03, Nicolai Hess <nicolaihess(a)web.de> wrote:
>>>>>
>>>>>
>>>>>
>>>>> 2015-05-06 16:40 GMT+02:00 Esteban Lorenzano <estebanlm(a)gmail.com>:
>>>>>
>>>>>>
>>>>>> On 06 May 2015, at 12:10, phil(a)highoctane.be wrote:
>>>>>>
>>>>>> I've loaded your package.
>>>>>>
>>>>>> A prerequisite is to load OS-Window to make it work.
>>>>>>
>>>>>>
>>>>>> why?
>>>>>> in any case, oswindow is already included in pharo4
>>>>>>
>>>>>
>>>>> OS-Windows (by TorstenBergmann)
>>>>>
>>>>> not
>>>>> OSWindow :)
>>>>>
>>>>>
>>>>> ahhh. Name clash :)
>>>>>
>>>>>
>>>>> It is needed for the shared pool WinTypes,
>>>>> but without OS-Window, he can use NBWinTypes instead.
>>>>>
>>>>>
>>>>>
>>>>>>
>>>>>> Esteban
>>>>>>
>>>>>>
>>>>>> I've got the DLL call working nicely and the nativeboost with the
>>>>>> structure freezing.
>>>>>>
>>>>>> Now, we should all have a look at:
>>>>>>
>>>>>> https://github.com/ronsaldo/bullet-pharo
>>>>>>
>>>>>> and
>>>>>>
>>>>>> https://github.com/ronsaldo/swig
>>>>>>
>>>>>> because it looks like the way to go to wrap libraries...
>>>>>>
>>>>>> Ronie, I know you modified swig for generating Pharo code;
>>>>>>
>>>>>> Is cloning your swig repo the way to go ?
>>>>>>
>>>>>>
>>>>>> Phil
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Wed, May 6, 2015 at 10:39 AM, Usman Bhatti <usman.bhatti(a)gmail.com
>>>>>> > wrote:
>>>>>>
>>>>>>> Hi Nicolai,
>>>>>>>
>>>>>>> Here is my package that defines the nativeboost call and associated
>>>>>>> C structs.
>>>>>>> The external C struct is self referencing and hence sometimes I get
>>>>>>> infinite recursion when trying to change field descriptions. That is the
>>>>>>> reason why the automatically generated accessors are absent (although I had
>>>>>>> them in an earlier version).
>>>>>>>
>>>>>>> Attached also the DLL referenced in the code.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Wed, May 6, 2015 at 9:58 AM, Nicolai Hess <nicolaihess(a)web.de>
>>>>>>> wrote:
>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> 2015-05-06 9:53 GMT+02:00 Usman Bhatti <usman.bhatti(a)gmail.com>:
>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Tue, May 5, 2015 at 7:34 PM, phil(a)highoctane.be <
>>>>>>>>> phil(a)highoctane.be> wrote:
>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On Tue, May 5, 2015 at 6:28 PM, Usman Bhatti <
>>>>>>>>>> usman.bhatti(a)gmail.com> wrote:
>>>>>>>>>>
>>>>>>>>>>> I succeeded to do it by encapsulating the C routine as a DLL and
>>>>>>>>>>> doing an FFI call from my image (as suggested by Guille).
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> At least there was a way!
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Exactly :)
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Looks like this is the most controlled|debuggable way:
>>>>>>>>>> - get it working with C code out of Pharo
>>>>>>>>>> - make a bridge that can be used easily with FFI in a dll
>>>>>>>>>> - use that from Pharo with proven FFI
>>>>>>>>>>
>>>>>>>>>> Would NativeBoost work with your dll? Should.
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>> I have read a few resources about Nativeboost but I am still naive
>>>>>>>>> to know the difference between FFI and nativeboost. The FFI call I made to
>>>>>>>>> invoke the DLL function looked similar to the nativeboost calls.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> I also tried to perform the nativeboost call by creating my
>>>>>>>>>>> structures in Pharo. The function in Windows that can be used to retrieve
>>>>>>>>>>> mac address in Windows: GetAdaptersInfo
>>>>>>>>>>> <https://msdn.microsoft.com/en-us/library/windows/desktop/aa365917%28v=vs.85…> that
>>>>>>>>>>> accepts a PIP_ADAPTER_INFO
>>>>>>>>>>> <https://msdn.microsoft.com/en-us/library/windows/desktop/aa366062(v=vs.85).…> structure.
>>>>>>>>>>> I subclassed NBExternalStructure to define this struct and the other used
>>>>>>>>>>> by it in the image but my NB call returned with 87 code (Invalid parameter)
>>>>>>>>>>> and it was impossible to debug. However, I would like to make this thing
>>>>>>>>>>> work to understand what went wrong.
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Has this something to do with 32|64 bit library complications?
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Not exactly. For me, it was more related to the fact that I had to
>>>>>>>>> map a complex C struct in Pharo. Here is an excerpt of the definition from
>>>>>>>>> MSDN:
>>>>>>>>>
>>>>>>>>> typedef struct _IP_ADAPTER_INFO {
>>>>>>>>> struct _IP_ADAPTER_INFO *Next;
>>>>>>>>> ...
>>>>>>>>> PIP_ADDR_STRING CurrentIpAddress;
>>>>>>>>> IP_ADDR_STRING GatewayList;
>>>>>>>>> ...
>>>>>>>>> }
>>>>>>>>>
>>>>>>>>> So, I had to define three external structures (all names in
>>>>>>>>> capitals) and I did the effort but in the end I got an error code that I
>>>>>>>>> could not debug in the image. Hence, I gave up and opted to go in the
>>>>>>>>> native environment. But I would like someone knowledgable to have a look at
>>>>>>>>> my nativeboost code because the nativeboost approach is more simple
>>>>>>>>> (everything's in the image).
>>>>>>>>>
>>>>>>>>
>>>>>>>> I can have a look.
>>>>>>>>
>>>>>>>> btw. for what do you need the mac address?
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> usman
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Phil
>>>>>>>>>>
>>>>>>>>>> With ProcessWrapper, I could not load the classes essential for
>>>>>>>>>> making the plugin work.
>>>>>>>>>>
>>>>>>>>>> HTH,
>>>>>>>>>>
>>>>>>>>>> Usman
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On Mon, May 4, 2015 at 2:54 PM, Ben Coman <btc(a)openinworld.com>
>>>>>>>>>> wrote:
>>>>>>>>>> As a complete newb to VM building I found this fairly straight
>>>>>>>>>> forward (on a Mac btw).
>>>>>>>>>> https://github.com/pharo-project/pharo-vm
>>>>>>>>>> cheers -ben
>>>>>>>>>>
>>>>>>>>>> On Mon, May 4, 2015 at 5:28 PM, Usman Bhatti <
>>>>>>>>>> usman.bhatti(a)gmail.com> wrote:
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On Sun, May 3, 2015 at 4:22 PM, Pierce Ng <pierce(a)samadhiweb.com>
>>>>>>>>>> wrote:
>>>>>>>>>> On Sat, May 02, 2015 at 03:55:47PM +0200, Usman Bhatti wrote:
>>>>>>>>>> > 1/ OSProcess: I tried (PipeableOSProcess command: 'ipconfig
>>>>>>>>>> /all') output.
>>>>>>>>>>
>>>>>>>>>> I have used http://www.smalltalkhub.com/#!/~hernan/ProcessWrapper
>>>>>>>>>> successfully
>>>>>>>>>> back when I was on Windows using some now-ancient version of
>>>>>>>>>> Pharo.
>>>>>>>>>>
>>>>>>>>>> I had initially discarded the idea of using this project because
>>>>>>>>>> it required a plugin and the information of the plugin was outdated on
>>>>>>>>>> squeaksource. However, having evaluated superficially the complexity of
>>>>>>>>>> doing it with nativeboost (because too many external c struct involved in
>>>>>>>>>> the call), I would like to see if I am better off using this wrapper.
>>>>>>>>>>
>>>>>>>>>> I loaded it with:
>>>>>>>>>>
>>>>>>>>>> Gofer it
>>>>>>>>>> url: 'http://www.smalltalkhub.com/mc/hernan/ProcessWrapper/main
>>>>>>>>>> ';
>>>>>>>>>> package: 'ProcessWrapper-Core';
>>>>>>>>>> package: 'ProcessWrapper-Plugin';
>>>>>>>>>> package: 'ProcessWrapper-Tests';
>>>>>>>>>> load.
>>>>>>>>>>
>>>>>>>>>> But the plugins wont load because it requires the
>>>>>>>>>> class SmartSyntaxInterpreterPlugin and apparently this file is a part of
>>>>>>>>>> the VMMaker. Is there any recent config for VMMaker in Pharo because this
>>>>>>>>>> one looks outdated:
>>>>>>>>>>
>>>>>>>>>> http://pharo.gemtalksystems.com/book/Virtual-Machine/Building/VMMakerTool/
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Pierce
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>
>>
>>
>> --
>> ---
>> Philippe Back
>> Visible Performance Improvements
>> Mob: +32(0) 478 650 140 | Fax: +32 (0) 70 408 027
>> Mail:phil@highoctane.be | Web: http://philippeback.eu
>> Blog: http://philippeback.be | Twitter: @philippeback
>> Youtube: http://www.youtube.com/user/philippeback/videos
>>
>> High Octane SPRL
>> rue cour Boisacq 101 | 1301 Bierges | Belgium
>>
>> Pharo Consortium Member - http://consortium.pharo.org/
>> Featured on the Software Process and Measurement Cast -
>> http://spamcast.libsyn.com
>> Sparx Systems Enterprise Architect and Ability Engineering EADocX Value
>> Added Reseller
>>
>>
>>
>
May 12, 2015
Re: [Pharo-users] beginner question - how to get a fully qualified filename from a dialog
by amaloney
Thank you for that Cyril; it's just what I need.
Cheers!
--
View this message in context: http://forum.world.st/beginner-question-how-to-get-a-fully-qualified-filena…
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
May 12, 2015
Re: [Pharo-users] mac address on windows
by Usman Bhatti
Hi Nicolas,
Thank you for looking at the code.
I was away and could not try your code.
On Thu, May 7, 2015 at 9:27 AM, phil(a)highoctane.be <phil(a)highoctane.be>
wrote:
>
>
> On Thu, May 7, 2015 at 1:06 AM, Nicolai Hess <nicolaihess(a)web.de> wrote:
>
>>
>>
>> 2015-05-06 22:47 GMT+02:00 Henrik Sperre Johansen <
>> henrik.s.johansen(a)veloxit.no>:
>>
>>> A few easily fixed Type/pointers to Types mixups, and a slipup where two
>>> different classes are confused for the same aside, the real show stopper,
>>> if I haven't missed something entirely, is that the struct parser/NB in
>>> general does not handle const sized arrays*, which is used in a few of the
>>> required structs.
>>>
>>> Extending the parser should be relatively straight forward, along the
>>> lines of adding
>>> stream peek: #'[' ifTrue: [stream next.
>>> type := SizedExternalArrayType type: type size: stream next.
>>> stream next = #']' ifFalse: [self error: 'Missing closing bracket for
>>> ', type printString]]
>>> to NBExtenralStructureFields >> #parseFields:... after the name is read.
>>>
>>> Coding SizedExternalArrayType is a bit more work though...
>>>
>>> Cheers,
>>> Henry
>>>
>>>
>>> *The end goal would be to be able to generate accessors/read/write for a
>>> simple test-struct such as
>>> #fieldsDesc
>>> ^#(
>>> char ip[MyClassVar +2];
>>> )
>>>
>>
>> Yes, a parser for this would be great.
>>
>> I tried it with a little hack
>>
>> NBExternalStructure subclass: #Char_260 ...
>>
>> Char_260 class>>#fieldDesc
>> ^ #(char data)
>>
>> Char_260 class>>instanceSize
>> ^ 260
>>
>> You need another accessor for accessing the data, otherwise you'll only
>> get the first char. AND I don't know how
>> the external memory is handle, probably it is never freed :)
>>
>> Now a complete example (attached code) call it with
>> GetMacWin32 getMacAddress
>>
>
>
> Code loads fine on my 3.0
>
same here.
>
> But hiccup on:
>
> resolveType: aTypeName
> " a type name could be
> - a class variable name
> - a class name
> - a type name
> - a type name, followed by arbitrary number pointer chars - $*"
>
> | name newName resolver binding ptrArity |
> newName := aTypeName.
> ptrArity := 0.
> "resolve aliases and pointers"
> [
> name := newName trimRight. <<<--------------- HERE - as newName is a
> subclass of NBExternalStructure, so no trimRight
> newName := self aliasForType: name.
> newName last = $* ifTrue: [
> ptrArity := ptrArity + 1.
> newName := newName allButLast ].
> name = newName ] whileFalse.
>
> I changed to name := newName asString trimRight.
>
this worked for me.
>
> Call worked then but output gives this:
>
> GetMacWin32 getMacAddress 'BYTE_8 (
> data: $¼ <-- some weird string here
> )'
>
It worked for me, I didn't encounter the problem of strange characters.
I get:
000c29ab70960000
The last 4 trailing zeros are not the part of the mac address and I am not
sure why these are getting added. I'll have a look at your code.
thanks again.
usman
> Also, I wonder why you call the primGet... twice
>
> getMacAddressOf: iInterface
> | ptr ptr2 nul ret |
> ptr := NativeBoost allocate: 4.
> nul := NativeBoost allocate: 0.
> ptr nbUInt32AtOffset: 0 put: 0.
> ret := self primGetAdaptersInfo: nul length: ptr.
> ret = 111 "ERROR_BUFFER_OVERFLOW"
> ifTrue: [
> | size |
> size := ptr nbUInt32AtOffset: 0.
> ptr2 := NativeBoost allocate: size.
> ret := self primGetAdaptersInfo: ptr2 length: ptr.
> ret = 0 "NO_ERROR"
> ifTrue: [
> | pip numberOfInterfaces|
> numberOfInterfaces := size / IpAdapterInfo instanceSize.
> (iInterface between:1 and: numberOfInterfaces) ifFalse:[ ^ nil].
> pip := (NBExternalArray ofType: IpAdapterInfo) onAddress: ptr2 size:
> numberOfInterfaces.
> ^ (pip at:iInterface ) Address asString]].
> ^ nil
>
> Phil
>
>
>
>
>
>>
>>
>>>
>>> On Wed, May 6, 2015 at 5:28 PM, Esteban Lorenzano <estebanlm(a)gmail.com>
>>> wrote:
>>>
>>>>
>>>> On 06 May 2015, at 17:03, Nicolai Hess <nicolaihess(a)web.de> wrote:
>>>>
>>>>
>>>>
>>>> 2015-05-06 16:40 GMT+02:00 Esteban Lorenzano <estebanlm(a)gmail.com>:
>>>>
>>>>>
>>>>> On 06 May 2015, at 12:10, phil(a)highoctane.be wrote:
>>>>>
>>>>> I've loaded your package.
>>>>>
>>>>> A prerequisite is to load OS-Window to make it work.
>>>>>
>>>>>
>>>>> why?
>>>>> in any case, oswindow is already included in pharo4
>>>>>
>>>>
>>>> OS-Windows (by TorstenBergmann)
>>>>
>>>> not
>>>> OSWindow :)
>>>>
>>>>
>>>> ahhh. Name clash :)
>>>>
>>>>
>>>> It is needed for the shared pool WinTypes,
>>>> but without OS-Window, he can use NBWinTypes instead.
>>>>
>>>>
>>>>
>>>>>
>>>>> Esteban
>>>>>
>>>>>
>>>>> I've got the DLL call working nicely and the nativeboost with the
>>>>> structure freezing.
>>>>>
>>>>> Now, we should all have a look at:
>>>>>
>>>>> https://github.com/ronsaldo/bullet-pharo
>>>>>
>>>>> and
>>>>>
>>>>> https://github.com/ronsaldo/swig
>>>>>
>>>>> because it looks like the way to go to wrap libraries...
>>>>>
>>>>> Ronie, I know you modified swig for generating Pharo code;
>>>>>
>>>>> Is cloning your swig repo the way to go ?
>>>>>
>>>>>
>>>>> Phil
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On Wed, May 6, 2015 at 10:39 AM, Usman Bhatti <usman.bhatti(a)gmail.com>
>>>>> wrote:
>>>>>
>>>>>> Hi Nicolai,
>>>>>>
>>>>>> Here is my package that defines the nativeboost call and associated C
>>>>>> structs.
>>>>>> The external C struct is self referencing and hence sometimes I get
>>>>>> infinite recursion when trying to change field descriptions. That is the
>>>>>> reason why the automatically generated accessors are absent (although I had
>>>>>> them in an earlier version).
>>>>>>
>>>>>> Attached also the DLL referenced in the code.
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Wed, May 6, 2015 at 9:58 AM, Nicolai Hess <nicolaihess(a)web.de>
>>>>>> wrote:
>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> 2015-05-06 9:53 GMT+02:00 Usman Bhatti <usman.bhatti(a)gmail.com>:
>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> On Tue, May 5, 2015 at 7:34 PM, phil(a)highoctane.be <
>>>>>>>> phil(a)highoctane.be> wrote:
>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Tue, May 5, 2015 at 6:28 PM, Usman Bhatti <
>>>>>>>>> usman.bhatti(a)gmail.com> wrote:
>>>>>>>>>
>>>>>>>>>> I succeeded to do it by encapsulating the C routine as a DLL and
>>>>>>>>>> doing an FFI call from my image (as suggested by Guille).
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>> At least there was a way!
>>>>>>>>>
>>>>>>>>
>>>>>>>> Exactly :)
>>>>>>>>
>>>>>>>>
>>>>>>>>>
>>>>>>>>> Looks like this is the most controlled|debuggable way:
>>>>>>>>> - get it working with C code out of Pharo
>>>>>>>>> - make a bridge that can be used easily with FFI in a dll
>>>>>>>>> - use that from Pharo with proven FFI
>>>>>>>>>
>>>>>>>>> Would NativeBoost work with your dll? Should.
>>>>>>>>>
>>>>>>>>
>>>>>>>> I have read a few resources about Nativeboost but I am still naive
>>>>>>>> to know the difference between FFI and nativeboost. The FFI call I made to
>>>>>>>> invoke the DLL function looked similar to the nativeboost calls.
>>>>>>>>
>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> I also tried to perform the nativeboost call by creating my
>>>>>>>>>> structures in Pharo. The function in Windows that can be used to retrieve
>>>>>>>>>> mac address in Windows: GetAdaptersInfo
>>>>>>>>>> <https://msdn.microsoft.com/en-us/library/windows/desktop/aa365917%28v=vs.85…> that
>>>>>>>>>> accepts a PIP_ADAPTER_INFO
>>>>>>>>>> <https://msdn.microsoft.com/en-us/library/windows/desktop/aa366062(v=vs.85).…> structure.
>>>>>>>>>> I subclassed NBExternalStructure to define this struct and the other used
>>>>>>>>>> by it in the image but my NB call returned with 87 code (Invalid parameter)
>>>>>>>>>> and it was impossible to debug. However, I would like to make this thing
>>>>>>>>>> work to understand what went wrong.
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Has this something to do with 32|64 bit library complications?
>>>>>>>>>
>>>>>>>>
>>>>>>>> Not exactly. For me, it was more related to the fact that I had to
>>>>>>>> map a complex C struct in Pharo. Here is an excerpt of the definition from
>>>>>>>> MSDN:
>>>>>>>>
>>>>>>>> typedef struct _IP_ADAPTER_INFO {
>>>>>>>> struct _IP_ADAPTER_INFO *Next;
>>>>>>>> ...
>>>>>>>> PIP_ADDR_STRING CurrentIpAddress;
>>>>>>>> IP_ADDR_STRING GatewayList;
>>>>>>>> ...
>>>>>>>> }
>>>>>>>>
>>>>>>>> So, I had to define three external structures (all names in
>>>>>>>> capitals) and I did the effort but in the end I got an error code that I
>>>>>>>> could not debug in the image. Hence, I gave up and opted to go in the
>>>>>>>> native environment. But I would like someone knowledgable to have a look at
>>>>>>>> my nativeboost code because the nativeboost approach is more simple
>>>>>>>> (everything's in the image).
>>>>>>>>
>>>>>>>
>>>>>>> I can have a look.
>>>>>>>
>>>>>>> btw. for what do you need the mac address?
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> usman
>>>>>>>>
>>>>>>>>
>>>>>>>>>
>>>>>>>>> Phil
>>>>>>>>>
>>>>>>>>> With ProcessWrapper, I could not load the classes essential for
>>>>>>>>> making the plugin work.
>>>>>>>>>
>>>>>>>>> HTH,
>>>>>>>>>
>>>>>>>>> Usman
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Mon, May 4, 2015 at 2:54 PM, Ben Coman <btc(a)openinworld.com>
>>>>>>>>> wrote:
>>>>>>>>> As a complete newb to VM building I found this fairly straight
>>>>>>>>> forward (on a Mac btw).
>>>>>>>>> https://github.com/pharo-project/pharo-vm
>>>>>>>>> cheers -ben
>>>>>>>>>
>>>>>>>>> On Mon, May 4, 2015 at 5:28 PM, Usman Bhatti <
>>>>>>>>> usman.bhatti(a)gmail.com> wrote:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Sun, May 3, 2015 at 4:22 PM, Pierce Ng <pierce(a)samadhiweb.com>
>>>>>>>>> wrote:
>>>>>>>>> On Sat, May 02, 2015 at 03:55:47PM +0200, Usman Bhatti wrote:
>>>>>>>>> > 1/ OSProcess: I tried (PipeableOSProcess command: 'ipconfig
>>>>>>>>> /all') output.
>>>>>>>>>
>>>>>>>>> I have used http://www.smalltalkhub.com/#!/~hernan/ProcessWrapper
>>>>>>>>> successfully
>>>>>>>>> back when I was on Windows using some now-ancient version of Pharo.
>>>>>>>>>
>>>>>>>>> I had initially discarded the idea of using this project because
>>>>>>>>> it required a plugin and the information of the plugin was outdated on
>>>>>>>>> squeaksource. However, having evaluated superficially the complexity of
>>>>>>>>> doing it with nativeboost (because too many external c struct involved in
>>>>>>>>> the call), I would like to see if I am better off using this wrapper.
>>>>>>>>>
>>>>>>>>> I loaded it with:
>>>>>>>>>
>>>>>>>>> Gofer it
>>>>>>>>> url: 'http://www.smalltalkhub.com/mc/hernan/ProcessWrapper/main
>>>>>>>>> ';
>>>>>>>>> package: 'ProcessWrapper-Core';
>>>>>>>>> package: 'ProcessWrapper-Plugin';
>>>>>>>>> package: 'ProcessWrapper-Tests';
>>>>>>>>> load.
>>>>>>>>>
>>>>>>>>> But the plugins wont load because it requires the
>>>>>>>>> class SmartSyntaxInterpreterPlugin and apparently this file is a part of
>>>>>>>>> the VMMaker. Is there any recent config for VMMaker in Pharo because this
>>>>>>>>> one looks outdated:
>>>>>>>>>
>>>>>>>>> http://pharo.gemtalksystems.com/book/Virtual-Machine/Building/VMMakerTool/
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Pierce
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>
>
>
> --
> ---
> Philippe Back
> Visible Performance Improvements
> Mob: +32(0) 478 650 140 | Fax: +32 (0) 70 408 027
> Mail:phil@highoctane.be | Web: http://philippeback.eu
> Blog: http://philippeback.be | Twitter: @philippeback
> Youtube: http://www.youtube.com/user/philippeback/videos
>
> High Octane SPRL
> rue cour Boisacq 101 | 1301 Bierges | Belgium
>
> Pharo Consortium Member - http://consortium.pharo.org/
> Featured on the Software Process and Measurement Cast -
> http://spamcast.libsyn.com
> Sparx Systems Enterprise Architect and Ability Engineering EADocX Value
> Added Reseller
>
>
>
May 12, 2015
Garage and SQLite file databases, general project structure
by Torsten Bergmann
Hi Guille,
I had a short look at Garage [1]. Nice initiative!
Looks like using a file is not supported for the SQLite3 backend in Garage:
GADriver fromConnectionString: 'sqlite3://file://C:/temp/test.db'
GADriver fromConnectionString: 'sqlite3://C:/temp/test.db'
Maybe GASqlite3Driver>>fromConnectionString: could be adopted, but the
conversion to a Zn URL already removes some stuff. (Ab)using the schema in the URL
as a driverID is nice - but prevents the use of file:// schema.
How can one construct a file db?
Also I do not understand: while "Garage-Postgres" uses the Postgres
project PostgresV2 as a backend the "Garage-Sqlite3" does not use
NBSqlite3 or SQlite3 projects as backend.
So "GASqlite3FFI" copies many methods of the original NBSQLite3 project from Pierce and myself
and is therefore like an own fork now.
Also the name FFI is misleading as it uses NativeBoost instead of FFI ...
Also it would be good if the project would be layered, we could have a
"Garage-Core" and "Garage-Tests-Core" with "Garage-Mysql" and "Garage-Tests-Mysql" for
the fixtures. The idea is always to be able to load runtime code without tests
for production code.
Thanks
Torsten
[1] http://lists.pharo.org/pipermail/pharo-users_lists.pharo.org/2015-May/01919…
May 12, 2015
Re: [Pharo-users] beginner question - how to get a fully qualified filename from a dialog
by Cyril Ferlicot
Hi,
maybe instead of UIManager you could look on UITheme.
For example the following code:
Smalltalk ui theme
chooseFullFileNameIn: World
title: 'Select file to open'
extensions: nil
path:
(myActualFilePath isNil
ifTrue: [ myActualFilePath ]
ifFalse: [ FileSystem workingDirectory ])
preview: nil
This will open a dialog with "Select file to open" in title, it will
accept file of every extension and the path will begin at
myActualFilePath or into the working directory if the actual file path
is nil.
On 12 May 2015 at 18:00, amaloney <amaloney(a)earthlink.net> wrote:
> I have a method:
> openSimulationFile
> inFile := (StandardFileStream fileNamed:
> '/Users/amaloney/Squeak/30shoes.txt') ascii
> I want to replace the hard coded fully qualified filename with the result of
> a file browser dialog.
>
> I've done some Googling and poked around in the system browser and I find
> that if I enter (in a playground)
> UIManager default chooseDirectory and inspect-it I get: a FileReference
> (/Users/amaloney/Squeak)
> and if I try UIManager default chooseFileMatching: #( '*.txt' ) I get: a
> ByteString ('Readme.txt').
>
> It seems that UIManager chooseDirectory is the method I should start
> exploring (since it returns a FileReference object) but the method is:
> chooseDirectory
> "Let the user choose a directory"
> ^self chooseDirectoryFrom: FileSystem workingDirectory
>
> and when I look at chooseDirectoryFrom: I get
> chooseDirectoryFrom: dir
> "Let the user choose a directory"
> ^self chooseDirectory: nil from: dir
> so I look at chooseDirectory: from:
> and I get:
> chooseDirectory: label from: dir
> "Let the user choose a directory"
> ^self subclassResponsibility
> Which doesn't help so I dig around in the docs some more and find out that
> the green down arrow is clickable.
> When I click it and choose MorphicUlManager>>#chooseDirectory:from:
> the method definition is:
> chooseDirectory: label from: dir
> "Answer the user choice of a directory."
>
> | modalMorph realLabel |
> realLabel := label ifNil: ['Choose Directory' translated].
> (ProvideAnswerNotification signal: realLabel) ifNotNil: [:answer |
> ^answer ].
> modalMorph := self modalMorph.
> ^modalMorph theme
> chooseDirectoryIn: modalMorph
> title: realLabel
> path: (dir ifNotNil: [dir fullName])
>
> The problem is that I cannot find a chooseDirectoryIn:title:path: method.
>
> I wrote this all out hoping someone can tell me where I chose the wrong
> rabbit hole and can point me to instructions on how to choose the correct
> rabbit hole. ;-) (Also, if there is a short answer i.e. use this
> object>>method, I'd appreciate that as well.)
>
> Thanks,
>
> Mike
>
>
>
>
>
>
>
>
>
> --
> View this message in context: http://forum.world.st/beginner-question-how-to-get-a-fully-qualified-filena…
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>
--
Cheers
Cyril Ferlicot
May 12, 2015
Re: [Pharo-users] Using VirtualGPU
by Alain Busser
Hi Serge,
I made some experiments with GPU computing with JavaScript. I understood
that the computings are made forever inside the GPU, so you just throw data
and programs once and you let the GPU compute for you. Yet the problem is
to read the data once they are computed. With webGL it seems impossible,
with webCL it is possible and not easy. Hence the choice of openCL I guess.
I relate here how I could compute the powers of a Markov matrix here:
http://revue.sesamath.net/spip.php?article651 (especially click on "webGL
sans three.js"). I also made some experiments here:
http://irem.univ-reunion.fr/spip.php?article797 (but they use three.js if I
remember well)
Happy readings, and, yes, I feel interersted in these subjects
Alain
On Tue, May 12, 2015 at 7:48 PM, Serge Stinckwich <
serge.stinckwich(a)gmail.com> wrote:
> Dear all,
>
> just to let you know, Cheikhou (in CC) is starting a student
> internship in my lab.
> He will work on Epidemiology Modelling with KENDRICK:
> http://ummisco.github.io/kendrick/
> the platform that we are developing in order to analyse and visualise
> diseases models behaviours.
>
> We would like first to implement a GPU version of the Gillespie
> Stochastic Simulation Algorithm (GSSA):
> http://en.wikipedia.org/wiki/Gillespie_algorithm and after that also
> implement SPH simulations:
> https://en.wikipedia.org/wiki/Smoothed-particle_hydrodynamics
>
> We are looking at the code of OpenCL and VirtualGPU done by Ronnie.
> What we have understand until now :
> - OpenCL package : low-level stuff to be able to interface OpenCL
> kernels with Pharo
> - VirtualGPU: high-level API on top of OpenCL in order to ease the
> task of people who wants to use OpenCL. VirtualGPU provide high-level
> operations on matrix and image at the moment.
>
> @Ronie: What is not clear at the moment in our mind : when you build a
> VirtualGPU program with the DSL, do you have the overhead of
> communications every time you execute a VirtualGPU instruction or all
> the the instructions are sent at the same time and run on the GPU ?
>
> In our context, for building a GSSA algorithm, I guess we just have to
> combine same VGPU instructions (matrix computations) but for doing SPH
> simulations, we will have to provide our own instructions. Is there
> any documentation in order to add own kernel and instructions ?
>
> I know that others guys at INRIA (Stéphane ?) are interested by GPU.
> Is it possible to join our effort to share what we are doing ?
>
> Regards,
> --
> Serge Stinckwich
> UCBN & UMI UMMISCO 209 (IRD/UPMC)
> Every DSL ends up being Smalltalk
> http://www.doesnotunderstand.org/
>
>
May 12, 2015
Moving the HandMorph
by Torsten Bergmann
In Pharo 4.0 load EventRecorder. It is a complete reimplementation
of an old goodie together with tests.
Then check Tools -> EventRecorder in the world menu
Bye
T.
May 12, 2015