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
Customize serialization with Fuel
by Alejandro Infante
Hello all,
Currently Iâm in the need of serializing some Spy instances and my problem is that some of the objects hold references to Classes and CompiledMethods. This gives me headaches because I would like to materialize Spy in another image which possibly does not define those classes and methods.
Is there a smart way to specify which instances variables serialize and which of them not?
Even better would be to specify that instead of serializing an instance variable #a that I know that holds a CompiledMethod, serialize the ring representation of the CompiledMethod.
Thanks,
Alejandro
May 7, 2015
Re: [Pharo-users] [Ann] The Garage database driver API
by Ben Coman
On Thu, May 7, 2015 at 5:36 PM, Guillermo Polito <guillermopolito(a)gmail.com>
wrote:
> Hi all,
>
> I'm pleased to announce the release 0.1 of Garage, a database driver API.
> Garage is meant to be a common interface to access several database
> servers, in a JDBC style.
>
> The current version works in Pharo3 and Pharo4 and includes drivers for:
> - mysql (pure smalltalk)
> - postgres (pure smalltalk)
> - sqlite (using ffi)
> - opendbx (allowing connecting with several db vendors, using ffi)
>
> We have a nice test suite (that maybe you can help to enlarge) that is
> tested every day in Jenkins [1].
>
> Also, in garage's website [2] you'll find
> - installation instructions
> - basic usage
> - documentation of features such as statements, transactions, cursored
> fetches.
> - issue tracker, backlog and other information
>
> Feedback (and contributions) are very welcome!
> Enjoy,
> Guille
>
> [1] https://ci.inria.fr/dbxtalk/view/Garage/
> [2] http://guillep.github.io/DBXTalk/garage/
>
This looks very cool. I like the url style connection string and provision
of the usual iterator methods do:, collect: and select:.
Suggested correction...
* stablishing --> establishing
cheers -ben
May 7, 2015
Roassal Camp Smalltalk, July 12
by Alexandre Bergel
Dear Colleagues and Friends,
We are happy to announce we will organize a CampSmalltalk about the Roassal visualization engine, on _Sunday 12 July_.
As far as we have seen, the interests are multiple. Here is a list of topics we will happy to work on:
- Improving Grapher, our charting library
- Fixing bugs, addressing recently uncovered issues (e.g., composite shapes)
- HTML/JavaScript export
Some participants have indicated a great interest in:
- Port of Roassal on VisualWorks
- Using Roassal on Gemstone
If you wish to participate, get in touch with us. Since we will probably have a sponsoring of the event, it would be nice to know how many will attend to ease the logistic and the pizza ordering :-)
Cheers,
Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
May 7, 2015
Re: [Pharo-users] [Ann] The Garage database driver API
by Guillermo Polito
There is not a real reason for the name. But if you push me:
- you stock things in your garage usually.
- The drivers go to the garage :)
El jue., 7 de may. de 2015 a la(s) 12:17 p. m., Esteban A. Maringolo <
emaringolo(a)gmail.com> escribió:
> Nice!
>
> Prepared statements, cursored fetchs, url connection strings... I like it.
>
> Why "Garage"?
>
> Regards!
> El may 7, 2015 6:37 AM, "Guillermo Polito" <guillermopolito(a)gmail.com>
> escribió:
>
>> Hi all,
>>
>> I'm pleased to announce the release 0.1 of Garage, a database driver API.
>> Garage is meant to be a common interface to access several database
>> servers, in a JDBC style.
>>
>> The current version works in Pharo3 and Pharo4 and includes drivers for:
>> - mysql (pure smalltalk)
>> - postgres (pure smalltalk)
>> - sqlite (using ffi)
>> - opendbx (allowing connecting with several db vendors, using ffi)
>>
>> We have a nice test suite (that maybe you can help to enlarge) that is
>> tested every day in Jenkins [1].
>>
>> Also, in garage's website [2] you'll find
>> - installation instructions
>> - basic usage
>> - documentation of features such as statements, transactions, cursored
>> fetches.
>> - issue tracker, backlog and other information
>>
>> Feedback (and contributions) are very welcome!
>> Enjoy,
>> Guille
>>
>> [1] https://ci.inria.fr/dbxtalk/view/Garage/
>> [2] http://guillep.github.io/DBXTalk/garage/
>>
>
May 7, 2015
Re: [Pharo-users] [Ann] The Garage database driver API
by Esteban A. Maringolo
Nice!
Prepared statements, cursored fetchs, url connection strings... I like it.
Why "Garage"?
Regards!
El may 7, 2015 6:37 AM, "Guillermo Polito" <guillermopolito(a)gmail.com>
escribió:
> Hi all,
>
> I'm pleased to announce the release 0.1 of Garage, a database driver API.
> Garage is meant to be a common interface to access several database
> servers, in a JDBC style.
>
> The current version works in Pharo3 and Pharo4 and includes drivers for:
> - mysql (pure smalltalk)
> - postgres (pure smalltalk)
> - sqlite (using ffi)
> - opendbx (allowing connecting with several db vendors, using ffi)
>
> We have a nice test suite (that maybe you can help to enlarge) that is
> tested every day in Jenkins [1].
>
> Also, in garage's website [2] you'll find
> - installation instructions
> - basic usage
> - documentation of features such as statements, transactions, cursored
> fetches.
> - issue tracker, backlog and other information
>
> Feedback (and contributions) are very welcome!
> Enjoy,
> Guille
>
> [1] https://ci.inria.fr/dbxtalk/view/Garage/
> [2] http://guillep.github.io/DBXTalk/garage/
>
May 7, 2015
Re: [Pharo-users] [Ann] The Garage database driver API
by Santiago Bragagnolo
Cool! :D
On Thu, 7 May 2015 at 11:37 Guillermo Polito <guillermopolito(a)gmail.com>
wrote:
> Hi all,
>
> I'm pleased to announce the release 0.1 of Garage, a database driver API.
> Garage is meant to be a common interface to access several database
> servers, in a JDBC style.
>
> The current version works in Pharo3 and Pharo4 and includes drivers for:
> - mysql (pure smalltalk)
> - postgres (pure smalltalk)
> - sqlite (using ffi)
> - opendbx (allowing connecting with several db vendors, using ffi)
>
> We have a nice test suite (that maybe you can help to enlarge) that is
> tested every day in Jenkins [1].
>
> Also, in garage's website [2] you'll find
> - installation instructions
> - basic usage
> - documentation of features such as statements, transactions, cursored
> fetches.
> - issue tracker, backlog and other information
>
> Feedback (and contributions) are very welcome!
> Enjoy,
> Guille
>
> [1] https://ci.inria.fr/dbxtalk/view/Garage/
> [2] http://guillep.github.io/DBXTalk/garage/
>
May 7, 2015
[Ann] The Garage database driver API
by Guillermo Polito
Hi all,
I'm pleased to announce the release 0.1 of Garage, a database driver API.
Garage is meant to be a common interface to access several database
servers, in a JDBC style.
The current version works in Pharo3 and Pharo4 and includes drivers for:
- mysql (pure smalltalk)
- postgres (pure smalltalk)
- sqlite (using ffi)
- opendbx (allowing connecting with several db vendors, using ffi)
We have a nice test suite (that maybe you can help to enlarge) that is
tested every day in Jenkins [1].
Also, in garage's website [2] you'll find
- installation instructions
- basic usage
- documentation of features such as statements, transactions, cursored
fetches.
- issue tracker, backlog and other information
Feedback (and contributions) are very welcome!
Enjoy,
Guille
[1] https://ci.inria.fr/dbxtalk/view/Garage/
[2] http://guillep.github.io/DBXTalk/garage/
May 7, 2015
Re: [Pharo-users] mac address on windows
by phil@highoctane.be
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
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.
Call worked then but output gives this:
GetMacWin32 getMacAddress 'BYTE_8 (
data: $¼ <-- some weird string here
)'
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 7, 2015
Re: [Pharo-users] mac address on windows
by Nicolai Hess
Ups, one method was in the *generated-code-protocol and will be removed on
package load.
You need to add the method
BYTE_8>>asString
^ self address hex
2015-05-07 1:06 GMT+02:00 Nicolai Hess <nicolaihess(a)web.de>:
>
>
> 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
>
>
>>
>> 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
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>
>
May 7, 2015
Re: [Pharo-users] Problems in switching from Moose 5.0 (Pharo 3) to Moose 5.1 (Pharo 4)
by PBKResearch
Vincent
Sorry for the delay in replying. The point about (TLTextTokenizer parse:
'test' startingAt: #word) is weird. You are quite right, it does give a
PPToken in Pharo #40613. In #40612 it gave an array of PPToken  I checked
this before sending the original message and again after receiving your
first reply, and I have now rescued my #40612 image from the recycle bin and
tested it again. We are using the same version, by the way  except that I
have now modified mine to remove the deprecated method ÂvalueÂ.
The behaviour of TLTextTokenizer in the latest image is very odd. It seems
to parse only the first word of any text even when I donÂt specify
startingAt: #word. For instance, if I enter (TLTextTokenizer parse: 'test
run' ), the result is aPPToken on ÂtestÂ. However, it is not clear that we
are meant to use TLTextTokenizer at all; the organisation of the TextLint
parsers suggests this is an abstract superclass, and the checkers seem to
use TLPatternTokenizer or TLPlainTokenizer and its subclasses exclusively.
I have used TLPlainTokenizer with only one oddity, namely that it would not
display the result of (TLPlainTokenizer parse: Âtest runÂ) in the
PetitParser browser until I changed (TLTerminatorMark with: ÂÂ) to
(TLTerminatorMark with: (PPToken on: ÂÂ)) in the elementList method.
I have spent probably far too long today exploring TextLint, particularly
trying to find why so many of the tests fail. It looks as though, since
many of them were written, PetitParser has been changed in many details.
Anyway, I can now use TLTextLintChecker to give me a parse of any plain text
as a structured document, which was my original objective, so I can get back
to my project - using Pharo 4.
Thanks for your help.
Peter Kenny
From: Pharo-users [mailto:pharo-users-bounces@lists.pharo.org] On Behalf Of
Blondeau Vincent
Sent: 06 May 2015 12:57
To: Any question about pharo is welcome
Subject: Re: [Pharo-users] Problems in switching from Moose 5.0 (Pharo 3) to
Moose 5.1 (Pharo 4)
De : Pharo-users [ <mailto:pharo-users-bounces@lists.pharo.org>
mailto:pharo-users-bounces@lists.pharo.org] De la part de PBKResearch
Envoyé : mercredi 6 mai 2015 12:12
à : 'Any question about pharo is welcome'
Objet : Re: [Pharo-users] Problems in switching from Moose 5.0 (Pharo 3) to
Moose 5.1 (Pharo 4)
Vincent
Peter,
Many thanks. You have solved the problem and educated me in the process Â
since I now know how to do a user interrupt  I was pressing Ctrl-Break with
no effect. The problem was the looping of the deprecation notifier, which I
can fix by removing the deprecated Âvalue message. The looping should not
have occurred, and there must be a bug somewhere, but itÂs not my problem.
Actually, the notify message open a debugger and Âvalue message is send by
the debugger, but value send a notify message that opens a new debuggerÂ
etcÂ
I donÂt think that is a bug. It is not the notify: method that should
be used but the deprecated: one.
One little detail, about your comment on point 6 below. On my system,
(TLTextTokenizer parse: 'test' startingAt: #word) generates an array of
PPToken, so it does not understand parsedValue. Are we looking at different
versions of TextLint?
TLTextTokenizer parse: 'test' startingAt: #word return a PPToken, not an
array on PPToken in the version I have.
I have this version of TextLint :
Name: TextLint-Model-JorgeRessia.225
Author: JorgeRessia
Time: 10 February 2012, 2:41:11 pm
UUID: 3c6965a4-bc1f-42e4-b309-fab8e4303046
Ancestors: TextLint-Model-lr.224
Name: TextLint-Tests-lr.166
Author: lr
Time: 25 March 2012, 10:46:49 am
UUID: ed387b31-02e6-4194-91e6-18d3879dc858
Ancestors: TextLint-Tests-DamienCassou.165
And petit parser:
Name: PetitParser-JanKurs.278
Author: JanKurs
Time: 5 May 2015, 2:39:26.475846 pm
UUID: 55ae813a-5dfd-4b4d-a98b-274f5431331e
Ancestors: PetitParser-JanKurs.277, PetitParser-JanKurs.276
Vincent Blondeau
Thanks again
Peter Kenny
From: Pharo-users [mailto:pharo-users-bounces@lists.pharo.org] On Behalf Of
Blondeau Vincent
Sent: 06 May 2015 10:00
To: Any question about pharo is welcome
Subject: Re: [Pharo-users] Problems in switching from Moose 5.0 (Pharo 3) to
Moose 5.1 (Pharo 4)
De : Pharo-users [ <mailto:pharo-users-bounces@lists.pharo.org>
mailto:pharo-users-bounces@lists.pharo.org] De la part de PBKResearch
Envoyé : mardi 5 mai 2015 18:01
à : <mailto:pharo-users@lists.pharo.org> pharo-users(a)lists.pharo.org
Objet : [Pharo-users] Problems in switching from Moose 5.0 (Pharo 3) to
Moose 5.1 (Pharo 4)
Hello,
I have been working with Moose 5.0 on a project involving natural language
processing. I used TextLint to parse the input, just because it contained a
set of parsers which gave output in a convenient form. I have read all about
the virtues of Pharo 4, and decided to give it a try, so I set out to
reproduce the earlier results. I have run into a number of problems Â
basically I havenÂt been able to get anywhere. I realise TextLint is rather
antique, but basically as I use it it is just a set of PetitParser parsers,
so I canÂt see a problem.
I have boiled the problems down to a few test cases, not realistic bits of
my work but just to show the essential points.
1. Environment: Windows 7 Professional (64 bit version).
2. Download and install latest Pharo 4 - Latest update: #40612. This is
just to get an up to date VM.
3. Download latest Moose 5.1 image and unzip into same folder as Pharo
4. On opening the Moose 5.1 image it also shows Latest update: #40612. (I
have to ignore FirefoxÂs hysterical warnings that the INRIA site does not
have a valid security certificate.)
4. Load TextLint into the image. CanÂt get ÂConfigurationofTextLint to
work, so load TextLInt-Model-JorgeRessia.225.mcz and
TextLint-Tests-lr.166.mcz via the Monticello Browser. This is the same as I
used in my earlier Moose 5.0 image, where it worked as expected.
The ConfigurationofTextLint doesnÂt not load because it canÂt found the
project NEC which is not at 'http://ss3.gemstone.com/ss/NEC', it has to be
changed in ConfigurationOfGlamour>>default:.
Your configuration should not load Glamour because it is already included in
the Moose image.
5. Open a playground, enter:
PPToken on: ÂtestÂ.
and select ÂInspect itÂ. The inspector halts with message: ÂMNU
ByteString>>find AnySubstring:startingAt:Â Basic Inspect works as expected.
Does this look like the problem raised by Nicolas Lusa today?
Seems resolved on latest Moose5.1 (#874) on Pharo #40613.
6. Enter in the playground:
word := (TLTextTokenizer parse: Âtest startingAt: #word) at: 1.
(The tokenizer gives an array of tokens, so we need to select the first Â
and only  one.) Basic Inspect confirms that Âword is a PPToken, as
expected.
The code doesnÂt work, did you mean : (TLTextTokenizer parse: 'test'
startingAt: #word) parsedValue at: 1 ?
7. Enter in the playground:
TLWord with: word.
Select ÂDo itÂ. The image becomes completely unresponsive, and appears to be
in a tight loop. Only way out is to click the Windows red X and say yes to
exit without saving. Restarting, get to the same point and select ÂDebug
itÂ. Trace it to TLSyntacticElement>>initializeWith: aToken, where the only
line of code is: Âtoken := aTokenÂ. Again a complete lockup.
Do ALT+. as soon you execute the method, you should be able to find the
error. By the way it seems that in TLSyntacticElement>>text, value has to be
replaced by inputValue (value is deprecated, and the notify event seems to
loopÂ
). It seems to work after that.
Sorry for the lengthy details; I just hope there is enough there to enable
someone to diagnose the problem(s). Any help gratefully received. Meanwhile
I am back to the Pharo 3 version.
Clear details, though. I think you can go back to Pharo 4.
Thanks
YouÂre welcome,
Vincent Blondeau
Peter Kenny
_____
Ce message et les pièces jointes sont confidentiels et réservés à l'usage
exclusif de ses destinataires. Il peut également être protégé par le secret
professionnel. Si vous recevez ce message par erreur, merci d'en avertir
immédiatement l'expéditeur et de le détruire. L'intégrité du message ne
pouvant être assurée sur Internet, la responsabilité de Worldline ne pourra
être recherchée quant au contenu de ce message. Bien que les meilleurs
efforts soient faits pour maintenir cette transmission exempte de tout
virus, l'expéditeur ne donne aucune garantie à cet égard et sa
responsabilité ne saurait être recherchée pour tout dommage résultant d'un
virus transmis.
This e-mail and the documents attached are confidential and intended solely
for the addressee; it may also be privileged. If you receive this e-mail in
error, please notify the sender immediately and destroy it. As its integrity
cannot be secured on the Internet, the Worldline liability cannot be
triggered for the message content. Although the sender endeavours to
maintain a computer virus-free network, the sender does not warrant that
this transmission is virus-free and will not be liable for any damages
resulting from any virus transmitted.
_____
Ce message et les pièces jointes sont confidentiels et réservés à l'usage
exclusif de ses destinataires. Il peut également être protégé par le secret
professionnel. Si vous recevez ce message par erreur, merci d'en avertir
immédiatement l'expéditeur et de le détruire. L'intégrité du message ne
pouvant être assurée sur Internet, la responsabilité de Worldline ne pourra
être recherchée quant au contenu de ce message. Bien que les meilleurs
efforts soient faits pour maintenir cette transmission exempte de tout
virus, l'expéditeur ne donne aucune garantie à cet égard et sa
responsabilité ne saurait être recherchée pour tout dommage résultant d'un
virus transmis.
This e-mail and the documents attached are confidential and intended solely
for the addressee; it may also be privileged. If you receive this e-mail in
error, please notify the sender immediately and destroy it. As its integrity
cannot be secured on the Internet, the Worldline liability cannot be
triggered for the message content. Although the sender endeavours to
maintain a computer virus-free network, the sender does not warrant that
this transmission is virus-free and will not be liable for any damages
resulting from any virus transmitted.
May 6, 2015