The APL Orchard

apl.chat ― Learn, teach, ask, code, golf, & discuss usage. See ...
Jul 25, 2024 19:35
@RaberRich I'm not familiar with Bjørn's OAuth2 sample, but I'll also nudge him about it. With regard to Schwab Trader, are you trying to achieve?
Mar 25, 2024 19:36
((1+⍴)↑⊢)3 3⍴⍳9
Dec 25, 2023 15:22
BigInteger.Pow(b,101)
12034173135202669345365704758250368726075966429317325168882707144073922934239872302442493143257162841550871722670413829330864425497178316735962925470434635141780199211181709446187511263745104473280985244678258123
Dec 25, 2023 15:18
Set ⎕USING appropriate to your installed .NET version,
For me, I have .NET Framework 4.8 and I used:
⎕USING←'System' 'System.Numerics,System.Numerics.dll'
b←⎕NEW BigInteger 123
b×⍣100⊢b
12034173135202669345365704758250368726075966429317325168882707144073922934239872302442493143257162841550871722670413829330864425497178316735962925470434635141780199211181709446187511263745104473280985244678258123
Dec 25, 2023 15:12
@Lapwing482 You could also use the BigInteger .NET class
Dec 5, 2023 21:55
@SantiagoNuñez-Corrales Sure, the only real restriction is that dfns within the class aren't visible outside the class
May 23, 2023 20:31
@RubenVerg In general, we favor readability and correctness over speed (unless your solution is hideously slow). We look for clarity over cleverness, but if you can arrive at a clear AND clever solution, it will likely be judged favorably.
Apr 21, 2023 19:39
Regarding Problem 8 (https://contest.dyalog.com/?goto=P18) in Phase 1 of the APL Problem Solving Competition... We have updated the problem page with a more correct description, plus an explanatory note. We've also amended the "Updates" section on the home page.

You do not need to amend a previous solution that was considered correct under the original description - we will still count it as being correct.

Finally, thank you to the APL Orchard participants who brought this to our attention!
Apr 3, 2023 13:42
I keep extending the utility as I find new HTML anomalies that it doesn't currently handle.
Apr 3, 2023 13:41
@finooiigee I have a utility that attempts to convert HTML to XHTML. It's in no way comprehensive but seems to handle reasonably structured HTML. The result can then be passed to ⎕XML. There are other online and downloadable HTML to XHTML conversion tools.
Mar 20, 2023 18:45
I smell a good April Fool's trick in the making
Mar 20, 2023 18:31
Trigger functions are cool voodoo
Jul 28, 2022 15:22
There's a proper example in the problem specification above that:
returns a Dyalog Date Number ddn that would satisfy
string ≡ ⊃pattern (1200⌶) ddn
Apr 29, 2022 15:39
Oops :)
Apr 29, 2022 15:38
I wrote a blog post about Fibonacci a while back... dyalog.com/blog/2014/11/…
Apr 29, 2022 15:20
{⍺←1 1 ⋄ ⍵≤≢⍺:⍵⍴⍺ ⋄ (⍺,+/¯2↑⍺)∇ ⍵}
Apr 29, 2022 15:14
ah right
Apr 29, 2022 15:13
{⍺←0 1 ⋄ ⋄⍵=0:⍬⍴⍺ ⋄ (1↓⍺,+/⍺)∇ ⍵-1}⍝ tail recursive
Apr 29, 2022 15:09
@Richard it uses reduction for its iteration
Apr 29, 2022 15:08
@Adám yup :)
Apr 29, 2022 15:02
{⊃{⍵,+/¯2↑⍵}/⌽⍳⍵} ⍝ also fails for 0
Apr 2, 2022 03:21
The following will also work
)wsid newname
)save
Apr 1, 2022 15:47
+⌿
Apr 1, 2022 15:12
This is why I argue that windowed-reduction should be changed.
Mar 31, 2022 17:02
@BrianBED I'm not sure I understand the question, but with error trapping (using ⎕TRAP or :Trap in tradfns or error guards in dfns) and ⎕SIGNAL, you can tailor the behavior in response to an error
Jan 27, 2022 20:49
but of course you need to contend with dropped connections, etc... so, it's never as simple as you first think...
Jan 27, 2022 20:48
@PaulMansour That was the conclusion I arrived at... websockets are bloody quick, almost no overhead
Jan 27, 2022 20:46
@FawnLocke You run DUI on a folder and relative requests are resolved based on that folder
Jan 27, 2022 20:41
It sends an expression that gets eval'ed
Jan 27, 2022 20:41
correct
Jan 27, 2022 20:24
for instance, the APL Problem Solving Competition website is MiServer-based, as was TryAPL for a decade until Adam and Rich Park rewrote it using Jarvis
Jan 27, 2022 20:23
DUI is two components, a server (either HRServer or MiServer) and a library of content-generating utilities that were supposed to make it easier to generate web content from APL... sadly how much easier is open to debate
Jan 27, 2022 20:22
but, the websockety thing I wrote would work with either
Jan 27, 2022 20:21
@PaulMansour You can do whatever you want with the content. There just won't be a MiServer analog
Jan 27, 2022 20:20
So, DUI has 2 server models, MiServer (Conga-based), and HRServer (HTMLRenderer-based)... the goal was to make it as flexible as possible for where and how you wanted to deploy
Jan 27, 2022 20:18
DUI is actually designed to work with either Conga or HTMLRenderer depending on whether you want to deploy as a web service or a desktop app
Jan 27, 2022 19:59
@PaulMansour I'll dig it up and share it with you...
Jan 27, 2022 19:59
@PaulMansour Truthfully Paul, it's been a while since I tinkered with it, so I don't recall if I resorted to using a thread. I think that it was just a simple callback
Jan 27, 2022 19:46
I wrote a prototype websockety thing (you embed a bit of JavaScript in your page and there's an APL side that knows how to talk with it) that allowed you to execute JavaScript and get results back... as I recall, my progress bogged down trying to accommodate more complex objects from the JS side
Jan 27, 2022 19:17
@PaulMansour Are changes in the client reflected in the APL DOM?
Jan 27, 2022 19:15
@FawnLocke The basics of event handling are found in github.com/Dyalog/DUI/blob/master/MS3/Documentation/References/…. If you have questions, please feel free to email me
Jan 27, 2022 19:05
@FawnLocke DUI has some basic capabilities to update the client side without refreshing the content.
Dec 8, 2021 21:25
@phantomics Thanks... it would be easiest to send it via email ([email protected])
Dec 8, 2021 21:23
@phantomics That's one plausible scenario
Dec 8, 2021 21:17
@phantomics I suspect you're not getting the entire HTTP message, and the connection is timing out and closing during the 5 minutes it's waiting and when it tries to send a response, the connection is already gone
Dec 8, 2021 21:15
@phantomics I'd really need to see the code to be able to tell what's going on... otherwise I'm just guessing at possible causes... there are lots scenarios that could be happening...
Dec 8, 2021 21:10
Jarvis has an HTTP server at its core, and there are object-oriented samples of HttpServers in github.com/Dyalog/samples-conga/tree/master/HttpServers
Dec 8, 2021 21:09
@phantomics So, now things make a bit more sense... to process an HTTP request in raw mode you need to, receive data until you get CRLFCRLF (then you've got the headers)... then parse the headers for content-length... then listen for that many bytes and that's your payload. There's a lot of work being done, and it's easy to miss nuances, like a 0 length payload.
Dec 8, 2021 21:04
But writing an HTTP server in Conga (using HTTP mode) is really easy.
Dec 8, 2021 21:03
It's not as simple as just swapping 'http' for 'raw'...