« first day (1353 days earlier)      last day (1301 days later) » 

2:58 AM
Making an APL implementation is a great way to understand APL itself actually.
 
 
2 hours later…
5:04 AM
@EliasMårtenson Yeah, quite a few people here have gone that route.
 
 
7 hours later…
12:06 PM
<phantomics> Worked for me
 
12:17 PM
<phantomics> On that note, has anyone considered implementing rational numbers in an APL? I get them for free in Common Lisp so I was thinking of using J's 1r2 syntax
 
GNU APL does it.
But it has to be activated using a compile flag and I think it's disabled by default.
I've considered implementing it in KAP.
 
@DyalogAPL @phantomics NARS2000 has them too.
 
The thing is that rational numbers are usually only useful if you have bignum support, which GNU APL doesn't do so on that platform they are not overly useful.
 
Damn just solved a challenge locally but doesn't work on TIO :(((
 
<phantomics> Cool, do they use the r-notation like 1r2?
<phantomics> So I can be consistent
 
12:25 PM
If I implement bignums in KAP, then I'll do rationals as well.
But yeah, I don't know of any language that does numbers better than Common Lisp.
 
@phantomics NARS2000 uses r for rationals, like J.
 
Maxima might be a bit better but it piggy-backs on top of Common Lisp so it's not fair :-)
 
<phantomics> Yeah, I'm spoiled with rationals, bignums and complex for free
 
At least APL does Complex right.
 
Does anyone have any idea why {10|⍵,⍨⊂⍺+⊃⍵} might error in dyalog extended
a domain error
 
12:33 PM
@rak1507 TIO link?
 
RGS
@EliasMårtenson Mathematica?
 
