« first day (2437 days earlier)      last day (438 days later) » 

00:52
@mitchelljohnstone probably missing something, but not seeing a way to trim the two args down to equal size without them being being "enclosed" at the end, unless I use mix. eg, this works for the basic calculation, but only with the mix, otherwise it returns the answer enclosed: ↑⍤(≤⌿⌊⍥≢↑¨,⍥⊂)
 
3 hours later…
04:19
@Jonah Maybe again a case for a dfn? {(+/,+/⍤~)+/⍺≤⍥((⍺⌊⍥≢⍵)∘↑)⍵} use the already computed length: {l(⊢,-)+/⍺≤⍥((l←⍺⌊⍥≢⍵)∘↑)⍵}
@Adám You don't prefer (⊃(≤⌿⌊⍥≢↑¨,⍥⊂)) to {⍺≤⍥((⍺⌊⍥≢⍵)∘↑)⍵}?
Either is fine, but there are other clever approaches, like +/1 0∘.=1 1⍉∘.≤
@Adám Isn't that only for processing after you've got them the same length?
No, that's the whole thing. Uses an outer product, so original lengths can be anything, then takes the diagonal which trunkates to shortest.
@Adám I'm getting rank error pasting that as is
04:28
      6 6 2 1 (+/1 0∘.=1 1⍉∘.≤) 6 5 5
2 1
@Adám maybe bc I have 0 indexing set
Yes, that'd do it. If so, then change 1 1 to 0 0
yeah that was it. ok that solution is quite nice, ty
 
3 hours later…
07:02
does apl have non-overlapping n-wise reduce. ie, the equivalent of _2]\] in J? Link
I noticed the specifying a negative reverse the results in apl, rather making the window non-overlapping, but thought there might be another way to achieve it.
@Jonah Stencil.
 
11 hours later…
17:54
@Adám My solution to the key value problem, using stencil: ' =' (⊢⌺(⍪2 2) ~⍤∊⍨ ⊆ ⊢) 'lang=APL dial=Dyalog'. tryapl link. Suggestions?
18:09
@Jonah That's exactly what I had ∘.○
 
2 hours later…
19:55
@mitchelljohnstone Nice, I was wondering if there was a shortcut for the (⍪2 2) part, since there is in J. Neither language afaik allows a wildcard for one position in shape, which I think would be a nice feature.

« first day (2437 days earlier)      last day (438 days later) »