« first day (1473 days earlier)      last day (1182 days later) » 

3:03 AM
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.
 
3:23 AM
@Marshall Thanks.
 
3:59 AM
<moon-child> anybody have thoughts on a good glyph for a cap (as in capped forks)?
<moon-child> overstruck ⊣ seems appropriate, but I don't think unicode has it
<moon-child> (or crossed out|inverted ⊣, indicating the absence of a left argument. Maybe there should be a colourapl a la colorforth.github.io)
 
4:12 AM
@DyalogAPL you mean a monadic fork right
hmm
 
<moon-child> @Razetime yeah, like jsoftware.com/help/dictionary/d502.htm
<moon-child> there are ⍅ and ⍡, which are somewhat warm, so I'm holding out hope
<moon-child> actually ⍆ might be good, showing the (uni-directional) direction of application
 
does look good, but it's very detailed
 
 
2 hours later…
6:38 AM
50 rep for the shortest APL answer on this by 13 Feb 12PM IST
 
7:32 AM
<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
 
 
1 hour later…
8:52 AM
@DyalogAPL razetime.github.io/APLgolf/… this was my original attempt, pretty similar
maybe k is just more optimized for it
 
9:08 AM
<kritixilithos> @razetime, can you shorten ⍸¨↓⍵∘.=⍺? what about (⊂⍬)? try also for ⍸~(≢⍺)↑⍸⍣¯1
<kritixilithos> @razetime what apl does that website run - extended?
 
9:30 AM
okay, i'm finished with my load balancer for isolates
bal←{{(¯1↓0,+\⍵)+⍳¨⍵}⍣(⍺>0)⊢(1↓q),⍨(⍵-+/q)+⊃q←(|⍺){+/↑(⍺⍴⌈⍺÷⍨≢⍵){(-⍺)↑¨↑∘⍵¨+\⍺}⍵,(⍺-⍺|≢⍵)⍴0}({⍵↓⍨-⊥⍨0=⍵}(⌊⊢+2÷⍨0.5≠2|⊢)⍵×⌽v÷+/v←⍺⍺¨⍳⍵)}
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
      ¯4(×⍨bal)16
7 5 3 1
      4(×⍨bal)16
┌─────────────┬────────────┬────────┬──┐
│1 2 3 4 5 6 7│8 9 10 11 12│13 14 15│16│
└─────────────┴────────────┴────────┴──┘
i used it with my PE72 solution:
* Benchmarking "+/{_←'pco'⎕cy'dfns'⋄+/{⍵××/(1-1÷⊢)¨∪3pco⍵}¨⍵}IÏ 1+16(×⍨bal)999999"
             (ms)
 CPU (avg):  1256
 Elapsed:    8677
 
@DyalogAPL you can choose from 17, 18, dzaima, extended in the options
@DyalogAPL I'm not sure how to shorten those yet
If I have any more ideas I'll post links
 
 
2 hours later…
11:31 AM
It's a bit hard to find where to split on for explanations.
 
12:04 PM
APLgolf now has a simple explanation assistant.
 
1:03 PM
@Razetime nice solution to t square
 
@Razetime ⍸¨↓⍵∘.=⍺⍸¨⍺∘=¨⍵; no need for the after ⍸⍣¯1; in extended (⊂⍬), could be ⍬⊂⍛,
⍸~(≢⍺)↑⍸⍣¯1(⍳≢⍺)~
 
2:08 PM
@dzaima woah
@rak1507 I decided to actually read the question lol
 
lmao
 
@dzaima this saves a ton
@dzaima 43 bytes: {'*'@((⍳≢⍺)~⊃{⍵,⊃⍺/⍨⍺>⊃⌽⍵}/⌽⍬⊂⍛,⍸¨⍺∘=¨⍵)⊢⍺} in extended
not sure what "blank char" suffix is aaaa
 
 
1 hour later…
3:30 PM
@rak1507 why answer in dyalog classic?
 
