edit-task
Home
Up
Delete
Task Name:
Task Description:
] makeSelections() ] makeSelections2() ] divide createRankings FROM single function TO multiple functions( x] entrants, x] qualified, ] practice, x] final)
TaskGroup ID:
Start Date:
Start Time:
Duration:
Priority:
Status:
To Do
Completed
In Process
Add Photo:
Owner ID:
Content:
use HTML
Edit Content
<h1 style="text-align: center;">4800-v-007-001</h1> <h2>[previously]</h2> <ol> <li><strong>[REFERENCE] prj4800 </strong></li> <ol> <li>] # # - <a href="/view/tasks?id=434" target="_blank">plan</a> - <a href="/view/task?id=4800" target="_blank">overview</a></li> <li>] # # - <a href="/view/tasks?id=435" target="_blank">document</a> -</li> </ol> <li><strong>[2015-06-24] </strong></li> <ol> <li>] # # -</li> </ol> <li><strong>[00:00] NEW task IN DATA</strong></li> <ol> <li>+] # 340 - driver joe nemechek</li> </ol> <li><strong>[2015-06-25][00:00] NEW task IN </strong></li> <ol> <li>x] ADD - .costThisRace - to each driver record, ,"costThisRace":"5.00"</li> <li>*] used VALUES for sonoma race</li> <li>*] ENTERED VALUES for michigan race in sheet</li> </ol> <li><strong>[2015-06-25] NEW task IN FIX-PRB</strong></li> <ol> <li>] FIX-PRB# # - no longer writing file</li> <li>] revert to old code</li> <ol> <li>] rem out - loop - process data, x] File writes</li> </ol></ol> <li><strong>[00:00] NEW task IN FIX-PRB# #</strong></li> <ol> <li>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,</li> <li>*] should work/test with small tight data sets)</li> <li>x] TRY = return loop to code</li> <li>x] RESULT = no change</li> </ol> <li><strong>[00:00] NEW task IN FIX-PRB</strong></li> <ol> <li>x] TRY = rem out new line for "costThisRace"</li> <li>x] RESULT = no change</li> <li>*] UPDATE DATA change = truex jr missing "practiceF" value, added set val=10 (not actual)</li> </ol> <li><strong>[00:00] NEW task IN BREAKDOWN </strong></li> <ol> <li>i] breakdown createRankings1() FROM: 1 big process TO: several smaller processes</li> <li>] breakdown into 1 big process INTO ] saveEntrants w/AvgFinish aka rankings-1 ] saveQualified aka-rankings-2, ] saveLastPractice, --> ] saveFinal</li> </ol> <li><strong>[00:00] NEW task IN FIX-PRB - prb loc in loop, prj line eval</strong></li> <ol> <li>x] TRY = rem just the eval line in the loop</li> <li>x] RESULT = CAUSE - this appears to be the problem, ? = why did it work before</li> <li>x] TRY = instead of processing the whole data set (driRank.length), just do a few </li> <li>x] RESULT = 10 - still broke, 5 = works, 6 = FAIL, PRB = record 5</li> <li>x] record 5 = PRB id.team=14 - had a bunch of new line char's in the json</li> <li>x] record 6 = PRB id.team=22 - extra comma,</li> <li>x] SOLUTION = problem WAS NOT in code, PRB was in DATA, bad data broke the code, (REMEMBER how sensitive js is)</li> <li>*] deprecated = home.js-v-006</li> </ol> <li><strong>[14:00] NEW task</strong></li> <ol> <li>x] deprecate = home.js-v-007 - cleaned out greenspace, ] should REVIEW code try/fail/... for project notes(lrn node,pass)</li> </ol> <li><strong>[15:00] NEW task IN BREAKDOWN</strong></li> <ol> <li>x] split into createRankings1() into 3 functions createRankings1, createRankings2, createRankings3,</li> <li>x] all write file, but different file,</li> <li>x] incrementally increase data fields,+qualified, +finalP, +costThisRace, 2 and 3 do the same processing as 1</li> <li>x] REMOVED driverRank from inside function, to outside(global)</li> </ol> <li><strong>[16:00] NEW task IN FIX PRB</strong></li> <ol> <li>x] accidentally deleted a closing bracket, toss another hour into the sea :(</li> </ol> <li><span style="background-color: #ffff00;"><strong>>> [17:00] NEW task IN ADD makeSelections(idx) - a recursive function to select best picks</strong></span></li> <ol> <li>i] # # - CREATE-function - makeSelection(availBudget) - recursive function to keep making selections(based upon availBudget) until roster is set</li> <li>x] SUCCESS ] function is executing, ] function is executing the correct # of times BUT</li> <li>i] PRB function is not accessing arrary vars in driverRankings</li> <li>] ADD conditons, budget,</li> <li>x] TRY= move call to function inside of createRankingsFile, this should give access to local var driRanks, PASS driRank as arg</li> <li>x] RESULT = FAIL</li> </ol> <li><strong>[18:00] NEW task IN</strong></li> <ol> <li><strong>x] # # - CREATE-function - makeSelections2(array) </strong></li> <li>x] iterate array, ] pick form top (passed array has been sorted by points)</li> <li>x] push into selections array</li> <li>x] budget, budgetBalance, balance = budget - selection; </li> <li>x] ADD condition, - dont push selection unless budget ( if arr[i].cost < budget){select, adjust budget} )</li> <li>*] cur result pick# 5 (kenseth) puts selections over budget,</li> <li><strong>x] deprecated home-v-008</strong></li> </ol> <li><strong>[2015-06-27] NEW task IN</strong></li> <ol> <li><strong>i] # # - UPDATE-function -createRankings2, ADD selections code</strong></li> <li>x] makeSelections2 IS functional, currently using "Rankings1"</li> <li>] ADD functionality: TO:call makeSelections(), call raceStatusChanged() x] createRankings- 2, x] 3/final -</li> <li>] change initial CALL to createRankings1, to createRankings2,</li> <li>] PRB = writing file but no content, , rankings page display info</li> <li>] CAUSE = calling raceStatusChange immediately after filewrite op must break filewrite, creates file but has no content</li> <li>] RESOLUTION/WORKAROUND - move call to raceStatusChange back to orig location</li> <li>*] use curRace.setStatus <> raceStatusChanged() </li> </ol> <li><strong>[00:00] NEW task IN</strong></li> <ol> <li><strong>i] # # - UPDATE-function -createRankings3, ADD selections code</strong></li> <li><strong>*] REM saveFile rankings3</strong></li> <li>*] PRB - selections top 4 drivers max out budget, no fifth selection</li> </ol></ol> <p> </p> <h2>[currently]</h2> <ol> <li>]</li> </ol> <h2>[next]</h2> <ol> <li><strong>[00:00] NEW task IN </strong></li> <ol> <li>] # # - 007-002 <strong>DATA for race# 16</strong></li> </ol> <li><strong>[00:00] NEW task IN</strong></li> <ol> <li>] # # - FIX-PRB selections - picking only 4 drivers</li> </ol></ol> <p> </p> <hr /> <p><strong>[] selections - recursion</strong></p> <p>> write loop to do something</p> <p>- example multiple num * by 10</p> <p>> put loop into function ( pass in arg)</p> <p> >> CREATE - article# 5327 recursion - javascript</p> <p><strong>[] selection</strong></p> <p> return driver.rankPoints where driver.costThisRace <= budget.balance</p> <p>selections = selections + 1;</p> <p>> function getDriverWithMostPoints( budgetBalance){</p> <p> for (i=0;i<rankings.length;i++){ </p> <p> selections = selections + 1;</p> <p> // return rankings[0].name;</p> <p> return i; </p> <p> budgetBalance = budget - rankings[0].costRace</p> <p> }</p> <p>> function getSelections(){</p> <p> while (selections < 4) {</p> <p> selections++;</p> <p> getDriverWithMostPoints(budgetBalance);</p> <p> }</p> <p>}</p> <p>> function checkBudget()</p> <p> for (i=, i<=, i++){</p> <p>}</p> <p> </p> <p>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 </p> <p>NEED = to pick 5 drivers, WANT = the 5 best drivers(most points)</p> <p>BUT = i only have budget of $100 to spend on all 5 driver</p> <p>AND = i must have 5 drivers on my driver roster</p> <p> </p> <p>manually i would </p> <p>- select top ranked driver , - add to list, -subtract cost from budget</p> <p>- select 2 ranked driver, - add to list, - sub d</p> <p>- select 3rd ranked driver, - add to list, subract driver.costRace from budget </p> <p>( at this point, HAVE = i will have 3 selections, likely have used about 80-90 $/% of my budget</p> <p>NEED = make to make 2 more selections, most points for ( budgetBalance$ ) </p> <p>BUT = function getDriverWithMostPoints will return a driver AND NOT LEAVE enough $ to make the final selection</p> <p> - cheapestDriver =</p> <p> </p> <p><strong>2015-06-27 to the remote server.</strong><br />11:56:14 AM: Updating file (nascar.sospep.com\2015-15-rankings-1.json).<br />11:56:14 AM: Updating file (nascar.sospep.com\2015-15-rankings-2.json).<br />11:56:14 AM: Updating file (nascar.sospep.com\2015-15-rankings-3.json).<br />11:56:14 AM: Updating file (nascar.sospep.com\2015-15-rankings-final.json).<br />11:56:14 AM: Updating file (nascar.sospep.com\routes\home.js).<br />11:56:14 AM: Updating file (nascar.sospep.com\views\rankings.jade).<br />11:56:14 AM: Publish completed.</p> <p> </p> <p> </p>