« first day (1189 days earlier)      last day (1466 days later) » 

12:21 AM
@Adám Probably a late answer. 3 1 4 {⍺[⍸~×⍵|⍺]} 2 2 2
 
12:36 AM
@Adám It's actually a working program... ○/ 1 2 3
 
@petStorm I think you mixed up left and right arguments (the function itself looks OK).
 
@Bubbler If I swap them it produces the wrong result.
 
So the code will look like 2 2 2 {⍵[⍸~×⍺|⍵]} 3 1 4
 
3 1 4 {⍺[⍸~×⍺|⍵]} 2 2 2 -> 1?
 
"returns numbers from the right argument that are evenly divisible by the left argument"
 
12:40 AM
Ohh...
 
And then, can be 0= and x[⍸y] can be y/x.
 
I know the second alternative, but the current focus of the lesson was on .
Four dialects of APL: A, J, Q, K. It feels like a joke...
 
@petStorm I felt exactly the same when I read it.
(Probably we need 2 through 10 too, except that 4 and 7 are already taken)
2
 
 
2 hours later…
2:48 AM
I would love to see a elegant array based solution this problem -- cough, @Bubbler. It seems almost impossible to avoid doing disguised procedural programming using $: or ^: or a reduction / -- all solutions end up requiring local mutating vars. The phrase +/\\. results an intriguing matrix with a simpler solution algorithm on it, but it still ends up being too cumbersome. Hoping I've missed somthing...
 
 
2 hours later…
4:34 AM
@Jonah How about this:
I don't think we can avoid ^: entirely for this problem, but fixpoint appears quite frequently in array-oriented solutions so I guess ^:_ and ^:a: are fine.
 
5:26 AM
@Bubbler Thanks! i'll have a closer look tomorrow. Time for bed now.
 
5:50 AM
@Adám @Adám @Adám Anyone here?
 
6:22 AM
@HighlyRadioactive Yes?
@petStorm I know, that's why I use it.
 
6:39 AM
@Adám So what exactly does this snippet do?
 
@petStorm Your application of it computes sin(cos(3 rad))
 
I see.
 
@petStorm More interesting is R←○/ ¯2 1 Y which computes the angle R that has a cosine that matches the sine of Y. I.e. it "mirrors" the angle.
 
7:03 AM
@Adám Damn.
I'm here now.
 
@HighlyRadioactive Sorry, I was up, but not at the computer.
 
Any new tasks?
 
@HighlyRadioactive Sure. You asked yesterday about removing elements from a list. APL has a built-in function for that, but let's see you implement it with arithmetic! 3 1 4 1 5 Without 1 should give 3 4 5
 
Uh huh. I think I got it.
 
7:25 AM
@Adám Without←{⍺[⍸⍺≠⍵]}
 
@HighlyRadioactive Very nice. No write Reverse 3 1 4 1 55 1 4 1 3 and Reverse 'abcde''edcba' without using the obvious built-ins.
 
@Adám Reverse←{⍵[(1+≢⍵)-⍳≢⍵]}
Looks excessively long, I must have done something completely unnecessary
Reverse 1 9 8 4
4 8 9 1

Reverse 'HighlyRadioactive'
evitcaoidaRylhgiH
 
@HighlyRadioactive No, that's good.
@HighlyRadioactive Btw, to post a code block message, insert 4 spaces before each line, or simply press Ctrl+K.
@HighlyRadioactive Want more?
 
@Adám Of course
 
OK. Don't worry about why the exact syntax is as it is, but X ∘.f Y creates applies f to all combinations of arguments from X and Y:
      1 2 3∘.+1 2 3 4
2 3 4 5
3 4 5 6
4 5 6 7
This works for any function, including , (concatenation):
      'chicken' 'pork' 'vegetable' ∘., ' chow mein' ' with cashew nuts'
┌───────────────────┬──────────────────────────┐
│chicken chow mein  │chicken with cashew nuts  │
├───────────────────┼──────────────────────────┤
│pork chow mein     │pork with cashew nuts     │
├───────────────────┼──────────────────────────┤
│vegetable chow mein│vegetable with cashew nuts│
└───────────────────┴──────────────────────────┘
 
7:39 AM
Wow.
 
Task: Write a function CountIn such that it, for each element of its argument, counts how many such elements are in the argument. E.g. CountIn 3 1 4 1 5 9 should give 1 2 1 2 1 1. (because there are 2 1s, and 1 of each of the others).
 
Do we need to use ∘.?
 
Yes.
 
Also not a lot of languages have CA built in, I'm happy to see it here.
 
CA?
 
7:42 AM
The only other language with CA built in I have ever seen is Mathematica.
@Adám You said this yourself
> (Also, APL has a CA built-in: ⌺)
 
@HighlyRadioactive Oh, yes. I thought you were referring to something I mentioned now.
 
Hahahaha.
I'm commonly known to be interested in miscellanous range-1 CA rules, but that's off-topic.
 
Try solving the CountIn problem, and when done, write a PrimesTo function. (I have to be away from the computer for about half an hour.)
 
Yep.
What is PrimesTo?
 
I guess "given a positive integer n, an array of all primes up to and including n"
 
7:49 AM
Alright
 
8:19 AM
@HighlyRadioactive OK, I'm back. How goes it?
 
@Adám Oops I spent a lot time on Cellular Automaton, but I'm doing the CountIn now.
@Adám Also see above: what is PrimesTo?
 
@HighlyRadioactive As Bubbler explained. PrimesTo 20 gives 2 3 5 7 11 13 17 19
 
@Adám Alright.
 
RGS
9:01 AM
@Adám (+⌿∘.=⍨) is reasonable, right?
 
9:21 AM
@RGS Yes.
 
@Adám - If that comment about "don't worry about why the syntax is..." is a reference to APL's history, I'd be interested in hearing it...
I never really considered the outer and inner product syntax to be obvious or intuitive.
 
@Adám {⍺/⍨⍺≠⍵}
@Adám {⍵[⍒⍳≢⍵]}
 
@JeffZeitlin I think inner product is pretty obvious.
@petStorm Yup, both are good, though not using the techniques I taught HighlyRadioactive.
 
9:36 AM
Inner is fine, outer is an oddball for language implementors...
 
@JeffZeitlin There's a bit of info on APL Wiki.
 
@Adám Huh, what an ambiguous symbol.
 
@Adám {⍵[1+(⌈/X)-X←⍳≢⍵]}
 
@JeffZeitlin Originally, Ken saw the outer product as a special downgrade case of the inner product, as inner product can produced by a selection from the outer product. So it was like f.g with no f. So they used a "nil function" to indicate this.
 
(What's the magic that HighlyRadioactive is doing?)
 
9:40 AM
@petStorm Perfect.
@petStorm What magic?
@Bubbler It isn't really that's the product (be it an operator or a constant), but rather . that's problematic.
 
@Adám - OK, so using ∘ does actually make sense in context.
But how did f.g become inner product?
 
@JeffZeitlin Ken later got the idea that ∘.f could be seen as tying 0 or more axes of the operands. Think of the result shape, which is (⍴X),(⍴Y), while f.g has (¯1↓⍴X),(1↓⍴Y). He then generalised it so the left operand of . could be a number of axes to tie, with being an alternative spelling for 0. See his Dictionary of APL.
@JeffZeitlin That one is obvious. +.× is called the "dot product" u∙v, so . was the closest available character (and adding a centered dot would probably be too hard to disambiguate) and became the generalised dot product operator.
 
(Finally got the same solution... {⍵[1+(≢⍵)-⍳≢⍵]})
@Adám You finally taught outer product. It made my life easier. {+/⍵∘.=⍵} 3 1 4 1 5 9
 
@Adám - Ah, OK. Would it be correct to say that for any vectors u and v such that (⍴u)=(⍴v), for functions f and g, u f.g v is f/ u g v?
 
@JeffZeitlin Yes.
 
9:51 AM
@Adám - OK, just wanted to make sure I understand what's happening there.
 
@JeffZeitlin And in general, f.g is (f/g)⍤1∞ or f/⍤g⍤1∞
 
@Adám - What's that infinty sign?
 
@JeffZeitlin Infinity.
 
@Adám "NONCE ERROR"
@Adám jk - not (yet) implemented
 
Mar 31 at 22:10, by Adám
@RGS 99≈∞ for sufficiently small values of ∞ ;-)
 
10:03 AM
Anyone suggest a good way to 'unzip' a vector into a matrix where row 1 is items on odd indexes, and row 2 is items on evens? So Unzip 'dyalog' gives ↑('dao')('ylg')?
 
@xpqz Reshape to 2-column matrix, then take the columns.
 
