Exception in barchart

View: New views
6 Messages — Rating Filter:   Alert me  

Exception in barchart

by Christian Schneiker-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Jan,

is it possible to make some changes in barchart.pl as follows:

Line 440ff

get(T, width, W), get(T, height, H),
send(I, hot_spot, point(W+5, H/2)),
%send(I, hot_spot, point(T?width+5, T?height/2)),

I'm getting the following exceptions when drawing barcharts and we don't
want to change them every time we install a new version of swi-prolog.

ERROR: point ->initialise: Argument 2 (y): `[int]' expected, found
`@13807156?height/2'
^  Exception: (20) send(@13707180/image,
hot_spot(point(@13807156/text?width+5, @13807156/text?height/2))) ? creep
   Exception: (19) Send-method on @13839200/bar_label:
bar_label->update_label ? creep
ERROR: point ->initialise: Argument 2 (y): `[int]' expected, found
`@13807156?height/2'
^  Exception: (17) send(@13839200/bar_label, update_label) ? creep
   Exception: (16) Send-method on @13839200/bar_label:
bar_label->initialise(@13835130/bar_group)


Christian

--
Dipl.-Inform. Christian Schneiker
Department of Computer Science
University of Wuerzburg
Am Hubland, 97074 Wuerzburg, Germany
Phone: +49 931 31 84942
Fax:   +49 931 888 4600
callto://ch_schneiker (skype)
mailto:schneiker@...
_______________________________________________
SWI-Prolog mailing list
SWI-Prolog@...
https://mailbox.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog

Re: Exception in barchart

by Jan Wielemaker-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Christian,

On Wednesday 24 June 2009 15:01:57 Christian Schneiker wrote:
> Hi Jan,
>
> is it possible to make some changes in barchart.pl as follows:
>
> Line 440ff
>
> get(T, width, W), get(T, height, H),
> send(I, hot_spot, point(W+5, H/2)),
> %send(I, hot_spot, point(T?width+5, T?height/2)),

Except for errors, this is -as I think you know-, the same. Why is there
an error though. Or more specifically, why does get(T, height, H) fail?
I surely have used this package with success.  Your fix might be a fix
at the wrong place, but before deciding we must know why it fails.

        Cheers --- Jan

>
> I'm getting the following exceptions when drawing barcharts and we don't
> want to change them every time we install a new version of swi-prolog.
>
> ERROR: point ->initialise: Argument 2 (y): `[int]' expected, found
> `@13807156?height/2'
> ^  Exception: (20) send(@13707180/image,
> hot_spot(point(@13807156/text?width+5, @13807156/text?height/2))) ? creep
>    Exception: (19) Send-method on @13839200/bar_label:
> bar_label->update_label ? creep
> ERROR: point ->initialise: Argument 2 (y): `[int]' expected, found
> `@13807156?height/2'
> ^  Exception: (17) send(@13839200/bar_label, update_label) ? creep
>    Exception: (16) Send-method on @13839200/bar_label:
> bar_label->initialise(@13835130/bar_group)
>
>
> Christian



_______________________________________________
SWI-Prolog mailing list
SWI-Prolog@...
https://mailbox.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog

Re: Exception in barchart

by Christian Schneiker-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Jan,

Dietmar Seipel observed this some time ago. Obviously this should not
make a change, but we noticed that it helps.

> Christian,
>> is it possible to make some changes in barchart.pl as follows:
>>
>> Line 440ff
>>
>> get(T, width, W), get(T, height, H),
>> send(I, hot_spot, point(W+5, H/2)),
>> %send(I, hot_spot, point(T?width+5, T?height/2)),
>
> Except for errors, this is -as I think you know-, the same. Why is there
> an error though. Or more specifically, why does get(T, height, H) fail?

get(T, height, H) does not fail.
send(I, hot_spot, point(T?width+5, T?height/2)) fails.


> I surely have used this package with success.  Your fix might be a fix
> at the wrong place, but before deciding we must know why it fails.
>
> Cheers --- Jan
>
>> I'm getting the following exceptions when drawing barcharts and we don't
>> want to change them every time we install a new version of swi-prolog.
>>
>> ERROR: point ->initialise: Argument 2 (y): `[int]' expected, found
>> `@13807156?height/2'
>> ^  Exception: (20) send(@13707180/image,
>> hot_spot(point(@13807156/text?width+5, @13807156/text?height/2))) ? creep
>>    Exception: (19) Send-method on @13839200/bar_label:
>> bar_label->update_label ? creep
>> ERROR: point ->initialise: Argument 2 (y): `[int]' expected, found
>> `@13807156?height/2'
>> ^  Exception: (17) send(@13839200/bar_label, update_label) ? creep
>>    Exception: (16) Send-method on @13839200/bar_label:
>> bar_label->initialise(@13835130/bar_group)
>>

Christian


--
Dipl.-Inform. Christian Schneiker
Department of Computer Science
University of Wuerzburg
Am Hubland, 97074 Wuerzburg, Germany
Phone: +49 931 31 84942
Fax:   +49 931 888 4600
callto://ch_schneiker (skype)
mailto:schneiker@...
_______________________________________________
SWI-Prolog mailing list
SWI-Prolog@...
https://mailbox.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog

Re: Exception in barchart

by Jan Wielemaker-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Christian,

On Thursday 25 June 2009 10:59:09 am Christian Schneiker wrote:

