« first day (1424 days earlier)      last day (1231 days later) » 

12:00 AM
@MartinJaniczek i don't think it's that important to the room, multiline messages work just fine (ctrl+k to monospace exists), my paste is mostly just for syntax coloring
 
So, question. Where did I go wrong in my // "compress second col by first col" idiom? is.gd/mjcompress ... I'd expect there to be only 3 elements (the non-empty ones) in the final thing
(btw the CSS for the "view with syntax coloring" mode could be improved - I can't scroll in there)
 
@MartinJaniczek oh .____. i recently tried to improve how it works on mobile, but broke that
 
0 1 0 1 1 / xs[;1] gives me 3 elements but the ×≢ thing doesn't
 
ngn
@MartinJaniczek so you want the right column without the enclosed empties?
 
yes
I just figured out ×≢¨xs[;0] gives me 1 1 1 1 1, no what I expected
 
ngn
12:10 AM
@MartinJaniczek xs[;1]~⊂⊂⍬
 
@ngn For some reason that doesn't work, it gives me the right column unchanged
 
try ]boxing on -style=max for debugging, it's often helpful to me
 
@MartinJaniczek could you do ⎕SE.Dyalog.Utils.repObj xs?
@rak1507 that is already on
 
5 2⍴0 (0⍴⊂⍬) 2 ('q2_1' 'q2_3') 9 (0⍴⊂⍬) 11 (,⊂'q2_2') 17 (,⊂'q2_4')
 
ngn
@MartinJaniczek xs[;1]~⊂0⍴⊂⍬ ?
 
12:13 AM
oh yeah oops
 
@ngn that does it. Is it just a matter of finding the right shape for some equality to kick in?
 
ngn
at first i didn't notice the little circle on the outer box
 
Also, I realized I need the first column too (facepalm)
I'll probably have to go with the bitmask, right?
 
@MartinJaniczek yeah. Dyalog allows many non-equal empty arrays. the 0⍴⊂⍬ in ngn's answer comes from the (0⍴⊂⍬) in the result of repObj
@MartinJaniczek probably the easiest way to go. ~ gives it
 
ngn
@MartinJaniczek does this give what you you expect? xs⌿⍨×≢¨xs[;1]
 
12:19 AM
@dzaima pushed fix, gh pages will update after some time
 
ngn
xs[;1] is shorter as ⊢/xs by the way
 
It does! I ended up with ((×(+/⍴))¨xs[;1])⌿xs around the same time
 
@MartinJaniczek you had already come up with ×≢, why (×(+/⍴))? :p
 
:D
BTW, how does the ×≢part not need a ∘ in between? (I need to re-read 2-trains...)
I'm guessing the ⌿ makes it unambiguous that it's not going to be a 3-train
 
@MartinJaniczek in xs⌿⍨×≢¨xs[;1]?
 
12:24 AM
yes
 
@MartinJaniczek there are no trains here
 
oh right
 
it's just × (with pervasion) applied on the result of ≢¨ applied on the result of xs[;1]
 
pervasion = scalar extension?
 
@MartinJaniczek scalar extension is the specific scalar pervasiveFn vector case, pervasion is the act of recursively applying in general
 
12:28 AM
ah, right. similar ("applied element-wise") but different.
 
scalar extension is a subset of pervasion i guess (but it's only for dyadic fns so it doesn't at all relate to monadic ×)
 
12:46 AM
Thanks a lot everybody. I really appreciate all the help. I've managed to get the tree data into the shape I wanted - huge accomplishment for me :) is.gd/mjjson
 
nice one
 
(My backend colleagues are, over the holidays, playing with and trying to replace their legacy data crunching solution in Go+ElasticSearch with D and Rust and what not. I started learning APL at the same time - so I'm curious whether I'll manage to get near / improve on their times / memory+disk consumption for the same task)
I didn't yet try to get a 5GB JSON file into APL but I heard there are some mmap niceties, so I'll probably have to read up on those.
 
D?!
 
      rawbig←⊃⎕NGET '/home/martin/Downloads/core/core.q1_2015.json' 0
WS FULL
haha
Well, that's a battle for another day. I'm going to bed. Thanks again everyone!
 
yeah you're going to need to up maxws for that one haha
goodnight
 
 
4 hours later…
4:51 AM
Trying to simulate a random walk here: Try it online!
any good ways to shorten this?
 
 
3 hours later…
7:45 AM
<moon-child> anyone know the licenses of the bitmap fonts linked here? sigapl.org/fonts/FontsIndex.php
 
ngn
8:16 AM
@DyalogAPL there's a string somewhere in the first file: "Manugistics Inc. 1990-1992. Created by Christopher H. Lee. All Rights Reserved"
@Razetime you can pass s as
 
ngn
8:32 AM
@Razetime also: '.'↑⍨-⍵ -> ⌽⍵↑'.'
 
oh thanks
 
 
2 hours later…
10:10 AM
Who was it that recommended I use array lookup syntax for hashmaps? I have no idea why I didn't implement it earlier. I'm writing a Matrix chatbot in Kap now, and finding a specific value in a JSON parse result is so clean: res["flows"][0]["type"]
 
 
1 hour later…
11:28 AM
@EliasMårtenson That should be res[⊂"flows"][0][⊂"type"] at a minimum - without the map extension, a[⍬] (and so equivalently a[""]) always results in an empty array, which would clash with getting the value corresponding to the empty key
 
11:43 AM
if my answer relies on ⎕IO←0, I have to include it in the byte count, right?
 
@KamilaSzewczyk nope
 
@dzaima Well, the index resolution is different for map vs. other scalars.
Essentially, the resolver does if (value is MAP) then MapLookup else ArrayLookup.
And ArrayLookup of ⍬ on a scalar returns itself.
 
@EliasMårtenson You're of course free to do whatever, but my issue with it is that it differs visibly. (do you allow map["key1" "key2"]?)
 
@dzaima No. Recall that maps can be keyed on anything, so that would lookup a value in the map where the key is ("key1" "key2")
 
@EliasMårtenson oh, so you're pretty much just reusing the bracket syntax for an entirely different thing
 
11:52 AM
I'm considering supporting multiple key lookup using ["key1";"key2"], however, it's not entirely consistent and the use case is limited.
@dzaima Exactly.
 
(at that point i'd recommend you make brackets on any other simple scalar error for consistency)
 
The multi-key lookup can be achieved using M mapGet¨(⊂'key1')(⊂'key2')
 
@dzaima oh that appears to already be the case
 
ideas on golfing this snippet: ((⍳+.!⌽∘⍳)¨(⍳1+⊢))⍳⊢? Assumes ⎕IO←0, I'm working on a solution to codegolf.stackexchange.com/questions/85567/fibonacci-reversed
 
Yeah, it is. You have to pass an empty "list" to array lookup for that to work
 
11:57 AM
@dzaima (but (⊂1 2 3)[,⊂⍬] doesn't work, while there's no reason for it to not to)
 
There isn't even a syntax for an empty list now, so it's not an issue
A list is a set of values separated by ;
 
@KamilaSzewczyk ((⍳+.!⌽∘⍳)¨∘⍳1+⊢)⍳⊢
 
oh yeah the bind function, that's smart
 
would (+.!∘⌽⍨¨∘⍳1+⊢)⍳⊢ work?
 
not necessarily
 
12:00 PM
@KamilaSzewczyk oh, forgot a ∘⍳: (+.!∘⌽∘⍳⍨¨∘⍳1+⊢)⍳⊢
 
⋄ f←((⍳+.!⌽∘⍳)¨∘⍳1+⊢)⍳⊢⋄f 55
 
@KamilaSzewczyk 57
 
prefix a before
 
@Razetime (no output)
 
it gives a different answer for me
⋄⎕IO←0⋄f←((⍳+.!⌽∘⍳)¨∘⍳1+⊢)⍳⊢⋄f 55
 
12:02 PM
@KamilaSzewczyk 10
 
⋄⎕IO←0⋄f←(+.!∘⌽∘⍳⍨¨∘⍳1+⊢)⍳⊢⋄f 55
 
@KamilaSzewczyk 56
 
@KamilaSzewczyk oh, i placed the ∘⍳ in the wrong place; (+.!∘⌽⍨∘⍳¨∘⍳1+⊢)⍳⊢
 
ah, okay, now it seems to work
so you basically replaced parens in the train with a bind function? so the fork/atop doesn't have to be parenthesized
 
@KamilaSzewczyk (⍳+.!⌽∘⍳)(⊢+.!⌽∘⊢)∘⍳(⊢+.!⌽)∘⍳(+.!∘⌽⍨)∘⍳
 
12:05 PM
oh, I see now
thanks
 
(+.!∘⌽⍨∘⍳¨⍳,⊢)⍳⊢ (assuming you don't need to handle an input of ¯1)
 
nope, this is a valid assumption
let me try dissecting it myself
I see, so you catenate the value on the right, because if we have IO=0 then index generator produces values 0..n-1 and without catenation it would break for ⍵=2 or ⍵=3
 
@KamilaSzewczyk yep, and as a side-effect, the isn't needed anymore
(fwiw in dzaima/APL ⍳,⊢0…)
 
In extended just … should work then
 
@Razetime oh right
 
12:15 PM
@dzaima Hmm, I tried to follow the ISO spec as best as I could when implementing array index lookup
If you put anything inside the brackets that would be a lookup of a one-dimensional array
 
@EliasMårtenson oh, GNU APL doesn't like it either
 
which is why 5[] works
The shape of the value inside the brackets indicate the shape of the output
 
@EliasMårtenson so i guess this is a non-ISO thing
@dzaima in which case that doesn't need to work
 
@dzaima Yes, as far as I can tell, it's non-standard.
Is it useful? :-)
If so, I can implement it.
 
@EliasMårtenson it's pretty much , aka sane indexing, so it's pretty useful, but not very much as bracket axis
 
12:27 PM
@dzaima Nice. I will implement ⊇
 
1:07 PM
Dyalog doesn't have ⊇?
 
@EliasMårtenson it doesn't
 
What does "extended dyalog apl" mean?
 
@EliasMårtenson this thing
 
I see.
Thanks.
 
(i guess i didn't make it clear that it's an extension not in any "major" impl. regardless, it's pretty useful)
 
1:14 PM
I note it's implemented in terms of ⍤. I guess I better get that one working so I can use it :-)
 
ngn
@EliasMårtenson "dyalog extended" has nothing to do with dyalog (the company). it's adam's source-to-source golfing transpiler running on top of dyalog (the software).
 
@EliasMårtenson there are alternate ways to implement it than the one. It should be pretty trivial to implement in kotlin
 
@dzaima Yes, but first I need to fully understand precisely how it works.
Is there a spec somewhere?
 
@EliasMårtenson there's a complete definition as ⌷⍨∘⊂⍨ (but that doesn't work in your impl). Regardless, there's a pretty trivial alternative - {x←⍵ ⋄ {(⊂⍵)⊃x}¨⍺}
(also fwiw your is "wrong" - 1⌷"ab" "cd" is "cd" whereas it should be ⊂"cd" (as does more than just get a single element))
 
ngn
@EliasMårtenson you could still allow them to be keyed on anything, and use ⊃map[⊂"key1" "key2"] for a lookup with a non-scalar key
 
1:29 PM
@ngn that'd mean that the 99% usage-case looks like ⊃map[⊂"key"] though
 
ngn
@dzaima yes, unfortunately, though it would be consistent with ⍴a[i] ←→ ⍴i
@dzaima map.key could be syntax sugar for that
 
2:07 PM
OK, I implemented it. It turned out I could do it fully on the library side.
By the way, my implementation is basically the one you posted, but the following gives me an error. Is it supposed to work?
2 ⊇ 100+⍳100
I have to do (,2) ⊇ 100+⍳100
 
@EliasMårtenson it is supposed to work, and I have no clue why 2{x←⍵ ⋄ {(⊂⍵)⊃x}¨⍺}100+⍳100 doesn't
ah, (⊂⍬)⊃2 should work but doesn't
also ⊢¨1 (with any arbitrary function in place of ) should work but doesn't
 
Wait what?
Argh
OK, back to the drawing board
 
@EliasMårtenson since 1≡⊂1, ⊢¨1⊢¨⊂1⊂⊢1
i believe the solution to many things should be somewhat simple - make valueAt(0) on a simple scalar return itself (iirc)
 
OK, I have an explicit test case for scalar arguments to 2-arg invocations of EACH, but not for one-arg. And that's the one that fails... I've added the appropriate tests now.
Just look at this crap, I try to be thorough, but miss the obvious one: github.com/lokedhs/array/blob/master/array/src/commonTest/…
OK, fixed. And now the example worked.
@dzaima Thank you for your help catching that annoying bug.
So sloppy of me.
 
 
1 hour later…
3:27 PM
@EliasMårtenson (⊂,1) ≡ ,¨1 should be true, but is not
(similarly for the dyadic case, (⊂1 1) ≡ 1,¨1 should be 1)
(and fwiw, TIOs dzaima/APL also has both of those bugs. they've been fixed since, but TIO is kind of frozen in the past. so you're not alone in messing it up :p)
 
@dzaima It used to. However, I wanted to make it explicit since it was otherwise easy to accidentally write code that caused infinite loops when resolving deferred values.
@dzaima I've fixed this one
@dzaima And now I've fixed this one too.
Thank you for all your help, without it there would have been much more bugs. :-)
 
