« first day (2221 days earlier)      last day (423 days later) » 

2:24 AM
Happy Friday, APL!
So, I didn't make much concrete progress on getting Dyalog running in Plan 9.
Focused mainly on the CI for now, so the RIDE efforts might be orthogonal.
Two issues: 1. I'm mostly a Plan 9 noob, and 2. linuxemu isn't compiling on my amd64 9front install.
That said, I did stumble across /lib/keyboard which basically configures a system-wide compose key-like mechanism, so getting the squiggles should be easy enough.
 
 
4 hours later…
6:29 AM
sorry, ignore me, my brain sometimes just forgets that APL operators can be dyadic ⍨
 
7:02 AM
@B.Wilson Don't forget to add a Plan 9 section to apl.wiki/Typing_glyphs when you have it all working :-)
 
 
2 hours later…
8:42 AM
@B.Wilson If you just want something to play with, you can always try git.sr.ht/~pmikkelsen/APL9 It is pretty limited in may ways, but I always considered it a proof of concept thing. There is a script that can extend you keyboard map with apl glyphs included in the repository :)
Trying to run linux software on plan9 is missing the point a bit in my opinion, as you don't really get anything out of the operating system in that case. It would be better to just run it on linux and interface with it from plan9 if you want to.
 
 
3 hours later…
12:04 PM
Is there a way to do a TAO comparison without grading?
 
there's also ⍺⍸⍵ but that & grade are the only things that use TAO iirc
 
1:00 PM
Welcome to APL Quest 2018-6! Today's quest is What’s Your Angle?:
> Write an APL expression that, given a character scalar or vector representing some XML, returns 1 if the angle brackets are properly balanced and 0 if not; all left angle brackets < must be “closed” with right angle brackets > before another occurrence of a left angle bracket.
 
Did not spend much time on it so expect something better :)
{{(∧/0≤+\⍵)∧0=+/⍵}-⌿'<>'∘.=⍵}
 
That looks very traditional.
 
yes perhaps. We used this already once before more or less
at least the first part
 
You could halve the amount of summing by noticing that +/ is the last element of +\.
 
ah yes :)
 
1:06 PM
Huh, is the reference solution on the site really correct?
> Passed all basic tests – for extra points, consider cases like ('<name<>first>') as right argument which should give (1)
Looks invalid to me.
@Richard Your solution says it is valid!
 
ow...
can be fixed by also checking wether the sum is never larger then 1
but that makes it even more ugly
 
I have ((⊢≡≢⍴1 0⍨)⊢⍷∩)∘'<>'
@Richard So you agree that it is wrong, right?
 
yes I do
It probably needed another testcase
 
The reference solution is {0(∧.≤∧=∘⊃∘⌽)+\-⌿'<>'∘.=⍵} which is effectively yours with my optimisation.
 
What does ∧.≤∧ do? Inner product for testing both conditions?
 
1:15 PM
(∧.≤∧=∘⊃∘⌽) is the same as ((∧/≤)∧=∘⊃∘⌽)
 
Also still looking at your solution. I don't think I understand it
 
The intersection of the argument and '<>' removes all other characters.
 
yes
 
If valid, the remaining characters must be <><><><> etc.
So we look for <> and check that it is found to begin at every other position, starting with the first.
Neater? ((⊢≡≠\⍤=⍨)⊢⍷∩)∘'<>'
 
and (1 0 ⍨) is the constant operator again?
 
1:22 PM
Yes, indeed.
OK, I've updated the site.
 
yes, now my soluition isn't accepted anymore
 
Do you want to fix your solution?
@Richard It should be possible to check that the sum is always between 0 and 1.
 
yes, but therefore another comparison is needed. Or another logic trick
or a small train
 
Using interval index: {((0=⊃∘⌽)∧1∧.=0 2∘⍸)+\-⌿'<>'∘.=⍵}
 
{{(∧/(<∘2∧≥∘0)+\⍵)∧0=+/⍵}-⌿'<>'∘.=⍵}
 
1:32 PM
Elegant, if hard to follow: {0 2(=⍥⊃∘⌽∧1∧.=⍸)+\-⌿'<>'∘.=⍵}
Shall we call it a day, then?
We didn't do an "industrial" regex solution!
 
Still breaking my brains on your last one. I'll take that with me. Thanks for this week
 
Sure, see you next week for 2018-7: Unconditionally Shifty.
 
 
3 hours later…
4:57 PM
      (a b)c d e(f g)←1 2 3 4 5
      a b c d e f g
┌→────────────┐
│1 1 2 3 4 5 5│
└~────────────┘
Thanks, APL.
Even if I understand it, I don't have to like it.
 
What's the problem with it?
 
5:13 PM
I think my gut reaction was that it ought to error. It took me a while to see that the two parenthesised expressions will be filled with extension if there aren't enough values.
Too many, and you get the LENGTH ERROR I'd expect:
      (a b)c d e(f g)←1 2 3 4 5 6 7 8
LENGTH ERROR
      a b←1
      a b
┌→──┐
│1 1│
└~──┘
is obviously fine.
Scalar extension ftw.
 
5:59 PM
try (a a)c d e(a g)←1 2 3 4 5
I'm a little disappointed it isn't assigned from right to left :D
 
6:20 PM
@Adám sorry, I'm a complete beginner, so this is probably obvious, but this should print [0, 1, 2, 3, 4, 5], right?
Or am I missing something?
 
you want ⎕←f 5
(or put f 5 in the "Input" field)
 
 
3 hours later…
9:12 PM
@dzaima oh, thanks
 

« first day (2221 days earlier)      last day (423 days later) »