« first day (1506 days earlier)      last day (1445 days later) » 

00:58
how can I do ']load HttpCommand' on tio
⎕SE.SALT.Load'HttpCommand' doesn't work for me
01:19
@rak1507 I thought putting it in the input would work, but it doesn't work either.
it must not be installed or whatever
which is a right pain
Just take a screenshot of your code running.
02:03
whats the equivalent of in J?
@Razetime ".
cool
It's called "Do"
03:01
damn, why does f⍢⊤ not work in extended
should be equal to 2⊥f⊤⊢
 
2 hours later…
04:44
any k people in the house I have a selection question
first does K have pattern matching? I'd like to match rows in a table that match a given pattern (1;2;3) someF (any; 2; any), ideally I'd have liked if ((1;2;3);(3;3;3))^(:;2;:) worked, but it doesn't
second, what is the idiomatic B/A or B⌿mat in K? I have a basic selection, but its inelegant and I'm trying to learn
{x@&~4=x}1 2 3 4
@rak1507 looks like UpTack doesn't have its obverse defined github.com/abrudz/dyalog-apl-extended/blob/master/UpTack.dyalog
@Adám oh, I tried enabling salt, but I didn't know you had to pass the full path
@rak1507 if you interested in making a pr, my commit may be helpful github.com/abrudz/dyalog-apl-extended/commit/…
thanks, I'll have a look later
ngn
ngn
06:23
@nathanrogers yes x@&y is idiomatic
@nathanrogers so you want to match the rows that have a 2 at column [1]? t:(1 2 3;3 3 3); t@&2=t[;1]
07:09
@ngn What do you think about making K off-topic here other than from the perspective of APL (comparison, ideas), and instead asking people to take K questions and discussions to your K Tree?
2
 
2 hours later…
08:49
Regarding the problem of determining the path of the currently running code: Do y'all think this is the question that one generally wants to ask, rather than the path of the script or source file that was used to START the current process?

If you "build" a workspace or a bound executable from source files in order to have a more easily distributable package, you won't have loaded the script files from the environment where your package has been deployed. At that point, your application root directory would be wherever the workspace or bound executable was found.
I'm doing some work on the next release of Link at the moment, and I'm exprimenting with adding a ⎕SE.Link.LaunchDir API function, which will tell you from whence things were started.
 
1 hour later…
ngn
ngn
09:59
@Adám you're one of the room owners here - do whatever you like
10:31
Morning/afternoon/evening, APLers.
hey there @xpqz
11:09
Can anyone suggest a clever way of achieving the follwing "left join":

