« first day (2571 days earlier)      last day (76 days later) » 

 
1 hour later…
11:58 AM
I added search functionality to Ominbar
also moved it to omnibar.rubenverg.com (old link might still work)
search is fun, I can now ask questions like "what's in Vision that isn't in Extended?"
hmm, looks like it doesn't work well though
i hate making manual parsers :\ tried a combinator parser library but must've gotten something wrong
could somebody help me figure out what's wrong? code is in query.ts
my goal was to port this haskell code which as far as I can tell is correct
but clearly either I got it wrong or I'm using the library wrong
 
1:00 PM
Welcome to APL Quest, 2023-6! Today's quest is Key/Value Pairs:
> Write a function that:
• takes a 2-element character vector left argument where the first element represents the separator character between multiple key/value pairs and the second element represents the separator between the key and the value for each pair.
• takes a character vector right argument representing a valid set of key/value pairs (delimited as specified by the left argument).
• returns a 2-column matrix where the first column contains the character vector keys of the key/value pairs and the second column contains the character vector values.
 
With a little cheat:
¯2⍴(∧⌿∘.≠)⊆⊢
 
¯2⍴
 
uses two columns and calculates the necessary rows. Wasn't that a upcoming feature?
 
It is an idea, but not exactly like that. It'd be ¯1 2⍴ or something similar.
 
:) sorry.
Otherwise 2÷⍨≢ for the rows
but had problems inserting this
 
1:04 PM
Right.
Btw, (∧⌿∘.≠) is just ~⍤∊⍨
@Richard Something like (⊢⍴⍨2,⍨2÷⍨≢)~⍤∊⍨⊆⊢
 
What a monster!
 
Yeah, hence the want for an extension to
 
@Adám the number of columns is always 2
 
Yes, hence 2,⍨
 
Why is something like (2 2÷⍨≢)⍴⊢ not working?
 
1:09 PM
1 1≡2 2÷2
 
⍴ sees a function instead of a number?
 
Your lone 2 is on the left instead of the right, and stranding is stronger than function application.
 
@Richard stranding doesn't work like that inside trains
 
oh, that might be - i was thinking you'd get wrong shape with strand binding first
 
with boxing on it gives ((2⍴2)(÷⍨)≢)⍴⊢
(showing trains)
? ⍨
 
1:13 PM
Yeah, that's right, which isn't what you want, right?
 
exactly, but why is it doing that
 
you want to concat the 2 after dividing, which isn't what you've got
 
With the Depth operator we could write ↑⍤⊃(≠⊆⍥1⊢)/⍤,⍥⌽∘⊂ or if you prefer explicit: {↑⊃(≠⊆⍥1⊢)/(⌽⍺),⊂⍵}
 
What?!
oh - think I get that with explicit
I tried with power but can't quite get the shifting {r←⍺ ⋄ ↑{⍵⊆⍨1@1⊢~(⊃r)⍷⍵ ⋄ r∘←1↓r}⍣2⊢⍵}
 
@Silas Basically using a reduction to do {↑⍺[2](≠⊆⊢)¨⍺[1](≠⊆⊢)⍵}
 
1:18 PM
yes - and that's sort of what I'd tried to do with power by shifting ⊃⍺ but not quite there
 
Shoe-horning ⎕CSV to do the job for us: {⎕CSV⍠'Separator'(2⊃⍺)⊢((⎕UCS 13)@(⍺[1]∘=)⍵)'S'}
(Only for basic cases) shoe-horning APL (!) into doing the job: {↑⍎2⌽''')(''',(,¨⍺)⎕R''')(''' ''' '''⍠'Regex' 0⊢⍵}
Anyone unerstand what's happening?
 
no, not me at least
 
Here, let me remove ↑⍎:
      ';='{2⌽''')(''',(,¨⍺)⎕R''')(''' ''' '''⍠'Regex' 0 ⊢⍵}'key1=value1;key2=value2'
('key1' 'value1')('key2' 'value2')
@user1772655 Hi Tammie Wagstaffe. If you want to participate here, please email access@apl.chat
 
ooh, nasty! Think I get that
 
So I replace ; with ')(' and replace = with ' ' and then I put (' at the front and ') at the end.
(note that in the above, the quotes are included in the substitution text)
 
1:29 PM
First time ever seeing ⍠ passing by.
 
Ah, this does the trick without Depth: {⊃(↑≠⊆¨⊢)/(⌽⍺),⊂⊂⍵}
@Richard Yeah it is really useful for making ⎕R be a simple text replacement without fancy regex. (Should have been the default, imo, but whatever).
Ooh, we can use to auto-shape into two columns!
Wanna have a go, or shoud I should how?
Wow, looking at submissions from the Competition. Someone found a shorter way (only 3 characters!) to do ~⍤∊⍨ — I'm duly impressed. Any ideas? It is so short you could brute-force it.
 
looking at it
no, can't find it right now
 
We want windows of size 2, and no overlap, so movement of 2 too.
      {⊂⍵}⌺(⍪2 2)⊢'abcdef'
┌──┬──┬──┐
│ab│cd│ef│
└──┴──┴──┘
      {⍵}⌺(⍪2 2)⊢'abcdef'
ab
cd
ef
      ⊢⌺(⍪2 2)⊢'abcdef'
ab
cd
ef
      ';='(⊢⌺(⍪2 2)~⍤∊⍨⊆⊢)'key1=value1;key2=value2'
┌────┬──────┐
│key1│value1│
├────┼──────┤
│key2│value2│
└────┴──────┘
And I guess nobody found the the 3-char equivalent of ~⍤∊⍨ so I'll give it away: 3=⍳
Why? Because we're looking up every char in the list of separators, of which there are just 2. If the position is 3, then it wasn't found. So thats a ~∊ with the lookup array on the left.
Unfortunately, it ends up being the same length, as we'll have to commute since 3=⊢ isn't a single derived function but rather a 3-train (no pun intended): ⊢⌺(⍪2 2)⊢⊆⍨3=⍳
Anyway, I think we've done this one. See you next week for 2023-7: Let’s Be Rational!
 
 
3 hours later…
4:43 PM
@RubenVerg Huh, splitting primitives on functionality differences doesn't interact very well with search. Like A2~Dy shows Replicate because the APL2 version is an operator. Maybe some primitives could be marked as encompassing others? So Conjugate->Identity, Replicate->Compress, fn Replicate <-> op Replicate.
Using this in a compound search seems slightly tricky; I guess a primitive just counts as every one it encompasses for ~ only. But I don't know if this works well for a~(b~c).
(But I also don't know when you'd use a~(b~c))
 
5:02 PM
@Adám I assume that for the APL challenge you should stick to the functions as suggested in the description?
 

« first day (2571 days earlier)      last day (76 days later) »