[Pharo-users] Object-centric breakpoint experiment during ESUG'24

2024-06-24 Thread Steven Costiou
Dear community, 
First, I would like to thanks again all the participants to our
experiment with object-centric breakpoints in Pharo. 
Many people participated, and we plan to present our results in an
informal manner at ESUG. 
However, from the scientifical point of view it would strenghten our
analysis if we had more participants. 
The more participants we have, the more we can trust our results and
take enlightened decisions about how to further develop the
object-centric debugger. 
Therefore, the experiment remains open until July 10th (included). 
If you're interested you can still do it, the instructions are here
https://github.com/Pharo-XP-Tools/XPImageGeneration/tree/exp-ocd 
Many people also declined to participate because of a lack of time,
which we totally understand. 
This is why we also propose to you, if time is an issue, to participate
to the experiment during the first days of esug. 
We can find a calm room in which we can supervise the experiment and
collect your data (reminder: once in our server the data is anonymized).

Please let us know if you would be potentially interested to participate
in such setting during ESUG. 
Thanks in advance, 
Steven and Valentin, EVREF team. 

[Pharo-users] Re: [Pharo-dev] Open Call: Object-Centric Breakpoints experiment

2024-05-14 Thread Steven Costiou
Dear community, 

we are still looking for participants for our experiment in the EVREF
team!
Please help us! 

We need 15 more participants, if you are interested and if you believe
you can work your way around a debugger, the experiment is fully
available online here (using Pharo 9): 

https://github.com/Pharo-XP-Tools/XPImageGeneration/tree/exp-ocd 

We would like to show our results at ESUG, but for that we really need
these 15 additional participations so that we can trust the results
better. 

Thanks in advance,
and many thanks to the people who already participated! 

Steven. 

Le 2024-02-02 14:14, Steven Costiou a écrit :

> Dear Community, 
> 
> as part of a research project in the EVREF team, we are looking for people to 
> participate to an empirical experiment on object-centric breakpoints - a 
> debugging tool present in Pharo 9. 
> 
> Many people from the community already participated, and we thank them very 
> much  🙂 
> 
> We are still looking for participants, we need 40 people to do the 
> experiment! 
> 
> Please help us, in return it helps us understand better our tools and their 
> impact and therefore build better tools for the Pharo community! 
> 
> For those who want to know a bit more, see my original email below. 
> For those who just want to jump at the experiment, you can go there 
> https://github.com/Pharo-XP-Tools/XPImageGeneration/tree/exp-ocd 
> 
> Thanks in advance 🙂 
> Steven. 
> 
> --- 
> 
> We would like to invite you to participate to our experimental study on 
> Object-Centric Breakpoints. 
> This study aims to evaluate and to understand how Object-Centric Breakpoints 
> impacts the debugging activity. 
> 
> This experiment takes place in **Pharo 9**. 
> In this experiment, we ask you to solve 2 debugging tasks, one with standard 
> Pharo tools and one other with Object-Centric Breakpoints. 
> Between the two tasks, you will have to follow a tutorialand warmup tasks to 
> learn how to use the tool. 
> 
> **How to Participate:** 
> All instructions are here, please read them carefully: 
> https://github.com/Pharo-XP-Tools/XPImageGeneration/tree/exp-ocd 
> 
> **About the Experiment:** 
> 
> The experiment last between 40 minutes and 2 hours. 
> Participants should have experience with Pharo development and debugging. 
> We recommend having more than 6 months experience in Pharo and debugging in 
> general. 
> You will gain insights into the Object-Centric Breakpoints approach and 
> contribute to advancements in debugging research. 
> 
> Help us to build better debugging tools that help you debug! 
> 
> **Some constraints:** 
> 
> - You are not allowed to load external tools and baselines, but you can use 
> anything that is in the base image 
> - Please do the experiment in one shot if possible without interruptions 
> - The experiment sends anonymous data to our inria server, please make sure 
> that you have a valid internet connection 
> - Please try to use the object-centric breakpoints when the experimental 
> framework asks you to 
> 
> **Notes:** 
> Participation is voluntary, and everything is anonymous. 
> You can abandon the experiment at any point (and your data will be 
> discarded). 
> For any question, you can contact us: steven.cost...@inria.fr and 
> valentin.bourc...@inria.fr 
> 
> Thank you for considering participating in our study. 
> Your contribution will be valuable in advancing the field of debugging and 
> helping us understand what tools we need to build for Pharo. 
> 
> Sincerely, 
> Steven and Valentin, 
> EVREF team, Inria

  

[Pharo-users] IWST 24 — International Workshop on Smalltalk Technologies Lille, France; July 8th to 11th, 2024

2024-03-14 Thread Steven Costiou
IWST 24 INFORMATION AND CALL FOR PAPERS

IWST 24 -- International Workshop on Smalltalk Technologies Lille,
France; July 8th to 11th, 2024 

GOALS AND SCOPE

The goals of the workshop is to create a forum around contributions and
experiences in building or using technologies related to Smalltalk.
While maturity of presented ideas and results is not crucial, it is
expected that their presentation triggers discussion and exchange of
ideas. The topics of your paper can be on all aspect of Smalltalk,
theoretical as well as practical. Authors are invited to submit research
articles or industrial papers. 

IMPORTANT DATES

* Extended abstract submission deadline: MARCH 31ST, 2024
* Extended abstract notification deadline: April 7th, 2024
* Full/short paper submission deadline: May 19th, 2024
* Full/short paper first-round notification deadline: June 30th, 2024

* Workshop: July 9-10, 2024

* Full/short paper resubmission deadline: July 21st, 2024
* Full/short paper final notification deadline: July 31st, 2024
* Camera ready package submission deadline: August 25th, 2024

TOPICS

We welcome contributions on all aspects, theoretical as well as
practical, of Smalltalk related topics such as: 

* Code Analysis
* Automated Testing
* Debugging
* Compilers, Virtual Machines and Language implementations
* Meta-programming and Meta-modeling
* Refactorings
* Design patterns
* Experience reports
* Libraries and frameworks
* New dialects or languages implemented in Smalltalk
* Interaction and integration with other languages
* Tools

SUBMISSIONS, REVIEWS, AND SELECTION

Authors interetsed to present their work at the IWST 2024 are invited to
submit an abstract of the intended talk before the extended abstract
submission deadline. The extended abstract should be not longer than 2
pages following the CEUR ART style [1]. 

Author of the submitted extended abstratcs will be notified and invited
to present their work by the extended abstract notification deadline
which enables presenters to register at the early registration prices. 

Authors of the accepted abstracts are also invited to submit a paper to
be subject of the review and a potential acceptance for publishing in
the IWST 2024 Proceedings. 

We are looking for papers of two kinds: 

* Short position papers (5 to 10 pages) describing fresh ideas and
early results.
* Full research papers (more than 10 pages) with deeper description of
experiments and of research results.

Paper accepted for publishing will be published within a CEUR-WS
Proceedings [2]. Hence, both submissions and final papers must be
prepared using the CEUR ART style [1]. 

All submissions must be sent via EasyChair submission page [3]. 

Pay attention, for organisation constraints, when submitting your
article you are expected to register to the conference and pay the
conference fees. 

REVIEWING

As the workshop format encourages bringing fresh ideas and early results
to be presented and discussed, and aims for giving a chance to young
community members to learn and grow, we will allow submissions with a
discussion potential to be conditionally accepted. In this case, authors
are expected to follow the recommendation of the reviewers. 

Consequently, the reviewing process will be organized in two rounds: 

* in the first round, all submissions will be reviewed by at least 3
reviewers. Based on these reviews authors will receive a notification
with reviewers comments, advises, and requirements and papers that are
not rejected will be invited to be resubmitted in an improved form
together with change log and answrers to the reviewers.
* in the second round, PC chairs in collaboration with the reviewers
where needed and possible, will evaluate the improved paper version and
notifiy authors about final decision on acceptance/rejection.

BEST PAPER AWARD 

To encourage the submission of high-quality ideas, contributions, and
papers, the IWST organizing committee is very proud to announce a Award
competition in the categories of BEST IDEA, BEST CONTRIBUTION TO THE
COMMUNITY and BEST PAPER FOR THIS EDITION OF IWST. 

The ranking will be decided by the program committee during the review
process and by the audience voting during the conference. 

The awards will be given during the ESUG conference social event. 

The Awards will take place only with a minimum of six submissions.
Notice also that to be eligible, a paper/abstract must be presented at
the workshop by one of the author and that the presenting author must be
registered at the ESUG conference. 

PROGRAM CHAIRS

* Steven Costiou, Inria Lille, France (chair),
* Guille Polito, Inria Lille, France (chair),
* Gordana Rakic, University of Novi Sad, Serbia (chair)

PROGRAM COMMITTEE

to be published ... 

  

Links:
--
[1] https://ceur

[Pharo-users] ESUG24 Call for Student Volunteers, 8-11 July, Lille, France

2024-03-12 Thread Steven Costiou
CALL FOR STUDENT VOLUNTEERS, ESUG 2024, 8-11 JULY, LILLE, FRANCE

Student volunteers help the conference running smoothly; in return, they
have free accommodations, while still having most of the time to enjoy
the conference. 

PAY ATTENTION: the places are limited so do not wait till the last
minute to apply. 

CONFERENCE DETAILS:

Send an email to volunteers-esu...@inria.fr. 

* title: [ESUG 2024 Student]
* name, gender, university/school, country, email address
* short description of you and why you are interested in participating

Accommodation is covered from Sunday 7 July until 8 Thursday July 2024
(including nights from Sunday to Monday and from Thursday to Friday). 
Students will be hosted in student rooms. 
ESUG additionally covers for the lunches during the week and one dinner.


Travel costs are *not* covered by the student volunteers program. 

Duties include handling registration as people arrive at the conference,
filling coffee machines, collecting presentation slides for ESUG right
after the presentation is given, being present at an information desk to
answer questions, and generally being helpful. Student volunteering
makes the conference better, takes a fairly small amount of time and
doesn't significantly interfere with enjoying and learning from the
conference. Please note, this role requires discipline and constant
attention to all attendees. 

[Pharo-users] Open PhD position on debugging at Inria Lille

2024-02-08 Thread Steven Costiou
Hello, 

we have a PhD position opening at Lille, France.
See all details here:
https://recrutement.inria.fr/public/classic/fr/offres/2024-07154 

Steven.

_Summary of the research proposal:_ 

###
Application development inevitably introduces bugs. Often, it's not
clear why a code change introduced a bug. To find this cause-and-effect
relationship and debug more efficiently, developers can sometimes rely
on the existence of a previous version of the code without the bug. Yet,
traditional debugging tools are not designed for this kind of work,
making it a tedious operation.

In this thesis, we propose an approach that enables us to understand and
to debug an application in a LIVE SYSTEM, such as Pharo or Python, by
comparing two executions with different results: one execution succeeds
and the other fails.

Based on this hypothesis, we propose in this thesis to answer the
following challenges:

- How to detect divergence, i.e. different behavior between two
executions of a program?
- How can we reduce the cost in time, memory and energy consumption of
detecting divergence(s) on long executions?
- What are the criteria for deciding whether a divergence is normal or
unauthorized?
- What about detecting multiple divergences in the same program?
- What abstractions are needed to compare two executions of a program
and detect divergences?

To meet these challenges, in addition to a precise state-of-the-art on
debugging techniques, the PhD student will study concrete cases of
program execution and propose a tool to be integrated into Pharo.
 

[Pharo-users] Open Call: Object-Centric Breakpoints experiment

2024-02-02 Thread Steven Costiou
Dear Community, 

as part of a research project in the EVREF team, we are looking for
people to participate to an empirical experiment on object-centric
breakpoints - a debugging tool present in Pharo 9. 

Many people from the community already participated, and we thank them
very much  🙂 

We are still looking for participants, we need 40 people to do the
experiment! 

Please help us, in return it helps us understand better our tools and
their impact and therefore build better tools for the Pharo community! 

For those who want to know a bit more, see my original email below. 
For those who just want to jump at the experiment, you can go there
https://github.com/Pharo-XP-Tools/XPImageGeneration/tree/exp-ocd 

Thanks in advance 🙂 
Steven. 

--- 

We would like to invite you to participate to our experimental study on
Object-Centric Breakpoints. 
This study aims to evaluate and to understand how Object-Centric
Breakpoints impacts the debugging activity. 

This experiment takes place in **Pharo 9**. 
In this experiment, we ask you to solve 2 debugging tasks, one with
standard Pharo tools and one other with Object-Centric Breakpoints. 
Between the two tasks, you will have to follow a tutorialand warmup
tasks to learn how to use the tool. 

**How to Participate:** 
All instructions are here, please read them carefully:
https://github.com/Pharo-XP-Tools/XPImageGeneration/tree/exp-ocd 

**About the Experiment:** 

The experiment last between 40 minutes and 2 hours. 
Participants should have experience with Pharo development and
debugging. 
We recommend having more than 6 months experience in Pharo and debugging
in general. 
You will gain insights into the Object-Centric Breakpoints approach and
contribute to advancements in debugging research. 

Help us to build better debugging tools that help you debug! 

**Some constraints:** 

- You are not allowed to load external tools and baselines, but you can
use anything that is in the base image 
- Please do the experiment in one shot if possible without interruptions

- The experiment sends anonymous data to our inria server, please make
sure that you have a valid internet connection 
- Please try to use the object-centric breakpoints when the experimental
framework asks you to 

**Notes:** 
Participation is voluntary, and everything is anonymous. 
You can abandon the experiment at any point (and your data will be
discarded). 
For any question, you can contact us: steven.cost...@inria.fr and
valentin.bourc...@inria.fr 

Thank you for considering participating in our study. 
Your contribution will be valuable in advancing the field of debugging
and helping us understand what tools we need to build for Pharo. 

Sincerely, 
Steven and Valentin, 
EVREF team, Inria 

[Pharo-users] Open Call: Object-Centric Breakpoints experiment

2023-11-21 Thread Steven Costiou
Dear Community, 
We would like to invite you to participate to our experimental study on
Object-Centric Breakpoints. 
This study aims to evaluate and to understand how Object-Centric
Breakpoints impacts the debugging activity. 
This experiment takes place in **Pharo 9**. 
In this experiment, we ask you to solve 2 debugging tasks, one with
standard Pharo tools and one other with Object-Centric Breakpoints. 
Between the two tasks, you will have to follow a tutorialand warmup
tasks to learn how to use the tool. 
**How to Participate:** 
All instructions are here, please read them carefully:
https://github.com/Pharo-XP-Tools/XPImageGeneration/tree/exp-ocd 
**About the Experiment:** 
The experiment last between 40 minutes and 2 hours. 
Participants should have experience with Pharo development and
debugging. 
We recommend having more than 6 months experience in Pharo and debugging
in general. 
You will gain insights into the Object-Centric Breakpoints approach and
contribute to advancements in debugging research. 

Help us to build better debugging tools that help you debug! :) 

**Some constraints:** 
- You are not allowed to load external tools and baselines, but you can
use anything that is in the base image 
- Please do the experiment in one shot if possible without interruptions

- The experiment sends anonymous data to our inria server, please make
sure that you have a valid internet connection 
- Please try to use the object-centric breakpoints when the experimental
framework asks you to 
**Notes:** 
Participation is voluntary, and everything is anonymous. 
You can abandon the experiment at any point (and your data will be
discarded). 
For any question, you can contact us: steven.cost...@inria.fr and
valentin.bourc...@inria.fr 
Thank you for considering participating in our study. 
Your contribution will be valuable in advancing the field of debugging
and helping us understand what tools we need to build for Pharo. 
Sincerely, 
Steven and Valentin, 
EVREF team, Inria 

[Pharo-users] Re: How to show the process name in the debugger?

2022-04-26 Thread Steven Costiou
Hi, 

in Pharo 9-11, from the StDebugger you can access the debugged process
using 

self session interruptedProcess name 

In the debugger class you can prepend that instruction in the window
title update methods: 

StDebugger>>initializeWindow: aWindowPresenter

super initializeWindow: aWindowPresenter.
aWindowPresenter
title: self session interruptedProcess name , ': '
, self debuggerActionModel statusStringForContext;
initialExtent: self initialExtent;
whenClosedDo: [ self clear ].

self initializeShortcuts: aWindowPresenter 

StDebugger>>newTitle

^ self session interruptedProcess name , ': '
  , self debuggerActionModel statusStringForContext 

There is no other ways yet to customize the window title. 

I do not know how to do it in prior versions of Pharo. 

Steven. 

Le 2022-04-26 10:45, Stewart MacLean a écrit :

> Hi, 
> 
> I am working on a multi green and OS threaded implementation of Apple's 
> Bonjour service discovery. 
> 
> I'd like to show the current Smalltalk process name in the Halt window title. 
> 
> Any clues are very much appreciated. 
> 
> Thanks, 
> 
> Stewart

  

[Pharo-users] One PhD and two internships offers on object-centric debugging at Inria Lille

2021-11-09 Thread Steven Costiou
Hello, 

Inria Lille is recruiting one phd student and two interns to work on
object-centric debugging within the OCRE project (ANR).

DESCRIPTION OF THE PROJECT 

Debugging is difficult and costly. 

Object-centric debugging is a young technique arguing that focusing the
scope of debugging on specific objects considerably eases the tracking
and the understanding of hard bugs in Object-Oriented Programs (OOP). 
But it lacks fundamental bricks to be applicable in practice. 
Therefore, it has never been empirically evaluated.

The objectives of the OCRE project are to study the fundamental and
practical limits that hinder the implementation, the evaluation, and the
adoption of object-centric debugging. 

We propose to build the first generation of object-centric debuggers, in
order to identify and evaluate its real benefits to OOP debugging. We
argue that these debuggers have the potential to drastically lower the
cost (time and effort) of tracking and understanding hard bugs in OOP. 

PHD TOPIC 

The goal of this PhD is to understand and to achieve the full potential
of object-centric debugging by:
- identifying the precise scenarios for object-centric debugging,
- studying means to obtain objects to debug,
- studying the implementation requirements for object-centric debuggers
and to implement prototypes,
- evaluate empirically object-centric debugging using these prototypes. 

The full detailed offer is available here:
https://jobs.inria.fr/public/classic/fr/offres/2021-04101 

INTERNSHIPS 