Can this be treated as an exercise?
 
Why not?
 
@xpqz - How do you want to handle the case where ⍴v is odd?
 
{⍉(2÷⍨≢⍵)2⍴⍵}'dyalog'
Doesn't work when ⍴v is odd.
 
10:07 AM
@petStorm That might be a feature for sanity.
 
If you want odds to work, just take the ceiling. {⍉(⌈2÷⍨≢⍵)2⍴⍵}
 
@petStorm Or the floor, or pad with the fill, or create a ragged result…
 
3 {⍉(⌈⍺÷⍨≢⍵)⍺⍴⍵}'dyalo'
 
@JeffZeitlin Ragged, I think
 
I don't really know how to do a ragged output...
 
10:09 AM
"dyaloge" -> 'daoe' 'ylg'
 
{⍵⊢∘⊂⌸⍨2|⍳≢⍵} is one solution.
{/∘⍵¨1 0=⊂2|⍳≢⍵} is an alternative.
 
Nice
 
@petStorm Tacit version: ⍉⊢⍴⍨2,⍨2÷⍨≢ and ⍉⊢⍴⍨⊣,⍨÷⍨∘≢ a general version that takes number of columns as left argument.
 
@petStorm You need a nested array for that in general. Otherwise, you get zero (or blank) padding in the shorter rows.
 
@xpqz |∘⍳∘≢⊢∘⊂⌸⊢ is a tacit generalised version that takes the number of pieces to split into as left argument (defaults to the length of the argument) with greedy ragged result.
 
10:21 AM
I will need some time to dissect that...
 
@xpqz (Simplified it a tiny bit.) Let me know if you need help.
 
Sorry I know I've asked this before, but what was the RIDE setting to display trains as trees?
 
@xpqz Nothing to do with RIDE per se. ]box on -trains=tree
If boxing is already on, you can do ]box -t=tree (as modifiers can be shortened as long as they are unambiguous).
 
Thank you. These kinds of settings, can they be written to config in some way such that my seesions default to them?
 
@xpqz If you save your session, they'll stay.
 
10:28 AM
They stack as well; nice: ]box on -style=max -trains=tree
That's an invaluable help from the interpreter, I've found.
 
@xpqz You may (or may not) want to also add -fns=on so ⎕← uses the settings.
@xpqz Yeah, about that, let me get back to fixing a bug in ]box
 
Maybe your Unzip←|∘⍳∘≢⊢∘⊂⌸⊢ deserves a place on APLCart. Very handy.
 
It feels that unzip with two operands is more general...
 
How do you mean? That does take two operands.
 
arguments
 
10:57 AM
@xpqz Like, unzip into 3 or 4 parts.
 
@petStorm That's what |∘⍳∘≢⊢∘⊂⌸⊢ does with a left argument of 3 or 4.
 
Ahh, nice.
Is every snippet in APLcart added as a built-in function of Dyalog APL Extended?
 
@petStorm No no, not at all.
 
Why not?
 
11:13 AM
@petStorm It'd be impossible to find (your way in) over 2000 glyphs for them all.
 
@Adám Mathematica has over 6000 built-in functions. And yet, the programmers are still capable of programming Mathematica. It's only a fraction of the Mathematica built-in set.
 
@petStorm Sure, but Mathematica has LongwindedNamesForAllItsBuiltIns and very few symbols. Are you suggesting naming all the entries (as done with for dfns.dws) or giving them glyphs?
 
@Adám NamingAllTheEntries, because it would benefit the programmer as they won't need to write the snippets themselves.
Giving them glyphs... well, you could randomly pick irrelevant characters from Unicode.
 
@petStorm It'd be hard to find good names, especially for multiple related functions, especially if you want to keep the name as short as the code it stands for.
 
@Adám So, glyphs then? It probably should not manually involve picking glyphs, since there are over 2000 of them.
 
11:22 AM
@petStorm remembering a few built-ins is easier than the precise name of a built-in, and is way more descriptive for the actual purpose. Typing 2000 different glyphs would be just impossible and pointless (dzaima/APL is almost pushing the limits of my keyboard key count already). And nevertheless, Dyalog APL Extended isn't just a dumping ground of "features"
 
@dzaima It's possible to type 2000 different glyphs: just copy them one by one from an instruction reference table.
Isn't Dyalog APL Extended an extension of Dyalog APL? It dumps more features into Dyalog APL.
 
