stevenjenkins / baskets Goto Github PK
View Code? Open in Web Editor NEWLoan basket calculator
Loan basket calculator
This contains an implementation to calculate the optimum set of loans given a comma-delimited input file of loans and loan sets in the following format: loan id, loan amount, set id, set minimum, set maximum ... USAGE: The program should be invoked as: build_loan_sets.rb -i <input file> For example: build_loan_sets.rb -i loan-basket-01.csv and will generate a file loan-based-01.out.csv containing the allocations. INPUT FILE FORMAT NOTES: If there are more loans than sets (the usual case), then the columns for loan sets should be empty; e.g., 1004,183000,,, If there are more sets than loans, then the CSV columns should just be blank, e.g.: ,,14,2000000,4000000 MANIFEST: README - this file build_loan_sets.rb - the program sample.rb - a sample script using the NP API test.rb - a set of tests extconf.rb - an internal program to build the NP API mulknap.c - the underlying knapsack algorithm solution code np.c - the bridge code between Ruby and mulknap.c loan-basket-01.csv - a sample input dataset loan-basket-01-out.csv - a sample output dataset INSTALLATION: - on a Unix system that has Ruby installed, installation is simply: ruby extconf.rb make - on a Windows system, installation is essentially the same, but the devkit package must be installed. Somewhat detailed steps are: 1- install Ruby 1.8.7 to C:\Ruby (http://rubyforge.org/frs/download.php/72085/rubyinstaller-1.8.7-p302.exe) 2- install DevKit (http://rubyinstaller.org/add-ons/devkit/); note that this will also need the 7-zip software: http://www.7-zip.org/ 3- start a command shell 4- cd to the directory containing this file 5- run "ruby extconf.rb" 6- run "make" 7- you can then run "build_loan_sets.rb -i loan-basket-01.csv" to regenerate the sample output file. If Windows complains that it cannot open the file build_loan_sets.rb, you can specify to use ruby in the invocation, i.e., ruby build_loan_sets.rb -i loan-basket-01.csv
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.