Coder Social home page Coder Social logo

bball's Introduction

Dev Setup

# Ensure ruby 2.0.0 is available to this project

bundle install
be rake db:create
be rake db:migrate
be rake db:seed
bundle exec rails server

# Browse to http://localhost:3000

Assumptions

  1. If a player lacks an entry for a particular statistic, such as hits, the value of that statistic is set to zero.

  2. If deriving a statistic requires division by zero, the value of that derived statistic is nil.

TODO

  1. Add support for dataTables UI images (sort arrows, etc.).

  2. Add tests.

Statistics Formulas

Source: Wikipedia

AVG: batting_average
HR: home_runs
SB: steals
RBI: rbi
RUNS: runs
OPS: on_base_plus_slugging

batting_average = hits / at_bats
on_base_plus_slugging = on_base_percentage + slugging_average
slugging_average = total_bases / at_bats
total_bases = 1 * (hits) + 2 * (doubles) + 3 * (triples) + 4 * (home_runs)
on_base_percentage = (hits + walks + hit_by_pitch) / (at_bats + walks + sacrifice_hits + hit_by_pitch)

Time to Completion

Coding

3 hours 20 minutes

Packaging deliverables and deploying

1 hour 45 minutes (mostly learning how to use heroku and postgresql)

Total

5 hours 5 minutes

bball's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.