Hi Henry,
It looks like I was off by one with the line that was causing the crash. No
excuses.
The sequence that causes a crash is this
load jpath '~temp/jig902.ijs'
litsvg_jig_
4 : 0
's b'=. x
if. b do. yc=.,.(msk=.a:~: ,lit) # rsfiy lit=. boxutf y
lit=. ,-.&a: each <"1 -.&a: lit [ xw=. msk # , xw [xc=.,. msk # ,
0&,@}:@(+/\)"1 xw=.(9.59 + s * 2) * >(((0.5+1.5*FM)"_)`1:`((0.5+1.5*FM)"_)`#@.(
15 26 31 I. {.))each lit
else. yc=.,.( ([ S:0 (# each each lit) ) # (18 * _1 |.!.0 +/\)) @:;@:
(;@:(}: , >:@:;each@:{:) each) @: (+/@:((10;13)e.{:) each each) lit=. unb lc
boxutf y
xw=. ; xw [ xc=. ,. ; 0&,@}:@(+/\) each xw=.((9.59 + s * 4.8)&*
each) (((0.5+1.5*FM)"_)`(12"_)`((0.5+1.5*FM)"_)`1:`((0.5+1.5*FM)"_)`(#@:>)@.(8
9 15 26 31 I. {.@:>))"0 each lit=.-.&a: ;lit end.
tt=.'<title>',"1(20#'='),"1 (26({.!.B)"1 (' UTF-8',B,':',B),"1 ;@:(>@:(":
each)each) lit),"1' ',"1 (20#'='),"1'</title>'
tm=. '<g><rect fill="#96C"',"1 ' x="',"1(": (s * 12)+ xc+3.5),"1'"
y="',"1(":yc+7),"1'" width="',"1 (": ,. , xw),"1'" height="18" rx="2"
fill-opacity="1"></rect><rect ',"1(s{::((,. -.&(<'') , 33&>@:{.each S:1
lit){::'fill="#004225" stroke="gold"';'fill="#008825"
stroke="gold"');'fill="white" stroke="red"'),"1' x="',"1(": (s * 12)+
xc+3.5),"1'" y="',"1(":yc+7),"1'" width="',"1 (": ,. , xw),"1'" height="18"
rx="2">',"1 tt ,"1'</rect>',"1 anim,"1'</g>'
vals=. ;@:,.@:(;"1@:,.@:((' '"_)`({&a.)`(valclean@:{&a.)`(({&a.))@.(0 15 26
I.{.) each) each)lit NB. vals raw values cleaned to show box characters in svg
tm=. ,tm ,"1 '<text font-family="',"1 FONT,"1'" font-weight="normal"
stroke="none" font-size="0.8em" pointer-events="none" text-anchor="start"
xml:space="preserve" ',"1 (s{::'fill="gold" ';'fill="black"'),"1'" x="',"1(cnv
(s * 14)+xc+4.5),"1'" y="',"1(cnv yc+20),"1'">',"1 vals ,"1 '</text>'
if. s do. (19.5 + >./ xw +&, xc);(32 + (18 * ({: ; lit) e. 10;13)+{: ,yc);tm
NB. width height character string
else. tt=. '<title>',(30#'='),(70({.!.B)' Type',B,':',B,'literal',B),(40{.'
Shape',B,':',B,(''-: $ y){::((": $ y);'atom')),(30#'='),'</title>'
('<g><rect rx="6" fill="#96C" width="',(": 7.5 + >./ xw +&, xc),'"
height="',(": 32 + (18* (-.b) * ({: ; lit) e. 10;13)+{: ,yc),'"
fill-opacity="1"></rect><rect overflow="visible" ');('rx="6" ',(1-: {. $
y){::('stroke="white" fill="#fff"');('fill="#dde" stroke="#aac"'));'"
width="';(7.5 + >./ xw +&, xc);'" height="';(32 + (18* (-.b) * ({: ; lit) e.
10;13)+{: ,yc);'">',tt,'</rect>',anim,'</g>',tm end.
)
FM_jig_
0
FONT_jig_
menlo
32 -: a. i. B_jig_
1
( 2 $ (<0),(<0)) litsvg_jig_ 'a' NB. crash occurs consistently with this
line
Running it a line at a time from the base locale
load jpath '~temp/jig902.ijs'
's b'=. ( 2 $ (<0),(<0))
s
0
b
0
yc=.,.( ([ S:0 (# each each lit) ) # (18 * _1 |.!.0 +/\)) @:;@: (;@:(}: ,
>:@:;each@:{:) each) @: (+/@:((10;13)e.{:) each each) lit=. unb_jig_ lc_jig_
boxutf_jig_ 'a'
yc
0
FM_jig_
0
lit
┌──────┐
│┌────┐│
││┌──┐││
│││97│││
││└──┘││
│└────┘│
└──────┘
xw=. ; xw [ xc=. ,. ; 0&,@}:@(+/\) each xw=.((9.59 + s * 4.8)&* each)
(((0.5+1.5*FM_jig_)"_)`(12"_)`((0.5+1.5*FM_jig_)"_)`1:`((0.5+1.5*FM_jig_)"_)`(#@:>)@.(8
9 15 26 31 I. {.@:>))"0 each lit=.-.&a: ;lit NB. this line killed it
Cheers, bob
> On Nov 3, 2020, at 15:35, Henry Rich <[email protected]> wrote:
>
> It works for me:
>
> [t=: (+/@:((10;13)e.{:) each each) ,1 NB. partial result works
> +---+
> |+-+|
> ||0||
> |+-+|
> +---+
> ;@: (;@:(}: , >:@:;each@:{:) each) t NB. completion of partial result
> works
> 1
> ;@: (;@:(}: , >:@:;each@:{:) each) @: (+/@:((10;13)e.{:) each each) ,1
> NB. This crashes the session
> 1
>
> The 32000-byte length limit has been around for at least half a year.
>
> Henry Rich
>
> On 11/3/2020 5:44 PM, 'robert therriault' via Beta wrote:
>> Thanks Henry,
>>
>> Has that limit been around for a while, because my sentences are well over
>> 32,000 bytes. I reset using 9!:37 and use 5!:6 <'t' [ t=. "svg expression"
>> to get the expected string produced from my input, then assert. that they
>> are equivalent, which makes for a very long sentence.
>>
>> Anyway, the problem that I have found seems unrelated to the string length,
>> but instead comes down to how I am processing literals and unicode, which in
>> turn affects symbols as they are built on top of the literal and unicode
>> representation. I can execute the components of the sentence successfully,
>> but it is the full sentence that crashes the session.
>>
>> JVERSION
>> Engine: j901/j64avx2/darwin
>> Release-f: commercial/2020-06-11T16:07:02
>> Library: 9.01.24
>> Qt IDE: 1.8.3/5.12.3
>> Platform: Darwin 64
>> Installer: J901 install
>> InstallPath: /users/bobtherriault/j901
>> Contact: www.jsoftware.com
>>
>> ;@: (;@:(}: , >:@:;each@:{:) each) @: (+/@:((10;13)e.{:) each each) ,1
>> NB. full sentence works in j901
>> 1
>> [t=: (+/@:((10;13)e.{:) each each) ,1
>> ┌───┐
>> │┌─┐│
>> ││0││
>> │└─┘│
>> └───┘
>> ;@: (;@:(}: , >:@:;each@:{:) each) t
>> 1
>>
>> JVERSION
>> Engine: j902/j64avx2/darwin
>> Beta-k: commercial/2020-11-03T11:38:14
>> Library: 9.02.06
>> Qt IDE: 1.8.7/5.12.7(5.12.7)
>> Platform: Darwin 64
>> Installer: J902 install
>> InstallPath: /users/bobtherriault/j902
>> Contact: www.jsoftware.com
>>
>> [t=: (+/@:((10;13)e.{:) each each) ,1 NB. partial result works
>> ┌───┐
>> │┌─┐│
>> ││0││
>> │└─┘│
>> └───┘
>> ;@: (;@:(}: , >:@:;each@:{:) each) t NB. completion of partial result
>> works
>> 1
>> ;@: (;@:(}: , >:@:;each@:{:) each) @: (+/@:((10;13)e.{:) each each) ,1
>> NB. This crashes the session
>>
>> Cheers, bob
>>
>>
>>
>>
>>> On Nov 3, 2020, at 13:51, Henry Rich <[email protected]> wrote:
>>>
>>> Max length of a sentence is 32000 bytes, but you can get a longer string by
>>> using 0 : 0 .
>>>
>>> You will send me a failing case when you have one, right?
>>>
>>> Henry Rich
>>>
>>> On 11/3/2020 1:10 PM, 'robert therriault' via Beta wrote:
>>>> Moved over to beta thread from programming.
>>>>
>>>> I think I figured it out.
>>>>
>>>> My jig902.ijs calls a testfile with some VERY long strings of svg output
>>>> (around 100k+ characters). When I extracted one of these lines and tried
>>>> to do a character count I got a limit error, so I can't be precise in the
>>>> actual length of the strings or what is the longest string.
>>>>
>>>> So now I am able to load the jig902.ijs file and can run it by disabling
>>>> the test run.
>>>>
>>>> Let me know if you need more information about the test file. I would like
>>>> to be able to run it, as this is how I catch the changes that the
>>>> different versions have generated.
>>>>
>>>> Cheers, bob
>>>>
>>>>> On Nov 3, 2020, at 09:46, 'robert therriault' via Programming
>>>>> <[email protected]> wrote:
>>>>>
>>>>> jig902 script
>>>> ----------------------------------------------------------------------
>>>> For information about J forums see http://www.jsoftware.com/forums.htm
>>>
>>> --
>>> This email has been checked for viruses by AVG.
>>> https://www.avg.com
>>>
>>> ----------------------------------------------------------------------
>>> For information about J forums see http://www.jsoftware.com/forums.htm
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm