The APL Orchard

apl.chat ― Learn, teach, ask, code, golf, & discuss usage. See ...
Jun 6, 2023 15:34
@Silas Solution found, if you're interested
Jun 5, 2023 07:26
@Adám This is working (I think) but it seems a lot inefficient {(⊂0 1)(⊂1 0)⍱.∊⊂∘.-⍨⍵}
Jun 5, 2023 07:17
Considering that, for the moment, I expect the matrix to have 12≥≢m so the positions will be around 24. (If the dimension of the vector can affect the efficiency of one method or the other one)
Jun 5, 2023 07:08
What about the difference between putting 0s in a matrix (that actually can be already a boolean one) and than use the function above and doing some calculations with the vector of positions?
Jun 5, 2023 07:03
@Adám Oh thanks, I was about to ask this
Jun 5, 2023 06:58
Wait, I might have badly proposed what I was looking for.
f ← ⍉⍱⍥(∨/∘,0 0∘⍷)× ⍝ This is my correct (and unefficient solution)
It returns 0 if the matrix contains two consecutives 0s (It return 1 in this matrix 3 3⍴ 1 1 0 0 1 1 1 1)
@Adám Is something like this correct?
⍉⍱⍥(∨/⍤∊2⍱/⊢)⊢
Jun 5, 2023 06:44
@JoshD Actually I already have positions of zeroes and the dimension of the matrix shouldn't exceed something like 30, but I always thought that checking relative positions of zeroes in a matrix would be simpler or more efficient, at least
Jun 5, 2023 06:37
(2(⍱/∨⍥(0∘∊)⍱⌿)⊢) 3 3⍴ 0 0 1  1 1 1  1 1 1
Jun 5, 2023 06:37
@Adám Shouldn't this give 1?
Jun 3, 2023 09:41
Is there a better way to check that there aren't consecutive zeros in a matrix (both rows and columns) than this f←(⍉∨⍥(∨/∘,0 0∘⍷)⊢)∘×?
Jun 1, 2023 06:42
@Adám Is this because trains aren't saved as defined but with another structure?
Jun 1, 2023 06:36
f ← (⊢∊∪(⌿⍨)1≠⊢∘≢⌸)⍤1
f ← ⊢∊∪⌿⍨1≠⊢∘≢⌸⍤1
Jun 1, 2023 06:35
Hi! I've modified this aplcart entry to find non-unique values of each row in a matrix and defined a function f, but when I run ]defs I see that f is displayed in form that I think isn't correct (although when using it, all work as desired). Am I wrong or should it be displayed like with parenthesis? [Below the function when I define it, and the result of defs]
Mar 12, 2023 10:48
@Adám Looks promising... I'll update you later
Mar 12, 2023 10:31
@Adám Should I send you an email to the one you posted on GitHub?
Mar 12, 2023 10:26
Ok, I've recorded a crash... Do you prefer meet on Zoom or is it better if I send you the video before?
Mar 12, 2023 10:22
It's pretty funny that when I was recording the screen it worked; after it crashed like five times
Mar 12, 2023 10:20
@Adám It's ok, but I don't know if I'll be able to find some sequence of actions that will cause the crash. Now I'm only pretty sure that it's crashing when I try to load the old session configuration
Mar 12, 2023 10:03
I'm joking, it just crashed another time... I've executed a bounch of ]CD and ]LINK (and it gave VALUE ERROR: Undefined name: ⎕SE.UCMD) a 1+1, I've wroted the message above and when I returned to APL it closed
Mar 12, 2023 10:01
This times I've noticed that it crashes after I do
]CD path\to\folder
]LINK.Create # .

