« first day (2095 days earlier)      last day (552 days later) » 

12:40 AM
@ArbIn Not sure what you mean by "append these to an outer table", but does respelling your calculation like {⍵,*∘0.5+/⍵*2}3 4 get you closer?
 
@ArbIn do you mean ⎕←0.5*⍨∘.(+⍥(2∘*))⍨⍳5?
 
@LdBeth
2           2.449489743 3.16227766  4.242640687 5.830951895
2.449489743 2.828427125 3.464101615 4.472135955 6
3.16227766  3.464101615 4           4.898979486 6.32455532
4.242640687 4.472135955 4.898979486 5.656854249 6.92820323
5.830951895 6           6.32455532  6.92820323  8
 
first (2*⍨⊣)+(2*⍨⊢) can be shortened to +⍥(2∘*), second ∘.f for the table.
 
@B.Wilson I mean that my goal was to to make tuples/mixed arrays with pyth triples. I tried iota2, but it didn't work out that well :(
 
Was thinking probably something more like: ⎕←{⍵,*∘0.5+/⍵*2}⍤¯1⊢2 2⍴3 4 5 12
 
12:45 AM
@B.Wilson
3  4  5
5 12 13
 
As you can see, that dfn just "appends" the hypotenuse length: ⎕←2 2⍴3 4 5 12
 
@B.Wilson
3  4
5 12
 
ooh... Can you explain what ⍤ is doing in the sentence? I haven't seen that symbol all that much. But yeah, that was what I meant.
 
The ⍤⍥ are different, and a (f⍥g) b means (g a) f (g b)
⎕←1 2 3 ∘.{⍺,⍵} 4 5 6
 
@LdBeth
┌───┬───┬───┐
│1 4│1 5│1 6│
├───┼───┼───┤
│2 4│2 5│2 6│
├───┼───┼───┤
│3 4│3 5│3 6│
└───┴───┴───┘
 
1:04 AM
I only ask since Problem 9 on PE appears to be rather tedious in APL.. I'm still trying to figure it out right now
 
@ArbIn That symbol is called Rank. The docs can do a better job explaining than I can in a short blurb here: help.dyalog.com/18.2/#Language/Primitive%20Operators/Rank.htm
Also, the docs there have a page that indexes the symbols, so you can figure out their meaning if you're completely unfamiliar: help.dyalog.com/18.2/#Language/Introduction/…
 
Thank you. I will refer to that from now on
 
:) Don't get me wrong. People here seem generally friendly and helpful, but the docs are just so darn good!
Speaking of the docs. I have a question about accessibility. Some of my blind acquaintances say that help.dyalog.com is really unfriendly to their screen reading software. The text-only browser they use (edbrowse) pretty much just fails to render the page at all.
Is there a less JS-ified reference? Something akin to dfns.dyalog.com would be wonderful.
 
1:24 AM
@B.Wilson There is chm version of dyalog docsets, if they could convert to format recognized by TTS softwares
 
@LdBeth Hrm. Are you referring to docs.dyalog.com? I see it mentions chm files, but I only see pdfs available.
 
1:43 AM
@B.Wilson oh it seems only available for download together with windows version of dyalog apl.
 
1:58 AM
@LdBeth Ah! That makes sense. Thanks for the sanity check.
 
@xpqz Thanks for that. I actually stumbled on it the first time around. It's seems very well written.
@Richard Thanks for that. I looked at it and it seems very promising. APL, here I come!
 
 
6 hours later…
7:42 AM
BTW, what's the history behind ⎕ML? I have gathered that Dyalog employs a certain conservatism about introducing changes or variants to the language, so Machine Level's presence feels mildly surprising.
 
8:36 AM
@B.Wilson as far as I understand, the Dyalog default (⎕ML←1) was designed first, and APL2 (⎕ML≥2) came later; so ⎕ML was added to be optionally compatible with APL2 - it was too late to change the current behaviors, but being completely APL2-incompatible isn't much of an option either
 
