Re: [Pharo-users] is it related to Freetype or Athens?

2017-06-07 Thread Peter Uhnak
On Tue, Jun 06, 2017 at 07:33:04PM +0200, Hilaire wrote:
> Hi there,
> 
> A Dr. Geo user on Ubuntu 64bits 16.04 got that buggy rendering of the
> canvas, then on some situation the rendering completely stop on a red
> screen, with a stack showing may be a zero divide error. I did not get
> access to the PharoDebog yet.
> 
> Fonts on the screenshot is not right too. Could it be a mixed problem
> between FreeType and Cairo? Any first though on the issue welcome.

There were couple GC/memory related issues in the VM's plugin, that were fixed 
or worked around in the Pharo 6 VM that apparently were present for a long 
time... so maybe that's also part of what you've experienced...



Re: [Pharo-users] Wiring objects, IoC and Service Locator

2017-06-07 Thread Peter Uhnak
> I don't see what is special about this.  You can easily arrange instance
> creation order with methods on the class-side of your domain classes.

I will not use the term "class", but rather a "service" (service can be just a 
single class, but that is not always the case). The point of inversion of 
control is provide the class with what is needed instead of the class creating 
it on it's own.
Sure, you can create class-side helper, however that is very limited, such as 
the examples/samples as you've demonstrated.

To give you an example, imagine that you have a class PeopleService that 
manages database of people, so it needs a connection to the database. 
Implemented in a naive way the class would have hard-coded credentials to a 
MySQL database and it would execute raw SQL queries. This works for a single 
class, but it creates a mess and mingles concerns; so instead you inverse the 
control and you provide PeopleService with e.g. a Persistence instance, which 
is already connected to the database; note however that you cannot just create 
the Persistence on the class-side, because you wouldn't even know what to 
instantiate (as you could e.g. use DbPersistence, FilePersistence, ...). And 
this is just a basic example. Imagine that the PeopleService also needs other 
services for it's use, and those services need more services, and you want to 
keep everything separated as much as possible... instantiation by hand will 
simply not cut it So the service locator/DI configuration (whether as 
annotations or in a XML file) keeps the actual classes separated from concrete 
instances; the service depends on abstract interfaces, not specific classes; 
only the conf determines the specific ones, and more often than not there will 
be several different configurations _at the same time_. To continue with the 
example you could have one config production using e.g. OraclePersistence, 
another for development using MySQLPersistance, another for test server using 
MemoryPersistence, etc. (also with different credentials, and whatnot).

Keep in mind however that relates primarily to using application frameworks, 
where the framework mandates the control, and the framework is the one calling 
you, and therefore it will also provide you with necessary parts. After all you 
are not even creating PeopleService class, the framework instantiates it for 
you and gives it to another services/classes that needed it.

Now I don't feel like there are many application frameworks in Pharo, maybe 
Seaside has something of this sorts? I guess Spec can be a bit framework-y, as 
the basic spec widgets do not actually know what Morphic counterparts will be 
created for them, and Spec looks up the actual class in a hard-coded data table 
(which might as well be a XML file), but that comes closer to ServiceLocator 
than DI (as Spec widgets should not actually communicate down to morphic).

I've used dependency injection for five years at my previous work and frankly I 
cannot imagine living without it there, but I've never felt the need for it in 
Pharo. This is probably more related to working in Pharo on completely 
different things and writing small libraries. However I wouldn't be surprised 
if the liveness of Smalltalk/Pharo environment eliminated some of the problems 
that DI is trying to solve. But then again, there are many ways to build 
systems, and not all need or benefit DI/IoC.

Peter

> Indeed, the GTTools are set up to work with in-Image sample data.  Look at
> implementors of #sample and #example.
> There was quite some bike-shedding over the naming convention (and I forget
> the final result), but hopefully it provide the general idea...
> 
> http://forum.world.st/a-request-to-change-the-meaning-of-lt-example-gt-pragma-td4927360.html
> http://forum.world.st/lt-example-gt-lt-examplar-gt-td4911728i20.html
> http://forum.world.st/Existing-lt-script-gt-lt-example-gt-pragmas-and-new-GT-needs-td4814903i20.html
> 
> 
> 
> >
> > I started, however, to question DI as a valid mechanisms because of it's
> > complexities and other problems. The article from Fowler provides the
> > service locator as an alternative which seems to me much simpler and
> > completely fine solution for the problem.
> >
> 
> If it seems suitable, then to quote Nike, just do it ;)
> 
> 
> 
> > So, to answer you question "Is it any more complicated than that?": In
> > the DI approach, yes it can be, but I don't think so in the service locator
> > approach.
> >
> > I am asking here because I wanted to know how people from Smalltalk deal
> > with this problem. As it seems there is no standard approach, nor this is
> > perceived as a problem...
> >
> 
> 
> DI or Service Locator are both "implementations" of your need.  Can we take
> step backward to see what is your need?  To kick off, I hazard a guess at
> some possible needs...
> 
> 1.  To switch between configurations to use production data and test data ?
> 2.  To make this switch during CI testing and

Re: [Pharo-users] About patterns, UML and documentation

2017-06-08 Thread Peter Uhnak
> > with the tool and layout and stuff rather than concentrate on what is

Well there are tools such as PlantUML that generate it for you, you can provide 
some hints, but generally it tends to be good enough to not be worried about 
layout.

I have a Pharo -> PlantUML generator for class, object, and sequence diagrams 
somewhere, as I've used it to gain insight about some subsystems on several 
occasions, but I never published it... it's a bit of hacky code around Pharo's 
metaprogramming and reflecting capabilities... so you could in principle write 
it by hand in an hour or so... in fact doing so by hand might be beneficial for 
specific problem, because you can reverse-engineer only the parts that you care 
about instead of having everything or having a complex generator 
parametrization...


> > Take Sven's NeoCSV package as an example. Great documentation and very
> > good method names. and a complete set of tests.
> >
> > Sounds frightening at first if you come from a static typing background,
> > but in my experience it works quite well.

I don't think that this is a good example. From user perspective you usually 
interact with only two classes (reader and writer)... and I don't really see 
how UML could help you there. The internal architecture on the other hand, or 
tools with models could benefit from it much more (at least in class diagrams, 
the relationships between elements tends to be the most important part, so if 
you have one or two classes... then you won't have much connections...).

Peter

On Thu, Jun 08, 2017 at 08:40:34AM +0200, Marc Hanisch via Pharo-users wrote:
> Date: Thu, 8 Jun 2017 08:40:34 +0200
> From: Marc Hanisch 
> To: Any question about pharo is welcome 
> Subject: Re: [Pharo-users] About patterns, UML and documentation
> 
> Thanks Todd and Joachim for your fast responses,
> 
> your examples are very interesting! I think I got the point! ...And you are
> so true about your experience with UML and the struggle to group / align
> all graphical objects so it is still understandable ;-)
> 
> Best regards,
> Marc
> 
> 2017-06-08 7:53 GMT+02:00 jtuc...@objektfabrik.de :
> 
> > I think the key to this is intention revealing names and comments. And
> > shipping unit tests that are the best example of "running documentation".
> >
> > Take Sven's NeoCSV package as an example. Great documentation and very
> > good method names. and a complete set of tests.
> >
> > Sounds frightening at first if you come from a static typing background,
> > but in my experience it works quite well.
> >
> > There are UML tools. Some even allow round-trips where the UML diagrams
> > can be generated from code (e.g. IBM/Instantiations have the UML Designer
> > add-on), but to be honest, these only put you in high danger of playing
> > with the tool and layout and stuff rather than concentrate on what is
> > important. UML is fine for communicating the raw structure and basic ideas.
> > Generating UML from code on the fly can help understand code, but I've seen
> > too many projects that made the UML design documents an art of itself, and
> > most of the times the diagrams were out of sync anyways...
> >
> > Just my 2 cents,
> >
> > Joachim
> >
> >
> > --
> > ---
> > 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] Wiring objects, IoC and Service Locator

2017-06-08 Thread Peter Uhnak
On Thu, Jun 08, 2017 at 08:46:15AM -0300, Vitor Medina Cruz wrote:

> This is true for IoC DI containers, but I don't think it applies for
> service locator, which, I think, could not be considered a framework
> approach. Actually, I think being a framework is the big problem of the of
> the former, since when I start to use an IoC container to create objects I
> got tied to it in a very basic and pervasive operation of an OO system:
> object creation.

Well that is the objective of DI to handle the object creation on your behalf. 
Of course no class is prohibited from creating instances directly, provided it 
had the necessary dependencies to give to the instance.

> Suddenly everything must be created through the DI container, but that is not 
> true for Service Locator.

As I've noted above, DI doesn't restrict you from creating instances. Service 
Locator gives you a more flexible approach, however it follows that it can be 
also harder to manage, as the services registered in the locator can (and 
typically do) change at runtime, which inhibits static reasoning about the 
dependencies, compared to a pre-fixed configuration.

> 
> However I wouldn't be surprised if the liveness of Smalltalk/Pharo
> > environment eliminated some of the problems that DI is trying to solve.
> 
> 
> That is precisely what I wanted to know. It seems there are no DI
> counterpart in the Pharo/Smalltalk environment, ok, so what people do to to
> deal with the above mentioned problem? Hand wiring is suffice? Is there
> anything in the liveness of Smalltalk/Pharo that eliminates the need for
> it? People use simple Service Locator, or variations of it?

In my previous mail I've mentioned Spec doing something of the sorts, but I 
don't think I've seen it anywhere else. The hand-wiring mostly suffices; 
sometimes you can see having a method containing the name of the class it will 
instantiate (and which can be altered in a subclass). My best guess would be 
that the capabilities of Pharo, such as pluggable closures, and being a live 
already-running system are more likely to push the programmer towards a 
different architecture, where incidentally DI's are not such a concern, but I 
would certainly love to see some deep analysis on this.


Peter

> 
> 
> cheers!
> Vitor
> 
> On Wed, Jun 7, 2017 at 9:32 PM, Ben Coman  wrote:
> 
> >
> >
> > On Tue, Jun 6, 2017 at 11:48 PM, Attila Magyar 
> > wrote:
> >
> >> I don't think using a DI container worth the effort. They add lots of
> >> complexities and solve very little. For some reason DI containers became
> >> very popular in the Java world, but if you take a look at other
> >> programming
> >> communities you'll realize that many people are perfectly happy without
> >> using these containers. Using DI and using a DI container is orthogonal.
> >> As
> >> you also said you can just pass dependencies to objects to achieve loose
> >> coupling. Yes, you have to do this manually but what's the big deal? We're
> >> talking about code with cyclomatic complexity of 1. Calling a constructor
> >> is
> >> not a problem that need to be solved. Using an external XML configuration
> >> to
> >> describe object wiring is the worst idea ever.
> >>
> >> Here is an article about using plain old object composition to do DI
> >>
> >> http://blog.davidpeterson.co.uk/2011/01/object-oriented-example.html
> >>
> >> Some more thoughts about the problems associated with DI containers:
> >>
> >> http://www.natpryce.com/articles/000783.html
> >
> >
> > I liked this...  "the [Dependency Injection] pattern also used to be
> > called "third-party binding" or "third-party connect": some third party is
> > responsible for connecting an object satisfying the service requirements of
> > a component"
> > This makes the subject seem less esoteric.  It reminds me of hearing that
> > the first (secret) task when doing a PhD is to invent new terms for common
> > ones, and base your writings on that. Perhaps its the same for consultants
> > and framework developers. ;P   Or maybe everything seems esoteric until you
> > have experience with it and I've not done much with Java, certainly not big
> > applications.
> >
> > Thx Peter for your example and how you prior experience compares to Pharo.
> >
> > cheers -ben
> >
> >
> >> http://higherorderlogic.com/2011/07/is-dependency-injection-like-facebook
> >>
> >>
> >>
> >> --
> >> View this message in context: http://forum.world.st/Wiring-o
> >> bjects-IoC-and-Service-Locator-tp4949280p4949720.html
> >> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
> >>
> >>
> >



Re: [Pharo-users] Wiring objects, IoC and Service Locator

2017-06-08 Thread Peter Uhnak
On Thu, Jun 08, 2017 at 08:02:04AM -0700, Attila Magyar wrote:
> Vitor Medina Cruz wrote
> > This is exactly my concern! Sure, for small stuff that is not a problem,
> > but what if you have a big app?
> 
> I don't think it makes any difference.

Scale can make all the difference. Imagine the complexity of connecting N 
elements. If you have just tree objects/classes/systems... you need just two 
connections, but you if double the number of elements, you need more than seven 
times more connections (to form a complete graph). Of course in practice that 
number will be smaller, but certainly more than linear to the number of 
elements. So what works in small scale doesn't necessarily translate to bigger 
scale, not to mention that brand new concerns are probably going to arise... 
just like when you are constructing a taller building, you cannot just slap it 
twice on each other, because the foundations will collapse, and when you want 
to build a space elevator, you need technology that hasn't been invented yet.




Re: [Pharo-users] Saving to local git and "Loading all file names from http://...pharo5/inbox"

2017-06-19 Thread Peter Uhnak
Hi,

there was an issue with presumably gitfiletree, that when checking a code 
against its repo (to commit or show changes), every single repository would be 
refreshed, which took quite a while (on the order of seconds to tens of 
seconds, but it was quite annoying as it happened frequently).. so as I don't 
need the repos unless I am fixing the bug, I removed them...

I don't use it in Pharo 6 as I haven't experienced the issue there, but I am 
using Iceberg now, so maybe that is the reason.

Peter


On Sat, Jun 17, 2017 at 03:19:41AM -0700, webwarrior wrote:
> Well, that is the question to the author of original script - Peter Uhnak.
> 
> The goal is to avoid contacting server (takes alot of time and blocks the
> image) every time you save a package to a filetree repo. As I understand
> repositories in question are kind of special and are always checked, so
> removing them solves the problem.
> 
> I just modified it to work on Pharo6. 
> 
> 
> 
> --
> View this message in context: 
> http://forum.world.st/Saving-to-local-git-and-Loading-all-file-names-from-http-pharo5-inbox-tp4897962p4951723.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
> 



Re: [Pharo-users] 2 questions around gitlab, gitfiletree, BaselineOf

2017-07-07 Thread Peter Uhnak
Hi,

I had similar issues when using gitfiletree... and in the end I've ended up 
with this 
https://github.com/peteruhnak/pharo-scripts/blob/master/config/5.0/openponk-autoload.st

it is not the prettiest thing, however it is automated so I didn't bother 
improving it.


* automatically loads GitFileTree (I also load my own shell, because OSProcess 
was failing on me hard)
* "pre-loads" some dependencies so they point to my local git repositories 
instead of being pulled from github
* if BaselineOf is available in the image, then MC loader will use that 
(instead of grabbing code from bitbucket/gitlab/github)
* #onWarningLog is there to suppress warning about loading from 
different source (local instead of github), but avialble in transcript iirc
* startup script, so I could name the image certain way and it will prepare it 
for me
* (obviously one can use it separately)
* used on windows and linux (that's why the platform checking)

Peter


On Fri, Jul 07, 2017 at 06:48:50AM -0700, Sabine Manaa wrote:
> Hi,
> 
> we have our own gitlab running now and I succeeded to move our code from
> sthub to it.
> I can push my new code into it from Pharo. All fine.
> I also created a Baseline (based on my former configurationOf).
> Loading the code from others (e.g. seaside) with this baseline is also fine.
> 
> There are 2 Points where I am sure it could be better (it is worse)
> 1) For loading my own code, I currently have a bad solution 
> It is in the postLoadBaseline and does this:
> 
>   | gitRepository |
>   gitRepository := MCFileTreeRepository new
>   directory:
> '/Applications/Pharo5.0-7.app/Contents/Resources/spf-gitlab/repository'
> asFileReference.
>   {'RKA24-Model' . 'RKA24-System' . 'RKA24-Translator' . 'RKA24-View' .
> 'RKA24-Test' . 'RKA24-Report' . 'RKA24-Overwrites'}
>   do: [ :each | 
>   Gofer it
>   repository: gitRepository;
>   package: each;
>   load ].
>   
> I would like to load it within my baseline like this below but I dont know
> what to write in the fileTreeRepository method...
>   
> baseline: spec
>   
>   spec
>   for: #common
>   do: [ spec blessing: #baseline.
>   spec repository: ##self fileTreeRepository##.
>   "here I load all the the oher stuff"
>   spec
>   package: 'RKA24-Model';
>   package: 'RKA24-System';
>   package: 'RKA24-Translator';
>   package: 'RKA24-View';
>   package: 'RKA24-Test';
>   package: 'RKA24-Report';
>   package: 'RKA24-Overwrites' ] 
> 
> 2) Also, when I take a new Image, I have to do several steps 
> 
> load gitfiletree from catalog
> add/open my gitfiletree repository from Monticello
> load BaselineOfRKA24 manually with 
> (BaselineOfRKA24   project map at: 'baseline') load
> 
> I think this is not the best way, I would like to make it right.
> 
> Can anyone give me some hints how to improve this two steps?
> I use Pharo 5 and I don't want to go to Pharo 6 right now.
> I develop on mac and production server is on windows.
> 
> Regards
> Sabine
>  
> 
> 
> 
> 
> --
> View this message in context: 
> http://forum.world.st/2-questions-around-gitlab-gitfiletree-BaselineOf-tp4953877.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
> 



[Pharo-users] integrating FileDialog into Pharo 7

