Re: [Pharo-dev] NativeBoost and WKHTML
I think this is because it is a C++ lib. NativeBoost cannot be used with C++ lib. It is a problem of call convention that is not the same from C to C++. As I discuss with some people it seems be a complexe problem, each C++ compiler seems have it own convention. But Igor can maybe be more accurate about that. A C wrapper to call C++, which should work. On 23 May 2014, at 02:36, Torsten Bergmann asta...@gmx.de wrote: Hi, as there was no responded so far I tried to track the problem deeper and did a short test client in C/C++ to verify if I can call WKHTMLTOPDF there and generate a PDF and to compare to the Pharo/NativeBoost client. Attached is the according CPP file which works and results in a PDF with the google homepage. I also additionally implemented the callback functions in the Pharo wrapper and using the error handling I noticed that the component returns Failed loading page http:// ... With that info I compared the C/C++ calls to the Pharo/NativeBoost calls more deeply and found out that in C/C++ the following call for an object setting works (by returning 1): // this returns 1 in C/C++ which is OK int a = wkhtmltopdf_set_object_setting(os, page, http://www.google.de;); printf(object set %i,a); while in Pharo the same call fails (by returning 0): The following call failed and returns 0 instead of 1 self setObjectSetting: 'page' to: 'http://www.google.de' in: os. I checked how I wrapped this API call again and again - it is fine from my side: setObjectSetting: aName to: value in: settings primitive: #primitiveNativeCall module: #NativeBoostPlugin ^NBFFICallout stdcall: #(int wkhtmltopdf_set_object_setting(wkhtmltopdf_object_settings* settings, char* aName, char* value)) module: 'wkhtmltox.dll' and I still have no idea why it fails. Especially because wkhtmltopdf_set_object_setting function is not different from wkhtmltopdf_set_global_setting which is exactly the same way wrapped, works and returns 1 in exactly the same example. I would really appreciate if someone could have a second look... To reproduce on Windows: 1. Download the 32 bit version of WKHTML from http://wkhtmltopdf.org and install it 2. Copy the wkhtmltox.dll to either the folder of the VM executable or the Windows directory so it can be found 3. Load the package WKHTML2PDF-Core-TorstenBergmann.7 from http://smalltalkhub.com/#!/~TorstenBergmann/WKHTML2PDF into Pharo 3.0#30848 4. Check the Transcript while evaluating: WKPDFLibrary example One can see that within this code #setObjectSetting:to:in: fails while #setGlobalSetting:to:in: works. Maybe I just do not see the obvious. Help is appreciated. Thanks in advance! bye T. main.cpp Best Regards Jean Baptiste Arnaud jbaptiste.arn...@gmail.com
Re: [Pharo-dev] NativeBoost and WKHTML
On 23 May 2014, at 11:31, Jean Baptiste Arnaud jbaptiste.arn...@gmail.com wrote: I think this is because it is a C++ lib. NativeBoost cannot be used with C++ lib. It is a problem of call convention that is not the same from C to C++. As I discuss with some people it seems be a complexe problem, each C++ compiler seems have it own convention. But Igor can maybe be more accurate about that. A C wrapper to call C++, which should work. Ronie’s SWIG for NativeBoost has some C++ support: http://forum.world.st/SWIG-for-Native-Boost-FFI-td4738511.html On 23 May 2014, at 02:36, Torsten Bergmann asta...@gmx.de wrote: Hi, as there was no responded so far I tried to track the problem deeper and did a short test client in C/C++ to verify if I can call WKHTMLTOPDF there and generate a PDF and to compare to the Pharo/NativeBoost client. Attached is the according CPP file which works and results in a PDF with the google homepage. I also additionally implemented the callback functions in the Pharo wrapper and using the error handling I noticed that the component returns Failed loading page http:// ... With that info I compared the C/C++ calls to the Pharo/NativeBoost calls more deeply and found out that in C/C++ the following call for an object setting works (by returning 1): // this returns 1 in C/C++ which is OK int a = wkhtmltopdf_set_object_setting(os, page, http://www.google.de;); printf(object set %i,a); while in Pharo the same call fails (by returning 0): The following call failed and returns 0 instead of 1 self setObjectSetting: 'page' to: 'http://www.google.de' in: os. I checked how I wrapped this API call again and again - it is fine from my side: setObjectSetting: aName to: value in: settings primitive: #primitiveNativeCall module: #NativeBoostPlugin ^NBFFICallout stdcall: #(int wkhtmltopdf_set_object_setting(wkhtmltopdf_object_settings* settings, char* aName, char* value)) module: 'wkhtmltox.dll' and I still have no idea why it fails. Especially because wkhtmltopdf_set_object_setting function is not different from wkhtmltopdf_set_global_setting which is exactly the same way wrapped, works and returns 1 in exactly the same example. I would really appreciate if someone could have a second look... To reproduce on Windows: 1. Download the 32 bit version of WKHTML from http://wkhtmltopdf.org and install it 2. Copy the wkhtmltox.dll to either the folder of the VM executable or the Windows directory so it can be found 3. Load the package WKHTML2PDF-Core-TorstenBergmann.7 from http://smalltalkhub.com/#!/~TorstenBergmann/WKHTML2PDF into Pharo 3.0#30848 4. Check the Transcript while evaluating: WKPDFLibrary example One can see that within this code #setObjectSetting:to:in: fails while #setGlobalSetting:to:in: works. Maybe I just do not see the obvious. Help is appreciated. Thanks in advance! bye T. main.cpp Best Regards Jean Baptiste Arnaud jbaptiste.arn...@gmail.com
Re: [Pharo-dev] NativeBoost and WKHTML
Hi Jean, thanks for answering. I dont think that the convention is an issue here: internally it is written in C++, but it exposes the API as simple C functions. The calls with NB work (even the callbacks). What confuses me most is that the call to wkhtmltopdf_set_global_setting works while the wkhtmltopdf_set_object_setting does not. They have exactly the same signature and are called one after the other. First one returns proper int 1 (success) as in the non-Smalltalk example, the other one 0 which means it failed. There is no magic in the Pharo code, just simple calls. Also the non-Smalltalk example proves that the component is working. Maybe a side effect of NativeBoost itself? Looks like so far I'm lost without the help of Igor here... Thx T. Gesendet: Freitag, 23. Mai 2014 um 11:31 Uhr Von: Jean Baptiste Arnaud jbaptiste.arn...@gmail.com An: Pharo Development List pharo-dev@lists.pharo.org Betreff: Re: [Pharo-dev] NativeBoost and WKHTML I think this is because it is a C++ lib. NativeBoost cannot be used with C++ lib. It is a problem of call convention that is not the same from C to C++. As I discuss with some people it seems be a complexe problem, each C++ compiler seems have it own convention. But Igor can maybe be more accurate about that. A C wrapper to call C++, which should work. On 23 May 2014, at 02:36, Torsten Bergmann asta...@gmx.de wrote: Hi, as there was no responded so far I tried to track the problem deeper and did a short test client in C/C++ to verify if I can call WKHTMLTOPDF there and generate a PDF and to compare to the Pharo/NativeBoost client. Attached is the according CPP file which works and results in a PDF with the google homepage. I also additionally implemented the callback functions in the Pharo wrapper and using the error handling I noticed that the component returns Failed loading page http:// ... With that info I compared the C/C++ calls to the Pharo/NativeBoost calls more deeply and found out that in C/C++ the following call for an object setting works (by returning 1): // this returns 1 in C/C++ which is OK int a = wkhtmltopdf_set_object_setting(os, page, http://www.google.de[http://www.google.de];); printf(object set %i,a); while in Pharo the same call fails (by returning 0): The following call failed and returns 0 instead of 1 self setObjectSetting: 'page' to: 'http://www.google.de'[http://www.google.de'] in: os. I checked how I wrapped this API call again and again - it is fine from my side: setObjectSetting: aName to: value in: settings primitive: #primitiveNativeCall module: #NativeBoostPlugin ^NBFFICallout stdcall: #(int wkhtmltopdf_set_object_setting(wkhtmltopdf_object_settings* settings, char* aName, char* value)) module: 'wkhtmltox.dll' and I still have no idea why it fails. Especially because wkhtmltopdf_set_object_setting function is not different from wkhtmltopdf_set_global_setting which is exactly the same way wrapped, works and returns 1 in exactly the same example. I would really appreciate if someone could have a second look... To reproduce on Windows: 1. Download the 32 bit version of WKHTML from http://wkhtmltopdf.org[http://wkhtmltopdf.org] and install it 2. Copy the wkhtmltox.dll to either the folder of the VM executable or the Windows directory so it can be found 3. Load the package WKHTML2PDF-Core-TorstenBergmann.7 from http://smalltalkhub.com/#!/~TorstenBergmann/WKHTML2PDF[http://smalltalkhub.com/#!/~TorstenBergmann/WKHTML2PDF] into Pharo 3.0#30848 4. Check the Transcript while evaluating: WKPDFLibrary example One can see that within this code #setObjectSetting:to:in: fails while #setGlobalSetting:to:in: works. Maybe I just do not see the obvious. Help is appreciated. Thanks in advance! bye T. main.cpp Best Regards Jean Baptiste Arnaud jbaptiste.arn...@gmail.com[jbaptiste.arn...@gmail.com]
Re: [Pharo-dev] NativeBoost and WKHTML
Hi, If I were to debug this, I would: 1 ) make sure there's no C++ interfering, try to compile using C compiler (not C++, I guess you run Windows and MSVC, I think there's command line option to process file as C). If not possible, wrap all methods you want to call form St in extern C {} block. Does it work? If not, then C++ compiler is doing it's magic which NB doesn't. 2 ) If it does, run whole thing under debugger, set breakpoint to the faulty function and check that arguments are correct and what's return value. If args are incorrect, then the problem is in either yours or NB's code. If return value is correct, then the problem is also in either yours or NB's code. If the return value is incorrect, well then the problem could be either in the library or some sort of GC thing as GC moves stuff around, which most of C/C++ libraries don't like much. In that case, I learned, the only way us to read library's code and single-step through it to see that the code actually does with data you pass down. HTH, Jan On 23/05/14 10:51, Torsten Bergmann wrote: Hi Jean, thanks for answering. I dont think that the convention is an issue here: internally it is written in C++, but it exposes the API as simple C functions. The calls with NB work (even the callbacks). What confuses me most is that the call to wkhtmltopdf_set_global_setting works while the wkhtmltopdf_set_object_setting does not. They have exactly the same signature and are called one after the other. First one returns proper int 1 (success) as in the non-Smalltalk example, the other one 0 which means it failed. There is no magic in the Pharo code, just simple calls. Also the non-Smalltalk example proves that the component is working. Maybe a side effect of NativeBoost itself? Looks like so far I'm lost without the help of Igor here... Thx T. Gesendet: Freitag, 23. Mai 2014 um 11:31 Uhr Von: Jean Baptiste Arnaud jbaptiste.arn...@gmail.com An: Pharo Development List pharo-dev@lists.pharo.org Betreff: Re: [Pharo-dev] NativeBoost and WKHTML I think this is because it is a C++ lib. NativeBoost cannot be used with C++ lib. It is a problem of call convention that is not the same from C to C++. As I discuss with some people it seems be a complexe problem, each C++ compiler seems have it own convention. But Igor can maybe be more accurate about that. A C wrapper to call C++, which should work. On 23 May 2014, at 02:36, Torsten Bergmann asta...@gmx.de wrote: Hi, as there was no responded so far I tried to track the problem deeper and did a short test client in C/C++ to verify if I can call WKHTMLTOPDF there and generate a PDF and to compare to the Pharo/NativeBoost client. Attached is the according CPP file which works and results in a PDF with the google homepage. I also additionally implemented the callback functions in the Pharo wrapper and using the error handling I noticed that the component returns Failed loading page http:// ... With that info I compared the C/C++ calls to the Pharo/NativeBoost calls more deeply and found out that in C/C++ the following call for an object setting works (by returning 1): // this returns 1 in C/C++ which is OK int a = wkhtmltopdf_set_object_setting(os, page, http://www.google.de[http://www.google.de];); printf(object set %i,a); while in Pharo the same call fails (by returning 0): The following call failed and returns 0 instead of 1 self setObjectSetting: 'page' to: 'http://www.google.de'[http://www.google.de'] in: os. I checked how I wrapped this API call again and again - it is fine from my side: setObjectSetting: aName to: value in: settings primitive: #primitiveNativeCall module: #NativeBoostPlugin ^NBFFICallout stdcall: #(int wkhtmltopdf_set_object_setting(wkhtmltopdf_object_settings* settings, char* aName, char* value)) module: 'wkhtmltox.dll' and I still have no idea why it fails. Especially because wkhtmltopdf_set_object_setting function is not different from wkhtmltopdf_set_global_setting which is exactly the same way wrapped, works and returns 1 in exactly the same example. I would really appreciate if someone could have a second look... To reproduce on Windows: 1. Download the 32 bit version of WKHTML from http://wkhtmltopdf.org[http://wkhtmltopdf.org] and install it 2. Copy the wkhtmltox.dll to either the folder of the VM executable or the Windows directory so it can be found 3. Load the package WKHTML2PDF-Core-TorstenBergmann.7 from http://smalltalkhub.com/#!/~TorstenBergmann/WKHTML2PDF[http://smalltalkhub.com/#!/~TorstenBergmann/WKHTML2PDF] into Pharo 3.0#30848 4. Check the Transcript while evaluating: WKPDFLibrary example One can see that within this code #setObjectSetting:to:in: fails while #setGlobalSetting:to:in: works. Maybe I just do not see the obvious. Help is appreciated. Thanks in advance! bye T. main.cpp Best Regards Jean
Re: [Pharo-dev] Clarifications with small lint rules
Ha, I’ve found the solution. Something around this lines: checker := SmalllintManifestChecker new rule: rules; environment: env; run. (rules leaves collect: [ :rule | rule - (checker criticsOf: rule) ] thenReject: [ :assoc | assoc value isEmpty ]) asDictionary Uko On 22 May 2014, at 17:27, Jan Vrany jan.vr...@fit.cvut.cz wrote: No. not really. There are just 4 implementors only, in RBBasicLintRule, RBTransformationRule and RBCompositeLintRule. Maybe I've added something to environment, I don't really remember, it's a long time ago when worked on this and since then it just works :-) If you'd like more convenient way to browse the code, you may want to download and run St/X and look at it in browser: https://swing.fit.cvut.cz/projects/stx-jv/wiki/Download SmallLint is pre-loaded. Jan On 22/05/14 16:18, Yuriy Tymchuk wrote: Hi Jan, in #failedMethods: you use #failedMethodsInto: which is abstract. So the idea is that in each rule gets methods from it’s result? Uko On 22 May 2014, at 17:03, Jan Vrany jan.vr...@fit.cvut.cz wrote: Yeah, all the refatory stuff has weird API and SmallLint ones are of the weirdest. The design is bit unfortunate. You may want to have a look how I did it: RBLintRulefailedMethods, RBLintRulefailedClasses source code's here: http://www.exept.de/cgi-bin/viewvc.cgi/stx/goodies/refactoryBrowser/lint/RBLintRule.st?view=markup Best, Jan On 22/05/14 15:49, Yuriy Tymchuk wrote: Hi guys, so I’m experimenting with rules, and I have one simple question: how do I get a collection of items from some environment which violate some rule? i know that I can send #runOnEnvironment: to the rule itself and then it will use a checker to run the rule on the environment. But later I end up with the rule itself. I know that I can get all atomic rules from composite rule by sending #leaves, and there is #result method that returns environment. But there is no single way to get items from environment, and all accessors are environment-specific. Am I doing something wrong? Because I’ve spent half of a day to find out how to run a rule and get violations :). Cheers. Uko
Re: [Pharo-dev] NativeBoost and WKHTML
Hi Jan, I did not compile the WKHTML component, just used the predefined DLL from the website. I know that there is no C++ interfering as the DLL has a normal C interface. So no C++ calling convention stuff/name mangling etc. is involved, no SWIG required or additional C wrapper. One can download and use the DLL as a usual C DLL like many others. So C/C++ was only involved because after the mentioned single Pharo/NB call failed and I could not see the reason in my code I wanted a Pharo independent non-smalltalk calling example to prove that the DLL is working. Could have used any other language (Java, VB, ...) to call the WKHTML DLL. So I use the DLL as a black box, similar like any other API where you do not have the source code. Debugging the DLL or modifying its source code by adding debug outputs would mean to go through all the hazzle of compiling WKHTML myself. According to the website this would also additionally require many tools (Perly, Python, Windows SDK, VisualStudio, ...) which I do not have installed. Way too much effort as I only thought it would be a nice idea if we could provide a Pharo binding to print something easily from Pharo using HTML - PDF. As you see on the calling example WKHTML is simple and straightforward with an init, put some settings (file/URL) and calling the conversion. I also think that the route to debugging the DLL would be questionable - my simple non-Smalltalk calling example proves that the DLL is properly working as the website states. So according to this the problem must be on the Pharo wrapper or NativeBoost side who calls the component. Therefore I looked at my wrapper code again and again - nothing suspicious. Thats why I asked: either I'm blind to not see the forest because of the all the trees or there is still some bug left in NB. Maybe there is also an easy way to check/compare the calls. Thanks T. Gesendet: Freitag, 23. Mai 2014 um 12:11 Uhr Von: Jan Vrany jan.vr...@fit.cvut.cz An: Pharo Development List pharo-dev@lists.pharo.org Betreff: Re: [Pharo-dev] NativeBoost and WKHTML Hi, If I were to debug this, I would: 1 ) make sure there's no C++ interfering, try to compile using C compiler (not C++, I guess you run Windows and MSVC, I think there's command line option to process file as C). If not possible, wrap all methods you want to call form St in extern C {} block. Does it work? If not, then C++ compiler is doing it's magic which NB doesn't. 2 ) If it does, run whole thing under debugger, set breakpoint to the faulty function and check that arguments are correct and what's return value. If args are incorrect, then the problem is in either yours or NB's code. If return value is correct, then the problem is also in either yours or NB's code. If the return value is incorrect, well then the problem could be either in the library or some sort of GC thing as GC moves stuff around, which most of C/C++ libraries don't like much. In that case, I learned, the only way us to read library's code and single-step through it to see that the code actually does with data you pass down. HTH, Jan On 23/05/14 10:51, Torsten Bergmann wrote: Hi Jean, thanks for answering. I dont think that the convention is an issue here: internally it is written in C++, but it exposes the API as simple C functions. The calls with NB work (even the callbacks). What confuses me most is that the call to wkhtmltopdf_set_global_setting works while the wkhtmltopdf_set_object_setting does not. They have exactly the same signature and are called one after the other. First one returns proper int 1 (success) as in the non-Smalltalk example, the other one 0 which means it failed. There is no magic in the Pharo code, just simple calls. Also the non-Smalltalk example proves that the component is working. Maybe a side effect of NativeBoost itself? Looks like so far I'm lost without the help of Igor here... Thx T. Gesendet: Freitag, 23. Mai 2014 um 11:31 Uhr Von: Jean Baptiste Arnaud jbaptiste.arn...@gmail.com An: Pharo Development List pharo-dev@lists.pharo.org Betreff: Re: [Pharo-dev] NativeBoost and WKHTML I think this is because it is a C++ lib. NativeBoost cannot be used with C++ lib. It is a problem of call convention that is not the same from C to C++. As I discuss with some people it seems be a complexe problem, each C++ compiler seems have it own convention. But Igor can maybe be more accurate about that. A C wrapper to call C++, which should work. On 23 May 2014, at 02:36, Torsten Bergmann asta...@gmx.de wrote: Hi, as there was no responded so far I tried to track the problem deeper and did a short test client in C/C++ to verify if I can call WKHTMLTOPDF there and generate a PDF and to compare to the Pharo/NativeBoost client.
Re: [Pharo-dev] Wanna to browse your code as a Disneyland ride?
Always inspiring ! I had the same idea with Calder: https://www.youtube.com/watch?v=SE1vuCy8q44 be able to switch from one view showing the agents in a spatial environment to another one more focus on the network communication. I made a short demo if you remember during last MOOSEDAY in Lille. Regards, On Thu, May 22, 2014 at 5:37 PM, Alexandre Bergel alexandre.ber...@me.com wrote: Here is an early preview of what we are working on... https://vimeo.com/96091089 To be announced at ESUG... Cheers, Alexandre -- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;. -- Serge Stinckwich UCBN UMI UMMISCO 209 (IRD/UPMC) Every DSL ends up being Smalltalk http://www.doesnotunderstand.org/
Re: [Pharo-dev] NativeBoost and WKHTML
On 23.05.2014 02:36, Torsten Bergmann wrote: With that info I compared the C/C++ calls to the Pharo/NativeBoost calls more deeply and found out that in C/C++ the following call for an object setting works (by returning 1): while in Pharo the same call fails (by returning 0): I tried to use another DLL which required me to change stackAlignment on Windows to answer 16 instead of 1; running on Win7 64 Bit. Could your problem be caused by something like that? (Just a shot in the dark). Best regards, Markus
Re: [Pharo-dev] The funny side of Pharo : Message Definitely Not Understood
2014-05-22 6:56 GMT+01:00 Freemail nicolaih...@web.de: Are we talking about the update menu item in the system menu? Yes. I don't understand this discussion, I always use this menu item for updating the image. I thought this is the nomal way. So did I when I first discovered Pharo. And I never had any problems with that . You are a very lucky person :D (maybe it works because I use it regulary) Even if that was a solution, it´s not good enough.. How do you keep the image up to date? I would answer by using the system update, which, sadly, may or may not work for you at any particular point in time with any particular image. Somebody else may answer make configurations for your packages and set up a CI job to create images for you. Which is *not* updating the image at all. Cheers, Sergi
Re: [Pharo-dev] NativeBoost and WKHTML
On 23 May 2014, at 2:36 , Torsten Bergmann asta...@gmx.de wrote: Hi, as there was no responded so far I tried to track the problem deeper and did a short test client in C/C++ to verify if I can call WKHTMLTOPDF there and generate a PDF and to compare to the Pharo/NativeBoost client. Attached is the according CPP file which works and results in a PDF with the google homepage. I also additionally implemented the callback functions in the Pharo wrapper and using the error handling I noticed that the component returns Failed loading page http:// ... With that info I compared the C/C++ calls to the Pharo/NativeBoost calls more deeply and found out that in C/C++ the following call for an object setting works (by returning 1): // this returns 1 in C/C++ which is OK int a = wkhtmltopdf_set_object_setting(os, page, http://www.google.de;); printf(object set %i,a); while in Pharo the same call fails (by returning 0): The following call failed and returns 0 instead of 1 self setObjectSetting: 'page' to: 'http://www.google.de' in: os. With argument type char * , NB does not 0-terminate your strings, but passes in the argument you provided raw. ByteStrings have an internal representation size a multiplum of 4, thus ‘page’ will have no accidentally terminating 0, while ‘out’ does, and the call fails since whatever garbage bytes are in the image after the string instance (‘page’) leads to the it not being recognized as a valid property name. Change the call definitions to use String as argument type instead, and NB will convert the args to zero-terminated strings for you: NBFFICallout stdcall: #(int wkhtmltopdf_set_object_setting(wkhtmltopdf_object_settings* settings, String aName, String value)) module: 'wkhtmltox.dll' Alternatively, you need to provide null-terminated strings yourself: x := self setObjectSetting: ('page' , (Character value: 0) asString) to: 'http://www.google.de', (Character value: 0) asString) in: os. Which also returns makes it return 1. Cheers, Henry signature.asc Description: Message signed with OpenPGP using GPGMail
Re: [Pharo-dev] NativeBoost and WKHTML
On 23 May 2014, at 2:52 , Henrik Johansen henrik.s.johan...@veloxit.no wrote: On 23 May 2014, at 2:36 , Torsten Bergmann asta...@gmx.de wrote: Hi, as there was no responded so far I tried to track the problem deeper and did a short test client in C/C++ to verify if I can call WKHTMLTOPDF there and generate a PDF and to compare to the Pharo/NativeBoost client. Attached is the according CPP file which works and results in a PDF with the google homepage. I also additionally implemented the callback functions in the Pharo wrapper and using the error handling I noticed that the component returns Failed loading page http:// ... With that info I compared the C/C++ calls to the Pharo/NativeBoost calls more deeply and found out that in C/C++ the following call for an object setting works (by returning 1): // this returns 1 in C/C++ which is OK int a = wkhtmltopdf_set_object_setting(os, page, http://www.google.de;); printf(object set %i,a); while in Pharo the same call fails (by returning 0): The following call failed and returns 0 instead of 1 self setObjectSetting: 'page' to: 'http://www.google.de' in: os. With argument type char * , NB does not 0-terminate your strings, but passes in the argument you provided raw. ByteStrings have an internal representation size a multiplum of 4, thus ‘page’ will have no accidentally terminating 0, while ‘out’ does, and the call fails since whatever garbage bytes are in the image after the string instance (‘page’) leads to the it not being recognized as a valid property name. Change the call definitions to use String as argument type instead, and NB will convert the args to zero-terminated strings for you: NBFFICallout stdcall: #(int wkhtmltopdf_set_object_setting(wkhtmltopdf_object_settings* settings, String aName, String value)) module: 'wkhtmltox.dll' Alternatively, you need to provide null-terminated strings yourself: x := self setObjectSetting: ('page' , (Character value: 0) asString) to: 'http://www.google.de', (Character value: 0) asString) in: os. Which also returns makes it return 1. Cheers, Henry To test it then *actually* worked, I implemented: getObjectSetting: aName in: settings into: value ofSize: vs primitive: #primitiveNativeCall module: #NativeBoostPlugin ^NBFFICallout stdcall: #(int wkhtmltopdf_get_object_setting(wkhtmltopdf_object_settings* settings, String aName, char* value, int vs)) module: 'wkhtmltox.dll' Note, you *cannot* use String for a parameter being written to, while NB in that case would pass along a zero-terminated copy for you, it does *not* copy the contents back into the actual string instance @ end of call. It’s also easy to spot garbage characters added when value was // 4 = 0 (using char * definition): x := self setObjectSetting: (‘page' , Character null asString) to: 'http://www.google.de' in: os. http://www.google.de size = 20 Transcript show: x. buffer := String new: 40. x := self getObjectSetting: ('page' , Character null asString) in: os into: buffer ofSize: buffer size. (buffer indexOf:Character null) 21 Probably true... Cheers, Henry PS: That’s a glorious getter API… It returns 1 even if your buffer is shorter than the actual parameter, so your only way to be sure you’ve fetched all of it, is to test that the result give contains a null character, and if not, retry with a larger buffer… (The sane thing to do would be allowing you to query the parameter length, either through a * int parameter, or a separate function). signature.asc Description: Message signed with OpenPGP using GPGMail
Re: [Pharo-dev] Clarifications with small lint rules
If you improve the system send us fixes. Just make sure that - the tests run - you add tests. Stef
Re: [Pharo-dev] Coral is green
Thanks, David. Where do I find a precompiled cog vm with the changes to test with? (preferably mac, but linux will do). build.squeak.org doesn't seem to have a recent green build. Stephan
[Pharo-dev] Getting access to the _whole_ smalltalkhub?
Hi! As you know, the moose team is full of passionated and happy people willing to analyze software. We have great platforms to carry out analysis that are robust enough to compete with state-of-the-Art software analysis platforms out there. It would be great to have software to feed our wonderful tools. There are 123 873 packages on Smalltalkhub (!). Can we have easily access to them? I mean, a big big big .zip file would be fantastic with all the public software. Cheers, Alexandre -- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
Re: [Pharo-dev] Getting access to the _whole_ smalltalkhub?
I support that idea :) Doru On Fri, May 23, 2014 at 3:43 PM, Alexandre Bergel alexandre.ber...@me.comwrote: Hi! As you know, the moose team is full of passionated and happy people willing to analyze software. We have great platforms to carry out analysis that are robust enough to compete with state-of-the-Art software analysis platforms out there. It would be great to have software to feed our wonderful tools. There are 123 873 packages on Smalltalkhub (!). Can we have easily access to them? I mean, a big big big .zip file would be fantastic with all the public software. Cheers, Alexandre -- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;. -- www.tudorgirba.com Every thing has its own flow
Re: [Pharo-dev] Getting access to the _whole_ smalltalkhub?
On 23 May 2014, at 15:43, Alexandre Bergel alexandre.ber...@me.com wrote: Hi! As you know, the moose team is full of passionated and happy people willing to analyze software. We have great platforms to carry out analysis that are robust enough to compete with state-of-the-Art software analysis platforms out there. It would be great to have software to feed our wonderful tools. There are 123 873 packages on Smalltalkhub (!). Package versions. This is the number of .mcz files. Can we have easily access to them? I mean, a big big big .zip file would be fantastic with all the public software. Would be nice the have an api… Marcus
[Pharo-dev] What is your seaside application?
Hi! Leonardo is a smart PhD Brazilien student, who is discovering the treasures we have built. He would like to analyze Seaside applications to analyze event propagation. I told Leonardo that the Pharo and Seaside communities are great and he will probably get help from us. So, a simple and quick-to-answer question, what is your Seaside application and how to access the code of it? Please, reply to this email with the smalltalkhub link that point to your application. Go go go! Cheers, Alexandre -- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
Re: [Pharo-dev] [Moose-dev] Wanna to browse your code as a Disneyland ride?
Yes yes :-) I do remember perfectly! Cool stuff!! Alexandre -- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;. On May 23, 2014, at 8:11 AM, Serge Stinckwich serge.stinckw...@gmail.com wrote: Always inspiring ! I had the same idea with Calder: https://www.youtube.com/watch?v=SE1vuCy8q44 be able to switch from one view showing the agents in a spatial environment to another one more focus on the network communication. I made a short demo if you remember during last MOOSEDAY in Lille. Regards, On Thu, May 22, 2014 at 5:37 PM, Alexandre Bergel alexandre.ber...@me.com wrote: Here is an early preview of what we are working on... https://vimeo.com/96091089 To be announced at ESUG... Cheers, Alexandre -- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;. -- Serge Stinckwich UCBN UMI UMMISCO 209 (IRD/UPMC) Every DSL ends up being Smalltalk http://www.doesnotunderstand.org/ ___ Moose-dev mailing list moose-...@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Re: [Pharo-dev] [Moose-dev] Wanna to browse your code as a Disneyland ride?
I need to find a student to work on this ! SmartBrowser is available somewhere ? On Fri, May 23, 2014 at 3:58 PM, Alexandre Bergel alexandre.ber...@me.com wrote: Yes yes :-) I do remember perfectly! Cool stuff!! Alexandre -- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;. On May 23, 2014, at 8:11 AM, Serge Stinckwich serge.stinckw...@gmail.com wrote: Always inspiring ! I had the same idea with Calder: https://www.youtube.com/watch?v=SE1vuCy8q44 be able to switch from one view showing the agents in a spatial environment to another one more focus on the network communication. I made a short demo if you remember during last MOOSEDAY in Lille. Regards, On Thu, May 22, 2014 at 5:37 PM, Alexandre Bergel alexandre.ber...@me.com wrote: Here is an early preview of what we are working on... https://vimeo.com/96091089 To be announced at ESUG... Cheers, Alexandre -- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;. -- Serge Stinckwich UCBN UMI UMMISCO 209 (IRD/UPMC) Every DSL ends up being Smalltalk http://www.doesnotunderstand.org/ ___ Moose-dev mailing list moose-...@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev -- Serge Stinckwich UCBN UMI UMMISCO 209 (IRD/UPMC) Every DSL ends up being Smalltalk http://www.doesnotunderstand.org/
Re: [Pharo-dev] [Moose-dev] Wanna to browse your code as a Disneyland ride?
Yes, in the Roassal distribution Just install Roassal and SmartBrowser will appear in your Tool menu. Note that SmartBrowser is not ready for public consumption. We are currently working on it Alexandre -- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;. On May 23, 2014, at 10:02 AM, Serge Stinckwich serge.stinckw...@gmail.com wrote: I need to find a student to work on this ! SmartBrowser is available somewhere ? On Fri, May 23, 2014 at 3:58 PM, Alexandre Bergel alexandre.ber...@me.com wrote: Yes yes :-) I do remember perfectly! Cool stuff!! Alexandre -- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;. On May 23, 2014, at 8:11 AM, Serge Stinckwich serge.stinckw...@gmail.com wrote: Always inspiring ! I had the same idea with Calder: https://www.youtube.com/watch?v=SE1vuCy8q44 be able to switch from one view showing the agents in a spatial environment to another one more focus on the network communication. I made a short demo if you remember during last MOOSEDAY in Lille. Regards, On Thu, May 22, 2014 at 5:37 PM, Alexandre Bergel alexandre.ber...@me.com wrote: Here is an early preview of what we are working on... https://vimeo.com/96091089 To be announced at ESUG... Cheers, Alexandre -- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;. -- Serge Stinckwich UCBN UMI UMMISCO 209 (IRD/UPMC) Every DSL ends up being Smalltalk http://www.doesnotunderstand.org/ ___ Moose-dev mailing list moose-...@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev -- Serge Stinckwich UCBN UMI UMMISCO 209 (IRD/UPMC) Every DSL ends up being Smalltalk http://www.doesnotunderstand.org/
[Pharo-dev] [website] small changes
Hi, - pharo-project.org now forwards to pharo.org (there is still old.pharo-project.org to access the old website) - all subdomains (ci, bugs….) are now defined for pharo.org, too. (DNS propagation might take a while) - added links to twitter https://twitter.com/pharoproject http://pharo.org/about http://pharo.org/news Marcus
Re: [Pharo-dev] What is your seaside application?
Hi, here’s my case for it: http://sebastianconcept.com/brandIt/10-reasons-why-im-using-smalltalk-for-airflowing versão em português: http://sebastianconcept.com/brandIt/10-razoes-pelas-quais-estou-usando-smalltalk-para-airflowing Served from Europe, designed in Foz do Iguaçu FTW :D sebastian o/ author of airflowing, founder of flowing TEDx Organizer email: sebast...@flowingconcept.com skype: sebastianconcept hangout: sebastianconc...@gmail.com LinkedIn: http://www.linkedin.com/in/sebastiansastre facebook: http://facebook.sebastianconcept.com twitter: @sebastianconcpt github: https://github.com/sebastianconcept On May 23, 2014, at 10:56 AM, Alexandre Bergel alexandre.ber...@me.com wrote: Hi! Leonardo is a smart PhD Brazilien student, who is discovering the treasures we have built. He would like to analyze Seaside applications to analyze event propagation. I told Leonardo that the Pharo and Seaside communities are great and he will probably get help from us. So, a simple and quick-to-answer question, what is your Seaside application and how to access the code of it? Please, reply to this email with the smalltalkhub link that point to your application. Go go go! Cheers, Alexandre -- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
Re: [Pharo-dev] What is your seaside application?
Thanks! We need more! Just say your name! Alexandre -- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;. On May 23, 2014, at 10:54 AM, Sebastian Sastre sebast...@flowingconcept.com wrote: Hi, here’s my case for it: http://sebastianconcept.com/brandIt/10-reasons-why-im-using-smalltalk-for-airflowing versão em português: http://sebastianconcept.com/brandIt/10-razoes-pelas-quais-estou-usando-smalltalk-para-airflowing Served from Europe, designed in Foz do Iguaçu FTW :D sebastian o/ author of airflowing, founder of flowing TEDx Organizer email: sebast...@flowingconcept.com skype: sebastianconcept hangout: sebastianconc...@gmail.com LinkedIn: http://www.linkedin.com/in/sebastiansastre facebook: http://facebook.sebastianconcept.com twitter: @sebastianconcpt github: https://github.com/sebastianconcept On May 23, 2014, at 10:56 AM, Alexandre Bergel alexandre.ber...@me.com wrote: Hi! Leonardo is a smart PhD Brazilien student, who is discovering the treasures we have built. He would like to analyze Seaside applications to analyze event propagation. I told Leonardo that the Pharo and Seaside communities are great and he will probably get help from us. So, a simple and quick-to-answer question, what is your Seaside application and how to access the code of it? Please, reply to this email with the smalltalkhub link that point to your application. Go go go! Cheers, Alexandre -- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
[Pharo-dev] [ANN] Pharo VM packaging for Ubuntu
Hi, I'm happy to announce a brand new packaging of the Pharo VM. The packaging works with all officially supported Ubuntu releases, both 32 and 64bits (see this list of Ubuntu support dates: http://en.wikipedia.org/wiki/Ubuntu_%28operating_system%29#Releases). I pushed these new packages to a different PPA so I can test without impacting current users : https://launchpad.net/~pharo/+archive/unstable/+packages If you are using an old version of Ubuntu (e.g., Precise 12.04 or even Lucid 10.04), you should try with this new PPA. Please report problems by email to me directly. An advantage of this new packaging is that it should become much easier to create Ubuntu packages for your own Pharo projects. I will talk about that later as I try these new packaging mechanism on the Launcher, Pillar and Phratch projects. -- Damien Cassou http://damiencassou.seasidehosting.st Success is the ability to go from one failure to another without losing enthusiasm. Winston Churchill
Re: [Pharo-dev] Getting access to the _whole_ smalltalkhub?
Tudor Girba tu...@tudorgirba.com writes: I support that idea :) Indeed :) Nico Doru On Fri, May 23, 2014 at 3:43 PM, Alexandre Bergel alexandre.ber...@me.comwrote: Hi! As you know, the moose team is full of passionated and happy people willing to analyze software. We have great platforms to carry out analysis that are robust enough to compete with state-of-the-Art software analysis platforms out there. It would be great to have software to feed our wonderful tools. There are 123 873 packages on Smalltalkhub (!). Can we have easily access to them? I mean, a big big big .zip file would be fantastic with all the public software. Cheers, Alexandre -- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;. -- Nicolas Petton http://nicolas-petton.fr
Re: [Pharo-dev] Coral is green
Hi Stephan, The precompiled Cog VM would need to come from Eliot's site (or follow the links to Eliot's site from http://squeakvm.org). The build.squeak.org job is really just me testing the VMMaker code generation, it's not intended as a source of VMs. I tested Eliot's change and it works, but I think I was testing it with a Cog VM that I compiled myself. So I'm not sure if the up to date precompiled VM is available. In any case, the change affects one source file in the VM platform sources, so if you can arrange to get that included in the Pharo VM builds, that should provide a working VM that you can use for OSProcess on Pharo. Dave Thanks, David. Where do I find a precompiled cog vm with the changes to test with? (preferably mac, but linux will do). build.squeak.org doesn't seem to have a recent green build. Stephan
[Pharo-dev] How To for CI and Jenkins
I would like additionally to create my own documentation for things I experiment with , for example Rubric and I want to have Jenkins build my pdf. So how I add a Job in Jenkins ? I assume I need an account but could not find a registration procedure and generally I need info how to do this.
Re: [Pharo-dev] What is your seaside application?
Hi! Leonardo is a smart PhD Brazilien student, who is discovering the treasures we have built. Welcome Leonardo He would like to analyze Seaside applications to analyze event propagation. What do you mean by event propagation because I do not really how it relates to Seasid. I told Leonardo that the Pharo and Seaside communities are great and he will probably get help from us. we are :) So, a simple and quick-to-answer question, what is your Seaside application and how to access the code of it? many of web app are private because business oriented. Please, reply to this email with the smalltalkhub link that point to your application. Go go go! Cheers, Alexandre
Re: [Pharo-dev] Advice for a newb
On 20/5/14 04:41, Rick Kitts wrote: Hello. I was wondering if anyone could point me to or otherwise suggest some best practices for working on Kernel code. I’m futzing about with the Duration class (in the interest of fixing 13215) Thanks! and have discovered that it’s really easy to crash Pharo if I break that class. I assume there are other classes that would exhibit the same behavior. Yes like Array or OrderedCollection. We are working on a bootstrap of pharo and it could help for brain surgery (but in that case the system may simply not build at all). So the suggestion of Ron to use ChangeSet is a good one. Now once I got change that crash (just a tight endless loop) as soon as you change anything and there you have to rollback and turn around the self referencing aspect. I suppose I could just be really cautious and save my image after every change but that seems so error prone that I’m hoping that there are idiomatic ways of working on kernel code (beyond just save ones image early and often) so I don’t lose work. I’m asking because the naive solution (copy the original class, modify it to suit, delete the original and rename the new class to the original) of course doesn’t work. TIA for any suggestions or assistance and apologies in advance if this is RTFM, I didn’t see anything (didn’t look very hard either though). —Rick
Re: [Pharo-dev] What is your seaside application?
From: stepharo steph...@free.fr Subject: Re: [Pharo-dev] What is your seaside application? Date: May 23, 2014 at 3:06:56 PM GMT-4 To: Pharo Development List pharo-dev@lists.pharo.org Reply-To: Pharo Development List pharo-dev@lists.pharo.org Hi! Leonardo is a smart PhD Brazilien student, who is discovering the treasures we have built. Welcome Leonardo Thank you! He would like to analyze Seaside applications to analyze event propagation. What do you mean by event propagation because I do not really how it relates to Seasid. I am interested in events you can trigger in web pages. For example: a user clicks on a button and the script code associated causes a state change in the Document Object Model (DOM) and sends a XHR request (XMLHttpRequest) to the server. The server eventually answers this request, closing the sequence of events. I want to trace these sequences of events from a running application. I told Leonardo that the Pharo and Seaside communities are great and he will probably get help from us. we are :) That's very nice So, a simple and quick-to-answer question, what is your Seaside application and how to access the code of it? many of web app are private because business oriented. I understand, but it would be nice to have some examples of web applications using script languages, even if I don't have access to all source code. Cheers, Leonardo
Re: [Pharo-dev] Coral is green
Ok, I created a pull request on https://github.com/pharo-project/pharo-vm. I guess there should be a way to use the diff directly, instead of editing the file by hand. Stephan
Re: [Pharo-dev] What is your seaside application?
Story Board Story Board is a multi user, drag and drop, agile planning tool. Each user can create projects and invite other users to participate. Architecture This application is build with Deltawerken and Seaside 3.1. Please use the configuration to load this application. Loading Gofer new url: 'http://ss3.gemstone.com/ss/StoryBoard'; package: 'ConfigurationOfStoryBoard'; load. (Smalltalk at: #ConfigurationOfStoryBoard) project bleedingEdge load Change the admin password in a workspace (SBUser userWithId: 'Admin') password: 'your new password' Video Getting started: https://vimeo.com/49195501 Links http://ss3.gemstone.com/ss/Deltawerken.html http://www.seaside.st
Re: [Pharo-dev] Coral is green
David wrote: In any case, the change affects one source file in the VM platform sources, so if you can arrange to get that included in the Pharo VM builds, that should provide a working VM that you can use for OSProcess on Pharo. I noticed that this is only a unix vm change. Should this be working already on Mac and Windows? Stephan
Re: [Pharo-dev] What is your seaside application?
Thanks Stephan! I will check it out. On Fri, May 23, 2014 at 5:24 PM, Stephan Eggermont step...@stack.nl wrote: Story Board Story Board is a multi user, drag and drop, agile planning tool. Each user can create projects and invite other users to participate. Architecture This application is build with Deltawerken and Seaside 3.1. Please use the configuration to load this application. Loading Gofer new url: 'http://ss3.gemstone.com/ss/StoryBoard'; package: 'ConfigurationOfStoryBoard'; load. (Smalltalk at: #ConfigurationOfStoryBoard) project bleedingEdge load Change the admin password in a workspace (SBUser userWithId: 'Admin') password: 'your new password' Video Getting started: https://vimeo.com/49195501 Links http://ss3.gemstone.com/ss/Deltawerken.html http://www.seaside.st
Re: [Pharo-dev] Coral is green
On Fri, May 23, 2014 at 10:26:54PM +0200, Stephan Eggermont wrote: David wrote: In any case, the change affects one source file in the VM platform sources, so if you can arrange to get that included in the Pharo VM builds, that should provide a working VM that you can use for OSProcess on Pharo. I noticed that this is only a unix vm change. Should this be working already on Mac and Windows? Definitely not for Windows. I'm honestly not sure where we stand on Mac VMs. If the VM is based on the unix platform sources, then it will work, otherwise probably not. The specific feature that affects the OSProcess tests is the ability to support #forkSqueak, which uses a Unix fork() mechanism to start an exact copy of the running VM and image with very little memory overhead. This is used in the OSProcess test suite in order to set up test cases that deal with the interaction of two or more OS processes. Think about what is required to ask the VM to pause for a moment, split itself in two like an amoeba, and then have both of the VM instances start running again as if nothing had happened. That means pausing and restarting some signal handlers, pausing the connection to the X display so a new one can be created for the second VM process, and restarting the various threads that were running in the original VM. Most of this was already working for Cog. Eliot came up with a way to restart the timer threads for Cog and wonder of wonders, that was all it took to get #forkSqueak working on Cog. Dave