The APL Orchard

apl.chat ― Learn, teach, ask, code, golf, & discuss usage. See ...
Dec 20, 2021 07:09
I was referring to the next example, with times for dyadic ⍳ vs binary search
Dec 20, 2021 07:04
wanted to ask about <https://chat.stackexchange.com/transcript/message/59923809#59923809> again because either it was missed or I missed the reply, hope it's not frowned upon to do that
Dec 20, 2021 00:04
is 'not capable of understanding a brilliant language' referring to something specific?
Dec 19, 2021 22:25
I see aplcart has some stuff for "days of month Is in year J"/"month I of years J". is there a more elegant one if I only need the days in a single month?
Dec 19, 2021 22:21
thanks, will take a look ^^
Dec 19, 2021 22:10
I thought ⍴that was 5 3. evidently it isn't but I'm confused why it isn't
Dec 19, 2021 22:08
thanks. I want to make an array of enclosed strings, what's the least painful way to type one in?
Dec 19, 2021 22:02
⌊1 ⎕DT 'J' is the current date right?
Dec 19, 2021 03:36
I did randInts ← 100000 ? 100000 and compared execution times of randInts ⍳ 1, 19326, and 46729. the return values of those are 94438, 1001, and 1 respectively. the execution times are 0.13ms, 0.47ms, and 0.12us respectively. can anyone explain what's happening?
Dec 19, 2021 03:36
so I was reading <https://xpqz.github.io/learnapl/iteration.html> a bit ago and was confused by the binary search example, so wanted to test. the numbers I'm seeing for linear search are both nothing like his and don't make a lot of sense.
Dec 14, 2021 21:07
ahh I was reading that as {(⍺⍴⍵),⍥,(⍺⍴0)} and then getting confused why it didn't do the same thing as that
Dec 14, 2021 21:01
I'm not sure I have a clue what ⍥ is. (in fact I'm fairly sure I don't)
Dec 14, 2021 20:58
oh, neat. got tricked by the name into thinking it wouldn't like a larger left argument than the length of the right argument
Dec 14, 2021 20:55
is there a function like ⍴ except that instead of repeating it just uses 0s for extra cells? (e.g. 3{...}1 2 becomes 1 2 0)
Dec 14, 2021 20:45
fair enough, it feels a little unreadable and also a little long to me, but maybe that is just not APLing enough
Dec 14, 2021 20:41
For the FRC problem, I imagine this was not what I was meant to do - would like some advice on improving it. {(1=(⍸'R'=⍵)⍸(⍵⍳'K'))∧2|+/⍸'B'=⍵} (Problem: problems.tryapl.org/psets/…)
Dec 14, 2021 18:54
For problem 2 on the problems.tryapl site you linked, are you meant to do it without using ⍳?
Dec 14, 2021 17:39
oh, I hadn't realized that 'A'='ACGT' would be 1 0 0 0. Which I really should have.
Dec 14, 2021 17:34
thanks. unrelated and let me know if I'm asking too much random stuff but. is this reasonably idiomatic or did I miss a better way? count ←{+/⍺∊⍵} and then basecount ← {⍵ count⍤1 0⊢'ACGT'}
Dec 14, 2021 17:27
yeah. or selecting with a name, for that matter, 'sin' ○ ○0.5
Dec 14, 2021 17:23
is there an interesting historical story/reason why works how it does?
Dec 14, 2021 17:11
thanks!
Dec 14, 2021 17:06
is there any way to get ⎕NGET to use a relative path instead of absolute? (or, at least, if it does use a relative path, it doesn't start in the folder my .dws file is in...)
Dec 14, 2021 17:01
testing: {'TGCA'['ACGT'⍳⊖⍵]}
Dec 14, 2021 16:59
hm, I appear to have lost a square bracket in the copying. oh well.
Dec 14, 2021 16:59
thanks! definitely says something about something that I'm spending more time trying to get I/O working than writing {'TGCA'['ACGT'⍳⊖⍵} or whatever. what it says about what, I'm not exactly sure yet ^^
Dec 14, 2021 16:51
Win10
Dec 14, 2021 16:50
thanks, that does make the input side of things better. don't suppose there's anything convenient like a way to copy the result of an expression directly to clipboard (without boxing/indents/extra whitespace between lines/etc)?
Dec 14, 2021 16:46
Trying the Rosalind problems to figure out the basics but I'm having some difficulty with inputs/outputs that are fairly long - was able to get one question working with ⊃⎕NGET but even then it choked on the terminating newline initially and then I had to manually remove blank lines and indents to submit the output...
Dec 14, 2021 16:46
Hi, thank you. Was reminded that I really should learn some APL after writing a depressing amount of (vector-set! v i (+ (vector-ref v i) 1))-style code for today's AoC problem and having it suggested that maybe I should use a language that's actually good at arrays for that sort of thing.