Re: [Pharo-users] Easiest way to wrap around the indexed value in a list (mod doesn't quite work)

2019-03-29 Thread Esteban Maringolo
I would do it as an iterator (a circular one).
The structure of the underlying list is irrelevant here (as long as it is
sequenceable), IMO.

Regards,

El vie., 29 de mar. de 2019 07:21, Peter Kenny 
escribió:

> Tim
>
> But the beauty of Smalltalk is that, if you need to use a particular
> structure frequently, you can make it an object just by subclassing
> something useful. In this case, you could create CircularList by
> subclassing
> SequenceableCollection and re-implementing #before and #after (and maybe
> tidying up #add if you don't want the circle to be extendable).
>
> Pursuing this line of thought, we  already have one specialized subclass in
> LinkedList. If the last element is linked to the first, this becomes
> circular. I glanced at some of the methods to see how well this would work,
> but because it regards links as separate from the linked objects, it got
> too
> complicated. But it could give a starting point if you have lots of such
> cases.
>
> HTH
>
> Peter Kenny
>
>
> Tim Mackinnon wrote
> > Hey thanks guys - while it certainly makes sense when you think about it,
> > I was kind of hoping we had something that was much more readable and
> > obvious. It seems strange that when we have lots of esoteric things in
> > collection, that something which is quite common to do isn’t there. I was
> > kind of hoping we might have some circular list or something.
> >
> > As it stands, if you really want to communicate this clearly you are
> > almost better off just doing, the more obvious:
> >
> > (Index := index - 1) = 0 ifTrue: [index := items size].
> >
> > Anyway, an interesting one.
> >
> > Tim
> >
> >> On 28 Mar 2019, at 16:55, Peter Kenny <
>
> > peter@.co
>
> > > wrote:
> >>
> >> Tim
> >>
> >> I found myself puzzling as to *why* James's solution works. This longer
> >> explanation helped me to understand.
> >>
> >> First, generalize moving forward to moving an arbitrary number of steps,
> >> still with wrapping.
> >>
> >> ^list at: (index + move - 1 \\ size + 1
> >>
> >> Second, realize that moving backward one step with wrapping is exactly
> >> equivalent to moving forward (size - 1) steps - because of wrapping, a
> >> move
> >> of size steps is null.
> >>
> >> Finally, substitute move = size - 1.
> >>
> >> ^list at: (index + size - 2 \\ size + 1.
> >>
> >> This can of course easily generalize to backward moves of any size.
> >>
> >> HTH
> >>
> >> Peter Kenny
> >>
> >>
> >>
> >> --
> >> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
> >>
>
>
>
>
>
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>
>


Re: [Pharo-users] How to catch and handle multiple exceptions

2019-04-08 Thread Esteban Maringolo
Richard,

I was going to comment the #when:do:[when:do:] approach of VAST [1].

Why do you say it won't be fast? Because of the multiple exception
handlers in the call stack?

I think that some construct might be used to obtain the same as the
#when:do:when:do: but using a chained approach instead.

Regards,

[1] AFAIR when I used VAST (+a decade ago) it didn't have "ANSI" exceptions.

Esteban A. Maringolo

El lun., 8 abr. 2019 a las 0:49, Richard O'Keefe () escribió:
>
> VisualAge Smalltalk has, in addition to the standard #on:do:,
> #when:do:, ..., #when:do:#when:do:#when:do:#when:do:#when:do:,
> with the last four mapping to #whenOneOf:doMatching:, taking
> two arrays.
>
> It's easy enough to add your own methods like
> on: exn1 do: act1 on: exn2 do: act2
> "An imperfect emulation of VAST's #when:do:when:do:"
> ^[self on: exn1 do: act1] on: exn2 do: act2
>
> on: exn1 do: act1 on: exn2 do: act2 on: exn3 do: act3
> "An imperfect emulation of VAST's #when:do:when:do:when:do:"
> ^[[self on: exn1 do: act1] on: exn2 do: act2] on: exn3 do: act3
> to BlockClosure.  It won't be fast, but your code might be
> clearer.
>
>
> On Mon, 8 Apr 2019 at 10:21, Tim Mackinnon  wrote:
>>
>>
>> Thanks, I guess that makes sense, although it somehow looks a bit ugly with 
>> the nested brackets.. but nothing else springs to mind so maybe I’ll get 
>> used to it (and In my case I think it’s likely 2 or 3 different exceptions)
>>
>> Tim
>>
>> Sent from my iPhone
>>
>> > On 7 Apr 2019, at 20:43, Richard Sargent 
>> >  wrote:
>> >
>> >
>> > This last one.
>> >
>> > [[self run]
>> > on: TestFailure
>> > do: [:testEx | ...]]
>> > on: Error
>> > do: [:error | ...]
>>
>>



Re: [Pharo-users] How to catch and handle multiple exceptions

2019-04-08 Thread Esteban Maringolo
Maybe the abstraction needed wraps everything within a single handler,
but internally does a switch like statement dispatching to a
particular error handler block.

handledBlock
  exceptionDispatcher
on: NotFoundError do: [:ex | ...];
on: MessageNotUnderstood do: [:ex | .. ].

BlockClosure>>exceptionDispatcher

| exceptionDispatcher|
exceptionDispatcher:= ExceptionDispatcher new.
self on: Exception do: [:ex | dispatcher handle: ex ].
^exceptionDispatcher


ExceptionDispatcher>>on: exceptionClass do: aBlock
  self handlers add: exceptionClass -> aBlock

The #exceptionDispatcher method would return this special object that
deals with the resolution of each exception class (how to sort them
would't be trivial unless done naively). But any resignalling would be
only one level deep.

Disclaimer: I just wrote the code as I replied this email, not
guaranteed to work :)


Esteban A. Maringolo

El lun., 8 abr. 2019 a las 10:09, jtuc...@objektfabrik.de
() escribió:
>
> Am 08.04.19 um 14:39 schrieb Richard O'Keefe:
>
>
>> >
>> > It's easy enough to add your own methods like
>> > on: exn1 do: act1 on: exn2 do: act2
>> > "An imperfect emulation of VAST's #when:do:when:do:"
>> > ^[self on: exn1 do: act1] on: exn2 do: act2
>> >
>> > on: exn1 do: act1 on: exn2 do: act2 on: exn3 do: act3
>> > "An imperfect emulation of VAST's #when:do:when:do:when:do:"
>> > ^[[self on: exn1 do: act1] on: exn2 do: act2] on: exn3 do: act3
>> > to BlockClosure.  It won't be fast, but your code might be
>> > clearer.
>
> well, an unwanted side effect might be that the handling of exn1 is also 
> guarded by the outer on:do: .
>
> Not that this has to be a problem but it introduces new things to think about 
> when you want to #resignalAs: and such.
>
>
> --
> ---
> Objektfabrik Joachim Tuchel  mailto:jtuc...@objektfabrik.de
> Fliederweg 1 http://www.objektfabrik.de
> D-71640 Ludwigsburg  http://joachimtuchel.wordpress.com
> Telefon: +49 7141 56 10 86 0 Fax: +49 7141 56 10 86 1
>
>



Re: [Pharo-users] [OT] (slightly) What makes other dialects "enjoyable" for you? (WAS: difference between double dispatch...)

2019-04-10 Thread Esteban Maringolo
I love this attitude coming from the very core of the Pharo dev-team,
which felt to me as being blind to what other dialects were doing or
did in the past, and these is days seems to be catching up quite
quickly.

Dolphin Smalltalk:
Practically all "widgets" (aka "views") are the native ones, and they
behave as expected by a Windows user, both in terms of shortcuts,
styling, etc. It feels like a Smalltalk built by Microsoft itself.

The MVP approach to build GUIs is, in my experience, the best of all
available options, and the way the Presenters and Views are factored
is great, for what I could see, Spec 2.0 is going in that direction
and I like. Some could say this would restrict you from building
"different" apps, but IMO that is another layer that must be built on
top of the basic building blocks.

It doesn't use pragmas (I particularly don't like them much), but
there are "hooks" everywhere to add items to tooling menus, etc.

The consistency and coherence of the whole system is outstanding, not
only in terms of UI, and I think it is the result of two great
developers (and I would argue only one in terms of UI), working for
over a decade in refining, trimming and polishing every corner of the
app while also using it for their own personal and business
developments.

Dolphin had both a commercial purpose and a utility purpose, the first
as a vendor to fulfill developer needs, but the others for them as a
business to develop their own applications. So in the end they were
profiting from scratching their own itch.

So what I would love to have in Pharo from Dolphin?
The UX consistency that a workspace context menu is as similar as the
one in the browser code or the one in the Debugger (e.g. Why I can't
do an "extract method" refactoring within the debugger?).

The concept of a SessionManager is great also, you could "deploy" your
image to have a session manager that will handle headless command line
application, a full blown UI or even be used an out of process COM
server.

There are many cons, but we're focusing only in what I'd like.
I developed with Dolphin for more than +10 years , building business
critical application with it.


VisualWorks
I use it every day and don't miss much from it, except that the UI is
snappier than the current in Pharo. There is no lag the interaction
with most widgets. Certain things such as breakpoints and bread and
butter things "just work".

What I would like in Pharo from VW?:
Multiple windows, robust tooling and snappier UI.

I don't miss the namespacing, because I understand there are better
things in the makings for Pharo :)

VisualAge/VAST:
I have only used it up to v5.5, but the "Interrupt" button it has
worked, I never understood how it was implemented, but no matter how
tight the recursion loop was, you hit that "stop everything" button,
and everything stopped.

For those that don't know, the VAST IDE had an external small window
that just had a button, that worked as a panic button to halt the
execution of the image. Very much like the [Alt]+[.] of Pharo, but,
again, it worked magically.

What I would like in Pharo from VAST?: THAT BUTTON. :D

Smalltalk/X
It always feelt alien to me and it is more an "utility" dialect for
themselves that they happened to make public.
The nicest thing I found is that it had multiple windows where each
window has it's own process!

This is very much like Chromium/Chrome works, where you can kill a
single tab and keep the other tabs working.

What I would like: That capability, although I think this would
require an overhaul of the current VM.


Cuis Smalltalk:
It is the most "approachable" of the Squeak spin-offs, it feels like
the most "Dolphin like" of the them as in it is the only that can be
understood as a whole by a single person and whose tools can be learnt
by inference.

They recently added LiveTyping and other "live info" capabilities
 than,
AFAIU, can be easily added to Pharo as well as long as they add a few
extensions to the VM.

What I would like: LiveTyping and friends.



Summarizing:
There are many things out there, but even so, I find Pharo the most
enjoyable of all existing dialects, and everyday when I come back to
it to work on some personal project I notice how far it has gone from
most of the above.

But sometimes I enjoy it as I enjoy working out or playing golf: I
enjoy it but not without effort and some pain from my side, maybe I
finish the day saying I need to find an alternative and then the next
day I'm there wanting to use it again. :)

Regards,


Esteban A. Maringolo

El mié., 10 abr. 2019 a las 3:26, Esteban Lorenzano
() escribió:
>
> Hi,
>
> Time to time I hear people like Richard saying “Dolphin is the dialect most 
> beautiful Smalltalk he used” and others praising it in different levels.
> As Pharo “architect” (or whatever I am, but at least I’m sure I have to pay 
> attention to the IDE :P), I’m interested to know what elements of 

Re: [Pharo-users] Migration from VW to Pharo

2019-04-17 Thread Esteban Maringolo
There is this tool: https://github.com/GemTalk/SETT

I used it with a few packages with no special Namespace and it worked just fine.

It provides, however, several settings to map namespaces, packages,
etc, so it should work.

It only works in Linux though, because of the dependency to external
process calls.

Regards,

Esteban A. Maringolo

On Wed, Apr 17, 2019 at 8:53 AM Sreenath G K  wrote:
>
> Hello All,
>
> I just wanted to know if we have any tools for which we can make use of to 
> migrate VW code base into Pharo. If something is there please let me know or 
> your suggestion d to port it.
>
> Thanks in advance.
>
> Best Regards,
> Sree



Re: [Pharo-users] Migration from VW to Pharo

2019-04-17 Thread Esteban Maringolo
You can migrate from Store to a git repository using a virtual machine
with Linux and then continue working on Windows.

It is certainly going to be simpler than having to export
packages/bundles manually from VisualWorks.

Esteban A. Maringolo

On Wed, Apr 17, 2019 at 9:51 AM Sreenath G K  wrote:
>
> Hey,
>
> Unfortunately I have Windows though. I will have a look at it. Thanks for 
> letting me know
>
> Best Regards,
> Sree
>
> On Wed, Apr 17, 2019, 5:27 PM Esteban Maringolo  wrote:
>>
>> There is this tool: https://github.com/GemTalk/SETT
>>
>> I used it with a few packages with no special Namespace and it worked just 
>> fine.
>>
>> It provides, however, several settings to map namespaces, packages,
>> etc, so it should work.
>>
>> It only works in Linux though, because of the dependency to external
>> process calls.
>>
>> Regards,
>>
>> Esteban A. Maringolo
>>
>> On Wed, Apr 17, 2019 at 8:53 AM Sreenath G K  wrote:
>> >
>> > Hello All,
>> >
>> > I just wanted to know if we have any tools for which we can make use of to 
>> > migrate VW code base into Pharo. If something is there please let me know 
>> > or your suggestion d to port it.
>> >
>> > Thanks in advance.
>> >
>> > Best Regards,
>> > Sree
>>



[Pharo-users] Deep Recursion break/protection

2019-04-25 Thread Esteban Maringolo
Hi,

Is there a way to add deep recursion protection to the system?

eg.
RecursiveObject>>#recurse
  self recurse

So calling `RecursiveObject new recurse` in Dolphin raises an
exception right away...

Throws the following error with this stack:
ProcessorScheduler>>stackOverflow:
[] in ProcessorScheduler>>vmi:list:no:with:
BlockClosure>>ifCurtailed:
ProcessorScheduler>>vmi:list:no:with:
RecursiveObject>>recurse
RecursiveObject>>recurse

In Pharo it goes forever until it hits the memory limit (3.6GiB), at
which point doing an Alt+. is useless and you have to kill the VM.

The example is pretty simple, but when doing Seaside rendering, it is
easy to miss some return, causing the receiver to render recursively,
turning your image useless.

e.g.
MyComponent>>renderContentOn: html
  html render: self someSubComponent

MyComponent>>someSubComponent
  "Here I forget returning the subcomponent"
  someSubComponent ifNil: [someSubcomponent := OtherComponent new].

When you render MyComponent... boom, because
#MyComponent>>#renderContentOn: will be called recursively.

Regards,

Esteban A. Maringolo



Re: [Pharo-users] Deep Recursion break/protection

2019-04-25 Thread Esteban Maringolo
I just checked in VisualWorks, where I also develop Seaside and also
make these mistakes, and these recursions launch a "Process Monitor
Emergency: No space left" process monitor, with the option of killing
any running Smalltalk process.

Regards,

Esteban A. Maringolo

On Thu, Apr 25, 2019 at 9:30 AM Esteban Maringolo  wrote:
>
> Hi,
>
> Is there a way to add deep recursion protection to the system?
>
> eg.
> RecursiveObject>>#recurse
>   self recurse
>
> So calling `RecursiveObject new recurse` in Dolphin raises an
> exception right away...
>
> Throws the following error with this stack:
> ProcessorScheduler>>stackOverflow:
> [] in ProcessorScheduler>>vmi:list:no:with:
> BlockClosure>>ifCurtailed:
> ProcessorScheduler>>vmi:list:no:with:
> RecursiveObject>>recurse
> RecursiveObject>>recurse
>
> In Pharo it goes forever until it hits the memory limit (3.6GiB), at
> which point doing an Alt+. is useless and you have to kill the VM.
>
> The example is pretty simple, but when doing Seaside rendering, it is
> easy to miss some return, causing the receiver to render recursively,
> turning your image useless.
>
> e.g.
> MyComponent>>renderContentOn: html
>   html render: self someSubComponent
>
> MyComponent>>someSubComponent
>   "Here I forget returning the subcomponent"
>   someSubComponent ifNil: [someSubcomponent := OtherComponent new].
>
> When you render MyComponent... boom, because
> #MyComponent>>#renderContentOn: will be called recursively.
>
> Regards,
>
> Esteban A. Maringolo



Re: [Pharo-users] Deep Recursion break/protection

2019-04-25 Thread Esteban Maringolo
I downloaded a fresh 7.0.3 image and VM, created the above class and
method, and called it.

The image is running in Ubuntu within a VirtualBox with 4GB RAM.

Such exception was not triggered in my image when it actually filled
all the available OS RAM, and I had to kill it using the operative
system process manager.

If I call it and press Alt+. right away it halts the execution (if
running on the main thread).
In Dolphin, because it is not JITted, it is instantaneous after a long
chain of calls.

Crashing the image by such a simple to make mistake should be avoided.
Fortunately we have other tools such as Epicea to recover changes, but
even still.


Regards,

Esteban A. Maringolo

On Thu, Apr 25, 2019 at 9:47 AM Sven Van Caekenberghe  wrote:
>
> We also have an OutOfMemory exception, we even have tests provoking such a 
> situation (check usage).
>
> However, I believe such tight loops end up in JIT machine code.
>
> Checking stack overflow on each stack manipulation is costly.
>
> But I totally agree that we should try to catch these situations even if 
> there is a cost.
>
> > On 25 Apr 2019, at 14:39, Esteban Maringolo  wrote:
> >
> > I just checked in VisualWorks, where I also develop Seaside and also
> > make these mistakes, and these recursions launch a "Process Monitor
> > Emergency: No space left" process monitor, with the option of killing
> > any running Smalltalk process.
> >
> > Regards,
> >
> > Esteban A. Maringolo
> >
> > On Thu, Apr 25, 2019 at 9:30 AM Esteban Maringolo  
> > wrote:
> >>
> >> Hi,
> >>
> >> Is there a way to add deep recursion protection to the system?
> >>
> >> eg.
> >> RecursiveObject>>#recurse
> >>  self recurse
> >>
> >> So calling `RecursiveObject new recurse` in Dolphin raises an
> >> exception right away...
> >>
> >> Throws the following error with this stack:
> >> ProcessorScheduler>>stackOverflow:
> >> [] in ProcessorScheduler>>vmi:list:no:with:
> >> BlockClosure>>ifCurtailed:
> >> ProcessorScheduler>>vmi:list:no:with:
> >> RecursiveObject>>recurse
> >> RecursiveObject>>recurse
> >>
> >> In Pharo it goes forever until it hits the memory limit (3.6GiB), at
> >> which point doing an Alt+. is useless and you have to kill the VM.
> >>
> >> The example is pretty simple, but when doing Seaside rendering, it is
> >> easy to miss some return, causing the receiver to render recursively,
> >> turning your image useless.
> >>
> >> e.g.
> >> MyComponent>>renderContentOn: html
> >>  html render: self someSubComponent
> >>
> >> MyComponent>>someSubComponent
> >>  "Here I forget returning the subcomponent"
> >>  someSubComponent ifNil: [someSubcomponent := OtherComponent new].
> >>
> >> When you render MyComponent... boom, because
> >> #MyComponent>>#renderContentOn: will be called recursively.
> >>
> >> Regards,
> >>
> >> Esteban A. Maringolo
> >
>
>



Re: [Pharo-users] Deep Recursion break/protection

2019-04-25 Thread Esteban Maringolo
Hi Sven,

On Thu, Apr 25, 2019 at 10:04 AM Sven Van Caekenberghe  wrote:
> This way, you should run out of heap before the stack gets too large, since 
> you allocate and hold on to an array in each frame.

I don't understand the purpose of such expression, since I'm not
writing recursive code, where I pay special attention or save the
image before running it, but I'm trying to find a way around
accidental deep recursions.

However I ran these examples in Dolphin and Pharo 7, and in Dolphin it
triggers an memory exhaustion exception right away, and in Pharo it
grows in memory use, slower than with the previous example, but with
the same behavior (unresponsive image once the memory fills the
available OS memory).

Regards,

Esteban A. Maringolo



Re: [Pharo-users] Deep Recursion break/protection

2019-04-25 Thread Esteban Maringolo
On Thu, Apr 25, 2019 at 10:41 AM Sven Van Caekenberghe  wrote:
> > On 25 Apr 2019, at 15:27, Esteban Maringolo  wrote:

> > However I ran these examples in Dolphin and Pharo 7, and in Dolphin it
> > triggers an memory exhaustion exception right away, and in Pharo it
> > grows in memory use, slower than with the previous example, but with
> > the same behavior (unresponsive image once the memory fills the
> > available OS memory).
>
> Too bad, this is a VM issue anyway.

I think this is user related (those who accidentally create deep
recursions), but should this be reported on the vm-list?

Regards,

Esteban A. Maringolo



Re: [Pharo-users] Getting example images - https://picsum.photos

2019-04-29 Thread Esteban Maringolo
I remember Paul de Bruicker (cc'ed) used a similar service to get user
profiles (with first and last name and pictures, so you can "simulate"
users in your app, and you could ask for male or female profiles).

I don't remember the name, hopefully he will :)

Esteban A. Maringolo

On Mon, Apr 29, 2019 at 8:24 AM Sven Van Caekenberghe  wrote:
>
> Hi,
>
> This is a cool service: https://picsum.photos - it gives you example images 
> (pictures/photos).
>
> Here is how you can use this from a standard Pharo image (no pun intended).
>
> ZnEasy getJpeg: 'https://picsum.photos/512'.
>
> ImageReadWriter formFromStream: (ZnClient new
>   systemPolicy;
>   url: 'https://picsum.photos/640/480?grayscale';
>   accept: ZnMimeType imagePng;
>   get) readStream.
>
> Sven
>
>



Re: [Pharo-users] Bloc of code in tiers programming language

2019-05-15 Thread Esteban Maringolo
On Wed, May 15, 2019 at 5:21 PM Tim Mackinnon  wrote:
>
> On a similar line - I’ve often noticed that an interesting block pattern in 
> Smalltalk which is overlooked in other languages is how we handle errors 
> through them.
>
> We often don’t throw exceptions but instead pass a useful block (and often 2) 
> for what to do instead.
>
> at:ifAbsent: comes to mind or at:ifPreset:ifAbsent: leading you to do 
> interesting things yourself like parseSource:onErrorRecoverWith: (or 
> whatever).
>
> I think this makes an interesting point about our block flexibility.

Although it is not exactly the same, the async style of programming
JavaScript uses similar approaches by passing "callback functions" as
arguments to certain functions. e.g. fopen('/path/to/file',
successFunction, errorHandler).

As said, it is not exactly the same thing, and 100% callback programs
can be a hell to work with, but the idiom of passing "lambdas" around
is similar.

Regards,

Esteban A. Maringolo



Re: [Pharo-users] can I do this with a stream or a format

2019-05-16 Thread Esteban Maringolo
Maybe this is a better way to build what you want.

String streamContents: [:stream |  gifts
do: [:each | stream nextPutAll: each ]
separatedBy: [ stream nextPut: $,; space ]
]


Esteban A. Maringolo


On Thu, May 16, 2019 at 4:21 PM Roelof Wobben  wrote:

> Hello,
>
> Im testing all my solutions with critiz and can solve almost all problems,
>
> Only this one I cannot figure out.
>
> I have this code
>
> (gifts allButLast
> inject: ''
> into: [ :str :each | str , each , ', ' ]) , 'and ' , gifts 
> last ]
>
> and critiz says I should use a stream .
>
> How can I make this work ?
>
> Roelof
>
>
>


Re: [Pharo-users] can I do this with a stream or a format

2019-05-16 Thread Esteban Maringolo
Sorry, I misses the "all" part at the end (I don't see how that could add
something, but if it's in the requirements...)

Then it should be like this:
String streamContents: [:stream |
  gifts allButLast
do: [:each | stream nextPutAll: each ]
separatedBy: [ stream nextPut: $,; space ].
  stream
nextPutAll: ' all, ';
nextPutAll: gifts last].


Esteban A. Maringolo


On Thu, May 16, 2019 at 4:52 PM Roelof Wobben  wrote:

> I think this is better
>
>  ^  String streamContents: [:stream |
>
>  gifts
> do: [:each | stream nextPutAll: each ]
> separatedBy: [ stream nextPut: $,; space ]
>   stream nextputAll: 'all'; nextPut: ','; nextPut: gifts last]
>
>
>
> Op 16-5-2019 om 21:47 schreef Roelof Wobben:
>
> oke, and then do something like :
>
> stream :=
>
> String streamContents: [:stream |  gifts
> do: [:each | stream nextPutAll: each ]
> separatedBy: [ stream nextPut: $,; space ]
>
>
>
> stream nextputAll: 'all'; nextPut: ','; nextPut: gifts last
>
> ]
>
> stream nextputAll: 'all'
> stream nextPut: ','
> stream nextPut: gifts last
>
>
> Roelof
>
>
>
> Op 16-5-2019 om 21:30 schreef Esteban Maringolo:
>
> Maybe this is a better way to build what you want.
>
> String streamContents: [:stream |  gifts
> do: [:each | stream nextPutAll: each ]
> separatedBy: [ stream nextPut: $,; space ]
> ]
>
>  Esteban A. Maringolo
>
>
> On Thu, May 16, 2019 at 4:21 PM Roelof Wobben  wrote:
>
>> Hello,
>>
>> Im testing all my solutions with critiz and can solve almost all problems,
>>
>> Only this one I cannot figure out.
>>
>> I have this code
>>
>> (gifts allButLast
>> inject: ''
>> into: [ :str :each | str , each , ', ' ]) , 'and ' , gifts 
>> last ]
>>
>> and critiz says I should use a stream .
>>
>> How can I make this work ?
>>
>> Roelof
>>
>>
>>
>
>


Re: [Pharo-users] can I do this with a stream or a format

2019-05-16 Thread Esteban Maringolo
Oh... the expected output was 'e1, e2, e3 and e4', I read "all" instead of
"and".

Now it makes sense.

Esteban A. Maringolo


On Thu, May 16, 2019 at 5:09 PM Roelof Wobben  wrote:

> and this is working
>
> String
> streamContents: [ :stream |
> gifts allButLast
> do: [ :each | stream nextPutAll: each ]
> separatedBy: [ stream
> nextPut: $,;
> space ].
> stream
> nextPut: $,;
> nextPutAll: ' and ';
> nextPutAll: gifts last ] ]
>
> Thanks Estaban for the hint.
>
> Roelof
>
>
>
> Op 16-5-2019 om 21:51 schreef Roelof Wobben:
>
> I think this is better
>
>  ^  String streamContents: [:stream |
>
>  gifts
> do: [:each | stream nextPutAll: each ]
> separatedBy: [ stream nextPut: $,; space ]
>   stream nextputAll: 'all'; nextPut: ','; nextPut: gifts last]
>
>
>
> Op 16-5-2019 om 21:47 schreef Roelof Wobben:
>
> oke, and then do something like :
>
> stream :=
>
> String streamContents: [:stream |  gifts
> do: [:each | stream nextPutAll: each ]
> separatedBy: [ stream nextPut: $,; space ]
>
>
>
> stream nextputAll: 'all'; nextPut: ','; nextPut: gifts last
>
> ]
>
> stream nextputAll: 'all'
> stream nextPut: ','
> stream nextPut: gifts last
>
>
> Roelof
>
>
>
> Op 16-5-2019 om 21:30 schreef Esteban Maringolo:
>
> Maybe this is a better way to build what you want.
>
> String streamContents: [:stream |  gifts
> do: [:each | stream nextPutAll: each ]
> separatedBy: [ stream nextPut: $,; space ]
> ]
>
>  Esteban A. Maringolo
>
>
> On Thu, May 16, 2019 at 4:21 PM Roelof Wobben  wrote:
>
>> Hello,
>>
>> Im testing all my solutions with critiz and can solve almost all problems,
>>
>> Only this one I cannot figure out.
>>
>> I have this code
>>
>> (gifts allButLast
>> inject: ''
>> into: [ :str :each | str , each , ', ' ]) , 'and ' , gifts 
>> last ]
>>
>> and critiz says I should use a stream .
>>
>> How can I make this work ?
>>
>> Roelof
>>
>>
>>
>
>
>


