Re: [Pharo-users] [Pharo-dev] spec question

2014-06-27 Thread stepharo

Hi guys

I do not have the answer but I know that I want to slowly make sure that 
all the widgets manages better the fonts and not blindly refer to

StandardsFont.

Setf




2014-06-26 23:13 GMT+02:00 Pablo R. Digonzelli >:



Hi all, two questions about Spec.

1) How can i change the font for a ListModel or TextModel?

2)  I try , but nothing happend . I does not work but there is no
error also

l := ListModel new.
l backgroundColorBlock: [ Color red ].
l openWithSpec .

Can I change de backcolor of ListModel ?

Sorry for my english.

TIA





*Ing. Pablo Digonzelli*
Software Solutions
IP-Solutiones SRL
Metrotec SRL
25 de Mayo 521
Email: pdigonze...@softsargentina.com

pdigonze...@gmail.com 
Cel: 5493815982714




About the font: I don't know if this is possible.

For the background color:

This works only for the background of the list cells. If there is no entry
in your listmodel list, the list view is empty as well and there is 
nothing

to show.

This works:

ListModel new
items: (1 to: 10);
backgroundColorBlock: [ :item :index |Color red ];
openWithSpec.

or with more colors :)

ListModel new
items: Color registeredColorNames ;
backgroundColorBlock: [ :item :index | Color named:item];
openWithSpec.






Re: [Pharo-users] [Pharo-dev] spec question

2014-06-27 Thread Yuriy Tymchuk
Sorry, a small remark, as you mentioned fonts.

We could use the icon magic that for example github is using: 
http://octicons.github.com

Uko

On 27 Jun 2014, at 09:29, stepharo  wrote:

> Hi guys
> 
> I do not have the answer but I know that I want to slowly make sure that all 
> the widgets manages better the fonts and not blindly refer to 
> StandardsFont.
> 
> Setf
> 
> 
>> 
>> 2014-06-26 23:13 GMT+02:00 Pablo R. Digonzelli :
>> 
>> Hi all, two questions about Spec.
>> 
>> 1) How can i change the font for a ListModel or TextModel?
>> 
>> 2)  I try , but nothing happend . I does not work but there is no error also
>> 
>> l := ListModel new.
>> l backgroundColorBlock: [ Color red ].
>> l openWithSpec . 
>> 
>> Can I change de backcolor of ListModel ?
>> 
>> Sorry for my english.
>> 
>> TIA
>> 
>> 
>> 
>> Ing. Pablo Digonzelli
>> Software Solutions
>> IP-Solutiones SRL
>> Metrotec SRL
>> 25 de Mayo 521
>> Email: pdigonze...@softsargentina.com
>> pdigonze...@gmail.com
>> Cel: 5493815982714
>> 
>> 
>> 
>> 
>> About the font: I don't know if this is possible.
>> 
>> For the background color:
>> 
>> This works only for the background of the list cells. If there is no entry
>> in your listmodel list, the list view is empty as well and there is nothing
>> to show.
>> 
>> This works:
>> 
>> ListModel new 
>> items: (1 to: 10);
>> backgroundColorBlock: [ :item :index |Color red ];
>> openWithSpec.
>> 
>> or with more colors :)
>> 
>> ListModel new 
>> items: Color registeredColorNames ;
>> backgroundColorBlock: [ :item :index | Color named:item];
>> openWithSpec.
>> 
>> 
> 



Re: [Pharo-users] A question about sets

2014-06-27 Thread hilaire
Why do you need a set for that? An array is enough. 
But please go on.

Hilaire



--
View this message in context: 
http://forum.world.st/A-question-about-sets-tp4763094p4765282.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.



[Pharo-users] Reading the last n lines from a file without using lots of memory

2014-06-27 Thread p...@highoctane.be
I wonder how you guys would read the last n lines from a file in Pharo
without reading through the whole thing.

Is there code doing just that somewhere?

The code I have is a shell script doing a 'tac file | tail -200 >
/temp/something'

I can always do that through OSProcess but wondered if there was something
available.

Reading through with a 200-entries FIFO circular buffer seems a bit silly
to do.

TIA
Phil


Re: [Pharo-users] Reading the last n lines from a file without using lots of memory

2014-06-27 Thread Guillermo Polito
If you have a MultiByteFileStream you can do

stream position: stream size - 200.
stream next: 200.

Have a look at RemoteString, which is the class used to read the source
from the source and changes files (without loading all of them into memory)


On Fri, Jun 27, 2014 at 6:15 PM, p...@highoctane.be 
wrote:

> I wonder how you guys would read the last n lines from a file in Pharo
> without reading through the whole thing.
>
> Is there code doing just that somewhere?
>
> The code I have is a shell script doing a 'tac file | tail -200 >
> /temp/something'
>
> I can always do that through OSProcess but wondered if there was something
> available.
>
> Reading through with a 200-entries FIFO circular buffer seems a bit silly
> to do.
>
> TIA
> Phil
>
>
>


Re: [Pharo-users] Reading the last n lines from a file without using lots of memory

2014-06-27 Thread p...@highoctane.be
Thanks.

But this would give me the 200 last chars. I am interested in the 200 last
lines.

Now, I did this:

command := 'tac ', file fullName, ' | head -200'.
^ (PipeableOSProcess command: command) output.

which did the trick but isn't portable at all (Linux here).

I had a look at RemoteString as well.

Phil


On Fri, Jun 27, 2014 at 6:21 PM, Guillermo Polito  wrote:

