LayoutFrame bug

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

LayoutFrame bug

Nicolas Cellier
Hi,
don't you get nice red-cross when opening a browser and selecting comment?
(Pharo7.0-32bit-b5ec533.image)

The problem is LayoutFrame having a Point instead of Number in fraction/offset inst. var.

So I defined two horrible hacks in order to be able to work with Pharo

Point>>@ n  ^x @ n
Point>>asInteger ^x asInteger

then could instrument the LayoutFrame inst. var. setters with horrible checks like:
    aNumber isNumber ifFalse: [ self halt].

And after a few seconds of IDE usage:

AbstractNautilusUI>>buildCodePanelWithCommentOnRight
...snip...
    sourceCodePanel
        addMorph: commentWidget
        fullFrame: (LayoutFrame identity leftFraction: 0.5@0 ;
                        leftOffset: delta).

Huh! it's as pleasant as not eating own dog food
I think this comes from a  recent refactoring. I can hardly use in image tools to trace it.
Iceberg bugs, MC has lost ancestry and is just good at synchronizing disk working copy with image working copy, but there is github & git API:


As it's nearly impossible to make giant refactorings like this without human error,
and as it's as impossible to review pull request with many lines of code,
I wonder if it is possible to automate those with rewrite rules...

I let you finish the work (open issue, patch, commit, etc...)


Reply | Threaded
Open this post in threaded view
|

Re: LayoutFrame bug

Christian Kellermann
Hi!

* Nicolas Cellier <[hidden email]> [171108 13:48]:

> Hi,
> don't you get nice red-cross when opening a browser and selecting comment?
> (Pharo7.0-32bit-b5ec533.image)
>
> The problem is LayoutFrame having a Point instead of Number in
> fraction/offset inst. var.
>
> So I defined two horrible hacks in order to be able to work with Pharo
>
> Point>>@ n  ^x @ n
> Point>>asInteger ^x asInteger
>
> then could instrument the LayoutFrame inst. var. setters with horrible
> checks like:
>     aNumber isNumber ifFalse: [ self halt].
>
> And after a few seconds of IDE usage:
>
> AbstractNautilusUI>>buildCodePanelWithCommentOnRight
> ...snip...
>     sourceCodePanel
>         addMorph: commentWidget
>         fullFrame: (LayoutFrame identity leftFraction: 0.5@0 ;
>                         leftOffset: delta).
>
> Huh! it's as pleasant as not eating own dog food
> I think this comes from a  recent refactoring. I can hardly use in image
> tools to trace it.
> Iceberg bugs, MC has lost ancestry and is just good at synchronizing disk
> working copy with image working copy, but there is github & git API:
>
> https://github.com/pharo-project/pharo/commit/042baad47fddb63db2dd0beefeec692962f06dfe#diff-b8c1cff56276a5a583eec641253123da
>
> As it's nearly impossible to make giant refactorings like this without
> human error,
> and as it's as impossible to review pull request with many lines of code,
> I wonder if it is possible to automate those with rewrite rules...
>
> I let you finish the work (open issue, patch, commit, etc...)

Nice find, I have been stumbling onto this yesterday.
Hard to spot this line 1612 in a huge commit like this.

Thanks for debugging it!

Christian

--
May you be peaceful, may you live in safety, may you be free from
suffering, and may you live with ease.

Reply | Threaded
Open this post in threaded view
|

Re: LayoutFrame bug

Sven Van Caekenberghe-2
In reply to this post by Nicolas Cellier
Yeah, I just got in trouble too by looking at class comments.

Heroic debugging, Nicolas !

> On 8 Nov 2017, at 13:47, Nicolas Cellier <[hidden email]> wrote:
>
> Hi,
> don't you get nice red-cross when opening a browser and selecting comment?
> (Pharo7.0-32bit-b5ec533.image)
>
> The problem is LayoutFrame having a Point instead of Number in fraction/offset inst. var.
>
> So I defined two horrible hacks in order to be able to work with Pharo
>
> Point>>@ n  ^x @ n
> Point>>asInteger ^x asInteger
>
> then could instrument the LayoutFrame inst. var. setters with horrible checks like:
>     aNumber isNumber ifFalse: [ self halt].
>
> And after a few seconds of IDE usage:
>
> AbstractNautilusUI>>buildCodePanelWithCommentOnRight
> ...snip...
>     sourceCodePanel
>         addMorph: commentWidget
>         fullFrame: (LayoutFrame identity leftFraction: 0.5@0 ;
>                         leftOffset: delta).
>
> Huh! it's as pleasant as not eating own dog food
> I think this comes from a  recent refactoring. I can hardly use in image tools to trace it.
> Iceberg bugs, MC has lost ancestry and is just good at synchronizing disk working copy with image working copy, but there is github & git API:
>
> https://github.com/pharo-project/pharo/commit/042baad47fddb63db2dd0beefeec692962f06dfe#diff-b8c1cff56276a5a583eec641253123da
>
> As it's nearly impossible to make giant refactorings like this without human error,
> and as it's as impossible to review pull request with many lines of code,
> I wonder if it is possible to automate those with rewrite rules...
>
> I let you finish the work (open issue, patch, commit, etc...)
>
>


Reply | Threaded
Open this post in threaded view
|

Re: LayoutFrame bug

Stephane Ducasse-3
Hi nicolas

Tx I fixed it before seeing your email. Too bad.

I introduced this bug when I did the asLayoutFrame conversion.
Note that I split the refactoring in parts to avoid too change commits.
Now I was also thinking how I could automate the change and this is
not that easy because the expressions
can use temps, instance variables... and it would take me age to be
able to write a rewrite expression (sadly enough).


I found it in 3 min because I know the changes I did but your way is
quite nice because it was not easy to find from the stack trace.