Re: [Pharo-users] can I do this with a stream or a format

2019-05-17 Thread Esteban Maringolo
The good thing about these exercises is that you know about new selectors,
I didn't know there was an #allButLast and #allButLastDo:.

Regards,

Esteban A. Maringolo


On Fri, May 17, 2019 at 5:44 AM Sven Van Caekenberghe  wrote:

> I would make that
>
> ^ String new: gifts size * 10 streamContents: [ :stream |
> gifts allButLastDo: [:each |
>   stream nextPutAll: each; nextPutAll: ', '].
> stream nextPutAll: 'and '; nextPutAll: gifts last ]
>
> Your iteration is well done, clear and to the point.
>
> > On 17 May 2019, at 02:44, Richard O'Keefe  wrote:
> >
> > stream := WriteStream on: (String new: gifts size * "estimated size per
> gift" 10).
> > "The number after #new: is the *initial* allocation; the stream will
> reallocate it
> >  as needed."
> > gifts allButLastDo: [:each |
> >stream nextPutAll: each; nextPutAll: ', '].
> > stream nextPutAll: 'and '; nextPutAll: gifts last.
> > ^stream contents
> > Using #allButLastDo: saves making a copy of (most of) gifts.
> > How could you find out about these things?
> >
> > You want to join some strings, so you look for a "join" method in String
> and you
> > will find
> >
> > join: aCollection
> >   ^ self class new: (aCollection size * self size) streamContents:
> [:stream |
> > aCollection
> >   do: [:each | stream nextPutAll: each asString]
> >   separatedBy: [stream nextPutAll: self]]
> >
> >
> > You might wonder if there is already something close to what you want,
> so you
> > might enter "commas" into Spotter.  If you did that, you would find
> > Collection>>asCommaStringAnd so that the whole thing is very nearly
> > gifts asCommaStringAnd
> >
> > Just as the concatenation selector #, works with most kinds of sequences,
> > so building sequences up using a WriteStream works with most kinds of
> sequences.
> >
> > Let's work through a little example.  We are just going to build up the
> string
> > 'Quick' one character at a time.
> > s := ''.
> > s := s , 'Q'.   "creates a new string holding 'Q'"
> > s := s , 'u'.   "creates a new string holding 'Qu'"
> > s := s , 'i'.   "creates a new string holding 'Qui'"
> > s := s , 'c'.   "creates a new string holding 'Quic'"
> > s := s , 'k'.   "creates a new string holding 'Quick'"
> >
> > You see that building a string of n characters will actually create n
> new strings,
> > all but the last of which will be thrown away, taking O(n**2) time.
> >
> > Now let's use a stream.
> > w := WriteStream on: (String new: 4).  "Yes, I know that's too small."
> > w nextPutAll: 'Q'. "The stream now holds 'Q...' in its buffer."
> > w nextPutAll: 'u'. "The stream now holds 'Qu..' in its buffer."
> > w nextPutAll: 'i'. "The stream now holds 'Qui.' in its buffer."
> > w nextPutAll: 'c'. "The stream now holds 'Quic' in its buffer."
> > s nextPutAll: 'k'. "There is no room left in the buffer, so the stream
> allocates
> > a new buffer twice the size and copies the old one
> into it.
> > Now it has 'Quic' and it has room.
> > The stream now holds 'Quick...' in its buffer."
> > s := w contents.   "We are asking for the defined elements of the buffer.
> > This means s := buffer copyFrom: 1 to: w position."
> >
> > You see that building a string of n characters this way requires a
> minimum of
> > two strings, the buffer and the final result.  The buffer may be
> periodically
> > resized, but growing by doubling means the average cost is still O(n).
> >
> > Let's time these to get an idea.
> > Time millisecondsToRun: [
> >   |s|
> >   s := ''.
> >   1 to: 1 do: [:i |
> >   s := s , i printString].
> >   s size]
> > => 124
> > Time millisecondsToRun: [
> >   |w|
> >   w := WriteStream on: (String new: 1).
> >   1 to: 1 do: [:i |
> >   w nextPutAll: i printString].
> >   w contents size]
> > => 7
> >
> > This is exactly the reason that Java has both String and StringBuilder.
> > The tragedy of Java (well, not the only one) is that they had the example
> > of Smalltalk before them, showing very very clearly that the best way to
> > handle object to text conversion is to use #printOn: as the primitive,
> > not #printString, and they *still* went ahead and did the worse thing.
> > (Ruby has even less excuse for privileging to_s.)
> >
> > There are quite a few books about Smalltalk available as free PDFs from
> > the Pharo web site, a wonderful resource.  The Blue Book (Smalltalk-80
> > The Language and its Implementation) describes streams in Chapter 12.
> >
> >
> > On Fri, 17 May 2019 at 07:21, Roelof Wobben  wrote:
> > Hello,
> >
> > Im testing all my solutions with critiz and can solve almost all
> problems,
> >
> > Only this one I cannot figure out.
> >
> > I have this code
> > (gifts allButLast
> > inject: ''
> > into: [ :str :each | str , each , ', ' ]) , 'and ' ,
> gifts last ]
> >
> > and c

Re: [Pharo-users] [Pharo-dev] [Ann] Lifeware, Schmidt Pro contracts for the consortium

2019-05-20 Thread Esteban Maringolo
This is really good news!

Congratulations!

Esteban A. Maringolo


On Mon, May 20, 2019 at 3:04 AM ducasse  wrote:

> The Pharo consortium is very excited and super happy to bring your
> attention to the following announce
> that was presented during Pharodays 2019:
> https://fr.slideshare.net/pharoproject/
>
> The consortium got two contracts to support financially one year of
> engineer to improve Pharo.
> The companies Lifeware and Schmidt Pro fund work on Pharo to improve
> Pharo. The total amount
> of the two contracts is around 190 K Euros.
> In addition the RMOD team got some resources from Inria.
> The net result is that in 2019 the consortium will have 3.5 engineers
> working full time on Pharo.
>
> - Esteban Lorenzano
> - Pablo Tesone
> - Cyril Ferlicot
> - Guillermo Polito
>
> It will boost Pharo. Note that the issues raised by Schmidt Pro and
> Lifeware
> and their impacts on the roadmap of Pharo 8 and Pharo 9 are presented in
> https://fr.slideshare.net/pharoproject/.
>
> What is key to notice is that the consortium is working because many
> contributing companies are sharing ressources.
> This is built a strong soil to grow Pharo and business around.
>
> On the behalf of Inria, the consortium and the community we would like to
> thank
> Lifeware and SchmidtPro for their strong support.
>
> Stef on the behalf of the Pharo consortium
>
>


Re: [Pharo-users] Modeling HABTM

2019-06-10 Thread Esteban Maringolo
The M:N relationship is pretty straightforward in pure OO design.

You have anEpisode that references a collection with instances of Track.
And each Track has a collection of episodes.

Of course this could be elaborated even further, and have an object
like TrackPlay sitting in between of anEpisode and aTrack.
This TrackPlay object could have extra information, like the timespan
at which it was played, the date (although this could be delegated to
the Episode itself).

It doesn't happen much these days, but a billboard hit was played more
than once, so with a TrackPlay you could log both plays and know when
each one was played.

So
Episode "has many" TrackPlay
TrackPlay "references" Episode and Track

The Track could "has many" Episodes (and ask them for the TrackPlays
of itself) or "has many" references TrackPlay.

And you can make things even more elaborated, but I'd go for the
"TrackPlay" (for the lack of a better name) path.

Regards,

Esteban A. Maringolo

On Mon, Jun 10, 2019 at 9:21 AM sergio ruiz  wrote:
>
> I am currently putting together a Seaside website for my radio show. I am 
> trying to figure out how to model the "has and belongs to many" relationships.
>
> Each episode can have many tracks, each of these tracks can belong to several 
> episodes.
> I want to be able to present a listing of which episodes each track appears 
> in, and a listing of tracks for each episode.
>
> The approach I have seen on this is to create an intermediary object and 
> store a set of ids on this, but this seems a little clunky, and it seems like 
> there would be a clean way to do this.
> Am I missing something?
> Thanks!
>
>
> 
> peace,
> sergio
> photographer, journalist, visionary
>
> Public Key: http://bit.ly/29z9fG0
> #BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV
> http://www.codeandmusic.com
> http://www.twitter.com/sergio_101
> http://www.facebook.com/sergio101
>



Re: [Pharo-users] Modeling HABTM

2019-06-10 Thread Esteban Maringolo
By reference I mean an instance variable. So it's the same thing.

But it's not that one object has two "parents" (this isn't a tree like
structure).
The object (it is, the Track) has two references to the Episodes where
it appears, such reference happens because aTrack as a instance
variable "holding" (aka "referencing") aCollection, and this
collection "contains" (it is, references) two elements, that are the
Episodes in which a track appears.

For the sake of simplicity, you should define who must perform the
"maintenance" of the collections on only one sides. In my opinion it
should be the Episode.

E.g.
Episode>>addTrackToPlaylist: aTrack
  self playlist add: aTrack.
  aTrack includeInEpisode: self

Episode>>playlist
  playlist ifNil: [playlist := OrderedCollection new].


Track>>includeInEpisode: anEpisode
   self episodes add: anEpisode

Track>>#episodes
   episodes ifNil: [episodes := Set new]


You can see that #includeInEpisode: doesn't add itself to the Episode,
because it is very likely that the interaction is started onto the
Episode and not the Track. Otherwise to avoid a recursion you should
have a condition like:

Episode>>addTrackToPlaylist: aTrack
  (self playlist includes: aTrack) ifFalse: [
self playlist add: aTrack.
aTrack includeInEpisode: self ]

Track>>includeInEpisode: anEpisode
   self episodes add: anEpisode.
   anEpisode addTrackToPlaylist: self




The paper about "Mutual Friends" talks about the pro's and cons of
different approaches.

Esteban A. Maringolo

On Mon, Jun 10, 2019 at 2:40 PM sergio ruiz  wrote:
>
> when you say references, how does this look in pharo? I don’t know that I 
> have used such a relationship.
>
> I was thinking that an object would have an instance variable that was an 
> ordered collection of objects.. So having one object belong to two parent 
> objects could be tricky.
>
>
>
> On Jun 10, 2019, at 1:27 PM, Esteban Maringolo  wrote:
>
> You have anEpisode that references a collection with instances of Track.
> And each Track has a collection of episodes.
>
>
> 
> peace,
> sergio
> photographer, journalist, visionary
>
> Public Key: http://bit.ly/29z9fG0
> #BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV
> http://www.codeandmusic.com
> http://www.twitter.com/sergio_101
> http://www.facebook.com/sergio101
>



[Pharo-users] SETT Commit per bundle/package

2019-06-17 Thread Esteban Maringolo
Hi,

I don't know if anybody is using SETT to migrate from VW's Store to a
Tonel repository, but I'm trying to pull back to Pharo a few packages
I moved to VW and continued to maintain there.

I don't understand why SETT creates a commit on a "per pundle"
(package/bundle) basis.

What would be the approach to get a lot of packages working together?
E.g. MyPackage-Core, MyPackage-Glorp, MyPackage-Tests, etc.

Should MyPackage be a Bundle instead?

Regards,

Esteban A. Maringolo



[Pharo-users] Iceberg loading a Tonel package migrated using SETT

2019-06-17 Thread Esteban Maringolo
Hi,

I'm trying to load a package from a Tonel repository[1] that was created
using SETT[2].

The structure seems fine, but when I try to load a package, I'm getting the
message saying that there is no version for the package in the current
commit (which seems wrong at least to the naked eye).

Eg.
[image: image.png]

Any idea of how to fix it?

Regards!

[1] https://github.com/eMaringolo/rbac/tree/master/sources/
[2] https://github.com/gemtalk/sett



Esteban A. Maringolo


Re: [Pharo-users] Iceberg loading a Tonel package migrated using SETT

2019-06-18 Thread Esteban Maringolo
Hi Guillermo,

Your workaround effectively solved my issue.

About the tonel format, in the .properties file at the sources directory
there was such setting:
https://github.com/eMaringolo/rbac/blob/9279f22ef5fd1c4149090b5b39a6afa143a6519c/sources/properties.st


But the .project file was missing at the root of the repository. So maybe
it is a mix of both conditions.

In any case, I'm glad the workaround works, and that it helped spotting a
bug.

Thank you!


Esteban A. Maringolo


On Tue, Jun 18, 2019 at 4:35 AM Guillermo Polito 
wrote:

> I’ve created an issue:
>
> https://github.com/pharo-vcs/iceberg/issues/1251
>
> El 18 jun 2019, a las 9:30, Guillermo Polito 
> escribió:
>
> Hi Esteban,
>
> It seems like a bug in Iceberg. If you click on debug, you’ll see that
> although you’ve said the project is in tonel format, it’s trying to use a
> Filetree reader
>
> 
>
> This is due to some missing metadata in the commit (iceberg is relying on
> commit information there and not working copy information).
>
> There is however a simple workaround. If you click in the commit button
> you’ll see that Iceberg tries to create and commit the missing files:
>
> 
>
> If you commit those files, then you’ll be able to load your packages.
>
> Guille
>
>
> El 18 jun 2019, a las 2:34, Esteban Maringolo 
> escribió:
>
> Hi,
>
> I'm trying to load a package from a Tonel repository[1] that was created
> using SETT[2].
>
> The structure seems fine, but when I try to load a package, I'm getting
> the message saying that there is no version for the package in the current
> commit (which seems wrong at least to the naked eye).
>
> Eg.
> 
>
> Any idea of how to fix it?
>
> Regards!
>
> [1] https://github.com/eMaringolo/rbac/tree/master/sources/
> [2] https://github.com/gemtalk/sett
>
>
>
> Esteban A. Maringolo
>
>
>
>


Re: [Pharo-users] Iceberg loading a Tonel package migrated using SETT

2019-06-18 Thread Esteban Maringolo
Dale,

Besides the issue affecting this particular case, I think that the Tonel
"format" should support and honor "metadata" at the class/package/method
level.
E.g. the SETT exporter creates the #vw_namespace for classes, other
dialects may need to specify other information that would be useful that
when written back by Pharo are honored as well.

E.g. You export a package from VW that has the class "Foo" in the
"FooNamespace" namespace, so the Tonel class type definition will be
defined with "Foo" as name and the #vw_namespace set to be "FooNamespace",
if you lad this into Pharo everything will compile because the
#vw_namespace will be ignored, but once you commit back the #vw_namespace
property will be lost. I can think in other cases like Dolphin's class GUID
or VAST Application/Subapplication mapping to a package or public/private
to methods, etc.

Tonel files don't have exactly the best format, but it seems to be the one
that has the most widespread adoption in file based SCM, and maybe we (as a
Smalltalk community) could make another attempt of having a common format
to interchange code between dialects without much effort from the "main
trunk" (Pharo).

Regards,

Esteban A. Maringolo


On Tue, Jun 18, 2019 at 2:32 PM Dale Henrichs <
dale.henri...@gemtalksystems.com> wrote:

> SETT was create based on our understanding (GemTalk Systems) of what the
> tonel disk format was _supposed_ to be and I think that Pharo has departed
> from somewhat from what was understood to be the format.
>
> I've had similar problems trying to use filetree repositories with Iceberg
> that have been readable by the old Monticello/Filetree readers for years
> [1] ... and are readable when loaded through the Monticello Browser, but
> not readable when using Iceberg ...
>
> One of these days, there needs to be agreement as to what the actual disk
> format of tonel and filetree repositories is going to be/has been and then
> stick to them, otherwise these problems are going to continue to plague us.
>
> Dale
>
> [1] https://github.com/pharo-vcs/iceberg/issues/1239
> On 6/18/19 6:40 AM, Esteban Maringolo wrote:
>
> Hi Guillermo,
>
> Your workaround effectively solved my issue.
>
> About the tonel format, in the .properties file at the sources directory
> there was such setting:
>
> https://github.com/eMaringolo/rbac/blob/9279f22ef5fd1c4149090b5b39a6afa143a6519c/sources/properties.st
>
>
> But the .project file was missing at the root of the repository. So maybe
> it is a mix of both conditions.
>
> In any case, I'm glad the workaround works, and that it helped spotting a
> bug.
>
> Thank you!
>
>
> Esteban A. Maringolo
>
>
> On Tue, Jun 18, 2019 at 4:35 AM Guillermo Polito <
> guillermopol...@gmail.com> wrote:
>
>> I’ve created an issue:
>>
>> https://github.com/pharo-vcs/iceberg/issues/1251
>>
>> El 18 jun 2019, a las 9:30, Guillermo Polito 
>> escribió:
>>
>> Hi Esteban,
>>
>> It seems like a bug in Iceberg. If you click on debug, you’ll see that
>> although you’ve said the project is in tonel format, it’s trying to use a
>> Filetree reader
>>
>> 
>>
>> This is due to some missing metadata in the commit (iceberg is relying on
>> commit information there and not working copy information).
>>
>> There is however a simple workaround. If you click in the commit button
>> you’ll see that Iceberg tries to create and commit the missing files:
>>
>> 
>>
>> If you commit those files, then you’ll be able to load your packages.
>>
>> Guille
>>
>>
>> El 18 jun 2019, a las 2:34, Esteban Maringolo 
>> escribió:
>>
>> Hi,
>>
>> I'm trying to load a package from a Tonel repository[1] that was created
>> using SETT[2].
>>
>> The structure seems fine, but when I try to load a package, I'm getting
>> the message saying that there is no version for the package in the current
>> commit (which seems wrong at least to the naked eye).
>>
>> Eg.
>> 
>>
>> Any idea of how to fix it?
>>
>> Regards!
>>
>> [1] https://github.com/eMaringolo/rbac/tree/master/sources/
>> [2] https://github.com/gemtalk/sett
>>
>>
>>
>> Esteban A. Maringolo
>>
>>
>>
>>


Re: [Pharo-users] Playground auto-save?

2019-06-19 Thread Esteban Maringolo
I still don't know why there is no explicit "save", to at least capture
that state in the play-stash.
There is an explicit "publish" to the cloud, but no save.

Esteban A. Maringolo


On Wed, Jun 19, 2019 at 2:34 PM Sven Van Caekenberghe  wrote:

> if you give the playground's tab a name, it will save it under that name
> in pharo-local/play-stash - which I found reasonably reliable.
>
> > On 19 Jun 2019, at 15:38, Peter Uhnak  wrote:
> >
> > Hi Hilaire,
> >
> > this is a known problem. I've been losing code to Playground for years.
> (e.g. using undo (ctrl+z) is a good way to lose code)
> >
> > What helps a lot is to look into pharo-local/play-cache directory (you
> can open Spotter and type in "pharo-local" (without quotes)) which contains
> a log of probably 90% of playgrounds you executed.
> >
> > There are still some conditions under which you can lose code even with
> play-cache (e.g. ctrl+z sometimes)... so good to keep that in mind.
> >
> > Peter
> >
> > On Wed, Jun 19, 2019 at 3:20 PM Hilaire  wrote:
> > Beside that, auto-save is a nice feature, but it needs to be predictable.
> >
> > Hilaire
> >
> > Le 18/06/2019 à 21:53, Hilaire a écrit :
> > > Hi,
> > >
> > > I have to admit it is working randomly in P7 with Dr.Geo. (19.06 rel)
> > >
> > > Sometime script can be retrieved with the playpage button other time
> no:
> > > executed script can not be retrieved.
> > >
> > > Its behavior is not predictable and it is a problem for me and the kids
> > > playing code.
> > >
> > > Hilaire
> >
> > --
> > Dr. Geo
> > http://drgeo.eu
> >
> >
> >
>
>
>


Re: [Pharo-users] Cryptography decrufted

2019-07-05 Thread Esteban Maringolo
Thank you Norbert!


Esteban A. Maringolo

On Fri, Jul 5, 2019 at 11:06 AM Cédrick Béler  wrote:
>
> Excellent job Norbert !
>
> Thx,
>
> Cédrik
>
> > Le 5 juil. 2019 à 13:04, Norbert Hartl  a écrit :
> >
> > I cannot remember how many years I’m suffering with the poor quality of the 
> > Cryptography package. As people were complaining that voyage cannot be 
> > loaded in windows because cryptography contains old code that produces 
> > filenames with 311 charactern I decided to stop that. I changed the 
> > Cryptography repo in a way that:
> >
> > - all packages that are old squeak related have been removed
> > - packages that could not be loaded into a pharo7 because of dependencies I 
> > don’t know have been removed
> > - loadable packages have been added in the baseline in the all group so 
> > everything is loaded and tested in travis
> > - tests have been fixed where I could do that easily
> > - tests that were failing and I don’t know why have been added (with a 
> > comment) to expectFailures
> > - after the removal I did a new version 0.4 for those who are interested in 
> > the cleaned old version
> > - then I converted the source into tonel format
> > - then I retired pharo4 and pharo5 for the travis builds because 3 yearsis 
> > enough for such a package
> > - finally I did a version 0.5 with that state
> >
> > There were also packages removed like PasswordHashingFFI and 
> > CryptographyPlugins. Not sure if the FFI variant is recent or the 
> > CryptographyPlugins realtes to the vm. I removed every package in its own 
> > commit. So resurrecting a package should be easy as reverting a commit if 
> > someone needs it.
> >
> > Now I’m udpating mongotalk and voyage.
> >
> > FYI,
> >
> > Norbert
>
>



[Pharo-users] Comparing to commits in Iceberg

2019-07-08 Thread Esteban Maringolo
Is there a way I can compare, and eventually merge, two arbitrary
commits with Iceberg?

E.g. I'm working on the latest commit of the master branch and want to
see what changed against two commits ago, and maybe roll back some
change.

Regards,

Esteban A. Maringolo



Re: [Pharo-users] [ANN] MessageFlowBrowser for Pharo 7 and 8

2019-07-12 Thread Esteban Maringolo
I like the soundtrack. If anything else must be added, subtitles is the
first thing in the list.

El vie., 12 de julio de 2019 08:59, Richard O'Keefe 
escribió:

> Great tool.  Helpful video.
> One thing would improve the video: remove the sound track, or
> replace it with spoken commentary.
>
>
> On Fri, 12 Jul 2019 at 04:15, Torsten Bergmann  wrote:
>
>> Hi,
>>
>> I updated my MessageFlowBrowser today to work on Pharo 7 and 8, see
>> attached screenshot
>> or youtube video on https://www.youtube.com/watch?v=DRd_bzGocQg
>>
>> It now also works in Calypso and you just need to right click on a method
>> in the method
>> pane or code pane and select "Message Flow" close to Senders,
>> Implementors and other.
>>
>> You can load the tool using
>>
>>Metacello new
>> repository: 'github://astares/Pharo-MessageFlowBrowser/src';
>> baseline: 'MessageFlowBrowser';
>> load
>>
>> I also now moved repo from
>>
>>   http://www.smalltalkhub.com/#!/~TorstenBergmann/MessageFlowBrowser
>>
>> to the new location
>>
>>   https://github.com/astares/Pharo-MessageFlowBrowser
>>
>> on GitHub for future development.
>>
>> Have fun,
>> T.
>>
>>


Re: [Pharo-users] [OrderedCollection] add a reference or a copy?

2019-07-24 Thread Esteban Maringolo
Yes, it is the same. Everything is passed by "reference" (*).
And if you copy the collection you'll get two collections referencing
the same object.

E.g.
| a c1 c2 |
a := Object new.
b := OrderedCollection with: a.
b identityIncludes: a. "true"
c := b copy.
c identityIncludes: a. "true"


(*) Some objects like SmallIntegers are "immediate" objects, and could
be considered that they're passed by value.
E.g.
1 copy == 1 "true"

Regards,

Esteban A. Maringolo

On Wed, Jul 24, 2019 at 9:45 AM sergio ruiz  wrote:
>
> I think my understanding of OrderedCollections has been incorrect for a very 
> long time. I have never had a situation where it mattered, but in modeling a 
> current project, I think I have been approaching it incorrectly.
>
> Since I have been using Smalltalk, I assumed that a copy of an object is 
> added to an OrderedCollection. A quick test shows that a reference to that 
> object is added to the OrderedCollection.
>
> I just wanted a sanity check on this. Is this true with all collections?
>
> Thanks!
>
>
> 
> peace,
> sergio
> photographer, journalist, visionary
>
> Public Key: http://bit.ly/29z9fG0
> #BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV
> http://www.codeandmusic.com
> http://www.twitter.com/sergio_101
> http://www.facebook.com/sergio101
>



Re: [Pharo-users] OrderedCollection as an instance variable

2019-07-24 Thread Esteban Maringolo
I agree with that, but in some cases, like reading objects from an
ORM, you would be creating lots of instances of objects that are going
to be discarded right away.
This would put no stress on GC since it would happen in the "new"
space, but would consume more memory (although I never measured how
much more).

Esteban A. Maringolo

On Wed, Jul 24, 2019 at 1:14 PM Richard Sargent
 wrote:
>
> I will add that I prefer the static model to tell the truth about its data 
> types. So, I prefer having an #initialize method which ensures the new object 
> is created in a self-consistent way and anyone looking at it in an inspector 
> will see useful and correct information. Leaving instance variables 
> uninitialized is a excellent way to generate Does Not Understand errors 
> (perhaps not in the short-term, but definitely in the long-term).
>
>
> On Wed, Jul 24, 2019 at 8:39 AM sergio ruiz  wrote:
>>
>>
>> tracks
>> ^tracks ifNil: [ tracks :=  OrderedCollection new ].
>>
>> - one line
>> - does not mix using accusers and not using accessors.
>>
>>
>> Okay, I totally get the subtlety now. I don’t even need an accessor.
>>
>> Thanks!
>>
>> 
>> peace,
>> sergio
>> photographer, journalist, visionary
>>
>> Public Key: http://bit.ly/29z9fG0
>> #BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV
>> http://www.codeandmusic.com
>> http://www.twitter.com/sergio_101
>> http://www.facebook.com/sergio101
>>



[Pharo-users] How to modify a non-forked Iceberg repository to create a pull request

2019-07-27 Thread Esteban Maringolo
I was working on something using Glorp, loaded as a Metacello
dependency cloned directly from the pharo-rdbms/Glorp GitHub repo.

Then I found what I think is a bug, make a few modifications and make
created a new commit.

I cannot commit to the `origin` remote since I'm not a member, but I
can't create a pull request, because I started from the "upstream"
repo as my base.

What should be the way to solve this without losing the local changes
(commited but not pushed)?

I thought:
- Fork the pharo-rdbms/Glorp repository in my own GitHub user
- Add a new remote (via CLI) to my Glorp local (pharo)
repositorypointing to the one at my user (emaringolo/Glorp).
- Fetch and checkout from the remote pointing to my repository
- Merge my local changes into my repository
- Push my changes
- Create a pull request from eMaringolo/Glorp to pharo-rdbms/Glorp

Is this wrong? What do you suggest?
I think this might happen to anyone who started working on some
repository that is not a fork of the canonical and then tries to make
changes to it.

Regards,

Esteban A. Maringolo



Re: [Pharo-users] How to modify a non-forked Iceberg repository to create a pull request

2019-07-27 Thread Esteban Maringolo
Thank you Gabriel.

It was even simpler.

Esteban A. Maringolo

On Sat, Jul 27, 2019 at 5:37 PM Gabriel Cotelli  wrote:
>
> Forth the repo
> Add the remote
> And just push to your remote
> Then use the usual flow for pr
>
> On Sat, Jul 27, 2019, 16:33 Esteban Maringolo  wrote:
>>
>> I was working on something using Glorp, loaded as a Metacello
>> dependency cloned directly from the pharo-rdbms/Glorp GitHub repo.
>>
>> Then I found what I think is a bug, make a few modifications and make
>> created a new commit.
>>
>> I cannot commit to the `origin` remote since I'm not a member, but I
>> can't create a pull request, because I started from the "upstream"
>> repo as my base.
>>
>> What should be the way to solve this without losing the local changes
>> (commited but not pushed)?
>>
>> I thought:
>> - Fork the pharo-rdbms/Glorp repository in my own GitHub user
>> - Add a new remote (via CLI) to my Glorp local (pharo)
>> repositorypointing to the one at my user (emaringolo/Glorp).
>> - Fetch and checkout from the remote pointing to my repository
>> - Merge my local changes into my repository
>> - Push my changes
>> - Create a pull request from eMaringolo/Glorp to pharo-rdbms/Glorp
>>
>> Is this wrong? What do you suggest?
>> I think this might happen to anyone who started working on some
>> repository that is not a fork of the canonical and then tries to make
>> changes to it.
>>
>> Regards,
>>
>> Esteban A. Maringolo
>>



Re: [Pharo-users] Warning Newbie Question: Bootstrap Navbar example works my copy and paste fails?

2019-07-29 Thread Esteban Maringolo
You're using the Bootstrap 4 library and methods.

I don't know about the one referenced in the MOOC, but there are
several differences between Torsten's Bootstrap 3 (TBS prefixed
classes) and Bootstrap 4 (SBS prefix), in particular because Bootstrap
4 library wrapper uses a subclass of WAHtmlCanvas where all the
methods are implemented.

See if your component implements #rendererClass it should return
SBSHtmlCanvas as its renderer class instead of the default, inherited,
WAHtmlCanvas.

Regards,


Esteban A. Maringolo

