« first day (2361 days earlier)      last day (286 days later) » 

1:43 PM
In the definition for Under {⍺←{⍵ ⋄ ⍺⍺} ⋄ ⍵⍵⍣¯1⊢(⍵⍵ ⍺)⍺⍺(⍵⍵ ⍵)}, what does {⍵ ⋄ ⍺⍺} mean?
 
2:37 PM
@rabbitgrowth It is a monadic operator which, when is later mentioned, consumes the ⍵⍵ function without applying it. Now I think of it, I believe it could also have been written ⍺←⍣0
 
2:48 PM
Ah, so the ⋄ ⍺⍺ part doesn't actually do anything and is just there to force the definition into that of an operator?
 
Correct.
 
Got it. Thank you!
I had no idea you could write ⍣0 on its own
 
3:00 PM
Welcome to APL Quest 2020-6! Today's quest is Move to the Front:
> Write a function that, given a right argument which is an integer vector and a left argument which is an integer scalar, reorders the right argument so any elements equal to the left argument come first while all other elements keep their order.
Jul 7 at 18:13, by RubenVerg
{⍵[⍋⍺≠⍵]} and its friend ⊂⍤⍋⍤≠⌷⊢
Jul 7 at 18:13, by RubenVerg
and the much faster (=,≠)⊢⍤/⊢,⊢
I think we can do better than this.
 
I had {⍵[⍋⍺≠⍵]} as well
 
Try to do it in terms of sets. We've got one set (3) and another (1 2 3 4 1 3 1 4 5).
@RubenVerg Might run even faster to write (=,≠) as (,∘~⍨=) or ,∘~⍨⍤=
 
(∩,~)⍨ ?
 
Yes, perfect, or distribute the over the outer tines: ∩⍨,~⍨
Nice that ,∘~⍨⍤=⊢⍤/⊢,⊢ has no parens. Looking forward to ≠~⍛,⍛/⊢,⊢ in 20.0…
 
That is nice.
 
3:08 PM
Your "nice" was probably on ∩⍨,~⍨ 😃
 
Yes, that's what I meant :)
 
@Adám Slightly with a million random elements 1…10:
  3((=,≠)⊢⍤/⊢,⊢)y  → 5.3E¯4 |  0% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
  3(,∘~⍨⍤=⊢⍤/⊢,⊢)y → 5.2E¯4 | -2% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
 
I also wrote down ~⍨,⍨=⊢⍤/⊢ and ~⍨,⍨+.=⍴⊣ but forgot about
Really nice how it preserves the repetitions
 
Yes. Sometimes people think that's strange, but it is actually more powerful.
OK, I think this is it.
 
Could always do ∪⍤∩
(looks like a running guy)
 
3:18 PM
How does that work?
 
huh, suprised at the little difference between my naive solution and the train
cmpx '3{((⍺=⍵)/⍵),((⍺≠⍵)/⍵)} x' '3(∩⍨,~⍨) x'
3{((⍺=⍵)/⍵),((⍺≠⍵)/⍵)} x → 3.6E¯4 | 0% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
3(∩⍨,~⍨) x → 2.7E¯4 | -27% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
 
@Adám just gets rid of the repetitions
 
Ah, you mean if one needs a pure set function. Right.
 
Is it better to do ∩⍥∪ ?
 
Possibly faster, but probably depends on the data. After all, might significanty lessens the amound of data to be 'ed.
 
3:23 PM
I see, that makes sense
Can't stop seeing ∪⍤∩ and ∩⍥∪ as someone who's running and panting heavily
 
See you next week for 2020-7: See You in a Bit!
 
See you!
 
Sorry, too late. Had no access. See you next week!
 
 
1 hour later…
5:01 PM
@rabbitgrowth while certainly very elegant, I would have never guessed set operations to be about as fast as mine
(that is, until I realized I was basically exactly reimplementing intersection and difference)
also, seems like the version with the double selfies is consistently slower
 
 
4 hours later…
8:38 PM
@Adám j solution: 0<17 b.
(while I think of a good way to do it in dyalog :) )
oh I misread the question, it wants all flags not any flag
doesn't work then
 
8:51 PM
alright, I have ∧/∊⍥(⍸⍤⌽2⊥⍣¯1⊢)
 

« first day (2361 days earlier)      last day (286 days later) »