« first day (2263 days earlier)      last day (378 days later) » 

11:24 AM
@B.Wilson what is this used for?
 
 
2 hours later…
1:34 PM
any decent way to tacitly write (XfY)g(YfX)?
I guess there's nothing better than a fork but I don't want to repeat the expression for f
 
2:19 PM
usually, the specific content f and g is required to derive a better expression
if f isn't commutative, is X f Y the complement of Y f X?
but the easy way is just do f←
 
2:49 PM
@RubenVerg No, other than f g f⍨
 
3:00 PM
Welcome to APL Quest 2019-2!* Today's quest is Making the Grade:
> Write a function that, given an array of integer test scores in the inclusive range 0–100, returns an identically-shaped array of the corresponding letter grades according to the table to the left.
Score Letter
Range Grade
0–64 F
65–69 D
70–79 C
80–89 B
90–100 A
 
Just the standard solution...
{'FDCBA'⌷⍨⊂1+65 70 80 90⍸ ⍵}
 
Yeah can't go wrong with that
What's the arbitrary decision you have to make when making this solution?
Hint: it could save you a 1+
 
⎕IO←1
 
wasn't thinking of ⎕IO
more arbitrary than that
 
you could use 0 65 70 80 90 as intervals?
 
3:06 PM
Yeah exactly
And what if you didn't have interval index ⍺⍸⍵?
 
'FDCBA'⌷⍨∘⊂+/⍤≥⍤0 1∘0 65 70 80 90
 
∧\⍵∘.≥
 
ah, didn't think of outer product
 
Yeah that's basically what interval index is as a pattern
+⌿∘.≤
 
@RikedyP better :)
 
3:11 PM
@rabbitgrowth This is outer product for these ranks spelled out using rank, to be fair
Any weird ones? I didn't think of any
 
no, not me. You already forced me to think of another one ;)
 
We run a tight ship around here, gotta crack the whip occasionally
 
As it shoudl be!
 
This one's used an example to contrast with control structures in course.dyalog.com/user-defined-functions/#marking-tests, but obviously there's not much to be gained in APL by doing so
 grades←Grade2 scores;boundaries;score
 boundaries←0 65 70 80 90
 grades←⍬
 :For score :In scores
     :If 90≤score
         grades,←'A'
     :ElseIf 80≤score
         grades,←'B'
     :ElseIf 70≤score
         grades,←'C'
     :ElseIf 65≤score
         grades,←'D'
     :ElseIf 0≤score
         grades,←'F'
     :EndIf
 :EndFor
 
After more than one year resetting my brain not using for-loops and if-then-esle you present this?
 
3:20 PM
hahaha
]runtime -c "Grade 0 64 65 69 70 79 80 89 90 100" "Grade2 0 64 65 69 70 79 80 89 90 100"

Grade 0 64 65 69 70 79 80 89 90 100 → 9.8E¯7 | 0% ⎕⎕⎕
Grade2 0 64 65 69 70 79 80 89 90 100 → 1.2E¯5 | +1071% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
Well anyway, unless anyone else has any urgent pressing matters, I might call it for this one
See you next week for the similarly themed 2019-3 Grade Distribution problems.tryapl.org/psets/2019.html?goto=P3_Grade_Distribution
 
Can I ask antoher not related question? I do not fully understand (the use) of the left argument of ⌸. Can be abnother time also, np
 
it's different in monadic and dyadic case
 
yes exactly. But do not see the added value of the dyadic version
 
I do need to go soon but can do this one quick
It's so you can group by keys which aren't the data
 
But then why should the size of left and roght argument be the same
 
3:25 PM
it's one major cell key in ⍺ for each corresponding major cell in ⍵
apples ← 2 0 1 5 3
groups ← 'AACBC'
total apples in each group
 
ah, ok!
 
hope that makes sense
 
yes ,thanks
 
catch you later, then!
 
@RikedyP {('FDCBA'/⍨¯2-/0 65 70 80 90 101)[1+⍵]}
 
3:32 PM
@rabbitgrowth :) !!
 
 
6 hours later…
9:41 PM
How do I read the contents of a text file into the Ride IDE?
I tried saving a bunch of definitions in a .dyalog file (as suggested by https://course.dyalog.com/Code/), but when I try to load it with
```
]load /Users/lifted/Sources/Dyalog/bio
```
I get the following error
```
*** Could not bring in "/Users/lifted/Sources/Dyalog/bio.dyalog": DOMAIN ERROR
statement not expected at this location
```
 

« first day (2263 days earlier)      last day (378 days later) »