@petStorm it's still pointless though, if you're copying a character you could just copy the function, and as a side-effect understand what it does and be able to modify it
@petStorm it doesn't "dump", it chooses good, useful extensions that actually benefit the language
 
Every single snippet in APLcart is always useful, otherwise it would be pointless to add a snippet there.
 
@petStorm the snippets are useful, naming each/assigning a glyph/being built in the language is not.
 
@dzaima It makes your code shorter, and it provides a template for you that eases you from programming that yourself.
 
11:29 AM
@petStorm again, if you have to look up a table with the name/glyph, you could just copy the implementation......
 
@dzaima If you use the glyph in your program though, it makes your program shorter......
 
but by all means, go ahead and fork Dyalog APL Extended, add 2000 built-ins to it and try using the thing, i don't particularly care
2
@petStorm if you want a golfing language, ↑
 
@petStorm Just as examples, can you find good short names for ≠⊆⊢ and =⊂⊢ and ⍷⊂⊢?
 
@Adám Just as examples, 𐊛 and 𐊙 and 𐊜.
Pretend that the glyphs are picked totally at random.
 
@petStorm But those names don't say what they do. If you just want an APL-like golfing language, have a look at Jelly.
 
11:48 AM
@Adám Jelly ran out of meaningful glyphs, so it started to use non-meaningful ones.
 
@petStorm Jelly has an order of magnitude fewer built-ins than there are entries in APLcart. Anyway, how'd you encode all the extra glyphs? Two bytes each? Then you might as well just use 2-char names like Jelly.
 
@Adám 128×128 = 16384. There are plenty of 2-byte instructions available.
By the time we have to use double-glyphs for every instruction, the language will already have 65536 instructions.
 
@petStorm Sure, but why would a two-byte encoding be any better than some of the built-ins being 2 chars?
 
@Adám It wouldn't be any better, SBCS then.
 
@petStorm So there's your answer: Jelly. Is is usually better for golfing anyway.
 
11:56 AM
@Adám Jelly is a specialized golfing language which doesn't implement some of the features implemented in practical languages.
 
@petStorm Right, so?
 
@Adám It's so, right?
 
@petStorm Why munge Extended Dyalog APL (which was only intended as a playground for trying out potential extensions to the real Dyalog APL) into a golfing language which anyway wouldn't be very competitive with Jelly? Golfing languages don't need those features, and anyway, I think Jelly can call Python for such things.
 
@Adám I'm just curious about why practical languages added these features.
 
@petStorm Uh, obviously because they are needed IRL.
 
12:02 PM
@Adám Uh, code golfing is real life. That's why sometimes golfing languages need to perform calls to practical languages.
 
12:15 PM
Apparently I missed another class.
 
@HighlyRadioactive Uh, no. There are just other discussions going on too.
 
Oh, okay then.
 
@HighlyRadioactive Did you solve CountIn?
 
@Adám Nope, I made a mess.
 
@HighlyRadioactive OK, let's take it step by step. You understood how ∘.f works?
 
12:21 PM
Yes.
 
So which function f do you think would be appropriate here?
 
The counting function for each character.
 
No no, don't go there. Rather, just compare all characters to each other.
 
Uh?
Oooh, APL is too hard. I'll just go back to my CA world. ...nvm.
 
For each character, you want to know which of all the characters it is equal to, right?
 
12:24 PM
Uh, right.
 
So, that's an "all-combinations" type problem. That calls for ∘.f
Which function should f be?
 
Equality test?
 
Right, and that's…?
 
{α=ω}
To lazy to type the APL characters.
 
@HighlyRadioactive Right, but you don't need to enclose it in its own dfn (lambda) as ∘.= will do.
 
12:27 PM
Oh well.
 
OK, so now we have {⍵∘.=⍵} as in:
      {⍵∘.=⍵}'Hello'
1 0 0 0 0
0 1 0 0 0
0 0 1 1 0
0 0 1 1 0
0 0 0 0 1
What would the next step be?
 
+⌿!
(I was using my name as the example string all the time LOL)
 
Random observation: dyadic ⎕VFI alleviates the need for regexes in many cases.
 
@xpqz If you have additions to APLcart's existing ⎕VFI entries, let me know.
 
Random question: what is "shy result"?
Have something to do with Fluttershy?
I might be inactive.
 
