[Jprogramming] Just sharing: The Edges of Our Universe

2021-04-09 Thread ethiejiesa via Programming
Hello J, "The Edges of Our Universe" is a nice and very accesible paper by Toby Ord that discusses different natural "edges" to the universe that arise in General Relativity (and in particular the ΛCDM model) and some futurist implications. https://arxiv.org/abs/2104.01191 Anyway, the tail end o

Re: [Jprogramming] histogram in stats/base

2021-04-09 Thread Devon McCormick
I have noticed some oddities here too but mostly have ignored them and adjusted my plots to compensate. I mostly use my own variant "plotHistoMulti" - here: https://code.jsoftware.com/wiki/User:Devon_McCormick/myStats - but have not yet nailed down exactly what is off with the underlying. On Sat,

[Jprogramming] histogram in stats/base

2021-04-09 Thread Gilles Kirouac
About the histogram verb in stats/base NB. The result is a list of counts of the number of data points in each interval. Intervals are specified by the left argument. histogram uses dyadic I. The I. primitive defines (1+#x) intervals. See its clear definition in Nuvoc. In short, it

Re: [Jprogramming] String prefixes and tabulation

2021-04-09 Thread 'Pascal Jasmin' via Programming
'ello' (<@[ +/@:= #@[ <\ ])'Hello Jello' will return the count of matches. On Friday, April 9, 2021, 09:48:11 a.m. EDT, Emir U wrote: s=: 'Hello Jello' Given a string like the above, I need to tabulate the number of occurrences of every letter for every prefix of length >=k. I also

[Jprogramming] Fwd: Fwd: read failure on Mac j903 beta-h

2021-04-09 Thread J. Patrick Harrington
I sent this message from an account which I think is unknown to the j forum.  Hope it doesn't appear twice. Forwarded Message Subject:Fwd: read failure on Mac j903 beta-h Date: Fri, 9 Apr 2021 14:14:33 -0400 From: JAMES PATRICK HARRINGTON To: j...@astro.umd.ed

Re: [Jprogramming] String prefixes and tabulation

2021-04-09 Thread xash
You can get every substring in a list with ; <@<\\. s If k is quite large, your approach with every k : #) <@<\ ] tab=: (<:@# ; }: ; {:)&> count=: ~. ,. <@#/.~ f=: count@:tab@:subs 4 f s -- For information about J

Re: [Jprogramming] String prefixes and tabulation

2021-04-09 Thread Emir U
Hey Mike, no prefixes don't have counts, letters with prefixes have counts. Your example: Hello Jello Hello Jello prefix length=8, prefix=llo Jell, letter=o, count=2 That's true for 'o' because 'o' follows both occurrences. Some more examples using your string. prefix length=1, prefix=l, lett

Re: [Jprogramming] String prefixes and tabulation

2021-04-09 Thread 'Michael Day' via Programming
Thanks - so in this slightly longer,  repetitive string: <<     s,' ',s Hello Jello Hello Jello >> 'llo Jell' would be a prefix (among several others!) with a count of two? (I see Julian has posted something which is probably useful...) Cheers, Mike On 09/04/2021 15:12, Emir U wrote: Hey Mi

Re: [Jprogramming] String prefixes and tabulation

2021-04-09 Thread Julian Fondren
/. gives you letter-tabulations and \ gets you prefixes: s=: 'Hello Jello' Given a string like the above, I need to tabulate the number of occurrences of every letter for every prefix of length >=k. I also need to know the length of the prefix. So: As an example, prefix length=3, prefi

Re: [Jprogramming] String prefixes and tabulation

2021-04-09 Thread Emir U
Hey Mike, many thanks for looking, its all just one string. There are no implicit delimiters in the string itself. Emir > Just in case it matters,  are you regarding Hello & Jello as distinct words > here,  or is space just another character? > If they're separate,  then we need only examine (;:

Re: [Jprogramming] String prefixes and tabulation

2021-04-09 Thread 'Michael Day' via Programming
Just in case it matters,  are you regarding Hello & Jello as distinct words here,  or is space just another character? If they're separate,  then we need only examine (;: s) or (cut s), brackets only to delimit the J idioms. Thanks, Mike On 09/04/2021 14:48, Emir U wrote: s=: 'Hello Jello'

[Jprogramming] String prefixes and tabulation

2021-04-09 Thread Emir U
s=: 'Hello Jello' Given a string like the above, I need to tabulate the number of occurrences of every letter for every prefix of length >=k. I also need to know the length of the prefix. So: As an example, prefix length=3, prefix=ell, letter=o, count=2 In my real use case k may be quite