These two internships aim at helping the design and the implementation
of an object-centric debugger, by unveiling knowledge without which
object-centric debuggers cannot be built and evaluated, or cannot be
used in practice. 

Internship 1 - Identifying and acquiring objects to debug 

The objective of this internship is to study the practical problems of
acquiring objects to debug.
The intern will characterize the scenarios in which developers need to
identify objects to debug and explore these scenarios by implementing
prototypes. 

Internship 2 - Evaluating object-centric debugging scenarios

The objective of this internship is to identify and to evaluate the
debugging scenarios that are the most likely to benefit from
object-centric debugging. 
The intern will interrogate real developers about object-centric
debugging scenarios, then implement prototypes and evaluate them
empirically with developers to validate these scenarios.

ADMINISTRATIVE DETAILS

Location: Lille, France

Phd:
- starting date: preferably october 2022, but it can start before.
- duration: 3 years (fully funded)
- the candidate must hold a Master or an equivalent degree

Internships:
- starting date: anytime
- duration: 4-6 months
- the candidate must be studying for a Master degree or equivalent (1st
or 2nd year, equivalent to M1 or M2 in France) 

  

Re: [Pharo-users] How to print playground contents as I type them.

2020-08-21 Thread Steven Costiou
Hi, 

no idea if that's what you are looking to, but there is 

RubScrolledTextMorph>>whenKeystrokeInTextArea: anAnnouncement 
self announcer announce: (anAnnouncement copy morph: self) 

I instrumented that in one of my projects to capture what's written in
text areas and print it on the Transcript.
But at this level, it does it for any text area. I guess it is possible
to filter and only print what comes from the Playground. 

Steven. 

Le 2020-08-21 21:04, Offray Vladimir Luna Cárdenas a écrit :

> Hi,
> 
> Just a gentle remainder if anyone can point me in the right direction.
> 
> By the way, despite of all the local activities where Pharo is a key
> core infrastructure and enabler, I'm, AFAIK, the only active
> Pharoer/Smalltalker in my country and (virtual) community has been key
> on my self-guided learning. Now this is even more visible in COVID times
> and make me think about it.
> 
> We have had 14 editions of the Data Week[1 [1]] (anti)hackathon covering
> civic tech, self publishing, data visualization for diverse participants
> (librarians, teachers, activists, journalists) and 48 editions of the
> Data Rodas (the shorter one afternoon version). Grafoscopio and Pharo
> have been there since the beginning, supporting community activities
> with different levels of visibility, but is now kind of in the back end.
> With the Indie Web workshops we started a week ago[2 [2]], I think that we
> have found a sweet spot between a project that is practical and simple
> enough to encourage adult learners to use it and code it. Also I have
> started the documentation of Brea[3 [3]][3a [4]] and hopefully I will be
> providing a Brea powered indie web site to show the road map and the
> posilities. I will keep sharing the advances in its own thread, once is
> more advanced.
> 
> [1] https://mutabit.com/dataweek/
> [2] https://docutopia.tupale.co/s/dataroda48#
> [3] https://mutabit.com/repos.fossil/brea/doc/tip/index.md.html
> [3a] https://docutopia.tupale.co/s/brea#
> 
> Anyway, I just one to thank once more to the community for being
> supportive in my learning and help me to bridge local and international
> communities and concerns... Well and also remain if any of you can help
> me with my question, as this would help the only active Pharoer in my
> country to improve learning experience to future local Pharoers.
> 
> Cheers,
> 
> Offray
> 
> On 5/08/20 5:15 p. m., Offray Vladimir Luna Cárdenas wrote: 
> 
>> Hi,
>> 
>> I have an annoying bug in Grafoscopio. While text nodes are updated as I
>> write them, code nodes capture the penultimate keystroke. So, when I
>> revisit a text node all the typed content is there, but when I do the
>> same with a code (playground) node I found the last character lost (this
>> is particularly annoying when the last keystroke is a key completion or
>> a cut and paste operation that happens in a single combined stroke).
>> 
>> When I was programming the notebook behavior I remember dealing with
>> transmissions between parts of the playground and the rest of the UI and
>> how to capture playground events. So I think that a minimal test example
>> would be to send to the Transcript, keystrokes from the playground as
>> they happen and to see which the the message that capture them all. So,
>> How can I print playground contents as I type them in the playground?
>> 
>> Thanks,
>> 
>> Offray

  

Links:
--
[1] https://mutabit.com/dataweek/
[2] https://docutopia.tupale.co/s/dataroda48#
[3] https://mutabit.com/repos.fossil/brea/doc/tip/index.md.html
[4] https://docutopia.tupale.co/s/brea#


Re: [Pharo-users] Disable halt and breakpoints globally

2020-08-19 Thread Steven Costiou
Le 2020-08-19 15:24, Esteban Maringolo a écrit :

> There is a similar view in Pharo 8, the Browse breakpoints show breakpoints 
> and halts as well.

The P8 view does not allow for dynamic activation, and that logic is
only in P9. 

Steven. 

> However, I avoid using breakpoints because you cannot add/remove them within 
> the debugger, and sometimes with nested blocks it is hard to specify which 
> expression should get it.
> 
> Regards! 
> 
> Esteban A. Maringolo 
> 
> On Wed, Aug 19, 2020 at 5:27 AM Steven Costiou  
> wrote: 
> 
> So, I just checked and we have this view in Pharo 9 with all halts and 
> breakpoints. 
> 
> We just need to put a global checkbox to (de)activate everything at once (and 
> polish a little bit the view). 
> 
> Le 2020-08-19 10:11, Steven Costiou a écrit : 
> 
> Hi, 
> 
> in Pharo 9/NewTools we added the possibility to disable a halt or a 
> breakpoint through a checkbox in the inspector or from a view in the debugger.
> For example this is an inspector on a test object: 
> 
> When a halt is disabled this way, it is still in your code but instead of 
> halting it logs into the Transcript.
> We planned to have a global view somewhere with a global "checkbox" to 
> enable/disable them all.
> But this will be only for Pharo 9. 
> 
> But to me it has interest only if you want to keep dormant debugging 
> capabilities in production, that you awake when you have a problem that you 
> need to debug.
> Otherwise, I would do as Tim suggested and make sure there are no halts in 
> the production image. 
> 
> Steven. 
> 
> Le 2020-08-18 22:46, Esteban Maringolo a écrit : 
> Hi,
> 
> I was bit by a bug in production I couldn't identify and it ended up
> being a lost halt in the code that was hanging my whole image. So no
> bug at all, a feature :-)
> 
> Is there a way to disable the #halt and breakpoints?
> This way I could add such an expression (if existent) to my server
> startup and avoid issues like this.
> 
> Regards!
> 
> Esteban A. Maringolo

  

Re: [Pharo-users] Disable halt and breakpoints globally

2020-08-19 Thread Steven Costiou
So, I just checked and we have this view in Pharo 9 with all halts and
breakpoints. 

We just need to put a global checkbox to (de)activate everything at once
(and polish a little bit the view). 

Le 2020-08-19 10:11, Steven Costiou a écrit :

> Hi, 
> 
> in Pharo 9/NewTools we added the possibility to disable a halt or a 
> breakpoint through a checkbox in the inspector or from a view in the debugger.
> For example this is an inspector on a test object: 
> 
> When a halt is disabled this way, it is still in your code but instead of 
> halting it logs into the Transcript.
> We planned to have a global view somewhere with a global "checkbox" to 
> enable/disable them all.
> But this will be only for Pharo 9. 
> 
> But to me it has interest only if you want to keep dormant debugging 
> capabilities in production, that you awake when you have a problem that you 
> need to debug.
> Otherwise, I would do as Tim suggested and make sure there are no halts in 
> the production image. 
> 
> Steven. 
> 
> Le 2020-08-18 22:46, Esteban Maringolo a écrit :
> 
>> Hi,
>> 
>> I was bit by a bug in production I couldn't identify and it ended up
>> being a lost halt in the code that was hanging my whole image. So no
>> bug at all, a feature :-)
>> 
>> Is there a way to disable the #halt and breakpoints?
>> This way I could add such an expression (if existent) to my server
>> startup and avoid issues like this.
>> 
>> Regards!
>> 
>> Esteban A. Maringolo

  

Re: [Pharo-users] Disable halt and breakpoints globally

2020-08-19 Thread Steven Costiou
Hi, 

in Pharo 9/NewTools we added the possibility to disable a halt or a
breakpoint through a checkbox in the inspector or from a view in the
debugger.
For example this is an inspector on a test object: 

When a halt is disabled this way, it is still in your code but instead
of halting it logs into the Transcript.
We planned to have a global view somewhere with a global "checkbox" to
enable/disable them all.
But this will be only for Pharo 9. 

But to me it has interest only if you want to keep dormant debugging
capabilities in production, that you awake when you have a problem that
you need to debug.
Otherwise, I would do as Tim suggested and make sure there are no halts
in the production image. 

Steven. 

Le 2020-08-18 22:46, Esteban Maringolo a écrit :

> Hi,
> 
> I was bit by a bug in production I couldn't identify and it ended up
> being a lost halt in the code that was hanging my whole image. So no
> bug at all, a feature :-)
> 
> Is there a way to disable the #halt and breakpoints?
> This way I could add such an expression (if existent) to my server
> startup and avoid issues like this.
> 
> Regards!
> 
> Esteban A. Maringolo

  

[Pharo-users] Fwd: [Pharo-dev] Fwd: Help Needed! Survey on developer knowledge of Breakpoints/Watchpoints

2020-06-17 Thread Steven Costiou
Hello, 

I did not see this email go through the Pharo users mailing list, so
just in case: 

 Courriel original  

OBJET:
[Pharo-dev] Fwd: Help Needed! Survey on developer knowledge of
Breakpoints/Watchpoints

DATE:
2020-06-10 15:40

DE:
Thomas Dupriez 

À:
pharo-...@lists.pharo.org

RÉPONDRE À:
Pharo Development List 

Hi all,

As part of a research work on watchpoints, we are setting up a survey to
gauge the general knowledge developers have on breakpoints/watchpoints. 

It should take around 10 minutes to complete.
Here is the link to participate if you would be so kind:
https://forms.gle/eK4HFvU1YNZZkiaHA 

If you are interested in the results, you can check the box at the end
of the survey and we will send you feedback on the results of the
survey. 

Additionally, we are going to set up a controlled experiment to evaluate
the effectiveness of a new type of watchpoints we are developing for
Pharo.
The gist of it is that we will observe participants hunt some bugs, with
and without the new tool, and see if their performance improve.
So, if you know how to program in Pharo, and would be willing to
participate, there is a question in the survey to tell us you are
interested.
We will get research data, and you will get a new debugging tool in
Pharo. So it's a win-win. 

That's it! Thanks for your time! And extra thanks if you take the survey
or consider participating in the experiment! 

Thomas Dupriez 

This research work is conducted by:
- Eduardo A. Fontana, Université du Québec à Chicoutimi, Canada.
- Thomas Dupriez, Univ. Lille, France. 

And is supervised by:
- Fabio Petrillo, Université du Québec à Chicoutimi, Chicoutimi, Québec,
Canada.
- Steven Costiou, Inria Lille, France.
- YANN-GAËL GUÉHÉNEUC, Concordia University, Montreal, Quebec, Canada.
- STÉPHANE DUCASSE, Inria Lille, France. 

Re: [Pharo-users] Slots and Metalink

2019-04-03 Thread Steven Costiou
Also, I do not think metalinks could work on #write:to: method from
slots, because that method is not used at runtime (I do not remember
exactly but maybe somebody knows the details...). 

Le 2019-04-03 16:20, Steven Costiou a écrit :

> Hi, 
> 
> if you are using Pharo7, you could do either on a class (affects all 
> instances) or on an object (affects only the target instance):
> 
>> classOrObject link: yourMetaLink toSlotNamed: #slotName option: #write
> 
> It will install the metalink on all write accesses to the slot. 
> 
> Note that if you target a single object, it will be migrated to an anonymous 
> subclass for the metalink to be object-specific. 
> 
> In both cases, if you add or remove inst-var accesses, the metalink should 
> update automatically. 
> 
> Steven. 
> 
> Le 2019-04-03 15:57, Vitor Medina Cruz a écrit :
> 
>> Hello,
>> 
>> Is it possible to intercept a slot store? I tried with a before metalink 
>> into #write:to selector, but it don't seems to work. Should I use another 
>> selector?
>> 
>> I would like to experiment with ivar change notification, but I don't know 
>> what is the better approach. I know I could install a MetaLink in an 
>> attribution node, but that seems ankward and I would have to edit the 
>> linkage every time my object is changed, isn't true?
>> 
>> Regards, 
>> Vitor

  

Re: [Pharo-users] Slots and Metalink

2019-04-03 Thread Steven Costiou
Hi, 

if you are using Pharo7, you could do either on a class (affects all
instances) or on an object (affects only the target instance):

> classOrObject link: yourMetaLink toSlotNamed: #slotName option: #write

It will install the metalink on all write accesses to the slot. 

Note that if you target a single object, it will be migrated to an
anonymous subclass for the metalink to be object-specific. 

In both cases, if you add or remove inst-var accesses, the metalink
should update automatically. 

Steven. 

Le 2019-04-03 15:57, Vitor Medina Cruz a écrit :

> Hello,
> 
> Is it possible to intercept a slot store? I tried with a before metalink into 
> #write:to selector, but it don't seems to work. Should I use another selector?
> 
> I would like to experiment with ivar change notification, but I don't know 
> what is the better approach. I know I could install a MetaLink in an 
> attribution node, but that seems ankward and I would have to edit the linkage 
> every time my object is changed, isn't true?
> 
> Regards, 
> Vitor

  

Re: [Pharo-users] Iliad on Pharo 7.0

2019-02-05 Thread Steven Costiou
Hi, 

I looked at it this week end but in the end had no time to go through. 

I will surely do it, but it will take time as I have too much to do at
the moment (say, not before March i think). 

Unless somebody does it before I can.. 

Steven. 

Le 2019-02-05 17:37, Siemen Baader a écrit :

> Hi, 
> 
> is anyone planning to port Iliad to Pharo 7.0? The Grease package seams to 
> have been removed from 7.0 so Iliad does not work out of the box. 
> 
> cheers, 
> Siemen

  

Re: [Pharo-users] How to intercept instvar write - MetaLinks + anonymous subclass problem

2019-02-02 Thread Steven Costiou
> Le 2019-02-02 16:26, Petr Fischer via Pharo-users a écrit : 
> 
> Thanks for answer! I want to detect instvar writes only for objects 
> (instances), that was previously fetched from external "datastore" (DB like), 
> so I can persist changed objects only back to the datastore at the end of 
> transaction. These objects can be any existing class (Pharo classes, some 3rd 
> party libs classes, everything), so 1) injecting a class is overkill (affects 
> all objects in the image) 2) impossible to rewrite #class method for every 
> existing class.
> 
> Injecting object-centric metalinks via anonymous subclass breaks up many 
> things, when I want to treat injected object like any othres (IMHO).
> 
> If you will be able to avoid this issue, that would be extra cool :-]
> 
> Note: for now, best for my "instvar writes detection" would be probably hack 
> Object>>#attemptToAssign:withIndex: or 
> ProtoObject>>#modificationForbiddenFor:index:value: and make my "datastore 
> fetched objects" read only (via Object>>#setIsReadOnlyObject.
> 
> pf

I will look into that yes, however object-centric metalinks are not
really meant to affect all instnces, only specific ones. That is more
the purpose of "standard" metalinks. 

Could standard metalinks not work? Since in any case you have to have
your hand on those objects, so instead of putting an object-centric
metalink you could ask for the class and install a normal metalink on
write access there, which would affect all instances of that class. You
would also have to keep some kind of record of which class you
instrumented, so you do not install the link multiple times. 

Steven. 

Re: [Pharo-users] How to intercept instvar write - MetaLinks + anonymous subclass problem

2019-02-02 Thread Steven Costiou
> is possible to intercept (before writeú all instance variable writes on every 
> existing objects? 
> 
> Ok, I learned more about MetaLinks and it's perfectly possible to intercept 
> instance variable writes via. installing MetaLink into object instance (cool) 
> - then I can intercept instvar write, but one problem immediately occurs:
> when installing MetaLink into object instance, an original object class is 
> exchanged to anonymous subclass of the original class - and because typical 
> #= method is implemented like:
> 
> =
> self == anObject
> ifTrue: [ ^ true ].
> self class = anObject class
> ifFalse: [ ^ false ].
> ...
> 
> then most of #= comparisons in application logic is broken due to "self class 
> = anObject class" part.
> 
> Is there any way to solve this problem?

Hi, 

the anonymous class thing only happen when you install an object-centric
metalink, i.e. on only one specific object. I also wanted to hide the
anonymous class, or maybe to only make it visible for environment tools.
I need to talk about that with Marcus. 

Why not installing your metalink on the classes of your objects, so that
all instances are affected but in that case there is no anonymous class
migration? 

If that is not possible, in your case maybe a (temporary) hack would be,
in your case, to add a test in the #class method in Object (or wherever
it is defined): 

class 

|myClass| 

myClass := self class. 

^myClass isAnonymous ifTrue:[myClass superclass] ifFalse:[myClass] 

But i did not test that and i have no idea of the overall impact. 

Steven. 

Re: [Pharo-users] Is it possible to follow an object through a computation?

2019-01-03 Thread Steven Costiou via Pharo-users
--- Begin Message ---
Hi, 

if you are using Pharo 7 I have some work on object-centric debugging
that could do that, using Reflectivity. 

For example, with object-centric metalinks you could do the following: 

##get your object (here are two instances of a trivial class which only
has a "name" inst var) 

obj1 := MyClass new.
obj2 := MyClass new. 

##define a "halt" metalink: 

link := MetaLink new 
metaObject: Halt; 
selector: #now;
control: #before.

##install the metalink on the  instance variable "name" of the  first
object using the new Reflectivity API 

obj1 link: link toSlotNamed: #name. 

##then the system only halts when you use a method accessing the "name"
slot of this object, and not for other instances 

obj1 name: 'first name'. <-- halt
obj2 name: 'second name' <-- no halt 

If you look at Object and Class classes, you will find a more detailed
API to install metalinks on different structural entities and to scope
them to objects. For example you can ask to halt only when a instance
variable is read, or only when something is written in it (in the
example above it does both). 

These metalinks are only available for Pharo 7 and must be loaded from
https://github.com/StevenCostiou/Reflectivity-dev and you must override
the current Reflectivity code (click "load" and not "merge"). Hopefully
that will be integrated and merged in Pharo 7 or 8 soon. 

There is also that https://github.com/ClotildeToullec/Collectors/wiki
which provides a history tool that stores all objects that went into an
instance variable of an object (or even a temp var or a given
expression). It uses the Reflectivity API mentionned above. However for
now it is needed to provide a condition to scope the capture of objects
to a specific instance (but it works well). This tool also gives you the
stack for each modification of an instance variable. Objects are stored
in memory though, so it can kill your image on too large program
executions (that part is currently being investigated...). 

I do not have time right now to get into more details, but if you try
any of it and have questions please ask. 

Steven. 

  --- End Message ---


Re: [Pharo-users] Tracing Method Calls

2018-07-27 Thread Steven Costiou
Hi, 

it may not be actively maintained but Phantom has recently been ported
to Pharo 6/6.1 https://github.com/InesSosa95/PHANtom 

You could also use Reflectivity (look for MetaLink class), which should
not be hard to understand if you are familiar with aspects (although
that is not aspects). 

For example, if you wanted to trace the receivers and parameters of a
method named #mWithArg1:withArg2:withArg3: in class C, you could do : 

|link| 

link := MetaLink new. 

link control: #before. 

link arguments: #(#receiver #arguments). 

link metaObject: YourMetaObject. 

link selector: #yourMethodWithArg1:andArg:. 

(C lookupSelector: #mWithArg1:withArg2:withArg3:) ast link: link 

YourMetaObject is here an object which will receive the
yourMethodWithArg1:andArg: with as arguments the receiver of the method
#mWithArg1:withArg2:withArg3: and its arguments as an array. 

It could be a block with 2 arguments, or any other object that you would
use to implement your trace behavior. You have a number of reifications
available that you can pass as arguments from the context, look for
subclasses of RFReification. 

Steven. 

Le 2018-07-27 17:25, Arturo Zambrano a écrit :

> Hi all, 
> I have a piece of undocumented software that I  need  understand ... One 
> thing I would like to do is to have a complete trace of method calls 
> (receivers, parameters)  for certain scenarios. 
> As an "aspects"guy, my first idea was to use Phantom, but it seems not active 
> anymore. 
> 
> Could someone please point me to some tools that I could use for this? (using 
> Pharo 6, 6.1 or  7)  
> 
> Thanks in advance 
> 
> Cheers 
> Arturo

  

Re: [Pharo-users] Pharo 6, bad debugger behaviour

2018-06-08 Thread Steven Costiou
Concerning the bug 22085, i commented on fogbuzz:

> I believe it is because when running test cases, it runs through:
> 
> runCaseForDebug: aTestCase
> [...call test code...]
> on: self class failure , self class skip, self class warning, self class error
> do: [:ex | ex sunitAnnounce: aTestCase toResult: self. ex pass]
> 
> So when you reach a doesNotUnderstand, you have:
> 
> doesNotUnderstand: aMessage
> [...stuff...]
> 
> resumeValue := exception signal.
> 
> ^exception reachedDefaultHandler
> ifTrue: [aMessage sentTo: self]
> ifFalse: [resumeValue]
> 
> In normal cases (class of the receiver is not a test case), when you step in 
> the debugger the exception signal blocks the execution right away. In 
> subclasses of TestCase, it does ex pass each time you get to this line, then 
> it enters the aMessage sentTo: self, which is not understood, then you can 
> wait a long time...
> 
> It is equivalent to doing this in a playground:
> 
> [ Object new doStuff ] on: Exception do:[:ex| ex pass]
> 
> Then step in the debugger and bye bye. But then it seems to be expected 
> behavior... or maybe not ? I mean voluntarily passing on an exception in a 
> doesNotUnderstand would lead to such problems.

I have heard at least three different stories about this bug : yours,
the one from fogbuzz and one other a bit different from Guille. 

They seem to be different but all of them end up looping ad vitam
eternam after a debugger step. 

I am looking for ways to reproduce any of this bugs (well except 22085),
but so far i have no success on my own images :'( (pharo 6.1 & 7). 

Steven. 

[Pharo-users] What are RBPattern* classes in the AST?

2018-03-31 Thread Steven Costiou
Hi, 

i was browsing the classes of the AST and i am curious about the
RBPattern* classes. 

What are they used for? 

The RBPatternParser's comment says that it is used "to search and
transform source code". 

After looking a bit in the senders and class refs, it seems it is used
for refactorings and other stuff. 

But is that used at some point in code compilation? 

Steven. 

Re: [Pharo-users] Looking for small boards and tiny computers which can run Pharo

2018-03-23 Thread Steven Costiou
Hi, 

thanks for the links :) 

Yes i am still working on this topic, however i chose to focus on
Raaspbery Pi. It is quite handy to have an embedded linux to experiment
things. I do not have a public page on my projects at the moment, but
there is the Pharo-iot github project that gather work of the community
on the subject (https://github.com/pharo-iot). [1] 

Did you manage to launch Pharo on the Teensy boards? 

Steven. 

Le 2018-03-23 08:47, Jonathan van Alteren a écrit :

> Hi Steven,
> 
> I found your message and was wondering if you're still working on this.
> I did some IoT stuff with the little Teensy 3.2 boards, which I find very
> convenient to use. The new 3.6 board has more memory (1Mb flash and 256Kb
> RAM).
> 
> See info and seller here:
> - https://www.pjrc.com/teensy/techspecs.html
> - https://www.antratek.com/boards/arduino-compatible/teensy
> 
> Can I follow your progress anywhere?
> 
> Kind regards,
> Jonathan
> 
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html

  

Links:
--
[1] https://github.com/pharo-iot)


Re: [Pharo-users] how to load compiled code in the image and to change methods already on the stack?

2018-02-26 Thread Steven Costiou
Hi Pablo, 

thanks :) I will try Hermes. 

Basic scenario is adding/removing metalinks to a lot of a methods in an
iot app: 

1- If the add/remove occurs a lot of time, then there is a slowdown due
to recompilation of methods. As this is a remote app, i want to try
recompiling all methods locally then upload them. I will also try with
Hermes. 

2- If metalinks are put inside a loop that is running, for now i
understand i cannot update the method unless i replace it on the stack.
Experimenting that is somewhere in my todolist, but i'm taking any
advice ;) Maybe that is not really possible. 

Steven. 

Le 2018-02-26 10:36, teso...@gmail.com a écrit :

> Hi Steven,  
> 
> 1. You can use Hermes through a socket or a file. The only pre-requisite is 
> that both images run similar compatible compilers (usually you can use it 
> from and to Pharo 6.1 and 7) 
> 2. You can change the method, but if there is an activation context in the 
> stack everything can be wrong. If you change a method you should update the 
> program counter of the stack, and also any other thing can change (for 
> example, temporaries or literals).  
> Can you describe more the scenario where you want to change the method? 
> 
> Cheers,  
> 
> On Sat, Feb 24, 2018 at 11:23 AM, Steven Costiou  
> wrote:
> 
>> Hi, 
>> 
>> is this possible somehow to: 
>> 
>> - load compiled code in the image? like loading a compiled method instead of 
>> loading source then compiling it? 
>> 
>> - dynamically change a method that is on the stack? 
>> 
>> If so, how? :) 
>> 
>> Steven.
> 
> -- 
> Pablo Tesone.
> teso...@gmail.com

  

Re: [Pharo-users] how to load compiled code in the image and to change methods already on the stack?

2018-02-25 Thread Steven Costiou
Le 2018-02-25 08:37, Stephane Ducasse a écrit :

> On Sat, Feb 24, 2018 at 11:23 AM, Steven Costiou
>  wrote: 
> 
>> Hi,
>> 
>> is this possible somehow to:
>> 
>> - load compiled code in the image? like loading a compiled method instead of
>> loading source then compiling it?
> 
> why is this a problem?
> you could try to serialise a method with fuel and load it.

That is not necessarily a problem, I want to add new or modified methods
in remote iot applications, while Pharo is running. I'm experimenting
different ways to find which one suits me best. It works with TelePharo
for example, but the method has to be recompiled on the iot application
side. I was just wondering if Pharo provided a way to upload an already
compiled method. 

I will try fuel. But is fuel part of "standard" Pharo distribution? 

>> - dynamically change a method that is on the stack?
> 
> have a look at on:fork: to see how igor cut some stack elements

Thanks. 

Steven. 

  

[Pharo-users] how to load compiled code in the image and to change methods already on the stack?

2018-02-24 Thread Steven Costiou
Hi, 

is this possible somehow to: 

- load compiled code in the image? like loading a compiled method
instead of loading source then compiling it? 

- dynamically change a method that is on the stack? 

If so, how? :) 

Steven. 

Re: [Pharo-users] [Iliad] raw HTML in Iliad

2018-02-13 Thread Steven Costiou
Hi, 

i think just doing 

e html: '' 

also works. 

Elements should not be instantiated like you do, there is an interface
for each element that can be called on "e". 

e div, e html:, e h1:, etc. The interface instantiates the right class
behind. 

You can find this somewhere in the core classes, but i don"t remember
where and i can't check right now. 

Steven. 

Le 2018-02-13 09:20, Siemen Baader a écrit :

> Formulating the question helped me to find the solution after I posted:  
> 
> index
> ^ [ :e | e add: (ILRawHtmlElement new contents: 'hello 
> world') ] 
> 
> :) 
> 
> cheers, 
> Siemen 
> 
> On Tue, Feb 13, 2018 at 9:14 AM, Siemen Baader  wrote:
> 
>> Hi all,
>> 
>> is there a way to render raw HTML from Iliad widgets, or perhaps mustache 
>> templates? I'm interested in not using the builders always because I use an 
>> external web editor that generates plain HTML and that has some advantages 
>> in my workflow. 
>> 
>> Is it possible do it with Seaside & Reef instead? 
>> -- Siemen

-- 
kloum.io 

Re: [Pharo-users] Trying to test Phantom / aspects in Pharo

2018-01-15 Thread Steven Costiou
Hi, thanks for the info :) 

Is your version for pharo 6.0 somewhere i can download it ? 

Steven. 

Le 2018-01-15 19:17, alvaro piorno a écrit :

> Hi,  
> A friend and i worked on phatom to make it work on actual pharo versions(at 
> that momento was 6.0 or 6.1) and could make examples work and lot of tests to 
> pass. 
> My partner went deeper into this, maybe she can help. (sosa.ine...@gmail.com) 
> 
> 2018-01-14 21:31 GMT-03:00 Miguel Campusano :
> 
> As far as I know, this is a project for an undregard thesis and I believe it 
> is discontinued. If you contact Johan I will be glad to collaborate on this 
> for a good cause 
> 
> On Sat, Jan 13, 2018 at 10:24 AM Stephane Ducasse  
> wrote: You should ask Johan Fabry.
> Now working at Raincode in belgium.
> 
> Stef
> 
> On Sat, Jan 13, 2018 at 1:06 PM, Steven Costiou  
> wrote:
>> Hi,
>> 
>> i am trying to test PHANtom but so far i can't get it to work.
>> 
>> I found an image here https://pleiad.cl/research/software/phantom [1] and i 
>> made
>> it run on a vm from 2013.
>> 
>> But the examples crashes (PhantomDemo), and i cannot make my own examples
>> work either (simple object interception).
>> 
>> 
>> 
>> Which vm should i use ?
>> 
>> Is the image available in the link above still ok ?
>> 
>> By any chance, is there a version for Pharo 6 ?
>> 
>> 
>> 
>> Steven.
>> 
>> 
 

Links:
--
[1] https://pleiad.cl/research/software/phantom


Re: [Pharo-users] Trying to test Phantom / aspects in Pharo

2018-01-15 Thread Steven Costiou
Hi, 

i've made it work with an old Pharo 3 (by importing one class from Pharo
1.6 and commenting some code). 

I think everything works. 

It would be nice to have it on latest Pharo, but i have no idea what is
the effort of porting it. Also it could be interesting to change the
backend and use Reflectivity instead of method wrappers. I could work a
bit on it but probably not do everything. 

Steven. 

Le 2018-01-15 01:31, Miguel Campusano a écrit :

> As far as I know, this is a project for an undregard thesis and I believe it 
> is discontinued. If you contact Johan I will be glad to collaborate on this 
> for a good cause 
> 
> On Sat, Jan 13, 2018 at 10:24 AM Stephane Ducasse  
> wrote: 
> 
>> You should ask Johan Fabry.
>> Now working at Raincode in belgium.
>> 
>> Stef
>> 
>> On Sat, Jan 13, 2018 at 1:06 PM, Steven Costiou  
>> wrote:
>>> Hi,
>>> 
>>> i am trying to test PHANtom but so far i can't get it to work.
>>> 
>>> I found an image here https://pleiad.cl/research/software/phantom and i made
>>> it run on a vm from 2013.
>>> 
>>> But the examples crashes (PhantomDemo), and i cannot make my own examples
>>> work either (simple object interception).
>>> 
>>> 
>>> 
>>> Which vm should i use ?
>>> 
>>> Is the image available in the link above still ok ?
>>> 
>>> By any chance, is there a version for Pharo 6 ?
>>> 
>>> 
>>> 
>>> Steven.
>>> 
>>> 
 

[Pharo-users] Trying to test Phantom / aspects in Pharo

2018-01-13 Thread Steven Costiou
Hi, 

i am trying to test PHANtom but so far i can't get it to work. 

I found an image here https://pleiad.cl/research/software/phantom and i
made it run on a vm from 2013. 

But the examples crashes (PhantomDemo), and i cannot make my own
examples work either (simple object interception). 

Which vm should i use ? 

Is the image available in the link above still ok ? 

By any chance, is there a version for Pharo 6 ? 

Steven. 

  

[Pharo-users] How to justify text in pillar booklets ?

2018-01-03 Thread Steven Costiou
Hi, 

i am using the pillar booklet tools from
https://github.com/SquareBracketAssociates/Booklet-PublishingAPillarBooklet


How can i justify all paragraphs in the generated spiral book, instead
of having all of it aligned to left ? 

Steven. 

Re: [Pharo-users] Pharo things analog reads ?

2017-12-23 Thread Steven Costiou
I finally bought 2 of those chips, and it works very well. 

A simple file read from Pharo and i get my analog values (although i
don't understand them, but that has nothing to do with the reading). It
is very, very fast. 

Thanks again :) 

Steven. 

Le 2017-12-20 05:20, K K Subbu a écrit :

> On Wednesday 20 December 2017 03:50 AM, Steven Costiou wrote: 
> 
>> So connecting an Arduino-like device to the raspberry that is
>> configured as an i2c slave, Pharo can ask for analog values. I will
>> try tomorrow with analog sensors, I will share if i manage to build
>> nice examples.
>> 
>> Seems to be even easier using a special chip: 
>> https://learn.adafruit.com/reading-a-analog-in-and-controlling-audio-volume-with-the-raspberry-pi?view=all
> 
> An Arduino would be an overkill. Also, there is no need for bitbanging. 
> MCP3008 is are directly supported by the IIO subsystem and its channel data 
> is demuxed in /sys/bus/iio/devices/iio:device
> 
> http://www.jumpnowtek.com/rpi/Using-mcp3008-ADCs-with-Raspberry-Pis.html
> 
> HTH .. Subbu

  

Re: [Pharo-users] Pharo things analog reads ?

2017-12-20 Thread Steven Costiou
Thanks for the link, also ;) 

Le 2017-12-20 05:20, K K Subbu a écrit :

> On Wednesday 20 December 2017 03:50 AM, Steven Costiou wrote: 
> 
>> So connecting an Arduino-like device to the raspberry that is
>> configured as an i2c slave, Pharo can ask for analog values. I will
>> try tomorrow with analog sensors, I will share if i manage to build
>> nice examples.
>> 
>> Seems to be even easier using a special chip: 
>> https://learn.adafruit.com/reading-a-analog-in-and-controlling-audio-volume-with-the-raspberry-pi?view=all
> 
> An Arduino would be an overkill. Also, there is no need for bitbanging. 
> MCP3008 is are directly supported by the IIO subsystem and its channel data 
> is demuxed in /sys/bus/iio/devices/iio:device
> 
> http://www.jumpnowtek.com/rpi/Using-mcp3008-ADCs-with-Raspberry-Pis.html
> 
> HTH .. Subbu

  

Re: [Pharo-users] Pharo things analog reads ?

2017-12-20 Thread Steven Costiou
Yeah i know this exists, but i have none of these and i have plenty of
trinkets, and i need to do analog reads. I2c is interesting anyway, some
devices need it i believe. 

Le 2017-12-20 05:20, K K Subbu a écrit :

> On Wednesday 20 December 2017 03:50 AM, Steven Costiou wrote: 
> 
>> So connecting an Arduino-like device to the raspberry that is
>> configured as an i2c slave, Pharo can ask for analog values. I will
>> try tomorrow with analog sensors, I will share if i manage to build
>> nice examples.
>> 
>> Seems to be even easier using a special chip: 
>> https://learn.adafruit.com/reading-a-analog-in-and-controlling-audio-volume-with-the-raspberry-pi?view=all
> 
> An Arduino would be an overkill. Also, there is no need for bitbanging. 
> MCP3008 is are directly supported by the IIO subsystem and its channel data 
> is demuxed in /sys/bus/iio/devices/iio:device
> 
> http://www.jumpnowtek.com/rpi/Using-mcp3008-ADCs-with-Raspberry-Pis.html
> 
> HTH .. Subbu

  

Re: [Pharo-users] Pharo things analog reads ?

2017-12-19 Thread Steven Costiou
hi, 

i've tried i2c and added ffi calls in WiringPiLibrary. 

WIRINGPII2CSETUP: DEVID

^self ffiCall: #(int wiringPiI2CSetup (int devId) ) 

READI2C: FD

^self ffiCall: #(int wiringPiI2CRead (int fd)) 

Then the following script is able to read a byte from a connected device
(i tried with a trinket
https://learn.adafruit.com/introducing-trinket/introduction): [1] 

|lib addr val| 

lib := WiringPiLibrary uniqueInstance. 

addr := self wiringPiSetupI2C: 4. _"Setup the i2c to the 0x04 address"_
val := self readI2C: addr. _"Read a byte from the i2c address"_ 

val inspect 

So connecting an Arduino-like device to the raspberry that is configured
as an i2c slave, Pharo can ask for analog values. I will try tomorrow
with analog sensors, I will share if i manage to build nice examples. 

Seems to be even easier using a special chip:
https://learn.adafruit.com/reading-a-analog-in-and-controlling-audio-volume-with-the-raspberry-pi?view=all


but it uses more pins on the board. 

Steven. 

Le 2017-12-17 19:48, Denis Kudriashov a écrit :

> Hi Steven
> 
> 2017-12-17 12:40 GMT+01:00 Steven Costiou :
> 
>> Hi, 
>> 
>> For what i know, raspberry pi boards cannot read analog sensors (which are 
>> the most interesting imo), except by connecting to some kind of bridges or 
>> to Arduino boards. 
>> 
>> In the PharoTHings code i see that there are Arduino classes, and also it is 
>> based on wiringpi and wiringpi provides support for i2c which is needed to 
>> connect to an Arduino and perform analog reads. 
>> 
>> I'm exploring the wiringpi doc to see if there is an example for that, but 
>> in the meantime, would someone already have an example of analog reads with 
>> PharoThings, with working code (even simple) ?
> 
> It is in my todo. I need to build example with temperature sensor. I will 
> continue work on it next year. 
> Now feel free to contribute to the project. 
> 
> About Arduino: it is not finished. Problem that I use Mac but serial port is 
> not working there (it is required for Firmata) 
> 
>> Steven.
 

Links:
--
[1] https://learn.adafruit.com/introducing-trinket/introduction)


[Pharo-users] Pharo things analog reads ?

2017-12-17 Thread Steven Costiou
Hi, 

For what i know, raspberry pi boards cannot read analog sensors (which
are the most interesting imo), except by connecting to some kind of
bridges or to Arduino boards. 

In the PharoTHings code i see that there are Arduino classes, and also
it is based on wiringpi and wiringpi provides support for i2c which is
needed to connect to an Arduino and perform analog reads. 

I'm exploring the wiringpi doc to see if there is an example for that,
but in the meantime, would someone already have an example of analog
reads with PharoThings, with working code (even simple) ? 

Steven. 

Re: [Pharo-users] Metalinks arguments as Array ?

2017-12-13 Thread Steven Costiou
Ok, i found it digging the mailing list... 

Working example is in testReifySendArgsAsArray method, where it suffice
to use 

link options: #(argsAsArray). 

I should try searching in the list before asking... 

[Pharo-users] Metalinks arguments as Array ?

2017-12-13 Thread Steven Costiou
Hi, 

can we somehow provide an array of reifications to a metalink metaobject
? 

For ex.: 

link metaObject: [:args| do stuff with args]. 

link selector: #valueWithArguments:. 

link arguments: #(object node link receiver sender) 

So that when the link executes, args in the block would be an array
containing all wanted reifications ? 

This example does not work as is, because the number of reifications (5)
is different from the number of arguments taken by the selector (1). The
problem is that for blocks, i could use the #value: message, but it is
limited to #value:value:value:value:, so 4 arguments. Besides, if i want
10 reifications for example, i would not want to have a selector like
#value:value:value:value:value:value:value:value:value:value: ... 

Any ideas ? 

Steven. 

Re: [Pharo-users] reloading ffi library

2017-12-07 Thread Steven Costiou
Thanks :) 

Will try it :) 

Le 2017-12-07 16:41, Esteban Lorenzano a écrit :

> you need to reset FFI:  
> 
> FFIMethodRegistry resetAll. 
> 
> Esteban
> 
>> On 7 Dec 2017, at 16:04, Steven Costiou  wrote: 
>> 
>> Hi, 
>> 
>> noob question: i installed bloc and tried to run examples. 
>> 
>> It worked well on Fedora 27 but not on latest Debian 64 bits because the 
>> path of libcairo.so.2 was wrong. 
>> 
>> So i fixed it in the code, but when trying the bloc examples again the lib 
>> path is still wrong (in the debugger).
>> 
>> Is there a way to reload the cairo lib or to reset it, so that the path 
>> would be right and it would find the lib ?
>> 
>> Steven.

  

[Pharo-users] reloading ffi library

2017-12-07 Thread Steven Costiou
Hi, 

noob question: i installed bloc and tried to run examples. 

It worked well on Fedora 27 but not on latest Debian 64 bits because the
path of libcairo.so.2 was wrong. 

So i fixed it in the code, but when trying the bloc examples again the
lib path is still wrong (in the debugger). 

Is there a way to reload the cairo lib or to reset it, so that the path
would be right and it would find the lib ? 

Steven. 

Re: [Pharo-users] Calypso bugs with metalinks in latest 7

2017-12-07 Thread Steven Costiou
> To disable critiques look at Problems section in github Calypso [1]

 Aw... sorry. I didn't read the whole page before so i didn't see it...
thanks. 

Links:
--
[1] https://github.com/dionisiydk/Calypso#problems


[Pharo-users] Calypso bugs with metalinks in latest 7

2017-12-07 Thread Steven Costiou
Hi, 

running Reflectivity tests (e.g. ReflectivityReificationTest) provokes
errors and tests fails: 

RGMethodDefinition did not understand #isDeprecated. Seems to be located
in MetaLinkChanged calypso extension (the 4 methods provoke the same
bug). 

To reproduce it i used the launcher to get the latest pharo 7 and the
script from here to get Calypso https://github.com/dionisiydk/Calypso 

Also, is it possible to switch off ClyCriticsAnalysis ? I have problems
while experimenting with instance-specific metalinks, and i cannot yet
describe exactly how to reproduce it. I'd like to disable it until i can
fix bugs in my own work before reactivating it... 

Steven. 

Re: [Pharo-users] How to remove method body?

2017-12-03 Thread Steven Costiou
For example that works for me: 

|ast|
ast := (MyClass >> #printOn:) ast.
ast body: (MyClass >> #returnSelf) ast body.
MyClass compile: ast newSource 

Le 2017-12-03 23:42, Steven Costiou a écrit :

> Hi, 
> 
> just after your modifications, from the compiled method try: 
> 
> ObjSkeletonMock compile: self ast newSource 
> 
> Maybe not the most elegant but it works. 
> 
> Steven. 
> 
> Le 2017-12-03 22:31, Stephane Ducasse a écrit :
> 
>> Hi
>> 
>> to prepare some code for students I want to convert methods into a
>> kind of method skeleton
>> ie
>> 
>> printOn: aStream
>> "super nice comment"
>> lk;lk;
>> kl;;kl
>> k;lkl;k
>> ^ 42
>> 
>> into
>> 
>> printOn: aStream
>> "super nice comment"
>> ^ self
>> 
>> any idea?
>> 
>> In the past I know that we could access the method comment but I do
>> not find how to access the method signature (selector + variables).
>> 
>> So I'm trying at the AST level.
>> 
>> ((ObjSkeletonMock >> #methodToSkeletonize2) ast body:
>> (ObjSkeletonMock >> #returnSelf) ast body).
>> 
>> But I do not get how I can recompile this.
>> 
>> Stef
> 
> -- 
> kloum.io

-- 
kloum.io 

Re: [Pharo-users] How to remove method body?

2017-12-03 Thread Steven Costiou
Hi, 

just after your modifications, from the compiled method try: 

ObjSkeletonMock compile: self ast newSource 

Maybe not the most elegant but it works. 

Steven. 

Le 2017-12-03 22:31, Stephane Ducasse a écrit :

> Hi
> 
> to prepare some code for students I want to convert methods into a
> kind of method skeleton
> ie
> 
> printOn: aStream
> "super nice comment"
> lk;lk;
> kl;;kl
> k;lkl;k
> ^ 42
> 
> into
> 
> printOn: aStream
> "super nice comment"
> ^ self
> 
> any idea?
> 
> In the past I know that we could access the method comment but I do
> not find how to access the method signature (selector + variables).
> 
> So I'm trying at the AST level.
> 
> ((ObjSkeletonMock >> #methodToSkeletonize2) ast body:
> (ObjSkeletonMock >> #returnSelf) ast body).
> 
> But I do not get how I can recompile this.
> 
> Stef

-- 
kloum.io 

Re: [Pharo-users] Bloc texts font size

2017-10-20 Thread Steven Costiou
Thanks Alex. 

Not much success with this trick however, do you use scaleTo:,
scaleBy:.. ? and on the BlTextElement or on the BrRopedText ? 

It also seems that some sizes work better, like 45, 55, and 70 are ok
aswell as everything under 40. I'll try to avoid the problematic sizes
for the moment. 

Unfortunately i am on linux and have trouble with brick and Moz2D,
specifically on raspberry pi - but otherwise just bloc works fine so
i'll stick with it for now :) 

Steven. 

Le 2017-10-20 19:52, Aliaksei Syrel a écrit :

> Hi Steven, 
> 
> It is a known Cairo + Freetype bug. If you are on OSX try to install 
> #development version of Bloc/Brick that uses Moz2D as rendering backend. 
> Cairo does not support named fonts because it there is no system fonts 
> lookup. Moz2D supports it. 
> 
> One way to fix strange font size is to apply scaling by 1.0001. Text 
> measurement will still be broken, though... 
> 
> Other than that you code looks good! 
> 
> Cheers, 
> Alex 
> On 20 October 2017 at 15:04, Steven Costiou  wrote:
> 
>> Hi, 
>> 
>> i am trying to set the font size of a BlTextElement, and i do not have much 
>> success. I use the following code to add the text element, where 'model' is 
>> a string. 
>> 
>> First, if the string is '0.0' then the font size is correct (see 
>> screenshot). But, if for example the value is '21.0' then the font size is 
>> wrong (see the other screenshot). I don't understand, i've tried variants 
>> but it seems to me that this code was the right way to do it. Sometimes, a 
>> '9' would be displayed at the correct font size, sometimes not. Any ideas ? 
>> 
>> text := BlTextElement new
>> text:
>> ((BrRopedText string: model)
>> attributes:
>> {(BrTextForegroundAttribute paint: (Color green alpha: 0.8)).
>> (BrFontSizeAttribute size: 60).
>> (BrFontWeightAttribute weight: 50).
>> (BrFontGenericFamilyAttribute monospace).
>> "(BrFontFamilyAttribute named: 'Source Sans Pro')"});
>> yourself. 
>> 
>> text
>> constraintsDo: [ :c | 
>> c frame horizontal alignCenter.
>> c frame vertical alignCenter ].
>> 
>> "text is added to a parent BlElement"
>> self addChild: text 
>> 
>> Second, i don't have the impression that changing the font family does have 
>> any effect (but maybe its my local setup i don't know...). 
>> 
>> Steven.
 

[Pharo-users] Bloc texts font size

2017-10-20 Thread Steven Costiou
Hi, 

i am trying to set the font size of a BlTextElement, and i do not have
much success. I use the following code to add the text element, where
'model' is a string. 

First, if the string is '0.0' then the font size is correct (see
screenshot). But, if for example the value is '21.0' then the font size
is wrong (see the other screenshot). I don't understand, i've tried
variants but it seems to me that this code was the right way to do it.
Sometimes, a '9' would be displayed at the correct font size, sometimes
not. Any ideas ? 

text := BlTextElement new
text:
((BrRopedText string: model)
attributes:
{(BrTextForegroundAttribute paint: (Color green
alpha: 0.8)).
(BrFontSizeAttribute size: 60).
(BrFontWeightAttribute weight: 50).
(BrFontGenericFamilyAttribute monospace).
"(BrFontFamilyAttribute named: 'Source Sans
Pro')"});
yourself. 

text
constraintsDo: [ :c | 
c frame horizontal alignCenter.
c frame vertical alignCenter ].

"text is added to a parent BlElement"
self addChild: text 

Second, i don't have the impression that changing the font family does
have any effect (but maybe its my local setup i don't know...). 

Steven. 

Re: [Pharo-users] How to recover selections in a fastlist after an update

2017-10-13 Thread Steven Costiou
Hi Ben, sure. 

This is my browser entry point: 

adaptationsBrowser
| browser |
browser := GLMTabulator new.
browser
row: [ :r | 
r
column: #adaptations;
column: #objects;
column: #methods ].
browser row: #diff.
browser transmit
to: #adaptations;
andShow: [ :a :adaptations | self adaptations: adaptations in: a
].
^ browser 

adaptations: adaptations in: composite
| list |
list := composite fastList.
list title: 'Adaptations'.
list display: adaptations.
adaptationsList := list. 

So my problem is that this adaptation list may change overtime. So
periodically the #step method is called, the adaptation collection is
updated and i also call #update to refresh the browser. However, if an
adaptation was selected in the list, then calling #update will reset
this selection. 

Le 2017-10-13 13:33, Ben Coman a écrit :

> On Fri, Oct 13, 2017 at 5:53 PM, Steven Costiou  
> wrote:
> 
>> Hi, 
>> 
>> I am using fastlists in a browser inspired from glmexamples, and when i use 
>> a stepping and that i update the browser (update method) all selections in 
>> lists are lost. 
>> 
>> Is there an automatic way to recover the selections or does it have to be 
>> handled in my code ? If so, i don't understand how to recover my selection, 
>> if i kept the fastlist in a var, doing list selection: myObject does not do 
>> anything. 
>> 
>> Steven.
> Sorry I don't know the answer, I don't know much about this part of Pharo, 
> but I'd like to learn more.  Would it be possible for you to attach a minimal 
> code example, so when an answer does come in, I'll have a chance to learn 
> more about fastlist? 
> 
> cheers -ben

  

[Pharo-users] How to recover selections in a fastlist after an update

2017-10-13 Thread Steven Costiou
Hi, 

I am using fastlists in a browser inspired from glmexamples, and when i
use a stepping and that i update the browser (update method) all
selections in lists are lost. 

Is there an automatic way to recover the selections or does it have to
be handled in my code ? If so, i don't understand how to recover my
selection, if i kept the fastlist in a var, doing list selection:
myObject does not do anything. 

Steven. 

Re: [Pharo-users] how to update a pane in a customized inspector

2017-10-10 Thread Steven Costiou
It works :) Thanks :) 

Yes that is the video i was looking for :) 

Le 2017-10-10 13:26, Andrei Chis a écrit :

> Hi, 
> 
> On Tue, Oct 10, 2017 at 11:31 AM, Steven Costiou  
> wrote:
> 
>> Hi, 
>> 
>> I am trying to customize an inspector with a code browser, and I have in a 
>> compose method of my own browser the following: 
>> 
>> [...] 
>> 
>> browser transmit
>> from: #methods;
>> fromOutsidePort: #entity;
>> to: #source;
>> when: [ :method | method notNil ];
>> andShow: [ :a :method :object | self sourceOf: method for: object in: a ].
>> 
>> browser transmit
>> from: #links;
>> fromOutsidePort: #entity;
>> to: #selectedLink;
>> when: [ :link | link notNil ];
>> andShow: [ :a :link | self inspectSelectedLink: link inPresenter: a ]. 
>> 
>> [...] 
>> 
>> Is there an easy way to update the #source pane whenever one of my links is 
>> selected in my #link pane ? 
>> 
>> In my case, the source code is displayed first, and when i select a link in 
>> the #link pane i want to highlight specific parts of this source code and 
>> the easiest way would be to re-trigger the first block above. I did not try 
>> it, but it seems that i could retrieve the #source pane and the selected 
>> method manually and re-trigger the method from the second block (i.e. when a 
>> link is selected), but i am not sure that is the right way to do it...
> 
> If you know the interval that you want to highlight when selecting a link, 
> you can create a transmission from the #selection port of the #link pane to 
> the #selectionInterval port of the #source pane. If you go to 
> GLMBasicExamples, textPortsExamples and textSelection show how to use the 
> selectionInterval port. 
> 
>> Also i was wondering if there was a video of the moldable inspector tutorial 
>> from pharo days 17 somewhere on the web, because i did not find it on 
>> youtube.
> Not sure if the Pharo Days videos are available but you can see the same 
> presentation from ESUG here: https://www.youtube.com/watch?v=wj5IWvAYSlw  
> 
> Cheers, 
> Andrei
 

[Pharo-users] how to update a pane in a customized inspector

2017-10-10 Thread Steven Costiou
Hi, 

I am trying to customize an inspector with a code browser, and I have in
a compose method of my own browser the following: 

[...] 

browser transmit
from: #methods;
fromOutsidePort: #entity;
to: #source;
when: [ :method | method notNil ];
andShow: [ :a :method :object | self sourceOf: method
for: object in: a ].

browser transmit
from: #links;
fromOutsidePort: #entity;
to: #selectedLink;
when: [ :link | link notNil ];
andShow: [ :a :link | self inspectSelectedLink: link
inPresenter: a ]. 

[...] 

Is there an easy way to update the #source pane whenever one of my links
is selected in my #link pane ? 

In my case, the source code is displayed first, and when i select a link
in the #link pane i want to highlight specific parts of this source code
and the easiest way would be to re-trigger the first block above. I did
not try it, but it seems that i could retrieve the #source pane and the
selected method manually and re-trigger the method from the second block
(i.e. when a link is selected), but i am not sure that is the right way
to do it... 

Also i was wondering if there was a video of the moldable inspector
tutorial from pharo days 17 somewhere on the web, because i did not find
it on youtube. 

Re: [Pharo-users] Hiding the cursor in pharo and/or bloc

2017-10-03 Thread Steven Costiou
Thanks Denis :) It works :) 

Its pretty nice for touch-sensitive apps :) 

Steven. 

Le 2017-10-03 10:13, Denis Kudriashov a écrit :

> Hi. 
> Look at Cursor class side. All cursor bitmaps are in class variables. If you 
> will replace all of them with blank cursor then cursor will be always blank.  
> Something like this: 
> 
>> Cursor classVariables associationsDo: [ :each | each value: Cursor blank ]
> 
> 2017-10-03 9:38 GMT+02:00 Steven Costiou :
> 
> Ah, thanks. So i will look at Morphic to see if i can do that. 
> 
> Steven.
> 
> Le 2017-10-02 22:30, Aliaksei Syrel a écrit : 
> Hi Steven, 
> 
> What you see is not Bloc's cursor (there is no cursor in bloc) 
> It is a Morphic cursor :) 
> 
> Cheers, 
> Alex 
> On 2 October 2017 at 22:19, Steven Costiou  wrote:
> 
> Hi, 
> 
> i've been playing with bloc, and i am trying to completely remove the cursor 
> (i.e. always display a blank cursor). I can't find how. Removing the Pharo 
> cursor would also be ok, but i can't either. I can only show a blank cursor 
> for a few moments but after moving the mouse too much it becomes normal 
> again. 
> 
> I have tried: 
> 
> Cursor currentCursor: Cursor blank (seems not to work ?) 
> 
> Cursor blank beCursor (works for a few moments only...) 
> 
> Any way to do that permanently ? 
> 
> Steven.

  

Re: [Pharo-users] Hiding the cursor in pharo and/or bloc

2017-10-03 Thread Steven Costiou
Ah, thanks. So i will look at Morphic to see if i can do that. 

Steven. 

Le 2017-10-02 22:30, Aliaksei Syrel a écrit :

> Hi Steven, 
> 
> What you see is not Bloc's cursor (there is no cursor in bloc) 
> It is a Morphic cursor :) 
> 
> Cheers, 
> Alex 
> On 2 October 2017 at 22:19, Steven Costiou  wrote:
> 
>> Hi, 
>> 
>> i've been playing with bloc, and i am trying to completely remove the cursor 
>> (i.e. always display a blank cursor). I can't find how. Removing the Pharo 
>> cursor would also be ok, but i can't either. I can only show a blank cursor 
>> for a few moments but after moving the mouse too much it becomes normal 
>> again. 
>> 
>> I have tried: 
>> 
>> Cursor currentCursor: Cursor blank (seems not to work ?) 
>> 
>> Cursor blank beCursor (works for a few moments only...) 
>> 
>> Any way to do that permanently ? 
>> 
>> Steven.

  

[Pharo-users] Hiding the cursor in pharo and/or bloc

2017-10-02 Thread Steven Costiou
Hi, 

i've been playing with bloc, and i am trying to completely remove the
cursor (i.e. always display a blank cursor). I can't find how. Removing
the Pharo cursor would also be ok, but i can't either. I can only show a
blank cursor for a few moments but after moving the mouse too much it
becomes normal again. 

I have tried: 

Cursor currentCursor: Cursor blank (seems not to work ?) 

Cursor blank beCursor (works for a few moments only...) 

Any way to do that permanently ? 

Steven. 

Re: [Pharo-users] How to find if a method is being executed in a given process

2017-09-25 Thread Steven Costiou
Le 2017-09-25 17:47, Stephane Ducasse a écrit :

> This is exactly my usecase, i need to remove code that may be called
> by a method on the stack - and i know exactly which method. However my
> base hypothesis is that it is in an already running process (maybe a
> loop) and that part i cannot change. Is there an existing Pharo
> implementation of MethodWrappers ?
> 
> How can you remove a method if it may be called?
> 
> Stef

Lets say i have the following method: 

m 

^self m1 

I have dynamically changed the code of m for a specific object o by the
following: 

m 

self m2. 

^self m1 

m2 is behavior that is dynamically added to the object o. 

If i want to revert the object o to its original behavior, that will
change back m and remove m2, i must be sure that the changed m is not on
the stack, else it could still call m2 that no longer exists. 

Actually i tried Ben's suggestion, and it works. I just ask the process
to run until the method i target is popped out of the stack and then i
can remoev my code. 

Steven. 

Re: [Pharo-users] How to find if a method is being executed in a given process

2017-09-25 Thread Steven Costiou
Le 2017-09-25 12:21, jtuc...@objektfabrik.de wrote : 

> Steven
> 
> You could add use a semaphore if changing code is an option.
> We once used MethodWrappers in VAST to answer a similar question regarding 
> whether a body of code can be removed from a system.
> 
> Joachim

This is exactly my usecase, i need to remove code that may be called by
a method on the stack - and i know exactly which method. However my base
hypothesis is that it is in an already running process (maybe a loop)
and that part i cannot change. Is there an existing Pharo implementation
of MethodWrappers ? 

Le 2017-09-25 14:32, Ben Coman wrote :

> I'm not sure if your wanting something more built in, or just "some way", 
> 
> so for the latter, consider wrapping in with your own status flags... 
> 
> status := #setup. 
> watcher := [[true] whileTrue:[  
> Transcript crShow: status.  
> 900 milliSeconds wait] 
> ] forkAt:36. 
> result := 0. 
> worker := [[true] whileTrue:[  
> status := #WORKING.  
> 1 second wait. 
> result := result + 1.  
> Transcript crShow: result.  
> status:=#waiting.  
> 3 seconds wait] 
> ] forkAt:35. 
> worker suspend. 
> worker resume. 
> 
> cheers -ben

 I want to avoid adding control in the code, because hypothetically the
process i want to check is already running and possibly written by
somebody else. I've think about a similar solution using metalinks, but
if the loop is on the stack then i don't know what i can do. 

Le 2017-09-25 12:42, Marcus Denker a wrote :

> you could iterate all processes, there then get the stack and look up the 
> sender chain
> if the method is somewhere to be found. If yes -> it is exectuted right now. 
> One problem is that which methods are on the stack changes, so you should 
> try to avoid process switches while doing the analysis. 
> 
> Marcus

Ok so if i know which process to analyse, i can just do something like
the following that i found in the Halt class: 

[ cntxt isNil ] whileFalse: [ 
cntxt selector = aSelector ifTrue: [ ... ].
cntxt := cntxt sender ] 

But if i actually found the method i was looking for on the stack, can i
somehow ask the suspended context to "execute" until it returns from
this method ? 

Steven. 

  

[Pharo-users] How to find if a method is being executed in a given process

2017-09-25 Thread Steven Costiou
Hi, 

how can i know if a given method is being executed ? 

For ex.: 

process := [[mycondition] whileTrue:[ myObject doStuff. myDelay wait]]
fork 

I want to suspend process and find if doStuff is being executed or if
process is waiting. 

How could i do that ? 

Steven. 

Re: [Pharo-users] Metalinks UI... ?

2017-08-28 Thread Steven Costiou
Thank you :) 

I will look into that :) 

Steven. 

Le 2017-08-28 20:15, Peter Uhnák a écrit :

> Maybe this? https://github.com/peteruhnak/metalinks-toolkit 
> It also enables/adds the browser icons. 
> 
> However, the toolkit was more towards preserving the metalinks when a method 
> changed... anyway, it is document. 
> 
> In metalink-wrapper branch there are also two undocumented classes 
> simplifying a bit the usage of metalinks, but I forgot to merge it and 
> document it... so. :) 
> 
> Peter 
> 
> On Mon, Aug 28, 2017 at 7:48 PM, Steven Costiou  
> wrote:
> 
> Yes there are the suggestions, but they provide already configured metalinks. 
> I am much more looking for a ui - even very basic - which allows to configure 
> a metalink options (target node, metaobject, selector, etc.). 
> 
> How can i enable the browser iconswe can see in your images for my own 
> metalinks ? 
> 
> Steven.
> 
> Le 2017-08-28 19:04, Peter Uhnák a écrit : 
> Maybe in Nautilus browser? 
> 
> When you right-click on a piece of code, in suggestions you see couple of 
> options to add metalinks that do some particular things. 
> 
> and then you have a ui for it 
> 
> You can also enable something similar for when you have your own metalink 
> attached to a particular AST node. 
> 
> Peter 
> 
> On Mon, Aug 28, 2017 at 4:28 PM, Steven Costiou  
> wrote:
> 
> Hi, 
> 
> i think somebody told me (i do not remember who) that an other somebody 
> (whose name i don't remember either) made a very basic UI for metalink 
> creation or management. Would somebody know of such project and where to find 
> it ? 
> 
> Thanks, 
> 
> Steven.

  

Re: [Pharo-users] Metalinks UI... ?

2017-08-28 Thread Steven Costiou
Yes there are the suggestions, but they provide already configured
metalinks. I am much more looking for a ui - even very basic - which
allows to configure a metalink options (target node, metaobject,
selector, etc.). 

How can i enable the browser iconswe can see in your images for my own
metalinks ? 

Steven. 

Le 2017-08-28 19:04, Peter Uhnák a écrit :

> Maybe in Nautilus browser? 
> 
> When you right-click on a piece of code, in suggestions you see couple of 
> options to add metalinks that do some particular things. 
> 
> and then you have a ui for it 
> 
> You can also enable something similar for when you have your own metalink 
> attached to a particular AST node. 
> 
> Peter 
> 
> On Mon, Aug 28, 2017 at 4:28 PM, Steven Costiou  
> wrote:
> 
>> Hi, 
>> 
>> i think somebody told me (i do not remember who) that an other somebody 
>> (whose name i don't remember either) made a very basic UI for metalink 
>> creation or management. Would somebody know of such project and where to 
>> find it ? 
>> 
>> Thanks, 
>> 
>> Steven.
 

[Pharo-users] Metalinks UI... ?

2017-08-28 Thread Steven Costiou
Hi, 

i think somebody told me (i do not remember who) that an other somebody
(whose name i don't remember either) made a very basic UI for metalink
creation or management. Would somebody know of such project and where to
find it ? 

Thanks, 

Steven. 

Re: [Pharo-users] Looking for small boards and tiny computers which can run Pharo

2017-07-30 Thread Steven Costiou
Hi, 

thanks everybody for all the leads. I will look into all those :) 

Steven. 

Le 2017-07-25 19:11, Bruce O'Neel a écrit :

> Hi, 
> 
> With a bit of work it probably fits on one of these: 
> 
> https://onion.io/omega2/ 
> 
> If you feel on really wasting space this would work as well, though it would 
> need some porting if you wanted to run it locally. 
> 
> https://getchip.com/pages/pocketchip 
> 
> If you don't want the display and keyboard and want to run it remote this 
> will work then, it's the CPU from the above. 
> 
> https://getchip.com/pages/chip 
> 
> If I get some free time I can poke at these and see how well Squeak etc runs. 
> 
> cheers 
> 
> bruce 
> 
> _24 July 2017 21:30 Steven Costiou  wrote:_ 
> 
>> Hi, 
>> 
>> i am looking for: 
>> 
>> - small hardware, boards/computers, "embeddable" devices, etc. that can run 
>> Pharo (except Raspberry pi that i already know) 
>> 
>> - robots, flying drones or things alike with an open linux which can 
>> possibly run Pharo 
>> 
>> Could somebody points me to documentation or web sites where such things can 
>> be found ? 
>> 
>> Thanks, 
>> 
>> Steven.
 

[Pharo-users] Looking for small boards and tiny computers which can run Pharo

2017-07-24 Thread Steven Costiou
Hi, 

i am looking for: 

- small hardware, boards/computers, "embeddable" devices, etc. that can
run Pharo (except Raspberry pi that i already know) 

- robots, flying drones or things alike with an open linux which can
possibly run Pharo 

Could somebody points me to documentation or web sites where such things
can be found ? 

Thanks, 

Steven. 

Re: [Pharo-users] Anonymous classes performances

2017-06-17 Thread Steven Costiou
I spent my day testing and comparing execution speed between classes and
anonymous subclasses when i tried to compare two sets of values between
pharo classes: they also differ. 

In fact it seems that every instruction has a different execution speed
if we run it enough times. So it seems impossible to precisely compare
execution time between anon classes and pharo classes, at least i don't
know how to do it. I computed confidence intervals of various measures,
the differences in execution time that exist between classes and
anonymous classes can be between -2% to + 9%. But comparing sets of
speed between pharo classes, i also have similar intervals (but smaller,
from -2% speed to +5% speed). 

So maybe they have similar performances, at least sometimes they do and
sometimes one is slightly faster than the other, but in the end it is
not possible to tell. But maybe i'm looking for something which does not
even exist, maybe anonymous classes are designed to be as fast as
regular classes ? Or maybe it is common to have such variability when
benchmarking code ? 

Does it exist any instruction in pharo with a constant execution time ?
(or it could be possible with one million years to compute enough speed
tests and do an accurate mean...) 

Steven. 

Le 2017-06-16 18:14, Steven Costiou a écrit :

> You can find the code below. I just change the call to m by m1 to test the 
> two methods. 
> 
> I started again in a fresh pharo 6 image and now the results seem all similar 
> for the following code. I will do all my tests again to see if it was my 
> fault but it takes a lot of time (2 hours for each full test). 
> 
> What sould be the expected results ? Should an instance of an anonymous class 
> be as fast as a regular instance when calling the same code, being defined in 
> the anon class or its super class ? 
> 
> A implements m ^100 printString and B subclass of A implements m1 ^100 
> printString 
> 
> a := B new. 
> 
> class := A newAnonymousSubclass 
> addSlot: (InstanceVariableSlot named: #y); compile: 'm1
> ^100 printString'; yourself.
> c := A new becomeForward: class new.
> 
> res := Dictionary new.
> col1 := OrderedCollection new.
> col2 := OrderedCollection new. 
> 
> 1 timesRepeat: [
> Smalltalk garbageCollect .
> col1 add: [100 timesRepeat: [ a m ]] timeToRun]. 
> 
> 1 timesRepeat: [
> Smalltalk garbageCollect .
> col2 add: [100 timesRepeat: [ c m ]] timeToRun]. 
> 
> res at: 'a' put: col1.
> res at: 'c' put: col2.
> res inspect
 

Re: [Pharo-users] Anonymous classes performances

2017-06-16 Thread Steven Costiou
You can find the code below. I just change the call to m by m1 to test
the two methods. 

I started again in a fresh pharo 6 image and now the results seem all
similar for the following code. I will do all my tests again to see if
it was my fault but it takes a lot of time (2 hours for each full test).


What sould be the expected results ? Should an instance of an anonymous
class be as fast as a regular instance when calling the same code, being
defined in the anon class or its super class ? 

A implements m ^100 printString and B subclass of A implements m1 ^100
printString 

a := B new. 

class := A newAnonymousSubclass 
addSlot: (InstanceVariableSlot named: #y); compile: 'm1
^100 printString'; yourself.
c := A new becomeForward: class new.

res := Dictionary new.
col1 := OrderedCollection new.
col2 := OrderedCollection new. 

1 timesRepeat: [
Smalltalk garbageCollect .
col1 add: [100 timesRepeat: [ a m ]] timeToRun]. 

1 timesRepeat: [
Smalltalk garbageCollect .
col2 add: [100 timesRepeat: [ c m ]] timeToRun]. 

res at: 'a' put: col1.
res at: 'c' put: col2.
res inspect 

Steven. 

Le 2017-06-16 17:31, Denis Kudriashov a écrit :

> Hi Steven. 
> 
> Could you show code which you measure? 
> 
> 2017-06-16 17:17 GMT+02:00 Steven Costiou :
> 
>> I have been playing a bit with anonymous subclasses, and instances of anon 
>> subclasses seem slower to execute code than "regular" subclasses instances, 
>> but sometimes they reach equivalent performances (for code defined in 
>> anon-subclasses). I don't understand why.
>> 
>> I have a class A with a method m. 
>> B is subclass of A with a new method m1.
>> Anon-A is an anonymous class of A which also implements the m1 method.
>> 
>> I did various tests of speed and:
>> 
>> - when executing m, compiled in A, instances of Anon-A are around 10% slower 
>> than instances of B
>> 
>> - when executing m1, compiled in B and in Anon-A, performances are 
>> equivalent between instances of B and of anon-A
>> 
>> Is that a particular behavior of anonymous subclasses, like their instances 
>> can easily find behavior defined in their class but have to perform 
>> extra-work to find methods defined in their superclass (which is not 
>> anonymous) ? Is that vm related ? Other ? 
>> 
>> Steven.

  

[Pharo-users] Anonymous classes performances

2017-06-16 Thread Steven Costiou
I have been playing a bit with anonymous subclasses, and instances of
anon subclasses seem slower to execute code than "regular" subclasses
instances, but sometimes they reach equivalent performances (for code
defined in anon-subclasses). I don't understand why.

I have a class A with a method m. 
B is subclass of A with a new method m1.
Anon-A is an anonymous class of A which also implements the m1 method.

I did various tests of speed and:

- when executing m, compiled in A, instances of Anon-A are around 10%
slower than instances of B

- when executing m1, compiled in B and in Anon-A, performances are
equivalent between instances of B and of anon-A

Is that a particular behavior of anonymous subclasses, like their
instances can easily find behavior defined in their class but have to
perform extra-work to find methods defined in their superclass (which is
not anonymous) ? Is that vm related ? Other ? 

Steven. 

Re: [Pharo-users] About how to benchmark the lookup speed...

2017-06-15 Thread Steven Costiou
Hi, 

i added the garbage collect and the numbers are better ! There are
fluctuations but no more "random-like" variations of the measured
values. 

I computed the standard error which is, for all measures i did, inferior
to 0.5% of the mean (then the confidence interval is good). 

Thank you both :) 

Steven. 

Le 2017-06-14 22:08, werner kassens a écrit :

> On 06/14/2017 09:12 PM, Steven Costiou wrote: 
> 
>> repetitions timesRepeat:[ results add: [100 timesRepeat:[o m]] 
>> timeToRun].
> 
> Hi Steven, 
> 
> the influence of the garbage collector is in cases like these often somewhat 
> difficult to forecast. i would eventually change the code to: 
> 
> repetitions timesRepeat:[ Smalltalk garbageCollect. results add: [100 
> timesRepeat:[o m]] timeToRun]. 
> 
> and if i wanted to see the influence of the garbage collector i would enlarge 
> repetitions and diminish 100 in such a way that the product remains 
> constant. of course one would not want to destroy that influence completely 
> as in the real world it always takes its toll.
> werner

  

Re: [Pharo-users] About how to benchmark the lookup speed...

2017-06-14 Thread Steven Costiou
Thanks Peter :) 

I will make these computations tomorrow at the lab and see what the
confidence interval looks like. 

Steven. 

Le 2017-06-14 20:03, PBKResearch a écrit :

> Steven 
> 
> The question you need to consider is how much the results vary from one 
> repetition to another. If they are very variable, then the average will still 
> be variable. In the case of your 100 repetitions, for instance, you can work 
> out a confidence interval for the mean quite easily. Find the mean and 
> standard deviation of the 100 repetitions; the standard error of the mean is 
> the sample standard deviation divided by the square root of the number of 
> values averaged (i.e. 10 in this case); the approximate 95% confidence 
> interval is the mean +/- twice the standard error of the mean. (This makes a 
> lot of simplifying assumptions, but should be sufficient for your purposes.) 
> 
> If, as I suspect, the width of the confidence interval is quite large in 
> relation to the mean, this means that you cannot consistently measure the 
> speed of operations like this. You could try greatly increasing the number of 
> repetitions, but the square root law is working against you. 10,000 
> repetitions would give you an interval about 10% of the width of 100 
> repetitions, 1,000,000 repetitions would reduce it to 1%. 
> 
> Hope this is helpful 
> 
> Peter Kenny 
> 
> FROM: Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] ON BEHALF OF 
> Steven Costiou
> SENT: 14 June 2017 18:14
> TO: Pharo users users 
> SUBJECT: [Pharo-users] About how to benchmark the lookup speed... 
> 
> Hi, 
> 
> i'm having trouble doing benchmarks in Pharo, at least i don't understand the 
> results (maybe i'm missing something). I want to compare anonymous subclasses 
> lookup speed with standard pharo classes lookup speed. 
> 
> I have a method m and a method m2 that execute the following code: ^ 100 
> printString. I have implemented these 2 methods in one class then in one 
> anonymous subclass. I thought that measuring the execution speed of the same 
> code in these two different cases would give me different times if the lookup 
> speed was not the same. 
> 
> So I did the following: 
> 
> |o results repetitions | 
> 
> o := theClass new. 
> 
> results := OrderedCollection new. 
> 
> repetitions := 100. 
> 
> repetitions timesRepeat:[ results add: [100 timesRepeat:[o m]] 
> timeToRun]. 
> 
> I do the same for m2, and then i compute an average of all the values 
> measured in results. 
> 
> What i don't understand is that, for example, for an average on 100 
> measurements, m is 1% slower and m2 is 2% faster in the Pharo class case than 
> with anonymous subclasses. But for 1 000 measurements, m is 11% faster but m2 
> is 3% slower. Results continue to vary as i change the number of 
> measurements, but they do not increase with it (seems not to be linear). 
> 
> I don't have enough knowledge about how to benchmark code, or what will make 
> a difference in Pharo. For now the only explanations i have is that maybe the 
> results are too slow to be significant and then they can vary, or i have done 
> something wrong in how i measure it. 
> 
> How would you measure the lookup speed of a method ? 
> 
> Steven.
 

[Pharo-users] About how to benchmark the lookup speed...

2017-06-14 Thread Steven Costiou
Hi, 

i'm having trouble doing benchmarks in Pharo, at least i don't
understand the results (maybe i'm missing something). I want to compare
anonymous subclasses lookup speed with standard pharo classes lookup
speed. 

I have a method m and a method m2 that execute the following code: ^
100 printString. I have implemented these 2 methods in one class then in
one anonymous subclass. I thought that measuring the execution speed of
the same code in these two different cases would give me different times
if the lookup speed was not the same. 

So I did the following: 

|o results repetitions | 

o := theClass new. 

results := OrderedCollection new. 

repetitions := 100. 

repetitions timesRepeat:[ results add: [100 timesRepeat:[o m]]
timeToRun]. 

I do the same for m2, and then i compute an average of all the values
measured in results. 

What i don't understand is that, for example, for an average on 100
measurements, m is 1% slower and m2 is 2% faster in the Pharo class case
than with anonymous subclasses. But for 1 000 measurements, m is 11%
faster but m2 is 3% slower. Results continue to vary as i change the
number of measurements, but they do not increase with it (seems not to
be linear). 

I don't have enough knowledge about how to benchmark code, or what will
make a difference in Pharo. For now the only explanations i have is that
maybe the results are too slow to be significant and then they can vary,
or i have done something wrong in how i measure it. 

How would you measure the lookup speed of a method ? 

Steven. 

Re: [Pharo-users] Remote debugger: do i need identical images ?

2017-06-12 Thread Steven Costiou
Le 2017-06-12 16:27, Denis Kudriashov a écrit :

> Hi. 
> 
> 2017-06-12 16:03 GMT+02:00 Steven Costiou :
> 
>> Hi, 
>> 
>> when using the Pharo remote debugger, we have a server side (the remote 
>> application) and a client side (the local computer used to debug). 
>> 
>> Apart from the remote debugger itself, do both images need to have exactly 
>> the same code - especially the application itself - or could they be 
>> different ? 
>> 
>> More specifically, to debug a program, do i need a local "clone" image 
>> dedicated to debug the remote image ?
> No. Client development image not needs any code of your remote application. 
> 
> Only requirement is same version of PharmIDE related projects on both images.

Thanks :) 

[Pharo-users] Remote debugger: do i need identical images ?

2017-06-12 Thread Steven Costiou
Hi, 

when using the Pharo remote debugger, we have a server side (the remote
application) and a client side (the local computer used to debug). 

Apart from the remote debugger itself, do both images need to have
exactly the same code - especially the application itself - or could
they be different ? 

More specifically, to debug a program, do i need a local "clone" image
dedicated to debug the remote image ? 

Steven. 

Re: [Pharo-users] How to migrate an object to a subclass of its class but with new inst vars ?

2017-06-07 Thread Steven Costiou
Hmm ok, but can i easily make b become a again later ? I guess i would
just need to instanciate a new a... 

But would it not be faster to just change the class (which finally works
with a little tuning) ? 

I can't test right now but i will compare the two things... 

Le 2017-06-07 21:59, Denis Kudriashov a écrit :

> 2017-06-07 16:43 GMT+02:00 Steven Costiou :
> 
>> Yes but when you do that you loose all the states from "a" (at least the 
>> values). You have to do state migration management...
> 
> You just need extra step to copy all state from old object: 
> 
>> b := B new.
> 
>> b copyFrom: a.
> 
>> a becomeForward: b.
 

Re: [Pharo-users] How to migrate an object to a subclass of its class but with new inst vars ?

2017-06-07 Thread Steven Costiou
Yes but when you do that you loose all the states from "a" (at least the
values). You have to do state migration management... 

Le 2017-06-07 16:18, Denis Kudriashov a écrit :

> 2017-06-07 14:53 GMT+02:00 Steven Costiou :
> 
>> I want to do the following: 
>> 
>> B adoptInstance: a 
>> 
>> It does'nt work, for what i understand it is because the format of the 
>> classes are different (B has an inst var and A has not).
> 
> Yes, #adopt checks class format.  
> Use need to use #become to achieve what you want: 
> 
>> a becomeForward: B new

  

Re: [Pharo-users] How to migrate an object to a subclass of its class but with new inst vars ?

2017-06-07 Thread Steven Costiou
I managed to do it :) 

What i did not say is that the subclasses (with new inst var) i want to
use are anonymous subclasses. 

So i subclassed the SlotClassBuilder and i did: 

- generate an anonymous subclass from the source class 

- migrate my object 

- modify the anonymous subclass with new instance variables 

- rebuild the class with my own SlotClassBuilder 

It seems to work. I did not try how to migrate back my object to its
original class but i think i might have a problem there. Also it seems
very slow. 

Indeed it is a very certain, specific application :) 

Steven. 

Le 2017-06-07 15:32, Blondeau Vincent a écrit :

> So, I do not think that is possible... 
> 
> Any solution I see is either to change the superclass or to add an external 
> object with a mapping between your new objects and the values of your new 
> IVs. 
> 
> Or you do the migration and after you add the IV once all instances are 
> migrated. 
> 
> But, I repeat that, as written in comments of primitiveChangeClassTo,  "The 
> facility is really provided for certain, very specific applications (mostly 
> related to classes changing shape) and not for casual use." 
> 
> Vincent 
> 
> DE : Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] DE LA PART DE 
> Steven Costiou
> ENVOYÉ : mercredi 7 juin 2017 15:18
> À : Any question about pharo is welcome
> OBJET : Re: [Pharo-users] How to migrate an object to a subclass of its class 
> but with new inst vars ? 
> 
> Hi Vincent, thanks for your quick answer. 
> 
> This is the default behavior of adoptInstance: which calls 
> primitiveChangeClassTo: 
> 
> But i specifically want to gain new inst vars, which does not work that way. 
> 
> I can't add an instvar to the superclass since i don't want to change my 
> system. 
> 
> Steven. 
> 
> Le 2017-06-07 15:09, Blondeau Vincent a écrit :
> 
>> Hi, 
>> 
>> You should be able to do it using the method primitiveChangeClassTo: but it 
>> not recommended to do it. Are you sure that it is the only way to resolve 
>> your problem? 
>> 
>> If you really want to, an example: 
>> 
>> Object subclass: #Toto 
>> 
>> slots: { #tata } 
>> 
>> classVariables: {  } 
>> 
>> category: 'Temp'. 
>> 
>> Toto subclass: #Titi 
>> 
>> slots: {  } 
>> 
>> classVariables: {  } 
>> 
>> category: 'Temp'. 
>> 
>> obj := Toto new. 
>> 
>> obj primitiveChangeClassTo: Titi new. 
>> 
>> obj has a new class. 
>> 
>> However, you cannot add a new instance variable this way but you keep the 
>> values of the instance. 
>> 
>> But nothing avoid you to add an empty instance variable in a superclass that 
>> only the subclass will use. 
>> 
>> I hope that it will help you 
>> 
>> Vincent 
>> 
>> DE : Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] DE LA PART DE 
>> Steven Costiou
>> ENVOYÉ : mercredi 7 juin 2017 14:54
>> À : Pharo users users
>> OBJET : [Pharo-users] How to migrate an object to a subclass of its class 
>> but with new inst vars ? 
>> 
>> Hi, 
>> 
>> i'm trying to migrate an object from a given class A to a subclass of A with 
>> new inst vars. Can't get it to work. 
>> 
>> I have a class and an instance of it, say: 
>> 
>> Object subclass: #A
>> instanceVariableNames: '' 
>> 
>> |a| 
>> 
>> a := A new. 
>> 
>> A has no instance variables. Now i create a subclass B of A with a new inst 
>> var: 
>> 
>> A subclass: #B
>> instanceVariableNames: 'x' 
>> 
>> I want to do the following: 
>> 
>> B adoptInstance: a 
>> 
>> It does'nt work, for what i understand it is because the format of the 
>> classes are different (B has an inst var and A has not). 
>> 
>> How can i make the a object become an instance of B (subclass of a's class), 
>> making a acquiring the new inst var x (and in more complex cases keeping its 
>> own previous inst vars) ? 
>> 
>> Steven.
 

Re: [Pharo-users] How to migrate an object to a subclass of its class but with new inst vars ?

2017-06-07 Thread Steven Costiou
Hi Vincent, thanks for your quick answer. 

This is the default behavior of adoptInstance: which calls
primitiveChangeClassTo: 

But i specifically want to gain new inst vars, which does not work that
way. 

I can't add an instvar to the superclass since i don't want to change my
system. 

Steven. 

Le 2017-06-07 15:09, Blondeau Vincent a écrit :

> Hi, 
> 
> You should be able to do it using the method primitiveChangeClassTo: but it 
> not recommended to do it. Are you sure that it is the only way to resolve 
> your problem? 
> 
> If you really want to, an example: 
> 
> Object subclass: #Toto 
> 
> slots: { #tata } 
> 
> classVariables: {  } 
> 
> category: 'Temp'. 
> 
> Toto subclass: #Titi 
> 
> slots: {  } 
> 
> classVariables: {  } 
> 
> category: 'Temp'. 
> 
> obj := Toto new. 
> 
> obj primitiveChangeClassTo: Titi new. 
> 
> obj has a new class. 
> 
> However, you cannot add a new instance variable this way but you keep the 
> values of the instance. 
> 
> But nothing avoid you to add an empty instance variable in a superclass that 
> only the subclass will use. 
> 
> I hope that it will help you 
> 
> Vincent 
> 
> DE : Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] DE LA PART DE 
> Steven Costiou
> ENVOYÉ : mercredi 7 juin 2017 14:54
> À : Pharo users users
> OBJET : [Pharo-users] How to migrate an object to a subclass of its class but 
> with new inst vars ? 
> 
> Hi, 
> 
> i'm trying to migrate an object from a given class A to a subclass of A with 
> new inst vars. Can't get it to work. 
> 
> I have a class and an instance of it, say: 
> 
> Object subclass: #A
> instanceVariableNames: '' 
> 
> |a| 
> 
> a := A new. 
> 
> A has no instance variables. Now i create a subclass B of A with a new inst 
> var: 
> 
> A subclass: #B
> instanceVariableNames: 'x' 
> 
> I want to do the following: 
> 
> B adoptInstance: a 
> 
> It does'nt work, for what i understand it is because the format of the 
> classes are different (B has an inst var and A has not). 
> 
> How can i make the a object become an instance of B (subclass of a's class), 
> making a acquiring the new inst var x (and in more complex cases keeping its 
> own previous inst vars) ? 
> 
> Steven. 
> !!!*
> "Ce message et les pièces jointes sont confidentiels et réservés à l'usage 
> exclusif de ses destinataires. Il peut également être protégé par le secret 
> professionnel. Si vous recevez ce message par erreur, merci d'en avertir 
> immédiatement l'expéditeur et de le détruire. L'intégrité du message ne 
> pouvant être assurée sur Internet, la responsabilité de Worldline ne pourra 
> être recherchée quant au contenu de ce message. Bien que les meilleurs 
> efforts soient faits pour maintenir cette transmission exempte de tout virus, 
> l'expéditeur ne donne aucune garantie à cet égard et sa responsabilité ne 
> saurait être recherchée pour tout dommage résultant d'un virus transmis.
> 
> This e-mail and the documents attached are confidential and intended solely 
> for the addressee; it may also be privileged. If you receive this e-mail in 
> error, please notify the sender immediately and destroy it. As its integrity 
> cannot be secured on the Internet, the Worldline liability cannot be 
> triggered for the message content. Although the sender endeavours to maintain 
> a computer virus-free network, the sender does not warrant that this 
> transmission is virus-free and will not be liable for any damages resulting 
> from any virus transmitted.!!!"

-- 
kloum.io 

[Pharo-users] How to migrate an object to a subclass of its class but with new inst vars ?

2017-06-07 Thread Steven Costiou
Hi, 

i'm trying to migrate an object from a given class A to a subclass of A
with new inst vars. Can't get it to work. 

I have a class and an instance of it, say: 

Object subclass: #A
instanceVariableNames: '' 

|a| 

a := A new. 

A has no instance variables. Now i create a subclass B of A with a new
inst var: 

A subclass: #B
instanceVariableNames: 'x' 

I want to do the following: 

B adoptInstance: a 

It does'nt work, for what i understand it is because the format of the
classes are different (B has an inst var and A has not). 

How can i make the a object become an instance of B (subclass of a's
class), making a acquiring the new inst var x (and in more complex cases
keeping its own previous inst vars) ? 

Steven. 

Re: [Pharo-users] A benchmarking package or lib ?

2017-05-25 Thread Steven Costiou
Thank you all for your answers :) 

I will have a look into all that :) 

Steven. 

[Pharo-users] A benchmarking package or lib ?

2017-05-25 Thread Steven Costiou
Hi, 

is there any benchmark library for Pharo ? that would provide tools to
choose metrics to measure between two versions of the same code and
maybe display a comparison or something (whatever the form of the
report) ? 

I've found BenchmarkResult in Pharo but it seems very basic, at least
there are no detailed examples of how it could be used. 

I'm specifically looking for a way to measure the speed of method calls
(if that is possible) or the memory usage, but i'm also curious in
general about what is measureable and try different benchmarks to see
the results. So if there were a tool already doing all this work... ? 

Steven. 

  

Re: [Pharo-users] Working with remote debugger: how to debug something happening in the remote image ?

2017-05-10 Thread Steven Costiou
It works :) 

