News for hackers. Stuff that matters.
Re:Random walk in 2 lines of J by mgraczyk on Saturday October 15, 2022 @08:50PM (#33220079)
Interesting, but I guess I'd have to learn APL or J to compare. Without understanding what those symbols mean, it seems much less like "math" than the numpy version.

    1 + np.min(np.argwhere(running_sum[1:] == 0), axis=0)
Re:Random walk in 2 lines of J by rak1507 on Saturday October 15, 2022 @08:57PM (#33220128)
⊃ is 'first', ⍸ is where, f⍤g is like function composition, and ⍤1 means apply to each rank 1 (vector), so ⊃⍤⍸⍤1 means 'the first true for each vector'
Re:Random walk in 2 lines of J by mgraczyk on Saturday October 15, 2022 @09:09PM (#33220197)
Interesting, thanks for explaining!