« first day (1895 days earlier)      last day (1056 days later) » 

04:09
Would ⊢⊂⍤⊢⌸⍨⊢|⍤-⍳⍤≢ be a good overall solution?
⋄ (⊢⊂⍤⊢⌸⍨⊢|⍤-⍳⍤≢) 2 5 3 1 4 6
@rabbitgrowth
┌───┬───┬───┐
│2 4│5 1│3 6│
└───┴───┴───┘
The top J solution is 3 bytes shorter, but I'm not sure how comparable that is
04:41
guys what is the shortest method to generate all permutations of ⍳3?
04:52
nvm found that in APLcart
 
3 hours later…
07:40
⌽⍤0 1⍨ ⍳3 technically contains all permutations :)
 
3 hours later…
10:45
@compiledweird Hi there. Interested in APL?
 
4 hours later…
15:02
⋄ {(⍳⍵)(,[⍳2](⊢,⍤1 0~)⍤1)⍣⍵⍉⍪⍬}3
@LdBeth
1 2 3
1 3 2
2 1 3
2 3 1
3 1 2
3 2 1
 
6 hours later…
21:17
Is there a better method to matching parentheses than ⋄ ((0<|)ׯ1∘=++\)0 1 1 ¯1 ¯1?
@LdBeth 0 1 2 2 1
(0<|) can be 0∘≠
21:40
thanks.
but how do I have 1 1 2 2 instead of 1 1 1 1 from 1 ¯1 1 ¯1?
so you want a separate number for each matching parenthesis pair, not depth?
yes, and if possible get the numbering in ascending order.
aight that'll probably be a decent bit more complicated
⋄ ((0∘≠)ׯ1∘=++⍀) 1 ¯1 2 ¯1 3 4 ¯1 ¯1
@LdBeth 1 1 2 2 4 8 8 7
21:50
what does a number not in ¯1 0 1 mean?
I'm trying to make first 1 a 1, second 1 to 2, third to 3 etc.
i'm working on a way using progressive index of
Like ranking? Double grade up?
@dzaima actually that's way overkill
my problem context is, for a bit string of even length like 101001, and for every possible arrangement of parentheses of the same length, find if the the two bits on matching parentheses are distinct.
21:56
⋄⍋⍋1 ¯1 2 ¯1 3 4 ¯1 ¯1
@doug 5 1 6 2 7 8 3 4
aight this works
coool!
Couldn't you just pick parens for the 1's and then fill in the 0's with the opposite ones? Or are you looking for a predicate?
oh it is more like "two bit strings can be matched together if for any one of possible parentheses arrangement, the parity on each pairing parentheses are same"
so 1111 matches. 1100 with parentheses {}{}
0101 matches 1010 for {{}} or {}{}
22:15
Oh, opposite braces for the same bits on both?
Oh, no. Got it. Matching braces, but the lefts occur on the same bits for both.
lefts and rights. I thought the one implied the other but the first case shows that's not the case.
no, it's more complex than that, the full problem context is this challenge codegolf.stackexchange.com/questions/229334/…
Thanks for the reference. I was still confused...
> Brackets corresponds to 2's and 3's. For matching brackets, if they are [ ]0 then they correspond to the same color, and different colors if they are [ ]1.
But the left brackets are the same for both types...
You could number them but only after finding the matching brackets.
22:32
yes that's why I ask for a method to match parentheses
The presentation is a little confusing. He sets it up describing how to get a coloring from a chromogram and then immediately changes the frame of reference to getting a chromogram from a coloring. I think I get the problem now, though.
22:46
Hi, if I do something like: (⍳ 5) + ⍳ 5
does APL make the two arrays and then add them or does it actually just work with one pair of elements at a time?
I'm asking because if instead of 5 we have a large number N than memory scales with N
It makes two arrays.if you want the later, do +⍨⍤0⊢⍳5
And if you are working on dataset larger than memory, there is component file feature that can operate on arrays saved on harddisk.
@olabaz memory will always scale with array size (this technically depends on the implementation, but most work like this, including Dyalog)
I see, thanks

« first day (1895 days earlier)      last day (1056 days later) »