[Pharo-users] state of pharo on tablets

2016-02-10 Thread Peter Uhnák
Hi,

does anyone knows what is the current state of Pharo on tablets / state of
touchscreen?

I'm considering buying a new tablet and I would like to play with Pharo
there, if that is currently possible (I've seen some videos, but I am not
sure if that was special hardware or whatnot).

So are tablets supported? Android? Windows (10)?

Thanks,
Peter


[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] Spec #focusOrder

2016-02-10 Thread Nicolai Hess
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 ?


>
> 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



Re: [Pharo-users] Spec #focusOrder

2016-02-10 Thread Nicolai Hess
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.




>
> Julien
>
>


Re: [Pharo-users] How to generate "Content-Type: application/octet-stream" with Zinc client

2016-02-10 Thread chicoary
Thanks Sven for your reply.

The curl I want reproduce with Zinc is:

curl 'http://localhost:5001/api/v0/add?stream-channels=true' \
-H 'content-type: multipart/form-data;
boundary=a831rwxi1a3gzaorw1w2z49dlsor' \
-H 'Connection: keep-alive' \
--data-binary $'--a831rwxi1a3gzaorw1w2z49dlsor\r\nContent-Type:
application/octet-stream\r\nContent-Disposition: file; name="file";
filename="file.txt"\r\n\r\nfile.txt
contents--a831rwxi1a3gzaorw1w2z49dlsor--' --compressed

It is like an example in https://github.com/ipfs/js-ipfs-api#tooling.

I want to implement the ipfs add command in my project
http://smalltalkhub.com/#!/~chicoary/SmallIPFS/.





-
http://chico...@gmail.com
--
View this message in context: 
http://forum.world.st/How-to-generate-Content-Type-application-octet-stream-with-Zinc-client-tp4876671p4876782.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.



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] How to generate "Content-Type: application/octet-stream" with Zinc client

2016-02-10 Thread Robert Kuszinger
OK. I'm an idiot. This is server code, so, another business


Robert Kuszinger  ezt írta (időpont: 2016. febr. 10.,
Sze, 14:15):

> Hello!
>
> Here is a code snippet:
>
>
> At the trivial pülace you can set whatever mime type yout think will work
> for you.
> I hope this helps.
>
> Robert
> --
>
>
> sendFile
>
> |contents stream |
>
> stream :=  FileStream readOnlyFileNamed: self file.
> stream binary.
> contents := stream contents.
> stream close.
>
>  self requestContext respond: [ :response |
>response
>*contentType: 'application/x-msdownload';*
>document: contents;
>attachmentWithFileName: self fileName
> ].
>
>
>
>
> chicoary  ezt írta (időpont: 2016. febr. 10., Sze,
> 14:08):
>
>> Thanks Sven for your reply.
>>
>> The curl I want reproduce with Zinc is:
>>
>> curl 'http://localhost:5001/api/v0/add?stream-channels=true' \
>> -H 'content-type: multipart/form-data;
>> boundary=a831rwxi1a3gzaorw1w2z49dlsor' \
>> -H 'Connection: keep-alive' \
>> --data-binary $'--a831rwxi1a3gzaorw1w2z49dlsor\r\nContent-Type:
>> application/octet-stream\r\nContent-Disposition: file; name="file";
>> filename="file.txt"\r\n\r\nfile.txt
>> contents--a831rwxi1a3gzaorw1w2z49dlsor--' --compressed
>>
>> It is like an example in https://github.com/ipfs/js-ipfs-api#tooling.
>>
>> I want to implement the ipfs add command in my project
>> http://smalltalkhub.com/#!/~chicoary/SmallIPFS/.
>>
>>
>>
>>
>>
>> -
>> http://chico...@gmail.com
>> --
>> View this message in context:
>> http://forum.world.st/How-to-generate-Content-Type-application-octet-stream-with-Zinc-client-tp4876671p4876782.html
>> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>>
>>


Re: [Pharo-users] How to generate "Content-Type: application/octet-stream" with Zinc client

2016-02-10 Thread Robert Kuszinger
Hello!

Here is a code snippet:


At the trivial pülace you can set whatever mime type yout think will work
for you.
I hope this helps.

Robert
--


sendFile

|contents stream |

stream :=  FileStream readOnlyFileNamed: self file.
stream binary.
contents := stream contents.
stream close.

 self requestContext respond: [ :response |
   response
   *contentType: 'application/x-msdownload';*
   document: contents;
   attachmentWithFileName: self fileName
].