2017-07-10 Thread Peter Uhnak
Hi,

some people expressed interest in integrating File Dialog 
https://github.com/peteruhnak/file-dialog into Pharo as the default file dialog.

Is it something people are interested in, or is the current solution sufficient 
for them?

Peter



Re: [Pharo-users] [Pharo-dev] integrating FileDialog into Pharo 7

2017-07-10 Thread Peter Uhnak
Done. What next?

Peter


On Mon, Jul 10, 2017 at 12:46:50PM +0200, Pavel Krivanek wrote:
> We should work on integration of it. Firstly please move tests to a
> separate package.
> 
> Cheers,
> -- Pavel
> 
> 2017-07-10 12:34 GMT+02:00 Peter Uhnak :
> 
> > Hi,
> >
> > some people expressed interest in integrating File Dialog
> > https://github.com/peteruhnak/file-dialog into Pharo as the default file
> > dialog.
> >
> > Is it something people are interested in, or is the current solution
> > sufficient for them?
> >
> > Peter
> >
> >



Re: [Pharo-users] Mysterious problem in loading Pharo

2017-07-16 Thread Peter Uhnak
I had this problem for several months (and still do), and so far I didn't 
manage to figure out what is the actual cause.

Sometimes it fixes itself (close Pharo and open again), sometimes opening it 
with different VM (and then reopen with the original) helps, and sometimes I 
have to restart system.

After I disabled Windows Fast Boot it is somewhat more infrequent (or rather it 
fixes itself without the need to restart).

But otherwise I might as well wave a magical wand. It is annoying but still 
better than then spending countless hours digging randomly and aimlessly in the 
VM ¯\_(ツ)_/¯.

Peter


On Sat, Jul 15, 2017 at 10:38:51PM +0800, Ben Coman wrote:
> Maybe revew recent Windows 10 updates...
> http://www.sysprobs.com/how-to-view-installed-updates-on-windows-10-8-1-server-2012
> 
> cheers -ben
> 
> On Sat, Jul 15, 2017 at 6:26 PM, PBKResearch 
> wrote:
> 
> > Hello
> >
> >
> >
> > I have a problem in loading Pharo images which, until yesterday, loaded
> > without difficulty. All the images showing the problem are Pharo 6 with the
> > Cog VM; older images do not seem to be affected.
> >
> >
> >
> > The first sign of a problem is that, as soon as I start the image, the
> > debug console appears, with several repeats of the message:
> >
> > LoadLibrary(FT2Plugin.dll) (998: Invalid access to memory location.)
> >
> > The other strange thing is that the appearance of some opened windows has
> > changed. Most obviously, the three icons at the top left (close, minimise,
> > expand) are very close together. Also, I think the print size has got a bit
> > smaller, though this is not obvious.
> >
> >
> >
> > I have recently reinstalled some components of Pharo and Moose, trying to
> > solve my problems with PunQLite, so I wondered if I had fouled something
> > up. To check, I made a completely new install of Pharo 6 (#60508) from the
> > Pharo download page in a separate folder. When I start the image, both the
> > strange things above are present, plus a debug window with the message;
> > ‘FT2 Error: Freetype2 primitive failed’.
> >
> >
> >
> > So it looks as though something has happened to my system which means that
> > any Pharo 6 image will show these oddities. The images I have tried seem
> > able to run some of my functions correctly, so it’s all to do with
> > appearance.
> >
> >
> >
> > I am running on Windows 10 with all recent updates. There was a major
> > update of Windows late yesterday, so it may be that the problems appeared
> > then. Does anyone have any suggestions?
> >
> >
> >
> > Many thanks
> >
> >
> >
> > Peter Kenny
> >



Re: [Pharo-users] Mysterious problem in loading Pharo

2017-07-17 Thread Peter Uhnak
With fast boot I had experiences where the restart wasn't enough and I had to 
restart several times, but since I disabled fast boot restarting once was 
always enough... so usually the first thing I do when windows boots is to check 
if Pharo runs ok.

In some rare unclear circmustances (now I wonder whether it happened after 
sleep) it broke after some time... but that happened only two or three times in 
past ~6 months.

Also dual-booting increases the probability it seems... there were some 
correlated issues regarding time and network card, but nothing conclusive.

Peter


On Mon, Jul 17, 2017 at 12:01:55AM +0100, PBKResearch wrote:
> Peter
> 
> I think the implication of your second para is that your last resort, 
> re-booting the system, is always effective in fixing the problem. If so, 
> while it is obviously a nuisance I think I can live with that. I think I have 
> had this only once before - at least, I have seen the debug console in some 
> context. But yesterday it happened simultaneously on two separate machines. 
> So it all depends on how frequently it happens.
> 
> Peter Kenny
> 
> -Original Message-
> From: Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] On Behalf Of 
> Peter Uhnak
> Sent: 16 July 2017 15:40
> To: Any question about pharo is welcome 
> Subject: Re: [Pharo-users] Mysterious problem in loading Pharo
> 
> I had this problem for several months (and still do), and so far I didn't 
> manage to figure out what is the actual cause.
> 
> Sometimes it fixes itself (close Pharo and open again), sometimes opening it 
> with different VM (and then reopen with the original) helps, and sometimes I 
> have to restart system.
> 
> After I disabled Windows Fast Boot it is somewhat more infrequent (or rather 
> it fixes itself without the need to restart).
> 
> But otherwise I might as well wave a magical wand. It is annoying but still 
> better than then spending countless hours digging randomly and aimlessly in 
> the VM ¯\_(ツ)_/¯.
> 
> Peter
> 
> 
> On Sat, Jul 15, 2017 at 10:38:51PM +0800, Ben Coman wrote:
> > Maybe revew recent Windows 10 updates...
> > http://www.sysprobs.com/how-to-view-installed-updates-on-windows-10-8-
> > 1-server-2012
> > 
> > cheers -ben
> > 
> > On Sat, Jul 15, 2017 at 6:26 PM, PBKResearch 
> > wrote:
> > 
> > > Hello
> > >
> > >
> > >
> > > I have a problem in loading Pharo images which, until yesterday, 
> > > loaded without difficulty. All the images showing the problem are 
> > > Pharo 6 with the Cog VM; older images do not seem to be affected.
> > >
> > >
> > >
> > > The first sign of a problem is that, as soon as I start the image, 
> > > the debug console appears, with several repeats of the message:
> > >
> > > LoadLibrary(FT2Plugin.dll) (998: Invalid access to memory location.)
> > >
> > > The other strange thing is that the appearance of some opened 
> > > windows has changed. Most obviously, the three icons at the top left 
> > > (close, minimise,
> > > expand) are very close together. Also, I think the print size has 
> > > got a bit smaller, though this is not obvious.
> > >
> > >
> > >
> > > I have recently reinstalled some components of Pharo and Moose, 
> > > trying to solve my problems with PunQLite, so I wondered if I had 
> > > fouled something up. To check, I made a completely new install of 
> > > Pharo 6 (#60508) from the Pharo download page in a separate folder. 
> > > When I start the image, both the strange things above are present, 
> > > plus a debug window with the message;
> > > ‘FT2 Error: Freetype2 primitive failed’.
> > >
> > >
> > >
> > > So it looks as though something has happened to my system which 
> > > means that any Pharo 6 image will show these oddities. The images I 
> > > have tried seem able to run some of my functions correctly, so it’s 
> > > all to do with appearance.
> > >
> > >
> > >
> > > I am running on Windows 10 with all recent updates. There was a 
> > > major update of Windows late yesterday, so it may be that the 
> > > problems appeared then. Does anyone have any suggestions?
> > >
> > >
> > >
> > > Many thanks
> > >
> > >
> > >
> > > Peter Kenny
> > >
> 
> 



Re: [Pharo-users] Iceberg + github without github account

2017-07-21 Thread Peter Uhnak
In Iceberg (Version Control) settings, there should be an option "enable 
Metacello (or Monticello?) integration" that should disable this iirc.

On Fri, Jul 21, 2017 at 08:35:23PM +0200, Herby Vojčík wrote:
> Hello!
> 
> I use Iceberg with metacelloIntegration: true to have gitlocal:// protocol
> available to load local git repos.
> 
> Problem I encountered (while trying to load Mocketry) that Iceberg hijacks
> github:// protocol and it seems it needs ssh credentials that actually
> allows access to github. But I don't have (and don't plan to have, because
> reasons) a github account.
> 
> For the moment I work it around this way (the script I use to build my work
> image):
> 
>  BEGIN
> | hereRef |
> hereRef := Smalltalk imageDirectory asFileReference.
> (IceRepositoryCreator new location: hereRef; subdirectory: 'src';
> createRepository) register.
> 
> "BEGIN WORKAROUND"
> IceGithubRepositoryType class compile: 'type ^ ''github+rw'''. "Work around
> github:// needing access"
> "END WORKAROUND"
> 
> Iceberg enableMetacelloIntegration: true.
> Metacello new baseline: 'Towergame'; repository: 'gitlocal:///', (hereRef /
> 'src') fullName; load.
> Towergame configure.
> 
> Smalltalk snapshot: true andQuit: true.
>  END
> 
> Questions: Is there some more canonical way to get there? Will Iceberg
> include something to make it easier to have readonly-github repos /
> integrate only gitlocal://?
> 
> Thanks, Herby
> 



[Pharo-users] best naming practices for (file) format reading/writing

2017-07-22 Thread Peter Uhnak
Hi,

I've seen (and I use) different naming conventions when reading/writing from 
files/streams...

e.g.

MyReader new readFromStream: aStream. "-> aModel"
MyWriter new writeToStream: aModel. "-> aStream"

or

(MyReader new on: aStream) upToEnd. "-> aModel"
(MyWriter new on: aStream) nextPut: aModel. "-> aStream"

or 

MyReader new fromString: aString. "-> aModel"
MyReader new toString: aModel. "-> aString"


etc. (optionally with class-side methods for convenience).

Do we have some best practices/recommendations/conventions regarding this?

Thanks,
Peter



[Pharo-users] NeoCSV change proposal

2017-07-22 Thread Peter Uhnak
Hi,

this is a continuation of an older thread about quoting fields only when 
necessary. ( http://forum.world.st/NeoCSVWriter-automatic-quotes-td4924781.html 
)

I've attached fileouts of NeoCSV packages with the addition (I don't know if 
Metacello can file-out only changesets).

The change doesn't affect the default behavior, only when explicitly requested.

Peter



Re: [Pharo-users] NeoCSV change proposal

2017-07-22 Thread Peter Uhnak
attached

On Sat, Jul 22, 2017 at 02:12:10PM +0200, Peter Uhnak wrote:
> Hi,
> 
> this is a continuation of an older thread about quoting fields only when 
> necessary. ( 
> http://forum.world.st/NeoCSVWriter-automatic-quotes-td4924781.html )
> 
> I've attached fileouts of NeoCSV packages with the addition (I don't know if 
> Metacello can file-out only changesets).
> 
> The change doesn't affect the default behavior, only when explicitly 
> requested.
> 
> Peter
Object subclass: #NeoCSVReader
instanceVariableNames: 'readStream charBuffer separator stringStream 
fieldCount recordClass recordClassIsIndexable fieldAccessors emptyFieldValue'
classVariableNames: ''
poolDictionaries: ''
category: 'Neo-CSV-Core'!
!NeoCSVReader commentStamp: '' prior: 0!
I am NeoCSVReader.

I read a format that
- is text based (ASCII, Latin1, Unicode)
- consists of records, 1 per line (any line ending convention)
- where records consist of fields separated by a delimiter (comma, tab, 
semicolon)
- where every record has the same number of fields
- where fields can be quoted should they contain separators or line endings

Without further configuration, records will become Arrays of Strings.

By specifiying a recordClass and fields with optional converters most objects 
can be read and instanciated correctly.

MIT License.
!


!NeoCSVReader methodsFor: 'accessing' stamp: 'SvenVanCaekenberghe 5/13/2014 
15:34'!
readHeader
"Read a record, presumably a header and return the header field names.
This should normally be called only at the beginning and only once.
This sets the fieldCount (but fieldAccessors overrides fieldCount)."

| names |
names := Array streamContents: [ :out |
 [ self atEnd or: [ self readEndOfLine ] ]
whileFalse: [ 
out nextPut: self readField.
(self readSeparator and: [ self atEnd or: [ 
self peekEndOfLine ] ])
ifTrue: [ out nextPut: emptyFieldValue 
] ] ].
fieldCount := names size.
^ names! !

!NeoCSVReader methodsFor: 'accessing' stamp: 'SvenVanCaekenberghe 10/6/2014 
17:34'!
select: filter
"Read and collect records that satisfy filter into an Array until there 
are none left.
Return the array."

^ Array streamContents: [ :stream | 
self 
select: filter 
thenDo: [ :each | stream nextPut: each ] ]! !

!NeoCSVReader methodsFor: 'accessing' stamp: 'SvenVanCaekenberghe 6/21/2012 
22:30'!
next
"Read the next record.
I will return an instance of recordClass."

^ recordClassIsIndexable
ifTrue: [ self readNextRecordAsArray ] 
ifFalse: [ self readNextRecordAsObject ]! !

!NeoCSVReader methodsFor: 'accessing' stamp: 'SvenVanCaekenberghe 10/6/2014 
17:33'!
select: filter thenDo: block
"Execute block for each record that satisfies filter until I am at end."

[ self atEnd ]
whileFalse: [ 
| record |
record := self next.
(filter value: record)
ifTrue: [ block value: record ] ]! !

!NeoCSVReader methodsFor: 'accessing' stamp: 'SvenVanCaekenberghe 6/25/2012 
14:45'!
upToEnd 
"Read and collect records into an Array until there are none left.
Return the array."

^ Array streamContents: [ :stream |
self do: [ :each | stream nextPut: each ] ]! !

!NeoCSVReader methodsFor: 'accessing' stamp: 'SvenVanCaekenberghe 6/25/2012 
14:45'!
do: block
"Execute block for each record until I am at end."

[ self atEnd ]
whileFalse: [ 
block value: self next ]! !


!NeoCSVReader methodsFor: 'private - reading' stamp: 'SvenVanCaekenberghe 
6/14/2012 17:24'!
readField
^ self peekQuote
ifTrue: [
self readQuotedField ]
ifFalse: [
self readUnquotedField ]! !

!NeoCSVReader methodsFor: 'private - reading' stamp: 'SvenVanCaekenberghe 
1/15/2014 09:55'!
readNextRecord
| record |
record := recordClass new: fieldCount.
fieldAccessors
ifNil: [ self readNextRecordWithoutFieldAccessors: record ]
ifNotNil: [ self readNextRecordWithFieldAccessors: record ].
self readAtEndOrEndOfLine.
^ record! !

!NeoCSVReader methodsFor: 'private - reading' stamp: 

[Pharo-users] is Renraku general purpose rule checker?

2017-07-22 Thread Peter Uhnak
Hi,

I'm looking at Renraku and I wonder, would Renraku be a good start for 
general-purpose checking?

E.g. I have a domain, where Person cannot drink if they are underage.

So I've created a simple ReAbstractRule subclass that does basic check

SomeRule>>basicCheck: anEntity
^ anEntity age < 18

and also custom Critique.

So for everything seems that it works well, however I am not sure if there are 
some potential roadbloacks down the road, because e.g. Renraku is meant only 
for AST/code based rules.

Thanks,
Peter



Re: [Pharo-users] NeoCSV change proposal

2017-07-22 Thread Peter Uhnak
Hi Sven,

my use case was hand-edited CSVs (therefore the quotes are extra clutter), 
which imples that I would be hand-viewing/editing only small CSVs (no 
performance issues).

I agree that we should err on the safe side with CR & LF (e.g. tools may 
sometimes autoconvert line endings).

Regarding performance:

#findFirstInString:inSet:startingAt: didn't work for me (not sure if bug, or I 
don't know how to use), so I've trried with inCharacterSet:

Tested on worst-case scenario - strings don't contain tested symbols.

s10 := 'a' repeat: 10.
s100 := 'a' repeat: 100.

[ {'"'. ','. String cr. String lf } anySatisfy: [ :each | s10 
includesSubstring: each ] ] bench. "'1,200,046 per second'"
[ {'"'. ','. String cr. String lf } anySatisfy: [ :each | s100 
includesSubstring: each ] ] bench. "'495,482 per second'"