4:30 PM
Hi folks, I'm trying to get around "big data" problem. I have (for now) 5GB JSON array that I need to preprocess before using it in queries. (In the full problem there are easily around 30x5 of these 5GB files, each of which is a "wave + datapoint" combination, so I'm definitely looking for somehow compressing and preprocessing the data as much as possible.)

I've tried the naive approach of making MAXWS=12G and just trying to

raw←80 ¯1 ⎕MAP 'path.json'
json←⎕JSON raw

with hope of perhaps ⎕MPUTing it later in a more efficient data representation, but that JSON parsing step already gives m
 
@MartinJaniczek it should work (as long as you're careful to not keep all the loaded objects in RAM at the same time), if you can work out a good way to read the file line-by-line
 
4:49 PM
@Adám Are there any good examples for the usage of TCPSocket?
 
ngn
5:08 PM
@MartinJaniczek are you solving a real-world problem? can i see your test data?
 
yeah, I can give you the first 3 lines of the 5GB file ... 283KB :) give me a sec.
 
ngn
@MartinJaniczek thanks
 
it's mostly a bitset inside each of the objects, so I'm hopeful that holding a vector of list keys and then some corresponding bool matrix / list of bool vectors would lend savings
Right now I'm solving how to (outside APL) split the 5GB JSON array into "object-per-line" file. Then awk '{ print length }' file.txt works pretty well it seems, and that could give me a way to feed offsets to ⎕MAP since I can't do 80 ¯1 ¯1⎕MAP to read a vector of lines
 
ngn
5:23 PM
@MartinJaniczek i replicated that to 52 lines for ~5MB. do you have an apl program that parses that to a tree? i'd like to compare performance against my k.
 
@ngn Yeah a moment please
 
ngn
no rush
 
I have a question about syntax: If you have an Agh train and another function f, and you want (Agh)f (apply f, then apply Agh), is there a simpler syntax than using parentheses around Agh or doing Ag(hf)? E.g.(6∧somefunction)(0,∘⌽∘⍉⍣16⊢)
 
ngn
@user if Agh and f are applied monadically: A g∘h f
 
@ngn That makes sense, thanks!
 
ngn
5:38 PM
@ngn actually, it should work for dyadic f too
 
Nice!
 
@user alternatively, (Agh)f is equal to A g h⍤f for both monadic and dyadic
 
@dzaima That's also a byte shorter, but because of the structure of f, it seems to be getting parsed differently and throwing an error.
 
@Konrad'Unrooted'Klawikowski 7 pm GMT or a bit later should fit me well.
@Konrad'Unrooted'Klawikowski This might work, even if slightly out of date.
 