> If you have a MultiByteFileStream you can do
>
> stream position: stream size - 200.
> stream next: 200.
>
> Have a look at RemoteString, which is the class used to read the source
> from the source and changes files (without loading all of them into memory)
>
>
> On Fri, Jun 27, 2014 at 6:15 PM, p...@highoctane.be 
> wrote:
>
>> I wonder how you guys would read the last n lines from a file in Pharo
>> without reading through the whole thing.
>>
>> Is there code doing just that somewhere?
>>
>> The code I have is a shell script doing a 'tac file | tail -200 >
>> /temp/something'
>>
>> I can always do that through OSProcess but wondered if there was
>> something available.
>>
>> Reading through with a 200-entries FIFO circular buffer seems a bit silly
>> to do.
>>
>> TIA
>> Phil
>>
>>
>>
>


Re: [Pharo-users] Reading the last n lines from a file without using lots of memory

2014-06-27 Thread Sven Van Caekenberghe
http://stackoverflow.com/questions/10164597/how-would-you-implement-tail-efficiently
http://git.savannah.gnu.org/cgit/coreutils.git/tree/src/tail.c

I would work with the growing buffer read backwards.
It would be great fun doing that in Pharo.

On 27 Jun 2014, at 18:50, p...@highoctane.be wrote:

> Thanks.
> 
> But this would give me the 200 last chars. I am interested in the 200 last 
> lines.
> 
> Now, I did this: 
> 
> command := 'tac ', file fullName, ' | head -200'.
> ^ (PipeableOSProcess command: command) output.
> 
> which did the trick but isn't portable at all (Linux here).
> 
> I had a look at RemoteString as well.
> 
> Phil
> 
> 
> On Fri, Jun 27, 2014 at 6:21 PM, Guillermo Polito  
> wrote:
> If you have a MultiByteFileStream you can do
> 
> stream position: stream size - 200.
> stream next: 200.
> 
> Have a look at RemoteString, which is the class used to read the source from 
> the source and changes files (without loading all of them into memory)
> 
> 
> On Fri, Jun 27, 2014 at 6:15 PM, p...@highoctane.be  
> wrote:
> I wonder how you guys would read the last n lines from a file in Pharo 
> without reading through the whole thing.
> 
> Is there code doing just that somewhere?
> 
> The code I have is a shell script doing a 'tac file | tail -200 > 
> /temp/something'
> 
> I can always do that through OSProcess but wondered if there was something 
> available.
> 
> Reading through with a 200-entries FIFO circular buffer seems a bit silly to 
> do.
> 
> TIA
> Phil
> 
> 
> 
> 




Re: [Pharo-users] Reading the last n lines from a file without using lots of memory

2014-06-27 Thread David T. Lewis
On Fri, Jun 27, 2014 at 06:50:11PM +0200, p...@highoctane.be wrote:
> Thanks.
> 
> But this would give me the 200 last chars. I am interested in the 200 last
> lines.
> 
> Now, I did this:
> 
> command := 'tac ', file fullName, ' | head -200'.
> ^ (PipeableOSProcess command: command) output.
> 
> which did the trick but isn't portable at all (Linux here).


Don't forget to close the pipes on that PipeableOSProcess when you are done 
using it :-)


Dave



Re: [Pharo-users] A question about sets

2014-06-27 Thread Alain Busser
You're right but it should not have a fixed length because I want to remove
numbers from it. I guess an SortedCollection is the best way to retrieve
the next prime number. And the exercise is a good way to discover select
and reject...

Alain


On Fri, Jun 27, 2014 at 1:41 PM, hilaire  wrote:

> Why do you need a set for that? An array is enough.
> But please go on.
>
> Hilaire
>
>
>
> --
> View this message in context:
> http://forum.world.st/A-question-about-sets-tp4763094p4765282.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>
>


Re: [Pharo-users] Reading the last n lines from a file without using lots of memory

2014-06-27 Thread p...@highoctane.be
Le 28 juin 2014 01:18, "David T. Lewis"  a écrit :
>
> On Fri, Jun 27, 2014 at 06:50:11PM +0200, p...@highoctane.be wrote:
> > Thanks.
> >
> > But this would give me the 200 last chars. I am interested in the 200
last
> > lines.
> >
> > Now, I did this:
> >
> > command := 'tac ', file fullName, ' | head -200'.
> > ^ (PipeableOSProcess command: command) output.
> >
> > which did the trick but isn't portable at all (Linux here).
>
> 
> Don't forget to close the pipes on that PipeableOSProcess when you are
done using it :-)
> 

Isn't output closing them? Command is a complete string here.

Phil
>
> Dave
>
>


Re: [Pharo-users] A question about sets

2014-06-27 Thread p...@highoctane.be
Fun French Smalltalk.

Il y a une version dispo?

Phil
Le 25 juin 2014 18:33, "Alain Busser"  a écrit :

> About the birthday problem, I already pulished something that I had
> exeperimented in the classroom, but it is in French:
> http://irem.univ-reunion.fr/spip.php?article618 (clic on "problème des
> anniversaires" tab). The idea is that if you add say 30 times a "365
> atRandom" to a bag (instead of a set) it happens now and then that a number
> appear more than once. In this classroom, two students actually had the
> same birthday, and they were eager to know of it happens often, so that
> they were very active for this exercise.
>
> Happy reading ;-)
>
> Alain
>
>
> On Wed, Jun 25, 2014 at 12:10 PM, hilaire  wrote:
>
>> Alain,
>>
>> I love very much your cultural insight and I would like to see more
>> examples
>> like this one applied to Dr. Geo scripting or Smalltalk sketches.
>> Personally, I don't have the time to both develop Dr. Geo *and* to
>> investigate such examples; contributions like yours are more than welcome.
>>
>> Thanks
>>
>> Hilaire
>>
>>
>>
>> --
>> View this message in context:
>> http://forum.world.st/A-question-about-sets-tp4763094p4764640.html
>> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>>
>>
>