[ s10 includesAny: { $,. $". Character cr. Character lf } ] bench. "'2,819,416 
per second'"
[ s100 includesAny: { $,. $". Character cr. Character lf } ] bench. "'2,200,668 
per second'"

[ ByteString findFirstInString: s10 inCharacterSet: ',"', String crlf 
startingAt: 1 ] bench. "'1,187,324 per second'"
[ ByteString findFirstInString: s100 inCharacterSet: ',"', String crlf 
startingAt: 1 ] bench. "'165,526 per second'"


#includesAny: seems to be the best by far.

Storing the tested characters didn't improve it by much.

Peter

On Sat, Jul 22, 2017 at 06:51:31PM +0200, Sven Van Caekenberghe wrote:
> Hi Peter,
> 
> > On 22 Jul 2017, at 14:12, Peter Uhnak  wrote:
> > 
> > Hi,
> > 
> > this is a continuation of an older thread about quoting fields only when 
> > necessary. ( 
> > http://forum.world.st/NeoCSVWriter-automatic-quotes-td4924781.html )
> > 
> > I've attached fileouts of NeoCSV packages with the addition (I don't know 
> > if Metacello can file-out only changesets).
> > 
> > The change doesn't affect the default behavior, only when explicitly 
> > requested.
> > 
> > Peter
> 
> I accepted your changes as such, the .mcz's were copied over to the main 
> repositories. This is a pure & clean extension, so that is good. Thank you.
> 
> This option is always going to be slower, but the current implementation 
> might be improved, I think.
> 
> The key test in #writeOptionalQuotedField:
> 
> {
>   lineEnd asString.
>   separator asString.
>   '"' } anySatisfy: [ :each | string includesSubstring: each ]
> 
> will be quite slow. 
> 
> If we accept a little bit of (over safe) error on EOL and use any occurrence 
> of CR or LF as needing a quote, we could switch to characters to test for. 
> There exists a fast (primitive) test, #findFirstInString:inSet:startingAt: 
> that can do all the testing in one go. If your version turns out to be slow, 
> we could try that, if measurements show a difference.
> 
> Regards,
> 
> Sven 
> 
> 



Re: [Pharo-users] NeoCSV change proposal

2017-07-23 Thread Peter Uhnak
Ah, ByteArrayMap, I was trying ByteArray.

Not sure what the next step is here: should I add it and send you mczs, or will 
you do it yourself? (it is a simple change).

Peter

On Sat, Jul 22, 2017 at 10:51:42PM +0200, Sven Van Caekenberghe wrote:
> Peter,
> 
> > On 22 Jul 2017, at 22:27, Peter Uhnak  wrote:
> > 
> > Hi Sven,
> > 
> > my use case was hand-edited CSVs (therefore the quotes are extra clutter), 
> > which imples that I would be hand-viewing/editing only small CSVs (no 
> > performance issues).
> > 
> > I agree that we should err on the safe side with CR & LF (e.g. tools may 
> > sometimes autoconvert line endings).
> > 
> > Regarding performance:
> > 
> > #findFirstInString:inSet:startingAt: didn't work for me (not sure if bug, 
> > or I don't know how to use), so I've trried with inCharacterSet:
> 
> Yes, it is a bitch to use, the the version you used does not use the 
> primitive.
> 
> Try playing with this:
> 
> s10 := 'a' repeat: 10.
> s100 := 'a' repeat: 100.
> 
> searchSet := ByteArray new: 256 withAll: 0.
> ',"', String crlf do: [ :each | searchSet at: each asInteger + 1 put: 1 ].
> 
> searchSet := (CharacterSet newFrom: ',"', String crlf) byteArrayMap.
> 
> [ ByteString findFirstInString: s10 inSet: searchSet startingAt: 1 ] bench.
>  "15,160,161 per second"
> [ ByteString findFirstInString: s100 inSet: searchSet startingAt: 1 ] bench.
>  "8,219,081 per second"
> 
> ByteString findFirstInString: ',"', String crlf inSet: searchSet startingAt: 
> 1.
> 
> Sven
> 
> > Tested on worst-case scenario - strings don't contain tested symbols.
> > 
> > s10 := 'a' repeat: 10.
> > s100 := 'a' repeat: 100.
> > 
> > [ {'"'. ','. String cr. String lf } anySatisfy: [ :each | s10 
> > includesSubstring: each ] ] bench. "'1,200,046 per second'"
> > [ {'"'. ','. String cr. String lf } anySatisfy: [ :each | s100 
> > includesSubstring: each ] ] bench. "'495,482 per second'"
> > 
> > [ s10 includesAny: { $,. $". Character cr. Character lf } ] bench. 
> > "'2,819,416 per second'"
> > [ s100 includesAny: { $,. $". Character cr. Character lf } ] bench. 
> > "'2,200,668 per second'"
> > 
> > [ ByteString findFirstInString: s10 inCharacterSet: ',"', String crlf 
> > startingAt: 1 ] bench. "'1,187,324 per second'"
> > [ ByteString findFirstInString: s100 inCharacterSet: ',"', String crlf 
> > startingAt: 1 ] bench. "'165,526 per second'"
> > 
> > 
> > #includesAny: seems to be the best by far.
> > 
> > Storing the tested characters didn't improve it by much.
> > 
> > Peter
> > 
> > On Sat, Jul 22, 2017 at 06:51:31PM +0200, Sven Van Caekenberghe wrote:
> >> Hi Peter,
> >> 
> >>> On 22 Jul 2017, at 14:12, Peter Uhnak  wrote:
> >>> 
> >>> Hi,
> >>> 
> >>> this is a continuation of an older thread about quoting fields only when 
> >>> necessary. ( 
> >>> http://forum.world.st/NeoCSVWriter-automatic-quotes-td4924781.html )
> >>> 
> >>> I've attached fileouts of NeoCSV packages with the addition (I don't know 
> >>> if Metacello can file-out only changesets).
> >>> 
> >>> The change doesn't affect the default behavior, only when explicitly 
> >>> requested.
> >>> 
> >>> Peter
> >> 
> >> I accepted your changes as such, the .mcz's were copied over to the main 
> >> repositories. This is a pure & clean extension, so that is good. Thank you.
> >> 
> >> This option is always going to be slower, but the current implementation 
> >> might be improved, I think.
> >> 
> >> The key test in #writeOptionalQuotedField:
> >> 
> >> {
> >>  lineEnd asString.
> >>  separator asString.
> >>  '"' } anySatisfy: [ :each | string includesSubstring: each ]
> >> 
> >> will be quite slow. 
> >> 
> >> If we accept a little bit of (over safe) error on EOL and use any 
> >> occurrence of CR or LF as needing a quote, we could switch to characters 
> >> to test for. There exists a fast (primitive) test, 
> >> #findFirstInString:inSet:startingAt: that can do all the testing in one 
> >> go. If your version turns out to be slow, we could try that, if 
> >> measurements show a difference.
> >> 
> >> Regards,
> >> 
> >> Sven 
> >> 
> >> 
> > 
> 
> 



Re: [Pharo-users] NeoCSV change proposal

2017-07-23 Thread Peter Uhnak
Thank you Sven!

Peter

On Sun, Jul 23, 2017 at 01:59:41PM +0200, Sven Van Caekenberghe wrote:
> 
> > On 23 Jul 2017, at 09:55, Peter Uhnak  wrote:
> > 
> > Ah, ByteArrayMap, I was trying ByteArray.
> 
> ByteArrayMap is not a class, it is still a ByteArray, but of size 256 used as 
> an inclusion map for characters that fit a byte.
> 
> BTW, using CharacterSet as an abstraction makes the trick easier.
> 
> I committed:
> 
> ===
> Name: Neo-CSV-Core-SvenVanCaekenberghe.26
> Author: SvenVanCaekenberghe
> Time: 23 July 2017, 1:54:22.095185 pm
> UUID: e429f87e-5c11-0d00-a72d-ae5d00db2a8c
> Ancestors: Neo-CSV-Core-PeterUhnak.25
> 
> make the core test in #writeOptionalQuotedField faster by using a primitive 
> when possible
> 
> add #testWideOptionalQuoted
> ===
> Name: Neo-CSV-Tests-SvenVanCaekenberghe.22
> Author: SvenVanCaekenberghe
> Time: 23 July 2017, 1:54:52.133003 pm
> UUID: 5f81c280-5c11-0d00-a72e-7cd500db2a8c
> Ancestors: Neo-CSV-Tests-PeterUhnak.21
> 
> make the core test in #writeOptionalQuotedField faster by using a primitive 
> when possible
> 
> add #testWideOptionalQuoted
> ===
> 
> Extra caution was needed for WideStrings.
> 
> Sven
> 
> > Not sure what the next step is here: should I add it and send you mczs, or 
> > will you do it yourself? (it is a simple change).
> > 
> > Peter
> > 
> > On Sat, Jul 22, 2017 at 10:51:42PM +0200, Sven Van Caekenberghe wrote:
> >> Peter,
> >> 
> >>> On 22 Jul 2017, at 22:27, Peter Uhnak  wrote:
> >>> 
> >>> Hi Sven,
> >>> 
> >>> my use case was hand-edited CSVs (therefore the quotes are extra 
> >>> clutter), which imples that I would be hand-viewing/editing only small 
> >>> CSVs (no performance issues).
> >>> 
> >>> I agree that we should err on the safe side with CR & LF (e.g. tools may 
> >>> sometimes autoconvert line endings).
> >>> 
> >>> Regarding performance:
> >>> 
> >>> #findFirstInString:inSet:startingAt: didn't work for me (not sure if bug, 
> >>> or I don't know how to use), so I've trried with inCharacterSet:
> >> 
> >> Yes, it is a bitch to use, the the version you used does not use the 
> >> primitive.
> >> 
> >> Try playing with this:
> >> 
> >> s10 := 'a' repeat: 10.
> >> s100 := 'a' repeat: 100.
> >> 
> >> searchSet := ByteArray new: 256 withAll: 0.
> >> ',"', String crlf do: [ :each | searchSet at: each asInteger + 1 put: 1 ].
> >> 
> >> searchSet := (CharacterSet newFrom: ',"', String crlf) byteArrayMap.
> >> 
> >> [ ByteString findFirstInString: s10 inSet: searchSet startingAt: 1 ] bench.
> >> "15,160,161 per second"
> >> [ ByteString findFirstInString: s100 inSet: searchSet startingAt: 1 ] 
> >> bench.
> >> "8,219,081 per second"
> >> 
> >> ByteString findFirstInString: ',"', String crlf inSet: searchSet 
> >> startingAt: 1.
> >> 
> >> Sven
> >> 
> >>> Tested on worst-case scenario - strings don't contain tested symbols.
> >>> 
> >>> s10 := 'a' repeat: 10.
> >>> s100 := 'a' repeat: 100.
> >>> 
> >>> [ {'"'. ','. String cr. String lf } anySatisfy: [ :each | s10 
> >>> includesSubstring: each ] ] bench. "'1,200,046 per second'"
> >>> [ {'"'. ','. String cr. String lf } anySatisfy: [ :each | s100 
> >>> includesSubstring: each ] ] bench. "'495,482 per second'"
> >>> 
> >>> [ s10 includesAny: { $,. $". Character cr. Character lf } ] bench. 
> >>> "'2,819,416 per second'"
> >>> [ s100 includesAny: { $,. $". Character cr. Character lf } ] bench. 
> >>> "'2,200,668 per second'"
> >>> 
> >>> [ ByteString findFirstInString: s10 inCharacterSet: ',"', String crlf 
> >>> startingAt: 1 ] bench. "'1,187,324 per second'"
> >>> [ ByteString findFirstInString: s100 inCharacterSet: ',"', String crlf 
> >>> startingAt: 1 ] bench. "'165,526 per second'"
> >>> 
> >>> 
> >>> #includesAny: seems to be the best by far.
> >>> 
> >>> Storing the tested characters didn&

Re: [Pharo-users] Iceberg and removing packages

2017-07-30 Thread Peter Uhnak
This was supposedly fixed in April 
https://github.com/pharo-vcs/iceberg/issues/317

however I had the same issue ~two months ago, so I had to delete the packages 
by hand.

P


On Sun, Jul 30, 2017 at 11:04:20AM -0300, Esteban A. Maringolo wrote:
> Hi,
> 
> I'm playing around with Iceberg in Pharo 6, and even when I find the
> workflow streamlined, but since it doesn't map 1:1 with git workflow
> from other IDEs or command line, I find myself not knowing how to do
> certain tasks.
> 
> One thing that happened is that I published a few packages to one of
> my repos in Github, then I decided to remove one of the packages from
> the repo, then I synchronized it but in the repo there is still is the
> package folder for the package I removed.
> 
> What should I do to definitely remove those files from the commit?
> 
> Regards!
> 
> Esteban A. Maringolo
> 



Re: [Pharo-users] How to export critics from Critic Browser?

2017-07-31 Thread Peter Uhnak
Hi,

I did a small experiment on Travis short while ago that collects the QAs and 
prints them to output log.

Script (you would be interested only in the Smalltalk part of the code): 
https://github.com/peteruhnak/ugly-pharo-code/blob/master/qa-testing.sh

Travis output (expand line 400): 
https://travis-ci.org/peteruhnak/ugly-pharo-code#L400

Peter

On Mon, Jul 31, 2017 at 01:38:31AM -0300, Hernán Morales Durand wrote:
> Hi,
> 
> I'm using Pharo 6.1 and I want to export a report of Critics Browser results.
> Is there a way to save the results?
> 
> It would be nice to have a CSV, to record historical analysis of my
> progress, then plot using Roassal, etc.
> 
> Cheers,
> 
> Hernán
> 



Re: [Pharo-users] step-by-step trace of object creation and messaging?

2017-08-01 Thread Peter Uhnak
Hi David,

> I am new to Pharo

As in you've never seen Pharo before, or that you have only limited knowledge?

All the examples are just methods in the system. E.g. the simple example is 
defined in class-side of BormExampleDiagrams in method #exampleDataFlows.

So you could run it from playground as "BormExampleDiagrams exampleDataFlows."

To open a debugger on any code, you can select it and press ctrl+shift+d, or 
right-click and select "Debug it".

I haven't really looked at BORM in quite a while as I am busy with different 
projects, so there are some issue related to the latest Pharo (#name 
deprecation, which you can disable with `Deprecation raiseWarning: false`) and 
Roassal (dark theme messed up the colors).

If you have questions regarding OpenPonk, you can also contact me privately.


Peter

On Tue, Aug 01, 2017 at 01:39:18PM +, David Epstein wrote:
> Hello,
> 
> 
> I am new to Pharo and would like to better understand how 
> openponk.github.io works by stepping through the 
> creation of objects and seeing the messages they send. I don't see a way to 
> call the debugger without highlighting some problematic code. No code is 
> problematic (that I know of). Ideally, I'd like to see what is happening when 
> I start one of OpenPonk's examples, such as "BORM Simple Diagram". What tool 
> or browser can I use to do this?
> 
> 
> -david



Re: [Pharo-users] Compiling lots of method source without debugger

2017-08-04 Thread Peter Uhnak
Hi,

> This is my first time here so I hope this is the right place to ask
> questions.

It is. :)

> I want to be able to compile these methods programatically without
> interruptions (using method source strings only) and gather all compiler
> errors that occur. What would be the best way to go about this?

It is certainly a way.

Compilation errors will raise SyntaxErrorNotifications that you can capture, 
e.g.

sthClass := Object subclass: #Something.
[ sthClass compile: '^^' classified: 'protocol-name' ]
on: SyntaxErrorNotification
do: [ :err | err inspect ]

> Also: How do I control in which package a compiled method ends up if the
> target class is in a different package (Method extension)?

Methods are stored in protocols (accessing, initialization, as yet 
unclassified).
If you however start the name with an asterisk *, then the method will become 
an extension method and will be stored in the package name following the 
asterisk.


e.g.

sthClass := Object subclass: #Something.
sthClass compile: 'methodName self lives somewhere else' classified: 
'*SomewhereElse'.

> 
> Any help would be greatly appreciated!

I would (shameless self-promotion) also recommend looking at this 
https://github.com/peteruhnak/pharo-changes-builder , so you could review the 
changes before actually compiling them.

Peter



Re: [Pharo-users] Lazy-initialization patterns

2017-08-05 Thread Peter Uhnak
Personally I prever to avoid long lazy initializations, so I have it nice and 
tidy in a single method.

MyClass>>#property
^ property ifNil: [ property := self bar collect: #food ]

If I want to initialize the value in a separate method (typically for testing 
or reuse), then I prefer to avoid state mutation there and instead I return the 
result.

MyClass>>#property
^ property ifNil: [ property := self createNewProperty ]

MyClass>>createNewProperty
"I won't touch property instance variable here, just create a new value 
and return it"
^ self bar collect: [ :e | e drink ]


> an initializationMethod returning the value instead of the receiver is a code 
> smell to me.

For this reason I tend to name such methods createNewX, initializeX says to me 
"only mutate state and return self"

Peter



[Pharo-users] sharing context/variables between multiple playgrounds

2017-08-07 Thread Peter Uhnak
Hi,

is there a way to share context/variables between multiple playgrounds?

E.g. in Playground window 1 I declare

```
factor := 70.
```

and in Playground window 2 I do (without declaring `factor`)

```
5 * factor. "-> 350"
```


Thanks,
Peter



[Pharo-users] Playground doesn't respect LF endings

2017-08-07 Thread Peter Uhnak
Hi,

when I paste a text into the playground with line endings containing just LF 
(unix-style), then navigation to beginning/end of a line instead jumps to the 
beginning/end of the text. (I guess it is hardcoded to CR only).

Right now I have to execute `Clipboard clipboardText withSqueakLineEndings 
asString` and then copy&paste the result.

Peter



[Pharo-users] including Pillar in Pharo image by default

2017-08-11 Thread Peter Uhnak
Hi,

I would like to propose including Pillar in the Pharo image by default.

My reasoning:

Since we are moving to git, and most people will use github, gitlab, and the 
likes, it is expected to include a README.md file (or possibly more extensive 
documentation) alongside the code.

Which means that people will (and are) writing the README mostly by hand, which 
of course is problematic, as e.g. code snippets can get deprecated, screenshots 
become outdated, etc.

As Pillar tries to address these problems, it would make sense to me to include 
Pillar in the image by default, as anyone using git (which eventually should be 
everyone) will most likely benefit from writing their documentation in Pillar.
Similarly using Pillar would open an avenue to provide the documentation 
in-image, e.g. one exporter for html/markdown, and another one for Pharo's Help 
system.

I could, of course, install Pillar every time, but considering thats extra 
effort and in the extra time I can fix the issues by hand, I don't have such an 
incentive to use Pillar for this.

Questions & Problems:

I don't know by how much would pillar increase the image size. Perhaps there 
could be (a) "lightweight Pillar" (that would include just pillar & markdown 
exporter), or (b) we would have different images for different uses.

By different images I mean something along the lines of
a) developer image - meant to be directly used by developers to create their 
software
b) production image - as a foundation for running systems / users

Does this make sense?

Peter



Re: [Pharo-users] including Pillar in Pharo image by default

2017-08-11 Thread Peter Uhnak
What I meant is that I have a readme, e.g. https://github.com/OpenPonk/xmi , 
which contains

* Pharo code examples
* images
* References to Pharo code (class names, etc.)

But if the code changes (renames, API changes, different UI), I have to 
manually update the README.
There is also no way for me to validate the examples, etc and see if anything 
is broken.

Peter

On Fri, Aug 11, 2017 at 06:58:50PM +0200, Stephane Ducasse wrote:
> Let us rephrase it:
> 
> - I would like to have a mini pillar with a simplified model and visitor
> to display class comments.
> 
> - then think about Pharo 70 as the core and birth of a new generation of 
> imageS
> 
> I will restart to revisit Pillar once I'm done with the Lecture at Prague.
> 
> Stef
> 
> On Fri, Aug 11, 2017 at 6:52 PM, Peter Uhnak  wrote:
> > Hi,
> >
> > I would like to propose including Pillar in the Pharo image by default.
> >
> > My reasoning:
> >
> > Since we are moving to git, and most people will use github, gitlab, and 
> > the likes, it is expected to include a README.md file (or possibly more 
> > extensive documentation) alongside the code.
> >
> > Which means that people will (and are) writing the README mostly by hand, 
> > which of course is problematic, as e.g. code snippets can get deprecated, 
> > screenshots become outdated, etc.
> >
> > As Pillar tries to address these problems, it would make sense to me to 
> > include Pillar in the image by default, as anyone using git (which 
> > eventually should be everyone) will most likely benefit from writing their 
> > documentation in Pillar.
> > Similarly using Pillar would open an avenue to provide the documentation 
> > in-image, e.g. one exporter for html/markdown, and another one for Pharo's 
> > Help system.
> >
> > I could, of course, install Pillar every time, but considering thats extra 
> > effort and in the extra time I can fix the issues by hand, I don't have 
> > such an incentive to use Pillar for this.
> >
> > Questions & Problems:
> >
> > I don't know by how much would pillar increase the image size. Perhaps 
> > there could be (a) "lightweight Pillar" (that would include just pillar & 
> > markdown exporter), or (b) we would have different images for different 
> > uses.
> >
> > By different images I mean something along the lines of
> > a) developer image - meant to be directly used by developers to create 
> > their software
> > b) production image - as a foundation for running systems / users
> >
> > Does this make sense?
> >
> > Peter
> >
> 



Re: [Pharo-users] including Pillar in Pharo image by default

2017-08-11 Thread Peter Uhnak
On Fri, Aug 11, 2017 at 09:14:01PM +0200, Esteban Lorenzano wrote:
> 
> > On 11 Aug 2017, at 21:10, Esteban Lorenzano  wrote:
> > 
> > hi, 
> > 
> >> On 11 Aug 2017, at 18:57, Cyril Ferlicot D.  >> > wrote:
> >> 
> >> Another step would be to get a minimal parser not relying on
> >> PetitParser. 
> > 
> > Let’s think differently: why not to include a tiny PetitParser? 
> > Then we can think on:
> > 
> > - pillar sintax (better than just a restricted version)
> *syntax*… sorry for spanish intromission ;)
> 
> btw… not just outside the image (as readme).

Yes, one of the points I want is to have the readme available in Pharo's Help 
Browser with rich content.

Peter



Re: [Pharo-users] including Pillar in Pharo image by default

2017-08-11 Thread Peter Uhnak
A long time issue with Markdown was that there was no standardization (and when 
I used Pillar's MD export ~2 years ago it didn't work well).

However CommonMark ( http://spec.commonmark.org/0.28/ ) has become the de-facto 
standard, so it would make sense to support it bidirectionally with Pillar.

> The readme.md that Peter is talking about is gfm markdown

Well, technically it is just a CommonMark, as I am not using any github 
extensions.
(Github uses CommonMarks and adds just couple small extensions.)

Peter



Re: [Pharo-users] Preference to for not showing hidden files in the FileBrowser?

2017-08-17 Thread Peter Uhnak
There's no such option.

I've created File Dialog ( https://github.com/peteruhnak/file-dialog ) which 
will be in P7 when I find the time to go through the incorporation process... 
which practically means September...

Peter


On Thu, Aug 17, 2017 at 01:05:25PM +0200, Guillermo Polito wrote:
> On Wed, Aug 16, 2017 at 1:26 PM, H. Hirzel  wrote:
> 
> > Hello
> >
> > Is there a preference for not showing hidden files in the FileBrowser?
> >
> 
> I don't think such preference exists, sorry... Maybe implementing it would
> not be so hard?
> 
> 
> > I checked menu 'System' -> 'Settings' searching for 'hidden'.
> > This is on Ubuntu, i.e. hidden files start with a dot.
> >
> > Thank you for the answer in advance
> >
> > Hannes
> >
> >
> 
> 
> -- 
> 
> 
> 
> Guille Polito
> 
> 
> Research Engineer
> 
> French National Center for Scientific Research - *http://www.cnrs.fr*
> 
> 
> 
> 
> *Web:* *http://guillep.github.io* 
> 
> *Phone: *+33 06 52 70 66 13



Re: [Pharo-users] YAML parser (2017)

2017-08-18 Thread Peter Uhnak
Hi,

Phil Back has kindly fixed the PetitYAML so it mostly works now.
The only problem I've encountered was some weird misparsing of strings 
containing slashes, e.g. "5/".

In any case:

Install PetitParser (from Catalog or somewhere), load PetitYAML package (this 
is already loaded when loading PP from catalog).

And then parse your string

```
PPYAMLGrammar parse: '
language: c
sudo: false
cache:
  directories:
- opensmalltalk-vm/.thirdparty-cache
git:
  depth: "5"'.
```


"Dictionary(
'cache'->a Dictionary(
'directories'->#('opensmalltalk-vm/.thirdparty-cache')
)
'git'->a Dictionary(
'depth'->'5'
)
'language'->'c'
'sudo'->'false'
)"


Take a look at PPYAMLGrammarTest>>testTravisYml too.

Peter



On Fri, Aug 18, 2017 at 09:45:00AM +0200, H. Hirzel wrote:
> I am not looking for a complete implementation which is quite an effort
> 
> but rather for a subset which does simple things such as parsing
> - a list of hashes (dictionaries),
> - a dictionary of dictionaries (nested to arbitrary depths),
> - multi-line comments
> 
> 
> --Hannes
> 
> On 8/16/17, H. Hirzel  wrote:
> > Are there any news about a YAML parser for Pharo 5 / 6.1?
> >
> > --Hannes
> >
> > On 5/29/17, Peter Uhnak  wrote:
> >> Hi,
> >>
> >> do we have a working parser for YAML?
> >>
> >> There's PPYAMLGrammar (in PetitParser), however it doesn't seem to work
> >> in
> >> Pharo 6 at all (not even tests pass).
> >> In Pharo 5 the tests are green, but using it on YAML content still
> >> fails...
> >> with small fix I managed it to "pass", however the output seems to be a
> >> very
> >> fine-grained AST decomposition and not the expected output
> >> (dictionaries/arrays).
> >>
> >> So do we have some else/working?
> >>
> >> YAML specs have BNF descriptions, so maybe SmaCC can generate it? (I
> >> don't
> >> know SmaCC, so maybe this is not how it works.)
> >>
> >> Thanks,
> >> Peter
> >>
> >>
> >
> 



Re: [Pharo-users] Installation done last week: Do I have Pharo 6.0 or Pharo 6.1?

2017-08-18 Thread Peter Uhnak
I don't know what was the exact reasoning why it was chosen to stay this way...
60505 is still 6.0, so somewhere between 60506 and 60510 is the split. :-)

Peter


On Fri, Aug 18, 2017 at 04:21:24PM +0200, H. Hirzel wrote:
> Hello
> 
> Pharo 6.1 was released on the 24th July 2017.
> Thread [Pharo-dev] [ANN] Pharo 6.1 (summer) released! (35 messages so far).
> My question short: Which version do I get when installing?
> 
> Last week I on the the 9th August I did
> 
>curl get.pharo.org | bash
> 
> on Ubuntu 14.04-32bit. Installation was done fully automated. Very
> smooth! Excellent!
> 
> Just needed to do in a terminal window
> ./pharo-ui
> to start Pharo 6.x
> 
> Now my question:
> 
> 'Word menu'  -> 'System' -> 'About'
> 
> gives me
> 
> Pharo 6.0
> Latest update: #60510
> 
> 
> Is the indication 'Pharo 6.0' just an omission in the release process
> and it should say 'Pharo 6.1'?
> Or did I still get 'Pharo 6.0' for some reason?
> 
> Thank you for the answer in advance
> 
> Hannes
> 



Re: [Pharo-users] YAML parser (2017)

2017-08-18 Thread Peter Uhnak
On Fri, Aug 18, 2017 at 09:50:35PM +0200, H. Hirzel wrote:
> Hello Peter
> 
> Thank you for the answer. Good news that Phil Back has an done
> upgraded version of the PetitYAML parser recently.
> 
> I think what you describe as "mostly complete" will be very fine for
> my purposes.
> 
> On 8/18/17, Peter Uhnak  wrote:
> > Hi,
> >
> > Phil Back has kindly fixed the PetitYAML so it mostly works now.
> > The only problem I've encountered was some weird misparsing of strings
> > containing slashes, e.g. "5/".
> >
> > In any case:
> >
> > Install PetitParser (from Catalog or somewhere), load PetitYAML package
> > (this is already loaded when loading PP from catalog).
> 
> I just installed Pillar and that pulled in PetitParser. Not sure if it
> is a good idea now to re-install PetitParser again.
> 
> In particular there is only PetitParser catalog entry for Pharo 5.0,
> not 6.0 or 6.1

I don't know about this, you'd have to ask the Moose team (or whoever is 
responsible for PetitParser now)

> 
> I assume that can directly load the PetitYAML from the repository instead.
> Where do I find it?

Open Monticello Browser, find PetitParser repository and open it, select 
PetitYAML package, select the latest version, right click and load.

Peter



Re: [Pharo-users] Installation done last week: Do I have Pharo 6.0 or Pharo 6.1?

2017-08-18 Thread Peter Uhnak
On Fri, Aug 18, 2017 at 07:16:30PM +0200, H. Hirzel wrote:
> Thank you, Bernhard and Markus for confirming that Pharo is not
> reporting the correct version number.
> 
> But do you think I probably got 6.1 when I installed it  on the 9th August 
> with
> 
>  curl get.pharo.org | bash

Yes, you will get the latest version which is 60510, which is 6.1.

You can download previous versions here http://files.pharo.org/image/60/

Peter



Re: [Pharo-users] YAML parser (2017)

2017-08-19 Thread Peter Uhnak
All my tests are green, so maybe you need to update PetitParser too to the 
latest (PetitParser-JanKurs.290)

It is probable that Pillar loaded older version of PetitParser.

Peter


On Fri, Aug 18, 2017 at 10:56:30PM +0200, H. Hirzel wrote:
> Hello again
> 
> On 8/18/17, Peter Uhnak  wrote:
> [...]
> >> I assume that can directly load the PetitYAML from the repository
> >> instead.
> >> Where do I find it?
> >
> > Open Monticello Browser, find PetitParser repository and open it, select
> > PetitYAML package, select the latest version, right click and load.
> >
> > Peter
> >
> Thank you for the instructions.
> Loading PetitYAML-PhilippeBack.11.mcz went fine.
> 
> But out of 76 tests I get 57 errors. This are so many error that that
> it is quite possible that they have a single cause. I did not start
> debugging.
> 
> Something similar happens if I go back to
> PetitYAML-JanKurs.8
> Author: JanKurs
> Time: 15 June 2016
> 
> What I aiming at is
> 
> - to have Pillar loaded (was successful, see other thread)
> - get a working PetitYAML version
> 
> --Hannes
> 
> P.S. Note that the screen shot shows a Pharo 6.0 version. But it
> actually is 6.1 (see other thread).





Re: [Pharo-users] YAML parser (2017)

2017-08-19 Thread Peter Uhnak
On Sat, Aug 19, 2017 at 02:45:28PM +0200, H. Hirzel wrote:
> Peter, thanks for the confirmation that in your installation of the
> PetitYAML grammar all tests are green.
> 
> I wonder how you did it.

As I've said, you need to update PetitParser; if there's no appropriate catalog 
entry, then ConfigurationOfPetitParser loadBleeding edge, or manually via 
Monticello Browser (the same way you loaded PetitYAML).

Peter

> 
> This is what I did:
> 
> 1. I put Pillar on the back burner for the moment and
> 
> 2. I went for a pristine Pharo 6.0 Latest update: #60510 image (a.k.a. 6.1).
> 
> 3. Then I installed PetitParser only through the catalog --
> the entry is still tagged for Pharo 5.0
> 
> 4. Then I added PetitYAML
> 
> Name: PetitYAML-PhilippeBack.11
> Author: PhilippeBack
> Time: 29 May 2017, 12:53:55.994195 pm
> UUID: d7658233-112c-754c-81a7-d60139bb9549
> 
> taken from
> 
> MCSmalltalkhubRepository
>   owner: 'Moose'
>   project: 'PetitParser'
>   user: ''
>   password: ''
> 
> 
> 5. Running the tests gave me
> 
> 76 run -- 76 errors
> 
> 
> What am I missing here?
> 
> Is there an easy workaround to get PetitParser with PetitYAML into
> 6.0-#60510 (a.k.a. 6.1) ?
> 
> --Hannes



Re: [Pharo-users] Spec "bindings"

2017-09-09 Thread Peter Uhnak
Hi Rob,

I'm making a note to look at your proposals and I will discuss it with Stef 
later.

> 
> he has more and younger braincells than me

But not enough connections between them. The cells just sit there alone and are 
not talking to anyone. :(

Peter



Re: [Pharo-users] UI framework&design options

2015-01-25 Thread Peter Uhnak
Hi,

what is in Deep into Pharo is describing Roassal1, but now we have Roassal2. 
Also the book is still work in progress... I believe Alex mentioned releasing 
it in mid 2015.
Right now also the pharo and moose mailing list is good source of information, 
since roassal was discussed a lot in the past few months.

Peter

-Original Message-
From: "Piotr Klibert" 
Sent: ‎1/‎25/‎2015 1:26 PM
To: "Any question about pharo is welcome" 
Subject: Re: [Pharo-users] UI framework&design options

>
> is there a high-level overview of Roassal
> architecture somewhere?
>

I just found http://agilevisualization.com/#book - last time I read
about Roassal was in a draft for Deep into Pharo a couple of years ago
and I'm glad to see that documentation situation improved so much.
Added to my reading list.


Best regards,
Piotr Klibert



Re: [Pharo-users] Pillar multiline comment

2015-03-08 Thread Peter Uhnak
H
If pillar is line based, how I can make code examples?

Actually, maybe this could work, I'll try it later.
{{{comment:
My
Multiline
Comment
}}}


-Original Message-
From: "stepharo" 
Sent: ‎3/‎8/‎2015 8:21 AM
To: "Any question about pharo is welcome" 
Subject: Re: [Pharo-users] Pillar multiline comment

Pillar is line based.
You can put a comment to each of the line beginning.


Le 7/3/15 19:32, Peter Uhnák a écrit :
> Is it possible to create multiline comments in Pillar?
>
> For example I want to add code that I used to create a visualization, 
> but I want to show the user only the image (but want to keep the code 
> so I can regenerate if needed).
>
> Thanks,
> Peter




Re: [Pharo-users] GTSpotter with no results

2015-03-31 Thread Peter Uhnak
I also experience this daily, it happens when I start typing immediately, so 
maybe it isn't fully initialized yet?

As a sidenote this sometimes happens to me with spec windows, so maybe some 
problem in rendering loop.

Peter

-Original Message-
From: "Christophe Demarey" 
Sent: ‎3/‎31/‎2015 11:48 AM
To: "Any question about pharo is welcome" 
Subject: Re: [Pharo-users] GTSpotter with no results

I can reproduce it very easily by typing fast.
Maybe it is because I have an old computer ...



Le 31 mars 2015 à 11:00, Tudor Girba a écrit :


I never got it, but I would still be interested in how to reproduce it :).


Doru


On Tue, Mar 31, 2015 at 10:53 AM, Andrei Chis  
wrote:

I got this error once or twice but could not reproduce it.




Cheers,
Andrei


On Tue, Mar 31, 2015 at 10:47 AM, Christophe Demarey 
 wrote:

Hi,

I would like to know if some of you already got this problem: when I open 
GTSpotter (with the shortcut) and I start to type quickly (before any result 
appears) in the text I'm searching for, I get no result at all. Even If I 
remove all characters from the search field, GTSpotter still presents an empty 
list.

Thanks,
Christophe.







-- 

www.tudorgirba.com


"Every thing has its own flow"

Re: [Pharo-users] Request to put up my under-development applicationfor automated build

2015-07-13 Thread Peter Uhnak
Has your registration to pharo-contribution been approved yet? An admin needs 
to manually approve it, so it make take couple of hours.

Peter

-Original Message-
From: "Jigyasa Grover" 
Sent: ‎7/‎13/‎2015 1:48 PM
To: "pharo-users@lists.pharo.org" 
Subject: Re: [Pharo-users] Request to put up my under-development 
applicationfor automated build


*Access Denied
grover.jigya...@gmail.com is missing the Job/Create permission*


Peter, This is the error I receive on clicking on NEW JOB option. 
Help appreciated.
Thank You :)



--
View this message in context: 
http://forum.world.st/Request-to-put-up-my-under-development-application-for-automated-build-tp4836715p4837326.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.



[Pharo-users] Class side vs instance side

2015-07-22 Thread Peter Uhnak
Hi,

I am trying to figure out where to best place some mapping/data/stable methods.

For example imagine method
~
MyRectangle>>oppositeSides
^ { #top -> #bottom.
#bottom -> #top.
#topLeft -> #bottomRight

} asDictionary


And then the class might have some other related methods such as
~~~
MyRectangle>>oppositeSideFor: aSide
^ self oppositeSides at: aSide


So it's a method returning a mapping between opposite sides/corners and thus is 
really not going to change. 
Now I could place this in instance-side and create a new instance every time I 
wanted to use it (which doesn't seem practical), or I could put it in 
class-side.
 The problem I have with class-side is that naming is more like going through 
minefield (more than once I corrupted my image by naming a method or variable 
something I shouldn't have), and for whatever reason it feels like either 
metaprogramming or procedural programmming... That class side methods are 
pretty much global functions/variables... and short of constructors I am 
avoiding static methods even in other languages... but maybe using it is ok. Or 
maybe have it object an use singleton?

The only oop-like approach I see would be to extend symbols (#top 
oppositeSide), or have separate objects for sides, but that seems like overkill.

MySide subclass: #Top

Top>>oppositeSide
^ Bottom new

Are there any best practices regarding this? This is also true for actual data 
stored in methods/attributes (such as icons).

P.s.: For english natives... Should the second method be ned "oppositeSideOf:" 
or "oppositeSideFor:"?

Any ideas/pointers appreciated,
Peter

Re: [Pharo-users] [Moose-dev] Re: Script of the day

2015-07-30 Thread Peter Uhnak
You should be able to specify all layouts available in roassal...

b layout tree.
b layout cluster.
b layout force.
...

Peter

-Original Message-
From: "H. Hirzel" 
Sent: ‎7/‎30/‎2015 8:40 PM
To: "Moose-related development" ; 
"pharo-users@lists.pharo.org" 
Subject: Re: [Pharo-users] [Moose-dev] Re:  Script of the day

Is it possible to use a tree map?

--Hannes

On 7/30/15, Alexandre Bergel  wrote:
> I gave a try, and I did not find anything weird.
> I guess your document folder contains many files, as Doru said
>
> Alexandre
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel  http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>
>> On Jul 30, 2015, at 5:51 AM, Dimitris Chloupis 
>> wrote:
>>
>> Frankly I dont mind big images or big data , neither I share the obsession
>> to shrink things down to few mbs in a time that we are talking in TBs .
>>
>> Anyway you asked for the image and this is a link to it
>>
>> https://www.dropbox.com/s/wh1071xgoo54fq7/1%20Ephestos%2027-05-15.zip?dl=0
>> 
>>
>> I dont think you will find anything abnormal about it though.
>>
>> I was wondering whether it would worth the effort beyond the unit tests
>> that check for behaviour of the code to have also benchmark tests that
>> will have to pass specific standards so that specific method must perform
>> under a strict timetable specific tasks, this way CI may alert not only
>> unit tests that fail but also benchmarks that fail , automagically.
>>
>> Maybe some food for thought.
>>
>> Personally I am far more worried how much CPU Pharo consumes than how much
>> RAM.
>>
>> On Wed, Jul 29, 2015 at 11:54 PM Peter Uhnák > > wrote:
>> Not sure if there is any downside (I've been using it for a long time
>> without problems), but image cleanup often does wonders for me.
>>
>> Moose image
>> 410 MB => cleanup (World -> System -> Do Image Cleanup) => save =>  237
>> MB
>> and I even had situations where it went from ~600 MB to ~60 MB.
>> (As to why my images are so massive... right now there are 19 windows
>> opened inside most of them with opened roassal visualization... and I am
>> saving like every five minutes... but that is just a guess.)
>>
>> But image cleanup is supposed to break things, so better to backup the
>> folder first.
>> Plus is cache really necessary? I mean it's a cache. .image + .changes
>> should usually suffice.
>>
>> Peter
>>
>> On Wed, Jul 29, 2015 at 10:45 PM, Dimitris Chloupis > > wrote:
>> Tudor I dont know if you received my message but I already answered that
>> with this:
>>
>> "ah ok then its normal. Yes the structure is extensive, its 13 folders
>> (the rest 71 are files some of them very big), I would not be surprised if
>> each contains 100 files in its own subfolders."
>>
>>
>>
>> On Wed, Jul 29, 2015 at 11:30 PM Tudor Girba > > wrote:
>> Hi,
>>
>> But, do you confirm that you have many files under the mentioned folder?
>>
>> Cheers,
>> Doru
>>
>>
>>
>> On Wed, Jul 29, 2015 at 10:25 PM, Dimitris Chloupis > > wrote:
>> the image is 180 mb, changes are another 15, there are several other
>> folders that raise the total size to 250 mb, monticello-cache and
>> github-cache prodominately.
>>
>> Hmm ok my bad, the size of the zip is 89 MB not 200 mb. Still will take me
>> 1-2 hours to upload on this connection. So if you guys still need the
>> image i can upload tommorow from work, though it seems my slow down is
>> normal.
>>
>> Afterall I am sure you can test it yourselves on complex file structures
>> to see if it has delays as long as 20 minutes.
>>
>>
>>
>> On Wed, Jul 29, 2015 at 11:01 PM Sven Van Caekenberghe > > wrote:
>>
>> > On 29 Jul 2015, at 21:33, Dimitris Chloupis > > > wrote:
>> >
>> > well i can send you the image tommorow because its huge (200 MB ziped)
>> > for my pathetically slow internet connection at home. I will send it
>> > from work which is 8 times faster.
>>
>> If the image is 200 MB zipped, how large is it in its normal state ?
>>
>> For me, a 100 MB image file is already quite large, that would compress to
>> maybe 20/30 MB.
>>
>> This doesn't sound right to me, unless you explicitly tried to store a lot
>> of data.
>>
>> Maybe something else is wrong that would explain the slowness.
>>
>> > I can tell you that I am on MacOS Yosemite , I get my image with
>> > pharolauncher, the image was dowloaded at 27-07-15 some of the 84 items
>> > are folders that contain many sub folders. No idea if that matters.
>> >
>> > I got Roassal 2 using the Package Browser in Pharo 5 (the new
>> > configuration browser).
>> >
>> > On Wed, Jul 29, 2015 at 8:17 PM Alexandre Bergel
>> > mailto:alexandre.ber...@me.com>> wrote:
>> > Are you using windows? I know it may has problems regarding the source
>> > 

Re: [Pharo-users] interview on .Net Rocks! about Moose, humaneassessment, Pharo and GT

2015-07-30 Thread Peter Uhnak
Thank you, I've really enjoyed it!

Peter

-Original Message-
From: "Tudor Girba" 
Sent: ‎7/‎30/‎2015 9:35 PM
To: "moose-dev" ; "Discusses Development of Pharo" 
; "Any question about pharo is welcome" 

Subject: [Pharo-users] interview on .Net Rocks! about Moose, humaneassessment, 
Pharo and GT

Hi,


I had the pleasure of giving an interview for the .Net Rocks! podcast. It was 
quite fun and I managed to mention Moose, humane assessment, Pharo and GT in 45 
minutes. It was not as smooth as a presentation but I still think it's a useful 
advertisement.


Let me know what you think, and feel free to promote it further:


https://dotnetrocks.com/default.aspx?showNum=1172

http://www.tudorgirba.com/blog/dotnetrocks-interview-moose-humane-assessment-pharo-gt-2015


Cheers,
Doru



-- 

www.tudorgirba.com


"Every thing has its own flow"

[Pharo-users] Custom type inference and RoelTyper

2015-09-30 Thread Peter Uhnak
Hi,

Moose/FAMIX uses RoelTyper for type inference, how this does not seem to be 
maintained (last version 2013), and for my purposes is lacking.

So do we have something more advanced, even at the expense of speed?

Other alternative would be to either extend RoelTyper or write something custom 
that would be ran alongside RoelTyper.

Examples of such extensions would be extracting the type from meta-annotations 
and the actual argument names. (e.g. if an argument is named aString, I can 
safely assume that it will be String).

Thanks,
Peter 

[Pharo-users] Code completion in comment pane and Pillar

2015-09-30 Thread Peter Uhnak
Hi,

Some time ago I ran into a problem with typing left brackets into comment pane.

As you know, code blocks in Pillar are marked with
[[[

However comment pane is subject to regular code completion of NECController, 
which means that every time I type '[' NEC converts it into '[ ]'. So if I type 
'[[[' then I get '[ [ [ ] ] ]'. Which is good in code, but not here.

Now considering we are pushing for Pillar in comments I think this should be 
resolved. However I don't know how.

a) disable code completion for comments (trivial, but loosing CC
b) subclass NECController to disable this. This is probably lot more complex, 
because the current one is hard-wired via Smalltalk tools
c) add configuration option to NECControler so it can run in different modes 
(still a lot of work)

d) add setting to options to disable/enable CC in comments  and let users 
decide.

d) other better, faster, easier solution?

>From future perspective b) could be used to provide more extensive code 
>completion, specifically for Pillar.

Thanks,
Peter 

Re: [Pharo-users] Custom type inference and RoelTyper

2015-09-30 Thread Peter Uhnak
Good to hear!

Do you have any time estimation (days/weeks)? Also I don't mind looking at 
something incomplete (after all I learned roassal just from source code ;))

Thanks,
Peter

-Original Message-
From: "Tudor Girba" 
Sent: ‎9/‎30/‎2015 9:43 PM
To: "Any question about pharo is welcome" 
Cc: "Moose-related development" 
Subject: Re: [Pharo-users] Custom type inference and RoelTyper

Great news :)


Doru


On Wed, Sep 30, 2015 at 9:31 PM, Alexandre Bergel  
wrote:

Hi Peter!

I am currently working on gradual typing for Pharo.
I hope to have something ready for public consumption soon...

Alexandre



> On Sep 30, 2015, at 8:28 PM, Peter Uhnak  wrote:
>
> Hi,
>
> Moose/FAMIX uses RoelTyper for type inference, how this does not seem to be 
> maintained (last version 2013), and for my purposes is lacking.
>
> So do we have something more advanced, even at the expense of speed?
>
> Other alternative would be to either extend RoelTyper or write something 
> custom that would be ran alongside RoelTyper.
>
> Examples of such extensions would be extracting the type from 
> meta-annotations and the actual argument names. (e.g. if an argument is named 
> aString, I can safely assume that it will be String).
>
> Thanks,
> Peter


--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.










-- 

www.tudorgirba.com


"Every thing has its own flow"

Re: [Pharo-users] Pillar for 30 gone the way of the dodo on the CI

2015-10-01 Thread Peter Uhnak
In Jenkins you specify configuration matrix (versions of pharo versus type 
(development, stable, ...)).. So it will run development for all versions, even 
pharo 30 (which is now permanently broken)

-Original Message-
From: "Stephan Eggermont" 
Sent: ‎10/‎1/‎2015 9:47 AM
To: "pharo-users@lists.pharo.org" 
Subject: Re: [Pharo-users] Pillar for 30 gone the way of the dodo on the CI

On 01-10-15 09:41, Stephan Eggermont wrote:
> On 30-09-15 19:57, Ferlicot D. Cyril wrote:
>
>> We removed the Pillar job for Pharo 3 because we introduced an new
>> feature not backward compatible.
>
> Why is that a reason to remove the build? You have a configuration,
> don't you?

I would suggest: move to a separate job that is run much less often
and doesn't keep so many old artifacts. That makes it easier to get old 
stuff running again.

Stephan





Re: [Pharo-users] Basic versioning of GitHub repositories from within Pharo

2015-11-23 Thread Peter Uhnak
On Mon, Nov 23, 2015 at 04:25:28PM +0100, Skip Lentz wrote:
> Hi everyone,
> 
> As part of my internship I am creating bindings to the GitHub API in Pharo.
> As a prototype and demo, I have created a small tool last week to do some 
> basic versioning, namely checking out a version, committing a version and 
> showing a log of commits along with a branch tree.
> 
> Here’s a screenshot: http://i.imgur.com/iMfWOvp.png 
> 
> 
> The repository of the bindings and the tool is here: 
> http://smalltalkhub.com/#!/~Balletie/GitHub
> To load the tool into your image, execute:
> 
> (ConfigurationOfGitHub project version: #development) load: #tool
> 
> Keep in mind that this is tied to GitHub, since internally it uses the API. A 
> nice side effect of this is that everything can be done in-memory.

Do you have any plans to eventually make a "Git Tool" out of it, rather
than GitHub Tool?

Why is it tied to GitHub in the first place? Are you planning to support
some github-specific features like issue tracker, etc? Because not being
able to have git repo localy is actually a hindrance and not a "nice
side effect" (unless of course you are using git as monticello).

Peter



[Pharo-users] piping output from shell process to transcript

2015-11-23 Thread Peter Uhnak
Hi,

how can I pipe output from PipeableOSProcess to Transcript?

I tried doing:

(PipeableOSProcess command: 'my-command.sh') outputOn: Transcript.

However `#outputOn:` doesn't send `#endEntry` so I don't see anything,
and even if it would, the output is delivered there at the end anyway.

I would like to see the live result of the running commands.

Thanks,

-- 
Peter



Re: [Pharo-users] piping output from shell process to transcript

2015-11-24 Thread Peter Uhnak
On 11/23, john pfersich wrote:
> Try this:
> 
> | p |
> p:= (PipeableOSProcess waitForCommand: 'whoami').
> Transcript show: (p output).

This will not do, as I said, I need live result. `#output` will output
it only after the process has completed.

> 
> 
> 
> On Mon, Nov 23, 2015 at 6:42 PM, Peter Uhnak  wrote:
> 
> > Hi,
> >
> > how can I pipe output from PipeableOSProcess to Transcript?
> >
> > I tried doing:
> >
> > (PipeableOSProcess command: 'my-command.sh') outputOn: Transcript.
> >
> > However `#outputOn:` doesn't send `#endEntry` so I don't see anything,
> > and even if it would, the output is delivered there at the end anyway.
> >
> > I would like to see the live result of the running commands.
> >
> > Thanks,
> >
> > --
> > Peter
> >
> >

-- 
Peter



[Pharo-users] Pillar tables with multiline cells

2015-11-24 Thread Peter Uhnak
Hi,

is it possible to have table with multiline cells in Pillar?

For example in markdown I can embed a piece of HTML, unfortunately
Pillar requires {{{html: to start at a new line which doesn't work with
tables.

Is there another solution?

Thanks,


-- 
Peter



Re: [Pharo-users] Pillar tables with multiline cells

2015-11-24 Thread Peter Uhnak
On 11/24, Peter Uhnak wrote:
> Hi,
> 
> is it possible to have table with multiline cells in Pillar?
> 
> For example in markdown I can embed a piece of HTML, unfortunately
> Pillar requires {{{html: to start at a new line which doesn't work with
> tables.

Or I can use  instead of pillar syntax... problem solved. :)


> 
> Is there another solution?
> 
> Thanks,
> 
> 
> -- 
> Peter

-- 
Peter



[Pharo-users] graph library in Pharo

2015-11-29 Thread Peter Uhnak
Hi,

is there any graph library for pharo with algorithms for planarity
testing, spanning trees, flow costs, etc.?

Thanks,
-- 
Peter



Re: [Pharo-users] How I can tell to a startup script to target specific images

2015-12-02 Thread Peter Uhnak
On 12/02, Dimitris Chloupis wrote:
> I have a startup script that loads the libraries and project I mostly use,
> including my own, but I want that script to target specific folders and its
> subfolders , is this possible ?

You can test values of `SmalltalkImage current`...

for example

(SmalltalkImage current shortImageName includesSubstring: 
'SomePartOfImageName') ifTrue: [
"execute only for that image"
]

for folders you could check `SmalltalkImage current imagePath`, etc.

-- 
Peter



[Pharo-users] About GTSpotter matching

2015-12-05 Thread Peter Uhnak
Hi,

are there some wildcards in GTSpotter matching?

Currently it searches anywhere in the (method) name, which makes it hard
for shorter names, because it will match a lot of junk.

I've also discovered (by accident), that I can use '>>#selector' to
anchor the start of the selection. ('#selector' for some reason doesn't
work).
But I would like to also search by a simple ? (any character), * (any
characters) wildcard. Is that possible?

Additionally constraining it from the end would be also nice.
For example I want to look through #default methods, however 90% of the
matches will be junk, so I would like to write '#default$' and it will
not match '#defaultIcon', etc.

Is this possible?

Thanks,
-- 
Peter



[Pharo-users] OrderedSet?

2015-12-05 Thread Peter Uhnak
Hi,

what would be the equivalent of an OrderedSet?

1. all elements are unique

2. they are ordered

3. adding an existing element moves it
so
myOrderedSet addLast: x. "<- x is added as last"
myOrderedSet addFirst: x. "<- x is moved from last to first"

Thanks,

-- 
Peter



Re: [Pharo-users] where is save export setting file

2015-12-06 Thread Peter Uhnak
On 12/06, Hilaire wrote:
> Hello
> 
> Where export setting save the prefrence in the host file system, on Linux.

Linux config is normally in '~/.config/pharo/'

> 
> I am stuck with it and need to delete it
> 
> Thanks
> 
> Hilaire
> 
> -- 
> Dr. Geo
> http://drgeo.eu
> http://google.com/+DrgeoEu
> 
> 
> 

-- 
Peter



Re: [Pharo-users] About GTSpotter matching

2015-12-07 Thread Peter Uhnak
On 12/07, Juraj Kubelka wrote:
> Hi,
> 
> # is a category filter. Try #class, #instance, etc.

Oh... right. I've been using this for long time, my brain just didn't
connect the dots.

In either case, once you dive in the category filter is no longer
applicable.
So normally I would do "#i selector", then dive in, and then filter it.

> Then I have learnt that people are not aware of [...] any other kind of 
> wild-characters.

People don't know what wild-chars are? I would understand that someone
might be uncomfortable with regexps, because there are many variations, but 
wildchars...

> 
> > On Dec 5, 2015, at 20:40, Peter Uhnak  wrote:
> > 
> > Hi,
> > 
> > are there some wildcards in GTSpotter matching?
> > 
> > Currently it searches anywhere in the (method) name, which makes it hard
> > for shorter names, because it will match a lot of junk.
> > 
> > I've also discovered (by accident), that I can use '>>#selector' to
> > anchor the start of the selection. ('#selector' for some reason doesn't
> > work).
> > But I would like to also search by a simple ? (any character), * (any
> > characters) wildcard. Is that possible?
> > 
> > Additionally constraining it from the end would be also nice.
> > For example I want to look through #default methods, however 90% of the
> > matches will be junk, so I would like to write '#default$' and it will
> > not match '#defaultIcon', etc.
> > 
> > Is this possible?
> > 
> > Thanks,
> > -- 
> > Peter
> > 
> 
> 

-- 
Peter



Re: [Pharo-users] Roassal Performance Issues when applying layout

2015-12-07 Thread Peter Uhnak
On 12/07, Alejandro Infante wrote:
> Hi,
> It is really difficult to help you just with a profile and without looking at 
> your code.
> Even though, I have noticed that most of the time is used on calculating 
> properties related to CompositeShapes (like position and encompassing 
> rectangle).
> 
> Would be possible for you to run the same code but replacing the 
> CompositeShape by another less complex shape (like RTBox)?
> If this new experiment is fast, then the problem would be those 2 properties 
> (position and encompassing rectangle) are too expensive, and therefore we 
> should think how to optimize that code.
> 
> I know that ForceLayout is not the fastest layout, but 59 seconds is too much 
> for just 13 elements.

The complexity should be nlog(n) per iteration.
For such small diagram this should be pretty much instant.

However from the profiler I can see that a _lot_ of time is spent in
calculating the label size, which definitely shouldn't be this slow...

If you want to look at the other layouts, look at this
https://dl.dropboxusercontent.com/u/31543901/AgileVisualization/Layout/0106-Layout.html

> 
> Cheers,
> Alejandro
> 
> > On Dec 7, 2015, at 5:26 PM, Pablo Polanco  wrote:
> > 
> > Hello, we are Pablo Polanco and Jorge Ampuero and we are Computer Science 
> > students at Universidad de Chile.
> > 
> > We are currently taking a course on Robotics Software Engineering dictated 
> > by Johan Fabry.
> > 
> > We want to visualize a simple directed graph and we are experiencing 
> > performance issues when layouting our visualization in Roassal.
> > 
> > We provide the report from the Time Profiler when we visualize 13 elements 
> > and 38 edges: http://pastebin.com/zsh8YFPx 
> > 
> > Should it take so much time? How could we improve it? Is there another more 
> > appropriate layout?
> > 
> > Thanks in advance :)
> > 
> > 
> > ​
> 

-- 
Peter



[Pharo-users] code coverage tools

2015-12-09 Thread Peter Uhnak
Hi,

do we have any code coverage tools?

-- 
Peter



Re: [Pharo-users] code coverage tools

2015-12-09 Thread Peter Uhnak
On 12/09, p...@highoctane.be wrote:
> I came across this:
> 
> http://objectprofile.com/Hapao.html

This looks great!

Thanks
> 
> but never used or even digged into.
> 
> Phil
> 
> On Wed, Dec 9, 2015 at 9:25 AM, Peter Uhnak  wrote:
> 
> > Hi,
> >
> > do we have any code coverage tools?
> >
> > --
> > Peter
> >
> >
> >

-- 
Peter



Re: [Pharo-users] How to detect wheter the computer is connected to the internet ?

2015-12-13 Thread Peter Uhnak
On 12/14, Sven Van Caekenberghe wrote:
> Hi Dimitris,
> 
> > On 14 Dec 2015, at 07:02, Dimitris Chloupis  wrote:
> > 
> > Hey guys I try to make a way to detect whether my project is up to date and 
> > if not to update it from the github repo automagically. This part works 
> > fine , but I will also like to first detect whether the computer has an 
> > internet connection so to avoid unnecessary errors and checks .
> > 
> > Is that possible ?  
> 
> Just try accessing a well know, always available host with a short timeout ?
> 
> [ ZnClient new beOneShot; timeout: 2; get: 'http://www.google.com'; isSuccess 
> ] on: Error do: [ false ]
> 

You should try to contact github, not google, since that's what you care
about. After all github can be down sometimes so it would fail even with
internet connection.

Peter



Re: [Pharo-users] Keymapping, shift vs non-shift

2015-12-14 Thread Peter Uhnak
On 12/14, Guillermo Polito wrote:
> 
> > On 14 dic 2015, at 11:23 a.m., Nicolai Hess  wrote:
> > 
> > 
> > 
> > 2015-12-14 11:16 GMT+01:00 Stephan Eggermont  > >:
> > On my keyboard I have '+' in two positions: once over the '=' in the 
> > alphanumeric part,and once as a separate key on the numeric part.
> > When I do a
> > 
> > self bindKeyCombination: $+ command mac | $+ ctrl win | $+ ctrl unix
> >   toAction: [ self increaseFontSize ].
> > 
> > that only works for the numeric '+'.
> > Is that supposed to be the case? The problem is that it forces me to know 
> > about the keyboard layout to define shortcuts.
> 
> 
> So you mean that in order to make + in your +/= key you must press shift? And 
> then (ctrl +) does not match (ctrl shift +)?
> 
> Then I’d say it is a bug/unimplemented feature...
> 
> Hmm, maybe shift only has to work as a modifier for alphanumeric characters...
> 
> > 
> > I stumbled across this too, I don't think it is supposed to work that way.
> >  
> > 
> > Stephan
> > 
> > 
> > 
> > 
> 

How is this a bug? The only + key that you can press with just ctrl is
the numeric one, otherwise it would clash with "$= ctrl".

But since that's how most applications behave, I would propose to
actually use "$= ctrl" for zooming in.

-- 
Peter



Re: [Pharo-users] adding credentials to a repo via a playgroundscript

2016-03-06 Thread Peter Uhnak
I use QuickAccess to store these things ( 
http://forum.world.st/ANN-QuickAccess-for-Pharo-5-td4859265.html ) but I still 
have to figure out a good way to keep it in sync across images. QuickAccess 
gets autoloaded from a startup script.

Peter

-Original Message-
From: "stepharo" 
Sent: ‎3/‎6/‎2016 9:26 AM
To: "Any question about pharo is welcome" 
Subject: Re: [Pharo-users] adding credentials to a repo via a playgroundscript

Hi sean

where is your tool :).

Stef

Le 5/3/16 18:37, Sean P. DeNigris a écrit :
> Peter Uhnák wrote
>> repo
>> user: 'peteruhnak';
>> password: '**'
>> ... has no effect.
> Hmm, I wonder if something changed in 5.0. I do this all the time. In fact I
> wrote a small tool that picks up the credentials from a config file so I can
> invoke it from the World menu
>
>
>
> -
> Cheers,
> Sean
> --
> View this message in context: 
> http://forum.world.st/adding-credentials-to-a-repo-via-a-playground-script-tp4882668p4882713.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>
>




[Pharo-users] Installing a metalink on a subclass not overriding a method

2016-03-26 Thread Peter Uhnak
Imagine the following:

I have a class ‘Parent’ which has the following method

Parent>>name: aString
name := aString

I also have a subclass of a Parent called Child.
Now I would like to attach some behavior via MetaLinks for the method ‘name:’ 
but only for the Child method, is that possible?

Naturally I could just override the method and have
Child>>name: aString
super name: aString

And then attach the metalink to that, but that’s not nice because you have to 
create extra methods (which is extra work/code if Parent has more subclasses)

Alternatively I could attach the MetaLink to Parent and do type-checking, but 
that would br very complex and error-prone (Parent has a rather wild family).

Ideally I would like for the MetaLink to install to the child even though the 
method doesn't exist. Is that somehow possible?

Thanks,
Peter



[Pharo-users] library for comparing semver versions

2016-05-27 Thread Peter Uhnak
Hi,

is there any library available that can compare versions according to
SemVer? http://semver.org/

Thanks,
Peter



Re: [Pharo-users] Saving to local git and "Loading all file names from http://...pharo5/inbox"

2016-05-29 Thread Peter Uhnak
On Sat, May 28, 2016 at 10:48:47PM +0200, Holger Freyther wrote:
> Hi,
> 
> every time I save a local package using gitfiletree:// it tries to download 
> from the pharo5 inbox. Is this to be expected? I do not have the inbox 
> associated with that package though? Can the version number resolving be 
> changed?

For some reason the package manager is refreshing all packages. I don't know 
why it happens, and it's quite annoying (because it slows down commits), but it 
doesn't cause any actual problems, so don't worry about it too much.

Peter

> 
> kind regards
>   holger



Re: [Pharo-users] Saving to local git and "Loading all file names from http://...pharo5/inbox"

2016-05-29 Thread Peter Uhnak
On Sun, May 29, 2016 at 11:21:21AM +0200, Thierry Goubier wrote:
> Le 29/05/2016 11:15, Peter Uhnák a écrit :
> >  > All this is so that my .5 would not conflict with someone else .5
> > 
> > How is this a problem? Because it will be "Me.5" and "You.5", so there
> > can't be any conflict.
> 
> Me.5 and Me.5 are possible...
> 
> Think of numbering your own stuff on two different branches.
> 
> More, Metacello depends on Me.5 5 to be greater than You.5 5 for some of the
> baselines / configurations to work properly :)

Can't it use the ancestry to decide?

Because my impression is from this that merges are naive, compared to
git which actually checks the ancestry of both up the common endpoint
and diffs based on that.

Peter

> 
> Thierry
> 
> > 
> > Peter
> > 
> > On Sun, May 29, 2016 at 10:37 AM, Sven Van Caekenberghe  > > wrote:
> > 
> > 
> > > On 29 May 2016, at 10:28, Holger Freyther  > > wrote:
> > >
> > >
> > >> On 29 May 2016, at 09:58, Sven Van Caekenberghe  > > wrote:
> > >>
> > >>
> > >>>
> > >>> For some reason the package manager is refreshing all packages. I 
> > don't know why it happens, and it's quite annoying (because it slows down 
> > commits), but it doesn't cause any actual problems, so don't worry about it 
> > too much.
> > >>
> > >> As I understand it, what happens is the following: before you commit 
> > to your MC repo, you have to find the next version number; a check is then 
> > done in all relevant repos; the cached content is not used, but an actual 
> > refresh is done. All this is so that my .5 would not conflict with someone 
> > else .5 - the chance that this happens is very small, and the check does 
> > not really prevent it.
> > >
> > > I assumed that but can it be limited to the Repositories that are 
> > associated with the package? I am afraid that next time I travel I can not 
> > commit to my local repository (and ofcourse the speed part). :)
> > 
> > We should go one step further: add an option to totally disable this
> > check to go outside the target repo, it makes little sense. But MC
> > is a complex beast ...
> > 
> >  > holger
> > 
> > 
> > 
> 
> 



Re: [Pharo-users] Saving to local git and "Loading all file names from http://...pharo5/inbox"

2016-05-30 Thread Peter Uhnak
I don't see anything actionable in this thread.
What can we do to move this forward? Is it only up to Dale to change the
behavior?

Can we have some workaround? E.g. syncing in the background at regular
intervals so when I want to commit I am not blocked by it?

Because it doesn't always check the repos, and I don't see what is the
actual trigger.

Peter

On Sun, May 29, 2016 at 02:28:48PM +0200, Thierry Goubier wrote:
> Le 29/05/2016 14:04, Peter Uhnak a écrit :
> > On Sun, May 29, 2016 at 11:21:21AM +0200, Thierry Goubier wrote:
> > > Le 29/05/2016 11:15, Peter Uhnák a écrit :
> > > >   > All this is so that my .5 would not conflict with someone else .5
> > > > 
> > > > How is this a problem? Because it will be "Me.5" and "You.5", so there
> > > > can't be any conflict.
> > > 
> > > Me.5 and Me.5 are possible...
> > > 
> > > Think of numbering your own stuff on two different branches.
> > > 
> > > More, Metacello depends on Me.5 5 to be greater than You.5 5 for some of 
> > > the
> > > baselines / configurations to work properly :)
> > 
> > Can't it use the ancestry to decide?
> 
> I suggested that to Dale... Disregard version numbers, only consider as
> newer if the other is in the ancestry chain.
> 
> Would also be a lot more precise, because we would then use the package
> version UID instead of the name.version number approximation which can leads
> to failures or loading the wrong package in some cases.
> 
> > Because my impression is from this that merges are naive, compared to
> > git which actually checks the ancestry of both up the common endpoint
> > and diffs based on that.
> 
> This does not describe the Monticello merges. Monticello merges do walk the
> ancestry chain to find a common ancestor and does a three way merge, as git
> does.
> 
> The problem is that the Monticello ancestry chain is often damaged for three
> reasons: removing part of it to reduce memory usage (Done for the Pharo3
> release), removing all or part of it because your package ancestry chain is
> too long (I remember seeing some packages doing that on purpose?), the
> common ancestor doesn't exist anymore in the repositories visible to
> Monticello (long-lived packages that have moved between repositories,
> typically).
> 
> When Monticello sees a version in the history, it expects the full package
> to be available in the repositories; if this package is the common ancestor
> of the merge and can't be retrieved, then the merge will fail.
> 
> What GitFileTree/git does there is to ensure that if a version is in the
> ancestry, it can be retrieved. Git merge also use that property. Any
> GitFileTree-like layer would provide the same property (FossilFileTree, for
> example).
> 
> Note: in the git documentation, it is stated that git may create virtual
> ancestors in some cases, to simplify/reduce the merge work. In such cases,
> if set up, the gitfiletree merge driver will be called for all those merges
> (i.e. a single merge in git may trigger multiple merges).
> 
> Obvious, isn't it ;)
> 
> Thierry
> 
> > Peter
> > 
> > > 
> > > Thierry
> > > 
> > > > 
> > > > Peter
> > > > 
> > > > On Sun, May 29, 2016 at 10:37 AM, Sven Van Caekenberghe  > > > <mailto:s...@stfx.eu>> wrote:
> > > > 
> > > > 
> > > >  > On 29 May 2016, at 10:28, Holger Freyther  > > > <mailto:hol...@freyther.de>> wrote:
> > > >  >
> > > >  >
> > > >  >> On 29 May 2016, at 09:58, Sven Van Caekenberghe  > > > <mailto:s...@stfx.eu>> wrote:
> > > >  >>
> > > >  >>
> > > >  >>>
> > > >  >>> For some reason the package manager is refreshing all 
> > > > packages. I don't know why it happens, and it's quite annoying (because 
> > > > it slows down commits), but it doesn't cause any actual problems, so 
> > > > don't worry about it too much.
> > > >  >>
> > > >  >> As I understand it, what happens is the following: before you 
> > > > commit to your MC repo, you have to find the next version number; a 
> > > > check is then done in all relevant repos; the cached content is not 
> > > > used, but an actual refresh is done. All this is so that my .5 would 
> > > > not conflict with someone else .5 - the chance that this happens is 
> > > > very small, and the check does not really prevent it.
> > > >  >
> > > >  > I assumed that but can it be limited to the Repositories that 
> > > > are associated with the package? I am afraid that next time I travel I 
> > > > can not commit to my local repository (and ofcourse the speed part). :)
> > > > 
> > > >  We should go one step further: add an option to totally disable 
> > > > this
> > > >  check to go outside the target repo, it makes little sense. But MC
> > > >  is a complex beast ...
> > > > 
> > > >   > holger
> > > > 
> > > > 
> > > > 
> > > 
> > > 
> > 
> > 
> 
> 



Re: [Pharo-users] What should I name my nested packages?

2016-05-30 Thread Peter Uhnak
Hi,

are you referring to tags?

If you right-click a package, you see options such as "Add tag...", "Promote as 
package", "Demote to package with tag".

Peter


On Mon, May 30, 2016 at 02:10:38PM -0400, Evan Donahue wrote:
> Hello,
> 
> Just a quick question as I work on refactoring and cleaning up a project
> I've been working on. I notice that packages like Fuel appear in nice,
> nested hierarchies in my code browser, with 'Core' nested under 'Fuel' even
> though 'Core's package name is actually Fuel-Core. I'm wondering what I
> have to do to get my own packages to nest similarly in the code browser
> beyond just naming them accordingly.
> 
> Thank you,
> Evan



Re: [Pharo-users] Saving to local git and "Loading all file names from http://...pharo5/inbox"

2016-06-03 Thread Peter Uhnak
On Wed, Jun 01, 2016 at 10:28:12PM -0700, Dale Henrichs wrote:
> 
> FWIW, I've found that if I manually flush the cache for each package before
> I save it, I don't have to wait the minute or so for all of the repos to be
> refreshed ...
> 

How can I do that?

Peter



Re: [Pharo-users] problem getting moose

2016-06-05 Thread Peter Uhnak
On Sun, Jun 05, 2016 at 04:13:16PM +0800, Ben Coman wrote:
> Final thing...
> after loading, the following packages are dirty...
>   AST-Core
> - removal of NumberParser>>#isNumber:
>   Collections-Abstract
> - but when checked ==> no changes
>   Famix-Core
> - but when checked ==> no changes
>  Rubric-Rules
> - but when checked ==> no changes
> 
> cheers -ben
> 

The CI actually does more than just loading Moose: 
https://ci.inria.fr/moose/job/moose-6.0/1759/console

But the best way to download is imho through Pharo Launcher (which downloads it 
from the CI)

~~~ CI SCRIPT ~~~
wget --quiet -O - http://get.pharo.org/50+vm | bash
./pharo Pharo.image save moose-6.0

REPO=http://www.smalltalkhub.com/mc/Moose/Moose/main

./pharo moose-6.0.image eval Gofer new smalltalkhubUser: 'Pharo' project: 
'Rubric'; package: 'ConfigurationOfRubric'; load. Gofer new smalltalkhubUser: 
'Moose' project: 'Glamour'; package: 'ConfigurationOfGlamourCore'; load. Gofer 
new smalltalkhubUser: 'Moose' project: 'GToolkit'; package: 
'ConfigurationOfGTInspector'; package: 'ConfigurationOfGTInspectorCore'; 
package: 'ConfigurationOfGTSpotter'; package: 'ConfigurationOfGTPlayground'; 
package: 'ConfigurationOfGTPlaygroundCore'; package: 'ConfigurationOfGToolkit'; 
package: 'ConfigurationOfGToolkitCore'; package: 
'ConfigurationOfGTEventRecorder'; load. Gofer new smalltalkhubUser: 'Moose' 
project: 'Moose'; package: 'ConfigurationOfMoose'; load. Smalltalk snapshot: 
true andQuit: true.

./pharo moose-6.0.image config http://www.smalltalkhub.com/mc/Moose/Moose/main 
ConfigurationOfGlamourCore --install=development
./pharo moose-6.0.image config http://www.smalltalkhub.com/mc/Moose/Moose/main 
ConfigurationOfMoose --install=development

./pharo moose-6.0.image eval Gofer new smalltalkhubUser: 'Moose' project: 
'GToolkit'; package: 'GT-InspectorExtensions-CoreRoassal'; unload; cleanup; 
load. Gofer new smalltalkhubUser: 'Moose' project: 'GToolkit'; package: 
'GT-SpotterExtensions-CoreRoassal'; unload; cleanup; load. Smalltalk snapshot: 
true andQuit: true.

./pharo moose-6.0.image mooseimagesetup 
--signature=https://ci.inria.fr/moose/job/moose-6.0/1759/
~~ /CI SCRIPT ~~~

Peter



[Pharo-users] synchronized return from asynchronous message block

2016-06-06 Thread Peter Uhnak
Hi,

is it possible to return "synchronously" even if I have an asynchronous message?

For example:

SomeObject>>someMethod
^ UIManager default chooseFrom: #(a b c)

When the above method is executed, it will open a popup and block the execution 
until I select something, then it will return the selection.

But if I instead have something like this

SomeObject>>otherMethod
|choice|
NewListModel new
items: #(a b c);
whenSelectedItemChanged: [ :item | choice := item ];
openDialogWithSpec.
choice.

Then it will open the window but it will immediately return nil.

So my question is: is it possible to synchronously return even in the second 
example / block the flow until a selection is made?

Thanks,
Peter



Re: [Pharo-users] OSProcess command - non responding image when calling often

2016-06-07 Thread Peter Uhnak
It's strange that I was using GitFileTree over OSProcess for a long time 
without issue and yet every time I tried to use OSProcess directly I had this 
locking up.



> So I am asking polite to the pharo developers team if there are plans to
> provide a stable solution for calling external programs as described.
> 
> My production system will be a windows system, so I need this for windows,
> too.
> As far as I understand, the new OSSubprocess is (currently) only for unix.

Yes, there's ProcessWrapper for Windows.

An alternative approach might be to use direct FFI calls, e.g.

MyClass class>>system:
system: command
"Perform OS system() call."

^ self ffiCall: #(int system #(char * command)) module: LibC

And then you can do MyClass system: 'cp a.pdf b.pdf'.

Although it still locks up my image from time to time… but at least order of 
magnite less.

Also if you are targeting Windows, I suggest to look at Torsten's 'OSWindows' 
project (available from the catalog browser).

Peter


> 
> It is no problem for me to wait some time for this.
> But it would be nice to know what the plans are, to decide what to do (and
> not programming something which will be solved in future).
> 
> Regards
> Sabine
> 
> 
> 
> 
> 2016-06-07 9:43 GMT+02:00 Thierry Goubier [via Smalltalk] <
> ml-node+s1294792n4899548...@n4.nabble.com>:
> 
> > Hi Sabine,
> >
> > which version of Pharo are you using? I had similar issues, and I managed
> > to reduce those occurrences to a reasonable level by changing the way I
> > called OSProcess (and a lot of help from Dave). I do have sometime lockups
> > with OSSubprocess as well, but those are also rare.
> >
> > (I do think this is a bug somewhere in the VM which makes it loose signals)
> >
> > The code I use is in GitFileTree: a low-level way of calling OSProcess
> > which seems good at minimizing lockups.
> >
> > Thierry
> >
> >
> >
> > 2016-06-07 9:31 GMT+02:00 Sabine Manaa <[hidden email]
> > >:
> >
> >> Hi,
> >>
> >> sorry but I have another issue with OSProcess.
> >>
> >> For my app, I want to show small .png previews from my .pdfs. For this
> >> reason, I use an external software, currently pdfbox. It works fine, but
> >> regularly, I get a hanging image. I tried to reproduce it and found out,
> >> that it is not a problem with pdfbox (http://pdfbox.apache.org), because
> >> from command line, I can call it often without problems. There can be
> >> (hopefully) many users in my app with many previews at one time. So I have
> >> to call it often.
> >>
> >> For reproduction of the OSProcess issue, I used another simple command
> >> (from
> >> my other OSProcess umlaut issue :-)) to test it.
> >>
> >> calling this, results in a non responding image:
> >>
> >> 20 timesRepeat: [OSProcess   command: ('cp
> >> /Library/WebServer/Documents/reports/bar.pdf
> >> /Library/WebServer/Documents/reports/test-c.pdf').].
> >>
> >> also this:
> >> 20 timesRepeat: [OSProcess   command: ('echo "Hi there"').]
> >>
> >> My original code is similar to this but here only for information:
> >> OSProcess
> >> command:
> >> ('{1} -jar {2} PDFToImage -format PNG -page 1
> >> -dpi 100 {3}'
> >> format:
> >> {'Library/Internet\
> >> Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java'.
> >>
> >> '/Users/sabine/Desktop/pdfbox-app-2.0.1.jar'.
> >>
> >>
> >> '/Library/WebServer/Documents/reports/201411121510-112859865-3378921/20150605_170_IFA_Berlin_Reisekostenabrechnung.pdf'}).
> >>
> >>
> >> So, my question is: is it wrong, calling OSProcess like this? How to do it
> >> instead?
> >>
> >> I am sorry to ask again and hope that there is a simple solution.
> >> Or is it a bug in OSProcess?
> >>
> >> Regards
> >> Sabine
> >>
> >>
> >>
> >>
> >> --
> >> View this message in context:
> >> http://forum.world.st/OSProcess-command-non-responding-image-when-calling-often-tp4899540.html
> >> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
> >>
> >>
> >
> >
> > --
> > If you reply to this email, your message will be added to the discussion
> > below:
> >
> > http://forum.world.st/OSProcess-command-non-responding-image-when-calling-often-tp4899540p4899548.html
> > To start a new topic under Pharo Smalltalk Users, email
> > ml-node+s1294792n1310670...@n4.nabble.com
> > To unsubscribe from Pharo Smalltalk Users, click here
> > 
> > .
> > NAML
> > 

Re: [Pharo-users] OSProcess command - non responding image when calling often

2016-06-07 Thread Peter Uhnak
On Tue, Jun 07, 2016 at 01:22:04PM +0200, Thierry Goubier wrote:
> 2016-06-07 11:47 GMT+02:00 Peter Uhnak :
> 
> > It's strange that I was using GitFileTree over OSProcess for a long time
> > without issue and yet every time I tried to use OSProcess directly I had
> > this locking up.
> >
> >
> Yes. This is a bit worrying; the low-level OSProcess call was a bit of a
> stopgap while waiting for either OSProcess or the vm to sort the underlying
> issue (which is more significant than just my use); that it locks up under
> normal use is not good and should be reported.
> 
> I allways considered GitFileTree to be a heavy hitter on OSProcess, running
> hundreds of external commands to load a complex project, so that if I would
> lock up, it wouldn't be a normal pattern of use.
> 
> 
> >
> > > So I am asking polite to the pharo developers team if there are plans to
> > > provide a stable solution for calling external programs as described.
> > >
> > > My production system will be a windows system, so I need this for
> > windows,
> > > too.
> > > As far as I understand, the new OSSubprocess is (currently) only for
> > unix.
> >
> > Yes, there's ProcessWrapper for Windows.
> >
> > An alternative approach might be to use direct FFI calls, e.g.
> >
> > MyClass class>>system:
> > system: command
> > "Perform OS system() call."
> >
> > ^ self ffiCall: #(int system #(char * command)) module: LibC
> >
> > And then you can do MyClass system: 'cp a.pdf b.pdf'.
> >
> > Although it still locks up my image from time to time… but at least order
> > of magnite less.
> >
> 
> Than GitFileTree or OSProcess? Still, you get lockups... which isn't good.

No, GitFileTree never locked up my image. This was always my use.

Peter



Re: [Pharo-users] Smalltalkhub & Squeaksource3

2016-06-15 Thread Peter Uhnak
On Wed, Jun 15, 2016 at 01:06:08PM -0400, Mark Bratcher wrote:
> A couple of easy ones:
> 
> 1) Does smalltalkhub.com support private projects (used, e.g., for CI)?
> I've seen a couple of posts on random forums dating back a couple of years
> indicating that it did, but when I went to create a project, I didn't see
> an option to make it private.

I don't know about sthub/ss3, but BitBucket offers free private projects, so 
you can use that.

Peter



[Pharo-users] accepting method without creating variable and code generation

2016-06-28 Thread Peter Uhnak
Hi,

is it possible to accept a method without creating instance variable?

E.g.

~~
Object subclass: #MyObject
slots: {  }
classVariables: {  }
category: 'Category'
~~

~~
MyObject>>addValue: aValue
container add: aValue
~~

Now normally when I would try to compile the method I would get the "Unknown 
variable 'container'" warning that will force me to either create temporary or 
instance variable; I would like to somehow ignore that, because the method will 
actually never get called.

My objective is use this method as a template for code generation, so I would 
then take this method, apply some code transformation and compile it into 
different object.

Of course I could do

~
MyObject>>addValueTemplate
^ 'MyObject>>addValue: aValue
container add: aValue'
~

But then I would lose code highlighting, which is quite error-prone for more 
complex snippets.

If you have a better approach, I am all ears. :)

Thanks,
Peter




Re: [Pharo-users] change which browser opens when browsing senders/implementors

2016-07-20 Thread Peter Uhnak
On Wed, Jul 20, 2016 at 03:00:01PM +0200, Denis Kudriashov wrote:
> It was like that in some Pharo version

Only shortly, because people preferred consistency over convenience, so it was 
changed back.
(Note that there is no correct answer here.)

Peter

> 
> 2016-07-20 2:45 GMT+02:00 Mariano Martinez Peck :
> 
> >
> >
> > On Tue, Jul 19, 2016 at 8:26 PM, PAUL DEBRUICKER 
> > wrote:
> >
> >> Which method should I change if when browsing senders/implementors there
> >> is only one sender or implementor I'd like the Nautilus browser to open?
> >>
> >>
> > +9
> >
> > I would also love this
> >
> >
> > --
> > Mariano
> > http://marianopeck.wordpress.com
> >



Re: [Pharo-users] Pharo and GIT

2016-07-25 Thread Peter Uhnak
Hi Juraj,

I've finally forced myself to finish a guide on using gitfiletree: 
https://www.peteruhnak.com/blog/2016/07/25/how-to-use-git-and-github-with-pharo/
 so hopefully it will be of some use to you.

Couple of notes:
* GitFileTree loaded from Catalog still doesn't work in Pharo 6, so use 
the script Thierry provided
* There's some pain associated with some operations (e.g. merging, 
loading), this will be addressed sooner or later by IceBerg, which is hopefully 
the future of git in Pharo ( https://github.com/npasserini/iceberg )

Peter

On Mon, Jul 25, 2016 at 11:47:24AM -0400, Juraj Kubelka wrote:
> Hi Alexandre,
> 
> I will first give a try. I think once the Pharo community moves to GitHub, it 
> will help to all. It could be painful, but SmalltalkHub is also painful and 
> we are loosing other opportunities that GitHub service offers. 
> 
> I agree that it could be painful. I am fine using external GIT tools. Even 
> for Java (or other) projects I use external GIT tools. The important is that 
> we can easily deploy projects and people can load it (,e.g., Catalog Browser).
> 
> Cheers,
> Juraj
> 
> > On Jul 25, 2016, at 09:14, Alexandre Bergel  wrote:
> > 
> > Hi Juraj,
> > 
> > Although I find very appealing to work with Git, it is still very painful. 
> > Some of the issues I feel right now: difficult of merging, checking for 
> > source code differences, there is unfortunately a difference between 
> > installing using Metacello and cloning a repository, … 
> > We can discuss it if you want (I am back in Chile).
> > 
> > Alexandre
> > 
> > 
> >> On Jul 25, 2016, at 8:41 AM, Juraj Kubelka  
> >> wrote:
> >> 
> >> Hi,
> >> 
> >> can you point me to a latest (best) way to use GitHub for Pharo projects 
> >> (Pharo 6)? 
> >> 
> >> Is the GitFileTree project the way to use it?
> >> 
> >> How does ConfigurationOf change?
> >> 
> >> Thanks!
> >> Juraj
> > 
> > -- 
> > _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> > Alexandre Bergel  http://www.bergel.eu
> > ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
> > 
> > 
> > 
> > 
> 
> 



Re: [Pharo-users] Pharo and GIT

2016-07-25 Thread Peter Uhnak
On Mon, Jul 25, 2016 at 10:49:41PM +0200, Nicolas Passerini wrote:
> On Mon, Jul 25, 2016 at 7:28 PM, Peter Uhnak  wrote:
> 
> > IceBerg, which is hopefully the future of git in Pharo (
> > https://github.com/npasserini/iceberg )
> >
> 
> Well, I hope so :)
> 
> Iceberg is under development, but beta testers and feedback are welcome. I
> will be happy to help you if you intend to adopt it.

Well I wasn't sure if I should be reporting things now (because obviously it's 
incomplete), and I saw 58 issues on github, so didn't want to add more.

But if you want some feedback :)
* (confusing) The colors of the working copy / local repo should be 
switched, because now it's showing me new code in red, and removed code in 
green, which is confusing
* (really minor) Opening the synchronizing window by double clicking on 
the repository (instead of clicking on the button) will open it four times
* (docs) from readme file it's not clear whether I have to run the 
update command; running it will brick the installation
* (yay!) I am really happy I can use it side-by-side with gitfiletree 
so I always have a fallback option
* (unsure) I wasn't sure from the docs / experiments whether I can 
point it to local clone, or always have to use github

I am really looking forward to this project, and I am slowly starting to use it 
for some smaller projects, so more feedback will certainly come. :)

Thanks!

Peter



Re: [Pharo-users] Pharo and GIT

2016-07-25 Thread Peter Uhnak
On Mon, Jul 25, 2016 at 06:33:48PM -0400, Sean Glazier wrote:
> Thank you, Peter for documenting that :-). While I think git tools are OK,
> my opinion though is that Smalltalk hub should be moved forward as well.

While SmalltalkHub works for code storage, it is also just that, a storage.
Trying to run a service competing with the likes of GitHub, Bitbucket, or 
GitLab is frankly waste of resources that could be better invested into things 
that are relevant for the mission of Pharo.

> I git you are working with files and text and it does not have the notion of 
> classes and methods and
> the value of being able to see the history of the class / methods.

I've seen this argument many times and yet it is completely false.
You can actually retrieve the history of a single method even for languages 
that truly do use just files (C, ruby, …), although a fair bit of scripting 
would be required, but the history is there.
The used FileTree format that writes each method to a file makes this much more 
simpler.

> thing like renames and in cincom namespace renames and moves.

Funny that you mention renames, considering that SmalltalkHub cannot handle 
renames or track changes/moves across packages.

> I know this idea is a tall order. If we improved our tools to beable do
> this, no matter what the repository is behind it, that would be very
> helpful and powerful. I think it is a challenge in git because it is
> dealing with text and does not have a notion of what a class is etc.

class -> directory, method -> file makes it much more easier.
But even if it was all a dump into a single file, the bottom line is, it is 
always only a question of tooling.
After all, don't forget that whatever format you use, if you are storing it on 
hard drive it's in a file. You just have tools on top.

Peter



Re: [Pharo-users] Pharo and GIT

2016-07-25 Thread Peter Uhnak
On Mon, Jul 25, 2016 at 08:08:49PM -0300, Hernán Morales Durand wrote:
> 2016-07-25 19:33 GMT-03:00 Sean Glazier :
> 
> > Thank you, Peter for documenting that :-). While I think git tools are OK,
> > my opinion though is that Smalltalk hub should be moved forward as well. At
> > cincom the Store experience started out painful and it has its quirks, but
> > one of the advantages is that I could write tools to do things like browse
> > senders and implementors in the repository. I git you are working with
> > files and text and it does not have the notion of classes and methods and
> > the value of being able to see the history of the class / methods. It is
> > valuable when needing to understand not just the current implementation but
> > where it came from. In Store, I could search and see when a method was
> > present of a class and in what version lets say it got dropped
> > unintentionally for instance. Even more important I think is to also note
> > thing like renames and in cincom namespace renames and moves.
> >  I was working a while back on a way to have a persistent diary for a
> > class that could note these histories and maintained and more importantly
> > searchable from  the image.
> > I wrote tools too, to attach to a number of databases (repositories) and
> > search for classes and the comments. Helpful when you are searching to see
> > if someone else has solved a problem before. Git tools can tell you a lot
> > about the repository you are publishing to and comparing code etc. But it
> > does not help you to search across repositories and the data.
> >
> > I know this idea is a tall order. If we improved our tools to beable do
> > this, no matter what the repository is behind it, that would be very
> > helpful and powerful. I think it is a challenge in git because it is
> > dealing with text and does not have a notion of what a class is etc. If we
> > continue and put in more powerful search abilities, it will require using
> > different paradigm in representing code  so we can do more powerful things
> > with the repository. We can browse the class without loading it but that
> > gets us only so far.
> >
> >
> That is exactly the core problem with Git. It was conceived by people very
> used to think in terms of files and directories.

Because that is how the system (linux) works, so it makes sense that it works 
that way.

> And it was promoted as a revolutionary tool.

It is.

> If the model of Git were well-done would be adaptable to handle references
> of classes, and methods, of any typical programming language, regardless of
> paradigms.

Git is used also for other things, not just programming languages.

Peter



[Pharo-users] switching to metadata-less gitfiletree

2016-07-29 Thread Peter Uhnak
Hi,

I've followed this thread 
http://forum.world.st/How-do-I-convert-a-FileTree-project-to-Metadataless-GitFileTree-project-td4903920i20.html
 to switch to metadata less format,

Specifically:

1. change `.filetree` file,
2. load the repo to a clean image
3. make a change to each package and commit it

This worked correctly, however having to recommit each package is annoying if 
there are several.

My question is:

* is it safe to directly remove the incriminating files (all 
monticello.meta/version & methodProperties.json files),
* is it possible to mass-commit all packages with simple script,
* or should I just ignore the metadata and eventually someone will make a 
change to the package so the metadata silently disappears?

Thanks,
Peter



Re: [Pharo-users] Programmatic generation of new class

2016-07-29 Thread Peter Uhnak
Can you show the full trace? Because I am regularly doing something similar 
without any problems.
In fact if I copy/paste your code (and just change the classes that I have) it 
works fine.

