« first day (2094 days earlier)      last day (561 days later) » 

1:24 AM
I am trying to get all values that are greater than five from my 4x4 array. I keep having the same compress(ion) issue.
Contents ← 4 4 ⍴ ⍳16
I have tried: (Contents>5)/⍳⍴Contents and (Contents>5)/Contents. Both yield a "Rank Error"..
 
 
1 hour later…
2:45 AM
Fixed, but not sure if this is the optimal solution: (,Contents > 5) / (,Contents)
 
 
1 hour later…
3:56 AM
Nice. You remembered that `/` takes a vector left argument. We can do a bit of algebraic manipulation and factor out the common parts:
1. Ravel on both arguments can be performed by Over (⍥): `(Contents > 5) /⍥, Contents`
2. Make into a train: `(>∘5 /⍥, ⊢) Contents`, but...
3. Unfortunately, since `/` is both an operator and a function, we have to force it to parse as a function in trains: `(>∘5 ⊢⍤/⍥, ⊢) Contents`
 
 
1 hour later…
5:09 AM
@Adám Interesting. Do you mean effectively (⊃0⍴⊂Y) f Y? Would be interested in some these golfed examples!
 
 
8 hours later…
1:05 PM
Hi folks, I'm new to APL. Could one of you point to a good learning resource for APL? Video tutorials would be awesome. I would love to dive into it.
 
1:18 PM
@roshankar Welcome! Try aplwiki.com/wiki/Learning_resources for some good video and other resources, especially these aplwiki.com/wiki/APL_Quest
 
2:14 PM
@roshankar I recommend xpqz.github.io/learnapl -- disclaimer: author
Not a video, mind.
 
 
2 hours later…
4:39 PM
Quick question: What is the expression here doing 10 (0 ↑⍨⊣) ⍳4? I'm trying to find out what ⍨ is really doing here. I am trying to generate n number of 0s. I could just type 10 ↑ 0 and arrive at a very trivial solution.
The expression (⍳7, 0) should be giving me: (1, 2, 3, 4, 5, 6, 7, 0).. It is giving me blank lines on TryAPL :(
 
@ArbIn a f⍨ b is b f a; so there it's 0 ↑⍨ 1010↑0
@ArbIn that's ⍳(7,0), which creates a 7×0 matrix; you want (⍳7),0
 
4:55 PM
@dzaima ahh.. thanks! Some small error like parends makes such a big difference.
 
 
3 hours later…
7:55 PM
I put together a couple of pythagorean theorems individually: {3, 4, ⍵*0.5} (3((2*⍨⊣)+(2*⍨⊢))4), and {5, 12, ⍵*0.5} (5((2*⍨⊣)+(2*⍨⊢))12). I wonder if there is a way to append these to an outer table with different combinations (I was looking specifically at the subset of numbers from iota 2--1 to 2). I have tried {⍵ * 0.5} (⍳2((2*⍨⊣)∘.+(2*⍨⊢))⍳2) but this was not what I was looking for. Any help is greatly appreciated.
 

« first day (2094 days earlier)      last day (561 days later) »