Re: [Pharo-users] [ANN] Pharo Launcher 2.0 released!

2020-04-21 Thread Julien Delplanque

Hello Christophe,

I just updated my launcher and this new version looks awesome.

Thanks a lot for this work.

Julien

Le 17/04/20 à 18:08, Christophe Demarey a écrit :

Hi all,

Pharo Launcher 2.0 has just been released! It is available from 
http://pharo.org/download.


This new version introduces major changes:

  * The UI has been fully rewritten using the new Spec2 framework
 and the Commander2 library
. UI has been revamped
to increase usability, especially for newcomers. The main window
is now composed of a toolbar and the list of images. The template
list is now available when clicking on the new image button.
  * Documentation web site : All Pharo Launcher features are now
explained in the new documentation available at
https://pharo-project.github.io/pharo-launcher. You can contribute
easily by clicking the *edit on GitHub* button.
  * You can now have many launch configurations for an image (VM to
use, vm and image arguments). It means you can use headless Pharo
VM from Pharo Launcher.
  * When creating a new image, you can specify an initialisation
script that will be run once at the first image launch. It is
useful to load your project code in a stock Pharo image for
example. See

https://pharo-project.github.io/pharo-launcher/create-images/#image-initialization-script
  * You can now define your own template sources in addition to
official sources (see

https://pharo-project.github.io/pharo-launcher/templates/#create-your-own-list-of-template-categories),
including authenticated sources.
  * Improved image metadata. Pharo Launcher now manages all image
metadata in a single STON file (including description, Pharo version).


Big thanks to all contributors, including issue reports. It is also 
the opportunity to thanks Damien Cassou, the original author of Pharo 
Launcher.


Here is the changelog:
Pharo Launcher v2.0 



The list of closed issue is too long (68) to be listed but you can 
browse it here: 
https://github.com/pharo-project/pharo-launcher/issues?q=is%3Aissue+is%3Aclosed+closed%3A2019-07-09..2020-04-17

Here are some highlights:

New features:

  * Documentation web site
  * Image initialisation script
  * Launch configurations, headless VM support
  * User template file in addition to the official template file
  * Jenkins server template now support pipeline projects
  * Support of private Jenkins server
  * Support of authenticated HTTP server

Improvements:

  * Monitoring of image launch failures to give back the error message
(if any)
  * Newly created image is automatically selected in the image list
  * Allow to set image description at creation time
  * Better error management (you will have the choice to ignore them
or debug them)
  * Add a poor version column in image list
  * Speedup (especially when image repository has a lot of images)

Bug fixes:

  * Fix use of system unzip on Windows


Regards,
The Pharo team.


Re: [Pharo-users] Slots vs collections

2020-03-20 Thread Julien Delplanque

Hello,

There is a work in progress prototype slot named BooleanSlot in the 
Slot-Example package built-in the image.


I think this slot does what you want.

So, the answer is yes, it is possible to do that. But you will need to 
fix todos left in BooleanSlot methods.


Julien

Le 20/03/20 à 12:24, N. Bouraqadi a écrit :

Hi,

Suppose I have an instance variable referencing a collection of booleans.
I want to have all elements of the collection be stored as bits.
Is there a way I can express it using slots?

This idea can be generalized to other types of slots.

Noury





Re: [Pharo-users] StringSlice

2020-02-04 Thread Julien Delplanque

Hello Kasper,

Looks promising, can help a lot when analyzing Strings.

Will try it next time I need such feature. :-)

Good work!

Julien

Le 4/02/20 à 15:25, Kasper Østerbye a écrit :

Hi,

I was working on parsing longer texts, and my program was extracting 
substrings which sometimes were rather large. Not that it actually 
caused any problems, but it kind of hurt my feel for good code to do that.


It has most surely been done before, but here it is again then, string 
slices.

https://github.com/kasperosterbye/StringUtilities

A string slice a substring obtained by a start and an end index into 
an existing string. It is thus possible to get substrings without 
copying the bytes of the original string - at least for a large number 
of operations.


I have spend a lot of energy in getting it to work right with both 
ByteString and WideString, and to let string slices to be protocol 
compliant with the whole String protocol (except slices are read-only).


Feel free to enjoy and laugh.

In the work with doing StringSlice as a subclass of String, I 
collected a few issues in String. Those are mentioned at:

https://github.com/kasperosterbye/StringUtilities/blob/master/StringIssues.md.

The baseline does not load the tests, but they are there if you want 
to check that too.


I have tried the library on Pharo 7, 8 and 9 (as of 2020-02-04).

Best,

Kasper



[Pharo-users] [ANN] Youtube video explaining how to set-up a Pharo project

2020-01-20 Thread Julien Delplanque

Hello,

I recorded myself setting up a Pharo project on Github this afternoon.

https://www.youtube.com/watch?v=Wnt3OBhR18I

The video shows how to:

- Create git repository on Github, make Pharo be aware of it via Iceberg

- Set-up the CI

- Add CI badge and install script to your README (which we should all do 
systematically... :-) ).


This can be useful for newcomers.

Cheers,

Julien




[Pharo-users] [ANN] Grouper

2019-12-09 Thread Julien Delplanque

Hello,

I made a small library that reify grouping (that one does via #groupBy: 
usually): Grouper https://github.com/juliendelplanque/Grouper


It is designed in the same spirit as SortFunction, but for grouping.

Quick example:

The following code snippet using Grouper:

(10  to:  50)groupUsing:  [:integer  | integer asString first ].
"an OrderedDictionary(
$1->#(10 11 12 13 14 15 16 17 18 19)
$2->#(20 21 22 23 24 25 26 27 28 29)
$3->#(30 31 32 33 34 35 36 37 38 39)
$4->#(40 41 42 43 44 45 46 47 48 49)
$5->#(50))"

is equivalent to the following code snippet using 
built-in|#groupedBy:|method:


(10  to:  50)groupedBy:  [:integer  | integer asString first ]
"an OrderedDictionary(
$1->#(10 11 12 13 14 15 16 17 18 19)
$2->#(20 21 22 23 24 25 26 27 28 29)
$3->#(30 31 32 33 34 35 36 37 38 39)
$4->#(40 41 42 43 44 45 46 47 48 49)
$5->#(50))"

The advantage of using it is that it allows one to compose grouper objects.

Thus, it is easy to describe grouping on 2 or 3 levels.

Fore example:

The power of Grouper is that group description are first-class objects. 
Thus, it is possible to compose group descriptions in order to group a 
flat collection on multiple levels.


For example:

