[Pharo-users] SPLASH-I 2016: Call for Talk Proposals!

2016-05-11 Thread Tijs van der Storm
SPLASH-I: Innovation, Interaction, Insight, Industry, Invited

The ACM SIGPLAN conference on Systems, Programming, Languages and
Applications: Software for Humanity (SPLASH) embraces all aspects of
software construction and delivery to make it the premier conference at the
intersection of programming, languages, and software engineering. SPLASH
2016 will take place from Sunday, October 30 to Friday, November 4, 2016 in
Amsterdam, The Netherlands.

SPLASH-I is the track of SPLASH dedicated to great talks on exciting
topics! SPLASH-I will run in parallel with all of SPLASH (during the week
days), and is open to all attendees. SPLASH-I will host both invited talks
and selected talks submitted via this call for proposals. SPLASH-I solicits
inspiring talks, tutorials and demonstrations on exciting topics related to
programming and programming systems, delivered by excellent speakers from
academia or industry.

SPLASH-I caters for three categories of presentations:

- Regular talks on programming languages, systems or concepts;
- Tutorials aimed at introducing particular tools, systems, or languages
- Demonstrations showing off cool programming technology.

All slots in SPLASH-I are 45 minutes.

Please submit proposals here: http://goo.gl/forms/FZqQwpd73G
Have a suggestion for a great speaker and topic? Suggest it here:
http://goo.gl/forms/MWzgStWkww

SPLASH-I maintains two deadlines: 1st of June, and, if there are still
slots available, 1st of August.

Websites: http://2016.splashcon.org/track/splash-2016-splash-i

Organization: Eelco Visser (TU Delft), Tijs van der Storm (CWI)

Committee:
 - Matthias Hauswirth (University of Lugano)
 - Igor Peshansky (Google)
 - Tiark Rompf (Purdue & Oracle Labs)
 - Jurgen Vinju (CWI)


[Pharo-users] Temporary files

2016-05-11 Thread Valentin Ryckewaert
Hello everyone,

I would like to use a temporary file for a project and I didn't find an
existing method.
I'm asking my self if it's a better idea to use ffi or OSSubProcess (or
something already build for it) to build a method able to create this tmp
file.
Someone could help me please?

PS : Should it be a good idea to add this method directly in Pharo ?


[Pharo-users] Keystroke in ComposableModel

2016-05-11 Thread Khrystyna Mykhailiuk
Hello!

I  would like to implement some shortcuts at the window of an object of
ComposableModel class.
Can anybody help me to understand which methods I should override?



--
View this message in context: 
http://forum.world.st/Keystroke-in-ComposableModel-tp4894301.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.



Re: [Pharo-users] Semaphore wait and signal

2016-05-11 Thread Ben Coman
On Tue, May 10, 2016 at 6:31 PM, Vince Refiti  wrote:
> Hello
>
> I am playing around with Semaphore, and wrote the following:

[snip]

> Can someone please explain this pattern?

I rearranged again to make the output self explanatory...

  | coll count sem |
  Transcript clear; show: 'count' ; tab; show: 'each'.
  coll := Array withAll: (1 to: 99).
  count := 0.
  sem := Semaphore new.
  coll do:
  [   :each |
  count := count + 1.
  Transcript crShow: count printString; tab.
  (count >= 5) ifTrue:
  [ sem isSignaled
   ifTrue: [
   Transcript tab; show: 'consumeExcess, nowait, '.
sem wait ]
   ifFalse: [
  Transcript tab; show: 'main/UI waits on sem'.
   sem wait.
   Transcript cr; tab; tab;
  show: 'main/UI runs, excessSignals ' ;
  show: sem excessSignals printString; cr; tab. ]
   ].

 Transcript tab ; show: each printString, ' queued to run'.
  [count := count -1.
   Transcript crShow: count printString; tab ; tab;
  show: each printString,  ' runs, signals sem'.
sem signal.
sem isSignaled ifFalse: [  Transcript show: ', UI queued to run' ].
  ] fork.
  ]



On Tue, May 10, 2016 at 6:31 PM, Vince Refiti  wrote:
> Hello
>
> I am playing around with Semaphore, and wrote the following:

[snip]

> Can someone please explain this pattern?

