« first day (1538 days earlier)      last day (1119 days later) » 

9:38 AM
@Adám did you get a chance to take another look at the revised blog post thing I sent you?
 
@xpqz I didn't notice any revised edition, only a question about P9. I have some test cases I'll try out on the array solution and then send you. Can you email me a link to the updated version?
 
10:27 AM
I sent you a subsequent email after that with the new version attached, but I can resend with a download link if you prefer.
 
@xpqz Doh, I see that now. Sorry.
 
11:03 AM
@JCGonzalez Welcome. Interested in APL?
 
11:58 AM
is there a reason why | is defined sort of opposite to ÷? In other words what is the best way to "read/ imagine" |?
 
@k1m190r really, it'd be better if ÷ were swapped too, as the thing to the right of it is usually constant (see (a+b)÷2 vs 2|a+b - no parentheses for the reversed version)
 
@k1m190r ÷ and - are the way they are for legacy (traditional mathematical notation) reasons. Functions in APL generally take the main data argument on the right and the parameter or specification on the left. So - and ÷ should really be reversed. Indeed, you'll often find -⍨ or ÷⍨. Since | was new, it could be the "proper" way.
@k1m190r I read | as remainder, not "modulus", which is ambiguous anyway.
 
:) interesting understood
 
12:59 PM
@Adám Yes, indeed. Trying to complete the tutorials I find.
 
@JCGonzalez Cool. Do you know about apl.wiki/learning_resources?
 
1:11 PM
@Adám Yep, I have it in the queue, thanks! Will come back when I'm done.
 
@JCGonzalez Excellent. Do not hesitate to ask if you have any questions or get stuck anywhere.
 
RGS
2:13 PM
@k1m190r You could also think that ⍺|⍵ is closer to how mathematics uses the | symbol. ⍺|⍵ in mathematics means ⍺ divides ⍵
So ⍺|⍵ could also be seen as telling you by how much ⍺ does not divide ⍵
 
Got a Q about performance if anyone is knowledgable:
      PDepth1
{⌈/+\(⊣-~)'('=(⍵∊'()')/⍵}
      PDepth2
{⌈/+\-⌿'()'∘.=⍵}
      ≢expr2
1000000
      ]runtime -c "PDepth1 expr2" "PDepth2 expr2"

  PDepth1 expr2 → 6.7E¯4 |   0% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
  PDepth2 expr2 → 1.2E¯3 | +75% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
Is an outer product for 2 rows really that much worse?
 
not using ∘.f appears to be slightly better
 
RGS
@dzaima Are you missing a ? in the indexing?
 
2:28 PM
i indeed was
 
RGS
2:40 PM
The lack of follow-up suggests randomised indexing didn't alter the results significantly..?
 
No I don't think it does
Is the computational complexity of compress and/or reduce linear?
 
@RikedyP what else would it be?
 
@dzaima Don't know but I also don't know loads about this stuff so I'm just trying to check before I start telling lies on the internet
 
RGS
@dzaima I agree with you that compress and reduce should be linear and is fairly easy to reason about it, but it kind of becomes interesting to think about the complexity of expand
Would it be smth like O(+/|⍺), in ⍺/⍵?
 
A/B is linear, but note that if A is a bit boolean vector (as is here), it can be significantly optimized
+/A is also very much an optimized thing
@RGS probably easiest to say it's O(n) where n is the length of the longest of , and the result
 
RGS
2:50 PM
:P
The idea of big O notation is to give an asymptotic explanation of how the time complexity grows when the inputs change. My question was more of a "is this the complexity", and not so much "does this expression make sense"
 
@RGS O(≢⍺/⍵) you probably want more like O((≢⍺) + +/|⍺) as (1000⍴0)/⍳1000 still needs to scan through
 
RGS
@dzaima Yes, definitely you need to take into account the cases where +/⍺ is small :)
Btw, let me bother you with smth stupid :P
If you take a look at the RIDE tracer icon to toggle line numbers, you can see it is composed of 4 things.
 
yep
 
RGS
There's a "main" svg that draws the four lines, and then there's one more element for each number in 1 2 3
I wanted a standalone svg with that symbol, so I naively copied those 4 elements and their enclosing span into an .svg file
The lines get rendered nicely but the numbers not so much.
Do you know if/how I could fix this?
 
by "not so much" do you mean they don't at all?
 