chicoary  ezt írta (időpont: 2016. febr. 10., Sze,
14:08):

> Thanks Sven for your reply.
>
> The curl I want reproduce with Zinc is:
>
> curl 'http://localhost:5001/api/v0/add?stream-channels=true' \
> -H 'content-type: multipart/form-data;
> boundary=a831rwxi1a3gzaorw1w2z49dlsor' \
> -H 'Connection: keep-alive' \
> --data-binary $'--a831rwxi1a3gzaorw1w2z49dlsor\r\nContent-Type:
> application/octet-stream\r\nContent-Disposition: file; name="file";
> filename="file.txt"\r\n\r\nfile.txt
> contents--a831rwxi1a3gzaorw1w2z49dlsor--' --compressed
>
> It is like an example in https://github.com/ipfs/js-ipfs-api#tooling.
>
> I want to implement the ipfs add command in my project
> http://smalltalkhub.com/#!/~chicoary/SmallIPFS/.
>
>
>
>
>
> -
> http://chico...@gmail.com
> --
> View this message in context:
> http://forum.world.st/How-to-generate-Content-Type-application-octet-stream-with-Zinc-client-tp4876671p4876782.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>
>


Re: [Pharo-users] How to generate "Content-Type: application/octet-stream" with Zinc client

2016-02-10 Thread Sven Van Caekenberghe
From your netcat output I inferred that you wanted two content-type headers, 
but I don't think you do, I guess you just want to control the content-type.

When creating a ZnPart based on a file, the content-type is inferred 
automatically from the filename's extension.

The simplest solution is to use an unknown file type, like .bin or .dat which 
will result in a content-type of application/octet-stream (the default).

ZnMimePart fieldName: 'file' fileNamed: '/tmp/foo.bin'.

You could try setting the content-type after creation.

| part |
part := ZnMimePart fieldName: 'file' fileNamed: '/tmp/foo.txt'.
part headers contentType: ZnMimeType default.
part.

The methods #setContentType: could be added to ZnMimePart, I guess.

> On 10 Feb 2016, at 13:42, chicoary  wrote:
> 
> Thanks Sven for your reply.
> 
> The curl I want reproduce with Zinc is:
> 
> curl 'http://localhost:5001/api/v0/add?stream-channels=true' \
> -H 'content-type: multipart/form-data;
> boundary=a831rwxi1a3gzaorw1w2z49dlsor' \
> -H 'Connection: keep-alive' \
> --data-binary $'--a831rwxi1a3gzaorw1w2z49dlsor\r\nContent-Type:
> application/octet-stream\r\nContent-Disposition: file; name="file";
> filename="file.txt"\r\n\r\nfile.txt
> contents--a831rwxi1a3gzaorw1w2z49dlsor--' --compressed
> 
> It is like an example in https://github.com/ipfs/js-ipfs-api#tooling.
> 
> I want to implement the ipfs add command in my project
> http://smalltalkhub.com/#!/~chicoary/SmallIPFS/.
> 
> 
> 
> 
> 
> -
> http://chico...@gmail.com
> --
> View this message in context: 
> http://forum.world.st/How-to-generate-Content-Type-application-octet-stream-with-Zinc-client-tp4876671p4876782.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
> 




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



[Pharo-users] Huge image

2016-02-10 Thread Davide Varvello via Pharo-users
--- Begin Message ---
Guys, I've a bloated image and I don't know why it's so huge and how to
shrink it.
It happened that my image has grown from 50MB to 440MB in a morning.

I've already followed these suggestions
https://github.com/pharo-project/pharo-core/wiki/Memory-Hogs and flushing
monticello repos the image reduced itself to 219MB, better.

Anyway I don't know how to reduce it more. Evaluating: SmalltalkImage
current reportCPUandRAM I found 

you can see ByteStrings occupy 85.5% of space!

I tried to inspect instances of ByteString, but I can't find anything worth
of. If I Open pointers to the instance I find references to GLMPanePort,
GLMPane and NodeModel (see attached png)

I'm on Pharo 4

TIA
Davide

 



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

--- End Message ---


Re: [Pharo-users] Huge image

2016-02-10 Thread Dale Henrichs

David,

I don't have a direct solution, but I have been playing with an analysis 
technique for solving this particular type of problem: scads of Strings 
and a need to "make sense of the reference graph".


If you look at this example[1], you'll see that there are 202K instances 
of String (this example is from a GemStone db). the nodes pointing to 
the String node, show that of the 202K strings, there are 70K instances 
of Array referencing one or more of the 202k strings; 47K instances of 
MCVersionInfo  and 43K MethodVersionRecord instances.