Thanks :) 

Le 2017-05-10 14:22, Denis Kudriashov a écrit :

> 2017-05-10 13:49 GMT+02:00 Steven Costiou :
> 
>> Then i do openPlayground and TestClass new inspect ->  i got an inspector on 
>> the proxy object. If i do "self test inspect" inside it, i got the same 
>> debugger opening, telling me the error but with the "proxy stack" and not 
>> the test method where the problem is. Basically it seems that everything i 
>> try to remotely execute from the local image falls into this case. I did not 
>> try to start a process when starting the remote image so maybe this works. 
>> My question is, is there a way to remotely execute (user) code that will 
>> open the debugger on the "right" stack ? (or did i do something wrong ?)
> 
> Currently to get real debugger from playground script you need evaluate fork 
> over expression. For example following code in remote playground: 
> 
>> [1/0] fork
> 
> it will open debugger on remote process. But if you just execute "1/0" then 
> you will got local debugger with "RemoteException~" title without remote 
> stack. 
> 
> It works like that because remote request itself handles failures and 
> transfers them as result back to local image. It is suitable strategy for 
> many cases and it is most simple and safe to implement. But now there is no 
> way how to setup another strategy to open remote debugger.  
> So to escape internal communication handler you need fork evaluated 
> expression. When remote image produces unhandled error it will spawn debugger 
> which will be connected remote debugger in our case. That's why #fork is 
> needed: to ensure unhandled failures.  
> 
> I not hide this specifics inside remote playground because during debugging 
> of all this remote tools it is suitable to just see communication failure 
> instead of remote debugger. When remote debugger is opening it also 
> communicates with remote side and if communication logic is broken it leads 
> to infinite recursion and frozen image. 
> In future I will make this behaviour natural (like in local playground) but 
> right now my scenario is: 
> - evaluate desired code in playground. 
> - if It fails ( RemoteException with description of actual failure) then wrap 
> it with fork and got remote debugger.

  

Re: [Pharo-users] Working with remote debugger: how to debug something happening in the remote image ?

2017-05-10 Thread Steven Costiou
> If you want to fight with it then my first idea would be to find how method 
> AST is built in sugs menu. Then try to look at senders of 
> #astForStylingInCalypso which was implemented to support styling of remote 
> methods. Try to use it somehow for sugs menu too. 
> Maybe it will fix everything

Yes, i will have a look - i need the right click menu to properly work
so i need that to be fixed. The workaround i used was to just disable
suggestions by returning empty suggs collections, but i will see if i
can do something better. 

Thanks Denis. 

Re: [Pharo-users] Working with remote debugger: how to debug something happening in the remote image ?

2017-05-10 Thread Steven Costiou
Ok, so there is this problem. I just wanted to try the debugger on it. 

But i have the same problem with my own user code. For example i did
open a remote browser, create a test package with a class TestClass and
a method test>>^'1', 0. 

Then i do openPlayground and TestClass new inspect ->  i got an
inspector on the proxy object. If i do "self test inspect" inside it, i
got the same debugger opening, telling me the error but with the "proxy
stack" and not the test method where the problem is. Basically it seems
that everything i try to remotely execute from the local image falls
into this case. I did not try to start a process when starting the
remote image so maybe this works. My question is, is there a way to
remotely execute (user) code that will open the debugger on the "right"
stack ? (or did i do something wrong ?) 

Le 2017-05-10 13:21, Denis Kudriashov a écrit :

> Problem that right now many thinks in browser are not supported in remote 
> scenario: most of refactorings are not work and as you see suggestion menu 
> not works too. 
> 
> It is local tools problem, the way how local tools communicate with remote 
> environment to perform particular operations. When you try debug such 
> operations local debugger stops at the place of remote request. Distributed 
> debugger (which shows multiple process stacks) is not done. But it will not 
> help here. 
> 
> Generally there are many cases when transparent remoting is not working. And 
> to fix concrete scenario proper model is needed which is taken into account 
> that it can be distributed across network borders. 
> In this case suggestion menu operates with local AST-nodes of remote method 
> which is required non trivial logic to be handled properly. 
> 
> Anyway these features will be supported in future.. 
> 
> 2017-05-10 11:28 GMT+02:00 Steven Costiou :
> 
>> While configuring my local and remote images to work with the remote 
>> debugger, there was a bug with the menu in the remote browser. So i wanted 
>> to try the debugger and figure out what was the problem using it, but i do 
>> not understand how to proceed. When the debugger opens, all i see is the 
>> fact that there was a remote problem, and that the proxy was unable to 
>> return a proper value.
>> 
>> I used a local image connected with a headless remote image. To reproduce 
>> the bug, go for example in ByteString >> at:put:, right click after the 
>> first dot and click "debug". See suggs-menu-bug.png. 
>> 
>> When doing that i get debug-win.png and suggs-debug.png and as you can see i 
>> just know there was an error and what it was but i don't have an open 
>> debugger as i would normally expect in Pharo. How can i see the real problem 
>> occuring in the remote image ? How can i remotely fix this considering that 
>> my remote image is headless and it seems to be a problem tied to the remote 
>> thing, because locally it doesn't happen ? (or maybe it is a Calypso problem 
>> but anyway i cannot debug it...) 
>> 
>> Steven.

  

Re: [Pharo-users] Working with remote debugger: how to debug something happening in the remote image ?

2017-05-10 Thread Steven Costiou
Le 2017-05-10 11:28, Steven Costiou a écrit :

> While configuring my local and remote images to work with the remote 
> debugger, there was a bug with the menu in the remote browser. So i wanted to 
> try the debugger and figure out what was the problem using it, but i do not 
> understand how to proceed. When the debugger opens, all i see is the fact 
> that there was a remote problem, and that the proxy was unable to return a 
> proper value.
> 
> I used a local image connected with a headless remote image. To reproduce the 
> bug, go for example in ByteString >> at:put:, right click after the first dot 
> and click "debug". See suggs-menu-bug.png. 
> 
> When doing that i get debug-win.png and suggs-debug.png and as you can see i 
> just know there was an error and what it was but i don't have an open 
> debugger as i would normally expect in Pharo. How can i see the real problem 
> occuring in the remote image ? How can i remotely fix this considering that 
> my remote image is headless and it seems to be a problem tied to the remote 
> thing, because locally it doesn't happen ? (or maybe it is a Calypso problem 
> but anyway i cannot debug it...) 
> 
> Steven.

Hem, i forgot to say that i did that in a remote browser after sending
openBrowser to a PRRemotePharo 

Re: [Pharo-users] Remote Debugger bugs ?

2017-05-10 Thread Steven Costiou
> I found the issue. Debugging remote UI process is not supported well. When 
> you close debugger remote UI process is terminated which makes remote image 
> unresponsive. 
> But it is not completely frozen. You can spawn new UI process remotely: 
> 
>> remotePharo evaluate: [ UIManager default spawnNewProcess  ].
> 
> Or from remote playground just evaluate it directly: 
> 
>> UIManager default spawnNewProcess

Thanks, it works :) 

> I will think how to support it properly.  
> I wondering do you just play or you have real requirements for this scenario? 
> (I not thought it is important)

No i am playing with it while configuring my images. It's easier to test
things on both images with the uis when doing that. In the end i will
embed the remote image in a raspberry pi and access it remotely, so the
ui will (absolutely) not be needed. However, it is conceivable to have a
desktop app that i want to connect to for example if a remote user
experiences problems and i want to query things or to ask the user to
perform operations. 
If i do such queries i can make mistakes and i would have to
proceed/abandon/close debug windows. In this case both will need a ui. 

Re: [Pharo-users] Remote Debugger bugs ?

2017-05-09 Thread Steven Costiou
Hi Denis,

> 2017-05-09 17:22 GMT+02:00 Steven Costiou :
> 
>> I evaluated "1/0" in a playground in the remote image, and the exception 
>> opens in my local image. Now if i clic "abandon", the local image is ok but 
>> the remote is frozen. If i clic "proceed", the local image is frozen and the 
>> remote is ok.
> 
> Could you try just close window instead of abandon. I will check later but I 
> never use this button in my workflow.

Same problem. 

>> So using the remote browser from my local image, i created a test class with 
>> a test method that does "^'1', 0" and i execute it in the remote image. The 
>> debugger opens the local image and i can debug it "^'1', 0 printString", 
>> accept and proceed. The inspector opens with the return value in the remote 
>> image and the local image is frozen again.
> Normally it should work. I will try your scenario. 
> 
> What the platform for local and remote images? both 32bits?  And how bad is 
> network connection?

I use two images on the same computer (so its on localhost), using
windows 7 64 bits but the two images are 32bits (pharo 6 60483). 

Steven. 

[Pharo-users] Remote Debugger bugs ?

2017-05-09 Thread Steven Costiou
Hi, 

i'm confused with how to configure the remote debugger. I used this link
to configure my images:
http://dionisiydk.blogspot.fr/2017/01/pharmide-pharo-remote-ide-to-develop.html


I evaluated "1/0" in a playground in the remote image, and the exception
opens in my local image. Now if i clic "abandon", the local image is ok
but the remote is frozen. If i clic "proceed", the local image is frozen
and the remote is ok. 

So using the remote browser from my local image, i created a test class
with a test method that does "^'1', 0" and i execute it in the remote
image. The debugger opens the local image and i can debug it "^'1', 0
printString", accept and proceed. The inspector opens with the return
value in the remote image and the local image is frozen again. 

The only solution i have is to kill the image. I used Windows 7 for
these tests. Is there anything i missed besides the configurations steps
in the link above ? 

RemoteBrowser and RemotePlayground seem to work fine, except some
problems with the contextual menus in the browser. 

Re: [Pharo-users] How to listen for source code change in the image ?

2017-05-04 Thread Steven Costiou
Thanks :) 

Le 2017-05-04 13:55, Thierry Goubier a écrit :

> You need to register to the system announcer singleton to receive the 
> MethodModified event, with, for example: 
> 
> SystemAnnouncer uniqueInstance when: MethodModified send: #aMethodUpdated: 
> to: self 
> 
> Regards, 
> 
> Thierry 
> 
> 2017-05-04 13:40 GMT+02:00 Steven Costiou :
> 
>> Hi, 
>> 
>> where should i look at if i want a class of mine to be notified of any 
>> source code change in the image ? 
>> 
>> Specifically i want to know if anything changed about a method (or its ast 
>> method node), anything that could happen like a refactoring operation or a 
>> source code change. 
>> 
>> Steven.

  

[Pharo-users] How to listen for source code change in the image ?

2017-05-04 Thread Steven Costiou
Hi, 

where should i look at if i want a class of mine to be notified of any
source code change in the image ? 

Specifically i want to know if anything changed about a method (or its
ast method node), anything that could happen like a refactoring
operation or a source code change. 

Steven. 

Re: [Pharo-users] looking for tools to manually select ast nodes for metalinks

2017-03-20 Thread Steven Costiou
Hi Ben, Guille, 

thanks !!! I will look into that =) 

Steven. 

Le 2017-03-20 10:39, Guillermo Polito a écrit :

> Hi Steven, 
> 
> Yes there is! It's called "Suggestions". Suggestions is a project started 
> some years ago by Gisela Decuzzi as an intern of RMoD. The main idea is to 
> propose actions based on the AST corresponding to the cursor. This means that 
> given the position of the cursor, suggestions already: 
> 
> - parses the code 
> - selects the corresponding node 
> - provides possible actions for the node. E.g., 
> - refactorings 
> - code navigation 
> - breakpoints and watchpoints (through Metalinks) 
> 
> Check the SmartSuggestions package. 
> 
> Guille 
> 
> On Mon, Mar 20, 2017 at 1:12 AM, Ben Coman  wrote:
> 
>> On Mon, Mar 20, 2017 at 4:06 AM, Steven Costiou  
>> wrote:
>>> Hi,
>>> 
>>> i would like a way to define metalinks at debug time, by "visually"
>>> selecting ast nodes in the debugger. For example i would like to see a
>>> method that i am debugging and by a clic on the source code it would select
>>> the associated ast node and allow me to put a metalink right there.
>>> 
>>> - does that exist ?
>> 
>> This might get you close...
>> 
>> Debug into...
>> 1 printString
>> 
>> In Variables tab, select "thisContext"
>> 
>> In Raw tab, select method
>> 
>> In AST tab, select your node.
>> 
>> From there on, I don't know.   Please report back if you get something to 
>> work.
>> 
>>> 
>>> - if not, does a tool to display or to navigate through metalinks already
>>> exists ?
>> 
>> I don't think so.  Pharo 6 has only the first step of having the basic
>> underlying system implemented.
>> 
>> cheers -ben
>> 
>>> 
>>> - if not any, can somebody point me to documentation and/or ressources to
>>> extend the debugger so i can try to build it ? (i've already seen the spec
>>> book to build ui but i want to see what is possible with the debugger)

-- 
kloum.io 

[Pharo-users] looking for tools to manually select ast nodes for metalinks

2017-03-19 Thread Steven Costiou
Hi, 

i would like a way to define metalinks at debug time, by "visually"
selecting ast nodes in the debugger. For example i would like to see a
method that i am debugging and by a clic on the source code it would
select the associated ast node and allow me to put a metalink right
there. 

- does that exist ? 

- if not, does a tool to display or to navigate through metalinks
already exists ? 

- if not any, can somebody point me to documentation and/or ressources
to extend the debugger so i can try to build it ? (i've already seen the
spec book to build ui but i want to see what is possible with the
debugger) 

Thanks, 

Steven. 

  

Re: [Pharo-users] adding messages dinamically to a single instance object

2017-03-03 Thread Steven Costiou
Hi, 

could you describe why you need this ? Do you have a usecase ? 

Just interested to know, as i work on similar mechanisms. 

Steven. 

Le 2017-03-03 14:55, Pablo R. Digonzelli a écrit :

> Thanks Denis, I will take a look . I think this is what  i need. 
> 
> Tia 
> 
> -
> ING. PABLO DIGONZELLI
> Software Solutions
> IP-Solutiones SRL 
> Dividato SA
> 25 de Mayo 521 
> San Miguel de Tucumán 
> Email: pdigonze...@softsargentina.com
> pdigonze...@gmail.com
> Cel: 5493815982714 
> 
> -
> 
> DE: "Denis Kudriashov" 
> PARA: "Any question about pharo is welcome" 
> ENVIADOS: Viernes, 3 de Marzo 2017 10:11:53
> ASUNTO: Re: [Pharo-users] adding messages dinamically to a single instance 
> object 
> 
> Hi.
> Look at project Talents https://github.com/tesonep/pharo-talents. 
> Idea is to implement behaviour (also with state) in normal way with classes 
> and then dynamically install it to any existing objects 
> 
> 2017-03-03 14:07 GMT+01:00 Pablo R. Digonzelli :
> 
>> Hi all. I need to know how can i do if i want add new behaviour ( a new 
>> method ) to a single instance object of a class.  
>> It means not to add new selector to the class but i want a single instance 
>> responds that mesage.  
>> Where can i read about it? 
>> Tia 
>> 
>> -
>> ING. PABLO DIGONZELLI
>> Software Solutions
>> IP-Solutiones SRL 
>> Dividato SA
>> 25 de Mayo 521 
>> San Miguel de Tucumán 
>> Email: pdigonze...@softsargentina.com
>> pdigonze...@gmail.com
>> Cel: 5493815982714

-- 
kloum.io 

Re: [Pharo-users] [Deployement] Apache rewrite rules for Pharo

2017-01-18 Thread Steven Costiou
Hi, 

not sure that's what you are looking for but for my Pharo images with
Iliad applications i just add the following to my website vhost in the
/etc/apache directory: 

ProxyPass / http://localhost:/
ProxyPassReverse / http://localhost:/ 

That redirects all queries to my domain to this local url, for example
http://my-domain.com/iliad => http://localhost:/iliad 

Works fine but i don't even know if its the right thing to do (security
blabla...). I'm interested if someone knows a simpler procedure. 

Steven. 

Le 2017-01-18 18:22, Blondeau Vincent a écrit :

> Hi, 
> 
> I need to put on the same server and access through the port 80 several Pharo 
> images. 
> 
> I know that it is possible to do it thanks to the apache rewrite rules to 
> redirect outside urls http://myserver:80/myservice to internal ones: 
> http://localhost:8080 [1]. 
> 
> Did someone already make such a config and can share the xml of the 
> configuration file? 
> 
> Thanks in advance, 
> 
> Cheers, 
> 
> Vincent Blondeau 
> 
> !!!*
> "Ce message et les pièces jointes sont confidentiels et réservés à l'usage 
> exclusif de ses destinataires. Il peut également être protégé par le secret 
> professionnel. Si vous recevez ce message par erreur, merci d'en avertir 
> immédiatement l'expéditeur et de le détruire. L'intégrité du message ne 
> pouvant être assurée sur Internet, la responsabilité de Worldline ne pourra 
> être recherchée quant au contenu de ce message. Bien que les meilleurs 
> efforts soient faits pour maintenir cette transmission exempte de tout virus, 
> l'expéditeur ne donne aucune garantie à cet égard et sa responsabilité ne 
> saurait être recherchée pour tout dommage résultant d'un virus transmis.
> 
> This e-mail and the documents attached are confidential and intended solely 
> for the addressee; it may also be privileged. If you receive this e-mail in 
> error, please notify the sender immediately and destroy it. As its integrity 
> cannot be secured on the Internet, the Worldline liability cannot be 
> triggered for the message content. Although the sender endeavours to maintain 
> a computer virus-free network, the sender does not warrant that this 
> transmission is virus-free and will not be liable for any damages resulting 
> from any virus transmitted.!!!"

  

Links:
--
[1] http://monserver:8080


Re: [Pharo-users] "self problem" with Ghost (virus)

2016-07-28 Thread Steven Costiou
Thank you very much =) 

It works perfectly ! 

Steven. 

Le 2016-07-28 14:05, Denis Kudriashov a écrit :

> Steven, I fixed it. 
> Load development version (or just this: 
> Ghost-ObjectVirus-DenisKudryashov.12). 
> 
> I will update stable soon 
> 
> 2016-07-28 13:46 GMT+02:00 Steven Costiou :
> 
> Ok by digging a bit, i found that it was a problem in my behavior though i 
> don't understand it. 
> 
> When sending message to self, the #isMetaMessage: returns always true when 
> evaluating the first test condition GHCurrentMetaLevelDepth value > 0 ifTrue: 
> [ ^true ]. The value returns something higher than 0 and my "self messages" 
> are considered to be meta-messages. It is very sensible to modifications, as 
> just removing this test or try to bend it can freezes the image (just tried 
> to see what would happen). 
> 
> I'm a bit lost, what should i do to consider "self messages" not "meta" in 
> the behavior ?
> 
> Le 2016-07-28 12:33, Steven Costiou a écrit : 
> 
> Hi, 
> 
> I think i am missing something. 
> 
> For example in the following code (took from the tests): 
> 
> | victim virus actual |
> virus := GHObjectVirus behaviour: GHGhostBehaviourStub new.
> 
> victim := 0@0 corner: 3@4.
> virus infect: victim.
> victim corner 
> 
> The evaluation is trapped by the send:to: method in the behavior (i've put a 
> halt there). However if i replace the "corner" message by an inspect of the 
> victim, and if i evaluate "self corner", then the message is processed 
> without going through the send:to: method of the behavior. It is not halted 
> and the victim responds immediately to the message. I have also tried to add 
> a new method in the Rectangle class that calls "self corner". When called in 
> the playground, my new message is trapped but not the "corner" sent to self. 
> 
> From what i understand it could be related to the behavior i use, but i don't 
> see what's missing.
> 
> Le 2016-07-28 11:35, Denis Kudriashov a écrit : 
> I think I not understood second part of "self problem" in this paper. But 
> self sends are covered by virus as I described. 
> 
> 2016-07-28 11:30 GMT+02:00 Denis Kudriashov :
> 
> Hi 
> 
> 2016-07-27 22:19 GMT+02:00 Steven Costiou :
> 
> Hi, 
> 
> I use virus from Ghost to intercept messages sent to a given object and adapt 
> methods behaviors for this particular object only. However it would seems 
> that doing interception this way is subject to the "self problem" described 
> in this paper from Stéphane (DUCASSE, Stéphane. Evaluating message passing 
> control techniques in Smalltalk. _JOURNAL OF OBJECT ORIENTED PROGRAMMING_, 
> 1999, vol. 12, p. 39-50). 
> 
> I understand i could do instance based adaptation using an other technique, 
> but i wonder if there is any way with Ghost to deal with this "self problem" 
> problem ? I think "self problem" is only related to classic proxies when 
> objects stay behind them. But ObjectVirus is not proxy in this meaning. When 
> you infect your object by virus it is not replaced by somebody else. It is 
> same original instance but with overridden behaviour. That's why I call it 
> virus without any relation to proxies. 
> Any message to infected object is processed by your behaviour. All self sends 
> are intercepted. But there are few exceptions: 
> - special messages like ==,ifTrue/ifNil are not intercepted
> - meta messages are not intercepted. They processed by Ghost mechanics but 
> they not passed to your behaviour. Meta messages defined by #currentMetaLevel 
> of your behaviour. You could implement it like: 
> 
> YourGhostBehaviour>>currentMetaLevel 
> ^GHMetaLevel empty 
> 
> Empty meta level means that all messages will be passed to your behaviour. 
> There is also "GHMetaLevel standard" which is default one. It makes most of 
> "tool messages" not interceptable. For example #printString, #class, 
> #instVarAt: will be not intercepted. It's messages which are usually used by 
> tools like inspector and debugger.  
> Standard meta level simplifies debugging of new behaviours. If you make 
> mistake somewhere standard messages will be not broken and you could debug 
> error by tools.

  

Re: [Pharo-users] "self problem" with Ghost (virus)

2016-07-28 Thread Steven Costiou
Ok by digging a bit, i found that it was a problem in my behavior though
i don't understand it. 

When sending message to self, the #isMetaMessage: returns always true
when evaluating the first test condition GHCurrentMetaLevelDepth value >
0 ifTrue: [ ^true ]. The value returns something higher than 0 and my
"self messages" are considered to be meta-messages. It is very sensible
to modifications, as just removing this test or try to bend it can
freezes the image (just tried to see what would happen). 

I'm a bit lost, what should i do to consider "self messages" not "meta"
in the behavior ? 

Le 2016-07-28 12:33, Steven Costiou a écrit :

> Hi, 
> 
> I think i am missing something. 
> 
> For example in the following code (took from the tests): 
> 
> | victim virus actual |
> virus := GHObjectVirus behaviour: GHGhostBehaviourStub new.
> 
> victim := 0@0 corner: 3@4.
> virus infect: victim.
> victim corner 
> 
> The evaluation is trapped by the send:to: method in the behavior (i've put a 
> halt there). However if i replace the "corner" message by an inspect of the 
> victim, and if i evaluate "self corner", then the message is processed 
> without going through the send:to: method of the behavior. It is not halted 
> and the victim responds immediately to the message. I have also tried to add 
> a new method in the Rectangle class that calls "self corner". When called in 
> the playground, my new message is trapped but not the "corner" sent to self. 
> 
> From what i understand it could be related to the behavior i use, but i don't 
> see what's missing.
> 
> Le 2016-07-28 11:35, Denis Kudriashov a écrit : 
> I think I not understood second part of "self problem" in this paper. But 
> self sends are covered by virus as I described. 
> 
> 2016-07-28 11:30 GMT+02:00 Denis Kudriashov :
> 
> Hi 
> 
> 2016-07-27 22:19 GMT+02:00 Steven Costiou :
> 
> Hi, 
> 
> I use virus from Ghost to intercept messages sent to a given object and adapt 
> methods behaviors for this particular object only. However it would seems 
> that doing interception this way is subject to the "self problem" described 
> in this paper from Stéphane (DUCASSE, Stéphane. Evaluating message passing 
> control techniques in Smalltalk. _JOURNAL OF OBJECT ORIENTED PROGRAMMING_, 
> 1999, vol. 12, p. 39-50). 
> 
> I understand i could do instance based adaptation using an other technique, 
> but i wonder if there is any way with Ghost to deal with this "self problem" 
> problem ? I think "self problem" is only related to classic proxies when 
> objects stay behind them. But ObjectVirus is not proxy in this meaning. When 
> you infect your object by virus it is not replaced by somebody else. It is 
> same original instance but with overridden behaviour. That's why I call it 
> virus without any relation to proxies. 
> Any message to infected object is processed by your behaviour. All self sends 
> are intercepted. But there are few exceptions: 
> - special messages like ==,ifTrue/ifNil are not intercepted
> - meta messages are not intercepted. They processed by Ghost mechanics but 
> they not passed to your behaviour. Meta messages defined by #currentMetaLevel 
> of your behaviour. You could implement it like: 
> 
> YourGhostBehaviour>>currentMetaLevel 
> ^GHMetaLevel empty 
> 
> Empty meta level means that all messages will be passed to your behaviour. 
> There is also "GHMetaLevel standard" which is default one. It makes most of 
> "tool messages" not interceptable. For example #printString, #class, 
> #instVarAt: will be not intercepted. It's messages which are usually used by 
> tools like inspector and debugger.  
> Standard meta level simplifies debugging of new behaviours. If you make 
> mistake somewhere standard messages will be not broken and you could debug 
> error by tools.

-- 
kloum.io 

Re: [Pharo-users] "self problem" with Ghost (virus)

2016-07-28 Thread Steven Costiou
Hi, 

I think i am missing something. 

For example in the following code (took from the tests): 

| victim virus actual |
virus := GHObjectVirus behaviour: GHGhostBehaviourStub new.

victim := 0@0 corner: 3@4.
virus infect: victim.
victim corner 

The evaluation is trapped by the send:to: method in the behavior (i've
put a halt there). However if i replace the "corner" message by an
inspect of the victim, and if i evaluate "self corner", then the message
is processed without going through the send:to: method of the behavior.
It is not halted and the victim responds immediately to the message. I
have also tried to add a new method in the Rectangle class that calls
"self corner". When called in the playground, my new message is trapped
but not the "corner" sent to self. 

>From what i understand it could be related to the behavior i use, but i
don't see what's missing.

Le 2016-07-28 11:35, Denis Kudriashov a écrit :

> I think I not understood second part of "self problem" in this paper. But 
> self sends are covered by virus as I described. 
> 
> 2016-07-28 11:30 GMT+02:00 Denis Kudriashov :
> 
> Hi 
> 
> 2016-07-27 22:19 GMT+02:00 Steven Costiou :
> 
> Hi, 
> 
> I use virus from Ghost to intercept messages sent to a given object and adapt 
> methods behaviors for this particular object only. However it would seems 
> that doing interception this way is subject to the "self problem" described 
> in this paper from Stéphane (DUCASSE, Stéphane. Evaluating message passing 
> control techniques in Smalltalk. _JOURNAL OF OBJECT ORIENTED PROGRAMMING_, 
> 1999, vol. 12, p. 39-50). 
> 
> I understand i could do instance based adaptation using an other technique, 
> but i wonder if there is any way with Ghost to deal with this "self problem" 
> problem ? I think "self problem" is only related to classic proxies when 
> objects stay behind them. But ObjectVirus is not proxy in this meaning. When 
> you infect your object by virus it is not replaced by somebody else. It is 
> same original instance but with overridden behaviour. That's why I call it 
> virus without any relation to proxies. 
> Any message to infected object is processed by your behaviour. All self sends 
> are intercepted. But there are few exceptions: 
> - special messages like ==,ifTrue/ifNil are not intercepted
> - meta messages are not intercepted. They processed by Ghost mechanics but 
> they not passed to your behaviour. Meta messages defined by #currentMetaLevel 
> of your behaviour. You could implement it like: 
> 
> YourGhostBehaviour>>currentMetaLevel 
> ^GHMetaLevel empty 
> 
> Empty meta level means that all messages will be passed to your behaviour. 
> There is also "GHMetaLevel standard" which is default one. It makes most of 
> "tool messages" not interceptable. For example #printString, #class, 
> #instVarAt: will be not intercepted. It's messages which are usually used by 
> tools like inspector and debugger.  
> Standard meta level simplifies debugging of new behaviours. If you make 
> mistake somewhere standard messages will be not broken and you could debug 
> error by tools.
 

[Pharo-users] "self problem" with Ghost (virus)

2016-07-27 Thread Steven Costiou
Hi, 

I use virus from Ghost to intercept messages sent to a given object and
adapt methods behaviors for this particular object only. However it
would seems that doing interception this way is subject to the "self
problem" described in this paper from Stéphane (DUCASSE, Stéphane.
Evaluating message passing control techniques in Smalltalk. _JOURNAL OF
OBJECT ORIENTED PROGRAMMING_, 1999, vol. 12, p. 39-50). 

I understand i could do instance based adaptation using an other
technique, but i wonder if there is any way with Ghost to deal with this
"self problem" problem ? 

Steven. 

Re: [Pharo-users] Messages interceptions without using "halt"

2016-07-24 Thread Steven Costiou
Hi Thierry, Esteban, 

i forgot to thnk you for your advices. 

I tried Metalinks but it cannot intercept messages receptions. I used
Ghost, i have been able to do it with virus-proxies and it works well. 

Le 2016-04-26 15:07, Esteban Lorenzano a écrit :

> it is not what MetaLinks are for? 
> I think is easier than Ghost nowadays... but not sure :) 
> 
> look at  
> 
> ReflectivityControlTest>>testBeforeSend 
> 
> seems to be installing an interception "before send", who is what you are 
> asking for. 
> 
> Esteban 
> 
> ps: but I might be wrong... Marcus can explain better :)
> 
> On 26 Apr 2016, at 14:50, Thierry Goubier  wrote: 
> 
> Hi Steven,
> 
> 2016-04-26 14:39 GMT+02:00 Steven Costiou :
> 
> Hello, 
> 
> i am not new to Pharo nor to the list but this is the first time i speak 
> here, so : hi =)
> 
> I started a phd a few month ago (with Alain Plantec) on context oriented 
> programming and dynamic programs adaptation. I am using Pharo for my 
> experiments and i would like to intercept messages sent to an object just 
> before they get to their receiver. To be more specific, when #msg is sent to 
> an object o, i want to be able to intercept it just before it is actually 
> executed with the following objects at my disposal : the receiver (o), the 
> message or selector, the sender. My objective by doing that is to (try to) 
> change the lookup for a given method, and to be able to choose in which class 
> the lookup will start.
> 
> I have been looking a bit and it does not seem to be a "simple" way to do 
> that in Pharo. Is that even possible and if so, any advice on where i should 
> look ? 
> The easiest would be to use proxy or ghost objects, which catches all message 
> sends to a proxy of the real object and let you decide what to do with them. 
> A recent announcement on Ghosts for Pharo 5 was done, maybe starting with 
> that could be an idea. 
> 
> http://forum.world.st/Ann-New-version-of-Ghost-td4886357.html 
> 
> For old timers: wasn't Actalk done that way ? 
> 
> Thierry 
> 
> Thanks, 
> 
> Steven.

-- 
kloum.io 

Re: [Pharo-users] Changing method definition at runtime

2016-07-24 Thread Steven Costiou
As i'm trying to build some kind of context oriented mechanism, i have
the same need of behavior modification for a single instance of a class.
I use virus-proxies in Ghost, that can intercept a message upon its
reception in a particular object. From there it is possible to choose
the code you want to run, being the original method or an other
implementation. It works pretty well (by the way i still need to thanks
the person here that recommended Ghost to me...). 

However you still need to store your behaviors implementations
somewhere, in classes or blocks stored in variables... 

Le 2016-07-24 17:14, Eric Velten de Melo a écrit :

> Actually I wanted to have many different object instances with different 
> behaviours picked at random from a list of available behaviours, but didn't 
> find practical to create a class for each different method implementation and 
> delegating to it, since there are many, possibly unlimited valid behaviours. 
> 
> So maybe changing method implementation at runtime is not what I want because 
> the method implementation will be shared among all instances. What I had in 
> mind was a functionality similar to prototyped languages like Self and 
> Javascript in which you could change the behaviour inside the object and not 
> the class/prototype. 
> 
> 2016-07-23 7:35 GMT-03:00 Norbert Hartl :
> 
>> Can you elaborate on the reason why want to modify behaviour? And how you 
>> would like it to happen?
>> If the code you want to modify is your own code than you can solve that most 
>> of time with the things you already have. Your example using a block might 
>> be altered to be a strategy pattern. That means you keep one ore more 
>> instance variables for strategy objects. Then you delegate parts of your 
>> behaviour to those objects. You can based on context exchange those objects 
>> to adjust behaviour.
>> If it is not feasible to change the internal state of an object but you know 
>> all possible variants you can implement all variations as methods in the 
>> object. The right method can be invoked by doing a double dispatch with 
>> another object providing contextual information.
>> There are plenty of possibilities so you need to know what is the context 
>> that is responsible for switching behaviour and the requirements of the 
>> behaviour modifications. Can you alter the object? Is the number of 
>> modifications a fixed number? Does the modification need to be thread safe?
>> 
>> Norbert
>> 
>>> Am 23.07.2016 um 00:41 schrieb Eric Velten de Melo :
>>> 
>>> Hello,
>>> 
>>> One thing I try to do often is changing the behaviour of a method 
>>> dynamically at runtime. The current way I do this is by having a block as 
>>> an instance variable and having the method call this block, but I find this 
>>> approach a bit cumbersome. Is there some other way or is this the 
>>> recommended approach?
>>> 
>>> I mean, I suppose methods could be changed dynamically by means of 
>>> reflection somehow, but is this an easy or recommended way of programming 
>>> in Smalltalk? Should slots make things easier?
>>> 
>>> Eric

-- 
kloum.io 

Re: [Pharo-users] Changing method definition at runtime

2016-07-23 Thread Steven Costiou
Hello, 

a mean to achieve behavior modification of methods at runtime could be
context oriented programming (COP). It allows a method to have multiple
behavior variations that can be (de)activated dynamically. However to my
knowledge there is no context oriented extension for Pharo yet. 

I would also be interested by any known way to change method behavior
dynamically, as COP is not an option for now. Maybe by working on ast
nodes, by dynamically replacing them ? 

Steven. 

Le 2016-07-23 00:41, Eric Velten de Melo a écrit :

> Hello, 
> 
> One thing I try to do often is changing the behaviour of a method dynamically 
> at runtime. The current way I do this is by having a block as an instance 
> variable and having the method call this block, but I find this approach a 
> bit cumbersome. Is there some other way or is this the recommended approach? 
> 
> I mean, I suppose methods could be changed dynamically by means of reflection 
> somehow, but is this an easy or recommended way of programming in Smalltalk? 
> Should slots make things easier? 
> 
> Eric

-- 
kloum.io 

Re: [Pharo-users] [Raspberry Pi] Accessing GPIO pins on Raspberry Pi?

2016-06-14 Thread Steven Costiou
My bad, the leds were not on the right pins. Now all my leds are off and
my wiring is ok. It still doesn't work, but i'm not sure whether my
setup is wrong or if it just doesn't work anymore on Pharo5. 

I will attempt to use the library outside Pharo, reconfigure a Pharo
image & vm and then try it again. 

In the meantime if anyone does success at this, please let me know i am
very interested by using the GPIO pins from Pharo. 

Steven. 

Le 2016-06-13 17:10, Steven Costiou a écrit :

> Hi, 
> 
> i have tried to make it work but so far i can't get it right. Have you been 
> able to work with it ? 
> 
> I used pharo 5 latest non spur image with the non spur vm. It works on a 
> raspberry 3 but it is very slow. I tried the led examples, the leds do not 
> seem to be affected (some are on, some off, with a variable intensity). 
> 
> Is there any specific settings needed for this to work ? 
> 
> Thanks, 
> 
> Steven. 
> 
> Le 2016-05-27 20:11, sergio ruiz a écrit : 
> does anyone know if if pharo 5 runs on raspberry pi yet?
> 
> if so, i can poke around and see if i can get WiringPi to install on pharo 5.
> 
> thanks!
> 
> On May 27, 2016, at 1:56 PM, sergio ruiz  wrote:
> 
> The raspberry pi slave seems to be disconnected so do not know the
> status:
> Library:
> https://ci.inria.fr/pharo-contribution/job/WiringPi-ARM-AutomatedBuild/
> Pharo code ( probably on Pharo 3 or 4).
> http://smalltalkhub.com/#!/~jeanbaptistearnaud/WiringPi 
> great! i'll take a look at those!
> 
> thanks!
> 
> 
> peace,
> sergio
> photographer, journalist, visionary
> #BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV
> http://www.Village-Buzz.com
> http://www.ThoseOptimizeGuys.com
> http://www.CodingForHire.com
> http://www.coffee-black.com
> http://www.painlessfrugality.com
> http://www.twitter.com/sergio_101
> http://www.facebook.com/sergio101


peace,
sergio
photographer, journalist, visionary
#BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV
http://www.Village-Buzz.com
http://www.ThoseOptimizeGuys.com
http://www.CodingForHire.com
http://www.coffee-black.com
http://www.painlessfrugality.com
http://www.twitter.com/sergio_101
http://www.facebook.com/sergio101 

-- 
kloum.io 

Re: [Pharo-users] [Raspberry Pi] Accessing GPIO pins on Raspberry Pi?

2016-06-13 Thread Steven Costiou
Hi, 

i have tried to make it work but so far i can't get it right. Have you
been able to work with it ? 

I used pharo 5 latest non spur image with the non spur vm. It works on a
raspberry 3 but it is very slow. I tried the led examples, the leds do
not seem to be affected (some are on, some off, with a variable
intensity). 

Is there any specific settings needed for this to work ? 

Thanks, 

Steven. 

Le 2016-05-27 20:11, sergio ruiz a écrit :

> does anyone know if if pharo 5 runs on raspberry pi yet?
> 
> if so, i can poke around and see if i can get WiringPi to install on pharo 5.
> 
> thanks!
> 
> On May 27, 2016, at 1:56 PM, sergio ruiz  wrote:
> 
> The raspberry pi slave seems to be disconnected so do not know the
> status:
> Library:
> https://ci.inria.fr/pharo-contribution/job/WiringPi-ARM-AutomatedBuild/
> Pharo code ( probably on Pharo 3 or 4).
> http://smalltalkhub.com/#!/~jeanbaptistearnaud/WiringPi 
> great! i'll take a look at those!
> 
> thanks!
> 
> 
> peace,
> sergio
> photographer, journalist, visionary
> #BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV
> http://www.Village-Buzz.com
> http://www.ThoseOptimizeGuys.com
> http://www.CodingForHire.com
> http://www.coffee-black.com
> http://www.painlessfrugality.com
> http://www.twitter.com/sergio_101
> http://www.facebook.com/sergio101


peace,
sergio
photographer, journalist, visionary
#BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV
http://www.Village-Buzz.com
http://www.ThoseOptimizeGuys.com
http://www.CodingForHire.com
http://www.coffee-black.com
http://www.painlessfrugality.com
http://www.twitter.com/sergio_101
http://www.facebook.com/sergio101

-- 
kloum.io 

Re: [Pharo-users] Messages interceptions without using "halt"

2016-04-26 Thread Steven Costiou
Thank you ! I will look into these possibilities =) 

Steven. 

  1   2   >