Never mind, got it
Or not
 
 
ignore the horrible code (for now)
Oh now it doesn't work locally either
Ah it does but with ⍣¯1
Got a chemistry test now :(( will have to fix this later
 
1:42 PM
@rak1507 whats this do?
 
Stuff
48
Q: Combination bike lock

LuiThe scenario After a long day's work slogging in the office and browsing stackexchange.com, I finally walk out the door at 16:58, already weary with the day. Because I am still only an intern, my current mode of transportation is on bicycle. I head over to my trusty Peugeot Reynolds 501, but bef...

 
woooaaaah
 
f←{p⌷⍨⍸⍵≡¨⍥⊆⊃¨p←({⍵/⍨≠⊃¨⍵}⊢,⍥,((+,-)↓⍉2⊥⍣¯1⊢⎕A⍳'ABCDFGHLN')∘.{10|⍵,⍨⊂⍺+⊃⍵}⊢)⍣≡⊂⊂4⍴0}
works locally
Might just post it
 
2:08 PM
@rak1507 tried using a polyfill here: Try it online!
@rak1507 works alright locally
 
Yeah :/ I posted it
Currently in economics getting roasted so I'll do the explanation later
 
RGS
3:09 PM
@rak1507 I thought you were gonna do the exercises of my blog post during economics :P
DISCLAIMER: RGS in no way endorses behaviour that might or might not have a negative impact in academic perfomance and is not to be held responsible for the actions of those who follow his suggestions.
 
<phantomics> Blog post where?
 
RGS
phantomics: on my blog, about my basic APL interpreter in Python. Read @ mathspp.com/blog/lsbasi-apl-part3
 
<phantomics> Cool
 
RGS
phantomics, if you do have a look at any of the blog posts there (about APL or not) be sure to let me know your thoughts
 
<phantomics> Certainly, don't write much Python but interested to see your approach
 
RGS
3:21 PM
sure. I don't have much knowledge on interpreters and related topics, so don't expect great design choices or things like that :P
 
<phantomics> When I took up writing an APL I didn't realize how popular a pursuit it was, it's a great way to learn
<phantomics> And I went for a compiler
 
@RGS lmao
 
RGS
3:53 PM
@phantomics nice! What did you write it in?
 
<phantomics> Common Lisp: github.com/phantomics/april
<phantomics> @RGS This is my video presentation of it: youtube.com/watch?v=AUEIgfj9koc
<phantomics> Which features a hardware device that it powers
 
Oh wow you're that guy
 
RGS
Ah so you are "that" guy. I was aware of that video, just did not know you two are the same person
 
Hey mr @DyalogAPL
hey mr ngn
how much of your soul did you sacrifice to solve ascii art challenges
 
<phantomics> That guy? Seems a dubious honor
 
RGS
4:07 PM
yeah, I am sorry :P I just mean to say I did not establish the connection, even though I was aware of the existence of that video and of April. Also, to be completely honest that doesn't tell me much about you... You could be a "celebrity" in the Common Lisp world that I would have no idea!
All in all I just connected a couple of dots; that's all
 
ngn
@Razetime about 5.82%
 
4:23 PM
<phantomics> Haha don't worry about it
 
 
3 hours later…
6:54 PM
hacky reply to self userscript (also makes replies to the IRC bridge use usernames because why not)
 
 
2 hours later…
8:24 PM
new body system:
https://dzaima.github.io/paste/#01VXNbtNAEL77KUblhFKQx02K8LFJIw4QRw2cUA/reNOa@ifYTiECpChCXOCQg5F64YI4tFKPufMufgIegdn1JrhJ2pAEKrD2x/PN7Lfzs14DwF3@Gpz2fftloAFA7aAXbLHswwgh@/ge3rDSjy@fL96Vt7SKVFdDv@t6fLFJln7K0sH/0C5XxNdjW6mNKH1DPRt8R@qGQYOuOgoEy0oSGqwoO9wViJAMnFgXVkpwqniQ26bDSZ0uC@OogP9@hOutWkAigof1HunCsEQdqZdzsZDLPBm5PMFwanU1Fwujujn4jV1PJdm4MJ4V8Pk2vgY/K0T@y//RFMWdG0u/eShzb7M1Epp8YoX8Dydquka@5dNFPp1fsboDfR6DCz4Leszz@sAdN@EOJMduvE3oiRsckcChE0Y@SxIhHrPA8Ti4CXSjsMsjWvUq7HkO2Jx0kQPm29uKOZ0p0pLq30o50rkDNXP0lpy1v@vgqh/AAh@161n@tTbeLNo/smo2g@KXnw2@7lWX/PjbocNNDXQddBTlaz5rPQI0ATXAXQn
 
 
2 hours later…
RGS
10:06 PM
@dzaima this looks interesting. How does it work?
 
10:31 PM
<phantomics> I'm not sure if anyone from Dyalog reads here but I'm curious about something
<phantomics> Dyalog's arctanh function seems to be different from others
<phantomics> In Dyalog:
<phantomics> ¯7○¯2
<phantomics> 0.5493061443J¯1.570796327
<phantomics> In GNU APL:
<phantomics> ¯7○¯2
<phantomics> ¯0.5493061443J1.570796327
<phantomics> Common Lisp and Wolfram Alpha both return the same result as GNU APL
<phantomics> Why is Dyalog's different?
<moon-child> @Adám
<moon-child> phantomics: on my copy of dyalog, both the real and imaginary parts are negative
<phantomics> The real part is supposed to be negative
<phantomics> Do the high minus signs not show up for you?
<phantomics> Dylog output should be:
<phantomics> _0.5493061443J_1.570796327
<phantomics> The underscores are minus signs like in J
<phantomics> In everything else I've tried, the imaginary part is positive
 
ngn
10:52 PM
@phantomics does it matter? tanh of both is close to -2
 
<phantomics> Any discrepancy matters when a function that's supposedly a known quantity produces different results in different implementations, what if I'm doing something where I expect a positive imaginary part for this outcome based on the behavior of other languages?
 
ngn
right, so it's like sqrt: sqrt(4) might as well be -2 but we pick 2 by convention.
 
11:12 PM
APL Question: Trying to write an APL solution for "Longest Valid Parentheses". I have gotten to this:
t ← '}{}{{}}}}{}'
+\(~,[0.5]⊢)'{'=t
1 1 2 2 2 3 4 5 6 6 7
0 1 1 2 3 3 3 3 3 4 4
And now I need to reset the "plus scans" any time row 1 is greater than row 2. Is there an easy way to do that?
So the result for the above example would be:
0 0 1 1 1 2 3 0 0 0 1
0 1 1 2 3 3 3 0 0 1 1
 
ngn
@code_report can you give a link to the challenge?
 
@ngn Solution 4 is what I'm implementing leetcode.com/problems/longest-valid-parentheses/solution
 
@code_report Given a mask of where you want to reset, you can get index-of-last-reset with {⌈\⍵×⍳≢⍵}, then subtract the value at the last reset from the current value. Probably need to add a 0 before both sequences to use this.
This is assuming you can compute the reset mask all at once instead of having each reset depend on previous ones. If that's the case (I'm not sure from the way you wrote your question) then it's a lot harder.
So the idea is to get a contiguous sublist that's balanced?
 
11:28 PM
at the end of the day, I just need the length of the longest valid parens.
once you apply the reset/plus scans, you can just do the following (assuming that x is the result posted above):
(+⌿(⌈.×)=⌿)x
6
@Marshall for more clarity:
x
0 0 1 1 1 2 3 0 0 0 1
0 1 1 2 3 3 3 0 0 1 1
(+⌿(⌈.×)=⌿)x
6
I just need to know how to get from my first piece of code to x
 
The way I know to do this is to sort or group by bracked depth, so that at a given depth open and closed brackets alternate. Then a bracket is paired unless it's the first closed parenthesis at its depth or the last closed one. And a balanced sublist is the longest sequence of paired brackets.
 
"each reset depends on the previous"

i think this is the case
 
It's pretty similar to my markdown link-finding code here (in BQN).
Mine is a little more complicated because non-bracket characters are possible, so I work with indices essentially to filter those out. The only-bracket version shouldn't need indices.
 
oh wow, I just realized you are Marshall Lochbaum. I got extremely excited when I saw the "Combinators" section of github.com/mlochbaum/BQN/blob/…
 
11:41 PM
and when I saw the S/W/etc characters from the BQN character set - I got extremely excited because I thought those my correspond to the S-/W-/etc combinators from Combinatory Logic
 
ngn
@code_report does it matter how you solve it? the typical apl way would be to try all substrings
 
@code_report I don't think I've seen the W combinator.
 
not sure if that is the case though. I asked in the British APL Webinar if APL-ers are familiar with the fact that trains (forks) and many of the operators correspond to combinators: angelfire.com/tx4/cus/combinator/birds.html
@ngn isn't the complexity of that intractable?
 
ngn
@code_report it's a finite problem. O(n^3) is tractable :)
there are O(n^2) substrings, each can be tested in O(n) time
 
hmmm, i guess thats true. the solution needs to be linear for my case though
 
ngn
11:58 PM
not linear, but close: ⌈/'x+'⎕s 1⊢'{(x*)}'⎕r'x\1x'⍣≡t
 

« first day (1353 days earlier)      last day (1301 days later) »