« first day (2452 days earlier)      last day (195 days later) » 

12:06 AM
@Jeremygee Oh, yeah! The Curry-Howard-Lambek correspondence. Super cool stuff. Have you seen the nLab's article on this? ncatlab.org/nlab/show/computational+trilogy
I actually have some ideas for how we might directly leverage this in APL.
 
 
13 hours later…
1:00 PM
Welcome to APL Quest 2021-9! Today's quest is In the Long Run:
> Write a function that:
> • has a right argument that is a numeric vector of 2 or more elements representing daily prices of a stock.
> • returns an integer singleton that represents the highest number of consecutive days where the price increased, decreased, or remained the same, relative to the previous day.
The hint there is spot-on :-)
 
This is what I had:⌈/¯2-/⍸1,⍨1,2≠/2×⍤-/⍵
 
That is very very good.
Really, my only remark here would be to break out × from the 2-/
 
That makes sense. It was leftover from when I was trying to make it tacit.
 
Even so, you can do 2≠/∘×
There is a shorter, but less efficient solution too.
 
My original approach was more straightforward: ⌈/∊(+⌿¨⊆⍨)¨↓⍉↑2(=,>,<)/⍵
 
1:06 PM
Right.
 
Is that on the right track for the shorter solution? I couldn't see where to go from here.
 
Well, my thing was using ⊆⍨
The rest is basically the same as your good solution.
So, the whole thing I had was {1+⌈/0,≢¨⊆⍨2=/×2-/⍵}
Any other ideas on how to solve this?
I was thinking we could use directly, but it'll be hard to map the input to a valid argument.
 
@Adám I like that! I didn't catch the 2=/ operation on the first pass. And yeah, I couldn't see how to partition the original input well for .
 
Maybe we can use ⊂⍨ instead of to avoid adding 1.
 
{⌈/≢¨⊂⍨1,2≠/×2-/⍵} ?
 
1:20 PM
Yes!
I think that's it then. I'll be using your solutions for the video.
Btw, the videos I owe will be released daily at noon.
Then people can intertain themselves with those while I'm busy at the user meeting :-)
See you next week for 2021-10: On the Right Side!
 
Thanks! There's a video? Also, I saw a similar solution using my original approach on APLcart for "Lengths of subvectors of Yv having equal elements". Is the approach not listed because it's less optimized?
 
Yes, see apl.wiki/APL_Quest and yes, that's why.
 
Gotcha. Well, thanks @Adám!
 
2:58 PM
@Adám early submission, as always: ↑-⍛↑¨∘⊆
 
3:34 PM
@RubenVerg What is the character?
 
3:46 PM
@mitchelljohnstone Reverse Compose: aplwiki.com/wiki/Reverse_Compose
 
4:18 PM
@mitchelljohnstone I came with >./,(#;._1)@:(0,])"1]_1 0 1 =/ *2 -/;._3 ] 1 1 2 2 2 2 3 4 5 6 7 8 but not as clever as use of
 
4:34 PM
Oh I just found _1 0 1 =/ is actually =, so >./,(#;._1)@:(0,])"1]=*2 -/;._3 y
"The use of =y is deprecated because its result is too large." lol
 
 
4 hours later…
8:15 PM
Is there a way to change the title, axes and legends when using ]plot?
also, is there a way to save the viewport outcome into a graphics file?
 
 
2 hours later…
10:38 PM
@B.Wilson Nice! I haven't looked at this. Will check it out!
The Rosetta stone is very cool.
 

« first day (2452 days earlier)      last day (195 days later) »