Friday, July 30, 2004

Peer-To-Peer Movie Rentals

Number Slate is revolutionizing the way you rent movies. Are you tired of being limited to only "3 movies at a time"? Tired of waiting several days for your DVD to arrive at the distribution center, then waiting several more days for the next one to come back? Tired of DVDs arriving damaged? Tired of uncertainty about what movie will arrive next? Number Slate has solved all these problems.

Q: I just love computer science. Can you show me the code that figures out how many movies I can have at once?

A: Certainly. First we get the average number of days you keep each DVD with a SQL query to our database. Then we use the following code to decide how many DVDs you should have.

if (avg_time < cust_limit =" 10;"> 31)
cust_limit = 1;
else
cust_limit = static_cast((24 - (avg_time - 7))/3 + 2);

Pretty cool, huh?

No comments: