I have shiftR function, and I want to apply the shiftR on matrix m1 for each row,
1 shiftR m1
LENGTH ERROR
shiftR[0] shiftR←{len←≢⍵ ⋄ a←(len-⍺)↑⍵ ⋄ (⍺⍴0),a}
∧
1 ∘ shiftR ⌿ m1
SYNTAX ERROR: The function does not take a left argument
1∘shiftR⌿m1
any idea?
(1 ∘ shiftR) m1
LENGTH ERROR
shiftR[0] shiftR←{len←≢⍵ ⋄ a←(len-⍺)↑⍵ ⋄ (⍺⍴0),a}
∧
(1 ∘ shiftR) ⌿ m1
SYNTAX ERROR: The function does not take a left argument
(1∘shiftR)⌿m1
∧
proc2←{
(a b c d)←⍵
range←⊣,⊣-∘(⍳∘|××)-
a=c:mat[a;b range d]+←1
b=d:mat[a range c;b]+←1
⍝ else
(=/|(a-c)(b-d)):mat[a range c;b range d]+←(,⍨⍴1↑⍨1∘+)≢a range c
}
mat←1000 1000⍴0
proc2⍤1⊢Data.input
+/,1<mat
quick and dirty solution for today's :)
Before that, I preprocessed my data to strip , and -->s, and read them up as 2D array.
I'm wondering do you guys use APL/J in your daily to solve practical problem other than solve online coding question?, .. can you share some info.. what tool do you use.. ?
@elliptic00 I use the netpbm command line programs to convert all kinds of image formats from/to the so call PNM format supported by my image processing program
@adr No, they don't share scope, but you're using a monadic operator not a function, and there, ∇ is equivalent to (⍺⍺∇∇) so ∇∇ is a reference to the operator itself, while ∇ is a reference to the function it derives.
Finally cleaned up and commented my solutions so far: https://github.com/rikedyp/Advent-of-Code/tree/main/Y2021 let's see how sustainable it is to keep it going...
For now, I suggest writing to support@dyalog.com and asking about that particular book. The people getting support emails are regularly at the office. Maybe we can, for now, scan it and arrange a video call where you can browse it, or something.
@Adám Nice! Although that "mistake" did cause me to learn a little bit more about rank. Sure, at the moment I am using APL ([April](https://github.com/phantomics/april) specifically) on the advent of code. But last year I taught a small course on image processing using April to middle school students. I'll be teaching it again in February.
@Adám I found a report written by G. Chaitin, when he was working at IBM. He did some computational physics with APL back in the day, and had written that APL is ideal for physics because it's array/matrix oriented. Do you think you could invite him in one of the APL Campfire sessions ?
@Adám I've invited a few of my old profs from the math & physics school at the meetup. Most of them do computational (math/physics) stuff. It'd be nice if I'd get them to try do some of that in APL :)
not sure if they'll show up on a Saturday evening tho, but you never know
@Adám maybe it'd be a good idea to invite this person from the French APL user group too. France is close to Spain, it'd be nice to keep them close :) afapl.asso.fr/topo.pdf
@Adám yes, I have some themes at mind...Was thinking doing a live coding session after the trip back to the history lane, with applications from simple math, to computational math/physics stuff.