Re: [Jprogramming] running count

2018-03-31 Thread Raul Miller
; (/: /:~ ;@(<@i.@#/.~)) 1 2 1 1 2{ 0 3 1 > 2 0 0 1 1 > > > R.E. Boss > > >> -Original Message- >> From: Programming On >> Behalf Of Raul Miller >> Sent: woensdag 28 maart 2018 22:02 >> To: Programming forum >> Subject: Re: [J

Re: [Jprogramming] running count

2018-03-31 Thread R.E. Boss
No: (/: /:~ ;@(<@i.@#/.~)) 1 2 1 1 2{ 0 3 1 2 0 0 1 1 R.E. Boss > -Original Message- > From: Programming On > Behalf Of Raul Miller > Sent: woensdag 28 maart 2018 22:02 > To: Programming forum > Subject: Re: [Jprogramming] running count > > T

Re: [Jprogramming] running count

2018-03-30 Thread R.E. Boss
55 > To: programm...@jsoftware.com > Subject: Re: [Jprogramming] running count > > Hiya, > >rc=: i.~ (] - {) /:@/: >rc 1 2 1 1 2 > 0 0 1 2 1 > > Cheers, > Louis > > > On 28 Mar 2018, at 20:32, Joe Bogner wrote: > > > > I think this is

Re: [Jprogramming] running count

2018-03-30 Thread Louis de Forcrand
Hiya, rc=: i.~ (] - {) /:@/: rc 1 2 1 1 2 0 0 1 2 1 Cheers, Louis > On 28 Mar 2018, at 20:32, Joe Bogner wrote: > > I think this is an easy one but it's escaping me. How to calculate a > running count of an item in a list? > > runct (1,2,1,1,2) -: 0,0,1,2,1 > runct (5,6,5,5,6) -: 0,0,1,

Re: [Jprogramming] running count

2018-03-28 Thread Jan-Pieter Jacobs
Hey all, I came up with this version: <:@(i.~ {"0 1 +/\@|:@=) 1 2 1 1 2 Best regards, Jan-Pieter On Wed, 28 Mar 2018, 22:02 Raul Miller, wrote: > This? > >(/: /:~ ;@(<@i.@#/.~))1 2 1 1 2 > 0 0 1 2 1 > > -- > Raul > > > On Wed, Mar 28, 2018 at 2:32 PM, Joe Bogner wrote: > > I think this is

Re: [Jprogramming] running count

2018-03-28 Thread Raul Miller
This? (/: /:~ ;@(<@i.@#/.~))1 2 1 1 2 0 0 1 2 1 -- Raul On Wed, Mar 28, 2018 at 2:32 PM, Joe Bogner wrote: > I think this is an easy one but it's escaping me. How to calculate a > running count of an item in a list? > > runct (1,2,1,1,2) -: 0,0,1,2,1 > runct (5,6,5,5,6) -: 0,0,1,2,1 > > Th

Re: [Jprogramming] running count

2018-03-28 Thread Joe Bogner
Chris - thank you again, looks good. Henry - I started there but got stuck (should've mentioned it). I skimmed though it and was trying to apply pi to the problem, which clearly didn't work. It looks like oc is what I needed. Upon a re-read, "oc" or "occurrence count" is exactly what I'm looking f

Re: [Jprogramming] running count

2018-03-28 Thread Henry Rich
See also http://code.jsoftware.com/wiki/Essays/Progressive_Index-Of Henry Rich On 3/28/2018 3:14 PM, chris burke wrote: Following up your good start: a ,: <: +/ (* +/\"1) = a=: 1 2 1 1 2 3 2 3 1 2 1 1 2 3 2 3 0 0 1 2 1 0 2 1 a ,: <: +/ (* +/\"1) = a=: 5 6 5 5 6 5 7 6 5 6 5 5 6 5 7 6 0 0

Re: [Jprogramming] running count

2018-03-28 Thread chris burke
Following up your good start: a ,: <: +/ (* +/\"1) = a=: 1 2 1 1 2 3 2 3 1 2 1 1 2 3 2 3 0 0 1 2 1 0 2 1 a ,: <: +/ (* +/\"1) = a=: 5 6 5 5 6 5 7 6 5 6 5 5 6 5 7 6 0 0 1 2 1 3 0 2 On Wed, Mar 28, 2018 at 11:32 AM, Joe Bogner wrote: > I think this is an easy one but it's escaping me. How t

[Jprogramming] running count

2018-03-28 Thread Joe Bogner
I think this is an easy one but it's escaping me. How to calculate a running count of an item in a list? runct (1,2,1,1,2) -: 0,0,1,2,1 runct (5,6,5,5,6) -: 0,0,1,2,1 This seems to be a good start = (5,6,5,5,6) 1 0 1 1 0 0 1 0 0 1