« first day (2200 days earlier)      last day (444 days later) » 

12:06 AM
@gwa000 It looks like a tutorial on using ⎕SM and friends for controlling the CLI windows and stuff. As such, I'm not too surprised it's stripped out of the Windows version.
BTW, if you run )lib you can see a list off all available workspaces sitting under your WSPATH.
 
But ⎕SM does work on Windows.
 
Wow. You're up late!
 
Baby couldn't fall asleep.
 
Interesting. Is it that the CLI version is also available on Windows, or that ⎕SM isn't only useful from the CLI?
 
Neither. ⎕SM opens a terminal-looking GUI window on Windows:
 
12:12 AM
@Adám Deep in the weeds of making fond memories :D Thank you for donating so much of your time to us here.
 
 
Huh. That's quite funk!
 
@B.Wilson I had to wait until I was just over a year before attending my first APL conference. Rosa is definitely coming to one when she's just over 9 months :-)
 
@Adám Nice. So you're planning on attending this year?
 
For sure.
 
12:19 AM
Hoping to meet you and Rosa there :D
 
Oh, you're coming? Nice. It is just 2 km from my home. Oh, and I always want to attend; only missed the last one due to COVID-19.
 
Definitely am planning on attending. That's about 1/4000X the distance from my home :P Getting to see your stomping grounds will be a nice bonus.
 
Ooh, I just notices that the boys have vacation that week, so they can be there too.
 
12:40 AM
On, very nice. You have a large family?
 
Depends where you draw the line on family. We have 3 kids.
 
 
7 hours later…
7:28 AM
d←0 1 2 3 2 2 3 0 1 2 3 4 5 2 1
p⊣2{p[⍵]←⍺[⍺⍸⍵]}/⊢∘⊂⌸d⊣p←⍳≢d
I think I stumbled into Aaron territory.
 
Yes, looks like it.
 
It's actually something I wrote! Vaguely remember reading about this algorithm before knowing APL, and then today it just popped out of my hands naturally :D
Didn't realize I had Aaron-ed until a couple seconds later.
Trying to solve the generalized problem, where depths can increase by arbitrary integer amounts.
There's an ugly linear scan solution to first normalize the depths: ¯1+≢∘∊¨{∪⍺[⍳1+⍺⍸⍵],⍵}⍥,⍨⌿U⌽¨,⍀d. However, I don't like it.
The garbage at the tail is just trying to do a left-associative scan, really.
(Actually, left-associative scan is something I want from time to time. Maybe some primitive that improves this could be on the WANT list?)
 
Yeah, I've been thinking that could be achieved with a left argument to f⍀ specifying direction.
There are 4 scans, right?
(A)(A f B)((A f B) f C)
(A)(A f B)(A f (B f C))
((A f B) f C)(B f C)(C)
(A f (B f C))(B f C)(C)
I guess you could have the reverse of those too.
 
7:45 AM
Yeah, my conceptualization is that Scan has 2 (implicit) parameters at play: associativity and sublist-direction. My naming abilitiy on the latter sucks, but each has 2 options, giving your total of 4 possible combinations.
Given that left-associativity on reductions is simple enough with Reverse and Commute, I feel like the design space permits something that lets us leverage that as well. Maybe?
 
@B.Wilson I'm not sure I follow.
 
Apologies, I'm not being crisp in my expression here. We have the associativity of the (dyadic) function application. In 2 and 4 above, it's right-associative, just like normal APL, with 1 and 3 applying in a left-associative fashion.
 
OK, but that's still the above 4, right?
 
Then 1 and 2 apply to successively longer sublists, while 3 and 4 apply to successively shorter.
 
How about (A)(B f A)(C f B f A)? (both variants)
 
7:55 AM
So yeah, it's exactly your 4 options, but they're parameterized by 2 binary choices.
 
And (C f B f A)(B f A)(A)? (both variants)
And maybe you'd want to get just (A f B) f C without the intermediates?
 
@Adám This is just Under Reverse on your version 4?
 
3/4, yes.
 
@Adám That's just f⍨/∘⌽, no?
Gotta get back to work.
 
@B.Wilson Yes, sure, but you can define all of these in terms of and . The idea here is that you won't need to, and that it can be more efficient not to.
 
8:18 AM
Hrm. I don't think left-associative scan is definable only with Commute and Reverse, right?
My thinking is just that f⍨/⌽A isn't too, bad, but f⍨⌿U⌽¨,⍀A is kind of terrible :P
The latter is especially non-pithy enough that I'd expect real code to employ lots of variations on it.
 
@B.Wilson U is under?
 
Whoops! Yeah.
Feel free to educate me if there are much better approaches than that particular left scan spelling! :D
 
Probably not, other than a state machine.
 
 
4 hours later…
12:09 PM
Both ⎕CT and ⎕DCT work the same way, right? Just the difference in default value and both work for different datatypes... Otherwise, everything is exactly the same?
 
It isn't so much the data type it depends on, as much as it is the current setting of ⎕FR
 
@Adám Yes yes, that's what I meant, apologies. Basically with ⎕FR←1287 and ⎕FR←645 for DCT and CT. Otherwise, do both work the same or is there a difference?
 
Yes, then they are identical.
 
12:45 PM
@Adám Okay! thank you
 
1:00 PM
Welcome to APL Quest 2018-3! Today's quest is Rolling Along:
> Given an integer scalar or vector representing the number of sides on each of a set of dice, return a histogram showing the distribution curve for the possible totals that can be rolled using those dice.
 
{⍺((≢⍵)/'*')}⌸,+/¨⍳⍵
the inefficient solution.
 
Yes, and can you tell me when it gives an error?
 
rank >15
 
Any idea how you might mitigate that? I'll give more time before giving hints / answers
 
I hoped to do something with permutations. But didn't manage to find that
 
1:03 PM
it's more like combinations than permutations, I suppose
 
yes
so something with factorial
 
so dfns cmat is one I think
maybe not, will have to check
in any case, there is a bit of a simpler way
still inefficient, mind you
 
Is it a specificc kind of distribution? I am not aware of that
 
no, but other than "indices", how might you describe what ⍳2 4 3 gives you
well that's misleading - we already said it's "combinations"
so what's a way to get all combinations of two lists of numbers?
 
outer product
 
1:07 PM
indeed - and what are the lists of numbers we need to combine?
 
NUmber of faces of the dice.
 
I maybe wouldn't say the number of faces, but rather the numbers on the faces of each die
 
yes
 
can you give an expression that returns the numbers on the faces of each of our dice?
n_faces ← 2 4 3
numbers ← *expression*
 
⍳¨ 2 4 3
 
1:10 PM
nice
OK last piece before we talk about efficiency. How can get all of the combinations?
Does this still work?
⎕←⍳¨2 4 3
 
@RikedyP
┌───┬───────┬─────┐
│1 2│1 2 3 4│1 2 3│
└───┴───────┴─────┘
 
nice
Of course, you already said we need outer product
 
thnikning about a way to get a left argument to the ∘. using our results above
how about reduce combined with ∘.?
 
that sounds good - want me to type it or you give it a go first?
 
working on it
need some ()'s I gues
I always have a fight with reduce
 
1:17 PM
So when we add two numbers it's (a+b), but for a list (a b c) it's what?
 
+/
but ∘./ does not work
 
So in a way we're looking for what should be instead of the +
 
also (∘.)/
 
1 2 fn 1 2 3 4
 
∘.,
 
1:18 PM
very close!
ok Stefan just giving it away :P
 
tried ⍥
 
well you were right that we need some parens ()'s
 
indeed ∘.,/⍳¨ 3 2 4
 
yeah, the slash / binds to the comma , before the outer product ∘.F
⎕←(∘.,)/⍳¨3 2 4
 
@RikedyP
┌─────────────────────────┐
│┌─────┬─────┬─────┬─────┐│
││1 1 1│1 1 2│1 1 3│1 1 4││
│├─────┼─────┼─────┼─────┤│
││1 2 1│1 2 2│1 2 3│1 2 4││
│└─────┴─────┴─────┴─────┘│
│┌─────┬─────┬─────┬─────┐│
││2 1 1│2 1 2│2 1 3│2 1 4││
│├─────┼─────┼─────┼─────┤│
││2 2 1│2 2 2│2 2 3│2 2 4││
│└─────┴─────┴─────┴─────┘│
│┌─────┬─────┬─────┬─────┐│
││3 1 1│3 1 2│3 1 3│3 1 4││
│├─────┼─────┼─────┼─────┤│
││3 2 1│3 2 2│3 2 3│3 2 4││
│└─────┴─────┴─────┴─────┘│
└─────────────────────────┘
 