And after a little bit it closes without a window popup with the aplcore message
Mar 12, 2023 09:56
Nevermind, I got it... But this time it isn't generated
Mar 12, 2023 09:52
@Adám Where do I find it? I don't know what is it.
Mar 12, 2023 09:41
@Adám I've reinstalled it yesterday, but now it restarted crashing every two lines. Maybe there's a problem when executing ]LINK or ]CD commands
Mar 11, 2023 18:12
@MasterQuiz And it started to crash quite frequently... Like after less that 10 lines of code
Mar 11, 2023 14:52
I've built a new session with this commands but now there's a non-resizable area below...
[Here's a screenshot](https://ibb.co/5nyJ5pP)
)load buildse
BUILD_SESSION 'UK'
Mar 10, 2023 09:31
@Adám Yes, I'll do it later
Mar 10, 2023 09:31
It's a tradfn that creates some local variables that are accessed by an inner function
Mar 10, 2023 09:30
@Adám Yes
Mar 10, 2023 09:29
@Adám Yes
Mar 10, 2023 09:24
This gives an error
FUTURE ERROR: 2: SYNTAX ERROR: {⍺←⊢ ⋄ ⍺ solver ⍵}: iEvaluate[13] (,⍕(⍕rc),': ',(0⊃res),{(⍵∨.≠' ')/': ',⍵}1⊃res,'' '')iSpace.qsignal rc

But I'll read about it, thanks
Mar 10, 2023 09:16
@Adám So it's possible to execute them at the same time and obtain a result in 30s?
Mar 10, 2023 09:14
Hi! I was interesting to learn about multithreading in APL. I've tried to run this:
{⍎'(⍎&''solver ''''',⍵,''''''')'}¨'02-swarming-ant' '02-swarming-ant'
solver '02-swarming-ant', is executed in about 30s and the line above is executed in 1min, so apparently it starts two threading but they aren't executed at the same time.
Jan 15, 2023 11:40
@RikedyP This actually worked, I didn't find this page before. But is there a way to activate the shortcut with the CTRL key? Otherwise I have to change keyboard when I need to type numbers or characters...
Jan 12, 2023 21:20
What about Dyalog from terminal? Can it recognise keyboard shortcuts?
Jan 12, 2023 21:17
@dzaima I may have gotten used to use the CTRL key... So if there isn't a solution I'd rather have it on Windows
Jan 12, 2023 21:14
@dzaima Is the problem that it detects multiple keyboards? Should I remove one or is there the option to let it access just one keyboard? Because I don't really need both when programming in APL
Jan 12, 2023 21:09
In conclusion... Do you suggest to install it on Windows, or is there a way to have something good also on Fedora?
Jan 12, 2023 21:08
It's also possibile that I've done some errors trying to install it, cause I've tried a bounch of things, before I could get something that works in someway
Jan 12, 2023 21:07
Ride (installed from the latest release in GitHub) have a problem with the keyboard too: I have installed "Italian" and "English (UK)" keyboards on the system, and when I open Ride, it uses the active keyboard as normal, the other keyboard as the APL one (Like instead of pressing CTRL+R, I just have to press R), so it's a problem too, because, for example, to write five negative numbers I have to continuously change between one keyboard and the other one (or also to delete something)
Jan 12, 2023 21:07
Hi! I was trying to install Dyalog APL on Fedora 37, but I couldn't get something to work properly. Dyalog is from the terminal and I couldn't enable the keyboard mapping.
Sep 27, 2022 09:14
Should it be used when the result isn't a matrix of scalar, but a matrix of higher rank items?
Sep 27, 2022 09:13
Hi! In the video about Artificial Life of @RikedyP, I've seen that he uses something like f⍤1⍤1 99⍨ to do like the outer product (I guess). When is it faster then ∘.f? Cause I've tried
      ]runtime -c "×⍤1⍤0 99⍨⍳ 1e3" "∘.×⍨⍳ 1e3"
and the second one seems faster.
Feb 22, 2022 23:02
@LdBeth For some very complex problems I think it's legit to have a lot of lines
Feb 22, 2022 22:40
@LdBeth I wasn't expecting to compete
Feb 22, 2022 22:31
@LdBeth I have a problem solved with 21 lines in 5 functions. If I don't consider the GUI and the site written in APL
Feb 22, 2022 20:24
@Adám And I suppose there aren't either unofficial ones? Cause I needed the Geometry Set
Feb 22, 2022 19:59
Where can I find the solution to the contest of 2017?
Feb 19, 2022 21:47
Doesn't it stop the execution after 10s?
Feb 19, 2022 21:45
@Adám What can it do?
Feb 19, 2022 21:42
@Adám Do you know that TryAPL convert Power into this thing 'þ'? When I save a function and display it