Production algorithm tricks anyone?
1–10 of 20 posts
Re: Production algorithm tricks anyone?
#2https://en.wikipedia.org/wiki/B-tree
Re: Production algorithm tricks anyone?
#3http://www.drdobbs.com/cpp/misusing-floating-point-arithmeti...
http://www.drdobbs.com/cpp/some-programs-are-poorly-designed...
Re: Production algorithm tricks anyone?
#4Could you describe your current implementation and its elegance?
Re: Production algorithm tricks anyone?
#5>"we had used a random number generator within a segmented number range." Could you describe your current implementation and its elegance?
generate a random number between 0:100 if the number is 0-30 the Ad 1 has to be shown if the number is 30-70 the Ad 1 has to be shown else RTB is to be called
The servers can be now independent and no need to share the state, or have a lock based counter. For large number of requests, and with a good random number generator, you will get good results.
Re: Production algorithm tricks anyone?
#6Re: Production algorithm tricks anyone?
#7 float Q_rsqrt( float number )
{
long i;
float x2, y;
const float threehalfs = 1.5F;
x2 = number * 0.5F;
y = number;
i = * ( long * ) &y; // evil floating point bit level hacking
i = 0x5f3759df - ( i >> 1 ); // what the fuck?
y = * ( float * ) &i;
y = y * ( threehalfs - ( x2 * y * y ) ); // 1st iteration
// y = y * ( threehalfs - ( x2 * y * y ) ); // 2nd iteration, this can be removed
return y;
}
https://en.wikipedia.org/wiki/Fast_inverse_square_rootRe: Production algorithm tricks anyone?
#8For scaling view counters on the pages of popular videos Youtube increments the counter by N views with 1/N probability for each actual view. Or so I've been told.
Re: Production algorithm tricks anyone?
#9For scaling view counters on the pages of popular videos Youtube increments the counter by N views with 1/N probability for each actual view. Or so I've been told.
Re: Production algorithm tricks anyone?
#10>"we had used a random number generator within a segmented number range." Could you describe your current implementation and its elegance?
Ad 1 has to be shown 30% of the traffic Ad 2 has to be shown 40% of the traffic Remaining has to be given to RTB generate a random number between 0:100 if the number is 0-30 the Ad 1 has to be shown if the number is 30-70 the Ad 1 has to be shown else RTB is to be called The servers can be now independent and no need to share the state, or have a lock based counter. For large number of requests, and with a good rando…