« first day (1702 days earlier)      last day (960 days later) » 

2:24 AM
@MasterQuiz ah I didn't know that thanks!
 
 
2 hours later…
4:22 AM
i don't think you noticed @xpqz but i am pretty sure there is a typo on iteration#del
 
 
2 hours later…
5:58 AM
CMC: for (2≤≢⍵)∧1=⍴⍴⍵, if ≢⍵ is odd, extract odd elements and even elements, e.g. for 1 0 2 3 4 return (1 2 4)(0 3), if ≢⍵ is even, the last element belongs to both sequence, e.g. for 1 0 2 3 return (1 2 3)(0 3)
 
@LdBeth Why doesn't 1 0 2 3 give (1 3)(0 2 3)?
 
oh, I mean odd and even position elements, determined by ⎕io←1 ⋄ ⍳≢⍵
so the parity of numbers in the sequence doesn't matter, the function could even accept characters, e.g. 'bananas' gives 'bnns' 'aaa'
 
6:15 AM
@LdBeth Dyalog Extended, 20: 0 ¯1↓¨¯1.5 2,⌿⍤⍴⊢,⊢/ Try it online!
 
wow, that's a lot shorter that I expecting
 
Oh, I thought you'd have a much shorter, clever solution.
@LdBeth Also note that it uses the extended . The equivalent vanilla Dyalog solution would be 0 ¯1↓¨(⌈2,⍨2÷⍨1+≢),⌿⍤⍴⊢,⊢/
@user16722171 Hi there. If you want to participate here, please email access@apl.chat
 
I was using Replicate instead of reshaping which makes it much longer
 
7:17 AM
^ my font with little support for apl
also how do i make that shorter ^ (i am talking about all those 2s)
 
@pVCaecidiosporeadduced (8⍴2)
Or shorten the whole thing to {⍵⊤⍨8⍴2}
 
⎕← 8 {⍵⊤⍨⍺⍴2} 231
 
@pVCaecidiosporeadduced 1 1 1 0 0 1 1 1
 
2∘|J <- what is the ∘|?
 
@pVCaecidiosporeadduced with an array operand is "Currying". It binds the 2 as constant left argument to |, thus deriving a monadic function you could call "parity". Technically speaking, ∘| can stand alone as a monadic operator, but that is probably not what you have in mind.
 
7:31 AM
⎕← 4×.÷ 2 2⍴⍳4
 
@pVCaecidiosporeadduced 5.333333333 2
 
is there a way i can visualise these operations?
 
@pVCaecidiosporeadduced Like this?
      'tc'⎕CY'dfns'
      4(×tc).(÷tc) 2 2⍴⍳4
4  ÷  1  =>  4
4  ÷  2  =>  2
4  ÷  3  =>  1.333333333
4  ÷  4  =>  1
4  ×  1.333333333  =>  5.333333333
2  ×  1  =>  2
5.333333333 2
 
yes something like that
 
@pVCaecidiosporeadduced An alternative is ⎕←4{⍺'×'⍵}.{⍺'÷'⍵} 2 2⍴⍳4
 
7:37 AM
@Adám
┌───────────────┬───────────────┐
│┌─────┬─┬─────┐│┌─────┬─┬─────┐│
││4 ÷ 1│×│4 ÷ 3│││4 ÷ 2│×│4 ÷ 4││
│└─────┴─┴─────┘│└─────┴─┴─────┘│
└───────────────┴───────────────┘
 
@TryAPL this looks better
 
Using a scalar left argument to f.g doesn't really illustrate what it does though. A better example is ⎕←(2 2⍴⎕A){⍺'×'⍵}.{⍺'÷'⍵}(2 2⍴⎕C⎕A)
 
@Adám
┌───────────┬───────────┐
│┌───┬─┬───┐│┌───┬─┬───┐│
││A÷a│×│B÷c│││A÷b│×│B÷d││
│└───┴─┴───┘│└───┴─┴───┘│
├───────────┼───────────┤
│┌───┬─┬───┐│┌───┬─┬───┐│
││C÷a│×│D÷c│││C÷b│×│D÷d││
│└───┴─┴───┘│└───┴─┴───┘│
└───────────┴───────────┘
 
8:15 AM
@pVCaecidiosporeadduced You're not wrong. I shall fix. Many thanks for eagle-eyed reading.
 
@zeynel Welcome back. Long time no see!
 
 
4 hours later…
12:15 PM
@pVCaecidiosporeadduced Is there a reason why you want to put 8 twos? Cause you can do something like that 2⊥⍣¯1⊢
 
 
1 hour later…
1:34 PM
@MasterQuiz to get 8 bits
 
 
1 hour later…
2:44 PM
Announcement: BAA webinar in 15 minutes. Zoom 858 532 665, passcode: ×/1920 12 17
 
 
2 hours later…
4:37 PM
@Adám was it supposed to end?
i thought the audio got cut off abruptly
 
@Razetime Yes.
 
alright
 
@pVCaecidiosporeadduced Just asking, cause when I didn't know about the inversion trick, I used to put some twos to be sure I always get the first "valid" one...
 
5:26 PM
@MasterQuiz Well, you can compute how many 2s you need by taking the 2-logarithm of the argument:
      a←1000?1e6
      ]runtime -c {⍵⊤⍨2⍴⍨⌈2⍟2⌈⌈/⍵}a 2⊥⍣¯1⊢a

  {⍵⊤⍨2⍴⍨⌈2⍟2⌈⌈/⍵}a → 4.0E¯6 |   0% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
  2⊥⍣¯1⊢a           → 5.1E¯6 | +26% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
 
what!? how is that faster!!
 
I think it is because ⊥⍣¯1 has to do all kinds of extra checks. E.g. my dfn doesn't support non-positive numbers.
 
oh
still, pretty rare a pure(r) apl solution beats a 'primitive'
even though ⊥⍣¯1 isn't really a primitive (is it? idk)
 
¯\_(⍨)_/¯
@user922600 Hi Dan H. If you want to participate here, please email access@apl.chat
 
@rak1507 it at least must be implemented as a single thing
 
5:39 PM
yeah
 

« first day (1702 days earlier)      last day (960 days later) »