groupComposition:=  [:integer  | integer asString first ] grouper , [:integer  
| integer asString second ].
(10  to:  50)groupUsing:  groupComposition.
"an OrderedDictionary(
$1->an OrderedDictionary(
$0->#(10) $1->#(11) $2->#(12) $3->#(13) $4->#(14) $5->#(15) $6->#(16) 
$7->#(17) $8->#(18) $9->#(19))

$2->an OrderedDictionary(
$0->#(20) $1->#(21) $2->#(22) $3->#(23) $4->#(24) $5->#(25) $6->#(26) 
$7->#(27) $8->#(28) $9->#(29))

$3->an OrderedDictionary(
$0->#(30) $1->#(31) $2->#(32) $3->#(33) $4->#(34) $5->#(35) $6->#(36) 
$7->#(37) $8->#(38) $9->#(39))

$4->an OrderedDictionary(
$0->#(40) $1->#(41) $2->#(42) $3->#(43) $4->#(44) $5->#(45) $6->#(46) 
$7->#(47) $8->#(48) $9->#(49))

$5->an OrderedDictionary($0->#(50)))"

On the github, there are more example showing how to build trees with 
custom objects.


Any feedback for this library is welcome.

I would like to propose it to Pharo in the near future because it would 
simplify a lot of code in DrTests (related to result tree views, the 
tree on the right of the UI).


I don't know if it will be possible before next release as we are in 
feature freeze.


Cheers,

Julien



Re: [Pharo-users] Can we auto translate Python to Smalltalk?

2017-06-02 Thread Julien Delplanque

Hello,

Actually I did the opposite to be able to use Python 3 libraries from Pharo.

It is not complete, but you may want to take a look at it [1]. Using 
this lib

you can craft a Python 3 AST and generate its source code.

I guess there is a way to access the AST of a Python program using the API.
Now, you have to see if it is always possible to convert a Python AST to 
a Pharo AST.


One day, I read about someone that converted Python to Ruby (or the 
opposite) using

bytecode translation. Maybe it is another way to do it.

Julien

Links:

[1]: https://github.com/juliendelplanque/Python3Generator


On 02/06/17 17:20, askoh wrote:

Python and JavaScript are driving the movement to Dynamic Languages. In
particular, Python is the language of choice to teach students programming
in universities. So, Smalltalk stands to gain from this shift. We all know
that Smalltalk has the best environment. But we lack the diverse code base.
Can we patch that gap with automatic translation from Python to Smalltalk?
How feasible would it be to auto translate SciPy to SciSmalltalk? Even if it
is imperfect, can we cut the effort by 50% or 80%?

All the best,
Aik-Siong Koh



--
View this message in context: 
http://forum.world.st/Can-we-auto-translate-Python-to-Smalltalk-tp4949015.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.






Re: [Pharo-users] SSL/TLS plugin initailization failed (VM plugin missing ? OS libraries missing ?)

2017-05-14 Thread Julien Delplanque

Ok, I found a way to fix the problem.

Simply, I needed to install the package lib32-libopenssl-1.0-compat 
which contains
the library with "1.0.0" version. This should be added as dependency to 
the package

in AUR. (the command: # yaourt -S lib32-libopenssl-1.0-compat)

I can help for that if needed. Who manage the pharo-related packages for 
Arch?


Julien


On 09/05/17 11:24, Sven Van Caekenberghe wrote:

For Pharo 5, on the same machine:

$ curl get.pharo.org/50+vm | bash
...

$ ./pharo --version
5.0 #1 Wed May  4 11:54:28 CEST 2016 gcc 4.6.3 [Production Spur ITHB VM]
CoInterpreter VMMaker.oscog-eem.1855 uuid: d8e4a3c2-a3bf-4adc-b224-8012903a1ef4 
May  4 2016
StackToRegisterMappingCogit VMMaker.oscog-eem.1855 uuid: 
d8e4a3c2-a3bf-4adc-b224-8012903a1ef4 May  4 2016
https://github.com/pharo-project/pharo-vm.git Commit: 
b8ec25a570d7539653e1d793e97609adb509aaed Date: 2016-05-04 11:14:22 +0200 By: Esteban 
Lorenzano  Jenkins build #589
Linux pharo-linux 3.2.0-31-generic-pae #50-Ubuntu SMP Fri Sep 7 16:39:45 UTC 
2012 i686 i686 i386 GNU/Linux

$ ./pharo Pharo.image printVersion
[version] 5.0 #50772
$ ./pharo Pharo.image eval "ZnClient new get: 'https://pharo.org'"
4149724864:error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert 
handshake failure:s23_clnt.c:769:
ConnectionClosed: Connection closed while waiting for data.
...

This is normal, see 
https://pharo.fogbugz.com/f/cases/19864/Add-support-for-Server-Name-Indication-SNI-to-Zodiac-SSLPlugin
 which is integrated in 6 but not in 5.

Note that the error is different from yours (no linking error, a runtime error).

With other HTTPS sites, it still works on 5:

audio359@audio359:~/pharo-dev/pharo5$ ./pharo Pharo.image eval "ZnClient new get: 
'https://audio359.eu'"
...


On 9 May 2017, at 09:08, Julien Delplanque  wrote:

Hello,

I did the same thing as you and it works.

When I do:

./pharo --version

I get:

5.0-201705022326  Tue May  2 23:46:52 UTC 2017 gcc 4.6.3 [Production Spur ITHB 
VM]
CoInterpreter VMMaker.oscog-eem.2203 uuid: 12d4afae-8498-4e76-8efe-60eba6ef4db2 
May  2 2017
StackToRegisterMappingCogit VMMaker.oscog-eem.2203 uuid: 
12d4afae-8498-4e76-8efe-60eba6ef4db2 May  2 2017
VM: 201705022326 https://github.com/OpenSmalltalk/opensmalltalk-vm.git $ Date: 
Tue May 2 16:26:41 2017 -0700 $
Plugins: 201705022326 https://github.com/OpenSmalltalk/opensmalltalk-vm.git $
Linux testing-gce-7a7e75c9-f535-4934-bad2-d5fb6fd60cee 3.13.0-103-generic 
#150~precise1-Ubuntu SMP Thu Nov 24 11:05:34 UTC 2016 i686 i686 i386 GNU/Linux
plugin path: /tmp/pharo/pharo-vm/lib/pharo/5.0-201705022326 [default: 
/tmp/pharo/pharo-vm/lib/pharo/5.0-201705022326/]

And when I check the version of the VM currently installed on my system:

pharo-spur

I get:

5.0 #1 Tue Jun 21 12:37:33 CEST 2016 gcc 4.6.3 [Production Spur ITHB VM]
CoInterpreter VMMaker.oscog-HolgerHansPeterFreyther.1880 uuid: 
16138eb3-2390-40f5-a6c8-15f0494936f8 Jun 21 2016
StackToRegisterMappingCogit VMMaker.oscog-HolgerHansPeterFreyther.1880 uuid: 
16138eb3-2390-40f5-a6c8-15f0494936f8 Jun 21 2016
https://github.com/pharo-project/pharo-vm.git Commit: 
9638b0190a9fc01479bfb752becd96edfd253c8c Date: 2016-06-21 12:29:26 +0200 By: GitHub 
 Jenkins build #594
Linux pharo-linux 3.2.0-31-generic-pae #50-Ubuntu SMP Fri Sep 7 16:39:45 UTC 
2012 i686 i686 i386 GNU/Linux
plugin path: /usr/share/pharo/spur/ [default: /usr/share/pharo/spur/]

So apparently those are not the same VMs.

Nevertheless, when I open Pharo 6 image that I got using your curl command, it
using the network works with  both VM.

So, I tried to load a Pharo 5 image with the VM:

curl get.pharo.org/50+vm | bash

And when I do:

./pharo Pharo.image eval "ZnClient new get: 'https://pharo.org'"

I get:

ioLoadModule(/tmp/pharo2/pharo-vm/libSqueakSSL.so):
  /usr/lib32/libssl.so.1.0.0: version `OPENSSL_1.0.0' not found (required by 
/tmp/pharo2/pharo-vm/libSqueakSSL.so)
ZdcPluginMissing: SSL/TLS plugin initailization failed (VM plugin missing ? OS 
libraries missing ?)
[ :exception | ZdcPluginMissing signal ] in ZdcPluginSSLSession>>initialize in 
Block: [ :exception | ZdcPluginMissing signal ]
BlockClosure>>cull:
Context>>evaluateSignal:
Context>>handleSignal:
PrimitiveFailed(Exception)>>signal
PrimitiveFailed class(SelectorException class)>>signalFor:
ZdcPluginSSLSession(Object)>>primitiveFailed:
ZdcPluginSSLSession(Object)>>primitiveFailed
ZdcPluginSSLSession>>primitiveSSLCreate
[ handle := self primitiveSSLCreate ] in ZdcPluginSSLSession>>initialize in 
Block: [ handle := self primitiveSSLCreate ]
BlockClosure>>on:do:
ZdcPluginSSLSession>>initialize
ZdcPluginSSLSession class(Behavior)>>new
ZdcSecureSocketStream>>sslSession
ZdcSecureSocketStream>>connect
ZnClient>>setupTLSTo:
ZnClient>>newConnectionTo:
ZnClient>>getConnectionAndExecute
ZnClient>>exec

Re: [Pharo-users] SSL/TLS plugin initailization failed (VM plugin missing ? OS libraries missing ?)

2017-05-09 Thread Julien Delplanque
gnu/libcrypto.so.1.0.0 
(0xf751c000)
libssl.so.1.0.0 => /lib/i386-linux-gnu/libssl.so.1.0.0 (0xf74b2000)
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf72fb000)
libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xf72f6000)
/lib/ld-linux.so.2 (0xf7718000)

This is on a 64-bit Ubuntu with 32-bit libs installed (and that worked before).

Something must be different in your case.


On 8 May 2017, at 13:36, Marc Hanisch via Pharo-users 
 wrote:


From: Marc Hanisch 
Subject: Re: [Pharo-users] SSL/TLS plugin initailization failed (VM plugin 
missing ? OS libraries missing ?)
Date: 8 May 2017 at 13:36:12 GMT+2
To: Any question about pharo is welcome 


Hello,
I have the same problem on Ubuntu 16.04 and Fedora 25...

Any hints?
Marc


Am 08.05.2017 13:18 schrieb "Julien Delplanque" :
Ok, I installed the missing library:

yaourt -S lib32-openssl-1.0

now when I do:

ldd /usr/share/pharo/vm/libSqueakSSL.so

I get:

/usr/share/pharo/vm/libSqueakSSL.so: /usr/lib32/libssl.so.1.0.0: version 
`OPENSSL_1.0.0' not found (required by /usr/share/pharo/vm/libSqueakSSL.so)
 linux-gate.so.1 (0xf77f1000)
 libssl.so.1.0.0 => /usr/lib32/libssl.so.1.0.0 (0xf7731000)
 libc.so.6 => /usr/lib32/libc.so.6 (0xf7571000)
 libcrypto.so.1.0.0 => /usr/lib32/libcrypto.so.1.0.0 (0xf736)
 /usr/lib/ld-linux.so.2 (0x565de000)
 libdl.so.2 => /usr/lib32/libdl.so.2 (0xf735b000)

So it is still not working, I still get the exception in Pharo. :-(

Julien
  










Re: [Pharo-users] SSL/TLS plugin initailization failed (VM plugin missing ? OS libraries missing ?)

2017-05-08 Thread Julien Delplanque

Yes, it does but the file is present and normally in the right version.

I installed it using the package manager.

Julien


On 08/05/17 13:21, Sven Van Caekenberghe wrote:

On 8 May 2017, at 13:17, Julien Delplanque  wrote:

Ok, I installed the missing library:

yaourt -S lib32-openssl-1.0

now when I do:

ldd /usr/share/pharo/vm/libSqueakSSL.so

I get:

/usr/share/pharo/vm/libSqueakSSL.so: /usr/lib32/libssl.so.1.0.0: version 
`OPENSSL_1.0.0' not found (required by /usr/share/pharo/vm/libSqueakSSL.so)
linux-gate.so.1 (0xf77f1000)
libssl.so.1.0.0 => /usr/lib32/libssl.so.1.0.0 (0xf7731000)
libc.so.6 => /usr/lib32/libc.so.6 (0xf7571000)
libcrypto.so.1.0.0 => /usr/lib32/libcrypto.so.1.0.0 (0xf736)
/usr/lib/ld-linux.so.2 (0x565de000)
libdl.so.2 => /usr/lib32/libdl.so.2 (0xf735b000)

It gives you an error (first line), right ?


So it is still not working, I still get the exception in Pharo. :-(

Julien


On 08/05/17 12:50, Sven Van Caekenberghe wrote:

What does the following return for you ?

$ ldd bin/pharo-vm/libSqueakSSL.so
linux-gate.so.1 =>  (0xf779e000)
libssl.so.1.0.0 => /lib/i386-linux-gnu/libssl.so.1.0.0 (0xf7703000)
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf754d000)
libcrypto.so.1.0.0 => /lib/i386-linux-gnu/libcrypto.so.1.0.0 
(0xf736)
/lib/ld-linux.so.2 (0xf777c000)
libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xf735b000)

Each dependency should be satisfied.


On 8 May 2017, at 12:43, Julien Delplanque  wrote:

Hello,

I have this error when trying to use the network:

"SSL/TLS plugin initialization failed (VM plugin missing ? OS libraries missing 
?)"

What library could be missing on my operating system?

I appears after an update of my operating system I think.

I am on Archlinux.

Julien











Re: [Pharo-users] SSL/TLS plugin initailization failed (VM plugin missing ? OS libraries missing ?)

2017-05-08 Thread Julien Delplanque

Ok, I installed the missing library:

yaourt -S lib32-openssl-1.0

now when I do:

ldd /usr/share/pharo/vm/libSqueakSSL.so

I get:

/usr/share/pharo/vm/libSqueakSSL.so: /usr/lib32/libssl.so.1.0.0: version 
`OPENSSL_1.0.0' not found (required by /usr/share/pharo/vm/libSqueakSSL.so)

linux-gate.so.1 (0xf77f1000)
libssl.so.1.0.0 => /usr/lib32/libssl.so.1.0.0 (0xf7731000)
libc.so.6 => /usr/lib32/libc.so.6 (0xf7571000)
libcrypto.so.1.0.0 => /usr/lib32/libcrypto.so.1.0.0 (0xf736)
/usr/lib/ld-linux.so.2 (0x565de000)
libdl.so.2 => /usr/lib32/libdl.so.2 (0xf735b000)

So it is still not working, I still get the exception in Pharo. :-(

Julien


On 08/05/17 12:50, Sven Van Caekenberghe wrote:

What does the following return for you ?

$ ldd bin/pharo-vm/libSqueakSSL.so
linux-gate.so.1 =>  (0xf779e000)
libssl.so.1.0.0 => /lib/i386-linux-gnu/libssl.so.1.0.0 (0xf7703000)
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf754d000)
libcrypto.so.1.0.0 => /lib/i386-linux-gnu/libcrypto.so.1.0.0 
(0xf736)
/lib/ld-linux.so.2 (0xf777c000)
libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xf735b000)

Each dependency should be satisfied.


On 8 May 2017, at 12:43, Julien Delplanque  wrote:

Hello,

I have this error when trying to use the network:

"SSL/TLS plugin initialization failed (VM plugin missing ? OS libraries missing 
?)"

What library could be missing on my operating system?

I appears after an update of my operating system I think.

I am on Archlinux.

Julien









Re: [Pharo-users] SSL/TLS plugin initailization failed (VM plugin missing ? OS libraries missing ?)

2017-05-08 Thread Julien Delplanque

Thank you,

Apparently I have one library missing:

ldd /usr/share/pharo/vm/libSqueakSSL.so
linux-gate.so.1 (0xf77bb000)
libssl.so.1.0.0 => not found
libc.so.6 => /usr/lib32/libc.so.6 (0xf75ab000)
/usr/lib/ld-linux.so.2 (0x565a9000)

I'll try to fix this. But I guess other people on Arch will encounter 
this problem.


Julien




[Pharo-users] SSL/TLS plugin initailization failed (VM plugin missing ? OS libraries missing ?)

2017-05-08 Thread Julien Delplanque

Hello,

I have this error when trying to use the network:

"SSL/TLS plugin initialization failed (VM plugin missing ? OS libraries 
missing ?)"


What library could be missing on my operating system?

I appears after an update of my operating system I think.

I am on Archlinux.

Julien




Re: [Pharo-users] Smalltalk syntactic coloration in Spec's TextModel

2017-05-04 Thread Julien Delplanque

Thanks, it works perfectly.

Julien


On 04/05/17 13:11, Nicolai Hess wrote:

2017-05-04 12:53 GMT+02:00 Julien Delplanque :


Thanks, it works.

Another question: Is it possible to manage the fact that the
code displayed is a method? (ie not having the selector and
instance variables causing the syntactic coloration to be
red)


Yes, setting the behavior (class of the method):

TextModel new
 isForSmalltalkCode: true;
 text: (Collection>>#anyOne) sourceCode;
 aboutToStyle: true;
 behavior: (Collection>>#anyOne) methodClass;
 openWithSpec



Thanks in advance,

Julien



On 03/05/17 17:09, Nicolai Hess wrote:


2017-05-03 16:57 GMT+02:00 Julien Delplanque :

Hello,

I looked in the mailing list archive but did not found an answer.

Is there any way to have Smalltalk syntactic coloration in a TextModel
without having to put efforts in it?

I mean, if I do:

TextModel new
  isForSmalltalkCode: true;
  text: (Collection>>#any) sourceCode;
  openWithSpec

The text displayed is black.

Thanks in advance,

Julien



Hi,

you need to add
aboutToStyle:true



TextModel new
  isForSmalltalkCode: true;
  text: (Collection>>#anyOne) sourceCode;
  aboutToStyle: true;
  openWithSpec









Re: [Pharo-users] Smalltalk syntactic coloration in Spec's TextModel

2017-05-04 Thread Julien Delplanque

Thanks, it works.

Another question: Is it possible to manage the fact that the
code displayed is a method? (ie not having the selector and
instance variables causing the syntactic coloration to be
red)

Thanks in advance,

Julien


On 03/05/17 17:09, Nicolai Hess wrote:

2017-05-03 16:57 GMT+02:00 Julien Delplanque :


Hello,

I looked in the mailing list archive but did not found an answer.

Is there any way to have Smalltalk syntactic coloration in a TextModel
without having to put efforts in it?

I mean, if I do:

TextModel new
 isForSmalltalkCode: true;
 text: (Collection>>#any) sourceCode;
 openWithSpec

The text displayed is black.

Thanks in advance,

Julien




Hi,
you need to add
aboutToStyle:true



TextModel new
 isForSmalltalkCode: true;
 text: (Collection>>#anyOne) sourceCode;
 aboutToStyle: true;
 openWithSpec






[Pharo-users] Smalltalk syntactic coloration in Spec's TextModel

2017-05-03 Thread Julien Delplanque

Hello,

I looked in the mailing list archive but did not found an answer.

Is there any way to have Smalltalk syntactic coloration in a TextModel
without having to put efforts in it?

I mean, if I do:

TextModel new
isForSmalltalkCode: true;
text: (Collection>>#any) sourceCode;
openWithSpec

The text displayed is black.

Thanks in advance,

Julien




Re: [Pharo-users] [ANN] Animation package

2016-11-23 Thread Julien Delplanque

Hello,

Cool, I'll give a try to add animations to my windows switcher (Mirage [1]).

Julien

Links:
[1]: https://github.com/juliendelplanque/Mirage

On 23/11/16 11:49, Thibault Raffaillac wrote:

Hello,

I am happy to release the Animation package at last! 
http://smalltalkhub.com/#!/~ThibaultRaffaillac/Animation
This is a general animation system, which can turn any setter message into a 
smooth transition (provided the target value supports + and *Float).

Examples:
AnimationProperty new at: morph set: #position: to: 100@100 during: 2 seconds 
easing: #backOut.
AnimationProperty new at: morph set: #color: to: Color red during: 2 seconds 
easing: #linear.
AnimationProperty new at: morph set: #title: to: 'tutututu' during: 2 seconds 
easing: #linear.

Or equivalently (don't choke):
morph position: (100@100 during: 2 seconds easing: #backOut).
morph color: (Color red during: 2 seconds).
morph title: ('tutututu' during: 2 seconds).

It basically sends the setter message repeatedly during the target delay, each 
time with a slightly different value. It should also work with Bloc, although 
the update mechanism depends on Morphic's deferredUIMessage at the moment.

Cheers,
Thibault

ps: Thanks to anonymous contributor for the second syntax, it was a lot of fun 
- and evil laughs :)






Re: [Pharo-users] Improving comments cool action

2016-11-20 Thread Julien Delplanque

Great, I'll do it next time it happens to me.

Julien


On 20/11/16 18:36, stepharo wrote:



Le 20/11/16 à 17:36, Julien Delplanque a écrit :

Hello,

I may be able to help, it already happens to me to see a
comment that I could improve but I don't take the time...

Thanks this is important.


If someone wants to help, how can he publish his modifications?
Do he needs to open an issue and suggest a slice directly?

Yes


Regards,

Julien

On 20/11/16 17:26, stepharo wrote:

Hi guys

I would like to see how we could build a concerted action to improve 
the class and method comments in Pharo.


Now we have package comments :) so we should take also advantage of 
them.


I would love that a newbie is highlithed by class comments.

So I would like to start to comment key core classes.

I'm sure that if we all spend 30 min per week we can really have a 
huge impact.


I was planning to start with collection classes.

Now let me know if you want to help.

Stef














Re: [Pharo-users] Improving comments cool action

2016-11-20 Thread Julien Delplanque

Hello,

I may be able to help, it already happens to me to see a
comment that I could improve but I don't take the time...

If someone wants to help, how can he publish his modifications?
Do he needs to open an issue and suggest a slice directly?

Regards,

Julien

On 20/11/16 17:26, stepharo wrote:

Hi guys

I would like to see how we could build a concerted action to improve 
the class and method comments in Pharo.


Now we have package comments :) so we should take also advantage of them.

I would love that a newbie is highlithed by class comments.

So I would like to start to comment key core classes.

I'm sure that if we all spend 30 min per week we can really have a 
huge impact.


I was planning to start with collection classes.

Now let me know if you want to help.

Stef







Re: [Pharo-users] Chip-8

2016-11-16 Thread Julien Delplanque

Wow it would be a fun project!

I know there was GameBoy [1] emulator but I don't know if it is still 
working.


Julien

Links:

[1]: http://smalltalkhub.com/#!/~jeanbaptistearnaud/GameBoyEmulator


On 16/11/16 11:21, olivier auverlot wrote:

Hi,

I just read an fun article about Chip-8. Someone has worked on an emulator
of this with Pharo?

http://www.multigesture.net/articles/how-to-write-an-emulator-chip-8-interpreter/
http://miguelduarte.pt/2012/07/09/chip-8-emulator-in-javascript/

Best regards






Re: [Pharo-users] CodeGenerator, your opinions?

2016-10-18 Thread Julien Delplanque

Hello,

A generator for the visitor design pattern:
- Generate methods in visited objects: VisitedObject>>#accept: (with the 
selector name configurable)
- Generate empty methods (or methods with a "self 
subclassResponsability" if an abstract visitor is generated)
called in #accept: methods of VisitedObjects in the Visitor i.e 
Visitor>>#acceptVisitedObject: (with the selector

name configurable again).

Each time this design pattern has to be used, it is annoying to write by 
hand all these methods.


Regards,

Julien

On 18/10/16 07:24, Hernán Morales Durand wrote:

Hi guys,

I am writing a code generator, doing a few iterations right now.
I want your opinion, which most useful thing would you like to be generated
automatically? It could be a pattern, an idiom, another language...

For example my own wish (roadmap) list:

- A "settings framework" settings class generator.
- A state machine generator (based in the excellent paper of Trevor P.
Hopkins)
- A Spec UI generator.

Let me know your thoughts.

Cheers,

Hernán






Re: [Pharo-users] Questions

2016-07-28 Thread Julien Delplanque

Hello,

Have a look at "NeoCSV" project from the catalog browser.

This document [1] may help you as well. There is a dedicated section for 
NeoCSV.


Regards,
Julien

Links:
[1]: 
http://www.slideshare.net/philippeback/pharo-days-2016-data-formats-and-protocols



On 28/07/16 08:30, Alejandro Adgi Romano wrote:

Hello, my name is Alejandro.

I´m writting code in Pharo 5.0.

I need finish an exercise of my career.

My question is:

¿Could you tell me how can read and write a CSV File?

I need the code, because i don´t understand how is the use of NeoCSV or
another tool for this.

In the exercise, the text says:
"You must Show the CashFlow por One Period with information from
CashFlow.csv"


¿How can I do this?

Thanks!!!






[Pharo-users] State of Pharo in comparison with the "Pharo vision" document

2016-07-19 Thread Julien Delplanque

Hello everyone,

For a university project I need to write a little about Pharo.
I found the "Pharo vision" document [1] and I am curious about
the actual state of Pharo in comparison with it.

I have seen some things on the mailing list but I would like some
help to gather the state of each goal described in "Pharo vision"
version 1.0.

I made a list with the goals and wrote some of the (little) knowledge I
have about some elements (I also joined it to this mail in case it is not
readable):

Goals -> State
---
1.  Creation of the Pharo Consortium -> Created
2.  Small kernel & validated packages -> ?
3.  A Robust and Extensible System Events -> ?
4.  Rewrite of Filesystem/Streams -> ?/XStream?
5.  Announcements and Ephemerons -> ?
6.  UI Canvas for Zoomable Interfaces -> Bloc?
7.  Bootstrap of the Core -> ?
8.  Fully parametrized compiler tool chain -> ?
9.  Packages as real objects -> ?
10. Package Meta-Data -> PackageManifest?
11. Less Model Clutter and Duplication -> ?
12. Building and Reusing UI Logic -> Spec?
13. New Network Layer -> ?
14. Serializers -> Fuel
15. SystemChangeNotifier replacement -> ?
16. Cleaning Morphic -> Still valid? (asking because of Bloc existance)
17. Everybody should be able to compile VMs -> ?
18. VMs identification and regression testing -> ?
19. One Unified FFI framework -> Created and still being enhanced
20. 64 Bits -> I saw the screenshot on Twitter but what is the state now?
21. New Object Formats -> ?

If some of you know the state of one or many of these project and have the
time to give me some information about it/them, I would be really grateful.

Thanks in advance,

Julien

Links:
[1]: https://gforge.inria.fr/frs/download.php/30434/PharoVision.pdf
Goals | State

1.  Creation of the Pharo Consortium  | Created
2.  Small kernel & validated packages | ?
3.  A Robust and Extensible System Events | ?
4.  Rewrite of Filesystem/Streams | ?/XStream?
5.  Announcements and Ephemerons  | ?
6.  UI Canvas for Zoomable Interfaces | Bloc?
7.  Bootstrap of the Core | ?
8.  Fully parametrized compiler tool chain| ?
9.  Packages as real objects  | ?
10. Package Meta-Data | PackageManifest?
11. Less Model Clutter and Duplication| ?
12. Building and Reusing UI Logic | Spec?
13. New Network Layer | ?
14. Serializers   | Fuel
15. SystemChangeNotifier replacement  | ?
16. Cleaning Morphic  | Still valid? (asking because of 
Bloc existance)
17. Everybody should be able to compile VMs   | ?
18. VMs identification and regression testing | ?
19. One Unified FFI framework | Created
20. 64 Bits   | ?
21. New Object Formats| ?


Re: [Pharo-users] [UFFI] Getting an array of opaque structures filled

2016-07-04 Thread Julien Delplanque

Ok, the problem is resolved thanks to Esteban.

There was a mistake in the code given in preceding mails so, I am 
rewriting the 3 steps here:


===

1) Declare your class that subclasses FFIOpaqueObject:


FFIOpaqueObject subclass: USBDevice
etc...

2) Get a pointer to the array:

arrayPtr := ExternalAddress new.
size := self getDevice: context list: arrayPtr.

with:

getDevice: ctx list: list
^ self ffiCall: #(size_t libusb_get_device_list (libusb_context 
*ctx, void **list))


3) Now that we have the size of the array, we can declare it:

array := FFIExternalArray fromHandle: arrayPtr type: USBDevice size: size.

===

The problem was that I was using #fromPointer:type:size instead of 
#fromHandle:type:size:.


Thanks again Esteban!

Julien

On 04/07/16 13:15, Julien Delplanque wrote:



On 04/07/16 12:18, Ben Coman wrote:
On Mon, Jul 4, 2016 at 4:24 PM, Julien Delplanque  
wrote:

Hello again Esteban, all others,

I am still experiencing strange behaviors with the objects in the 
external

array.

I get a lot of NULL pointers and some strange addresses (I guess, I 
am not a

C expert) that are close to NULL
(see the screenshot attached). These objects make the VM crash 
(segmentation

fault) when I call a function
from the libusb binding (for NULL objects it may be ok but what about
others?). Some other objects (those with
a normal address in the screenshot) work finely with the functions 
calls

using UFFI...

This kind of bug is not reported in libusb discussions I found on the
internet and I tried an example in C,
there is no NULL pointer received from the function (they are not even
considered in official examples).

So I guess the problem may come from Pharo?

Do you have any idea of what it could be?

I will be available on Slack all the day if you want. :)

Thanks in advance,

Julien


On Mon, Jul 4, 2016 at 6:15 PM, Ben Coman  wrote:

How does it compare with the result you get in pure C?
e.g. using this code...
http://libusb.org/browser/libusb/examples/lsusb.c?rev=efc29733ad31f81883a7ac51a6cc6cda9ad4feb9&order=name 




Also, what is the return value of calling libusb_init() from Pharo?

cheers -ben


In pure C, it works. All my device are listed with the code at the 
link you gave me (so there is no NULL pointer).


In Pharo,  libusb_init() returns 0 as expected.

Julien




Re: [Pharo-users] [UFFI] Getting an array of opaque structures filled

2016-07-04 Thread Julien Delplanque



On 04/07/16 12:18, Ben Coman wrote:

On Mon, Jul 4, 2016 at 4:24 PM, Julien Delplanque  wrote:

Hello again Esteban, all others,

I am still experiencing strange behaviors with the objects in the external
array.

I get a lot of NULL pointers and some strange addresses (I guess, I am not a
C expert) that are close to NULL
(see the screenshot attached). These objects make the VM crash (segmentation
fault) when I call a function
from the libusb binding (for NULL objects it may be ok but what about
others?). Some other objects (those with
a normal address in the screenshot) work finely with the functions calls
using UFFI...

This kind of bug is not reported in libusb discussions I found on the
internet and I tried an example in C,
there is no NULL pointer received from the function (they are not even
considered in official examples).

So I guess the problem may come from Pharo?

Do you have any idea of what it could be?

I will be available on Slack all the day if you want. :)

Thanks in advance,

Julien


On Mon, Jul 4, 2016 at 6:15 PM, Ben Coman  wrote:

How does it compare with the result you get in pure C?
e.g. using this code...
http://libusb.org/browser/libusb/examples/lsusb.c?rev=efc29733ad31f81883a7ac51a6cc6cda9ad4feb9&order=name


Also, what is the return value of calling libusb_init() from Pharo?

cheers -ben


In pure C, it works. All my device are listed with the code at the link 
you gave me (so there is no NULL pointer).


In Pharo,  libusb_init() returns 0 as expected.

Julien



Re: [Pharo-users] [UFFI] Getting an array of opaque structures filled

2016-07-04 Thread Julien Delplanque

Hello again Esteban, all others,

I am still experiencing strange behaviors with the objects in the 
external array.


I get a lot of NULL pointers and some strange addresses (I guess, I am 
not a C expert) that are close to NULL
(see the screenshot attached). These objects make the VM crash 
(segmentation fault) when I call a function
from the libusb binding (for NULL objects it may be ok but what about 
others?). Some other objects (those with
a normal address in the screenshot) work finely with the functions calls 
using UFFI...


This kind of bug is not reported in libusb discussions I found on the 
internet and I tried an example in C,
there is no NULL pointer received from the function (they are not even 
considered in official examples).


So I guess the problem may come from Pharo?

Do you have any idea of what it could be?

I will be available on Slack all the day if you want. :)

Thanks in advance,

Julien

On 01/07/16 14:03, Esteban Lorenzano wrote:

ok, can you reload development version and try again?

ps: this is easier on slack ;)