Oh for some reason it didn't work in extended
Couldn't be bothered figuring out what the issue was
 
3:53 PM
Can someone explain to me why enclose returns an array with shape zilde? (Dyalog APL 18.0)

      m ← ⍳5
      m
1 2 3 4 5
      ⊂m
┌─────────┐
│1 2 3 4 5│
└─────────┘
      ⍴m
5
      ⍴⊂m
sorry for the monospace on the question, never really used SE chat before ^^'
 
It's a scalar
 
@Martmists The result is a scalar. Maybe the APL Wiki page on the concept makes it clearer?
See also bound.
 
but why would it have an empty shape rather than simply a shape of 1
 
@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
@Marshall i've never heard "bound" before. does it come from j?
 
4:05 PM
@ngn Dyalog implementers used it regularly. I think it's an old APL term but I don't know when it originated.
 
ngn
@Marshall maybe it just happens to be the name of an internal function or field with no significance outside of dyalog's implementation?
 
@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.
 
ngn
:)
 
a follow-up question about scalars: How does it decide when to apply certain functions and when to error? i.e. ⍳⊂10 works but ⍳⊂1 2 does not.
 
ngn
@Martmists ⊂10 is the same as 10 but ⊂1 2 is not the same as 1 2
 
4:14 PM
@Martmists ⊂10 doesn't enclose 10
 
@Martmists try ⍳⊂,10
 
Alright, I think I get it
time to overhaul my code again lol
 
ngn
beware of ⍳,10 which will never be fixed
 
⋄ (⍳⍴∘1)¨⍳5
bot is taking the day off?
 
ngn
4:25 PM
@rak1507 could be jewish :)
 
lol
 
@ngn oh no what's wrong with that
@rak1507 use userscript
 
effort
 
      (⍳⍴∘1)¨⍳5
┌─┬─────┬───────┬─────────┬───────────┐
│1│┌───┐│┌─────┐│┌───────┐│┌─────────┐│
│ ││1 1│││1 1 1│││1 1 1 1│││1 1 1 1 1││
│ │└───┘│└─────┘│└───────┘│└─────────┘│
└─┴─────┴───────┴─────────┴───────────┘
 
It's more profound with ⎕IO←0
      (⍳⍴∘1)¨⍳5
┌──┬─┬─────┬───────┬─────────┐
│┌┐│0│┌───┐│┌─────┐│┌───────┐│
││││ ││0 0│││0 0 0│││0 0 0 0││
│└┘│ │└───┘│└─────┘│└───────┘│
└──┴─┴─────┴───────┴─────────┘
 
4:27 PM
yay userscript
 
ngn
@Razetime it should return the of what ⍳10 returns
 
@ngn oh that does make sense
 
 
1 hour later…
5:37 PM
@Razetime ⍬⊂⍛, do you really need it to be a ⍬? is there anything else that could take its place?
maybe it's worth porting the newer ngn/k solution? idk, feels weird seeing a recursive solution win over in apl
 
 
4 hours later…
9:40 PM
I want to make a function that simply maps a given value a to a given value b, but it needs to be invertible
so when I give it b, it needs to give back a
what is the easiest way to do this?
it doesn't matter what it gives for other outputs that are neither a nor b
 
@rak1507 what are a and b - some values you've chosen? arguments?
 
some values that I've chosen
 
are they arrays? numbers?
 
Ideally it should work for anything, but in particular character vectors
 
this works
@dzaima -2
 
9:45 PM
That's smart, thanks
 
 
1 hour later…
11:11 PM
came up with imo a pretty decent answer to problem 57 (@KamilaSzewczyk) dzaima.github.io/paste#009avftS71e5R71KNRz1dhgaPeuc/…
 
ngn
11:51 PM
@rak1507 challenge: solve #66 without web searching :)
 
Challenge accepted :)
 

« first day (1473 days earlier)      last day (1182 days later) »