9:23 AM
@JeffZeitlin I think it is a vendor-specific extension, as Dyalog doesn't use . Instead, we have ⎕LOCK which gives a much more nuanced control over tradfn behaviour.
@B.Wilson Yes, exactly that. An example would be splitting on spaces with monadic (≠⊆⊢) and identifying control characters with monadic and non-negative numbers with <
@B.Wilson It currently uses frames, which I bet is the issue. Try opening the content frame without side navigation. Here's an example.
Also, we're in the process of overhauling the frontend, so things may get better soon.
@B.Wilson There was an extensions proposal called NARS, which Dyalog and STSC rushed to implement, but then, last moment, IBM decided to make a few changes for APL2. Since IBM at the time was the APL market leader, the other vendors felt compelled to follow, but also couldn't invalidate already written code.
 
 
1 hour later…
10:42 AM
@Adám - If it is vendor-specific, IBM was the vendor that first implemented it, lots and lots of years ago - it was specifically mentioned in the docs for the APL implementation that I used at RPI in the early '80s - and RPI was using an old IBM implementation of APL even then (I think it was actually either APL\360 or APL\370).
 
 
2 hours later…
1:00 PM
Welcome to APL Quest 2016-8! Today's quest is Separating Out the Negative:
> Write a function that takes a numeric vector and returns a two element vector whose first element contains the values less than 0 (zero) in the vector and the second element contains all values greater than or equal to 0.
 
{(⊂⍵/⍨0≤⍵),⊂⍵/⍨0>⍵}
the obvious one I asume
 
That's good, but you're really doing unnecessary comparison here.
Also, don't you have the two parts swapped?
 
yes I do
 
You can use stranding instead of concatenating enclosures.
 
you suggest using x?
 
1:02 PM
You mean a variable? Yes.
 
{⌽(0≤⍵)⊢∘⊂⌸⍵} Something similar to this
 
With all my fanciful extensions in "Extended Dyalog APL" and "Dyalog APL Vision" together (but too late now): >⍛/⍮≤⍛/
@awagga That depends on order of appearance.
 
Ah, good point
 
I was thinking about using an array/vector of functions and apply that to ⍵. But perhaps to complicated and not possible at all
 
(0∘>⊂⍤/⊢),0∘≤⊂⍤/⊢ isn't terrible.
@Richard I don't see how that'd be much better than a train with ,⍥⊂ as middle tine.
 
1:07 PM
You're right, was just thinking if something like that is possible at all
 
Doesn't work either, but a code golf idea: {⍵(~,⍥⊂⊢)∪⍵/⍵}
 
@Richard With the new array notation, we get easier access to function arrays, and ((f:{⍵/⍨0>⍵})(f:{⍵/⍨0≤⍵})).f⊂ should work.
But of course, that's no better than ({⍵/⍨0>⍵},⍥⊂{⍵/⍨0≤⍵})
Hopefully (0∘>⍛/,⍥⊂0∘≤⍛/) in 19.0.
 
⊂⊢⍤/¨⍨<∘0,⍥⊂≥∘0
 
(>,⍥⊂≤)⊢⍤/¨⊂⍤⊢ used dyadically with 0 as left arg.
@dzaima Nice and clean.
 
Sorry, no much to add for this problem.
 
1:20 PM
It seems like there's only one sensible solution here, due to the argument being unordered.
 
Time for some silly solutions?
 
:)
 
{(⍵∘~,⍥⊂⊢)⍵[⍸0≤⍵]}
 
@awagga Yes, I can understand this one. Nice
 
{r←⍬ ⍬ ⋄ r⊣{((⊃⌽⍣(0≤⍵))r),←⍵}¨⍵}
 
1:25 PM
@Adám (<,⍥⊂≥)∘0⊢⍤/¨⊂
 
Let's get rid of the comparison too: {r←⍬ ⍬ ⋄ r⊣{((⊃⌽⍣(0⌈×⍵))r),←⍵}¨⍵}
@dzaima That's actually quite nice.
 
{⍵(⊢,⍥⊂~)⍵~⍵/⍵}
 
Wat?
(<,⍥⊂≥)∘0⍛(/⍥1) should work.
 
⍵/⍵ - positive numbers replicated by themselves, negatives become 0. Rest should be clear
 
Ah, clever!
"ASCII" solution: {(⍵~⍵/⍵)(⍵~⍵~⍵/⍵)}
 
1:29 PM
Nice :)
 
See you next week for 2016-9: Delimited Text!
 
Thanks!
 
sadly {1↓(⍵~⊢)\3⍴⊂⍵/⍵} isn't shorter
and BQN: ¬⊸⋈∘≥⟜0/¨<
 

« first day (2095 days earlier)      last day (552 days later) »