Re: [Jprogramming] Gerund composed application

2017-09-24 Thread Jose Mario Quintana
I am surprised to hear that the second solution produces a syntax error in J604 even taking into account that J604 is quite old. I am pretty sure it should work in J701 and definitely works in, JVERSION Engine: j805/j64/windows Release: commercial/2016-12-11T08:02:16 Library: 8.05.10 Qt IDE: 1

Re: [Jprogramming] Gerund composed application

2017-09-24 Thread Raul Miller
Ah, sorry, I had not read your original post close enough. That's a bad habit, and I need to do better on reading other people's concepts. That said, I can offer some variants on Jose's approach: at=:4 :0 x`:6@:(y`:6)`'' ) Example use: at/(]`{.`{:`{:) Or, equivalently: at=: (<'@:') ,@<@,

Re: [Jprogramming] Ranges

2017-09-24 Thread Don Guinn
Or if the data is unordered. 8 100 (]#~[:~:/>:/) 2 45 10 300 45 10 On Sun, Sep 24, 2017 at 7:07 PM, Louis de Forcrand wrote: > You could compress twice: > > drng=: {.@[ (<: # ]) {:@[ (>: # ]) ] > > Perhaps faster on large data? > You could reorder and filter out the data under the lower bou

Re: [Jprogramming] Ranges