12:32 PM
@xpqz Added.
 
@Adám You've got my case covered already I see...
 
@HighlyRadioactive A result which isn't displayed unless forced to do so, e.g. by ⎕←. Examples are assignments, & thread spawning, and some system functions (like ⎕MKDIR) for which you're unlikely to want the result.
 
@Adám Awesome.
 
@Adám Oh, okay.
 
@HighlyRadioactive Put it all together — for the satisfaction!
 
12:37 PM
(What is & thread spawning...)
You don't have to answer above.
CountIn←{+⌿⍵∘.=⍵}?
 
@HighlyRadioactive You know about how you can use & on a command line to launch a process in a new thread. Dyalog APL has this as a monadic operator so you can launch a function in a new thread.
@HighlyRadioactive Yup. +1
 
@Adám I accidentally forgot to delete the quote.
@Adám Oh wow. You can really do everything C++ or Python can do with APL.
 
Now it is time for you to write PrimesTo. Again, use the property of primes that they have exactly 2 divisors.
 
@HighlyRadioactive It is a real programming language — just more fun than the common ones. (Btw, & launches green threads) but there's a way to launch OS threads too.)
 
12:41 PM
Do you have a built in to delete all reptitions in an array?
 
@HighlyRadioactive Yes, but you don't need that here.
 
@Adám I'm not saying that it's not a real programming language - just some real programming languages are limited too. E. g. Python can do much less than C.
 
@HighlyRadioactive Why? Can you explain which steps you're intending to implement?
 
Nevermind.
 
@HighlyRadioactive ∪ array
 
12:44 PM
A ridiculously complicated process.
 
How about:
∘ Generate all the numbers
∘ Find out which numbers divide which evenly
∘ Count how many they are for each number
∘ Find which ones have exactly 2 divisors
∘ Use that to select from the original numbers
 
1:08 PM
PrimesTo←{⍸2=+⌿0=∘.|⍨⍳⍵}
People say that obfuscated perl looks like line noise... APL doesn't have to be obfuscated to look like line noise ... :)
 
@JeffZeitlin Agreed.
I'll leave now, gotta sleep. (Turns out I could spend all day on this APL lesson.)
 
ngn
readability is in the eye of the beholder
4
 
@Adám - Just out of curiosity... How many of modern APL's primitives could actually be implemented as functions in APL\360? I see immediately that ≢⍵ seems to be 1↑⍴⍵, and ⍸⍵ seems to be ⍵/⍳⍴⍵, but what others are there?
(And if I'm not mistaken, that's more-or-less what you're doing to get Dyalog Extended APL from the standard version)
 
1:36 PM
@JeffZeitlin Any (partial) primitive that doesn't require nested or heterogeneous arrays. ≢⍵ would be (⍳0)⍴(⍴⍵),1 and ⍸⍵ is currently (~~⍵)/⍳⍴⍵ for vector, but the high-rank case gives a nested result. Of course, it would have been defined as ↑⍸ instead.
@JeffZeitlin All the complex numbers would be (and were) defined as arrays with a leading or trailing axis of length 2. and and ⌷⍵ are trivial (and useless in \360). Dyadic (and similarly ) would check for rank, shape, and ravel. ⊃⍵ is (⍳0)⍴⍵ and ⍺⊃⍵ and ⍺⌷⍵ can be defined in terms of square bracket indexing as there were no nested arrays. ↑⍵ and ↓⍵ are useless. wouldn't be hard either, using or . The set functions were common idioms. That's all functions.
@JeffZeitlin Operators are primitives too, and APL\360 did not let you create your own, but you could do hacky stuff with , and then and and would be possible, though hard. The only really impossible primitive would be &, I think.
 
2:13 PM
Is there an MD5 built-in somewhere in Dyalog?
 
@xpqz No but if you just need a simple hash, there are a couple of options.
 
github.com/Dyalog/DCL has a bunch of stuff, right?
 
I'll live with
md5←{⎕CMD 'md5 -q -s "',⍵,'"'}
for now
 
@xpqz Hm, if it wasn't UX only, I'd 'cart it. Btw, maybe use ⎕SH for clarity that this is UX-only (and for golfiness).
 
Ah, SH is unixen only, and CMD should work everywhere?
md5←{⎕SH 'md5 -q -s "',⍵,'"'}
 
2:25 PM
@xpqz No, they are completely synonymous.
 
oh ok
 
@Adám also, it'd probably break on input with quotes
 
@xpqz Will it work on very long s?
@dzaima Yeah, but those are easy to escape.
 
@HighlyRadioactive Adám is using digits from pi as the example list all the time. LOL
 
It's subject to the lengths of input the shell will take
 
2:27 PM
@petStorm No, I use 1 6 1 8 … and 2 7 1 8 … and 3 1 4 1 …
 
Uhh, any tasks here? I'm bored.
 
CMC: Golden ratio. (No APLcart cheating!)
 
For long long inputs, you probably want to apply it to a file.
@petStorm Start here: adventofcode.com/2015
 
@Adám Approximate with a limit?
 
@petStorm Sure, or direct formula. Whatever you can get shorter.
 
2:31 PM
(Generate fib numbers, divide second-to-last by first-to-last)
 
@petStorm Up for some crosswords?
@petStorm I don't understand how that conflicts.
 
{i←0 1⋄i←i,+/¯2↑i⋄i}5
@Adám How do I repeat the second statement operand times?
 
@petStorm {i←0 1⋄{⍵,+/¯2↑⍵}⍣⍵⊢i}5
 
And, solved... {i←0 1⋄÷/¯2↑{⍵,+/¯2↑⍵}⍣⍵⊢i}5
 
2:47 PM
@petStorm OK, but 1) "5" doesn't give a good result, 2) it can that be significantly golfed, 3) there are much shorter approaches. This is
 