Btw. did you override such methods in your system?

Peter

On Fri, Jul 29, 2016 at 07:05:04AM -0700, Brad Selfridge wrote:
> I'm trying to programmatically generate a new class, but am getting the
> following error: 
> 
> DynamicDescriptorSystem class(Object)>>doesNotUnderstand:
> #subclass:instanceVariableNames:classVariableNames:package:
> 
> This is the method that I'm trying to execute: 
> 
> buildNewDescriptorSystemUsing: aDescriptorSystemClassName
> 
>   descriptorSystem := 
>   DynamicDescriptorSystem subclass: aDescriptorSystemClassName asSymbol
>   instanceVariableNames: ''
>   classVariableNames: ''
>   package: packageName asString
> 
> I see examples of this all over Pharo and I copied this code almost
> verbatim. 
> 
> What am I doing wrong? 
> 
> 
> 
> -
> Brad Selfridge
> --
> View this message in context: 
> http://forum.world.st/Programmatic-generation-of-new-class-tp4908659.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
> 



Re: [Pharo-users] switching to metadata-less gitfiletree

2016-07-29 Thread Peter Uhnak
On Fri, Jul 29, 2016 at 06:58:02PM +0200, Thierry Goubier wrote:
> Hi Peter,
> 
> Le 29/07/2016 à 18:05, Peter Uhnak a écrit :
> > Hi,
> > 
> > I've followed this thread
> > http://forum.world.st/How-do-I-convert-a-FileTree-project-to-Metadataless-GitFileTree-project-td4903920i20.html
> > to switch to metadata less format,
> > 
> > Specifically:
> > 
> > 1. change `.filetree` file, 2. load the repo to a clean image 3. make
> > a change to each package and commit it
> > 
> > This worked correctly, however having to recommit each package is
> > annoying if there are several.
> 
> the "resaving" thing isn't necessary. It would have happened anyway on the
> next save for a package, and gitfiletree never reads the metadata anyway.
> 
> > My question is:
> > 
> > * is it safe to directly remove the incriminating files (all
> > monticello.meta/version & methodProperties.json files),
> 
> Yes. You could also ask git to ignore them (some do that :)).
> 
> > * is it possible to mass-commit all packages with simple script,
> 
> Yes.
> 
> > * or should I just ignore the metadata and eventually someone will
> > make  a change to the package so the metadata silently disappears?
> 
> You could ignore, yes.
> 
> I'd choose ignoring. Once the property (metadata-less) is set on the
> repository, it is kept and maintained. Just don't forget to commit it :)
> 

