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
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=: (<'@:') ,@<@,
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
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
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
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
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
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
/:~ (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)
> ┌──┬──┬─┬──┐
>
>
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:
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
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
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│
└─┴──┴─
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
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
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
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
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
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
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
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
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
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
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
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
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
26 matches
Mail list logo