On 01 Jul 2016, at 14:00, Esteban Lorenzano  wrote:

yes, I made a mistake… the problem of not being capable of test here :(

1 minute.

Esteban


On 01 Jul 2016, at 13:56, Julien Delplanque  wrote:

Ok, now I get a different exception! :-)

"MessageNotUnderstood: LUDevice class>>fromHandle:"

when executing: "array first."

Where LUDevice is defined like this:

FFIOpaqueObject subclass: #LUDevice
   instanceVariableNames: ''
   classVariableNames: ''
   package: 'LibUsb-Kernel'

Julien


On 01/07/16 13:51, Esteban Lorenzano wrote:

I need  you to test :)

can you execute this:

(ConfigurationOfUnifiedFFI project version: #development) load.

and then retry your example?

thanks,
Esteban

ps: this became pharo-dev, but well… still here :)


On 01 Jul 2016, at 13:48, Julien Delplanque  wrote:

Oh, ok :p

Can you notify me know when the bug will be resolved?

Thanks,

Julien


On 01/07/16 13:36, Esteban Lorenzano wrote:

… and now you hit a bug.
bah, an “non implemented feature” :P

I never tested arrays with complex types.
it should not be hard… I will provide a fix.

Esteban



On 01 Jul 2016, at 13:30, Julien Delplanque  wrote:

Ok, the ffi call is done without problem with your method thanks. :)

But now that I have the array, when I try to access the first element using:

array first.

I get a exception saying I need to override a method:

"SubclassResponsibility: FFIOpaqueObjectType had the subclass responsibility to 
implement #basicHandle:at:"

I looked at others implementors but I am not sure of how I should override it, 
nor if I should.

Thanks for the time your taking to answer me. :-)

Julien

On 01/07/16 12:29, Esteban Lorenzano wrote:

On 01 Jul 2016, at 12:27, Esteban Lorenzano  wrote:

hi,

this is because you want to get an array with opaque objects. Do not let the 
*** confuses you… cwhat you actually want, conceptually is something like this:

*((FFIOpaqueObject*)[])

means: you pass the address of an array of opaque types (who are always 
pointers).

So, what you need to pass is the address of an array… you will need to work a 
bit here, since translation is not automatic.

1) you need to declare your type. Let’ say it will be:

FFIOpaqueObject subclass: USBDevice.

2) then you need to get the pointer to this array. You need to rewrite you code 
as this:

arrayPtr := ExternalAddress new.
size := self getDevice: ctx list: arrayPtr.

getDevice: ctx list: list
^ self ffiCall: #(size_t libusb_get_device_list (libusb_context *ctx, 
void **list))

NOTE that we change the type to "void **”. This is because this is what you 
actually want: the array of devices

3) now you will have size and arrayPtr. Then you declare the array:

array := FFIExternalArray fromPointer: arrayPtr type: USBDevice

sorry, this expression (while possible) does not stops in “size”… it has to be 
like this, instead:

array := FFIExternalArray fromPointer: arrayPtr type: USBDevice size: size. “you 
already has the size for the result"


… and you should be able to iterate this array normally :)

let me know if this works for you… I’m “coding in mail client”, so it can fail 
:P

cheers,
Esteban



On 01 Jul 2016, at 12:02, Julien Delplanque  wrote:

Thanks, it works I get an instance of FFIOpaqueObject.

But how do I get a specific  libusb_device object from the list?

Thanks again for you quick answer :-).

Julien

On 01/07/16 11:44, Esteban Lorenzano wrote:

Hi,

an opaque structure is not an FFIExternalObject but an FFIOpaqueObject.
in that case, something like (simplified):

ctx := (your context).
list := FFIOpaqueObject new.
size := self getDevice: ctx list: list.

getDevice: ctx list: list
^ self ffiCall: #(size_t libusb_get_device_list (libusb_context *ctx, 
FFIOpaqueObject ***list))

should work (note that of course you can make libusb_device an alias for your 
type… that does n

Re: [Pharo-users] [UFFI] Getting an array of opaque structures filled

2016-07-01 Thread Julien Delplanque

And it works!

Thanks a lot!

Yes I should join slack, do I need an invitation or something?

Julien


On 01/07/16 14:03, Esteban Lorenzano wrote:

ok, can you reload development version and try again?

ps: this is easier on slack ;)


On 01 Jul 2016, at 14:00, Esteban Lorenzano  wrote:

yes, I made a mistake… the problem of not being capable of test here :(

1 minute.

Esteban


On 01 Jul 2016, at 13:56, Julien Delplanque  wrote:

Ok, now I get a different exception! :-)

"MessageNotUnderstood: LUDevice class>>fromHandle:"

when executing: "array first."

Where LUDevice is defined like this:

FFIOpaqueObject subclass: #LUDevice
   instanceVariableNames: ''
   classVariableNames: ''
   package: 'LibUsb-Kernel'

Julien


On 01/07/16 13:51, Esteban Lorenzano wrote:

I need  you to test :)

can you execute this:

(ConfigurationOfUnifiedFFI project version: #development) load.

and then retry your example?

thanks,
Esteban

ps: this became pharo-dev, but well… still here :)


On 01 Jul 2016, at 13:48, Julien Delplanque  wrote:

Oh, ok :p

Can you notify me know when the bug will be resolved?

Thanks,

Julien


On 01/07/16 13:36, Esteban Lorenzano wrote:

… and now you hit a bug.
bah, an “non implemented feature” :P

I never tested arrays with complex types.
it should not be hard… I will provide a fix.

Esteban



On 01 Jul 2016, at 13:30, Julien Delplanque  wrote:

Ok, the ffi call is done without problem with your method thanks. :)

But now that I have the array, when I try to access the first element using:

array first.

I get a exception saying I need to override a method:

"SubclassResponsibility: FFIOpaqueObjectType had the subclass responsibility to 
implement #basicHandle:at:"

I looked at others implementors but I am not sure of how I should override it, 
nor if I should.

Thanks for the time your taking to answer me. :-)

Julien

On 01/07/16 12:29, Esteban Lorenzano wrote:

On 01 Jul 2016, at 12:27, Esteban Lorenzano  wrote:

hi,

this is because you want to get an array with opaque objects. Do not let the 
*** confuses you… cwhat you actually want, conceptually is something like this:

*((FFIOpaqueObject*)[])

means: you pass the address of an array of opaque types (who are always 
pointers).

So, what you need to pass is the address of an array… you will need to work a 
bit here, since translation is not automatic.

1) you need to declare your type. Let’ say it will be:

FFIOpaqueObject subclass: USBDevice.

2) then you need to get the pointer to this array. You need to rewrite you code 
as this:

arrayPtr := ExternalAddress new.
size := self getDevice: ctx list: arrayPtr.

getDevice: ctx list: list
^ self ffiCall: #(size_t libusb_get_device_list (libusb_context *ctx, 
void **list))

NOTE that we change the type to "void **”. This is because this is what you 
actually want: the array of devices

3) now you will have size and arrayPtr. Then you declare the array:

array := FFIExternalArray fromPointer: arrayPtr type: USBDevice

sorry, this expression (while possible) does not stops in “size”… it has to be 
like this, instead:

array := FFIExternalArray fromPointer: arrayPtr type: USBDevice size: size. “you 
already has the size for the result"


… and you should be able to iterate this array normally :)

let me know if this works for you… I’m “coding in mail client”, so it can fail 
:P

cheers,
Esteban



On 01 Jul 2016, at 12:02, Julien Delplanque  wrote:

Thanks, it works I get an instance of FFIOpaqueObject.

But how do I get a specific  libusb_device object from the list?

Thanks again for you quick answer :-).

Julien

On 01/07/16 11:44, Esteban Lorenzano wrote:

Hi,

an opaque structure is not an FFIExternalObject but an FFIOpaqueObject.
in that case, something like (simplified):

ctx := (your context).
list := FFIOpaqueObject new.
size := self getDevice: ctx list: list.

getDevice: ctx list: list
^ self ffiCall: #(size_t libusb_get_device_list (libusb_context *ctx, 
FFIOpaqueObject ***list))

should work (note that of course you can make libusb_device an alias for your 
type… that does not matters much, this is just a simplification).

if this does not works, if you can provide me code to reproduce it, I can give 
it a shot and see what happens :)

Esteban


On 01 Jul 2016, at 11:19, Julien Delplanque  wrote:

Hello everyone,

I have a question about the UFFI API. I have the following function:

ssize_t libusb_get_device_list (libusb_context *ctx, libusb_device ***list)

where libusb_device is an opaque structure.

I made a type mapping "ssize_t" -> "int" and an object inheriting
from FFIExternalObject for the "libusb_context" (others methods
using it are working).

I can not find how to get an array filled with libusb_device using UFFI from 
Pharo. :-(

Thanks in advance,

Julien










Re: [Pharo-users] [UFFI] Getting an array of opaque structures filled

2016-07-01 Thread Julien Delplanque

No problem, give me as much version(s) to test as you want. :p

Julien


On 01/07/16 14:00, Esteban Lorenzano wrote:

yes, I made a mistake… the problem of not being capable of test here :(

1 minute.

Esteban


On 01 Jul 2016, at 13:56, Julien Delplanque  wrote:

Ok, now I get a different exception! :-)

"MessageNotUnderstood: LUDevice class>>fromHandle:"

when executing: "array first."

Where LUDevice is defined like this:

FFIOpaqueObject subclass: #LUDevice
instanceVariableNames: ''
classVariableNames: ''
package: 'LibUsb-Kernel'

Julien


On 01/07/16 13:51, Esteban Lorenzano wrote:

I need  you to test :)