On Sun, Jul 28, 2019 at 10:02 PM ian  wrote:
>
> Hi All,
>
> Hopefully this is an easy one?
>
> I have been going through the MOOC exercises and have come across something I 
> can't seem to figure out.
>
> In the example the code reads:
>
> 
> renderExampleOn: html
>
> | bar id|
> id := 'navbarSupportedContent'.
> bar := html navigationBar.
> bar beLight; expandLarge.
> bar background beLight.
> bar with: [
> html navigationBarBrand: 'Navbar'. ]
>
> 
>
> Mine reads exactly the same but errors in the browser with:
>
> 
>
> Seaside Walkback
> MessageNotUnderstood: WAHtmlCanvas>>navigationBar
>
> Debug Proceed Full Stack
> Possible Causes
>
> you sent a message this type of object doesn't understand
>
> Stack Trace
>
> thisContext
> WAHtmlCanvas(Object)>>doesNotUnderstand: #navigationBar
> self
> a WAHtmlCanvas
>
> thisContext
> VIHeaderComponent>>renderContentOn:
> self
> a VIHeaderComponent
>
> thisContext
> WARenderVisitor>>visitPainter:
> self
> a WARenderVisitor
>
> thisContext
> WARenderVisitor(WAPainterVisitor)>>visitPresenter:
> self
> a WARenderVisitor
>
> thisContext
> WARenderVisitor(WAPainterVisitor)>>visitComponent:
> self
> a WARenderVisitor
>
> 
>
> When using Finder to locate the selector, navigationBar, I notice that it is 
> a selector of SBSHtmlCanvas.
>
> So my question is: How to I set up my rendering class in seaside properly?  
> Currently, as per all I can find I am properly using WAComponent as 
> application super class.
>
> I don't see anything in the seaside book regarding bootstrap and I am 
> fallowing the MOOC section on bootstrap almost to a tee.  Accepting the fact 
> that the library is now SBSDeploymentLibrary rather than TBSDeploymentLibrary.
>
> Any help would be greatly appreciated.
>
> Kindly,
>
> Ian
>



Re: [Pharo-users] Warning Newbie Question: Bootstrap Navbar example works my copy and paste fails?

2019-08-01 Thread Esteban Maringolo
Hi Jeff,

Here  

Regards,

Esteban A. Maringolo

On Thu, Aug 1, 2019 at 3:48 AM Jeff Gray  wrote:
>
> Have I missed something? Is there a pharo Bootstrap 4? How do I get that?
>
>
>
>
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>



Re: [Pharo-users] A Canticle for Smalltalk

2019-08-06 Thread Esteban Maringolo
What is the intentend audience of this?

Personally I don't like the aesthetics, the pace of text and its
"nostalgia", and the overall message of the song lyrics ; and although
I like the band and song, it's a proven plagiarism of Satriani's "If I
could fly". [1]

Regards,


[1] https://youtu.be/8RJmiMq1pOA?t=48

Esteban A. Maringolo

On Tue, Aug 6, 2019 at 8:04 AM Mariano Martinez Peck
 wrote:
>
> Yes. And I think it's even more sad than the containers example doesn't work 
> anymore... AFAIK they replaced the system.
>
> On Tue, Aug 6, 2019, 05:06 Tim Mackinnon  wrote:
>>
>> It’s very entertaining but it seems a bit sad - it’s a shame it refers to 
>> JP-Morgan as “used Smalltalk “ as actually they are “still using Smalltalk” 
>> (so it’s not in the past)
>>
>> Tim
>>
>> Sent from my iPhone
>>
>> On 5 Aug 2019, at 16:19, Richard Kenneth Eng  
>> wrote:
>>
>> A big fan of my work created this rogue video: 
>> https://drive.google.com/file/d/1opveHaukFK8WbQ8wg8b14wuKJsjoOZfO/view
>>
>> I appreciate the homage, but I can't take credit for it.
>>
>> It's really quite beautiful, though. I'm using it as part of my evangelism.
>>



Re: [Pharo-users] A Canticle for Smalltalk

2019-08-06 Thread Esteban Maringolo
I'm not a native speaker but grammatically speaking "used" (simple
past) means you did use it in the past but there is no information
about whether you use it now, and "have been using" (present perfect)
means you did use it in the past and continue to do so in the present.

Esteban A. Maringolo


On Tue, Aug 6, 2019 at 11:37 AM Ben Coman  wrote:
>
> I didn't get the sense that "used" means its no longer being used.
> Yesterday I used a keyboard to write an email, and I'm doing the same thing 
> today.
> cheers -ben
>
> On Tue, 6 Aug 2019 at 16:06, Tim Mackinnon  wrote:
>>
>> It’s very entertaining but it seems a bit sad - it’s a shame it refers to 
>> JP-Morgan as “used Smalltalk “ as actually they are “still using Smalltalk” 
>> (so it’s not in the past)
>>
>> Tim
>>
>> Sent from my iPhone
>>
>> On 5 Aug 2019, at 16:19, Richard Kenneth Eng  
>> wrote:
>>
>> A big fan of my work created this rogue video: 
>> https://drive.google.com/file/d/1opveHaukFK8WbQ8wg8b14wuKJsjoOZfO/view
>>
>> I appreciate the homage, but I can't take credit for it.
>>
>> It's really quite beautiful, though. I'm using it as part of my evangelism.
>>



Re: [Pharo-users] Code of Conduct

2019-09-16 Thread Esteban Maringolo
On Mon, Sep 16, 2019 at 3:59 PM Ramon Leon  wrote:
>
> On 2019-09-11 1:07 p.m., Sean P. DeNigris wrote:
> > merely say that no one (including from those categories) will be harassed
> > inside the Pharo community. Seems pretty reasonable, unless I'm missing
> > something...
>
> You're missing what some progressives consider harassment these days.
> [SNIP]
> This is language policing and a forcing of political ideology into what 
> should not be political.

I think that even the "adoption" of such "Covenant CoC" introduces
political ideology (and hence agenda) into this community that has
been free from political debate (and so I expect it to be).

> https://linustechtips.com/main/topic/974038-why-the-linux-coc-is-bad/

Oh my.

> It's sad to see that Pharo has jumped onto this PC bandwagon, it does not 
> bode well for the community.

I believe this is more an undesired side effect of choosing a CoC from
a template without caring about the details than the intention to have
political correctness in the mailing list, because there's been flame
wars and name calling here, but I don't recall anybody raising
political ideology as an argument, or with the exception of a few
cases, used political imagery or references in the ML, presentations,
etc..

On a personal level I don't like this covenant in particular, and as
was mentioned before it is not even a covenant since most of us just
realized it existed and never before agreed to it.

As a side note I believe mailing lists (or online communities in
general) must not be safe spaces, and should only take action against
concrete threats or completely off-topic comments/posts.

Regards,

--
Esteban A. Maringolo



Re: [Pharo-users] Code of Conduct

2019-09-17 Thread Esteban Maringolo
On Tue, Sep 17, 2019 at 10:28 AM Offray Vladimir Luna Cárdenas
 wrote:
> For example, in Latin America I have not seen a huge movement about new 
> pronouns and I don't know any of such for Spanish.

The movement in LATAM started by the use of gender-neutral plurals,
with some phonetic aberrations that cannot be even spelled to a more
pronunciable alternative that seems to be sticking. Actually it's very
easy to spot SJW because they overuse such language. There were some
attempts to use it in pronouns, but apparently there is a language
thing in Spanish that makes it harder to stick.

> The raised concerns about a Code that states punishment without restoration 
> or defense is an important one,
> but also are the ones about technical communities where improper behavior is 
> allowed because is not a "technical issue".

It's simple to define improper behavior as something that is not
aligned with the objective or purpose of the mailing list.

> We may lock for examples in different communities to see which one fits 
> better our own.

It is, but the simpler the rules the simple to enforce them.
E.g. I've been part of a team of 10 moderators in an online community
of 40K+ members (with 1% active daily) for over two years now, we grew
our own CoC over time, but it is not harmful as this "Covenant"
proposed. And in that amount of members I can guarantee you (by
experience) that there is a myriad of different opinions even within
the "clusters" of those ruled by identity politics.

> This is an important conversation to have, once it has been raised.

Maybe, but as I said before, this mailing list, and the community in
general is very civilized, even by old Internet standards.

Regards,

Esteban A. Maringolo



Re: [Pharo-users] Code of Conduct

2019-09-19 Thread Esteban Maringolo
Peter,

I also understand that Esteban Lorenzano didn't aim the comment at
you, and there was a language mismatch in the tone or intention of the
last sentence.

Let's get back to the discussion of the CoC (if something else must be
discussed) and avoid the "you said"/"he said" kind of side-debate that
makes us lose focus.

Regards,

Regards,

Esteban A. Maringolo

On Thu, Sep 19, 2019 at 10:33 AM PBKResearch  wrote:
>
> Offray
>
>
>
> You may be right, though I don’t think so. But ‘You have been warned’ was 
> aimed at me; I’m sure of that.
>
>
>
> Peter Kenny
>
>
>
> From: Pharo-users  On Behalf Of Offray 
> Vladimir Luna Cárdenas
> Sent: 19 September 2019 14:26
> To: pharo-users@lists.pharo.org
> Subject: Re: [Pharo-users] Code of Conduct
>
>
>
> Peter,
>
> I think that the comment was referred to the comment made on the PR (not on 
> this list) that was insulting Serge (which I will not repeat). It has been 
> deleted now and only Stephan's response remains[1]. As you can see is 
> addressing someone different, who has no contributions and no name and seemed 
> to create the account just to insult and you can see by his/her empty account 
> without any info and any contributions[2].
>
> [1] https://github.com/pharo-project/pharo/pull/4637#issuecomment-532815478
> [2] https://github.com/eleitl
>
> So, in my interpretation, Stephan's comment was referred to the user at [2] 
> and Esteban warning was referred to the closing of the issue because of it, 
> so the "you" in the warning was not the singular "you", but the plural one. 
> Because conversation has been split in two places, these mistakes can be 
> done. I think that you raised a valid concern in a civilized manner, are a 
> recognized member of the community and did not insulted Serge, so the 
> comments were not addressing you.
>
> This can be a very sensible approach, as the discussion on the list so far 
> have shown, so the more clarity we can have to elevate the conversation and 
> be respectful with the participants, the better.
>
> Cheers,
>
> Offray
>
> On 19/09/19 8:02 a. m., PBKResearch wrote:
>
> I think the comments about “someone that has no name, no repositories, not 
> anything that makes you think is a real member of the community or just a 
> troll” are directed at me. My e-mail address is based on the trading name I 
> used at the time I was doing consulting work; my actual name is Peter Kenny, 
> and I use it to sign everything I post in this forum. I have no repositories, 
> because the only code I write is of no general interest. As a member of the 
> community, I was invited by Stephane Ducasse to work up a post I had written 
> to help someone into a pamphlet on web scraping; I think that is still 
> available in Pharo publications. So I am not a troll; I am an elderly but 
> still active user of Pharo, and concerned about developments. There is an 
> English saying about pots and kettles, which Mr Lorenzano might consider 
> before making personal attacks on me.
>
>
>
> I did not say anything insulting about Serge Stinckwich. I asked whether he 
> acted with authority when he posted the code, because I genuinely don’t know 
> what official position he has in the Pharo world. I still don’t know whether 
> the code is in effect as a result of being posted.
>
>
>
> ‘You have been warned’ seems like a threat. I do not like being threatened. 
> If comments here, which are relevant to the topic and expressed in moderate 
> language, are no longer welcome, I shall absent myself without waiting to be 
> banned.
>
>
>
> Peter Kenny
>
>
>
> From: Pharo-users  On Behalf Of Esteban 
> Lorenzano
> Sent: 19 September 2019 12:49
> To: Any question about pharo is welcome 
> Subject: Re: [Pharo-users] Code of Conduct
>
>
>
>
>
>
>
>
> On 19 Sep 2019, at 12:22, PBKResearch  wrote:
>
>
>
> I don’t think this conversation can be closed while things are in the present 
> unclear situation. The github entry at 
> https://github.com/pharo-project/pharo/blob/Pharo8.0/CODE_OF_CONDUCT.md is 
> still there, and has been there since last May. The github discussion on 
> https://github.com/pharo-project/pharo/pull/4637 was abruptly closed by 
> Stephane Ducasse, after some intemperate comments about Serge Stinckwich.
>
>
>
> Yes it can be closed.
>
> As we will close ANY thread/issue/PR that directly insults one of the members 
> of the community.
>
> Even more important: We can close it if thread has been highjacked by someone 
> that has no name, no repositories, not anything that makes you think is a 
> real member of the community or just a troll.
>
>
>
> Members can do things right or wrong, as they are human beings. But emitting 
> opinions in the way they were emitted about what they did is a no-go.
>
>
>
> So yes, you can discuss anything you want.
>
> But I personally will moderate any thread that does not discusses things in a 
> civilised way.
>
>
>
> So you have been warned :)
>
>
>
> Esteban
>
>
>
> PS: I will also remember you that the p

Re: [Pharo-users] Reminder: Smalltalk Webcamp, 22nd of October

2019-09-24 Thread Esteban Maringolo
Hi,

I'll arrive to Ghent by train on Monday afternoon, and will likely wander
around the city/museum and/or any other point of interest.
I still haven't booked any lodging, and will likely go for a simple bed
& breakfast since I plan to be outside as much as possible (if weather
enables it).

Regards,

Esteban A. Maringolo


On Tue, Sep 24, 2019 at 12:00 PM Craig Latta 
wrote:

>
> Hi Johan--
>
>  Looking forward to it!
>
>
> -C
>
> ***
>
>  On 23/9/19 19:57, Johan Brichau wrote:
>
> > Hi,
> >
> > Are you doing Web development with Smalltalk? Then this meeting is for
> you.
> > We organise an informal meetup on Smalltalk Web Technologies at the
> > Yesplan offices.
> >
> > ===
> > Smalltalk WebCamp
> > ---
> > Date: Tuesday October 22nd, 2019 (9h30 -> 18h00)
> > Location: Yesplan offices in Gent, Belgium. (www.yesplan.be
> > )
> > ===
> >
> > This is an un-conference: everyone is invited to actively participate by
> > presenting their project.
> > Come and share your web development experience with Smalltalk.
> > Wether you are doing Seaside, Teapot, PharoJS, Amber, SqueakJs, Zinc
> > REST, … or anything else that involves Smalltalk and web technologies:
> > come and share your experience!
> >
> > We provide ample time to discuss and collaborate on topics, meet people
> > and have a beer in the evening.
> >
> > Attendance is free, but please register before October 15th if you are
> > attending, so we can plan accordingly.
> > Registration
> > link: https://www.eventbrite.com/e/smalltalk-webcamp-tickets-69185265993
> >
> > At this time, there are 9 participants, excluding the Yesplan team.
> >
> > Questions? Please send me an email.
> >
> > Best regards
> > Johan Brichau
> > jo...@yesplan.be 
>
> --
> Craig Latta
> Black Page Digital
> Amsterdam :: San Francisco
> cr...@blackpagedigital.com
> +31   6 2757 7177
> + 1 415  287 3547
>
>


Re: [Pharo-users] Microsoft COM

2019-09-26 Thread Esteban Maringolo
On Wed, Sep 25, 2019 at 8:35 PM Vince Refiti <
vince.ref...@trapezegroup.com.au> wrote:

> Have you checked out Dolphin Smalltalk's way of creating COM components?
> The Dolphin guys have a wizard to "automatically generate wrapper classes
> for all the interfaces defined in the type-library" (from the help file).
>
>
I also was going to suggest checking Dolphin's approach as reference. They
have the wizard to wrap visual (OCX) and non-visual components [1], and it
works really well, I a past job we wrapped the whole Excel Object Model and
a few other things to automate it from Smalltalk.

Regards,

[1]
https://github.com/dolphinsmalltalk/Dolphin/tree/master/Core/Object%20Arts/Dolphin/ActiveX/COM



Esteban A. Maringolo



> Vince
>
>


Re: [Pharo-users] Workflows and possible usages

2019-09-30 Thread Esteban Maringolo
Bruno,

There was the MockGemstone package that created "compatible" reduced
conflict classes (that provide name compatibility but no RC behavior) and
other Gemstone globals (such as System) that you can use.

The develop in Pharo deploy in Gemstone is used by a few projects that I'm
aware of.

As for storing the rules, I rather go with Fuel or GLORP+SQlite. I don't
know how complex the object graph can get. But these two options are the
most easy to setup, since they have no dependencies and are self contained.

Regards,


Esteban A. Maringolo


On Mon, Sep 30, 2019 at 11:56 AM Smalltalk  wrote:

> Hi,*
> "There was a gemstone workflow engine - it’s not ported, it looked 
> interesting but used a Windows bpml tool and again wasn’t sure if it wanted 
> to own the world, and porting it would be more than I wanted to do."
>
> *I think you are talking about BpmFlow 
> (https://github.com/brunobuzzi/BpmFlow) if not excuse me :)
>
> A couple of month ago a created an issue for the port 
> (https://github.com/brunobuzzi/BpmFlow/issues/843) to annotate all 
> information related to a possible port.
>
> The most challenging task is how to persist BpmProcess data within Pharo, use 
> an ORM (GLORP) or use GemStone ?
> This task is the most complex.
>
> But first there are some minor issue to tackle:
> * Replace GS ReduceConflict classes with normal Pharo collections.
> * GsQuery
>- Replace GsQuery with normal blocks
>- (or) Find out if GsQuery was ported (or it could be ported) to Pharo
> * Replace GS Selection Block with normal Pharo blocks. {:each | 
> each.address.state = 'OR'}
>
> Develop in Pharo and Deploy in GemStone strategy can be a very good source of 
> information to solve the above issues.
>
> I use Jade client to directly develop on GemStone/S so a research is needed 
> on "Develop in Pharo and Deploy in GemStone".
>
> Modeling tools:
> The goal is to be able to import any XPDL file exported by any BPMN tool.
> For now we use Bizagi but others tools that export to XPDL standard can be 
> added.
> This will require some effort but is possible (we do an extensive use of 
> Bizagi extended attributes but if the BPMN tool to be added support some kind 
> of mechanism to add custom attributes to tasks there will be no problem).
>
> regards,
> bruno
>
>


Re: [Pharo-users] Looking for APIs to access Facebook, Instagram and Youtube

2019-10-04 Thread Esteban Maringolo
I have interest in such API tools as well. If you find something let me
know. AFAIU FB uses GraphQL.
Otherwise we'll have to build it our own.

Regards!

El vie., 4 de octubre de 2019 05:11, Esteban Lorenzano 
escribió:

> Hi,
>
> I’m evaluating the viability of a side project.
> Are there around APIs to connect to those platforms mentioned first?
>
> Thanks for the info, if any :)
>
> Esteban
>


Re: [Pharo-users] Pharo: Git and GUI speed; JS widget reuse in PharoJS

2019-10-07 Thread Esteban Maringolo
> Are we sure that Git is really the best way to go?  Yes, it’s everywhere, but 
> its representation in Iceberg seems awkward or incomplete.  I’ve been able to 
> crash several Pharo VMs with routine repo operations.  This is why I backed 
> away recently from Pharo--that and the mush (see below).

 I haven't seen is the instability of the VM you mention, it has
worked pretty well for my average use, although the UX is not
straightforward.

> The other thing that keeps me planted firmly in VW is the sheer speed of it.

I don't know if there are recent benchmarks, but I've felt Pharo to be
really fast compared to VW when it comes to computing.

> Pharo looks generally much better, but it’s mushy, and that’s a problem.  VW 
> is not.

Working regularly with VW or VAST when I go back to Pharo the
"mushiness" is significantly noticeable, but if you open a Pharo 3
image (or even Pharo 4) you'll feel it really "snappy", but of course
you'll lose all the improvements since then; and that's the current
tradeoff.

I never understood the reason for the incremental slowdown, it is even
present in "modern" tools such as GTToolkit.

> Gestural dynamics are very quick, well under 100 ms latency, often less than 
> 20 ms.
> I’m seeing 100, 150, and 200 ms regularly in Pharo.  It’s too mushy, and that 
> slows the mind.
> Any developer understands this, whether he talks about it or not.

This is true, below 20ms is ideal, and top-notch CLI terminals are
benchmarking this as a selling point (using stuff like
https://github.com/pavelfatin/typometer), Sublime, TextEdit, Notepad++
measure sub 10ms latency.

> So I’m wondering when the Pharo GUI will snap as well as VW.

Maybe with native widgets there will be a significant speedup,
although I don't know whether the lag comes from rendering time or
from something else.
But VW event model is not better than Pharo's, so it might be something else.

Regards,

Esteban A. Maringolo



Re: [Pharo-users] Pharo: Git and GUI speed; JS widget reuse in PharoJS

2019-10-07 Thread Esteban Maringolo
On Mon, Oct 7, 2019 at 12:07 PM Esteban Lorenzano  wrote:
> > On 7 Oct 2019, at 11:55, Esteban Maringolo  wrote:

> >> So I’m wondering when the Pharo GUI will snap as well as VW.
> >
> > Maybe with native widgets there will be a significant speedup,
> > although I don't know whether the lag comes from rendering time or
> > from something else.
>
> Morphic + Glamour sometimes + bad UI/algorithms design put us in a bad place 
> concerning UI speed.

Pharo 5 was the turning point when it comes to that, and it correlates
with the introduction of the Glamour-based tools.

> We are working to fix it, but this is not straightforward.

I know, and the effort put into that is really appreciated.

I haven't used your latest "native widgets" (GTK) build, but as long
as the UI isn't programmed to be as async as possible, then any non-UI
related event will slowdown or micro-block the UI, causing the noticed
latency.

I know I'm speaking the obvious to you here, but if you look at things
like Android Architecture there is a lot to learn from, because mobile
users expect significantly faster, non-blocking UIs that desktop, and
not to mention web (although this is is changing too).

Regards,

Esteban A. Maringolo



Re: [Pharo-users] Pharo: Git and GUI speed; JS widget reuse in PharoJS

2019-10-09 Thread Esteban Maringolo
On Wed, Oct 9, 2019 at 10:50 AM Esteban Lorenzano  wrote:

> There are a lot of things to consider, not just the native widgets.

> For example: how do you run those widgets? Because you need an event loop… 
> and while linux and windows do not care in which thread you run this, macOS 
> requires you to run it in the main thread.
> This means you need to run the VM using one of two strategies:
>
> 1) using the idle signal of Gtk (in case of gtk, but other frameworks have 
> similar things). This is of course suboptimal and forget about real-time 
> processing.
> 2) running the VM in a separated thread. This works as expected (and it also 
> follow apple application design recommendations) but then you need to make 
> sure the communication between the main thread and your vm thread work as 
> expected (and is not so easy)
>
> With Pablo we are working on (2), and I have to say that yes, if you do not 
> manage well things, you will not have more speed “just because” :)