2017-09-24 Thread Louis de Forcrand
You could compress twice: drng=: {.@[ (<: # ]) {:@[ (>: # ]) ] Perhaps faster on large data? You could reorder and filter out the data under the lower bound first if your data is usually smaller than it to speed up the verb. Louis > On 24 Sep 2017, at 22:37, Joey K Tuttle wrote: > > Yes, my

Re: [Jprogramming] Gerund composed application

2017-09-24 Thread Louis de Forcrand
rob=: {: ,~ ({.[:`'') ,@,. }: g=: %:`*:`+: g +--+--+--+ |%:|*:|+:| +--+--+--+ rob g +--+--+--+--+--+ |[:|%:|[:|*:|+:| +--+--+--+--+--+ (rob g)`:6]5 10 "rob" transforms your gerund into a suitable train. You can then apply it with `:6. Cheers, Louis > On 24 Sep 2017, at 20:35, Rob

Re: [Jprogramming] Ranges

2017-09-24 Thread Joey K Tuttle
Yes, my bad. I did sort and forgot that I had. I should have caught that silliness - sorry for the noise. This was a problem that I worked on in APL back in 1971 when I had a tape with many thousands of data points and wanted to put them in buckets (actually just count them) - it was that stru

Re: [Jprogramming] Ranges

2017-09-24 Thread Skip Cave
I suspect that Joey sorted a before breaking it into ranges: ]b =. /:~ a 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 /:~ ( 5 10 15 I. b) wrote: > Joey T. said: > > /:~ (0 5 10 15 I. a) ┌─┬──┬──┬──┐ > │1 2 3 4 5│6 7 8 9 10│11 12 13 14

Re: [Jprogramming] Ranges

2017-09-24 Thread Skip Cave
Joey T. said: /:~ (0 5 10 15 I. a) wrote: > /:~ (0 5 10 15 I. a) ┌─┬──┬──┬──┐ > │1 2 3 4 5│6 7 8 9 10│11 12 13 14 15│16 17 18 19 20│ > └─┴──┴──┴──┘ > > But that is a more boring (and perhaps less useful) res

Re: [Jprogramming] Ranges

2017-09-24 Thread Joey K Tuttle
/:~ (0 5 10 15 I. a) On 2017Sep 24, at 12:57, Skip Cave wrote: > > Jimmy G said: > > With key /. and < > > (0 5 10 15 I. a) > <<<>>> > >a > > 9 12 2 20 14 11 13 15 7 5 3 19 8 1 4 16 10 6 18 17 > > >(0 5 10 15 I. a) > ┌──┬──┬─┬──┐ > >

Re: [Jprogramming] Ranges

2017-09-24 Thread Skip Cave
Jimmy G said: With key /. and < (0 5 10 15 I. a) >> a 9 12 2 20 14 11 13 15 7 5 3 19 8 1 4 16 10 6 18 17 (0 5 10 15 I. a) wrote: > With key /. and < > > (0 5 10 15 I. a) > you can also count them > > (0 5 10 15 I. a) #/. a > > > On Sun, Sep 24, 2017 at 3:19 PM, Skip Cave > wrote:

Re: [Jprogramming] Ranges

2017-09-24 Thread Brian Schott
Skip, Though not exactly what you asked for, Stemplots were designed to do a very similar thing and are discussed at the following link. http://code.jsoftware.com/wiki/User:Brian_Schott/Stemplot Based on your example and the code at that link, the following jconsole session produced a result muc

Re: [Jprogramming] Ranges

2017-09-24 Thread Jimmy Gauvin
With key /. and < (0 5 10 15 I. a) wrote: > So that brings up another interesting problem. How > to > box ranges > ​?​ > : > > ]a=:>:?~20 > 9 12 2 20 14 11 13 15 7 5 3 19 8 1 4 16 10 6 18 17 > > 0 5 10 15 brng a > ┌─┬──┬──┬──┐ > │2 5 3 1 4│9 7 8

Re: [Jprogramming] Ranges

2017-09-24 Thread Skip Cave
So that brings up another interesting problem. How to box ranges ​?​ : ]a=:>:?~20 9 12 2 20 14 11 13 15 7 5 3 19 8 1 4 16 10 6 18 17 0 5 10 15 brng a ┌─┬──┬──┬──┐ │2 5 3 1 4│9 7 8 10 6│12 14 11 13 15│20 19 16 18 17│ └─┴──┴─

Re: [Jprogramming] Ranges

2017-09-24 Thread 'Mike Day' via Programming
I was about to send something when we had to go out for a bit... My best so far is ((] #~ 1 = I.)~ (0 _1 + ])) ~ assuming I've copied it correctly... Mike Please reply to mike_liz@tiscali.co.uk. Sent from my iPad > On 24 Sep 2017, at 18:45, Skip Cave wrote: > > Marshall, > > Wo

Re: [Jprogramming] Gerund composed application

2017-09-24 Thread Rob Moore
Thanks for replying Raul, your solutions weren't what I was looking for, but I understand the confusion from my first explanation. Jose your first solution worked perfectly, thanks very much! The other two solutions you gave caused syntax errors for me, must be different versions, I'm on 604. Wha

Re: [Jprogramming] Ranges

2017-09-24 Thread Skip Cave
Marshall, Wow! that is neat! I hadn't really understood dyadic I. but this forced me to try to understand it: 8 100 (]#~1=I.) 2 10 45 300 10 45 8 100 I. 2 10 45 300 0 1 1 2 1 = 8 100 I. 2 10 45 300 0 1 1 0 (1 = 8 100 I. 2 10 45 300) # 2 10 45 300 10 45 8 100 I. 2 10

Re: [Jprogramming] Gerund composed application

2017-09-24 Thread Rob Moore
Hi, sorry let me try to clarify and give my own use case. I'm looking for a function which takes a gerund on the left and applies the gerund's verbs one by one monadically from right to left to the right argument, (with no rank modifications to the verbs). My use case is that I'm implementing red

[Jprogramming] wiki navigation

2017-09-24 Thread Eric Iverson
Wiki Main Page and System page now link to an Interpreter page that links to Requests and Bugs pages. Use of these resources should make it easier for us all to stay on top of JE evolution. -- For information about J forums see ht

[Jprogramming] Fwd: RE: Pick up sticks

2017-09-24 Thread Linda Alvord
Sent from AOL Mobile Mail From: Linda Alvord Date: Sunday, September 24, 2017 Subject: RE: Pick up sticks To: lindaalvord This works in 805 but not 806 android.  if messages are in html how do you get to the J code? Linda Sent from AOL Mobile Mail On Sunday, September 17, 2017 Linda Alv

Re: [Jprogramming] Gerund composed application

2017-09-24 Thread Jose Mario Quintana
an=. <@:((,'0') (,&:<) ])NB. Atomizing words (monadic verb) f=. '(x , an y)`:6' (dyad :) NB. Explicit compliant version (*:`+:) f 4 64 train=. (<'`:')(0:`)(,^:)&6 f=. train@:([ , an@:]) f. NB. Non-compliant fixed tacit version (*:`+:) f 4 64 f=. "..@:([ , "..i

[Jprogramming] Fwd: RE: Pick up sticks

2017-09-24 Thread Linda Alvord
Sent from AOL Mobile Mail From: Linda Alvord Date: Sunday, September 24, 2017 Subject: RE: Pick up sticks To: lindaalvord This works in 805 but not 806 android.  if messages are in html how do you get to the J code? Linda Sent from AOL Mobile Mail On Sunday, September 17, 2017 Linda Alv

Re: [Jprogramming] Gerund composed application

2017-09-24 Thread Raul Miller
You did not give an example of what you want to see, and your description allows for at least two different interpretations: f1=: 4 :'x`:6 y'"_1 f2=: 4 :'((#y)$x) f1 y' They both give the same result when x and y have the same number of items. What are you trying to do? Thanks, -- Raul On

[Jprogramming] Gerund composed application

2017-09-24 Thread Rob Moore
Hi guys, I am wondering if there already exists a way of doing something that I want, which is an elementary enough operation that I was quite surprised to not have found it in jvoc/evoke gerund. If I have some gerund say *:`+: I am looking for some function which will apply the gerund's constit

Re: [Jprogramming] Ranges

2017-09-24 Thread Marshall Lochbaum
Also note that this will test whether numbers are in a half-open interval, that is, exclusive on the left and inclusive on the right (so 10 < x <= 100 in your example). If you want an exclusive interval like your solution tests for, you will need to subtract 0 1 from the left argument. Marshall O

Re: [Jprogramming] Ranges

2017-09-24 Thread Marshall Lochbaum
Try rng =: ] #~ 1=I. it's about half as fast because I. is not very well-optimized. Marshall On Sun, Sep 24, 2017 at 02:29:31AM -0500, Skip Cave wrote: > Here's a function I came up with to select numbers in a vector which are > within some range. > > Find all the numbers between 10 & 100 in a

[Jprogramming] Ranges

2017-09-24 Thread Skip Cave
Here's a function I came up with to select numbers in a vector which are within some range. Find all the numbers between 10 & 100 in a set of random numbers from 0 to 200: rng =. 4 : '((({.x)/y))#y' 10 100 rng ?50$200 89 91 32 85 84 27 31 20 28 66 96 93 22 85 39 97 82 35 90 67 34 35