> Dietmar Seipel observed this some time ago. Obviously this should not
> make a change, but we noticed that it helps.
>
> >> is it possible to make some changes in barchart.pl as follows:
> >>
> >> Line 440ff
> >>
> >> get(T, width, W), get(T, height, H),
> >> send(I, hot_spot, point(W+5, H/2)),
> >> %send(I, hot_spot, point(T?width+5, T?height/2)),
> >
> > Except for errors, this is -as I think you know-, the same. Why is there
> > an error though. Or more specifically, why does get(T, height, H) fail?
>
> get(T, height, H) does not fail.
> send(I, hot_spot, point(T?width+5, T?height/2)) fails.

That is weird. I'd like to see a program to reproduce this. It might
point at some deeper trouble.

        Cheers --- Jan

_______________________________________________
SWI-Prolog mailing list
SWI-Prolog@...
https://mailbox.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog

Re: Exception in barchart

by Christian Schneiker-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Jan,

Here is a code snippet of Dietmar's DDK for bar_chart from which I get
the error.

dislog_bar_chart(Title, Distribution, Limit) :-
   name_append(Title, ' Distribution', Title_Distribution),
   new(W, auto_sized_picture(Title_Distribution)),
%  send(W, size, size(700, 600)),
   length(Distribution, N),
   dislog_bar_chart_required_scale(
      Distribution, Limit, Scale),
   !,
   send(W, display,
      new(BC, bar_chart(vertical, 0, Scale, 300, N))),
   forall( member([A, Colour]-Amount, Distribution),
      send(BC, append,
         bar_group(A,
            bar('', Amount, Colour))) ),
   send(W, open).

dislog_bar_chart_required_scale(
      Distribution, Limit, Scale) :-
   findall( Amount,
      member(_-Amount, Distribution),
      Amounts ),
   maximum(Amounts, X),
   ( X < Limit,
     Scale is Limit
   ; round(X/100+0.5, 0, Y),
     Scale is Y * 100 ).


> That is weird. I'd like to see a program to reproduce this. It might
> point at some deeper trouble.
>
> Cheers --- Jan
>

Christian
_______________________________________________
SWI-Prolog mailing list
SWI-Prolog@...
https://mailbox.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog

Parent Message unknown Re: Exception in barchart

by Jan Wielemaker-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Christian,

On Thursday 25 June 2009 05:41:33 pm you wrote:
> It's getting strange ;-) I think it's a deeper problem than Dietmar
> thought. If I start test(bar_chart, 1) from test.pl (see att.) everything
> works fine. Consulting his DDK
> ( http://www1.informatik.uni-wuerzburg.de/database/DisLog/DisLog.tgz )
> the same test gives the error. Dietmar told me today, that it worked on
> some previous Prolog versions.

This is the explanation:

[1]  ?- send(@pce, write, @7152756?height/2).
ERROR: Unhandled exception: ? ->initialise: Argument 2 (selector): `name|
function' expected, found `height/2'
[1]  ?- send(@pce, write, (@7152756?height)/2).
8

I.e., the code is redefining operators such that @7152756?height/2 is
read as @7152756?(height/2).

I don't think this is a new bug ... Sorting out operator dependencies
without breaking too much code is really getting an important topic :-(

> But all other xpce things from the DDK are working well (except of
> list_browser on x86_64 machines).

What is wrong with that? I'm running x86_64 all day and I'm not aware of
any issues. That is, Linux x86_64. Windows64 is a different issue
because M$ broke all normal conventions that where true in the classical
world of C.

> I know why I've implemented XUL in Prolog for GUIs ;-)

Can you elaborate on that remark?

        Cheers --- Jan

> btw. greetings from Dietmar :-)

Send him my regards!

>
> Thanks,
> Christian
>
> Am 25.06.2009 16:20, schrieb Jan Wielemaker:
> > [private]
> >
> > Can you send me something I can run?  I don't like looking at code
> > I don't know ...
> >
> > --- Jan
> >
> > On Thursday 25 June 2009 02:28:14 pm Christian Schneiker wrote:
> >> Hi Jan,
> >>
> >> Here is a code snippet of Dietmar's DDK for bar_chart from which I get
> >> the error.
> >>
> >> dislog_bar_chart(Title, Distribution, Limit) :-
> >>    name_append(Title, ' Distribution', Title_Distribution),
> >>    new(W, auto_sized_picture(Title_Distribution)),
> >> %  send(W, size, size(700, 600)),
> >>    length(Distribution, N),
> >>    dislog_bar_chart_required_scale(
> >>       Distribution, Limit, Scale),
> >>    !,
> >>    send(W, display,
> >>       new(BC, bar_chart(vertical, 0, Scale, 300, N))),
> >>    forall( member([A, Colour]-Amount, Distribution),
> >>       send(BC, append,
> >>          bar_group(A,
> >>             bar('', Amount, Colour))) ),
> >>    send(W, open).
> >>
> >> dislog_bar_chart_required_scale(
> >>       Distribution, Limit, Scale) :-
> >>    findall( Amount,
> >>       member(_-Amount, Distribution),
> >>       Amounts ),
> >>    maximum(Amounts, X),
> >>    ( X < Limit,
> >>      Scale is Limit
> >>    ; round(X/100+0.5, 0, Y),
> >>      Scale is Y * 100 ).
> >>
> >>> That is weird. I'd like to see a program to reproduce this. It might
> >>> point at some deeper trouble.
> >>>
> >>> Cheers --- Jan
> >>
> >> Christian
> >> _______________________________________________
> >> SWI-Prolog mailing list
> >> SWI-Prolog@...
> >> https://mailbox.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog

_______________________________________________
SWI-Prolog mailing list
SWI-Prolog@...
https://mailbox.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog