« first day (4070 days earlier)      last day (878 days later) » 
00:00 - 23:0023:00 - 00:00

cmb
11:05 PM
yeah (but peeking and sleeping still feels like a hack – and it doesn't necessarily work in all cases)
 
11:26 PM
it definitely doesn't work in that context where you don't have a reactive "window function" dealing with the problem, sure :-P
those APIs are horrible btw, even if you are doing it "properly" it is so messy, like >2000 lines of code just for a minimum viable example
nothing will ever beat MessageBox() for a horrible API though... so many different versions of that signature making it totally ungooglable, all with way too many magical numeric arguments, all of them with different values for those numbers, none of which make any sense at all
my favourite being VB6 which has vbOK, vbCancel and vbOKCancel where not only is it not a bitmask, but there are no overlapping values anywhere in the whole thing you literally just have to remember the names of shit
 
Wes
gah i am trying to work out an algorithm to smooth out spikes in a sequence of numbers but i can't quite figure it out
i need to take like the previous 5 numbers and the next 5 numbers, and like average them out
 
I can't see any mechanism that is less that O(n^2) certainly
 
@Wes $options = array_map(fn () => 1, $options); // smoothenedet
 
Wes
clever :P
 
:D
 
Wes
11:37 PM
ah well it shouldn't be slow anyway, it's just a few hundred numbers
 
if you figure out the average variance over the whole set, then exclude each data point in turn and reduce anything which has a higher variance than the full set to max, that should produce the graph you describe (I think)
 
Wes
the smoothing should be relative only to the closest numbers
 
that's not what you graph shows...
 
Wes
it's not very accurate :B
 
I don't think it's possible to smooth it without looking at the whole set, but this sort of thing is very much not my strong suit
certainly with 3 data points it's impossible though, you are trying to smooth the spike out realtive to the trend, 3 data points does not give you a trend, even I remember that from being taught scatter plots in school :-P
(3 data points == $current and "the ones either side")
you need the average variance of the whole set to know how it relates to rthe whole set
more than willing to be wrong on this tho, I am not good at this sort of thing
I feel like audio noise reduction algos might have something to offer you here? feels like they do something similar
 
Wes
11:47 PM
$sum = $item[$N]*8 + $item[$N-1]*3 + $item[$N+1]*3 + $item[$N-2]*2 + $item[$N+2]*2 + $item[$N-3]*1 + $item[$N+3]*1;
$avg = $sum / (8 + 3 + 3 + 2 + 2 + 1 + 1);
 
fuck vector math man it's nearly midnight :-P
 
Wes
:P
 
Lol
 
Wes
i feel like i should be using logarithms
i know some of these words
@DaveRandom what if i do multiple passes
like the average of the next index is based on the previous number, which has been already adjusted
 
my main gut feel is... if you only look at what s immediately around you, the error compounds as you move through the set so you will end up artificially creating a trend that isn't really there
 
Wes
11:55 PM
hm
 
like I say, really not my strong suit... needs a stats nerd, ask Bob :-P
 
Wes
i think i'll start by actually rendering this data on a graph, so i can see what i am doing
 
@Wes This is a solved problem, isn't it? Surely there's a well-known statistics algorithm?
 
crawls back under rock :-P
 
Wes
probably... but i have no idea i've never done anything similar before
 
00:00 - 23:0023:00 - 00:00

« first day (4070 days earlier)      last day (878 days later) »