« first day (1743 days earlier)      last day (916 days later) » 

4:01 AM
@elliptic00 That's because you are using wrong notation for negative numbers. In APL, it should be written as ¯1 ¯1 ¯1 2 2
⋄ (∪∘∊3{⍺≡⍵:⍺⋄⍬}/⊢) ¯1 ¯1 ¯1 2 2
 
@LdBeth ¯1
 
{⍺≡⍵:⍺⋄⍬} means if and are not structurally equal (thinking eql in lisp), gives null (), otherwise return either one of & , although I pick .
⋄ (3{⍺≡⍵:⍺⋄⍬}/⊢) ¯1 ¯1 ¯1 2 2 3 3 3
 
@LdBeth
┌──┬┬┬┬┬─┐
│¯1│││││3│
└──┴┴┴┴┴─┘
 
⋄ (3,/⊢) ¯1 ¯1 ¯1 2 2 3 3 3
 
@LdBeth
┌────────┬───────┬──────┬─────┬─────┬─────┐
│¯1 ¯1 ¯1│¯1 ¯1 2│¯1 2 2│2 2 3│2 3 3│3 3 3│
└────────┴───────┴──────┴─────┴─────┴─────┘
 
4:42 AM
@LdBeth, thanks,
a ← 2,/⊢ 1 2 3
      ⍴ a
2
what is a?
a is list?
v1 ←3(↑,/)1 2 3 4
      ⍴ v1
2 3
I got 2 3 matrix,
2,/⊢ 1 2 3
1 2 2 3
c ← 2,/⊢ 1 2 3
+/ c
3 5
 2,/⊢ 1 2 3
 1 2  2 3
      c ← 2,/⊢ 1 2 3
      +/ c
 3 5
It seems it is a list of pair
 
5:17 AM
sorry, it is nested vectors,
k ← 2,/⊢ 1 2 3 4
      ≡k
2
 
6:03 AM
@elliptic00 It might help you to turn ]boxing on (as it is by default for TryAPL): ⎕←2,/⊢ 1 2 3 4 (btw, the doesn't make a difference)
 
@Adám
┌───┬───┬───┐
│1 2│2 3│3 4│
└───┴───┴───┘
 
6:38 AM
@Adám, thanks, I just turn the box on, ]box on -style=max , now I can see those axis around them
 
@elliptic00 You can make the boxing state permanent by saving your session.
 
yep, I assume RIDE use some session file to reload them for next restart
 
RIDE is a dumb HTML renderer. It is actually the interpreter that controls everything, and simply tells RIDE what to show and do. From RIDE, you can save your session using 2⎕NQ⎕SE'FileWrite'
 
7:10 AM
@Adám, Oh.. nice.. thx
 
 
1 hour later…
8:13 AM
@Adám RIDE is a dumb HTML renderer, lol
its built using electron right?
 
@PyGamer0 Yes.
@PyGamer0 It is not meant in a bad way, or anything. I don't know how else to briefly note that RIDE as little idea about what's going on. It isn't like a normal IDE that manages your code. It simply hands off almost everything to the interpreter.
This model was necessary because of the tight integration of the language and the environment.
 
9:04 AM
@Adám, Dyalog should write a IDE with pure APL only,
 
Not sure if you mean it should be implemented in APL, or should only support a pure APL without environment hooks.
 
9:20 AM
@Adám i think he means written in apl
 
9:31 AM
@Adám at Dyalog 18 there was a presentation on the future of RIDE (here). On slide 17 it mentions work to support the Language Server Protocol and debug extensions (now an open standard). Did that work get shelved?
 
9:50 AM
@xpqz Isn't that the (two?) linked items under VS Code here?
 
10:18 AM
It lacks the debug extensions, as far as I can tell.
 
10:42 AM
@xpqz The author of those plugins is also monitors the RIDE repo, so you could log a question there.
 
11:09 AM
Any implementors have insight into how +\ plus scan becomes linear rather than quadratic?
 
@RikedyP for integers, there's no difference, an implementation can choose to special-case it. For floats, I think dyalog just doesn't guarantee it being equal to {⍺+⍵}\
 
@RikedyP @dzaima Same as with +/.
 
@dzaima Awesome thanks - so something about the order (or ability to compute the cumulative sum in chunks rather than as scalar-by-scalar) is what makes it work. I saw Marshall's talk on reductions which makes sense sense the end result will be the same since + i commutative, but it's not obvious to me how it still works with scan since you need the intermediate results from the right order
 
@Adám yeah. except that for +/ it doesn't really gain you performance and still does the slow one-by-one addition, just in reverse order
 
@RikedyP Take the first number and put in result. Add the second number and append to result, add the third number and append to result… Voila: Linear.
 
