« first day (1554 days earlier)      last day (1105 days later) » 

12:30 AM
How come +/ is not done in place for a vector of matrices?
 
 
3 hours later…
3:26 AM
@rak1507 example?
 
4:24 AM
@rak1507 Because the (cumulative) result is a scalar pointer array, while the argument is a vector pointer array.
 
 
5 hours later…
9:50 AM
@Adám not sure why that means it can't be done in place but I'll take your word for it tbh
 
@rak1507 creating the resulting scalar in-place would be bad for memory usage too - you'd have a long tail of unused elements
 
how so?
 
you are storing (mat1 mat2 mat3 mat4 …) as a vector, taking up N bytes, and creating the scalar you get (matRes unused unused unused …)
 
oh right
 
and since you've just done a complicated O(n) reduction, a single constant-size allocation isn't that bad
(the separate matrix additions could be done in-place)
 
 
3 hours later…
12:57 PM
is there a way to do (⊣ f g) (dyadic) using only composition?
⍺ f ⍺ g ⍵
 
No.
There's no way to use the same argument twice.
 
yeah, thought so
 
1:29 PM
if I have a tradfn
∇f
something

can I capture the output somehow?
 
@rak1507 You don't want a return variable?
 
oh, is that done just by doing f←something (no, found it, thanks)
 
Well, something←f but yeah.
 
 
2 hours later…
4:06 PM
0
Q: Solve the Alien Probe puzzle

pxegerIntroduction In this TED-Ed video (which I'd recommend watching first), a puzzle is presented. 27 unit cubes must be painted with one of red, green, or purple on each face, so that they can be reassembled into a large 3x3x3 cube that shows only red on the outside, then a different arrangement tha...

looks very suitable for apl
something like
      {(3/⍵)⍴⊂6⍴0}3
┌───────────┬───────────┬───────────┐
│0 0 0 0 0 0│0 0 0 0 0 0│0 0 0 0 0 0│
├───────────┼───────────┼───────────┤
│0 0 0 0 0 0│0 0 0 0 0 0│0 0 0 0 0 0│
├───────────┼───────────┼───────────┤
│0 0 0 0 0 0│0 0 0 0 0 0│0 0 0 0 0 0│
└───────────┴───────────┴───────────┘
┌───────────┬───────────┬───────────┐
│0 0 0 0 0 0│0 0 0 0 0 0│0 0 0 0 0 0│
├───────────┼───────────┼───────────┤
│0 0 0 0 0 0│0 0 0 0 0 0│0 0 0 0 0 0│
├───────────┼───────────┼───────────┤
│0 0 0 0 0 0│0 0 0 0 0 0│0 0 0 0 0 0│
might work
but I'm not sure how to paint the faces correctly
 

« first day (1554 days earlier)      last day (1105 days later) »