

roryk
Forum Replies Created
-
You don’t need any of the midpoint calculation, the answer in radians is atan ab%bc
-
{x where not(&’:)” “=x} / 23 chars and fast f[not(&’:)” “=] / as a projection
-
roryk
MemberFebruary 15, 2024 at 12:00 am in reply to: Strange data type prevents table operation on what looks like a tableHow come ‘exec col1 from tab’ doesn’t collapse, but tab `col1 does?
-
roryk
MemberFebruary 15, 2024 at 12:00 am in reply to: Strange data type prevents table operation on what looks like a tableDropping into k can be useful to see the representation. Tab is +`time`col1`col2!(times;(`col11`col12!1 3;`col11`col12!5 33);(`col11`col12!1 3;`col11`col12!5 33))
What’s interesting is that
exec col1 from tab
then produces
(`col11`col12!1 3;`col11`col12!5 33)
But pasting this into the repl gives back a table,
+`col11`col12!(1 5;3 33)
So it seems like there’s some automatic table conversion that’s not happening in exec, that does happen in other cases. Interesting! Not much of an answer, but might help to find one.
-
roryk
MemberFebruary 15, 2024 at 12:00 am in reply to: Strange data type prevents table operation on what looks like a tableInteresting, thanks. So is tab `col1 semantically different to tab.col1? Unexpected (to me anyway)
-
Hi Michaela,
Thanks for explaining the behaviour, I managed to fix the function and now it passes. I was joining on more columns than required. I see why you don’t need to join on lapId, but does it not make sense to join on date/session? Any default values from another date or session don’t seem like they would be particularly meaningful to me. Or is it expected to do any filtering before using the function, and therefore it’s not an issue? This doesn’t matter for the capstone, it’s more out of curiosity and what might be expected in practice.
-
roryk
MemberApril 15, 2023 at 12:00 am in reply to: Issues with Filling Missing Values in DictionariesYou can use fill, you just have to convert to symbols and back.
string `na^`$d
The provided solution is probably better though.
-
Something like advent of code might be more like what you’re looking for, it’s not language specific but the problems are fun and it’s good practice.
-
I would define
round:{(floor 0.5+y*i)%i:10 xexp x}
and then you can do
select time, sym, round[1]price from trade.
As a bonus, this works with negative numbers too, round[-3; 12345.678] is 12000.
-
Each is an iterator/adverb – what that line does is applies pub to each item of ’til count subs’, not applying pub to ‘each til count subs’.
-
Hi Megan,
Thanks for the information!
It would be interesting to know the reason, but I don’t want to take up too much of a dev’s time for a random curiosity. If someone is free to look into it and would want to, then it would be interesting to know but no problem if not. -
Hi, the file doesn’t contain spaces, it’s just one word per line. So the results are the same. If mmap is faster, is there a reason read0 doesn’t use it, or is it just a potential optimisation that hasn’t been implemented?
It doesn’t really matter as only a couple of milliseconds for even a fairly large file, but it would be nice to have a deeper understanding of the performance of various operations.