This week we bring you the final set of videos from Dyalog '18 - you can find the introductory blog post with links to the videos at https://www.dyalog.com/blog/2019/01/dyalog-18-videos-final-week/
We hope you have enjoyed watching them!
Hey guys. I need to filter a vector to remove everything from it that's not in ⎕A,819⌶⎕A. I've tried using ∩, but it removes duplicates and I need it not to do that.
(of course replacing ⎕A with ⎕A,819⌶⎕A; hope i understood what you wanted correctly)
oh 'Hello, World!'∩⎕A,819⌶⎕A works fine. ∩ annoyingly does different stuff based on the order of its arguments, and you need the filterers to be ⍵ so ⍺ isn't deduplicated
@J.Sallé you know how {⍺,≢⍵}⌸'mississippi' is the regular way of counting characters in a vector? That clearly shows that ⍺s of the operand are elements of the right argument
I'm not even sure if ⍋ is gonna help me much here, tbh. I just noticed that the specs changed
Now I need to "Group letters ignoring case. In the output, use the case of the last occurrence in the input". I don't think it changed, it was just reworded.
@J.Sallé i guess i kind of thought it'd have about as much impact as the operator & function & train binding "regex" mess, but tokenizing is way way simpler :|
for ⌊(÷1|)⍡10⊢○1 which takes ~34000ns on average, tokenizing gives ±900ns variance (0.034ms, ±0.0009ms converted)
*not ±; 34000 is average of both, 900ns is tokenizing included - not included
@ngn hmm, i'd consider that to be worse than both options, as that gives a slight, constant difference between different timing amounts, but you're right, it shouldn't matter
oh ive completely forgotten that i've made every Obj (superclass of anything storable in variables) have a pointless string repr field.. it's used only for function string representations but that really should be a (virtual) method :|
argh i'd like to make a way for me to have optimized dyadic non-all-number functions, but that'd require copying this mess to another function and adding even more to it
i measure elapsed time in ms. if something runs too fast, i increase array sizes in the test until it gets to execute in 1 or 2s. if the test uses too much memory, i decrease the sizes and increase the number of iterations instead
@dzaima i think it is. i've seen "thermal management" or something in bioses
@ngn timing tokenizing requires the payload to be relatively very quick. For pretty much every other speed test before this I've always done n ⎕htime¨ "p1" "p2" manually a couple times