Re: [Jprogramming] How to improve speed searching for substrings using "E."?

2019-06-30 Thread Louis de Forcrand
woops! Sorry, I changed the name of the adverb before sending the message (to something more descriptive than mxs3 :) but I forgot to switch the recursive call. Replace mxs3 by recmax and you should be good! Louis > On 30 Jun 2019, at 17:59, vadim . wrote: > > It's amazing. Thank you so much

Re: [Jprogramming] How to improve speed searching for substrings using "E."?

2019-06-30 Thread vadim .
It's amazing. Thank you so much. I'm not yet comfortable with defining my own adverbs, and you show me constructs like "&.(B&#)" are possible. That will keep me busy for a while. One thing though, what's definition of "mxs3"? On Sun, Jun 30, 2019 at 4:57 PM Louis de Forcrand wrote: > > Hi again,

Re: [Jprogramming] a long-form essay

2019-06-30 Thread Devon McCormick
I routinely "cheat" when building tacit phrases by taking a look at what "13 :" does: 13 : '(2$x)$(>:x){.y' (2 $ [) $ ] {.~ [: >: [ 3 ((2 $ [) $ ] {.~ [: >: [) 5 5 0 0 0 5 0 0 0 5 The "trick" I see it doing here is flipping "(>:x) {. y " to " ] {.~ [: >: ", i.e. reversing the arguments of "{.

Re: [Jprogramming] How to improve speed searching for substrings using "E."?

2019-06-30 Thread Louis de Forcrand
Hi again, I haven’t much time right now, but I’ve come up with two new programs: fastmax=: 1 : 0 B=. C=. 1"_1 y while. +./C do. i=. C i.1 B=. 0 i} B B=. -.@:u&(i{y)&.(B&#) y C=. C *. B B=. 1 i} B end. B#y ) recmax=: 1 : 0 if. 1>:n=. #y do. y return. end. 'a b'=. (>.-:n) ({. ,&<&(

Re: [Jprogramming] Difficulties understanding a sentence with the compose-conjunction

2019-06-30 Thread Henry Rich
The dissect display is interactive.  If you click on a result, the selected cell of the result is highlighted, along with the input cells that contributed to it.  You can click again to move to subcells, etc. Henry Rich On 6/30/2019 7:28 AM, Thomas Bulka wrote: Am 30.06.2019 13:02 schrieb 'Ro

Re: [Jprogramming] Difficulties understanding a sentence with the compose-conjunction

2019-06-30 Thread Henry Rich
Agreed that the other methods are better on this problem.  But we don't want readers to shy away from use of x -. y  .  It is part of the i.-family and has good performance for what it is asked to do. Henry Rich On 6/29/2019 11:02 PM, bill lam wrote: Dyad -. is an expensive operation. For eff

Re: [Jprogramming] How to improve speed searching for substrings using "E."?

2019-06-30 Thread vadim .
Thank you for valuable answers. Louis, it will take me some time to study your answer, it looks like the "J way" of solving problems which I'm only hoping to grasp. Raul, I'll think on your suggestion to convert the task into numeric problem. For me it's just learning exercise, a "real life" probl

Re: [Jprogramming] Difficulties understanding a sentence with the compose-conjunction

2019-06-30 Thread Thomas Bulka
Am 30.06.2019 13:02 schrieb 'Rob Hodgkinson' via Programming: Hi Thomas, another suggestion to help you understand J phrases. Henry Rich now maintains the J engine, and awhile ago wrote a very handy verb ‘dissect’. If you run J (presumably you are running in JQT ?) then you can install the ‘deb

Re: [Jprogramming] Difficulties understanding a sentence with the compose-conjunction

2019-06-30 Thread 'Rob Hodgkinson' via Programming
Hi Thomas, another suggestion to help you understand J phrases. Henry Rich now maintains the J engine, and awhile ago wrote a very handy verb ‘dissect’. If you run J (presumably you are running in JQT ?) then you can install the ‘debug’ package in the Package Manager (see JQT menu), then do thi

Re: [Jprogramming] Difficulties understanding a sentence with the compose-conjunction

2019-06-30 Thread Thomas Bulka
Am 30.06.2019 06:14 schrieb Daniel Eklund: Thomas I think where your error is is in step 2 to step 3. Your linear description describes a composition of verbs that is different than the form of the 'to' verb actually is. It might be helpful to see the 'to' verb with a bunch of extra spaces (t

Re: [Jprogramming] How to improve speed searching for substrings using "E."?

2019-06-30 Thread Louis de Forcrand
Hi, Try this: maxs=: 1 : 0 for_i. i.-#y do. if. (i{y) +./@:u (<< fast=: cmp maxs NB. fast fstr=: fast@(\: #@>)NB. faster? maxs is a generic adverb that takes a boolean-valued verb and an array. The verb represents a partial order on the elements of the array, and maxs returns the