I fixed it but I cannot commit the fix. Iceberg does not let me.
Now I cannot produce a PR. :(

https://pharo.fogbugz.com/f/cases/20656/Nautilus-comment-panel-got-broken-by-asLayoutFrame-cleans

Guille told me that I could modify the printOn: method to help me.
And this is a bit better (I did not bother to be smart with ; or not)
I will use this trick to ease the refactoring and minimize errors
(probably sleeping more should help too and doing less boring tasks
too :).


printOn: aStream

aStream nextPutAll: ' (LayoutFrame identity '.
self leftFraction = 0
ifFalse: [ aStream << ('leftFraction: ', self leftFraction printString, ' ') ].
self topFraction = 0
ifFalse: [ aStream << ('topFraction: ', self topFraction printString, ' ') ].
self rightFraction = 1
ifFalse: [ aStream << ('rightFraction: ', self rightFraction
printString, ' ') ].
self bottomFraction = 1
ifFalse: [ aStream << ('bottomFraction: ', self bottomFraction
printString,' ') ].
self leftOffset = 0
ifFalse: [ aStream << ('leftOffset: ', self leftOffset printString,' ') ].
self topOffset = 0
ifFalse: [ aStream << ('topOffset: ', self topOffset printString,' ') ].
self rightOffset = 0
ifFalse: [ aStream << ('rightOffset: ', self rightOffset printString,' ') ].
self bottomOffset = 0
ifFalse: [ aStream << ('bottomOffset: ', self bottomOffset printString,' ') ].
aStream nextPutAll: ' ) '



On Wed, Nov 8, 2017 at 1:58 PM, Sven Van Caekenberghe <[hidden email]> wrote:

> Yeah, I just got in trouble too by looking at class comments.
>
> Heroic debugging, Nicolas !
>
>> On 8 Nov 2017, at 13:47, Nicolas Cellier <[hidden email]> wrote:
>>
>> Hi,
>> don't you get nice red-cross when opening a browser and selecting comment?
>> (Pharo7.0-32bit-b5ec533.image)
>>
>> The problem is LayoutFrame having a Point instead of Number in fraction/offset inst. var.
>>
>> So I defined two horrible hacks in order to be able to work with Pharo
>>
>> Point>>@ n  ^x @ n
>> Point>>asInteger ^x asInteger
>>
>> then could instrument the LayoutFrame inst. var. setters with horrible checks like:
>>     aNumber isNumber ifFalse: [ self halt].
>>
>> And after a few seconds of IDE usage:
>>
>> AbstractNautilusUI>>buildCodePanelWithCommentOnRight
>> ...snip...
>>     sourceCodePanel
>>         addMorph: commentWidget
>>         fullFrame: (LayoutFrame identity leftFraction: 0.5@0 ;
>>                         leftOffset: delta).
>>
>> Huh! it's as pleasant as not eating own dog food
>> I think this comes from a  recent refactoring. I can hardly use in image tools to trace it.
>> Iceberg bugs, MC has lost ancestry and is just good at synchronizing disk working copy with image working copy, but there is github & git API:
>>
>> https://github.com/pharo-project/pharo/commit/042baad47fddb63db2dd0beefeec692962f06dfe#diff-b8c1cff56276a5a583eec641253123da
>>
>> As it's nearly impossible to make giant refactorings like this without human error,
>> and as it's as impossible to review pull request with many lines of code,
>> I wonder if it is possible to automate those with rewrite rules...
>>
>> I let you finish the work (open issue, patch, commit, etc...)
>>
>>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: LayoutFrame bug

Nicolas Cellier
I know it's not the recommended way...

But if experiencing difficulties with iceberg, you can just use MC to produce the tonel output file, then use any git client to do the commit and the pull request...
At worse, you can even modify the tonel file directly without MC (more dangerous)

I'm often using sourcetree which is really one of the lowest barrier client to git (both macosx and windows, not linux though).

Last time, I did it with git command line, then emmitted the PR from github web API.
It's just 4 lines:
git branch blablabranch; git src add; git commit; git push --set-upstream origin blablabranch
I managed to create the branch from iceberg with fogbugz entry # so it was 3 commands and less blabla for me :)

And the last alternative is to correct directly the file thru github web API.
It's more boring to create a correct branch name and reference the bug entry etc... but it may work.

2017-11-08 22:29 GMT+01:00 Stephane Ducasse <[hidden email]>:
Hi nicolas

Tx I fixed it before seeing your email. Too bad.

I introduced this bug when I did the asLayoutFrame conversion.
Note that I split the refactoring in parts to avoid too change commits.
Now I was also thinking how I could automate the change and this is
not that easy because the expressions
can use temps, instance variables... and it would take me age to be
able to write a rewrite expression (sadly enough).


I found it in 3 min because I know the changes I did but your way is
quite nice because it was not easy to find from the stack trace.

I fixed it but I cannot commit the fix. Iceberg does not let me.
Now I cannot produce a PR. :(

https://pharo.fogbugz.com/f/cases/20656/Nautilus-comment-panel-got-broken-by-asLayoutFrame-cleans

Guille told me that I could modify the printOn: method to help me.
And this is a bit better (I did not bother to be smart with ; or not)
I will use this trick to ease the refactoring and minimize errors
(probably sleeping more should help too and doing less boring tasks
too :).


printOn: aStream

aStream nextPutAll: ' (LayoutFrame identity '.
self leftFraction = 0
ifFalse: [ aStream << ('leftFraction: ', self leftFraction printString, ' ') ].
self topFraction = 0
ifFalse: [ aStream << ('topFraction: ', self topFraction printString, ' ') ].
self rightFraction = 1
ifFalse: [ aStream << ('rightFraction: ', self rightFraction
printString, ' ') ].
self bottomFraction = 1
ifFalse: [ aStream << ('bottomFraction: ', self bottomFraction
printString,' ') ].
self leftOffset = 0
ifFalse: [ aStream << ('leftOffset: ', self leftOffset printString,' ') ].
self topOffset = 0
ifFalse: [ aStream << ('topOffset: ', self topOffset printString,' ') ].
self rightOffset = 0
ifFalse: [ aStream << ('rightOffset: ', self rightOffset printString,' ') ].
self bottomOffset = 0
ifFalse: [ aStream << ('bottomOffset: ', self bottomOffset printString,' ') ].
aStream nextPutAll: ' ) '



On Wed, Nov 8, 2017 at 1:58 PM, Sven Van Caekenberghe <[hidden email]> wrote:
> Yeah, I just got in trouble too by looking at class comments.
>
> Heroic debugging, Nicolas !
>
>> On 8 Nov 2017, at 13:47, Nicolas Cellier <[hidden email]> wrote:
>>
>> Hi,
>> don't you get nice red-cross when opening a browser and selecting comment?
>> (Pharo7.0-32bit-b5ec533.image)
>>
>> The problem is LayoutFrame having a Point instead of Number in fraction/offset inst. var.
>>
>> So I defined two horrible hacks in order to be able to work with Pharo
>>
>> Point>>@ n  ^x @ n
>> Point>>asInteger ^x asInteger
>>
>> then could instrument the LayoutFrame inst. var. setters with horrible checks like:
>>     aNumber isNumber ifFalse: [ self halt].
>>
>> And after a few seconds of IDE usage:
>>
>> AbstractNautilusUI>>buildCodePanelWithCommentOnRight
>> ...snip...
>>     sourceCodePanel
>>         addMorph: commentWidget
>>         fullFrame: (LayoutFrame identity leftFraction: 0.5@0 ;
>>                         leftOffset: delta).
>>
>> Huh! it's as pleasant as not eating own dog food
>> I think this comes from a  recent refactoring. I can hardly use in image tools to trace it.
>> Iceberg bugs, MC has lost ancestry and is just good at synchronizing disk working copy with image working copy, but there is github & git API:
>>
>> https://github.com/pharo-project/pharo/commit/042baad47fddb63db2dd0beefeec692962f06dfe#diff-b8c1cff56276a5a583eec641253123da
>>
>> As it's nearly impossible to make giant refactorings like this without human error,
>> and as it's as impossible to review pull request with many lines of code,
>> I wonder if it is possible to automate those with rewrite rules...
>>
>> I let you finish the work (open issue, patch, commit, etc...)
>>
>>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: LayoutFrame bug

Stephane Ducasse-3
I could not use MC, packages could not get dirty.
So at the end I put a halt in the changersorter fileout because I
could not find where the files where saved :)

For the PR it happened also to me to use github.

Now git is funky the last time I got conflict where there was none:
since I was the only one to commit and I had to resolve
by hand all the conflicts on github...

Stef (zeBugAttractor that is a bit fedup I literally crash everything
I used. Computers, telephons....

On Wed, Nov 8, 2017 at 11:18 PM, Nicolas Cellier
<[hidden email]> wrote:

> I know it's not the recommended way...
>
> But if experiencing difficulties with iceberg, you can just use MC to
> produce the tonel output file, then use any git client to do the commit and
> the pull request...
> At worse, you can even modify the tonel file directly without MC (more
> dangerous)
>
> I'm often using sourcetree which is really one of the lowest barrier client
> to git (both macosx and windows, not linux though).
>
> Last time, I did it with git command line, then emmitted the PR from github
> web API.
> It's just 4 lines:
> git branch blablabranch; git src add; git commit; git push --set-upstream
> origin blablabranch
> I managed to create the branch from iceberg with fogbugz entry # so it was 3
> commands and less blabla for me :)
>
> And the last alternative is to correct directly the file thru github web
> API.
> It's more boring to create a correct branch name and reference the bug entry
> etc... but it may work.
>
> 2017-11-08 22:29 GMT+01:00 Stephane Ducasse <[hidden email]>:
>>
>> Hi nicolas
>>
>> Tx I fixed it before seeing your email. Too bad.
>>
>> I introduced this bug when I did the asLayoutFrame conversion.
>> Note that I split the refactoring in parts to avoid too change commits.
>> Now I was also thinking how I could automate the change and this is
>> not that easy because the expressions
>> can use temps, instance variables... and it would take me age to be
>> able to write a rewrite expression (sadly enough).
>>
>>
>> I found it in 3 min because I know the changes I did but your way is
>> quite nice because it was not easy to find from the stack trace.
>>
>> I fixed it but I cannot commit the fix. Iceberg does not let me.
>> Now I cannot produce a PR. :(
>>
>>
>> https://pharo.fogbugz.com/f/cases/20656/Nautilus-comment-panel-got-broken-by-asLayoutFrame-cleans
>>
>> Guille told me that I could modify the printOn: method to help me.
>> And this is a bit better (I did not bother to be smart with ; or not)
>> I will use this trick to ease the refactoring and minimize errors
>> (probably sleeping more should help too and doing less boring tasks
>> too :).
>>
>>
>> printOn: aStream
>>
>> aStream nextPutAll: ' (LayoutFrame identity '.
>> self leftFraction = 0
>> ifFalse: [ aStream << ('leftFraction: ', self leftFraction printString, '
>> ') ].
>> self topFraction = 0
>> ifFalse: [ aStream << ('topFraction: ', self topFraction printString, ' ')
>> ].
>> self rightFraction = 1
>> ifFalse: [ aStream << ('rightFraction: ', self rightFraction
>> printString, ' ') ].
>> self bottomFraction = 1
>> ifFalse: [ aStream << ('bottomFraction: ', self bottomFraction
>> printString,' ') ].
>> self leftOffset = 0
>> ifFalse: [ aStream << ('leftOffset: ', self leftOffset printString,' ') ].
>> self topOffset = 0
>> ifFalse: [ aStream << ('topOffset: ', self topOffset printString,' ') ].
>> self rightOffset = 0
>> ifFalse: [ aStream << ('rightOffset: ', self rightOffset printString,' ')
>> ].
>> self bottomOffset = 0
>> ifFalse: [ aStream << ('bottomOffset: ', self bottomOffset printString,'
>> ') ].
>> aStream nextPutAll: ' ) '
>>
>>
>>
>> On Wed, Nov 8, 2017 at 1:58 PM, Sven Van Caekenberghe <[hidden email]>
>> wrote:
>> > Yeah, I just got in trouble too by looking at class comments.
>> >
>> > Heroic debugging, Nicolas !
>> >
>> >> On 8 Nov 2017, at 13:47, Nicolas Cellier
>> >> <[hidden email]> wrote:
>> >>
>> >> Hi,
>> >> don't you get nice red-cross when opening a browser and selecting
>> >> comment?
>> >> (Pharo7.0-32bit-b5ec533.image)
>> >>
>> >> The problem is LayoutFrame having a Point instead of Number in
>> >> fraction/offset inst. var.
>> >>
>> >> So I defined two horrible hacks in order to be able to work with Pharo
>> >>
>> >> Point>>@ n  ^x @ n
>> >> Point>>asInteger ^x asInteger
>> >>
>> >> then could instrument the LayoutFrame inst. var. setters with horrible
>> >> checks like:
>> >>     aNumber isNumber ifFalse: [ self halt].
>> >>
>> >> And after a few seconds of IDE usage:
>> >>
>> >> AbstractNautilusUI>>buildCodePanelWithCommentOnRight
>> >> ...snip...
>> >>     sourceCodePanel
>> >>         addMorph: commentWidget
>> >>         fullFrame: (LayoutFrame identity leftFraction: 0.5@0 ;
>> >>                         leftOffset: delta).
>> >>
>> >> Huh! it's as pleasant as not eating own dog food
>> >> I think this comes from a  recent refactoring. I can hardly use in
>> >> image tools to trace it.
>> >> Iceberg bugs, MC has lost ancestry and is just good at synchronizing
>> >> disk working copy with image working copy, but there is github & git API:
>> >>
>> >>
>> >> https://github.com/pharo-project/pharo/commit/042baad47fddb63db2dd0beefeec692962f06dfe#diff-b8c1cff56276a5a583eec641253123da
>> >>
>> >> As it's nearly impossible to make giant refactorings like this without
>> >> human error,
>> >> and as it's as impossible to review pull request with many lines of
>> >> code,
>> >> I wonder if it is possible to automate those with rewrite rules...
>> >>
>> >> I let you finish the work (open issue, patch, commit, etc...)
>> >>
>> >>
>> >
>> >
>>
>