Skip to content
Gather box office estimates to help with Fantasy Movie League.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Deploy Adding deployment scripts to Azure. Oct 8, 2018
MovieMiner.Tests Added BO Mojo Daily miner for the previous weekend's compound numbers… May 1, 2019
MovieMiner BO Report fix for Pokmon. May 9, 2019
MoviePicker.Cognitive Working on OCR stuff. Mar 29, 2019
MoviePicker.Common Add day of week to the default hashtag. May 2, 2019
MoviePicker.Msf Some weirdness in the custom Miner (MineMine). Fixed the Clone() meth… Apr 24, 2019
MoviePicker.Repository Added some DB models. Oct 1, 2018
MoviePicker.Simulations Added Clear() to movie picker. Implemented paste values into new look… Sep 19, 2018
MoviePicker.Tests Merge branch 'master' of https://github.com/SpilledMilkCOM/MooveePicker Apr 22, 2019
MoviePicker.WebApp.Tests Updated Application Insights packages. Feb 1, 2019
MoviePicker.WebApp Added last week theater counts to the CSV extract. May 17, 2019
MoviePicker More tests on Unbounded Knapsack. Apr 17, 2019
TestRunner Updated Application Insights packages. Feb 1, 2019
TheMovieDatabase Updated a few packages: HtmlAgility, NewtonSoft, RestSharp Jan 25, 2019
XUnitTests Updated Application Insights packages. Feb 1, 2019
.gitignore Added Box Office Pro numbers. Aug 30, 2018
LICENSE Initial commit Jun 6, 2017
MooveePicker.sln Added sample script to the Data folder. Nov 21, 2018
README.md Added percent change buttons. Feb 2, 2019
pushFileToAzureWebApp.ps1 Added the PowerShell script to push a file to an Azure Web App. I'm p… Nov 20, 2018

README.md

MooVee Picker

A simulation that picks movies.

Given a set of movies with Earnings and Cost (as well as other rules), chooses the best lineup of movies to run in your theaters.

Basic Algorithm

This is effectively an "unbounded knapsack" problem. Added some hashing (which does not care about the sub-problem order) so not all 4,294,967,296 (16^8) possibilities are attempted. That is worst case if all the items have the same weight and value, but some are much LARGER than others and use up more space meaning that there will be MUCH less room for other movies. You may choose multiples of the same movie provided that it maximizes your return for the list of movies.

If you remove the hashing, a 3 second algorithm, becomes a 54 minute algorithm (depending on your processor speed).

A More Advanced Algorithm

Using the above algorithm to chose the best from a list, this second algorithm manufactures MANY lists based on adjusting the earnings up or down a specified amount. By doing so you can be more confident that your baseline is going to be pretty robust. If there are too many discrepancies from your baseline, then you might want to rethink your values or just be fine with that baseline.

Speculation

Another class that will find the value where your "tent pole" movie becomes irrelevant.

Aside

I'll probably be banned from FML, but oh well. It's still not an exact science... until it IS.

Reference

A reference for the general knapsack (0/1). (you may NOT reuse items, you may only choose a single instance of an item) http://www.programminglogic.com/knapsack-problem-dynamic-programming-algorithm/

Reference for many of the knapsack algorithms. https://en.wikipedia.org/wiki/Knapsack_problem

Microsoft Solver Foundation: https://msdn.microsoft.com/en-us/library/ff524497(v=vs.93).aspx

Actual published website: http://mooveepicker.com/

Tricks for styling sliders (input type range controls) https://css-tricks.com/styling-cross-browser-compatible-range-inputs-css/

Using The Movie Database for movie posters where needed. http://www.themoviedb.org/

The current defaults that I use are on the About page.

Things I learned in this project
  • More Javascript and JQuery shortcuts
    • .sort() on arrays (ascending/descending)
    • .slice(0) to make a shallow clone of array objects.
  • I didn't know that hsl() was a thing in CSS (pretty cool)
  • More about Bootstrap
    • Columns within columns.
    • Grids with headers which switch to labels in mobile view.
  • Twitter
    • Large summary cards are clipped, supposed to be 2:1 aspect but 600x314 works better
    • Emoji's
  • Phone browsers are weird.
  • Browsers support PNG file format as a "favicon" (don't need the old ICO file anymore - YAY!)
  • How to add Application Insights to monitor the web app.
  • How to add Adsterra.com ads (removed them due to ads that take over your browser - NOT GOOD)
  • More about Open Graph Facebook's standard for web page metadata.
Azure Notes
  • Application Settings
    • Change from default 32 bit to 64 bit
    • Turned OFF ARR Affinity to improve performance
    • Added connection string here
  • Added some alerts
    • A classic alert for memory
    • A new alert that encomasses just about everything else.
  • Added an auto scale out in the App Service Plan >80% memory +1 instance.
    • Added notification
  • There is no default to scale the instances back down. Had to add one when memory is <10% decrement an instance.
You can’t perform that action at this time.