« first day (664 days earlier)      last day (1980 days later) » 

4:37 AM
@nathanrogers If you want to see the current uses of Key, you should probably read e.cd. If you want to see how I used Key with Depth Vectors, then you can read the Publications section of the README for the "Key to a Data Parallel Compiler." I have an extended version of that paper, but I don't recall whether I have posted a link that one or not.
@nathanrogers I almost certainly have a bug in page 5, but I certainly don't know what it is.
@nathanrogers Are you still having trouble with getting Co-dfns installed or compiled?
 
 
3 hours later…
7:13 AM
Interesting challenge: starting with a depth vector representing a tree where each element is listed in the vector according to a depth-first, pre-order traversal, what is a nice, short way to compute the table showing the distance from each node to every other node in the tree, where distance is the number of edges in the shortest path connecting any given two nodes.
Example Depth vector:
0 1 2 3 1 2 3 3 4 1 2 3 4 5 6 5 5 6 3 4 5 6 5 5 6 3 4
And corresponding distance matrix:
0 1 2 3 1 2 3 3  4 1 2 3 4 5  6 5 5  6 3 4 5  6 5 5  6 3 4
1 0 1 2 2 3 4 4  5 2 3 4 5 6  7 6 6  7 4 5 6  7 6 6  7 4 5
2 1 0 1 3 4 5 5  6 3 4 5 6 7  8 7 7  8 5 6 7  8 7 7  8 5 6
3 2 1 0 4 5 6 6  7 4 5 6 7 8  9 8 8  9 6 7 8  9 8 8  9 6 7
1 2 3 4 0 1 2 2  3 2 3 4 5 6  7 6 6  7 4 5 6  7 6 6  7 4 5
2 3 4 5 1 0 1 1  2 3 4 5 6 7  8 7 7  8 5 6 7  8 7 7  8 5 6
3 4 5 6 2 1 0 2  3 4 5 6 7 8  9 8 8  9 6 7 8  9 8 8  9 6 7
3 4 5 6 2 1 2 0  1 4 5 6 7 8  9 8 8  9 6 7 8  9 8 8  9 6 7
4 5 6 7 3 2 3 1  0 5 6 7 8 9 10 9 9 10 7 8 9 10 9 9 10 7 8
 
 
2 hours later…
9:42 AM
@ngn @pierre @AttilaVrabecz Any idea what version of K this is? {s[x]#(,//y)@<s[x]_sv(s _vs!*/s:^y)x}
 
ngn
@Adám looks like kona/k3
 
 
5 hours later…
ngn
2:23 PM
@arcfide 26 bytes: ∘.(≢∪~∩)⍨⊢↑¨∘↓(⌈⍀∘↑-↑¨⍳∘≢)
 
 
4 hours later…
5:58 PM
@arcfide {∘.(≢∪~∩)⍨∪¨⌊\¨,⍨\⌽⍋⍋⌽⍵}
@ngn ^ can probably be even shorter
Same byte count but looks nicer is {∘.(≢∪~∩)⍨(⌊∘⊃∪⊢)\⌽⍋⍋⌽⍵}
Is ⌽⍋⍋⌽⍵ the breadth-first, post-order traversal? (I'm only guessing the name)
Hmm, looks like it is a breadth-first traversal, and I guessed wrong what pre-order meant
 
ngn
6:23 PM
@H.PWiz oh, 24 bytes, nice! :)
 
 
3 hours later…
9:49 PM
@ngn Thanks. I'd post it if I knew how to use Kona on TIO.
 
 
1 hour later…
ngn
11:04 PM
@Adám which challenge is it a solution to?
 
@ngn
 
ngn
@Adám how do i call it? {...}[order;nestedarray]?
 
@ngn No idea, I guess that or with reversed args.
 
11:19 PM
100000>1.797693135E30
I'm getting domain error
@Adám
 
⎕←100000>1.797693135E30
 
@H.PWiz
0
 
⋄⎕IO←0⋄⎕DIV←1⋄⎕←100000>1.797693135E30
 
@nathanrogers
0
 
X(
in Dyalog this is giving me Domain Error
⎕←100000>1.797693135E308
 
11:21 PM
@nathanrogers 308, not 30!
 
Sorry
⌊/ (0=11○x)/x←1J3 2J3
why doe sthis return 1.797.....
 
⎕←⌊/⍬
 
@H.PWiz
1.797693135E308
 
@nathanrogers Because 0=11○x is 0 so x gets compressed to ⍬ and then ^
 
so how can I only get the smallest of a list or ⍬?
 
11:24 PM
@nathanrogers That's a bit inconsistent.
 
I want the least from a list where the least is a non imaginary number
that is very consistent
if there isn't one, then there isn't one
 
I'm slightly surprised that you can't compare with ⌊/⍬ though
 
@nathanrogers When reducing over an empty vector, APL will attempt at returning the identity element. The identity element is an argument which leaves the other argument unchanged. For min ⍺⌊⍵ it is the greatest representable number.
@H.PWiz It is because of rounding. the 10-digit precision display rounds up beyond max-float, which in turn is an invalid input when ⎕FR=645.
 
how would I express "the min of all items that are not imaginary"?
 
⍞←100000>⌊/⍬
 
11:25 PM
@Adám 0
 
@nathanrogers Like you did, but there aren't any in x!
 
i know that
but 1.77...E308 is also not in my list
 
ngn
⎕←⌊/⍬ ⋄ ⎕pp←34 ⋄ ⎕←⌊/⍬
 
so (⌊/(0=11○x)/x) returning 1.777.... doens't make any sense
 
@ngn
1.797693135E308
1.7976931348623157E308
 
11:27 PM
2 mins ago, by Adám
@nathanrogers When reducing over an empty vector, APL will attempt at returning the identity element. The identity element is an argument which leaves the other argument unchanged. For min ⍺⌊⍵ it is the greatest representable number.
 
I know, so how do I express what I want?
I'm not asking how is ⌊ implemented
I'm asking how to get the result I'm after
 
@nathanrogers What do you want there are none? Really
 
nothing
if there are none, then its an empty list
obv
 
@nathanrogers There is no such thing as "nothing" in APL.
 
nil, nothing , nada
 
11:28 PM
@nathanrogers That is something; a length-0 list.
@nathanrogers Well, there is ⎕NULL, but I wouldn't recommend it.
 
which is what it should be
empty
 
@nathanrogers (∨/b)/⌊/(b←0=11○x)/x←1J3 2J3 would do it. Or ⊃b/⌊/(b←0=11○x)/x←1J3 2J3 if you want to golf.
 
ngn
@DyalogAPL this looks like a bug in dyalog
any arith op with 1.797693135E308 causes a domain error
 
@ngn Why? .48 rounds to .5
 
ngn
on the other hand 1.7976931348623157E308 works
 
11:32 PM
@ngn Yes, that number is beyond the range on a 64-bit float.
@ngn That's less.
 
I think 1.797693135E308 should at least error, before doing anything with it
 
ngn
@Adám ^
 
@H.PWiz It does, no?
 
⎕←1.797693135E308
 
ngn
⎕←1.797693135E308
 
11:33 PM
@H.PWiz
1.797693135E308
@ngn
1.797693135E308
 
lol :)
 
ngn
lol :D
 
We allow you to input and handle DECFs in 64-bit mode, but not do math with them:
⍞←1E1000
 
@Adám 1E1000
 
⎕←2 3⍴1E1000 1E2000
 
11:35 PM
@Adám
1E1000 1E2000 1E1000
1E2000 1E1000 1E2000
 
⎕←1+2 3⍴1E1000 1E2000
 
@Adám
DOMAIN ERROR
 
ngn
@H.PWiz hahah, you're a couple milliseconds faster than me :)
 
I have a question
this is a primitive ray caster
 
@nathanrogers Whoa.
 
11:40 PM
this function is giving me problems
the csting function in particular
ns←⎕NS ⍬
]compile ns cd -af=cpu
cd.∆.Init
cd.∆.(Image Display≢) ray⍬
I'm using codfns like above
there's a bug in the cast function to dtermine which color to show, and I've been staring at it for 2 days
and it's making me nuts
 