11:20 AM
@Adám Surely then the question is: why is general scan quadratic?
 
Aug 4 at 20:53, by Adám
@code_report IIRC, Iverson intentionally chose the current definition of scan because it allows -\ and ÷\ as alternating sum and product.
 
Is it just because this "method" only works for commutative functions?
 
you can make all sorts of such fancy hacks for linearizing most useful scans
@RikedyP Dyalog doesn't actually appear to do that for +\ - ⎕ct←0 ⋄ a←?1000000⍴0 ⋄ (+/a)≡⊃⌽+\a is always 1, which means it must still be doing it scalar-by-scalar
 
11:37 AM
@RikedyP f\a b c d = a (a f b) (a f b f c) (a f b f c f d) which due to the RTL nature of APL evaluation needs to calculate each one separately unless (a f b) f c = a f (b f c) which allows it to be special cased
 
except that, for +, (a f b) f c is not always equal to a f (b f c), but Dyalog still assumes it as such
 
true
 
@dzaima Isn't more that Dyalog assumes them to not be the same, but instead behaves like LPA for +/ and +\?
 
@Adám the two are equivalent reasons for the difference. And I'd assume that the origin of the behavior of +/ was accidental, because of the assumption of associativity
 
@dzaima Maybe, but it could also be intentional to ensure that +\ could be linear instead of quadratic, while remaining consistent with +/.
Of course, they should never have made any promises about stability of float summation.
 
 
1 hour later…
1:02 PM
Afternoon all. Not sure if I'm missing something super simple here. I'm setting up a task to test out communications with the Microsoft Office OLE on Windows Server 2019 (been having some problems for a client). I run a WinFile.PolishCurrentDir (essentially setting the cd to that of the workspace). That allows me to read my INI file using a relative path, but when I go to work with a sample Word doc, it's looking in the wrong place (under my user folder).
⎕CMD 'cd'
F:\APL_Dvlp\Tasks\TestMSoffice
]cd
F:\APL_Dvlp\Tasks\TestMSoffice
This works fine: #.INI←⎕NEW #.IniFiles(,⊂'INIs/TestMSoffice.ini')
 
@JamesHeslip What is this showing?
 
myWordDoc←Word.Documents.Open⊂'./Data/Test.rtf' yields DOMAIN ERROR: Sorry, we couldn't find your file. Was it moved, renamed, or deleted?
(C:\Users\james\Documents\Data\Test.rtf)
@Adám Essentially I was hoping that things would look relative to the current directory (F:\APL_Dvlp\Tasks\TestMSoffice). But Word is looking under my documents. Is this just a feature of the Word OLE?
 
Probably.
I'd use absolute paths anyway.
 
can you look at the source for Word.Documents.Open and check?
 
You know you can make a path that is relative to the current directory into an absolute path with ∊1∘⎕NPARTS?
 
1:08 PM
@rak1507 I didn't see anything to suggest that it would act this way in docs.microsoft.com/en-us/office/vba/api/word.documents.open
 
oh it's not an APL thing
stackoverflow.com/questions/213584/… looks like it doesn't use relative paths
 
@Adám That's neat- I didn't know that. Thanks! I'll be sure to share.
@rak1507 Perfect, thank you.
 
1⎕nparts is cool
 
Also means you can get the current dir with ⊃1⎕NPARTS''
 
platform independent too! (probably?)
 
1:17 PM
Of course. Try it online!
 
1:37 PM
@Adám FYI: github.com/tiamatica/vscode-apl-debug -- I shall have a go at this.
 
2:05 PM
{-⊃{⍺+.×⍨(+\-+/)@(∘.=⍨⍤⍳⍤≢)⍵×∘.≤⍨⍳≢⍵}⍣(1-⍨≢⍵)⍨⍵} fun determinant from codegolf.stackexchange.com/questions/236835/…
+\-+/ is cute
 
2:44 PM
@rak1507 1-⍨≢⍵≢1↓⍵
@rak1507 You can remove one of the s in ∘.=⍨⍤⍳⍤≢
 
 
2 hours later…
5:11 PM
@Adám oh yeah, true
 
 
5 hours later…
10:34 PM
3,/ 1 2 3 4
┌→────────────────┐
│ ┌→────┐ ┌→────┐ │
│ │1 2 3│ │2 3 4│ │
│ └~────┘ └~────┘ │
└∊────────────────┘
any Python function similar to above operation?
any name for that?
more general n,/ 1 2 3 4
 
11:20 PM
nope, nothing built in
best bet is probably using zip, zip(x, x[1:], x[2:]...)
 

« first day (1743 days earlier)      last day (916 days later) »