« first day (2039 days earlier)      last day (602 days later) » 

8:24 AM
@Adám You can use a negative sign even if it's a zero, but I hear you that the notation is not negating only the degree part. Maybe it's better to have an extra coordinate with the sign. so ¯1 42 7 30 or 1 42 7 30.
This is basically a variant of @LdBeth's suggestion.
 
8:55 AM
@doug Sure, but I really think negating every element is much better and clearer, as it literally means −x degs, −y mins, −z secs.
 
Fair enough. My preference would be to hew as closely to what seems standard. I guess it might be worth considering whether there are any operations that might be performed on the values. Your way might work better if you're meant to add coordinates.
 
 
6 hours later…
3:00 PM
Welcome to APL Quest 2015-10! Today's quest is Blaise’ing a Trail:
> Write a function that takes an integer right argument representing the order of the Pascal’s triangle to be created and returns a “nicely” formatted character matrix with the lines being centered.
 
(((⌈2÷⍨⊢-⊢/)≢¨)⌽↑)((⍕⊢!⍨0,⍳)¨0,⍳)
 
Nice!
 
Can't copy my solution now, but I formatted each line, determined the length of it and appended spaces depending on the length of the longest line. Not a very nice solution however.
 
I have {m⌽⍨-⌊2÷⍨+/∧\' '=⌽m←↑⍕¨0~⍨¨↓⍉∘.!⍨0,⍳⍵}
 
@rabbitgrowth ah, rotate is much smarter, thanks!
forgot about that option
 
3:07 PM
I tried to use negative overtake at first
 
what do you mean with that?
 
@rabbitgrowth Slightly shorter:
(↑⌽⍨∘(⌈2÷⍨⊢-⊢/)≢¨)((⍕i!⊢)¨i←0,⍳)
 
Nice. I always forget you could use assignment inside a train.
@Richard For example, ¯21↑'1 3 3 1'
 
@Richard Compute half the difference between the line lengths and the the length of the last line, then mix.
 
ok!
 
3:19 PM
Like this: (↑⊢↑¨⍨((⌈-+2÷⍨⊢-⊢/)≢¨))((⍕i!⊢)¨i←0,⍳)
1 char shorter as half-explicit: {↑⍵↑¨⍨(⌈-+2÷⍨⊢-⊢/)≢¨⍵}((⍕i!⊢)¨i←0,⍳)
 
didn't now about ¯21↑'1'. Why is 21↑'1' not adding 20 spaces like ¯21↑'1' is prepending spaces?
 
It does, but on the right.
 
⋄'2',⍨21↑'1'
 
@Richard 1 2
 
it does :)
 
3:23 PM
Another one using outer product: {m⌽⍨-⌊2÷⍨+/∧\' '=⌽m←{⍕⍵~0}⍤1⍉∘.!⍨0,⍳⍵}
 
ay, is that dyadic transpose?
 
No, the 1 on its left is the operand of (Rank)
Not so bad either: (↑⊢↑⍨¨∘⌈¯2÷⍨∘(⊢/+⊢)≢¨)((⍕i!⊢)¨i←0,⍳)
Half-explicit: {↑⍵↑⍨¨⌈¯2÷⍨(⊢/+⊢)≢¨⍵}((⍕i!⊢)¨i←0,⍳)
Same length all-tacit: (↑⊢↑⍨¨∘(⌈¯2÷⍨⊢/+⊢)≢¨)((⍕i!⊢)¨i←0,⍳)
Ooh better arithmetic: (↑⊢↑⍨¨∘(⌈2÷⍨--⊢/)≢¨)((⍕i!⊢)¨i←0,⍳)
Oh well, probably not much more to say here, is there?
 
I was thinking about how to get rid of the zeros and came up with ... drumroll ... {(-⌽0,⍳⍵)↓¨↓⍉∘.!⍨0,⍳⍵}. Of course you can just ~0! I always forget about ~ for some reason
 
I used ~ twice above.
 
Yeah, that's how I realized you can just use ~0.
 
3:40 PM
OK, I guess that's it for 2015 then. See you next week for the easy 2016-1: Statistics - Mean.
 
thanks for today!
 
See you all next week!
 
Btw, I'm thinking of making these events an hour or two earlier. Not now, but maybe in a month or two.
 
ok, not sure if that fits but will put it in the agenda. Thanks for warning in advance so I can arrange something
 
I could do it step-by-step, first one hour earlier from mid-October, and then another hour earlier from mid-November.
 
3:48 PM
That's totally OK for me.
 
We also have DST so it will shift nevertheless. As long as I know it in advance I can probably arrange something in my agenda.
 
GMT+8 here, so 11pm → 9pm for me. But these APL learning sessions are so good I would happily wake up at 4am if I had to :)
 
:)
 
4:33 PM
why is 0⌈⍬ equal to ⍬ and 0⌊⍬ also? Something is always more than nothing, or? Or why no syntax error?
 
@Richard You're confusing numeric maximum with total array ordering.
 
@Richard and are pervasive, so the structure of the result should be the exact same as 0+⍬ etc
 
Indeed ⎕← 0 {⊃(⍋-⍒)⍺⍵} ⍬
 
@Adám 1
 
@dzaima you mean the '0' is downgraded to an empty vector, so it has the same dimension?
or the result is downgraded to an empty vector
 
4:41 PM
The 0 is distributed to "all" elements of and for each pair, the lowest is returned.
 
@Richard same as 1+2 3 4 becomes ((⍴2 3 4)⍴1) + 2 3 4, 0⌈⍬ becomes ((⍴⍬)⍴0) ⌈ ⍬
 
ok, thanks! that makes sense.
 
 
7 hours later…
11:42 PM
Hello, quick question
when I perfor
perform*
I obtain 1 4 correctly
however, if I do
⍴ ,/ (1 2) (3 4)
I obtain an empty numeric vector
I meant
⍴ ,/ (1 2 ⍴ 2) (1 2 ⍴ 2)
I wanted to avoid defining a recursive function for it. How can I fix this?
 

« first day (2039 days earlier)      last day (602 days later) »