This is great. Android does the same thing as MacOS, and it is even
enforced by the OS, it will mark any app as unresponsive if it blocks
the UI thread.
You can fork Threads that communicate with the UI thread by means of a
"Handler" [1], to map this using a dynamic language is simpler, but
you'd need an event loop in the UI first (I don't know whether we have
this in Pharo).

Regards,

[1] https://developer.android.com/training/multiple-threads/communicate-ui

Esteban A. Maringolo



Re: [Pharo-users] How to zip a WideString

2019-10-10 Thread Esteban Maringolo
On Wed, Oct 9, 2019 at 3:18 PM Sven Van Caekenberghe  wrote:
>
> Actually, thinking about the original use case, I now feel that it would be 
> best to remove #zipped/unzipped from String.

Please do. Cases like this teach us about the proper separation of concerns.

Regards,

--
Esteban



Re: [Pharo-users] BlockClosure

2019-10-23 Thread Esteban Maringolo
There's no way you could use an integer (or any  number) as a selector.

So what you can do if you want to avoid using the "wordy" #value: selector
is to implement your own selector in BlockClosure.

It could be a #v: selector (so it is still a keyword selector) or a symbol
such as #<< that ends up calling #value:, but keep in mind that if you use
a symbol you cannot extend it to have more than one parameter.

Regards,



El mié., 23 de octubre de 2019 09:22, main 
escribió:

> Hello fellow Pharoians (?) from a lonely Swede.
>
> I just found out about Pharo (and Smalltalk) two days ago and I'm already
> loving it :)
> However, there is a behavior I would like to change, or be enlightened
> about
> how it could be done.
>
> As I understand it (bear with me) BlockClosure from Kernel-Methods does not
> understand (by default?) how to respond to an "anonymous object" (no
> message
> name).
>
> Is there any way this could be implemented? I'll post an example soon
> (I currently use both Pharo 7 and 8)
>
> If I write the following:
>
> [:x | x + 1] value: 3
>
> and evaluate it, I get the expected result, which is 4.
>
> That's nice.
>
> What I would really like is to be able to just send 3 to BlockClosure and
> make it repond as above.
>
> Like this:
>
> [:x | x + 1] 3
>
> or like this:
>
> 3 [:x | x + 1]
>
> Would this be possible?
>
> ---
>
> Also as a bonus, would it be possible to use this for "function
> composition", "Block composition" or similar?
>
> Example of composition:
>
> [ :f :g | [ :x | f value: (g value: x) ] ]
>
> I could use this construct like this for example:
>
> (([ :f :g | [ :x | f value: (g value: x) ] ])
> value: [:x | x + 1]
> value: [:x | x - 1])
> value: 5
>
> But… It's a bit wordy.
>
> What I would like to be able to do (essentialy remove "value:"):
>
> (([ :f :g | [ :x | f (g x) ] ])
> [:x | x + 1]
> [:x | x - 1])
> 5.
>
> Or in one line:
> (([ :f :g | [ :x | f (g x) ] ]) [:x | x + 1] [:x | x - 1]) 5.
>
> While this might seem obscure, I would really find it useful.
>
> Can it be done?
>
> Thanks in advance
>
>
>
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>
>


Re: [Pharo-users] [ANN] XMLParser moved to GitHub

2019-11-19 Thread Esteban Maringolo
+1

Thanks for the effort. Not only migrated the code, but also polished
it, documented, and setup a CI for it.

Regards!

Esteban A. Maringolo

On Tue, Nov 19, 2019 at 8:53 AM Sven Van Caekenberghe  wrote:
>
> Great!
>
> Thank you for this effort, it was probably much harder than it looks.
>
> > On 19 Nov 2019, at 12:32, Torsten Bergmann  wrote:
> >
> > Hi,
> >
> > the STHub -> PharoExtras project "XMLParser"
> >
> > was now moved from http://smalltalkhub.com/#!/~PharoExtras/XMLParser to
> > https://github.com/pharo-contributions/XML-XMLParser including the FULL 
> > HISTORY
> >
> > The old STHub repo was marked as obsolete - but is linking to the new one. 
> > I've also
> > setup an CI job:  https://travis-ci.org/pharo-contributions/XML-XMLParser
> > which is green for Pharo 7. Some cleanups, class comments and docu was 
> > applied as you can
> > see from commit history.
> >
> > The new version is tagged in git as version 3.5.0 (with a moveable tag 
> > 3.5.x in case further
> > hotfixes are required).
> >
> > If you want to load use
> >
> >   Metacello new
> >   baseline: 'XMLParser';
> >   repository: 'github://pharo-contributions/XML-XMLParser/src';
> >   load.
> >
> > or try to load from catalog in Pharo 7 and 8.
> >
> > For referencing in own baselines I would suggest to use the 3.5.x tag line:
> >
> >  
> > 
> >  xmlParserOn: spec
> >   spec
> >   baseline: 'XMLParser'
> >with: [
> >   spec
> >   loads: #('Core');
> >   repository: 
> > 'github://pharo-contributions/XML-XMLParser:3.5.x/src' ].
> >   spec
> >   project: 'XMLParser Tests' copyFrom: 'XMLParser' with: [ spec 
> > loads: #('Tests') ];
> >   project: 'XMLParser Tools' copyFrom: 'XMLParser' with: [ spec 
> > loads: #('Tools') ]
> >   
> > 
> >
> > Currently there is a dependency on OrderPreservingDictionary project which 
> > will be thrown out in
> > a later iteration (see attached graph and [1] for more details).
> >
> > More to come soon ...
> >
> > Have fun
> > T.
> >
> > [1]  
> > https://lists.pharo.org/pipermail/pharo-users_lists.pharo.org/2019-November/044793.html
> > 
>
>



Re: [Pharo-users] [ANN] XMLParserHTML moved to GitHub

2019-11-29 Thread Esteban Maringolo
Thank you Torsten,

I wasn't aware of this tool, I'm already using it to scrap content
from a website and fed a Pharo driven system :)

The XML integration in the Inspector is great too.

Regards!

Esteban A. Maringolo

On Tue, Nov 19, 2019 at 8:40 AM Torsten Bergmann  wrote:
>
> Hi,
>
> the STHub -> PharoExtras project "XMLParserHTML"
>
> was now moved from http://smalltalkhub.com/#!/~PharoExtras/XMLParserHTML to
> https://github.com/pharo-contributions/XML-XMLParserHTML including the FULL 
> HISTORY
>
> The old STHub repo was marked as obsolete - but is linking to the new one. 
> I've also
> setup an CI job:  https://travis-ci.org/pharo-contributions/XML-XMLParserHTML
> which is green for Pharo 7. Some cleanups, class comments and docu was 
> applied as you can
> see from commit history.
>
> The new version is tagged in git as version 1.6.0 (with a moveable tag 1.6.x 
> in case further
> hotfixes are required).
>
> You can load using
>
>Metacello new
> baseline: 'XMLParserHTML';
> repository: 'github://pharo-contributions/XML-XMLParserHTML/src';
> load.
>
> or from catalog in Pharo 7 or 8.
>
> Attached is current dependency graph.
>
> More to come soon ...
>
> Bye
> T.



Re: [Pharo-users] [ANN] XMLParserHTML moved to GitHub

2019-11-29 Thread Esteban Maringolo
Great!

I just added a link to the README.md of the project and created a PR,
because it is very likely that if you're parsing HTML you're doing
some scrapping. :-)

Esteban A. Maringolo


On Fri, Nov 29, 2019 at 2:18 PM Cédrick Béler  wrote:
>
> Stef and other wrote this book a while ago:
>
> http://books.pharo.org/booklet-Scraping/html/scrapingbook.html
>
> Basically XMLHtmlParser + XPath
>
> To me, far better than using Soup.
> Google chrome pharo integration helps top to scrap complex full JS web site 
> like google ;)



Re: [Pharo-users] [ANN] XMLParserHTML moved to GitHub

2019-11-30 Thread Esteban Maringolo
Why use Chrome instead of ZnClient? To get a "real" render of the
content? (including JS and whatnot).

Regards!


Esteban A. Maringolo

On Sat, Nov 30, 2019 at 8:11 PM Cédrick Béler  wrote:
>
>
> >
> > Also interesting! Any publicly available examples? How does one load "Google
> > chrome pharo integration »?
>
> "https://github.com/astares/Pharo-Chrome";
> "https://github.com/akgrant43/Pharo-Chrome »
>
> Cheers,
>
> Cédrick
>
>



[Pharo-users] Cache for ZnClient

2019-12-04 Thread Esteban Maringolo
Is there any library/setting that adds "cache" to ZnClient?

I'm doing some web scrapping with ZnClient, and sometimes I request
the same pages (~300) more than once, and I'd like to save requests
(and time) by simply retrieving what's in the cache (since the content
doesn't change frequently).

Maybe there other way is to put an HTTP proxy in between and ask the
local proxy.

Regards,

Esteban A. Maringolo



Re: [Pharo-users] Cache for ZnClient

2019-12-04 Thread Esteban Maringolo
Hi Sven,

Yeap, building something would be fairly easy, I just wanted to avoid doing it.
Or to know where I should "hook" such cache lookup in the ZnClient
before performing the actual network request.

Regards,



Esteban A. Maringolo

On Wed, Dec 4, 2019 at 6:27 PM Sven Van Caekenberghe  wrote:
>
> Hi Esteban,
>
> > On 4 Dec 2019, at 21:35, Esteban Maringolo  wrote:
> >
> > Is there any library/setting that adds "cache" to ZnClient?
> >
> > I'm doing some web scrapping with ZnClient, and sometimes I request
> > the same pages (~300) more than once, and I'd like to save requests
> > (and time) by simply retrieving what's in the cache (since the content
> > doesn't change frequently).
> >
> > Maybe there other way is to put an HTTP proxy in between and ask the
> > local proxy.
> >
> > Regards,
> >
> > Esteban A. Maringolo
>
> No, this does not exist as such, not in public code anyway, AFAIK.
>
> In our codebase there is a RestJsonClient which holds onto an httpClient and 
> a CachingRestJsonClient as a subclass of that one, that add a cache url->json 
> with time and number of entries based lru invalidation.
>
> It would not be too hard to built this yourself.
>
> Sven
>
>



Re: [Pharo-users] Cache for ZnClient

2019-12-04 Thread Esteban Maringolo
I created a ZnCachingClient subclass of ZnClient, and I cache GET
requests responses on disk.

The overview is here:
https://gist.github.com/eMaringolo/bed9974d70c9ab8c6398149716e22b08

I don't differentiate about content type nor encoding, because for my
use case I'm only caching text/html responses.
It's simple, but it works pretty well and saved me a lot of time in
the debugging of the scrapper :-)


Regards!

Esteban A. Maringolo

Esteban A. Maringolo


On Wed, Dec 4, 2019 at 6:58 PM Esteban Maringolo  wrote:
>
> Hi Sven,
>
> Yeap, building something would be fairly easy, I just wanted to avoid doing 
> it.
> Or to know where I should "hook" such cache lookup in the ZnClient
> before performing the actual network request.
>
> Regards,
>
>
>
> Esteban A. Maringolo
>
> On Wed, Dec 4, 2019 at 6:27 PM Sven Van Caekenberghe  wrote:
> >
> > Hi Esteban,
> >
> > > On 4 Dec 2019, at 21:35, Esteban Maringolo  wrote:
> > >
> > > Is there any library/setting that adds "cache" to ZnClient?
> > >
> > > I'm doing some web scrapping with ZnClient, and sometimes I request
> > > the same pages (~300) more than once, and I'd like to save requests
> > > (and time) by simply retrieving what's in the cache (since the content
> > > doesn't change frequently).
> > >
> > > Maybe there other way is to put an HTTP proxy in between and ask the
> > > local proxy.
> > >
> > > Regards,
> > >
> > > Esteban A. Maringolo
> >
> > No, this does not exist as such, not in public code anyway, AFAIK.
> >
> > In our codebase there is a RestJsonClient which holds onto an httpClient 
> > and a CachingRestJsonClient as a subclass of that one, that add a cache 
> > url->json with time and number of entries based lru invalidation.
> >
> > It would not be too hard to built this yourself.
> >
> > Sven
> >
> >



[Pharo-users] Calypso loading code spinner

2019-12-06 Thread Esteban Maringolo
It is happening to me very often that to access the source of a
method, or sometimes to find senders/implementors, the Calypso browser
takes a long time to load it.

By long I mean from two to five seconds, sometimes longer.

I'm running Pharo 7 within a VirtualBox VM with Ubuntu 16.04 in a
Windows 10 host.

Regards,

Pharo 7.0.3
Build information:
Pharo-7.0.3+build.164.sha.591a635c8922e5f1cff1d0b3fbf2e525b590d25f (64
Bit)


Esteban A. Maringolo


Re: [Pharo-users] Calypso loading code spinner

2019-12-06 Thread Esteban Maringolo
Answering myself...

It seems to be related with the power management because as soon as I
plugged in my laptop the spinning effect went away (and also the whole
environment got faster).
Maybe it has to do with the guest OS power management, although I
didn't see any noticeable slowdown in other apps within the VM.

Is there any specific PM thing in the Pharo VM? Or should I look at
the VBOX/Ubuntu settings.

Regards.

Esteban A. Maringolo

On Fri, Dec 6, 2019 at 7:02 PM Esteban Maringolo  wrote:
>
> It is happening to me very often that to access the source of a
> method, or sometimes to find senders/implementors, the Calypso browser
> takes a long time to load it.
>
> By long I mean from two to five seconds, sometimes longer.
>
> I'm running Pharo 7 within a VirtualBox VM with Ubuntu 16.04 in a
> Windows 10 host.
>
> Regards,
>
> Pharo 7.0.3
> Build information:
> Pharo-7.0.3+build.164.sha.591a635c8922e5f1cff1d0b3fbf2e525b590d25f (64
> Bit)
>
>
> Esteban A. Maringolo



[Pharo-users] Localization of Months and Day names

2019-12-17 Thread Esteban Maringolo
What is the "official way" (if any) to localize the printing of Date
Month and Day names?

I saw there is a Locale class, but neither the primLongDateFormat and
primShortDateFormat have any senders, so if they're used, it's not
through message sends.

Regards!

Esteban A. Maringolo



Re: [Pharo-users] Namespaces (was Re: Behold Pharo: The Modern Smalltalk)

2019-12-22 Thread Esteban Maringolo
There are two uses for namespacing:
1. Avoiding class name collisions between different packages
2. Modularization

I don't have the use cases for 2, but Torsten had an idea to support
the dot in the class name, that'd solve the problem 1. (e.g.
Chronology.Date and YourPackage.Date).

Esteban A. Maringolo

On Sun, Dec 22, 2019 at 8:57 AM ponyatov  wrote:
>
> What is the modern state of namespaces support? Maybe in Pharo 8 (or 9)
>
> I'm going to model some generic async Smalltalk in Pharo, package-bounded
> namespaces can save me from prefixing every class name.
>
>
>
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>



[Pharo-users] High CPU use idling

2019-12-23 Thread Esteban Maringolo
I constantly find Pharo eating the CPU of the VM, from 25% on idle to
100%, which of course heats up any laptop.

The Pharo Process monitor doesn't show anything unusual, but I cannot
tell from that tool if some process is the culprit.

How can I know what is eating the CPU?
Is there a way to kill all the unnecessary process and respawn the needed ones?

I run Pharo 7 within a VirtualBox VM with Lubuntu on a Windows 10 host.
But the CPU issue happens only with Pharo.

Regards,

Image: Pharo-7.0.3+build.164.sha.591a635c8922e5f1cff1d0b3fbf2e525b590d25f
(64 Bit)
Vm: /lib/pharo/5.0-201901051900/pharo (downloaded by PharoLauncher)

Esteban A. Maringolo



Re: [Pharo-users] High CPU use idling

2019-12-23 Thread Esteban Maringolo
I did a few extra things to detect the anomaly and I found that this
happens mostly when running on battery (with CPU throttling).

The CPU use gets more intense the more power friendly the power scheme is.

I created an issue with a linked video because this might be happening
only with VirtualBox or some weird combination.

https://github.com/pharo-project/pharo/issues/5417

Regards,

Esteban A. Maringolo

On Mon, Dec 23, 2019 at 6:27 PM Esteban Maringolo  wrote:
>
> I constantly find Pharo eating the CPU of the VM, from 25% on idle to
> 100%, which of course heats up any laptop.
>
> The Pharo Process monitor doesn't show anything unusual, but I cannot
> tell from that tool if some process is the culprit.
>
> How can I know what is eating the CPU?
> Is there a way to kill all the unnecessary process and respawn the needed 
> ones?
>
> I run Pharo 7 within a VirtualBox VM with Lubuntu on a Windows 10 host.
> But the CPU issue happens only with Pharo.
>
> Regards,
>
> Image: Pharo-7.0.3+build.164.sha.591a635c8922e5f1cff1d0b3fbf2e525b590d25f
> (64 Bit)
> Vm: /lib/pharo/5.0-201901051900/pharo (downloaded by PharoLauncher)
>
> Esteban A. Maringolo



Re: [Pharo-users] Date offset in Glorp and RDBMS

2019-12-29 Thread Esteban Maringolo
+1 to #equals:, it is for that purpose.

However it might be the case that Glorp is testing a type that is
expected to have an offset/timezone, in which case you'd be "eating"
the error if the cell value contains a timezone different than the one
in your image.

Esteban A. Maringolo

On Sun, Dec 29, 2019 at 9:46 AM Sven Van Caekenberghe  wrote:
>
> Hi Tomaz,
>
> Consider
>
>   DateAndTime now asUTC asDate = Date today.
>
> which is false (on most systems), while
>
>   DateAndTime now asUTC asDate equals: Date today.
>
> is true. #equals was added specifically for that purpose (ignore the offset).
>
> Note also that an abstract date (year/month/day) does not exist without the 
> context of a proper timezone (an offset is not enough).
>
> Sven
>
> > On 29 Dec 2019, at 13:29, eftomi  wrote:
> >
> > Dear all,
> >
> > Going through the remaining red tests in PharoADO + Glorp, I have a sort of
> > a conceptual challenge. Some of the Glorp tests are checking the equality of
> > dates written to and then returned from the database. Pharo regards the
> > dates as not equal if their time offsets are different despite the fact that
> > the date (in a narrow sense) is the same. For instance:
> >
> > "2019-12-29T00:00:00+01:00"
> >
> > is not equal to
> >
> > "2019-12-29T00:00:00+00:00"
> >
> > The challenge is that the ActiveX Data Objects (ADO) library that I'm using
> > returnes the dates in Variants which don't have any information about the
> > offset. The conversion from ADO variants to Pharo's Date is done in PharoCOM
> > package.
> >
> > What would be the best approach to somehow ignore the missing offset or
> > impute a proper value? Of course it's better to ignore a missing data than
> > to impute a wrong value. How is this handled with other DB systems?
> >
> > Thanks,
> > Tomaz
> >
> >
> >
> > --
> > Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
> >
>
>



Re: [Pharo-users] why is masses not found?

2019-12-31 Thread Esteban Maringolo
On Tue, Dec 31, 2019 at 11:29 AM Roelof Wobben via Pharo-users
 wrote:
>
> I solved it but I think with ugly code on the class side.
>
> solution
>  | computer |
>  computer := self new.
>  computer readRam: computer masses.
>  computer patchRam: 1 value: 12.
>  computer patchRam: 2 value: 2.
>  computer processData: computer ram.
>  computer at: 0
>
> Is there a way I can make this more smalltalk.

I don't know exactly why you mean by "more smalltalk", I don't know
the problem you're solving, but you have a class side method that
doesn't return anything, and the readRam: and processData: methods
pass arguments that the receiver already have.

So I'd do:

solution
 | computer |
 computer := self new.
 computer readMasses;
 computer patchRam: 1 value: 12.
 computer patchRam: 2 value: 2.
 computer processRAMData.
 ^computer at: 0 "I don't know what this does".



Re: [Pharo-users] [ANN] Phoedown - Markdown to HTML

2020-01-02 Thread Esteban Maringolo
On Thu, Jan 2, 2020 at 3:47 PM Sean P. DeNigris  wrote:
>
> Tim Mackinnon wrote
> > I’m getting the impression that ffi is getting very easy these days and
> > maybe we should use it more to focus on “other” things... This said, many
> > of our nastiest bugs...
>
> That said, as you pointed out, bugs seem to be
> more severe and difficult to diagnose, so we'll see how it goes as FFI use
> becomes more and more common...

It seems to have played very well for the Python folks.
It should work even better for Pharo. :)



Esteban A. Maringolo



Re: [Pharo-users] Why Smalltalk is so easy to evangelize

2020-01-09 Thread Esteban Maringolo
Hi Richard,

Regardless of the reasoning behind the title of the article, I don't
like the tone of the last paragraph, it is not necessary, and probably
not recommended either, to demote other languages in order to promote
yours. In particular languages that have their own merits and
capabilities to which Smalltalk/Pharo can't fulfill today, and by
design won't neither.

Regards,


Esteban A. Maringolo

On Thu, Jan 9, 2020 at 1:07 PM Richard Kenneth Eng
 wrote:
>
> https://itnext.io/why-smalltalk-is-so-easy-to-evangelize-2b88b4d4605c
>
>



Re: [Pharo-users] Why Smalltalk is so easy to evangelize

2020-01-09 Thread Esteban Maringolo
On Thu, Jan 9, 2020 at 2:23 PM horrido  wrote:

> I happen to like Dart, Elixir, Golang, Julia, and Rust. But be honest: do
> these languages provide nearly as many reasons to choose them?
> I'm not being deprecatory.

I don't know about Julia nor Elixir, but Dart has Flutter, Golang
drives a good chunk of the high-availability internet and Rust is
becoming the most secure programming language and several critical
applications are being rewritten in Rust.

Their user base is huge (and so is their funding), but it's not only
about funding, the reasons to choose them are a lot, there is no
silver bullet.

Regards,

Esteban A. Maringolo



Re: [Pharo-users] Why Smalltalk is so easy to evangelize

2020-01-09 Thread Esteban Maringolo
Hi Richard,

I don't find Smalltalk easy to evangelize, and in my experience the
appeal to history (a variation of the "argumentum ad antiquitatem"
fallacy) proved ineffective.

People don't care about who invented MVC, bitblt or JIT, and so make
decisions looking into the future, they weight in the past of course,
but looking forward is what matters for any decision you take now.

That's why things like Flutter or Elixir and other "new" technologies
get the attention they get these days, even when there are no "huge"
success cases. I can't judge whether these techs have value, are hyped
and/or there is a lot of FOMO in the decision making process. And no,
I don't believe it is because of Google shoving it through people
throats, it's people finding something valuable and trying to get an
professional advantage by learning/adopting it early.

Smalltalk adoption in the last decade has grown by its own merits,
_despite_ of the efforts to promote it.

I would bet that any appeal to emotion could be more effective, since
most developers get frustrated and any modern Smalltalk dialect can
ease that inherent frustration of software development, or even
better, turn it into an enjoyable experience (as it's been my case for
over a decade).

Have some reasonable big tech/company saying they're going to use X,
and you'll have flocks of users trying X.

Esteban A. Maringolo

On Thu, Jan 9, 2020 at 5:03 PM horrido  wrote:
>
> Absolutely correct. Each of those languages do have good reasons to choose
> them. I have never said otherwise.
>
> My point is that Smalltalk gives me many more reasons, many more ways to
> evangelize it. Smalltalk is very easy to evangelize. That's the premise of
> the entire article, and if it's wrong, then I should delete the entire
> article.
>
> Is it wrong?
>
>
>
> Esteban A. Maringolo wrote
> > On Thu, Jan 9, 2020 at 2:23 PM horrido <
>
> > horrido.hobbies@
>
> > > wrote:
> >
> >> I happen to like Dart, Elixir, Golang, Julia, and Rust. But be honest: do
> >> these languages provide nearly as many reasons to choose them?
> >> I'm not being deprecatory.
> >
> > I don't know about Julia nor Elixir, but Dart has Flutter, Golang
> > drives a good chunk of the high-availability internet and Rust is
> > becoming the most secure programming language and several critical
> > applications are being rewritten in Rust.
> >
> > Their user base is huge (and so is their funding), but it's not only
> > about funding, the reasons to choose them are a lot, there is no
> > silver bullet.
> >
> > Regards,
> >
> > Esteban A. Maringolo
>
>
>
>
>
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>



Re: [Pharo-users] Why Smalltalk is so easy to evangelize

2020-01-10 Thread Esteban Maringolo
On Fri, Jan 10, 2020 at 6:53 AM jtuc...@objektfabrik.de
 wrote:

> I wanted to stay out of this thread, because it leads nowhere. But now
> that I've typed all this, I will push the send button and regret it in a
> few minutes...

Don't regret it, I like how you wrote and I agree with most of what
you said, maybe because we deal with similar kind of software
solutions.

It's only when you use something to solve a real problem, usually with
economic constraints, that you find its strengths and limitations. And
Smalltalk has both.

Regards,

Esteban A. Maringolo



Re: [Pharo-users] Smalltalk Poll

2020-01-29 Thread Esteban Maringolo
Final and correct option: All the above :-D

Esteban A. Maringolo


On Wed, Jan 29, 2020 at 9:40 AM Richard Kenneth Eng <
horrido.hobb...@gmail.com> wrote:

> I'm crafting a Smalltalk poll for my blog. I just wanted to get some
> feedback. Have I overlooked anything?
>
> [image: image.png]
>


Re: [Pharo-users] Just curious...

2020-01-30 Thread Esteban Maringolo
The number after the s is the scale of the ScaledDecimal.

E.g. If you write 0.1s3 it means you instantiate a ScaledDecimal that is 0.001

So it sems that printOn: in ScaledDecimal is being "explicit" as it
prints 1 when other dialects don't.

Regards,

Esteban A. Maringolo


On Thu, Jan 30, 2020 at 2:07 PM Richard Kenneth Eng
 wrote:
>
> In the Playground, if I type in
>
> 0.1s
>
> and then "Print it", I get the following output:
>
> 0.1s1
>
> What does the s1 stand for? Why doesn't it simply print s?
>



Re: [Pharo-users] Just curious...

2020-01-30 Thread Esteban Maringolo
Errata:

> E.g. If you write 0.1s3 it means you instantiate a ScaledDecimal that is 0.001

I meant: 0.1s3 = 0.100

Esteban A. Maringolo


On Thu, Jan 30, 2020 at 2:28 PM Esteban Maringolo  wrote:
>
> The number after the s is the scale of the ScaledDecimal.
>
> E.g. If you write 0.1s3 it means you instantiate a ScaledDecimal that is 0.001
>
> So it sems that printOn: in ScaledDecimal is being "explicit" as it
> prints 1 when other dialects don't.
>
> Regards,
>
> Esteban A. Maringolo
>
>
> On Thu, Jan 30, 2020 at 2:07 PM Richard Kenneth Eng
>  wrote:
> >
> > In the Playground, if I type in
> >
> > 0.1s
> >
> > and then "Print it", I get the following output:
> >
> > 0.1s1
> >
> > What does the s1 stand for? Why doesn't it simply print s?
> >



Re: [Pharo-users] About "it's not pharo but smalltalk"

2020-02-05 Thread Esteban Maringolo
On Wed, Feb 5, 2020 at 2:22 PM Steve Davies
 wrote:

> I don't know where Pharo stops and Smalltalk starts, so its not easy for me 
> to tell if my question is a Pharo question of a Smalltalk one.

Pharo is the political division(*) , Smalltalk was is the same territory.

>From now on you can call it Pharo because it was built with its own
merits, but you can't deny that regardless of the new flag, there was
Smalltalk in the same territory. :-)

Regards,

(*) In cases like this, literally an arbitrary border.

Esteban A. Maringolo



Re: [Pharo-users] About "it's not pharo but smalltalk"

2020-02-05 Thread Esteban Maringolo
On Wed, Feb 5, 2020 at 4:48 PM horrido  wrote:
>
> I learned a long time ago that you can't please everybody. I've heard the
> critics about my evangelism. I've also heard the praise.
>
> So what am I supposed to do? Listen to the critics and ignore the fans?

tr;dr answer: know who you listen to.

But if you've been for a while (it is, years) here in this tiny tribe
(in global scale) that is the Smalltalk community, you'd pay attention
to the critics from many whose feedback can be treated as wisdom.

In particular when you're promoting something that you might have
mastered in the past, but given your recent questions in the list, you
don't today.

Smalltalk as a concept lacks a good PR these days, so does Pharo as a
product (although non-commercial), but Pharo has been successful in
growing organically and create some kind of grassroots, albeit slow.

And in technical environments bad PR is counterproductive and if you
push too hard it usually fires back.

Regards,

Esteban A. Maringolo



Re: [Pharo-users] "Theming" dictionaries?

2020-02-19 Thread Esteban Maringolo
I'm not sure I fully understand your question.

But Dictionaries expect its elements to respond to #key/#value messages,
and in the case of Pharo Dictionary is tightly bound to the Association
class (and the #-> selector), so there is no way to subclassify Dictionary
and specify the class of its elements.

Otherwise you could subclassify Dictionary and have its elements to be
instances of "MinipediaLanguage", that is polymorphic with Association but
have language/titles instead of key/value.

I don't see the need for it, though.

Esteban A. Maringolo


On Wed, Feb 19, 2020 at 1:49 PM Offray Vladimir Luna Cárdenas <
offray.l...@mutabit.com> wrote:

> Hi,
>
> As some of you may know, I'm a "savage coder" who learned
> Smalltalk/Pharo by himself, of course thanks to communities, books and
> videos, but without formal training or peers in the same country and
> guided mostly by necessity. All this to say that this maybe kind of a
> silly question.
>
> Anyway, we have this project called Minipedia[1], that imports Wikipedia
> articles and their history. A Minipedia language there, is just a
> dictionary, where the key is the language two letters code and the value
> for each key is an array of article titles. There is any way to
> specialize a Dictionary to tell it, name your 'key' as language and your
> 'value' as 'titles'?
>
> [1] https://mutabit.com/repos.fossil/minipedia/
>
> Thanks,
>
> Offray
>
>
>
>


Re: [Pharo-users] "Theming" dictionaries?

2020-02-19 Thread Esteban Maringolo
On Wed, Feb 19, 2020 at 2:09 PM Richard Sargent
 wrote:

> If you want to have a limited API, you wrap a dictionary with a new class 
> that exposes just the API you desire consumers to use.
>
> In general, inheritance is often overused or/ misused. Composition is usually 
> a better technique unless you want the full API of the hierarchy to be 
> available and used.

+1 to this.

Inheriting means accepting the "interface contract" of being able to
respond to all the messages understood by its superclasses.
It also limits your model to future refactorings and modifications.

I rarely, if ever, sub-classify any "base" class for domain modelling,
and more so in the case of Collection classes, and when I had to deal
with domain classes that did that, it always caused more problems than
solutions.

Regards,

Esteban A. Maringolo



Re: [Pharo-users] [ANN] Open source Pharo application "mediaclue"

2020-02-25 Thread Esteban Maringolo
Hi Andreas,

Thanks for sharing the whole stack and how to build it from the ground up.

One thing I noticed is that you are using the Plupload component?
How was that integration with Seaside done? Is it available separately?

Thanks!

Esteban A. Maringolo

On Tue, Feb 25, 2020 at 10:41 AM Brodbeck Andreas
 wrote:
>
> Hi all
>
> I'm a Pharo lover since many years. A huge thanks to all of you, making Pharo 
> possible! As a giving back I would like to open source some of my business 
> projects (Thanks to my supporting customers, too). The first is a web based 
> media assets management called "mediaclue" (Think of it as a 
> image/audio/video/document sharing platform, e.g. for teachers inside a 
> school):
>
> ***
> https://github.com/talk-small-be-open/mediaclue
> ***
>
> (Everything is ready for simple install into a fresh Linux server with 
> included Ansible provisioning scripts to create the whole appliance)
>
> Cheers!
> Andreas
>
> P.S. The UI language is still german at the moment, but that should turn 
> multilanguage eventually
>
> -
> Brot? www.brotrezept.ch!
>
> Andreas Brodbeck
> Software-Macher
> mindclue GmbH
> Dipl. El.-Ing. ETH
>
> +41 55 622 26 24
> www.mindclue.ch
> -
>
>



Re: [Pharo-users] evaluation of the expression 7 factorial

2020-03-10 Thread Esteban Maringolo
Try inspecting the result (Cmd+i) instead of printing it.

The print result is breaking the number (5040) in two lines, but you only
see the first three characters.

Regards!

Esteban A. Maringolo


On Tue, Mar 10, 2020 at 1:48 PM Rene Paul Mages (ramix) 
wrote:

> Hello,
>
> As you can see :
>
> http://ramix.org/pharo/version-8.0/7-factorial.png
>
> the result of the following evaluation is not 5040 :
>
> 7 factorial
>
> Nota Bene : my linux laptop is running the 64 bits version of Pharo 8.0.0
>
> --
> Thanks for your help.
> Rene Paul Mages (ramix) GnuPG key 0x9840A6F7
> http://renemages.wordpress.com/smalltalk/pharo/
> http://www.linux-azur.org/ramix
> http://blog.pharo.fr
>
>


Re: [Pharo-users] Generate class hierarchy from JSON Schema

2020-03-11 Thread Esteban Maringolo
Hi,

To feed a Pharo app I need to read from an old MDB file, via ODBC.

So I tested PharoADO and, after adding a missing Variant Type [1], I got my
query working (at least read only).

However the time of ADOClient to return a query with 10K rows of 5 columns
each is extremely slow (+65000ms) compared, e.g., with Dolphin Smalltalk
via ODBC (62ms).

The time of the execute call to return is instantaneous, so I think the
issue might be in the creation of the result set.

Is this a known issue?

Should I check something else?

Thanks in advance,


[1]  https://github.com/tesonep/pharo-com/pull/10
Esteban A. Maringolo


On Fri, Jan 24, 2020 at 5:59 AM Tomaž Turk  wrote:

>
> That would be amazing!
>
> I'm a Mac/Unix guy so I don't have access to the other platforms (I
> suppose I could fire up an AWS Oracle).  I can do mysql/mariadb, posgresql,
> and sqlite.
>
> I'm pretty close to pushing my ActiveRecord extensions.  I just need to
> get many to many with link tables done and it is good to go.  I spent a few
> days "porting" the ruby inflector and its tests.
>
> As for database introspection, I am relying on this new method and the
> result set format on DatabasePlatform.
>
> printSqlStatementToListColumnsInTable: aDatabaseTable inSchema:
> schemaString on: aStream
> " Format:
>   name   |   type| length | nullable |
> default_value | pk
>
> -+---++--+---+
>  id  | character varying |255 |0 |
> ''::character varying |  1
>
>
> This is great news about ActiveRecord!
>
> ADO is, unfortunately, a Windows library, so PharoADO is limited to
> Windows. Maybe as a next step we should focus into Garage and the addition
> of SQL Server and Oracle support. If I only had time ...
>
> Stéphane, thanks for the support.
>
> Best wishes,
> Tomaz
>
>
>
>
>
>
>


Re: [Pharo-users] Generate class hierarchy from JSON Schema

2020-03-11 Thread Esteban Maringolo
As an additional reference, I attach the profile tally  for the query I'm
mentioning.

The culprit seems to be the calculation of the ADOField properties that
might be calculated on every call.

Regards,

Esteban A. Maringolo


On Wed, Mar 11, 2020 at 2:13 PM Esteban Maringolo 
wrote:

> Hi,
>
> To feed a Pharo app I need to read from an old MDB file, via ODBC.
>
> So I tested PharoADO and, after adding a missing Variant Type [1], I got
> my query working (at least read only).
>
> However the time of ADOClient to return a query with 10K rows of 5 columns
> each is extremely slow (+65000ms) compared, e.g., with Dolphin Smalltalk
> via ODBC (62ms).
>
> The time of the execute call to return is instantaneous, so I think the
> issue might be in the creation of the result set.
>
> Is this a known issue?
>
> Should I check something else?
>
> Thanks in advance,
>
>
> [1]  https://github.com/tesonep/pharo-com/pull/10
> Esteban A. Maringolo
>
>
> On Fri, Jan 24, 2020 at 5:59 AM Tomaž Turk 
> wrote:
>
>>
>> That would be amazing!
>>
>> I'm a Mac/Unix guy so I don't have access to the other platforms (I
>> suppose I could fire up an AWS Oracle).  I can do mysql/mariadb, posgresql,
>> and sqlite.
>>
>> I'm pretty close to pushing my ActiveRecord extensions.  I just need to
>> get many to many with link tables done and it is good to go.  I spent a few
>> days "porting" the ruby inflector and its tests.
>>
>> As for database introspection, I am relying on this new method and the
>> result set format on DatabasePlatform.
>>
>> printSqlStatementToListColumnsInTable: aDatabaseTable inSchema:
>> schemaString on: aStream
>> " Format:
>>   name   |   type| length | nullable |
>> default_value | pk
>>
>> -+---++--+---+
>>  id  | character varying |255 |0 |
>> ''::character varying |  1
>>
>>
>> This is great news about ActiveRecord!
>>
>> ADO is, unfortunately, a Windows library, so PharoADO is limited to
>> Windows. Maybe as a next step we should focus into Garage and the addition
>> of SQL Server and Oracle support. If I only had time ...
>>
>> Stéphane, thanks for the support.
>>
>> Best wishes,
>> Tomaz
>>
>>
>>
>>
>>
>>
>>
 - 72071 tallies, 72100 msec.

**Tree**

Process: (40s) Morphic UI Process: nil

86.2% {62136ms} UndefinedObject>>DoIt
  86.2% {62136ms} ADOClient>>query:
86.2% {62128ms} Array class(SequenceableCollection class)>>streamContents:
  86.2% {62128ms} Array class(SequenceableCollection 
class)>>new:streamContents:
86.2% {62128ms} ADOClient>>query:
  85.0% {61281ms} Array class(SequenceableCollection 
class)>>streamContents:
85.0% {61277ms} Array class(SequenceableCollection 
class)>>new:streamContents:
  85.0% {61275ms} ADOClient>>query:
81.7% {58884ms} ADOField>>value
  |81.7% {58872ms} COMDispatchInstance>>propertyNamed:
  |  61.7% {44516ms} COMTypeInfo>>properties
  ||61.7% {44504ms} COMTypeInfo>>calculateProperties
  ||  58.5% {42198ms} COMTypeInfo>>methods
  |||58.5% {42198ms} COMTypeInfo>>calculateMethods
  |||  58.5% {42198ms} BlockClosure>>ensure:
  |||58.5% {42153ms} COMTypeInfo>>calculateMethods
  |||  57.2% {41257ms} 
COMTypeInfo>>calculateMethodAt:
  |||46.9% {33832ms} BlockClosure>>ensure:
  |||  |43.9% {31644ms} 
COMTypeInfo>>calculateMethodAt:
  |||  |  |41.6% {30017ms} COMMethod 
class>>fromFuncDesc:in:
  |||  |  |  |41.5% {29895ms} 
COMMethod>>from:in:
  |||  |  |  |  23.7% {17054ms} 
COMTypeInfo>>getNamesOfMemberID:maxNames:
  |||  |  |  ||9.7% {7016ms} 
OrderedCollection>>collect:
  |||  |  |  ||  |9.2% {6669ms} 
ByteSymbol(Symbol)>>value:
  |||  |  |  ||  |  9.2% {6624ms} 
BSTRString>>asString
  |||  |  |  ||  |8.9% {6411ms} 
Win32WideString>>asString
  |||  |  |  

Re: [Pharo-users] Generate class hierarchy from JSON Schema

2020-03-11 Thread Esteban Maringolo
The profiling using the recordset was even worst. I changed the iteration
[1] to add everything to a collection, but most of the time is spent in
#calculateMethods and #calculateProperties. Which is performed everytime
for each ADOField.

I wouldn't consider this a stress test, but maybe the methods and
properties should be cached, or a different class of dispatcher should be
used where the methods and properties are defined ahead of time instead of
being discovered when first invoked.

Regards,


[1] "Modified code"
rst := ADORecordset createInstance .
rst open: 'SELECT * FROM PLAYER' activeConnection: conn cursorType: 2
lockType: 3 options: -1.
results := OrderedCollection new.
[rst eof] whileFalse: [
  | row |
  row := Array new: rst fields count.
  1 to: row size do: [ :idx | row at: idx put: (rst fields item: idx) value
].
  results add: row.
  rst moveNext
 ].



Esteban A. Maringolo


On Wed, Mar 11, 2020 at 3:02 PM Tomaž Turk  wrote:

> Hi Esteban,
>
> Thanks for reporting this issue. I haven't made any "stress" tests yet for
> ADOClient. Could you please try to use ADORecordset as described in the
> readme? There you have a direct access to each record at a time, and then
> you can create your own "loop" to process the query result. In this way you
> can avoid the loop in ADOClient>>query: method.
>
> Best wishes,
> Tomaz
>
> -- Original Message --
> From: "Esteban Maringolo" 
> To: "Tomaž Turk" ; "Any question about pharo is
> welcome" 
> Sent: 11. 03. 2020 18:25:51
> Subject: Re: [Pharo-users] Generate class hierarchy from JSON Schema
>
> As an additional reference, I attach the profile tally  for the query I'm
> mentioning.
>
> The culprit seems to be the calculation of the ADOField properties that
> might be calculated on every call.
>
> Regards,
>
> Esteban A. Maringolo
>
>
> On Wed, Mar 11, 2020 at 2:13 PM Esteban Maringolo 
> wrote:
>
>> Hi,
>>
>> To feed a Pharo app I need to read from an old MDB file, via ODBC.
>>
>> So I tested PharoADO and, after adding a missing Variant Type [1], I got
>> my query working (at least read only).
>>
>> However the time of ADOClient to return a query with 10K rows of 5
>> columns each is extremely slow (+65000ms) compared, e.g., with Dolphin
>> Smalltalk via ODBC (62ms).
>>
>> The time of the execute call to return is instantaneous, so I think the
>> issue might be in the creation of the result set.
>>
>> Is this a known issue?
>>
>> Should I check something else?
>>
>> Thanks in advance,
>>
>>
>> [1]  https://github.com/tesonep/pharo-com/pull/10
>> Esteban A. Maringolo
>>
>>
>> On Fri, Jan 24, 2020 at 5:59 AM Tomaž Turk 
>> wrote:
>>
>>>
>>> That would be amazing!
>>>
>>> I'm a Mac/Unix guy so I don't have access to the other platforms (I
>>> suppose I could fire up an AWS Oracle).  I can do mysql/mariadb, posgresql,
>>> and sqlite.
>>>
>>> I'm pretty close to pushing my ActiveRecord extensions.  I just need to
>>> get many to many with link tables done and it is good to go.  I spent a few
>>> days "porting" the ruby inflector and its tests.
>>>
>>> As for database introspection, I am relying on this new method and the
>>> result set format on DatabasePlatform.
>>>
>>> printSqlStatementToListColumnsInTable: aDatabaseTable inSchema:
>>> schemaString on: aStream
>>> " Format:
>>>   name   |   type| length | nullable |
>>> default_value | pk
>>>
>>> -+---++--+---+
>>>  id  | character varying |255 |0 |
>>> ''::character varying |  1
>>>
>>>
>>> This is great news about ActiveRecord!
>>>
>>> ADO is, unfortunately, a Windows library, so PharoADO is limited to
>>> Windows. Maybe as a next step we should focus into Garage and the addition
>>> of SQL Server and Oracle support. If I only had time ...
>>>
>>> Stéphane, thanks for the support.
>>>
>>> Best wishes,
>>> Tomaz
>>>
>>>
>>>
>>>
>>>
>>>
>>>
 - 138775 tallies, 138791 msec.

**Tree**

Process: (40s) Morphic UI Process: nil

86.1% {119451ms} UndefinedObject>>DoIt
  43.2% {59996ms} ADOField>>value
|43.2% {59983ms} 

Re: [Pharo-users] Generate class hierarchy from JSON Schema

2020-03-11 Thread Esteban Maringolo
I did a small change in ADORecordset to have the fields as an instVar and
also in ADOFields to have each ADOField in an `items` instVar.
It is still slow compared to an ODBC API, but I got a 20x speedup
(~1000ms), that is spent mostly on the actual call to the dispatcher to
fetch each cell value.

I look forward for an ODBC API, but at least to read any other data source,
this seems to work pretty well.

I already sent a pull-request.

Esteban A. Maringolo


On Wed, Mar 11, 2020 at 3:31 PM Esteban Maringolo 
wrote:

>
> The profiling using the recordset was even worst. I changed the iteration
> [1] to add everything to a collection, but most of the time is spent in
> #calculateMethods and #calculateProperties. Which is performed everytime
> for each ADOField.
>
> I wouldn't consider this a stress test, but maybe the methods and
> properties should be cached, or a different class of dispatcher should be
> used where the methods and properties are defined ahead of time instead of
> being discovered when first invoked.
>
> Regards,
>
>
> [1] "Modified code"
> rst := ADORecordset createInstance .
> rst open: 'SELECT * FROM PLAYER' activeConnection: conn cursorType: 2
> lockType: 3 options: -1.
> results := OrderedCollection new.
> [rst eof] whileFalse: [
>   | row |
>   row := Array new: rst fields count.
>   1 to: row size do: [ :idx | row at: idx put: (rst fields item: idx)
> value ].
>   results add: row.
>   rst moveNext
>  ].
>
>
>
> Esteban A. Maringolo
>
>
> On Wed, Mar 11, 2020 at 3:02 PM Tomaž Turk 
> wrote:
>
>> Hi Esteban,
>>
>> Thanks for reporting this issue. I haven't made any "stress" tests yet
>> for ADOClient. Could you please try to use ADORecordset as described in the
>> readme? There you have a direct access to each record at a time, and then
>> you can create your own "loop" to process the query result. In this way you
>> can avoid the loop in ADOClient>>query: method.
>>
>> Best wishes,
>> Tomaz
>>
>> -- Original Message --
>> From: "Esteban Maringolo" 
>> To: "Tomaž Turk" ; "Any question about pharo is
>> welcome" 
>> Sent: 11. 03. 2020 18:25:51
>> Subject: Re: [Pharo-users] Generate class hierarchy from JSON Schema
>>
>> As an additional reference, I attach the profile tally  for the query I'm
>> mentioning.
>>
>> The culprit seems to be the calculation of the ADOField properties that
>> might be calculated on every call.
>>
>> Regards,
>>
>> Esteban A. Maringolo
>>
>>
>> On Wed, Mar 11, 2020 at 2:13 PM Esteban Maringolo 
>> wrote:
>>
>>> Hi,
>>>
>>> To feed a Pharo app I need to read from an old MDB file, via ODBC.
>>>
>>> So I tested PharoADO and, after adding a missing Variant Type [1], I got
>>> my query working (at least read only).
>>>
>>> However the time of ADOClient to return a query with 10K rows of 5
>>> columns each is extremely slow (+65000ms) compared, e.g., with Dolphin
>>> Smalltalk via ODBC (62ms).
>>>
>>> The time of the execute call to return is instantaneous, so I think the
>>> issue might be in the creation of the result set.
>>>
>>> Is this a known issue?
>>>
>>> Should I check something else?
>>>
>>> Thanks in advance,
>>>
>>>
>>> [1]  https://github.com/tesonep/pharo-com/pull/10
>>> Esteban A. Maringolo
>>>
>>>
>>> On Fri, Jan 24, 2020 at 5:59 AM Tomaž Turk 
>>> wrote:
>>>
>>>>
>>>> That would be amazing!
>>>>
>>>> I'm a Mac/Unix guy so I don't have access to the other platforms (I
>>>> suppose I could fire up an AWS Oracle).  I can do mysql/mariadb, posgresql,
>>>> and sqlite.
>>>>
>>>> I'm pretty close to pushing my ActiveRecord extensions.  I just need to
>>>> get many to many with link tables done and it is good to go.  I spent a few
>>>> days "porting" the ruby inflector and its tests.
>>>>
>>>> As for database introspection, I am relying on this new method and the
>>>> result set format on DatabasePlatform.
>>>>
>>>> printSqlStatementToListColumnsInTable: aDatabaseTable inSchema:
>>>> schemaString on: aStream
>>>> " Format:
>>>>   name   |   type| length | nullable |
>>>> default_value | pk
>>>>
>>>> -+---++--+---+
>>>>  id  | character varying |255 |0 |
>>>> ''::character varying |  1
>>>>
>>>>
>>>> This is great news about ActiveRecord!
>>>>
>>>> ADO is, unfortunately, a Windows library, so PharoADO is limited to
>>>> Windows. Maybe as a next step we should focus into Garage and the addition
>>>> of SQL Server and Oracle support. If I only had time ...
>>>>
>>>> Stéphane, thanks for the support.
>>>>
>>>> Best wishes,
>>>> Tomaz
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>


Re: [Pharo-users] Generate class hierarchy from JSON Schema

2020-03-11 Thread Esteban Maringolo
Follow up.

Seems that playing with these COM/ADO objects in the playground messes with
the VM; so I'm getting weird image crashes, where the image closes without
any notice.

Do you experience the same?


Esteban A. Maringolo


On Wed, Mar 11, 2020 at 4:11 PM Esteban Maringolo 
wrote:

> I did a small change in ADORecordset to have the fields as an instVar and
> also in ADOFields to have each ADOField in an `items` instVar.
> It is still slow compared to an ODBC API, but I got a 20x speedup
> (~1000ms), that is spent mostly on the actual call to the dispatcher to
> fetch each cell value.
>
> I look forward for an ODBC API, but at least to read any other data
> source, this seems to work pretty well.
>
> I already sent a pull-request.
>
> Esteban A. Maringolo
>
>
> On Wed, Mar 11, 2020 at 3:31 PM Esteban Maringolo 
> wrote:
>
>>
>> The profiling using the recordset was even worst. I changed the iteration
>> [1] to add everything to a collection, but most of the time is spent in
>> #calculateMethods and #calculateProperties. Which is performed everytime
>> for each ADOField.
>>
>> I wouldn't consider this a stress test, but maybe the methods and
>> properties should be cached, or a different class of dispatcher should be
>> used where the methods and properties are defined ahead of time instead of
>> being discovered when first invoked.
>>
>> Regards,
>>
>>
>> [1] "Modified code"
>> rst := ADORecordset createInstance .
>> rst open: 'SELECT * FROM PLAYER' activeConnection: conn cursorType: 2
>> lockType: 3 options: -1.
>> results := OrderedCollection new.
>> [rst eof] whileFalse: [
>>   | row |
>>   row := Array new: rst fields count.
>>   1 to: row size do: [ :idx | row at: idx put: (rst fields item: idx)
>> value ].
>>   results add: row.
>>   rst moveNext
>>  ].
>>
>>
>>
>> Esteban A. Maringolo
>>
>>
>> On Wed, Mar 11, 2020 at 3:02 PM Tomaž Turk 
>> wrote:
>>
>>> Hi Esteban,
>>>
>>> Thanks for reporting this issue. I haven't made any "stress" tests yet
>>> for ADOClient. Could you please try to use ADORecordset as described in the
>>> readme? There you have a direct access to each record at a time, and then
>>> you can create your own "loop" to process the query result. In this way you
>>> can avoid the loop in ADOClient>>query: method.
>>>
>>> Best wishes,
>>> Tomaz
>>>
>>> -- Original Message --
>>> From: "Esteban Maringolo" 
>>> To: "Tomaž Turk" ; "Any question about pharo
>>> is welcome" 
>>> Sent: 11. 03. 2020 18:25:51
>>> Subject: Re: [Pharo-users] Generate class hierarchy from JSON Schema
>>>
>>> As an additional reference, I attach the profile tally  for the query
>>> I'm mentioning.
>>>
>>> The culprit seems to be the calculation of the ADOField properties that
>>> might be calculated on every call.
>>>
>>> Regards,
>>>
>>> Esteban A. Maringolo
>>>
>>>
>>> On Wed, Mar 11, 2020 at 2:13 PM Esteban Maringolo 
>>> wrote:
>>>
>>>> Hi,
>>>>
>>>> To feed a Pharo app I need to read from an old MDB file, via ODBC.
>>>>
>>>> So I tested PharoADO and, after adding a missing Variant Type [1], I
>>>> got my query working (at least read only).
>>>>
>>>> However the time of ADOClient to return a query with 10K rows of 5
>>>> columns each is extremely slow (+65000ms) compared, e.g., with Dolphin
>>>> Smalltalk via ODBC (62ms).
>>>>
>>>> The time of the execute call to return is instantaneous, so I think the
>>>> issue might be in the creation of the result set.
>>>>
>>>> Is this a known issue?
>>>>
>>>> Should I check something else?
>>>>
>>>> Thanks in advance,
>>>>
>>>>
>>>> [1]  https://github.com/tesonep/pharo-com/pull/10
>>>> Esteban A. Maringolo
>>>>
>>>>
>>>> On Fri, Jan 24, 2020 at 5:59 AM Tomaž Turk 
>>>> wrote:
>>>>
>>>>>
>>>>> That would be amazing!
>>>>>
>>>>> I'm a Mac/Unix guy so I don't have access to the other platforms (I
>>>>> suppose I could fire up an AWS Oracle).  I can do mysql/mariadb, 
>>>>> p

Re: [Pharo-users] Any existing RDF implementation in Pharo?

2020-03-16 Thread Esteban Maringolo
Hi Juraj,

There is an RDF project in Cincom's Public Repository for VW.

And there it seems somebody was wanting to migrate it to Pharo since
there is a "RDF fileout Pharo" package whose first version says:

--- Blessed: Work In Progress
--- By: chaider
--- On 25/08/2019 08:20:42
started the RDF transformation for Pharo


Regards,


Esteban A. Maringolo

On Mon, Mar 16, 2020 at 11:03 AM Juraj Kubelka via Pharo-users
 wrote:
>
> Hi all!
>
> I am interested if there is any RDF model 
> (https://en.wikipedia.org/wiki/Resource_Description_Framework) implemented in 
> Pharo (or another Smalltalk)?
>
> Thank you!
> Juraj
>



Re: [Pharo-users] How should XMLHTMLParser handle strange HTML?

2020-04-02 Thread Esteban Maringolo
Hi Peter,


Just in case it helps you parsing the files...

I had to parse HTML with a XMLParser (no XMLHTMLParser) so what I did
was to pass it first through html tidy [1] converting it to xhtml
which is compatible with XML parsers (it is XML, after all).

Regards,

[1] http://www.html-tidy.org/

Esteban A. Maringolo

On Thu, Apr 2, 2020 at 2:17 PM PBKResearch  wrote:
>
> Hello
>
>
>
> I have come across a strange problem in using XMLHTMLParser to parse some 
> HTML files which use strange constructions. The input files have been 
> generated by using MS Outlook to translate incoming messages, stored in .msg 
> files, into HTML. The translated files display normally in Firefox, and the 
> XMLHTMLParser appears to generate a normal parse, but examination of the 
> parse output shows that the structure is distorted, and about half the input 
> text has been put into one string node.
>
>
>
> Hunting around, I am convinced that the trouble lies in the presence in the 
> HTML source of pairs of comment-like tags, with this form:
>
> 
>
> 
>
> since the distorted parse starts at the first occurrence of one of these tags.
>
>
>
> I don’t know whether these are meant to be a structure in some programming 
> language – there is no reference to supportLists anywhere in the source code. 
> When it is displayed in Firefox, use of the ‘Inspect Element’ option shows 
> that the browser has treated them as comments, displaying them with the 
> necessary dashes as e.g. . I edited the source code 
> by inserting the dashes, and XMLHTMLParser parsed everything correctly.
>
>
>
> I have a workaround, therefore; either edit in the dashes to make them into 
> legitimate comments, or equivalently edit out these tags completely. The only 
> question of general interest is whether XMLHTMLParser should be expected to 
> handle these in some other way, rather than produce a distorted parse without 
> comment. The Firefox approach, turning them into comments, seems sensible. It 
> would also be interesting if anyone has any idea what is going on in the 
> source code.
>
>
>
> Thanks for any help
>
>
>
> Peter Kenny



Re: [Pharo-users] [Pharo-dev] Cover for PBE8

2020-04-07 Thread Esteban Maringolo
There is also Pixabay: https://pixabay.com/images/search/lighthouse/

Regards!


Esteban A. Maringolo

On Tue, Apr 7, 2020 at 11:18 AM Torsten Bergmann  wrote:
>
> For free pictures I guess one could use:
>
>https://unsplash.com/about
>https://www.pexels.com
>
> If you check there for "lighthouse" you will find nice ones like:
>  - https://www.pexels.com/photo/gray-and-black-rock-formation-1113552/
>  - 
> https://images.unsplash.com/photo-1556290287-14de2be0657b?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=60
>
> You can even get the "spiral" effect there:
>
>  https://unsplash.com/s/photos/spiral
>  https://www.pexels.com/search/spiral/



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

2020-04-18 Thread Esteban Maringolo
Thanks, I will check it as soon as Pharo.org gets back online!

[1] https://downforeveryoneorjustme.com/pharo.org

Esteban A. Maringolo

On Sat, Apr 18, 2020 at 10:48 AM Christophe Demarey
 wrote:
>
> Hi Graham,
>
>
> Le 18 avr. 2020 à 11:30, Graham McLeod  a écrit :
>
> Hi
>
> This looks like a major update with some very welcome features and improved 
> UI.
> Very welcome and thanks for the work!
>
> One item I would like to see is a mention in the help on implications of 
> upgrading from the existing
> Pharo launcher. Bit nervous to install when I don't know what will become of 
> existing configurations in the old one.
> I am assuming that the new one is independent and will simply start off 
> blank. It would be nice to have this tackled in the
> documentation. Maybe a short section on "Moving your configurations / images 
> from the old Launcher ».
>
>
> Yes, you’re right!
> Pharo Launcher is mostly compatible with the previous one.
> When using Pharo Launcher 2.0, image metadata will be converted from the old 
> format to the new one.
> I added an upgrade section on Pharo Launcher documentation: 
> https://pharo-project.github.io/pharo-launcher/installation/#upgrade-notes
>
> Tell me if this is enough.
> Regards,
> Christophe



Re: [Pharo-users] [ANN] Pharo Compendium

2020-05-03 Thread Esteban Maringolo
Excellent Torsten!

I guess it will not work in Pharo 8 because of the Spec 2 requirement. Right?

Regards!

Esteban A. Maringolo

On Sat, May 2, 2020 at 5:35 PM Torsten Bergmann  wrote:
>
> Hi,
>
> time flows and Pharo-Project is improving on all ends since its inception in 
> 2008. As you know over time for the code project hosting we used
> SqueakSource, SS3 repos and other and later switched to SmalltalkHub 
> available on http://smalltalkhub.com.
> Starting with Iceberg in Pharo 6 many community projects are now hosted 
> elsewhere - most of them moved to GitHub. Pharo's git support allows
> also for GitLab, BitBucket and other git hosting services.
>
> I still think easy and quick accessibility to external (re)sources directly 
> from the image is key - especially for new users who often get lost
> among all the various things that are available. Back in 2013 I therefore 
> provided a small tool called ConfigBrowser as a replacement for
> MetacelloConfigurationBrowser to easily load Metacello configs directly into 
> Pharo.
>
> Later we improved quick loading with a primary tool called "Catalog" written 
> by Esteban. Catalog is indexing every 24 hours all configs within
> specific meta-repositories on SmalltalkHub (per Pharo version) like
>
>   http://www.smalltalkhub.com/#!/~Pharo/MetaRepoForPharo80
>
> to automatically build
>
>http://catalog.pharo.org/
>
> and also a JSON source
>
>http://catalog.pharo.org/catalog/json
>
> The last one feeds the catalog browser and catalog spotter search within the 
> Pharo image.
>
> So Catalog helped us and especially new Pharo users to find what is available 
> as external project or package. Unfortunately some package maintainers
> are too lazy and do not maintain their configs over old and new Pharo 
> versions. Also SmalltalkHub.com is now seen as legacy and will only be 
> available
> in a read only mode or as a browseable archive soon.
>
> So we have to think about others steps beyond Catalog and (triggered by a 
> recent discussion on Discord) I started now a simple tool that helped me
> finding all GitHub projects marked with "pharo" as GitHub topic. I 
> additionally also added previous catalog loading. More sources could be added
> as well as some kind of custom stores/plugins. Maybe this tool could be the 
> base for a future replacement of the catalog tool.
>
> Long story short - let me introduce "Pharo Compendium":
>
> Compendium is a new UI tool to list, browse and load Pharo artefacts from the 
> web like:
>
>  - GitHub Projects
>  - Catalog Projects
>
> and other
>
> By default there are two plugin packages available for GitHub and Catalog - 
> but you can implement own ones easily to connect to other sources
> on the web. Compendium is available on:
>
>https://github.com/astares/Pharo-Compendium
>
> It is implemented using the new Spec2 UI framework - so you need a recent 
> Pharo 9 image to give it a try. Just run:
>
> Metacello new
> repository: 'github://astares/Pharo-Compendium/src';
> baseline: 'Compendium';
> load
>
> to load the tool. Then go to "Tools" -> "Compendium Browser". Attached is a 
> screenshot demoing the primary functionality.
>
> If you want your GitHub project to be listed in the tool you simply need to 
> add the topic "pharo" to the GitHub repository on the GitHub webpage.
>
> Feel free to comment or help improving the tool by sending PR's.
>
> Thx
> T. (aka astares)
>
>



[Pharo-users] Preserving Pharo Window state between sessions

2020-05-05 Thread Esteban Maringolo
Is there a way to preserve the window state after saving the image on
quit and restarting it again?

If I save my image window maximized I would like it to be maximized
when starting again.

Having it otherwise can be annoying when moving from different screen
resolutions, because a 1920x1080 maximized window becomes a "floating"
(non-maximized) window that size on a smaller screen.

I guess this is controlled by the VM and not the image, but there is a
way to maximize the window from the image? This way it could be a
preference of some sort.

Regards,

Esteban A. Maringolo



Re: [Pharo-users] [ANN] What are good reasons to use Smalltalk?

2020-05-15 Thread Esteban Maringolo
I don't know what is behind the poll system, but it doesn't work in
Brave browser. It simply says "Thanks for participating in the poll."

I find the questions confusing though.

Esteban A. Maringolo

On Wed, May 13, 2020 at 4:43 PM Richard Kenneth Eng
 wrote:
>
> https://smalltalk.tech.blog/2020/05/13/what-are-good-reasons-to-use-smalltalk/
>
> Please participate in the poll.



Re: [Pharo-users] [ANN] What are good reasons to use Smalltalk?

2020-05-21 Thread Esteban Maringolo
On Thu, May 21, 2020 at 10:37 AM Vitor Medina Cruz  wrote:
>
> Richard
>
> "The browsers are *way* more compatible than Smalltalk systems are."
>
> How so?

You can have a webpage, or even a web application (JS) and it will run
exactly the same on all major, modern, web-browsers (Chromium, Safari
and Firefox).

Regards,

Esteban A. Maringolo



Re: [Pharo-users] [ANN] What are good reasons to use Smalltalk?

2020-05-21 Thread Esteban Maringolo
On Thu, May 21, 2020 at 11:34 AM Vitor Medina Cruz  wrote:
> Sorry, I mean how so are Smalltalk systems less compatible than web browsers 
> are?

Different dialects have different features (e.g. Namespaces, Traits),
syntax, image format...

Smalltalk is a concept, with Smalltalk-80 as the canonical reference,
not even a specification, because ANSI Smalltalk was the closest thing
to a standard (Like ECMA TS39 is for JavaScript), but it was DoA.

> This means between different distributions of Smalltalk (VA, Squeak, 
> Pharo...)? Same code are not as compatible between different Smalltalks 
> distribution as a web application is between different browsers? How so? Why?

Because of history for the most part.
Smalltalk comes from a pre-opensource era, where commercial vendors
were the norm, and competition was not collaborative as it might be
now.

Each one took its own path and merging everything back is non-viable,
both for technical and commercial reasons.

When/if smalltalk grows to a web scale, then the need for standards
and constraint will arise.

Regards!

Esteban A. Maringolo



Re: [Pharo-users] Willow-Seaside serving static files

2020-06-14 Thread Esteban Maringolo
The handler at /files (WAFileManager?), is set to explicitly forbid listing
of files.

El dom., 14 de junio de 2020 07:33, Tomaž Turk 
escribió:

> Hi, I added an image to a subclass of WAFileLibrary to serve it as a
> static file from within Pharo. Everything seems fine, except that the
> /files URL is not accessible:
>
> Error: you are forbidden to access "/files".
>
> and source view displays
>
> /files/EMStaticFiles/window.png not found
>
> if I click on image's URL.
>
> I loaded Seaside as a Willow's dependency.
>
> Best wishes,
> Tomaz
>
>
>
>
>


Re: [Pharo-users] [Pharo-dev] [ANN] PharoPro

2020-06-17 Thread Esteban Maringolo
Hi Norbert,

Congratulations for the initiative! I look forward to your success.

Best regards!


Esteban A. Maringolo

On Wed, Jun 17, 2020 at 5:35 AM Norbert Hartl  wrote:
>
> Dear community,
>
> we are very proud to announce the availability of PharoPro, a company that 
> offers professional support for the pharo platform. Our mission is to enable 
> people and companies to secure their business when building products with 
> pharo.
>
> We have been tinkering with the idea creating it for a long time. We talked 
> to a lot of people, especially at last ESUG in cologne and finally decided to 
> do it. So at the end of last year we founded the company PharoPro. Obstacles 
> (one being covid-19) kept us from make it public until today.
>
> In close relationship with the pharo consortium our mission is to extend the 
> market opportunities for pharo.
> Although PharoPro is new and still small we want to show our commitment to 
> the consortium and the community from the start. We decided therefor that 
> PharoPro will join the pharo consortium as platinum member.
>
> Our plans apart from support contracts is to have an LTS (long term support) 
> version of pharo, create a professional pharo ecosystem with libraries and 
> frameworks and to help out building the infrastructure pharo needs.
>
> We are still shaping up. We want to know your requirements and needs that 
> help us deciding what are the most needed things. So you might visit
>
> http://pharo-pro.com
>
> and then come talk to us.
>
> Best regards and health,
>
> Norbert
> PharoPro GmbH



Re: [Pharo-users] a simple question (I think)

2020-06-17 Thread Esteban Maringolo
Objects interact with each other by sending messages, although you can
get the sender by using reflection (thisContext sender), it is not a
common practice to do so.
So if you need another object to know the sender (or any other object)
you simply pass it as a parameter.

So modifying your example, and making the syntax actually work it would be:

self property: ObjectClass new.
self property caller: self.

and then when you need to deal with that you can simply get a
reference to that object and send it a message to do something:
self property caller doSomething.

You can also have something like

self property: (ObjectClass for: self)


In that case the #for: message is received by "ObjectClass class",
which you can think of as if it were a Factory or a "static" method
(it is not! it is much more powerful than that).

ObjectClass class>>#for: callerObject
  ^self new
 setCaller: callerObject;
 yourself

And that's it, you have an instance of ObjectClass that you
initialized by sending #for: instead of #new (internally it ended up
calling #new, but from the outside it was just a message send).

And for the most part that's Smalltalk: Objects and messages.

Regards!

Esteban A. Maringolo

On Wed, Jun 17, 2020 at 6:19 PM Russ Whaley  wrote:
>
> I find myself, over and over, creating a & storing q new object in an 
> instVar, then storing (my)self on that object - so I can have easy access to 
> the 'object that created me.'
>
> 
>
> self instVar := NewClass new.
>
> self instVar callingObject: self.
>
> "where these call the same messages"
>
> self myMessage.
>
> self instVar callingObject myMessage.
>
> 
>
> self instVar := NewClass new.
>
> self instVar objectWhoCreatedMe myMessage.
>
> "I know there is a 'thisContext sender' - but is there a 'who created me' 
> concept?"
>
>
> Ultimately, there is no real overhead to storing (my)self on a new object, I 
> guess, but as I'm developing and testing, I tend to have a whole lot of 
> 'stranded objects' I have to remove manually.
>
> Thoughts?
>
> Thanks!
> --
> Russ Whaley
> whaley.r...@gmail.com



Re: [Pharo-users] [ANN] What are reasons NOT to use Smalltalk?

2020-06-19 Thread Esteban Maringolo
In my case it didn't let me vote at all, it assumed I already voted.

I started a private tab, disabled tracking (it tracks a lot for a
single post), and then saw the options, and there wasn't a "none of
the above/other" kind of option.
So I didn't vote.

Esteban A. Maringolo

On Fri, Jun 19, 2020 at 2:02 PM Richard Sargent
 wrote:
>
> It wouldn't let me vote without choosing an answer, none of which were my 
> answer.
>
> On Fri, Jun 19, 2020 at 9:32 AM Richard Kenneth Eng 
>  wrote:
>>
>> https://smalltalk.tech.blog/2020/06/19/what-are-reasons-not-to-use-smalltalk/
>>
>> Thanks for participating in the poll.



Re: [Pharo-users] STON question

2020-07-01 Thread Esteban Maringolo
Thank you Sven! This is really convenient.

SortFunctions are really cool.

Esteban A. Maringolo

On Tue, Jun 30, 2020 at 6:06 PM Sven Van Caekenberghe  wrote:
>
> Hi Stef,
>
> With the following commit 
> https://github.com/svenvc/ston/commit/3565d388172b76c180454575d4c2f71019f130c4
>
> there is now basic support for SortCollections using SortFunctions.
>
> All of the following can now be serialised and materialised by STON (see 
> #testSortedCollections):
>
> SortedCollection new.
> SortedCollection new: 0.
>
> #(5 3 7 2 1 4 10 9 8 6) asSortedCollection.
>
> #(5 3 7 2 1 4 10 9 8 6) asSortedCollection: #yourself ascending.
> #(5 3 7 2 1 4 10 9 8 6) asSortedCollection: #yourself descending.
>
> #('' '*' '*' '**' '***') asSortedCollection: #size ascending.
> #('' '*' '*' '**' '***') asSortedCollection: #size descending.
>
> #(5 3 7 2 1 4 10 nil 9 8 6) asSortedCollection: #yourself ascending 
> undefinedFirst.
> #(5 3 7 2 1 4 10 nil 9 8 6) asSortedCollection: #yourself ascending reversed 
> undefinedLast.
>
> I think this trick covers a large set of SortedCollection use cases avoiding 
> blocks by using SortFunctions.
>
> This technique could also be used to replace other block usages elsewhere.
>
> To answer your original question: yes we could add this to the documentation 
> (although right now it is very new and unproven).
>
> Regards,
>
> Sven
>
> > On 28 Jun 2020, at 12:25, Stéphane Ducasse  
> > wrote:
> >
> >
> >
> >> On 27 Jun 2020, at 16:58, Sven Van Caekenberghe  wrote:
> >>
> >> Hi Russ,
> >>
> >> The limitation of STON not being capable of serialising a block closure 
> >> still stands and will probably not change very soon (it open up the whole 
> >> language to be written out).
> >>
> >> You can work around this though, with sort functions for example.
> >>
> >> Here is an example:
> >>
> >> { 1->#one. 3->#three. 2->#two } sorted: (STON fromString: (STON 
> >> toStringPretty: #key ascending)).
> >>
> >> SortFunctions are really cool BTW (they can handles nil values elegantly).
> >>
> >> Sven
> >
> > Sven do you think that we should have a little section on this question in 
> > STON chapter.
> >
> > S
>
>



Re: [Pharo-users] STON question

2020-07-02 Thread Esteban Maringolo
On Thu, Jul 2, 2020 at 11:46 AM Sean P. DeNigris  wrote:
>
> Sven Van Caekenberghe-2 wrote
> > there is now basic support for SortCollections using SortFunctions.
>
> Cool! This would be great to have in Fuel as well. There is a slow and
> steady stream of users running into trouble trying to serialize blocks
> (whatever the library) due primarily to sorted collections.

Wouldn't that work out of the box with Fuel?

A SortFunction is a simple object, and even a ChainedSortFunction is
the same. So if you have:

#(4 2 2 1) asSortedCollection: #yourself ascending

You end up with a SortedCollection without any blocks, because its
sortBlock is actually a SortFunction.

Regards!

Esteban A. Maringolo



Re: [Pharo-users] Class side vs instance side (variables and methods)

2020-07-28 Thread Esteban Maringolo
Hi,

The "class vs instance" side is one of the most confusing things for
newcomers, I remember struggling with it when I learnt Smalltalk (and
also was a novice in OOP).

It helps you thinking it this way: the instance side is everything
that will affect all instances of such class, and you can think the
"class side" as what affect the factory for these instances (the sole
instance of the class).

E.g. let's say you have a "Dog".
Dog instances will have a #bark method, and maybe a "color" property
(via an instance variable).

So when you do:
dog1 := Dog new.
dog1 color: Color white.
dog2 := Dog new.
dog2 color: Color black.

You have two instances of Dog, and each one with its own color. Both
understand the #bark message.

But the Dog (capitalized) there, references the Dog class itself (aka
"the class side" of Dog) and #new is a method of the "class side" of
Dog.

So if you implement a #newWhite method in the "class side" of Dog, it
would be something like this.
Dog class>>newWhite
  "Returns a new white instance of receiver."
  ^self new color: Color white

In this method the "self new" refers to the class itself, not to the
"instance" of the dog, but the returned object of "new" is an
instance, and there the #color: message is sent to the instance of
Dog.

I hope this explanation helps, the meta relations involved in this are
more complex than what I explained, but I hope this helps you get
started.

Regards!

Esteban A. Maringolo

On Tue, Jul 28, 2020 at 8:35 PM G B via Pharo-users
 wrote:
>
> Being new not only to Smalltalk, but OOP in general, I think I finally am 
> understanding things. One area I am still unsure about is the class side 
> versus the instance side. Does one usually use the class side when they want 
> those inherited in every subclass, which frees one from having to declare 
> them in every instance?
>
> TIA for reading my silly questions.



[Pharo-users] Extract-method refactoring erratic behavior in Pharo 8

2020-07-31 Thread Esteban Maringolo
Hi,

I get, more often than not, a message indicating an "invalid source to
extract", commonly with the "End of statement list encountered"
explanation.

In comparison, I can extract the same code in Pharo 4. Is there a
reason why the "Extract method" refactoring is not working in Pharo 8
as it was in that or any other version?

Thanks!

Esteban A. Maringolo



[Pharo-users] SmalltalkHub is offline

2020-08-01 Thread Esteban Maringolo
Hi people,

SmalltalkHub has been down for a while.
https://downforeveryoneorjustme.com/smalltalkhub.com

I don't know if there was a planned downtime or something crashed.

Thanks!

Esteban A. Maringolo



  1   2   3   >