ngn
@user (0,∘⌽∘⍉⍣16⊢) -> (⍉0,⌽)⍣16
 
5:46 PM
@ngn Oh cool, that'll make A g∘h f work!
 
@MartinJaniczek Yes it does, just use ⎕JSON⍠'M'
 
@ngn Sadly, the train doesn't work for my specific use case, but thank you for your help, this'll be very useful in the future
 
Cant' say I'm proud of this mess: AoC Day 19 - gist.github.com/xpqz/8520ca9791343763e10dd669fce64afb
At least a solid regex workout.
 
@ngn I'm having trouble generalizing my code to work with multiple lines. This is the best I have so far is.gd/mjlines
vals should be a bool vector of 7036 items
 
ngn
@user what's the larger context? maybe i can make it work
 
5:58 PM
@ngn I'm trying to improve this answer. It's pretty golfed already, but I wanted to make it a train. Can't crack 27 bytes though.
 
ngn
@xpqz i should study your algorithm. mine is recursive, slow and stupid.
@user oh, that's "extended". nevermind then.
 
@ngn mine is at least fast, but taking some data-related liberties in part 2.
 
That's too bad. Thanks for offering to help, though
 
I have {({6::0 ⋄ ⍺.data.core.q1_2015⍎⍵})¨bitfields}¨jsondata, trying to return 0 for a single element computation if the hydrant expresson gives VALUE ERROR. I'm not getting VALUE ERROR anymore but I'm also only getting 0s out (there should have been some 1s, ie. results of the hydrant expression). Am I applying the error guard in a wrong way?
 
@MartinJaniczek you're always calling the inner dfn monadically, but using both and
 
6:09 PM
Is there a way for ⎕R to do multiple pattern replacements?
p1 p2 p3 p4 ⎕R r1 r2 r3 r4 ⊢ data ⍝ This does not work!
and have p1 be replaced by r1, p2 by r2 etc.
 
@xpqz that should work. (make sure all p_ and r_ are character vectors and not single characters)
 
Ah, maybe that was my mistake, actually.
That observation should simplify my AoC d19 considerably.
 
@dzaima Thanks, indeed got them tangled up. {⍵.data.core.q1_2015{6::0 ⋄ ⍺⍎⍵}¨bitfields}¨jsondata works
 
ngn
oh crap, my json parsing is 10x slower (it builds a tree, not a table)
 
-rw-r--r--   6880 small_bits.aplarray
-rw-r--r-- 288864 small_split.json
sweet
I'm only worried that I'll have to know all field names in advance, or somehow retrospectively add 0s to all already-saved rows...
 
ngn
6:25 PM
@ngn .. and i didn't think i'd ever hit the limit of 1<<16 symbols, but for this file i had to raise it manually
 
@ngn interning strings or something like that?
 
ngn
@MartinJaniczek yes
"ab" is a string in k, `ab is a symbol (scalar, fast comparisons)
json object keys are parsed as symbols. you have many distinct keys.
also, i parse all json numbers as double-precision floating point, so they take up their own chunk of memory with a header, refcounting and everything
 
ngn
6:43 PM
@MartinJaniczek if i disable the interning and just keep the strings as keys, it's super-fast! (~1s for the whole file)
who says 3-letter identifiers aren't better? :) i can set things up so those don't need interning
 
6:59 PM
I'm measuring this is.gd/mjbatch from the "outside" (time dyalog -script parse_batch.dyalog) for a 5MB (52 lines) file too and getting 3.6s runtime. (Is there a way to measure a single run of a multi-line / diamond-containing program? I was thinking about ⎕PROFILE but it probably skews the results)
 
ngn
@MartinJaniczek i get ~5s for dyalog on my (slow) computer. but it's still not fair - ⎕json doesn't build a tree.
 
Does it not though? (I'm not using the 'M' variant)
 
@MartinJaniczek ]runtime "expression"
 
ngn
@MartinJaniczek ah..
@MartinJaniczek it does, it prints #.[JSON object]-s
@MartinJaniczek you can still use time and -script with -s, e.g. see the first few lines in git.sr.ht/~ngn/a/tree/master/item/01.dyalog
 
@ngn (no output)
 
ngn
7:06 PM
@DyalogAPL shut up
 
yeah the time and -script approach has no problems with multiline files... I was thinking I could get rid of some initialization costs by measuring inside a session though
Anyways now I'm thinking about trying to do the same thing with the 'M' variant. Here we go again, depth vectors :D
is there a way to destructure this in one go?
n←fst[;1]
v←fst[;2]
t←fst[;3]
 
ngn
@MartinJaniczek n v t←↓⍉fst[;1 2 3]
 
(↑ [;1 2 3] not needed if you're destructuring all columns)
 
7:21 PM
looks like loading all of them without [;1 2 3] and just never using d is sliiightly faster, but basically negligible
 
ngn
they should have made it return an inverted table
the matrix prevents tight packing of narrow types
 
7:59 PM
Any ideas as to why ⊃∪/ isn't enough to give me an unique vector? ∪⊃∪/ gives slightly less results
 
ngn
8:15 PM
@MartinJaniczek because ⍺∪⍵ preserves duplicates in
 
@Razetime No, it has been superseded by Conga.
 
ngn
@MartinJaniczek so if the first "set" contains duplicates, they'll remain in the result from ⊃∪/
 
Ah, in that case it might be better for me to do ∪,↑ instead
 
ngn
@MartinJaniczek either that or ∪∊
@Adám what do you think about inverted tables?
 
ngn
8:33 PM
≤3letter identifiers are now officially faster in ngn/k :)
 
I have an issue where I have n objects with sparse fields, ie. one might have a,b,c, another b,d, another b,c,d,e and so on (each field value being a bool). I've found a superset of all the fields names, but now when trying to make a bool vector for each object (either the 0/1 value if found, or 0 if not present at all) I realized this approach will do a bunch of searches. Is there a way to go about it so that I can somehow reuse the bool vectors in the objects? Some kind of grading?
:56487904 The ⎕JSON⍠'M' approach gives me a list of field names and a corresponding list of values. Those are obviously sorted wrt each other, but not wrt the union of fields across all objects
I wonder whether I can somehow think about this as a "set membership" problem. Each object would be reduced to the fields that were 1 (the vector of values could be discarded after that)... and then ... something something outer product with the union of all fields?
 
ngn
8:51 PM
@MartinJaniczek so, for [{"a":0,"b":1},{"b":2,"c":3}] you want to get something like ↑(1 1 0)(0 1 1)?
 
the field values will be 0/1, so let's say for [{"a":0,"b":1},{"b":0,"c":1}] I want to get 2 3⍴0 1 0 0 0 1
 
ngn
ah ok, understood
 
"present and 0" = same meaning as "not present"
the non-matrix approach did this with {6::0 ⋄ ⍺⍎⍵} but I think I should somehow use the fact that I already have semi-prepared columns in the matrix, instead of searching for each field from the union from scratch
 
I'm struggling to remove this outer dfn and replace it with a tacit definition: {⊃⍒{+/(2∘⊥⍣¯1)(2*32)∘|⍵}¨⍵}⊃⊢, any tips?
 
@ngn Good idea. I'll take it up.
@KamilaSzewczyk ⊃⍤⍒(+/2(⊥⍣¯1)(2*32)|⊢)¨?
 
9:02 PM
so much smaller, but it doesn't work
 
ngn
@KamilaSzewczyk any tests?
 
@KamilaSzewczyk Try it online!
 
hm, now it seems okay
is there a tool for APL like there is for J to suggest tacit definitions?
 
@KamilaSzewczyk No, but you can follow the instructions here or the lesson here.
@Konrad'Unrooted'Klawikowski Ready?
 
9:07 PM
I already checked out the second link, thanks anyways
 
ngn
@KamilaSzewczyk simpler: {⊃⍒+⌿(32⍴2)⊤⍵}⊃⊢
 
@KamilaSzewczyk I use this hacky template to alow the f← to be outside TIO's Code block.
@ngn @KamilaSzewczyk Even shorter: {⊃⍒+⌿⍵⊤⍨32⍴2}⊃⊢
 
ngn
@Adám right, i forgot ⍨ but the [ ] lose a byte
 
@ngn Right. Fixed.
 
ngn
@Adám you fix faster than i can type :)
 
9:17 PM
That's how a I feel about dzaima.
 
Ha! ↑{bitfields ∊ ⍵}¨ {((⍵[;2] ≡¨ 1) ∧ ⍵[;1]∊bitfields) / ⍵[;1]}¨ jsondata No idea if it's correct (there are 1s inside though, so there's hope) but finally something at least has the right shape I'd expect :)
 
ngn
@MartinJaniczek i have this:
_ k v _←↓⍉⎕json⍠'M'⊢'[{"a":0,"b":1},{"b":0,"c":1}]'
v⊆⍨←k⊆⍨←≢¨k ⍝ group by object
u←∪⊃,/k ⍝ unique keys
↑v{⍺\⍨∨/u∘.≡⍵}¨k
 
(the matrix approach is 1.2s compared to the 3.6s when parsing into a tree)
@ngn taking a look
 
ngn
@MartinJaniczek note that a+←b (any modified assignment) in dyalog returns b, not the new value of a
 
the snipped you posted - bonkers :)
 
ngn
9:30 PM
@MartinJaniczek i don't like the ¨ in the last line, tbh
⋄≠¨'ab' 'ccd'
 
@ngn SYNTAX ERROR
 
ngn
⋄{≠⍵}¨'ab' 'ccd'
 
@ngn
┌→──────────────┐
│ ┌→──┐ ┌→────┐ │
│ │1 1│ │1 0 1│ │
│ └~──┘ └~────┘ │
└∊──────────────┘
 
ngn
wtf
 
@ngn Old bug, log since fixed.
 
ngn
9:34 PM
ah, good
 
moon-child: you should upgrade your 18.0
 
ngn
@MartinJaniczek i've just realized my ≢¨k on the second line should be ×≢¨k. it doesn't affect this example.
 
@ngn Tweaked that to disregard non-interesting fields:
_ k v t←↓⍉⎕json⍠'M'⊢'[{"a":0,"b":1,"xx":"abcde"},{"b":0,"c":1,"xx":"cdefg"}]'
m←⍸(t=3)∨t=1
k←k[m]
v←v[m]
v⊆⍨←k⊆⍨←≢¨k
u←∪⊃,/k
↑v{⍺\⍨∨/u∘.≡⍵}¨k
 
@MartinJaniczek Press Ctrl+k before posting multiple lines of code.
 
Hm, the × would serve what purpose?
Thanks Adám
Ah, so you're saying "abc": 1 would be problematic.
 
ngn
9:46 PM
@MartinJaniczek if the length of a key is >1 we don't want to mess up the grouping argument of ⊆
@MartinJaniczek yep, i simply forgot to put × in
it's a common pattern, we use it a lot in aoc solutions
i really don't like that last line.. but i must go to bed now
 
The "bad" middle column looks weird
https://dzaima.github.io/paste#0U1AAgXiFbIUyhZJHbRMetU1@1Nv5qG9qVnF@3qPeBeq@6o@6FqlHVyslKlkZ6CglJStZGQKpxBQgXatTrZQEFk5OQRaOVecCG6tQ9qir7VHvCqC52XDW4emPOhcdWpENVVIKsrRj1aOuZh19mNijtoll1Y96d8WAdHSs0C991DFD71Hnwke9W2tBOh9N6XnUNunRlAYcaAIX0BsGCoZAaKBg8GhKE1BHkwGIDRKD8KfU4dY/A@Y2gjaRiiaAXKIAM3WCApL5KBwUPoayJqgpTYlQOikZxkhMgbGgdDJMAKpnCsSHcBY6B4WPoQwcco86uqgXIjMA
@ngn Thanks a lot for the help!
 
@MartinJaniczek how so?
 
both objects have "bad":1 but the column isn't 1 1
 
oh, I thought there was something wrong with the rendering on screen :-)
 

« first day (1424 days earlier)      last day (1231 days later) »