« first day (2179 days earlier)      last day (468 days later) » 

9:19 AM
:62759939 no, but very curious how you managed in 8. I'was very proud of 11
  0(≥⌈⍥(+/)≤)t
 
@Richard ⌈/×+.×⌸×
 
and had a fight with +/ giving an error until i put it between ()
@Adám incredible! How can you ever think of something like that.
 
@Richard Well, using was pretty obvious, since we need to count size of groups of elements that share a trait (negativeness, positiveness; i.e. the sign). Then we just need to sum them up and adjust the sign, which we can do using the sign too.
 
chapeau
 
 
2 hours later…
11:16 AM
@Adám Beautiful! I saw Key but failed to notice the inner product. Thanks for lighting up those neurons again.
 
12:13 PM
How do I assign the result of a niladic ]usrcmd to a variable?
 
@xpqz ]r←usrcmd
I should add this to APLcart.
 
@Adám I'm sure I used to know this... I even rtfm'ed, but couldn't see it.
 
@xpqz try entering ]
 
12:33 PM
:D
 
12:53 PM
⌈/|×∘≢⌸×
a variation you perhaps can make shorter?
 
APL Quest?
 
no, my try on a leetcode problem Adam mentioned
 
@mathcat no, I meant to ask "What is an APL Quest?"
 
ah, thanks
 
1:00 PM
Welcome to APL Quest 2017-10! Today's quest is Squaring Off:
> Write a function that will reshape a given array into the smallest square matrix that will contain all the elements of the argument, padding with additional elements if necessary. The pad element should be 0 if the array is numeric and space ' ' if the array is character.
 
{s s⍴⍵↑⍨2*⍨s←⌈0.5*⍨≢⍵}
with three selfies :)
 
 
Basically the same approach: {n⍴⍵↑⍨×/n←2⍴⌈*∘0.5≢⍵}⍥,
And the obligatory tacitification: (⊢(⊢⍴⊣↑⍨×/⍤⊢)2⍴≢⌈⍤*0.5⍨)⍥,
 
Yeah, I don't think there are so many ways to attack this.
 
is the ⍥, necessary?
 
1:02 PM
No.
 
for the ⍬ not is it?
 
Does seem superfluous: ⎕←≢0
 
I had the exact same thing as Richard. Also tried to tacitify it: ,⍨⍤f⍴⊢↑⍨2*⍨f←.5⌈⍤*⍨≢
 
@rabbitgrowth at least 4 ⍨'s
 
I think I like the dfn better though
 
1:04 PM
Inline assignments in tacit functions are indeed a bit hairy.
@B.Wilson While I admire your s, ⊣↑⍨×/⍤⊢ is just ×/⍤⊢↑⊣
 
@Adám Hah! Can't believe I didn't see that.
Still dissatisfied with all the ⊣⊢ going on in that inner tacit function.
 
is (⊢⍴⊣) not the same as (⍴⍨)?
 
Yes, but that is part of the expression on the right.
 
ah ok!
 
Not sure if this is better: ⊢(,⍨⍤⊢⍴↑⍨∘(×⍨)).5⌈⍤*⍨≢
 
1:12 PM
In 20.0 you'll be able to write ↑⍨∘(×⍨) as ×⍨⍛↑⍨
 
Nice
Now I see why it's called reverse compose
 
Speaking of new operators, the overtake length computation has a nice Under expression, IIUC: {⌈⍢(*∘0.5)≢⍵}.
 
{↑s↑⍵⊂⍨l⍴1↑⍨s←⌈2*∘÷⍨l←≢⍵}
@B.Wilson Indeed, although it'd look even better as ⌈⍢√≢⍵
@rabbitgrowth Good, then this session wasn't in vain.
 
I love these sessions, I almost always learn something
 
With a bunch of potential language extensions: {⍵@(⍳≢⍵)⍢,⍵⍴∘⍷⍨⌈⍢√≢⍵}
is Under, is (square)root, is type.
 
1:22 PM
@Adám Hah! That is pretty. J's monadic defaults (%: in this case) do come in handy from time to time.
Somewhat curious what Aaron would have to say about the HCI of Root. I suspect there's pushback to introducing "frivilous" primitives and such?
 
I think I'd like {n⍴⍵↑⍨×/n←2⍴⌈√≢⍵} best. Or maybe {(⊢⍴×/↑⍵⍨),⍨⌈√≢⍵}
@B.Wilson HCI?
 
Human Computer Interface
 
I myself am ambivalent about it.
If we add it, we might also want to add its inverse, which is *⍨
Anyway, that's a discussion for another day.
 
Little sidestep. Why not introduce a circle with a dot in it ⊙ for outer product? And of course keep the ∘. It is the only function which uses two characters. Probably stupid question as newcomer / non programmer
 
@Richard … or some other symbol. I suggested it, but Roger Hui countered that we already have a regular way of writing outer product, using Rank.
 
1:28 PM
@Adám but much less readable, at least for me
 
Yeah.
Now we can celebrate the half-point of the existing phase 1 problems. See you next week for 2018-1: Oh Say Can You See?
 
\○/
 
yes ,2018-1 is a nice one
 
\⍢/
Btw @Adám, do you have a solution for the LeetCode problem that's fewer than 8 characters? I'm really curious
 
2:18 PM
@rabbitgrowth No, but @dzaima said he had.
 
2:30 PM
If only / was not ambivalent, I wouldn't need the parens in ≢⍉⊢⌸(/⍨×)
 
2:56 PM
Yes indeed
 
≢⍤⍉(/⌸×) seems to work, but isn't fewer than 8 characters
 
3:49 PM
Sweet
 

« first day (2179 days earlier)      last day (468 days later) »