1:22 PM
why isn't it working without ,
 
because outer product on its own is just an operator, it needs to be used with a function
in this case, we are using catenate ⍺,⍵
it could be another function, like join/strand
⎕←(∘.{⍺⍵})/⍳¨3 2
 
@RikedyP
┌─────────┐
│┌───┬───┐│
││1 1│1 2││
│├───┼───┤│
││2 1│2 2││
│├───┼───┤│
││3 1│3 2││
│└───┴───┘│
└─────────┘
 
which in this case is the same because we are joining scalars
 
but / is the function
 
no / is the reduce operator
 
1:24 PM
ah yes !!!
thanks
 
good
but...
can you tell me what is wrong with (∘.,)/⍳¨ ?
we are almost there
 
missing the '+'
 
Needs disclosing
 
a bit of this, a little of that
very good, both of you, but not exactly what I was looking for
it will also fail on some input
 
Scalar
 
1:28 PM
probably, but also not what I was looking for
 
what is the rank of an outer product in terms of the ranks of the arguments?
 
no seems to work with scalar
 
@RikedyP ravel
 
+1 for @xpqz, @Richard can you see where to put it? And also why it is needed?
 
⊃(,∘.,)/⍳¨2 4 3
 
1:31 PM
@Adám the rank is the amount of arguments in this case
so the sum of the rank of both arguments
 
yes
so when does this become problem?
 
if we want to do another +/ for example
 
not exactly, we're still talking about the expression to get combinations
 
You can still outrank Dyalog this way.
 
You need a vector of combinations
but that's not what you mean?
 
1:36 PM
We talked about this the other day, infact.
 
well it's also the same issue that @Richard's original solution has
 
⎕←1+(,⌿⊢⊤∘⍳×/) 2 4 3
 
⎕←⊃(∘.,)/⍳¨2 2
 
@RikedyP
┌───┬───┐
│1 1│1 2│
├───┼───┤
│2 1│2 2│
└───┴───┘
 
⎕←⊃(∘.,)/⍳¨2 2 2
 
1:37 PM
@RikedyP
┌─────┬─────┐
│1 1 1│1 1 2│
├─────┼─────┤
│1 2 1│1 2 2│
└─────┴─────┘
┌─────┬─────┐
│2 1 1│2 1 2│
├─────┼─────┤
│2 2 1│2 2 2│
└─────┴─────┘
@xpqz
┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐
│1 1 2│1 1 3│1 2 1│1 2 2│1 2 3│1 3 1│1 3 2│1 3 3│1 4 1│1 4 2│1 4 3│2 1 1│2 1 2│2 1 3│2 2 1│2 2 2│2 2 3│2 3 1│2 3 2│2 3 3│2 4 1│2 4 2│2 4 3│1 1 1│
└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘
 
@RikedyP The validator doesn't like me, but I think this hits the spec: {(∪s),('*'⍴⍨⊢∘≢)⌸s←+/¨1+⍵∘⊤¨⍳×/⍵}
 
It probably wants a different ordering.
 
@B.Wilson smells like ⎕IO
 
No, it's ⎕IO 1. But the "first" throw is last in the list.
 
Bah. ⎕IO←1 is objectively wrong :P
 
1:39 PM
@xpqz both
no not both
 
Don't you need to sort each throw, too
1 2 1 ←→ 2 1 1
 
actually maybe both
 
Actually, we're only doing sums, not permutations.
 
yeah it's just the use of encode with iota still requires ⎕IO←0
@Richard are you happy you understand the issue with the outer product catenate to get combinations?
 
@B.Wilson "That would be an ecumenical matter" as Father Ted said.
 
1:43 PM
{(∪s),('*'⍴⍨⊢∘≢)⌸s←(⊂∘⍋⌷⊢)+/¨1+⍵∘⊤¨⍳×/⍵} should be ⎕IO-independent, but still fails validation.
 
:) yes, was already trying other things with it. Thanks!
 
