task

4800-v-007-001

[previously]

  1. [REFERENCE] prj4800
    1. ] # # - plan - overview
    2. ] # # - document -
  2. [2015-06-24]
    1. ] # # -
  3. [00:00] NEW task IN DATA
    1. +] # 340 - driver joe nemechek
  4. [2015-06-25][00:00] NEW task IN
    1. x] ADD -  .costThisRace - to each driver record,  ,"costThisRace":"5.00"
    2. *] used VALUES for sonoma race
    3. *] ENTERED VALUES for michigan race in sheet
  5. [2015-06-25] NEW task IN FIX-PRB
    1. ] FIX-PRB# # - no longer writing file
    2. ] revert to old code
      1. ] rem out -  loop - process data, x] File writes
  6. [00:00] NEW task IN FIX-PRB# #
    1. x] TRY = CHECK data - x] found 4 records, no field added ( nemechek, r.blaney, moffitt, bliss ), x] added field, x] changed status to "asked" *] set value of cTR=4.00 which is NOT valid,
    2. *] should work/test with small tight data sets)
    3. x] TRY = return loop to code
    4. x] RESULT = no change
  7. [00:00] NEW task IN FIX-PRB
    1. x] TRY = rem out new line for "costThisRace"
    2. x] RESULT = no change
    3. *] UPDATE DATA change = truex jr missing "practiceF" value, added set val=10 (not actual)
  8. [00:00] NEW task IN BREAKDOWN
    1. i] breakdown createRankings1() FROM: 1 big process TO: several smaller processes
    2. ] breakdown into 1 big process INTO ] saveEntrants w/AvgFinish aka rankings-1 ] saveQualified aka-rankings-2, ] saveLastPractice, --> ] saveFinal
  9. [00:00] NEW task IN FIX-PRB - prb loc in loop, prj line eval
    1. x] TRY = rem just the eval line in the loop
    2. x] RESULT  = CAUSE - this appears to be the problem, ? = why did it work before
    3. x] TRY = instead of processing the whole data set (driRank.length), just do a few 
    4. x] RESULT = 10 - still broke, 5 = works, 6 = FAIL, PRB = record 5
    5. x] record 5 = PRB id.team=14 - had a bunch of new line char's in the json
    6. x] record 6 = PRB id.team=22 - extra comma,
    7. x] SOLUTION = problem WAS NOT in code, PRB was in DATA, bad data broke the code, (REMEMBER how sensitive js is)
    8. *] deprecated = home.js-v-006
  10. [14:00] NEW task
    1. x] deprecate = home.js-v-007 - cleaned out greenspace, ] should REVIEW code try/fail/... for project notes(lrn node,pass)
  11. [15:00] NEW task IN BREAKDOWN
    1. x] split into createRankings1() into 3 functions createRankings1, createRankings2, createRankings3,
    2. x] all write file, but different file,
    3. x] incrementally increase data fields,+qualified, +finalP, +costThisRace, 2 and 3 do the same processing as 1
    4. x] REMOVED driverRank from inside function, to outside(global)
  12. [16:00] NEW task IN FIX PRB
    1. x] accidentally deleted a closing bracket, toss another hour into the sea :(
  13. >> [17:00] NEW task IN ADD makeSelections(idx) - a recursive function to select best picks
    1. i] # # - CREATE-function -  makeSelection(availBudget) - recursive function to keep making selections(based upon availBudget) until roster is set
    2. x] SUCCESS ] function is executing, ] function is executing the correct # of times BUT
    3. i] PRB  function is not accessing arrary vars in driverRankings
    4. ] ADD conditons, budget,
    5. x] TRY=  move call to function inside of createRankingsFile, this should give access to local var driRanks, PASS driRank as arg
    6. x] RESULT = FAIL
  14. [18:00] NEW task IN
    1. x] # # - CREATE-function -  makeSelections2(array) 
    2. x] iterate array, ] pick form top (passed array has been sorted by points)
    3. x] push into selections array
    4. x] budget, budgetBalance, balance = budget - selection;   
    5. x] ADD condition, - dont push selection unless budget ( if arr[i].cost < budget){select, adjust budget} )
    6. *] cur result pick# 5 (kenseth)  puts selections over budget,
    7. x] deprecated home-v-008
  15. [2015-06-27] NEW task IN
    1. i] # # - UPDATE-function -createRankings2, ADD selections code
    2. x] makeSelections2 IS functional, currently using "Rankings1"
    3. ] ADD functionality:  TO:call makeSelections(), call raceStatusChanged()  x] createRankings- 2, x] 3/final -
    4. ] change initial CALL to createRankings1, to createRankings2,
    5. ] PRB = writing file but no content, , rankings page display info
    6. ] CAUSE = calling raceStatusChange immediately after filewrite op must break filewrite, creates file but has no content
    7. ] RESOLUTION/WORKAROUND - move call to raceStatusChange back to orig location
    8. *] use curRace.setStatus <> raceStatusChanged()  
  16. [00:00] NEW task IN
    1. i] # # - UPDATE-function -createRankings3, ADD selections code
    2. *] REM saveFile rankings3
    3. *] PRB - selections top 4 drivers max out budget, no fifth selection

 

