« first day (2139 days earlier)      last day (520 days later) » 

5:17 AM
Today's Part 1 +/{((∧/∊⍨)/∨(∧/∊)/){(⊃⍵),(⊃⍵)+⍳-⍨/⍵}¨{⍎¨⍵⊆⍨'-'≠⍵}¨⍵⊆⍨','≠⍵}¨data, Part 2 is almost same except ((∨/∊⍨)/∨(∨/∊)/)
 
 
5 hours later…
10:21 AM
When I first read the Q I copied to from dfns, but then the maths was more to the point for me:
part1←+/((≤⌿b)∧≥⌿t)∨(≥⌿b)∧≤⌿t
part2←+/0≤(⌊⌿t)-⌈⌿b
where b and t are the bottom values and top values from each pair of ranges
 
11:00 AM
my heart still believes part 1 can be made simpler somehow
 
d←⊃⎕NGET('d/4')1⋄(p1 p2)←0
_←{(a b c d)←1⊃'-,'⎕VFI⍵⋄p1+←((a≥c)∧(b≤d))∨(c≥a)∧d≤b⋄p2+←~(a>d)∨c>b}¨d
p1 p2
fugly
 
 
4 hours later…
2:46 PM
+/{((⍵[1]≥⍵[3])∧⍵[2]≤⍵[4]) ∨ (⍵[1]≤⍵[3])∧⍵[2]≥⍵[4]}¨{⍎¨,↑'-'(≠⊆⊢)¨','(≠⊆⊢)⍵}¨⊃⎕nget 'input' 1
but the logic probably can be more efficient
 
3:01 PM
Greetings. In Emacs, do I first need to set up a dyalog session in a separate terminal and then hook into it with Dyalog mode after the fact?
The documentation is a bit unclear.
 
3:27 PM
 +/ ~{(⍵[2]<⍵[3])∨(⍵[1]>⍵[4])}¨{⍎¨,↑'-'(≠⊆⊢)¨','(≠⊆⊢)⍵}¨⊃⎕nget 'input' 1
part 2
 
4:19 PM
@Richard check out ⎕VFI -- quite handy to pick out numbers from strings
 
 
3 hours later…
6:55 PM
Thanks!
 
 
4 hours later…
11:15 PM
@Pythonicator That thing is intended to let you use Emacs as the editor for Dyalog IDE whenever you specify )edit. It does not let you run APL repl inside Emacs like Common Lisp's slime
Actually, I rarely find that feature much useful since the builtin editor of Dyalog RIDE is good enough for me.
 
11:54 PM
Scenario: you have an array of 2 arrays of equal length, and you want to apply a function ```f``` to each pair.
You could save the array as `X` and run `X[1] f¨ X[2]`, but is there a simpler way?
Something like `f?X`, where `?` is a convenient function meaning "take the elements of `X` as inputs for `f`".
 

« first day (2139 days earlier)      last day (520 days later) »