@xpqz :D
I should probably strip DEFAULT_IO from my dyalog.dcfg.
 
@B.Wilson I think it's the key giving back a matrix with spaces in it, rather than a column of vectors?
@Richard The last thing to note, which is already being shown here, is the relationship between indices of a multidimensional array (in ⎕IO←0) and the use of encode ⍺⊤⍵ and decode ⍺⊥⍵
@B.Wilson check with ]box on
 
What does ⎕IO look like in the wild? Do most people just go with the default? IIRC, I've seen a few papers that specify ⎕IO←0 in the beginning.
 
@B.Wilson it does not return a two-column matrix
@B.Wilson I think most commercial applications use default, and then people specify in the code if they are doing something different (rather than using DEFAULT_IO), but that's my hunch I don't actually know
 
1:50 PM
@B.Wilson Most nuskool APLers (like most here, I suspect) are team 0, is my perception.
Aaron Hsu seems to be Team 0, too.
 
@RikedyP It's an 11 7 matrix, as per the spec, no?
 
@B.Wilson "The histogram is a 2-column matrix..."
 
Oh. RTFM!
 
Arguably, your interpretation is better.
Certainly looks better with ]box on.
 
Right? Just puts a nice box around it, like you want :)
 
1:54 PM
@RikedyP I'll have to figure that out, yet.
 
@Richard yeah have a play - I'll also try to dig out Aaron's blog post about it if that still exists
Here's one more that @Adám prepared earlier:
{{⍺('*'⍨¨⍵)}⌸+⌿(1+⊢⊤¯1+∘⍳×/)⍵}
same deal, but maybe @B.Wilson notice the lack of each on encode
⎕←¯1+⍳2 3
 
@RikedyP
┌───┬───┬───┐
│0 0│0 1│0 2│
├───┼───┼───┤
│1 0│1 1│1 2│
└───┴───┴───┘
 
⎕←2 3⊤¯1+⍳6
 
@RikedyP
0 0 0 1 1 1
0 1 2 0 1 2
 
1:59 PM
@RikedyP thanks
 
Unless there are any other questions, I think that's it for today. Thanks everyone for participating
See you next week for What's Your Sign?
 
@RikedyP Yeeeahhh. Must better. I always feel slightly dirty using Each. Adám always ends up showing something tighter :)
 
@B.Wilson there's often another way, especially with these types of problems
 
Heh, t-shirt/pin badge idea: I program without ¨
 
2:17 PM
Maybe ,⍳ could be an optimised idiom that bypasses the problem of maxrank in the future.
 
2:43 PM
@RikedyP was it Scholes who wrote parse and kk in dfns? dfns.dyalog.com/n_parse.htm
 
@xpqz That's dangerous. One thing is avoiding a WS FULL from ↓⍉↑ but surely splitting code up should give the same qualitative result.
 
@Adám You mean the fact that ,⍳⍳16 would work but ⍳⍳16 would crash?
I agree that might be confusing.
 
No, that ,⍳⍳16 would work but ,⊢⍳⍳16 or ,(⍳⍳16) would crash
Or that ,⍳⍳16 would work but I←,⍳ ⋄ I⍳16 would crash.
Difference being that my expressions are entirely equivalent.
token-by-token tracing could crash too.
 
3:01 PM
A valid point well made. I do think though it's a reasonably common thing to want to do, and that whilst ,⌿⊢⊤∘⍳×/ is a clever solution, ,⍳X I'd wager is the natural spelling most would arrive at.
 
⊢⊤∘⍳×/ should be what you're after to stay flat, so maybe ↑,⍳
But note the "bug" in ↑,⍳X if X has only one element.
So, really it should be ↑,,¨⍳X at which point you might as well write X⊤⍳×/X
 
 
1 hour later…
4:19 PM
0
Q: Why am I getting intermittent DELETE PENDING errors in Dyalog APL?

Albert WifstrandI'm getting DELETE PENDING errors intermittently when my program deletes a file and then quickly thereafter creates a new file with the same path as the deleted file. In the Dyalog APL session window, it's reported as FILE ACCESS ERROR. I can re-create the error with Dyalog APL 16.0.35389.0 32 Cl...

 

« first day (2200 days earlier)      last day (444 days later) »