Skip to content

Commit

Permalink
fix signup comments and add pem key to aws server
Browse files Browse the repository at this point in the history
  • Loading branch information
henrychen0220 committed Mar 12, 2019
1 parent 24513d6 commit fc3ebf2
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 11 deletions.
23 changes: 23 additions & 0 deletions balancedbiteKey.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
-----BEGIN RSA PRIVATE KEY-----
MIIEowIBAAKCAQEAomVOLL7mzD00IGZelZvuLlcbMVJdWQstU0Uyx1pSnVVGkze4PIXLh9Lwd5T4
SWYAbUBCd3uyF47bxsBFW1PlSSEYTB5ERipmHfdNOjNZPT0PDeGJkwxr1V7NG6aQKI8WAABz/RrS
RUgOS4xzZeeZQMUjd/QL5UdCGU0A3JiX6uxFlmP4UEcrChlPaGILCTIJDUE+2TrxzfQiAPDrEvYc
DYUVKEAG3vS/QdKutuwxkWjTCi/a2Ak9T9gXe2NRIq8afTCgfZvy3ytjp7vgTF97b7FXkt4bTVux
5ARzSvgv/ey+6vVx2HOF73hwxnYW6ZAYIRHmDG2omFuACWU4nDU50QIDAQABAoIBAFWF6H+kIcQZ
z2PoxZMgxXTeJtH4wHRucHZUEQPvy2ZUTJCnXX1yMNfc/QrdB00QTNU8bESkfgvuDkxDYcNREYVL
ypH7tpUFKzZI0QD/ndWkXFNBHcS1W+zIulf/hhf2Eu35TxxSjb4yzmR3GSbnq0vzBlTbz4/10Rel
9/g03Hy5DnZ8lq8d8yACupTVCIurzAA6KPhBq5GERNFVMOqgML4aREebKoKfNxqyg1CMqssMgyAN
bX5yNQ5ER0W28xY1EnUJ8CzuHqmM58SnzuuWbiTT494THV2Yij6ge64tGX3f56/Dkv56TPgGNudI
Z2uBzfFnBhspgswv1uiFyveyOoECgYEA1uL9UJpy+h4t7wXeeNX0wZ/jJW37ueJJs5iO/fxCZ33i
56veRg/uMztpE91v1AUai9mRPRD7Q+1g73TIUdcXJk7dcUVrS3soGvGlzrb6dhTTaG7nQQx7JXbH
mkyloKRU/xZpW2/VHKsF5XLuSd5sAQaEbPiVDQVWQOUmXajCzfkCgYEAwXdXyD6g5DKQDPGU0D91
499PhdtCCc5S/nB/OPgEEZ24BrHGic3AeHV7UTe+pq8/DnkkQ6TJ+epH4cyOYcX6PiFi4p9Jvfx0
up1BnHvp5WRYkPiQ3n2nsFjsfI3uGlAaZosi7z67McEIvL5ywqUovM/HfpwD8JQdEBVrrJyRIJkC
gYAMoVLaRfm0EcoJXoLw/0JfjxI+xPQivNYwJCtjakxM4O1RSJzL6WvKvxcx/7Xu9E3XInaS7EiY
eX9VE7wic039Bm2llrrzuM1mqAVi3QZjol26qaoV/LHQReb9frvNcVs9kwemRDB2eubh0ZuH4/bd
KJDoBsRb+5BSSCW1I5IvoQKBgEUu9Ek7fDWejzzRtzGxP+s5FCr9+WOgULWEbTpmFq5mBEUAlcr5
tPZerLaihJ7+1EHMuFcoOsIQMZxhlhkIvzAwqDf6VliGSwfg7HGVLlNFyxYsjUHDFZBOfGMeLiNi
uc4pu1hqym5EZWd5g3hvr121v9Va3V3O2YXC4zpa0tshAoGBAK/VDsDen5pR1DQH8iyxuCp+gAt+
tJSpXeVYgfx+COtIS3Os/Rcly2TbfZvm4FMe27PIELEG3EI9lx4pvO5bwrCiy19HsF3QThY0o/Xu
1ccyP2QIlJ+8Wr6/di3MLdFwf9uWkJG+faXsh9obi1Er8VHXNWZis+SULmuNO14ys9pO
-----END RSA PRIVATE KEY-----
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import edu.uci.ics.balancedbite.web.api.FoodInfo;
import edu.uci.ics.balancedbite.web.db.MongoDBRequest;

// mvn exec:java -Dexec.mainClass="com.vineetmanohar.module.Main"
public class loadFoods {
public static List<FoodInfo> readAllFoods(String fileName) throws JsonParseException, JsonMappingException, IOException {
String filePath = "src/main/resources/foodData/" + fileName + ".json";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,14 @@ public static double calculateBMI(int weight, int height) {
* Adult male: 66 + (6.3 x body weight in lbs.) + (12.9 x height in inches) - (6.8 x age in years) = BMR
* Adult female: 655 + (4.3 x weight in lbs.) + (4.7 x height in inches) - (4.7 x age in years) = BMR
*
* kg -> 1 : 2.20462 -> lb
* cm -> 1 : 0.393701 -> inches
* kg = 1 : 2.20462 = lb
* cm = 1 : 0.393701 = inches
*
* @return
* @param sexes user sex
* @param weight user weight
* @param height user height
* @param age user age
* @return user calculated BMR
*/
public static double calculateBMR(String sexes, int weight, int height, int age) {
double weightInlbs = weight * 2.20462;
Expand All @@ -76,15 +80,17 @@ public static double calculateBMR(String sexes, int weight, int height, int age)
* http://www.checkyourhealth.org/eat-healthy/cal_calculator.php
*
* If you are sedentary (little or no exercise) : Calorie-Calculation = BMR x 1.2
If you are lightly active (light exercise/sports 1-3 days/week) : Calorie-Calculation = BMR x 1.375
If you are moderately active (moderate exercise/sports 3-5 days/week) : Calorie-Calculation = BMR x 1.55
If you are very active (hard exercise/sports 6-7 days a week) : Calorie-Calculation = BMR x 1.725
If you are extra active (very hard exercise/sports & physical job or 2x training) : Calorie-Calculation = BMR x 1.9
* If you are lightly active (light exercise/sports 1-3 days/week) : Calorie-Calculation = BMR x 1.375
* If you are moderately active (moderate exercise/sports 3-5 days/week) : Calorie-Calculation = BMR x 1.55
* If you are very active (hard exercise/sports 6-7 days a week) : Calorie-Calculation = BMR x 1.725
* Otherwise: BMR x 1.9
*
*
*
*
* @return
* @param sexes user sex
* @param weight user weight
* @param height user height
* @param age user age
* @param workoutFreq user workout frequency
* @return user calories needed daily
*/
public static int calculateCalories(String sexes, int weight, int height, int age, int workoutFreq) {
double BMR = calculateBMR(sexes, weight, height, age);
Expand Down

0 comments on commit fc3ebf2

Please sign in to comment.