I've found that this approach can help you understand why you have so 
many strings ...


The basic technique is to gather the instances of String, then for each 
instance of string, gather the collection of objects that reference the 
String instance and summarize the reference by class instance count and 
keep an IdentitySet of the instances referencing Strings by class so 
that you can build the next level of references 


 For GemStone, this information is displayed using Roassal2 and the 
calculations are done by scanning a backup of the repository...


You could probably brute force calculate this in Pharo (be sure to 
isolate the objects that you are using in your analysis from the set of 
objects being analyzed otherwise things get out of control ...


HTH,

Dale


[1] 
https://github.com/dalehenrich/obex#class-instance-counts-based-on-selected-set-of-instances






Re: [Pharo-users] Rép: How to display Dictionary using TreeModel

2016-02-10 Thread Христина Михайлюк
Thank you very much =)

2016-02-09 23:45 GMT+02:00 julien :

> Hi, try something like:
>
> tm := TreeModel new.
> tm roots: yourCollection.
> tm hasChildrenBlock: [ :item | item isDictionnary ].
> tm childrenBlock: [ :item | item keysAndValues ].
>
> I wrote that from my phone but I think it is working. Else it shows you
> the idea :)
>
> Julien
>
> Khrystyna Mykhailiuk  a écrit :
>
> >Hi, all!
> >
> >I have OrderedCollection of Dictionaries and I want to display content of
> >each Dictionary using TreeModel.
> >I wrote these code, but it doesn't work correctly. And I get some errors.
> >
> >mt := TreeModel new.
> >mt roots: (collectionFirst select: OrderedCollection new);
> >childrenBlock: [ :item | item ].
> >mt openWithSpec.
> >
> >(This is screenshot of my work)
> >
> >
> >I need to show each pair of Dictionary in new node.
> >
> >Can you help me, please?
> >
> >
> >
> >--
> >View this message in context:
> http://forum.world.st/How-to-display-Dictionary-using-TreeModel-tp4876653.html
> >Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
> >
>


Re: [Pharo-users] [Bulk] smalltalk banner or poster for FOSSASIA conference.

2016-02-10 Thread Offray Vladimir Luna Cárdenas

Hi,

On 10/02/16 00:46, Martin Bähr wrote:

Excerpts from Hernán Morales Durand's message of 2016-02-09 22:39:56 +0100:

Last year there was a poster made by Adam a...@234.cz
I don't know if that fits your goals, the poster license or if he's still
around, maybe you could check with him if there's an update.

that one was my first thought actually:
https://github.com/AdamSadovsky/pharo-family

it is a bit dense for a banner though, as people won't usually get close to it
to read.

greetings, martin.



I agreed. It gives a good panoramic overview of the Pharo ecosystem with 
a thematic approach.


Cheers,

Offray



Re: [Pharo-users] Huge image

2016-02-10 Thread Davide Varvello via Pharo-users
--- Begin Message ---
I don't know why my original message isn't accepted by the list, but it's on
forum: http://forum.world.st/Huge-image-td4876854.html

Anyway, thanks Dale, I'm going to try your suggestion. 

Davide



Dale Henrichs-3 wrote
> David,
> 
> I don't have a direct solution, but I have been playing with an analysis 
> technique for solving this particular type of problem: scads of Strings 
> and a need to "make sense of the reference graph".
> 
> If you look at this example[1], you'll see that there are 202K instances 
> of String (this example is from a GemStone db). the nodes pointing to 
> the String node, show that of the 202K strings, there are 70K instances 
> of Array referencing one or more of the 202k strings; 47K instances of 
> MCVersionInfo  and 43K MethodVersionRecord instances.
> 
> I've found that this approach can help you understand why you have so 
> many strings ...
> 
> The basic technique is to gather the instances of String, then for each 
> instance of string, gather the collection of objects that reference the 
> String instance and summarize the reference by class instance count and 
> keep an IdentitySet of the instances referencing Strings by class so 
> that you can build the next level of references 
> 
>   For GemStone, this information is displayed using Roassal2 and the 
> calculations are done by scanning a backup of the repository...
> 
> You could probably brute force calculate this in Pharo (be sure to 
> isolate the objects that you are using in your analysis from the set of 
> objects being analyzed otherwise things get out of control ...
> 
> HTH,
> 
> Dale
> 
> 
> [1] 
> https://github.com/dalehenrich/obex#class-instance-counts-based-on-selected-set-of-instances





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

--- End Message ---