RGS
3:03 PM
Exactly :P They get dumped at the bottom of the screen, at least for me.
A similar experiment with the icon for the "clear breaks, etc" shows a similar phenomenon
 
if you just copied the svg, you won't copy all the fontawesome-defined css styles
 
RGS
So .svg files can go with css?
That's insanely cool. So if I were to copy the corresponding css styles you think it would work?
 
no, this isn't a .svg file
 
RGS
Hm ok, so what is it?
 
it's HTML+CSS (and SVG happens to be part of HTML)
here we go
https://dzaima.github.io/paste/#0zVjfk9o2EH6/v0Ilk5ljijjZBh/YdzeZ9qUvfe27ABnUE7bHFgd3DP97V7JsC/wjtCFJk0mwP61Wq29Xuys/5fJdsJe7/G0dxIm8D7IkkcMxvGIeCx4zjCN6TN5YFolkH7zxnC8EO10KrHieCvoeGGghkuVrGCWxxDn/YABvWMZluGF8vZGBw7bhpcoQ3iVfUoGp4Os4wGPHnbLt5UrjiGKxPjaE3S7hPXaOe76Sm2BM/G4htxRyumW8Smb22Ck0KYW69UxLEa9nMb8S6l7rsZSZ9AjNSqFOiXkl0UOQQ0qpPqGKa7@HIqciu0emInvWQ5JTsd23XMX3vIcmpyTc6ZQo6XZ6I8mZVWJ9ls9rqR7bXVKJdelKd0JgwSJ53NJszWOc6TM29uCQFXPpTiadM7V0OVWpuWbmIslWLDuWx7krtAQ31rvt49H@YndqDn1nWY5A@DLHLBIpk21AQm0lCQubtY1hmuRc8gTeFnkidpKFBQsklEkaEEtze6qyElOlKmOCSv7GQskO0iSaJYslyxq5ynHH08@hFT@9G8F7t
 
RGS
3:11 PM
wow alright.
But like you said, that's HTML+CSS, not only svg stuff, correct?
 
yeah
 
RGS
Yeah, that is annoying.
 
you could probably somehow convert it to pure svg if you wanted to, but idk
 
RGS
3:49 PM
Yeah
 
4:38 PM
@RikedyP For vector arguments, compress algorithms have a term that's linear in the argument length and one that's linear in the result length, and sometimes one that's linear in the number of times the left argument switches from 0 to 1 or 1 to 0. It tests the left argument to pick a good algorithm. All those terms are bounded by the length so it is O(n), but the exact timing can be complicated. PDepth1 will get slower with more parentheses both from the compress and the arithmetic after it.
 
 
1 hour later…
ngn
5:46 PM
@MartinJaniczek done. thanks.
 
RGS
6:02 PM
@Marshall "bounded by the length" of what? If +/⍺ is much larger than the length of ⍺ and ⍵, doesn't that in some way dominate?
Or is +/⍺ irrelevant to the time complexity ⍺/⍵ takes to run?
 
@RGS by the length of the input. Marshall is only considering compress there, not full replicate
 
RGS
Ah ok, in that case I understand the answer :)
 
 
4 hours later…
10:27 PM
@RGS awesome thanks
Topic that is not covered in the Mastering Dyalog book (2009) is trains/ tacit programming. I'm reading aplwiki and Dyalog documentation on the topic, but my mental model is still a little blurry. Maybe need way way more time just writing and reading more code... Anyway any pointers from the pros who just grok the tacit lines will be much appreciated. I think it just takes time as with everything....
 
RGS
@k1m190r I'm not a pro
But I'm reworking MDAPL and we will be adding a chapter on tacit programming
Until then, I recommend practice, setting ]box -trains=tree, and taking a look perhaps at RPark's video:
Also, if that's the kind of exercise that would work for you, you could check the tacit entries on apl cart (aplcart.info?q=tacit), randomly pick one, and try to understand how it works
Ok, maybe use the "quiz" functionality on APL Cart (aplcart.info/quiz) and use the "Explaining the purpose of a given function" section.
 
oki thanks for the video
following the suggested train of thought (all pun intended) :)
 
RGS
@Adám problem here ↑
@k1m190r :D
 
11:25 PM
@RGS video is very helpful, it is sinking in
 
I think you're right that it's also one of those topics that just takes time to get good at reading naturally
 

« first day (1538 days earlier)      last day (1119 days later) »