Can I use APLcart this time?
 
@petStorm No, of course not, or it would be no challenge.
 
@Adám Or, just use the formula. :) {2÷⍨¯1+5*.5}
For the complemential value just reciprocal it. {÷2÷⍨¯1+5*.5}
 
@petStorm Correct.
@petStorm You didn't think there. Try again.
 
@Adám What do you mean?
 
2:56 PM
@petStorm There's an obvious simplification in the reciprocal case.
 
3:52 PM
How can I convert a number to a character string of the same number, e.g. like in say c: printf("hello-%d", 57);?
 
@xpqz What did you search for on APLcart?
 
convert number to string
 
@xpqz OK, I'll make sure that works. Meanwhile:
 
What could I have searched for?
 
4:01 PM
And the APL Cart it has a light theme! My eyes thank you.
 
@xpqz You're welcome. You know how to bookmark it with the light theme active?
 
Nope? I only just discovered it.
 
Bookmarks updated; many thanks.
Many of the Dyalog Comp problems have solutions readily available in the 'cart. I've had to ration my use.
 
@xpqz Shh! True. We've decided not to worry too much about it.
 
RGS
4:40 PM
@Adám ⍨
Also, would you consider adding normalization functions to APL Cart? In the sense of normalizing arrays with their norms
e.g. (⊢÷+/) normalizes a vector so that their components sum to one
 
@RGS For sure. Fits well with the existing ⊢-⌊/
 
I think with the shell-out to system MD5, the AdventCoin mining from 2015 is intractable (adventofcode.com/2015/day/4) -- looking back at the solution I needed more than 9M MD5 invocations. With each of those starting a subshell...
 
RGS
@Adám yup, that was the only normalization function I could find
 
@xpqz Yeah, then the DCL should work.
 
RGS
it might be interesting to also include normalization w.r.t. euclidean norm
i.e. sqrt of sum of squares equal to one
 
4:43 PM
@RGS Can you log an issue for them all?
 
RGS
Yes
I'll try to come up with decent trains for those
and I'll leave the others to you
:)
 
RGS
5:26 PM
you've been using APL too much when you use ⍨ in your proof drafts when a given path seems like a dead-end
 
 
RGS
You have to admit it... APL has some really interesting emojis
⍥ is another excellent one!
 
Selfie is definitely my favourite.
 
Mine too.
 
RGS
I think an APL emoji survey is due
 
5:31 PM
Your face when you try to apply every possible trigonometric function to every possible value: ∘.○
 
RGS
@Adám damn
 
@Adám Is the DCL something that needs additional software installation, or some command to tell the interpreter? Happy to be pointed at RTFM.
 
@xpqz Download the repo, then load the workspace (or copy it in and run LX).
@xpqz I've added an issue for some instructions.
 
Does it work on a Mac?
 
@xpqz Something is telling me it doesn't as-is, but that the necessary change is obvious.
 
