« first day (2067 days earlier)      last day (580 days later) » 

3:58 AM
@Connor That GoL video is old. Today, you can simply write {+/,⍵}⌺3 3∊¨3+0,¨⊢
 
 
6 hours later…
9:35 AM
@Connor I did a particle simulator a while back (warning, very raw repository) github.com/rikedyp/APLPhys - I do plan to do a clean up and write up at some point
 
 
5 hours later…
2:54 PM
Few minutes late.
be there in 10 minutes I hope
 
Welcome to APL Quest 2016-4! Today's quest is Just Meshing Around:
> Write a function that takes vectors as its left and right arguments and returns them “meshed” into a single vector formed by alternately taking successive elements from each argument.
Don't forget that we'll start 2 hours earlier, beginning in 3 weeks, 14 October.
 
,⌷⍨∘⊂∘⍋,⍥(⍳≢)
 
That's pretty elegant.
 
I started with ⌊⍥≢ but couldn't make it nice
 
Ah, but you need the trailing elements.
Btw, your solution can be written ⊂⍤⍋⍤,⍥(⍳≢)⌷, or even golfed to ⊂⍤⍋⍤,⍥⍳⍥≢⌷,
If you change the , to it'll even work on arrays of any rank.
I wonder if one could construct a mask to remove the fills from {,⍉↑⍺⍵}
 
3:07 PM
Nice. Thank you!
I ended up with (⌊⍥≢)((,⍤⍉⍤↑↑¨),(∊↓¨))(,⍥⊂) in my first attempt
 
{l←(≢⍺)⌈≢⍵ ⋄ a←l↑⍺,l/'⍝' ⋄ w←l↑⍵,l/'⍝' ⋄ '⍝'~⍨,↑[1]a w}
Ugly I know
Couldn't find a nice solution to cope with uneven length
 
Here's one: ∊,⊢∘⊂⌸⍨,⍥(⍳≢)
 
Indeed: M⍥(=⍨)⊢⍤/M←{,⍉↑⍺⍵}
 
Oops, you can remove the ⍨ there.
 
Yeah: ∊,⊢∘⊂⌸,⍥(⍳≢)
Or even ∊,⊢∘⊂⌸,⍥⍳⍥≢
Btw, why ⊢∘⊂ instead of ⊂⍤⊢?
 
3:13 PM
No reason
Just muscle memory
 
Did I mention I like ? ,⍥⊂⍥(=⍨)⊢⍤/⍥,⍥⍉⍥↑,⍥⊂
 
Heh
Golf: ∊,⍥(⍳≢)⊆⌸,
 
Wat.
 
The left argument is always a positive integer
Which just encloses.
 
Ugh.
 
3:16 PM
Yep
 
But that's actually a neat golf trick for when you need a dyadic enclose for a train.
@awagga Only works in ⎕IO←1!
 
Good point
1+⍳≢ will be ⎕IO independent but that's longer :)
 
g'morning. Sorry I'm late. :)
 
Object oriented (i.e. joke) solution: {n←⎕NS⍬ ⋄ n~⍨,⍉↑⍺⍵,¨n⍨¨¨⍵⍺}
Or how about {n←⎕NEW⊂'Timer' ⋄ (,⍉↑n,¨⍺⍵)∩⍵,⍺}
 
at least better than using '⍝' as I did
 
3:22 PM
Yeah, that's not universal.
 
@SteveAllen good evening ;)
 
This one is fun: {(,⍉↑(⊂f),¨⍺⍵)~f←1↑0⍴⊂⍺⍵}
 
@Richard "Greetings and salutations!" :P
 
nice
 
@Adám could you explain the first part?
 
3:26 PM
What is the first part of M⍥(=⍨)⊢⍤/M←{,⍉↑⍺⍵}? M?
 
the part before ⍤/
 
Do M on the all-1 vectors of same length as the arguments
 
My first go was {,⍺(,⍤0)⍵}, but I didn't realize it had to handle mismatched lengths for some reason.
 
Oh, I didn't notice ,⍥⍳⍥≢was one character shorter. ∊,⍥⍳⍥≢⊆⌸, is a cute golf, horrible, confusing, but cute.
 
@Richard The belongs with the ⍤/
 
3:28 PM
yes, there I was thinking wrong
 
⋄ M←{,⍉↑⍺⍵} ⋄ ('Dyalog' M⍥(=⍨) 'APL') ('Dyalog' M 'APL')
 
@Adám
┌───────────────────────┬────────────┐
│1 1 1 1 1 1 1 0 1 0 1 0│DAyPaLl o g │
└───────────────────────┴────────────┘
 
And then we just filter.
 
yes ,thanks!
 
If that's what you need, then you can just write it as the train ,,⍤0
@rabbitgrowth {m←⍺⌊⍥≢⍵ ⋄ ⍺(,⍥(m∘↓),⍨∘,,⍤0⍥(m∘↑))⍵}
Running out of steam?
 
3:36 PM
Still looking at the indexing solution of @rabbitgrowth
 
Ah, with the grade. Yes, that is the "correct" APL solution.
 
Is it working for all cases?
 
Yes.
Think about it like this: You're enumerating the elements of each:
D:1, y:2, a:3, l:4, o:5, g:6
A:1, P:2, L:3
 
Nice different approach.
 
Then we sort by that key: Take all the 1s, then all the 2s, then…
 
3:38 PM
∊,⍥⊂⊆⍨⍥,⍥⍉⍥↑,⍥⊂⍥⍳⍥≢
 
awagga has established the fine art of programming in A⍥P⍥L; every other symbol must be .
 
Indeed
 
LOL What does ⍥ do? vs. ⍤? Is there a mnemonic?
 
@awagga made Adam very happy :)
 
3:42 PM
@SteveAllen gaps over more than . It pre-processes both arguments, while post-processes the result.
 
@SteveAllen This page
https://aplwiki.com/wiki/Function_composition
always is on my screen and explains it very nice
 
has a big "inside", while has a small one:
 
best version: ,⍥⊂⍥⍳⍥≢∊⍤⊆⍥,⍥⍉⍥↑,⍥⊂
 
I imagine Adám frowning when he looks at the ()(()())() in my solution
 
  ⍥       ⍤
  f       f
 / \      |
g   g     g
|   |    / \
⍺   ⍵  ⍺   ⍵
 
3:45 PM
Every ⍥ gives a +point and ( or ) a -point with Adam
 
Notably, is just called plain "compose" in J — it is seen as the basic composition.
 
I have never considered the f⍥g⍥h pattern until now.
 
@Adám 😂
 
@awagga Just an inefficient f⍥(g h)
 
Yeah
 
3:48 PM
@Adám Subtle. I see why the glyphs are related, and mnemonic now makes sense. They are both running f with the results of g, but how they run g in the first place is different. Got it.
@Richard 😂
 
OK, I think we're about done then.
See you next week for 2016-5: You’re Unique, Just Like Everyone Else. Don't forget that we'll start 2 hours earlier, beginning in 3 weeks, 14 October.
 
Last time I bother you with it. But we are very close!
https://week.golf/newLanguage.php
 
Well, keep bothering about it until we succeed.
 
I probably will not be able to join next week. I'll try to just post my solution
 
When I'm handwriting APL I make my s extra large so that I don't confuse them with my s :)
 
3:54 PM
Hand writing APL seems like a challenge. ⌊ or l or | ⌷ ⎕ ⍥ ⍤ O ∘
 
Yeah, me too, and the APL386 font has a larger circle.
 
@Adám Should the APL Wiki logo not also become the new APL logo?
 
@Richard Write your letters in italic: L | O o and should be really narrow, like [] overlaid, with having the golden ratio (height=1.6×width)
@Richard Maybe.
 
I don't mind. Just wondered.
 
But not every site about APL should use the APL logo, as that'd be confusing.
That said, APL Wiki is about as close as we get to "APL's homepage", like haskell.org etc.
Anyway, gotta go.
 
4:03 PM
was [] overlaid, wasn't it?
 

« first day (2067 days earlier)      last day (580 days later) »