Yeah, this looks like the best and easiest solution.

Thanks!

Peter



Re: [Pharo-users] How can I save a project on GitHub to SmalltalkHub?

2016-08-01 Thread Peter Uhnak
> >>> On 27 Jul 2016, at 23:26, Juraj Kubelka  wrote:
> >>> 
> >>> Hi,
> >>> 
> >>> How can I save (from time to time) project packages hosted on GitHub to 
> >>> SmalltakHub?
> >>> 
> >>> The reason is that I do not want to force people to install GIT when they 
> >>> want to install a project.
> >>> So I am thinking to regularly deploy it on SmalltalkHub and update 
> >>> ConfigurationOf.
> >>> 
> >>> Thanks in advance,
> >>> Juraj

You should be able (in theory) just swap the endpoints in this script to copy 
from GitHub to SmalltalkHub.

https://www.peteruhnak.com/blog/2016/03/02/moving-project-from-smalltalkhub-to-github/#Copying-repository

Peter



Re: [Pharo-users] I can't run Pharo5 on Linux Ubuntu 14.04.4 LTS

2016-08-02 Thread Peter Uhnak
On Tue, Aug 02, 2016 at 12:51:12AM -0700, Davide Varvello via Pharo-users wrote:

You could try to install pharo from the PPA

sudo add-apt-repository ppa:pharo/stable
sudo dpkg --add-architecture i386
sudo apt-get update

sudo apt-get install pharo-vm-core

I am not sure if it's up to date (I don't use ubuntu), but it should download 
all the necessary libraries.

> > pharo: could not find any display driver

Sounds like the libx11 library hasn't been installed properly.

Try the PPA and then we can think about other options.

Peter



Re: [Pharo-users] Script to migrate all mcz packages to git?

2016-08-02 Thread Peter Uhnak
On Tue, Aug 02, 2016 at 01:04:10PM +0200, Nicolas Passerini wrote:
> There is this script from Peter Uhnak
> https://www.peteruhnak.com/blog/2016/03/02/moving-project-from-smalltalkhub-to-github/#Copying-repository
> 
> but it will not be able to preserve commit date.

At the time of the (post) writing it did preserve commit dates, but there was 
no metadata-less yet.

In any case, I don't see a reason why it shouldn't preserve commit dates with 
metadata-less — it goes mcz by mcz and recommits it with given date, no?

Peter

> 
> Preserving commit dates... I think it could only be possible in
> metadata-ful git repositories, which I would not recommend.
> 
> On Tue, Aug 2, 2016 at 12:10 PM, Holger Freyther  wrote:
> 
> > Hi,
> >
> > I think I have seen something but can't find it right now. I would like to
> > move to git but preserve the history (and my commit messages and the commit
> > date/time). Is there a script that goes through all versions of a package
> > and copies them to git repository? Will it be able to preserve the original
> > commit date?
> >
> > thank you
> > holger
> >



[Pharo-users] generating function keys

2016-08-08 Thread Peter Uhnak
Hi,

how can one generate function keys? (F1 to F12)

I've made a morph for testing

~~
c := Morph subclass: #MyKeyMorph.

c compile: 'handlesKeyboard: evt
^ true'.

c compile: 'handleKeystroke: evt
self logCr: evt'.

c compile: 'handleKeyUp: evt
self logCr: evt'.

c compile: 'handleKeyDown: evt
self logCr: evt'.

m := c new.
m openInWindow.
m takeKeyboardFocus
~~

However the functions keys are not being generated.

Is this something that would have to be done in the VM?
I'm using linux btw, but ideally it should work on all platforms.

Thanks,
Peter



[Pharo-users] hooking into GTInspector tags

2016-08-13 Thread Peter Uhnak
Hi,

how can one hook into the GTInspector tags that can be filtered?

Apparently I can assign a presentation to a tag with ``,
however this works only if the tag name was already added.

As this was done in GTInspector>>initialize, it makes the whole filtering idea 
quite useless (unless I explicitly initialize GTInspector, which is not the 
natural approach).

Can't it just collect all the tags from the current presentations?

Or can I somehow access the GTInspector instance from the `composite` argument?

Thanks,
Peter



[Pharo-users] changing theme colors of windows without closing them

2016-08-14 Thread Peter Uhnak
Hi,

I fairly often switch themes (sometimes daily), and the fact that windows don't 
properly switch is quite annoying as I have to close literally everything and 
start over.

Is there a way to force-reload the colors without closing the windows?

For Nautilus I could probably script something like this

(NautilusUI allInstances select: [ :each | each window owner = World ])
do: [ :each | |new|
new := each fullBrowse.
new ui window position: each window position.
each close.
].

both for the rest (GTInspector in particular) I cannot just close them because 
I have live data there.

Thanks,
Peter



Re: [Pharo-users] 64bit support

2016-08-16 Thread Peter Uhnak
On Tue, Aug 16, 2016 at 03:51:30PM +0200, Clément Bera wrote:
> The 64 bits linux and mac VM have been working for more than 6 months.
> They've been in production in a company since April or something like that.
> Latest product are built by Travis and available here:
> https://bintray.com/opensmalltalk/vm/cog#files. Pharo provides a
> Pharo-flavored VM with a different logo and additional plugins. No 64 bits
> Pharo-flavored VM seems to be available, so the support right now is
> incomplete on 64bits due to missing plugins (no FreeType, Cairo binding,
> etc.), however I am taking care that the Pharo image still starts and works
> normally on the main build, so only some features are not working.
> 
> The 64 bits Pharo image is available on http://files.pharo.org/image/60/
> (See for example latest-64.zip).
> 
> The FFI plugin is working but the UFFI front-end may have little issues.
> The issues should be minor so the complete support shouldn't take long.
> 
> On Tue, Aug 16, 2016 at 1:04 PM, Peter Uhnák  wrote:
> 
> > Is there a timeline for 64bit on Windows?
> >
> 
> There has been a working 64 bits VM on windows for a month now. It has been
> merged with the main code base recently. 64 bits windows VM are not
> compiled automatically yet so you have to compile it yourself if you want
> to use it. The repo is here:
> https://github.com/OpenSmalltalk/opensmalltalk-vm and the build.win64x64
> folder has a HowToBuild file.
> 
> 
> > Also will it make the Windows VM even more unstable, or can it help?
> > #askingforafriend
> >
> 
> Precise what you are talking about and I can answer.

Well there was a lot of instability (I still crash regularly), mostly related 
to Cairo/GrafPort and FT.
On windows I didn't even get dumps, so I can only suspect it was the same issue.

But I guess since there are no plugins for this, it wouldn't work at all at the 
moment, but we will when it rolls in.

Peter



Re: [Pharo-users] standalone/runtime executable

2016-08-18 Thread Peter Uhnak
On Thu, Aug 18, 2016 at 10:36:50AM +0200, Gour wrote:
> Hello,
> 
> there are some Smalltalks like Dolphin, VisualWorks..which can, afaict,
> create stand-alone executable for easier deployment to end users.
> 
> I'm aware that Pharo probably has more important tasks to tackle first,
> but just curious if creating stand-alone/runtime exectuables is
> somewhere on its radar?

This essentially means bundling-in the VMs. If you only target Mac and/or Win, 
it should be easy.
If you aim for linux, then good luck… I have a sometimes working setup that 
creates a build with the VMs and platform-specific launchers, but I don't 
really have time right now to clean it up and share it… but if you can wait a 
couple of weeks...

There was also effort to push for NixOS iirc, but I don't know how that works.

Peter



Re: [Pharo-users] standalone/runtime executable

2016-08-18 Thread Peter Uhnak
On Thu, Aug 18, 2016 at 11:25:45AM +0200, Gour wrote:
> On Thu, 18 Aug 2016 11:07:23 +0200
> Peter Uhnak  wrote:
> 
> > If you only target Mac and/or Win, it should be easy. If you aim for
> > linux, then good luck…
> 
> If I'd use some other compiled language, then covering Mac/Win would be
> fine considering that Linux users are (mostly) accustomed to build
> install using ther preferred package manager, but I'm not sure how does
> it work with Linux not seeing any end-user app written in Pharo
> available for e.g. Debian?

I am not sure what you mean by "not seeing any end-user app written in Pharo".

> 
> > I have a sometimes working setup that creates a build with the VMs
> > and platform-specific launchers, 
> 
> Does it also include stripping the VM from the stuff as it is done with
> other Smalltalks like the ones I've mentioned in original email?

There is work being done on a "minimal Pharo bootstrap" which would allow you 
to take just the core of the platform and install whatever you need on top.
But I don't know the current state.

Peter



Re: [Pharo-users] standalone/runtime executable

2016-08-18 Thread Peter Uhnak
On Thu, Aug 18, 2016 at 12:14:35PM +0200, Gour wrote:
> On Thu, 18 Aug 2016 11:55:40 +0200 Peter Uhnak
>  wrote:
> 
> > I am not sure what you mean by "not seeing any end-user app written
> > in Pharo".
> 
> Afaics, there are no applications written using Pharo to be installed
> under Debian, right?

I'm still confused... do you mean in distribution? No, there is no such app for 
debian.

There is however PharoLauncher, which is technically an app written in Pharo, 
that is available for Ubuntu (you could probably install the .deb in debian 
though).

Also my DynaCASE https://dynacase.github.io/#download has linux build that 
should run on debian even if you don't have the required libs installed (it has 
them pre-downloaded, but I haven't tested it on non-debian systems).

Peter



Re: [Pharo-users] BlueInk formatting (line length) Pharo5

2016-08-19 Thread Peter Uhnak
On Thu, Aug 18, 2016 at 10:50:41PM -0700, Davide Varvello via Pharo-users wrote:
> Date: Thu, 18 Aug 2016 22:48:44 -0700 (PDT)
> From: Davide Varvello 
> To: pharo-users@lists.pharo.org
> Subject: Re: BlueInk formatting (line length) Pharo5
> 
> Hi Nicolai,
> Thanks for your reply.
> 
> Wow, 70 is not so much, especially because standard screens are wide, 16:9
> sized. It's a pity it is not configurable.

But people normally code in Nautilus, where the code pane is actually quite 
small.
But hard-coded line length explains some strange behavior I was experiencing... 
I thought that it was based on real nautilus width.

Peter



[Pharo-users] is there live preview for pillar?

2016-08-20 Thread Peter Uhnak
Hi,

is there any editor extension for Pillar that would show me the result version 
side by side with what I am typing, as I am typing it?
(Also it has to be desktop editor, nothing online).

Thanks,
Peter



[Pharo-users] renaming packages with iceberg or metadata-less gitfiletree

2016-08-27 Thread Peter Uhnak
Hi,

is it now possible to rename package without losing history with iceberg or 
metadata-less gitfiletree?

Normally git can easily handle this, but it seems that on pharo-side it needs 
to be handled explicitly?

Thanks,
Peter



  1   2   3   >