Given two vectors, the first a vector of char vecs, the second a vector of two-element vectors, group the second based on the first component, returning the second components per group, inserting the empty vectors for groups not present.
e.g
X←'one' 'two' 'three' 'four'
Y←('one' 1)('one' 2)('three' 1)('four' 2)('four' 3)
R←⎕←X f Y
┌───┬┬─┬───┐
│1 2││1│2 3│
└───┴┴─┴───┘
R≡(1 2)(,⍬)(,1)(2 3)
1
@xpqz (⊃¨{⊂1↓⊢/¨⍵}⌸⊢)(X,⍥⊂¨0),Y
wow, nice
11:50
also {/∘(1⊃¨⍵)¨↓⍺∘.≡⊃¨⍵}
12:00
Nice, but probably inefficient.
yeah :(
It's x⊸⊐⊸⊔˝⍉>y in BQN (group continues to be awesome)
+66% length to fix an edge-case that really shouldn't exist in the first place
13:17
@dzaima But there isn't a way to never have that edge case in Group, is there? The safe solution is still much shorter than either Dyalog version or the slow (and golfed) (≡⌜˜⟜x<∘/⎉1⊢)˝⍉>y.
something called 'group' should group things properly
@Marshall with 2 arguments, I don't think there's a way. But a 3-arg group taking keys;values;output keys, would. Unfortunately, the character restrictions make finding a built-in for that nigh impossible
@rak1507 All the things go to the correct group. The problem is that maybe a group you wanted that has no things won't be there.
all the things might go to the correct group, but all the groups don't go to the correct things
@rak1507 The correct absence of things.
13:22
yes
@dzaima I mean, if you're implementing a database you can always just define Group←{k‿v‿o←𝕩⋄v⊔˜(o⊐k)∾≠o}.
@Marshall i'd argue that's a pretty good replacement of in general
@dzaima thoughts on extending ⍀ to do a traditional rtl scan in dzaima/APL?
@rak1507 it's already taken up by expand, which is a function
ah and you can't do two things like dyalog does?
13:31
@rak1507 that's called schizophrenia, and that is bad
rtl scans though :( new symbol for it?
@rak1507 is it really that hard to & ?
@dzaima I think a version of that always requires a final count would be a lot easier to use. But you can just program that way anyway, and the current is much more convenient in cases where every group is guaranteed to have entries (like monadic ⊐⊸⊔).
(i'm much more likely to add a ltr reduce than a rtl scan :p)
13:33
@dzaima `f` doesn't have a dyadic meaning in dzaima/APL, does it?
Current Group is also a lot easier to structurally invert.
@Adám it doesn't, but i'd rather not abuse it for a reduce (also ``f\``)
(dammit did i really not test my code escaping :|)
13:52
Wow. Getting the parser to do the right thing for short-form function definitions was a nightmare. Turns out that support dyalog-style is actually easier than my earlier proposed style. Since I still don't want to support full-on Dyalog style (for the reasons outlined earlier) I have temporarily gone for this:
add ⇐ +
This is the same as Dyalog, but a double struck arrow instead of single-struck.
@Adám This was fun. Do I get 200 rep now?
@Adám I can give you 200 :D
@Bubbler That'd be nice. Then I have more to give to you…
dfns.roman would shorten that a bit I think
> No libraries that do roman numeral conversion for you
14:03
oh
do you think I can put ⎕FIX'file:///opt/mdyalog/17.1/64/unicode/Library/Conga/HttpUtils.dyalog' in the header or should that be in the actual code?
@rak1507 Either way, but if you put it in the header, then it needs to go in the header of your answer too: "Dyalog APL with HttpUtils"
is there a way to make 'input' in tio not act like a repl?
@rak1507 what do you want it to act like? just be completely ignored?
@rak1507 As a single text array?
heh, {⍞}⍣⊢0 in code stops interpreting further code and exits, but the more obvious ⎕off is disallowed :D
14:19
@dzaima That's because you're actually inside a :Namespace definition.
@Adám well yeah, but why disallow ⎕off if one can get around that anyway
@dzaima TIO's interpreter stops because input is redirected and so there's no chance the user will enter more. Not a normal stop.
@dzaima regular stdin that I can read with ⎕/⍞
@rak1507 that's already the case
@rak1507 Uh, it is.
14:25
oh
I must be doing something wrong then
my bad
@rak1507 TIO link, please?
I'll try and fix it myself
@Adám oh, it cathes (and hides) the error that dyalog creates. why though
@dzaima So that the exit code can indicate the error.
@Adám oh, regular Dyalog 17.1 throws up even if the input in REPL mode is cut short
14:29
@dzaima Yeah, the -script was only an unofficial hack at the time.
wait, -script and --script are different things?
well, whatever anything does, imo the correct behavior is to quietly exit when the REPL hits EOF, but give an error if a / gets EOF
'thing'≡+'thing', til
 
1 hour later…
15:59
Announcement: BAA webinar now at zoom.us/j/858532665 with Passcode ← ×/1920 12 17
ngn
ngn
16:29
@xpqz one way to do it k (while it's still allowed here): make a dict mapping X's items to empty lists and amend it with the keys and values from Y: .@[X!(#X)#,();;,;]/+Y
(amend with ,)
something similar in apl:
K V←↓⍉↑Y ⋄ R←⍬⍨¨X ⋄ R[X⍳K],←V
16:49
@ngn Nice!
17:32
@Adám dammit i found this too late
Dyalog windows is such an upgrade from mac
18:11
@ngn the ok docs refer to m_l where m is a boolean function, will remove where 1 from l, and also m#l will select. Does NGN support these? I couldn't get either of them working correctly
ngn
ngn
@nathanrogers only m#l now but i'll add m_l too. in the meantime you can use {~..}# instead of {..}_
@Razetime You may want to log issues against RIDE for what you were missing there.
18:44
Can anyone call a CMC?
CMC: read a .ini file, and return it as a nested namespace (en.wikipedia.org/wiki/INI_file). Assume it has no commets.
no backslash escapes either?
Nope.
Just key=value and [section] and empty lines
can value be a string like test="whatever"
in an example I found, it has this
server=192.0.2.62
port=143
file="payroll.dat"
how come the third one has quotes but the first two don't
18:50
I think quotes are optional. All uses I've seen ditch the quotes
I wonder if Dyalog has one built in on some random i-bar
hmm I think this cmc might have to wait as I just felt an incredibly sharp pain in my side, brb
ngn
ngn
@xpqz replace a=b with a←'b' using a regex and ns.⍎ it :)
Will that handle sections?
@rak1507 :O ono get better
@rak1507 hope you ok buddy
1000+ loc !
well idk what that was about but back to the apling
mine is 5
ngn
ngn
@xpqz how should they be handled?
@xpqz no nested sections right?
18:57
The ini file is basically a js object, or a py dic. Only one level, yes.
ngn
ngn
[s] could be replaced with ns←#.s←⎕ns⍬ or simply ignored
I want to be able to say: ns.sectionname.keyname basically
{root←⎕NS⍬ ⋄ root⊣⍎¨'(.*)=(.*)'⎕R'ns.\1←''\2'''⊢'\[(.*)\]'⎕R'ns←root.\1←⎕NS⍬'⊢⊃⎕NGET⍵1}
ngn
ngn
@rak1507 shouldn't it be root.⍎¨ instead of ⍎¨?
19:07
oh, I forgot you can execute code inside namespaces like that, that code does work as it mutates root and then returns it, but your method will be simpler
ngn
ngn
ah, you have root.\1 so it's fine
{r⊣(r←⎕NS⍬)⍎¨'(.*)=(.*)'⎕R'ns.\1←''\2'''⊢'\[(.*)\]'⎕R'ns←\1←⎕NS⍬'⊃⎕NGET⍵1} works
ngn
ngn
cool
@rak1507 ⊢⊃
@rak1507 ).⍎)⍎
edited
ngn
ngn
19:11
it would be 1 byte shorter with a single ⎕r with multiple patterns
I'm not trying to code golf
ngn
ngn
but whyyy.. sigh of disappointment
@xpqz Can we assume all values are inside sections?
@ngn readability :D
Meh, this turned out longer:
{⎕JSON⍠'Dialect' 'JSON5'1⌽'}{',2⌽∊'^\[(\w+)]' '^(.*)=(.*)'⎕R'},\1:{' '\1:"\2",'⊃⎕NGET⍵}
@rak1507 Doesn't handle empty lines, nor keys named ns
19:27
oh empty lines
That's just ()~⊂''
It also populates the namespace with an extra ns name.
true
does your json one work?
I believe so.
nice
It also has the benefit of being safe (no ) and auto-mangling names that are invalid in APL.
19:30
definitely the smarter way to do rather than eval, which is pretty hacky
yeah
Mine also handles = in values. (Well, it can, at the cost of another few bytes.)
@rak1507 Test input:
[sec-tion]
ns=

[]
===
Test run:
      ⎕JSON⍠'Compact' 0{⎕JSON⍠'Dialect' 'JSON5'⊢1⌽'}{',2⌽∊'^\[(.*)]' '^(.*?)=(.*)'⎕R'},"\1":{' '"\1":"\2",'⊢⍵}t
{
  "": {
    "": "=="
  },
  "sec-tion": {
    "ns": ""
  }
}
if someone has that as a config they deserve whatever nonsense they get
:)
what's up with the "": "=="
that doesn't seem right
@rak1507 Why not? It comes from === which means the empty string key has the value "=="
19:35
oh right, I was interpreting it as the key "=" has the value "="
but I see now how that would not make very much sense
Not sure which it should be, as there's no real Ini file standard.
having = as a potentially valid key character introduces ambiguity
How so?
foo==bar
is foo equal to =bar or is foo= equal to bar
I think the spec is that the first = stops the key name.
Question is if the key can be empty or not.
19:38
yeah, that makes sense to me
I think an empty key being allowed is fair enough but I don't think a user should necessarily expect something sensible from it
@rak1507 The Windows registry is often represented with Ini files, and there are plenty of empty keys there.
of course it is, typical windows
However, regedit exports inifiles with keys in quotes. Hm.
Ah, they have lots of fancy features…
yeah I saw backslash escaping in the wiki article
20:02
@rak1507 Mine fails on values that are not in a section.
Fixing it isn't so easy.
20:20
@rak1507 @xpqz OK, exactly 100 bytes (without the file read) for a fairly solid implementation:
{⎕JSON⍠'Dialect' 'JSON5'⊢2⌽'}}{"":{',∊'^;.*' '^\[(.*)]' '^(.*?)=(.*)'⎕R'' '},"\1":{' '"\1":"\2",'⊢⍵}
nice
Things before the first section go into a special namespace.
(This is necessary to allow a "global" key to have the same name as a section.)
Also allows comments in the form of lines that begin with ;
Ignores empty lines.
Handles all key names (even empty ones) but a 0-length section name will replace the "root" section (if any).
Also handles JSON style escapes.
Tacit version saves 4 bytes:
⎕JSON⍠'Dialect' 'JSON5'∘∊2⌽'}}{"":{','^;.*' '^\[(.*)]' '^(.*?)=(.*)'⎕R'' '},"\1":{' '"\1":"\2",'
20:39
@Adám good job!
Almost APLcart material?

« first day (1506 days earlier)      last day (1445 days later) »