5:50 PM
Wow, my first PR deep in the crypto-lib?
Might have to be tomorrow!
 
@xpqz I've added an issue for mac support.
@xpqz You may want to look around at other uses of "platform" and of course test it all before PRing.
21
Q: Take that frown and turn it around

AdámA celebration of the many faces of APL Given a string among those in column 1 or column 2 of the below table, return the string's neighbor to its right. In other words, if given a string in column 1 then return column 2's string on that row, and if given a string in column 2 then return column 3...

 
RGS
@Adám nice :D
 
6:48 PM
my golden ration solution (did not look at aplcart)
1 {⍺+÷⍵}⍣≡ 1
 
ngn
7:03 PM
can anybody repro this? in ride enable prefs>general>"show tips for glyphs", then hover a glyph - no tooltip
 
@ngn it seems offset by 1 character
er, seems it's more 0.5 characters. hovering over the left half highlights the char on the left
 
ngn
@dzaima oh.. right. thanks.
 
 
1 hour later…
8:23 PM
xposting a math question here. Looking for help figuring out a linear algebra algorithm step. I'm converting some of the algorithms in the book "Matrix Computations" by Golub & Van Loan to APL. Feels like I'm running into a brick wall finding communities that are familiar with some of the details (without spamming the LAPACK mailing list). If you're familiar w/ the book or know a community that might be, let me know, otherwise please feel free to ignore.

https://math.stackexchange.com/questions/3648588/implementing-qr-algorithm-from-golub-van-loans-matrix-computations-notati
3
 
ngn
8:36 PM
@cannadayr are you interested in apl impls of qr decomposition or just an answer to that particular question?
 
specifically that question. the qr decompisition is different from the qr algorithm. however apl implementations of the qr decomposition (or other linear algebra subroutines might be helpful)
theres a few posts on comp.lang.apl from years ago that reference apl based linear algebra libraries that arent easy to find.
*sry on phone rn
 
ngn
@cannadayr i wanted to show you this: gitlab.com/n9n/apl/-/blob/master/apl.js#L26-32 - generously contributed by roger hui himself and then mercilessly golfed by yours truly without the slightest idea of how it works
 
that is exceptionally golfed.
i dont think its quite the same. the qr algorithm only does qr decomposition implicitly (i believe). this particular step is (i think) looking for cases when the matrix deflates into submatrices.
 
RGS
@Adám I'm addressing your bullet points now. is there anything you'd like to add?
 
(continuing to guess) like when the matrix rank is less than the size and you get zeros in the diagonal
 
8:47 PM
@RGS I don't think so. I went over it with RichardPark too.
 
RGS
Alright; I'll be back then
 
ngn
@cannadayr the original
 
@ngn bookmarked for later. good to know it exists and ill keep it in mind.
 
RGS
@Adám Thanks; I just have a question about whatever comparisonFn/⍋ means
 
im mostly converting the eqs from golub directly to apl but the result leaves a lot to be desired re: clarity
 
RGS
8:50 PM
I don't understand if you are using / as the operator
or if you mean "defining a custom comparison function" and ⍋ can be used to compare anything
 
RGS
@Adám to be honest I was not able to use the words in an efficient manner but your APL Cart link cleared things for me, I think.
@Adám if you agree, maybe the "spell out some benefits of that [logical values being 0 and 1]" would be better suited for the notebook on boolean functions?
 
9:12 PM
@RGS Yes, I thought I replied that on GitHub.
 
RGS
@Adám you replied to using the comparison functions as boolean functions
but you also talk about having a "heads up" on APL using 0/1 for logical values and then you add "and maybe (later?) spell out ..."
and I'm saying that probably this too should go in the other notebook
 
Oh, I should have been more clear.
 
RGS
if you already assumed this was all the same thing then my bad
 
Using comparison functions as Boolean functions belongs in another notebook.
However, the fact that comparison functions return 0/1 and not false/true should be mentioned here.
 
RGS
Yes*2
Alright, that was already settled in my mind. Maybe I overthought something ⍥
 
 
1 hour later…
RGS
10:21 PM
@Adám done; I'll be waiting for a second round of feedback. That's it for today, I'm off to bed ○/
 
@RGS Ill have a look tomorrow. ⎕DL well!
 
11:08 PM
@xpqz I skipped that one in my Advent of APL for a reason. :)
 

« first day (1189 days earlier)      last day (1466 days later) »