Now work in reverse. Build a small model:
]D=:?#~12
1 0 2 9 8 6 2 9 2 9 10 0
(P ([:>.*)<:#D){/:~D
0 0 2 6 9 10 10
Write the explicit definition:
pc5=: 13 :'(x ([:>.*)<:#y){/:~y'
P pc5 D
0 0 2 6 9 10 10
P pc4 D
0 0 2 6 9 10 10
It matches the result of pc4. But sometimes you get lucky!
It's even shorter than oc4.
pc5
([ ([: >. *) [: <: [: # ]) { [: /:~ ]
pc4
([ ([: >. *) [: ([: <: #) ]) { [: /:~ ]
Linda
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Linda Alvord
Sent: Thursday, July 30, 2015 2:10 AM
To: [email protected]
Subject: Re: [Jprogramming] [Jdatabase] A few questions
Tacit comes in many styles. You might find this script interesting.
P=: 0.01 0.05 0.25 0.50 0.75 0.95 0.99
pc=: 13 :'(x >.@* <:@# y){/:~y'
D=:?#~12
P pc D
pc2=: (] {~ [ >.@* <:@#@]) /:~
P pc2 D
pc3=: 13 :'(x >.@* ([:<:#) y){/:~y'
P pc3 D
pc4=: 13 :'(x ([: >.*)([:<:#) y){/:~y'
P pc4 D
5!:4 <'pc'
5!:4 <'pc2'
5!:4 <'pc3'
5!:4 <'pc4'
pc
pc2
pc3
pc4
Linda
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Yoel Jacobsen
Sent: Wednesday, July 29, 2015 7:51 AM
To: Programming forum <[email protected]>
Subject: Re: [Jprogramming] [Jdatabase] A few questions
Brian,
I wasn't aware of 13: . Thank you.
Yoel
>From Brian Schott <[email protected]>
> Have you tried the 13 : feature like this?
>
> 13 : '(x >.@* <:@# y){/:~y'
> ([ >.@* [: <:@# ]) { [: /:~ ]
>
>
>
> --
> (B=) <-----my sig
> Brian Schott
> ----------------------------------------------------------------------
> 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