@nathanrogers Wait, does it run in normal Dyalog APL (not compiled)?
 
yes
but you need codfns image
to display the result
I believe the sphere and plane detections are working like they're supposed to, I've reviewed them several times, but the sphere is coming back as two colors
 
@nathanrogers OK, but when running in normal Dyalog, can you at least inspect the result and verify that it is as expected?
 
it's a very large result
800x600x3
 
ngn
@Adám ugh. so ⌊/⍬ prints as something that not only doesn't evaluate to its exact self, but causes errors when you do arith on it... that's why i want ngn/k floats to round-trip
 
11:44 PM
at least the output of the Ray function
 
@ngn Welcome to float land!
 
I don't know how to do an isolated test of "cast"
there we go. you can see the sphere should be red, but the top section is green
something is wrong in that cast function expression to determine the color index of the nearest distance found
 
@nathanrogers Maybe scale the whole thing down to 16×12 and hand-check?
 
good idea
didn't think of that :P
Oh
I'm never filtering out the nonzero vlaues
rather, I'm never filtering out the less than zero values
ah! but that gets rid of the plane X(
 
⎕FR←1287⋄⎕PP←34⋄⎕←⌊/⍬
 
11:58 PM
 
@DyalogAPL Hey!
 
⎕←⌊/⍬⊣⎕FR←1287⊣⎕PP←34
 
@Bubbler
9.999999999999999999999999999999999E6144
 
Interesting
 
@Bubbler You can also use a leading to have multiple statements but not output the result of the first:
⋄ a←2 ⋄ b←3 ⋄ ⎕←a+b
 
11:59 PM
@Adám
5
 
Oh thanks
 

« first day (664 days earlier)      last day (1980 days later) »