« first day (1582 days earlier)      last day (1075 days later) » 

6:22 AM
@DavidLloyd-Jones Hi there. Interested in APL?
 
 
4 hours later…
10:12 AM
If I have an array of ⎕JSON namespaces and I want to pick out a subset of those where if a field exists, and if so this field matches some criterion, how would I do that? My problem is the "if the field exists". So, if data is my array of namespaces and I'm looking for name anywhere in a field customer which may or may not be present:
data/⍨name(∨/⍷)¨data.customer
VALUE ERROR: Undefined name: customer
 
You could start by masking by existence of the field. ×data.⎕NC⊂⊂'costumer'
@xpqz Something like:
      js←'[{"customer":"Abe"},{},{"customer":"Carl"},{},{"customer":"Earl"}]'
      data←⎕JSON js
      found←{⍵/⍨name∘(∨/⍷)¨⍵.customer}data/⍨×data.⎕NC⊂⊂'customer'
      found.customer
┌────┬────┐
│Carl│Earl│
└────┴────┘
 
Yep, works
Handy pattern.
 
@xpqz DSL:
2
      Where←/⍨
      Has←{×⍺.⎕NC⊂⊂⍵}
      In←{⍺∘(∨/⍷)¨⍵}
      From←{⍵⍎¨⊂⍺}
      'customer' From {⍵ Where name In ⍵.customer} data Where data Has 'customer'
┌────┬────┐
│Carl│Earl│
└────┴────┘
 
10:33 AM
Who needs SQL now :)
That's really cool.
 
This is basically what Q is for K.
 
 
1 hour later…
11:40 AM
Hi, who ran the bot that links this room and #apl on freenode?
I think people want to move over to libera.chat
 
moonchild
 
Oh
Thanks
 
12:10 PM
In the List function of a user command, what should the Parse attribute be set to if I want my function to accept any number of string arguments (i.e. like a vector of character vectors)?
 
Should it also accept a zero strings?
 
One or more strings.
 
1-99
I guess you'll never actually use it with a hundred strings, right?
 
Is that 1-99S?
No, I suspect in practice it'd be a handful
 
No, 99S is just short for 0-99 ― yes, I know.
 
12:14 PM
Should I have been able to deduce this from the userdoc pdf?
1-99 does the job.
Thanks
 
@xpqz Yes.
 
:/ I need new glasses, clearly
 
 
4 hours later…
4:26 PM
Hi, I'm having trouble setting up my keyboard to type APL characters. I installed dyalog and went into my keyboard settings where "apl" of the variant "dyalog" was already added as a layout. I configured "change layout" key but I was still unable to type APL characters when using it. Now, for some reason, the APL layout in my keyboard settings is gone and I can't add it from the list of available layouts anymore.
I've been looking around online but so far I haven't found a solution, other than "if you're using a newer debian derivative it's already installed" (which was the case for me apparently, but now the layout is gone and I don't know how to get it back). I'm using the latest Linux Mint distro with XFCE.
I suppose I'm looking for a fool-proof set of steps to set this up
 
4:43 PM
@Johnny see wiki. I use the top command (setxkbmap -layout us,apl -variant ,dyalog -option grp:switch (with some tiny irrelevant tweaks)) with some manual shortcuts to switch to/from it
that enables typing APL chars with <altgr>+whatever, with grp:switch replaceable with any of these
 
5:08 PM
Thank you, that wiki page is incredibly helpful. Dunno how I missed that
 
5:19 PM
Hmm, win_switch doesn't work for me as a key to switch to the APL layout, do you know of any reason why that might be? Others, such as switch (altgr) work
 
do you have any other special xkb things configured? (caps lock remapping or xcompose) if not (or if you're fine with temporarily disabling), it may be worth trying setxkbmap -layout us,apl -variant ,dyalog -option -option grp:win_switch (where the first -option clears all xkb configuration)
(also worth viewing the output of setxkbmap -query)
(fwiw win_switch works fine for me, linux mint 20, cinnamon)
 
```
rules: evdev
model: pc105
layout: de,apl
variant: ,dyalog
options: grp:win_switch
```
This is the output of the query. I did override all previous xkb settings right before (I didn't have anything configured anyway) but it still doesn't work
 
weird. setxkbmap -layout de,apl -variant ,dyalog -option -option grp:win_switch works for me (and gives the same query output)
 
The Onboard app shows the win key as the super key I think, maybe that has something to do with it? Haven't found whether xkb makes a difference between win and super for its configuration though
 
super and win are just synonyms afaik (onboard shows super for me too)
I'd have to guess that some other app (or maybe just the OS?) is hijacking super for itself
 
5:35 PM
It's not really a solution but RIDE lets you type characters with backticks, which is alright
 
@dzaima mhm, probably. Can't find where though, I think I've removed all visible system-wide super bindings
@rak1507 don't think this'll be a proper solution for me because I do not have a keyboard layout where backticks are immediately accessible
 
Ah.. does RIDE allow you to change the input method? (not sure)
 
Idk. I'm looking to write APL in emacs though anyway
 
@Johnny (fwiw i have separate xkb configuration for when i need to type APL, and my native language. but i assume us,apl doesn't work for you either)
 
yeah, using us doesn't change the outcome
 
5:40 PM
:/
 
I think I'll use Alt Gr for the time being and eventually make a PR to the emacs mode I'm using to add a keyboard settings agnostic input method
 
@Johnny @rak1507 You can choose prefix key.
@frankblond Hi there. Interested in APL?
 
@Johnny it's open-source, surely it's pretty trivial to change the prefix key
 
@Johnny Maybe you're experiencing this.
@Johnny What are you using?
 
sorry honestly not too sure what it even is, but always happy to learn :)
just joined this chat website now so having a look at the rooms there are aha
 
5:51 PM
@frankblond It is a programming language evolved from traditional mathematics, rather than evolved from machine code.
 
@Adám Not sure whether I'm experiencing this because I'm using neither gnome nor ubuntu 21, but it just looks like an alternative to me anyway. Tbf, caps lock is probably a better substitute for me than Alt Gr
@Adám Installed dyalog-mode (github.com/harsman/dyalog-mode) today and I've been thinking about gnu-apl-mode and its APL-Z input method
 
OK.
 
can you tell my uni lecturers to use this language then instead of python and R please? thanks
 
It used to be more common in universities, long before Python and R. Maybe it'll see a comeback. Some teachers will allow you to use any language you want…
 
6:11 PM
@Johnny wiki shows an example with grp:win_switch, huh
 
@dzaima Could it be that something has changed in the latest versions of Ubuntu-based distros? I added the trouble-shooting entry on the wiki because I spotted this.
 
@Adám ah, that could be a reason, as my linux mint installation appears to be ubuntu 20.04
 
@dzaima On the other hand, Johnny is on "latest Mint" which should be based on Ubuntu 20.04.
 
6:35 PM
@dzaima Yeah, I followed that for persistent settings.
@Adám Right, yeah
 
6:52 PM
/me thinks that someone needs to re-create the Symbolics LISP Machine keyboard (the so-called "Space Cadet" keyboard) as a modern USB keyboard, complete with drivers to support the at-least-three additional modifier keys that current keyboards don't have...
 
7:03 PM
 
7:18 PM
:)
 
 
3 hours later…
10:27 PM
Why does ¯2 | 3 give ¯1 not 1?
 
@rak1507 someone at some point picked it from the many options
 
frustrating
 
@dzaima No, it isn't arbitrary.
 
LCM also produces positive numbers
 
@Adám well, none of the options there aren't arbitrary
 
10:33 PM
If LCM produced negatives it could save me a whole 5 bytes in one of the problem solving problems!
 
@dzaima I can't quite find it right now, but if you want me to, I'll ask Roger Hui where exactly it is discussed.
@dzaima Maybe APLcart should have entries for the other forms?
 
nah
the other forms are easy enough to work out
 
^
(this is the first i've heard of anyone actually having a negative dividend for modulo anywhere. And the APL definition (where (with a positive dividend) the result is positive) is what i think you want 99.9% of the time)
 
I still think it could be nice to have them. Any volunteers?
 
@dzaima using ~ and / to replicate by the modulo would save me a whole byte over needing 0= and ⊢⍤/
I don't consider that a spoiler considering it is both stupid and doesn't work
@Adám |⍤| is probably what you want most of the time
(which is just ||)
I'm pretty sure people can figure that one out
 
10:49 PM
Maybe worth it to explain the differences between |⍤| and |⍥| ― and how about |∘| and |⍛| (i.e. |⍨∘|⍨)?
 
I assume you're joking, but if you're not, it's definitely not worth having entries for all of them
 
i think it'll take longer for one to understand what the APLcart entry means and does, than figuring out how to implement what you need yourself (and you'll end up learning more that way too)
 
this ^
 
OK. I was thinking of it similar to how I've included many rounding methods.
 
most of them are slightly more complex than adding a whole 1 extra character
 

« first day (1582 days earlier)      last day (1075 days later) »