can you execute this:

(ConfigurationOfUnifiedFFI project version: #development) load.

and then retry your example?

thanks,
Esteban

ps: this became pharo-dev, but well… still here :)


On 01 Jul 2016, at 13:48, Julien Delplanque  wrote:

Oh, ok :p

Can you notify me know when the bug will be resolved?

Thanks,

Julien


On 01/07/16 13:36, Esteban Lorenzano wrote:

… and now you hit a bug.
bah, an “non implemented feature” :P

I never tested arrays with complex types.
it should not be hard… I will provide a fix.

Esteban



On 01 Jul 2016, at 13:30, Julien Delplanque  wrote:

Ok, the ffi call is done without problem with your method thanks. :)

But now that I have the array, when I try to access the first element using:

array first.

I get a exception saying I need to override a method:

"SubclassResponsibility: FFIOpaqueObjectType had the subclass responsibility to 
implement #basicHandle:at:"

I looked at others implementors but I am not sure of how I should override it, 
nor if I should.

Thanks for the time your taking to answer me. :-)

Julien

On 01/07/16 12:29, Esteban Lorenzano wrote:

On 01 Jul 2016, at 12:27, Esteban Lorenzano  wrote:

hi,

this is because you want to get an array with opaque objects. Do not let the 
*** confuses you… cwhat you actually want, conceptually is something like this:

*((FFIOpaqueObject*)[])

means: you pass the address of an array of opaque types (who are always 
pointers).

So, what you need to pass is the address of an array… you will need to work a 
bit here, since translation is not automatic.

1) you need to declare your type. Let’ say it will be:

FFIOpaqueObject subclass: USBDevice.

2) then you need to get the pointer to this array. You need to rewrite you code 
as this:

arrayPtr := ExternalAddress new.
size := self getDevice: ctx list: arrayPtr.

getDevice: ctx list: list
^ self ffiCall: #(size_t libusb_get_device_list (libusb_context *ctx, 
void **list))

NOTE that we change the type to "void **”. This is because this is what you 
actually want: the array of devices

3) now you will have size and arrayPtr. Then you declare the array:

array := FFIExternalArray fromPointer: arrayPtr type: USBDevice

sorry, this expression (while possible) does not stops in “size”… it has to be 
like this, instead:

array := FFIExternalArray fromPointer: arrayPtr type: USBDevice size: size. “you 
already has the size for the result"


… and you should be able to iterate this array normally :)

let me know if this works for you… I’m “coding in mail client”, so it can fail 
:P

cheers,
Esteban



On 01 Jul 2016, at 12:02, Julien Delplanque  wrote:

Thanks, it works I get an instance of FFIOpaqueObject.

But how do I get a specific  libusb_device object from the list?

Thanks again for you quick answer :-).

Julien

On 01/07/16 11:44, Esteban Lorenzano wrote:

Hi,

an opaque structure is not an FFIExternalObject but an FFIOpaqueObject.
in that case, something like (simplified):

ctx := (your context).
list := FFIOpaqueObject new.
size := self getDevice: ctx list: list.

getDevice: ctx list: list
^ self ffiCall: #(size_t libusb_get_device_list (libusb_context *ctx, 
FFIOpaqueObject ***list))

should work (note that of course you can make libusb_device an alias for your 
type… that does not matters much, this is just a simplification).

if this does not works, if you can provide me code to reproduce it, I can give 
it a shot and see what happens :)

Esteban


On 01 Jul 2016, at 11:19, Julien Delplanque  wrote:

Hello everyone,

I have a question about the UFFI API. I have the following function:

ssize_t libusb_get_device_list (libusb_context *ctx, libusb_device ***list)

where libusb_device is an opaque structure.

I made a type mapping "ssize_t" -> "int" and an object inheriting
from FFIExternalObject for the "libusb_context" (others methods
using it are working).

I can not find how to get an array filled with libusb_device using UFFI from 
Pharo. :-(

Thanks in advance,

Julien










Re: [Pharo-users] [UFFI] Getting an array of opaque structures filled

2016-07-01 Thread Julien Delplanque

Ok, now I get a different exception! :-)

"MessageNotUnderstood: LUDevice class>>fromHandle:"

when executing: "array first."

Where LUDevice is defined like this:

FFIOpaqueObject subclass: #LUDevice
instanceVariableNames: ''
classVariableNames: ''
package: 'LibUsb-Kernel'

Julien


On 01/07/16 13:51, Esteban Lorenzano wrote:

I need  you to test :)

can you execute this:

(ConfigurationOfUnifiedFFI project version: #development) load.

and then retry your example?

thanks,
Esteban

ps: this became pharo-dev, but well… still here :)


On 01 Jul 2016, at 13:48, Julien Delplanque  wrote:

Oh, ok :p

Can you notify me know when the bug will be resolved?

Thanks,

Julien


On 01/07/16 13:36, Esteban Lorenzano wrote:

… and now you hit a bug.
bah, an “non implemented feature” :P

I never tested arrays with complex types.
it should not be hard… I will provide a fix.

Esteban



On 01 Jul 2016, at 13:30, Julien Delplanque  wrote:

Ok, the ffi call is done without problem with your method thanks. :)

But now that I have the array, when I try to access the first element using:

array first.

I get a exception saying I need to override a method:

"SubclassResponsibility: FFIOpaqueObjectType had the subclass responsibility to 
implement #basicHandle:at:"

I looked at others implementors but I am not sure of how I should override it, 
nor if I should.

Thanks for the time your taking to answer me. :-)

Julien

On 01/07/16 12:29, Esteban Lorenzano wrote:

On 01 Jul 2016, at 12:27, Esteban Lorenzano  wrote:

hi,

this is because you want to get an array with opaque objects. Do not let the 
*** confuses you… cwhat you actually want, conceptually is something like this:

*((FFIOpaqueObject*)[])

means: you pass the address of an array of opaque types (who are always 
pointers).

So, what you need to pass is the address of an array… you will need to work a 
bit here, since translation is not automatic.

1) you need to declare your type. Let’ say it will be:

FFIOpaqueObject subclass: USBDevice.

2) then you need to get the pointer to this array. You need to rewrite you code 
as this:

arrayPtr := ExternalAddress new.
size := self getDevice: ctx list: arrayPtr.

getDevice: ctx list: list
^ self ffiCall: #(size_t libusb_get_device_list (libusb_context *ctx, 
void **list))

NOTE that we change the type to "void **”. This is because this is what you 
actually want: the array of devices

3) now you will have size and arrayPtr. Then you declare the array:

array := FFIExternalArray fromPointer: arrayPtr type: USBDevice

sorry, this expression (while possible) does not stops in “size”… it has to be 
like this, instead:

array := FFIExternalArray fromPointer: arrayPtr type: USBDevice size: size. “you 
already has the size for the result"


… and you should be able to iterate this array normally :)

let me know if this works for you… I’m “coding in mail client”, so it can fail 
:P

cheers,
Esteban



On 01 Jul 2016, at 12:02, Julien Delplanque  wrote:

Thanks, it works I get an instance of FFIOpaqueObject.

But how do I get a specific  libusb_device object from the list?

Thanks again for you quick answer :-).

Julien

On 01/07/16 11:44, Esteban Lorenzano wrote:

Hi,

an opaque structure is not an FFIExternalObject but an FFIOpaqueObject.
in that case, something like (simplified):

ctx := (your context).
list := FFIOpaqueObject new.
size := self getDevice: ctx list: list.

getDevice: ctx list: list
^ self ffiCall: #(size_t libusb_get_device_list (libusb_context *ctx, 
FFIOpaqueObject ***list))

should work (note that of course you can make libusb_device an alias for your 
type… that does not matters much, this is just a simplification).

if this does not works, if you can provide me code to reproduce it, I can give 
it a shot and see what happens :)

Esteban


On 01 Jul 2016, at 11:19, Julien Delplanque  wrote:

Hello everyone,

I have a question about the UFFI API. I have the following function:

ssize_t libusb_get_device_list (libusb_context *ctx, libusb_device ***list)

where libusb_device is an opaque structure.

I made a type mapping "ssize_t" -> "int" and an object inheriting
from FFIExternalObject for the "libusb_context" (others methods
using it are working).

I can not find how to get an array filled with libusb_device using UFFI from 
Pharo. :-(

Thanks in advance,

Julien










Re: [Pharo-users] [UFFI] Getting an array of opaque structures filled

2016-07-01 Thread Julien Delplanque

Oh, ok :p

Can you notify me know when the bug will be resolved?

Thanks,

Julien


On 01/07/16 13:36, Esteban Lorenzano wrote:

… and now you hit a bug.
bah, an “non implemented feature” :P

I never tested arrays with complex types.
it should not be hard… I will provide a fix.

Esteban



On 01 Jul 2016, at 13:30, Julien Delplanque  wrote:

Ok, the ffi call is done without problem with your method thanks. :)

But now that I have the array, when I try to access the first element using:

array first.

I get a exception saying I need to override a method:

"SubclassResponsibility: FFIOpaqueObjectType had the subclass responsibility to 
implement #basicHandle:at:"

I looked at others implementors but I am not sure of how I should override it, 
nor if I should.

Thanks for the time your taking to answer me. :-)

Julien

On 01/07/16 12:29, Esteban Lorenzano wrote:

On 01 Jul 2016, at 12:27, Esteban Lorenzano  wrote:

hi,

this is because you want to get an array with opaque objects. Do not let the 
*** confuses you… cwhat you actually want, conceptually is something like this:

*((FFIOpaqueObject*)[])

means: you pass the address of an array of opaque types (who are always 
pointers).

So, what you need to pass is the address of an array… you will need to work a 
bit here, since translation is not automatic.

1) you need to declare your type. Let’ say it will be:

FFIOpaqueObject subclass: USBDevice.

2) then you need to get the pointer to this array. You need to rewrite you code 
as this:

arrayPtr := ExternalAddress new.
size := self getDevice: ctx list: arrayPtr.

getDevice: ctx list: list
^ self ffiCall: #(size_t libusb_get_device_list (libusb_context *ctx, 
void **list))

NOTE that we change the type to "void **”. This is because this is what you 
actually want: the array of devices

3) now you will have size and arrayPtr. Then you declare the array:

array := FFIExternalArray fromPointer: arrayPtr type: USBDevice

sorry, this expression (while possible) does not stops in “size”… it has to be 
like this, instead:

array := FFIExternalArray fromPointer: arrayPtr type: USBDevice size: size. “you 
already has the size for the result"


… and you should be able to iterate this array normally :)

let me know if this works for you… I’m “coding in mail client”, so it can fail 
:P

cheers,
Esteban



On 01 Jul 2016, at 12:02, Julien Delplanque  wrote:

Thanks, it works I get an instance of FFIOpaqueObject.

But how do I get a specific  libusb_device object from the list?

Thanks again for you quick answer :-).

Julien

On 01/07/16 11:44, Esteban Lorenzano wrote:

Hi,

an opaque structure is not an FFIExternalObject but an FFIOpaqueObject.
in that case, something like (simplified):

ctx := (your context).
list := FFIOpaqueObject new.
size := self getDevice: ctx list: list.

getDevice: ctx list: list
^ self ffiCall: #(size_t libusb_get_device_list (libusb_context *ctx, 
FFIOpaqueObject ***list))

should work (note that of course you can make libusb_device an alias for your 
type… that does not matters much, this is just a simplification).

if this does not works, if you can provide me code to reproduce it, I can give 
it a shot and see what happens :)

Esteban


On 01 Jul 2016, at 11:19, Julien Delplanque  wrote:

Hello everyone,

I have a question about the UFFI API. I have the following function:

ssize_t libusb_get_device_list (libusb_context *ctx, libusb_device ***list)

where libusb_device is an opaque structure.

I made a type mapping "ssize_t" -> "int" and an object inheriting
from FFIExternalObject for the "libusb_context" (others methods
using it are working).

I can not find how to get an array filled with libusb_device using UFFI from 
Pharo. :-(

Thanks in advance,

Julien










Re: [Pharo-users] [UFFI] Getting an array of opaque structures filled

2016-07-01 Thread Julien Delplanque

Ok, the ffi call is done without problem with your method thanks. :)

But now that I have the array, when I try to access the first element using:

array first.

I get a exception saying I need to override a method:

"SubclassResponsibility: FFIOpaqueObjectType had the subclass 
responsibility to implement #basicHandle:at:"


I looked at others implementors but I am not sure of how I should 
override it, nor if I should.


Thanks for the time your taking to answer me. :-)

Julien

On 01/07/16 12:29, Esteban Lorenzano wrote:

On 01 Jul 2016, at 12:27, Esteban Lorenzano  wrote:

hi,

this is because you want to get an array with opaque objects. Do not let the 
*** confuses you… cwhat you actually want, conceptually is something like this:

*((FFIOpaqueObject*)[])

means: you pass the address of an array of opaque types (who are always 
pointers).

So, what you need to pass is the address of an array… you will need to work a 
bit here, since translation is not automatic.

1) you need to declare your type. Let’ say it will be:

FFIOpaqueObject subclass: USBDevice.

2) then you need to get the pointer to this array. You need to rewrite you code 
as this:

arrayPtr := ExternalAddress new.
size := self getDevice: ctx list: arrayPtr.

getDevice: ctx list: list
^ self ffiCall: #(size_t libusb_get_device_list (libusb_context *ctx, 
void **list))

NOTE that we change the type to "void **”. This is because this is what you 
actually want: the array of devices

3) now you will have size and arrayPtr. Then you declare the array:

array := FFIExternalArray fromPointer: arrayPtr type: USBDevice

sorry, this expression (while possible) does not stops in “size”… it has to be 
like this, instead:

array := FFIExternalArray fromPointer: arrayPtr type: USBDevice size: size. “you 
already has the size for the result"


… and you should be able to iterate this array normally :)

let me know if this works for you… I’m “coding in mail client”, so it can fail 
:P

cheers,
Esteban



On 01 Jul 2016, at 12:02, Julien Delplanque  wrote:

Thanks, it works I get an instance of FFIOpaqueObject.

But how do I get a specific  libusb_device object from the list?

Thanks again for you quick answer :-).

Julien

On 01/07/16 11:44, Esteban Lorenzano wrote:

Hi,

an opaque structure is not an FFIExternalObject but an FFIOpaqueObject.
in that case, something like (simplified):

ctx := (your context).
list := FFIOpaqueObject new.
size := self getDevice: ctx list: list.

getDevice: ctx list: list
^ self ffiCall: #(size_t libusb_get_device_list (libusb_context *ctx, 
FFIOpaqueObject ***list))

should work (note that of course you can make libusb_device an alias for your 
type… that does not matters much, this is just a simplification).

if this does not works, if you can provide me code to reproduce it, I can give 
it a shot and see what happens :)

Esteban


On 01 Jul 2016, at 11:19, Julien Delplanque  wrote:

Hello everyone,

I have a question about the UFFI API. I have the following function:

ssize_t libusb_get_device_list (libusb_context *ctx, libusb_device ***list)

where libusb_device is an opaque structure.

I made a type mapping "ssize_t" -> "int" and an object inheriting
from FFIExternalObject for the "libusb_context" (others methods
using it are working).

I can not find how to get an array filled with libusb_device using UFFI from 
Pharo. :-(

Thanks in advance,

Julien










Re: [Pharo-users] [UFFI] Getting an array of opaque structures filled

2016-07-01 Thread Julien Delplanque

Thanks, it works I get an instance of FFIOpaqueObject.

But how do I get a specific  libusb_device object from the list?

Thanks again for you quick answer :-).

Julien

On 01/07/16 11:44, Esteban Lorenzano wrote:

Hi,

an opaque structure is not an FFIExternalObject but an FFIOpaqueObject.
in that case, something like (simplified):

ctx := (your context).
list := FFIOpaqueObject new.
size := self getDevice: ctx list: list.

getDevice: ctx list: list
^ self ffiCall: #(size_t libusb_get_device_list (libusb_context *ctx, 
FFIOpaqueObject ***list))

