Can someone explain what precisely is happening with the encoding behavior of box characters here? When I get them from a. by index, 2 2 shapes them correctly. But if copy/paste that output back, I need to shape by 2 6 to get the same result.
Presumably something to do with the number of bytes in the characters, but I don't understand exactly what.
@Jonah J is using control characters to encode box drawing characters. But these characters don't display as boxes in the IDE (because they're not), so it prints out different characters. J string literals are UTF-8, and the actual box drawing characters displayed are three bytes long.
@Marshall "so it prints out different characters" So J is internally doing conversion from control characters representing the boxes to the actual box characters? Where in J does this actually occur? Also your list sentence implies that J strings are basically just byte arrays and not "character aware" -- is that correct?
@Jonah I'm not going to dig through the J source for that conversion—it might even be in the IDE. As for J's relation with Unicode, see u:. It's not good.
<kritixilithos> for this bounty codegolf.stackexchange.com/q/217690, i think a port of chrispn's k answer might prove shorter than the recursive apl one
if i have a function with the O(n^2) complexity, and i want to run it in 4 different threads on the dataset consisting of 30 elements in ascending order with the same gap between them, then
¯4(×⍨bal)30
13 9 5 3
computes the dataset layout, and after i pass a positive core number to bal, then generates indices of element to be passed to the function
@Martmists A shape of 1 (,1 really) indicates that it has one axis of length one, but the result of Enclose doesn't really have any axes.
One strange result you would get if you made it a vector instead of a scalar is that the outer product (⊂'abc') ∘., 'ef' 'ghi' 'jk' would have shape 1 3 (the shapes of the two results together) instead of just 3. So you have this extra axis that appears and can get mixed into other arrays where you don't want it.
@ngn I believe I've seen it in documentation for some old APL dialect, but I have no hope of tracking it down now. In any case, it's featured prominently in my outer product talk so there's some precedence now.