I rearranged again to make the output self explanatory...

  | coll count sem |
  Transcript clear; show: 'count' ; tab; show: 'each'.
  coll := Array withAll: (1 to: 99).
  count := 0.
  sem := Semaphore new.
  coll do:
  [   :each |
  count := count + 1.
  Transcript crShow: count printString; tab.
  (count >= 5) ifTrue:
  [ sem isSignaled
   ifTrue: [
   Transcript tab; show: 'nowait '.
sem wait ]
   ifFalse: [
  Transcript tab; show: 'main/UI waits on sem'.
   sem wait.
   Transcript cr; tab; tab;
  show: 'main/UI runs, excessSignals ' ;
  show: sem excessSignals printString; cr; tab. ]
   ].

 Transcript tab ; show: each printString, ' queued to run'.
  [count := count -1.
   Transcript crShow: count printString; tab ; tab;
  show: each printString,  ' runs, signals sem'.
sem signal.
sem isSignaled ifFalse: [  Transcript show: ', main/UI
queued to run' ].
  ] fork.
  ]


count each
11 queued to run
22 queued to run
33 queued to run
44 queued to run
5main/UI waits on sem
41 runs, signals sem, main/UI queued to run
32 runs, signals sem
23 runs, signals sem
14 runs, signals sem
 main/UI runs, excessSignals 3
 5 queued to run
26 queued to run
37 queued to run
48 queued to run
5consumeExcess, nowait, 9 queued to run
6consumeExcess, nowait, 10 queued to run
7consumeExcess, nowait, 11 queued to run
8main/UI waits on sem
75 runs, signals sem, main/UI queued to run
66 runs, signals sem
57 runs, signals sem
48 runs, signals sem
39 runs, signals sem
210 runs, signals sem
111 runs, signals sem
 main/UI runs, excessSignals 6
 12 queued to run
213 queued to run
314 queued to run
415 queued to run
5consumeExcess, nowait, 16 queued to run
6consumeExcess, nowait, 17 queued to run
7consumeExcess, nowait, 18 queued to run
8consumeExcess, nowait, 19 queued to run
9consumeExcess, nowait, 20 queued to run
10   consumeExcess, nowait, 21 queued to run
11   main/UI waits on sem
10   12 runs, signals sem, main/UI queued to run
913 runs, signals sem
814 runs, signals sem
715 runs, signals sem
616 runs, signals sem
517 runs, signals sem
418 runs, signals sem
319 runs, signals sem
220 runs, signals sem
121 runs, signals sem
 main/UI runs, excessSignals 9
 22 queued to run
223 queued to run
324 queued to run
425 queued to run
5consumeExcess, nowait, 26 queued to run
6consumeExcess, nowait, 27 queued to run
7consumeExcess, nowait, 28 queued to run
8consumeExcess, nowait, 29 queued to run
9consumeExcess, nowait, 30 queued to run
10   consumeExcess, nowait, 31 queued to run
11   consumeExcess, nowait, 32 queued to run
12   consumeExcess, nowait, 33 queued to run
13   consumeExcess, nowait, 34 queued to run
14   main/UI waits on sem
13   22 runs, signals sem, main/UI queued to run
12   23 runs, signals sem
11   24 runs, signals sem
10   25 runs, signals sem
926 runs, signals sem
827 runs, signals sem
728 runs, signals sem
629 runs, signals sem
530 runs, signals sem
431 runs, signals sem
332 runs, signals sem
233 runs, signals sem
134 runs, signals sem
 

Re: [Pharo-users] Temporary files

2016-05-11 Thread Cyril Ferlicot Delbecque


On 11/05/2016 15:01, Valentin Ryckewaert wrote:
> Hello everyone,
> 
> I would like to use a temporary file for a project and I didn't find an
> existing method.
> I'm asking my self if it's a better idea to use ffi or OSSubProcess (or
> something already build for it) to build a method able to create this
> tmp file.
> Someone could help me please?
> 
> PS : Should it be a good idea to add this method directly in Pharo ?

Hi,

For temporary files you can create a new file in memory via `FileSystem
memory` so you do not pollute your file system and the file will be
deleted later since the memory is volatile.

`file := FileSystem memory / 'tmp.txt'.
file ensureCreateFile.
file writeStreamDo: [ :s | s nextPutAll: 'Hello World' ].`

-- 
Cyril Ferlicot

http://www.synectique.eu

165 Avenue Bretagne
Lille 59000 France



signature.asc
Description: OpenPGP digital signature


Re: [Pharo-users] Temporary files

2016-05-11 Thread Sven Van Caekenberghe
Check out FileReference class>>#newTempFilePrefix:suffix:

> On 11 May 2016, at 15:01, Valentin Ryckewaert  
> wrote:
> 
> Hello everyone,
> 
> I would like to use a temporary file for a project and I didn't find an 
> existing method.
> I'm asking my self if it's a better idea to use ffi or OSSubProcess (or 
> something already build for it) to build a method able to create this tmp 
> file.
> Someone could help me please?
> 
> PS : Should it be a good idea to add this method directly in Pharo ?




[Pharo-users] OrderedCollection get all lines

2016-05-11 Thread Valentin Ryckewaert
Hi,

I would like to reproduce the grep command in Pharo.
To do it I wanted to get the content of a stream and transform it to an
OrderedCollection (to use matchesRegex: on it).

First of all, is there an easier way to do it?
In a second time, is there a method to get the content of a Stream as an
OrderedCollection ? (nextLine exists so I could use it to get my
OrderedCollection but is there an easier way?)


Re: [Pharo-users] OrderedCollection get all lines

2016-05-11 Thread Sven Van Caekenberghe
Did you see #lines and #linesDo: ?

> On 11 May 2016, at 16:15, Valentin Ryckewaert  
> wrote:
> 
> Hi,
> 
> I would like to reproduce the grep command in Pharo.
> To do it I wanted to get the content of a stream and transform it to an 
> OrderedCollection (to use matchesRegex: on it).
> 
> First of all, is there an easier way to do it?
> In a second time, is there a method to get the content of a Stream as an 
> OrderedCollection ? (nextLine exists so I could use it to get my 
> OrderedCollection but is there an easier way?)




Re: [Pharo-users] OrderedCollection get all lines

2016-05-11 Thread Valentin Ryckewaert
Thanks you again Sven, it will work with that, but there is nothing on
Streams?


2016-05-11 16:19 GMT+02:00 Sven Van Caekenberghe :

> Did you see #lines and #linesDo: ?
>
> > On 11 May 2016, at 16:15, Valentin Ryckewaert <
> valentin.ryckewa...@gmail.com> wrote:
> >
> > Hi,
> >
> > I would like to reproduce the grep command in Pharo.
> > To do it I wanted to get the content of a stream and transform it to an
> OrderedCollection (to use matchesRegex: on it).
> >
> > First of all, is there an easier way to do it?
> > In a second time, is there a method to get the content of a Stream as an
> OrderedCollection ? (nextLine exists so I could use it to get my
> OrderedCollection but is there an easier way?)
>
>
>


Re: [Pharo-users] OrderedCollection get all lines

2016-05-11 Thread Sven Van Caekenberghe

> On 11 May 2016, at 16:22, Valentin Ryckewaert  
> wrote:
> 
> Thanks you again Sven, it will work with that, but there is nothing on 
> Streams? 

If performance is not too important, just read the whole contents of the file.

BTW, this is actually example 19 of 'Elegant Pharo Code':

https://medium.com/concerning-pharo/elegant-pharo-code-bb590f0856d0

'^.*.jpg' asRegex in: [ :regex |
  '/tmp/foo.txt' asFileReference contents lines 
select: [ :line | regex matches: line ] ]

> 2016-05-11 16:19 GMT+02:00 Sven Van Caekenberghe :
> Did you see #lines and #linesDo: ?
> 
> > On 11 May 2016, at 16:15, Valentin Ryckewaert 
> >  wrote:
> >
> > Hi,
> >
> > I would like to reproduce the grep command in Pharo.
> > To do it I wanted to get the content of a stream and transform it to an 
> > OrderedCollection (to use matchesRegex: on it).
> >
> > First of all, is there an easier way to do it?
> > In a second time, is there a method to get the content of a Stream as an 
> > OrderedCollection ? (nextLine exists so I could use it to get my 
> > OrderedCollection but is there an easier way?)
> 
> 
> 




Re: [Pharo-users] OrderedCollection get all lines

2016-05-11 Thread Henrik Sperre Johansen
There's also PositionableStream >> #nextLine
which lets you write code like

[readStream atEnd] whileFalse: 
   [(self regexMatch: readStream nextLine)
   ifNotNil: [:matchingLine | "Record match somewhere here"]]

Cheers,
Henry



--
View this message in context: 
http://forum.world.st/OrderedCollection-get-all-lines-tp4894314p4894324.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.



Re: [Pharo-users] Keystroke in ComposableModel

2016-05-11 Thread Stephan Eggermont

On 11-05-16 14:32, Khrystyna Mykhailiuk wrote:

I  would like to implement some shortcuts at the window of an object of
ComposableModel class.
Can anybody help me to understand which methods I should override?

Just take a look at #bindKeyCombination:toAction: and its senders

Stephan




Re: [Pharo-users] Keystroke in ComposableModel

2016-05-11 Thread Христина Михайлюк
Thanks a lot.

2016-05-11 20:48 GMT+03:00 Stephan Eggermont :

> On 11-05-16 14:32, Khrystyna Mykhailiuk wrote:
>
>> I  would like to implement some shortcuts at the window of an object of
>> ComposableModel class.
>> Can anybody help me to understand which methods I should override?
>>
> Just take a look at #bindKeyCombination:toAction: and its senders
>
> Stephan
>
>
>