« first day (1602 days earlier)      last day (40 days later) » 

12:14 AM
Q: Using APL symbols in Ubuntu, console only

Santiago Nuñez-CorralesI have been trying unsuccessfully to setup the keymap on a console to program in APL. My machine is remote, hence I do not have Xorg installed. How can I setup my keymap/charset to correctly produce APL symbols?

6 hours later…
6:27 AM
@Adám what exactly does "appropriate" mean
@Razetime Adding only words that actually identify the primitive, so for we should add let but not only.
that sounds very manual
Indeed. I've already done almost all the automatic processing possible for the Gist.
then where's the fun part
would y'all be interested in a custom feed name/avatar :P or are you happy with the default config
6:33 AM
@hyper-neutrino The current name and avatar is fine. The delay between posting and Feeds reacting isn't very nice though.
ah. yeah :( SE chat things ¯\_(ツ)_/¯
How were you intending to change name/avatar without entirely replacing Feeds with a bot?
for me it's just one button to create a new user for the feed, and then just change its avatar and username
basically, SE chat doesn't really have proper support for custom feeds. you just abuse mod powers on a feed user ¯\_(ツ)_/¯
Well… It would be cool if Feeds' avatar looked like now, but with instead of .₎)
Problem is finding the right orange background blob.
hah, i like the way you wrote the feeds avatar with unicode :P that would be cool. but making it into the style of the current icon would take a bit of effort
6:42 AM
Actually, that seems to be the standard RSS icon.
oh. you're right lol.
6:59 AM
@hyper-neutrino Maybe something like this?
ooh, that could be cool
reminds me of a mobile phone, tbh :P probably just cuz i'm not particularly an APL user though
is used for stderr.
Now I think of it, maybe it should say ⍞← (send to stderr)
ah, i see. well if y'all do ever want a custom feed name/avatar feel free to ping me :p unfortunately a mod has to do it AFAIK; ROs can't just set it up for any room sadly. i just brought it up because i saw the SO feed post and noticed it was default. nothing wrong with that ofc.
@hyper-neutrino Can you make it ^^?
the wiki one, the SE post feed, or both?
(and I'm not sure I can make them both the same user unfortunately)
7:10 AM
What is "the wiki one"?
"APL Wiki - New Pages [en-gb]"
(also, do you happen to have a white/transparent-background version of that image?)
Oh, that isn't working, unfortunately.
ah :/
@hyper-neutrino Yes, one min. I want to make the border a little wider too.
@Adám ⍞← does NOT mean "send to stderr". It happens to do that in current Dyalog APL, but I consider this to be one of the most bizarre decisions in the implementation and it may well come to an end when we re-implement the guts of the I/O handling in order to wrap up the #! scripting project by adding RIDE support, planned for v19.0.
7:16 AM
@MortenKromberg OK, do you have another suggestion for the Feeds icon?
No, have not had time to look at that :). I just wanted to be sure that people don't think QuoteQuad "means" stderr.
⍞← commonly means to print a message, which this does.
Of course, we could use ⎕← as well.
Or even
@hyper-neutrino How do I deliver an image with transparent background? Imgur seems to convert transparency to black.
@Adám uh, seems to be working for me ¯\_(ツ)_/¯
send the upload link and i'll take a look?
Oh :-)
alright, done :) and now we just need to wait for a post :P
7:26 AM
That might take a while. Thanks!
do you have a particular name in mind? I just set it to "Feeds" for now
Might be an idea to call it "Stack Exchange Feeds" to make it more clear what is happening.
I think that makes sense too :) alright, :D
Yup, I can see that:
Thanks, HN!
you're welcome! :) now we just wait lol
7:55 AM
@MortenKromberg I thought scripting was an 18.1 thing not a 19.0 thing?
May 30 at 18:45, by Adám
@rak1507 Yes and no. Yes, officially. No, because in all likelihood, real-world usage will uncover important components that are glaringly missing, and maybe even things that have been done wrong in the initial attempt.
8:15 AM
@rak1507 In 18.1, scripting is missing at least one key feature, which is debug-ability via RIDE. This is the piece that requires a rewrite of some core I/O functionality as we need to teach the interpreter that "debug input" and "user input" may come from different sources. We need to add a central switching station.
@MortenKromberg On the other hand, I think plenty of users will be happy for the script execution to stop altogether on error, rather than be dropped into a tracer.
Indeed, so the scripting support in 18.1 is already valuable. However, in more complex scenarios, the ability to attach a debugger will be even more valuable.
What might (I've not tested it) be sorely missing in 18.1 is the ability to prompt the user for input, and get what they wrote back in a safe manner. Also, printing something (please wait...) and then erasing it again.
what does 'in a safe manner' mean?
Without risking that part (or all) of the prompt is included in the input, nor that any of the input is lost.
Try e.g. ⍞←'prompt: ' ⋄ 8↓⍞ and then backspace over the prompt before you start typing.
You might come up with something like {⍞←⍵ ⋄ i←⍞ ⋄ i↓⍨+/∧\=⌿↑⍵ i}'prompt: ' but even this will fail if the user backspaces over the prompt and then retypes the same characters as the prompt had in those positions.
8:31 AM
Backspacing over the prompt surely won't be possible...
Maybe, maybe not, as I said, I've not tested it. Maybe it'll "just work".
We'll also be looking at whether a completely new input mechanism is required, in addition to QuoteQuad, which has, ah, interesting features which were very useful in the day of the teletype.
8:46 AM
any update/eta on the kattis thing also?
@rak1507 No.
OK, I just tested using 18.1's scripting, and it adds a line break after :-( Of course, this might well change before release.
4 hours later…
12:43 PM
Are there any neat ways of combining an :If with a :Trap so they share a clause?
 :If x<0
 :Trap 0
Else: :Else
     ⎕←'uh oh'
Something like this would be nice:
 :Trap 0
 :OrIf x<0
     ⎕←'uh oh'
Or maybe it should be:
 :Trap 0
 :AndIf x>0
     ⎕←'uh oh'
1 hour later…
1:49 PM
@Adám Please no
@MortenKromberg Right, but how do I write it nicely?
2:07 PM
uh oh
2:52 PM
@MortenKromberg :D
@MortenKromberg the correct answer
@SantiagoNuñez-Corrales Welcome to the APL Orchard. Did you solve your problem with typing APL glyphs?
3:29 PM
Speaking of typing glyphs, has anyone managed to get a semi-decent experience writing APL in VS Code? The option key is used by VS Code for certain chords meaning that some glyphs (to my knowledge) seem untypeable. Annoyingly including .
(on a Mac....)
May have to make a completely new keyboard layout using the fn key instead of option (fn key isn't used for anything really on a mac).
@xpqz Have you tried using the APL Language Server Client extension to enable prefix key input?
Yes, i believe so, meaning that I can use backtick -- but it's not a great typing experience, I find.
3:52 PM
@xpqz Can the function key be used in keybindings? I remember having difficulties swapping the Ctrl and Fn keys on a Lenovo because it's special in some way
1 hour later…
4:53 PM
@Adám Hi Adam, I did install Dyalog in MacOs and have no problem using the glyphs there after following the instructions.
Now, I would really like to use Dyalog on an Ubuntu AWS instance through Blink on my iPad to gain a bit of remote flexibility. That is where my current challenge rests now.
But for this learning stage, I will probably then stick to my Mac.
My plan is to learn APL and use it in the context of my research (mathematical physics), will probably remain close to this chat in the meantime.
5:16 PM
@SantiagoNuñez-Corrales That shouldn't be a problem to arrange. The dyalog executable can serve RIDE which any browser with access to the exposed port can then access.
@SantiagoNuñez-Corrales Where are you up to with your learning? Do you need any pointers to materials?
5:57 PM
Just saw this in an email from Roger Hui:
Thankfully, to my knowledge, our major users don't use ⎕io=0.
Never thought I'd live to see that.
6:17 PM
@Adám Thank you for offering help. I am right now just starting, but eager to learn.
@SantiagoNuñez-Corrales Maybe some of these resources can help?
7:20 PM
somewhat related: do you perhaps have reading or watching recommendations for thinking in vectors (for lack of better words)

I think I am looking for input that helps me with examples so I can build an intuition for "seeing" a vector representation of a solution when I am tackling a problem
@tosh Maybe the "Thinking in APL" series? Part 1 and Part 2?
7:38 PM
ty, will take a look!
2 hours later…
9:41 PM
@Adám wow! what was the context?
@tosh if you have a particular question about a problem you could always ask here as well
2 hours later…
11:19 PM
so, f⍣≡ Y apparently applies f until stable / fixed point
is there any way to collect all intermediate results?
nope (not easily at least)
Not as a built-in symbol, but there's dfns.traj
ah. alright. basically, i have (1∘↓+\⍣¯1) that takes an array and returns its forward difference array; i want to apply that N times (N is the length of the list) and have all intermediate results
before considering golfing (1∘↓+\⍣¯1) - what would be the most idiomatic way of going about something like this?
(also, i'm not sure if porting my jelly answer is the best way to solve this challenge anyway lol. wanna give it a shot though)
I think you actually want 2-/
oh yeah, right, it seems that i'm getting the increment array, not the forward differences
why does 2-/ 1 2 3 4 5 work but not (2-/) 1 2 3 4 5?
11:23 PM
2-/ is not a valid train. 2-/⊢ is.
oh, is -/ a train(?) that reduces as monad and n-wise reduces as dyad?
it's a function, but yeah
Not a train, / is an operator that takes - as its operand, so -/ is a function
The rest of the sentence is correct.
ah... okay, thanks. yeah, I mistakenly thought / would take both the - and 2 as its arguments lol :P misunderstood the way it works
Jelly fallacy :P
11:25 PM
i was writing 2-/ 1 2 3 4 5 so that didn't quite help with my understanding of it, but looking at the tryapl built-in guide for / and how it was spaced made me realize how that worked
@Bubbler yes :c lmao
er, why does (2∘-/) not work? (says "this function does not take a left argument") - am I misunderstanding how composing / partial-functions work?
@hyper-neutrino that's parsed as ((2∘-)/)
oh .-. oops
X f¨ Y does vectorize instead of each on either side. what's the best way to make it only loop over X or only loop over Y? I could work around it with a different structure but it'd probably be considerably longer and I'm wondering if there's a better way to do it
one side, or do f∘Y¨⊢X/X∘f¨Y
oh, so bind Y to the right of f and then call that on each of X?
or rank
11:36 PM
hm, i see. okay, thanks
@Bubbler is ⊂X a valid output format or should I stick a ⊃ in front
I think there's a default IO that says [X] is acceptable whenever X is, so I guess it's fine
well i eventually got {⊃¨(⊂⍵){((2-/⊢)⍣(⍵-1))⍺}¨∘⍳≢⍵} which is longer than user's solution and idk how to submit it as either a TIO or TryAPL link xD
not gonna bother leaving an answer but it does seem to actually work lol
it's also probably really bad :D
port of the j solution is shorter {-/⍵ר↓∘.!⍨⍳≢⍵}
@hyper-neutrino (⍵-1) can be ⍵ if you just use ⎕IO←0 (which is allowed)
oh cool
11:43 PM
Quick golf: {⊃¨⍵∘{2-/⍣(⍵-1)⊢⍺}¨⍳≢⍵}
ah. nice. i'll eventually understand trains hopefully lmao
There's no train in there
well like
what's it called, binding? i don't honestly know terminology
like which operators take precedence (if that's even a concept) - i'll have to read over your golf more to understand the specific details
Yeah, x∘f and f∘y are called bind
Operators take precedence over functions, but all operators have identical precedence. And they are left-associative
Trainified: ⊃¨⊂{2-/⍣(⍵-1)⊢⍺}¨⍳∘≢
11:47 PM
f¨∘⍳ = f¨⍳

{((2-/⊢)⍣⍵)⍺} = {(2-/⍣⍵)⍺} = {2-/⍣⍵⊢⍺}


⊃¨{thing}¨x = {⊃thing}¨x

convert to train
final solution is actually just as short as the j port and more accurate
i have ⊃¨((2-/⊢)\≢⍴⊂)
ahh, using a scan, nice
-1: ⊃¨≢(2-/⊢)\⍤⍴⊂

« first day (1602 days earlier)      last day (40 days later) »