should work (note that of course you can make libusb_device an alias for your 
type… that does not matters much, this is just a simplification).

if this does not works, if you can provide me code to reproduce it, I can give 
it a shot and see what happens :)

Esteban


On 01 Jul 2016, at 11:19, Julien Delplanque  wrote:

Hello everyone,

I have a question about the UFFI API. I have the following function:

ssize_t libusb_get_device_list (libusb_context *ctx, libusb_device ***list)

where libusb_device is an opaque structure.

I made a type mapping "ssize_t" -> "int" and an object inheriting
from FFIExternalObject for the "libusb_context" (others methods
using it are working).

I can not find how to get an array filled with libusb_device using UFFI from 
Pharo. :-(

Thanks in advance,

Julien








[Pharo-users] [UFFI] Getting an array of opaque structures filled

2016-07-01 Thread Julien Delplanque

Hello everyone,

I have a question about the UFFI API. I have the following function:

ssize_t libusb_get_device_list (libusb_context *ctx, libusb_device ***list)

where libusb_device is an opaque structure.

I made a type mapping "ssize_t" -> "int" and an object inheriting
from FFIExternalObject for the "libusb_context" (others methods
using it are working).

I can not find how to get an array filled with libusb_device using UFFI 
from Pharo. :-(


Thanks in advance,

Julien



Re: [Pharo-users] [ANN]Windows previewer / switcher for Pharo

2016-06-30 Thread Julien Delplanque

Yes it was one of the idea I already had to make it more sexy
and advertise the user that he is using it.

Thanks for the feedback. :)

Julien


On 30/06/16 07:37, stepharo wrote:

Julien


it may be good to put all the preview morphs on top of a blurry 
translucent morph so that we clearly identify them but still see the 
background



Stef


Le 29/6/16 à 23:42, Nicolai Hess a écrit :

Hi Julien,

yes, finding a shortcut satisfying all users (for all different 
platforms) is not easy, see
15546 
<https://pharo.fogbugz.com/f/cases/15546/alt-tab-does-not-work-correctly> 
alt+tab does not work correctly

and
17924 
<https://pharo.fogbugz.com/f/cases/17924/Switch-Windows-shortcut> 
Switch Windows shortcut



2016-06-29 0:31 GMT+02:00 Merwan Ouddane <mailto:merwanoudd...@gmail.com>>:


Argh i was so thrilled by this ! But it doesn't seem to work on
windows :/

Ctrl+tab gives the focus to the front window or makes an "inspect
it" on the current editor line...


For windows, to make ctrl+tab working, you need to disable the
"hasSpecialCTRLKeyValue"-check (I think this check is not needed 
anymore, since we changed the

windows vm for ctrl+number/tab/space... keystrokes)


Thank you anyway !


On 28/06/2016 14:51, Julien Delplanque wrote:

Also, here is a screenshot (I forgot to attach it to the
preceding mail).

    Julien


On 28/06/16 11:06, Julien Delplanque wrote:

Hello,

This mail to announce you that I am working on a windows
previewer / switcher for
Pharo [1].

It is still in early stage of development but it is usable.

To install it:

|Metacello new repository:
'github://JulienDelplanque/WindowsPreviewer/repository';
baseline: 'WindowsPreviewer'; load|

See the README for details on activation/shortcuts.

Please, if you have some ideas or critics let me know!

Also, a better name than "Windows Previewer" would be cool
but I have
no other idea :-)...

Regards,

Julien

Links:
[1]: https://github.com/juliendelplanque/WindowsPreviewer













Re: [Pharo-users] [ANN]Windows previewer / switcher for Pharo

2016-06-30 Thread Julien Delplanque

Hi,

Ok then I need to think about a nice solution...

Maybe by making the shortcut modifiable by the user in the "Settings 
browser"?


I think it would be good to have Ctrl/Cmd+Tab on all platform but it can 
be done yet.


Julien


On 29/06/16 23:42, Nicolai Hess wrote:

Hi Julien,

yes, finding a shortcut satisfying all users (for all different platforms)
is not easy, see
15546
<https://pharo.fogbugz.com/f/cases/15546/alt-tab-does-not-work-correctly>
alt+tab does not work correctly
and
17924 <https://pharo.fogbugz.com/f/cases/17924/Switch-Windows-shortcut>
Switch Windows shortcut


2016-06-29 0:31 GMT+02:00 Merwan Ouddane :


Argh i was so thrilled by this ! But it doesn't seem to work on windows :/

Ctrl+tab gives the focus to the front window or makes an "inspect it" on
the current editor line...


For windows, to make ctrl+tab working, you need to disable the
"hasSpecialCTRLKeyValue"-check (I think this check is not needed anymore,
since we changed the
windows vm for ctrl+number/tab/space... keystrokes)



Thank you anyway !


On 28/06/2016 14:51, Julien Delplanque wrote:


Also, here is a screenshot (I forgot to attach it to the preceding mail).

Julien


On 28/06/16 11:06, Julien Delplanque wrote:


Hello,

This mail to announce you that I am working on a windows previewer /
switcher for
Pharo [1].

It is still in early stage of development but it is usable.

To install it:

|Metacello new repository:
'github://JulienDelplanque/WindowsPreviewer/repository'; baseline:
'WindowsPreviewer'; load|

See the README for details on activation/shortcuts.

Please, if you have some ideas or critics let me know!

Also, a better name than "Windows Previewer" would be cool but I have
no other idea :-)...

Regards,

Julien

Links:
[1]: https://github.com/juliendelplanque/WindowsPreviewer









[Pharo-users] [ANN]Windows previewer / switcher for Pharo

2016-06-28 Thread Julien Delplanque

Hello,

This mail to announce you that I am working on a windows previewer / 
switcher for

Pharo [1].

It is still in early stage of development but it is usable.

To install it:

|Metacello new repository: 
'github://JulienDelplanque/WindowsPreviewer/repository'; baseline: 
'WindowsPreviewer'; load|


See the README for details on activation/shortcuts.

Please, if you have some ideas or critics let me know!

Also, a better name than "Windows Previewer" would be cool but I have
no other idea :-)...

Regards,

Julien

Links:
[1]: https://github.com/juliendelplanque/WindowsPreviewer


Re: [Pharo-users] [ANN] Smallworlds (Interactive Fiction Framework) v1.0 released

2016-06-23 Thread Julien Delplanque

Cool :)

I will give a try.

Julien


On 23/06/16 15:33, ericvm wrote:

New version of Interactive Fiction Framework
(https://github.com/ericvm/smallworlds)

I think it is mature enough to be used, but of course there might be some
rough edges.

Contributors, users and testers would be very welcome!



--
View this message in context: 
http://forum.world.st/ANN-Smallworlds-Interactive-Fiction-Framework-v1-0-released-tp4902660.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.






Re: [Pharo-users] [UFFI] Call a function where argument type is char ** (argv)

2016-06-01 Thread Julien Delplanque

Hello,

I asked a simililar question some days ago, maybe this [1] can help.

Regards,

Julien

Links:

[1]: 
http://forum.world.st/Unified-FFI-pointer-of-String-as-function-parameter-td4898066.html



On 31/05/16 16:28, Blondeau Vincent wrote:

TL;DR: How to pass as argument an array of Strings (char **) with Unified-FFI?

Vincent

De : Blondeau Vincent
Envoyé : mercredi 25 mai 2016 13:58
À : Pharo Development List
Objet : [UFFI] Call a function where argument type is char ** (argv)

Hello,

I have written a R bridge in Pharo and I would like to migrate it from 
NativeBoost to UFFI.
Most of the changes are easy to do but I am stuck to a double pointer problem.
I have to call the function: int Rf_initEmbeddedR(int argc, char ** argv). I 
know how to give the int but the char ** is a problem. It is an array of 
Strings.

With NB, I managed to have this (working) code:
 "This is 32bit... too bad..."
 strings := OrderedCollection new.
 par := NativeBoost allocate: 4 * params size.
 params
 keysAndValuesDo: [ :i :each |
 | str |
 str := each asNBExternalString.
 strings add: str.
 par nbUInt32AtOffset: (i - 1) 
* 4 put: str value ].
 self prim_initEmbeddedRargc: params size argv: par ]
 ensure: [
 "Free the memory we allocated"
 par ifNotNil: [ par free ].
 strings ifNotNil: [ strings 
do: [ :each | each free ] ] ]

With a primitive call:
Self nbCall: #(int Rf_initEmbeddedR(int argc, char *argv))

Do I still need to create my own array of strings or FFI creates it for me? How?

Thanks in advance for your answers,

Vincent


!!!*
"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.!!!"






Re: [Pharo-users] [ANN] LibnotifyBinding: a binding to libnotify 0.7.6 for Pharo

2016-05-30 Thread Julien Delplanque


On 30/05/16 18:02, Esteban Lorenzano wrote:

On 30 May 2016, at 16:50, Julien Delplanque  wrote:

Hello,

I took the libnotify [0] binding for Squeak [1], adapted it to use the Pharo 
UFFI API and
enhanced it. It is available here [2] and seems to work well (see attached 
image).

It does not cover all libnotify possibilities (see the README on github) but it 
is already
usable to display notifications with eventually icons, set urgency, set 
timeout, etc...

It was great to try UFFI, it is really easy to use. Thanks a lot for it! :-)

thank you for your feedback, is highly appreciated :)

… and I have a project who will benefit from libnotify, so, thanks you :D
If you see strange things in the code, or things that could be enhanced 
don't hesitate

to report them using Github issues. :-)

Julien



Re: [Pharo-users] [ANN] LibnotifyBinding: a binding to libnotify 0.7.6 for Pharo

2016-05-30 Thread Julien Delplanque

Good idea, I will have a look at this feature. :-)

Julien


On 30/05/16 17:07, Denis Kudriashov wrote:

Nice.

And it would be much nicer if Pharo allows to install it as new
notifications backend (instead of morphic one).

2016-05-30 16:50 GMT+02:00 Julien Delplanque :


Hello,

I took the libnotify [0] binding for Squeak [1], adapted it to use the
Pharo UFFI API and
enhanced it. It is available here [2] and seems to work well (see attached
image).

It does not cover all libnotify possibilities (see the README on github)
but it is already
usable to display notifications with eventually icons, set urgency, set
timeout, etc...

It was great to try UFFI, it is really easy to use. Thanks a lot for it!
:-)

Regards,

Julien

Links:
[0]: https://developer.gnome.org/libnotify/
[1]: http://www.squeaksource.com/libnotify.html
[2]: https://github.com/juliendelplanque/LibnotifyBinding






[Pharo-users] [ANN] LibnotifyBinding: a binding to libnotify 0.7.6 for Pharo

2016-05-30 Thread Julien Delplanque

Hello,

I took the libnotify [0] binding for Squeak [1], adapted it to use the 
Pharo UFFI API and
enhanced it. It is available here [2] and seems to work well (see 
attached image).


It does not cover all libnotify possibilities (see the README on github) 
but it is already
usable to display notifications with eventually icons, set urgency, set 
timeout, etc...


It was great to try UFFI, it is really easy to use. Thanks a lot for it! :-)

Regards,

Julien

Links:
[0]: https://developer.gnome.org/libnotify/
[1]: http://www.squeaksource.com/libnotify.html
[2]: https://github.com/juliendelplanque/LibnotifyBinding


Re: [Pharo-users] Unified FFI: pointer of String as function parameter

2016-05-30 Thread Julien Delplanque


On 30/05/16 11:44, Esteban Lorenzano wrote:

On 30 May 2016, at 11:39, Julien Delplanque  wrote:

I just did it, it works directly except for 2 little mistakes (for people who 
are interested):

The class method to override in StringValueHolder is #typeDecl and not 
#typeDesc.

To get the actual String from the StringValueHolder, no need to call 
#readString on the
result of #value, it causes an error because #value already returns a String.

oh well, I was coding by heart ;)
Indeed, I mean no offense, I just wanted to fix this for people who will 
need to do this in the future. :-p



Thanks a lot for this explanation Esteban :-).

you’re welcome :)

Esteban


Regards,

Julien

On 30/05/16 11:14, Esteban Lorenzano wrote:

this is not the easiest part of FFI :)

this is the simplest  way:

str := ExternalAddress new. “This will point to NULL”
self callToMyFunction: str.
pharoString := (str pointerAt: 1) readString.

callToMyFunction: str
self ffiCall: #( void function ( char ** str ) )


now, another way is to declare a value holder:

1) subclass FFIExternalValueHolder.

FFIExternalValueHolder subclass: #StringValueHolder.

2) implement class side method  typeDesc

StringValueHolder class>>typeDesc
^ String

3) implement your method replacing char** for your value holder:

callToMyFunction: str
self ffiCall: #( void function ( StringValueHolder* str ) )

then you call like this:

str := StringValueHolder new.
self callToMyFunction: str.
pharoString := str value readString.

looks like too much steps for just economise the “pointeAt: 1” part, but is 
useful when you have lots of this calls :)

cheers,
Esteban



On 30 May 2016, at 10:56, Julien Delplanque  wrote:

Hello everyone,

I have a C function to call from Pharo that looks like this:

int my_function(char ** parameter);

This function fill the pointer on the String given as parameter.

How can I use this from pharo Unified FFI? I mean, how to get a pharo String 
filled by this function?

Thanks in advance,

Julien











Re: [Pharo-users] Unified FFI: pointer of String as function parameter

2016-05-30 Thread Julien Delplanque
I just did it, it works directly except for 2 little mistakes (for 
people who are interested):


The class method to override in StringValueHolder is #typeDecl and not 
#typeDesc.


To get the actual String from the StringValueHolder, no need to call 
#readString on the
result of #value, it causes an error because #value already returns a 
String.


Thanks a lot for this explanation Esteban :-).

Regards,

Julien

On 30/05/16 11:14, Esteban Lorenzano wrote:

this is not the easiest part of FFI :)

this is the simplest  way:

str := ExternalAddress new. “This will point to NULL”
self callToMyFunction: str.
pharoString := (str pointerAt: 1) readString.

callToMyFunction: str
self ffiCall: #( void function ( char ** str ) )


now, another way is to declare a value holder:

1) subclass FFIExternalValueHolder.

FFIExternalValueHolder subclass: #StringValueHolder.

2) implement class side method  typeDesc

StringValueHolder class>>typeDesc
^ String

3) implement your method replacing char** for your value holder:

callToMyFunction: str
self ffiCall: #( void function ( StringValueHolder* str ) )

then you call like this:

str := StringValueHolder new.
self callToMyFunction: str.
pharoString := str value readString.

looks like too much steps for just economise the “pointeAt: 1” part, but is 
useful when you have lots of this calls :)

cheers,
Esteban



On 30 May 2016, at 10:56, Julien Delplanque  wrote:

Hello everyone,

I have a C function to call from Pharo that looks like this:

int my_function(char ** parameter);

This function fill the pointer on the String given as parameter.

How can I use this from pharo Unified FFI? I mean, how to get a pharo String 
filled by this function?

Thanks in advance,

Julien









Re: [Pharo-users] Unified FFI: pointer of String as function parameter

2016-05-30 Thread Julien Delplanque

Thanks for the fast answer. :-)


On 30/05/16 11:14, Esteban Lorenzano wrote:

this is not the easiest part of FFI :)

this is the simplest  way:

str := ExternalAddress new. “This will point to NULL”
self callToMyFunction: str.
pharoString := (str pointerAt: 1) readString.

callToMyFunction: str
self ffiCall: #( void function ( char ** str ) )


now, another way is to declare a value holder:

1) subclass FFIExternalValueHolder.

FFIExternalValueHolder subclass: #StringValueHolder.

2) implement class side method  typeDesc

StringValueHolder class>>typeDesc
^ String

3) implement your method replacing char** for your value holder:

callToMyFunction: str
self ffiCall: #( void function ( StringValueHolder* str ) )

then you call like this:

str := StringValueHolder new.
self callToMyFunction: str.
pharoString := str value readString.

looks like too much steps for just economise the “pointeAt: 1” part, but is 
useful when you have lots of this calls :)

I think I will use the second solution. It is cleaner isn't it?

Julien



[Pharo-users] Unified FFI: pointer of String as function parameter

2016-05-30 Thread Julien Delplanque

Hello everyone,

I have a C function to call from Pharo that looks like this:

int my_function(char ** parameter);

This function fill the pointer on the String given as parameter.

How can I use this from pharo Unified FFI? I mean, how to get a pharo 
String filled by this function?


Thanks in advance,

Julien




Re: [Pharo-users] Get a String during the execution

2016-05-18 Thread Julien Delplanque

No problem. :-)

++
Julien

On 18/05/16 15:12, Valentin Ryckewaert wrote:

Hello julien,

cyril helped me i'm using UIManager default textEntry: 'Type something'.
and it's exactly what I was looking for !

Thanks you for your answer, i'll check openModal anyway ! :)

Valentin

2016-05-18 15:05 GMT+02:00 Julien Delplanque :


Hello Valentin,

You should check the World>>#openModal: message.

I think this is what you are looking for. :-)

Regards,

Julien


On 18/05/16 14:08, Valentin Ryckewaert wrote:


Hi !

I'm trying to make a method able to ask the user to write something which
will be used in the method.
During my method execution, a pop up appear on the screen, the user write
anything 'test' for exemple, and then the method continue using this
string.

The code looks like this:
MyClass>>dostuff
mypopup := MyPopup new.
mypopup openDialogWithSpec.
mypopup window okAction: [ date := mapop input text. dostuff with the
variable date ]."

And then I execute this method:
MyClass new dostuff.
SessionManager default snapshot: false andQuit: true (To close Pharo)

The problem is that the method dostuff wait the proc of the popup to make
what is in the bloc but continue execution and close Pharo.
I would like to be able to stop execution of the code just after mypopup
window okAction and to reactivate it in the bloc executed when it's proc.
Is it possible?

Valentin









Re: [Pharo-users] Get a String during the execution

2016-05-18 Thread Julien Delplanque

Hello Valentin,

You should check the World>>#openModal: message.

I think this is what you are looking for. :-)

Regards,

Julien

On 18/05/16 14:08, Valentin Ryckewaert wrote:

Hi !

I'm trying to make a method able to ask the user to write something which
will be used in the method.
During my method execution, a pop up appear on the screen, the user write
anything 'test' for exemple, and then the method continue using this string.

The code looks like this:
MyClass>>dostuff
mypopup := MyPopup new.
mypopup openDialogWithSpec.
mypopup window okAction: [ date := mapop input text. dostuff with the
variable date ]."

And then I execute this method:
MyClass new dostuff.
SessionManager default snapshot: false andQuit: true (To close Pharo)

The problem is that the method dostuff wait the proc of the popup to make
what is in the bloc but continue execution and close Pharo.
I would like to be able to stop execution of the code just after mypopup
window okAction and to reactivate it in the bloc executed when it's proc.
Is it possible?

Valentin






Re: [Pharo-users] Presenting Pharo in Greece

2016-05-13 Thread Julien Delplanque

Hello Dimitris,

Is this http://c2.com/cgi-bin/wiki?SmalltalkSyntaxInaPostcard what 
you're looking for?


Good luck for your presentation.

Julien

On 13/05/16 10:32, Dimitris Chloupis wrote:

thanks any idea where i can get the card that contains the pharo syntax ?

On Fri, May 13, 2016 at 10:33 AM stepharo  wrote:


good luck :)



Le 12/5/16 à 12:50, Dimitris Chloupis a écrit :

Hey I wanted to inform you that I will be doing a 30 minutes
presentation of Pharo in Hackerspace , Athens so if there are any
Greeks watching the list they are more than welcomed to join. My talk
will focus on live coding and no familiarity with Pharo/Smalltalk or
programming experience required.

The talk will be 30 minutes and it will be given in 15:30 28th of May
2016 (Saturday) as part of Hackfest 2016 organized by Hackerspace in
Athens.

More info can be found here

https://hackfest.gr/

This will be both the first time Pharo is presented in Greece and my
first presentation so I am pretty excited about how it will go. Wish
me luck :)












Re: [Pharo-users] FFI documentation

2016-05-06 Thread Julien Delplanque

Super cool!

This is exactly what I needed.

Thanks a lot!

Julien

On 06/05/16 21:18, Alexandre Bergel wrote:

Hi Julien!

Esteban L. wrote a chapter on it:
https://ci.inria.fr/pharo-contribution/view/Books/job/PharoBookWorkInProgress/lastSuccessfulBuild/artifact/book-result/UnifiedFFI/UnifiedFFI.pdf

It would be great to have a Help, accessible in the HelpBrowser in Pharo.

Cheers,
Alexandre





[Pharo-users] FFI documentation

2016-05-06 Thread Julien Delplanque

Hello,

Let's say I would like to create a binding to ncurses library.
Is there any documentation on how to do it properly?
Or at least do you have any advice to do it the right way?

I have no real knowledge on how the unified ffi work. So
any documentation is welcome.

Thanks in advance. :)

Julien



Re: [Pharo-users] [ANN] Pharo Astares Distribution

2016-05-05 Thread Julien Delplanque
Really cool, I like this idea of different distributions providing 
different flavor

of a development environment!

Julien


On 03/05/16 22:01, Torsten Bergmann wrote:

Hi,

I summarized some of the goodies that I wrote like
  - DesktopManager
  - QuickAccess
  - HubCap
  - WebBrowser
  - MessageFlowBrowser
  - ...

into an own kind of Pharo distribution that I call AstaresDistribution.
So if you already use these goodies it is easier to load quickly into a fresh 
image.

You can load directly from Catalog or by opening Spooter, enter "Astares"
and hit ENTER to load.

Alternatively you can download a prebuilt image using PharoLauncher from
"Pharo Contributions Jenkins" -> "AstaresDistribution" or directly from [1].

Screenshot attached.

Have fun
T.
  
[1] https://ci.inria.fr/pharo-contribution/job/AstaresDistribution





Re: [Pharo-users] [ANN] Genetic Algorithm is available from the Catalog

2016-04-25 Thread Julien Delplanque

Cool!


On 25/04/16 16:10, Alexandre Bergel wrote:

Hi!

I did a bit of programming… A genetic algorithm is available from the Catalog.

Cheers,
Alexandre





Re: [Pharo-users] [ANN] Arff generator for Pharo

2016-04-25 Thread Julien Delplanque

argh, here take my +1 for this mail :p


On 25/04/16 14:08, Damien Pollet wrote:

So, ARFF is the file format… I propose that an OO modeling of it should be
named the Attribute-Relation Graph Hierarchy

:D

On 25 April 2016 at 13:37, Julien Delplanque  wrote:


Hello everyone,

For a university project in ''Datamining and Datawarehousing'', I have to
convert data stored as text files in different formats to the Weka[1] ARFF
format[2].

I did it with Pharo of course! :)

So, I wrote this little project [3] to share what I have done with you,
just in case someone else needs to export data from Pharo objects to an
ARFF string for further analysis with Weka.

Cheers,

Julien

Links:

[1] Weka's website: http://www.cs.waikato.ac.nz/ml/weka/

[2] ARFF format spec: https://weka.wikispaces.com/ARFF

[3] Arff generator for Pharo: https://github.com/juliendelplanque/Arff









Re: [Pharo-users] [ANN] Arff generator for Pharo

2016-04-25 Thread Julien Delplanque

Took me 1 hour to create 1 object/concept and the visitor.

My classmates probably did it with Python but not in the spirit to share
it so I guess it took them less time but it is not reusable... :)

Then some time to document, write the baseline and the mail.

Julien

On 25/04/16 14:09, p...@highoctane.be wrote:

Hello Julien,

I am curious to know how much faster/slower you can do this vs people using
other languages.

So?

Phil

On Mon, Apr 25, 2016 at 1:37 PM, Julien Delplanque  wrote:


Hello everyone,

For a university project in ''Datamining and Datawarehousing'', I have to
convert data stored as text files in different formats to the Weka[1] ARFF
format[2].

I did it with Pharo of course! :)

So, I wrote this little project [3] to share what I have done with you,
just in case someone else needs to export data from Pharo objects to an
ARFF string for further analysis with Weka.

Cheers,

Julien

Links:

[1] Weka's website: http://www.cs.waikato.ac.nz/ml/weka/

[2] ARFF format spec: https://weka.wikispaces.com/ARFF

[3] Arff generator for Pharo: https://github.com/juliendelplanque/Arff










[Pharo-users] [ANN] Arff generator for Pharo

2016-04-25 Thread Julien Delplanque

Hello everyone,

For a university project in ''Datamining and Datawarehousing'', I have 
to convert data stored as text files in different formats to the Weka[1] 
ARFF format[2].


I did it with Pharo of course! :)

So, I wrote this little project [3] to share what I have done with you, 
just in case someone else needs to export data from Pharo objects to an 
ARFF string for further analysis with Weka.


Cheers,

Julien

Links:

[1] Weka's website: http://www.cs.waikato.ac.nz/ml/weka/

[2] ARFF format spec: https://weka.wikispaces.com/ARFF

[3] Arff generator for Pharo: https://github.com/juliendelplanque/Arff





Re: [Pharo-users] About Traits

2016-04-22 Thread Julien Delplanque



On 22/04/16 17:04, Hilaire wrote:

Hi Julien,


Le 22/04/2016 16:45, Julien Delplanque a écrit :

Hello,

I have a question about Trait.

Is it ok, in the design point of view, to use them to force an object to
implement an interface?

Why not using a parent abstract class for that, with required method
answering #subclassResponsability?
Yes this is what I do for now. But what if I do not want to force the 
use of inheritance?


Then from your tests in subclasses, you check

self shouldnt: [instance toto] raise: SubclassResponsabilty


This wont work if the object does not implement #toto at all.

Like that it would be possible to check (via an #assert: for example) if
a class provides the interface required.

I read some things I found on the net about Traits and already used
TComparable but I never created one myself and I am not sure to
understand this concept entirely.


With Trait you add behavior to a class. TComparable adds behavior to
your class, your instance are then comparable.
Is it a problem? Isn't it similar to Java's interface? I see traits as a 
mix between Java's abstract classes and Java's interface
since you can define methods and let some of them abstract but you can 
not define instance variables.

But maybe I am wrong, that is why I ask :)...

Julien



[Pharo-users] About Traits

2016-04-22 Thread Julien Delplanque

Hello,

I have a question about Trait.

Is it ok, in the design point of view, to use them to force an object to 
implement an interface?


Like that it would be possible to check (via an #assert: for example) if 
a class provides the interface required.


I read some things I found on the net about Traits and already used 
TComparable but I never created one myself and I am not sure to 
understand this concept entirely.



Thanks in advance!

Julien




Re: [Pharo-users] [ANN] OS-Linux-CentOS

2016-04-01 Thread Julien Delplanque

Hello,

This is nice :)

I have a question:

Why do CentOS and Ubuntu classes do inherit from UnixSystem?

#contentsOf: and  #system: message have the same implementation.

Cheers,

Julien

On 31/03/16 18:31, Torsten Bergmann wrote:

Hi,

the OS-xxx series with (so far)

  - OS-Windows
  - OS-Linux-Ubuntu
  - OS-Unix
  - OS-Raspbian

now has a new member called "OS-Linux-CentOS" which is more or less an 
adopted/customized
pendant to "OS-Linux-Ubuntu".

Project page is at  http://www.smalltalkhub.com/#!/~OS/OS-Linux-CentOS

Ready for Pharo 5. As ever you can load from Catalog tool or directly by entering 
"CentOS"
into the Spotter search tool.

Enjoy the video:

https://www.youtube.com/watch?v=nAwtVeoll_k

Bye
T.







[Pharo-users] [Spec] CheckBoxModel>>enabled: does not work?

2016-03-26 Thread Julien Delplanque

Hello,

I am trying to disable a CheckBoxModel using #enabled: method does not 
works.


Any idea?

Regards,

Julien



Re: [Pharo-users] RFC Minecraft Server

2016-03-12 Thread Julien Delplanque

It would be awesome but sounds like a (very) big project.

I would provide help if I was not already suffocating under too much 
projects... :-(


Julien

On 12/03/16 18:38, Ben Coman wrote:

I'm not ready to do this yet, but just surveying interest.  I'm
thinking of creating a Minecraft server using Pharo.

My kids are enthusiastic about playing Minecraft and I think its a
great platform to grow their creativity and cognitive skills per [1].
Much better than passively watching TV!

[1] http://minemum.com/minecraft-educational

I'm particularly interested in using Minecraft modding as a platform
to teach programming to my kids.  I had high hopes for the
Scratch-like interface of learntomod.com, but I found it awkward and
unsuitable.  Other options for writing mods include Java[2],
Javascript [3] or Lua[4][5].  For now I'll probably settle on Lua, but
I'd prefer to be teaching them with Phratch and later directly with
Pharo.

[2] 
https://blogs.oracle.com/arungupta/entry/introducing_kids_to_java_programming
[3] http://scriptcraftjs.org/
[4] http://www.computercraft.info/wiki/Main_Page
[5] https://book.cuberite.org/

Ignoring client-side modding that IIUC is only applicable to single
player mode, mods are implemented on the server.  Servers are written
in several languages [6] and it would be nice to make one in Pharo,
with  Woden providing a basic 3D viewer as a management tool.
Documentation available here  [7]

[6] http://minecraft.gamepedia.com/Custom_servers
[7] http://wiki.vg/How_to_Write_a_Server

cheers -ben

P.S. Along the way I found several pointers at the following being
competent info on optimising voxel engines...
http://0fps.net/2015/01/23/collision-detection-part-3-benchmarks/
http://0fps.net/2012/01/14/an-analysis-of-minecraft-like-engines/
http://0fps.net/2012/06/30/meshing-in-a-minecraft-game/
http://0fps.net/2012/07/07/meshing-minecraft-part-2/






Re: [Pharo-users] Problems/Suggestions with Pharo IDE

2016-03-12 Thread Julien Delplanque

Hi Clement,

On 12/03/16 10:42, Clément Dumazy wrote:

- I can't copy/paste from Google Chrome (on ubuntu 14.04) while I could
copy/paste from other software like Gedit or Firefox.

I had the same problem. There is a little trick to resolve this: [1] 
(second message).


Sadly, there are still webpages where copy/paste from it to Pharo does 
not work :(.


Julien

Links:
[1]: 
http://forum.world.st/Problem-with-Copy-and-Paste-on-Google-Chrome-in-Ubuntu-td4854203.html




Re: [Pharo-users] Is there a way to display Spec widgets in a ListModel?

2016-03-02 Thread Julien Delplanque

This: [1] is what I would like to do.
I found it in  an old thread: [2] but it is a prototype. I wondered if 
there was an object able to do it in the framework :-)...


Julien

Links:
[1]: http://ijintek.fr/wiki/doku.php?id=spec_examples#listview_example
[2]: http://forum.world.st/Spec-question-td4741608.html#a4747231

On 02/03/16 21:31, Johan Fabry wrote:

I never tried anything like this, I do not think it is possible.

What you are trying to do seems strange to me, what is the use case you want to 
implement?


On Mar 2, 2016, at 17:06, Julien Delplanque  wrote:

Hi everyone,

I can't find how to display Spec widgets in a ListModel, is it possible?

I would like to have a list model holding, at each row, a TextModel and a 
ButtonModel.

Thanks in advance,

Julien





---> Save our in-boxes! http://emailcharter.org <---

Johan Fabry   -   http://pleiad.cl/~jfabry
PLEIAD and RyCh labs  -  Computer Science Department (DCC)  -  University of 
Chile







Re: [Pharo-users] Is there a way to display Spec widgets in a ListModel?

2016-03-02 Thread Julien Delplanque
I would like to have a ListModel holding objects I can edit a value 
using the TextModel and apply my modification using the ButtonModel.


Julien

On 02/03/16 21:31, Johan Fabry wrote:

I never tried anything like this, I do not think it is possible.

What you are trying to do seems strange to me, what is the use case you want to 
implement?


On Mar 2, 2016, at 17:06, Julien Delplanque  wrote:

Hi everyone,

I can't find how to display Spec widgets in a ListModel, is it possible?

I would like to have a list model holding, at each row, a TextModel and a 
ButtonModel.

Thanks in advance,

Julien





---> Save our in-boxes! http://emailcharter.org <---

Johan Fabry   -   http://pleiad.cl/~jfabry
PLEIAD and RyCh labs  -  Computer Science Department (DCC)  -  University of 
Chile







[Pharo-users] Is there a way to display Spec widgets in a ListModel?

2016-03-02 Thread Julien Delplanque

Hi everyone,

I can't find how to display Spec widgets in a ListModel, is it possible?

I would like to have a list model holding, at each row, a TextModel and 
a ButtonModel.


Thanks in advance,

Julien



Re: [Pharo-users] A Spec widget to hold non-editable multi-lines text?

2016-02-27 Thread Julien Delplanque

I totally agree, I will do it and add this one.
Maybe I will also make some research for similar content on the mailing 
list.


Julien

On 27/02/16 13:08, stepharo wrote:

Julien

we should create a simple chapter with questions/answers and we 
capture there such knowledge.


Stef

Le 25/2/16 11:30, Julien Delplanque a écrit :

Nice, can't wait to read it :)

Julien

On 25/02/16 10:58, Peter Uhnák wrote:
I'm sure it's documented somewhere… in any case new Spec 
documentation is

emerging so let's not forget to make sure it's there.

Peter

On Thu, Feb 25, 2016 at 10:49 AM, Julien Delplanque 
wrote:

Indeed but I mean, I was not able to deduce the fact that to have a 
widget

holding not-editable multi-line text I have to use

TextInputFieldModel and use #enabled: message...

But maybe there is already documentation about that?

Julien



On 25/02/16 09:58, Peter Uhnák wrote:


Maybe this should be documented in the class comment of

TextInputFieldModel?

This is a feature of AbstractWidgetModel, so it applies to all 
widgets

(buttons, texts, selects, ...).

   Peter
















Re: [Pharo-users] A Spec widget to hold non-editable multi-lines text?

2016-02-25 Thread Julien Delplanque

Nice, can't wait to read it :)

Julien

On 25/02/16 10:58, Peter Uhnák wrote:

I'm sure it's documented somewhere… in any case new Spec documentation is
emerging so let's not forget to make sure it's there.

Peter

On Thu, Feb 25, 2016 at 10:49 AM, Julien Delplanque 
wrote:


Indeed but I mean, I was not able to deduce the fact that to have a widget
holding not-editable multi-line text I have to use

TextInputFieldModel and use #enabled: message...

But maybe there is already documentation about that?

Julien



On 25/02/16 09:58, Peter Uhnák wrote:


Maybe this should be documented in the class comment of

TextInputFieldModel?

This is a feature of AbstractWidgetModel, so it applies to all widgets

(buttons, texts, selects, ...).

   Peter









Re: [Pharo-users] A Spec widget to hold non-editable multi-lines text?

2016-02-25 Thread Julien Delplanque
Indeed but I mean, I was not able to deduce the fact that to have a 
widget holding not-editable multi-line text I have to use


TextInputFieldModel and use #enabled: message...

But maybe there is already documentation about that?

Julien


On 25/02/16 09:58, Peter Uhnák wrote:

Maybe this should be documented in the class comment of
TextInputFieldModel?


This is a feature of AbstractWidgetModel, so it applies to all widgets
(buttons, texts, selects, ...).

  Peter






Re: [Pharo-users] A Spec widget to hold non-editable multi-lines text?

2016-02-24 Thread Julien Delplanque
Hi,

Thank you it works as expected :) Maybe this should be documented in the
class comment of TextInputFieldModel?

Regards,

Julien

On Wed, Feb 24, 2016 at 7:49 PM, Johan Fabry  wrote:

> Hello Julien,
>
> have you tried configuring it with enabled: false ?
>
> > On Feb 24, 2016, at 13:24, Julien Delplanque  wrote:
> >
> > Hello,
> >
> > I wonder if there is a Spec widget to hold non-editable multi-line text?
> >
> > There is TextInputFieldModel but the text is editable.
> >
> > Thanks in advance,
> >
> > Julien
> >
> >
>
>
>
> ---> Save our in-boxes! http://emailcharter.org <---
>
> Johan Fabry   -   http://pleiad.cl/~jfabry
> PLEIAD and RyCh labs  -  Computer Science Department (DCC)  -  University
> of Chile
>
>
>


[Pharo-users] A Spec widget to hold non-editable multi-lines text?

2016-02-24 Thread Julien Delplanque

Hello,

I wonder if there is a Spec widget to hold non-editable multi-line text?

There is TextInputFieldModel but the text is editable.

Thanks in advance,

Julien



[Pharo-users] Strange behavior of Pragma>>#allNamed:in:

2016-02-23 Thread Julien Delplanque

Hi,

I experience a strange behavior with Pragma>>#allNamed:in:

When I use

Pragma allNamed: #myPragma in: MyClass

It works as expected.

But when instead of hard-coding "MyClass" I use "self class" in an 
method (instance side),


Pragma allNamed: #myPragma in: self class

returns an empty array.

What can I do about it?

Julien



Re: [Pharo-users] Spec #focusOrder

2016-02-10 Thread Julien Delplanque



On 10/02/16 14:09, Julien Delplanque wrote:



On 10/02/16 14:00, Nicolai Hess wrote:

2016-02-10 13:15 GMT+01:00 Julien Delplanque :



On 10/02/16 12:48, Nicolai Hess wrote:


2016-02-10 12:20 GMT+01:00 Julien Delplanque :

Hi,
I am trying to manage the focus order of my widget that uses 
sub-widgets

with their #focusOrder defined.

How do spec manage nested focus order? I see in the implementation 
that

it
is simply an OrderedCollection.

I does not behave as I expected, when I add my sub-widgets to the 
focus
order, the focus is given to the first sub-widget and I can not 
access

the
second sub-widget using tabulation.

For example lets imagine WidgetA contains 2 buttons and WidgetB 
contains

2
buttons. I can only access the two buttons of WidgetA using 
tabulation.


How can I deal with that?

Thanks in advance,

Hi Julien,
how are WidgetA and WidgetB connected ? Are they both (spec)-models 
used

by
another main model ?

Hi Nicolai,

Yes they are subclasses of ComposableModel used by another main model.

Ok, so, if your main model has instance  variables for widgetA and 
widgetB,
can you add this in the method where you instantiate WidgetA and 
WidgetB:


widgetA focusOrder add: widgetB.
widgetB focusOrder add: widgetA.

Oh ok, I will try that. I was adding widgetA and widgetB to the 
focusOrder of my main widget :/...


Thanks,

Julien

When I use your method, I have the good behavior when going to the next 
sub-widget using tabulation but I have a strange behavior when going to 
the previous widget.


If I take the same example with widgetA and widgetB, when trying to 
reach previous sub-widgets with the focus, I can only access the first 
button of each sub-widget is it normal? How can I fix this?


Thanks in advance,

Julien



Re: [Pharo-users] Spec #focusOrder

2016-02-10 Thread Julien Delplanque



On 10/02/16 14:00, Nicolai Hess wrote:

2016-02-10 13:15 GMT+01:00 Julien Delplanque :



On 10/02/16 12:48, Nicolai Hess wrote:


2016-02-10 12:20 GMT+01:00 Julien Delplanque :

Hi,

I am trying to manage the focus order of my widget that uses sub-widgets
with their #focusOrder defined.

How do spec manage nested focus order? I see in the implementation that
it
is simply an OrderedCollection.

I does not behave as I expected, when I add my sub-widgets to the focus
order, the focus is given to the first sub-widget and I can not access
the
second sub-widget using tabulation.

For example lets imagine WidgetA contains 2 buttons and WidgetB contains
2
buttons. I can only access the two buttons of WidgetA using tabulation.

How can I deal with that?

Thanks in advance,

Hi Julien,

how are WidgetA and WidgetB connected ? Are they both (spec)-models used
by
another main model ?

Hi Nicolai,

Yes they are subclasses of ComposableModel used by another main model.


Ok, so, if your main model has instance  variables for widgetA and widgetB,
can you add this in the method where you instantiate WidgetA and WidgetB:

widgetA focusOrder add: widgetB.
widgetB focusOrder add: widgetA.

Oh ok, I will try that. I was adding widgetA and widgetB to the 
focusOrder of my main widget :/...


Thanks,

Julien




Re: [Pharo-users] Spec #focusOrder

2016-02-10 Thread Julien Delplanque



On 10/02/16 12:48, Nicolai Hess wrote:

2016-02-10 12:20 GMT+01:00 Julien Delplanque :


Hi,

I am trying to manage the focus order of my widget that uses sub-widgets
with their #focusOrder defined.

How do spec manage nested focus order? I see in the implementation that it
is simply an OrderedCollection.

I does not behave as I expected, when I add my sub-widgets to the focus
order, the focus is given to the first sub-widget and I can not access the
second sub-widget using tabulation.

For example lets imagine WidgetA contains 2 buttons and WidgetB contains 2
buttons. I can only access the two buttons of WidgetA using tabulation.

How can I deal with that?

Thanks in advance,


Hi Julien,

how are WidgetA and WidgetB connected ? Are they both (spec)-models used by
another main model ?


Hi Nicolai,

Yes they are subclasses of ComposableModel used by another main model.

Julien



[Pharo-users] Spec #focusOrder

2016-02-10 Thread Julien Delplanque

Hi,

I am trying to manage the focus order of my widget that uses sub-widgets 
with their #focusOrder defined.


How do spec manage nested focus order? I see in the implementation that 
it is simply an OrderedCollection.


I does not behave as I expected, when I add my sub-widgets to the focus 
order, the focus is given to the first sub-widget and I can not access 
the second sub-widget using tabulation.


For example lets imagine WidgetA contains 2 buttons and WidgetB contains 
2 buttons. I can only access the two buttons of WidgetA using tabulation.


How can I deal with that?

Thanks in advance,

Julien



Re: [Pharo-users] Simple question about Spec

2016-02-09 Thread Julien Delplanque

Indeed, it should be implemented the same way as #minimize and #maximize.

Julien

On 09/02/16 09:04, Nicolai Hess wrote:

2016-02-04 8:17 GMT+01:00 stepharo :


I do not like the API :)


Hi Steph, Julien,

Iooked at the fix for this issue.
Implementing #activate on WindowModel and delegate to
self window
of course works.
But I am unsure if we want to do it that way, because messages like
#maximize #minimize are implemented differently.

I don't know what is the  preferred way for models to communicate with
widgets through the adapter. But if we
follow  the way of maximize and minimize, an implementation for
WindowModel>>#activate
could be

 self changed: #activate with: #()

and this needs another change in MorphicWindowAdapter>>#activate

 self widgetDo: [ :w | w activate ]


what do you think?





Le 3/2/16 13:35, Julien Delplanque a écrit :

Ok I found how to do it:

myWidget window window activate.

Some observations:
"myWidget window" gives a WindowModel which inherits from
AbstractWidgetModel and does not have #activate message.
"myWidget window window" gives a SpecWindow which inherits from
StandardWindow, a morph.

Thanks a lot for the help!

Julien

On 03/02/16 13:16, Sven Van Caekenberghe wrote:


 window activate ?

On 03 Feb 2016, at 13:03, Julien Delplanque  wrote:


On 03/02/16 12:33, Stephan Eggermont wrote:


On 03-02-16 12:14, Julien Delplanque wrote:


Hello,

I can't find the answer by browsing classes comments nor methods so I
ask the question here :).

Is it possible to put a WindowModel on top of all other windows
opened?
If it is, how?


I'm not sure where you are looking for, but did you look at the
WorldModel?

Stephan



How, a little precision, when I say "Is it possible to put a

WindowModel on top of all other windows opened?" I mean programatically of
course :p.

Julien












Re: [Pharo-users] Another question about Spec

2016-02-04 Thread Julien Delplanque

Ok, I just tried what you said and it does not always works
since it is possible to drag an item from the list without selecting it...

Julien

On 04/02/16 17:42, Julien Delplanque wrote:

Oh, I realize I didn't read your mail correctly, I'm sorry.

I will try this trick.

Julien

On 04/02/16 16:55, Johan Fabry wrote:
I don’t know the details of drag and drop, but it seems that you get 
the source widget as well as an argument of the block. From there you 
can get the selectedItem, which should be the one that you are 
dragging I suppose. Can you confirm that this works?



On Feb 4, 2016, at 04:38, Julien Delplanque  wrote:

Hey,

I use drag and drop between two lists in a project and I read this 
tutorial [1] to learn how to do it.


My question is: Is there a way to have another object than a String 
as passengers in #acceptDropBlock: (I get passengers the same way as 
in the tutorial i.e sending #passenger to transfer object) like the 
objects really in the list? Because if I use #displayBlock: it 
became difficult to be sure I retrieve the object I dropped in the 
source list...


Thanks in advance,

Julien

[1]: http://spec.st/docs/drag_n_drop/





---> Save our in-boxes! http://emailcharter.org <---

Johan Fabry   -   http://pleiad.cl/~jfabry
PLEIAD and RyCh labs  -  Computer Science Department (DCC)  - 
University of Chile










Re: [Pharo-users] Spec doc

2016-02-04 Thread Julien Delplanque

Hi,

On 04/02/16 17:42, Hilaire wrote:

Hello

I want to evaluate the use of Spec for desktop application.

What are the recommended spec reading?

I suppose this link: http://spec.st/docs/home/
and the examples in 'Spec-Examples' package.


Is Spec feature complete enough to develop application with complex GUI?
(very subjective question)

I can not really answer this since I only begin with Spec but, right now,
I have difficulties with drag and drop between lists but it may be my fault.


Is it intended to remain compatible with future release and modification
of the underneath graphic system?

Thanks

Hilaire


Julien




Re: [Pharo-users] Another question about Spec

2016-02-04 Thread Julien Delplanque

Oh, I realize I didn't read your mail correctly, I'm sorry.

I will try this trick.

Julien

On 04/02/16 16:55, Johan Fabry wrote:

I don’t know the details of drag and drop, but it seems that you get the source 
widget as well as an argument of the block. From there you can get the 
selectedItem, which should be the one that you are dragging I suppose. Can you 
confirm that this works?


On Feb 4, 2016, at 04:38, Julien Delplanque  wrote:

Hey,

I use drag and drop between two lists in a project and I read this tutorial [1] 
to learn how to do it.

My question is: Is there a way to have another object than a String as 
passengers in #acceptDropBlock: (I get passengers the same way as in the 
tutorial i.e sending #passenger to transfer object) like the objects really in 
the list? Because if I use #displayBlock: it became difficult to be sure I 
retrieve the object I dropped in the source list...

Thanks in advance,

Julien

[1]: http://spec.st/docs/drag_n_drop/





---> Save our in-boxes! http://emailcharter.org <---

Johan Fabry   -   http://pleiad.cl/~jfabry
PLEIAD and RyCh labs  -  Computer Science Department (DCC)  -  University of 
Chile







Re: [Pharo-users] Another question about Spec

2016-02-04 Thread Julien Delplanque

I understand what you say but sadly, it will not work in my case because:
- I use #displayBlock:
- Two or more items may be different objects but the result of the 
display block is the same.


So I can't just use the string to retrieve the item in the list... :(

Julien

On 04/02/16 16:55, Johan Fabry wrote:

I don’t know the details of drag and drop, but it seems that you get the source 
widget as well as an argument of the block. From there you can get the 
selectedItem, which should be the one that you are dragging I suppose. Can you 
confirm that this works?


On Feb 4, 2016, at 04:38, Julien Delplanque  wrote:

Hey,

I use drag and drop between two lists in a project and I read this tutorial [1] 
to learn how to do it.

My question is: Is there a way to have another object than a String as 
passengers in #acceptDropBlock: (I get passengers the same way as in the 
tutorial i.e sending #passenger to transfer object) like the objects really in 
the list? Because if I use #displayBlock: it became difficult to be sure I 
retrieve the object I dropped in the source list...

Thanks in advance,

Julien

[1]: http://spec.st/docs/drag_n_drop/





---> Save our in-boxes! http://emailcharter.org <---

Johan Fabry   -   http://pleiad.cl/~jfabry
PLEIAD and RyCh labs  -  Computer Science Department (DCC)  -  University of 
Chile







Re: [Pharo-users] Simple question about Spec

2016-02-04 Thread Julien Delplanque

Ok, its done here [1], I hope I followed the procedure correctly. :)

Julien

[1]: 
https://pharo.fogbugz.com/f/cases/17528/Missing-activate-message-in-WindowModel


On 04/02/16 15:26, Sven Van Caekenberghe wrote:

On 04 Feb 2016, at 15:21, Johan Fabry  wrote:


Yes, please do that! I would do it myself but I’m on holiday this month and not 
allowed to touch the computer much ;-)

And still you somehow managed to type this message ;-)


On Feb 4, 2016, at 09:10, Stephan Eggermont  wrote:

On 04-02-16 08:28, Julien Delplanque wrote:

To match my needs, I simply added an extension to WindowModel with the
message #activate.

Just create an issue and fix it in place and put a slice in the inbox.
You will not be the only one needing it.

Stephan







---> Save our in-boxes! http://emailcharter.org <---

Johan Fabry   -   http://pleiad.cl/~jfabry
PLEIAD and RyCh labs  -  Computer Science Department (DCC)  -  University of 
Chile









Re: [Pharo-users] Simple question about Spec

2016-02-04 Thread Julien Delplanque
Ok, it will be a good occasion to learn the contribution process *shame 
on me*.


Julien

On 04/02/16 13:10, Stephan Eggermont wrote:

On 04-02-16 08:28, Julien Delplanque wrote:

To match my needs, I simply added an extension to WindowModel with the
message #activate.


Just create an issue and fix it in place and put a slice in the inbox.
You will not be the only one needing it.

Stephan








[Pharo-users] Another question about Spec

2016-02-03 Thread Julien Delplanque

Hey,

I use drag and drop between two lists in a project and I read this 
tutorial [1] to learn how to do it.


My question is: Is there a way to have another object than a String as 
passengers in #acceptDropBlock: (I get passengers the same way as in the 
tutorial i.e sending #passenger to transfer object) like the objects 
really in the list? Because if I use #displayBlock: it became difficult 
to be sure I retrieve the object I dropped in the source list...


Thanks in advance,

Julien

[1]: http://spec.st/docs/drag_n_drop/



Re: [Pharo-users] Simple question about Spec

2016-02-03 Thread Julien Delplanque
To match my needs, I simply added an extension to WindowModel with the 
message #activate.


So I do not need to do "myWidget window window activate".

Julien

On 04/02/16 08:17, stepharo wrote:

I do not like the API :)


Le 3/2/16 13:35, Julien Delplanque a écrit :

Ok I found how to do it:

myWidget window window activate.

Some observations:
"myWidget window" gives a WindowModel which inherits from 
AbstractWidgetModel and does not have #activate message.
"myWidget window window" gives a SpecWindow which inherits from 
StandardWindow, a morph.


Thanks a lot for the help!

Julien

On 03/02/16 13:16, Sven Van Caekenberghe wrote:

 window activate ?


On 03 Feb 2016, at 13:03, Julien Delplanque  wrote:


On 03/02/16 12:33, Stephan Eggermont wrote:

On 03-02-16 12:14, Julien Delplanque wrote:

Hello,

I can't find the answer by browsing classes comments nor methods 
so I

ask the question here :).

Is it possible to put a WindowModel on top of all other windows 
opened?

If it is, how?
I'm not sure where you are looking for, but did you look at the 
WorldModel?


Stephan



How, a little precision, when I say "Is it possible to put a 
WindowModel on top of all other windows opened?" I mean 
programatically of course :p.


Julien















Re: [Pharo-users] Create type(class) dynamically

2016-02-03 Thread Julien Delplanque

Hi,

You can create a class programatically using:

ParentClass subclass: #ClassName
instanceVariableNames: 'instVar1 instVar2'
classVariableNames: ''
category: 'APackage'

Then you can add method using:

ClassName compile: 'helloWorld
^''Hello world!'''

for example.

I don't know if this answer you question?

Julien

On 03/02/16 20:48, Khrystyna Mykhailiuk wrote:

Hi, all!

Is it possible in Pharo to create a type (class) dynamically?
Not using special space for it, but create type by running method of another
class.

Thanks,
Khrystyna.



--
View this message in context: 
http://forum.world.st/Create-type-class-dynamically-tp4875651.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.






Re: [Pharo-users] Simple question about Spec

2016-02-03 Thread Julien Delplanque

Ok I found how to do it:

myWidget window window activate.

Some observations:
"myWidget window" gives a WindowModel which inherits from 
AbstractWidgetModel and does not have #activate message.
"myWidget window window" gives a SpecWindow which inherits from 
StandardWindow, a morph.


Thanks a lot for the help!

Julien

On 03/02/16 13:16, Sven Van Caekenberghe wrote:

 window activate ?


On 03 Feb 2016, at 13:03, Julien Delplanque  wrote:


On 03/02/16 12:33, Stephan Eggermont wrote:

On 03-02-16 12:14, Julien Delplanque wrote:

Hello,

I can't find the answer by browsing classes comments nor methods so I
ask the question here :).

Is it possible to put a WindowModel on top of all other windows opened?
If it is, how?

I'm not sure where you are looking for, but did you look at the WorldModel?

Stephan




How, a little precision, when I say "Is it possible to put a WindowModel on top of 
all other windows opened?" I mean programatically of course :p.

Julien








Re: [Pharo-users] Simple question about Spec

2016-02-03 Thread Julien Delplanque



On 03/02/16 13:14, Stephan Eggermont wrote:

On 03-02-16 12:59, Julien Delplanque wrote:

I looked at WindowModel and, because of your mail, also at WorldModel
but I still do not find how to put the window on top of all the 
others...


There is

  openWorldWithSpec

as used in PharoLauncher.

Are you looking for a (modal) dialog or building a custom application 
with no pharo IDE? Spec does not have fine-grained control over layers,

for that you need the Morphic level, where you can say e.g.

setProperty: #morphicLayerNumber toValue: 18.

to be on top of normal windows.

Stephan



I am building a custom application. Ok, so I need to work at Morph level.
To retrieve the morph associated with the WindowModel, do I need to use 
World submorphs and detect it or is there another way?


If I retrieve the SpecWindow, I can simply send #activate to put the 
window to the top...


Julien




Re: [Pharo-users] Simple question about Spec

2016-02-03 Thread Julien Delplanque


On 03/02/16 12:33, Stephan Eggermont wrote:

On 03-02-16 12:14, Julien Delplanque wrote:

Hello,

I can't find the answer by browsing classes comments nor methods so I
ask the question here :).

Is it possible to put a WindowModel on top of all other windows opened?
If it is, how?


I'm not sure where you are looking for, but did you look at the 
WorldModel?


Stephan



How, a little precision, when I say "Is it possible to put a WindowModel 
on top of all other windows opened?" I mean programatically of course :p.


Julien



Re: [Pharo-users] Simple question about Spec

2016-02-03 Thread Julien Delplanque



On 03/02/16 12:33, Stephan Eggermont wrote:

On 03-02-16 12:14, Julien Delplanque wrote:

Hello,

I can't find the answer by browsing classes comments nor methods so I
ask the question here :).

Is it possible to put a WindowModel on top of all other windows opened?
If it is, how?


I'm not sure where you are looking for, but did you look at the 
WorldModel?


Stephan



I looked at WindowModel and, because of your mail, also at WorldModel 
but I still do not find how to put the window on top of all the others...


Julien



[Pharo-users] Simple question about Spec

2016-02-03 Thread Julien Delplanque

Hello,

I can't find the answer by browsing classes comments nor methods so I 
ask the question here :).


Is it possible to put a WindowModel on top of all other windows opened? 
If it is, how?


Thanks in advance,

Julien



[Pharo-users] Smalltalkhub is down?

2016-02-02 Thread Julien Delplanque

Hey,

I can not access smalltalkhub neither from an image nor from a web 
browser. Also, if I ping the server it does not responds.


Anyone experiencing the same thing?

Julien



Re: [Pharo-users] A Turing Machine simulator written in Pharo

2016-01-14 Thread Julien Delplanque

No problem, I will do that. :)

Julien

On 14/01/16 16:33, Sven Van Caekenberghe wrote:

Julien,


On 14 Jan 2016, at 15:42, Julien Delplanque  wrote:

Hey everyone,

I had a course named "Calculabilty and Complexity" last year and I implemented 
a Turing
Machine simulator using Pharo just to see how easy/hard it would be (it was 
quite easy :) ).

I also wrote a little thing on medium about it [1] (I just took half an hour to 
review it and
I thought it was time to publish it).

Very nice, this is important.

Would you be interested to have your article included in 
https://medium.com/concerning-pharo ? If so, I believe you have to submit it 
and then I can accept it. I would love to have it there.

Sven


Just announcing it in case it case someone need/is interested by this.

There is also a github repository for the source code [2].

Julien

[1]: 
https://medium.com/@juliendelplanque/a-turing-machine-simulator-written-in-pharo-fda74e1a705b#.mo3s1a1g1
[2]: https://github.com/juliendelplanque/turing-machine








Re: [Pharo-users] A Turing Machine simulator written in Pharo

2016-01-14 Thread Julien Delplanque

:)

On 14/01/16 16:05, stepharo wrote:

Thanks I never got any lecture on this machine so I will read it :)

But there is no explanation about the mathematical model (there is too 
much things to say), just how to simulate it... :)


Le 14/1/16 15:42, Julien Delplanque a écrit :

Hey everyone,

I had a course named "Calculabilty and Complexity" last year and I 
implemented a Turing
Machine simulator using Pharo just to see how easy/hard it would be 
(it was quite easy :) ).


I also wrote a little thing on medium about it [1] (I just took half 
an hour to review it and

I thought it was time to publish it).

Just announcing it in case it case someone need/is interested by this.

There is also a github repository for the source code [2].

Julien

[1]: 
https://medium.com/@juliendelplanque/a-turing-machine-simulator-written-in-pharo-fda74e1a705b#.mo3s1a1g1

[2]: https://github.com/juliendelplanque/turing-machine










[Pharo-users] A Turing Machine simulator written in Pharo

2016-01-14 Thread Julien Delplanque

Hey everyone,

I had a course named "Calculabilty and Complexity" last year and I 
implemented a Turing
Machine simulator using Pharo just to see how easy/hard it would be (it 
was quite easy :) ).


I also wrote a little thing on medium about it [1] (I just took half an 
hour to review it and

I thought it was time to publish it).

Just announcing it in case it case someone need/is interested by this.

There is also a github repository for the source code [2].

Julien

[1]: 
https://medium.com/@juliendelplanque/a-turing-machine-simulator-written-in-pharo-fda74e1a705b#.mo3s1a1g1

[2]: https://github.com/juliendelplanque/turing-machine



Re: [Pharo-users] Small steps in a keyboard driven IDE

2015-12-14 Thread Julien Delplanque

Cool. I'll give it a try soon.

On 11/12/15 20:32, Stephan Eggermont wrote:

https://vimeo.com/148637679

Added a class view that shows the methods. Dragging them out opens
a method card, Shift-RightArrow adds a method card below the class card.
Ctrl-- makes a method card use smaller text, Ctrl-+ larger. On my 
machines I have a bug in Keymapping or the VM that breaks a + that 
normally needs a shift to press.


Stephan








Re: [Pharo-users] Magritte Tutorial [Draft]

2015-12-13 Thread Julien Delplanque

Thank you, I was actually looking for tutorials about it.

Julien

On 13/12/15 11:18, stepharo wrote:

Hi guys

Here is the ci of the magritte tutorial that I'm revising and 
collecting material for


https://ci.inria.fr/pharo-contribution/view/Books/job/Magritte/lastSuccessfulBuild/artifact/book-result/BookletMagritte.pdf 



If you want to add a chapter let me know.
I will add the ticketCorner and/or conference registration one in the 
future.


Stef






[Pharo-users] Python's argparse like CommandlineHandler?

2015-11-26 Thread Julien Delplanque

Hello,

Is there a way to specify:
- The "type" of command line arguments.
- The default value if none is given.
- That an argument is obligatory or optional?

A bit like argparse does in Python, if you know it.

Julien



[Pharo-users] Modify Pillar's pillarPostExport.sh script from pillar.conf?

2015-11-25 Thread Julien Delplanque

Hi,

I am generating LaTeX using Pillar and I would like the 
'pillarPostExport.sh'

to compile my bibliography. So, the default 'pillarPostExport.sh' do:

...
pdflatex output.tex
pdflatex output.tex
...

And I would like it to do:

...
pdflatex output.tex
bibtex biblio
pdflatex output.tex
pdflatex output.tex
...

Is it possible to override the default LaTeX's compilation script
from pillar.conf?

Julien



Re: [Pharo-users] Basic versioning of GitHub repositories from within Pharo

2015-11-23 Thread Julien Delplanque

Awesome, I'll use it soon :)

On 23/11/15 16:25, Skip Lentz wrote:

Hi everyone,

As part of my internship I am creating bindings to the GitHub API in Pharo.
As a prototype and demo, I have created a small tool last week to do some basic 
versioning, namely checking out a version, committing a version and showing a 
log of commits along with a branch tree.

Here’s a screenshot: http://i.imgur.com/iMfWOvp.png 


The repository of the bindings and the tool is here: 
http://smalltalkhub.com/#!/~Balletie/GitHub
To load the tool into your image, execute:

(ConfigurationOfGitHub project version: #development) load: #tool

Keep in mind that this is tied to GitHub, since internally it uses the API. A 
nice side effect of this is that everything can be done in-memory. That is, 
there’s no local copy on the filesystem. One does not even need git installed.

That being said, feel free to take off with my prototype and make it work with 
e.g. the LibGit bindings in Pharo.

Known bug:
- When selecting a different repository from the dropdown while a version is 
also selected in the log, one gets a DNU. To work around this for the time 
being, just deselect the version before you switch repositories.

Let me know what you think and feel free to ask some questions.

Skip





Re: [Pharo-users] [ANN] Mathex 0.3 is out! How hard would it be to give the possibility to use it with Pillar?

2015-10-27 Thread Julien Delplanque

Nice, I'll take time to implement this feature as soon as I can :).

On 26/10/15 14:37, Damien Cassou wrote:

Julien Delplanque  writes:


On 22/10/15 17:56, Damien Cassou wrote:

Julien Delplanque  writes:


I wonder how hard it would be to give the possibility to write Mathex
directly inside Pillar? Mathex provide pdf/png generation under Linux,
so it is possible to create images for non-LaTeX Pillar's exportation.

what about

${mathex:value=2 asMathex sqrt}$

Looks good but does the right part supports multi lines?

the right part ends with '}$'. If there are line breaks before, so be
it :-).






Re: [Pharo-users] [ANN] Mathex 0.3 is out! How hard would it be to give the possibility to use it with Pillar?

2015-10-22 Thread Julien Delplanque

On 22/10/15 17:56, Damien Cassou wrote:

Julien Delplanque  writes:


I wonder how hard it would be to give the possibility to write Mathex
directly inside Pillar? Mathex provide pdf/png generation under Linux,
so it is possible to create images for non-LaTeX Pillar's exportation.


what about

${mathex:value=2 asMathex sqrt}$

Looks good but does the right part supports multi lines?


This syntax already exists and it is easy to plug behavior to it. Look
at the PRAbstractAnnotation class.

Please open an issue on https://github.com/pillar-markup/pillar/issues
to discuss about it.


Ok I'll do that.

Julien



[Pharo-users] [ANN] Mathex 0.3 is out! How hard would it be to give the possibility to use it with Pillar?

2015-10-19 Thread Julien Delplanque

Hi all,

I just released Mathex 0.3, you can look at the release
note here [1] if you want. :)

I wonder how hard it would be to give the possibility to
write Mathex directly inside Pillar? Mathex provide pdf/png
generation under Linux, so it is possible to create images
for non-LaTeX Pillar's exportation.

I would like to help to do this, if someone can give me some
keys to do it I would appreciate :)

Julien

[1]: https://github.com/juliendelplanque/mathex/releases/tag/0.3





  1   2   >