[currently]

  1. ]

[next]

  1. [00:00] NEW task IN
    1. ] # # - 007-002 DATA for race# 16
  2. [00:00] NEW task IN
    1. ] # # - FIX-PRB selections - picking only 4 drivers

 


[] selections - recursion

> write loop to do something

- example multiple num * by 10

> put loop into function ( pass in arg)

 >> CREATE - article# 5327 recursion - javascript

[] selection

 return driver.rankPoints where driver.costThisRace <= budget.balance

selections = selections + 1;

> function  getDriverWithMostPoints( budgetBalance){

      for (i=0;i<rankings.length;i++){ 

          selections = selections + 1;

         // return rankings[0].name;

        return i;  

         budgetBalance = budget - rankings[0].costRace

   }

> function getSelections(){

        while (selections < 4) {

              selections++;

               getDriverWithMostPoints(budgetBalance);

        }

}

> function checkBudget()

        for (i=, i<=, i++){

}

 

list of drivers, drivers have been ranked with points to determine which are the best choices, each driver also has a cost between 5-30, typically the drivers with the highest rankings have the highest cost 

NEED = to pick 5 drivers, WANT = the 5 best drivers(most points)

BUT = i only have budget of $100 to spend on all 5 driver

AND = i must have 5 drivers on my driver roster

 

manually i would 

- select top ranked driver , - add to list, -subtract cost from budget

- select 2 ranked driver, - add to list, - sub d

- select 3rd ranked driver, - add to list, subract driver.costRace from budget 

( at this point, HAVE = i will have 3 selections, likely have used about 80-90 $/% of my budget

NEED = make to make 2 more selections, most points for ( budgetBalance$ )  

BUT = function getDriverWithMostPoints will return a driver AND NOT LEAVE enough $ to make the final selection

 - cheapestDriver =

 

2015-06-27 to the remote server.
11:56:14 AM: Updating file (nascar.sospep.com\2015-15-rankings-1.json).
11:56:14 AM: Updating file (nascar.sospep.com\2015-15-rankings-2.json).
11:56:14 AM: Updating file (nascar.sospep.com\2015-15-rankings-3.json).
11:56:14 AM: Updating file (nascar.sospep.com\2015-15-rankings-final.json).
11:56:14 AM: Updating file (nascar.sospep.com\routes\home.js).
11:56:14 AM: Updating file (nascar.sospep.com\views\rankings.jade).
11:56:14 AM: Publish completed.

 

 

Details Photos Edit more

Details

ID: 5325

NAME: 4800-v-007-001

DESCRIPTION: ] makeSelections() ] makeSelections2() ] divide createRankings FROM single function TO multiple functions( x] entrants, x] qualified, ] practice, x] final)

START DATE TIME: 2015-06-24 21:00:00

EST DURATION: 01:00:00

END DATE TIME: 2015-06-24 22:00:00

STATUS: Completed

PRIORITY: -5

OWNER ID: 75

Content Photos Edit more

photos

photos for this task

actions

Agenda Email task SMS task Priorities