query
stringlengths 9
34k
| document
stringlengths 8
5.39M
| negatives
sequencelengths 19
20
| metadata
dict |
---|---|---|---|
addRestInfoWatchDb() adds price change, percentage change to the database | function addRestInfoWatchDb(sym, previousPrice) {
var dbPath = "watchlist/" + sym,
change,
pctChange;
console.log("in addRestInfoWatchDb()");
// get current stock price from database and calculate change in price
database.ref(dbPath).on("value", (snapshot) => {
change = snapshot.val().stockPrice - previousPrice;
console.log("change in addRestInfoWatchDB: " + change);
}, (errorObject) => {
console.log("Errors handled: " + JSON.stringify(errorObject));
});
pctChange = change / previousPrice;
currentWatchRow.pctChange = pctChange;
currentWatchRow.previousPrice = previousPrice;
currentWatchRow.change = change;
console.log("current watch row: " + JSON.stringify(currentWatchRow));
database.ref(dbPath).update({
previousPrice,
change,
pctChange
}, (errorObject) => {
console.log("Errors handled: " + JSON.stringify(errorObject));
});
} | [
"function addRestInfoWatchDb(sym, previousPrice) {\n var dbPath = \"/watchlist/\" + sym,\n change,\n pctChange;\n\n console.log(\"in addRestInfoWatchDb() dbPath: \" + dbPath);\n\n // get current stock price from database and calculate change in price\n database.ref(dbPath).on(\"value\", (snapshot) => {\n change = snapshot.val().stockPrice - previousPrice;\n console.log(\"change in addRestInfoWatchDB: \" + change);\n }, (errorObject) => {\n console.log(\"Errors handled: \" + JSON.stringify(errorObject));\n });\n pctChange = change / previousPrice;\n currentWatchRow.pctChange = pctChange;\n currentWatchRow.previousPrice = previousPrice;\n currentWatchRow.change = change;\n\n console.log(\"current watch row: \" + JSON.stringify(currentWatchRow));\n\n database.ref(dbPath).update({\n previousPrice,\n change,\n pctChange\n }, (errorObject) => {\n console.log(\"Errors handled: \" + JSON.stringify(errorObject));\n });\n }",
"function addToWatchDb(sym, price) {\n var dbPath = \"watchlist/\" + sym;\n\n currentWatchRow.currentPrice = price;\n database.ref(dbPath).update({\"stockPrice\": price});\n }",
"function addToWatchDb(sym, price) {\n var dbPath = \"/watchlist/\" + sym;\n\n currentWatchRow.currentPrice = price;\n console.log(\"in addToWatchDb() appUser.authenticated = \" + appUser.authenticated);\n if (appUser.authenticated) {\n appUser.addToWatch(sym);\n }\n database.ref(dbPath).update({\"stockPrice\": price});\n }",
"async price_update() {}",
"function saveApis(data) {\n \n defineDBSchema(2);\n firstDBShemaVersion(1);\n db.open();\n\n /* data.forEach(function(item) {\n db.apis.put(item);\n console.log('saved api', item.apiName);\n });\n */\n\n db.transaction('rw', db.apis, function() {\n data.forEach(function(item) {\n db.apis.put(item);\n console.log('added api from txn', item.apiName);\n });\n }).catch(function(error) {\n console.error('error', error);\n });\n \n\n // .finally(function() {\n // db.close(); \n // });\n }",
"function getLivestockDB() {\n db.transaction(function (transaction) {\n transaction.executeSql('SELECT * FROM livestock', [], function (tx, results) {\n var data2Arr = Array.from(results.rows);\n updateLivestockView(data2Arr, results.rows.length)\n }, null);\n });\n}",
"function saveResults(db, type){\n\t\tvar test = getSelectedTest().id;\n\t\tif (test == 0 || test == 1)\n\t\t\ttest = \"post\";\n\t\telse if (test == 2 || test == 3)\n\t\t\ttest = \"get\";\n\t\telse if (test == 4 || test == 5)\n\t\t\ttest = \"update\"\n\n\t\tvar time = $scope.time;\n\t\tfirebase.database().ref('test_history/' + test + '/' + db.name.toLowerCase() + '/' + type).push({\n\t\t\tip: ipInfo,\n\t\t\ttime_ms: time\n\t\t});\n\n\t\t$scope.completedTests.push({\n\t\t\tdb: db,\n\t\t\ttime: time,\n\t\t\tresult: \"Sucess\"\n\t\t});\n\t\tnextTest();\n\t}",
"function addStockRefresh(beverage) {\n addBeverage(beverage);\n loadMgrEditStock();\n loadCategoryDropdown();\n}",
"function checkForDatabaseChanges() {\n // zet het serverrequest in elkaar\n var request = new XMLHttpRequest();\n request.open('GET', `/api/checkchanges/${laatsteUpdateTimeStamp}`, true)\n request.onload = function () {\n if (request.status >= 200 && request.status < 400) {\n if (this.response == \"Update needed\") {\n console.log(\"Server geeft aan dat de database een update heeft die widget nog niet heeft\");\n\n // roep ander update functie(s) aan:\n getMarbleCount();\n }\n else {\n // je kunt de code hieronder aanzetten, maar krijgt dan wel iedere seconde een melding\n // console.log(\"Widget is up to date\");\n }\n }\n else {\n console.log(\"bleh, server reageert niet zoals gehoopt\");\n console.log(this.response);\n }\n }\n\n // verstuur het request\n request.send()\n}",
"function addLevelDBData(key, value) {\n //console.log(\"Current key value is \" + key)\n db.put(key, JSON.stringify(value), function(err) {\n if (err) return console.log('Block ' + key + ' submission failed', err);\n });\n}",
"function idbCatalogUpdate() {\n\tif (!idbSupport) return;\n\tvar os = 'catalog';\n\tvar item = {\n\t\tnpidLocal: notepadIdLocal,\n\t\tnpname: catalog[notepadIdLocal][\"npname\"],\n\t\tnphash: catalog[notepadIdLocal][\"nphash\"],\n\t\tnpdesc: catalog[notepadIdLocal][\"npdesc\"],\n\t\tlastEdit: catalog[notepadIdLocal][\"lastEdit\"],\n\t\tlastOpen: catalog[notepadIdLocal][\"lastOpen\"],\n\t\tsynced: catalog[notepadIdLocal][\"synced\"]\n\t};\n\tvar dbPromise = idb.open(idbDB);\n\treturn dbPromise.then(function(db) {\n\t\tvar tx = db.transaction(os, 'readwrite');\n\t\tvar store = tx.objectStore(os);\n\t\tstore.put(item);\n\t\tdb.close();\n\t\treturn tx.complete;\n\t}).then(function() {\n\t\tconsole.log('Notepad details updated to catalog object store:', item);\n\t\treturn item;\n\t});\n}",
"function addToWatchList(event) {\n var stockSymbol = $(this).attr(\"stock-id\");\n\n console.log(\"in addToWatchList, currentUser: \" + appUser.email);\n\n event.preventDefault();\n // empty out stock-ticker content\n $(\"#stock-ticker-content\").empty();\n $(\"#my-watch-table\").show();\n\n console.log(\"in addToWatchList() \");\n console.log(\"stock symbol: \" + stockSymbol);\n\n // get current price of stock symbol\n buildBatchURL(stockSymbol, \"watch\");\n\n // get yesterday's close price of stock symbol\n buildTimeSeriesURL(stockSymbol);\n\n // add row to watchListTable\n renderWatchTable(stockSymbol);\n }",
"pushRefreshedDatas() {\n var tt = this;\n MongoClient.connect(this.uri, function(err, db) {\n if (err) throw err;\n //Looking for a db called test\n var dbo = db.db(\"test\");\n for (var i = 0; i < tt.collections.length; ++i) {\n dbo.collection(\"rss\").insertOne(tt.collections[i],function(err, result) {\n if (err) throw err;\n });\n }\n db.close();\n });\n }",
"function addToWatchList(event) {\n var stockSymbol = $(this).attr(\"stock-id\");\n\n event.preventDefault();\n // empty out stock-ticker content\n $(\"#stock-ticker-content\").empty();\n\n console.log(\"in addToWatchList() \");\n console.log(\"stock symbol: \" + stockSymbol);\n // $(\"#financial-text\").empty();\n // get current price of stock symbol\n buildBatchURL(stockSymbol, \"watch\");\n\n // get yesterday's close price of stock symbol\n buildTimeSeriesURL(stockSymbol);\n\n // add row to watchListTable\n renderWatchTable(stockSymbol);\n }",
"function handle_bp_cart_hist(req, startTime, apiName) {\n this.req = req; this.startTime = startTime; this.apiName = apiName;\n}",
"function renderWatchTable(sym) {\n var tRow = $(\"<tr>\"),\n tCellSym = $(\"<td>\"),\n tCellPrice = $(\"<td>\"),\n tCellChange = $(\"<td>\"),\n tCellPct = $(\"<td>\"),\n tCellRmv = $(\"<td>\"),\n delBtn = $(\"<button>\"),\n dbPath = \"watchlist/\" + sym,\n price, changeInPrice, pctCh,\n dbVal;\n\n // read current stock price from database\n database.ref(dbPath).on(\"value\", (snapshot) => {\n dbVal = snapshot.val();\n console.log(\"dbVal: \" + JSON.stringify(dbVal));\n console.log(\"price: \" + dbVal.stockPrice);\n price = dbVal.stockPrice;\n changeInPrice = dbVal.change;\n pctCh = dbVal.pctChange;\n\n console.log(\"in renderWatchTable: \" + price);\n // console.log(\"converted price: \" + numeral(cprice).format(\"$0,0.00\"));\n tCellSym.text(sym);\n tCellPrice.html(numeral(price).format(\"$0,0.00\"));\n tCellChange.html(numeral(changeInPrice).format(\"+0,0.00\"));\n tCellPct.html(numeral(pctCh).format(\"0.00%\"));\n delBtn.attr(\"id\", \"btn-\" + sym).\n attr(\"data-name\", sym).\n addClass(\"custom-remove remove-from-watchlist\").\n text(\"x\");\n tCellRmv.append(delBtn);\n tRow.attr(\"id\", \"wrow-\" + sym).\n attr(\"stock-sym\", sym);\n // empty out row so as to not repeat stock symbol on watchlist\n $(\"#wrow-\" + sym).empty();\n tRow = $(\"#wrow-\" + sym).append(tCellSym, tCellPrice, tCellChange, tCellPct, tCellRmv);\n }, (errorObject) => {\n console.log(\"Errors handled: \" + errorObject.code);\n });\n $(\"#watchlist-caption\").show();\n $(\"#watch-table-header\").show();\n $(\"#watch-table\").prepend(tRow);\n }",
"function ActionUpdateDatabase(rfid){\n console.log(\"update rfid set Action=\"+\"'\"+database_res+\"'\"+\" where item_rfid=\"+\"'\"+rfid+\"'\");\n var pre_query = new Date().getTime();\n \n //this is a query function that gets rfid data from the online database and COMPARES with reader values \n connection.query(\"update rfid set Action=\"+\"'\"+database_res+\"'\"+\" where item_rfid=\"+\"'\"+rfid+\"'\",function(err,rows){\n if(err)throw err;\n else{\n var post_query = new Date().getTime();\n var duration = (post_query-pre_query)/1000;\n console.log('------------------------------');\n console.log(\"database connection taken: \"+duration);\n console.log('------------------------------');\n searchManufacturerDatabase();\n var ser_end = new Date().getTime();\n var cli_ser = (ser_end-cli_start)/1000;\n console.log(\"Time from client to server: \"+cli_ser);\n }//END ELSE STATEMENT\n }); //END QUERY\n}",
"function start(update_rate) {\n /*----------------------------------------------------\n Init datasource APIs\n ----------------------------------------------------*/\n INTF = {\n messari: new MSRIInterface(15), // 15 mins\n coinMarketCap: new CMCInterface(60 * 12), // 12 hours\n stablecoinWatch: new SCWInterface(60), // 1 hour\n coinGecko: new CGKOInterface(60), // 1 hour \n };\n\n /*----------------------------------------------------\n update data for first time\n ----------------------------------------------------*/\n update();\n\n /*----------------------------------------------------\n Schedule data update at specified rate\n ----------------------------------------------------*/\n cron.schedule(`*/${update_rate} * * * *`, update);\n}",
"function storeTrainInfo() {\n database.ref(\"/trainData\").push({\n trainName: trainName\n ,destination: destination\n ,firstTrain: firstTrain\n ,frequency: freq\n })\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Save an ongoing action on the GM computer for a future reload | saveAction() {
if (game.user.isGM) {
localStorage.setItem('pendingAction', this.toJSON());
}
} | [
"@action\n async save() {\n await this.rdfaCommunicator.persist();\n this.owner.lookup(SAVE_RESET_KEY).handleClose(this.args.info, null);\n }",
"function villagerAction(){\n dataStore.waitForAll(\"nightWait\", postNightPhase, \"$null\");\n document.getElementById(\"notice\").innerHTML = \"Waiting for night to end...\";\n document.getElementById(\"notice\").style.display = \"block\";\n }",
"function replay() {\n\tlocation.reload();\n}",
"function saveGame(objButton){\n var fired_button = objButton.value;\n localStorage.setItem(\"datetime\", fired_button);\n}",
"afficheSavingReporter ()\n {\n console.log(\"RAPPORT D'ERREUR AU COURS DE LA SAUVEGARDE\")\n console.log(this.savingReporter)\n alert(\"Des erreurs sont survenues pendant la sauvegarde, merci de consulter la console (CMD + i)\")\n }",
"function resetOwnActionTimer() {\n actionTimer = new Date()\n }",
"function onSaveButtonClicked(event) {\n\t// console.log('clicked');\n\tif ('caches' in window) {\n\t\tcaches.open('user-requested')\n\t\t .then(function (cache) {\n\t\t\t cache.add('https://httpbin.org/get');\n\t\t\t cache.add('/src/images/sf-boat.jpg');\n\t\t });\n\t}\n}",
"function saveGame() {\r\n\tvar sNewCellID;\r\n\r\n\t// save current board state\r\n\tfor (var x = 0; x < 9; x++) {\r\n\t\tfor (var y = 0; y < 9; y++) {\r\n\t\t\tsNewCellID = cord2ID(x, y);\r\n\r\n\t\t\twindow.localStorage.setItem(sNewCellID, JSON\r\n\t\t\t\t\t.stringify(aCellByIDs[sNewCellID]));\r\n\t\t}\r\n\t}\r\n\r\n\t// save next balls\r\n\tfor (var i = 0; i < 3; i++) {\r\n\t\twindow.localStorage.setItem(\"nextBall\" + i, JSON\r\n\t\t\t\t.stringify(aNextBalls[i]));\r\n\t}\r\n\r\n\t// save total score\r\n\twindow.localStorage.setItem(\"nTotalScore\", nTotalScore);\r\n\r\n\t// save game dificulty\r\n\twindow.localStorage.setItem(\"nMaxColor\", oGameSettings.nMaxColor);\r\n}",
"performedUserAction() {\n this.autoScanManager_.restartIfRunning();\n }",
"function menuSaveClick() {\n requestSave();\n}",
"function saveFitness() {\n}",
"function saveExplication() {\n\tstorage.explication = $('#explication').text();\n}",
"function saveSettings(){\n localStorage[\"pweGameServerStatus\"] = gameselection;\n //console.log('saved: ' + gameselection);\n}",
"function saveGame() {\n pauseGame();\n let cardsData = '';\n $('.card').each(function() {\n cardsData += $(this).attr('class') + '@' + $(this).html() + '@@';\n });\n localStorage.setItem('cardsData', cardsData);\n localStorage.setItem('clockState', clockState);\n localStorage.setItem('playDuration', playDuration);\n localStorage.setItem('moves', moves);\n resumeGame();\n}",
"function RobotAction()\n{\n\tif(roboActionArray.length > 0)\n\t{\n\t\trobotBusy = true;\n\t\tRobotActionName = roboActionArray.Pop();\n\t\tvar logString = \"{\"+boardPosition.X+\",\"+boardPosition.Y+\",\"+facing+\"} - \"+ RobotActionName;\n\t\tif(RobotActionName != \"\")\n\t\t\tlastPath += logString + '\\n';\n\t\t\n\t\tswitch(RobotActionName)\n\t\t{\n\t\t\tcase \"Forward\": MoveForward(); break;\n \t\t\tcase \"Backward\" : MoveBackward();\tbreak;\n \t\t\tcase \"Turn Right\" : RotateRight(); break;\n \t\t\tcase \"Turn Left\" : RotateLeft(); break;\n \t\t\tcase \"Jump\" : Jump(); break;\n \t\t\tcase \"Pick Up/Put Down\": PickUp(); break;\n \t\t\t//case \"Set Step\": PlaceStep(); break;\n \t\t\tcase \"Place Switch\": PlaceSwitch(); break;\n \t\t\tcase \"Place Box\": PlaceBox(); break;\n \t\t\tcase \"Set Spawn\": SetSpawn(); break;\n \t\t\tcase \"Raise Ground\": PlaceStep(); break;\n \t\t\tcase \"Lower Ground\": RemoveStep(); Debug.Log(\"blam\"); break;\n case \"HeavyBox\": PlaceHeavyBox(); break;\n \t\t\tcase \"Activate\" : Activate(); break;\n \t\t\tcase \"Error\" : ErrorOut(\"WAY too many instructions! Check your loops and recursions...\"); break;\n\t\t\tcase \"\" : break;\n \t\t\tdefault : Debug.Log(\"error: illegal action type \" + RobotActionName);\n\t\t}\n\t}\n\telse\n\t{\n\t\tStop();\n\t}\n}",
"function StoreIssueStateToTransfer(key, lockAfterTransfer, callback) {\r\n let stateToStore = new Object();\r\n stateToStore[key] = lockAfterTransfer;\r\n chrome.storage.local.set(stateToStore, function () {\r\n callback();\r\n });\r\n}",
"save() {\n if (this.properties.saveCallback) {\n this.properties.saveCallback();\n } else if (this.properties.localStorageReportKey) {\n if ('localStorage' in window && window['localStorage'] !== null) {\n try {\n let report = this.getReport();\n // console.log(JSON.stringify(report));\n window.localStorage.setItem(this.properties.localStorageReportKey, JSON.stringify(report));\n this.modified = false;\n } catch (e) {}\n }\n }\n this.updateMenuButtons();\n }",
"recordDraftInteraction() {\n // If there is no timer defined, then this is the first interaction.\n // Set up the timer so that it's ready to record the intervening time when\n // called again.\n const timer = this._timers.timeBetweenDraftActions;\n if (!timer) {\n // Create a timer with a maximum length.\n this._timers.timeBetweenDraftActions = this.getTimer(DRAFT_ACTION_TIMER)\n .withMaximum(DRAFT_ACTION_TIMER_MAX);\n return;\n }\n\n // Mark the time and reinitialize the timer.\n timer.end().reset();\n }",
"function autosaveThread(mode) {\n\t// Start/restart the wait.\n\tif (mode === 'start') {\n\t\tclearInterval(autosaveTimer);\n\t\tautosaveTimer = setInterval(function(){ autosaveNotepad(); }, AUTOSAVE_SECONDS * 1000);\n\t}\n\t// Destroy the event.\n\telse if (mode === 'stop') {\n\t\tclearInterval(autosaveTimer);\n\t}\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method called when attempting to navigate to the 'Staff Requests' page | handleClickRequests(e) {
e.preventDefault();
this.props.history.push({
pathname: '/staff-requests',
state: {onUpdate: this.props.onUpdate,
diningSessions: this.props.diningSessions,
diningSessionAttributes: this.props.diningSessionAttributes,
filterDiningSessionList: this.props.filterDiningSessionList,
selectedView: this.props.selectedView}
})
} | [
"function DoUserInitiatedNavigation(/*object*/ sender) \r\n {\r\n// CodeAccessPermission perm = SecurityHelper.CreateUserInitiatedNavigationPermission(); \r\n// perm.Assert(); \r\n\r\n try \r\n {\r\n DispatchNavigation(sender);\r\n }\r\n finally \r\n {\r\n CodeAccessPermission.RevertAssert(); \r\n } \r\n }",
"function showCorrectLogonPage() {\n if(initializeRewards.urlContainsFlowID()){\n changePageFn('#urlogon');\n } else if (isCustomerUsingToken(ccoTokenKey)) {\n changePageFn('#cco');\n }else if (isCustomerUsingToken(bbTokenKey)) {\n changePageFn('#bb');\n }\n }",
"NavigateToProperPage() {\n console.log('this.accRecord.Application_Current_Stage__c '+ this.accRecord.Application_Current_Stage__c )\n if(this.accRecord.Application_Current_Stage__c == 'Not Started'){\n this.currentStep=\"1\"\n this.navigateToGeneralInfo()\n }\n // If Current Stage == Personal Information, assign this.accountRecord and navigate to PersonalInformation\n else if (this.accRecord.Application_Current_Stage__c == 'Personal Information') {\n this.currentStep=\"2\"\n this.navigateToPersonalInfo()\n\n }\n\n //If == Eligibility, assign ParentData and navigate to Eligbility\n else if(this.accRecord.Application_Current_Stage__c == 'Eligibility Test') {\n this.currentStep=\"3\"\n this.navigateToEligibility()\n }\n else if(this.accRecord.Application_Current_Stage__c == 'Quote'){\n this.currentStep=\"4\"\n let values = {detail:{childcompname:'Product info',childcompdescription:'DESCRIPTION',SelectedLicence:this.accRecord.Applicable_License__r.Licenses_Type__c }}\n this.navigateToProductInfo(values)\n }\n\n else if(this.accRecord.Application_Current_Stage__c == 'Suspended'){\n\n this.currentStep = \"4\";\n //stepThree2\n \n this.template.querySelector('div.stepOne').classList.add('slds-hide');\n this.template.querySelector('div.stepTwo').classList.add('slds-hide');\n this.template.querySelector('div.stepThree').classList.add('slds-hide');\n this.template.querySelector('div.stepThree2').classList.remove('slds-hide');\n this.template.querySelector('div.stepFour').classList.add('slds-hide');\n }\n\n else {\n\n console.log('Application Current Stage::' + this.accRecord.Application_Current_Stage__c);\n }\n console.log('Account Record ::' + JSON.stringify(this.accRecord));\n this.AccountName = this.accRecord.HiddenAccount__r.Name;\n\n \n }",
"changeStep() {\n window.location.assign('#/eventmgmt/shop');\n }",
"goToCustomerDenials(customer) {\n state.get(this).go('main.corporate.customer-denials', {customerId: customer.customerId});\n }",
"redirect() {\n Radio.request('utils/Url', 'navigate', {\n trigger : false,\n url : '/notebooks',\n includeProfile : true,\n });\n }",
"function setContactPage(){\r\n setPage('contact-page');\r\n }",
"goToEditCustomer() {\n let url;\n if (Auth.get(this).user.role === 'corporate-admin') {\n url = 'main.corporate.customer.edit';\n } else {\n url = 'main.employee.customer.edit';\n }\n state.get(this).go(url, {customerId: this.displayData.selectedCustomer._id});\n }",
"navigateToViewRecordPage() {\n this[NavigationMixin.Navigate]({\n type: 'standard__recordPage',\n attributes: {\n \"recordId\": this.recordId,\n \"objectApiName\": \"Account\",\n \"actionName\": \"view\"\n },\n });\n }",
"goToCardIntake() {\n let url;\n if (Auth.get(this).user.role === 'corporate-admin') {\n url = 'main.corporate.customer.intake-revised';\n } else {\n url = 'main.employee.customer.intake-revised';\n }\n if (this.displayData.rejectionTotal) {\n url = url + '.denials';\n }\n state.get(this).go(url, {customerId: this.displayData.selectedCustomer._id});\n }",
"page(rudderElement) {\n logger.debug('=== In Adroll Page ===');\n const { message } = rudderElement;\n const eventsHashmap = getHashFromArray(this.eventsMap);\n let pageFullName;\n if (!message.name && !message.category) {\n pageFullName = `Viewed a Page`;\n } else if (!message.name && message.category) {\n pageFullName = `Viewed ${message.category} Page`;\n } else if (message.name && !message.category) {\n pageFullName = `Viewed ${message.name} Page`;\n } else {\n pageFullName = `Viewed ${message.category} ${message.name} Page`;\n }\n\n const segmentId = eventsHashmap[pageFullName.toLowerCase()];\n if (!segmentId) {\n logger.error(`The event ${pageFullName} is not mapped to any segmentId. Aborting!`);\n return;\n }\n\n window.__adroll.record_user({\n adroll_segments: segmentId,\n name: pageFullName,\n path: window.location.pathname,\n referrer: window.document.referrer,\n search: window.location.search,\n title: window.document.title,\n url: window.location.href,\n });\n }",
"navigateConObject() {\n this[NavigationMixin.Navigate]({\n \"type\": \"standard__objectPage\",\n \"attributes\": {\n \"objectApiName\": \"Contact\",\n \"actionName\": \"home\"\n }\n });\n }",
"function Redirect(UUID,location_id,vendortypeloggedin,redirectedfrom,screen_ids,session_id,VID,nameArray,vendor_session_id,vendor_name,vendor_user_name,vendorUserId,UUID,theaterName,customer_id,seat_num,row,accessedfrom)\n{\n\t\t\t\t\t\tlocalStorage.setItem('showpickitemspage', 'yes');\n\t\t\t\t\t\n\t\t\t\t\twindow.location.replace(\"../customer/index_dup.html? UUID=\" + UUID + '&location_id=' + location_id + '&vendortypeloggedin=' + vendortypeloggedin + '&redirectedfrom=' + redirectedfrom + '&screen_id=' + screen_ids + '&session_id=' + session_id + '&vendor_id=' + VID + '&VID=' + VID + '&nameArray=' + nameArray + '&vendor_session_id=' + vendor_session_id + '&vendor_name=' + vendor_name + '&vendor_user_name=' + vendor_user_name + '&vendorUserId=' + vendorUserId + '&UUID=' + UUID + \"&sName=\" + theaterName + \"&customer_id=\" + customer_id + \"&seatnum=\" + seat_num + \"&row=\" + row+ \"&accessedfrom=\" + accessedfrom);\n\t\t\t\t\n\t\t\t\t\tclearTimeout(timer);\n}",
"function fnOpenOrderSingleApproval(id) {\n $.mobile.changePage(\"/HiDoctor_Activity/OTC/SalesOrderSingleApproval?orderID=\" + id.split('^')[0] + \"&userCode=\" + id.split('^')[1], {\n type: \"post\",\n reverse: false,\n changeHash: false\n });\n}",
"function gotoProfile(e){\n window.location.href = \"http://localhost:8080/TeamOneSports/profile.jsp\";\n}",
"handleReviewOrder(){\n this.props.orderStore.deliveryInfo = this.props.orderStore.currentOrder.deliveredPrices[this.state.mailingOptions];\n browserHistory.replace(\"/revieworder\");\n }",
"function navigateToListView() {\n Shell.UI.Navigation.navigate(\"#Workspaces/{0}/CmpWapExtension\").format(CmpWapExtensionTenantExtension.name);\n }",
"navigateToEditRecordPage() {\n this[NavigationMixin.Navigate]({\n type: 'standard__recordPage',\n attributes: {\n \"recordId\": this.recordId,\n \"objectApiName\": \"Account\",\n \"actionName\": \"edit\"\n },\n });\n }",
"nextPage(){\n BusinessActions.nextPage();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ shuffle produces a random list by doing len exchanges | function shuffle(list, length) {
var i, rnd, temp;
for (i = 0; i < length; i += 1) {
rnd = i + Math.floor((Math.random() * (length - i)));
temp = list[i];
list[i] = list[rnd];
list[rnd] = temp;
}
} | [
"shuffleElements() { \n this.deck.shuffle();\n }",
"shuffleGuessList() {\r\n this.mixedGuessList = super.shuffle(this.guessList.slice());\r\n }",
"shuffle() {\r\n for (let i = 0; i < this.len(); i++) {\r\n this.swap(\r\n this.getLinkByPosition(\r\n Math.floor(Math.random() * (window.innerWidth - 10)),\r\n Math.floor(Math.random() * (window.innerHeight - 10))\r\n ),\r\n this.getLinkByPosition(\r\n Math.floor(Math.random() * (window.innerWidth - 10)),\r\n Math.floor(Math.random() * (window.innerHeight - 10))\r\n )\r\n );\r\n }\r\n console.log(\"shuffle\");\r\n }",
"shuffle() {\n \n for (let i = 0; i < this._individuals.length; i++) {\n let index = getRandomInt( i + 1 );\n let a = this._individuals[index];\n this._individuals[index] = this._individuals[i];\n this._individuals[i] = a;\n }\n }",
"function shuffleArray(){\n\tfor(i=0;i<questions.length;i++){\n\t\tvar j = Math.floor(Math.random()*questions.length);\n\t\tvar temp = questions[i];\n\t\tquestions[i] = questions[j];\n\t\tquestions[j] = temp;\n\t}\n}",
"function shuffle() {\n var parent = document.querySelector(\"#container\");\n for (var i = 0; i < parent.children.length; i++) {\n parent.appendChild(parent.children[Math.random() * i | 0]);\n }\n}",
"function shuffleCards(array){\r\n\tfor (var i = 0; i < array.length; i++) {\r\n\t\tlet randomIndex = Math.floor(Math.random()*array.length);\r\n\t\tlet temp = array[i];\r\n\t\tarray[i] = array[randomIndex];\r\n\t\tarray[randomIndex] = temp;\r\n\t}\r\n}",
"_shuffle() {\n\tif (!this.currentQuestion) throw \"No questions to shuffle.\";\n\tthis.orderChoices = [\n\t this.currentQuestion.correctAnswer,\n\t this.currentQuestion.wrongAnswer\n\t];\n\tif (Math.floor(Math.random() * 2) == 0) {\n\t this.orderChoices.reverse();\n\t}\n }",
"shuffleSpells() {\n this.spellDeck.shuffle();\n }",
"function shuffleAction() {\n const shuffledList = cards.slice().sort(() => Math.random() - 0.5);\n return createCard(shuffledList);\n}",
"function shuffle_quotes() {\n if (so_far.length < 2) {\n return true;\n }\n erase();\n for (var i = so_far.length - 1; i > 0; i--) {\n var j = Math.floor(Math.random() * (i + 1));\n var temp = so_far[i];\n so_far[i] = so_far[j];\n so_far[j] = temp;\n }\n for (i=0; i< so_far.length; i++) {\n \n add_sth(so_far[i]);\n }\n \n}",
"function loadShuffledItems() {\n\tloadItemLabels();\n \tshuffledItems = shuffle(itemLabels);\n}",
"function shuffle(deck) {\n\t// Shuffle\n\tfor (let i=0; i<1000; i++) {\n\t // Swap two randomly selected cards.\n\t let pos1 = Math.floor(Math.random()*deck.length);\n\t let pos2 = Math.floor(Math.random()*deck.length);\n\n\t // Swap the selected cards.\n\t [deck[pos1], deck[pos2]] = [deck[pos2], deck[pos1]];\n\t}\n\n }",
"function shuffle(size) {\n if (size < 2) return 'invalid deck'\n if (size === 2) return 1\n let calcSize = size\n if (size % 2 === 1) {\n calcSize++\n }\n // we only have to pay attention to one card (the card at index 1 is a good choice) to solve this problem. let's start by \"shuffling\" that one card once.\n let originalIndex = 1\n let tempIndex = 2\n let count = 1\n while (tempIndex !== originalIndex) {\n count++\n if (tempIndex < calcSize / 2) {\n tempIndex = tempIndex * 2\n }\n else {\n tempIndex = tempIndex - (calcSize - tempIndex - 1)\n }\n }\n return count\n}",
"function shuffleCards() {\n for (var j = 0; j < cards.length; j++) {\n cards[j].classList.remove('open', 'show', 'match')\n };\n\n allCards = shuffle(allCards)\n for (var i = 0; i < allCards.length; i++) {\n deck.innerHTML = ''\n for (const e of allCards) {\n deck.appendChild(e)\n }\n }\n}",
"function shuffleAnswers(answers) {\n var shuffledAnswers = [];\n var correctAnswerShuffled = 0;\n for(var i = 0 ; i < 4 ; i++)\n {\n var shuffleSpot = getRandomInt(0,answers.length-1);\n if(correctAnswerShuffled == 0 && shuffleSpot == 0)\n {\n multipleChoiceCorrectAnswer=i; \n correctAnswerShuffled=1;\n }\n shuffledAnswers.push( answers.splice(shuffleSpot , 1).toString() ); \n }\n return shuffledAnswers;\n}",
"function shuffle(){\n\t\n\t\tif(position == 0){ \n\t\t\treturn;\n\t\t}\n\t\t\n\t\tgame.removeAttribute('category'); //Remove the class attribute from the puzzle\n\t\tposition = 0;\n\t\t\n\t\tvar prevBox;\n\t\tvar i = 1;\n\t\tvar stop = setInterval(function(){\n\t\t\tif(i <= 100){\n\t\t\t\tvar next = findNextBoxs(findEmptyBox());\n\t\t\t\tif(prevBox){\n\t\t\t\t\tfor(var j = next.length-1; j >= 0; j--){\n\t\t\t\t\t\tif(next[j].innerHTML == prevBox.innerHTML){\n\t\t\t\t\t\t\tnext.splice(j, 1);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t/*gets random next box and saves the box for the next loop*/\n\t\t\t\tprevBox = next[random(0, next.length-1)]; //gets random next box\n\t\t\t\tmoveBox(prevBox); //saves position for the next loop\n\t\t\t\ti++;\n\t\t\t} else {\n\t\t\t\tclearInterval(stop);\n\t\t\t\tposition = 1;\n\t\t\t}\n\t\t}, 5);\n\t\t\n\t}",
"static shuffle3(key, src) {\n let ret = [];\n\n let first = key % 3;\n ret.push(src[first]);\n src.splice(first, 1);\n\n let second = key % 2;\n ret.push(src[second]);\n src.splice(second, 1);\n\n ret.push(src[0]);\n return ret;\n }",
"function randSampleInPlace(collection, numSample) {\n var n = collection.length\n var s = Math.min(n, numSample)\n for (var i = n - 1; i >= n - s; i--) {\n var j = randomIntBetweenInclusive(0, i)\n if (i !== j) {\n // swap\n var temp = collection[j]\n collection[j] = collection[i]\n collection[i] = temp\n }\n }\n return collection.slice(n - s, n)\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Obtain the index value of the phrase being used so the right hint can correspond. | function getPhraseIndex(arr){
const phraseIndex = arr.indexOf(chosenPhrase);
return phraseIndex;
} | [
"function _index(phrase) {\n\n var indexKey = phrase.substr(0, config.indexDepth).trim();\n if (local.index[indexKey] === undefined) {\n local.index[indexKey] = {};\n }\n\n // Set Id as either the same as the previous equal phrase or\n // max id + 1\n var id = local.index[indexKey][phrase] || (local.phraseId + 1);\n\n // Update max id\n local.phraseId = Math.max(local.phraseId, id);\n\n local.index[indexKey][phrase] = id;\n\n return id;\n }",
"function findWordIndex(word) {\n\t\tfor (var i = 1; i <= 3; i++) {\n\t\t\tfor (var j = 0; j < 16; j++) {\n\t\t\t\tvar menu_item = \"#\" + i + \"_\" + j + \"\";\n\t\t\t\t// might be item.target.text\n\t\t\t\tif($(menu_item).text() === word) {\n\t\t\t\t\t// return menu_item;\n\t\t\t\t\treturn j;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// return \"#none\";\n\t\treturn -1;\n\t}",
"getIndexOfFirstWord() {\n let indexFirstWord = -1;\n\n this.recordingData.forEach((word, index) => {\n if (word[1] == -1) {\n indexFirstWord = index;\n return;\n }\n });\n\n return indexFirstWord;\n }",
"function myIndexOf(string, searchTerm) {}",
"_wordToIndex(word) {\n\n word = word.toString();\n\n if(this._wordToIdx[word] === undefined) {\n var idx = this._idxToWord.length;\n this._wordToIdx[word] = idx;\n this._idxToWord[idx] = word;\n\n if(this._normalize) {\n var normWord = word.toLocaleLowerCase();\n if(word != normWord) {\n var idx2 = this._idxToWord.length;\n this._wordToIdx[normWord] = idx2;\n this._idxToWord[idx2] = normWord;\n }\n }\n\n return idx;\n } else {\n return this._wordToIdx[word];\n }\n }",
"function getHintValue() {\n hint = ((category == \"dictionary\") ?\n ((hintCollection.length >= 1) ? hintCollection[Math.floor(Math.random() * hintCollection.length)] : `First letter in this word is: ${firstLetter}`) :\n hint);\n }",
"function FindMotif(targetMotif, dnaString){\n\tvar indexLoc = '';\n\tvar notDone = true;\n\tvar counter = 0;\n\tvar lastFound = 0;\n\twhile(notDone && counter <10000){\n\t\tvar pos = dnaString.toString().indexOf(targetMotif,lastFound);\n\t\tif(pos == -1)\n\t\t\tnotDone = false;\n\t\telse{\n\t\t\tpos++\n\t\t\tindexLoc += (pos-1) + ' ';\n\t\t\tlastFound = pos;\n\t\t}\n\t\tconsole.log(pos);\n\t\tcounter++;\n\t}//end while\n\n\tconsole.log(indexLoc);\n\treturn indexLoc;\n}",
"getIndex(attributeName) {\n const arg = this.args[attributeName];\n return arg ? arg.idx : null;\n }",
"function getStartIndex(value, label) {\n return (value.indexOf(label) + label.length + 1);\n }",
"phrase(phrase) {\n for (let map of this.facet(dist_EditorState.phrases))\n if (Object.prototype.hasOwnProperty.call(map, phrase))\n return map[phrase];\n return phrase;\n }",
"function getIndexQ() {\n for (let i = d.length - 1; i >= 0; i--) {\n if (d.substring(i, i + 1) === 'Q') {\n return i\n }\n }\n return 0\n }",
"wordToIdx(word) {\n if(Array.isArray(word)) {\n var result = [ ];\n for(var i = 0; i < word.length; i++)\n result.push(this._wordToIndex(word[i]));\n return result;\n } else {\n return this._wordToIndex(word);\n }\n }",
"function getCandidatePosition(anIndex) {\n return candidatePositions[anIndex];\n } // getCandidatePosition",
"get index() {\n\n // Check if the face is bound to a mesh and if not throw an error\n if (!this.mesh) throw new Error(`Cannot compute the index - the face is not bound to a Mesh`);\n\n // Return the index of the face in the faces\n return Number(this.mesh.faces.findIndex(face => face.equals(this)));\n }",
"posById(id){\n let slot = this._index[id];\n return slot ? slot[1] : -1\n }",
"phrase(phrase) {\n for (let map of this.facet(EditorState.phrases))\n if (Object.prototype.hasOwnProperty.call(map, phrase))\n return map[phrase];\n return phrase;\n }",
"getIndexForPositionString (positionString = 'a1') {\n const { row, column } = this.getCoordinatesForPositionString(positionString)\n let index = Math.abs(column - 8) + (row * 8)\n index = Math.abs(index - 64)\n return index\n }",
"function getPosition(str,start,needle){\n\tvar index = str.substr(start).indexOf(needle);\n\tif (index==-1) {\n\t\treturn index;\n\t}\n\treturn index+start;\n}",
"function automatedReadabilityIndex(letters, numbers, words, sentences) {\nย ย ย ย return (4.71 * ((letters + numbers) / words))\nย ย ย ย ย ย ย ย + (0.5 * (words / sentences))\nย ย ย ย ย ย ย ย - 21.43;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
saves userName to localStorage | function saveName() {
localStorage.setItem('receivedName', userName)
} | [
"function saveUsersName(text) {\n localStorage.setItem(USERS_LS, text);\n}",
"function storeName() {\n const formWrapper = document.getElementById(\"personalizer\");\n const username = document\n .querySelector('[name=\"username\"]')\n .value.trim()\n .toUpperCase();\n if (username === \"\") {\n validationError('[name=\"username\"]', formWrapper);\n } else {\n validationError('[name=\"username\"]', formWrapper, false);\n localStorage.setItem(\"username\", username);\n personalizer();\n }\n}",
"function storeNames() {\n // Stringify and set \"names\" key in localStorage to names array\n localStorage.setItem(\"names\", JSON.stringify(names));\n }",
"save() {\n var string = JSON.stringify(this[PINGA_SESSION_STATE]);\n\n localStorage.setItem(this.userId, string);\n }",
"function userData() {\n\n userName = $('#username').val()\n sessionStorage.setItem(\"userName\", userName)\n if ((fillUserName = null) || (fillUserName = \"\")) { //if player doesn't enter any username or saves username without entering anything\n sessionStorage.setItem(\"\", userName);\n }\n}",
"function saveMeal()\r\n{\r\n if(Cookies.get(\"loggedRegUser\") != null)\r\n {\r\n var currUser = JSON.parse(getUser(Cookies.get(\"loggedRegUser\"))); \r\n currUser.user = getLoggedUser();\r\n console.log(currUser);\r\n localStorage.setItem(currUser.username,JSON.stringify(currUser)); \r\n alert(\"Meal saved successfully!\"); \r\n\r\n }\r\n else{\r\n alert(\"You are not logged in to save your meal, please log in first!\");\r\n }\r\n\r\n}",
"function saveUsers() {\n localStorage.setItem(\"trivia-users\", JSON.stringify(users));\n}",
"function save_user() {\n var user = document.getElementById(\"username\").value;\n //check that a username was inputted \n if (!user || (user.trim()).length == 0) {\n document.getElementById(\"username\").value = \"\";\n alert('No username specified.');\n return;\n }\n if (user.length>10){\n document.getElementById(\"username\").value = \"\";\n alert(\"Username exceeded 10 characters.\")\n return;\n }\n //if there is a username, save to chrome.storage\n chrome.storage.sync.set({\"user\": user}, function() {\n message('Username saved and updated.');\n });\n document.getElementById(\"username\").placeholder = \"Current Username: \" + user;\n document.getElementById(\"username\").value = \"\";\n }",
"function setGameObject(userName, obj){\n\tvar newUsername = 'usr_' + userName;\n\tlocalStorage.setItem(newUsername, JSON.stringify(obj));\n\tif(localStorage.getItem(\"gameUsersList\") == undefined){\n\t\tvar list = new Array();\n\t\tlist[0] = userName;\n\t\tlocalStorage.setItem(\"gameUsersList\", JSON.stringify(list));\n\t}\n\telse\n\t{\n\t\tvar list = JSON.parse(localStorage.gameUsersList);\n\t\tlist.push(userName);\n\t\tlocalStorage.gameUsersList = JSON.stringify(list);\n\t}\n}",
"function playerName() {\r\n var player = document.getElementById(\"player\").value;\r\n localStorage.setItem(\"playerName\", player);\r\n}",
"function setDisplayName(displayName){\n //Save display name into the storage\n localStorage.setItem('displayName',displayName);\n}",
"function saveAndPublishUserData(resp) {\n user.name = resp.data.name;\n user.email = resp.data.email;\n user.id = resp.data._id;\n localStorage.setItem('user', JSON.stringify(user)); \n}",
"function addUserName () {\n let tag = document.querySelector('#player')\n let myHeadline = document.createElement('h2')\n myHeadline.innerText = 'Curently playing:'\n tag.appendChild(myHeadline)\n let button = document.querySelector('#player button')\n button.addEventListener('click', event => {\n let value = button.previousElementSibling.value\n if (value.length === 0) return\n window.localStorage.setItem('value', value)\n document.getElementById('playername').innerHTML = window.localStorage.getItem('value')\n event.stopPropagation()\n button.previousElementSibling.value = ''\n })\n}",
"function saveStudentInfo() {\n\n\t\n\talert(\"Reached\");\n\t// Get the form element which contains all the data\n\tvar studentForm = document.getElementById('studentForm');\n\n\t// Save the data into the 'studentInfo' object\n\tstudentInfo.firstName = studentForm.elements[\"firstName\"].value;\n\talert(firstName);\n\tstudentInfo.lastName = studentForm.elements[\"lastName\"].value;\n\tstudentInfo.emailId = studentForm.elements[\"emailId\"].value;\n\tstudentInfo.contactNo = studentForm.elements[\"contactNo\"].value;\n\tstudentInfo.addr1 = studentForm.elements[\"addr1\"].value;\n\tstudentInfo.city = studentForm.elements[\"city\"].value;\n\tstudentInfo.state = studentForm.elements[\"state\"].value;\n\tstudentInfo.country = studentForm.elements[\"country\"].value;\n\tstudentInfo.zipCode = studentForm.elements[\"zipCode\"].value;\n\n\t// Create a JSON string of the object\n\tvar strObject = JSON.stringify(studentInfo);\n\t// Save the data into the localStorage of the browser\n\tlocalStorage.setItem(studentInfo.firstName, strObject);\n\n\tdocument.getElementById('display_msg').style.display = \"block\";\n\n}",
"function saveKittens() {\r\n\r\n\r\n\r\n window.localStorage.setItem(\"kittens\", JSON.stringify(kittens));\r\n\r\n}",
"function saveData() {\n var self = this;\n\n try {\n localStorage.setItem(\n self.data.name,\n JSON.stringify(self.getArrayOfData())\n );\n } catch (e) {\n console.error('Local storage save failed!', e);\n }\n\n }",
"function saveToLocalStorage() {\n localStorage.setItem(\"startTime\", startTime);\n localStorage.running = running;\n localStorage.paused = paused;\n localStorage.tableSize = tableSize;\n localStorage.setItem(\"historyTable\", historyTable.innerHTML);\n localStorage.setItem(\"timeDisplay\", timeDisplay.innerHTML);\n localStorage.useStorage = 1;\n}",
"function store(data,key) {\n\tlocalStorage[key] = JSON.stringify(data);\n}",
"function storePref () {\n localStorage.setItem('pref', JSON.stringify(pref));\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
moveThisBodyPart() multipurpose reduces possibility of code errors and number of functions to maintain. Repetitive logic from before now in 1 place easier to fix if something is wrong | function moveThisBodyPart(i, thisBodyPart) {
if (clicksArrayStarts0s[i] < 2) { // Cycles back to the beginning pic.
$(thisBodyPart).animate({left:"-="+bodyPartWidth+"px"}, 500);
clicksArrayStarts0s[i] = clicksArrayStarts0s[i]+1;
}
else {
clicksArrayStarts0s[i] = 0;
$(thisBodyPart).animate({left:"0px"}, 500);
}
} | [
"move()\n\t{\n\t\t// For every SnakePart in the body array make the SnakePart take on\n\t\t// the direction and x- and y-coordinates of the SnakePart ahead\n\t\t// of it.\n\t\tfor (let index = this.length - 1; index > 0; index--)\n\t\t{\n\t\t\tthis.body[index].x = this.body[index - 1].x;\n\t\t\tthis.body[index].y = this.body[index - 1].y;\n\t\t\tthis.body[index].direction = this.body[index - 1].direction;\n\t\t}\n\n\t\t// In case the snake needs to teleport to other side of the grid...\n\t\tif (this.needsTeleport)\n\t\t{\n\t\t\t// ...assign the head of the snake new coordinates accordingly\n\t\t\t// based on its direction.\n\t\t\tswitch(this.body[0].direction)\n\t\t\t{\n\t\t\t\tcase \"UP\":\n\t\t\t\t{\n\t\t\t\t\tthis.body[0].y = canvas.height - tileSize;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase \"RIGHT\":\n\t\t\t\t{\n\t\t\t\t\tthis.body[0].x = 0;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase \"DOWN\":\n\t\t\t\t{\n\t\t\t\t\tthis.body[0].y = 0;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase \"LEFT\":\n\t\t\t\t{\n\t\t\t\t\tthis.body[0].x = canvas.width - tileSize;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// After its been assigned new coordinates, \n\t\t\t// it no longer needs be teleported.\n\t\t\tthis.needsTeleport = false;\n\t\t}\n\t\t// If not, then move snake head 1 tileSize in its direction.\n\t\telse\n\t\t{\n\t\t\tswitch(this.body[0].direction)\n\t\t\t{\n\t\t\t\tcase \"UP\":\n\t\t\t\t{\n\t\t\t\t\tthis.body[0].y -= tileSize;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase \"RIGHT\":\n\t\t\t\t{\n\t\t\t\t\tthis.body[0].x += tileSize;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase \"DOWN\":\n\t\t\t\t{\n\t\t\t\t\tthis.body[0].y += tileSize;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase \"LEFT\":\n\t\t\t\t{\n\t\t\t\t\tthis.body[0].x -= tileSize;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// If the Tile at the snake head's new position \n\t\t// contains a food item then eat it.\n\t\tif (this.body[0].tile.element == \"FOOD\")\n\t\t{\n\t\t\tthis.eatFood();\n\t\t}\n\t}",
"function moveItem(tmpList, body) {\n item.resetOutput();\n let output = item.getOutput();\n // -> Move item to diffrent place - counts with equiping filling magazine etc\n //cartriges handler start\n if (body.to.container === 'cartridges') {\n let tmp_counter = 0;\n for (let item_ammo in tmpList.data[0].Inventory.items) {\n if (body.to.id === tmpList.data[0].Inventory.items[item_ammo].parentId) {\n tmp_counter++;\n }\n }\n body.to.location = tmp_counter;//wrong location for first cartrige\n }\n //cartriges handler end\n\n for (let item of tmpList.data[0].Inventory.items) {\n if (item._id && item._id === body.item) {\n item.parentId = body.to.id;\n item.slotId = body.to.container;\n if (typeof body.to.location !== \"undefined\") {\n item.location = body.to.location;\n } else {\n if (item.location) {\n delete item.location;\n }\n }\n\n profile.setCharacterData(tmpList);\n return output;\n }\n }\n\n return \"\";\n}",
"movePaper(moveThisPaper) {\n if(this.r3a1_key_W.isDown && this.r3a1_paperMoveable == true) {\n r3a1_moveThisPaper.y -= 7;\n } if (this.r3a1_key_A.isDown && this.r3a1_paperMoveable == true) {\n r3a1_moveThisPaper.x -= 7;\n } if (this.r3a1_key_S.isDown && this.r3a1_paperMoveable == true) {\n r3a1_moveThisPaper.y += 7;\n } if (this.r3a1_key_D.isDown && this.r3a1_paperMoveable == true) {\n r3a1_moveThisPaper.x += 7;\n }\n }",
"function moveLegTop(){\n if(leg.moveDone){\n // reset motion\n leg.vy=0;\n leg.move1=false;\n leg.move3=false;\n\n // paw facing down\n // invert shapes\n leg.paw=-abs(leg.paw);\n leg.h=-abs(leg.h);\n leg.extend=-abs(leg.extend);\n // set position\n legStartPos=-200;\n // start motion\n leg.move3=true;\n leg.moveDone=false;\n\n }\n}",
"moveAround() {\r\n\r\n\r\n }",
"function moveBox(box){\n\t\t\n\t\tif(box.clasName != 'em_box'){ //if selected box is not empty (if box has a number)\n\t\t\t\n\t\t\t//getEmptyNextBox method tried to get empty box that is next to it\n\t\t\tvar emptyBox = getEmptyNextBox(box);\n\t\t\t\n\t\t\tif(emptyBox){\n\t\t\t\t// Temporary data for an empty box\n\t\t\t\tvar temp = {style: box.style.cssText, id: box.id};\n\t\t\t\t\n\t\t\t\t// Exchanges id and style values for the empty boxs\n\t\t\t\tbox.style.cssText = emptyBox.style.cssText;\n\t\t\t\tbox.id = emptyBox.id;\n\t\t\t\temptyBox.style.cssText = temp.style;\n\t\t\t\temptyBox.id = temp.id;\n\t\t\t\t\n\t\t\t\tif(position == 1){\n\t\t\t\t\tcheckSequence(); //calls the method to check correct order\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t}",
"saveOldQueuePosition(){\n const { snakeBodyParts, length} = this;\n const lastBodyPart = snakeBodyParts[ length -1 ];\n \n this.lastBodyPartOldPosition = {\n ...lastBodyPart\n }\n }",
"function Move(timestamp, id, start, dir, startPos, endPos) {\n //get all vehciles of this type\n var vehicles = $(id).toArray();\n\n //set startPos for each vehicle\n vehicles.forEach(function (vehicle) \n {\n if (!start && vehicle.style.left != \"\") { //first run and style.left isnt blank\n startPos = vehicle.style.left; //save style.left\n startPos = parseFloat(startPos); //remove \"px\" from string so its just numbers\n }\n });\n\n //use timestamp to step through the move positions\n if (!start) {\n //save start time\n start = timestamp;\n }\n var pos = timestamp - start; //get difference betwen this step and start time\n\n var atEnd = pos > endPos; //check for end of movement path - used in if statement a few lines down\n\n //alter pos and redefine end if for left\n if (dir === \"Left\") {\n pos = pos * -1; //invert pos for moving left instead of right\n atEnd = pos < endPos; //end pos logic is diffeent in this direction\n }\n\n //check for end of moevment path, if so run round logic, if not move again\n if (!atEnd) \n {\n //move each vehicle\n vehicles.forEach(function (vehicle) {\n vehicle.style.left = startPos + pos + 'px';\n });\n\n //set next recursive movement run\n window.requestAnimationFrame(function (timestamp) {\n Move(timestamp, id, start, dir, startPos, endPos);\n });\n } \n //at end of movement- run round logic\n else \n {\n //use active anims ot check if the round logic has already been updated\n if (activeAnimations.length > 0) {\n console.log(\"move end\");\n \n //clear running animations\n for(var i = 0; i < activeAnimations.length; i++)\n {\n cancelAnimationFrame(activeAnimations[i]);\n }\n activeAnimations = [];\n\n //based on gaem state, update state and goto next phase\n switch (gameState) {\n case state.Start:\n //chnage state for next run\n gameState = state.Playing;\n\n break\n\n case state.Playing:\n //change state\n gameState = state.End;\n\n //move vehicles off screen\n RoundEndTransition();\n break;\n\n case state.End:\n //chnage state\n gameState = state.Start;\n\n //clear round matches - so a NextRound() is only called once\n roundTotalMatches = 0;\n\n\n //start next round and move vehicles back on screen\n NextRound();\n RoundStartTransition();\n break;\n\n case state.Win:\n //goto win screen and clear as much data as possible\n WinScreen();\n break;\n }\n }\n\n\n }\n\n}",
"function moveObject(object) {\n // Switch based on object's current location to select destination\n // Your items <--> Your offerings\n // Their items <--> Their offerings\n var parentName = $(object).parent().attr('id');\n switch (parentName) {\n case \"yourItems\":\n $(\"#yourOffering\").append(object);\n $(object).addClass(\"item-preview-in-trade\");\n filterTradeItems(true);\n\n itemsOffered++;\n $(\"#yourOffering\").find('.placeholder').hide();\n break;\n case \"theirItems\":\n $(\"#theirOffering\").append(object);\n $(object).addClass(\"item-preview-in-trade\");\n filterTradeItems(false);\n\n itemsReceived++;\n $(\"#theirOffering\").find('.placeholder').hide();\n break;\n case \"yourOffering\":\n $(\"#yourItems\").append(object);\n $(object).removeClass(\"item-preview-in-trade\");\n filterTradeItems(true);\n\n itemsOffered--;\n if (itemsOffered == 0) {\n $(\"#yourOffering\").find('.placeholder').show();\n }\n break;\n case \"theirOffering\":\n $(\"#theirItems\").append(object);\n $(object).removeClass(\"item-preview-in-trade\");\n filterTradeItems(false);\n\n itemsReceived--;\n if (itemsReceived == 0) {\n $(\"#theirOffering\").find('.placeholder').show();\n }\n break;\n }\n updateTradeValue();\n}",
"function removeHtmlBodySteps(steps) {\r\n while (steps[steps.length - 1].toString() === \"html\" || steps[steps.length - 1].toString() === \"body\") {\r\n steps.pop();\r\n }\r\n }",
"function movelegBottom(){\n if(leg.moveDone){\n // reset motion\n leg.vy=0;\n leg.move1=false;\n leg.move3=false;\n // paw facing up\n // set shapes to initial direction\n leg.paw=abs(leg.paw);\n leg.h=abs(leg.h);\n leg.extend=abs(leg.extend);\n // position\n legStartPos=height+200;\n // start motion\n leg.move1=true;\n leg.moveDone=false;\n }\n}",
"function moveElement(playingArea, element) {\n\n //Initialization of the different elements used to modify html document\n var puzzleArea = document.getElementById(\"puzzlearea\");\n var puzzlePieces = puzzleArea.getElementsByTagName(\"div\");\n\n //Conditions that check the directions in which the puzzle piece can be moved\n if(playingArea[element - 1][0] == 16){\n \n return movePieceUp(playingArea, element, puzzlePieces);\n }\n else if(playingArea[element - 1][1] == 16){\n \n return movePieceRight(playingArea, element, puzzlePieces);\n }\n else if(playingArea[element - 1][2] == 16){\n \n return movePieceDown(playingArea, element, puzzlePieces);\n }\n else if(playingArea[element - 1][3] == 16){\n\n return movePieceLeft(playingArea, element, puzzlePieces);\n }\n}",
"function moveComponents(updwn)\r\n{\r\n\tvar directn = parseInt(updwn);\r\n\thideAllDialogs();\r\n var stateDisplay = document.getElementById('stateDisplay');\r\n stateDisplay.value = globalBreadBoard.toString();\r\n\r\n okToClear = true;\r\n clearBreadBoard( ! okToClear);\r\n\r\n var circuitCode = stateDisplay.value;\r\n var lines = circuitCode.split(\"\\n\");\r\n\r\n for(var i = 0; i < lines.length; ++ i)\r\n {\r\n if(lines[i].length > 10 && lines[i].indexOf(\"BREADBOARDSTYLE\") == -1 && lines[i].indexOf(\"SHOWTHETOPAREA\") == -1)\r\n {\r\n var parts = lines[i].split(\"|\");\r\n\r\n\t\t\tif(directn == 1) // downwards\r\n\t\t\t{\r\n\t\t\t\tparts[3] = parseInt(parts[3]) + 295\t\t\r\n\t\t\t}\r\n\t\t\telse if(directn == 2) // up and drop/delete any in top area\r\n\t\t\t{\t\r\n\t\t\t\tif ( parts[3] < 295)\r\n\t\t\t\t{\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tparts[3] = parseInt(parts[3]) - 295;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if(directn == 3) // up and gather\r\n\t\t\t{\t\r\n\t\t\t\tif( parts[3] < 295)\r\n\t\t\t\t{\r\n\t\t\t\t\tparts[3] = 0; \r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tparts[3] = parseInt(parts[3]) - 295;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if(directn == 4) // up and left for backward compatability\r\n\t\t\t{\r\n\t\t\t\tparts[2] = parseInt(parts[2]) - 160\t// adjust the x coordinate value\t\r\n\t\t\t\tparts[3] = parseInt(parts[3]) - 60\t// adjust the y coordinate value\t\r\n\t\t\t}\r\n\t\t\r\n var newComp = new BBComponent(parts[0], parts[1], parts[2], parts[3], parts[4], parts[5],\r\n parts[6], parts[7], parts[8], parts[9], parts[10], parts[11], parts[12]);\r\n createComponent(newComp);\r\n }\r\n }\r\n}",
"build_body_frames(knowledgebase) {\n //// Pre-process statements\n\n // get all the statements for this section\n let section = this.variant;\n let section_statements = knowledgebase.filter(\n entry => entry[KB_KEY_SECTION] === section\n );\n\n // find identical statements with different emotions and merge\n // first, sort by statement\n section_statements.sort((a, b) => a.Statement.localeCompare(b.Statement));\n\n // then, merge identical\n let merged_section_statements = [];\n let item = section_statements[0];\n for(let i = 1; i <= section_statements.length; i++) {\n // peek at the next item\n let next;\n if(i < section_statements.length) {\n next = section_statements[i];\n }\n if(i === section_statements.length || next.Statement !== item.Statement) {\n // item is the last of a run, make a new entry in the merged list\n let item_to_push = Object.assign(item);\n item_to_push.Emotions = item_to_push.Emotion.split(', ');\n delete item_to_push.Emotion;\n merged_section_statements.push(item_to_push);\n } else {\n // merge this entry into the next entry\n next.Emotion = item.Emotion.concat(', ',next.Emotion);\n }\n item = next;\n }\n\n // finally, re-sort by emotion\n merged_section_statements.sort(\n (a, b) => a.Emotions[0].localeCompare(b.Emotions[0]));\n\n //// Create frames\n\n // copy the list (we'll use 1st copy to create uds later, 2nd copy to create frames now)\n let statements = merged_section_statements.concat();\n\n statements = _.shuffle(statements);\n\n // divide them into pages...\n\n // first, determine number of statements on each page\n let a, b, c, d, e;\n [a, b, c, d, e] = DbtWorksheetModelFwd.compute_page_counts(\n statements.length, BODY_MAX_STATEMENTS_PER_PAGE);\n let pages = [];\n // make d many pages with b many statements each\n for(let idx = 0; idx < d; idx++) {\n pages.push(statements.splice(0, b));\n }\n // make e many pages with c many statements each\n for(let idx = 0; idx < e; idx++) {\n pages.push(statements.splice(0, c));\n }\n\n // make a frame for each page\n let body_frames = [];\n for(let idx of Array(pages.length).keys()) {\n let page = pages[idx];\n let page_statements = [];\n for(let stmt of page) {\n page_statements.push([stmt.Statement, false, stmt.Emotions]);\n }\n\n let frame = {};\n frame.title = BODY_TITLE + ' ' + (idx+1);\n frame.response_name = RESPONSE_GENERIC;\n frame.template = STATEMENTS_FRAME_TEMPLATE;\n frame.question = BODY_QUESTION[this.variant];\n\n frame.statements = [];\n frame.is_app = true;\n for(let statement of page_statements) {\n frame.statements.push(statement);\n }\n body_frames.push(new StatementsBodyFrame(frame, this.logger));\n }\n\n //// Create uds\n for (let stmt of merged_section_statements) {\n let ud = new UserData(stmt.Statement, false, stmt.Emotions, RESPONSE_GENERIC);\n this.uds.add(ud);\n }\n\n return body_frames;\n }",
"function moveItem(src, dst, copy) {\n \"use strict\";\n copy = copy || false;\n console.log('moveItem ' + src + ' ' + dst);\n $.post('/editor/move_item', { src: src, dst: dst, copy: copy.toString() }, function (response) {\n var srcDirs = (src.match(/.*\\//)[0]).split('/'),\n dstDirs = (dst.match(/.*\\//)[0]).split('/'),\n dstDir = dstDirs.join('/'),\n jqDst = $('li.directory > a[rel=\"' + dstDir + '\"]'),\n bDstIsFile = (dst.split('/').pop() !== '');\n // If src is a directory, reduce by one\n if (srcDirs.join('/') === src) {\n srcDirs.pop();\n }\n // Optimise redisplay of fileTree\n if (dstDir === ROOT) {\n console.log('move to top');\n displayTree(src);\n } else if (srcDirs.length === dstDirs.length) {\n console.log('optimise equal paths');\n $('li > a[rel=\"' + src + '\"]').hide('slow');\n if (bDstIsFile) {\n jqDst.click();\n }\n jqDst.click();\n } else if (srcDirs.length < dstDirs.length) {\n console.log('optimise deeper');\n if (jqDst.parent().hasClass('expanded')) {\n jqDst.click();\n }\n $('li > a[rel=\"' + src + '\"]').hide('slow');\n jqDst.click();\n } else {\n console.log('optimise shallower');\n if (jqDst.parent().hasClass('expanded')) {\n jqDst.click();\n }\n jqDst.click();\n }\n if (src.split(ROOT).pop() === $('#path').val()) {\n if (bDstIsFile) {\n displayLocation(dst.split(ROOT).pop());\n } else {\n displayLocation((dst + src.split('/').pop()).split(ROOT).pop());\n }\n if (bFileChanged) {\n highlightChanged();\n }\n }\n }).error(function (jqXHR, textStatus, errorThrown) {\n console.log('moveItem: ' + textStatus + ': ' + errorThrown);\n saveMsg('Move failed');\n });\n}",
"function move1(addition){\n //below condition so that it doesnt move when it reaches the end\n if((multiplier[2]==0&&addition==1)||(multiplier[divs.length-1]==0&&addition==-1))\n return;\n if(currentDay){\n arrowTransition(-1*addition);\n return;\n }\n /* if(addition!=0){\n $('#mycanvas').animate({\n left :('+='+addition*100+'px')\n },time);\n }*/\n for(var i=1;i<divs.length;++i){\n multiplier[i]=multiplier[i]+addition;\n //we are changing the properties of the divs according to their value in the multiplier ml-marginleft mt-margin-top\n var ml = multiplier[i]*130;\n var mt = Math.abs(multiplier[i])*-1*90;\n var angle = -1*multiplier[i]*20;\n var width = Math.abs(multiplier[i])*-1*20 +100;\n var opacity =1;\n for(var j=Math.abs(multiplier[i]);j!=0;--j)\n opacity/=2;\n if(multiplier[i]>0)\n ml=ml+Math.abs(multiplier[i])*20;\n if(opacity==1)\n current_display_block=divs[i];\n //one thing about move is that u have to feed relative values....relative to the initial position of the div...that is if u want to move a div from 420 to 450..just give .y(30)\n var k=0;\n if(Math.abs(multiplier[i])>2)\n opacity=0;\n move(divs[i])\n .duration(time)\n .x(ml)\n .y(mt)\n .set('opacity',opacity)\n .skew(0,angle)\n .set('width',width)\n .set('height',100)\n .end();\n \n }\n change_dateViewer();\n highlight_tags();\n colour_change();\n }",
"function move(currentorder)\n\n/** \n * Every if of the function, checks the value of the objetct direction(string). First step is check where is looking the Rover.\nSedcond step is depending on where is looking the Rover, the function will ++ or -- a position into the Rover coordinates. \nOr change the value of the object direction.\n */ \n{\n if (Myrover.direction === 'up') {\n\n switch (currentorder) {\n case 'f':\n Myrover.position.x++\n break;\n case 'r':\n Myrover.direction = 'right';\n return;\n break;\n case 'b':\n Myrover.position.x--\n break;\n case 'l':\n Myrover.direction = 'left'\n return;\n break;\n };\n };\n\n\n if (Myrover.direction === 'right') {\n switch (currentorder) {\n case 'f':\n Myrover.position.y++\n break;\n case 'r':\n Myrover.direction = 'down';\n return;\n break;\n case 'b':\n Myrover.position.y--\n break;\n case 'l':\n Myrover.direction = 'up';\n return;\n break;\n };\n };\n\n if (Myrover.direction === 'down') {\n switch (currentorder) {\n case 'f':\n Myrover.position.x--\n break;\n case 'r':\n Myrover.direction = 'left'\n return;\n break;\n case 'b':\n Myrover.position.x++\n break;\n case 'l':\n Myrover.direction = 'right'\n return;\n break;\n };\n };\n\n if (Myrover.direction === 'left') {\n switch (currentorder) {\n case 'f':\n Myrover.position.y--\n break;\n case 'r':\n Myrover.direction = 'up'\n return;\n break;\n case 'b':\n Myrover.position.y++\n break;\n case 'l':\n Myrover.direction = 'down'\n return;\n break;\n };\n };\n}",
"makeMove(toStackId) {\n this.moveItem(this.find_stack_by_contents(this.currently_dragged),\n this.find_stack_by_id(toStackId))\n }",
"movePiece(p_index, t_index) {\n // Pull variables out of loop to expand scope\n let piece = null;\n let o_tile = null;\n let t_tile = null;\n\n // Look for old and new tiles by index\n for (let line of this.board) {\n for (let tile of line) {\n if (tile.index === p_index) {\n // Grap piece and old tile\n piece = tile.piece;\n o_tile = tile;\n }\n if (tile.index === t_index) {\n // Grab target tile\n t_tile = tile;\n }\n }\n }\n\n // Only move piece if old tile has one to move and move id valid\n // Make sure you can't take out your own pieces\n if (o_tile.piece && t_tile.valid) {\n if (o_tile.piece.color === this.turn) {\n if (t_tile.piece) {\n if (o_tile.piece.color !== t_tile.piece.color) {\n o_tile.piece = null;\n t_tile.piece = piece;\n this.turn = this.turn === 'black' ? 'white' : 'black'; \n }\n } else { \n o_tile.piece = null;\n t_tile.piece = piece;\n this.turn = this.turn === 'black' ? 'white' : 'black'; \n }\n }\n }\n\n // Reset all valid tags\n for (let line of this.board) {\n for (let tile of line) {\n tile.valid = false;\n }\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
build rotated table column 1 from first row of main table | function FlexTable_stacks_in_4914_page22_SetRotHeader() {
if (0 != 1) { return; }
var table = document.getElementById('FlexTable_stacks_in_4914_page22');
var rtable = document.getElementById('FlexTableRot_stacks_in_4914_page22');
if (!table || !rtable) { return; }
for (i=0; i<table.rows[0].cells.length; i++) {
rtable.rows[i].cells[0].innerHTML = table.rows[0].cells[i].innerHTML;
}
} | [
"function FlexTable_stacks_in_5677_page22_SetRotHeader() {\n\n\tif (0 != 1) { return; }\n\n\tvar table = document.getElementById('FlexTable_stacks_in_5677_page22');\n\tvar rtable = document.getElementById('FlexTableRot_stacks_in_5677_page22');\n\tif (!table || !rtable) { return; }\n\n\tfor (i=0; i<table.rows[0].cells.length; i++) {\n\t\trtable.rows[i].cells[0].innerHTML = table.rows[0].cells[i].innerHTML;\n\t\t}\n\t}",
"function rotate90CCW1(m) {\n m = cloneDeep(m);\n const size = m.length;\n // console.log(m.map(i => i.join(', ')).join('\\n'), '\\n');\n\n for (let i = 0; i < Math.floor(size / 2); i++) {\n const first = i;\n const last = size - 1 - i;\n for (let j = first; j < last; j++) {\n const k = j - i;\n const tmp = m[first][last - k];\n // console.log('first:', first, 'last:', last, 'k:', k, 'tmp:', tmp, '\\n');\n\n m[first][last - k] = m[last - k][last];\n m[last - k][last] = m[last][first + k];\n m[last][first + k] = m[first + k][first];\n m[first + k][first] = tmp;\n // console.log(m.map(i => i.join(', ')).join('\\n'), '\\n');\n }\n }\n\n return m;\n}",
"ddTable () {\n\t\tlet table = [this.output];\n\t\tfor (let i = 0; i < this.output.length - 1; i++) {\n\t\t\ttable.push([]);\n\t\t\tfor ( let j = 0; j < table[i].length - 1 ; j++ ) {\n\t\t\t\tlet current_row = table[i+1]\n\t\t\t\tcurrent_row.push( this.output[j+i+1] - this.output[j] );\n\t\t\t}\n\t\t}\n\t\treturn table;\n\t}",
"function fourDTableFix(){\n\t$j('.fourDTable').prepend('<tr class=\"hide\"><td></td><td></td></tr>');\n\t$j('.fourDTable tr:odd').addClass('alt');\n\t$j('.fourDTable td:first-child').wrapInner('<strong />');\n}",
"renderMatrix () {\n return this.generateMatrix().map((y, i) => {\n return (<tr key={i + 'y'}>{\n y.map((x, i) => {\n return (<td key={i + 'x'}>{x}</td>);\n })\n }</tr>);\n });\n }",
"function buildDown() {\n\tvar curRow = PascalRow.row; // The current row being worked on\n\n\twhile (curRow.length > 1) {\n\t\tvar nextRow = new Array(curRow.length - 1);\n\t\tfor (var i = 0; i < nextRow.length; i++) {\n\t\t\tnextRow[i] = curRow[i] + curRow[i+1];\n\t\t}\n\t\tcurRow = nextRow;\n\t}\n\t\n\treturn curRow;\n}",
"getTableHeading() {\n return (\n <Entries.Row isHeading={true}>\n { this.getCellLayouts() }\n </Entries.Row>\n );\n }",
"function generateTable() {\n emptyTable();\n generateRows();\n generateHead();\n generateColumns();\n borderWidth();\n}",
"__getRowHeader () {\n\n var string = \" |\";\n var i;\n\n console.log(this.board);\n\n this.board.forEach(function (column, index) {\n string += \"-\" + index + \"-|\";\n });\n\n return string;\n }",
"function reset_table(table) {\n table.innerHTML = \"\";\n var legend_row = table.insertRow(0);\n legend_row.outerHTML = \"<tr class='legend'><th>date/month</th><th onclick='top_column(1)'>cases</th><th onclick='top_column(2)'>tests</th><th onclick='top_column(3)'>test capacity</th><th onclick='top_column(4)'>patients in hospital</th></tr>\";\n }",
"function loadTableTPD()\n{\n var arr = new Array(\"Attained Age upon TPD\",\"Less Than 7\",\"7 to less than 15\",\"15 to less than 65\",\"TPD Benefit Limit per Life\",\"RM 100,000\",\"RM 500,000\",\"RM 3500,000\");\n \n var table = document.createElement('table');\n table.setAttribute('class','normalTable');\n table.style.width = \"95%\";\n\n for (i = 1; i<= arr.length/2;i++)\n {\n \n var tr = document.createElement('tr');\n var td = document.createElement('td');\n var td2 = document.createElement('td');\n td.setAttribute('class','textAlignCenter');\n td2.setAttribute('class','textAlignCenter');\n td.innerHTML = arr[i-1];\n td2.innerHTML = arr[(arr.length/2)-1+i];\n tr.appendChild(td);\n tr.appendChild(td2);\n table.appendChild(tr);\n }\n \n return table;\n \n}//table TPD in No 2",
"function redefineTableArray () {\n\t//function to redefinetableArray\n\t\n\tvar r = originalNumberRecords; //start from rows 3\nvar c = originalNumberOfFields; //start from col 5..if edit don't forget to increase the numberOfFields value\n\nvar rows = tableTitle.length;//current total number of rows after adding new ones will = tableTitle.length\nvar cols = currentNumberOfFields;\n\nfor (var i = 0; i < rows; i++) {\n var start;\n if (i < r) {\n start = c;\n } else {\n start = 0;\n tableArray.push([]);\n }\n for (var j = start; j < cols; j++) {\n tableArray[i].push(0);\n }\n}\nreturn tableArray;\n//above is trial code to define new tableArray\n//PUTS 7 0's after each record ? How come?\n}//end function redefineTableArray",
"function top_column(col_idx) {\n table = document.getElementById(\"output_table\");\n data = get_table_data(table); // get the data from the table\n if (data.length == 1) return;\n sorted = data.sort((a, b) => {\n return b[col_idx]- a[col_idx]\n })\n reset_table(table);\n for (i=0; i<10; i++) {\n addRowBottom(sorted[i]);\n }\n }",
"function constructHeaderTbl1() {\t\n\tprintHeadInnerTable = '<div class=\"page\"><table cellspacing=\"0\" class=\"printDeviceLogTable ContentTable\" style=\"font-size: 15px;height:45%;min-height:580px;max-height:580px;table-layout: fixed; width: 1100px;\" width=\"100%\">'\n\t\t+'<thead><tr><th rowspan=\"2\" width=\"50px\">Article</th>'\n\t\t+'<th rowspan=\"2\" width=\"5px\"></th>'\n\t\t+'<th rowspan=\"2\" class=\"columnDivider\">Description</th>'\n\t\t+'<th colspan=\"3\" class=\"centerValue columnDivider\">Last Received Details</th>'\n\t\t+'<th rowspan=\"2\" class=\"centerValue\" width=\"50px\">OM</th>'\n\t\t+'<th rowspan=\"2\" class=\"centerValue\" width=\"50px\">SOH</th>'\n\t\t+'<th rowspan=\"2\" class=\"centerValue\" width=\"80px\">Units to Fill</th>'\n\t\t+'<th rowspan=\"2\" class=\"centerValue\" width=\"100px\">LTO</th>'\n\t\t+'<th rowspan=\"2\" class=\"lastColumn leftValue\" width=\"140px\">Comment</th>'\n\t\t+'</tr><tr class=\"subHeader\">'\n\t\t+'<th class=\"centerValue\" width=\"50px\">Date</th>'\n\t\t+'<th class=\"centerValue columnDivider\" width=\"50px\">Qty.</th>'\n\t\t+'<th class=\"centerValue\" width=\"50px\">Order</th></tr></thead>';\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\n}",
"function rotate() {\n // Transpose\n const len = gameBoard.length;\n for (let i = 0; i < len; i++) {\n for (let k = i; k < len; k++) {\n const temp = gameBoard[i][k];\n gameBoard[i][k] = gameBoard[k][i];\n gameBoard[k][i] = temp;\n }\n }\n\n // Flip horizontally\n for (let i = 0; i < len; i++) {\n for (let k = 0; k < len/2; k++) {\n const temp = gameBoard[i][k];\n gameBoard[i][k] = gameBoard[i][len-k-1];\n gameBoard[i][len-k-1] = temp;\n }\n }\n}",
"createTable(x, y, z) {\n\t\t'use strict';\n\t\tvar table = new Table(x, y, z);\n\n\t\ttable.createTableLeg(-35, 30, -50);\n\t\ttable.createTableLeg(-35, 30, 50);\n\t\ttable.createTableLeg(35, 30, -50);\n\t\ttable.createTableLeg(35, 30, 50);\n\t\ttable.createTableTop();\n\t\tthis.scene.add(table);\n\t\treturn table;\n\t}",
"function sortTable(table) {\n\tvar store = [];\n\tfor (var i = 0, len = table.rows.length; i < len; i++) {\n\t\tvar row = table.rows[i];\n\t\tvar sortnr = parseInt(row.id);\n\t\tif (!isNaN(sortnr)) store.push([sortnr, row]);\n\t}\n\tstore.sort(function(x, y) {\n\t\treturn x[0] - y[0];\n\t});\n\tfor (var i = 0, len = store.length; i < len; i++) {\n\t\t$(store[i][1]).find(\"td:first\").text(i + 1);\n\t\t$(\"section.jsContainer #js-table tbody\").append($(store[i][1]).get(0));\n\t}\n\tstore = null;\n}",
"function generateTableHeaderRow(){\n var headerRowHTML = \"\";\n\n // TODO: Question 2 - Add additional table headers here to\n // give a header for each table data element.\n\n headerRowHTML += '<tr>';\n headerRowHTML += generateTableHeader(\"ID#\");\n headerRowHTML += generateTableHeader(\"First\");\n headerRowHTML += generateTableHeader(\"Last\");\n headerRowHTML += generateTableHeader(\"Email\");\n headerRowHTML += generateTableHeader(\"Home Address\");\n headerRowHTML += generateTableHeader(\"Job\");\n headerRowHTML += '</tr>';\n\n return headerRowHTML;\n }",
"function createTable() {\n var main = $('#region-main');\n var table = $('<table></table>');\n table.attr('id', 'local-barcode-table');\n table.addClass('generaltable');\n table.addClass('local-barcode-table');\n\n var thead = table.append('<thead></thead>');\n var header = thead.append('<tr></tr>');\n header.html('<th colspan=\"8\" class=\"local-barcode-th-left local-barcode-sm-hide\">' + strings[1] +\n ' - (<span id=\"local_barcode_id_count\">' +\n '0</span> ' + strings[6] + ')</th>' +\n '<th colspan=\"17\" class=\"local-barcode-th-center\">' + strings[0] + '</th>' +\n '<th colspan=\"5\" class=\"local-barcode-th-right\">' + strings[8] +\n '(<span id=\"local_barcode_id_submit_count\">0</span>)</th>');\n table.append('<tbody id=\"tbody\"></tbody>');\n\n main.append(table);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns an HTML string to show a weather icon depending "icon". A sun will be displayed by default. | function getWeatherIcon(icon)
{
if (icon.localeCompare('clear-night') == 0)
{
return '<i class="wi wi-night-clear" style="font-size: 32px"></i>';
}
else if (icon.localeCompare('rain') == 0)
{
return '<i class="wi wi-rain" style="font-size: 32px"></i>';
}
else if (icon.localeCompare('snow') == 0 || icon.localeCompare('sleet') == 0)
{
return '<i class="wi wi-snow" style="font-size: 32px"></i>';
}
else if (icon.localeCompare('fog') == 0 || icon.localeCompare('cloudy') == 0 || icon.localeCompare('partly-cloudy-day') == 0)
{
return '<i class="wi wi-day-fog" style="font-size: 32px"></i>';
}
return '<i class="wi wi-day-sunny" style="font-size: 32px"></i>'
} | [
"function weatherIcon(weather) {\n const mainweather = weather.weather[0].main;\n const weather_icon = weather.weather[0].icon;\n let icon = \"\";\n\n switch (mainweather) {\n case \"Rain\":\n if (weather_icon === \"09d\") {\n icon += \"weather_icons/rainy-7.svg\";\n } else {\n icon += \"weather_icons/rainy-1.svg\";\n }\n break;\n case \"Thunderstorm\":\n icon += \"weather_icons/thunder.svg\";\n break;\n case \"Drizzle\":\n icon += \"weather_icons/rainy-4.svg\";\n break;\n case \"Snow\":\n icon += \"weather_icons/snowy-6.svg\";\n break;\n case \"Haze\":\n icon += \"weather_icons/haze.png\";\n break;\n case \"Clear\":\n if (weather_icon === \"01d\") {\n icon += \"weather_icons/day.svg\";\n } else {\n icon += \"weather_icons/night.svg\";\n }\n break;\n case \"Clouds\":\n if (weather_icon === \"02d\" || \"04d\") {\n icon += \"weather_icons/cloudy-day-3.svg\";\n } else if (weather_icon === \"02n\" || \"04n\") {\n icon += \"weather_icons/cloudy-night-3.svg\";\n } else {\n icon += \"weather_icons/cloudy.svg\";\n }\n break;\n default:\n icon += \"weather_icons/mist.svg\";\n break;\n }\n return icon;\n}",
"function getWeatherIcon(day){\n let src = './images/'\n switch(day.weather[0].main){\n case 'Thunderstorm':\n if (/rain|drizzle/.test(day.weather[0].description)){\n src += 'rain-thunder'\n }\n break; \n case 'Drizzle':\n case 'Rain': \n src += 'rain'\n break;\n case 'Snow': \n src += 'snow'\n break; \n case 'Clear': \n src += 'sunny'; \n break; \n case 'Clouds': \n if (day.clouds.all < 50) { \n src += 'part-sunny'\n }else{\n src += 'cloudy';\n }\n break;\n default: \n src += 'cloudy'; \n }\n src += '.svg'; \n return src;\n}",
"function getIllustration(weatherIcon) {\n let temp = (props.iconCode.temperature);\n let illustrationImg = \"\";\n switch (weatherIcon) {\n case \"01d\":\n if (temp < -1) {\n illustrationImg = ImgCold;\n } else {\n illustrationImg = ImgSunny;\n }\n break;\n case \"01n\":\n if (temp < -1) {\n illustrationImg = ImgCold;\n } else {\n illustrationImg = ImgNight;\n }\n break;\n case \"02d\":\n case \"02n\":\n case \"03d\":\n case \"03n\":\n case \"04d\":\n case \"04n\":\n if (temp < -1) {\n illustrationImg = ImgCold;\n } else {\n illustrationImg = ImgCloudy;\n }\n break;\n case \"09d\":\n case \"09n\":\n case \"10d\":\n case \"10n\":\n illustrationImg = ImgRain;\n break;\n case \"11d\":\n case \"11n\":\n illustrationImg = ImgThunder;\n break;\n case \"13d\":\n case \"13n\":\n illustrationImg = ImgSnow;\n break;\n case \"50d\":\n case \"50n\":\n if (temp < -1) {\n illustrationImg = ImgCold;\n } else {\n illustrationImg = ImgMisty;\n }\n break;\n default: illustrationImg = ImgCloudy;\n }\n return illustrationImg;\n }",
"function chooseIcon(condition) {\n condition = condition.toLowerCase();\n if (condition.includes(\"thunderstorm\")) return weatherIcon(STORM);\n if (condition.includes(\"freezing\")||condition.includes(\"snow\")||\n condition.includes(\"sleet\")) {\n return weatherIcon(SNOW);\n }\n if (condition.includes(\"drizzle\")||\n condition.includes(\"shower\")) {\n return weatherIcon(RAIN);\n }\n if (condition.includes(\"rain\")) return weatherIcon(RAIN);\n if (condition.includes(\"clear\")) return weatherIcon(SUN);\n if (condition.includes(\"few clouds\")) return weatherIcon(PART_SUN);\n if (condition.includes(\"scattered clouds\")) return weatherIcon(CLOUD);\n if (condition.includes(\"clouds\")) return weatherIcon(CLOUD);\n if (condition.includes(\"mist\") ||\n condition.includes(\"smoke\") ||\n condition.includes(\"haze\") ||\n condition.includes(\"sand\") ||\n condition.includes(\"dust\") ||\n condition.includes(\"fog\") ||\n condition.includes(\"ash\") ||\n condition.includes(\"squalls\") ||\n condition.includes(\"tornado\")) {\n return weatherIcon(CLOUD);\n }\n return weatherIcon(CLOUD);\n}",
"function weatherToEmoji(weather) {\n switch (weather.toLowerCase()) {\n case 'sun':\n return 'โ๏ธ';\n case 'clouds':\n return 'โ๏ธ';\n case 'mist':\n case 'fog':\n return '๐ซ';\n case 'thunderstorm':\n return 'โก๏ธ';\n case 'drizzle':\n case 'rain':\n return 'โ๏ธ';\n case 'snow':\n return 'โ๏ธ';\n default:\n return '';\n }\n}",
"drawIcon() {\n return `<i class=\"fab fa-sketch\"></i>`\n }",
"function render(wd) {\n var currentLocation = wd.name;\n var currentWeather = wd.weather[0].description;\n var currentTemp = displayTemp(wd.main.temp, cel);\n var high = wd.main.temp_max;\n var low = wd.main.temp_min;\n var icon = wd.weather[0].icon;\n var humidity = wd.main.humidity;\n var wind = wd.wind.speed;\n var currentCountry = wd.country;\n\n $('#currentLocation').html(currentLocation);\n $('#currentTemp').html(currentTemp);\n $('#currentWeather').html(currentWeather);\n $('#humidity').html(\" / humidity: \" + humidity + \"%\").prepend(\"speed of wind: \" + wind + \"km/h\");\n\n\n var iconSrc = \"http://openweathermap.org/img/w/\" + icon + \".png\";\n $('#currentTemp').prepend('<img src=\"' + iconSrc + '\">');\n\n}",
"showIconFromSkycons(icon) { // n.b it's not still set to use, we need darsky api to use it or to hard code\n console.log(icon);\n var skycons = new Skycons({ color: \"black\" });\n const icon1 = icon.replace(/-/g, '_').toUpperCase();\n skycons.add(document.getElementById(\"w-icon\"), Skycons[icon1]);\n\n skycons.play();\n }",
"function getMarkerIcon(concertDate) {\n var currentDate = +new Date();\n concertDate = convertDateToTimestamp(concertDate);\n var timeToConcert = concertDate - currentDate;\n if (timeToConcert < 1000 * 60 * 60 * 24 * 7) {\n return 'http://maps.google.com/mapfiles/ms/icons/red-dot.png';\n } else if (timeToConcert < 1000 * 60 * 60 * 24 * 30) {\n return 'http://maps.google.com/mapfiles/ms/icons/blue-dot.png';\n } else {\n return 'http://maps.google.com/mapfiles/ms/icons/green-dot.png';\n }\n}",
"function fnIconize(tipo) {\n var icon = '';\n switch (tipo) {\n case 'skill':\n icon = 'flash_on';\n break;\n case 'breakfast':\n icon = 'local_dining';\n break;\n case 'forge':\n icon = 'gavel';\n break;\n case 'furnace':\n icon = 'whatshot';\n break;\n case 'fury':\n icon = 'remove_red_eye';\n break;\n case 'equipment':\n icon = 'security';\n break;\n case 'system':\n default:\n icon = 'info_outline';\n }\n return icon;\n }",
"function buttonTemplate(icon) {\n return '<div class=\"vjs-topbar-button__icon\"><i class=\"fa ' + icon + '\" aria-hidden=\"true\"></i></div>';\n }",
"function get_icon_number (icon_name,current_hour,sunrise_hour,sunset_hour){\n switch(icon_name){\n case \"partlycloudy\":\n case \"mostlycloudy\":\n return icon_number.ICON_PARTLYCLOUDY;\n case \"cloudy\":\n return icon_number.ICON_CLOUDY;\n case \"tstorms\":\n return icon_number.ICON_TSTORMS;\n case \"sunny\":\n return icon_number.ICON_CLEAR_DAY;\n case \"snow\":\n case \"flurries\":\n return icon_number.ICON_SNOW;\n case \"sleet\":\n return icon_number.ICON_SLEET;\n case \"rain\":\n return icon_number.ICON_RAIN;\n case \"partlysunny\":\n case \"mostlysunny\":\n return icon_number.ICON_PARTLYSUNNY;\n case \"hazy\":\n case \"fog\":\n return icon_number.ICON_FOG;\n default:\n if(current_hour == sunrise_hour)\n return icon_number.ICON_SUNRISE;\n else if(current_hour == sunset_hour)\n return icon_number.ICON_SUNSET;\n else if(current_hour < sunrise_hour || current_hour > sunset_hour)\n return icon_number.ICON_CLEAR_NIGHT;\n else\n return icon_number.ICON_CLEAR_DAY;\n }\n}",
"function getIconUrl(entry) {\n\tvar url = entry.iconurl;\n\tif (!url)\n\t\t// unknown - relative to HTML\n\t\treturn \"icons/_blank.png\";\n\t\n\t// Used on this device: \n\t// build global address (with prefix), \n\t// but try cache if possible (from cache path and prefix)\n\tif (entry.iconpath && entry.prefix) {\n\t\treturn entry.prefix+entry.iconpath;\n\t}\n\treturn getInternetUrl(entry, url);\n}",
"institutionIcon(id) {\n return 'static/institutions/' + id + '.png'\n }",
"function getDefaultIcon(x,y,s){\n\tvar result=\"M\"+(x-s/2)+\" \"+y+\",\";\n\tresult=result+\"S\"+(x-s/4)+\" \"+(y-s/2)+\" \"+x+\" \"+y+\",\";\n\tresult=result+\"S\"+(x+s/4)+\" \"+(y+s/2)+\" \"+(x+s/2)+\" \"+y+\",\";\n\t\n\treturn result;\n}",
"function createIconWrapper(i, locationObject) {\n let tempIcon = locationObject.siteIcon;\n let tempName = locationObject.siteName;\n let tempURL = locationObject.url;\n let wrapper = \"\";\n if (tempURL === null) {\n // DISPLAY NONE\n wrapper = `<a href=\"${tempURL}\" class=\"iz-i m-s d-n\">\n <img src=\"${tempIcon}\" alt=\"${tempName}\" title=\"${tempName}\" class=\"br bd-g e-g-hv h-f w-f s-hv d-n\">\n </a>`;\n }\n else {\n wrapper = `<a href=\"${tempURL}\" class=\"iz-i m-s\">\n <img src=\"${tempIcon}\" alt=\"${tempName}\" title=\"${tempName}\" class=\"br bd-g e-g-hv h-f w-f p-s s-hv\">\n </a>`;\n }\n return wrapper;\n }",
"function thirdDayWeather (weatherObject) {\n\tvar content = '';\n\t\tcontent += '<h4>' + weatherObject.city.name + '</h4>';\n\t\tcontent += '<h3>' + parseInt(weatherObject.list[2].temp.day) + '°' + '/' + parseInt(weatherObject.list[2].temp.min) + '°' + '</h3>';\n\t\tcontent += '<img src = \"http://openweathermap.org/img/w/'+ weatherObject.list[2].weather[0].icon +'.png\">';\n\t\tcontent += '<h4>' + 'Wind: ' + weatherObject.list[2].speed + '</h4>';\n\t\tcontent += '<h4>' + 'Humidity: ' + weatherObject.list[2].humidity + '</h4>';\n\t\tcontent += '<h4>' + 'Pressure: ' + weatherObject.list[2].pressure + '</h4>';\n\t\tcontent += weatherObject.list[2].weather[0].description;\n\t$('#thirdDayWeather').html(content);\n}",
"function TemplateIcon(props) {\n const { icon, ...other } = props;\n if (icon?.kind === IconKind.PREDEFINED) {\n return <StandardIcon name={icon.key} {...other} />;\n } else {\n return <CustomIcon url={icon?.key} {...other} />;\n }\n}",
"function getFontAwesomeIconHtml(iconName){\n var iconHtml = '<i class=\"fa '+iconName+'\"></i>';\n return iconHtml;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A dimmable subcomponent for Dimmer. | function DimmerDimmable(props) {
var blurring = props.blurring,
className = props.className,
children = props.children,
dimmed = props.dimmed;
var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__["a" /* useKeyOnly */])(blurring, 'blurring'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__["a" /* useKeyOnly */])(dimmed, 'dimmed'), 'dimmable', className);
var rest = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__["b" /* getUnhandledProps */])(DimmerDimmable, props);
var ElementType = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__["c" /* getElementType */])(DimmerDimmable, props);
return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
ElementType,
__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),
children
);
} | [
"get isDimmable() {\r\n return true; // we know no lightbulbs that aren't dimmable\r\n }",
"function FluidPanel() {}",
"function dimDot (id, dim)\n{\n\tif (dim) ph[id].dot.attr(\"opacity\", 0.15).attr(\"stroke-width\", dotstroke).toFront();\n\telse ph[id].dot.attr(\"opacity\", 1).attr(\"stroke-width\", dotstroke).toFront();\n}",
"getLOD() {\n return this.LOD;\n }",
"function removeDim() {\r\n\r\n var gO = NewGridObj; // currently configured grid\r\n\r\n gO.numDims--;\r\n if (gO.numDims == 1) gO.multiCol = 0; //MPI: bug fix\r\n gO.dimTitles.pop();\r\n gO.dimComments.pop();\r\n gO.dimIsExtended.pop(); //MPI:\r\n\r\n // Note. Not updating other variables because they are not visible\r\n //\r\n reDrawConfig(); // redraw with updates\r\n}",
"function changeDimIsExtended(dim, state) {\r\n\r\n var gO = NewGridObj;\r\n\r\n if (state)\r\n gO.dimIsExtended[dim] = true;\r\n else\r\n gO.dimIsExtended[dim] = false;\r\n\r\n reDrawConfig();\r\n\r\n}",
"function addDim() {\r\n\r\n var gO = NewGridObj; // currently configured grid\r\n\r\n var newdim = gO.numDims;\r\n gO.numDims++;\r\n if (gO.numDims == 2) gO.multiCol = true; //MPI: bug fix general\r\n gO.dimTitles[newdim] = new Array();\r\n gO.dimComments[newdim] = new Array();\r\n\r\n for (var t = 0; t < DefNumTabsInDim; t++) {\r\n //gO.dimTitles[newdim].push( \"d\" + (newdim+1) + DefDimTitleRoot + t);\r\n if (newdim > 1) //MPI: bug fix\r\n\t gO.dimTitles[newdim].push(getTabName(newdim, t));\r\n\telse //MPI: bug, this can only be newdim = 1\r\n\t gO.dimTitles[newdim].push(DefTitleRoots[ColDimId] + t);\r\n\t \r\n gO.dimComments[newdim].push(null);\r\n }\r\n\r\n gO.dimHasTitles[newdim] = true; // VERIFY -- do we need titles by default\r\n gO.dimHasIndices[newdim] = false; // VERIFY -- do we need indices by default\r\n\r\n gO.dimIsExtended[newdim] = false; //MPI:\r\n\r\n gO.dimShowSize[newdim] = DefNumTabsInDim;\r\n gO.dimActSize[newdim] = DefNumTabsInDim;\r\n gO.dimDynSize[newdim] = null;\r\n gO.dimShowStart[newdim] = 0;\r\n\r\n gO.dimSelectTabs[newdim] = 0; // select first tab by default\r\n\r\n reDrawConfig(); // redraw with updates\r\n}",
"subdivision() {\n this.edges.forEach(edge => {\n if(this.bundled[edge.id]) {\n edge.controlpoints = this.subdivide(edge.cp, this.bundleStrength);\n edge.controlpoints = this.approximateBezier(edge.controlpoints, this.numApproximationPoints)\n }\n });\n }",
"subdivision() {\n this.edges.forEach(edge => {\n if(this.bundled[edge.id]) {\n edge.controlpoints = this.subdivide(edge.cp, this.bundleStrength);\n edge.controlpoints = this.approximateBezier(edge.controlpoints, this.numApproximationPoints)\n }\n });\n }",
"function SubEmitter(/**\n * the particle system to be used by the sub emitter\n */particleSystem){this.particleSystem=particleSystem;/**\n * Type of the submitter (Default: END)\n */this.type=SubEmitterType.END;/**\n * If the particle should inherit the direction from the particle it's attached to. (+Y will face the direction the particle is moving) (Default: false)\n * Note: This only is supported when using an emitter of type Mesh\n */this.inheritDirection=false;/**\n * How much of the attached particles speed should be added to the sub emitted particle (default: 0)\n */this.inheritedVelocityAmount=0;// Create mesh as emitter to support rotation\nif(!particleSystem.emitter||!particleSystem.emitter.dispose){particleSystem.emitter=new BABYLON.AbstractMesh(\"SubemitterSystemEmitter\",particleSystem.getScene());}// Automatically dispose of subemitter when system is disposed\nparticleSystem.onDisposeObservable.add(function(){if(particleSystem.emitter&&particleSystem.emitter.dispose){particleSystem.emitter.dispose();}});}",
"function processDisElement(el) {\r\n\t let ignoreColors = [];\r\n\t if(el.dataset.disIgnoreColors) {\r\n\t ignoreColors = getNumberArraysFromString(el.dataset.disIgnoreColors);\r\n\t }\r\n\t\r\n\t let particleType = \"Particle\";\r\n\t if(el.dataset.disParticleType) {\r\n\t particleType = el.dataset.disParticleType;\r\n\t }\r\n\t\r\n\t let particleColor = [];\r\n\t if(el.dataset.disColor) {\r\n\t particleColor = getNumberArraysFromString(el.dataset.disColor)[0];\r\n\t }\r\n\t\r\n\t let particleReductionFactor = 35;\r\n\t if(el.dataset.disReductionFactor) {\r\n\t particleReductionFactor = parseInt(el.dataset.disReductionFactor);\r\n\t }\r\n\t\r\n\t let disObj = {\r\n\t elem: el,\r\n\t type: el.dataset.disType,\r\n\t container: undefined,\r\n\t actualWidth: el.offsetWidth,\r\n\t actualHeight: el.offsetHeight,\r\n\t lastWidth: el.offsetWidth,\r\n\t lastHeight: el.offsetHeight,\r\n\t count: 0,\r\n\t particleArr: [],\r\n\t animationDuration: 100, // in ms \r\n\t canvas: undefined,\r\n\t ctx: undefined,\r\n\t scrnCanvas: undefined,\r\n\t scrnCtx: undefined,\r\n\t ignoreColors: ignoreColors,\r\n\t isOutOfBounds: false,\r\n\t isAnimating: false,\r\n\t particleReductionFactor: particleReductionFactor,\r\n\t particleType: particleType,\r\n\t particleColor: particleColor\r\n\t };\r\n\t\r\n\t let container;\r\n\t if(disObj.type === \"self-contained\") {\r\n\t let parent = el.parentNode;\r\n\t let wrapper = document.createElement('div');\r\n\t wrapper.dataset.disContainer = \"\";\r\n\t wrapper.style.width = disObj.lastWidth;\r\n\t wrapper.style.height = disObj.lastHeight;\r\n\t wrapper.style.overflow = \"hidden\";\r\n\t let elemStyles = window.getComputedStyle(el);\r\n\t wrapper.style.position = elemStyles.getPropertyValue(\"position\");\r\n\t wrapper.style.margin = elemStyles.getPropertyValue(\"margin\");\r\n\t wrapper.style.top = elemStyles.getPropertyValue(\"top\");\r\n\t wrapper.style.left = elemStyles.getPropertyValue(\"left\");\r\n\t wrapper.style.display = elemStyles.getPropertyValue(\"display\");\r\n\t el.style.margin = 0;\r\n\t el.style.top = 0;\r\n\t el.style.left = 0;\r\n\t\r\n\t disObj.container = wrapper;\r\n\t\r\n\t parent.replaceChild(wrapper, el);\r\n\t wrapper.appendChild(el);\r\n\t\r\n\t disObj.container = wrapper;\r\n\t } else if(disObj.type === \"contained\") {\r\n\t // Try to use the given container if a container Id is provided\r\n\t if(el.dataset.disContainerId && document.querySelector(\"[data-dis-id = '\" + el.dataset.disContainerId + \"']\")) {\r\n\t disObj.container = document.querySelector(\"data-dis-container-id = \" + el.dataset.disContainerId);\r\n\t } else {\r\n\t // Default to using the nearest Disintegrate container or the parent node\r\n\t disObj.container = findParentWithAttr(el, \"data-dis-container\");\r\n\t }\r\n\t }\r\n\t \r\n\t // Add this Disintegrate element to our list\r\n\t dises.push(disObj);\r\n\t // Create the canvases for this Disintegrate element\r\n\t getScreenshot(disObj);\r\n\t // See if all Dises have been loaded\r\n\t checkAllLoaded();\r\n\t}",
"function calcSlicedPart() {\n return slicedPart = innerBoxWidth % containerWidth;\n }",
"function ShadowDepthWrapper(baseMaterial, scene, options) {\n var _this = this;\n this._baseMaterial = baseMaterial;\n this._scene = scene;\n this._options = options;\n this._subMeshToEffect = new Map();\n this._subMeshToDepthEffect = new MapMap();\n this._meshes = new Map();\n var prefix = baseMaterial.getClassName() === \"NodeMaterial\" ? \"u_\" : \"\";\n if (prefix) {\n this._matriceNames = {\n \"world\": prefix + \"World\",\n \"view\": prefix + \"View\",\n \"projection\": prefix + \"Projection\",\n \"viewProjection\": prefix + \"ViewProjection\",\n \"worldView\": prefix + \"WorldxView\",\n \"worldViewProjection\": prefix + \"WorldxViewxProjection\",\n };\n var nodeMat = baseMaterial;\n var inputBlocks = nodeMat.getInputBlocks();\n for (var i = 0; i < inputBlocks.length; ++i) {\n switch (inputBlocks[i]._systemValue) {\n case NodeMaterialSystemValues.World:\n this._matriceNames[\"world\"] = inputBlocks[i].associatedVariableName;\n break;\n case NodeMaterialSystemValues.View:\n this._matriceNames[\"view\"] = inputBlocks[i].associatedVariableName;\n break;\n case NodeMaterialSystemValues.Projection:\n this._matriceNames[\"projection\"] = inputBlocks[i].associatedVariableName;\n break;\n case NodeMaterialSystemValues.ViewProjection:\n this._matriceNames[\"viewProjection\"] = inputBlocks[i].associatedVariableName;\n break;\n case NodeMaterialSystemValues.WorldView:\n this._matriceNames[\"worldView\"] = inputBlocks[i].associatedVariableName;\n break;\n case NodeMaterialSystemValues.WorldViewProjection:\n this._matriceNames[\"worldViewProjection\"] = inputBlocks[i].associatedVariableName;\n break;\n }\n }\n }\n else {\n this._matriceNames = {\n \"world\": prefix + \"world\",\n \"view\": prefix + \"view\",\n \"projection\": prefix + \"projection\",\n \"viewProjection\": prefix + \"viewProjection\",\n \"worldView\": prefix + \"worldView\",\n \"worldViewProjection\": prefix + \"worldViewProjection\",\n };\n }\n // Register for onEffectCreated to store the effect of the base material when it is (re)generated. This effect will be used\n // to create the depth effect later on\n this._onEffectCreatedObserver = this._baseMaterial.onEffectCreatedObservable.add(function (params) {\n var _a;\n var mesh = (_a = params.subMesh) === null || _a === void 0 ? void 0 : _a.getMesh();\n if (mesh && !_this._meshes.has(mesh)) {\n // Register for mesh onDispose to clean up our internal maps when a mesh is disposed\n _this._meshes.set(mesh, mesh.onDisposeObservable.add(function (mesh) {\n var iterator = _this._subMeshToEffect.keys();\n for (var key = iterator.next(); key.done !== true; key = iterator.next()) {\n var subMesh = key.value;\n if ((subMesh === null || subMesh === void 0 ? void 0 : subMesh.getMesh()) === mesh) {\n _this._subMeshToEffect.delete(subMesh);\n _this._subMeshToDepthEffect.mm.delete(subMesh);\n }\n }\n }));\n }\n _this._subMeshToEffect.set(params.subMesh, params.effect);\n _this._subMeshToDepthEffect.mm.delete(params.subMesh); // trigger a depth effect recreation\n });\n }",
"function DOMDisplay(parent, level) {\n\tthis.wrap = parent.appendChild(elMaker(\"div\", \"game\"));\n\tthis.level = level;\n\n\tthis.wrap.appendChild(this.drawBackground());\n\tthis.activeLayer = null;\n\tthis.drawFrame();\n}",
"get scale() {\n\t\treturn {\n\t\t\tx: this.dimens.x/this.width,\n\t\t\ty: this.dimens.y/this.height,\n\t\t};\n\t}",
"function DiscreteFaceter(aAttrDef, aFacetDef) {\n this.attrDef = aAttrDef;\n this.facetDef = aFacetDef;\n}",
"function DiscGeometry(id,scene,/**\n * Defines the radius of the disc\n */radius,/**\n * Defines the tesselation factor to apply to the disc\n */tessellation,canBeRegenerated,mesh,/**\n * Defines if the created geometry is double sided or not (default is BABYLON.Mesh.DEFAULTSIDE)\n */side){if(mesh===void 0){mesh=null;}if(side===void 0){side=BABYLON.Mesh.DEFAULTSIDE;}var _this=_super.call(this,id,scene,canBeRegenerated,mesh)||this;_this.radius=radius;_this.tessellation=tessellation;_this.side=side;return _this;}",
"fitViewToDimension(w, h, d) {\n\n if (w/h >= 1.0) {\n\n this.setViewport( w/h * d, d);\n }\n else {\n\n this.setViewport( d, h/w * d);\n }\n }",
"function updateDimensions() {\n styleContentElements();\n parentDimensions = getParentDimensions();\n playerDimensions = getPlayerDimensions();\n }",
"buildSimpleDisplayPanel(title, single, double, immune) {\n single = single || []\n double = double || []\n immune = immune || []\n\n let panel = document.createElement(\"div\");\n panel.classList.add(\"panel\");\n\n let label = document.createElement(\"h3\");\n label.classList.add(\"label\");\n label.innerText = title;\n panel.appendChild(label);\n\n immune.forEach((t) => { panel.appendChild(this.buildType(t, false, \"immune\", \"small\")) });\n double.forEach((t) => { panel.appendChild(this.buildType(t, false, \"double\", \"small\")) });\n single.forEach((t) => { panel.appendChild(this.buildType(t, false, \"small\")) });\n\n return panel;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
New function for deleting any info from a date. So simple it's embarrasing the way it was done before. | function deleteDateInfoAll(timestamp)
{
deleteDateInfo(timestamp, true, true, true, true);
} | [
"deleteAppointment(date,time)\n {\n if (this.map.has(date)) {\n\n for (let i=0; i<this.map.get(date).length; i++)\n {\n if (this.map.get(date)[i].date == date && this.map.get(date)[i].time == time) {\n this.map.get(date).splice(i,1);\n break;\n }\n }\n }\n }",
"function clearDates(){\n beginDate = \"\";\n endDate = \"\";\n days = [];\n\n}",
"function clearOlderEntries(browsingData, dateKey) {\n for (var key in browsingData) {\n if (key !== dateKey) {\n delete browsingData[key];\n }\n }\n}",
"function clearDatesSection() {\r\n const dateContainer = document.querySelector(\".dates-container\");\r\n dateContainer.innerHTML=\"\";\r\n return;\r\n}",
"function deleteVacationDay(theElement){\n\tconsole.log(\"Deleting this vacationDay: \");\n\tconsole.log(theElement.parentNode);\n\t\n\t$(\"#saveStatusMessage\")[0].innerHTML = \"Saving...\";\n\t$(\"#saveStatusMessage\").show();\n\t\n\t//Handle the removal of the vacation day from the User object\n\tvar theVacationDay = theElement.id;\n\tU.profiles[Profile].vacationDays.splice(theVacationDay,1);\n\tupdateUserData(1);\n\t\n\t//Handle the removal of the element from the DOM\n\tvar e = theElement.parentNode;\n\te.remove();\n}",
"async function deleteVaccination(email, name, vacc, date) {\n let sql = `\n DELETE FROM taken\n WHERE userEmail = ? AND userName = ?\n AND vaccName = ? AND dateTaken = ?`;\n\n date = new Date(date).toISOString().slice(0, 19).replace('T', ' ');\n await db.query(sql, [email, name, vacc, date]);\n}",
"function jnParseDeleteDayObj(dayObj) \n{\n\tif (typeof dayObj._activities === undefined) {\n\t\tif (dayObj._activities.length > 0) {\n\t\t\tfor (jnActivityObj in dayObj._activities) {\n\t\t\t\tjnParseDeleteActivityObj(jnActivityObj);\n\t\t\t}\n\t\t\tclearArray(dayObj._activities);\n\t\t}\n\t}\n\t\n\tdelete dayObj;\n}",
"_clearDate() {\n this.value = undefined;\n this.display = '';\n }",
"deleteDay(url, day_id) {\n return axios.delete(`${url}trip/day/${day_id}`).then(res => {\n return res.data;\n });\n }",
"function jnParseDeleteItineraryObj(itObj) \n{\n\tif (typeof itObj._days === undefined) {\n\t\tif (itObj._days.length > 0) {\n\t\t\tfor (jnDayObj in itObj._days) {\n\t\t\t\tjnParseDeleteDayObj(jnDayObj);\n\t\t\t}\n\t\t\tclearArray(itObj._days);\n\t\t}\n\t}\n\t\n\tdelete itObj;\n}",
"function hideDates() {\n\t\t\t\tlet dates = $('.dates');\n\t\t\t\tdates.fadeOut('slow', ()=>{dates.remove();});\n\t\t\t\titems.unbind('click', hideDates);\n\t\t\t}",
"function removeVisitedThreeDaysOld() {\n const currentTime = new Date().getTime();\n const refUserVisited = database.ref('users/' + firebase.currentUser.uid + \"/visited\");\n refUserVisited\n .orderByChild(\"dateVisited\").endAt(currentTime - 259200000).once(\"value\", function (snap) {\n snap.forEach(function (child) {\n refUserVisited.child(child.key).remove();\n })\n })\n }",
"function deleteTimeDetails() {\n let timeDetails = myStorage.timeDetails;\n timeDetails = null;\n myStorage.timeDetails = timeDetails;\n myStorage.sync();\n}",
"function deleteFormat(format)\r\n{\r\n}",
"function handleDelete(event) {\n\tlet id = event.target.id;\n\n\tlet output = [];\n\n\toutput = db_appointments.filter(function (value) {\n\t\treturn value.idPengunjung !== id;\n\t});\n\n\tdb_appointments = output;\n\n\tevent.target.parentElement.remove();\n}",
"removeSelectedLead(req, res) {\n\n var pastDateTime = datetime.create(new Date());\n\n\n var deletedDate = pastDateTime.now();\n con.query(\"update `object_query_22` set ActiveStatus=?,o_deletionDate=? where oo_id IN (\" + req.query.id + \")\",[0,deletedDate],function(err, result)\n {\n if(err)\n throw err;\n else{\n\n con.query(\"update `object_query_31` set ActiveStatus=? where RelatedToId IN (\" + req.query.id + \") AND RelatedToObject=?\", [0,'Lead'], function(err, result) {\n if (err)\n throw err;\n else {\n\n return res.status(200).json({leads:result})\n }\n })\n\n\n }\n })\n }",
"function removeReturnDate() {\n\tvar selectedElements = document.querySelectorAll(\".removeReturnDate\");\n\tselectedElements.forEach(element => {\n\t\telement.style.display = \"none\" // Conditional to hide all elements with #returnDate in form.\n\t});\n}",
"function getDebeDate() {\n let date = new Date();\n \n if(date.getUTCHours() < 4) {\n date.setDate(date.getDate() - 1);\n }\n return date.toJSON().split(\"T\")[0]\n}",
"function toggleDate(timestamp, noCount)\n{\n\ttry {\n\n\t\tif(noCount)\n\t\t{\n\t\t\tvar noCountDateArray = getSubDates();\n\t\t\n\t\t\t//Secondary dates. Store many hooray\n\t\t\tvar sidx = noCountDateArray.indexOf(timestamp);\n\t\t\n\t\t\tif(sidx != -1)\n\t\t\t{\n\t\t\t\tnoCountDateArray.splice(sidx, 1); //Remove if found\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//...add if not found.\n\t\t\t\tnoCountDateArray.push(timestamp);\n\t\t\t}\n\t\t\t\n\t\t\tnoCountDateArray.sort();\n\t\t\t\n //trackEvent(\"Interaction\", \"Sub date changed\", timestamp);\n\t\t\t\n\t\t\t//This is the new solution!\n\t\t\tdates.subDateArray = noCountDateArray;\n\t\t\tpersistDatesToStorage(dates);\n\t\t\t\t\t\t\n\t\t\tlog(\"Sub date array changed\", noCountDateArray);\n\t\t\t\t\n\t\t\t\n\t\t}\n\t\telse //The main one. Store just that.\n\t\t{\n\t\t\tvar dateArray = getDates();\n\t\t\t\n\t\t\tvar idx = dateArray.indexOf(timestamp);\n\t\t\t\n\t\t\tif(idx != -1)\n\t\t\t{\n\t\t\t\tdateArray = []; // Clear out\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tdateArray = [timestamp]; //Set\n\t\t\t}\n\t\t\t\n\t\t\t//This is the new solution!\n\t\t\tdates.mainDateArray = dateArray;\n\t\t\tpersistDatesToStorage(dates);\n\t\t\t\n\t\t\t\n\t\t\tlog(\"Date array changed\", dateArray); //Log it\t\n\t\t}\n\t\t\t\n\t}\n\tcatch(e)\n\t{\n\t\thandleError(\"Functions toggleDate\", e);\n\t}\n\t\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Passes all uniform values to shader program. | uploadUniforms() {
const gl = EngineToolbox.getGLContext();
if (!this.shaderProgram) {
return;
}
// pass uniforms to shader only if defined
gl.useProgram(this.shaderProgram);
this.uniforms.modelViewMatrix.value &&
uniformMatrix4fv(this.uniforms.modelViewMatrix);
this.uniforms.projectionMatrix.value &&
uniformMatrix4fv(this.uniforms.projectionMatrix);
this.uniforms.normalMatrix.value &&
uniformMatrix4fv(this.uniforms.normalMatrix);
this.uniforms.directLightDirection.value &&
uniform3fv(this.uniforms.directLightDirection);
this.uniforms.directLightColor.value &&
uniform3fv(this.uniforms.directLightColor);
this.uniforms.directLightValue.value &&
uniform1fv(this.uniforms.directLightValue);
this.uniforms.ambientLightColor.value &&
uniform3fv(this.uniforms.ambientLightColor);
this.uniforms.ambientLightValue.value &&
uniform1fv(this.uniforms.ambientLightValue);
this.uniforms.useVertexColor.value &&
uniform1iv(this.uniforms.useVertexColor);
this.uniforms.color0Sampler.value &&
uniform1iv(this.uniforms.color0Sampler);
this.uniforms.color1Sampler.value &&
uniform1iv(this.uniforms.color1Sampler);
this.uniforms.normal0Sampler.value &&
uniform1iv(this.uniforms.normal0Sampler);
this.uniforms.useColor0.value && uniform1iv(this.uniforms.useColor0);
this.uniforms.useColor1.value && uniform1iv(this.uniforms.useColor1);
this.uniforms.useNormal0.value && uniform1iv(this.uniforms.useNormal0);
this.uniforms.useEmission.value && uniform1iv(this.uniforms.useEmission);
this.uniforms.mapOffsetX.value && uniform1fv(this.uniforms.mapOffsetX);
this.uniforms.mapOffsetY.value && uniform1fv(this.uniforms.mapOffsetY);
this.uniforms.mapTilingX.value && uniform1fv(this.uniforms.mapTilingX);
this.uniforms.mapTilingY.value && uniform1fv(this.uniforms.mapTilingY);
} | [
"function parseUniforms(gl, uniformsJSON) {\n checkParameter(\"parseUniforms\", gl, \"gl\");\n checkParameter(\"parseUniforms\", uniformsJSON, \"uniformsJSON\");\n var shaderProgram = gl.getParameter(gl.CURRENT_PROGRAM);\n if (shaderProgram === null) {\n throw \"Applying vertex attributes with no shader program\";\n }\n\n for (uniform in uniformsJSON) {\n var location = gl.getUniformLocation(shaderProgram, uniform);\n if (location == null) {\n continue;\n }\n var uniformInfo = uniformsJSON[uniform];\n var func = uniformInfo[\"func\"];\n checkParameter(\"parseUniforms\", func, \"uniformsJSON[\" + uniform + \"][func]\");\n var args = uniformInfo[\"args\"];\n checkParameter(\"parseUniforms\", args, \"uniformsJSON[\" + uniform + \"][args]\");\n // Find function name and reflect.\n if (func === \"glUniform1f\") {\n gl.uniform1f(location, args[0]);\n } else if (func === \"glUniform2f\") {\n gl.uniform2f(location, args[0], args[1]);\n } else if (func === \"glUniform3f\") {\n gl.uniform3f(location, args[0], args[1], args[2]);\n } else if (func === \"glUniform4f\") {\n gl.uniform4f(location, args[0], args[1], args[2], args[3]);\n } else if (func === \"glUniform1fv\") {\n gl.uniform1fv(locationloc, args);\n } else if (func === \"glUniform2fv\") {\n gl.uniform2fv(location, args);\n } else if (func === \"glUniform3fv\") {\n gl.uniform3fv(location, args);\n } else if (func === \"glUniform4fv\") {\n gl.uniform4fv(location, args);\n } else if (func === \"glUniform1i\") {\n gl.uniform1i(location, args[0]);\n } else if (func === \"glUniform2i\") {\n gl.uniform2i(location, args[0], args[1]);\n } else if (func === \"glUniform3i\") {\n gl.uniform3i(location, args[0], args[1], args[2]);\n } else if (func === \"glUniform4i\") {\n gl.uniform4i(location, args[0], args[1], args[2], args[3]);\n } else if (func === \"glUniform1iv\") {\n gl.uniform1iv(location, args);\n } else if (func === \"glUniformMatrix4fv\") {\n gl.uniformMatrix4fv(location, false, args);\n } else {\n console.log(\"Do not know how to set uniform via function \" + func + \" and args \" + args);\n }\n }\n}",
"function setUpAttributesAndUniforms() {\n // finds the index of the variables in the program\n ctx.aVertexPositionId = gl.getAttribLocation(ctx.shaderProgram, \"aVertexPosition\");\n ctx.aVertexColorId = gl.getAttribLocation(ctx.shaderProgram, \"aVertexColor\");\n ctx.aVertexNormalId = gl.getAttribLocation(ctx.shaderProgram, \"aVertexNormal\");\n\n ctx.uModelMatId = gl.getUniformLocation(ctx.shaderProgram, \"uModelMat\");\n ctx.uNormalMatrixId = gl.getUniformLocation(ctx.shaderProgram, \"uNormalMatrix\");\n ctx.uProjectionMatId = gl.getUniformLocation(ctx.shaderProgram, \"uProjectionMat\");\n\n ctx.uEnableLightingId = gl.getUniformLocation(ctx.shaderProgram, \"uEnableLighting\");\n ctx.uLightPositionId = gl.getUniformLocation(ctx.shaderProgram, \"uLightPosition\");\n ctx.uLightColorId = gl.getUniformLocation(ctx.shaderProgram, \"uLightColor\");\n}",
"_readUniformLocationsFromLinkedProgram() {\n const {gl} = this;\n this._uniformSetters = {};\n this._uniformCount = this._getParameter(GL.ACTIVE_UNIFORMS);\n for (let i = 0; i < this._uniformCount; i++) {\n const info = this.gl.getActiveUniform(this.handle, i);\n const {name, isArray} = parseUniformName(info.name);\n const location = gl.getUniformLocation(this.handle, name);\n this._uniformSetters[name] = getUniformSetter(gl, location, info, isArray);\n }\n this._textureIndexCounter = 0;\n }",
"function UniformBuffer(engine, data, dynamic) {\n this._engine = engine;\n this._noUBO = engine.webGLVersion === 1;\n this._dynamic = dynamic;\n this._data = data || [];\n this._uniformLocations = {};\n this._uniformSizes = {};\n this._uniformLocationPointer = 0;\n this._needSync = false;\n if (this._noUBO) {\n this.updateMatrix3x3 = this._updateMatrix3x3ForEffect;\n this.updateMatrix2x2 = this._updateMatrix2x2ForEffect;\n this.updateFloat = this._updateFloatForEffect;\n this.updateFloat2 = this._updateFloat2ForEffect;\n this.updateFloat3 = this._updateFloat3ForEffect;\n this.updateFloat4 = this._updateFloat4ForEffect;\n this.updateMatrix = this._updateMatrixForEffect;\n this.updateVector3 = this._updateVector3ForEffect;\n this.updateVector4 = this._updateVector4ForEffect;\n this.updateColor3 = this._updateColor3ForEffect;\n this.updateColor4 = this._updateColor4ForEffect;\n }\n else {\n this.updateMatrix3x3 = this._updateMatrix3x3ForUniform;\n this.updateMatrix2x2 = this._updateMatrix2x2ForUniform;\n this.updateFloat = this._updateFloatForUniform;\n this.updateFloat2 = this._updateFloat2ForUniform;\n this.updateFloat3 = this._updateFloat3ForUniform;\n this.updateFloat4 = this._updateFloat4ForUniform;\n this.updateMatrix = this._updateMatrixForUniform;\n this.updateVector3 = this._updateVector3ForUniform;\n this.updateVector4 = this._updateVector4ForUniform;\n this.updateColor3 = this._updateColor3ForUniform;\n this.updateColor4 = this._updateColor4ForUniform;\n }\n }",
"function Shader(glContext, vertexPath, fragmentPath)\n{\n this.uniforms = new Array();\n this.uniforms.count = 0;\n \n \n this.worldViewProjectionHandle = -1;\n this.worldMatrixHandle = -1;\n this.projectionMatrixHandle = -1;\n this.textureHandle = -1;\n \n //attribute handles \n this.positionHandle = -1;\n this.normalHandle = -1;\n this.colorHandle = -1;\n this.uvCoordinateHandle = -1;\n \n this.vertexShaderSource = \"\";\n this.vertexShaderLength = 0;\n this.vertexShaderHandle = -1;\n \n this.fragmentShaderSource = \"\";\n this.fragmentShaderLength = 0;\n this.fragmentShaderHandle = -1;\n \n this.programHandle = -1;\n \n this.loadShader(glContext, vertexPath, fragmentPath);\n \n \n //get attribute handles\n this.colorHandle = gl.getAttribLocation( this.programHandle, \"a_Color\" );\t\n this.positionHandle = gl.getAttribLocation( this.programHandle, \"a_Position\" );\t\n this.uvCoordinateHandle = gl.getAttribLocation( this.programHandle, \"a_UVCoordinates\" );\n this.normalHandle = gl.getAttribLocation(this.programHandle, \"a_Normal\");\n \n //get uniform handles\n this.worldViewProjectionHandle = gl.getUniformLocation(this.programHandle, \"u_WorldViewProjection\");\n this.worldMatrixHandle = gl.getUniformLocation(this.programHandle, \"u_WorldMatrix\");\n this.projectionMatrixHandle = gl.getUniformLocation(this.programHandle, \"u_ProjectionMatrix\");\n this.textureHandle = gl.getUniformLocation(this.programHandle, \"u_Texture\");\n}",
"uploadNormalMatrixToShader() {\r\n mat3.fromMat4(this.nMatrix,this.mvMatrix);\r\n mat3.transpose(this.nMatrix,this.nMatrix);\r\n mat3.invert(this.nMatrix,this.nMatrix);\r\n gl.uniformMatrix3fv(shaderProgram.nMatrixUniform, false, this.nMatrix);\r\n }",
"function uploadNormalMatrixToShader(){\n mat3.fromMat4(nMatrix,mvMatrix);\n mat3.transpose(nMatrix,nMatrix);\n mat3.invert(nMatrix,nMatrix);\n gl.uniformMatrix3fv(shaderProgram.nMatrixUniform, false, nMatrix);\n}",
"bind(){ gl.ctx.useProgram( this.shader.program ); return this; }",
"render(program, renderParameters, textures){\n //renders the media source to the WebGL context using the pased program\n let overriddenElement;\n for (let i = 0; i < this.mediaSourceListeners.length; i++) {\n if (typeof this.mediaSourceListeners[i].render === 'function'){\n let result = this.mediaSourceListeners[i].render(this, renderParameters);\n if (result !== undefined) overriddenElement = result;\n }\n }\n\n this.gl.useProgram(program);\n let renderParametersKeys = Object.keys(renderParameters);\n let textureOffset = 1;\n for (let index in renderParametersKeys){\n let key = renderParametersKeys[index];\n let parameterLoctation = this.gl.getUniformLocation(program, key);\n if (parameterLoctation !== -1){\n if (typeof renderParameters[key] === \"number\"){\n this.gl.uniform1f(parameterLoctation, renderParameters[key]);\n }\n else if( Object.prototype.toString.call(renderParameters[key]) === '[object Array]'){\n let array = renderParameters[key];\n if(array.length === 1){\n this.gl.uniform1fv(parameterLoctation, array);\n } else if(array.length === 2){\n this.gl.uniform2fv(parameterLoctation, array);\n } else if(array.length === 3){\n this.gl.uniform3fv(parameterLoctation, array);\n } else if(array.length === 4){\n this.gl.uniform4fv(parameterLoctation, array);\n } else{\n console.debug(\"Shader parameter\", key, \"is too long and array:\", array);\n }\n }\n else{\n //Is a texture\n this.gl.activeTexture(this.gl.TEXTURE0 + textureOffset);\n this.gl.uniform1i(parameterLoctation, textureOffset);\n this.gl.bindTexture(this.gl.TEXTURE_2D, textures[textureOffset-1]);\n }\n }\n }\n \n this.gl.activeTexture(this.gl.TEXTURE0);\n let textureLocation = this.gl.getUniformLocation(program, \"u_image\");\n this.gl.uniform1i(textureLocation, 0);\n this.gl.bindTexture(this.gl.TEXTURE_2D, this.texture);\n if (overriddenElement !== undefined){\n this.gl.texImage2D(this.gl.TEXTURE_2D, 0, this.gl.RGBA, this.gl.RGBA, this.gl.UNSIGNED_BYTE, overriddenElement);\n } else {\n this.gl.texImage2D(this.gl.TEXTURE_2D, 0, this.gl.RGBA, this.gl.RGBA, this.gl.UNSIGNED_BYTE, this.element);\n }\n this.gl.drawArrays(this.gl.TRIANGLES, 0, 6);\n }",
"function genShaderPrograms(){\r\n\r\n\tif(!(gl.program1 = util_InitShaders(gl, VSHADER_SOURCE1, FSHADER_SOURCE1))) {\r\n\t\tconsole.log(\"Error building program 1\");\r\n\t\treturn false;\r\n\t}\r\n\r\n\tif(!(gl.program2 = util_InitShaders(gl, VSHADER_SOURCE2, FSHADER_SOURCE2))) {\r\n\t\tconsole.log(\"Error building program 2\");\r\n\t\treturn false;\r\n\t}\r\n\r\n\tif(!(gl.program3 = util_InitShaders(gl, VSHADER_SOURCE3, FSHADER_SOURCE3))) {\r\n\t\tconsole.log(\"Error building program 3\");\r\n\t\treturn false;\r\n\t}\r\n\r\n\treturn true;\r\n}",
"function enableShaderAttrib(prog, name)\n{\n\tvar attribLoc = gl.getAttribLocation(prog, name);\n\tgl.enableVertexAttribArray(attribLoc);\n\treturn attribLoc;\n}",
"function updateForTextures(_ref) {\n var vs = _ref.vs,\n sourceTextureMap = _ref.sourceTextureMap,\n targetTextureVarying = _ref.targetTextureVarying,\n targetTexture = _ref.targetTexture;\n var texAttributeNames = Object.keys(sourceTextureMap);\n var sourceCount = texAttributeNames.length;\n var targetTextureType = null;\n var samplerTextureMap = {};\n var updatedVs = vs;\n var finalInject = {};\n\n if (sourceCount > 0 || targetTextureVarying) {\n var vsLines = updatedVs.split('\\n');\n var updateVsLines = vsLines.slice();\n vsLines.forEach(function (line, index, lines) {\n // TODO add early exit\n if (sourceCount > 0) {\n var updated = processAttributeDefinition(line, sourceTextureMap);\n\n if (updated) {\n var updatedLine = updated.updatedLine,\n inject = updated.inject;\n updateVsLines[index] = updatedLine; // sampleInstructions.push(sampleInstruction);\n\n finalInject = (0, _src.combineInjects)([finalInject, inject]);\n Object.assign(samplerTextureMap, updated.samplerTextureMap);\n sourceCount--;\n }\n }\n\n if (targetTextureVarying && !targetTextureType) {\n targetTextureType = getVaryingType(line, targetTextureVarying);\n }\n });\n\n if (targetTextureVarying) {\n (0, _assert.default)(targetTexture);\n var sizeName = \"\".concat(SIZE_UNIFORM_PREFIX).concat(targetTextureVarying);\n var uniformDeclaration = \"uniform vec2 \".concat(sizeName, \";\\n\");\n var posInstructions = \" vec2 \".concat(VS_POS_VARIABLE, \" = transform_getPos(\").concat(sizeName, \");\\n gl_Position = vec4(\").concat(VS_POS_VARIABLE, \", 0, 1.);\\n\");\n var inject = {\n 'vs:#decl': uniformDeclaration,\n 'vs:#main-start': posInstructions\n };\n finalInject = (0, _src.combineInjects)([finalInject, inject]);\n }\n\n updatedVs = updateVsLines.join('\\n');\n }\n\n return {\n // updated vertex shader (commented texture attribute definition)\n vs: updatedVs,\n // type (float, vec2, vec3 of vec4) target texture varying\n targetTextureType: targetTextureType,\n // required vertex and fragment shader injects\n inject: finalInject,\n // map of sampler name to texture name, can be used to set attributes\n // usefull when swapping textures, as source and destination texture change when swap is called.\n samplerTextureMap: samplerTextureMap\n };\n} // builds and returns an object contaning size uniform for each texture",
"function initShaders( vertexShaderId, fragmentShaderId )\n{\n var vertShdr;\n\tvar fragShdr;\n\t\n\n\n\t// --- Compiling vertex shader\n var vertElem = document.getElementById( vertexShaderId );\n if ( !vertElem ) { \n alert( \"Unable to load vertex shader \" + vertexShaderId );\n return -1;\n }\n else {\n vertShdr = gl.createShader( gl.VERTEX_SHADER );\n gl.shaderSource( vertShdr, vertElem.text );\n gl.compileShader( vertShdr );\n if ( !gl.getShaderParameter(vertShdr, gl.COMPILE_STATUS) ) {\n var msg = \"Vertex shader failed to compile. The error log is:\"\n \t+ \"<pre>\" + gl.getShaderInfoLog( vertShdr ) + \"</pre>\";\n alert( msg );\n return -1;\n }\n }\n\n\n\n\t// --- Compiling fragment shader\n var fragElem = document.getElementById( fragmentShaderId );\n if ( !fragElem ) { \n alert( \"Unable to load vertex shader \" + fragmentShaderId );\n return -1;\n }\n else {\n fragShdr = gl.createShader( gl.FRAGMENT_SHADER );\n gl.shaderSource( fragShdr, fragElem.text );\n gl.compileShader( fragShdr );\n if ( !gl.getShaderParameter(fragShdr, gl.COMPILE_STATUS) ) {\n var msg = \"Fragment shader failed to compile. The error log is:\"\n \t+ \"<pre>\" + gl.getShaderInfoLog( fragShdr ) + \"</pre>\";\n alert( msg );\n return -1;\n }\n }\n\n\n\n\t// --- Creating program\n var program = gl.createProgram();\n gl.attachShader( program, vertShdr );\n gl.attachShader( program, fragShdr );\n gl.linkProgram( program );\n \n if ( !gl.getProgramParameter(program, gl.LINK_STATUS) ) {\n var msg = \"Shader program failed to link. The error log is:\"\n + \"<pre>\" + gl.getProgramInfoLog( program ) + \"</pre>\";\n alert( msg );\n return -1;\n }\n\n return program;\n}",
"applyColor(_materialComponent) {\n let colorPerPosition = [];\n for (let i = 0; i < this.vertexCount; i++) {\n colorPerPosition.push(_materialComponent.Material.Color.X, _materialComponent.Material.Color.Y, _materialComponent.Material.Color.Z);\n }\n WebEngine.gl2.bufferData(WebEngine.gl2.ARRAY_BUFFER, new Uint8Array(colorPerPosition), WebEngine.gl2.STATIC_DRAW);\n }",
"function parseVertex(gl, vertexJSON) {\n checkParameter(\"parseVertex\", gl, \"gl\");\n checkParameter(\"parseVertex\", vertexJSON, \"vertexJSON\");\n var shaderProgram = gl.getParameter(gl.CURRENT_PROGRAM);\n if (shaderProgram === null) {\n throw \"Applying vertex attributes with no shader program\";\n }\n var maxAttribute = 0;\n\n for (attribute in vertexJSON) {\n var attributeIndex = maxAttribute++;\n gl.bindAttribLocation(shaderProgram, attributeIndex, attribute);\n var attributeInfo = vertexJSON[attribute];\n var enabled = attributeInfo[\"enabled\"];\n checkParameter(\"parseVertex\", enabled, \"vertexJSON[\" + attribute + \"][enabled]\");\n if (enabled == \"false\") {\n // For disabled, it is the same as uniforms.\n var func = attributeInfo[\"func\"];\n checkParameter(\"parseVertex\", func, \"vertexJSON[\" + attribute + \"][func]\");\n var args = attributeInfo[\"args\"];\n checkParameter(\"parseVertex\", args, \"vertexJSON[\" + attribute + \"][args]\");\n // Find function name and reflect.\n if (func === \"glVertexAttrib1f\") {\n gl.vertexAttrib1f(attributeIndex, args[0]);\n } else if (func === \"glVertexAttrib2f\") {\n gl.vertexAttrib2f(attributeIndex, args[0], args[1]);\n } else if (func === \"glVertexAttrib3f\") {\n gl.vertexAttrib3f(attributeIndex, args[0], args[1], args[2]);\n } else if (func === \"glVertexAttrib4f\") {\n gl.vertexAttrib4f(attributeIndex, args[0], args[1], args[2], args[3]);\n } else if (func === \"glVertexAttrib1fv\") {\n gl.vertexAttrib1fv(attributeIndex, args);\n } else if (func === \"glVertexAttrib2fv\") {\n gl.vertexAttrib2fv(attributeIndex, args);\n } else if (func === \"glVertexAttrib3fv\") {\n gl.vertexAttrib3fv(attributeIndex, args);\n } else if (func === \"glVertexAttrib4fv\") {\n gl.vertexAttrib4fv(attributeIndex, args);\n } else {\n console.log(\"Do not know how to set attribute via function \" + func + \" and args \" + args);\n }\n } else {\n // Otherwise the input comes form the bound buffer.\n var size = attributeInfo[\"size\"];\n checkParameter(\"parseVertex\", size, \"vertexJSON[\" + attribute + \"][size]\");\n var stride = attributeInfo[\"stride\"];\n checkParameter(\"parseVertex\", stride, \"vertexJSON[\" + attribute + \"][stride]\");\n var offset = attributeInfo[\"offset\"];\n checkParameter(\"parseVertex\", offset, \"vertexJSON[\" + attribute + \"][offset]\");\n gl.vertexAttribPointer(attributeIndex, size, gl.FLOAT, false, stride, offset);\n gl.enableVertexAttribArray(attributeIndex);\n }\n }\n}",
"function _compileShaders()\n\t{\n\t\tvar vertexShader = _loadShaderFromDOM( _vertexShaderId );\t\t// Get shaders and compile them.\n\t\tvar fragmentShader = _loadShaderFromDOM( _fragmentShaderId );\n\n\t\t_renderingProgram = gl.createProgram();\n\t\tgl.attachShader( _renderingProgram, vertexShader );\t\t\t\t// Link shaders to program.\n\t\tgl.attachShader( _renderingProgram, fragmentShader );\n\t\tgl.linkProgram( _renderingProgram );\n\n\t\tif( !gl.getProgramParameter( _renderingProgram, gl.LINK_STATUS ) )\n\t\t\talert( \"Failed to set up shaders!\" );\n\t}",
"async function createGLProgram(gl, shader_list, transform_feedback_varyings) {\n var program = gl.createProgram();\n for (var i = 0; i < shader_list.length; i++) {\n var shader_info = shader_list[i];\n var shader = await createShader(gl, shader_info);\n gl.attachShader(program, shader);\n }\n\n /* Specify varyings that we want to be captured in the transform\n feedback buffer. */\n if (transform_feedback_varyings != null) {\n gl.transformFeedbackVaryings(\n program,\n transform_feedback_varyings,\n gl.INTERLEAVED_ATTRIBS)\n }\n\n gl.linkProgram(program);\n var link_status = gl.getProgramParameter(program, gl.LINK_STATUS);\n if (!link_status) {\n var error_message = gl.getProgramInfoLog(program);\n throw \"Could not link program.\\n\" + error_message;\n }\n return program;\n}",
"function setMaterial(mat)\n{\n gl.uniform3fv(material.diffuseLoc, mat.diffuse);\n gl.uniform3fv(material.specularLoc, mat.specular);\n gl.uniform3fv(material.ambientLoc, mat.diffuse);\n gl.uniform1f(material.shininessLoc, mat.shininess);\n}",
"function sendDataViaTexture(gl, uniformLocation, uniformName, floatArray) {\n var texture = createDataTexture(gl, floatArray),\n textureUnit = 0;\n \n gl.activeTexture(gl.TEXTURE0 + textureUnit);\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.uniform1i(uniformLocation, textureUnit);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
main loop: draw, capture event, update scene, and loop again | function loop(){
drawScene();
updateData();
window.requestAnimationFrame(loop);
} | [
"function game_loop () {\n clear(current_level.c, current_level.ctx);\n\n // DEBUG TOOLS\n //draw_grid(current_level.c, current_level.ctx);\n //draw_room_holder_grid(current_level.c, current_level.ctx);\n //draw_ui_line(c, ctx);\n\n if (current_level.battle !== null) {\n current_level.battle.draw();\n if (current_level.battle.intro_transition) {\n current_level.battle.draw_intro();\n }\n else {\n current_level.battle.listen();\n }\n }\n else {\n current_level.player.listen();\n current_level.resolve_monsters();\n\n // Draw\n current_level.draw();\n }\n\n if (!current_level.player.dead) {\n requestAnimationFrame(game_loop);\n }\n}",
"once () { this.step(); this.draw() }",
"function run(){\n\n console.log(\"Attempting Setup\");\n stage = new PIXI.Stage(0x66FF99);\n canvas = document.getElementById(\"game\");\n renderer = PIXI.autoDetectRenderer(800, 300,{view: canvas});\n document.body.appendChild(renderer.view);\n\n\tmain_menu();\n\tconsole.log(\"Game Start!\");\n\tupdate();\n}",
"run() {\n function main(tFrame) {\n game = window.game;\n game.stopMain = window.requestAnimationFrame(main);\n var nextTick = game.lastTick + game.tickLength;\n var numTicks = 0;\n\n //If tFrame < nextTick then 0 ticks need to be updated (0 is default for numTicks).\n //If tFrame = nextTick then 1 tick needs to be updated (and so forth).\n //Note: As we mention in summary, you should keep track of how large numTicks is.\n //If it is large, then either your game was asleep, or the machine cannot keep up.\n if (tFrame > nextTick) {\n var timeSinceTick = tFrame - game.lastTick;\n numTicks = Math.floor(timeSinceTick / game.tickLength);\n }\n\n queueUpdates(game, numTicks);\n game.render(tFrame);\n game.lastRender = tFrame;\n }\n\n function queueUpdates(game, numTicks) {\n for (var i = 0; i < numTicks; i++) {\n game.lastTick = game.lastTick + game.tickLength; //Now lastTick is this tick.\n game.update(game.lastTick);\n }\n }\n\n this.lastTick = performance.now();\n this.lastRender = this.lastTick; //Pretend the first draw was on first update.\n this.tickLength = 20; //This sets your simulation to run at 20Hz (50ms)\n\n this.setInitialState();\n\n this.time_start = performance.now();\n main(performance.now()); // Start the cycle\n }",
"function run(){\n\n console.log(\"Attempting Setup\");\n //stage = new PIXI.Stage(0x66FF99)\n\tstage = new PIXI.Stage(0xFFF);\n canvas = document.getElementById(\"game\");\n renderer = PIXI.autoDetectRenderer(800, 300,{view: canvas});\n document.body.appendChild(renderer.view);\n\n\tmain_menu();\n\tconsole.log(\"Game Start!\");\n\tupdate();\n}",
"function loop(){\n requestAnimationFrame(loop);\n //Get waveform values in order to draw it.\n var waveformValues = waveform.analyse();\n drawWaveform(waveformValues);\n }",
"updateAndRender(){\n if (this.scene) {\n this.calculateSquareLayout();\n this.updateSquares();\n this.updateYPos();\n this.updateTexture();\n this.updateUniforms();\n this.scene.render();\n }\n }",
"loop() {\n clearTimeout(this.persistentLoop);\n // emit loop event to any active persistent tool\n EventBus.$emit(\"loop\", this.loopCount);\n\n // redraw canvas\n if (this.file && this.file.selectionCanvas) this.onRedrawCanvas();\n\n // increase loop iteration\n ++this.loopCount;\n\n // re-run persistence loop\n this.persistentLoop = setTimeout(() => this.loop(), 25);\n }",
"render(){\n\t\tif (this.active)\n\t\t{\n\t\t\trequestAnimationFrame(this.render.bind(this));\n\t\t\tif (this.checkFrameInterval())\n\t\t\t{\n\t\t\t\tthis.frameInfo.then = this.frameInfo.now - (this.frameInfo.elapsed % this.frameInfo.fpsInterval);\n\t\t\t\tthis.clearScreen();\n\t\t\t\tthis.draw();\n\t\t\t}\n\t\t}\n\t}",
"_runBabylonRenderLoop() {\n let scene = this.Scene;\n this.BabylonEngine.runRenderLoop(function () {\n scene.render();\n });\n }",
"function main() {\n drawMap();\n setupKeyboardControls();\n }",
"function draw() {\n // Clear the background to black\n background(0);\n\n // Handle input for the tiger\n tiger.handleInput();\n lion.handleInput();\n // Move all the \"animals\"\n tiger.move();\n lion.move();\n antelope.move();\n zebra.move();\n bee.move();\n\n // Handle the tiger eating any of the prey\n tiger.handleEating(antelope);\n tiger.handleEating(zebra);\n tiger.handleEating(bee);\n\n lion.handleEating(antelope);\n lion.handleEating(zebra);\n lion.handleEating(bee);\n\n // Display all the \"animals\"\n tiger.display();\n lion.display();\n antelope.display();\n zebra.display();\n bee.display();\n}",
"function runGame(){\n movePaddle();\n moveBall();\n drawAll();\n requestAnimationFrame(runGame); // argument is self recursion\n}",
"function draw() {\n background(\"black\");\n scenery();\n\n //Loop over length of menagerie and call appropriate methods\n for (let i = 0; i < menagerie.length; i++) {\n menagerie[i].display();\n menagerie[i].update();\n menagerie[i].move();\n\n if (mouseIsPressed) {\n fill(\"white\");\n triangle(mouseX, mouseY, mouseX + 5, mouseY - 30, mouseX + 10, mouseY);\n arc(mouseX, mouseY, 30, 10, 0, 90);\n }\n }\n\n}",
"function tick() {\n current_animation_frame = requestAnimFrame(tick);\n draw();\n animate();\n}",
"function render() {\n\t//clear all canvases for a fresh render\n\tclearScreen();\n\t\n\t//draw objects centered in order\n\tfor (let i = 0; i < objects.length; ++i) {\n\t\tdrawCentered(objects[i].imgName,ctx, objects[i].x, objects[i].y,objects[i].dir);\n\t}\n\t\n\t//finally draw the HUD\n\tdrawHUD();\n}",
"update() {\r\n\t\tthis.flock();\r\n\t\tthis.drawBoid();\r\n\t}",
"function draw() {\r\n if (currentScene === 1) {\r\n drawTitleScreen();\r\n drawPlayButton();\r\n drawPractiseButton();\r\n drawRules();\r\n hint.draw();\r\n hint.update();\r\n goalSign();\r\n }\r\n if (currentScene === 2) { // zoals je kan zien wordt dit getekent bij scene 2\r\n drawPongTheGame();\r\n drawScoreBoard();\r\n drawBatjeA();\r\n drawBatjeB();\r\n batjesUpdate();\r\n goalSign();\r\n }\r\n if (currentScene === 3) { // en onderstaande wordt getekent bij scene 3\r\n drawPractiseRoom();\r\n drawBackButton();\r\n drawScoreBoardPractise();\r\n drawBatjeB();\r\n batjesUpdate();\r\n }\r\n if (currentScene === 10) { // dit wordt getekent bij scene 10\r\n drawTitleScreenExtreme();\r\n drawTitleAnimation();\r\n drawPlayExtremeButton();\r\n drawPractiseExtremeButton();\r\n drawRulesExtreme();\r\n PowerUpNr = 0;\r\n speeding = 1*resize;\r\n }\r\n if (currentScene === 11){ // dit wordt getekent bij scene 11\r\n drawPongExtreme();\r\n drawBatjeAExtreme();\r\n drawBatjeBExtreme();\r\n drawScoreBoardExtreme();\r\n batjesUpdate();\r\n drawPowerUps();\r\n goalSign();\r\n }\r\n if(currentScene === 12){ // dit wordt getekent bij scene 12\r\n drawRulesScreenExtreme();\r\n drawBackButton();\r\n drawTitleAnimation();\r\n \r\n \r\n }\r\n if(surpriseBart === true){ // dit wordt getekent wanneer de B toets wordt ingedrukt\r\n bSurprise();\r\n }\r\n}",
"function update()\r\n{\r\n rebind.update()\r\n requestAnimationFrame(update)\r\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
parent_zone_id computed: true, optional: false, required: false | get parentZoneId() {
return this.getStringAttribute('parent_zone_id');
} | [
"get parentZoneName() {\n return this.getStringAttribute('parent_zone_name');\n }",
"get parentId() {\n return this.getStringAttribute('parent_id');\n }",
"get parent() {\n return new Path(this.parentPath);\n }",
"function setParentId(/*Object*/ object,/*Store.PutDirectives?*/ options) {\n\t\t\t// summary:\n\t\t\t//\t\tSet the parent property of a store object.\n\t\t\t// object:\n\t\t\t//\t\tThe object to store.\n\t\t\t// tag:\n\t\t\t//\t\tPrivate\n\t\t\tvar objectId = this.getIdentity(object);\n\t\t\tvar parents = options.parent;\n\t\t\tvar parentId, np = [];\n\t\t\tvar undef, i;\n\n\t\t\tif (parents instanceof Array) {\n\t\t\t\tfor (i=0; i<parents.length; i++) {\n\t\t\t\t\tif (parentId = this.getIdentity(parents[i])) {\n\t\t\t\t\t\tif (parentId != objectId && np.indexOf(parentId) == -1) {\n\t\t\t\t\t\t\tnp ? np.push(parentId) : np = [parentId];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (parentId = this.getIdentity(parents)) {\n\t\t\t\t\tif (parentId != objectId) {\n\t\t\t\t\t\tnp = parentId;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tnp = undef;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn np;\n\t\t}",
"function DeleteNewZoneSubzone(type,address){\n // alert(type+address);\n var childid;\n var fromlead = 0;\n if(type == 1){\n document.getElementById('province').options.length = 1;\t\n document.getElementById('city').options.length = 1;\n document.getElementById('zone').options.length = 1;\n document.getElementById('subzone').options.length = 1;\n childid =document.getElementById(\"province\");\n \t}\n else if(type == 2){\t\t\n document.getElementById('city').options.length = 1;\n document.getElementById('zone').options.length = 1;\n document.getElementById('subzone').options.length = 1;\n childid =document.getElementById(\"city\");\n \t}\n\telse if(type == 3){ \n document.getElementById('zone').options.length = 1;\n document.getElementById('subzone').options.length = 1;\n childid =document.getElementById(\"zone\");\n \t}\n\telse if(type == 4){\t \n document.getElementById('subzone').options.length = 1;\n childid =document.getElementById(\"subzone\");\n }\nif(address !=\"\")\n{\n var flag = 1;\n fromlead = 1;\n callAjaxForDeleteZoneSubzone(type,address,flag);\n }\n}",
"getParentModel() {\n return this.parentModel;\n }",
"get parentFolder() {\n return Folder(this, \"parentFolder\");\n }",
"get timezoneName() {\n let parent = this.parent;\n let n = `${this.name}`;\n while (parent) {\n n = `${parent.name}, ${n}`;\n parent = parent.parent;\n }\n return n;\n }",
"function matchLearnertoParent(learnerId, parentId) {\n return db(\"learner_parent\")\n .insert(learnerId, parentId)\n .then(ids => ({ id: ids[0] }));\n}",
"get parentChangeKey()\n\t{\n\t\treturn this._parentChangeKey;\n\t}",
"get parent() {\n return tag.configure(ContentType(this, \"parent\"), \"ct.parent\");\n }",
"get parent() {\n return ContentType(this, \"parent\");\n }",
"function SelectParent( sParentName )\n{\n\t// Controlli\n\tif( GetFormControl(\"<%=FORM_SYS_FIELD_REQUEST_ACTION%>\").value != \"<%=ACTION_ADD_NEW%>\" )\n\t{\n // Notifica avvetimento se non si tratta di inserimento\n if( !window.confirm( \"ATTENZIONE! Questa operazione permette di variare \" +\n \"i riferimenti relativi ai dati della sezione \" + sParentName +\n \"\\n\\nContinuare ?\" ) )\n return;\n\t}\n\n\t// Nome dell'oggetto Container globale gestito da questo form\n\tvar sContainerObjName = \"<%=ODBMS_DS_FORM_PREFIX%>\" \n\t\t\t\t\t+ GetFormControl( \"<%=FORM_SYS_FIELD_FORM_PUPUP_LEVEL%>\" ).value;\n\n\t// Richiama la griglia per la selezione della Parent\n\tOpenPopUpWindow( \"<%=ResolveClientUrl(_SITE_ROOT_ & _site.Lib.GetPageFileName(_site.Glb.GetParam(\"PAGE_NAME_DATA_GRID\")))%>\",\n\t\t\t\t\"<%=FORM_SYS_FIELD_DATA_PATH%>=\" + sParentName\n\t\t\t\t+ \"&<%=FORM_SYS_FIELD_CONTAINER_OBJECT_NAME%>=\" + sContainerObjName\n\t\t\t\t+ \"&<%=FORM_SYS_FIELD_ENABLE_SELECT%>=True\"\n\t\t\t\t+ \"&<%=FORM_SYS_FIELD_REQUEST_ACTION%>=<%=ACTION_VIEW%>\", \n\t\t\t\t\t0, 0, true, true );\n}",
"ensureParentExist() {\n return __awaiter(this, void 0, void 0, function* () {\n return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {\n const collection = this.database.collection('choices');\n const parent = yield collection.findOne({\n id: this.parentId\n });\n if (!parent) {\n reject(new Error(`Unable to find the parent '${this.parentId}'`));\n return;\n }\n resolve();\n }));\n });\n }",
"function parentNetIDOfLeaf(netName){\n if (!isLeaf(netName)){\n showTitle(\"parentOfLeaf-- \"+netName+\" is not a leaf\");\n return false;\n }else\n return (netDefinition.networks[netName].leafOf);\n}",
"static getParentId(el){\n return $(el).parents('div[class^=\"shiny\"]').prop(\"id\");\n }",
"function createZone (zoneid) {\n\t\tvar $tr = $('<tr/>').attr('zoneid',zoneid);\n\t\treturn $tr;\n}",
"getRelationshipIfReferenceFieldToParent(fieldId) {\n return _.get(this.props, 'relationships') && this.props.relationships.find((relationship) => relationship.detailFieldId === fieldId);\n }",
"function GetSpaceParent(){\n var deferred = $q.defer();\n\n var spaceParents = [];\n angular.forEach(\n //Drupal.settings space_parents is json string\n\n JSON.parse(Drupal.settings.Api.space_parents), \n function (value, key) {\n this.push(new Node(key,value)); \n },\n spaceParents\n );\n deferred.resolve(spaceParents);\n\n return deferred.promise; \n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function init() to provide event listeners to make game buttons clickable and to playsound and blink when player presses game button | function init() {
document
.getElementById("game-photo-1")
.addEventListener("click", playSound1);
document
.getElementById("game-photo-2")
.addEventListener("click", playSound2);
document
.getElementById("game-photo-3")
.addEventListener("click", playSound3);
document
.getElementById("game-photo-4")
.addEventListener("click", playSound4);
} | [
"function buildGameButton(){\n\tbuttonStart.cursor = \"pointer\";\n\tbuttonStart.addEventListener(\"click\", function(evt) {\n\t\tplaySound('soundButton');\n\t\tgoPage('tutorial');\n\t});\n\t\n\tbuttonGotIt.cursor = \"pointer\";\n\tbuttonGotIt.addEventListener(\"click\", function(evt) {\n\t\tplaySound('soundButton');\n\t\tgoPage('game');\n\t});\n\t\n\tfor(n=0;n<pots_arr.length;n++){\n\t\t$.buttons[n+'_cook'].cursor = \"pointer\";\n\t\t$.buttons[n+'_cook'].id = n;\n\t\t$.buttons[n+'_cook'].addEventListener(\"click\", function(evt) {\n\t\t\tevt.preventDefault();\n\t\t\tstartCook(evt.target.id);\n\t\t});\n\t\t\n\t\t$.buttons[n+'_burn'].cursor = \"pointer\";\n\t\t$.buttons[n+'_burn'].id = n;\n\t\t$.buttons[n+'_burn'].addEventListener(\"mousedown\", function(evt) {\n\t\t\tevt.preventDefault();\n\t\t\tpots_arr[evt.target.id].heatUp = true;\n\t\t\tplaySound('soundBurn');\n\t\t});\n\t\t\n\t\t$.buttons[n+'_burn'].addEventListener(\"pressup\", function(evt) {\n\t\t\tevt.preventDefault();\n\t\t\tpots_arr[evt.target.id].heatUp = false;\n\t\t});\n\t}\n\t\n\tbuttonReplay.cursor = \"pointer\";\n\tbuttonReplay.addEventListener(\"click\", function(evt) {\n\t\tplaySound('soundButton');\n\t\tgoPage('tutorial');\n\t});\n\t\n\ticonFacebook.cursor = \"pointer\";\n\ticonFacebook.addEventListener(\"click\", function(evt) {\n\t\tshare('facebook');\n\t});\n\ticonTwitter.cursor = \"pointer\";\n\ticonTwitter.addEventListener(\"click\", function(evt) {\n\t\tshare('twitter');\n\t});\n\ticonGoogle.cursor = \"pointer\";\n\ticonGoogle.addEventListener(\"click\", function(evt) {\n\t\tshare('google');\n\t});\n}",
"function start() {\n generalTime = new Date();\n createTextArray();\n document.getElementById(\"playButton\").addEventListener('click', buttonControl, false);\n\n}//end function start",
"init() {\n if (!this.menuButton) {\n this.menuButton = this.createMenuButton();\n }\n this.menuButton.addEventListener(\n 'click',\n this.handleButtonClick.bind(this)\n );\n if (!this.closeButton) {\n this.closeButton = this.createCloseButton();\n }\n this.closeButton.addEventListener(\n 'click',\n this.handleButtonClick.bind(this)\n );\n this.disableTab(this.overlay);\n }",
"function initSimon() {\n $('[data-action=start]').on('click', startGame);\n\n }",
"function init() {\n // Create a new array for the bubbles\n bubbles = [];\n\n // Create the bubble DOM elements and add them to the board\n // Add them to the array\n for (let i = 0; i < NUM_BUBBLES; i++) {\n const bubble = makeBubble(POINTS_PER_BUBBLE);\n bubbles.push(bubble);\n board.append(bubble);\n }\n \n bubblesLeft = bubbles.length;\n \n // start the timer\n timer.text(\"0:00\");\n time = 0;\n timerInterval = setInterval(updateTimer, 1000);\n\n // hide the play button and show the timer\n playButton.hide();\n timer.show();\n \n //start game running\n updateInterval = setInterval(update, 50);\n}",
"function loadEventListeners() {\n addKeyCallback(Phaser.Keyboard.ONE, changeState, 1);\n}",
"createEventHandlers() {\n $(`#play-now-btn`).on('click', (event) => {\n // Hide the splash screen and show the game screen\n $('#splash-screen').removeClass('show');\n $('#splash-screen').addClass('hide');\n $('#game-screen').removeClass('hide');\n $('#game-screen').addClass('show');\n });\n\n $(`#music-button`).on('click', (event) => {\n let my = this.___private___;\n my.GameSound.togglePlay(); // turns background music on/off\n });\n\n $(`#reset-button`).on('click', (event) => {\n let my = this.___private___;\n $('#winner').remove();\n $('#loser').remove();\n if (this.musicState) {\n my.GameSound.play();\n }\n this.renderMinefieldGrid();\n });\n }",
"function createPlayAgainEvents()\n {\n yesButton();\n\n noButton();\n\n function yesButton()\n {\n canvasObjs[1] = new CanvasObject(250, DEFAULT_CANVAS_SIZE - 75, 0, 0, CHIP_RADIUS);\n canvasObjs[1].clickCallback = function()\n {\n Game.counter = 0;\n resetArray();\n Game.lastTimedEvent = 0;\n resetHand(Game.CPUHand);\n resetHand(Game.userHand);\n }\n canvasObjs[1].hoverCallback = function()\n {\n drawChip(250, DEFAULT_CANVAS_SIZE - 75, 'YES', '#0000AA');\n }\n }\n\n function noButton()\n {\n canvasObjs[2] = new CanvasObject(375, DEFAULT_CANVAS_SIZE - 75, 0, 0, CHIP_RADIUS);\n canvasObjs[2].clickCallback = function()\n {\n Game.context = 'TitleScreen';\n resetArray();\n Game.lastTimedEvent = 0;\n resetHand(Game.CPUHand);\n resetHand(Game.userHand);\n Game.prevCounter = null;\n }\n canvasObjs[2].hoverCallback = function()\n {\n drawChip(375, DEFAULT_CANVAS_SIZE - 75, 'NO', '#0000AA');\n }\n }\n }",
"function configure_event_handlers(){\n\n document.getElementById('btn-start').addEventListener(\"click\", btn_start_click_function);\n document.getElementById('btn-save').addEventListener(\"click\", btn_save_click_function);\n document.getElementById('btn-continue').addEventListener(\"click\", btn_continue_click_function);\n\n document.getElementById('game-mode-select').addEventListener(\"click\", game_mode_option_change_function);\n\n}",
"function init() {\n squares.forEach((q) => {\n q.innerText = \"\";\n q.addEventListener(\"click\", handleTurn);\n })\n win = null;\n moveCount = 0;\n render();\n}",
"function voiceAssistantInit() {\n hideElement('#bubble-1');\n hideElement('#bubble-2');\n hideElement('#bubble-3');\n hideElement('#bubble-4');\n buttonlistener(\".btnVoice\",voiceAssistantAction);\n}",
"function initUI() {\n // Detach Stop and Stop Replay\n $stopButton.detach();\n $stopReplayButton.detach();\n // Append start and start replay\n $buttonContainer.append($startButton);\n $buttonContainer.append($startReplayButton);\n}",
"function run(){\n\n console.log(\"Attempting Setup\");\n stage = new PIXI.Stage(0x66FF99);\n canvas = document.getElementById(\"game\");\n renderer = PIXI.autoDetectRenderer(800, 300,{view: canvas});\n document.body.appendChild(renderer.view);\n\n\tmain_menu();\n\tconsole.log(\"Game Start!\");\n\tupdate();\n}",
"function init()\n{\n\t//\tInitialize the canvas and context\n\tcanvas = document.getElementById(\"mainCanvas\");\n\tctx = canvas.getContext(\"2d\");\n\tctx.font = \"100pt Verdana\";\n\tcanvas.width = TILE_S * COLS;\n\tcanvas.height = TILE_S * ROWS;\n\tcanvas.setAttribute(\"tabIndex\", \"0\");\n\tcanvas.focus();\n\n\n\tcanvas.addEventListener(\"keydown\",keyDownHandler);\n\tcanvas.addEventListener(\"keyup\",keyUpHandler);\n\n\t//\tInitialize actors\n\n\t// Bernie\n\thero = new Square(0, 0, 150, 228, 'img/Bernie.png', \"img/BernieJumping.png\");\n\tapplyDraw(hero);\n\tapplyGravity(hero, GRAVITY);\n\tactors.push(hero);\n\n\tmakeCostumes();\n\n}",
"function run(){\n\n console.log(\"Attempting Setup\");\n //stage = new PIXI.Stage(0x66FF99)\n\tstage = new PIXI.Stage(0xFFF);\n canvas = document.getElementById(\"game\");\n renderer = PIXI.autoDetectRenderer(800, 300,{view: canvas});\n document.body.appendChild(renderer.view);\n\n\tmain_menu();\n\tconsole.log(\"Game Start!\");\n\tupdate();\n}",
"init() {\n\t\t'use strict';\n\t\tthis.createRenderer();\n\t\tthis.createScene();\n\n\t\tthis.clock = new THREE.Clock;\n this.clock.start();\n\n\n\t\twindow.addEventListener(\"keydown\", KeyDown);\n window.addEventListener(\"keyup\", KeyUp);\n\t}",
"function privateInitializeEventHandlers(){\n\t\t/*\n\t\t\tOn time update for the audio element, update visual displays that\n\t\t\trepresent the time on either a visualized element or time display.\n\t\t*/\n\t\tconfig.active_song.addEventListener('timeupdate', privateUpdateTime );\n\n\t\t/*\n\t\t\tWhen the audio element has ended playing, we handle the song\n\t\t\tending. In a single song or multiple modular song instance,\n\t\t\tthis just synchronizes the visuals for time and song time\n\t\t\tvisualization, but for a playlist it determines whether\n\t\t\tit should play the next song or not.\n\t\t*/\n\t\tconfig.active_song.addEventListener('ended', privateHandleSongEnded );\n\n\t\t/*\n\t\t\tBinds handlers for play classes\n\t\t*/\n\t\tvar play_classes = document.getElementsByClassName(\"amplitude-play\");\n\n\t\tfor( var i = 0; i < play_classes.length; i++ ){\n\t\t\tif( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {\n\t\t\t\tplay_classes[i].addEventListener('touchstart', privatePlayClickHandle );\n\t\t\t}else{\n\t\t\t\tplay_classes[i].addEventListener('click', privatePlayClickHandle );\n\t\t\t}\n\t\t}\n\n\t\t/*\n\t\t\tBinds handlers for pause classes\n\t\t*/\n\t\tvar pause_classes = document.getElementsByClassName(\"amplitude-pause\");\n\n\t\tfor( var i = 0; i < pause_classes.length; i++ ){\n\t\t\tif( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {\n\t\t\t\tpause_classes[i].addEventListener('touchstart', privatePauseClickHandle );\n\t\t\t}else{\n\t\t\t\tpause_classes[i].addEventListener('click', privatePauseClickHandle );\n\t\t\t}\n\t\t}\n\n\t\t/*\n\t\t\tBinds handlers for stop classes\n\t\t*/\n\t\tvar stop_classes = document.getElementsByClassName(\"amplitude-stop\");\n\n\t\tfor( var i = 0; i < stop_classes.length; i++ ){\n\t\t\tif( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {\n\t\t\t\tstop_classes[i].addEventListener('touchstart', privateStopClickHandle );\n\t\t\t}else{\n\t\t\t\tstop_classes[i].addEventListener('click', privateStopClickHandle );\n\t\t\t}\n\t\t}\n\n\t\t/*\n\t\t\tBinds handlers for play/pause classes\n\t\t*/\n\t\tvar play_pause_classes = document.getElementsByClassName(\"amplitude-play-pause\");\n\n\t\tfor( var i = 0; i < play_pause_classes.length; i++ ){\n\t\t\tif( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {\n\t\t\t\tplay_pause_classes[i].addEventListener('touchstart', privatePlayPauseClickHandle );\n\t\t\t}else{\n\t\t\t\tplay_pause_classes[i].addEventListener('click', privatePlayPauseClickHandle );\n\t\t\t}\n\t\t}\n\n\t\t/*\n\t\t\tBinds handlers for mute classes\n\n\t\t\tWARNING: If iOS, we don't do anything because iOS does not allow the\n\t\t\tvolume to be adjusted through anything except the buttons on the side of\n\t\t\tthe device.\n\t\t*/\n\t\tvar mute_classes = document.getElementsByClassName(\"amplitude-mute\");\n\n\t\tfor( var i = 0; i < mute_classes.length; i++ ){\n\t\t\tif( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {\n\t\t\t\t/*\n\t\t\t\t\tChecks for an iOS device and displays an error message if debugging\n\t\t\t\t\tis turned on.\n\t\t\t\t*/\n\t\t\t\tif( /iPhone|iPad|iPod/i.test(navigator.userAgent) ) {\n\t\t\t\t\tprivateWriteDebugMessage( 'iOS does NOT allow volume to be set through javascript: https://developer.apple.com/library/safari/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/Device-SpecificConsiderations/Device-SpecificConsiderations.html#//apple_ref/doc/uid/TP40009523-CH5-SW4' );\n\t\t\t\t}else{\n\t\t\t\t\tmute_classes[i].addEventListener('touchstart', privateMuteClickHandle );\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tmute_classes[i].addEventListener('click', privateMuteClickHandle );\n\t\t\t}\n\t\t}\n\n\t\t/*\n\t\t\tBinds handlers for volume up classes\n\n\t\t\tWARNING: If iOS, we don't do anything because iOS does not allow the\n\t\t\tvolume to be adjusted through anything except the buttons on the side of\n\t\t\tthe device.\n\t\t*/\n\t\tvar volume_up_classes = document.getElementsByClassName(\"amplitude-volume-up\");\n\n\t\tfor( var i = 0; i < volume_up_classes.length; i++ ){\n\t\t\tif( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {\n\t\t\t\t/*\n\t\t\t\t\tChecks for an iOS device and displays an error message if debugging\n\t\t\t\t\tis turned on.\n\t\t\t\t*/\n\t\t\t\tif( /iPhone|iPad|iPod/i.test(navigator.userAgent) ) {\n\t\t\t\t\tprivateWriteDebugMessage( 'iOS does NOT allow volume to be set through javascript: https://developer.apple.com/library/safari/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/Device-SpecificConsiderations/Device-SpecificConsiderations.html#//apple_ref/doc/uid/TP40009523-CH5-SW4' );\n\t\t\t\t}else{\n\t\t\t\t\tvolume_up_classes[i].addEventListener('touchstart', privateVolumeUpClickHandle );\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tvolume_up_classes[i].addEventListener('click', privateVolumeUpClickHandle );\n\t\t\t}\n\t\t}\n\n\t\t/*\n\t\t\tBinds handlers for volume down classes\n\n\t\t\tWARNING: If iOS, we don't do anything because iOS does not allow the\n\t\t\tvolume to be adjusted through anything except the buttons on the side of\n\t\t\tthe device.\n\t\t*/\n\t\tvar volume_down_classes = document.getElementsByClassName(\"amplitude-volume-down\");\n\t\t\n\t\tfor( var i = 0; i < volume_down_classes.length; i++ ){\n\t\t\tif( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {\n\t\t\t\t/*\n\t\t\t\t\tChecks for an iOS device and displays an error message if debugging\n\t\t\t\t\tis turned on.\n\t\t\t\t*/\n\t\t\t\tif( /iPhone|iPad|iPod/i.test(navigator.userAgent) ) {\n\t\t\t\t\tprivateWriteDebugMessage( 'iOS does NOT allow volume to be set through javascript: https://developer.apple.com/library/safari/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/Device-SpecificConsiderations/Device-SpecificConsiderations.html#//apple_ref/doc/uid/TP40009523-CH5-SW4' );\n\t\t\t\t}else{\n\t\t\t\t\tvolume_down_classes[i].addEventListener('touchstart', privateVolumeDownClickHandle );\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tvolume_down_classes[i].addEventListener('click', privateVolumeDownClickHandle );\n\t\t\t}\n\t\t}\n\n\t\t/*\n\t\t\tBinds handlers for song slider classes. The song sliders are HTML 5 \n\t\t\tRange Elements. This event fires everytime a slider has changed.\n\t\t*/\n\t\tvar song_sliders = document.getElementsByClassName(\"amplitude-song-slider\");\n\n\t\tfor( var i = 0; i < song_sliders.length; i++ ){\n\t\t\tsong_sliders[i].addEventListener('input', privateSongStatusBarInputHandle );\n\t\t}\n\n\t\t/*\n\t\t\tBinds handlers for volume slider classes. The volume sliders are HTML 5\n\t\t\tRange Elements. This event fires everytime a slider has changed.\n\n\t\t\tWARNING: If iOS, we don't do anything because iOS does not allow the\n\t\t\tvolume to be adjusted through anything except the buttons on the side of\n\t\t\tthe device.\n\t\t*/\n\t\tvar volume_sliders = document.getElementsByClassName(\"amplitude-volume-slider\");\n\n\t\tfor( var i = 0; i < volume_sliders.length; i++ ){\n\t\t\t/*\n\t\t\t\tChecks for an iOS device and displays an error message if debugging\n\t\t\t\tis turned on.\n\t\t\t*/\n\t\t\tif( /iPhone|iPad|iPod/i.test(navigator.userAgent) ) {\n\t\t\t\tprivateWriteDebugMessage( 'iOS does NOT allow volume to be set through javascript: https://developer.apple.com/library/safari/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/Device-SpecificConsiderations/Device-SpecificConsiderations.html#//apple_ref/doc/uid/TP40009523-CH5-SW4' );\n\t\t\t}else{\n\t\t\t\tvolume_sliders[i].addEventListener('input', privateVolumeInputHandle );\n\t\t\t}\n\t\t}\n\n\t\t/*\n\t\t\tBinds handlers for next button classes.\n\t\t*/\n\t\tvar next_classes = document.getElementsByClassName(\"amplitude-next\");\n\n\t\tfor( var i = 0; i < next_classes.length; i++ ){\n\t\t\tif( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {\n\t\t\t\tnext_classes[i].addEventListener('touchstart', privateNextClickHandle );\n\t\t\t}else{\n\t\t\t\tnext_classes[i].addEventListener('click', privateNextClickHandle );\n\t\t\t}\n\t\t}\n\n\t\t/*\n\t\t\tBinds handlers for previous button classes.\n\t\t*/\n\t\tvar prev_classes = document.getElementsByClassName(\"amplitude-prev\");\n\n\t\tfor( var i = 0; i < prev_classes.length; i++ ){\n\t\t\tif( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {\n\t\t\t\tprev_classes[i].addEventListener('touchstart', privatePrevClickHandle );\n\t\t\t}else{\n\t\t\t\tprev_classes[i].addEventListener('click', privatePrevClickHandle );\n\t\t\t}\n\t\t}\n\n\t\t/*\n\t\t\tBinds handlers for shuffle button classes.\n\t\t*/\n\t\tvar shuffle_classes = document.getElementsByClassName(\"amplitude-shuffle\");\n\n\t\tfor( var i = 0; i < shuffle_classes.length; i++ ){\n\t\t\tshuffle_classes[i].classList.remove('amplitude-shuffle-on');\n\t\t\tshuffle_classes[i].classList.add('amplitude-shuffle-off');\n\n\t\t\tif( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {\n\t\t\t\tshuffle_classes[i].addEventListener('touchstart', privateShuffleClickHandle );\n\t\t\t}else{\n\t\t\t\tshuffle_classes[i].addEventListener('click', privateShuffleClickHandle );\n\t\t\t}\n\t\t}\n\n\t\t/*\n\t\t\tBinds handlers for repeat button classes.\n\t\t*/\n\t\tvar repeat_classes = document.getElementsByClassName(\"amplitude-repeat\");\n\n\t\tfor( var i = 0; i < repeat_classes.length; i++ ){\n\t\t\trepeat_classes[i].classList.remove('amplitude-repeat-on');\n\t\t\trepeat_classes[i].classList.add('amplitude-repeat-off');\n\n\t\t\tif( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {\n\t\t\t\trepeat_classes[i].addEventListener('touchstart', privateRepeatClickHandle );\n\t\t\t}else{\n\t\t\t\trepeat_classes[i].addEventListener('click', privateRepeatClickHandle );\n\t\t\t}\n\t\t}\n\t}",
"function startGame() {\n createButtons();\n createCards();\n displayCards();\n}",
"function playbackEvents () {\n\n\t\tvar play = document.getElementById('play');\n\t\tvar overlayPlay = document.getElementById('overlay-play');\n\t\tvar pause = document.getElementById('pause');\n\t\tvar overlayPause = document.getElementById('overlay-pause');\n\t\tvar previous = document.getElementById('previous');\n\t\tvar next = document.getElementById('next');\n\n\t\tplay.addEventListener('click', emitEvent('play'));\n\t\toverlayPlay.addEventListener('click', emitEvent('play'));\n\t\tpause.addEventListener('click', emitEvent('pause'));\n\t\toverlayPause.addEventListener('click', emitEvent('pause'));\n\t\tprevious.addEventListener('click', emitEvent('previous'));\n\t\tnext.addEventListener('click', emitEvent('next'));\n\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
isSpamSubmission checks for a hidden field which should not be set and returns false if it is | isNotSpamSubmission() {
var spamFieldValue = this.state.forbiddenInput;
if(spamFieldValue.length !== 0) {
return false;
}
return true;
} | [
"function TKR_flagSpam(isSpam) {\n var selectedLocalIDs = [];\n for (var i = 0; i < issueRefs.length; i++) {\n var checkbox = document.getElementById('cb_' + issueRefs[i]['id']);\n if (checkbox && checkbox.checked) {\n selectedLocalIDs.push(issueRefs[i]['id']);\n }\n }\n if (selectedLocalIDs.length > 0) {\n if (!confirm((isSpam ? 'Flag' : 'Un-flag') +\n ' all selected issues as spam?')) {\n return;\n }\n var selectedLocalIDString = selectedLocalIDs.join(',');\n $('bulk_spam_ids').value = selectedLocalIDString;\n $('bulk_spam_value').value = isSpam;\n\n var loading = $('bulk-action-loading');\n loading.style.visibility = 'visible';\n\n var form = $('bulkspam');\n form.submit();\n } else {\n alert('Please select some issues to flag as spam');\n }\n}",
"sendForm() {\n\t\tlet rand = Math.floor(Math.random() * 101);\n\t\tif(rand <= 70) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"function checkAttendeeHourForm() {\n var canSubmit = true;\n\n // Check for Attendee selected\n var aId = $('#attendeeId').val();\n if (aId === '')\n canSubmit = false;\n\n // Check for PD Hours\n var pdHours = $('#PDHours').val();\n if (pdHours === '')\n canSubmit = false;\n else {\n pdHours = parseFloat(pdHours);\n if (pdHours <= 0.00)\n canSubmit = false;\n }\n\n // Enable/disable submit button\n disableAttendeeHourSubmit(!canSubmit);\n}",
"function checkAttendeeForm() {\n var canSubmit = true;\n\n // Check first name\n if ($('#firstName').val() === '')\n canSubmit = false;\n\n // Check last name\n if ($('#lastName').val() === '')\n canSubmit = false;\n\n // Check agency id\n if ($('#attendeeAgencyId').val() === '')\n canSubmit = false;\n\n // Enable/disable submit button\n disableAttendeeSubmit(!canSubmit);\n}",
"function checkAgencyForm() {\n var cansubmit = true;\n\n // Check agency name\n if ($('#agency').val() === '')\n cansubmit = false;\n\n // Enable/disable submit button\n disableAgencySubmit(!cansubmit);\n}",
"function editSubmitButtonWarning() {\n\n const hasWordWarning = $('p.word-warning').is(':visible');\n const hasSentenceWarning = $('p.sentence-warning').is(':visible');\n const hasTranslationWarning = $('p.translation-warning').is(':visible');\n\n const hasNoSynonyms = $('input.english-synonym').val().split(',').length === 0;\n const hasNoSentence = $('input.sentence').val() === '';\n const hasNoWord = $('input.word').val() === '';\n const hasNoTranslation = $('input.translation').val() === '';\n\n const shouldShowWarning = hasWordWarning\n || hasSentenceWarning\n || hasTranslationWarning\n || hasNoSynonyms\n || hasNoSentence\n || hasNoWord\n || hasNoTranslation;\n\n if (shouldShowWarning) {\n $('p.submit-warning').show();\n return true;\n } else {\n $('p.submit-warning').hide();\n return false;\n }\n }",
"function checkSpam(textNode){\n\n var v = textNode.innerHTML;\n var checkSpam = \"This comment is hidden because it's likely to be inappropriate or spam. \";\n var spam = v.search(checkSpam);\n if(spam >= 0){ \n var button = $(textNode).find(\"a\");\n if(button[0] != null){\n $(button[0]).click();\n }\n }\n return textNode;\n}",
"function testSubmitted()\r\n{\r\n\tvar total = $('#rateGame-alert-container').find('.rating-submit').length;\r\n\tvar count = 0;\r\n\t\r\n\t$('#rateGame-alert-container').find('.rating-submit').each(function()\r\n\t{\r\n\t\tif ($(this).text().toLowerCase() == 'submitted') {\r\n\t\t\tcount++;\r\n\t\t}\r\n\t})\r\n\t\r\n\tif (count == total) {\r\n\t\treturn true;\r\n\t} else {\r\n\t\treturn false;\r\n\t}\r\n}",
"function IsHidden(){\n\treturn !_showGizmo;\n}//IsHidden",
"function validateNewsLetterMailForm(formID)\n{\n if(validateForm(formID, 'frmNewsLetterName', 'Title', 'R','frmSubscriberList','Subscriber','R'))\n { \n return true;\n } \n else \n {\n return false;\n }\n}",
"function validateNewsletter() {\r\n let checkbox = document.getElementById(\"newsletter\");\r\n let email = document.getElementById(\"email\").value;\r\n let show = \"none\";\r\n if (checkbox.checked === true && email === \"\")\r\n show = \"block\";\r\n else\r\n show = \"none\";\r\n document.getElementById(\"emailMandatory\").style.display = show;\r\n return (show === 'none' && checkbox.checked);\r\n}",
"function foodbakery_autopost_twitter_hide_show(opt_id) {\n if (jQuery(\"#\" + opt_id).val() != 'on') {\n jQuery(\"#twitter_message_format\").hide();\n } else {\n jQuery(\"#twitter_message_format\").show();\n }\n}",
"shouldSendUnsentMessages() {\n var sendUnsentWhenGoingOnlinePref = Services.prefs.getIntPref(\n \"offline.send.unsent_messages\"\n );\n if (sendUnsentWhenGoingOnlinePref == 2) {\n // never send\n return false;\n } else if (this.haveUnsentMessages()) {\n // if we we have unsent messages, then honor the offline.send.unsent_messages pref.\n if (\n (sendUnsentWhenGoingOnlinePref == 0 &&\n this.confirmSendUnsentMessages()) ||\n sendUnsentWhenGoingOnlinePref == 1\n ) {\n return true;\n }\n }\n return false;\n }",
"function valReason(frm){\n\tvar passed=true;\n\tvar errorCount=0;\n\tvar r= frm.reason.value;\n\t\n\tif(r==\"\" || r==null){\n\t\terrorCount++;\n\t\tdocument.getElementById(\"reason_err\").innerHTML=\"You must select a reason to deny the post.\";\n\t}\n\t\n\t\tif(errorCount !=0)\n\t{\n\t\treturn false;\n\t}\n}",
"function checkMail(){\r\n\tif (mail.value == null || mail.value == \"\"){\r\n\t\temptyFieldsArray.push(\" Email\");\r\n\t\tborderRed(mail);\r\n\t\treturn true;\r\n\t}\r\n\telse{\r\n\t\treturn false;\r\n\t}\r\n}",
"function profilecreatedforvalidation(){\n\tif($(\"#profilecreatedforpopup\").val() == \"\"){\n\t\t$(\"#notnullprofilecreated\").show();\n\t\treturn false;\n\t} else {\n\t\t$(\"#notnullprofilecreated\").hide();\n\t\treturn true;\n\t}\n}",
"function isValidPost(post) {\n return post && post.url && !post.distinguished && !post.self_text && !post.stickied && !post.pinned;\n }",
"function mothertonguevalidation(){\n\tif($(\"#mothertonguepopup\").val() == \"\"){\n\t\t$(\"#notnullmothertongue\").show();\n\t\treturn false;\n\t} else {\n\t\t$(\"#notnullmothertongue\").hide();\n\t\treturn true;\n\t}\n}",
"function disableAttendeeSubmit(disable) {\n $('#attendeeSubmit').attr('disabled', disable);\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds health pills (which visualize tensor summaries) to a graph group. | function addHealthPills(svgRoot, nodeNamesToHealthPills, healthPillStepIndex) {
if (!nodeNamesToHealthPills) {
// No health pill information available.
return;
}
var svgRootSelection = d3.select(svgRoot);
svgRootSelection.selectAll('g.nodeshape')
.each(function (nodeInfo) {
// Only show health pill data for this node if it is available.
var healthPills = nodeNamesToHealthPills[nodeInfo.node.name];
var healthPill = healthPills ? healthPills[healthPillStepIndex] : null;
_addHealthPill(this, healthPill, nodeInfo);
});
} | [
"function heal() {\n\tif (pilot.total_health_packs == 0) {\n\t\t//The pilot can't do anything if they don't have health packs\n\t\tconsole.log(\"Can't heal,; no more health packs!\");\n\t} else {\n\t\tif (pilot.health == 100) {\n\t\t\t//Can't have more than 100 health\n\t\t\tconsole.log(\"Can't use health pack; Pilot has max health!\");\n\t\t} else if (pilot.health > 75) {\n\t\t\tpilot.health = 100;\n\t\t\tpilot.total_health_packs --;\n\t\t\tconsole.log(\"Pilot health has gone up to \" + pilot.health.toString() + \".\");\n\t\t} else {\n\t\t\tpilot.health += 25\n\t\t\tpilot.total_health_packs --;\n\t\t\tconsole.log(\"Pilot health has gone up to \" + pilot.health.toString() + \".\");\n\t\t}\n\t}\n}",
"function addMedPac(medPacName){\n var mod = medPacs[medPacName].modifier;\n //current health + mod\n console.log(\"Health \",health,\"hits \",hits)\n//add mod to health\n//debugger\n}",
"attachNewGroup() {\n 'use strict'\n let view, builder, groupType, order\n\n view = this\n builder = aljabr.builder\n\n groupType = view.el.select('#group-type-menu')\n .property('value')\n order = parseInt(view.el.select('#group-order-menu')\n .property('value'), 10)\n console.log('groupType: ' + groupType)\n console.log('order: ' + order)\n\n if (groupType === 'empty') {\n aljabr.group = new aljabr.GroupBuilder(aljabr.alphaElements(order))\n }\n else if (groupType === 'cyclic') {\n aljabr.group = aljabr.buildCyclicGroup(order)\n }\n else if (groupType === 'dihedral') {\n aljabr.group = aljabr.buildDihedralGroup(order)\n }\n else if (groupType === 'alternating') {\n aljabr.group = aljabr.buildAlternatingGroup(order)\n }\n else if (groupType === 'symmetry') {\n aljabr.group = aljabr.buildSymmetryGroup(order)\n }\n\n builder.cayleyTableView.attach(aljabr.group)\n builder.cayleyGraphView.attach(aljabr.group)\n\n return\n }",
"attachToGroup(group) {\n if (this.groups.find(g => g === group)) {\n return;\n }\n this.groups.push(group);\n }",
"addHealthPoints(points) {\n if (points >= 0) {\n this.health += parseInt(points);\n if (this.health > this.maxHealth) {\n this.restoreHealthCompletely()\n }\n } else {\n this.removeHealthPoints(-points);\n }\n }",
"function addDifficulty() {\n if (tiger.score > 0 & tiger.score % 9 === 0) {\n hunterAmount = 4;\n let newHunter = new Hunter(random(width), random(height), 5, color(200, 200, 200), 20);\n hunter.push(newHunter);\n }\n else if (tiger.score > 0 & tiger.score % 6 === 0) {\n hunterAmount = 3;\n let newHunter = new Hunter(random(width), random(height), 5, color(200, 200, 200), 20);\n hunter.push(newHunter);\n }\n else if (tiger.score > 0 & tiger.score % 3 === 0) {\n hunterAmount = 2;\n let newHunter = new Hunter(random(width), random(height), 5, color(200, 200, 200), 20);\n hunter.push(newHunter);\n }\n}",
"function groupBubbles() {\n hideYears();\n\n force.on('tick', function(e) {\n bubbles.each(moveToCenter(e.alpha))\n .attr('cx', function(d) {\n return d.x;\n })\n .attr('cy', function(d) {\n return d.y;\n });\n });\n\n force.start();\n }",
"function showGrowth() {\n // ensure the axis to histogram one\n hideAxis();\n\n g.selectAll(\".growth\")\n .transition()\n .duration(600)\n .style(\"opacity\", 1.0);\n\n g.selectAll(\".line\")\n .transition()\n .duration(600)\n .style(\"opacity\", 0);\n\n g.selectAll(\".scatter\")\n .transition()\n .duration(600)\n .style(\"opacity\", 0);\n }",
"function doDamage() {\n let newGroup = {}\n let deadGuys = 0;\n\n if (props.secondGroup) \n newGroup = JSON.parse(JSON.stringify(props.secondGroup))\n else\n newGroup = JSON.parse(JSON.stringify(props.group))\n\n props.changePrevState(JSON.parse(JSON.stringify(newGroup)))\n\n \n //Make an array of keys with the values that are above 0\n let nonzeros = []\n if (props.selection) {\n newGroup.creatures.forEach((element, index) => {\n if (element > 0 && props.selectedCreatures.includes(index) ) \n nonzeros.push(index) \n })\n }\n else {\n newGroup.creatures.forEach((element, index) => {\n if( element > 0 ) \n nonzeros.push(index)\n })\n }\n\n switch(props.targetType) {\n case \"lowest\":\n nonzeros.sort(function(a, b){return newGroup.creatures[a]-newGroup.creatures[b]});\n break;\n case \"highest\":\n nonzeros.sort(function(a,b){return newGroup.creatures[b]-newGroup.creatures[a]})\n break;\n default: \n nonzeros = SmallFunctions.shuffle(nonzeros)\n break;\n }\n\n \n let targets = props.numTargets;\n let rollResults = []\n let finalResults = []\n let damage = null;\n \n\n if (!props.aoe && !props.secondGroup) { //If doing single target damage\n let remainder = props.damage;\n if (props.bleedthrough) targets += 1;\n\n while (nonzeros.length > 0 && targets > 0 && remainder > 0) {\n\n if(newGroup.creatures[nonzeros[0]] > remainder){\n newGroup.creatures[nonzeros[0]] -= remainder\n remainder = 0;\n }\n else if (newGroup.creatures[nonzeros[0]] === remainder) {\n remainder = 0;\n deadGuys += 1;\n newGroup.creatures[nonzeros[0]] = 0;\n }\n else{\n remainder -= newGroup.creatures[nonzeros[0]]\n newGroup.creatures[nonzeros[0]] = 0\n deadGuys += 1;\n }\n nonzeros.splice(0, 1)\n targets -= 1; \n console.log(\"loop\") \n } \n \n }\n else {\n if (props.saveRule === \"None\") \n rollResults = []\n else if (props.aoe)\n rollResults = SmallFunctions.rollDice(props.rolltype, props.numTargets )\n else //If it is an attack group action\n rollResults = SmallFunctions.rollDice(props.rolltype, props.numAttackers )\n\n \n\n if(props.aoe) { //if aoe effect\n while (targets > 0 && nonzeros.length > 0) {\n if (props.saveRule === \"None\" || rollResults[0] + newGroup.Saves[props.saveType]< props.saveDC ) \n damage = props.damage\n \n else if (props.saveRule === \"Half\")\n damage = Math.floor(props.damage / 2)\n \n else \n damage = 0;\n \n newGroup.creatures[nonzeros[0]] = Math.max( 0 , newGroup.creatures[nonzeros[0]] - (damage))\n if (newGroup.creatures[nonzeros[0]] === 0) deadGuys += 1;\n finalResults.push([rollResults[0], damage, false])\n rollResults.splice(0,1)\n nonzeros.splice(0,1)\n targets -= 1;\n }\n \n\n }\n else { //if group attack\n nonzeros = nonzeros.splice(0, targets)\n while (rollResults.length > 0 && nonzeros.length > 0) {\n let newDamage = props.selectedAttack.damBonus\n let victim = Math.floor(Math.random()*nonzeros.length)\n finalResults.push([rollResults[0]])\n for (let i = 0; i < props.selectedAttack.numDie; i++) {\n newDamage += Math.floor(Math.random() * props.selectedAttack.damDie) + 1\n }\n if(props.selectedAttack.saving) {\n if(rollResults[0] + newGroup.Saves[props.selectedAttack.savingType] < props.selectedAttack.DC ) {\n newGroup.creatures[nonzeros[victim]] = Math.max(0, newGroup.creatures[nonzeros[victim]] - newDamage)\n finalResults[finalResults.length-1].push(newDamage)\n finalResults[finalResults.length-1].push(false)\n }\n else {\n finalResults[finalResults.length-1].push(0)\n finalResults[finalResults.length-1].push(false) \n }\n }\n else {\n if( rollResults[0] + props.selectedAttack.bonus >= newGroup.armorClass ) {\n newGroup.creatures[nonzeros[victim]] = Math.max(0, newGroup.creatures[nonzeros[victim]] - newDamage)\n finalResults[finalResults.length-1].push(newDamage)\n finalResults[finalResults.length-1].push(true)\n }\n else {\n finalResults[finalResults.length-1].push(0)\n finalResults[finalResults.length-1].push(true)\n }\n }\n\n if(newGroup.creatures[nonzeros[victim]] === 0) {\n nonzeros.splice(victim, 1)\n deadGuys += 1\n }\n rollResults.splice(0,1) \n\n } \n }\n }\n\n \n if(props.saveRule === \"None\")\n props.changeRollResults([])\n else\n props.changeRollResults(finalResults)\n props.updateGroup(newGroup) \n props.changeDeadGuys(deadGuys) \n }",
"createGroups() {\n\t\tlet heightScale = d3.scaleLinear().domain([0, 100]).range([0, this.height - this.barGroupHeight]);\n\t\tlet widthScale = d3.scaleLinear().domain([0, 100]).range([0, this.width]);\n\t\tlet invWidth = 1.0 / this.totalBars;\n\n\t\tthis.svg.selectAll(\"g\").remove();\n\t\tlet bargroupsgroup = this.svg.append(\"g\");\n\n\t\tlet barData = [];\n\t\tlet barNames = [\"colorbar\", \"timebar\", \"branchesbar\", \"samplesbar\", \"depthbar\", \"variancebar\", \"boxIntersections\", \"objIntersections\"];\n\t\tlet sortFields = [\"color\", \"time\", \"branches\", \"samples\", \"depth\", \"variance\", \"boxIntersections\", \"objIntersections\"];\n\t\tfor (let i = 0; i < this.totalBars; ++i) {\n\t\t\tlet entry = {\n\t\t\t\t\"class\" : barNames[i],\n\t\t\t\t\"newClass\" : barNames[i],\n\t\t\t\t\"idx\" : i,\n\t\t\t\t\"width\" : this.width / this.totalBars,\n\t\t\t\t\"self\" : this,\n\t\t\t\t\"sortField\" : sortFields[i],\n\t\t\t\t\"x\": i * widthScale(100 / this.totalBars)\n\t\t\t}\n\t\t\tbarData.push(entry);\n\t\t}\n\n\t\tlet groups = bargroupsgroup.selectAll(\"g\").data(barData);\n\t\tlet enterGroups = groups.enter().append(\"g\");\n\t\tlet allGroups = groups.merge(enterGroups)\n\n\t\tallGroups.each(function(d) { this.classList.add(d.class); this.classList.add(\"b\" + d.idx); this.classList.add(\"bargroup\"); })\n\t\t\t\t.call(d3.drag().on(\"start\", this.dragstarted).on(\"drag\", this.dragged).on(\"end\", this.dragended));\n\n\n\t\tthis.svg.append(\"g\").classed(\"selectableBar overlay\", true);\n\t\t//this.update();\n\t}",
"function add_grouped(entity_name) {\n var variance_mapping = {\n 'bubble': 100,\n 'jellyfish': 250\n };\n var spawn_mapping = {\n 'bubble': add_bubble,\n 'jellyfish': add_jellyfish\n }\n var max_mapping = {\n 'bubble': 50,\n 'jellyfish': 20\n }\n\n var x_coord = Math.floor(Math.random() * game.world.width);\n var y_coord = 0;\n var n = Math.floor(4 + (Math.random() * max_mapping[entity_name]));\n\n for (var i = 0; i < n; i++) {\n var pos_neg = Math.random() <= 0.5 ? -1 : 1;\n var x_variance = pos_neg * Math.random() * variance_mapping[entity_name];\n var y_variance = -1 * Math.random() * variance_mapping[entity_name];\n\n spawn_mapping[entity_name](\n x_coord + x_variance, y_coord + y_variance);\n }\n}",
"add(group) {\n this.routeGroups.push(group);\n return this;\n }",
"drawHealth() {\n document.querySelector(\".monster-health__remain\").style.width =\n (this.health / this.startHealth) * 100 + \"%\";\n document.querySelector(\n \".monster-health__remain\"\n ).innerHTML = this.health;\n }",
"function AlertGroup(type, groupID, heading, count){\n\tthis.type = type;\t\t//danger, warning, or caution\n\tthis.groupID = groupID;\t//the alerts will refer to this id\n\tthis.heading = heading;\t//heading text for the group\n\tthis.count = count = 0; //total number of alerts within this group\n}",
"function buildContainerGroups() {\n let container = svg\n .append('g')\n .classed('tooltip-container-group', true)\n .attr('transform', `translate( ${margin.left}, ${margin.top})`);\n\n container.append('g').classed('tooltip-group', true);\n }",
"function createAlertGroupContainer(group){\n\t\t\tvar containerHtml = \"<li class='ANDI508-alertGroup-container ANDI508-display-\"+group.type+\"' id='ANDI508-alertGroup_\"+group.groupID+\"'>\\\n\t\t\t\t\t\t\t <h4><a href='#' class='ANDI508-alertGroup-toggler' tabindex='0' aria-expanded='false'>\"+group.heading+\n\t\t\t\t\t\t\t\t \" (<span class='ANDI508-total'></span>)</a></h4><ol class='ANDI508-alertGroup-list'></ol></li>\";\n\t\t\t$(\"#ANDI508-alertType-\"+group.type+\"s-container\").append(containerHtml);\n\t\t}",
"updateHealth(health) {\n // width is defined in terms of the player's health\n this.width = health * 5;\n }",
"addGroup() {\n let name = this.state.groupName\n if (name === \"\") return\n this.setState(prevState => ({\n groupName: \"\",\n groups: [...prevState.groups, {\n name,\n population: 200\n }],\n grid: [\n ...this.addToPrev(prevState.grid, prevState.groups.length + 1),\n Array.apply(null, Array(prevState.groups.length + 1)).map(function () { return { value: 0 } })\n ]\n }))\n\n console.log(this.state.grid)\n }",
"makeObjPool () {\n\t\t// Runs update method for objects within this group\n\t\tthis.alienG = this.physics.add.group({classType: Alien, runChildUpdate: true});\n\t\tthis.alienB = this.physics.add.group({classType: AlienB, runChildUpdate: true});\n\t\tthis.alienR = this.physics.add.group({classType: AlienR, runChildUpdate: true});\n\t\tthis.boss = this.physics.add.group({classType: Boss, runChildUpdate: true});\n\n\t\t// Tower group\n\t\tthis.towerW = this.add.group({classType: WoodTower, runChildUpdate: true});\n\t\tthis.towerSC = this.add.group({classType: SCTower, runChildUpdate: true});\n\t\tthis.towerF = this.add.group({classType: FlameTower, runChildUpdate: true});\n\n\t\t// Projectile group\n\t\tthis.projectileW = this.physics.add.group({classType: WoodProjectile, runChildUpdate: true});\n\t\tthis.projectileSC = this.physics.add.group({classType: scProjectile, runChildUpdate: true});\n\t\tthis.projectileF = this.physics.add.group({classType: fProjectile, runChildUpdate: true});\n\t\t\n\t\t// Check for colission (Wood projectile)\n\t\tthis.physics.add.overlap(this.alienG, this.projectileW, this.takeDmg.bind(this));\n\t\tthis.physics.add.overlap(this.alienB, this.projectileW, this.takeDmg.bind(this));\n\t\tthis.physics.add.overlap(this.alienR, this.projectileW, this.takeDmg.bind(this));\n\t\tthis.physics.add.overlap(this.boss, this.projectileW, this.takeDmg.bind(this));\n\n\t\t// Check for colission (SC projectile)\n\t\tthis.physics.add.overlap(this.alienG, this.projectileSC, this.takeDmg.bind(this));\n\t\tthis.physics.add.overlap(this.alienB, this.projectileSC, this.takeDmg.bind(this));\n\t\tthis.physics.add.overlap(this.alienR, this.projectileSC, this.takeDmg.bind(this));\n\t\tthis.physics.add.overlap(this.boss, this.projectileSC, this.takeDmg.bind(this));\n\t\t\n\t\t// Check for colission (Flame projectile)\n\t\tthis.physics.add.overlap(this.alienG, this.projectileF, this.takeDmg.bind(this));\n\t\tthis.physics.add.overlap(this.alienB, this.projectileF, this.takeDmg.bind(this));\n\t\tthis.physics.add.overlap(this.alienR, this.projectileF, this.takeDmg.bind(this));\n\t\tthis.physics.add.overlap(this.boss, this.projectileF, this.takeDmg.bind(this));\n\n\t\t// Listen for player click and runs buildTower\n\t\tthis.input.on('pointerdown', this.buildTower.bind(this));\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Extra check whether it's valid assignment target | _checkValidAssignmentTarget(node) {
if (node.type === "Identifier" || node.type === "MemberExpression") {
return node;
}
throw new SyntaxError("Invalid left-hand side in assignment expression");
} | [
"_isAssignmentOperator(tokenType) {\n return tokenType === \"SIMPLE_ASSIGN\" || tokenType === \"COMPLEX_ASSIGN\";\n }",
"function analyze_assignment(stmt) {\n const name = assignment_name(stmt);\n const value_func = analyze(assignment_value(stmt));\n\n return (env, succeed, fail) => {\n value_func(env,\n (value, fail2) => {\n const old_value = lookup_name_value(name, env);\n assign_name_value(name, value, env);\n succeed(\"assignment ok\",\n () => {\n assign_name_value(name, old_value, env);\n fail2();\n });\n },\n fail);\n };\n}",
"function isUnsafeAssignment(type, receiver, checker, senderNode) {\n var _a, _b;\n if ((0, predicates_1.isTypeAnyType)(type)) {\n // Allow assignment of any ==> unknown.\n if ((0, predicates_1.isTypeUnknownType)(receiver)) {\n return false;\n }\n if (!(0, predicates_1.isTypeAnyType)(receiver)) {\n return { sender: type, receiver };\n }\n }\n if ((0, tsutils_1.isTypeReference)(type) && (0, tsutils_1.isTypeReference)(receiver)) {\n // TODO - figure out how to handle cases like this,\n // where the types are assignable, but not the same type\n /*\n function foo(): ReadonlySet<number> { return new Set<any>(); }\n \n // and\n \n type Test<T> = { prop: T }\n type Test2 = { prop: string }\n declare const a: Test<any>;\n const b: Test2 = a;\n */\n if (type.target !== receiver.target) {\n // if the type references are different, assume safe, as we won't know how to compare the two types\n // the generic positions might not be equivalent for both types\n return false;\n }\n if ((senderNode === null || senderNode === void 0 ? void 0 : senderNode.type) === utils_1.AST_NODE_TYPES.NewExpression &&\n senderNode.callee.type === utils_1.AST_NODE_TYPES.Identifier &&\n senderNode.callee.name === 'Map' &&\n senderNode.arguments.length === 0 &&\n senderNode.typeParameters == null) {\n // special case to handle `new Map()`\n // unfortunately Map's default empty constructor is typed to return `Map<any, any>` :(\n // https://github.com/typescript-eslint/typescript-eslint/issues/2109#issuecomment-634144396\n return false;\n }\n const typeArguments = (_a = type.typeArguments) !== null && _a !== void 0 ? _a : [];\n const receiverTypeArguments = (_b = receiver.typeArguments) !== null && _b !== void 0 ? _b : [];\n for (let i = 0; i < typeArguments.length; i += 1) {\n const arg = typeArguments[i];\n const receiverArg = receiverTypeArguments[i];\n const unsafe = isUnsafeAssignment(arg, receiverArg, checker, senderNode);\n if (unsafe) {\n return { sender: type, receiver };\n }\n }\n return false;\n }\n return false;\n}",
"isAssignableTo(expression, type) {\n let expressionType =\n expression.constructor === VariableExpression\n ? expression.ref.type\n : expression.type;\n let targetType = type;\n doCheck(\n this.typesAreEquivalent(expressionType, targetType),\n `Expression of type ${util.format(\n expressionType\n )} not assignable to variable/param/field of type ${util.format(\n targetType\n )}`\n );\n }",
"check(target) {\n const targetType = typeof target;\n assert('string' === targetType, 'Type error, target should be a string, ' +\n `${targetType} given`);\n }",
"AssignmentExpression() {\n const left = this.LogicalORExpression();\n\n if (!this._isAssignmentOperator(this._lookahead.type)) {\n return left;\n }\n\n return {\n type: \"AssignmentExpression\",\n operator: this.AssignmentOperator().value,\n left: this._checkValidAssignmentTarget(left),\n right: this.AssignmentExpression(),\n };\n }",
"isNotReadOnly(lvalue) {\n doCheck(!lvalue.isReadOnly, \"Assignment to read-only variable\");\n }",
"AssignmentOperator() {\n if (this._lookahead.type === \"SIMPLE_ASSIGN\") {\n return this._eat(\"SIMPLE_ASSIGN\");\n }\n return this._eat(\"COMPLEX_ASSIGN\");\n }",
"visitAssignment_statement(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"function needTarget(effect,other_data){\n return (!other_data.isLS && !other_data.sp && (effect['passive target'] !== undefined && effect['passive target'] !== 'self'));\n }",
"verifyDelaySlot() {\n if (this.delaySlot) {\n this.pushError(\"Cannot have a jump/branch instruction in delay slot! [line \" + this.line + \"]. Ignoring jump/branch in delay slot.\");\n return true;\n }\n return false;\n }",
"function isKeepAssigned(o) {\n return keepAssignedPrototype.isPrototypeOf(o);\n}",
"onTargetAssigned(target) {}",
"assertTransitionLegal(allowedState, transitionTo) {\n if (!(this.state === allowedState)) {\n throw new Error(`Assertion failure: cannot transition from ${TraitState[this.state]} to ${TraitState[transitionTo]}.`);\n }\n }",
"_add_assignment_statement_subtree_to_ast(cst_current_node) {\n var _a;\n this.verbose[this.verbose.length - 1].push(new NightingaleCompiler.OutputConsoleMessage(SEMANTIC_ANALYSIS, INFO, `Adding assignment statement subtree to abstract syntax tree.`) // OutputConsoleMessage\n ); // this.verbose[this.verbose.length - 1].push\n let identifier_node = cst_current_node.children_nodes[0].children_nodes[0];\n // Check scope tree if the variable exists and get its type\n let error = true;\n let var_matadata = this.is_variable_declared(identifier_node);\n if (var_matadata !== null) {\n var_matadata.isInitialized = true;\n error = false;\n } // if\n // Add root Node(Assignment Statement) for asignment statement subtree\n this._current_ast.add_node(cst_current_node.name, NODE_TYPE_BRANCH, error, false);\n // Add the identifier to assignment statement subtree\n this._current_ast.add_node(identifier_node.name, NODE_TYPE_LEAF, error, false, cst_current_node.getToken());\n // Ignore the assignment operator: Node(=)\n // let assignment_op = cst_current_node.children_nodes[1]\n // Add the expression node to assignment statement subtree at the SAME LEVEL\n let expression_node = cst_current_node.children_nodes[2];\n // I've used null-aware operators in Dart, apparently Typescript has them too, damn...\n this._add_expression_subtree(expression_node, (_a = var_matadata === null || var_matadata === void 0 ? void 0 : var_matadata.type) !== null && _a !== void 0 ? _a : UNDEFINED);\n }",
"function evaluate_assignment(stmt,env) {\n var value = evaluate(assignment_value(stmt),env);\n set_variable_value(variable_name(assignment_variable(stmt)),\n value,\n env);\n return value;\n}",
"hasDuplicatedTargets () {\n return this.targets.some((target, position) => {\n return this.targets.indexOf(target) !== position;\n })\n }",
"function validateRetreat (data, command) {\n var invalidMsg = 'Invalid Command - (' + command.member.displayName() + ' RETREAT): ';\n var member_group = battleHelpers.groupType(command.member);\n var target_group = battleHelpers.groupType(command.target);\n\n if (member_group !== target_group) {\n throw new Error(invalidMsg + 'target must be in the ' + member_group + ' group.');\n } else if (command.member.group_index !== command.target.group_index) {\n throw new Error(invalidMsg + 'target must come from the same group formation.');\n } else {\n return true;\n }\n }",
"function checkExpressionAnalysisMode(node) {\n return t.ifStatement(markMemberToNotBeRewritten(t.memberExpression(nonRewritableIdentifier('self'), nonRewritableIdentifier('__expressionAnalysisMode__'))), t.expressionStatement(node\n // ,t.unaryExpression(\"void\", t.numericLiteral(0), true)\n ));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
==== Marketplace Members Controller | function marketMembersCtrl ($scope, $stateParams, memberData, requests, roleData, orgScreenModel,
EVENTS, memberHelper, memberService) {
$scope.addMember = addMember;
$scope.members = memberData;
$scope.pendingRequests = requests;
$scope.roles = roleData;
$scope.orgScreenModel = orgScreenModel;
orgScreenModel.updateTab('Members');
orgScreenModel.getOrgDataForId(orgScreenModel, $stateParams.orgId);
$scope.$on(EVENTS.MEMBER_LIST_UPDATED, function () {
memberService.getMembersForOrg($scope.orgId).then(function (members) {
$scope.members = members;
})
});
function addMember() {
memberHelper.addMember(orgScreenModel.organization, $scope.roles);
}
} | [
"static async view(ctx) {\n // team details\n const team = await Team.get(ctx.params.id);\n if (!team) ctx.throw(404, 'Team not found');\n\n // team members\n const sql = `Select TeamMemberId, MemberId, Firstname, Lastname\n From Member Inner Join TeamMember Using (MemberId)\n Where TeamId = :id`;\n const [ members ] = await Db.query(sql, { id: ctx.params.id });\n\n const context = team;\n context.members = members;\n await ctx.render('teams-view', context);\n }",
"function marketController() {}",
"function getMemberId() {\n return $routeParams.memberId ? $routeParams.memberId : 'me';\n }",
"function updateMemberList() {\n people_list = RTMchannel.getMembers().toString(); // gets list of channel members\n document.getElementById(\"people_list\").innerHTML = \"<u>People</u>: \" + people_list.toString();\n}",
"isMember(state) {\n return state.oauth.user !== null && ['board', 'member'].indexOf(state.oauth.user.level) !== -1;\n }",
"async members(opts) {\n opts = utils.normalizeKeys(opts);\n opts = utils.defaults(opts, this.consul._defaults);\n\n const req = {\n name: \"agent.members\",\n path: \"/agent/members\",\n query: {},\n };\n\n utils.options(req, opts);\n\n return await this.consul._get(req, utils.body);\n }",
"async show({ params: { companyId, purchaseId }, request, response, view }) {\n //const user = await auth.getUser()\n const purchase = await Purchase.find(purchaseId);\n\n //AuthorizationService.verifyPermission(company, user)\n\n response.status(200).json({\n data: purchase,\n });\n }",
"urlForLeaving() {\n return `/settings/${Spark.teamsPrefix}/${this.leavingTeam.id}/members/${this.user.id}`;\n }",
"function gettingJasonMembersObj(event) {\n const savedMembers = JSON.parse(event.target.responseText);\n appData.members = savedMembers.members\n jsonsState.push('true');\n addLabelColors();\n //checking only two since i have only 2 AJAX calls\n checkIfCanLoadPage();\n // firstLoad();\n\n //\n // firstLoad();\n // for (const member of appData.members) {\n\n // createMemberList(member.name);\n //\n // }\n}",
"function getAllMemberLoans () {\n MemberService.getAllMemberLoans().then(function (data) {\n $scope.memberLoans.successCB(data);\n }, function (error) {\n $scope.memberLoans.errorCB(error);\n });\n }",
"function listUsersView(targetid, users){\n apply_template(targetid, \"users-list-template\", {'users': users});\n}",
"function MemberDirectoryListCtrl($filter, $http) {\n\n return function($scope, $element, $attrs) {\n angular.extend($scope, {\n reset: reset,\n pageSize: 20,\n currentPage: 0,\n numberOfPages: 1\n });\n\n activate();\n\n function activate() {\n getMembers();\n reset();\n }\n\n function calcNumberPages() {\n $scope.currentPage = 0;\n $scope.numberOfPages = Math.ceil($filter(\"filter\")($filter(\"filter\")($scope.members, $scope.searchText), $scope.searchObj).length / $scope.pageSize);\n $scope.pages = new Array($scope.numberOfPages);\n }\n\n function reset() {\n $scope.searchText = \"\";\n $scope.searchObj = {\n member_type: $scope.memberType || \"\",\n organization: $scope.organization || \"\",\n organization_address_city: \"\",\n organization_address_state: \"\"\n };\n }\n\n function getMembers() {\n return $http.get(\"/wp-content/plugins/plantbasedfoods-member-directory/members.json\").then(function(r) {\n\n $scope.members = r.data.filter(function(m) {\n if (!$scope.memberType) {\n return true;\n }\n return $scope.memberType == m.member_type;\n }).map(function(m) {\n angular.forEach([\"organization_address_city\", \"organization_address_state\", \"website_url\"], function(k) {\n if (\"undefined\" === typeof m[k]) {\n m[k] = \"\";\n }\n });\n return m;\n });\n\n // Create a de-duped list of organizations\n $scope.organizations = $scope.members.filter(function(m) {\n return !$scope.memberType || m.member_type == $scope.memberType;\n }).map(function(m) {\n return m.organization;\n }).filter(function(org, index, members) {\n return org && members.indexOf(org) == index;\n });\n\n // Create a de-duped list of member types\n $scope.memberTypes = $scope.members.filter(function(m) {\n return !$scope.memberType || m.member_type == $scope.memberType;\n }).map(function(m) {\n return m.member_type;\n }).filter(function(type, index, types) {\n return type && types.indexOf(type) == index;\n });\n\n $scope.states = $scope.members.filter(function(m) {\n return !$scope.memberType || m.member_type == $scope.memberType;\n }).map(function(m) {\n return m.organization_address_state;\n }).filter(function(type, index, types) {\n return type && types.indexOf(type) == index;\n }).sort();\n\n initWatchers();\n\n });\n }\n\n var watching = false;\n function initWatchers() {\n if (watching) {\n return;\n }\n watching = true;\n $scope.$watch(\"searchObj\", calcNumberPages, true);\n $scope.$watch(\"searchText\", calcNumberPages);\n $scope.$watch(\"members\", calcNumberPages);\n $scope.$watch(\"searchObj.organization_address_state\", function(val) {\n $scope.searchObj.organization_address_city = \"\";\n $scope.cities = $scope.members.filter(function(m) {\n if (!val) {\n return true;\n }\n return m.organization_address_state == val;\n }).map(function(m) {\n return m.organization_address_city;\n }).filter(function(type, index, types) {\n return type && types.indexOf(type) == index;\n }).sort();\n });\n }\n\n\n }\n}",
"function processAddMemberForm(data)\n{\n var member_index = memberIndex(data);\n insertMember(data, member_index);\n}",
"static async processEdit(ctx) {\n if (ctx.state.auth.user.Role != 'admin') {\n ctx.flash = { _error: 'Team management requires admin privileges' };\n return ctx.response.redirect('/login'+ctx.request.url);\n }\n\n const body = ctx.request.body;\n\n // update team details\n if ('Name' in body) {\n try {\n\n const validation = { // back-end validation matching HTML5 validation\n Name: 'required',\n };\n\n if (validationErrors(body, validation)) {\n throw new Error(validationErrors(body, validation));\n }\n\n await Team.update(ctx.params.id, body);\n\n // return to list of members\n ctx.response.redirect('/teams');\n\n } catch (e) {\n // stay on same page to report error (with current filled fields)\n ctx.flash = { formdata: body, _error: e.message };\n ctx.response.redirect(ctx.request.url);\n }\n }\n\n // add member to team\n if ('add-member' in body) {\n const values = {\n TeamId: ctx.params.id,\n MemberId: body['add-member'],\n JoinedOn: new Date().toISOString().replace('T', ' ').split('.')[0],\n };\n\n try {\n\n const id = await TeamMember.insert(values);\n ctx.response.set('X-Insert-Id', id); // for integration tests\n\n // stay on same page showing new team member\n ctx.response.redirect(ctx.request.url);\n\n } catch (e) {\n // stay on same page to report error\n ctx.flash = { formdata: body, _error: e.message };\n ctx.response.redirect(ctx.request.url);\n }\n }\n\n // remove member from team\n if ('del-member' in body) {\n try {\n\n await TeamMember.delete(body['del-member']);\n // stay on same page showing new members list\n ctx.response.redirect(ctx.request.url);\n\n } catch (e) {\n // stay on same page to report error\n ctx.flash = { _error: e.message };\n ctx.response.redirect(ctx.request.url);\n }\n }\n }",
"function ProjectsController($scope, $route) {\n var vm = this;\n \n // api.getRestaurants()\n // .then(function(data) {\n // vm.profile = data;\n // });\n }",
"function getMember() {\n var matchMin = getMin();\n var getMember;\n for (var y = 0; y < store.length; y++) {\n if (store[y].actProjects == matchMin) {\n getMember = store[y].member;\n }\n }\n if (DEBUG) {\n wom.log(DEBUG_PREFIX + \"Got member... \" + getMember.lastName);\n }\n return getMember;\n }",
"function displayAddOwner(){\n getToken().then((token) => {\n var params = window.location.search + \"&idToken=\" + token;\n\n const displayRequest = new Request(\"/get-role\" + params, {method: \"GET\"});\n fetch(displayRequest).then(response => response.json()).then((role) => {\n var elem = document.getElementById(\"ownerForm\");\n if (role === \"owner\"){\n elem.style.display = \"inline-block\";\n }\n });\n });\n}",
"function fnsviewpermissiondetails() {\r\n\t\t$http.get('http://localhost:1337/viewpermissions').success(function (data) {\r\n\t\t\t$scope.userrelationcollection = data;\r\n\t\t});\r\n\t}",
"function showList() {\n $state.go('customer.list');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
=========================================================================== Compute the optimal bit lengths for a tree and update the total bit length for the current block. IN assertion: the fields freq and dad are set, heap[heap_max] and above are the tree nodes sorted by increasing frequency. OUT assertions: the field len is set to the optimal bit length, the array bl_count contains the frequencies for each bit length. The length opt_len is updated; static_len is also updated if stree is not null. | function gen_bitlen(s, desc)
// deflate_state *s;
// tree_desc *desc; /* the tree descriptor */
{
var tree = desc.dyn_tree;
var max_code = desc.max_code;
var stree = desc.stat_desc.static_tree;
var has_stree = desc.stat_desc.has_stree;
var extra = desc.stat_desc.extra_bits;
var base = desc.stat_desc.extra_base;
var max_length = desc.stat_desc.max_length;
var h; /* heap index */
var n, m; /* iterate over the tree elements */
var bits; /* bit length */
var xbits; /* extra bits */
var f; /* frequency */
var overflow = 0; /* number of elements with bit length too large */
for (bits = 0; bits <= MAX_BITS; bits++) {
s.bl_count[bits] = 0;
}
/* In a first pass, compute the optimal bit lengths (which may
* overflow in the case of the bit length tree).
*/
tree[s.heap[s.heap_max] * 2 + 1] /*.Len*/ = 0; /* root of the heap */
for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {
n = s.heap[h];
bits = tree[tree[n * 2 + 1] /*.Dad*/ * 2 + 1] /*.Len*/ + 1;
if (bits > max_length) {
bits = max_length;
overflow++;
}
tree[n * 2 + 1] /*.Len*/ = bits;
/* We overwrite tree[n].Dad which is no longer needed */
if (n > max_code) {
continue;
} /* not a leaf node */
s.bl_count[bits]++;
xbits = 0;
if (n >= base) {
xbits = extra[n - base];
}
f = tree[n * 2] /*.Freq*/;
s.opt_len += f * (bits + xbits);
if (has_stree) {
s.static_len += f * (stree[n * 2 + 1] /*.Len*/ + xbits);
}
}
if (overflow === 0) {
return;
}
// Trace((stderr,"\nbit length overflow\n"));
/* This happens for example on obj2 and pic of the Calgary corpus */
/* Find the first bit length which could increase: */
do {
bits = max_length - 1;
while (s.bl_count[bits] === 0) {
bits--;
}
s.bl_count[bits]--; /* move one leaf down the tree */
s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */
s.bl_count[max_length]--;
/* The brother of the overflow item also moves one step up,
* but this does not affect bl_count[max_length]
*/
overflow -= 2;
} while (overflow > 0);
/* Now recompute all bit lengths, scanning in increasing frequency.
* h is still equal to HEAP_SIZE. (It is simpler to reconstruct all
* lengths instead of fixing only the wrong ones. This idea is taken
* from 'ar' written by Haruhiko Okumura.)
*/
for (bits = max_length; bits !== 0; bits--) {
n = s.bl_count[bits];
while (n !== 0) {
m = s.heap[--h];
if (m > max_code) {
continue;
}
if (tree[m * 2 + 1] /*.Len*/ !== bits) {
// Trace((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits));
s.opt_len += (bits - tree[m * 2 + 1] /*.Len*/) * tree[m * 2] /*.Freq*/;
tree[m * 2 + 1] /*.Len*/ = bits;
}
n--;
}
}
} | [
"function $fb1c7bd82eb4c0c48c74268ddc57b$var$NextTableBitSize(count, len, root_bits) {\n var left = 1 << len - root_bits;\n\n while (len < $fb1c7bd82eb4c0c48c74268ddc57b$var$MAX_LENGTH) {\n left -= count[len];\n if (left <= 0) break;\n ++len;\n left <<= 1;\n }\n\n return len - root_bits;\n }",
"calculateTreeWidth() {\n let leftSubtreeWidth = nodeSize + 2 * nodePadding;\n let rightSubtreeWidth = leftSubtreeWidth;\n if (this.left != null) {\n leftSubtreeWidth = this.left.calculateTreeWidth();\n }\n if (this.right != null) {\n rightSubtreeWidth = this.right.calculateTreeWidth();\n }\n this.width = leftSubtreeWidth + rightSubtreeWidth;\n return this.width;\n }",
"get maxHeight() {\n\t\tlet maxHeight = 0, height;\n\n\t\tfor (let i = 0; i < this.count; i++) {\n\t\t\tif (this.cache[i]) {\n\t\t\t\theight = this.cache[i];\n\t\t\t} else {\n\t\t\t\theight = this.traverse(i);\n\t\t\t\t\n\t\t\t\tthis.cache[i] = height;\n\t\t\t\tthis.cache[this.tree[i]] = height - 1;\n\t\t\t}\n\n\t\t\tmaxHeight = Math.max(maxHeight, height);\n\t\t}\n\n\t\treturn maxHeight;\n\t}",
"function top2Optimization(){\n for (var i=0;i<5;i++){\n checkChange(1,0,function(){\n adjustTree(arrIndexMap[1],hierarchy_array[0])\n })\n checkChange(0,1,function(){\n adjustTree(arrIndexMap[0],hierarchy_array[1])\n })\n }\n }",
"computeNodeBytes() {\n return sizeof(this.value) + 160;\n }",
"function computeLaneSize(lane) {\n\t\t // assert(lane instanceof go.Group && lane.category !== \"Pool\");\n\t\t var sz = computeMinLaneSize(lane);\n\t\t if (lane.isSubGraphExpanded) {\n\t\t var holder = lane.placeholder;\n\t\t if (holder !== null) {\n\t\t var hsz = holder.actualBounds;\n\t\t sz.height = Math.max(sz.height, hsz.height);\n\t\t }\n\t\t }\n\t\t // minimum breadth needs to be big enough to hold the header\n\t\t var hdr = lane.findObject(\"HEADER\");\n\t\t if (hdr !== null) sz.height = Math.max(sz.height, hdr.actualBounds.height);\n\t\t return sz;\n\t\t}",
"function computeNodeBreadths() {\n var remainingNodes = nodes,\n nextNodes,\n x = 0;\n\n while (remainingNodes.length) {\n nextNodes = [];\n remainingNodes.forEach(function(node) {\n node.x = x;\n node.dx = nodeWidth;\n node.sourceLinks.forEach(function(link) {\n if (nextNodes.indexOf(link.target) < 0) {\n nextNodes.push(link.target);\n }\n });\n });\n remainingNodes = nextNodes;\n ++x;\n }\n\n //\n moveSinksRight(x);\n scaleNodeBreadths((size[0] - nodeWidth) / (x - 1));\n }",
"max() {\n for(let i = this.array.length - 1; i >= 0; i--){\n const bits = this.array[i];\n if (bits) {\n return BitSet.highBit(bits) + i * bitsPerWord;\n }\n }\n return 0;\n }",
"function calculateHeavy(node) {\n let rh, lh; // heights of left and right tree\n if (node.left === undefined || node.left === null) {\n lh = -1;\n }\n else {\n lh = node.left.height;\n }\n\n if (node.right == undefined || node.right == null) {\n rh = -1;\n }\n else {\n rh = node.right.height;\n }\n\n let diff = rh - lh; // Difference in height\n let heavy;\n if (diff >= -1 && diff <= 1) {\n heavy = \"neutral\";\n } else if (rh > lh) {\n heavy = \"right\";\n }\n else {\n heavy = \"left\";\n }\n return heavy;\n}",
"function calcCmdLength(obj, callback) {\n\tvar cmdLength = 16, // All commands are at least 16 octets long\n\t err,\n\t param,\n\t paramType,\n\t tlvValue,\n\t tlvName,\n\t tlvDef;\n\n\t// Handle params - All command params should always exists, even if they do not contain data.\n\tfor (param in defs.cmds[obj.cmdName].params) {\n\n\t\t// Get the parameter type, int, string, cstring etc.\n\t\t// This is needed so we can calculate length etc\n\t\tparamType = defs.cmds[obj.cmdName].params[param].type;\n\n\t\tif (obj.params[param] === undefined) {\n\t\t\tobj.params[param] = paramType.default;\n\t\t}\n\n\t\tif (isNaN(paramType.size(obj.params[param]))) {\n\t\t\terr = new Error('Invalid param value \"' + obj.params[param] + '\" for param \"' + param + '\" and command \"' + obj.cmdName + '\". Is it of the right type?');\n\t\t\tlog.error('larvitsmpp: lib/utils.js: calcCmdLength() - ' + err.message);\n\t\t\tcallback(err);\n\t\t\treturn;\n\t\t}\n\n\t\tcmdLength += paramType.size(obj.params[param]);\n\t}\n\n\t// TLV params - optional parameters\n\tfor (tlvName in obj.tlvs) {\n\t\ttlvValue = obj.tlvs[tlvName].tagValue;\n\t\ttlvDef = defs.tlvsById[obj.tlvs[tlvName].tagId];\n\n\t\tif (tlvDef === undefined) {\n\t\t\ttlvDef = defs.tlvs.default;\n\t\t}\n\n\t\ttry {\n\t\t\tcmdLength += tlvDef.type.size(tlvValue) + 4;\n\t\t} catch(e) {\n\t\t\terr = new Error('Could not get size of TLV parameter \"' + tlvName + '\" with value \"' + tlvValue + '\"');\n\t\t\tlog.error('larvitsmpp: lib/utils.js: calcCmdLength() - ' + err.message);\n\t\t\tcallback(err);\n\t\t\treturn;\n\t\t}\n\t}\n\n\tcallback(null, cmdLength);\n}",
"function fillupTripCountTreeNode(tripCountNode) {\n if (Object.entries(tripCountNode['children']) == 0)\n return;\n let tripCount = tripCountNode.trip_count;\n for (let childID in tripCountNode['children']) {\n // For every subloop, make sure there are enough trip count nodes\n if (parseInt(tripCountNode['children'][childID].length) < tripCount) {\n let savedLength = tripCountNode['children'][childID].length;\n let lastTCNode = tripCountNode['children'][childID][savedLength - 1];\n for (let i = savedLength; i < tripCount; i++) {\n tripCountNode['children'][childID].push(lastTCNode); // A bunch of references should be fine...?\n }\n }\n else if (parseInt(tripCountNode['children'][childID].length) > tripCount) {\n let savedLength = tripCountNode['children'][childID].length;\n for (let i = tripCount; i < savedLength; i++) {\n tripCountNode['children'][childID].pop(); // Remove last element\n }\n } // Do nothing if they're equal \n }\n for (let childID in tripCountNode['children']) {\n for (let i = 0; i < tripCount; i++) {\n fillupTripCountTreeNode(tripCountNode['children'][childID][i]);\n }\n }\n}",
"function computeMinLaneSize(lane) {\n\t\t if (!lane.isSubGraphExpanded) return new go.Size(MINLENGTH, 1);\n\t\t return new go.Size(MINLENGTH, MINBREADTH);\n\t\t}",
"balance(maxBufferLength = DefaultBufferLength) {\n return this.children.length <= BalanceBranchFactor ? this\n : balanceRange(this.type, NodeType.none, this.children, this.positions, 0, this.children.length, 0, maxBufferLength, this.length);\n }",
"function initializeMegaMenuHeight(currentStatus){\n currentStatus.heights=[]\n max=0;\n //console.log(\"before : \"+currentStatus.heights);\n $(\".data-depth-0>li.selected\").children(\".ul-reset\").each(function() {\n if(max<$(this).find(\".ul-reset\").height()){\n max = $(this).find(\".ul-reset\").height();\n }\n});\n currentStatus.heights.push($(\".data-depth-0>li.selected\").children(\".ul-reset\").height());\n $(\".data-depth-0\").height(currentStatus.heights[currentStatus.heights.length-1]+20);\n //console.log(\"after : \"+currentStatus.heights);\n}",
"function initFilters(N,E,mbuffer,T,K,Z,Y, mfilter_bits,P,leveltier, isOptimalFPR) {\n\n var filter_array = [];\n var remainingKeys=N-mbuffer/E;\n var level=0;\n //Calculate the number of keys per level in a almost-full in each level LSM tree\n while (remainingKeys>0)\n {\n level++;\n var levelKeys=Math.ceil(Math.min(Math.pow(T,level)*mbuffer/E,N));\n var newFilter = new Filter();\n newFilter.nokeys=levelKeys;\n newFilter.fp=0.0;\n // console.log(\"New remaining keys: \"+(remainingKeys-levelKeys))\n if (remainingKeys-levelKeys<0)\n newFilter.nokeys=remainingKeys;\n //console.log(newFilter.nokeys)\n filter_array.push(newFilter);\n remainingKeys=remainingKeys-levelKeys;\n // console.log(levelKeys)\n }\n\t\tvar mem_level = filter_array.length - Y;\n\t\tfor (var i=0;i<mem_level;i++)\n\t\t{\n\t\t\t\tfilter_array[i].mem=mfilter_bits/mem_level;\n\t\t}\n\t\tfor (var i=mem_level;i<filter_array.length;i++){\n\t\t\tfilter_array[i].mem= 0;\n\t\t}\n/*\n //Initialize the memory per level to be equal\n\t\tif(!isOptimalFPR){\n\t\t\tfor (var i=0;i<filter_array.length;i++)\n\t {\n\t filter_array[i].mem=mfilter_bits/filter_array.length;\n\t }\n\t return filter_array;\n\t\t}else{\n\t\t\tvar EULER = 2.71828182845904523536;\n\t\t\tvar C = Math.pow(Math.log(2), 2);\n\t\t\tvar L = filter_array.length;\n\t\t\tvar X = 1.0/C*(Math.log(T/(T - 1)) + Math.log(K/Z)/T)\n\t\t\tvar Y = Math.ceil(Math.log(N*X/mfilter_bits)/Math.log(T))\n\t\t\tif(Y > 0){\n\t\t\t\tL -= Y;\n\t\t\t}\n\t\t\tvar tmp = 0;\n\t\t\tfor(var i=1;i<=L;i++){\n\t\t\t\tif(i == L){\n\t\t\t\t\ttmp += Z*filter_array[i-1].nokeys*Math.log(Z);\n\t\t\t\t}else{\n\t\t\t\t\ttmp += K*filter_array[i-1].nokeys*Math.log(K*Math.pow(T, L - i));\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar t = Math.pow(EULER, (tmp - mfilter_bits*C)/N);\n\t\t\tvar equal_flag = false;\n\t\t\tvar eqaul_mem = 0;\n\t\t\tvar left_levels = 1;\n\t\t\tfor(var i=1;i<=L;i++){\n\t\t\t\tvar fpr_i;\n\t\t\t\tvar runs;\n\t\t\t\tif(equal_flag){\n\t\t\t\t\tfilter_array[i-1].mem = eqaul_mem;\n\t\t\t\t}else{\n\t\t\t\t\tif(i==L){\n\t\t\t\t\t\tfpr_i = Math.max(mfilter_bits, 0);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tfpr_i = t/K/Math.pow(T, L-i);\n\t\t\t\t\t}\n\t\t\t\t\tif(fpr_i > 1){\n\t\t\t\t\t\tequal_flag = true;\n\t\t\t\t\t\tleft_levels = L - i + 1;\n\t\t\t\t\t\teqaul_mem = mfilter_bits/left_levels;\n\t\t\t\t\t\tfilter_array[i-1].mem = eqaul_mem;\n\t\t\t\t\t}else{\n\t\t\t\t\t\tfilter_array[i-1].mem=-filter_array[i-1].nokeys*Math.log(fpr_i)/C;\n\t\t\t\t\t\tmfilter_bits -= filter_array[i-1].mem;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t}*/\n\n\t\treturn filter_array;\n}",
"function binb(x, len) {\n var j, i, l,\n W = new Array(80),\n hash = new Array(16),\n //Initial hash values\n H = [\n new int64(0x6a09e667, -205731576),\n new int64(-1150833019, -2067093701),\n new int64(0x3c6ef372, -23791573),\n new int64(-1521486534, 0x5f1d36f1),\n new int64(0x510e527f, -1377402159),\n new int64(-1694144372, 0x2b3e6c1f),\n new int64(0x1f83d9ab, -79577749),\n new int64(0x5be0cd19, 0x137e2179)\n ],\n T1 = new int64(0, 0),\n T2 = new int64(0, 0),\n a = new int64(0, 0),\n b = new int64(0, 0),\n c = new int64(0, 0),\n d = new int64(0, 0),\n e = new int64(0, 0),\n f = new int64(0, 0),\n g = new int64(0, 0),\n h = new int64(0, 0),\n //Temporary variables not specified by the document\n s0 = new int64(0, 0),\n s1 = new int64(0, 0),\n Ch = new int64(0, 0),\n Maj = new int64(0, 0),\n r1 = new int64(0, 0),\n r2 = new int64(0, 0),\n r3 = new int64(0, 0);\n\n if (sha512_k === undefined) {\n //SHA512 constants\n sha512_k = [\n new int64(0x428a2f98, -685199838), new int64(0x71374491, 0x23ef65cd),\n new int64(-1245643825, -330482897), new int64(-373957723, -2121671748),\n new int64(0x3956c25b, -213338824), new int64(0x59f111f1, -1241133031),\n new int64(-1841331548, -1357295717), new int64(-1424204075, -630357736),\n new int64(-670586216, -1560083902), new int64(0x12835b01, 0x45706fbe),\n new int64(0x243185be, 0x4ee4b28c), new int64(0x550c7dc3, -704662302),\n new int64(0x72be5d74, -226784913), new int64(-2132889090, 0x3b1696b1),\n new int64(-1680079193, 0x25c71235), new int64(-1046744716, -815192428),\n new int64(-459576895, -1628353838), new int64(-272742522, 0x384f25e3),\n new int64(0xfc19dc6, -1953704523), new int64(0x240ca1cc, 0x77ac9c65),\n new int64(0x2de92c6f, 0x592b0275), new int64(0x4a7484aa, 0x6ea6e483),\n new int64(0x5cb0a9dc, -1119749164), new int64(0x76f988da, -2096016459),\n new int64(-1740746414, -295247957), new int64(-1473132947, 0x2db43210),\n new int64(-1341970488, -1728372417), new int64(-1084653625, -1091629340),\n new int64(-958395405, 0x3da88fc2), new int64(-710438585, -1828018395),\n new int64(0x6ca6351, -536640913), new int64(0x14292967, 0xa0e6e70),\n new int64(0x27b70a85, 0x46d22ffc), new int64(0x2e1b2138, 0x5c26c926),\n new int64(0x4d2c6dfc, 0x5ac42aed), new int64(0x53380d13, -1651133473),\n new int64(0x650a7354, -1951439906), new int64(0x766a0abb, 0x3c77b2a8),\n new int64(-2117940946, 0x47edaee6), new int64(-1838011259, 0x1482353b),\n new int64(-1564481375, 0x4cf10364), new int64(-1474664885, -1136513023),\n new int64(-1035236496, -789014639), new int64(-949202525, 0x654be30),\n new int64(-778901479, -688958952), new int64(-694614492, 0x5565a910),\n new int64(-200395387, 0x5771202a), new int64(0x106aa070, 0x32bbd1b8),\n new int64(0x19a4c116, -1194143544), new int64(0x1e376c08, 0x5141ab53),\n new int64(0x2748774c, -544281703), new int64(0x34b0bcb5, -509917016),\n new int64(0x391c0cb3, -976659869), new int64(0x4ed8aa4a, -482243893),\n new int64(0x5b9cca4f, 0x7763e373), new int64(0x682e6ff3, -692930397),\n new int64(0x748f82ee, 0x5defb2fc), new int64(0x78a5636f, 0x43172f60),\n new int64(-2067236844, -1578062990), new int64(-1933114872, 0x1a6439ec),\n new int64(-1866530822, 0x23631e28), new int64(-1538233109, -561857047),\n new int64(-1090935817, -1295615723), new int64(-965641998, -479046869),\n new int64(-903397682, -366583396), new int64(-779700025, 0x21c0c207),\n new int64(-354779690, -840897762), new int64(-176337025, -294727304),\n new int64(0x6f067aa, 0x72176fba), new int64(0xa637dc5, -1563912026),\n new int64(0x113f9804, -1090974290), new int64(0x1b710b35, 0x131c471b),\n new int64(0x28db77f5, 0x23047d84), new int64(0x32caab7b, 0x40c72493),\n new int64(0x3c9ebe0a, 0x15c9bebc), new int64(0x431d67c4, -1676669620),\n new int64(0x4cc5d4be, -885112138), new int64(0x597f299c, -60457430),\n new int64(0x5fcb6fab, 0x3ad6faec), new int64(0x6c44198c, 0x4a475817)\n ];\n }\n\n for (i = 0; i < 80; i += 1) {\n W[i] = new int64(0, 0);\n }\n\n // append padding to the source string. The format is described in the FIPS.\n x[len >> 5] |= 0x80 << (24 - (len & 0x1f));\n x[((len + 128 >> 10) << 5) + 31] = len;\n l = x.length;\n for (i = 0; i < l; i += 32) { //32 dwords is the block size\n int64copy(a, H[0]);\n int64copy(b, H[1]);\n int64copy(c, H[2]);\n int64copy(d, H[3]);\n int64copy(e, H[4]);\n int64copy(f, H[5]);\n int64copy(g, H[6]);\n int64copy(h, H[7]);\n\n for (j = 0; j < 16; j += 1) {\n W[j].h = x[i + 2 * j];\n W[j].l = x[i + 2 * j + 1];\n }\n\n for (j = 16; j < 80; j += 1) {\n //sigma1\n int64rrot(r1, W[j - 2], 19);\n int64revrrot(r2, W[j - 2], 29);\n int64shr(r3, W[j - 2], 6);\n s1.l = r1.l ^ r2.l ^ r3.l;\n s1.h = r1.h ^ r2.h ^ r3.h;\n //sigma0\n int64rrot(r1, W[j - 15], 1);\n int64rrot(r2, W[j - 15], 8);\n int64shr(r3, W[j - 15], 7);\n s0.l = r1.l ^ r2.l ^ r3.l;\n s0.h = r1.h ^ r2.h ^ r3.h;\n\n int64add4(W[j], s1, W[j - 7], s0, W[j - 16]);\n }\n\n for (j = 0; j < 80; j += 1) {\n //Ch\n Ch.l = (e.l & f.l) ^ (~e.l & g.l);\n Ch.h = (e.h & f.h) ^ (~e.h & g.h);\n\n //Sigma1\n int64rrot(r1, e, 14);\n int64rrot(r2, e, 18);\n int64revrrot(r3, e, 9);\n s1.l = r1.l ^ r2.l ^ r3.l;\n s1.h = r1.h ^ r2.h ^ r3.h;\n\n //Sigma0\n int64rrot(r1, a, 28);\n int64revrrot(r2, a, 2);\n int64revrrot(r3, a, 7);\n s0.l = r1.l ^ r2.l ^ r3.l;\n s0.h = r1.h ^ r2.h ^ r3.h;\n\n //Maj\n Maj.l = (a.l & b.l) ^ (a.l & c.l) ^ (b.l & c.l);\n Maj.h = (a.h & b.h) ^ (a.h & c.h) ^ (b.h & c.h);\n\n int64add5(T1, h, s1, Ch, sha512_k[j], W[j]);\n int64add(T2, s0, Maj);\n\n int64copy(h, g);\n int64copy(g, f);\n int64copy(f, e);\n int64add(e, d, T1);\n int64copy(d, c);\n int64copy(c, b);\n int64copy(b, a);\n int64add(a, T1, T2);\n }\n int64add(H[0], H[0], a);\n int64add(H[1], H[1], b);\n int64add(H[2], H[2], c);\n int64add(H[3], H[3], d);\n int64add(H[4], H[4], e);\n int64add(H[5], H[5], f);\n int64add(H[6], H[6], g);\n int64add(H[7], H[7], h);\n }\n\n //represent the hash as an array of 32-bit dwords\n for (i = 0; i < 8; i += 1) {\n hash[2 * i] = H[i].h;\n hash[2 * i + 1] = H[i].l;\n }\n return hash;\n }",
"function getSelectorLen(selector) {\n var len = 0\n walk(selector)\n function walk(pattern, complexPattern) {\n pattern.forEach((sel, i, arr) => {\n\n if (i !== 0 && sel.type !== \"Combinator\" && arr[i-1].type !== \"Combinator\" && !complexPattern)\n // first sub selector needs space (+1 len) in complex?\n // calc like codegen does, if we need space?\n\n // and not id && sel.type !== \"id\" || \"class\", \"attri\"?\n // we do need space after class etc for non complex\n // but not inside complex. the tree removed spaces\n // parent\n // this is dont after, not before though\n len += 1\n\n if (sel.type === \"UniversalSelector\")\n len++\n else if (sel.type === \"IdSelector\")\n len += sel.name.length + 1\n else if (sel.type === \"ClassSelector\")\n len += sel.name.length + 1\n else if (sel.type === \"TagSelector\")\n len += sel.name.length\n else if (sel.type === \"Combinator\")\n len++\n else if (sel.type === \"AttributeSelector\") {\n len += 2 + sel.name.name.length\n if (sel.operator) len += sel.operator.length\n if (sel.value === \"Identifier\") len += sel.value.name.length // if op, there has to be a value?\n if (sel.value === \"String\") len += sel.value.val.length + 2\n if (sel.flag) len += sel.flag.name.length // s or i\n if (sel.value === \"Identifier\" && sel.flag.name) len++ // add space if flag and ident (not needed for string)\n }\n else if (sel.type === \"PsuedoElementSelector\")\n len += sel.name.length + 2\n else if (sel.type === \"PseudoClassSelector\")\n len += sel.name.length + 2\n else if (sel.type === \"ComplexSelector\") {\n if (i !== 0) len++ // add space at start of ComplexSel (unless its first), since if above dont add for first node in arr\n\n walk(sel.selectors, true)\n }\n })\n }\n\n return len\n}",
"visitMaxsize_clause(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"function adjustTree(indexMapLeft,root){\n if(root.hasOwnProperty('children')){\n //console.log(root.data.name)\n var cL=root.children[0];\n var cR=root.children[1];\n //console.log(leavesL,leavesR)\n //console.log(bias0,bias1)\n\n var cross_result=optimizationFun_cross(cL,cR,indexMapLeft);\n if (cross_result<0){\n swapChildren(root);\n }\n else if(cross_result==0){\n if(optimizationFun_order(cL,cR,indexMapLeft)<0)\n swapChildren(root);\n }\n\n adjustTree(indexMapLeft,cL);\n adjustTree(indexMapLeft,cR);\n }\n }",
"function computeMinPoolSize(pool) {\n\t\t // assert(pool instanceof go.Group && pool.category === \"Pool\");\n\t\t var len = MINLENGTH;\n\t\t pool.memberParts.each(function(lane) {\n\t\t // pools ought to only contain lanes, not plain Nodes\n\t\t if (!(lane instanceof go.Group)) return;\n\t\t var holder = lane.placeholder;\n\t\t if (holder !== null) {\n\t\t var sz = holder.actualBounds;\n\t\t len = Math.max(len, sz.width);\n\t\t }\n\t\t });\n\t\t return new go.Size(len, NaN);\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Second player wins the game | function secondPlayerWins() {
secondPlayerScore.innerHTML = parseInt(secondPlayerScore.innerHTML) + 1;
gameIsWon = true;
} | [
"function winOrLose() {\n if (playerScore === randomNum) {\n winsCounter++;\n $(\"#wins\").html(\" \" + winsCounter);\n startGame();\n } else if (playerScore > randomNum) {\n lossCounter++;\n $(\"#losses\").html(\" \" + lossCounter);\n startGame();\n }\n }",
"function checkForWinner() {\n // If it hits the left wall, player 2 wins\n if (puck.x < 0) {\n // player2Win = true;\n player1Start = true; // Set our flag to allow player 1 to start\n won = true;\n player2.score += 1;\n updateScoreboard();\n // document.getElementById(\"p2score\").innerHTML = player2.score;\n }\n // If it hits the right wall, player 1 wins\n if (puck.x > canvas.width) {\n // player1Win = true;\n player1Start = false; // Set our flag to allow player 2 to start\n won = true;\n player1.score += 1;\n updateScoreboard();\n // document.getElementById(\"p1score\").innerHTML = player1.score;\n }\n}",
"function winnerIs(player) {\n\tconsole.log(player == \"player1\" ? \"Player 1 wins\" : \"Player 2 wins\");\n\tshowMessege(player == \"player1\" ? \"#\" + player1.short + \"-hits\" : \"#\" + player2.short + \"-hits\");\n\tif(player == \"player1\") {\n\t\tsetStamina(player1, \"player-1-stamina\", \"add\");\n\t\tsetStamina(player2, \"player-2-stamina\", \"subtract\");\n\t} else {\n\t\tsetStamina(player1, \"player-1-stamina\", \"subtract\");\n\t\tsetStamina(player2, \"player-2-stamina\", \"add\");\t\t\n\t}\n\tplayer == \"player1\" ? decreaseHealth(player2, \"player2\") : decreaseHealth(player1, \"player1\");\n\t$(\"#player-1-health\").html(player1.health);\n\t$(\"#player-2-health\").html(player2.health);\n\tif(player == \"player1\" && player2.health == 0) {\n\t\tplayer2.dead = true;\n\t} else if(player1.health == 0) {\n\t\tplayer1.dead = true;\n\t}\n}",
"function checkWinner() {\n if (player1Score === 20) {\n setMessage(\"player 1 wins\");\n document.getElementById(\"ci1a\").disabled = true;\n document.getElementById(\"ci1b\").disabled = true;\n document.getElementById(\"ci1c\").disabled = true;\n document.getElementById(\"ci1d\").disabled = true;\n document.getElementById(\"ci2a\").disabled = true;\n document.getElementById(\"ci2b\").disabled = true;\n document.getElementById(\"ci2c\").disabled = true;\n document.getElementById(\"ci2d\").disabled = true;\n playAgain();\n } else if (player2Score === 20) {\n setMessage(\"player 2 wins\");\n document.getElementById(\"ci1a\").disabled = true;\n document.getElementById(\"ci1b\").disabled = true;\n document.getElementById(\"ci1c\").disabled = true;\n document.getElementById(\"ci1d\").disabled = true;\n document.getElementById(\"ci2a\").disabled = true;\n document.getElementById(\"ci2b\").disabled = true;\n document.getElementById(\"ci2c\").disabled = true;\n document.getElementById(\"ci2d\").disabled = true;\n playAgain();\n }\n }",
"function firstPlayerWins() {\n firstPlayerScore.innerHTML = parseInt(firstPlayerScore.innerHTML) + 1;\n gameIsWon = true;\n }",
"function correct() {\n wins++;\n restartGame();\n }",
"function playGame()\n{\n let userChoice = getUserChoice(\"Scissors\");\n console.log(`User choice: ${userChoice}`);\n let computerChoice = getComputerChoice();\n console.log(`Computer choice: ${computerChoice}`);\n console.log(determineWinner(userChoice, computerChoice));\n}",
"function opponentTurn(){\n\t\tif(matchProceed)\n\t\t{\n\t\t\tattack(enemyP, playerC);\n\t\t}\n\t\telse {\n\t\t\tcheckGame();\n\t\t\tconsole.log(\"Game is over.\");\n\t\t}\n\t\topponentLock = false;\n\t\t\n\t}",
"function whoPlaysFirst() {\n //generate random number between 1 and 2\n const random = Math.ceil(Math.random()*2)\n if(random === 2) {\n p1Turn = false\n playerTurn.innerHTML = `${player2.name}, ร toi de jouer !`\n playerTurn.classList.add('text-red-700')\n } else {\n playerTurn.innerHTML = `${player1.name}, ร toi de jouer !`\n playerTurn.classList.add('text-blue-700')\n return p1Turn\n }\n }",
"function playGame() {\n let userChoice = getUserChoice('paper');\n let computerChoice = getComputerChoice();\n console.log('Human chose: ' + userChoice);\n console.log('Computer chose: ' + computerChoice);\n console.log(determineWinner(userChoice,computerChoice));\n}",
"playerWins(){ // i2 - put inline\n\t\tif (this.player === activePlayer && playing === false) {\n\t\t\treturn true;\n\t\t}\t}",
"function checkScore(){\n\n if (counter == targetNumber) {\n gameOver=true;\n wins++;\n $(\"#wins\").html(wins);\n \trestart();\n\t\t\talert(\"You Win!\");\n }\n\n\t\tif (counter > targetNumber) {\n losses++;\n $(\"#losses\").html(losses);\n \trestart();\n alert(\"You Lose!\"); \n \n }\n }",
"checkIfWin(){\n\t\tconst g = this.state.grid;\n\t\tvar hits = 0;\n\n\t\tfor(var i = 0; i < this.gridSize; i++) {\n\t\t\tfor(var j = 0; j < this.gridSize; j++) {\n\t\t\t\tif (g[i][j] === \"Hit\") {\n\t\t\t\t\thits++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif(hits === this.maxNumberOfShips*2){\n\t\t\tvar theWinner = \"\";\n\n\t\t\tif(this.props.id === \"gridA\"){\n\t\t\t\ttheWinner = \"PlayerB\";\n\t\t\t\tthis.props.handleWin(theWinner);\n\t\t\t}\n\t\t\telse{\n\t\t\t\ttheWinner = \"PlayerA\";\n\t\t\t\tthis.props.handleWin(theWinner);\n\t\t\t}\n\n\t\t}\n\n\t}",
"function game() {\n let score = [0,0];\n while (score[0] !== 5 && score[1] !== 5) {\n let resultMessage = playRound(playerChoice(), computerPlay());\n if(resultMessage === undefined) {\n break;\n } else {\n roundWinner(resultMessage,score);\n }\n }\n checkWinner(score);\n}",
"function winLoss() {\n if (userScore === answer) {\n winCount++\n console.log(\"new winCount is \" + winCount);\n $(\"#lossMessage\").hide();\n $(\"#winMessage\").show(300);\n $(\"#wins\").text(\"Wins: \" + winCount);\n newRound();\n }\n\n else if (userScore > answer) {\n lossCount++\n console.log(\"new lossCount is \" + lossCount);\n $(\"#winMessage\").hide();\n $(\"#lossMessage\").show(300);\n $(\"#losses\").text(\"Losses: \" + lossCount);\n newRound();\n }\n \n}",
"rally(winner) {\n if (1 <= this.game_over) {\n if (this.game_over < 2) {\n this.msg = txt_GameOver;\n this.game_over++;\n }\n } else if (winner == txt_Random) {\n if (this.servingTeam() == this.winningTeam()) {\n this.serverWins();\n } else {\n this.serverLoses();\n }\n } else {\n if (this.servingTeam() == winner) {\n this.serverWins();\n } else {\n this.serverLoses();\n }\n }\n this.draw();\n }",
"function turnIs() {\n if (turn == player2) {\n turn = player1;\n symbol = \"o\";\n } else {\n turn = player2;\n symbol = \"x\";\n }\n\n }",
"function isGameOver(){\n if (player1.health <= 0){\n player1.health = 0;\n $( \".fightButton1\" ).css( \"display\", \"none\" );\n $( \".fightButton2\" ).css( \"display\", \"none\" );\n displayStats(player1);\n // timeout used so the health can be seen before the modal box\n setTimeout(\n function(){ \n background.pause();\n horn.play();\n celebrate.play();\n document.getElementById(\"match-winner\").innerHTML = \"Loki, the god of mischief\";\n document.getElementById(\"winner-img\").src =\"images/loki.png\";\n document.getElementById(\"winner-gif\").src = \"images/fireworks.gif\"\n endModal.style.display = \"block\" ;\n }, \n 800);\n }\n if (player2.health <= 0){\n player2.health = 0;\n $( \".fightButton1\" ).css( \"display\", \"none\" );\n $( \".fightButton2\" ).css( \"display\", \"none\" );\n displayStats(player2);\n setTimeout(\n function(){ \n background.pause();\n horn.play();\n celebrate.play();\n document.getElementById(\"match-winner\").innerHTML = \"Thor, son of Odin\";\n document.getElementById(\"winner-img\").src = \"images/Thor.png\";\n document.getElementById(\"winner-gif\").src = \"images/giphyThunder.gif\";\n endModal.style.display = \"block\";\n }, \n 800);\n }\n }",
"isGameOver() {\n return this.winner || this.numGuessesRemaining === 0\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
UPDATE NEXT SONG ON DOM WITH SONG OBJECT | function updateNextSongDiv(nextSong){
let nextTitle = document.getElementById('next-playing-song-title')
let nextArtist = document.getElementById('next-playing-song-artist')
let nextImg = document.getElementById('next-playing-song-img')
let nextSongData = document.getElementById('next-playing-con').dataset
let nextSongAudio = document.querySelector('.next-audio')
let nextHeart = document.getElementById('next-song-heart')
let nextDuration = document.getElementById('next-playing-con').dataset
nextTitle.innerText = nextSong.title
nextArtist.innerText = nextSong.artist
nextImg.src = nextSong.img
nextSongData.songid = nextSong.id
nextSongData.songidx = nextSong.idx
nextSongData.pll = nextSong.pll
nextDuration.duration = nextSong.duration
nextSongAudio.id = nextSong.id
nextSongAudio.src = `../static/audio/${nextSong.file}`
nextHeart.src = "../static/img/heart1.png"
} | [
"function updatePrevSongDiv(prevSong){\n let prevTitle = document.getElementById('prev-playing-song-title')\n let prevArtist = document.getElementById('prev-playing-song-artist')\n let prevImg = document.getElementById('prev-playing-song-img')\n let prevSongData = document.getElementById('prev-playing-con').dataset\n let prevSongAudio = document.querySelector('.prev-audio')\n let prevHeart = document.getElementById('prev-song-heart')\n let nextDuration = document.getElementById('prev-playing-con').dataset\n\n prevTitle.innerText = prevSong.title\n prevArtist.innerText = prevSong.artist\n prevImg.src = prevSong.img\n prevSongData.songid = prevSong.id\n prevSongData.songidx = prevSong.idx\n prevSongData.pll = prevSong.pll\n nextDuration.duration = prevSong.duration\n prevSongAudio.id = prevSong.id\n prevSongAudio.src = `../static/audio/${prevSong.file}`\n prevHeart.src = \"../static/img/heart1.png\"\n}",
"function updateCurrSongDiv(song){\n let currTitle = document.getElementById('curr-playing-song-title')\n let currArtist = document.getElementById('curr-playing-song-artist')\n let currImg = document.getElementById('curr-playing-song-img')\n let currSongData = document.getElementById('curr-song-audio-control-con').dataset\n let currSongAudio = document.querySelector('.curr-audio')\n let currHeart = document.getElementById('curr-song-heart')\n\n currTitle.innerText = song.title\n currArtist.innerText = song.artist\n currImg.src = song.img\n currSongData.songid = song.id\n currSongData.songidx = song.idx\n //pll = playlist length\n currSongData.pll = song.pll\n currSongAudio.id = song.id\n currSongAudio.src = `../static/audio/${song.file}`\n currHeart.src = \"../static/img/heart1.png\" \n}",
"function updateMetadataId(oMetadata){\r\n\t\t\t\t\tvar sId = Math.floor(Math.random() * 10000);\r\n\t\t\t\t\toMetadata.id = replaceId(sId, oMetadata.id );\r\n\t\t\t\t\toMetadata.uri = replaceId(sId, oMetadata.uri);\r\n\t\t\t\t}",
"function updateDOM() {\n document.querySelector('.slash').style.display = allData[lastWatched[index]].site =='9anime'? \"none\":\"inline\"\n if (lastWatched.length > 0) {\n if(isTracking){\n isTracking=false;\n }\n toggleLoadingAnimation();\n\n // for currently airing update broadcast time\n if (lastWatched[index] in broadcastTimes)\n scheduleElement.innerHTML = broadcastTimes[lastWatched[index]]\n\n artworkElement.src = artwork[lastWatched[index]]\n document.querySelector('.sectionLabel').innerHTML = lastWatched[index] == currWatching ? \"Currently Watching\" : \"Last Watched\"\n document.getElementById('lastWatched').innerHTML = lastWatched[index]\n let episodeObj = allData[lastWatched[index]]\n document.getElementById('lastWatchedEpisode').innerHTML = episodeObj.episode\n document.getElementById('lastWatchedTime').innerHTML = episodeObj.time\n document.getElementById('lastWatchedTotalTime').innerHTML = episodeObj.totalTime\n document.getElementById('lastWatchedSite').innerHTML = episodeObj.site\n if(episodeObj.nextEpisodeLink != undefined && episodeObj.nextEpisodeLink != \"\"){\n document.getElementById('nextEpisode').style.display = \"inline-block\"\n }\n else{\n document.getElementById('nextEpisode').style.display = \"none\"\n }\n \n }\n else {\n // display help text if user is not tracking anything\n for (let e of helpText) {\n e.style.display = \"block\"\n }\n showHelp = !showHelp\n }\n\n}",
"function setNextImage(image) {\n if(document.getElementById(image.id).parentNode.nextSibling !== null){\n nextImage=document.getElementById(image.id).parentNode.nextSibling.firstChild;\n }\n else{\n nextImage = document.getElementById('container').firstChild.firstChild;\n }\n}",
"function updateLink(value) {\n var item = new Array;\n\n //! Update Link\n item.modified = new Date();\n item.id = 1\n item.link = value;\n Storage.updateLink(item);\n strLink = value;\n}",
"function update_link(video_id, is_in_stack) {\n var video = video_map[video_id];\n\n if (typeof video != 'undefined') {\n video.is_in_stack = is_in_stack;\n\n for (var i in video.containers) {\n $('.flixstack-wrapper', video.containers[i]).remove();\n $(video.containers[i]).append(make_link(video_id));\n }\n }\n}",
"function updateEpisode(episode, episodeIndex) {\n $('.episodeNumber')\n .text(episodeIndex+1)\n .next().text(episode.title);\n }",
"function incrementVote(htmlId) {\n for (var item of items) {\n if (item.htmlId === htmlId) {\n item.voteNum++;\n }\n }\n}",
"function updateControlNode(parentNode, newParms)\n {\n parentNode.src = newParms.img;\n parentNode.alt = newParms.alt;\n parentNode.title = newParms.alt;\n }",
"function loadNextImage() {\n let next = games.splice(0, 1)[0];\n\n document.getElementById(\"background\").src = next.img;\n document.getElementById(\"jakob\").getElementsByTagName(\"span\")[0].innerText = next.name;\n}",
"function updateCurrentLinkFromAlt(altID) {\r\n for(var i = 0; i < signlinkArray.length; i++) {\r\n if(altID == signlinkArray[i].link) {\r\n currentLink = i;\r\n break;\r\n }\r\n }\r\n }",
"static update(id, shortLink){\n\t\tlet kparams = {};\n\t\tkparams.id = id;\n\t\tkparams.shortLink = shortLink;\n\t\treturn new kaltura.RequestBuilder('shortlink_shortlink', 'update', kparams);\n\t}",
"function handleNextBtn() {\n // Move the pointer back\n util.movePtr(\"next\");\n\n // Extract the index and url at ptr using object deconstruction\n const { idx, url } = ptr.value;\n\n // Update the index\n util.updateIdx(idx);\n\n // Update the carousel's image\n util.updateImage(url);\n }",
"function updateImages(lastChild, i) {\n const flipCardBack = lastChild.appendChild(document.createElement('div'));\n flipCardBack.setAttribute('class', 'flip-card-back');\n\n const title = flipCardBack.appendChild(document.createElement('h1'));\n const description = flipCardBack.appendChild(document.createElement('h4'));\n const image = flipCardBack.appendChild(document.createElement('img'));\n\n title.innerHTML = `${imagesArr[i].name}`;\n description.innerHTML = `${imagesArr[i].email}`;\n image.src = '/assets/delete.svg';\n image.setAttribute('id', `${i}`)\n}",
"function updateURL() {\n const URLelement = elements.get(\"title\").querySelector(\"a\");\n switch (URLelement) {\n case null:\n currentURL = undefined;\n break;\n default:\n const id = URLelement.href.replace(/[^0-9]/g, \"\");\n currentURL = `https://tidal.com/browse/track/${id}`;\n break;\n }\n}",
"function update_user_elements() {\n $('.echo-item-authorName, .echo-item-avatar').each( function() {\n if(!$(this).hasClass('initialized')) {\n var container = $(this).parents('.echo-item-container');\n \n var userName = container.find('.echo-item-authorName').text();\n var userID = container.find('.echo-item-metadata-userID .echo-item-metadata-value').text();\n \n var url = '/echo2-users.php?user_id=' + UrlEncoderTool.encode(userID) + '&d=' + new Date().getTime();\n \n $(this).html($('<a></a>').attr('href',url).attr('title', 'user page: ' + userName).addClass('echo-linkColor').html($(this).html()));\n $(this).find('img').removeAttr('height');\n $(this).addClass('initialized');\n }\n });\n }",
"function nextPhoto() {\n\tstoryIndex++; // <-- increase index\n\n\t// if we've reached the end of the array...\n\tif (storyIndex == storyParts.length) {\n\t\tstoryIndex--; // <-- decrement index to stay in-bounds\n\n\t\t// if another story-piece is available...\n\t} else {\n\t\ttextAreaEl.value = storyParts[storyIndex]; // <-- change textArea to\n\t\t\t\t\t\t\t\t\t\t\t\t\t// new dialogue\n\t\timgEl.src = \"pup_imgs/\" + imgParts[storyIndex] + \".jpg\"; // <--\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// update\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// image\n\t}\n}",
"function updatePlayerRef(){\r\n\tif(a_playerSnail >= 300){\r\n\t\ta_refLink = window.location.protocol + '//' + window.location.host + window.location.pathname + \"?ref=\" + web3.eth.accounts[0];\r\n\t\tplayerreflinkdoc.innerHTML = \"<br>\" + a_refLink;\r\n\t} else {\r\n\t\tplayerreflinkdoc.textContent = \"NOT active. You must have at least 300 snails in your hatchery.\";\r\n\t}\r\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Makes an Authorization 'Bearer' request with the given accessToken to the given endpoint. | async function callEndpointWithToken(endpoint, accessToken) {
const options = {
headers: {
Authorization: `Bearer ${accessToken}`
}
};
console.log('Request made at: ' + new Date().toString());
const response = await axios.default.get(endpoint, options);
return response.data;
} | [
"function bearerAuth(req, res, next) {\r\n passport.authenticate('bearer', {\r\n session: false\r\n },\r\n function(err, user, info) {\r\n if (err) return res.send(500, err);\r\n if (!req.query.access_token) {\r\n return res.send(401, {\r\n message: \"An access token must be provided\"\r\n });\r\n }\r\n if (!user) {\r\n return res.send(401, {\r\n message: \"Access token has expired or is invalid\"\r\n });\r\n }\r\n req.user = user;\r\n next();\r\n })(req, res, next);\r\n }",
"function getOAuthHeader(accessToken) {\n if (!accessToken || !(typeof accessToken === 'string')) {\n throw new Error(`Bad accessToken given: ${accessToken}`);\n }\n return { Authorization: 'Bearer ' + accessToken };\n}",
"function getBearerToken() {\n // These are your credentials. Copied from Slack\n var clientId = \"vb5V9lDO52aGeCa72ne1m62jbeBVnpsmo0zNWB6WXNlaHsxHwX\"\n var clientSecret = \"lSZxDywC45exeleR65WjlWjkIIIPl8F4BTB9GexH\"\n // Has to be a POST request because you are sending data\n fetch(\"https://api.petfinder.com/v2/oauth2/token\", {\n method: 'POST',\n // They expect you to send this info in the \"body\"\n body: \"grant_type=client_credentials&client_id=\" + clientId + \"&client_secret=\" + clientSecret,\n // Needed to prevent errors \n headers: {\n \"Content-Type\": \"application/x-www-form-urlencoded\"\n },\n }).then(function (apiResponse) {\n return apiResponse.json()\n }).then(function (bearerToken) {\n // This provides you an access token. \n // It is good for 3600 seconds, or 1 hour.\n getPetData(bearerToken.access_token)\n })\n}",
"async function doAblyTokenRequestWithAuthURL() {\n clearStatus();\n writeStatus(\"Requesting TokenDetails object from auth server\");\n\n ably = new Ably.Realtime({ authUrl: \"/tokenrequest\" });\n ably.connection.on((stateChange) => {\n onStateChange(\"Connection\", stateChange);\n });\n}",
"function setHeaderWithToken() {\n var cookie = $.cookie(\"accessToken\");\n\n $(document).ajaxSend(function (event, jqxhr, settings) {\n jqxhr.setRequestHeader('Authorization', 'bearer ' + cookie);\n });\n }",
"verifyAccessToken(access_token) {\n let options = {\n method: 'GET',\n uri: this._server + '/oauth/verify',\n headers: {\n 'Authorization': 'Bearer ' + access_token\n }\n };\n\n return this._request(options);\n }",
"function authorize(request, token) {\n return Object.assign(\n { headers: {'Authorization': `userToken=${token}` } },\n request)\n}",
"async generateJWTTokenFromAccessToken(accessCode) {\n return new Promise((resolve, reject) => {\n const url = \"https://\" + this.bot.rainbow.host + \":443/api/rainbow/authentication/v1.0/oauth/token\";\n const applicationAuthent = this.bot.application.appID + \":\" + this.bot.application.appSecret;\n\n const headers = {\n \"Content-Type\": \"application/x-www-form-urlencoded\",\n Authorization: \"Basic \" + Buffer.from(applicationAuthent).toString(\"base64\")\n };\n\n const requestBody = {\n grant_type: \"authorization_code\",\n code: accessCode,\n redirect_uri: \"https://localhost:3002/webinar/oauth\"\n };\n\n const encodedBody = qs.stringify(requestBody);\n\n axios\n .post(url, encodedBody, { headers: headers })\n .then(response => {\n resolve({ refresh_token: response.data.refresh_token, access_token: response.data.access_token });\n })\n .catch(err => {\n reject(err);\n });\n });\n }",
"async function requestAccessToken() {\n\n/**\n * Function to get base64 encoded data from private spotify values.\n * @param {string} clientID - private spotify client id\n * @param {string} secret - private spotify secret key\n */\n async function getEncodedKey(clientID, secret) {\n const encodedVal = btoa(clientID + \":\" + secret);\n return encodedVal;\n };\n\n const key = await getEncodedKey(CLIENT_ID, CLIENT_SECRET)\n const config = {\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n 'Authorization': `Basic ${key}`\n }\n };\n const params = new URLSearchParams();\n params.append('grant_type', 'client_credentials');\n const {data} = await axios.post(ACCESS_TOKEN_URL, params, config);\n return data.access_token;\n}",
"async function apiManagementCreateAuthorizationProviderGenericOAuth2() {\n const subscriptionId = process.env[\"APIMANAGEMENT_SUBSCRIPTION_ID\"] || \"subid\";\n const resourceGroupName = process.env[\"APIMANAGEMENT_RESOURCE_GROUP\"] || \"rg1\";\n const serviceName = \"apimService1\";\n const authorizationProviderId = \"eventbrite\";\n const parameters = {\n displayName: \"eventbrite\",\n identityProvider: \"oauth2\",\n oauth2: {\n grantTypes: {\n authorizationCode: {\n authorizationUrl: \"https://www.eventbrite.com/oauth/authorize\",\n clientId: \"\",\n clientSecret: \"\",\n refreshUrl: \"https://www.eventbrite.com/oauth/token\",\n scopes: \"\",\n tokenUrl: \"https://www.eventbrite.com/oauth/token\",\n },\n },\n redirectUrl:\n \"https://authorization-manager.consent.azure-apim.net/redirect/apim/apimService1\",\n },\n };\n const credential = new DefaultAzureCredential();\n const client = new ApiManagementClient(credential, subscriptionId);\n const result = await client.authorizationProvider.createOrUpdate(\n resourceGroupName,\n serviceName,\n authorizationProviderId,\n parameters\n );\n console.log(result);\n}",
"function callMSGraph(theUrl, accessToken, callback) {\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function () {\n if (this.readyState == 4 && this.status == 200)\n callback(JSON.parse(this.responseText));\n }\n xmlHttp.open(\"GET\", theUrl, true); // true for asynchronous\n xmlHttp.setRequestHeader('Authorization', 'Bearer ' + accessToken);\n xmlHttp.send();\n}",
"constructor(baseUri, token) {\n if (!baseUri) {\n throw new Error('the base uri was not provided');\n }\n if (!token) {\n throw new Error('the auth token was not provided');\n }\n\n this.AuthenticatedApi = axios.create({\n baseURL: baseUri,\n headers: { \n 'Authorization': `Bearer ${token}`,\n 'Content-Type': 'application/json',\n }\n });\n }",
"authorize() {\n this.auth = this.auth || new Promise((resolve, reject) => {\n this._client.authorize((err, tokens) => err ? \n reject(err) : \n resolve(this._client));\n });\n return this.auth;\n }",
"function setAxiosToken(token) {\n axios.defaults.headers[\"Authorization\"] = \"Bearer \" + token;\n}",
"function subscriptionAuthorization(req, res, next) {\n if (configUtil.getRequireAuth() === false) return next();\n\n const token = getToken(req);\n const adminToken = configUtil.getAdminToken();\n if (adminToken && token === adminToken) return next();\n else if (token) {\n const subscriptionId = token.split(':')[0];\n if (subscriptionId) {\n const subscriptions = db.select(SUBSCRIPTIONS, s => s.resource.id === subscriptionId);\n for (const subscription of subscriptions) {\n // Get the authorization token from the subscription\n const authorizationHeader = subscription.resource.channel.header[0];\n const authToken = authorizationHeader.split('Authorization: Bearer ')[1];\n if (token === authToken) return next();\n }\n }\n }\n\n res.sendStatus(StatusCodes.UNAUTHORIZED);\n}",
"function authUsingAdalCallback(vaultUri) {\n console.log(\"Using ADAL to authenticate to '\" + vaultUri + \"'\");\n \n // Callback for ADAL authentication.\n const adalCallback = (challenge, callback) => {\n const context = new AuthenticationContext(challenge.authorization);\n return context.acquireTokenWithClientCredentials(challenge.resource, clientId, secret, (err, tokenResponse) => {\n if(err) {\n throw err;\n }\n \n // The KeyVaultCredentials callback expects an error, if any, as the first parameter. \n // It then expects a value for the HTTP 'Authorization' header, which we compute based upon the access token obtained with the SP client credentials. \n // The token type will generally equal 'Bearer' - in some user-specific situations, a different type of token may be issued. \n return callback(null, tokenResponse.tokenType + ' ' + tokenResponse.accessToken);\n });\n };\n \n const keyVaultClient = new KeyVault.KeyVaultClient(new KeyVault.KeyVaultCredentials(adalCallback));\n \n // Using the key vault client, create and retrieve a sample secret.\n console.log(\"Setting secret 'test-secret'\");\n \n keyVaultClient.setSecret(vaultUri, 'test-secret', 'test-secret-value', {})\n .then( (kvSecretBundle, httpReq, httpResponse) => {\n console.log(\"Secret id: '\" + kvSecretBundle.id + \"'.\");\n var secretId = KeyVault.parseSecretIdentifier(kvSecretBundle.id);\n return keyVaultClient.getSecret(secretId.vault, secretId.name, secretId.version);\n })\n .then( (bundle) => {\n console.log(\"Successfully retrieved 'test-secret'\");\n console.log(bundle);\n })\n .catch( (err) => {\n console.log(err);\n });\n}",
"function getUserAccessToken(siteUrl, clientId, clientSecret, refreshToken, realm, stsUri, cacheKey) {\n return getTokenInternal({ siteUrl: siteUrl, clientId: clientId, clientSecret: clientSecret, refreshToken: refreshToken, realm: realm, stsUri: stsUri, cacheKey: \"user:\" + cacheKey });\n }",
"function attachToken(request) {\r\n var token = getToken();\r\n if (token) {\r\n request.headers = request.headers || {};\r\n request.headers['x-access-token'] = token;\r\n }\r\n return request;\r\n }",
"async acquireToken(/*scopes = ['user.read']*/) {\r\n this.waitingOnAccessToken = true\r\n // Override any scope\r\n let scopes = this.defaultScope()\r\n if (!msalApp) {\r\n return null\r\n }\r\n\r\n // Set scopes for token request\r\n const accessTokenRequest = {\r\n scopes,\r\n account: this.user()\r\n }\r\n\r\n let tokenResp\r\n try {\r\n // 1. Try to acquire token silently\r\n tokenResp = await msalApp.acquireTokenSilent(accessTokenRequest)\r\n console.log('### MSAL acquireTokenSilent was successful')\r\n } catch (err) {\r\n // 2. Silent process might have failed so try via popup\r\n tokenResp = await msalApp.acquireTokenPopup(accessTokenRequest)\r\n console.log('### MSAL acquireTokenPopup was successful')\r\n } finally {\r\n this.waitingOnAccessToken = false\r\n }\r\n\r\n // Just in case check, probably never triggers\r\n if (!tokenResp.accessToken) {\r\n throw new Error(\"### accessToken not found in response, that's bad\")\r\n }\r\n\r\n this.accessToken = tokenResp.accessToken\r\n\r\n // Execute waiting call backs\r\n if (this.accessTokenCallbacks.length > 0) {\r\n this.accessTokenCallbacks.forEach( callback => {\r\n console.log('executing callback: '+callback)\r\n callback()\r\n })\r\n this.accessTokenCallbacks = [] // reset\r\n }\r\n\r\n return tokenResp.accessToken\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Registers a block type. | function registerBlockType(blockType) {
// Bail ealry if is excluded post_type.
var allowedTypes = blockType.post_types || [];
if (allowedTypes.length) {
// Always allow block to appear on "Edit reusable Block" screen.
allowedTypes.push('wp_block'); // Check post type.
var postType = acf.get('postType');
if (allowedTypes.indexOf(postType) === -1) {
return false;
}
} // Handle svg HTML.
if (typeof blockType.icon === 'string' && blockType.icon.substr(0, 4) === '<svg') {
var iconHTML = blockType.icon;
blockType.icon = /*#__PURE__*/React.createElement(Div, null, iconHTML);
} // Remove icon if empty to allow for default "block".
// Avoids JS error preventing block from being registered.
if (!blockType.icon) {
delete blockType.icon;
} // Check category exists and fallback to "common".
var category = wp.blocks.getCategories().filter(function (cat) {
return cat.slug === blockType.category;
}).pop();
if (!category) {
//console.warn( `The block "${blockType.name}" is registered with an unknown category "${blockType.category}".` );
blockType.category = 'common';
} // Define block type attributes.
// Leave default undefined to allow WP to serialize attributes in HTML comments.
// See https://github.com/WordPress/gutenberg/issues/7342
var attributes = {
id: {
type: 'string'
},
name: {
type: 'string'
},
data: {
type: 'object'
},
align: {
type: 'string'
},
mode: {
type: 'string'
}
}; // Append edit and save functions.
var ThisBlockEdit = BlockEdit;
var ThisBlockSave = BlockSave; // Apply align_text functionality.
if (blockType.supports.align_text) {
attributes = withAlignTextAttributes(attributes);
ThisBlockEdit = withAlignTextComponent(ThisBlockEdit, blockType);
} // Apply align_content functionality.
if (blockType.supports.align_content) {
attributes = withAlignContentAttributes(attributes);
ThisBlockEdit = withAlignContentComponent(ThisBlockEdit, blockType);
} // Merge in block settings.
blockType = acf.parseArgs(blockType, {
title: '',
name: '',
category: '',
attributes: attributes,
edit: function edit(props) {
return /*#__PURE__*/React.createElement(ThisBlockEdit, props);
},
save: function save(props) {
return /*#__PURE__*/React.createElement(ThisBlockSave, props);
}
}); // Add to storage.
blockTypes[blockType.name] = blockType; // Register with WP.
var result = wp.blocks.registerBlockType(blockType.name, blockType); // Fix bug in 'core/anchor/attribute' filter overwriting attribute.
// See https://github.com/WordPress/gutenberg/issues/15240
if (result.attributes.anchor) {
result.attributes.anchor = {
type: 'string'
};
} // Return result.
return result;
} | [
"setType(block) {\n const type = block.type === 'customBlock' ? block.fields.type : block.type;\n block.type = type;\n }",
"static registerType(type) { ShareDB.types.register(type); }",
"has_block(type) { return (this.tracking_block(type)) ? this.blocks[type] : false; }",
"async addBlock(block) {\n await this.chain.push(block);\n return block;\n }",
"function addType() {\n\t\tvar args = extract(\n\t\t\t{ name: 'name', test: function(o) { return typeof o === 'string'; } },\n\t\t\t{ name: 'type', parse: function(o) {\n\t\t\t\treturn (o instanceof Type) ? o : new Type(this.name || o.name, o);\n\t\t\t} }\n\t\t).from(arguments);\n\n\t\ttypeList.push(args.type);\n\t}",
"resetBlockWithType(editorState, newType, newText) {\n const contentState = editorState.getCurrentContent();\n const selectionState = editorState.getSelection();\n const key = selectionState.getStartKey();\n const blockMap = contentState.getBlockMap();\n const block = blockMap.get(key);\n\n // Maintain persistence in the list while removing chars from the start.\n // https://github.com/facebook/draft-js/blob/788595984da7c1e00d1071ea82b063ff87140be4/src/model/transaction/removeRangeFromContentState.js#L333\n let chars = block.getCharacterList();\n let startOffset = 0;\n const sliceOffset = block.getText().length - newText.length;\n while (startOffset < sliceOffset) {\n chars = chars.shift();\n startOffset++;\n }\n\n const newBlock = block.merge({\n type: newType,\n text: newText,\n characterList: chars,\n data: {},\n });\n const newContentState = contentState.merge({\n blockMap: blockMap.set(key, newBlock),\n });\n const newSelectionState = selectionState.merge({\n anchorOffset: 0,\n focusOffset: 0,\n });\n\n return EditorState.acceptSelection(\n EditorState.set(editorState, {\n currentContent: newContentState,\n }),\n newSelectionState,\n );\n }",
"function getBlockType(name) {\n return blockTypes[name] || false;\n }",
"function setType(itemType){\n\ttype = itemType;\n}",
"function registerCallback(type, func) {\n if( callbacks.hasOwnProperty(type) == false ) {\n callbacks[type] = [];\n }\n callbacks[type].push(func);\n }",
"set type(aValue) {\n this._logger.debug(\"type[set]\");\n this._type = aValue;\n }",
"register (name: string, callback: Callback, type: CallbackKind = 'didSave') {\n if (typeof callback !== 'function') {\n throw new Error('callback must be a function')\n }\n if (type !== 'didSave' && type !== 'willSave') {\n throw new Error('type must be a willSave or didSave')\n }\n if (type === 'willSave') {\n const cb: WillSaveCallback = ((callback: any): WillSaveCallback)\n this.willSaveCallbacks.add(cb)\n return new Disposable(() => {\n if (this.willSaveCallbacks) {\n this.willSaveCallbacks.delete(cb)\n }\n })\n }\n\n const cb: DidSaveCallback = ((callback: any): DidSaveCallback)\n this.didSaveCallbacks.set(name, cb)\n return new Disposable(() => {\n if (this.didSaveCallbacks) {\n this.didSaveCallbacks.delete(name)\n }\n })\n }",
"function addBlock(label) {\n // make sure label is unique identifier\n var newlabel = label;\n var counter = 1;\n var found;\n do {\n found = topBlock.forEachChild(function(child){\n if (child.getLabel() == newlabel) {\n newlabel = label + counter;\n counter += 1;\n return false;\n }\n return true;\n });\n } while (!found);\n label = newlabel;\n\n // create the new block; pass it a handle to the top-level (i.e. its parent)\n // logic block so that it can access other procedures in the program\n var element = new FlowBlockVisual(ctx,label,topBlock.getLogic());\n element.setHeightChangeCallback(resizeCanvas);\n topBlock.addChild(element);\n modified = true;\n drawScreen();\n return element;\n }",
"function addType(newType, configFunction) {\n OPTION_CONFIGURERS[newType] = configFunction;\n }",
"function isBlockType(name) {\n return !!blockTypes[name];\n }",
"function newBlock(block, reply) {\n /* we use two different patterns describing the URL: the URL pattern is used for\n the webRequest event listeners and uses the scheme defined for webextensions; the\n RegExp pattern is used to figure out which URL pattern was actually triggered\n */\n const regExpPattern = createURLRegExp(block.url); // for use in finding the time until its blocked\n const filterPattern = createURLPattern(block.url); // for use in urlFilter object\n blockMap.set(regExpPattern, { until: block.blockUntil, urlPattern: filterPattern });\n urlFilter.urls.push(filterPattern);\n chrome.webRequest.onBeforeRequest.addListener(checkBlock, urlFilter, ['blocking']);\n console.log(blockMap);\n reply({ message: 'url blocked' });\n}",
"enterTypeReference(ctx) {\n\t}",
"enterTypeVariable(ctx) {\n\t}",
"function addCodeblock() {\r\n\r\n // Disable the codeblock buttons so that multiple codeblocks can't be\r\n // added/saved/removed at once.\r\n changeCodeblockButtons(false);\r\n jQuery(\"#codeblock_add\").button(\"option\", \"label\", \"Adding...\");\r\n\r\n // Request that the server adds a new codeblock.\r\n jQuery.post(ajaxurl, {\r\n\r\n action : 'tw-ajax-codeblock-add'\r\n\r\n }, function(response) {\r\n // Re enable the codeblock buttons now that we've gotten a response from\r\n // the server.\r\n changeCodeblockButtons(true);\r\n jQuery(\"#codeblock_add\")\r\n .button(\"option\", \"label\", \"Add New Code Block\");\r\n\r\n // Only update the UI if the addition of the tab was successful.\r\n if (response.success) {\r\n\r\n // Create a new codeblock object and populate it with data from the\r\n // server.\r\n codeblocks[response.block_id] = {\r\n block_name : response.block_name,\r\n block_code : response.block_code,\r\n block_color : response.block_color\r\n };\r\n\r\n // Add a new tab to the UI.\r\n var $codeblock_tabs = jQuery('#codeblock_tabs');\r\n $codeblock_tabs.tabs(\"add\", \"#codeblock_tab_\" + response.block_id,\r\n response.block_name);\r\n\r\n // Select the newly created tab, thus triggering a form update.\r\n $codeblock_tabs.tabs(\"select\", \"#codeblock_tab_\"\r\n + response.block_id);\r\n }\r\n\r\n });\r\n}",
"addSymbol(name, range, type) {\n const key = name.toLowerCase();\n if (!this.symbolMap.has(key)) {\n this.symbolMap.set(key, []);\n }\n this.symbolMap.get(key).push({\n name: name,\n range: range,\n type: type\n });\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Merge the two, cdnjs libs takes precedence. sanitize pkg.names for both sources, lowercasing all, replacing spaces by ``. Generates a single `gimme.json` file with following props: name: package's name, lowercased, spaces replaced by `` description: package's description version: package's version, if provided (case of cdnjs only) homepage: package's homepage, for microjs this is the url prop keywords: package's keyword, case of microjs this is the tags prop repo: package's remote repository, format is user/repo branch: package's remote repo branch source: string or array of strings mapping the filepaths to fetch. in case of cdnjs, needs to be guessed from name/version/filename. | function merge(cdnjs, microjs, app, cb) {
var pkgs = [];
microjs = microjs.map(function(pkg) {
pkg.name = sanitize(pkg.name);
pkg.origin = 'microjs';
return pkg;
});
// merge the two, cdnjs libs takes precedence
var names = cdnjs.map(function(pkg) {
pkg.origin = 'cdnjs';
return sanitize(pkg.name);
});
microjs = microjs.filter(function(pkg) {
// filter out any libs already present in cdnjs packages
return !~names.indexOf(sanitize(pkg.name));
});
pkgs = pkgs.concat(cdnjs).concat(microjs);
// now, try to standardize...
pkgs = pkgs.map(function(pkg) {
var o = {
name: pkg.name,
description: pkg.description,
version: pkg.version || '',
homepage: pkg.homepage || pkg.url || '',
keywords: pkg.keywords || pkg.tags,
repo: guess('repo', pkg),
branch: guess('branch', pkg),
source: guess('source', pkg),
repositories: guess('repositories', pkg),
origin: pkg.origin
};
o[pkg.origin] = true;
return o;
});
// filter out any invalid packages, just testing pkg.name
pkgs = pkgs.filter(function(pkg) { return pkg.name; });
pkgs = pkgs.sort(function(a, b) {
// todo: true sort
return a.name < b.name;
});
fs.writeFile(path.join(app.get('prefix'), 'gimme.json'), JSON.stringify(pkgs, null, 2), cb);
} | [
"async function generatePackageJson() {\n const original = require('../package.json')\n const result = {\n name: original.name,\n author: original.author,\n version: original.version,\n license: original.license,\n description: original.description,\n main: './index.js',\n dependencies: Object.entries(original.dependencies).filter(([name, version]) => original.external.indexOf(name) !== -1).reduce((object, entry) => ({ ...object, [entry[0]]: entry[1] }), {})\n }\n await writeFile('dist/package.json', JSON.stringify(result))\n}",
"function load(force, cb) {\n if(!cb) cb = force, force = false;\n var done = {};\n app = this,\n config = app.get();\n\n var packages = path.join(app.get('prefix'), 'cdnjs'),\n datajs = path.join(app.get('prefix'), 'microjs'),\n dictionnary = path.join(app.get('prefix'), 'gimme.json');\n\n if(path.existsSync(dictionnary)) return cb();\n\n app.log.info('Fetching cdnjs and microjs packages dictionnary.');\n fetch.github('cdnjs', 'website', 'gh-pages', packages, next('cdnjs'));\n fetch.github('madrobby', 'microjs.com', 'master', datajs, function(e) {\n if(e) return cb(e);\n\n var datajson = path.join(datajs, 'data.json');\n\n // only go further if data.json does not exist\n fs.stat(datajson, function(e) {\n if(!e && !force) return next('microjs')();\n\n // data.js is JavaScript, run in a new context, taking the result.\n // building the data.json according file\n fs.readFile(path.join(datajs, 'data.js'), 'utf8', function(e, body) {\n if(e) return cb(e);\n var sandbox = {};\n vm.runInNewContext(body, sandbox);\n fs.writeFile(datajson, JSON.stringify(sandbox.MicroJS, null, 2), function(e) {\n if(e) return cb(e);\n next('microjs')();\n });\n });\n });\n });\n\n\n function next(from) { return function (err) {\n if(err) return cb(err);\n done[from] = true;\n if(!done.cdnjs || !done.microjs) return;\n\n fs.stat(dictionnary, function(err) {\n if(!err && !force) return cb();\n var cdnjs, microjs;\n fs.readFile(path.join(packages, 'packages.json'), 'utf8', function(err, body) {\n if(err) return cb(err);\n cdnjs = JSON.parse(body);\n if(cdnjs && microjs) merge(cdnjs.packages, microjs, app, cb);\n });\n\n fs.readFile(path.join(datajs, 'data.json'), 'utf8', function(err, body) {\n if(err) return cb(err);\n microjs = JSON.parse(body);\n if(cdnjs && microjs) merge(cdnjs.packages, microjs, app, cb);\n });\n });\n }}\n}",
"async function update_package_jsons() {\n const pkg = JSON.parse(fs.readFileSync(\"./package.json\"));\n pkg.version = NEW_VERSION;\n const pkg_json = `${JSON.stringify(pkg, undefined, 4)}\\n`;\n fs.writeFileSync(\"../package.json\", pkg_json);\n const packages = {};\n for (const ws of pkg.workspaces) {\n for (const path of glob(`${ws}/package.json`, {\n sync: true,\n })) {\n const pkg = JSON.parse(fs.readFileSync(path));\n pkg.version = NEW_VERSION;\n packages[pkg.name] = {\n pkg,\n path,\n };\n }\n }\n for (const pkg_name of Object.keys(packages)) {\n const { pkg, path } = packages[pkg_name];\n for (const deptype of [\n \"dependencies\",\n \"devDependencies\",\n \"peerDependencies\",\n ]) {\n if (pkg[deptype]) {\n for (const dep of Object.keys(pkg[deptype])) {\n if (packages[dep] !== undefined) {\n pkg[deptype][dep] = `^${NEW_VERSION}`;\n }\n }\n }\n }\n const pkg_json = `${JSON.stringify(pkg, undefined, 4)}\\n`;\n fs.writeFileSync(path, pkg_json);\n sh`git add ${path}`.runSync();\n }\n}",
"function concatPackage (pack, outDir, minified) {\n if (_.contains(concatedPkgs, path.basename(pack))) return;\n\n var bowerFile = 'bower.json';\n\n if (! fs.existsSync(path.join(pack, bowerFile)))\n bowerFile = '.bower.json';\n\n var regularJSON = JSON.parse(\n fs.readFileSync(path.join(pack, bowerFile))\n );\n var bowerJSON = json.normalize(regularJSON);\n var deps = bowerJSON.dependencies || {};\n var mains = bowerJSON.main || [];\n\n concatedPkgs.push(path.basename(pack));\n\n _.each(Object.keys(deps), function (pkg, i, l) {\n var components = pack.split(path.sep);\n var pkgpath = components.slice(0, -1).join(path.sep);\n\n concatPackage(path.join(pkgpath, pkg), outDir, minified);\n });\n\n debug('concatenating package ' + path.basename(pack) + '...');\n\n var files = constructFileList(pack, mains, minified);\n var concatJS = '', concatCSS = '';\n\n _.each(files, function (filepath, i, l) {\n var contents = fs.readFileSync(filepath) + '\\n';\n var ext = filepath.split('.')[filepath.split('.').length - 1];\n\n if (ext === 'js' || ext === 'css')\n debug('including file ' + filepath + '...');\n\n if (ext === 'js')\n concatJS += contents;\n else if (ext === 'css')\n concatCSS += contents;\n });\n\n if (concatJS !== '' || concatCSS !== '')\n debug('writing files...');\n\n if (concatJS !== '')\n fs.appendFileSync(path.join(outDir, 'build.js'), concatJS);\n\n if (concatCSS !== '')\n fs.appendFileSync(path.join(outDir, 'build.css'), concatCSS);\n}",
"function whoss(options) {\n taim_1.default('Total Processing', bluebird_1.default.all([\n taim_1.default('Npm Licenses', npm_1.getNpmLicenses(options)),\n ]))\n .catch(function (err) {\n console.log(err);\n process.exit(1);\n })\n .spread(function (npmOutput) {\n var o = {};\n npmOutput = npmOutput || {};\n lodash_1.default.concat(npmOutput).forEach(function (v) {\n o[v.name] = v;\n });\n var userOverridesPath = path_1.default.join(options.outputDir, 'overrides.json');\n if (fs_jetpack_1.default.exists(userOverridesPath)) {\n var userOverrides = fs_jetpack_1.default.read(userOverridesPath, 'json');\n console.log('Using overrides:', userOverrides);\n // foreach override, loop through the properties and assign them to the base object.\n o = lodash_1.default.defaultsDeep(userOverrides, o);\n }\n return o;\n })\n .catch(function (e) {\n console.error('ERROR processing overrides', e);\n process.exit(1);\n })\n .then(function (licenseInfos) {\n var attributionSequence = lodash_1.default(licenseInfos)\n .filter(function (licenseInfo) { return licenseInfo && !licenseInfo.ignore && licenseInfo.name !== undefined; })\n .sortBy(function (licenseInfo) { return licenseInfo.name.toLowerCase(); })\n .map(function (licenseInfo) {\n return [\n licenseInfo.name,\n licenseInfo.version + \" <\" + licenseInfo.url + \">\",\n licenseInfo.licenseText ||\n \"license: \" + licenseInfo.license + os_1.default.EOL + \"authors: \" + licenseInfo.authors\n ].join(os_1.default.EOL);\n })\n .value();\n var attribution = attributionSequence.join(constants_1.DEFAULT_SEPARATOR);\n var headerPath = path_1.default.join(options.outputDir, 'header.txt');\n if (fs_jetpack_1.default.exists(headerPath)) {\n var template = fs_jetpack_1.default.read(headerPath);\n console.log('using template', template);\n attribution = template + os_1.default.EOL + os_1.default.EOL + attribution;\n }\n fs_jetpack_1.default.write(path_1.default.join(options.outputDir, 'licenseInfos.json'), JSON.stringify(licenseInfos));\n return fs_jetpack_1.default.write(path_1.default.join(options.outputDir, 'attribution.txt'), attribution);\n })\n .catch(function (e) {\n console.error('ERROR writing attribution file', e);\n process.exit(1);\n })\n .then(function () {\n console.log('done');\n process.exit();\n });\n}",
"function concatPackages (packages, outDir, minified) {\n if (! outDir) outDir = path.join('.', 'build');\n\n if (!fs.existsSync(outDir)) fs.mkdirSync(outDir);\n var jsFileName = path.join(outDir, 'build.js');\n if (fs.existsSync(jsFileName)){\n fs.truncateSync(jsFileName, 0);\n }\n var cssFileName = path.join(outDir, 'build.css');\n if (fs.existsSync(cssFileName)){\n fs.truncateSync(cssFileName, 0);\n }\n _.each(packages, function (pack, i, l) {\n concatPackage(pack, outDir, minified);\n });\n}",
"function populateApplicationPackageJSON(\n applicationName,\n convertedAppDir,\n { packagesDir, packagesDirName, packagesThatShouldBeLibs }\n) {\n const appPackageJSON = readJsonSync(\n join(\"..\", \"conversion-data\", applicationName, \"package.json\")\n );\n const appPackageJSONFileLocation = join(convertedAppDir, \"package.json\");\n\n for (const packageDir of readdirSync(packagesDir)) {\n const isNotLib = packagesThatShouldBeLibs.includes(packageDir) === false;\n const isPackage = isPackageDirectory(packagesDir, packageDir);\n\n if (isNotLib && isPackage) {\n appPackageJSON.dependencies[\n packageDir\n ] = `file:../../${packagesDirName}/${packageDir}`;\n }\n }\n\n writeJsonSync(appPackageJSONFileLocation, appPackageJSON, { spaces: 2 });\n}",
"function derivePackageConfig(pjson, override) {\n var dpjson = extend({}, pjson);\n\n // apply the jspm internal overrides first\n if (pjson.jspm) {\n if (pjson.jspm.dependencies && !pjson.registry)\n pjson.registry = 'jspm';\n extend(dpjson, pjson.jspm);\n delete dpjson.jspm;\n }\n\n if (override)\n extend(dpjson, override);\n\n // finally set the derived package.json as the \"jspm\" property on the package.json\n return dpjson;\n}",
"function mergePackageJsonWithYarnEntry(entries, mod) {\n const entry = findMatchingYarnEntryByNameAndVersion(entries, mod);\n if (!entry) {\n throw new Error(\"No matching node_module found for this module\", mod);\n }\n\n // Use the bazelified name as the module name\n mod.original_name = mod.name\n mod.name = entry.name\n // Store everything else here\n mod.yarn = entry;\n}",
"async function changePackages() {\n const packages = await getPackages()\n\n await Promise.all(\n packages.map(async ({ pkg, path: pkgPath }) => {\n // you can transform the package.json contents here\n\n if (\n pkg.files &&\n pkg.files.includes('lib') &&\n pkg.name !== 'babel-plugin-emotion'\n ) {\n pkg.files = pkg.files.map(file => (file === 'lib' ? 'dist' : file))\n }\n\n await writeFile(\n path.resolve(pkgPath, 'package.json'),\n JSON.stringify(pkg, null, 2) + '\\n'\n )\n })\n )\n}",
"function copyAssets(done) {\n var assets = {\n js: [\n \"./node_modules/jquery/dist/jquery.js\",\n \"./node_modules/bootstrap/dist/js/bootstrap.bundle.js\",\n \"./node_modules/metismenujs/dist/metismenujs.min.js\",\n \"./node_modules/jquery-slimscroll/jquery.slimscroll.js\",\n \"./node_modules/feather-icons/dist/feather.min.js\",\n ]\n };\n\n var third_party_assets = {\n css_js: [\n {\"name\": \"sortablejs\", \"assets\": [\"./node_modules/sortablejs/Sortable.min.js\"]},\n {\"name\": \"apexcharts\", \"assets\": [\"./node_modules/apexcharts/dist/apexcharts.min.js\"]},\n {\"name\": \"parsleyjs\", \"assets\": [\"./node_modules/parsleyjs/dist/parsley.min.js\"]},\n {\"name\": \"smartwizard\", \"assets\": [\"./node_modules/smartwizard/dist/js/jquery.smartWizard.min.js\", \n \"./node_modules/smartwizard/dist/css/smart_wizard.min.css\", \n \"./node_modules/smartwizard/dist/css/smart_wizard_theme_arrows.min.css\", \n \"./node_modules/smartwizard/dist/css/smart_wizard_theme_circles.min.css\",\n \"./node_modules/smartwizard/dist/css/smart_wizard_theme_dots.min.css\"\n ]},\n {\"name\": \"summernote\", \"assets\": [\"./node_modules/summernote/dist/summernote-bs4.min.js\", \"./node_modules/summernote/dist/summernote-bs4.css\"]},\n {\"name\": \"dropzone\", \"assets\": [\"./node_modules/dropzone/dist/min/dropzone.min.js\", \"./node_modules/dropzone/dist/min/dropzone.min.css\"]},\n {\"name\": \"bootstrap-tagsinput\", \"assets\": [\"./node_modules/@adactive/bootstrap-tagsinput/dist/bootstrap-tagsinput.min.js\", \"./node_modules/@adactive/bootstrap-tagsinput/dist/bootstrap-tagsinput.css\"]},\n {\"name\": \"select2\", \"assets\": [\"./node_modules/select2/dist/js/select2.min.js\", \"./node_modules/select2/dist/css/select2.min.css\"]},\n {\"name\": \"multiselect\", \"assets\": [\"./node_modules/multiselect/js/jquery.multi-select.js\", \"./node_modules/multiselect/css/multi-select.css\"]},\n {\"name\": \"flatpickr\", \"assets\": [\"./node_modules/flatpickr/dist/flatpickr.min.js\", \"./node_modules/flatpickr/dist/flatpickr.min.css\"]},\n {\"name\": \"bootstrap-colorpicker\", \"assets\": [\"./node_modules/bootstrap-colorpicker/dist/js/bootstrap-colorpicker.min.js\", \"./node_modules/bootstrap-colorpicker/dist/css/bootstrap-colorpicker.min.css\"]},\n {\"name\": \"bootstrap-touchspin\", \"assets\": [\"./node_modules/bootstrap-touchspin/dist/jquery.bootstrap-touchspin.min.js\", \"./node_modules/bootstrap-touchspin/dist/jquery.bootstrap-touchspin.css\"] },\n {\n \"name\": \"datatables\", \"assets\": [\"./node_modules/datatables.net/js/jquery.dataTables.min.js\",\n \"./node_modules/datatables.net-bs4/js/dataTables.bootstrap4.min.js\",\n \"./node_modules/datatables.net-responsive/js/dataTables.responsive.min.js\",\n \"./node_modules/datatables.net-responsive-bs4/js/responsive.bootstrap4.min.js\",\n \"./node_modules/datatables.net-buttons/js/dataTables.buttons.min.js\",\n \"./node_modules/datatables.net-buttons-bs4/js/buttons.bootstrap4.min.js\",\n \"./node_modules/datatables.net-buttons/js/buttons.html5.min.js\",\n \"./node_modules/datatables.net-buttons/js/buttons.flash.min.js\",\n \"./node_modules/datatables.net-buttons/js/buttons.print.min.js\",\n \"./node_modules/datatables.net-keytable/js/dataTables.keyTable.min.js\",\n \"./node_modules/datatables.net-select/js/dataTables.select.min.js\",\n \"./node_modules/datatables.net-bs4/css/dataTables.bootstrap4.min.css\",\n \"./node_modules/datatables.net-responsive-bs4/css/responsive.bootstrap4.min.css\",\n \"./node_modules/datatables.net-buttons-bs4/css/buttons.bootstrap4.min.css\",\n \"./node_modules/datatables.net-select-bs4/css/select.bootstrap4.min.css\"\n ]\n },\n {\"name\": \"moment\", \"assets\": [\"./node_modules/moment/min/moment.min.js\"]},\n {\"name\": \"fullcalendar-bootstrap\", \"assets\": [\"./node_modules/@fullcalendar/bootstrap/main.min.js\", \n \"./node_modules/@fullcalendar/bootstrap/main.min.css\",\n ]\n },\n {\"name\": \"fullcalendar-core\", \"assets\": [\"./node_modules/@fullcalendar/core/main.min.js\", \n \"./node_modules/@fullcalendar/core/main.min.css\",\n ]\n },\n {\"name\": \"fullcalendar-daygrid\", \"assets\": [\"./node_modules/@fullcalendar/daygrid/main.min.js\", \n \"./node_modules/@fullcalendar/daygrid/main.min.css\"\n ]\n },\n {\"name\": \"fullcalendar-interaction\", \"assets\": [\"./node_modules/@fullcalendar/interaction/main.min.js\"]},\n {\n \"name\": \"fullcalendar-timegrid\", \"assets\": [\"./node_modules/@fullcalendar/timegrid/main.min.js\",\n \"./node_modules/@fullcalendar/timegrid/main.min.css\"]\n },\n {\n \"name\": \"fullcalendar-list\", \"assets\": [\"./node_modules/@fullcalendar/list/main.min.js\",\n \"./node_modules/@fullcalendar/list/main.min.css\"]\n },\n {\"name\": \"list-js\", \"assets\": [\"./node_modules/list.js/dist/list.min.js\"]},\n {\n \"name\": \"jqvmap\", \"assets\": [\"./node_modules/jqvmap/dist/jquery.vmap.min.js\", \n \"./node_modules/jqvmap/dist/jqvmap.min.css\",\n \"./node_modules/jqvmap/dist/maps/jquery.vmap.usa.js\",\n ]\n },\n ]\n };\n\n //copying third party assets\n lodash(third_party_assets).forEach(function (assets, type) {\n if (type == \"css_js\") {\n lodash(assets).forEach(function (plugin) {\n var name = plugin['name'];\n var assetlist = plugin['assets'];\n lodash(assetlist).forEach(function (asset) {\n gulp.src(asset).pipe(gulp.dest(folder.dist_assets + \"libs/\" + name));\n });\n });\n //gulp.src(assets).pipe(gulp.dest(folder.dist_assets + \"css/vendor\"));\n }\n });\n\n //copying required assets\n lodash(assets).forEach(function (assets, type) {\n if (type == \"scss\") {\n gulp\n .src(assets)\n .pipe(\n rename({\n // rename aaa.css to _aaa.scss\n prefix: \"_\",\n extname: \".scss\"\n })\n )\n .pipe(gulp.dest(folder.src + \"scss/vendor\"));\n } else {\n gulp.src(assets).pipe(gulp.dest(folder.src + \"js/vendor\"));\n }\n });\n\n //copying data files\n gulp.src(folder.src + \"data/**\").pipe(gulp.dest(folder.dist_assets + \"/data\"));\n\n done();\n}",
"function getUserNpmInput() {\n\n console.log('');\n\n const npmrcPath = __dirname + '/../.npmrc';\n const yarnPath = __dirname + '/../.yarnrc';\n\n const npmRegExp = {\n name: /init[.-]author[.-]name =? ?[\"']?([^\"']*)[\"']?\\n/,\n email: /init[.-]author[.-]email =? ?[\"']?([^\"']*)[\"']?\\n/,\n url: /init[.-]author[.-]url =? ?[\"']?([^\"']*)[\"']?\\n/,\n license: /init[.-]license =? ?[\"']?([^\"']*)[\"']?\\n/,\n version: /init[.-]version =? ?[\"']?([^\"']*)[\"']?\\n/\n }\n\n let npmrc = '';\n\n if (fs.existsSync(npmrcPath)) {\n npmrc = fs.readFileSync(npmrcPath, 'utf8');\n } else if (fs.existsSync(yarnPath)) {\n npmrc = fs.readFileSync(yarnPath, 'utf8');\n }\n\n if (npmrc !== '') {\n\n let name = npmrc.match(npmRegExp.name) === null ? 'Author Name' :\n npmrc.match(npmRegExp.name)[1];\n let email = npmrc.match(npmRegExp.email) === null ? 'author.name@authordomain.com' :\n npmrc.match(npmRegExp.email)[1];\n let url = npmrc.match(npmRegExp.url) === null ? 'https://authordomain.com' :\n npmrc.match(npmRegExp.url)[1];\n let license = npmrc.match(npmRegExp.license) === null ? 'MIT' :\n npmrc.match(npmRegExp.license)[1];\n let version = npmrc.match(npmRegExp.version) === null ? '0.0.0' :\n npmrc.match(npmRegExp.version)[1];\n\n npmData = {\n name: name,\n email: email,\n url: url,\n license: license,\n version: version\n }\n } else {\n npmData = {\n name: 'Author Name',\n email: 'author.name@authordomain.com',\n url: 'https://authordomain.com',\n license: 'MIT',\n version: '0.0.0'\n }\n }\n\n let adjustedNpmPrompts = [];\n\n if (promptFlag) {\n for (let i = 0; i < config.npmConfigPrompts.length; i++) {\n if (npmData[config.npmConfigPrompts[i].name] !== undefined) {\n adjustedNpmPrompts.push(config.npmConfigPrompts[i]);\n adjustedNpmPrompts[i].default =\n npmData[adjustedNpmPrompts[i].name];\n }\n }\n }\n\n cli.prompt(adjustedNpmPrompts, function (answers) {\n\n Object.assign(npmData, answers);\n generate();\n\n });\n}",
"async function warmNpmCache() {\n console.log(' Warm NPM cache for project template deps.');\n\n // cwd is the root dir where snapp-cli's package.json is located.\n const jsProj = fs.readFileSync('templates/project/package.json', 'utf8');\n const tsProj = fs.readFileSync('templates/project-ts/package.json', 'utf8');\n\n let jsProjDeps = {\n ...JSON.parse(jsProj).dependencies,\n ...JSON.parse(jsProj).devDependencies,\n };\n\n let tsProjDeps = {\n ...JSON.parse(tsProj).dependencies,\n ...JSON.parse(tsProj).devDependencies,\n };\n\n for (prop in tsProjDeps) {\n if (jsProjDeps[prop] && jsProjDeps[prop] === tsProjDeps[prop]) {\n delete tsProjDeps[prop];\n }\n }\n\n const allUniqueDeps = { ...jsProjDeps, ...tsProjDeps };\n\n let toCache = [];\n for (const pkgName in allUniqueDeps) {\n toCache.push(`${pkgName}@${allUniqueDeps[pkgName]}`);\n }\n\n try {\n await shExec(`npm cache add ${toCache.join(' ')}`);\n console.log(' Done.');\n } catch (err) {\n console.error(err);\n }\n}",
"function update_package_file_version() {\r\n\tconst package_file_path = library_base_directory + 'package.json';\r\n\tlet package_file_content = CeL.read_file(package_file_path).toString()\r\n\t\t// version stamp\r\n\t\t.replace(/(\"version\"[\\s\\n]*:[\\s\\n]*\")[^\"]*(\")/, function (all, header, footer) {\r\n\t\t\treturn header + CeL.version + footer;\r\n\t\t});\r\n\tCeL.write_file(package_file_path, package_file_content, { changed_only: true });\r\n}",
"function getPackageJson(cwd, opts) {\n if ($._.isObject(opts.bowerJson)) {\n return opts.bowerJson;\n }\n\n if ($.fs.existsSync(opts.bowerJson)) {\n return JSON.parse($.fs.readFileSync(opts.bowerJson));\n }\n\n var bowerJsonFile = $.path.join(cwd, './bower.json');\n if ($.fs.existsSync(bowerJsonFile)) {\n return JSON.parse($.fs.readFileSync(bowerJsonFile));\n }\n\n //if the bower.json file doesn't exists\n //look for the @bower_components dependencies in package.json\n //from migration of `bower-away` (https://github.com/sheerun/bower-away)\n // Understand why here: https://bower.io/blog/2017/how-to-migrate-away-from-bower/\n\n var packageObj;\n\n if ($._.isObject(opts.packageJson)) {\n packageObj = opts.packageJson;\n } else {\n var packageJsonFile = opts.packageJson;\n\n if (opts.packageJson && !$.fs.existsSync(packageJsonFile)) {\n packageJsonFile = $.path.join($.path.dirname(opts.packageJson), './package.json');\n }\n\n if (opts.bowerJson && !$.fs.existsSync(packageJsonFile)) {\n packageJsonFile = $.path.join($.path.dirname(bowerJsonFile), './package.json');\n }\n\n if (!$.fs.existsSync(packageJsonFile)) {\n packageJsonFile = $.path.join(cwd, './package.json');\n }\n\n if (!$.fs.existsSync(packageJsonFile)) {\n var error = new Error('Cannot find where you keep your package.json.');\n error.code = 'YARN_COMPONENTS_MISSING';\n config.get('on-error')(error);\n }\n packageJsonFile = $.path.resolve(packageJsonFile);\n // console.log(`Using package.json file from ${packageJsonFile}`);\n packageObj = JSON.parse($.fs.readFileSync(packageJsonFile));\n }\n\n var dependencies = {};\n var devDependencies = {};\n var bowerScope = config.get('scope');\n if (config.get('verbose')) {\n console.log(`Using scope [${bowerScope}]`);\n }\n if ($._.isEmpty(bowerScope)) {\n //without scope dependencies\n Object.keys(packageObj.dependencies || {})\n .forEach(function(dep) {\n if (!dep.startsWith('@')) {\n dependencies[dep] = packageObj.dependencies[dep];\n }\n });\n\n Object.keys(packageObj.devDependencies || {})\n .forEach(function(dep) {\n if (!dep.startsWith('@')) {\n devDependencies[dep] = packageObj.devDependencies[dep];\n }\n });\n } else {\n //scoped dependencies only\n Object.keys(packageObj.dependencies || {})\n .forEach(function(dep) {\n if (dep.indexOf(bowerScope) !== -1) {\n dependencies[dep.replace(bowerScope, '')] = packageObj.dependencies[dep];\n }\n });\n\n Object.keys(packageObj.devDependencies || {})\n .forEach(function(dep) {\n if (dep.indexOf(bowerScope) !== -1) {\n devDependencies[dep.replace(bowerScope, '')] = packageObj.devDependencies[dep];\n }\n });\n }\n\n var fakeBowerJson = {\n fakeBower: true,\n name: packageObj.name,\n version: packageObj.version,\n main: packageObj.main,\n dependencies: dependencies,\n devDependencies: devDependencies\n };\n\n // console.log(fakeBowerJson);\n return fakeBowerJson;\n}",
"function updateModulesPackages() {\n return through2.obj(function(file, enc, cb) {\n if (file.isNull()) {\n cb(null, file);\n return;\n }\n\n if (file.isStream()) {\n cb(new gulputil.PluginError('convertPackageMain', 'Streaming not supported'));\n return;\n }\n\n const pkg = JSON.parse(file.contents.toString());\n\n // Update package.main to point at babel-renamed files\n if (pkg.main && path.extname(pkg.main) === '.jsx') {\n pkg.main = pkg.main.substr(0, pkg.main.length - 1);\n }\n\n // Update dependencies to load shrine modules locally\n pkg.dependencies = Object.keys(pkg.dependencies || {}).reduce(\n (dependencies, dependencyName) => {\n if (dependencyName.indexOf(`${MODULE_PREFIX}/`) === 0) {\n dependencies[dependencyName] = path.resolve(path.join(MODULES_BUILD_DIR, dependencyName));\n } else {\n dependencies[dependencyName] = pkg.dependencies[dependencyName];\n }\n\n return dependencies;\n },\n {}\n );\n\n file.contents = new Buffer(JSON.stringify(pkg, null, 2));\n this.push(file);\n\n cb();\n });\n}",
"function addMaterialToPackageJson(options) {\n return (host) => {\n package_1.addPackageToPackageJson(host, 'dependencies', '@angular/cdk', lib_versions_1.cdkVersion);\n package_1.addPackageToPackageJson(host, 'dependencies', '@angular/material', lib_versions_1.materialVersion);\n package_1.addPackageToPackageJson(host, 'dependencies', '@angular/animations', lib_versions_1.angularVersion);\n return host;\n };\n}",
"async function getConfigFromPackageJson() {\n const { repository } = await utils_1.loadPackageJson();\n if (!repository) {\n return;\n }\n const { owner, name } = parse_github_url_1.default(typeof repository === \"string\" ? repository : repository.url) || {};\n if (!owner || !name) {\n return;\n }\n return {\n repo: name,\n owner,\n };\n}",
"function dtsBundler() {\n const packageDirectories = fs.readdirSync(PACKAGES_DIRECTORY);\n packageDirectories.forEach((packageDirectory) => {\n const main = path.join(PACKAGES_DIRECTORY, packageDirectory, './index.d.ts');\n fs.access(main, fs.constants.F_OK, (error) => {\n if (error) {\n return;\n }\n const isAllInOne = packageDirectory === ALL_IN_ONE_PACKAGE;\n if (!isAllInOne) {\n // Only the all-in-one package should generate a d.ts bundle\n return;\n }\n\n // d.ts file exists\n const packagePath = path.join(PACKAGES_DIRECTORY, packageDirectory);\n const name = JSON.parse(fs.readFileSync(path.join(packagePath, 'package.json'), 'utf8')).name;\n const destBasename\n = isAllInOne ? packageDirectory : `mdc.${toCamelCase(packageDirectory.replace(/^mdc-/, ''))}`;\n const destFilename = path.join(packagePath, 'dist', `${destBasename}.d.ts`);\n console.log(`Writing UMD declarations in ${destFilename.replace(process.cwd() + '/', '')}`);\n dts.bundle({\n name,\n main,\n out: destFilename,\n });\n });\n });\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
sets the default 1616 grid size when page is loaded | function setDefaultGrid() {
setGridSize(16);
fillGrid(16);
} | [
"function changeGridSize() {\n value = sizeSlider.value;\n container.innerHTML = \"\";\n makeRows(value, value);\n displayGridSlider.innerHTML = value.toString() + \"x\" + value.toString();\n}",
"function setSizes() {\n if (!currentMap) return;\n\n const viewMaxWidth = canvasElement.width - dpi(40);\n const viewMaxHeight = canvasElement.height - dpi(40);\n const tileWidth = Math.floor(viewMaxWidth / currentMap.cols);\n const tileHeight = Math.floor(viewMaxHeight / currentMap.rows);\n\n tileSize = Math.min(tileWidth, tileHeight);\n viewWidth = tileSize * currentMap.cols;\n viewHeight = tileSize * currentMap.rows;\n viewX = (canvasElement.width - viewWidth) / 2;\n viewY = (canvasElement.height - viewHeight) / 2;\n}",
"function changeGridSize(){\r\n let cellsToDelete = Array.prototype.slice.apply(document.querySelectorAll('.cell'))\r\n cellsToDelete.forEach((cell) => {gridContainer.removeChild(cell)})\r\n\r\n let gridValue = gridSize.value\r\n console.log(gridValue,\"GV\")\r\n createGrid(gridValue)\r\n}",
"function setLandingSize() {\r\n\tappContainer_Ls.css({\r\n\t\t'width' : appContainerWidth_Ls,\r\n\t\t'height' : appContainerHeight_Ls,\r\n\t\t'margin-top': appContainer_marginTop_Ls\r\n\t});\r\n}",
"function initSizeParamsHor(){\n\t\t\n\t\tvar arrThumbs = g_objInner.children(\".ug-thumb-wrapper\");\n\t\tvar firstThumb = jQuery(arrThumbs[0]);\n\t\tvar thumbsRealHeight = firstThumb.outerHeight();\n\n\t\t//set grid size\n\t\tvar gridWidth = g_temp.gridWidth;\n\t\tvar gridHeight = g_options.grid_num_rows * thumbsRealHeight + (g_options.grid_num_rows-1) * g_options.grid_space_between_rows;\n\t\t\n\t\tg_temp.gridHeight = gridHeight;\n\t\t\n\t\tg_functions.setElementSize(g_objGrid, gridWidth, gridHeight);\n\t\n\t\t//set inner size (as grid size, will be corrected after placing thumbs\n\t\tg_functions.setElementSize(g_objInner, gridWidth, gridHeight);\n\t\t\n\t\t//set initial inner size params\n\t\tg_temp.innerWidth = gridWidth;\n\t\tg_temp.innerHeight = gridHeight;\n\t}",
"function setCardSize(){\n if (windowHeight/rangee < gameWidth/column){\n cardSize = windowHeight/rangee*0.7;\n }\n else {\n cardSize = gameWidth/column*0.7;\n }\n}",
"async resize (width, height) {\n this.page.set('viewportSize', {width, height})\n }",
"function updateCanvasScale() {\n cellSize = (window.innerWidth / 100) * gridCellSizePercent;\n cellsPerWidth = parseInt(window.innerWidth / cellSize);\n cellsPerHeight = parseInt((cellsPerWidth * 9) / 21);\n\n canvasWidth = window.innerWidth;\n canvasHeight = cellSize * cellsPerHeight;\n resizeCanvas(canvasWidth, canvasHeight);\n\n if (smallScreen != canvasWidth < minCanvasWidth) {\n smallScreen = canvasWidth < minCanvasWidth;\n if (!smallScreen) {\n ui.showUIByState();\n }\n }\n\n ui.hiscores.resize(false);\n}",
"function SetNextWindowContentSize(size) {\r\n bind.SetNextWindowContentSize(size);\r\n }",
"function makeGrid() {\n\tlet cellSize = 0;\n\tif ($(window).width() < $(window).height()) {\n\t\tcellSize = $(window).width()*0.8*(1/(level + 0.5));\n\t} else {\n\t\tcellSize = $(window).height()*0.8*(1/(level + 0.5));\n\t}\n\tmakeRows(cellSize);\n\tfillRows(cellSize);\n}",
"function newGrid (newSize) {\n $('.row').remove();\n createGrid(newSize);\n // $('.column').outerHeight(oldSize*oldPixel/newSize);\n // $('.column').outerWidth(oldSize*oldPixel/newSize);\n}",
"function resizeHandler() {\n\tvar contentHeight = $('.content').height(),\n\t\tboxHeight = $('.info_box').height(),\n\t\tpageData = CLUB.pageData,\n\t\tpageSize = Math.floor(contentHeight/(boxHeight + 15));\n\tif(pageData.pageSize !== pageSize) {\n\t\tpageData.pageSize = pageSize;\n\t\tsetPageNumber();\n\t}\n}",
"function setTileSizes() {\n $tileList = mainDiv.find(selector);\n for (var i = 0; i < $tileList.length; i++) {\n var size = $tileList.eq(i).attr(\"data-size\");\n var wdt = tileRatio * baseWH * tileSize[size].w-margin;\n var hgh = baseWH * tileSize[size].h-margin;\n $tileList.eq(i).css({\"width\": wdt, \"height\": hgh}).addClass('w' + tileSize[size].w + ' ' + 'h' + tileSize[size].h);\n }\n }",
"function updateDimensions() {\n theight = templateHeight();\n cheight = containerHeight();\n vpheight = viewPortHeight();\n }",
"function setSizePerElection(aSize) {\n sizePerElection = parseInt(aSize);\n } // setResolution",
"function changeCanvasSize(){ \n\tcanvasSize = canvasSelector.value();\n\tif(canvasSize == 2){\n\t\tmain_canvas = resizeCanvas(1920, 1000);\n\t}\n\telse if(canvasSize == 3){\n\t\tmain_canvas = resizeCanvas(2880, 1500);\n\t}\n\telse {\n\t\tmain_canvas = resizeCanvas(960, 500);\n\t}\n\tclear();\n\tbackground(0);\n\tredraw();\n}",
"function setupDimensions() {\n\t$('.opt').css('width', width/numtabs+'px');\n\t$('.sub').css('width', width+'px');\n\t$('.sub').css('overflow', 'hidden');\n\t$('.controlgroup').css('width', numtabs*width+'px');\n\t$('#camera').css('margin-top', '1px');\n\t$('#camera').css('margin-bottom', '2px');\n\t$('.controlgroup').css('margin-top', '1px');\n\t$('.controlgroup').css('margin-bottom', '2px');\n\t$('#topbar').height($('#back').height());\n\t$('#topbar').css('padding', 'auto auto auto 10px');\n\t$('#back').css('margin', 'auto 10px auto');\n\t$('#text').css('height', (height-4*($('#enter').height()+10)-($('#topbar').height()+6))+'px');\n\t$('#text').css('width', width*3/4-10+'px');\n\t$('#links').css('height', (height-4*($('#enter').height()+10)-($('#topbar').height()+6))+'px');\n\t$('#links').css('width', width/4-10+'px');\n\t$('.bottom_opt').css('width', width/5+'px');\n}",
"gridCellSize() {\n return (gridCellSizePercent * canvasWidth) / 100;\n }",
"function setFullSize() {\r\n\tappContainer_Fs.css({\r\n\t\t'width' : appContainerWidth_Fs,\r\n\t\t'height' : appContainerHeight_Fs,\r\n\t\t'margin-top': appContainer_marginTop_Fs\r\n\t});\r\n\tappContent.css({\r\n\t\t'width' : appContentWidth,\r\n\t\t'height' : appContentHeight,\r\n\t});\t\r\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds premade routes from geoJSON.js file to the map. | function addPremadeRoutes() {
layerToAdd.forEach((tablica, index) => {
var url = 'https://api.mapbox.com/directions/v5/mapbox/driving/' + tablica + '?geometries=geojson&steps=true&&access_token=' + mapboxgl.accessToken;
var req = new XMLHttpRequest();
req.responseType = 'json';
req.open('GET', url, true);
req.onload = function () {
var jsonResponse = req.response;
var coords = jsonResponse.routes[0].geometry;
console.log(coords);
// add the route to the map
addRoute(coords);
};
req.send();
function addRoute(coords) {
// check if the route is already loaded
let color = "";
if (index === 0) color = '#e68580';
if (index === 1) color = '#329999';
if (index === 2) color = '#db9000';
addRouteToTheMap("route" + index, coords, color, 0.8);
map.setLayoutProperty("route" + index, 'visibility', 'none');
};
})
} | [
"function loadMapShapes() {\n // load US state outline polygons from a GeoJson file\n map.data.loadGeoJson('https://storage.googleapis.com/mapsdevsite/json/states.js', {\n idPropertyName: 'STATE'\n });\n\n // wait for the request to complete by listening for the first feature to be\n // added\n google.maps.event.addListenerOnce(map.data, 'addfeature', function() {\n google.maps.event.trigger(document.getElementById('census-variable'),\n 'change');\n });\n}",
"function geojson_asteroid_points_test() {\n $.getJSON(\"{{ url_for('asteroid_map_event') }}\", {},\n function (data) {\n // Add with static style. Need to implement dynamic styles somehow\n layers['point_geoJSON'].addData(data.result);\n }\n )\n}",
"function addPolygons() {\n \n if (typeof postcodeAreas !== 'undefined') {\n postcodeAreas.addTo(mymap);\n legend.addTo(mymap);\n } else {\n postcodeAreas = L.geoJSON(postcodeGeoJSON, {\n onEachFeature: onEachFeature,\n }).addTo(mymap);\n legend.addTo(mymap);\n } \n}",
"function load_map() {\n\tmap = new L.Map('map', {zoomControl: true});\n\n\t// from osmUrl we can change the looks of the map (make sure that any reference comes from open source data)\n\tvar osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',\n\t// var osmUrl = 'https://tiles.wmflabs.org/bw-mapnik/{z}/{x}/{y}.png',\n\t\tosmAttribution = 'Map data © 2012 <a href=\"http://openstreetmap.org\">OpenStreetMap</a> contributors',\n\t\tosm = new L.TileLayer(osmUrl, {maxZoom: 18, attribution: osmAttribution});\n\n\n\t// define the center and zoom level when loading the page (zoom level 3 allows for a global view)\n\tmap.setView(new L.LatLng(20, 10), 3).addLayer(osm);\n\n\n\t$.ajax({\n\t\turl: 'js/doe.csv',\n\t\tdataType: 'text/plain',\n\t}).done(successFunction);\n\n\tfunction successFunction(data) {\n\t\tvar planes = data.split('/\\r?\\n|\\r/');\n\t\tconsole.log(planes);\n\n\t\t// for (var i = 0; i < planes.length; i++) {\n\t\t// \tvar markersplit = planes[i].split(',');\n\t\t// \tmarker = new L.marker([markersplit[3],markersplit[4]]).bindPopup(markersplit[0]).addTo(map);\n\t\t// }\n\n\t}\n\n\n\t// variable to allow to read the points from above and pass that to the marker rendering function\n\n\n\n\t// create layer with all the markers to turn on and off (maybe no need for this)\n\t// var overlayMaps = {\n\t// \t\"Cities\" : marker\n\t// }\n\t// L.control.layers(overlayMaps).addTo(map);\n\n\n}",
"init() {\n this.worldMap.parseMap();\n }",
"function addRouteMarkers() {\n\n // Add start location\n map.addMarker({\n lat: startLocation[0],\n lng: startLocation[1],\n title: \"Start Location: \" + startLocation[2],\n icon: \"images/start.png\"\n });\n\n // Add end location\n if (endLocation != startLocation) {\n map.addMarker({\n lat: endLocation[0],\n lng: endLocation[1],\n title: \"End Location: \" + endLocation[2],\n icon: \"images/end.png\"\n });\n }\n\n // Add all path markers\n for (var i = 0; i < path.length; i++) {\n map.addMarker({\n lat: path[i][0],\n lng: path[i][1],\n title: path[i][2],\n icon: markers[i],\n infoWindow: {\n content: \"<p>\" + path[i][2] + \"</p><p><input onclick='search([\" + path[i][0] + \",\" + path[i][1] + \"], \\\"\\\")'\" + \" type='button' value='Search Nearby'></p>\" + \n \"<span id='marker' class='delete' onclick='cancelStopMarker(\\\"\" + path[i][2] + \"\\\")'><img src='images/cancel.png' alt='cancel' /></span>\"\n }\n });\n }\n\n fitMap();\n}",
"function addGeoJsonFeatures(layer, features) {\n\t\tlayer.getSource().addFeatures(\n\t\t\t(new ol.format.GeoJSON()).readFeatures(\n\t\t\t\tturf.featurecollection(features), {\n\t\t\t\t\tdataProjection: 'EPSG:4326',\n\t\t\t\t\tfeatureProjection: 'EPSG:3857'\n\t\t\t\t}\n\t\t\t)\n\t\t);\n\t}",
"function addMarkers(map) {\n // create AJAX request\n var xhttp = new XMLHttpRequest();\n\n // define behaviour for a response\n xhttp.onreadystatechange = function() {\n if(this.readyState == 4 && this.status == 200) {\n hotels = JSON.parse(xhttp.responseText);\n for(i=0; i<hotels.length; i++) {\n // convert parts of the hotels address variables and concatenate them\n var address = hotels[i].number + \" \" + hotels[i].street + \", \" + hotels[i].suburb + \", \" + hotels[i].city + \", \" + hotels[i].state + \", \" + hotels[i].country;\n var markerTitle = \"Hotel Name: \" + hotels[i].hotelName + \"\\nPrice: \" + hotels[i].price;\n\n // geocode address variable\n var geocoder = new google.maps.Geocoder();\n geocoder.geocode({\"address\":address}, function(results,status) {\n // if valid location\n if(status = \"OK\") {\n var marker = new google.maps.Marker({\n position: results[0].geometry.location,\n title: markerTitle\n });\n marker.setMap(map)\n }\n });\n }\n } \n }\n\n // initiate connection\n xhttp.open(\"GET\", \"hotels.json\", true);\n\n // send request\n xhttp.send();\n}",
"function updateRoutes(){\n vm.map.cleanRoute();\n var locations = vm.map.markers.filter(function(el){\n return el.hasOwnProperty('location') && !el.location.isVisited;\n }).forEach(function(el){\n el.path.origin = [vm.user.position.lat(), vm.user.position.lng()];\n vm.map.drawRoute(el.path);\n });\n }",
"loadRoutes() {\n this._routes = this.loadConfigFile('routes') || function() {};\n }",
"function loadDefaultElementsOnMap (){\n\n map.on('load', function(){\n\n try {\n\n // source and layer UPZ polygons\n addSourceMap(ID_UPZ_SOURCE, UPZ_POL_LOCAL_PATH, 'geojson');\n addLayerPolygonOnMap(ID_LAYER_UPZ, ID_UPZ_SOURCE, 'none', '#3CB8FB', '#FFFFFF');\n\n // source and layer localities polygons\n addSourceMap(ID_LOCALITIES_SOURCE, LCL_POL_LOCAL_PATH, 'geojson');\n addLayerPolygonOnMap(ID_LAYER_LCL, ID_LOCALITIES_SOURCE, 'none', '#3CB8FB', '#FFFFFF');\n\n addSourceMap(ID_CAT_ZONE_SOURCE, CAT_ZONE_POL_LOCAL_PATH, 'geojson');\n addLayerPolygonOnMap(ID_LAYER_ZC, ID_CAT_ZONE_SOURCE, 'none', '#3CB8FB', '#FFFFFF');\n\n // localities borders\n addLineBorderLayerOnMap (ID_BORDER_LAYER_LCL, ID_LOCALITIES_SOURCE, 'none', '#FFFFFF', 1.2);\n // upz borders\n addLineBorderLayerOnMap (ID_BORDER_LAYER_UPZ, ID_UPZ_SOURCE, 'none', '#FFFFFF', 1.2);\n // catastral zones borders\n addLineBorderLayerOnMap (ID_BORDER_LAYER_ZC, ID_CAT_ZONE_SOURCE, 'none', '#FFFFFF', 1);\n\n // localities names\n addSourceMap(ID_NAMES_LCL_SOURCE, LCL_UNIT_NAMES_PATH, 'geojson');\n addPolygonNamesOnMap (ID_NAMES_LAYER_LCL, ID_NAMES_LCL_SOURCE, 'none', 'NOM_LCL', 0.68, 10, 20);\n\n // upz names\n addSourceMap(ID_NAMES_UPZ_SOURCE, UPZ_UNIT_NAMES_PATH, 'geojson');\n addPolygonNamesOnMap (ID_NAMES_LAYER_UPZ, ID_NAMES_UPZ_SOURCE, 'none', 'UPlNombre', 0.58, 10, 20);\n \n // catastral zones names\n addSourceMap(ID_NAMES_ZC_SOURCE, ZC_UNIT_NAMES_PATH, 'geojson');\n addPolygonNamesOnMap (ID_NAMES_LAYER_ZC, ID_NAMES_ZC_SOURCE, 'none', 'ZC_NOM', 0.5, 13, 22);\n\n // heatmap nuse\n addSourceMap(ID_HEATMAP_NUSE_SOURCE, HEATMAP_NUSE_PATH, 'geojson');\n addSourceMap(ID_HEATMAP_PTS_NUSE_SOURCE, HEATMAP_PTS_NUSE_PATH, 'geojson');\n heatMapNuse();\n \n } catch (error) {\n console.log(error);\n }\n \n\n });\n\n}",
"function initMap() {\n $('#widgetRealTimeMapliveMap .loadingPiwik, .RealTimeMap .loadingPiwik').hide();\n map.addLayer(currentMap.length == 3 ? 'context' : 'countries', {\n styles: {\n fill: colorTheme[currentTheme].fill,\n stroke: colorTheme[currentTheme].bg,\n 'stroke-width': 0.2\n },\n click: function (d, p, evt) {\n evt.stopPropagation();\n if (currentMap.length == 2){ // zoom to country\n updateMap(d.iso);\n } else if (currentMap != 'world') { // zoom out if zoomed in\n updateMap('world');\n } else { // or zoom to continent view otherwise\n updateMap(UserCountryMap.ISO3toCONT[d.iso]);\n }\n },\n title: function (d) {\n // return the country name for educational purpose\n return d.name;\n }\n });\n if (currentMap.length == 3){\n map.addLayer('regions', {\n styles: {\n stroke: colors['region-stroke-color']\n }\n });\n }\n var lastVisitId = -1,\n lastReport = [];\n refreshVisits(true);\n }",
"function mapa_crearMapa() {\n\tvar dominio = JSON.parse(localStorage.getItem('dominio'));\n\tvar usuario_zonas = JSON.parse(localStorage.getItem('usuario_zonas'));\n\tvar zonas_codigos = {};\n\tvar zonas_colores = {};\n\tg_lista_zonas = usuario_zonas;\n\tfor (var i = 0; i < usuario_zonas.length; i++) {\n\t\tvar zona_id = usuario_zonas[i].idzona;\n\t\tvar zona_nombre = usuario_zonas[i].nombre;\n\t\tvar zona_color_hex = usuario_zonas[i].color_hex;\n\t\tvar zonas_subzonas = usuario_zonas[i].subzonas;\n\t\tfor (var j = 0; j < zonas_subzonas.length; j++) {\n\t\t\tvar subzona_estado_codigo = zonas_subzonas[j].estado_codigo;\n\t\t\tvar subzona_estado_nombre = zonas_subzonas[j].estado_nombre;\n\t\t\tif (!zonas_codigos.hasOwnProperty(subzona_estado_codigo)) {\n\t\t\t\tvar subzona_estado_escuelas = zonas_subzonas[j].escuelas;\n\t\t\t\tvar subzona_estado_escuelas_total = zonas_subzonas[j].escuelas_total;\n\t\t\t\tzonas_codigos[subzona_estado_codigo] = zona_nombre;\n\t\t\t\tg_mapa_subzonas.push({\n\t\t\t\t\tzona_id: zona_id,\n\t\t\t\t\tzona_nombre: zona_nombre,\n\t\t\t\t\testado_codigo: subzona_estado_codigo,\n\t\t\t\t\testado_nombre: subzona_estado_nombre,\n\t\t\t\t\tescuelas: subzona_estado_escuelas,\n\t\t\t\t\tescuelas_total: subzona_estado_escuelas_total\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tzonas_colores[zona_nombre] = zona_color_hex;\n\t}\n\t$('#vmap').vectorMap({\n\t\tmap: 'mx_en',\n\t\tenableZoom: true,\n\t\tshowTooltip: true,\n\t\tbackgroundColor: '#a5bfdd',\n\t\tborderColor: '#818181',\n\t\tborderOpacity: 0.25,\n\t\tborderWidth: 1,\n\t\tcolor: '#f4f3f0',\n\t\thoverColor: '#c9dfaf',\n\t\thoverOpacity: null,\n\t\tnormalizeFunction: 'polynomial',\n\t\tscaleColors: ['#b6d6ff', '#005ace'],\n\t\tselectedColor: '#c9dfaf',\n\t\tregionsSelectable: true,\n\t\tregionsSelectableOne: true,\n\t\tregionStyle: {\n\t\t\tinitial: {\n\t\t\t\tfill: '#eee',\n\t\t\t\t'fill-opacity': 1,\n\t\t\t\tstroke: 'black',\n\t\t\t\t'stroke-width': 0.5,\n\t\t\t\t'stroke-opacity': 1\n\t\t\t},\n\t\t\thover: {\n\t\t\t\tfill: '#000000',\n\t\t\t\t'fill-opacity': 0.5,\n\t\t\t\tcursor: 'pointer'\n\t\t\t},\n\t\t\tselected: {\n\t\t\t\tfill: '#3333'\n\t\t\t},\n\t\t\tselectedHover: {}\n\t\t},\n\t\tregionLabelStyle: {\n\t\t\tinitial: {\n\t\t\t\t'font-family': 'Verdana',\n\t\t\t\t'font-size': '12',\n\t\t\t\t'font-weight': 'bold',\n\t\t\t\tcursor: 'default',\n\t\t\t\tfill: 'black'\n\t\t\t},\n\t\t\thover: {\n\t\t\t\tcursor: 'pointer'\n\t\t\t}\n\t\t},\n\t\tseries: {\n\t\t\tregions: [{\n\t\t\t\tvalues: zonas_codigos,\n\t\t\t\tscale: zonas_colores,\n\t\t\t\tnormalizeFunction: 'polynomial'\n\t\t\t}]\n\t\t},\n\t\tonRegionSelected: function(element, code, region, isSelected) {\n\t\t\tif (g_mapa_interacciones == true) {\n\t\t\t\tvar regiones = $('#vmap').vectorMap('get', 'mapObject').getSelectedRegions();\n\t\t\t\tif (regiones.length === 1) {\n\t\t\t\t\t$('#vmap').vectorMap('get', 'mapObject').setFocus({\n\t\t\t\t\t\tregion: code,\n\t\t\t\t\t\tanimate: true\n\t\t\t\t\t});\n\t\t\t\t\tvar subzona = obtenerObjectoEnArreglo(g_mapa_subzonas, 'estado_codigo', code);\n\t\t\t\t\tvar zona = obtenerObjectoEnArreglo(g_lista_zonas, 'idzona', subzona.zona_id);\n\t\t\t\t\tg_mapa_zona_seleccionada_id = zona.idzona;\n\t\t\t\t\tg_mapa_subzona_seleccionada_id = subzona.estado_codigo;\n\t\t\t\t\tmapa_cargarSelectZonasSubzonasDesdeMapa(g_mapa_zona_seleccionada_id, g_mapa_subzona_seleccionada_id, true);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tonRegionTipShow: function(e, el, code) {\n\t\t\t/*var zona = zonas_codigos[code];\n\t\t\tif (zona !== undefined) {\n\t\t\t var subzona = obtenerObjectoEnArreglo(g_mapa_subzonas, 'estado_codigo', code);\n\t\t\t var subzona_escuelas_total = subzona.escuelas_total;\n\t\t\t el.html(zona + ' โข ' + el.html() + ' โข ' + subzona_escuelas_total + ' escuelas');\n\t\t\t} else {\n\t\t\t el.html('ยกNo hay escuelas de ' + dominio + ' en ' + el.html() + '!');\n\t\t\t}*/\n\t\t\tel.html('');\n\t\t}\n\t});\n}",
"function createMap(){\n\n // Add place searchbar to map\n L.Control.openCageSearch(options).addTo(map);\n\n // Add zoom control (but in top right)\n L.control.zoom({\n position: 'topleft'\n }).addTo(map);\n\n // build easy bar from array of easy buttons\n L.easyBar(buttons).addTo(map);\n\n // Add easy button to pull up splash screen\n L.easyButton('<img src=\"img/noun_Info_1845673_blk.svg\">', function(){\n $('#splash-screen').modal('show');\n },'info window',{ position: 'topleft' }).addTo(map);\n\n //load tile layer\n L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer/tile/{z}/{y}/{x}', {\n\t attribution: 'Tiles © Esri — Esri, DeLorme, NAVTEQ',\n }).addTo(map);\n\n L.control.attribution({\n position: 'bottomright'\n }).addTo(map);\n //call getData function\n getData(map);\n}",
"loadMapWithRoute(elem, route) {\n var centerStop = route[Math.floor(route.length/2)]; //Get the center element\n var centerLoc = new google.maps.LatLng(centerStop.lat, centerStop.lon);\n var opts = {\n mapTypeId: google.maps.MapTypeId.ROADMAP,\n zoom: 14,\n center: centerLoc,\n };\n var map = new google.maps.Map(elem, opts);\n _.forEach(route, stop => {\n //Add a marker for each stop in the route\n var loc = new google.maps.LatLng(stop.lat, stop.lon);\n new google.maps.Marker({\n map: map,\n position: loc,\n title: stop.stop_name\n });\n });\n return map;\n }",
"function loadPolylines(){\n fetch('/polyline/load', { credentials: 'include' }).then((res) => {\n return res.json();\n }).then((polylines) => {\n console.log('----polylines that loaded-------')\n console.log(polylines);\n console.log('--------------------------------')\n addPolyline(polylines);\n }).catch((err) => {\n console.log(err.message);\n })\n}",
"initializeLocations() {\n for (const filename of glob(kLocationDirectory, '.*\\.json$')) {\n const description = new FightLocationDescription(kLocationDirectory + filename);\n const location = new FightLocation(description);\n\n this.#locations_.set(description.name, location);\n }\n }",
"function addLocation()\r\n{\r\n let newWaypoint = currentRoute.routeMarker.getPosition();\r\n currentRoute.waypoints.push(newWaypoint);\r\n currentRoute.displayPath();\r\n}",
"getGeoJson(mode) {\n const stops = this.getGeoJsonStops(mode).features;\n const edges = this.getGeoJsonEdges().features;\n \n // Append the edge features to the stop features\n const geoJson = stops.concat(edges);\n \n return {\n 'type': 'FeatureCollection',\n 'features': geoJson\n };\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Game_UnitTS The superclass of Game_PartyTS and Game_TroopTS. | function Game_UnitTS() {
this.initialize.apply(this, arguments);
} | [
"function Game_PartyTS() {\n this.initialize.apply(this, arguments);\n}",
"function Game_TroopTS() {\n this.initialize.apply(this, arguments);\n}",
"function Window_BattleItemTS() {\n this.initialize.apply(this, arguments);\n}",
"function antRPSGame() {\n this.Player1 = new antPlayer('Player1');\n this.Player2 = new antPlayer('Player2');\n this.isReal = false;\n this.bRequiresUpdate = false;\n this.iGameState = 0;\n this.chat = 0;\n this.loser = 0;\n this.winner = 0;\n this.gotime = 0;\n this.bGameOver=false;\n\n} //end antRPSGame Class",
"function Game_SelectorTS() {\n this.initialize.apply(this);\n}",
"function Window_BattleStatusTS() {\n this.initialize.apply(this, arguments);\n}",
"function BattleManagerTS() {\n throw new Error('This is a static class');\n}",
"createUnit(mapX, mapY, unitType, player) {\r\n let u = new Unit(this, this.tiles[mapY][mapX], unitType, player)\r\n this.units.push(u);\r\n player.units.push(u);\r\n }",
"function Window_BattleSkillTS() {\n this.initialize.apply(this, arguments);\n}",
"function Scene_BattleTS() {\n this.initialize.apply(this, arguments);\n}",
"function getAllUnits(){\r\n var townArray = uw.ITowns.getTowns(), groupArray = uw.ITowns.townGroups.getGroups(),\r\n \r\n unitArray = {\"sword\":0, \"archer\":0, \"hoplite\":0, \"chariot\":0, \"godsent\":0, \"rider\":0, \"slinger\":0, \"catapult\":0, \"small_transporter\":0, \"big_transporter\":0,\r\n \"manticore\":0, \"harpy\":0, \"pegasus\":0, \"cerberus\":0, \"minotaur\":0, \"medusa\":0, \"zyklop\":0, \"centaur\":0, \"fury\":0, \"sea_monster\":0 },\r\n \r\n unitArraySea = {\"bireme\":0, \"trireme\":0, \"attack_ship\":0, \"demolition_ship\":0, \"colonize_ship\":0 };\r\n \r\n if(uw.Game.is_hero_world){\r\n unitArray = $.extend(unitArray, {\"griffin\":0, \"calydonian_boar\":0});\r\n }\r\n unitArray = $.extend(unitArray, unitArraySea);\r\n \r\n \r\n for(var group in groupArray){\r\n if(groupArray.hasOwnProperty(group)){\r\n // clone Object \"unitArray\"\r\n groupUnitArray[group] = Object.create(unitArray);\r\n \r\n for(var town in groupArray[group][\"towns\"]){\r\n if(groupArray[group][\"towns\"].hasOwnProperty(town)){\r\n var type = { lo: 0, ld: 0, so: 0, sd: 0, fo: 0, fd: 0 }; // Type for TownList\r\n \r\n for(var unit in unitArray){\r\n if(unitArray.hasOwnProperty(unit)){\r\n // All Groups: Available units\r\n var tmp = parseInt(uw.ITowns.getTown(town).units()[unit], 10);\r\n groupUnitArray[group][unit] += tmp || 0;\r\n // Only for group \"All\"\r\n if(group == -1){\r\n //Bireme counter\r\n if( unit === \"bireme\" && ((biriArray[townArray[town].id] || 0) < (tmp || 0))) {\r\n biriArray[townArray[town].id] = tmp; \r\n }\r\n //TownTypes\r\n if(!unitVal[unit].is_naval){\r\n if(unitVal[unit].flying){\r\n type.fd += ((unitVal[unit].def_hack + unitVal[unit].def_pierce + unitVal[unit].def_distance)/3 * (tmp || 0));\r\n type.fo += (unitVal[unit].attack * (tmp || 0));\r\n } else {\r\n type.ld += ((unitVal[unit].def_hack + unitVal[unit].def_pierce + unitVal[unit].def_distance)/3 * (tmp || 0));\r\n type.lo += (unitVal[unit].attack * (tmp || 0));\r\n }\r\n } else {\r\n type.sd += (unitVal[unit].defense * (tmp || 0));\r\n type.so += (unitVal[unit].attack * (tmp || 0));\r\n }\r\n }\r\n }\r\n }\r\n // Only for group \"All\"\r\n if(group == -1){\r\n // Icon: DEF or OFF?\r\n var z = ((type.sd + type.ld + type.fd) <= (type.so + type.lo + type.fo)) ? \"o\" : \"d\",\r\n temp = 0;\r\n \r\n for(var t in type){\r\n if(type.hasOwnProperty(t)){\r\n // Icon: Land/Sea/Fly (t[0]) + OFF/DEF (z)\r\n if(temp < type[t]){\r\n autoTownTypes[townArray[town].id] = t[0] + z;\r\n temp = type[t];\r\n }\r\n // Icon: Troops Outside (overwrite)\r\n if(temp < 1000){\r\n autoTownTypes[townArray[town].id] = \"no\";\r\n }\r\n }\r\n }\r\n // Icon: Empty Town (overwrite)\r\n var popBuilding = 0, buildVal = uw.GameData.buildings, levelArray = townArray[town].buildings().getLevels(),\r\n popTotal = Math.floor(buildVal.farm.farm_factor * Math.pow(townArray[town].buildings().getBuildingLevel(\"farm\"), buildVal.farm.farm_pow)), // Population from farm level\r\n popPlow = townArray[town].researches().attributes.plow ? 200 : 0,\r\n popFactor = townArray[town].buildings().getBuildingLevel(\"thermal\") ? 1.1 : 1.0, // Thermal\r\n popExtra = townArray[town].getPopulationExtra();\r\n for(var b in levelArray){\r\n if(levelArray.hasOwnProperty(b)){\r\n popBuilding += Math.round(buildVal[b].pop * Math.pow(townArray[town].buildings().getBuildingLevel(b), buildVal[b].pop_factor));\r\n }\r\n }\r\n townPopulation[town] = popTotal * popFactor + popPlow + popExtra - (popBuilding + townArray[town].getAvailablePopulation());\r\n if((popTotal * popFactor + popPlow + popExtra - (popBuilding + townArray[town].getAvailablePopulation())) < 300){\r\n autoTownTypes[townArray[town].id] = \"po\";\r\n }\r\n // Icon: Farm Incomplete\r\n if(townArray[town].buildings().getBuildingLevel(\"farm\") < 40){\r\n //autoTownTypes[townArray[town].id] = \"bu\";\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n updateBiriCount();\r\n saveBiri();\r\n \r\n //if(options.pop)\t{\r\n updateAvailableUnitsBox(groupUnitArray[-1]);\r\n //}\r\n}",
"constructor(name, pixelWidth, pixelHeight, pixelOffsetX, pixelOffsetY, sight, hitPoints, cost,\n spriteImages, defaults, radius, range, moveSpeed, interactSpeed, firePower, builtFrom, weaponType) {\n super(name, pixelWidth, pixelHeight, pixelOffsetX, pixelOffsetY,\n sight, hitPoints, cost, spriteImages, defaults);\n this.defaults.type = 'units';\n this.radius = radius;\n this.range = range;\n this.moveSpeed = moveSpeed;\n this.interactSpeed = interactSpeed;\n this.firePower = firePower;\n this.builtFrom = builtFrom;\n\t\tthis.weaponType = weaponType;\n this.directions = 4;\n this.animationIndex = 0;\n this.imageOffset = 0;\n this.canAttack = true;\n this.canMove = true;\n this.turnSpeed = 2;\n this.speedAdjustmentWhileTurningFactor = 0.5;\n }",
"function Window_BattleInfoTS() {\n this.initialize.apply(this, arguments);\n}",
"function playerCreature() {}",
"function Sprite_HpGaugeTS() {\n this.initialize.apply(this, arguments);\n}",
"function Sprite_StartTS() {\n this.initialize.apply(this, arguments);\n}",
"function PropulsionUnit() {\n this.getAcceleration = function () {\n throw new Error(\"The method getAcceleration is not implemented in the abstract class PropulsionUnit\");\n };\n}",
"function Truck( options) {\n\n this.state = options.state || \"used\";\n this.wheelSize = options.wheelSize || \"large\";\n this.color = options.color || \"blue\";\n\n //NOT defined in prototype\n this.drive = function() {\n console.log(\"truck drive\");\n }\n\n this.breakDown = function() {\n console.log(\"truck breakdown\");\n }\n}",
"function TpelletTile(){\n\tthis.pellet = new Tsphere();\n\tthis.tile = new Ttile();\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create empty description template and show it instead of gallery content | function showDescriptionTemplate(body) {
var description = buildDescription();
description.title = '';
description.subtitle = '';
description.items.forEach(function(item) {
item.title = '';
item.description = '';
});
cleanUpPage(body);
var header = createAddElement('p', body);
header.innerHTML = 'This is a template for ' + options.descriptionFile + ' file. <a href="?">Go to gallery content</a>';
var textArea = createAddElement('textarea', body, {
rows: 30,
cols: 90
});
textArea.value = JSON.stringify(description, null, 4);
} | [
"function createGalleryWithDescription(body) {\n\t\t\tjQuery.ajax({\n\t\t\t\turl: options.descriptionFile,\n\t\t\t\tdataType: 'json',\n\t\t\t\terror: function () {\n\t\t\t\t\t// As a failback, create simple gallery\n\t\t\t\t\tcreateSimpleGallery(body);\n\t\t\t\t},\n\t\t\t\tsuccess: function(description) {\n\t\t\t\t\t// Check if description has a list of items\n\t\t\t\t\tif(!description.items) {\n\t\t\t\t\t\tdescription = buildDescription(description);\n\t\t\t\t\t}\n\t\t\t\t\trenderGallery(body, description);\n\t\t\t\t}\n\t\t\t});\n\t\t}",
"function build_description(description_text, page_name) {\n var description_container = document.createElement(\"div\");\n description_container.id = page_name.toLowerCase() + \"_description\";\n description_container.classList = [page_name + \" description container\"];\n\n description_container.appendChild(build_paragraph(description_text));\n\n return description_container;\n}",
"function initArticleContent(data) {\n var article_content = document.createElement('p');\n var content = data.fields.body;\n if (content.length > 500) {\n article_content.innerHTML = content.substring(0, 500) + \"...\";\n } else {\n article_content.innerHTML = content;\n }\n article_content.className = \"flavour\";\n return article_content;\n }",
"function renderArticles(doc){\n let div = document.createElement('div');\n \n let image = document.createElement('img');\n let title = document.createElement('h3');\n let content = document.createElement('p');\n \n\n // var createA = document.createElement('a');\n // createA.setAttribute('href', \"single-blog.html\");\n \n \n\n image.src = doc.data().image;\n title.textContent = doc.data().title;\n content.textContent = doc.data().content;\n\n \n div.setAttribute('data-id', doc.id);\n div.appendChild(image);\n div.appendChild(title);\n //createA.appendChild(title);\n //div.appendChild(createA);\n div.appendChild(content);\n \n\n articlesList.appendChild(div);\n\n \n\n}",
"renderDescription() {\n const { library, expanded } = this.props;\n\n if (expanded) {\n return (\n <CardSection>\n <Text style={{ flex: 1, paddingLeft: 16, paddingRight: 16, color: '#FA8072' }}>\n {library.description}\n </Text>\n </CardSection>\n );\n }\n }",
"renderDescriptionDiv (options) {\n\t\tconst { review } = options;\n\t\treturn Utils.renderDescriptionDiv(review.text, options);\n\t}",
"function displayEmpty() {\n blogContainer.empty();\n var messageh2 = $(\"<h2>\");\n messageh2.css({ \"text-align\": \"center\", \"margin-top\": \"50px\" });\n // messageh2.html(\"No recipes yet for this category, navigate <a href='/cms'>here</a> in order to create a new Recipe.\");\n blogContainer.append(messageh2);\n }",
"getNameDescription(instance, element, defaultValue='') {\n instance.name = this.v(element, 'meta.title', defaultValue);\n instance.description = this.v(element, 'meta.description', '');\n\n instance.nameSourcemap = this.s(element, 'meta.title');\n instance.descriptionSourcemap = this.s(element, 'meta.description');\n\n for (const item of this.v(element, 'content', [])) {\n switch (item.element) {\n case 'copy':\n instance.description = `${instance.description}\\n${this.v(item)}`.trim();\n // Resetting the sourcemap isn't technically correct, but it works\n // in practice and is easier than combining them.\n instance.descriptionSourcemap = this.s(item);\n break;\n }\n }\n }",
"function buildDescription(externalDescription) {\n\t\t\tvar description = externalDescription || {};\n\t\t\tdescription.items = [];\n\n\t\t\tvar items;\n\t\t\tif(options.showSubFolders == 'first') {\n\t\t\t\titems = (itemOrder.folder || []).concat(itemOrder.image);\n\t\t\t} else if (options.showSubFolders == 'last') {\n\t\t\t\titems = (itemOrder.image || []).concat(itemOrder.folder);\n\t\t\t} else {\n\t\t\t\titems = itemOrder.image || [];\n\t\t\t}\n\t\t\t\n\t\t\tfor(var n = 0; n < items.length; ++ n) {\n\t\t\t\tdescription.items.push({\n\t\t\t\t\turl: items[n]\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn description;\n\t\t}",
"_createInfoArray(decoratedImage, title, subtitle, mainDescription, secondaryDescription, link, htmlDescription) {\n let data = Object.assign({},\n decoratedImage ? { decoratedImage } : {},\n title ? { title } : {},\n subtitle ? { subtitle } : {},\n mainDescription ? { mainDescription } : {},\n secondaryDescription ? { secondaryDescription } : {},\n link ? { link } : {},\n htmlDescription ? { htmlDescription } : {}\n );\n this.set('description', [ data ]);\n }",
"buildDescription(data) {\n return data.desc + \"\\n\\n Userfeed Story Link: \" + data.redirectUrl;\n }",
"generateSmallDescription(text){\r\n\t if(text){\r\n\t\tif(text.length > 120){\r\n\t\t text= text.slice(0,120) + '...';\r\n\t\t return text;\r\n\t\t}\r\n\t\telse{\r\n\t\t return text;\r\n\t\t}\r\n\t }\r\n\t}",
"function editorEmptyRender() {\n $( \".preview\" ).html( `<div class=\"empty\"><span class=\"icon\"></span><span>ๅฝๅๆช้ๆฉไปปไฝ้้
็ซ็น</span></div>` );\n}",
"function buildSubcaption() {\n const displayFileName = originalFilename || (files[0] && files[0].name)\n let subcaption = type === documentFileTypes.TEMPLATE ? category : `${requiredFileExtensions.join(', ')} ยท ${category}`\n if (displayFileName) subcaption = (\n <>\n <span role='link' onClick={originalFilename ? handleFileDownload : handleUploadedFileDownload}>\n {displayFileName}\n </span>\n {` ยท ${category}`}\n </>\n )\n return <PDocInfo includeTopMargin={!displayFileName}>{subcaption}</PDocInfo>\n }",
"function createCards(photographer){\n const sectionCard = elmtFactory(\n 'section',\n {class: 'card'},\n );\n\n\n\n// to recovery value & format case\n// function getTagsElement(value){\n\n// }\n\n\n const head = elmtFactory('a',\n { href: 'photographer-page.html?id=' + photographer.id},\n elmtFactory('img', {class: 'card_picture', src: './public/' + photographer.portrait, alt: ''}, ),\n elmtFactory('h2', {class: 'card_name'}, photographer.name),\n elmtFactory('p', {class: 'card_location'}, photographer.city + ', ' + photographer.country),\n elmtFactory('p', {class: 'card_slogan'}, photographer.tagline),\n elmtFactory('p', {class: 'card_price'}, photographer.price + 'โฌ'),\n );\n\n let ul = elmtFactory(\n 'ul',\n {class: 'card_ul'},\n );\n\n let li = photographer.tags.map( (value) => {\n return ('<a href=\"index.html?tag=' + value + '\" class=\"card_ul_li\">#<span>'\n + value + '</span></a>');});\n\n li = li.toString().replace(/[, ]+/g, ' ').trim();\n\n main.appendChild(sectionCard);\n sectionCard.appendChild(head);\n sectionCard.appendChild(ul);\n ul.innerHTML += (li);\n}",
"setDescription(description) {\n this.description = description;\n }",
"function prepareDisplay(photos) {\n\t$('#title').html(title);\n\n\tif (photos.length < 1) return;\n\tvar firstPhoto = photos[0];\n\t$('#imageHolder').attr('src', firstPhoto.uri);\n\t$('#photoTitle').html(firstPhoto.title);\n}",
"function createDescriptionCol(item) {\n\treturn '<td align=\"left\" class=\"description\">' + item.name + '</td>';\n}",
"function creation() {\n return div('creation', \n row(\n col('col-4', div('creation__title title', 'News creation form')) + \n col('col-8', toolbox())\n ) +\n row(\n col('col-12', div('tab-content', textForm() + imageForm()))\n )\n \n ) \n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Formats a range of years. | formatYearRange(start, end) {
return `${start} \u2013 ${end}`;
} | [
"formatYearRangeLabel(start, end) {\n return `${start} to ${end}`;\n }",
"outputYear(years) {\n\t\tlet yearString = \"year\";\n\t\tif (years !== 1) {\n\t\t\tyearString = `${yearString}s`;\n\t\t}\n\t\treturn `${years} ${yearString}`;\n\t}",
"function parse_years() {\n var raw_years = year_date_textbox.getValue();\n var years_to_list = raw_years.split(\"-\");\n return years_to_list;\n}",
"function generateEndYears(selectedDatabaseMask) {\n var stringYear = $(\"input[name='stringYear']\");\n if (typeof stringYear == 'undefined') {\n console.warn(\"stringYear value could not be set!\");\n return;\n }\n\n var sy = calStartYear(selectedDatabaseMask, stringYear.val());\n var ey = calEndYear(selectedDatabaseMask);\n\n var years = new Array();\n var idx = 0;\n for (var j = ey; j >= sy; j--) {\n if (j == ey) years[idx++] = {\"label\": j, \"value\": j, \"selected\": true};\n else years[idx++] = {\"label\": j, \"value\": j};\n }\n return years\n\n }",
"function generateStartYears(selectedDatabaseMask) {\n var stringYear = $(\"input[name='stringYear']\");\n if (typeof stringYear == 'undefined') {\n console.warn(\"stringYear value could not be set!\");\n return;\n }\n\n var sy = calStartYear(selectedDatabaseMask, stringYear.val());\n var ey = calEndYear(selectedDatabaseMask);\n var dy = calDisplayYear(selectedDatabaseMask, stringYear.val());\n\n var years = new Array();\n var idx = 0;\n for (var j = sy; j <= ey; j++) {\n if (j == dy) years[idx++] = {\"label\": j, \"value\": j, \"selected\": true};\n else years[idx++] = {\"label\": j, \"value\": j};\n }\n return years\n }",
"function makeYearSlider () {\n\t\tvar select = $( \".select-year\" );\n\t\tvar slider = $( \"<div id='slider'></div>\" ).insertAfter( select ).slider({\n\t\t\tmin: 1,\n\t\t\tmax: 5,\n\t\t\trange: \"min\",\n\t\t\tvalue: select[ 0 ].selectedIndex + 1,\n\t\t\tslide: function( event, ui ) {\n\t\t\t\tselect[ 0 ].selectedIndex = ui.value - 1;\n\t\t\t\tswitch(ui.value) {\n\t\t\t\t\tcase 5:\n\t\t\t\t\t\tdisplayYear = \"2012\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 4:\n\t\t\t\t\t\tdisplayYear = \"2011\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 3:\n\t\t\t\t\t\tdisplayYear = \"2010\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\tdisplayYear = \"2009\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\tdisplayYear = \"2008\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tdisplayYear = \"2012\";\n\t\t\t\t\t\tbreak;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t};\n\t\t\t\tupdateDisplayArray()\n\t\t\t}\n\t\t});\n\t\t$( \".select-year\" ).change(function() {\n\t\t\tslider.slider( \"value\", this.selectedIndex + 1 );\n\t\t});\n\t}",
"function setYear() {\n\n // GET THE NEW YEAR VALUE\n var year = tDoc.calControl.year.value;\n\n // IF IT'S A FOUR-DIGIT YEAR THEN CHANGE THE CALENDAR\n if (isFourDigitYear(year)) {\n calDate.setFullYear(year);\n\n\t// GENERATE THE CALENDAR SRC\n\tcalDocBottom = buildBottomCalFrame();\n\n // DISPLAY THE NEW CALENDAR\n writeCalendar(calDocBottom);\n }\n else {\n // HIGHLIGHT THE YEAR IF THE YEAR IS NOT FOUR DIGITS IN LENGTH\n tDoc.calControl.year.focus();\n tDoc.calControl.year.select();\n }\n}",
"function changeImmYear()\n{\n let form = this.form;\n let censusId = form.Census.value;\n let censusYear = censusId.substring(censusId.length - 4);\n let immyear = this.value;\n if (this.value == '[')\n {\n this.value = '[Blank';\n }\n let res = immyear.match(/^[0-9]{4}$/);\n if (!res)\n { // not a 4 digit number\n res = immyear.match(/^[0-9]{2}$/);\n if (res)\n { // 2 digit number\n // expand to a 4 digit number which is a year in the\n // century up to and including the census year\n immyear = (res[0] - 0) + 1900;\n while (immyear > censusYear)\n immyear -= 100;\n this.value = immyear;\n } // 2 digit number\n } // not a 4 digit number\n\n this.checkfunc();\n}",
"function expand_year (y, century_break)\n{\n Result = parseInt (y);\n\n if (Result < 100)\n {\n\tif (! century_break)\n\t century_break = Date_century_break;\n\t\n\tif (Result <= century_break)\n\t Result += 2000;\n\telse\n\t Result += 1900;\n }\n\n return Result;\n}",
"function setYearList() {\n\tvar res = \"<select id = 'selected_year' onchange = 'setYear();' >\";\n\tfor (i = 1950; i <= 2097; i++) {\n\t\tif (YEAR == i) {\n\t\t\tres += \"<option selected = 'selected' value =\" + i +\">\" + i +\"</option>\";\n\t\t}else {\n\t\t\tres += \"<option value =\" + i +\">\" + i +\"</option>\";\n\t\t}\n\t}\n\tres += \"</select>\";\n\treturn res;\n\n}",
"_yearsQuery() {\n const operation = operationKeys.GET_YEARS;\n\n return queryString.stringify({\n op: operation,\n data: JSON.stringify({\n catalogSource: 'Endeca',\n site: this.getDomain(operation),\n pipeDelimited: 1,\n }),\n }, { encode: false });\n }",
"function calcAge(yearBorn) {\n return 2019 - yearBorn;\n}",
"function leapYear() {\r\n var y = 2021\r\n var i = 0\r\n while (i < 20) {\r\n if ((y % 4 === 0) && (y % 100 !== 0) || (y % 400 === 0)) {\r\n document.write(y + \"\\n\");\r\n y++\r\n i++\r\n }\r\n else {\r\n y++\r\n }\r\n }\r\n\r\n}",
"function isYear(str) {\n\tvar inputYear\n\tvar resultStr = \"\";\n\t// Return immediately if an invalid value was passed in\n\tif (str+\"\" == \"undefined\" || str == null) return null;\n\t// Make sure the argument is a string\n\tstr += \"\";\n\tstr = Trim( str )\n\tinputYear = parseInt(str)\n\tif (isNaN(inputYear)) return null\n\tif (inputYear < 1900 || inputYear > 2200) return null //unreasonable value\n\tresultStr = \"\" + inputYear\n\treturn resultStr;\n}",
"iYearToJYear(iYear) {\n // console.log('** iYearToJYear ' + iYear + ' **');\n const jYears1 = []; // fill with tuple(s) of (startYear, eraCode) for matching era(s), then sort it\n const jYears2 = []; // fill this with tuple(s) of (eName, jName, eraYear)\n if ((iYear<this.minYear) || (iYear>this.maxYear+1)) {return jYears2;} // return blank if out of range\n for (const [eraCode, oneEra] of Object.entries(this.yDict)) {\n // console.log( 'iYear for ' + oneEra.getEraCode());\n if (oneEra.isIYearInEra(iYear)) {\n jYears1.push([oneEra.getStartYear(), eraCode]);\n }\n }\n jYears1.sort(function(a, b){return a[0]-b[0];}); // sort in order by start year\n for (const [startYear, eraCode] of jYears1) {\n jYears2.push([this.yDict[eraCode].getEName(), this.yDict[eraCode].getJName(),\n this.yDict[eraCode].iYearToEraYear(iYear)]);\n }\n // console.log(jYears2);\n return jYears2;\n }",
"function filterYear(data) {\n let filteredData = data.filter(function(d, i) {\n return data[i].year === \"1980\";\n });\n data = filteredData;\n return data;\n }",
"function draw_year() {\n // Calculate the serial date that the camera's z position corresponds to\n serial_date = ((((camera_z / multiplier) - 70)/600) * (latest - earliest)) + earliest;\n // Convert the date from the serialised format back to a nice format \"May 2019\".\n var new_date = moment(\"0000-01-01\", \"YYYY-MM-DD\").add(Math.floor(serial_date), 'days');\n ctx.font = 'bold 2em sans-serif';\n ctx.globalAlpha = 0.7;\n ctx.textAlign = \"right\";\n // Draw the date\n ctx.fillText(new_date.format(\"MMMM YYYY\"), 250, 35);\n}",
"function populate_year_dropboxes(dropbox_id) {\n //\n var options_str = '';\n var date = new Date();\n var curr_year = date.getFullYear();\n var first_year = CONSTANTS.FIRST_YEAR_WITH_DATA;\n var dropbox = document.getElementById(dropbox_id);\n var opt = null;\n var opt_attr = {};\n for (var y = curr_year; y >= first_year; y--) {\n opt_attr = {'id' : dropbox_id+'-'+y, 'value' : y}\n opt = document.createElementWithAttr('OPTION',opt_attr);\n opt.appendChild(document.createTextNode(y));\n dropbox.appendChild(opt);\n }\n}",
"shortYear() {\n return this.date.getYear();\n }",
"function checkValidYear(c,obj)\n\t{\n\t\tvar calendar = eval('calendar'+c);\t\t\t\t\t\n\t\t// ------- 'calendar'+c is calendar componet ID.\n\t\t// ------- if you want to change calendar component ID please \n\t\t// ------- change calendar component ID in calendar generator at method getTagGenerator() too.\n\t\tvar objLength = obj.value.length;\n\t\tvar splitValue\t= \"/\";\n\t\tvar dateArray = obj.value.split(splitValue);\n\t\tvar year = dateArray[2];\n\t\tif( obj.value!=\"\" &&( Number(year) < calendar.minYear || Number(year) > calendar.maxYear) )\n\t\t{\n\t\t\tshowOWarningDialog(\"Data not complete\", \"Year must between \"+calendar.minYear+\" and \"+calendar.maxYear+\".\", \"OK\") ;\n\t\t\tif(Number(year) < calendar.minYear)\n\t\t\t{\n\t\t\t\tobj.value = dateArray[0]+splitValue+dateArray[1]+splitValue+ calendar.minYear;\n\t\t\t}else{\n\t\t\t\tobj.value = dateArray[0]+splitValue+dateArray[1]+splitValue+ calendar.maxYear;\n\t\t\t}\n\t\t\tobj.focus();\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
On click image Vocabulary | function onClickVocabularyImg() {
// Set flag
$('#scenario_vocabulary').val('vocabulary');
onOffAreaScenarioVocabulary(CLIENT.ONVOCABULARY);
} | [
"function handleWordClick(event) {\n // get letter associated with image\n let image = document.getElementById(\"image\").src.substring(57,58)\n console.log(\"image name\", image)\n let word = event.target.value\n console.log(\"word selected\", word)\n for (let i=0; i<8; i++) {\n wordList[word][i]+=images[image][i] \n } \n console.log(wordList[word])\n document.getElementById(\"image\").src = randImage()\n}",
"function menuImageClick() {\n Data.Edit.Mode = EditModes.Image;\n updateMenu();\n}",
"function imageClicked() {\n var currentSource = $(this).attr('src');\n var altSource = $(this).attr('data-src');\n $(this).attr('src', altSource);\n $(this).attr('data-src', currentSource);\n }",
"function overviewImgClick(e){\n\tvar i,j,tname,turl,item,c,li,\n\t\ttarget = e.target || e.srcElement,\n\t\ttype = default_types_1,\n\t\tpremium;\n\n\tturl = target.u;\n\n\t//๋ํดํธ ํ์
์์ ํ์ li ๊ฒ์\n\tfor (i = 0; i < type.length; i++) {\n\t\ttname = type[i].n;\n\t\tif (tname === turl) {\n\t\t\titem = type[i];\n\t\t\tbreak;\n\t\t}\n\t}\n\tif (!item)\n\t\treturn;\n\n\t// click ๋ overview Image Name์ ๊ฐ์ง๊ณ ์จ๋ค.\n\titem.imgName = target.childNodes[0].innerHTML;\n\n\titem.over = true;\n\tactiveMainLi(item, false);\n}",
"function setClickHandler(correctCategory,imageCategories) {\n $('#guessOverview').children().click(function (event) {\n buildCategories(event.target.id, correctCategory, imageCategories)\n })\n\n}",
"function goToSelectedImages(){\n location.href = \"MyPhotoStockSelected.html\"\n \n }",
"function select_annotation(evt) {\n select_button(evt.target);\n }",
"function gifClicked() {\n largeGifAppears(this);\n automatedSpeech();\n}",
"function drawSelectionChanged() {\n drawType = drawSelector.value();\n setImage();\n}",
"function changePhoto () {\n if (currentWord === \"beagle\") {\n document.getElementById(\"dog-photo\").src=\"assets/images/beagle.jpg\"\n }\n if (currentWord === \"boxer\") {\n document.getElementById(\"dog-photo\").src=\"assets/images/boxer.jpg\"\n }\n if (currentWord === \"dachshund\") {\n document.getElementById(\"dog-photo\").src=\"assets/images/dachshund.jpg\"\n }\n if (currentWord === \"corgi\") {\n document.getElementById(\"dog-photo\").src=\"assets/images/corgi.jpg\"\n }\n if (currentWord === \"labrador\") {\n document.getElementById(\"dog-photo\").src=\"assets/images/labrador.jpg\"\n }\n if (currentWord === \"bulldog\") {\n document.getElementById(\"dog-photo\").src=\"assets/images/bulldog.jpg\"\n }\n }",
"function votingOnPictures (event) {\n if (event.target.alt) {\n totalVotes++;\n for (var i =0; i < threePictures.length; i++) {\n if (event.target.alt === allPictures[threePictures[i]].name) {\n allPictures[threePictures[i]].votesPerPicture++;\n }\n }\n if (totalVotes === 25) {\n pics.removeEventListener('click', votingOnPictures);\n pics.innerHTML= '';\n updateChart();\n drawBarGraph();\n savingVotesInGraph();\n }\n choosingThreePictures();\n displayPictures();\n }\n}",
"function switch_search_images()\r\n{\r\n search_images = !search_images;\r\n drawControl();\r\n}",
"function AddTag(image){\n\tvar texture = THREE.ImageUtils.loadTexture(\"img/\"+image);\n\tvar geometry = new THREE.PlaneGeometry(2,2);\n\tvar material = new THREE.MeshBasicMaterial( { map: texture} );\n\tvar tag = new THREE.Mesh( geometry, material );\n\ttag.lookAt(camera.position);\n\t$(tag).click(function(){\n\t\tconsole.log(\"clicked!\")\n\t});\n\treturn tag;\n}",
"function setupIconLibrarySelectionListener() {\n $('li[class^=ion]').click(function(e) {\n var originalElement = e.target;\n var imageName = originalElement.classList[0].slice(4);\n $('#IconLibraryModal').modal('hide');\n generateFlatIconFromImage('/img/ionicons/512/' + imageName + '.png');\n });\n}",
"function setSelectedImage(objectUrl) {\r\n var image_iframe = document.getElementById('image-input'); \r\n image_iframe.contentWindow.setSelectedImage(objectUrl);\r\n }",
"function addRamenToMenu (ramen) {\n const newImage = document.createElement(\"img\")\n newImage.addEventListener(\"click\", () => ramenClick(ramen))\n newImage.src = ramen.image\n ramenMenu.append(newImage);\n}",
"function showEsa(img) {\n document.getElementById('esa').src = \"images/\" + img;\n}",
"function categoryClick(clicked_id) {\n sessionStorage.setItem(\"category\", clicked_id);\n location.href = '../wordbank/words.html';\n}",
"function maptab_click() {\n\t//get secondary img path from data attribute\n\tvar data = $(\".inner_container\").find(\"img\").attr(\"data-id\");\n\t//get primary (UK) img from src\n\tvar src = $(\".inner_container\").find(\"img\").attr(\"data\");\n\t//map tab event listener\n\t//Test which button was pressed\n\tif($(this).text() === \"UK\") {\n\t\t//set correct src attriube for map\n\t\t$(\".election_map\").attr(\"src\", src);\n\t\t//add and remove active id as required\n\t\t$(\".map_tabs tr:eq(0)\").attr(\"id\", \"active_tab\");\n\t\t$(\".map_tabs tr:eq(1)\").attr(\"id\", \"\");\n\t} else {\n\t\t$(\".election_map\").attr(\"src\", data);\n\t\t$(\".map_tabs tr:eq(1)\").attr(\"id\", \"active_tab\");\n\t\t$(\".map_tabs tr:eq(0)\").attr(\"id\", \"\");\n\t}\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add friend to invite list | function addFriend(id) {
invitedArr.push(id);
var ufriends = JSON.parse(window.localStorage.getItem("uFriends"));
for (var i = 0; i < ufriends.length; i++) {
if (ufriends[i].id == id) {
$('#friendTags').addTag(ufriends[i].name);
}
}
} | [
"function add2List(me, friends) {\n var myName = me.name.substring(0, 20).toLowerCase();\n \n for (var i=0; i<friends.length; i++) {\n if (myName === friends[i].name.substring(0,20).toLowerCase()) {\n friends[i] = me;\n return;\n } \n }\n friends.push(me);\n }",
"handleAddUser() {\n this.props.searchedFriends.forEach((friend) => {\n if (friend.selected) {\n // console.log(this.props, 'THISTHSIHAF;SAFJDKS;FAJK;DLKS');\n this.props.addFriendRequestToDB(friend.id);\n socketActions.sendFriendRequest(this.props.userInfo.user, friend);\n }\n });\n }",
"function addMemberToAppData(e){\n // console.info(e.target.closest('.modal-content ').querySelector('.new-member-input').getAttribute('data-id'));\n // const color = addLabelColors();\n const newList = {\n name: e.target.closest('.modal-content ').querySelector('.new-member-input').value,\n id:uuid(),\n labelColor: addColor()\n };\n appData.members.push(newList);\n}",
"function addFriend(species, obj) { \n var friends = obj.relationships.friends;\n friends.push(species);\n return friends;\n}",
"function createFriendElement(friendKey){\n var friendData;\n for (var i = 0; i < userArr.length; i++){\n if(friendKey == userArr[i].uid){\n friendData = userArr[i];\n break;\n }\n }\n\n if(friendData != null) {\n try{\n document.getElementById(\"TestGift\").remove();\n } catch (err) {}\n\n var userUid = friendData.uid;\n var friendName = friendData.name;\n var friendUserName = friendData.userName;\n var friendShareCode = friendData.shareCode;\n var liItem = document.createElement(\"LI\");\n liItem.id = \"user\" + userUid;\n liItem.className = \"gift\";\n liItem.onclick = function () {\n var span = document.getElementsByClassName(\"close\")[0];\n var friendSendMessage = document.getElementById('sendPrivateMessage');\n var friendInviteRemove = document.getElementById('userInviteRemove');\n var friendNameField = document.getElementById('userName');\n var friendUserNameField = document.getElementById('userUName');\n var friendShareCodeField = document.getElementById('userShareCode');\n\n if (friendShareCode == undefined || friendShareCode == \"\") {\n friendShareCode = \"This User Does Not Have A Share Code\";\n }\n\n friendNameField.innerHTML = friendName;\n friendUserNameField.innerHTML = \"User Name: \" + friendUserName;\n friendShareCodeField.innerHTML = \"Share Code: \" + friendShareCode;\n\n friendSendMessage.onclick = function() {\n generatePrivateMessageDialog(friendData);\n };\n\n friendInviteRemove.onclick = function () {\n modal.style.display = \"none\";\n deleteFriend(userUid);\n };\n\n //show modal\n modal.style.display = \"block\";\n\n //close on close\n span.onclick = function () {\n modal.style.display = \"none\";\n };\n\n //close on click\n window.onclick = function (event) {\n if (event.target == modal) {\n modal.style.display = \"none\";\n }\n };\n };\n var textNode = document.createTextNode(friendName);\n liItem.appendChild(textNode);\n\n userList.insertBefore(liItem, document.getElementById(\"userListContainer\").childNodes[0]);\n\n friendCount++;\n }\n }",
"function addFriends() {\n clickNextButton(\"Add\", defaultAddFriendSelector);\n}",
"invite(userId, invitedId) {\n // use date for sorted set ordering\n return new Promise((resolve, reject) => {\n this.client.zadd(\n `${this.namespace}:user:${invitedId}:${STATE_KEY.invited}`,\n Date.now(),\n userId,\n (err, res) => {\n if (err) { reject(err); }\n debug(`${userId} invited ${invitedId}`);\n return resolve(res);\n });\n });\n }",
"function manage_inviteables( inviteable_list ){\r\n\t\t\r\n\t\t$( '#friends_to_invite div.not_invited_yet div, #friends_to_invite div.already_invited div' )\r\n\t\t\t.addClass( 'not_inviteable_del' );\r\n\t\t\r\n\t\t$.each( inviteable_list, function(i, list) {\r\n\t\t\tvar id = parseInt( list.id );\r\n\t\t\tvar name = list.name;\r\n\t\t\tvar invited = list.invited;\r\n\t\t\t\r\n\t\t\tvar act_obj = $( '#inviteable_one_'+id );\r\n\t\t\tif ( typeof act_obj != 'undefined' && act_obj.length > 0 ) {\r\n\t\t\t\tact_obj.removeClass( 'not_inviteable_del' );\r\n\t\t\t\tif ( !invited )\r\n\t\t\t\t\tif ( typeof $( 'div.already_invited div#inviteable_one_'+id ) != 'undefined' && $( 'div.already_invited div#inviteable_one_'+id ).length > 0 ) {\r\n\t\t\t\t\t\tact_obj.fadeOut( 50, function(){\r\n\t\t\t\t\t\t\tact_obj.appendTo( '#friends_to_invite div.not_invited_yet' ).fadeIn( 50 );\r\n\t\t\t\t\t\t} );\r\n\t\t\t\t\t\tact_obj.data( 'invited', false );\r\n\t\t\t\t\t}\r\n\t\t\t} else\r\n\t\t\t\t$( '<div/>' )\r\n\t\t\t\t\t.attr( 'id', 'inviteable_one_'+id )\r\n\t\t\t\t\t.appendTo( '#friends_to_invite div.not_invited_yet' )\r\n\t\t\t\t\t.html( name )\r\n\t\t\t\t\t.data( 'invited', false )\r\n\t\t\t\t\t.click( function(){\r\n\t\t\t\t\t\tvar o_this = $( this );\r\n\t\t\t\t\t\tif (!o_this.data( 'invited' )) {\r\n\t\t\t\t\t\t\to_this.fadeOut( 50, function(){\r\n\t\t\t\t\t\t\t\to_this.appendTo( '#friends_to_invite div.already_invited' ).fadeIn( 50 );\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$.ajax({\r\n\t\t\t\t\t\t\t\ttype: 'POST',\r\n\t\t\t\t\t\t\t\turl: 'send_invite.php',\r\n\t\t\t\t\t\t\t\tdata: {\r\n\t\t\t\t\t\t\t\t\t'id': id\r\n\t\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t\tsuccess: function( data ) {\r\n\t\t\t\t\t\t\t\t\tif ( data!=0 ) {\r\n\t\t\t\t\t\t\t\t\t\t$( '#hv_alert_wrapper' ).hv_alert( 'show_alert', {\r\n\t\t\t\t\t\t\t\t\t\t\t'message': c['error_invite']+' '+data\r\n\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t\to_this.fadeOut( 50 );\r\n\t\t\t\t\t\t\t\t\t} else\r\n\t\t\t\t\t\t\t\t\t\to_this.data( 'invited', true );\r\n\t\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t\terror: function() {\r\n\t\t\t\t\t\t\t\t\t$( '#hv_alert_wrapper' ).hv_alert( 'show_alert', {\r\n\t\t\t\t\t\t\t\t\t\t'message': c['error_invite']+' '+data\r\n\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\to_this.fadeOut( 50 );\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t});\r\n\t\t$( '.not_inviteable_del' ).fadeOut( 50, function(){\r\n\t\t\t$( this ).remove();\r\n\t\t} );\r\n\t\t\r\n\t}",
"function sendInvite(newfriendname) {\n\t// post to /addfriend/ where database takes care of sending invite\n\t\n\t\n\t$(\" <div />\" ).attr(\"id\",'confirm_invitation')\n\t.attr(\"title\", 'Confirm Invitation')\n\t.html(\n\t\t'<div id=\"myconfirmationinvitation\">' + \n\t\t'<table width=100%> <tr style=\"text-align: center;\"><td colspan=\"2\" style=\"height: 50px;\">' +\n\t\t'Do you want to send an invitation email? </td></tr>' +\n\t\t'<tr style=\"text-align: center;\">' +\n\t\t'<td style=\"width: 100px;\"> <a id=\"sendInvitebutton\" class=\"btn btn-success\" style=\"width: 60px;\"> <i class=\"icon-ok icon-white\"></i></a> </td>' +\n\t\t'<td style=\"width: 100px\"> <a id=\"nosendInvitebutton\" class=\"btn btn-danger\" style=\"width: 60px;\"> <i class=\"icon-remove icon-white\"></i></a></td> ' +\n\t\t'</tr></table></div>'\n\t\t\n\t)\n\t.appendTo($( \"#boxes\" ));\n\n\t$('#sendInvitebutton').click(\n\t\tfunction() {\n\t\t\tinvite(newfriendname);\n\t\t\t$('#confirm_invitation').dialog('destroy').remove()\n\t\t}\n\t);\n\t$('#nosendInvitebutton').click(\n\t\tfunction() {\n\t\t\t$('#confirm_invitation').dialog('destroy').remove()\n\t\t}\n\t);\n\t\n\t$('#confirm_invitation').dialog( {\n autoOpen: true,\n modal: true\n });\n}",
"function addUser(user) {\n\tif (user) {\n\t\tlet friends = []\n\t\tu.forEach((person) => {\n\t\t\tif (person !== user) {\n\t\t\t\tfriends.push(person)\n\t\t\t}\n\t\t})\n\t\tlet newUser = new User()\n\t\tnewUser.facebook.name = user\n\t\tnewUser.password = '123'\n\n\t\tnewUser.facebook.friends = friends\n\t\tnewUser.save()\n\t}\n}",
"onChatRoomInvite(socket) {\n socket.on('invite', (data, fn: (user: User, containsError: boolean, errorMessage: string) => void) => {\n const room: ChatRoom = this.roomProvider.getModel(data.roomId);\n if (!room) {\n fn(undefined, true, 'An error occurred');\n return;\n }\n const user: User = this.userProvider.models.find((model) => model.name === data.nickname);\n if (!user) {\n fn(user, true, 'The user does not exists');\n return;\n }\n if (room.users.find(u => u.id === user.id)) {\n fn(user, true, 'The user is already in the chat room');\n return;\n }\n room.users.push(user);\n user.chatRooms.push(room.id);\n fn(user, false);\n socket.to(user.id).emit('invite', room);\n this.chatWs.sendMessageToChat(room.id, new this.Message(`${user.name} has joined the group!`,\n user.name, this.MessageType.ServerMessage, room.id));\n console.log(`${data.nickname} was invited to ${room.name}`)\n })\n }",
"inviteOtherUser (callback) {\n\t\tlet data = {\n\t\t\tteamId: this.team.id,\n\t\t\temail: this.userData[1].user.email\n\t\t};\n\t\tthis.apiRequest(\n\t\t\t{\n\t\t\t\tmethod: 'post',\n\t\t\t\tpath: '/users',\n\t\t\t\tdata,\n\t\t\t\ttoken: this.userData[0].accessToken\n\t\t\t},\n\t\t\tcallback\n\t\t);\n\t}",
"set friends(aValue) {\n this._logService.debug(\"gsDiggEvent.friends[set]\");\n this._friends = aValue;\n }",
"function changeFriendElement(friendKey){\n var friendData;\n for (var i = 0; i < userArr.length; i++){\n if(friendKey == userArr[i].uid){\n friendData = userArr[i];\n break;\n }\n }\n\n if(friendData != null) {\n var userUid = friendData.uid;\n var friendName = friendData.name;\n var friendUserName = friendData.userName;\n var friendShareCode = friendData.shareCode;\n var liItemUpdate = document.getElementById(\"user\" + userUid);\n liItemUpdate.innerHTML = friendName;\n liItemUpdate.className = \"gift\";\n liItemUpdate.onclick = function () {\n var span = document.getElementsByClassName(\"close\")[0];\n var friendSendMessage = document.getElementById('sendPrivateMessage');\n var friendInviteRemove = document.getElementById('userInviteRemove');\n var friendNameField = document.getElementById('userName');\n var friendUserNameField = document.getElementById('userUName');\n var friendShareCodeField = document.getElementById('userShareCode');\n\n if (friendShareCode == undefined) {\n friendShareCode = \"This User Does Not Have A Share Code\";\n }\n\n friendNameField.innerHTML = friendName;\n friendUserNameField.innerHTML = \"User Name: \" + friendUserName;\n friendShareCodeField.innerHTML = \"Share Code: \" + friendShareCode;\n\n friendSendMessage.onclick = function() {\n generatePrivateMessageDialog(friendData);\n };\n\n friendInviteRemove.onclick = function () {\n modal.style.display = \"none\";\n deleteFriend(userUid);\n };\n\n //show modal\n modal.style.display = \"block\";\n\n //close on close\n span.onclick = function () {\n modal.style.display = \"none\";\n };\n\n //close on click\n window.onclick = function (event) {\n if (event.target == modal) {\n modal.style.display = \"none\";\n }\n }\n };\n }\n }",
"addUser(person) {\r\n this.#userList.set(person.getPersonId(), person);\r\n }",
"function sendInvites(json, statusText) {\n\t$(\"table.team tr:last\").after(json.members_html);\n for (i = 0; i < json.members_ids.length; i++) {\n\t\t$(\"#member_\"+ json.members_ids[i]).highlightFade({start: '#FFFF99', speed: 2000});\n\t $(\"#member_\"+ json.members_ids[i] +\" a.tip\").link_tips();\n\t};\n\t$(\"div.list-people\").after(\"<div class='invited-sent'><h3>Invites sent!</h3><p>Sent invites to \"+ json.members_names+\". Don't forget to edit their permissions on the left.</p></div>\");\t \n\tresetInviteQueue();\n\tcloseContactSelect();\n\t$(\"input[name='invites[]']\").remove();\n\tremove_this_after($(\"div.invited-sent\"), 7000);\n}",
"function inviteMember(current_user, invite_user, list_id) {\n if(confirmInvite(invite_user)) {\n\tif(list_id) {\n\t var result = null;\n\t var xmlhttp = null;\n\t if (window.XMLHttpRequest) {\n\t\txmlhttp=new XMLHttpRequest();\n\t } else {\n\t\txmlhttp=new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t }\n\t \n\t xmlhttp.onreadystatechange=function() {\n\t\tif (xmlhttp.readyState==4 && xmlhttp.status==200) {\n\t\t result = xmlhttp.responseText;\n\t\t}\n\t }\n\t \n\t var param1 = \"inv=\".concat(invite_user);\n\t var param2 = \"&i=\".concat(list_id); \n\t var params = param1.concat(param2);\n\t xmlhttp.open(\"POST\", \"resources/invite-member.php\", true);\n\t xmlhttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n\t xmlhttp.send(params);\n\t} else {\n\t //TODO \n\t //: if(targetListId) fails\n\t}\n\tdocument.getElementById('inviteMemberTextField').value='';\n } else {\n\t//DO SOMETHING\n\t//:if(confirmInvite(inviteUser) fails\n }\n}",
"async function initFriendsListener() {\n\n await updateUserFriends()\n \n\n // fill initial group panel\n friendHeader.innerHTML = `Friends\n <button id=\"friend-invit-btn\" type=\"button\" class=\"btn btn-light\">Invit users</button>`;\n \n friendContent.innerHTML = getHtmlFriendsList( userFriends );\n\n // attach listener to add button friends\n let invitFriendBtn = document.getElementById(\"friend-invit-btn\");\n invitFriendBtn.addEventListener( 'click', () => invitFriendListener() );\n\n // attach listener to all see friends button\n let seeFriendBtn = [...document.getElementsByClassName(\"btn-list-friend\")];\n seeFriendBtn.forEach( btn => btn.addEventListener( 'click', () => seeFriendListener(btn) ));\n\n // attach listener to all see friends button\n let chatFriendBtn = [...document.getElementsByClassName(\"btn-chat-friend\")];\n chatFriendBtn.forEach( btn => btn.addEventListener( 'click', () => {\n const friendid = btn.getAttribute(\"data-friendid\");\n openChatBox(friendid);\n }));\n}",
"function addToParty() {\n\t\t$(this).remove();\n\t\tfellowship.append($(this));\n\t\t$(this).children().each(function() {\n\t\t\talert($(this).text() + \" has joined your party!\");\n\t\t});\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Called on user input event handler, logs a pause video event to the server, then pauses the video. | function runPauseSequence() {
var time = getVideoTime();
logVideoEvent('pause', time, VIDEO_EVENT_LOG_URL).
then(function() {
pauseVideo();
});
} | [
"function _playVideoOnPause() {\n if (!_videoElementMovedWarning) {\n logging.warn('Video element paused, auto-resuming. If you intended to do this, ' + 'use publishVideo(false) or subscribeToVideo(false) instead.');\n\n _videoElementMovedWarning = true;\n }\n\n _domElement.play();\n }",
"function pause() {\n try {\n\t pl[(arguments[0]-1)].message(\"pause\");\n\t }\n catch(err) {\n post(\"bw.playlister: pause() requires a postive integer between 1 and \" + String(play_num) + \"\\n\");\n } \n}",
"function privatePause(){\n\t\tconfig.active_song.pause();\n\t\t\n\t\tif( config.active_metadata.live ){\n\t\t\tprivateDisconnectStream();\n\t\t}\n\t}",
"static recordPauseEvent() {\n chrome.metricsPrivate.recordUserAction(MetricsUtils.PAUSE_SPEECH_METRIC);\n }",
"function updatevideostatus(){\n \n \n if(video.paused)\n {\n \n video.play();\n }\n else{\n video.pause();\n }\n\n \n }",
"function sendPlayPause(paused)\n {\n socket.broadcast.emit('masterVideoPause', paused);\n }",
"function playPause() {\n if (video.paused) {\n // Play video\n video.play();\n } else {\n // Pause video\n video.pause();\n }\n}",
"function pause() {\r\n\t\t\tpauseFunction(countDown, \"pause\");\r\n\t\t}",
"function video_click(e) {\n\t//console.log(e);\n\t//console.log(this);\n\tif (this.paused == true) {\n\t\tthis.play();\n\t} else {\n\t\tthis.pause();\n\t}\n}",
"$mediaplayerPause() {\n this._setState(\"Paused\")\n }",
"pause(){\n console.debug(\"Pausing\", this.id);\n this.playing = false;\n for (let i = 0; i < this.mediaSourceListeners.length; i++) {\n if(typeof this.mediaSourceListeners[i].pause === 'function')this.mediaSourceListeners[i].pause(this);\n }\n }",
"pause () {\n\n this._debug.log(\"Pause\");\n // Stop the ad player\n if (this._vastPlayerManager) {\n this._vastPlayerManager.pause();\n }\n }",
"function _pauseCurrentPlayingVideo(){\n\t\t\tcontext.videoListControl.filter(function (videoItem) {\n\t\t\t\t// i need to get all the videos that are playing, which means its currentState is equals to 'play'\n\t\t\t\treturn videoItem.API.currentState === 'play';\n\t\t\t}).map(function (filteredVideo) {\n\t\t\t\t// pause the filtered video\n\t\t\t\tfilteredVideo.API.pause();\n\t\t\t});\n\t\t}",
"pause() {\n if (this.mediaUpdateTimeout) {\n window.clearTimeout(this.mediaUpdateTimeout);\n this.mediaUpdateTimeout = null;\n }\n\n this.stopRequest();\n if (this.state === 'HAVE_NOTHING') {\n // If we pause the loader before any data has been retrieved, its as if we never\n // started, so reset to an unstarted state.\n this.started = false;\n }\n // Need to restore state now that no activity is happening\n if (this.state === 'SWITCHING_MEDIA') {\n // if the loader was in the process of switching media, it should either return to\n // HAVE_MAIN_MANIFEST or HAVE_METADATA depending on if the loader has loaded a media\n // playlist yet. This is determined by the existence of loader.media_\n if (this.media_) {\n this.state = 'HAVE_METADATA';\n } else {\n this.state = 'HAVE_MAIN_MANIFEST';\n }\n } else if (this.state === 'HAVE_CURRENT_METADATA') {\n this.state = 'HAVE_METADATA';\n }\n }",
"function pauseGame() {\n // Pause the game logic goes here\n}",
"function onTimeupdate(){\n //if the video has finished\n if ( this.currentTime >= this.duration ){\n //if we are offering e-mail sharing\n if (configHandler.get('showLocalShare')){\n var vidElem = document.getElementById('videoReview');\n //if we have not shown the e-mail option yet\n if (haveShownShare === false ){\n //remember that we have shown it\n haveShownShare = true;\n //transition in the other UI elements\n var container = document.getElementById('videoReviewContainer');\n container.classList.add('share');\n var btn = document.getElementById('breakButton');\n btn.classList.remove('enabled');\n btn.classList.add('disabled');\n vidElem.muted = true;\n //play the audio after the e-mail option\n // has transitioned in\n if (soundPlayer.exists()){\n soundTimeout = setTimeout(function(){\n soundPlayer.play();\n }, 1000);\n }\n }\n //replay the video\n vidElem.currentTime = 0;\n vidElem.play();\n } else {\n //if we are not offering e-mail sharing\n // just transition to the thank you screen\n window.events.dispatchEvent(new Event('special'));\n }\n }\n }",
"playPauseAndUpdate(song = player.currentlyPlaying) {\n player.playPause(song);\n $('#time-control .total-time').text( player.getDuration );\n }",
"pauseToggle() {\n\t\tthis.isPaused = (this.isPaused)?false:true;\t\n\t}",
"function onContentPauseRequested() {\n isAdPlaying = true;\n videoContent.pause();\n // This function is where you should setup UI for showing ads (for example,\n // display ad timer countdown, disable seeking and more.)\n // setupUIForAds();\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method to resize Lookup result droupdown according to lookup search width this method called from "resize" event registed in connectedCallBack, fired when browser resize | windowResizing(event) {
let lookupSearchWidth = this.template.querySelector(".lookup-search");
if (lookupSearchWidth != null) {
lookupSearchWidth = lookupSearchWidth.offsetWidth + "px";
this.template.querySelector(".dropdown").style.width = lookupSearchWidth;
}
} | [
"function i2uiResizeSlaveresize()\r\n{\r\n var distanceX = i2uiResizeSlavenewX - i2uiResizeSlaveorigX;\r\n //i2uitrace(1,\"resize dist=\"+distanceX);\r\n if (distanceX != 0)\r\n {\r\n //i2uitrace(1,\"resize variable=\"+i2uiResizeSlavewhichEl.id);\r\n\r\n // test that variable exists by this name\r\n if (i2uiIsVariableDefined(i2uiResizeSlavewhichEl.id.substring(i2uiResizeKeywordLength)))\r\n {\r\n var w = i2uiResizeSlavewhichEl.id.substring(i2uiResizeKeywordLength);\r\n var newwidth = eval(w) + distanceX;\r\n //i2uitrace(1,\"distance=\"+distanceX+\" old width=\"+eval(w)+\" new width=\"+newwidth);\r\n\r\n var len = i2uiResizeWidthVariable.length;\r\n //i2uitrace(1,\"array len=\"+len);\r\n for (var i=0; i<len; i++)\r\n {\r\n if (i2uiResizeWidthVariable[i] == i2uiResizeSlavewhichEl.id.substring(i2uiResizeKeywordLength))\r\n {\r\n //i2uitrace(1,\"resize slave2 table[\"+i2uiResizeSlave2Variable[i]+\"]\");\r\n //i2uitrace(1,\"resize master table[\"+i2uiResizeMasterVariable[i]+\"]\");\r\n\r\n // make newwidth the smaller of newwidth and scroll width\r\n var scrolleritem = document.getElementById(i2uiResizeSlave2Variable[i]+\"_scroller\");\r\n //i2uitrace(0,\"scrolleritem=\"+scrolleritem);\r\n if (scrolleritem != null)\r\n {\r\n //i2uitrace(1,\"scrolleritem=\"+scrolleritem);\r\n //i2uitrace(1,\"scroller: width=\"+scrolleritem.width+\" style.width=\"+scrolleritem.style.width+\" client=\"+scrolleritem.clientWidth+\" scroll=\"+scrolleritem.scrollWidth+\" offset=\"+scrolleritem.offsetWidth);\r\n newwidth = Math.min(newwidth,scrolleritem.scrollWidth);\r\n }\r\n\r\n // must know about row groupings !!\r\n i2uiResizeScrollableArea(i2uiResizeSlave2Variable[i],null,newwidth);\r\n i2uiResizeScrollableArea(i2uiResizeMasterVariable[i],null,20,i2uiResizeSlaveVariable[i],i2uiResizeFlagVariable[i],newwidth);\r\n eval(i2uiResizeSlavewhichEl.id.substring(i2uiResizeKeywordLength)+\"=\"+newwidth);\r\n break;\r\n }\r\n }\r\n }\r\n else\r\n {\r\n window.status = \"ERROR: variable [\"+i2uiResizeSlavewhichEl.id.substring(i2uiResizeKeywordLength)+\"] not valid\";\r\n }\r\n }\r\n}",
"function resize() {\n\n var mapratio= parseInt(d3.select(tag_id).style('width'));\n\n if (width > 8*height) {\n mapratio = width /5;\n } else if (width > 6*height) {\n mapratio = width /4;\n } else if(width>4*height){\n mapratio = width /3;\n } else if(width> 2*height){\n mapratio = width/2;\n } else if(width >= height){\n mapratio = width;\n }\n\n projection.scale([mapratio]).translate([width/2,height/2]);\n }",
"function resizedw(){\n loadSlider(slider);\n }",
"function _resizeMeasurements(resizeInfo, sizeInfo) {\n var oldChartElem, doc = document,\n winSize = {\n height: window.innerHeight || doc.documentElement.offsetHeight,\n width: window.innerWidth || doc.documentElement.offsetWidth\n };\n\n if (winSize.height > 0 && winSize.width > 0) {\n winSize.height -= (resizeInfo.vMargins + resizeInfo.footingHeight);\n winSize.width -= resizeInfo.hMargins;\n\n resizeInfo.size = resizeInfo.size || getSizeObject(sizeInfo);\n resizeInfo.size.height = winSize.height;\n resizeInfo.size.width = winSize.width;\n resizeInfo.menuDiv.style.width = resizeInfo.size.width + 'px';\n\n try {\n if (resizeInfo.autoFit === arConstants.AUTOFIT_RESIZE) {\n oldChartElem = doc.getElementById(resizeInfo.containerId);\n oldChartElem.parentNode.removeChild(oldChartElem);\n }\n } catch(e) {} \n }\n\n return winSize;\n} // end _resizeMeasurements()",
"resizeResult() {\n if (this.props.showResults === true && this.state.resultsWidth === 0) {\n setTimeout(() => {\n this.setState({\n resultsWidth: (this.props.answerCount / this.props.highestAnswerCount) * 100,\n });\n }, 20);\n }\n }",
"function resizeHandler() {\n chart.draw(chartdata);\n }",
"updateWidth() {\n if (this.setupComplete) {\n let width = this.headerData.getWidth();\n this.width = '' + width;\n this.widthVal = width;\n $(`#rbro_el_table${this.id}`).css('width', (this.widthVal + 1) + 'px');\n }\n }",
"function resize () {\n width = slider.offsetWidth\n\n totalTravel = getTotalTravel()\n\n if (totalTravel <= 0 && active) {\n destroy()\n } else if (totalTravel > 0 && !active) {\n init()\n }\n\n if (active && !suspended) {\n reflow()\n selectByIndex(true) // skip focus, will jump page or slider otherwise\n }\n }",
"function resizeWordcloud() {\n wordCloudDiv.empty();\n $scope.wordCloud = wordcloud.WordCloud(wordCloudDiv.width(), wordCloudDiv.width() * 0.75,\n 250, $scope.addSearchString, \"#wordCloud\");\n $scope.wordCloud.redraw($scope.wordCount.getWords());\n wordCloudWidth = wordCloudDiv.width();\n }",
"function __resizeHandler__() {\n\t\tvar topMostDlg = __findTopMostDialog__();\n\t\t\n\t\tdoSizing();\n\t\t\n\t\tif (topMostDlg) {\n\t\t\tdoPositioning(topMostDlg);\n\t\t}\n\t}",
"updateWidth() {\n if (!this.isMounted() || !controller.$contentColumn.length) return;\n\n const left = controller.$contentColumn.offset().left - $(window).scrollLeft();\n const padding = 18;\n let width = $(document.body).hasClass('ltr') ?\n left - padding :\n $(window).width() - (left + controller.$contentColumn.outerWidth()) - padding;\n if (cd.g.skin === 'minerva') {\n width -= controller.getContentColumnOffsets().startMargin;\n }\n\n // Some skins when the viewport is narrowed\n if (width <= 100) {\n this.$topElement.hide();\n this.$bottomElement.hide();\n } else {\n this.$topElement.show();\n this.$bottomElement.show();\n }\n\n this.$topElement.css('width', width + 'px');\n this.$bottomElement.css('width', width + 'px');\n }",
"function resizeAllAutocomplete()\n{\n var autocompleteArrowContainer, autocompleteInput;\n\n $(\".autocomplete_container\").each(function ()\n {\n autocompleteArrowContainer = $(this).children(\".autocomplete_arrowContainer\");\n autocompleteInput = $(this).children(\".autocomplete_input\");\n\n $(autocompleteInput).outerWidth($(this).outerWidth() - $(autocompleteArrowContainer).outerWidth() - 1);\n });\n}",
"function ResizeScreenAfterContainerResize() {\r\n\r\n $(\"div [id$=InsertGridSubstance]\").css(\"height\", \"50%\");\r\n $(\"div [id$=InsertGridHealthHistory]\").css(\"height\", \"100\");\r\n}",
"function resizeHandler() {\n\tvar contentHeight = $('.content').height(),\n\t\tboxHeight = $('.info_box').height(),\n\t\tpageData = CLUB.pageData,\n\t\tpageSize = Math.floor(contentHeight/(boxHeight + 15));\n\tif(pageData.pageSize !== pageSize) {\n\t\tpageData.pageSize = pageSize;\n\t\tsetPageNumber();\n\t}\n}",
"updateMiddleWidth() {\n if(this.added) {\n var title = this.getJQueryObject().find(\".title\");\n var middle = title.find(\".middle\");\n var middlePadding = middle.outerWidth(true) - middle.width();\n var middleWidth = title.width() - middlePadding;\n\n // Wait 50ms to make sure every document change has been applied\n // Should probably be done in a more elegant way\n setTimeout(function() {\n title.children('div').each(function () {\n if(!$(this).hasClass(\"middle\")) {\n middleWidth -= $(this).outerWidth(true);\n }\n }).promise()\n .done( function() {\n middle.css(\"max-width\", middleWidth);\n });\n }, 50);\n }\n }",
"static startImageResize(d) {\n //console.log('resize start');\n d3.event.sourceEvent.preventDefault();\n d3.event.sourceEvent.stopPropagation();\n d.newHeight = d.height;\n d.newWidth = d.width;\n //console.log(JSON.stringify(d));\n d3.select('#OVER-' + d.link)\n .append('rect')\n .attr('id', 'RESIZE_WINDOW')\n .attr('x', 0)\n .attr('y', 0)\n .attr('height', d.newHeight)\n .attr('width', d.newWidth)\n .style('stroke-width', 1)\n .style('stroke', 'rgb(0,0,0)')\n .style('fill', 'rgb(10,20,180)')\n .style('fill-opacity', '0.4');\n }",
"function resizePopupWindow()\n{\n var list = document.getElementById('div__body');\n if (list == null)\n return; // only run this on the body section of framework generated pages\n var docwidth = getDocumentWidth()-10;\n var maxspanwidth = getMaxContentWidth(list.getElementsByTagName(\"span\"));\n var maxdivwidth = getMaxContentWidth(list.getElementsByTagName(\"div\"));\n var maxwidth = Math.max(list.scrollWidth,Math.max(maxspanwidth,maxdivwidth));\n // compare content width among all spans (machines) and divs (sections) to the windoe\n if ( maxwidth > docwidth )\n window.resizeBy(maxwidth -docwidth,0);\n}",
"function updateLook() {\n if (gURLBar.focused) {\n reset(1);\n return;\n }\n // compute the width of enhancedURLBar first\n partsWidth = 0;\n Array.forEach(enhancedURLBar.childNodes, function(child) partsWidth += child.boxObject.width);\n\n if (partsWidth > getMaxWidth() || showingHidden)\n enhancedURLBar.style.width = maxWidth + \"px\";\n else\n enhancedURLBar.style.width = partsWidth + \"px\";\n }",
"function resize(){\r\n\t$('#map').css(\"height\", ($(window).height() - navBarMargin));\r\n\t$('#map').css(\"width\", ($(window).width())); \r\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generate HTML given a title, body, stylesheet paths, and script paths. | function html_document(title, body, favicon, stylesheets, scripts) {
if (stylesheets === undefined) stylesheets = [];
if (scripts === undefined) scripts = [];
if (favicon !== undefined) {
favicon_type = { 'ico': 'image/x-icon', 'gif': 'image/gif', 'png': 'image/png' }[favicon.substring(favicon.length - 3)];
}
return '<html>\n<head>\n'
+ '<meta charset="utf-8">\n'
+ '<title>' + title + '</title>\n'
+ '<meta name="viewport" content="width=device-width">\n'
+ stylesheets.map(stylesheet_code).join(' ') + '\n'
+ scripts.map(script_code).join(' ') + '\n'
+ (favicon !== undefined ? '<link rel="shortcut icon" type="' + favicon_type + '" href="' + favicon + '">' : '') + '\n'
+ '</head>\n<body>' + '\n'
+ body + '\n'
+ '</body>\n</html>';
} | [
"function createPage() {\n\t\t// check to see if the directory exists\n\t\tif (!fs.existsSync(OUTPUT_DIR)) {\n\t\t\t// if it does not, then make it\n\t\t\tfs.mkdirSync(OUTPUT_DIR);\n\t\t}\n\t\t// write the html file using the render(coworkers) data\n\t\tfs.writeFileSync(outputPath, render(coworkers), \"utf-8\");\n\t}",
"function staticRender(body) {\n\n\t\t\tvar base = Brink.path('templates', 'application.html'),\n\t\t\t content = fs.readFileSync(base, 'utf8');\n\n\t\t\tvar data = {\n\t\t\t\thead: head\n\t\t\t};\n\n\t\t\tdata.body = body;\n\t\t\tdata.screen_name = current_screen;\n\n\t\t\tvar scripts = [];\n\t\t\tscripts.push({src:Brink.config('app_js')});\n\t\t\tscripts.push({src:Brink.config('socket_js')});\n\t\t\tscripts.push({src:Brink.config('template_js')});\n\n\t\t\tdata.scripts = scripts;\n\n\t\t\tdata.body = Mustache.render(layouts._main, data);\n\t\t\thtml = Mustache.render(content, data);\n\t\t\treturn html;\n\n\t\t}",
"buildTemplate(title, imagePath) {\n\n\t\tconst cssBlock = this.getStyling()\n\t\tconst inputtedImage = this.base64Image(imagePath)\n\n\t\treturn `\n\t\t\t<!DOCTYPE html>\n\t\t\t<html>\n\t\t\t\t<head>\n\t\t\t\t\t<meta charset=\"utf-8\">\n\t\t\t\t\t<style>${cssBlock}</style>\n\t\t\t\t</head>\n\t\t\t\t<body>\n\t\t\t\t\t<div id=\"container\">\n\t\t\t\t\t\t<img src=\"${inputtedImage}\" id=\"inputImage\"/>\n\t\t\t\t\t\t<h1>${title}</h1>\n\t\t\t\t\t</div>\n\t\t\t\t</body>\n\t\t\t</html>\n\t\t`\n\t}",
"function html() {\n return src('src/pug/*.pug')\n .pipe(pug({\n pretty: true\n }))\n // .on(\"error\", notify.onError(\"Error: <%= error.message %>\"))\n .pipe(dest('dist'))\n}",
"function prepHTML(options) {\n // options\n var options = typeof options !== \"undefined\" ? options : {}\n var container = options.container || \"chat\" // id of the container HTML element\n\tvar relative_path = options.relative_path || \"./node_modules/chat-bubble/\"\n\n // make HTML container element\n window[container] = document.createElement(\"div\")\n window[container].setAttribute(\"id\", container)\n document.body.appendChild(window[container])\n\n // style everything\n var appendCSS = function(file) {\n var link = document.createElement(\"link\")\n link.href = file;\n link.type = \"text/css\"\n link.rel = \"stylesheet\"\n link.media = \"screen,print\"\n document.getElementsByTagName(\"head\")[0].appendChild(link)\n }\n\tappendCSS(relative_path+ \"component/styles/input.css\");\n\tappendCSS(relative_path + \"component/styles/reply.css\")\n\tappendCSS(relative_path + \"component/styles/says.css\")\n\tappendCSS(relative_path + \"component/styles/setup.css\")\n\tappendCSS(relative_path + \"component/styles/typing.css\")\n\n}",
"function T1_init () {\n\n var codeBuffer = \"\";\n\n codeBuffer += '<!DOCTYPE html>';\n codeBuffer += '<html lang=\"en\">';\n codeBuffer += '<head>';\n codeBuffer += '<title>Generated Site</title>';\n codeBuffer += '<meta charset=\"UTF-8\">';\n codeBuffer += '<link rel=\"stylesheet\" href=\"layout.css\" type=\"text/css\">';\n codeBuffer += '<link rel=\"stylesheet\" href=\"http://htmlforge.com/Generated/template-1/layout.css\" type=\"text/css\">';\n codeBuffer += '<link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.7.0/animate.min.css\" type=\"text/css\">';\n codeBuffer += '</head>';\n codeBuffer += '<body>';\n\n return codeBuffer;\n}",
"function generateStyleHTML (styleSrc)\n{\n\treHeader = /\\.text-header\\s*\\{([^}]*)/\n\treBody = /\\.text-body\\s*\\{([^}]*)/\n\t\t\n\tif (styleSrc.indexOf(\"SS_\") == 0)\n\t\tvar style = doActionEx\t('DATA_READFILE',styleSrc, 'FileName', styleSrc,'ObjectName',\n\t\t\t\t\t\t\t\tgSTYLE_OBJ, 'FileType', 'txt');\n\telse\t\t\n\t\tvar style = doActionEx\t('DATA_READFILE',gSTYLES_DIR+styleSrc, 'FileName', gSTYLES_DIR+styleSrc,\n\t\t\t\t\t\t\t\t'ObjectName', gPUBLIC, 'FileType', 'txt');\n\n\tvar rc = \"<table width = '100%' border='1' bgcolor='#FFFFFF'><tr><td>\";\n rc += \"<div align='center'><b><i>\";\n rc += \"<font size='5' color='#000000' style = '\"+reHeader(style)[1]+\";TEXT-ALIGN: center;'>\";\n rc += \"Sample Header<br></font></i></b>\";\n rc += \"<font size='4' color='#000000' style = '\"+reBody(style)[1]+\";TEXT-ALIGN: center;'>\";\n rc += \"Sample Body</font></div></td></tr></table>\";\n\treturn (rc);\n}",
"function template(title) {\n var initialState = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var content = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : \"\";\n // there is nothing special except window.__STATE__. All we need to do is grab the initial state from\n // window.__STATE__ and pass it to our configureStore() function as the initial state.\n var scripts = '';\n\n if (content) {\n // To pass along the state, the template attaches state to window.__STATE__ inside a <script> tag.\n // Now you can read state on the client side by accessing window.__STATE__.\n // We also include the SSR companion assets/client.js client-side application in another script tag.\n scripts = \"<script>window.__STATE__ = \".concat(JSON.stringify(initialState), \"</script><script src=\\\"assets/client.js\\\"></script>\");\n } else {\n // If you request the pure client version, it only puts assets/bundle.js inside the script tag.\n // we use `` symbols because we need string to compose it in html tag instead of object\n scripts = \"<script src=\\\"../assets/bundle.js\\\"></script>\"; // this version will return incorrect string and client rendering will work incorrect.\n //scripts = `<script src=\"../assets/bundle.js\" />`;\n // will provide object to us instead of string\n //scripts = (<script src=\"../assets/bundle.js\" />);\n } // returns composed version\n\n\n return \"<html lang=\\\"en\\\">\\n <head>\\n <meta charSet=\\\"utf-8\\\" />\\n <title>\".concat(title, \"</title>\\n <link href=\\\"../assets/style.css\\\" rel=\\\"stylesheet\\\" />\\n </head>\\n <body>\\n <div class=\\\"content\\\"><div id=\\\"app\\\" class=\\\"wrap-inner\\\">\").concat(content, \"</div>\\n <div>\").concat(scripts, \"</div>\\n </body>\\n </html>\");\n}",
"function writeHomepage(length, data) {\n\n var gotoURL = \"/makememe/\"\n\n // var html = '<!DOCTYPE html><html><head><link rel=\"stylesheet\" href=\"homepage.css\"><script>src=\"index.js\"</script><meta charset=\"utf-8\"/></head><body><table class = \"grid\" id = \"table\"><h1 class = \"title\">Meme Maker</h1><tr>'; //head of html file\n var pugtxt = \"doctype html\\nhtml\\n\\thead\\n\\t\\tstyle\\n\\t\\t\\tinclude homepage.css\\n\\t\\tscript.\\n\\t\\t\\tsrc=\\\"index.js\\\"\\n\\tbody\\n\\t\\tdiv.header\\n\\t\\t\\th1.title Meme Maker\\n\\t\\th2.text To get started, select an image from the gallery below!\\n\\t\\ttable#table.grid\\n\\t\\t\\ttbody\\n\\t\\t\\t\\ttr\";\n for(var i = 0; i < length; i++) {\n if(i%4 === 0 && i!=0){ // Makes a row of 4, replace 4 with anything you want \n //html += '</tr><tr>'; \n pugtxt += \"\\n\\t\\t\\t\\ttr\"\n }\n //html += '<td class = \"meme_box\"><img src=\"' + data[i].url + '\"></td>';\n // pugtxt += \"\\n\\t\\t\\t\\t\\ttd.meme_box a(href =\\\"\" + gotoURL + data[i].template_id + \"\\\")\";\n \n pugtxt += \"\\n\\t\\t\\t\\t\\ttd.meme_box\"\n //pugtxt += \"\\n\\t\\t\\t\\t\\t\\ta(href ='\" + gotoURL + data[i].template_id + \"')\";\n pugtxt += \"\\n\\t\\t\\t\\t\\t\\timg(src=\\\"\" + data[i].url + \"\\\")\";\n }\n //html += '</tr>';\n //html += '</table>'; \n //html += '</body></html>';\n //console.log(html); // just for testing if you want to \n //write pugtxt to the index.pug file, it will overwrite the previous html on each run\n fs.writeFile(path.join(__dirname + 'views/index.pug'), pugtxt, err => {\n if(err) {\n console.error(err);\n return; \n }\n })\n}",
"buildPage() {\n if (this.compiled == false) {\n var page = \"<h1> Scoring </h1><b><p>Compiler failed with the following output:<p id=\\\"output\\\">\" + this.out + \"</p></b>\";\n fs.writeFileSync('result.html', page, function (err) {\n if (err) throw err;\n console.log('Created result.html page!');\n this.isDone = true;\n });\n } else {\n var page = \"<h1> Scoring </h1><b><p id=\\\"score\\\">\" + this.points + \" / \" + this.maxPoints + \"</p><p id=\\\"output\\\">\" + this.out + \"</p></b>\";\n fs.writeFileSync('result.html', page, function (err) {\n if (err) throw err;\n console.log('Created result.html page!');\n this.isDone = true;\n });\n }\n }",
"function appendToHead(callback) {\n\t\t\tvar headLayout = '';\n\t\t\tvar scripts = ['jquery.printarea.min.js','jquery.fancybox.min.js','flash-detection.min.js','swfobject.min.js','jquery.mCustomScrollbar.min.js','jquery.touchSwipe.min.js','jquery.jcarousel.min.js','jquery.tooltip.min.js','tour.min.js'];\n\n\t\t\tfor (var i = scripts.length - 1; i >= 0; i--) {\n\t\t\t\theadLayout += '<script type=\"text/javascript\" src=\"' + settings.basepath + '/global/js/' + scripts[i] + '\"></script>';\n\t\t\t}\n\n\t\t\theadLayout += '<link rel=\"stylesheet\" type=\"text/css\" href=\"' + settings.basepath + '/global/lightwindow/jquery.fancybox.min.css\" media=\"screen\" />';\n\t\t\theadLayout += '<link rel=\"stylesheet\" type=\"text/css\" href=\"' + settings.basepath + '/global/css/style.css\" media=\"screen\" />';\n\t\t\theadLayout += '<link rel=\"stylesheet\" type=\"text/css\" href=\"' + settings.basepath + '/global/css/skin.css\" media=\"screen\" />';\n\t\t\theadLayout += '<link rel=\"stylesheet\" type=\"text/css\" href=\"' + settings.basepath + '/global/css/jquery.mCustomScrollbar.min.css\" media=\"screen\" />';\n\t\t\theadLayout += '<link rel=\"stylesheet\" type=\"text/css\" href=\"' + settings.basepath + '/global/css/print.min.css\" media=\"print\" />';\n\t\t\t$('head').append(headLayout);\n\n\t\t\tif (typeof callback === \"function\") {\n\t\t\t\tcallback();\n\t\t\t}\n\t\t}",
"generate() {\n if (!fs.existsSync(this.outputPath)) {\n fs.mkdirSync(this.outputPath);\n }\n\n fs.writeFile(`${ this.outputPath }/index.html`, this.report, (err) => {\n if (err) {\n return logger.error(err);\n }\n });\n }",
"render(opts) {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n if (opts.publicPath && opts.documentFilePath && opts.url !== undefined) {\n const url = new URL(opts.url);\n // Remove leading forward slash.\n const pathname = url.pathname.substring(1);\n const pagePath = resolve(opts.publicPath, pathname, 'index.html');\n if (pagePath !== resolve(opts.documentFilePath)) {\n // View path doesn't match with prerender path.\n let pageExists = this.pageExists.get(pagePath);\n if (pageExists === undefined) {\n pageExists = yield exists(pagePath);\n this.pageExists.set(pagePath, pageExists);\n }\n if (pageExists) {\n // Serve pre-rendered page.\n return readFile(pagePath, 'utf-8');\n }\n }\n }\n // if opts.document dosen't exist then opts.documentFilePath must\n const extraProviders = [\n ...(opts.providers || []),\n ...(this.providers || []),\n ];\n let doc = opts.document;\n if (!doc && opts.documentFilePath) {\n doc = yield this.getDocument(opts.documentFilePath);\n }\n if (doc) {\n extraProviders.push({\n provide: INITIAL_CONFIG,\n useValue: {\n document: opts.inlineCriticalCss\n // Workaround for https://github.com/GoogleChromeLabs/critters/issues/64\n ? doc.replace(/ media=\\\"print\\\" onload=\\\"this\\.media='all'\"><noscript><link .+?><\\/noscript>/g, '>')\n : doc,\n url: opts.url\n }\n });\n }\n const moduleOrFactory = this.moduleOrFactory || opts.bootstrap;\n const factory = yield this.getFactory(moduleOrFactory);\n const html = yield renderModuleFactory(factory, { extraProviders });\n if (!opts.inlineCriticalCss) {\n return html;\n }\n const { content, errors, warnings } = yield this.inlineCriticalCssProcessor.process(html, {\n outputPath: (_a = opts.publicPath) !== null && _a !== void 0 ? _a : (opts.documentFilePath ? dirname(opts.documentFilePath) : undefined),\n });\n // tslint:disable-next-line: no-console\n warnings.forEach(m => console.warn(m));\n // tslint:disable-next-line: no-console\n errors.forEach(m => console.error(m));\n return content;\n });\n }",
"function writeHtml() {\n return gulp.src('index.html')\n .pipe(htmlreplace({\n 'js-bundle': 'bundle.js'\n })).pipe(useref())\n .pipe(gulp.dest('build/'));\n}",
"function loadScripts() {\n loadPageHeader();\n getPages();\n getStyles();\n getScripts();\n addEventListeners();\n}",
"addLayoutScriptsAndStyles() {\n this.asset.layoutScript = path.join(this.pageConfig.layoutsAssetPath, this.layout, 'scripts.js');\n this.asset.layoutStyle = path.join(this.pageConfig.layoutsAssetPath, this.layout, 'styles.css');\n this.includedFiles.add(\n path.join(this.pageConfig.rootPath, LAYOUT_FOLDER_PATH, this.layout, 'scripts.js'));\n this.includedFiles.add(\n path.join(this.pageConfig.rootPath, LAYOUT_FOLDER_PATH, this.layout, 'styles.css'));\n }",
"function htmlHeader( title, config )\n{\n origTitle = title;\n if (title==\"HomePage\") \n title = config.GENERAL.HOMEPAGE; \n print(\"<!DOCTYPE html PUBLIC \\\"-//W3C//DTD XHTML 1.0 Strict//EN\\\" \\\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\\\">\\n\");\n print(\"<html xmlns=\\\"http://www.w3.org/1999/xhtml\\\" xml:lang=\\\"ja-JP\\\" lang=\\\"ja-JP\\\">\\n\");\n print(\"<head>\");\n print(\"\\n\");\n print(\"\\t<meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html; charset=\"+config.GENERAL.ENCODE+\"\\\" />\\n\");\n css(origTitle);\n print(\"\\t<title>\");\n if (config.GENERAL.TITLE==title)\n print(config.GENERAL.TITLE);\n else\n print(config.GENERAL.TITLE+\">\"+title); \n print(\"</title>\\n\");\n print(\"</head>\\n\");\n print(\"<body>\\n\");\n}",
"function T1_MakeHTML (blocks) {\n\n var code = \"\"; // Code will be appended to this through the process\n var head_count = 0; // Will keep count of headers found\n var foot_count = 0; // Will keep count of footers found\n\n // Scan for Headers and Footers, we will not allow duplicates by force.\n for(var i = 0; i < blocks.length; i++){\n if(blocks[i] == 'label_1') {head_count++;}\n if(blocks[i] == 'label_2') {foot_count++;}\n }\n \n // Initalizes HTML\n code += T1_init ();\n \n // Header Exclusive, this forces a header to always be placed on top regardless\n // of the location it was found\n if(head_count > 0){code += T1_Header(); head_count--;}\n\n // Container Open (Used only for the basic Template)\n code += T1_ContainerTop();\n\n // Loop through blocks and output code as necessary \n for(var i = 0; i < blocks.length; i++){\n\n if (blocks[i] == 'label_1') { // Special conditions for headers\n if(head_count > 0) { // ONLY pushes alternate code if header was used\n code += T1_Title();\n head_count--;\n }} \n\n if (blocks[i] == 'label_2') { // Special conditions for footers\n if(foot_count > 1) { // ONLY pushed alternate code if footer was detected\n code += T1_Title();\n foot_count--;\n }}\n\n // All Other Labels\n if (blocks[i] == 'label_3') {code += T1_Para();}\n if (blocks[i] == 'label_4') {code += T1_Title();}\n if (blocks[i] == 'label_5') {code += T1_SingleImage();}\n if (blocks[i] == 'label_6') {code += T1_ImagePara();}\n if (blocks[i] == 'label_7') {code += T1_ImagePrev();}\n if (blocks[i] == 'label_8') {code += T1_ImageSimple();}\n if (blocks[i] == 'label_9') {code += T1_ImgLeft_TxtRight();}\n if (blocks[i] == 'label_10') {code += T1_ImgRight_TxtLeft();}\n if (blocks[i] == 'label_11') {code += T1_ImgTop_TxtBottom();}\n if (blocks[i] == 'label_12') {code += T1_Img_TxtTop();}\n if (blocks[i] == 'label_13') {code += T1_People();}\n }\n\n // Container Close (Used only for the basic Template)\n code += T1_ContainerBot ();\n \n // Footer Exclusive, forces a detected footer to always place on the bottom \n // regardless of the location it was found\n if(foot_count > 0){code += T1_Footer();}\n\n // Closes initalized HTML\n code += T1_init_End();\n \n code = formatFactory(code);\n return code;\n}",
"function processSourceFile(filepath, next){\n\tgrunt.log.ok(\"Processing \" + filepath + \"\\n\");\n\t//Renders then writes the file\n\tgenerateFile(filepath, function(err, contents){\n\t\tif (err) {\n\t\t\tgrunt.warn(err);\n\t\t\tnext(err);\n\t\t}\n\t\twriteFile(contents, getHtmlFileDestination(filepath));\n\t\tnext();\n\t});\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
create the final dungeon, keeping the hero's stats and items: | createFinalDungeon (heroStats, heroItems) {
this.finalDungeon = true
this.enemies = this.createEnemies()
this.setState({
gameId: this.state.gameId + 1,
heroStats: heroStats,
heroItems: heroItems
})
} | [
"generateDoors(){\n if(!this.walls.top){\n // make a door to the top\n this.grid[this.getIndex(2, 0)].fg = null;\n this.grid[this.getIndex(3, 0)].fg = null;\n this.grid[this.getIndex(1, 0)].fg = this.getSprite('tilemap', 'cobble-fg-right-0');\n this.grid[this.getIndex(2, 2)].fg = this.getSprite('tilemap', 'stoneplank-0');\n this.grid[this.getIndex(3, 2)].fg = this.getSprite('tilemap', 'stoneplank-1');\n this.grid[this.getIndex(4, 0)].fg = this.getSprite('tilemap', 'cobble-fg-left-0');\n this.grid[this.getIndex(2, 2)].fg.jumpable = true;\n this.grid[this.getIndex(3, 2)].fg.jumpable = true;\n }\n if(!this.walls.right){\n // make a door to the right\n this.grid[this.getIndex(5, 1)].fg = null;\n this.grid[this.getIndex(5, 2)].fg = null;\n this.grid[this.getIndex(5, 3)].fg = null;\n this.grid[this.getIndex(5, 4)].fg = null;\n } else {\n this.grid[this.getIndex(5, 1)].deco = null;\n this.grid[this.getIndex(5, 2)].deco = null;\n this.grid[this.getIndex(5, 3)].deco = null;\n this.grid[this.getIndex(5, 4)].deco = null;\n }\n if(!this.walls.bottom){\n // make a door to the bottom\n this.grid[this.getIndex(1, 5)].fg = this.getSprite('tilemap', 'cobble-fg-right-0');\n this.grid[this.getIndex(2, 5)].fg = this.getSprite('tilemap', 'stoneplank-0');\n this.grid[this.getIndex(3, 5)].fg = this.getSprite('tilemap', 'stoneplank-1');\n this.grid[this.getIndex(4, 5)].fg = this.getSprite('tilemap', 'cobble-fg-left-0');\n this.grid[this.getIndex(2, 5)].fg.jumpable = true;\n this.grid[this.getIndex(3, 5)].fg.jumpable = true;\n }\n if(!this.walls.left){\n // make a door to the left\n this.grid[this.getIndex(0, 1)].fg = null;\n this.grid[this.getIndex(0, 2)].fg = null;\n this.grid[this.getIndex(0, 3)].fg = null;\n this.grid[this.getIndex(0, 4)].fg = null;\n } else {\n this.grid[this.getIndex(0, 1)].deco = null;\n this.grid[this.getIndex(0, 2)].deco = null;\n this.grid[this.getIndex(0, 3)].deco = null;\n this.grid[this.getIndex(0, 4)].deco = null;\n }\n }",
"function makeRoom(){\n var newRoom = new Room(size());\n newRoom.populate();\n for (var j=0; j<newRoom.contents.length; j++){\n var furn = newRoom.contents[j];\n furn.populate();\n };\n return newRoom;\n}",
"function createMob() {\n var rand = Math.random();\n var tear = 1;\n if (rand < 0.5) {\n tear = 1;\n } else if (rand < 0.8) {\n tear = 2;\n } else if (rand < 0.95) {\n tear = 3;\n } else {\n tear = 4;\n }\n enemy = new Monster(LEVEL, tear);\n updateMob();\n}",
"function create_random_map() {\n var easy = planet_types.none;\n for(var j = 0; j < map.rows - map.downgrade; j++) {\n for(var i = 0; i < map.columns; i++) {\n var planet = map.planets[i][j];\n if(gamer.level <= 2) {\n if(i % 2 == 0) {\n var tmp = random(1, 6);\n while(easy == tmp) {\n tmp = random(1, 6);\n }\n easy = tmp;\n }\n planet.type = easy;\n } else if(gamer.level <= 4) {\n planet.type = random(1, 6);\n } else {\n hardmode = true;\n planet.type = random(1, 6);\n }\n gamer.available_planets++;\n }\n }\n }",
"function LevelCreator(){\n var universe = new Universe();\n \n universe.nav = new LevelCreatorNav();\n \n universe.init = function (world, graphics) {\n this.nav.init(world, graphics);\n graphics.addTask(new LevelGraphics(world));\n graphics.disableDebug();\n \n world.getCamera().setFocusObj(this.wizard);\n world.getCamera().setScaleBounds(1.0, 2.0);\n world.getCamera().setTileSize(this.tileSize);\n \n this.wizard.init(world);\n \n for (var i = 0; i < this.data.length; i++) {\n for (var j = 0; j < this.data[i].unit.length; j++) {\n var ud = this.data[i].unit[j];\n this.addUnit(ud.type - 1, \n (i * this.tileSize * this.sliceSize) + (ud.x * this.tileSize), \n ud.y);\n }\n }\n };\n \n universe.wizard = {\n x: 0,\n y: 0,\n pos : {x: 0, y:0},\n speed: 2,\n init: function (world) {\n this.x = world.getCamera().canvasWidth / 2;\n this.y = world.getCamera().canvasHeight / 2;\n },\n update: function (world) {\n var ctrl = world.getController();\n if (ctrl.a) this.x -= this.speed;\n if (ctrl.d) this.x += this.speed;\n if (ctrl.w) this.y -= this.speed;\n if (ctrl.s) this.y += this.speed;\n \n var mouse = ctrl.current;\n if (mouse !== null) {\n var cam = world.getCamera();\n this.pos.x = Math.trunc((mouse.offsetX / 2 + cam.x) / world.getUniverse().tileSize);\n this.pos.y = Math.trunc((mouse.offsetY / 2 + cam.y) / world.getUniverse().tileSize);\n }\n \n if (ctrl.isDown) {\n world.getUniverse().setBlock(this.pos.x, this.pos.y, \n universe.nav.blockBrush());\n }\n }\n };\n \n /**\n * The main game loop. Called dt/1000 times a second.\n * @param {Universe} world The entire universe\n */\n universe.update = function(world){\n this.wizard.update(world);\n };\n \n return universe;\n}",
"plantSeed() {\n\t\tthis.stop();\n\t\tthis.loops = 0;\n\t\tthis.myTree = new FractalTree({x: ground.width/2-100, y: ground.height-20}, this.myDNA);\n\t\tthis.settingsClose();\n\t\tthis.play();\n\t}",
"function loadLevel(){\n\n\t\t//saveChar(n, r, ge, go, l, t, a);\n\t\tnewLevel++;\n // Next we get to change the background\n //var BG = PIXI.Texture.fromImage(\"res/\" + currentArea.name + \".png\");\n\t\tvar BG = PIXI.Texture.fromImage(currentArea.name + \".png\");\n\t doorOut.tint = 0x999966;\n\n\t\tconsole.log(\"\t\" + newLevel + \" \" + currentArea.name);\n\n\t\t// Gotta reset those chests, jsut gonna make new ones for now, will 'reset' them later.\n \t for(var i = 0; i < 5; i++){\n\n \t chests[i] = new chest(INDEX, i);\n\t chests[i].sprite.position.x = 650; //20 + (90 * i);\n \t chests[i].sprite.position.y = 42 + (80 * i); //50;\n \t stage.addChild(chests[i].sprite);\n \t }\n\t\t\n\t\t// Next we get to change the background\n \t//var BG = PIXI.Texture.fromImage(\"res/\" + currentArea.name + \".png\");\n\t\t//areaBackground.setTexture(BG);\n\t\tareaBackground.texture = BG;\n //stage.addChild(areaBackground);\n\t}",
"function buildFort(position, playerName) {\n var sql = \"INSERT INTO game_objects (type, pos_x, pos_y, owner, health) VALUES ?\";\n var values = [\n ['TOWER', position.posX, position.posY, playerName, 100],\n ['TOWER', position.posX + 6, position.posY, playerName, 100],\n ['TOWER', position.posX, position.posY + 6, playerName, 100],\n ['TOWER', position.posX + 6, position.posY + 6, playerName, 100],\n ['STRGHD', position.posX + 2, position.posY + 2, playerName, 200],\n ['WORKER', position.posX + 7, position.posY + 7, playerName, 100]\n ];\n for(i=1; i<=5; i++) {\n values.push(['WALL', position.posX + i, position.posY, playerName, 100]);\n values.push(['WALL', position.posX, position.posY + i, playerName, 100]);\n values.push(['WALL', position.posX + i, position.posY + 6, playerName, 100]);\n values.push(['WALL', position.posX + 6, position.posY + i, playerName, 100]);\n }\n conn.query(sql, [values], function(err, result) {\n if(err) throw err;\n console.log('Built Fort for \\'', playerName, '\\' at position (', position.posX, ', ', position.posY, ')');\n });\n}",
"function makeOverworld(start_side=\"\", buildRange=[3,7]){\n\tlet m = baseOverworld(start_side);\n\tlet doorSet = makeBuildings(m,buildRange);\n\treturn {'map': m, 'doors': doorSet};\n}",
"function createRandomTerrain(){\n\t\t//first check world sizes not to small\n\t\tif(worldWidth < worldMinWidth){ worldWidth = worldMinWidth; }\n\t\tif(worldHeight < worldMinHeight){ worldHeight = worldMinHeight; }\n\t\t\n\t\t//world map grid\n\t\t//first we just create the whole array\n\t\tworldGrid = new Array(worldWidth);\n\t\tfor(var iX = 0; iX < worldWidth; iX++){\n\t\t\tworldGrid[iX] = new Array(worldHeight);\n\t\t\tfor(var iY = 0; iY < worldHeight; iY++){\n\t\t\t\tworldGrid[iX][iY] = new Object();\n\t\t\t\tworldGrid[iX][iY].blockType = BLOCKTYPENONE;\n\t\t\t\tworldGrid[iX][iY].frameName = \"blank.png\";\n\t\t\t\tworldGrid[iX][iY].position = new PIXI.Point(iX * worldBlockSize, iY * worldBlockSize);\n\t\t\t}\n\t\t}\n\t\t\n\t\t//random generation\n\t\tvar lastHeight = Math.round(worldHeight -(worldMinHeight / 3));\n\n\t\tfor(var iX = 0; iX < (worldWidth / 2); iX++){\n\t\t\t\n\t\t\t//randomize when not in start flat area\n\t\t\tif(iX < lowRangeStartArea || iX > highRangeStartArea){\n\t\t\t\tvar rndNum = Math.random();\n\t\t\t\tif(rndNum < 0.5){ lastHeight--; lastHeight--; }\n\t\t\t\tif(rndNum >= 0.5){ lastHeight++;}\n\t\t\t}\n\t\t\t\n\t\t\tif(lastHeight < 5){ lastHeight = 5; }\n\t\t\t\n\t\t\t// 1/4 of last height\n\t\t\tvar\tqLastHeight = Math.round((worldHeight - lastHeight) / 4);\n\t\t\t\n\t\t\tfor(var iY = (worldHeight - 1); iY > 0; iY--){ //y in reverse\n\t\t\t\tif(iY > lastHeight){\n\t\t\t\t\tworldGrid[iX][iY].blockType = BLOCKTYPEDIRT;\n\t\t\t\t\tworldGrid[iX][iY].frameName = getRandomDirtTexture(0);\n\t\t\t\t}\n\t\t\t\tif(iY > lastHeight + qLastHeight){\n\t\t\t\t\tworldGrid[iX][iY].blockType = BLOCKTYPEDIRT;\n\t\t\t\t\tworldGrid[iX][iY].frameName = getRandomDirtTexture(1);\n\t\t\t\t}\n\t\t\t\tif(iY > lastHeight + qLastHeight*2){\n\t\t\t\t\tworldGrid[iX][iY].blockType = BLOCKTYPEDIRT;\n\t\t\t\t\tworldGrid[iX][iY].frameName = getRandomDirtTexture(2);\n\t\t\t\t}\n\t\t\t\tif(iY > lastHeight + qLastHeight*3){\n\t\t\t\t\tworldGrid[iX][iY].blockType = BLOCKTYPEDIRT;\n\t\t\t\t\tworldGrid[iX][iY].frameName = getRandomDirtTexture(3);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//smooth out rough parts\n\t\tfor(var iX = 1; iX < (worldWidth / 2); iX++){\n\t\t\tfor(var iY = 1; iY < worldHeight - 1; iY++){\n\t\t\t\t//check not right at edge of world for array saftey net\n\t\t\t\tif(worldGrid[iX][iY].blockType != BLOCKTYPENONE ){\n\t\t\t\t\t//\n\t\t\t\t\tif(worldGrid[iX - 1][iY].blockType === BLOCKTYPENONE &&\n\t\t\t\t\t\t\tworldGrid[iX][iY - 1].blockType === BLOCKTYPENONE &&\n\t\t\t\t\t\t\tworldGrid[iX + 1][iY].blockType === BLOCKTYPENONE){\n\t\t\t\t\t\t\n\t\t\t\t\t\tworldGrid[iX][iY].blockType = BLOCKTYPENONE;\n\t\t\t\t\t\tworldGrid[iX][iY].frameName = \"blank.png\";\n\t\t\t\t\t\tworldGrid[iX+1][iY].blockType = BLOCKTYPENONE;\n\t\t\t\t\t\tworldGrid[iX+1][iY].frameName = \"blank.png\";\n\t\t\t\t\t\tworldGrid[iX-1][iY].blockType = BLOCKTYPENONE;\n\t\t\t\t\t\tworldGrid[iX-1][iY].frameName = \"blank.png\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t//grass topping\n\t\tvar grassLevels;\n\t\tfor(var iX = 1; iX < (worldWidth / 2); iX++){\n\t\t\tgrassLevels = 0;\n\t\t\tfor(var iY = 1; iY < worldHeight - 1; iY++){\n\t\t\t\t//check not right at edge of world for array saftey net\n\t\t\t\tif(worldGrid[iX][iY].blockType != BLOCKTYPENONE ){\n\t\t\t\t\t\tworldGrid[iX][iY].blockType = BLOCKTYPEGRASS;\n\t\t\t\t\t\tworldGrid[iX][iY].frameName = getRandomGrassTexture();\n\t\t\t\t\t\tgrassLevels++;\n\t\t\t\t\t\tif(grassLevels > 1){ break; }\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//flip copy to second half of world\n\t\tfor(var iX = 0; iX < (worldWidth / 2); iX++){\n\t\t\tfor(var iY = 0; iY < worldHeight; iY++){\n\t\t\t\tif(worldGrid[iX][iY].blockType != BLOCKTYPENONE){\n\t\t\t\t\tworldGrid[worldWidth - iX - 1][iY].blockType = worldGrid[iX][iY].blockType;\n\t\t\t\t\tswitch(worldGrid[iX][iY].blockType){\n\t\t\t\t\tcase BLOCKTYPEDIRT:\n\t\t\t\t\t\tworldGrid[worldWidth - iX - 1][iY].frameName = worldGrid[iX][iY].frameName;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase BLOCKTYPEGRASS:\n\t\t\t\t\t\tworldGrid[worldWidth - iX - 1][iY].frameName = getRandomGrassTexture(60);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t\t\n\t}",
"function makeTerrain(){\n //Parameters affecting terrain generation\n var paddingSize=5;\n var scaleUp=4;\n var smoothingRadius=3;\n //Get terrain data\n var terrainData=generateTerrainData(worldData.emoScores,paddingSize,scaleUp,smoothingRadius);\n //Unpack terrain data\n var flattenedArr=terrainData.flattenedArr;\n var helperArrFlat=terrainData.helperArrFlat;\n var wS=terrainData.wS;\n var hS=terrainData.hS;\n var numChunks=terrainData.numChunks;\n //Set variables in exported object\n globalTerrainData.terrainWidth=terrainData.terrainWidth;\n globalTerrainData.terrainHeight=terrainData.terrainHeight;\n globalTerrainData.playerStartX=terrainData.xBound-terrainData.paddingX/4;\n globalTerrainData.xBound=terrainData.xBound;\n globalTerrainData.zBound=terrainData.zBound;\n //Generate and return mesh\n return generateMesh(globalTerrainData.terrainWidth,globalTerrainData.terrainHeight,wS,hS,numChunks,flattenedArr,helperArrFlat)\n}",
"function generate_level() {\r\n startposx = randomNbr(1, 12)\r\n startposy = randomNbr(1, 11)\r\n let endposx = randomNbr(startposx + 1, 13)\r\n let endposy = randomNbr(1, 11)\r\n let posX_table = [startposx, endposx]\r\n let posY_table = [startposy, endposy]\r\n\r\n //save new position for x,y\r\n function incrementposX(x, y) {\r\n if (x < endposx) {\r\n x++;\r\n posX_table.unshift(x)\r\n posY_table.unshift(y)\r\n // console.log('incremented x', x);\r\n } else {\r\n x--;\r\n posX_table.unshift(x)\r\n posY_table.unshift(y)\r\n // console.log('decremented x', x);\r\n }\r\n }\r\n \r\n //save new position for y,x\r\n function incrementposY(x, y) {\r\n if (y < endposy) {\r\n y++;\r\n posY_table.unshift(y)\r\n posX_table.unshift(x)\r\n // console.log('incremented y', y);\r\n } else {\r\n y--;\r\n posY_table.unshift(y)\r\n posX_table.unshift(x)\r\n // console.log('decremented y', y);\r\n }\r\n }\r\n\r\n //bit of math to calculate maximum amount of moves possible, so that random path generator won't be stuck by wall\r\n let dist = (endposx - startposx) + (Math.abs((endposy - startposy))) + Math.abs((endposx + endposy) - (startposx + startposy))\r\n console.log('this is dist', dist);\r\n\r\n //generates solution path based on distances using both posX and posY tables, and will randomly increment x or y \r\n for (i = 0; i <= (dist); i++) {\r\n if (posX_table[0] != endposx && posY_table[0] != endposy) {\r\n let rand = Math.floor(Math.random() * 2)\r\n if (rand < 1) {\r\n incrementposX(posX_table[0], posY_table[0])\r\n } else {\r\n incrementposY(posX_table[0], posY_table[0])\r\n }\r\n } else if (posX_table[0] != endposx) {\r\n incrementposX(posX_table[0], posY_table[0])\r\n } else if (posY_table[0] != endposy) {\r\n incrementposY(posX_table[0], posY_table[0])\r\n } else {\r\n i = dist;\r\n }\r\n //console.log('i =', i)\r\n }\r\n\r\n //generates random walls or paths for reste of map (excluding solution)\r\n let arr = [];\r\n for (i = 0; i < 143; i++) {\r\n // console.log('path Normal at ' + i);\r\n let random = randomNbr(1,3);\r\n random < 2 ? arr.push('*') : arr.push('.');\r\n }\r\n for (y = 0; y < posX_table.length; y++) {\r\n if (y == posX_table.length - 2) {\r\n let res = posX_table[y] + ((posY_table[y] * 13) - 13)\r\n arr.splice(res - 1, 1, 'S')\r\n } else if (y == posX_table.length - 1) {\r\n let res = posX_table[y] + ((posY_table[y] * 13) - 13)\r\n arr.splice(res - 1, 1, 'T')\r\n } else {\r\n let res = posX_table[y] + ((posY_table[y] * 13) - 13)\r\n console.table(posX_table[y], posY_table[y], res)\r\n arr.splice(res - 1, 1, '.')\r\n }\r\n }\r\n \r\n //converts array to proper string with spaces so load_level() can interpret it\r\n let arr_splitter_counter = 0\r\n const multi_arr = [];\r\n for (elem of arr) {\r\n arr_splitter_counter < 13 ? multi_arr.push(elem) + arr_splitter_counter++ : multi_arr.push('\\n', elem) + (arr_splitter_counter = 1);\r\n }\r\n const final_arr = multi_arr.join(\"\");\r\n return final_arr;\r\n}",
"spawnNew() {\r\n\t\tif (this.isFull()) return;\r\n\t\t// gets random empty cell and spawns there a tile\r\n\t\tlet k = Math.floor(Math.random() * this.emptyCells.size());\r\n\t\tlet i = this.emptyCells.getK(k).i;\r\n\t\tlet j = this.emptyCells.getK(k).j;\r\n\t\tif (Math.random() < 0.1) {\r\n\t\t\tthis.map[i][j] = 4;\r\n\t\t}\r\n\t\telse {\t\r\n\t\t\tthis.map[i][j] = 2;\r\n\t\t}\r\n\t\tthis.emptyCells.delete(i, j);\r\n\t}",
"generateChest(){\n if(this.chest){\n var x = 2 + Math.round(this.r.random());\n var y = 4;\n this.grid[this.getIndex(x, y)].deco = this.getSprite('tilemap', 'chest-1');\n this.grid[this.getIndex(x, y - 1)].deco = null;\n }\n }",
"function boss3_factory(middleX, middleY) {\n var enemy_array = [];\n//The first tile of the boss.\n enemy_obj = new Enemy(middleX, middleY, boss3_hatch_dimension, boss3_hatch_update, boss3_hatch_render, damage = 8, true, 0, func_noOp, 270);\n giant_boss = enemy_obj;\n return enemy_obj;\n}",
"createInitialEnemies() {\n this.enemies = [];\n this.checkEnemyCreation(1000);\n for (let i = 0; i < this.level.numEnemyRows - 1; ++i) this.checkEnemyCreation(2);\n }",
"checkEnemyCreation(dt) {\n if (Math.random() < dt * this.level.enemyFrequency * this.level.stoneRows) {\n // only create enemies in stone rows\n const row = Math.floor(Math.random() * this.level.stoneRows + this.level.waterRows);\n const speed = Math.floor(Math.random() * (this.level.enemyMaxSpeed - this.level.enemyMinSpeed) + this.level.enemyMinSpeed);\n // place enemies at either the left or right edge of screen\n // and set their movement to travel to the other side\n if (Math.random() < 0.5) {\n this.enemies.push(new Enemy({x: -this.level.tileWidth, y: row * this.level.tileHeight}, {x: speed, y: 0}));\n } else {\n this.enemies.push(new Enemy({x: this.level.widthPixels() + this.level.tileWidth, y: row * this.level.tileHeight},\n {x: -speed, y: 0}));\n }\n }\n }",
"function dungnArrWithRooms(roomArr, dungeonArr, level) {\n //store room sizes in an array (skip the first row)\n var min = 0;\n var max = dungeonArr.length;\n var dungeonRows = dungeonArr.length;\n var dungeonCols = dungeonArr[0].length;\n var roomNrForWeapon = parseInt(Math.floor(Math.random() * (roomArr.length - 2) + 1));\n\n var _getWeaponPoint = getWeaponPoint(roomArr[roomNrForWeapon], level);\n\n var row = _getWeaponPoint.row;\n var col = _getWeaponPoint.col;\n //make array of rooms (x = rows, y = cols)\n\n var randRow = 0,\n randCol = 0,\n i = 0,\n intersectObj = {};\n //place weapon\n roomArr[roomNrForWeapon][row][col] = [].concat(roomArr[roomNrForWeapon][row][col], 49 + level);\n //for each room: write it to the grid and connect it with others\n for (var roomNr = 0; roomNr < roomArr.length; roomNr++) {\n // random 2D point for new room\n randRow = parseInt(Math.floor(Math.random() * (max - min) + min));\n randCol = parseInt(Math.floor(Math.random() * (max - min) + min));\n //randomize the point until the room is 1-4 points away from other rooms!\n while (!isRoomAdequate(randRow, randCol, roomArr[roomNr], dungeonArr, intersectObj, roomNr)) {\n randRow = parseInt(Math.floor(Math.random() * (max - min) + min));\n randCol = parseInt(Math.floor(Math.random() * (max - min) + min));\n }\n //push new room in the dungeonArr\n for (var _row = 0; _row < roomArr[roomNr].length; _row++) {\n // row of room array\n for (var _col = 0; _col < roomArr[roomNr][_row].length; _col++) {\n // col of room array\n try {\n //((arr, row, col) => {if ([].concat(arr[row][col]).indexOf(50) > -1) {console.log();}})(roomArr[roomNr], row, col);\n dungeonArr[randRow + _row][randCol + _col] = roomArr[roomNr][_row][_col];\n } catch (e) {\n // delete the old dungeonArr and fill it with rooms again - happens when room is out of bounds\n dungeonArr.length = 0;\n dungeonArr = Array.apply(null, Array(dungeonRows)).map(function () {\n return Array.apply(null, Array(dungeonCols)).map(function () {\n return 0;\n });\n });\n return dungnArrWithRooms(roomArr, dungeonArr);\n }\n }\n }\n // needed because of first room - it has no intersect. points!\n if (intersectObj.intersectPts.length > 0 && intersectObj.intersectPts != null) {\n (function (intersectObj, dungeonArr) {\n return connectRoom(intersectObj, dungeonArr);\n })(intersectObj, dungeonArr);\n }\n }\n return dungeonArr;\n}",
"function populateMountains() {\n\tmountains = [];\n\tfor (i = 0; i < 3; i++) {\n\t\tmountains[i] = {\n\t\t\tx: random(32),\n\t\t\ty: random(16),\n\t\t\theight: max(random(10), random(10))\n\t\t};\n\t}\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
loadModelFromText loads the model from the text. | loadModelFromText(text) {
const cfg = config_1.Config.newConfigFromText(text);
this.loadModelFromConfig(cfg);
} | [
"function LoadOBJObject() {\r\n var mtlLoader = new THREE.MTLLoader();\r\n mtlLoader.setResourcePath(tempStorePath + lastUploadedObjectName.split(\".\")[0] + '/');\r\n mtlLoader.setPath(tempStorePath + lastUploadedObjectName.split(\".\")[0] + '/');\r\n mtlLoader.load(lastUploadedObjectName.split(\".\")[0] + '.mtl', function (materials) {\r\n materials.preload();\r\n var objLoader = new THREE.OBJLoader();\r\n objLoader.setMaterials(materials);\r\n objLoader.setPath(tempStorePath + lastUploadedObjectName.split(\".\")[0] + '/');\r\n objLoader.load(lastUploadedObjectName, function (object) {\r\n //add object to scene and array\r\n addNewObjectToProject(object, myTypes.importedObject);\r\n //Remove files when object is on scene\r\n removeTempFolder();\r\n });\r\n });\r\n}",
"function loadFileAsText() {\n\tvar fileToLoad = document.getElementById(\"fileToLoad\").files[0];\n\tvar textFromFileLoaded = \"\";\n\tvar fileReader = new FileReader();\n\tfileReader.onload = function(fileLoadedEvent) {\n\t\ttextFromFileLoaded = fileLoadedEvent.target.result;\n\t\tdocument.getElementById(\"inputTextToSave\").value = fileLoadedEvent.target.result;\n\t\tparseFile(textFromFileLoaded)\n\t\tsetCharacterInfo(fileInfo.character.class_name.toLowerCase())\n\t};\n\tfileReader.readAsText(fileToLoad, \"UTF-8\");\n}",
"load(req) {\n let self = this;\n // Default the model type to assembly\n req.type = req.modelType ? req.modelType : 'assembly';\n delete req.modelType;\n // Load the model\n this._loader.load(req, function(err, model) {\n if (err) {\n console.log('CADManager.load error: ' + err);\n } else {\n // Add the model to the list of loaded models\n self._models[req.path] = model;\n self.dispatchEvent({ type: 'model:add', path: req.path });\n // Make sure all the rest of the parts have loaded\n self._loader.runLoadQueue();\n }\n });\n // Get the rest of the files\n this._loader.runLoadQueue();\n }",
"function loadModel(filename) {\n return fetch(filename)\n .then(r => r.json())\n .then(raw_model => {\n // Create and bind the VAO\n let vao = gl.createVertexArray();\n gl.bindVertexArray(vao);\n \n // Load the vertex coordinate data onto the GPU and associate with attribute\n let posBuffer = gl.createBuffer(); // create a new buffer\n gl.bindBuffer(gl.ARRAY_BUFFER, posBuffer); // bind to the new buffer\n gl.bufferData(gl.ARRAY_BUFFER, Float32Array.from(raw_model.vertices), gl.STATIC_DRAW); // load the data into the buffer\n gl.vertexAttribPointer(gl.program.aPosition, 3, gl.FLOAT, false, 0, 0); // associate the buffer with \"aPosition\" as length-3 vectors of floats\n gl.enableVertexAttribArray(gl.program.aPosition); // enable this set of data\n\n // Load the index data onto the GPU\n let indBuffer = gl.createBuffer(); // create a new buffer\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indBuffer); // bind to the new buffer\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, Uint16Array.from(raw_model.indices), gl.STATIC_DRAW); // load the data into the buffer\n \n // Cleanup\n gl.bindVertexArray(null);\n gl.bindBuffer(gl.ARRAY_BUFFER, null);\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null);\n\n // Return the VAO and number of indices\n return [vao, raw_model.indices.length];\n })\n .catch(console.error);\n}",
"function loadModels() {\r\n\r\n const loader = new THREE.GLTFLoader();\r\n \r\n \r\n const onLoad = ( gltf, position ) => {\r\n \r\n model_tim = gltf.scene;\r\n model_tim.position.copy( position );\r\n //console.log(position)\r\n \r\n //model_tim_skeleton= new THREE.Skeleton(model_tim_bones);\r\n model_tim_skeleton= new THREE.SkeletonHelper(model_tim);\r\n model_tim_head_bone=model_tim_skeleton.bones[5];\r\n console.log(model_tim_head_bone);\r\n //console.log(model_tim_bones);\r\n animation_walk = gltf.animations[0];\r\n \r\n const mixer = new THREE.AnimationMixer( model_tim );\r\n mixers.push( mixer );\r\n \r\n action_walk = mixer.clipAction( animation_walk );\r\n // Uncomment you need to change the scale or position of the model \r\n //model_tim.scale.set(1,1,1);\r\n //model_tim.rotateY(Math.PI) ;\r\n\r\n scene.add( model_tim );\r\n \r\n //model_tim.geometry.computeBoundingBox();\r\n //var bb = model_tim.boundingBox;\r\n var bb = new THREE.Box3().setFromObject(model_tim);\r\n var object3DWidth = bb.max.x - bb.min.x;\r\n var object3DHeight = bb.max.y - bb.min.y;\r\n var object3DDepth = bb.max.z - bb.min.z;\r\n console.log(object3DWidth);\r\n console.log(object3DHeight);\r\n console.log(object3DDepth);\r\n // Uncomment if you want to change the initial camera position\r\n //camera.position.x = 0;\r\n //camera.position.y = 15;\r\n //camera.position.z = 200;\r\n \r\n \r\n };\r\n \r\n \r\n \r\n // the loader will report the loading progress to this function\r\n const onProgress = () => {console.log('Someone is here');};\r\n \r\n // the loader will send any error messages to this function, and we'll log\r\n // them to to console\r\n const onError = ( errorMessage ) => { console.log( errorMessage ); };\r\n \r\n // load the first model. Each model is loaded asynchronously,\r\n // so don't make any assumption about which one will finish loading first\r\n const tim_Position = new THREE.Vector3( 0,0,0 );\r\n loader.load('Timmy_sc_1_stay_in_place.glb', gltf => onLoad( gltf, tim_Position ), onProgress, onError );\r\n \r\n }",
"async function loadFromURN(token, urn) {\n\n var loadOptions = {\n placementTransform: buildTransformMatrix()\n }\n\n var pathCollection = await API.getViewablePath(\n token, urn);\n\n var model = await API.loadModel(\n pathCollection[0],\n loadOptions);\n\n return model;\n }",
"setGeometryFromString(str) {\n\n\t\tthis.madeGeometry = true\n\n\t\t// TODO must write remove if already exists in scene\n\n\t\tlet is_gltf = 0\n\t\tlet geometry = 0\n\n\t\tswitch(str) {\n\t\t\tcase undefined:\n\t\t\tcase 0:\n\t\t\tcase null:\n\t\t\tcase \"ignore\":\n\t\t\t\t// TODO the semantics here could use thought - perhaps a default shape is best if nothing is supplied\n\t\t\t\tgeometry = this.setCustomGeometry()\n\t\t\t\tbreak\n\t\t\tcase \"group\":\n\t\t\t\tgeometry = null\n\t\t\t\tbreak\n\t\t\tcase \"box\":\n\t\t\t\tgeometry = new THREE.BoxBufferGeometry(1,1,1,16,16,16)\n\t\t\t\tbreak\n\t\t\tcase \"sphere\":\n\t\t\t\tgeometry = new THREE.SphereGeometry(1,16,16)\n\t\t\t\tbreak\n\t\t\tdefault:\n\t\t\t\tis_gltf = 1\n\t\t\t\tgeometry = new THREE.SphereGeometry(1,16,16)\n\t\t\t\tbreak\n\t\t}\n\n\t\tif(this.geometry) this.geometry.dispose()\n\t\tthis.geometry = geometry\n\n\t\t// was a simple geometry\n\t\tif(!is_gltf) {\n\t\t\treturn this.geometry\n\t\t}\n\n\t\t// actually i don't want to see it\n\t\tif(this.material) this.material.visible = false\n\n\t\t// load the gltf\n\t\tlet url = str + \"/scene.gltf\"\n\t\tlet loader = new THREE.GLTFLoader()\n\t let mesh = this\n\n\t\tloader.load(url, (gltf) => {\n\n\t\t\tif(!gltf || !gltf.scene) {\n\t\t\t\treturn // oh well it tried - doesn't matter if fails\n\t\t\t}\n\n\t\t\t// start animations\n\t if(gltf.animations && gltf.animations.length){\n\t let mixer = new THREE.AnimationMixer(gltf.scene)\n\t for(let animation of gltf.animations){\n\t mixer.clipAction(animation).play()\n\t }\n\t }\n\n\t\t\t// center on self\n\t\t\tlet bbox = new THREE.Box3().setFromObject(gltf.scene)\n\t\t\tlet size = mesh.scale.length()\n\t\t let resize = size / bbox.getSize(new THREE.Vector3()).length() * 2\n\t\t let offset = bbox.getCenter(new THREE.Vector3()).multiplyScalar(resize)\n\t\t gltf.scene.scale.set(resize,resize,resize)\n\t\t gltf.scene.position.sub(offset)\n\n\t\t // add to parent\n\t\t\tmesh.add(gltf.scene)\n\n\t\t\t// turn the top level material invisible to reveal the gltf only\n\t\t\t// TODO later use the top level material here\n\t\t\tif(this.material) this.material.visible = false\n\t\t})\n\n\t\treturn this.geometry\n\t}",
"function triload(vrml, path) {\r\n\tvar i1, i2, i3, i4, i5, txt, matches;\r\n\tvar data;\r\n\t\r\n\t// texture file name\r\n\t//\r\n\ti1 = vrml.indexOf('appearance Appearance');\r\n\ti2 = vrml.indexOf('texture ImageTexture', i1);\r\n\ti3 = vrml.indexOf('{', i2);\r\n\ti4 = vrml.indexOf('}', i3);\r\n\ttxt = vrml.substring(i3+1, i4);\r\n\tmatches = txt.match(/url\\s+['\"](.+?)['\"]/);\r\n\t\r\n\tvar texturefile = matches ? path + matches[1] : '';\r\n\t\r\n\t// vertices\r\n\t//\r\n\ti1 = vrml.indexOf('geometry IndexedFaceSet');\r\n\ti2 = vrml.indexOf('coord Coordinate', i1);\r\n\ti3 = vrml.indexOf('point', i2);\r\n\ti4 = vrml.indexOf('[', i3);\r\n\ti5 = vrml.indexOf(']', i4);\r\n\ttxt = vrml.substring(i4+1, i5);\r\n\tmatches = txt.match(/[\\d\\.e-]+/g);\t// nasty e, nasty e!!\r\n\t\r\n\tvar vertices = Two.Arr([3,matches.length/3]);\r\n\tdata = vertices.data;\r\n\tfor (var i=matches.length; i--; )\r\n\t\tdata[i] = parseFloat(matches[i]);\r\n\t\r\n\t// faces\r\n\t//\r\n\ti1 = vrml.indexOf('coordIndex', i5);\r\n\ti2 = vrml.indexOf('[', i1);\r\n\ti3 = vrml.indexOf(']', i2);\r\n\ttxt = vrml.substring(i2+1, i3);\r\n\tmatches = txt.match(/[\\d-]+/g);\r\n\t\r\n\tvar faces = Two.Arr([3,matches.length/4], null, Uint16Array);\t// N.B. four\r\n\tdata = faces.data;\r\n\tfor (var i=0,cnt=matches.length,j=0; i<cnt; i+=4,j+=3) {\r\n\t\tdata[j+0] = parseInt(matches[i+0]);\r\n\t\tdata[j+1] = parseInt(matches[i+1]);\r\n\t\tdata[j+2] = parseInt(matches[i+2]);\r\n\t}\r\n\t\r\n\t// texture coordinates (UV)\r\n\t//\r\n\ti1 = vrml.indexOf('texCoord TextureCoordinate', i3);\r\n\ti2 = vrml.indexOf('point', i1);\r\n\ti3 = vrml.indexOf('[', i2);\r\n\ti4 = vrml.indexOf(']', i3);\r\n\ttxt = vrml.substring(i3+1, i4);\r\n\tmatches = txt.match(/[\\d\\.e-]+/g);\r\n\t\r\n\tvar texturecoords = Two.Arr([2,matches.length/2]);\r\n\tdata = texturecoords.data;\r\n\tfor (var i=matches.length; i--; )\r\n\t\tdata[i] = parseFloat(matches[i]);\r\n\t\r\n\t// texture indices\r\n\t//\r\n\ti1 = vrml.indexOf('texCoordIndex', i4);\r\n\ti2 = vrml.indexOf('[', i1);\r\n\ti3 = vrml.indexOf(']', i2);\r\n\ttxt = vrml.substring(i2+1, i3);\r\n\tmatches = txt.match(/[\\d-]+/g);\r\n\t\r\n\tvar textureindices = Two.Arr([3,matches.length/4], null, Uint16Array);\r\n\tdata = textureindices.data;\r\n\tfor (var i=0,cnt=matches.length,j=0; i<cnt; i+=4,j+=3) {\r\n\t\tdata[j+0] = parseInt(matches[i+0]);\r\n\t\tdata[j+1] = parseInt(matches[i+1]);\r\n\t\tdata[j+2] = parseInt(matches[i+2]);\r\n\t}\r\n\t\r\n\t// trimesh\r\n\t//\r\n\treturn {\r\n\t\ttexturefile: texturefile,\r\n\t\tvertices: vertices,\r\n\t\tfaces: faces,\r\n\t\ttexturecoords: texturecoords,\r\n\t\ttextureindices: textureindices,\r\n\t};\r\n}",
"function ModelLoader(onLoadedHandler) {\n\n /// List of modules to load in given order\n\n var MODEL_MODULES = [\n// //\"model-browser.js\",\n// //\"model-photo.js\",\n// //\"model-directory.js\",\n// \"model/model-servicelist.js\",\n// \"model/model-sound.js\", // delete by ghl for headphoneinsert interface\n// \"model/model-hisfactory.js\",\n// \"model/model-tvservice.js\",\n// \"model/model-closedcaption.js\",\n// \"model/model-app-setting.js\",\n \"model/model-language.js\",\n \"model/model-parental-lock.js\",\n// \"model/model-softwareupdate.js\",\n// //\"model/model-cec.js\",\n \"model/model-system.js\",\n \"model/model-basic-settings.js\",\n// \"model/model-timer-functions.js\",\n// \"model/model-source.js\",\n \"model/model-network.js\",\n// \"model/model-channelsearch.js\",\n \"model/model-video.js\",\n// \"model/model-miracast.js\",\n \"model/model-picture.js\",\n \"model/model-mpctrl.js\",\n \"model/model-usb.js\",\n \"model/model-volume.js\",\n \"model/model-directory.js\"\n\n ];\n\n /// Number of loaded modules\n var loadedModules = 0;\n\n for (var i = 0; i < MODEL_MODULES.length; i++) {\n var module = MODEL_MODULES[i];\n var script = document.createElement('script');\n script.type = \"text/javascript\";\n script.src = module;\n script.onload = function () {\n loadedModules++;\n if (loadedModules == MODEL_MODULES.length) {\n onLoadedHandler();\n }\n }\n document.head.appendChild(script);\n }\n}",
"function LoadInRuleSet(){\n //selected file\n var file = document.getElementById(\"inputfile\").files[0];\n if(file){\n var reader = new FileReader();\n reader.readAsText(file, \"UTF-8\");\n reader.onload = function (evt) {\n //document.getElementById(\"importRule\").textContent = evt.target.result;\n try{\n //create object\n var newOBJ = JSON.parse(evt.target.result);\n //assign and ensure that the imported file is valid\n var importedRuleset = assignObjectToRuleset(newOBJ);\n\n importedRuleset.Rules.forEach(rule =>{\n LoadRuleObjectToWorkSpace(rule);\n });\n\n }\n catch(e){\n alert(e);\n }\n //reset file selection\n document.getElementById(\"inputfile\").value = \"\";\n }\n reader.onerror = function (evt) {\n alert(\"error reading file\");\n }\n }\n}",
"load(targetArtboardNode) {\n const scenegraph = require('scenegraph');\n let textNode = new scenegraph.Text();\n\n textNode.text = this._text;\n textNode.styleRanges = this._styleRanges;\n textNode.flipY = this._flipY;\n textNode.textAlign = this._textAlign;\n textNode.lineSpacing = this._lineSpacing;\n textNode.paragraphSpacing = this._paragraphSpacing;\n textNode.areaBox = this._areaBox;\n textNode.strokeEnabled = this._strokeEnabled;\n textNode.stroke = this._stroke;\n textNode.strokeWidth = this._strokeWidth;\n textNode.strokePosition = this._strokePosition;\n textNode.strokeEndCaps = this._strokeEndCaps;\n textNode.strokeJoins = this._strokeJoins;\n textNode.strokeMiterLimit = this._strokeMiterLimit;\n textNode.strokeDashArray = this._strokeDashArray;\n textNode.strokeDashOffset = this._strokeDashOffset;\n textNode.shadow = this._shadow;\n textNode.blur = this._blur;\n textNode.opacity = this._opacity;\n textNode.rotateAround(this._rotationDeg, this._rotationCenter);\n\n textNode.placeInParentCoordinates(this._registrationPt, this._translation);\t\t//move the text's topLeft point (local coordinate value) to the original text's topLeft point (parent coordinate value)\n // targetArtboard.items[0].addChild(textNode);\n targetArtboardNode.addChild(textNode);\n\n return textNode;\n }",
"function loadSceneObject( url, Id ) {\n\t\tconsole.log( 'loadSceneObject(' + url + ')' );\n\t\tvar sceneObj = new CubicVR.SceneObject( 'resources/xml/sceneObject2.xml' );\n\t\t//sceneObj.obj.bb = [ [-10, -5, -5],[10, 5, -5] ];\n\t\t//sceneObj.obj.addFace([0, 1, 2, 3]);\n\t\t//sceneObj.obj.calcNormals();\n\t\t//sceneObj.obj.compile();\n\t\tconsole.log( 'loaded xml sceneObj: ' );\n\t\tconsole.log( sceneObj );\n\t\t\n\t\tvar planeCollision = new CubicVR.CollisionMap({\n\t\t\ttype : \"box\",\n\t\t\tsize: [5, 5, 0.01]\n\t\t});\n\t\tvar rigidObj = new CubicVR.RigidBody(sceneObj, {\n\t\t\ttype : \"dynamic\",\n\t\t\tmass : 1,\n\t\t\tcollision : planeCollision\n\t\t});\n\t\tconsole.log( 'created rigidObj' );\n\t\t\n\t\ttry {\n\t\t\tconsole.log('binding sceneObject ' + Id + ' to scene & physics managers');\n\t\t\tscene.bind(sceneObj);\n\t\t\tphysics.bind(rigidObj);\n\t\t} catch( err ) {\n\t\t\tconsole.log('ERROR on Binding: \\t' + err );\n\t\t}\n\t\t\n\t\tsceneObjects.push({\n\t\t\tsceneObj : sceneObj,\n\t\t\tplaneCollision : planeCollision,\n\t\t\tId: Id\n\t\t\t\n\t\t});\n\t\tconsole.log('Finished creating sceneObject ' + Id + '\\n');\n\t}",
"function parseModel (inputModel) {\n var lines = inputModel.split(/\\r?\\n/);\n var ids = lines[0].split(\" \");\n agents = []\n\n // clear movements array\n movements = []\n\n // create the agents\n var index = 0;\n for (var id of ids) {\n var newAgent = new Agent(id);\n newAgent.fixed = (lines[index+1].split(\" \")[0] == \"p\"?true:false); // passive (fixed) or active\n agents.push(newAgent);\n ++index;\n }\n \n\n // define up down and objective\n index = 0;\n for (var agent of agents) {\n var adjacences = lines[index+1].split(\" \");\n upId = adjacences[1];\n downId = adjacences[2];\n targetId = adjacences[3];\n\n if (upId == \"-\") {\n agent.up = null\n } else {\n for (var agnt of agents) {\n if (agnt.id == upId) {\n agent.up = agnt\n }\n }\n }\n if (downId == \"-\") {\n agent.down = null\n } else {\n for (var agnt of agents) {\n if (agnt.id == downId) {\n agent.down = agnt\n }\n }\n }\n if (targetId == \"-\") {\n agent.target = null\n } else {\n for (var agnt of agents) {\n if (agnt.id == targetId) {\n agent.target = agnt\n }\n }\n }\n ++index;\n }\n\n // register global vars for each agent to have access\n for (var block of agents) {\n block.neighbours = agents; // model of world composed by the blocks\n block.movements = movements; // global to register the solving steps\n }\n simulate(agents);\n}",
"function train(model, syllables) {\n console.log('train')\n let x = syllables.map(extract)\n let y = syllables.map(({ tone }) => tone)\n\n // const data = model.name === 'LogisticRegression' ? [\n // new Matrix(x),\n // Matrix.columnVector(y)\n // ] : [x, y]\n\n const data = [new Matrix(x), Matrix.columnVector(y)]\n\n model.train(...data)\n \n return model\n}",
"function createModel(modelData) {\n\n\t// the next line defines an \"object\" in Javascript\n\t// (note that there are several ways to define an \"object\" in Javascript)\n\tvar model = {};\n\t\n\t// the following lines defines \"members\" of the \"object\"\n model.coordsBuffer = gl.createBuffer();\n model.normalBuffer = gl.createBuffer();\n model.textureBuffer = gl.createBuffer();\n model.indexBuffer = gl.createBuffer();\n model.count = modelData.indices.length;\n\n\t// the \"members\" are then used to load data from \"modelData\" in the graphic card\n gl.bindBuffer(gl.ARRAY_BUFFER, model.coordsBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, modelData.vertexPositions, gl.STATIC_DRAW);\n gl.bindBuffer(gl.ARRAY_BUFFER, model.normalBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, modelData.vertexNormals, gl.STATIC_DRAW);\n gl.bindBuffer(gl.ARRAY_BUFFER, model.textureBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, modelData.vertexTextureCoords, gl.STATIC_DRAW);\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, model.indexBuffer);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, modelData.indices, gl.STATIC_DRAW);\n\n\t// The following function is NOT executed here. It is only DEFINED to be used later when we\n\t// call the \".render()\" method.\n model.render = function () {\n gl.bindBuffer(gl.ARRAY_BUFFER, this.coordsBuffer);\n gl.vertexAttribPointer(CoordsLoc, 3, gl.FLOAT, false, 0, 0);\n gl.bindBuffer(gl.ARRAY_BUFFER, this.normalBuffer);\n gl.vertexAttribPointer(NormalLoc, 3, gl.FLOAT, false, 0, 0);\n gl.bindBuffer(gl.ARRAY_BUFFER, this.textureBuffer);\n gl.vertexAttribPointer(TexCoordLoc, 2, gl.FLOAT, false, 0, 0);\n\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);\n\n gl.uniformMatrix4fv(ModelviewLoc, false, flatten(modelview)); //--- load flattened modelview matrix\n gl.uniformMatrix3fv(NormalMatrixLoc, false, flatten(normalMatrix)); //--- load flattened normal matrix\n\n gl.drawElements(gl.TRIANGLES, this.count, gl.UNSIGNED_SHORT, 0);\n //console.log(this.count);\n }\n\t\n\t// we now return the \"object\".\n return model;\n}",
"constructor(networkText, weightsBuffer) {\n this._network = this._verifyAndParse(networkText);\n this._weights = weightsBuffer;\n\n const version = parseInt(this._network._graphs[0]._version);\n if (version < 5) {\n throw new Error(`IR version ${version} is not supported. ` +\n `Please convert the model using the latest OpenVINO model optimizer`);\n }\n\n this._bindHelperFunctions();\n }",
"function parseObj() {\r\n // parse data\r\n\t\r\n\tvertexNum = 0;\r\n faceNum = 0;\r\n\t\r\n\tvar filename = \"teapot.obj\";\r\n var file = new XMLHttpRequest();\r\n var allText=[];\r\n\t\r\n file.open(\"GET\", filename, false);\r\n\t\r\n\tfile.onreadystatechange = function() {\r\n\t\t\r\n if (file.readyState === 4) {\r\n if (file.status === 200 || file.status == 0) {\r\n\t\t\t\t\r\n var text = file.responseText;\r\n\t\t\t\t\r\n console.log(\"Got text file!\"); \r\n\t\t\t\t\r\n\t\t\t\tvar lines = text.split(\"\\r\\n\");\r\n\t\t\t\t\r\n\t\t\t\tfor(var i = 0; i < lines.length; i++){\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar slice = lines[i].split(/\\s+/);\r\n\t\t\t\t\t\r\n if (slice[0] == 'v'){\r\n vertexNum++;\r\n for (var k = 1; k < 4; k++)\r\n vertexArray.push(parseFloat(slice[k]));\r\n }\r\n \r\n\t\t\t\t\tif (slice[0] == 'f'){\r\n faceNum++;\r\n for (var k = 1; k < 4; k++)\r\n faceArray.push(parseInt(slice[k]-1));\r\n }\r\n }\r\n\t\t\t\t\r\n\t\t\t\tfor (var i = 0; i< 3606; i++){\r\n vNormalArray[i] = 0;\r\n }\r\n\t\t\t\t\r\n\t\t\t\tfor (var i = 0; i < 2256; i++){\r\n\t\t\t\t\tvar v1 = vec3.fromValues(vertexArray[3*faceArray[3*i]], vertexArray[3*faceArray[3*i]+1], vertexArray[3*faceArray[3*i]+2]);\r\n\t\t\t\t\tvar v2 = vec3.fromValues(vertexArray[3*faceArray[3*i+1]], vertexArray[3*faceArray[3*i+1]+1], vertexArray[3*faceArray[3*i+1]+2]);\r\n\t\t\t\t\tvar v3 = vec3.fromValues(vertexArray[3*faceArray[3*i+2]], vertexArray[3*faceArray[3*i+2]+1], vertexArray[3*faceArray[3*i+2]+2]);\r\n\r\n\t\t\t\t\tvar edge1 = vec3.create(); \r\n\t\t\t\t\tvar edge2 = vec3.create();\r\n\t\t\t\t\tvar normal = vec3.create();\r\n\t\t\t\t\tvec3.subtract(edge1, v3, v2);\r\n\t\t\t\t\tvec3.subtract(edge2, v1, v2);\r\n\t\t\t\t\tvec3.cross(normal, edge1, edge2);\r\n\t\t\t\t\tvec3.normalize(normal, normal);\r\n\r\n\t\t\t\t\t// calculate per-vertex normal\r\n\t\t\t\t\tvNormalArray[3*faceArray[3*i]] += normal[0];\r\n\t\t\t\t\tvNormalArray[3*faceArray[3*i]+1] += normal[1];\r\n\t\t\t\t\tvNormalArray[3*faceArray[3*i]+2] += normal[2];\r\n\r\n\t\t\t\t\tvNormalArray[3*faceArray[3*i+1]] += normal[0];\r\n\t\t\t\t\tvNormalArray[3*faceArray[3*i+1]+1] += normal[1];\r\n\t\t\t\t\tvNormalArray[3*faceArray[3*i+1]+2] += normal[2];\r\n\r\n\t\t\t\t\tvNormalArray[3*faceArray[3*i+2]] += normal[0];\r\n\t\t\t\t\tvNormalArray[3*faceArray[3*i+2]+1] += normal[1];\r\n\t\t\t\t\tvNormalArray[3*faceArray[3*i+2]+2] += normal[2];\r\n\r\n\t\t\t\t\tnormalArray.push(normal[0]);\r\n\t\t\t\t\tnormalArray.push(normal[1]);\r\n\t\t\t\t\tnormalArray.push(normal[2]); \r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tvar temp = [];\r\n\t\t\t\tfor (var i = 0; i < 1202; i++){\r\n\t\t\t\t\tvar normal = vec3.create();\r\n\t\t\t\t\tnormal[0] = vNormalArray[3*i];\r\n\t\t\t\t\tnormal[1] = vNormalArray[3*i+1];\r\n\t\t\t\t\tnormal[2] = vNormalArray[3*i+2];\r\n\t\t\t\t\tvec3.normalize(normal, normal);\r\n\t\t\t\t\tvNormalArray[3*i] = normal[0];\r\n\t\t\t\t\tvNormalArray[3*i+1] = normal[1];\r\n\t\t\t\t\tvNormalArray[3*i+2] = normal[2];\r\n\t\t\t\t\t// temp[i] = normal[0]*normal[0] + normal[1]*normal[1] + normal[2]*normal[2];\r\n\t\t\t\t} \r\n\t }\r\n }\r\n }\r\n\t\r\n\tfile.send(null);\r\n\t\r\n}",
"function onFileInitialize(model) {\n var string = model.createString();\n string.setText(activeFile.content);\n model.getRoot().set('collabString', string);\n}",
"function lemmatize($text) {\n\tvar text = $text;\n\tvar doc = nlp($text);\n\tvar verbs = doc.verbs().json();\n\tvar nouns = doc.nouns().json();\n\tvar nouns_ori = doc.nouns().toSingular().json();\n\n\t// verb\n\tverbs.forEach(obj => {\n\t\tlet now = obj.text;\n\t\tlet to = obj.conjugations.Infinitive;\n\n\t\t// do not change\n\t\tif (now === to) return;\n\t\tif (now === '') return;\t\t// e.g. there's will cause one empty entry\n\t\tif (now.indexOf(\"'\") >= 0) return;\t// e.g. didn't => not didn't\n\n\t\t// replace\n\t\tlet re = new RegExp(now, 'g');\n\t\ttext = text.replace(re, to);\n\t});\n\n\t// noun\n\tnouns.forEach((obj, i) => {\n\t\tlet now = obj.text;\n\t\tlet to = nouns_ori[i].text;\n\n\t\t// do not change\n\t\tif (now === to) return;\n\n\t\t// replace\n\t\tlet re = new RegExp(now, 'g');\n\t\ttext = text.replace(re, to);\n\t});\n\n\treturn text;\n}",
"function load() {\n _data_id = m_data.load(FIRST_SCENE, load_cb, preloader_cb);\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Convenience, remove this session from associated [[Link]] storage if set. Equivalent to: ```ts session.link.removeSession(session.identifier, session.auth) ``` | async remove() {
if (this.link.storage) {
await this.link.removeSession(this.identifier, this.auth);
}
} | [
"function removeFromSession(key) {\n if (sessionStorage) {\n if (sessionStorage[key]) {\n delete sessionStorage[key];\n }\n }\n else {\n throw Error(\"Session storage not supported\");\n }\n}",
"static async destroy(id) {\n db.del(`session:${id}`)\n }",
"clearSession() {\n ['accessToken', 'expiresAt', 'idToken'].forEach(key => {\n sessionStorage.removeItem(key);\n });\n\n this.accessToken = '';\n this.idToken = '';\n this.expiresAt = '';\n }",
"function removeRedirectFromStorage() {\n sessionStorage.removeItem('authSuccessRedirect')\n}",
"function logout() {\n sessionStorage.removeItem(\"userId\");\n sessionStorage.removeItem(\"jwt\");\n }",
"logoutUser() {\n this.get('session').invalidate();\n }",
"logout() {\n this._mealPlan = null\n this._userId = null\n this._token = null\n this._diet = null\n this._intolerances = null\n\n sessionStorage.removeItem('mealPlan')\n sessionStorage.removeItem('userId')\n sessionStorage.removeItem('token')\n sessionStorage.removeItem('diet')\n sessionStorage.removeItem('intolerances')\n }",
"function removeAccessToken(provider) {\n var accessTokenKey = getAccessTokenPlaceholder(provider);\n sessionStorage.removeItem(accessTokenKey);\n }",
"destroy(launchId) {\n const session = this.sessions.get(launchId);\n session === null || session === void 0 ? void 0 : session.dispose();\n this.sessions.delete(launchId);\n }",
"function _clear() {\n\n\t// Delete from localStorage\n\tdelete localStorage['_session'];\n\n\t// Delete the cookie\n\tCookies.remove('_session', '.' + window.location.hostname, '/');\n}",
"function deleteLinkByKind(linkKind) {\n return spPost(SPInstance(this, \"deleteLinkByKind\"), request_builders_body({ linkKind }));\n}",
"function onSessionDestroyed() {\n const session = this[owner_symbol];\n this[owner_symbol] = undefined;\n\n if (session) {\n session[kSetHandle]();\n process.nextTick(emit.bind(session, 'close'));\n }\n}",
"removeConnectivityStateListener(listener) {\n this.stateListeners.delete(listener);\n }",
"function leave () {\n var session = USERS.get(socket.id)\n\n if (session) {\n USERS.del(socket.id)\n\n debug('leave session', session.id, socket.id)\n\n session.leave(socket)\n }\n }",
"logout() {\n debug(\"=== Hotjar logout running... ===\")\n debug(\"Remove local storage and cookie with: %s\", this.hjSessionKeyName)\n removeLocalStorageItem(this.hjSessionKeyName)\n removeLocalItem(this.hjSessionKeyName)\n debug(\"=== Hotjar logout finished... ===\")\n }",
"function doHumanDetectFaceUnregister(serviceId, sessionKey) {\r\n\r\n dConnect.removeEventListener({\r\n profile: 'humandetection',\r\n attribute: 'onfacedetection',\r\n params: {\r\n serviceId: serviceId\r\n }\r\n }).catch(e => {\r\n alert(e.errorMessage);\r\n });\r\n}",
"removeAccessToken() {\n localStorage.removeItem('accessToken');\n }",
"function destroyExpiredSessions() {\n // httpd sessions\n var httpSessions = this.getSessions(\"http\");\n for (var i = 0; i < httpSessions.length; i++) {\n var session = httpSessions[i];\n if ((Date.now() - session.lastActive) > this.timeout) {\n this.destroy(session);\n }\n }\n // socket.io sessions\n var socketIOSessions = this.getSessions(\"socket.io\");\n for (var i = 0; i < socketIOSessions.length; i++) {\n var session = socketIOSessions[i];\n if (session.socket == null) {\n this.destroy(session);\n }\n }\n\n }",
"async remove (id, params) {\n //need to use this in different scope\n const self = this;\n const roomId = id;\n //prolly get user model maybe (why is it caps???)\n const users = this.sequelizeClient.model.Users;\n //get user to be removed\n const {user} = params;\n //remove roomId from users \"rooms\" array (ide says i need an await here but i dont think i do)\n await users.update({'rooms': Sequelize.fn('array_remove', Sequelize.col('rooms'), roomId)},\n {'where': {'id': user}});\n //if user is connected to the rooms/roomId channel remove them\n self.app.channel(`rooms/${roomId}`).connections.forEach(function (connection){\n if(connection.user.id === user){\n self.app.channel(`room/${roomId}`).leave(connection);\n }\n });\n\n return id;\n }",
"_handleLogout(){\r\n sessionStorage.clear();\r\n this.set('route.path', './login-page');\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Do a deep render of the match result, showing the structure mismatches in context | renderMismatch() {
if (!this.hasFailed()) {
return '<match>';
}
const parts = new Array();
const indents = new Array();
emitFailures(this, '');
recurse(this);
return moveMarkersToFront(parts.join('').trimEnd());
// Implementation starts here.
// Yes this is a lot of code in one place. That's a bit unfortunate, but this is
// the simplest way to access private state of the MatchResult, that we definitely
// do NOT want to make part of the public API.
function emit(x) {
if (x === undefined) {
debugger;
}
parts.push(x.replace(/\n/g, `\n${indents.join('')}`));
}
function emitFailures(r, path, scrapSet) {
for (const fail of r.failuresHere.get(path) ?? []) {
emit(`!! ${fail.message}\n`);
}
scrapSet?.delete(path);
}
function recurse(r) {
// Failures that have been reported against this MatchResult that we didn't print yet
const remainingFailures = new Set(Array.from(r.failuresHere.keys()).filter(x => x !== ''));
//////////////////////////////////////////////////////////////////////
if (Array.isArray(r.target)) {
indents.push(' ');
emit('[\n');
for (const [first, i] of enumFirst(range(r.target.length))) {
if (!first) {
emit(',\n');
}
emitFailures(r, `${i}`, remainingFailures);
const innerMatcher = r.innerMatchFailures.get(`${i}`);
if (innerMatcher) {
// Report the top-level failures on the line before the content
emitFailures(innerMatcher, '');
recurseComparingValues(innerMatcher, r.target[i]);
}
else {
emit(renderAbridged(r.target[i]));
}
}
emitRemaining();
indents.pop();
emit('\n]');
return;
}
//////////////////////////////////////////////////////////////////////
if (r.target && typeof r.target === 'object') {
indents.push(' ');
emit('{\n');
const keys = Array.from(new Set([
...Object.keys(r.target),
...Array.from(remainingFailures),
])).sort();
for (const [first, key] of enumFirst(keys)) {
if (!first) {
emit(',\n');
}
emitFailures(r, key, remainingFailures);
const innerMatcher = r.innerMatchFailures.get(key);
if (innerMatcher) {
// Report the top-level failures on the line before the content
emitFailures(innerMatcher, '');
emit(`${jsonify(key)}: `);
recurseComparingValues(innerMatcher, r.target[key]);
}
else {
emit(`${jsonify(key)}: `);
emit(renderAbridged(r.target[key]));
}
}
emitRemaining();
indents.pop();
emit('\n}');
return;
}
//////////////////////////////////////////////////////////////////////
emitRemaining();
emit(jsonify(r.target));
function emitRemaining() {
if (remainingFailures.size > 0) {
emit('\n');
}
for (const key of remainingFailures) {
emitFailures(r, key);
}
}
}
/**
* Recurse to the inner matcher, but with a twist:
*
* If the match result target value is not the same as the given value,
* then the matcher is matching a transformation of the given value.
*
* In that case, render both.
*
* FIXME: All of this rendering should have been at the discretion of
* the matcher, it shouldn't all live here.
*/
function recurseComparingValues(inner, actualValue) {
if (inner.target === actualValue) {
return recurse(inner);
}
emit(renderAbridged(actualValue));
emit(' <*> ');
recurse(inner);
}
/**
* Render an abridged version of a value
*/
function renderAbridged(x) {
if (Array.isArray(x)) {
switch (x.length) {
case 0: return '[]';
case 1: return `[ ${renderAbridged(x[0])} ]`;
case 2:
// Render if all values are scalars
if (x.every(e => ['number', 'boolean', 'string'].includes(typeof e))) {
return `[ ${x.map(renderAbridged).join(', ')} ]`;
}
return '[ ... ]';
default: return '[ ... ]';
}
}
if (x && typeof x === 'object') {
const keys = Object.keys(x);
switch (keys.length) {
case 0: return '{}';
case 1: return `{ ${JSON.stringify(keys[0])}: ${renderAbridged(x[keys[0]])} }`;
default: return '{ ... }';
}
}
return jsonify(x);
}
function jsonify(x) {
return JSON.stringify(x) ?? 'undefined';
}
/**
* Move markers to the front of each line
*/
function moveMarkersToFront(x) {
const re = /^(\s+)!!/gm;
return x.replace(re, (_, spaces) => `!!${spaces.substring(0, spaces.length - 2)}`);
}
} | [
"function showShallowDiff(obj1, obj2) {\n const args=global.args||{};\n var differences=false;\n if (!args.diff) return;\n Object.keys(obj1).forEach(key => {\n if (obj1[key] && typeof obj1[key] === \"object\" && obj1[key]!==null) { // it's an object\n if(obj2[key] && typeof obj2[key]==='object' && obj2[key]!== null) { // it's an object too\n if (obj1[key].id !== obj2[key].id) {\n args.diff && console.error(key + '.id', obj1[key].id, \"!==\", obj2[key].id);\n differences=true;\n }\n } else {\n args.diff && console.error(key + obj1[key], \"!==\", obj2[key], \"not an object\");\n differences=true;\n }\n } else { // obj1[key] is not an object\n if (typeof obj2[key] === \"undefined\" && typeof obj1[key] !== 'undefined') {\n args.diff && console.error(key + ':', obj1[key], \"!==\", obj2[key]);\n differences=true;\n }\n if (obj1[key] !== obj2[key]){\n args.diff && console.error(key + ':', obj1[key], \"!==\", obj2[key]);\n differences=true;\n }\n }\n })\n return differences;\n}",
"render() {\n const results = this.state.regionalResults;\n\n if (results.errors === 0 && results.games.length) {\n return this._renderGames(results);\n } else if (results.errors) {\n return this._renderError();\n } else {\n return this._renderNothing();\n }\n }",
"templateMatches(expected) {\n const matcher = matcher_1.Matcher.isMatcher(expected) ? expected : match_1.Match.objectLike(expected);\n const result = matcher.test(this.template);\n if (result.hasFailed()) {\n throw new Error([\n 'Template did not match as expected. The following mismatches were found:',\n ...result.toHumanStrings().map(s => `\\t${s}`),\n ].join('\\n'));\n }\n }",
"applyMatchers(\n string: string,\n parentConfig: NodeConfig,\n ): string | React$Node[] {\n const elements = [];\n const { props } = this;\n let matchedString = string;\n let parts = {};\n\n this.matchers.forEach((matcher) => {\n const tagName = matcher.asTag().toLowerCase();\n const config = this.getTagConfig(tagName);\n\n // Skip matchers that have been disabled from props or are not supported\n if (\n props[matcher.inverseName] ||\n TAGS_BLACKLIST[tagName] ||\n (!props.disableWhitelist && !TAGS[tagName])\n ) {\n return;\n }\n\n // Skip matchers in which the child cannot be rendered\n if (!this.canRenderChild(parentConfig, config)) {\n return;\n }\n\n // Continuously trigger the matcher until no matches are found\n while (parts = matcher.match(matchedString)) {\n const { match, ...partProps } = parts;\n\n // Replace the matched portion with a placeholder\n matchedString = matchedString.replace(match, `#{{${elements.length}}}#`);\n\n // Create an element through the matchers factory\n this.keyIndex += 1;\n\n elements.push(matcher.createElement(match, {\n ...props,\n ...partProps,\n key: this.keyIndex,\n }));\n }\n });\n\n if (elements.length === 0) {\n return matchedString;\n }\n\n // Deconstruct the string into an array so that React can render it\n const matchedArray = [];\n let lastIndex = 0;\n\n while (parts = matchedString.match(/#\\{\\{(\\d+)\\}\\}#/)) {\n const [, no] = parts;\n // $FlowIgnore https://github.com/facebook/flow/issues/2450\n const { index } = parts;\n\n // Extract the previous string\n if (lastIndex !== index) {\n matchedArray.push(matchedString.slice(lastIndex, index));\n }\n\n // Inject the element\n matchedArray.push(elements[parseInt(no, 10)]);\n\n // Set the next index\n lastIndex = index + parts[0].length;\n\n // Replace the token so it won't be matched again\n // And so that the string length doesn't change\n matchedString = matchedString.replace(`#{{${no}}}#`, `%{{${no}}}%`);\n }\n\n // Extra the remaining string\n if (lastIndex < matchedString.length) {\n matchedArray.push(matchedString.slice(lastIndex));\n }\n\n return matchedArray;\n }",
"function renderResult() {\n $(\"#results\").empty();\n $(\"#results\").append($(\"<h2>\").text(\"Validation Result\"));\n var transforms = {\n \"status\" : {\n \"<>\" : \"div\",\n \"html\" : [\n {\n \"<>\" : \"div\",\n \"text\" : function(obj, index) {var date = new Date(obj.date); return \"Date:\" + date.toUTCString();}\n },\n {\n \"<>\" : \"div\",\n \"class\" : function(obj, index) {return \"alert \" + (obj.valid ? \"alert-success\" : \"alert-danger\");},\n \"text\" : \"Validation Result: ${valid}\"\n }\n ]\n },\n \"entries\" : {\n \"<>\" : \"div\",\n \"class\" : function(obj, index) {return \"alert \" + (obj.level === \"ERROR\" ? \"alert-danger\" : obj.level === \"WARNING\" ? \"alert-warning\" : \"alert-info\");},\n \"text\" : function(obj, index) {return (index + 1) + \". \" + obj.level + \": \" + obj.message;}\n }\n };\n $(\"#results\").json2html(ipValidator.result, transforms.status);\n $(\"#results\").append($(\"<h3>\").text(\"Validation Entries\"));\n $(\"#results\").json2html(ipValidator.result.validationEntries, transforms.entries);\n}",
"function match(req, res) {\n let username = req.session.username;\n if (!username) {\n res.render('improper');\n return;\n }\n\n let answersForCurrentUser = Model.getAllAnswersForUser(username);\n let userMatches = new Map();\n if (answersForCurrentUser) {\n answersForCurrentUser.forEach((answerForCurrentUser, i, arr) => {\n // get all the answers for same question for other users\n Model.getAllAnswersForQuestion(answerForCurrentUser.questionId)\n // filter for matching answer\n .filter(currentAnswer => currentAnswer.answer === answerForCurrentUser.answer)\n // filter out the user we're matching\n .filter(currentAnswer => currentAnswer.username != username)\n // count matches of other users to current user\n .forEach((currentAnswer, i) => {\n if (userMatches.has(currentAnswer.username)) {\n let matches = userMatches.get(currentAnswer.username);\n matches++;\n userMatches.set(currentAnswer.username, matches);\n } else {\n userMatches.set(currentAnswer.username, 1);\n }\n });\n });\n }\n let matches = [];\n // sort the userMatches map from highest match to lowest\n let userMatchesSortedDesc = new Map([...userMatches.entries()]\n // sort by match count\n .sort((a, b) => b.value - a.value))\n // add each string to matches array\n .forEach((val, key) => matches.push(`User: ${key} matched ${val} answers`));\n console.log(matches);\n res.render('matches', { \n title: 'SER421 MVC Ex Survey Matches', \n username: username,\n matches: matches\n });\n}",
"function displayMatches(){\n const matchArray = findMatches(this.value, cities);\n\n const html = matchArray.map( place => {\n const regex = new RegExp(this.value, 'gi');\n\n const cityName = place.city.replace(regex, `<span class=\"hl\">${this.value}</span>`);\n const stateName = place.state.replace(regex, `<span class=\"hl\">${this.value}</span>`);\n\n return `\n <li>\n <span class=\"name\">${cityName}, ${stateName}</span>\n <span class=\"population\">${numberWithCommas(place.population)}</span>\n </li>\n `;\n }).join('');\n\n let match_txt = (matchArray.length > 1) ? ' matches' : ' match';\n founds.innerHTML = matchArray.length + match_txt + ' found.';\n \n if(this.value == ''){\n founds.style.display = 'none'; \n } else {\n founds.style.display = 'block'; \n }\n\n suggestions.innerHTML = html;\n}",
"function getMatchingDiff(fileChangeJSON, data) {\n if ($.isArray(data.diffs) && data.diffs.length) {\n var matchingDiff = _.find(data.diffs, function (diff) {\n if (diff.destination) {\n return diff.destination.toString === new Path(fileChangeJSON.path).toString();\n } else if (fileChangeJSON.srcPath) {\n return diff.source.toString === new Path(fileChangeJSON.srcPath).toString();\n }\n return false;\n }) || data.diffs[0]; //Or the first diff if none were found (this shouldn't happen)\n\n data = _.assign({ diff: matchingDiff }, data, matchingDiff);\n Object.keys(matchingDiff).forEach(function (key) {\n deprecate.prop(data, key, key, 'diff.' + key, '4.5', '5.0');\n });\n\n delete data.diffs;\n }\n return data;\n }",
"function drawResults(obj) {\n\n //Clear the contents of contentsWrapper\n contentsWrapper.innerHTML = '';\n\n //If the object from our lookup exists, write out its properties\n if(obj) {\n for(var prop in obj) {\n if(obj.hasOwnProperty(prop)) {\n contentsWrapper.appendChild(createElementEditor(prop, obj));\n }\n }\n //Add an additional horizontal line\n contentsWrapper.appendChild($.create('hr'));\n }\n\n //Add the property adder elements\n contentsWrapper.appendChild(createElementAdder()); \n}",
"function processComplexTypeAsConsole(diff,showConsoleDiffCode){\n diff.forEach(function(part){\n // Render as console resulut\n var color = part.added ? 'green' : part.removed ? 'red' : 'grey';\n var colorCode = part.value;\n colorCode.split(\"\\n\").forEach(function(item,index){\n if(item){\n if ('[object String]' === Object.prototype.toString.call(item)){\n showConsoleDiffCode += item[color] + \"\\n\";\n }else{\n showConsoleDiffCode += colors[color](item) + \"\\n\";\n }\n }\n });\n });\n return showConsoleDiffCode;\n}",
"render() {\n if (this.props.chosenMeme !== -1 && this.props.matches.length > 0) {\n return (\n <div className=\"matchesBorder bigBorder\">\n <div className=\"tempBorder\">\n <div className=\"navButtons\">\n <NavLink to=\"/profile\"><button className=\"btn btn-info\" type=\"submit\">My Profile</button></NavLink> \n <NavLink to=\"/main\"><button className=\"btn btn-info\" type=\"submit\">Pick Memes</button></NavLink>\n </div>\n <MatchesList matches={this.props.matches}\n deleteMatch={this.deleteMatch}\n disabled={this.props.disabled}\n response={this.props.userData}\n toggleDisabled={this.props.toggleDisabled} />\n </div>\n </div>\n );\n }\n\n else {\n return (\n <div className=\"matchesBorder bigBorder\">\n <div className=\"tempBorder\">\n <div className=\"navButtons\">\n <NavLink to=\"/profile\"><button className=\"btn btn-info\" type=\"submit\">My Profile</button></NavLink> \n <NavLink to=\"/main\"><button className=\"btn btn-info\" type=\"submit\">Pick Memes</button></NavLink>\n </div>\n <center><h1>Sorry, no matches yet. Like a meme!</h1></center>\n </div>\n </div>\n );\n }\n }",
"function matchingTestResult(accessibleComponentText,matchingAgainstObject){\n\t\t\tvar matchFound = false;\n\t\t\taccessibleComponentText = stripHTML(accessibleComponentText); //ignores andiLaser markup\n\t\t\tif(accessibleComponentText == stripHTML(matchingAgainstObject.ariaLabelledby) //ignores andiLaser markup\n\t\t\t|| accessibleComponentText == matchingAgainstObject.ariaLabel\n\t\t\t|| accessibleComponentText == stripHTML(matchingAgainstObject.label) //ignores andiLaser markup\n\t\t\t|| accessibleComponentText == matchingAgainstObject.alt\n\t\t\t|| accessibleComponentText == matchingAgainstObject.innerText\n\t\t\t|| accessibleComponentText == matchingAgainstObject.value){\n\t\t\t\tmatchFound = true;\n\t\t\t}\n\t\t\treturn matchFound;\n\t\t\t\n\t\t\t//This function provides a slick way to remove html and get the inner text\n\t\t\t//but also to escape syntax that would throw a javascript error.\n\t\t\t//Without the <b> container, it will error out on special characters.\n\t\t\tfunction stripHTML(html){\n\t\t\t\treturn $(\"<b>\"+html+\"</b>\").text();\n\t\t\t}\n\t\t}",
"function parseMatches(data) {\n if (data === undefined || data === null) {\n console.log(\"cannot parse and append matches, no data passed\");\n return -1;\n }\n var lenItems = data.totalCount;\n var i = 0;\n var rTeam = '' ; var bTeam = '';\n var rScore = ''; var bScore = '';\n var winner = ''; var winName = '';\n var matches = ''; var match = '';\n var rDot = '<i class=\"red icon circle\"></i>';\n var bDot = '<i class=\"blue icon circle\"></i>';\n var winDot = '';\n var s = data.query_url.split('/');\n var currInt = s[s.length -3];\n var matchMenu = '#matchMenu' + currInt;\n // handle bye series with no matches\n if (lenItems === 0) {\n $(matchMenu)\n .popup({\n on: 'click',\n html: '<p>no match data available</p>'\n });\n return;\n }\n // all other series have data\n // assume red wins\n while (i < lenItems) {\n winner = data.items[i].winner.href;\n rTeam = data.items[i].redTeam.href;\n bTeam = data.items[i].blueTeam.href;\n rScore = data.items[i].score.redTeam;\n bScore = data.items[i].score.blueTeam;\n winName = data.items[i].redTeam.teamName;\n winDot = rDot;\n // winner is given as href team, so compare that\n if (winner === bTeam) {\n winName = data.items[i].blueTeam.teamName;\n winDot = bDot;\n }\n match = '<div>' + winDot + winName + '<p class=\"ui header red\"> ' + rScore + ' </p> <p class=\"ui header blue\"> ' + bScore + '</p></div>';\n\n matches += match;\n i++;\n }\n // attach to the dropdown in the '?' type column\n $(matchMenu)\n .popup({\n on: 'click',\n html: matches\n });\n}",
"function renderResults(document) {\n let renderedContent = document.content;\n\n const words = document.proccesedDocument.removedStopWords;\n const stemMapping = document.proccesedDocument.stemmMapping;\n const tfidf = document.tfidf;\n\n const maxTfidf = document.listTerms[0].tfidf;\n const minTfidf = document.listTerms[document.listTerms.length - 1].tfidf;\n const step = (maxTfidf - minTfidf) / 7;\n const getLevel = (val) => {\n return Math.floor(val / step);\n };\n\n words.forEach((word) => {\n const stemmed = stemMapping[word];\n if (!stemmed) {return ;}\n\n const renderValue = getLevel(tfidf[stemmed]);\n // \\b for cyrrilic fix: http://breakthebit.org/post/3446894238/word-boundaries-in-javascripts-regular\n const pattern = new RegExp(`(^\\|[ \\n\\r\\t.,'\\\"\\+!?-\\ยป]+\\|>)(${word})([ \\n\\r\\t.,'\\\"\\+!?-\\ยป]+\\|$\\|>)(?![^<span]*>|[^<>]*<\\/span)`, 'gim');\n renderedContent = renderedContent.replace(pattern, `\\$1<span class=\"tfidf tfidf-${renderValue}\">\\$2</span>\\$3`);\n });\n\n return renderedContent;\n}",
"renderTeamDisplay() {\n\t\tconst teamData = this.state.members;\n\t\treturn <TeamDisplay data={teamData} />;\n\t}",
"function buildMatchData(submissionNodesIndexIndex, submissionNodes, matchEdges) {\n\n var currentIndex = 0;\n\n for (var matchIndex in matches) {\n if (matches.hasOwnProperty(matchIndex)) {\n\n var match = matches[matchIndex];\n\n // Get the indices the submission ids\n var submission1Index = submissionNodesIndexIndex[match['submission_1_id']];\n var submission2Index = submissionNodesIndexIndex[match['submission_2_id']];\n\n // Add this edge to adjacencies of submissions\n var submission1 = submissionNodes[submission1Index];\n var submission2 = submissionNodes[submission2Index];\n\n // Mark the associated submissions as having certain types of matches\n if (match.isCrossSemesterMatch) {\n submission1.hasCrossSemesterMatch = true;\n submission2.hasCrossSemesterMatch = true;\n }\n if (match.isSolutionMatch) {\n submission1.hasSolutionMatch = true;\n submission2.hasSolutionMatch = true;\n }\n\n // Add match edge indices to corresponding submissions\n submission1.edges.push(currentIndex);\n submission2.edges.push(currentIndex);\n\n // Determine whether or not this edge represents a match between partners (in either direction)\n var studentOnePartneredTwo = $.inArray(submission2.id, submission1.partner_ids) >= 0;\n var studentTwoPartneredOne = $.inArray(submission1.id, submission2.partner_ids) >= 0;\n var isPartnerMatch = studentOnePartneredTwo || studentTwoPartneredOne;\n\n // Add the edge\n matchEdges.push({\n\n // Submission ids (of graph node endpoints)\n source:submission1Index,\n target:submission2Index,\n value:(match['score1'] + match['score1']) / 2.0, // Use average for weight\n\n // Information about the type of the edge\n isPartnerMatch:isPartnerMatch,\n isSolutionMatch:match.isSolutionMatch,\n isCrossSemesterMatch:match.isCrossSemesterMatch,\n\n // Auxiliary data for this match\n id:match['id'],\n link:match['link'],\n moss_analysis_id:match['moss_analysis_id'],\n score1:match['score1'],\n score2:match['score2']\n });\n currentIndex++;\n }\n }\n}",
"function findMatch () {\n module.exports.internal.dataObj.seasons[module.exports.internal.seasonId].matches.forEach((match) => {\n if (match.id === module.exports.internal.matchId) {\n module.exports.internal.matchData = match\n }\n })\n}",
"function checkData(xmlobject)\n{\n var output = \"\";\n\n // TODO - make sure each field has a name, type, op, label (warning), and perspective\n\n // TODO - make sure, depending upon the op, that the other fields are there\n // (the array below is the current requirements)\n\n var reqFields = { count: [\"target\"],\n\t\t average: [\"target\"],\n\t\t combine: [\"target\"],\n\t\t delta: [\"start\",\"end\"],\n\t\t sum: [\"target\"],\n\t\t percent: [\"target\",\"targetVal\"],\n\t\t weight: [\"target\",\"multiplier\"],\n\t\t contains:[\"target\",\"targetVal\"],\n\t\t containsAny:[\"target\",\"targetVal\"],\n\t\t max: [\"target\"],\n\t\t min: [\"target\"],\n\t\t defEffect: [\"target\"],\n\t\t compare: [\"target\"],\n\t\t divide: [\"target\"],\n\t\t multiply:[\"target\"],\n\t\t subtract:[\"target\"],\n\t\t constant:[\"target\"]\n\t\t };\n\n var optFields = { weight: [\"high\",\"low\"],\n\t\t compare: ['ltVal','gtVal','eqVal']\n\t\t };\n\t\n\t\n // TODO - should check that all of the right things are there for the ops\n // (like start and end for delta, etc.)\n\n // TODO - make sure all sections are there\n\n // TODO - make sure the layout looks good relative to elements\n\n var rawData = xmlobject.rawData;\n\n var rawDataFields = [];\n for(var i=0; i < rawData.length; i++) {\n\trawDataFields.push(rawData[i].name);\n }\n\n var metaData = xmlobject.metaData;\n\n if(metaData === null) {\n\toutput += \"METADATA ERROR: I can't find any metaData specs.<br>\\n\";\n\toutput += \"Did you forget to capitalize the D in \\\"metaData\\\" in the XML?\";\n\treturn(output);\n }\n\n // need to check the perspectives in order, from lowest to highest\n \n var perspectives = [ \"match\", \"competition\", \"robot\", \"year\", \"top\" ];\n var previousLevelFields = null; // allows upper levels to check lower levels\n\n var allMetaDataFields = [];\n \n for(var perspective in perspectives) {\n\tvar thisMetaData = metaData[perspectives[perspective]];\n\n\t// first, gather the names of all of the metaData fields at this perspective\n\tvar thisMetaDataFields = [];\n\tfor(var i=0; i < thisMetaData.length; i++) {\n\t thisMetaDataFields.push(thisMetaData[i].name);\n\t allMetaDataFields.push(thisMetaData[i].name);\n\t}\n\n\t// now check to see that they refer to rawData, the current metaData, or lower MetaData\n\n\tfor(var i=0; i < thisMetaData.length; i++) {\n\n\t // need to check the targets, start list, and end list\n\n\t var checks = [\"target\",\"start\",\"end\"];\n\n\t for(var check in checks) {\n\t\tvar thisCheck = checks[check];\n\t\t\n\t\tif(thisMetaData[i].hasOwnProperty(thisCheck)) {\n\t\t for(var j=0; j < thisMetaData[i][thisCheck].length; j++) {\n\t\t\tif(!thisMetaDataFields.includes(thisMetaData[i][thisCheck][j])) {\n\t\t\t if(!rawDataFields.includes(thisMetaData[i][thisCheck][j])) {\n\t\t\t\tif(!previousLevelFields || !previousLevelFields.includes(thisMetaData[i][thisCheck][j])) {\n\n\t\t\t\t // special case for constants - just catch it here\n\t\t\t\t if(thisCheck == 'target' && thisMetaData[i]['op'] == 'constant') {\n\t\t\t\t\t// this is OK, if there is just one target if more, warn\n\t\t\t\t\tif(j > 0) {\n\t\t\t\t\t output += \"METADATA WARNING: \" +\n\t\t\t\t\t\tperspectives[perspective] + \":\" + thisMetaData[i].name + \" - \" +\n\t\t\t\t\t\t'multiple targets for constant! ignoring: ' +\n\t\t\t\t\t\tthisMetaData[i][thisCheck][j] + '<br>' + '\\n';\n\t\t\t\t\t}\n\t\t\t\t } else {\n\t\t\t\t\t// otherwise not\n\t\t\t\t\toutput += \"METADATA ERROR: \" +\n\t\t\t\t\t perspectives[perspective] + \":\" + thisMetaData[i].name + \" - \" +\n\t\t\t\t\t 'bad reference in ' + thisCheck + ' - ' +\n\t\t\t\t\t thisMetaData[i][thisCheck][j] + '<br>' + '\\n';\n\t\t\t\t }\n\t\t\t\t}\n\t\t\t }\n\t\t\t}\n\t\t }\n\t\t}\n\t }\n\t}\n\tpreviousLevelFields = thisMetaDataFields;\n }\n\n output += checkViews(xmlobject.views,rawDataFields,allMetaDataFields);\n \n if(output == \"\"){\n\toutput += \"NO ERRORS FOUND\";\n }\n \n return(output);\n}",
"function pushDetailsInTeams(teams,matches){\n for(let i=0;i<teams.length;i++){\n let name=teams[i].name;\n for(let j=0;j<matches.length;j++){\n if(name==matches[j].t1 || name==matches[j].t2){\n if(name==matches[j].t1 ){\n teams[i].matches.push({\n opponenetTeam:matches[j].t2,\n teamScore:matches[j].team1Score,\n opponentScore:matches[j].team2Score,\n result:matches[j].result\n })\n }else{\n teams[i].matches.push({\n opponenetTeam:matches[j].t1,\n teamScore:matches[j].team2Score,\n opponentScore:matches[j].team1Score,\n result:matches[j].result\n })\n }\n }\n }\n }\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Bernstein Basis NumCS script: 5.5.2.8, p423 Scrpt Fabian: 3.45, p112 | function bernsteinBasis(N, tt) {
const n = N-1;
const t = tt/n; //this basis goes from 0 to 1 for some reason
//const t = tt;
var sol = [];
for(var i = 0; i <= n; i++) {
const val = choose(n, i)*Math.pow(t,i)*Math.pow(1-t,n-i);
sol.push(val);
}
return sol;
} | [
"function get_BasePart_Energy(pos_i, int_seq)\n{\n var bp_i; // assignment of the base\n var size; // loop size\n var pos_BP_vor, pos_BP_nach; // pos. of the BPs that enclose the free base (in BP_Order)\n var i, j;\n var group_i, group_j; // left and right border of the group of free bases where the consideres free base (pos_i) is located\n\n // ATTENTION!!: PREDECESSOR AND SUCCESSOR BP DON'T HAVE THE SAME MEANING AS FOR BPs! HERE THE BPs ARE NOT \n // PREDECESSOR AND SUCCESSOR TO EACH OTHER AUTOMATICALLY!\n\n bp_i = int_seq[pos_i];\n\n //finding the group of free bases\n //+++++++++++++++++++++++++++++++++++++++++++\n i = pos_i;\n while ((0<=i) && (brackets[i] == '.'))\n i--;\n group_i = i+1;\n\n j = pos_i;\n while ((j<struct_len) && (brackets[j] == '.'))\n j++;\n group_j = j-1;\n\n // if the free base is not adjacent to a stem, it has no influence on the energy\n // thus, return 0.0 + penalty\n //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n if ((pos_i == 0) && (brackets[pos_i+1] == '.'))\n return Sum_MaxDouble(0.0,BasePenalty(pos_i, int_seq[pos_i]));\n else if ((pos_i == struct_len-1) && (brackets[pos_i-1] == '.'))\n return Sum_MaxDouble(0.0,BasePenalty(pos_i, int_seq[pos_i]));\n else if ((brackets[pos_i-1] == '.') && (brackets[pos_i+1] == '.'))\n return Sum_MaxDouble(0.0,BasePenalty(pos_i, int_seq[pos_i]));\n\n else\n {\n // EL (- G i) or (i G -)\n if ((group_i == 0) || (group_j == struct_len-1))\n {\n return externEnergy(int_seq);\n }\n\n pos_BP_vor = BP_Pos_Nr[group_i-1];\n pos_BP_nach = BP_Pos_Nr[group_j+1];\n\n // in HairpinLoop\n if (pos_BP_vor == pos_BP_nach)\n {\n size = BP_Order[pos_BP_vor][1] - BP_Order[pos_BP_vor][0] - 1;\n return HairpinLoopEnergy(size,BP_Order[pos_BP_vor][0],int_seq);\n }\n\n // free base is right in a BL or IL or ML, pos_BP_nach = closingML\n else if ((brackets[group_i-1] == ')') && (brackets[group_j+1] == ')'))\n {\n return getPartEnergy(pos_BP_nach, pos_BP_vor, int_seq);\n }\n\n // free base if left in a BL or IL or ML, pos_BP_vor = closingBP\n else if ((brackets[group_i-1] == '(') && (brackets[group_j+1] == '('))\n {\n //if (BP_Order[pos_BP_nach][3] == 0) ==> BL or IL (left);\n //else ==> ML, closingBP = pos_BP_nach\n // getPartEnergy can be used, since pos_BP_vor and pos_BP_nach are neighbors\n\n // HERE: pos_BP_nach is predecessor of pos_BP_vor\n return getPartEnergy(pos_BP_vor, pos_BP_nach, int_seq);\n }\n else if (BP_Successors[pos_BP_vor] == BP_Successors[pos_BP_nach])\n {\n //ML\n if (BP_Successors[pos_BP_vor] != numBP)\n return MLEnergy(BP_Successors[pos_BP_vor],int_seq);\n //EL\n else\n return externEnergy(int_seq);\n }\n\n //forgotten cases\n else\n {\n out(\"Pos: %d => Forgotten cases!\\n\", pos_i);\n return 0;\n }\n } // else\n}",
"function getAnchoBandaMinimoQPSK(Fb) {\n B=Fb/2\n return B;\n}",
"function getAnchoBandaMinimoFSK(Fb,des) {\n B=2*(Fb+des)\n return B;\n}",
"function tentBasis(N, t) {\n var sol = [];\n for(var i = 0; i < N; i++) {\n if(i-1 > t) {\n sol.push(0);\n }\n else if(i > t) {\n sol.push( (t % 1.0));\n }\n else if(i+1 > t) {\n sol.push(1- (t % 1.0));\n }\n else {\n sol.push(0);\n }\n }\n\n return sol;\n}",
"function babbage() {\n const endDigits = 269696;\n let num = Math.ceil(Math.sqrt(endDigits));\n\n while (num * num % 1000000 !== endDigits) {\n num += 2;\n }\n\n return num;\n}",
"SolveBend_PBD_Triangle() {\n const stiffness = this.m_tuning.bendStiffness;\n for (let i = 0; i < this.m_bendCount; ++i) {\n const c = this.m_bendConstraints[i];\n const b0 = this.m_ps[c.i1].Clone();\n const v = this.m_ps[c.i2].Clone();\n const b1 = this.m_ps[c.i3].Clone();\n const wb0 = c.invMass1;\n const wv = c.invMass2;\n const wb1 = c.invMass3;\n const W = wb0 + wb1 + 2.0 * wv;\n const invW = stiffness / W;\n const d = new b2_math_js_1.b2Vec2();\n d.x = v.x - (1.0 / 3.0) * (b0.x + v.x + b1.x);\n d.y = v.y - (1.0 / 3.0) * (b0.y + v.y + b1.y);\n const db0 = new b2_math_js_1.b2Vec2();\n db0.x = 2.0 * wb0 * invW * d.x;\n db0.y = 2.0 * wb0 * invW * d.y;\n const dv = new b2_math_js_1.b2Vec2();\n dv.x = -4.0 * wv * invW * d.x;\n dv.y = -4.0 * wv * invW * d.y;\n const db1 = new b2_math_js_1.b2Vec2();\n db1.x = 2.0 * wb1 * invW * d.x;\n db1.y = 2.0 * wb1 * invW * d.y;\n b0.SelfAdd(db0);\n v.SelfAdd(dv);\n b1.SelfAdd(db1);\n this.m_ps[c.i1].Copy(b0);\n this.m_ps[c.i2].Copy(v);\n this.m_ps[c.i3].Copy(b1);\n }\n }",
"function get_BP_Energy(pos_i, int_seq)\n{\n var energy = 0.0;\n\n var pos_BP; //pos_i is the absolute pos. in the structure, pos_BP is the pos. of the BP in BP_Order (in pos_i is a BP)\n var pos_j; //binding pos. of pos_i, if there is a BP in pos_i\n var bp_i, bp_j; // assignment of the BP\n var size; // size of the loop\n var pos_i_vor, pos_j_vor, pos_i_nach, pos_j_nach; // pos. of the previous and the following BPs (if there are exactly one prec. and one succ.)\n var pos_BP_vor, pos_BP_nach; // pos. of the previous and the following BP in BP_Order\n var bp_i_vor, bp_j_vor, bp_i_nach, bp_j_nach; // assignments of the previous and the following BP\n\n pos_j = BP_Order[BP_Pos_Nr[pos_i]][1];\n bp_i = int_seq[pos_i];\n bp_j = int_seq[pos_j];\n\n pos_BP = BP_Pos_Nr[pos_i];\n pos_BP_vor = BP_Precursors[pos_BP];\n if (pos_BP_vor != -1)\n {\n pos_i_vor = BP_Order[pos_BP_vor][0];\n pos_j_vor = BP_Order[pos_BP_vor][1];\n bp_i_vor = int_seq[pos_i_vor];\n bp_j_vor = int_seq[pos_j_vor];\n }\n pos_BP_nach = BP_Successors[pos_BP];\n if (pos_BP_nach != -1)\n {\n pos_i_nach = BP_Order[pos_BP_nach][0];\n pos_j_nach = BP_Order[pos_BP_nach][1];\n bp_i_nach = int_seq[pos_i_nach];\n bp_j_nach = int_seq[pos_j_nach];\n }\n\n //depending on the kind of the BP:\n //=====================================\n //CLOSING HL or ML or dangling end:\n\n if (pos_BP_vor == -1) // no predecessor\n {\n //CLOSING HL:\n //---------------\n if (BP_Order[pos_BP][3] == 0) // no ML\n {\n size = BP_Order[pos_BP][1] - BP_Order[pos_BP][0] - 1;\n energy = Sum_MaxDouble(energy, HairpinLoopEnergy(size,pos_i,int_seq));\n\n //if pos_BP_nach == -1, pos_BP would already be the imaginary last BP (\"closing\"\n //the external loop) and no further structural element follows\n if (pos_BP_nach != -1)\n energy = Sum_MaxDouble(energy, getPartEnergy(pos_BP_nach, pos_BP, int_seq));\n }\n\n //CLOSING ML or dangling end:\n //-------------------------------\n else\n {\n if (pos_BP_nach != -1)\n {\n energy = Sum_MaxDouble(energy, MLEnergy(pos_BP,int_seq));\n energy = Sum_MaxDouble(energy, getPartEnergy(pos_BP_nach, pos_BP, int_seq));\n }\n else //dangling has no predecessor and no successor\n {\n energy = Sum_MaxDouble(energy, externEnergy(int_seq));\n }\n }\n }\n //BL or IL or successor is dangling end or closing ML:\n //-------------------------------------------------------\n else\n {\n //has predecessor\n energy = Sum_MaxDouble(energy, getPartEnergy(pos_BP, pos_BP_vor, int_seq));\n //all that have a predecessor, have a successor as well\n energy = Sum_MaxDouble(energy, getPartEnergy(pos_BP_nach, pos_BP, int_seq));\n }\n\n return energy;\n}",
"function binb(x, len) {\n var j, i, l,\n W = new Array(80),\n hash = new Array(16),\n //Initial hash values\n H = [\n new int64(0x6a09e667, -205731576),\n new int64(-1150833019, -2067093701),\n new int64(0x3c6ef372, -23791573),\n new int64(-1521486534, 0x5f1d36f1),\n new int64(0x510e527f, -1377402159),\n new int64(-1694144372, 0x2b3e6c1f),\n new int64(0x1f83d9ab, -79577749),\n new int64(0x5be0cd19, 0x137e2179)\n ],\n T1 = new int64(0, 0),\n T2 = new int64(0, 0),\n a = new int64(0, 0),\n b = new int64(0, 0),\n c = new int64(0, 0),\n d = new int64(0, 0),\n e = new int64(0, 0),\n f = new int64(0, 0),\n g = new int64(0, 0),\n h = new int64(0, 0),\n //Temporary variables not specified by the document\n s0 = new int64(0, 0),\n s1 = new int64(0, 0),\n Ch = new int64(0, 0),\n Maj = new int64(0, 0),\n r1 = new int64(0, 0),\n r2 = new int64(0, 0),\n r3 = new int64(0, 0);\n\n if (sha512_k === undefined) {\n //SHA512 constants\n sha512_k = [\n new int64(0x428a2f98, -685199838), new int64(0x71374491, 0x23ef65cd),\n new int64(-1245643825, -330482897), new int64(-373957723, -2121671748),\n new int64(0x3956c25b, -213338824), new int64(0x59f111f1, -1241133031),\n new int64(-1841331548, -1357295717), new int64(-1424204075, -630357736),\n new int64(-670586216, -1560083902), new int64(0x12835b01, 0x45706fbe),\n new int64(0x243185be, 0x4ee4b28c), new int64(0x550c7dc3, -704662302),\n new int64(0x72be5d74, -226784913), new int64(-2132889090, 0x3b1696b1),\n new int64(-1680079193, 0x25c71235), new int64(-1046744716, -815192428),\n new int64(-459576895, -1628353838), new int64(-272742522, 0x384f25e3),\n new int64(0xfc19dc6, -1953704523), new int64(0x240ca1cc, 0x77ac9c65),\n new int64(0x2de92c6f, 0x592b0275), new int64(0x4a7484aa, 0x6ea6e483),\n new int64(0x5cb0a9dc, -1119749164), new int64(0x76f988da, -2096016459),\n new int64(-1740746414, -295247957), new int64(-1473132947, 0x2db43210),\n new int64(-1341970488, -1728372417), new int64(-1084653625, -1091629340),\n new int64(-958395405, 0x3da88fc2), new int64(-710438585, -1828018395),\n new int64(0x6ca6351, -536640913), new int64(0x14292967, 0xa0e6e70),\n new int64(0x27b70a85, 0x46d22ffc), new int64(0x2e1b2138, 0x5c26c926),\n new int64(0x4d2c6dfc, 0x5ac42aed), new int64(0x53380d13, -1651133473),\n new int64(0x650a7354, -1951439906), new int64(0x766a0abb, 0x3c77b2a8),\n new int64(-2117940946, 0x47edaee6), new int64(-1838011259, 0x1482353b),\n new int64(-1564481375, 0x4cf10364), new int64(-1474664885, -1136513023),\n new int64(-1035236496, -789014639), new int64(-949202525, 0x654be30),\n new int64(-778901479, -688958952), new int64(-694614492, 0x5565a910),\n new int64(-200395387, 0x5771202a), new int64(0x106aa070, 0x32bbd1b8),\n new int64(0x19a4c116, -1194143544), new int64(0x1e376c08, 0x5141ab53),\n new int64(0x2748774c, -544281703), new int64(0x34b0bcb5, -509917016),\n new int64(0x391c0cb3, -976659869), new int64(0x4ed8aa4a, -482243893),\n new int64(0x5b9cca4f, 0x7763e373), new int64(0x682e6ff3, -692930397),\n new int64(0x748f82ee, 0x5defb2fc), new int64(0x78a5636f, 0x43172f60),\n new int64(-2067236844, -1578062990), new int64(-1933114872, 0x1a6439ec),\n new int64(-1866530822, 0x23631e28), new int64(-1538233109, -561857047),\n new int64(-1090935817, -1295615723), new int64(-965641998, -479046869),\n new int64(-903397682, -366583396), new int64(-779700025, 0x21c0c207),\n new int64(-354779690, -840897762), new int64(-176337025, -294727304),\n new int64(0x6f067aa, 0x72176fba), new int64(0xa637dc5, -1563912026),\n new int64(0x113f9804, -1090974290), new int64(0x1b710b35, 0x131c471b),\n new int64(0x28db77f5, 0x23047d84), new int64(0x32caab7b, 0x40c72493),\n new int64(0x3c9ebe0a, 0x15c9bebc), new int64(0x431d67c4, -1676669620),\n new int64(0x4cc5d4be, -885112138), new int64(0x597f299c, -60457430),\n new int64(0x5fcb6fab, 0x3ad6faec), new int64(0x6c44198c, 0x4a475817)\n ];\n }\n\n for (i = 0; i < 80; i += 1) {\n W[i] = new int64(0, 0);\n }\n\n // append padding to the source string. The format is described in the FIPS.\n x[len >> 5] |= 0x80 << (24 - (len & 0x1f));\n x[((len + 128 >> 10) << 5) + 31] = len;\n l = x.length;\n for (i = 0; i < l; i += 32) { //32 dwords is the block size\n int64copy(a, H[0]);\n int64copy(b, H[1]);\n int64copy(c, H[2]);\n int64copy(d, H[3]);\n int64copy(e, H[4]);\n int64copy(f, H[5]);\n int64copy(g, H[6]);\n int64copy(h, H[7]);\n\n for (j = 0; j < 16; j += 1) {\n W[j].h = x[i + 2 * j];\n W[j].l = x[i + 2 * j + 1];\n }\n\n for (j = 16; j < 80; j += 1) {\n //sigma1\n int64rrot(r1, W[j - 2], 19);\n int64revrrot(r2, W[j - 2], 29);\n int64shr(r3, W[j - 2], 6);\n s1.l = r1.l ^ r2.l ^ r3.l;\n s1.h = r1.h ^ r2.h ^ r3.h;\n //sigma0\n int64rrot(r1, W[j - 15], 1);\n int64rrot(r2, W[j - 15], 8);\n int64shr(r3, W[j - 15], 7);\n s0.l = r1.l ^ r2.l ^ r3.l;\n s0.h = r1.h ^ r2.h ^ r3.h;\n\n int64add4(W[j], s1, W[j - 7], s0, W[j - 16]);\n }\n\n for (j = 0; j < 80; j += 1) {\n //Ch\n Ch.l = (e.l & f.l) ^ (~e.l & g.l);\n Ch.h = (e.h & f.h) ^ (~e.h & g.h);\n\n //Sigma1\n int64rrot(r1, e, 14);\n int64rrot(r2, e, 18);\n int64revrrot(r3, e, 9);\n s1.l = r1.l ^ r2.l ^ r3.l;\n s1.h = r1.h ^ r2.h ^ r3.h;\n\n //Sigma0\n int64rrot(r1, a, 28);\n int64revrrot(r2, a, 2);\n int64revrrot(r3, a, 7);\n s0.l = r1.l ^ r2.l ^ r3.l;\n s0.h = r1.h ^ r2.h ^ r3.h;\n\n //Maj\n Maj.l = (a.l & b.l) ^ (a.l & c.l) ^ (b.l & c.l);\n Maj.h = (a.h & b.h) ^ (a.h & c.h) ^ (b.h & c.h);\n\n int64add5(T1, h, s1, Ch, sha512_k[j], W[j]);\n int64add(T2, s0, Maj);\n\n int64copy(h, g);\n int64copy(g, f);\n int64copy(f, e);\n int64add(e, d, T1);\n int64copy(d, c);\n int64copy(c, b);\n int64copy(b, a);\n int64add(a, T1, T2);\n }\n int64add(H[0], H[0], a);\n int64add(H[1], H[1], b);\n int64add(H[2], H[2], c);\n int64add(H[3], H[3], d);\n int64add(H[4], H[4], e);\n int64add(H[5], H[5], f);\n int64add(H[6], H[6], g);\n int64add(H[7], H[7], h);\n }\n\n //represent the hash as an array of 32-bit dwords\n for (i = 0; i < 8; i += 1) {\n hash[2 * i] = H[i].h;\n hash[2 * i + 1] = H[i].l;\n }\n return hash;\n }",
"function chebab(a,b,n)\n{\n var xnodes=linspace(1/(2*n+2)*Math.PI,(2*n+1)/(2*n+2)*Math.PI,n+1);\n// disp(xnodes)\n var abnodes=zeros(n+1,1);\n for(var i=0;i<=n;i++)\n {\n\tabnodes[n-i]= (Math.cos(xnodes[i])+1)/2*(b-a)+a;\n }\n return(abnodes)\n\n}",
"function constructBan(sfen) {\n const n = sfen.length;\n\n // Pices on board\n var i;\n var ix = 0;\n var iy = 0;\n var iban = 0;\n\n for(var i = 0; i <nrow*nrow; i++)\n editor.ban[i] = '';\n\n for (i = 0; i < n; i++) {\n p = sfen.charAt(i);\n\n if (p === '+') {\n p = sfen.substring(i, i + 2);\n i++;\n }\n\n var number = Number(p);\n if (p == '/') { // Next row\n ix = 0;\n iy++;\n }\n else if (number) { // n black squares\n for(k=0; k<number; k++)\n editor.ban[iban + k] = '';\n iban += number;\n ix += number;\n }\n else if (p == ' ') { // End of board discription\n break;\n }\n else if(Piece[p.toLowerCase()]) { \n editor.ban[iban] = p;\n ix++;\n iban ++;\n }\n }\n\n i = skipTeban(sfen, i);\n\n i = constructSenteHand(sfen, i);\n i = constructGoteHand(sfen, i);\n\n if (sfenEditorJs.debug) {\n console.log('BanFromText', editor.ban);\n console.log('SenteHand', editor.senteHand);\n console.log('GoteHand', editor.goteHand);\n }\n}",
"function compute_LF_finings(ibu) {\n var finingsMlPerLiter = 0.0;\n var LF_finings = 0.0;\n var postBoilVolume = 0.0;\n\n LF_finings = 1.0;\n if (!isNaN(ibu.finingsAmount.value)) {\n postBoilVolume = ibu.getPostBoilVolume();\n finingsMlPerLiter = ibu.finingsAmount.value / postBoilVolume;\n if (ibu.finingsType.value == \"gelatin\") {\n // exponential decay factor from 'gelatin' subdirectory, data.txt\n LF_finings = Math.exp(-0.09713 * finingsMlPerLiter);\n }\n }\n if (SMPH.verbose > 5) {\n console.log(\"LF finings : \" + LF_finings.toFixed(4) + \" from \" +\n ibu.finingsAmount.value.toFixed(3) + \" ml of \" +\n ibu.finingsType.value + \" in \" +\n postBoilVolume.toFixed(2) + \" l post-boil\");\n }\n return LF_finings;\n}",
"function constructText(ban) {\n var num = 0;\n var text = '';\n for(var iy=0; iy<nrow; iy++) {\n for(var ix=0; ix<nrow; ix++) {\n var index = nrow*iy + ix;\n if(ban[index]) {\n if(num > 0) {\n text += num;\n num = 0;\n }\n text += ban[index];\n }\n else {\n num++;\n }\n\n }\n if(num > 0) {\n text += num;\n num = 0;\n }\n if(iy < nrow - 1)\n text += '/'\n }\n\n text += ' b ';\n\n editor.senteHand = sortPieces(editor.senteHand);\n editor.goteHand = sortPieces(editor.goteHand);\n\n text += constructTextInHand(editor.senteHand).toUpperCase();\n text += constructTextInHand(editor.goteHand).toLowerCase();\n\n if(editor.senteHand.length == 0 && editor.goteHand.length == 0)\n text += '-';\n\n text += ' 1';\n\n var sfenText = document.getElementById(\"sfen\");\n sfenText.innerHTML = text;\n\n return text;\n}",
"function CByte(n) {\n var i=n*1;\n i=Math.round(i);\n //odd numbers round up if .5, even numbers don't\n if (i%2 != 0) {\n var j=Math.abs(n-i);\n if (j==.5) {i-=1;}\n }\n return i;\n}",
"BCS() { if (this.C) this.PC = this.checkBranch_(this.MP); }",
"function coeff_biquad_lowpass12db(freq, gain) {\n var w = 2.0 * Math.PI * freq / samplerate;\n var s = Math.sin(w);\n var c = Math.cos(w);\n var q = gain;\n var alpha = s / (2.0 * q);\n var scale = 1.0 / (1.0 + alpha);\n\n var a1 = 2.0 * c * scale;\n var a2 = (alpha - 1.0) * scale;\n var b1 = (1.0 - c) * scale;\n var b0 = 0.5 * b1;\n var b2 = b0;\n\n return [0, 0, 0, 0, b0, b1, b2, a1, a2];\n}",
"function isBichain(m) {\n return hasAlg('bichain', m)\n}",
"function PHSK_BFeld( draht, BPoint) {\n\tif ( GMTR_MagnitudeSquared( GMTR_CrossProduct( GMTR_VectorDifference(draht.a ,draht.b ),GMTR_VectorDifference(draht.a ,BPoint ) )) < 10E-10)\n\t\treturn new Vec3 (0.0, 0.0, 0.0);\n\n\n\tlet A = draht.a;\n\tlet B = draht.b;\n\tlet P = BPoint;\n\t\n\tlet xd = -(GMTR_DotProduct(A,A) - GMTR_DotProduct(A,B) + GMTR_DotProduct(P , GMTR_VectorDifference(A,B))) / (GMTR_Distance(A,B));\n\tlet x = xd / (GMTR_Distance(A,B));\n\tlet yd = xd + GMTR_Distance(A,B);\n\t\n\tlet F1 = (yd / GMTR_Distance(P,B)) - (xd / GMTR_Distance(P,A));\n\tlet F2 = 1 / (GMTR_Distance(P,GMTR_VectorAddition(A,GMTR_ScalarMultiplication( GMTR_VectorDifference(B,A), x))));\n\tlet F3 = GMTR_CrossProductNormal( GMTR_VectorDifference(A,B),GMTR_VectorDifference(A,P) );\n\n\treturn GMTR_ScalarMultiplication(F3,F1*F2);\n}",
"function getBin(){\n var ccNumber = document.querySelector('input[data-checkout=\"cardNumber\"]');\n return ccNumber.value.replace(/ /g, '').replace(/-/g, '').replace(/\\./g, '').slice(0,6);\n \n }",
"function smashFactor(bs, cs) {\n\treturn Math.round(bs / cs * 100) / 100;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
3. find user sockets [] | function findUserSockets(ioServer, userId, sessionId, logoutAll) {
let ioSockets = [];
let nsps = ioServer.nsps;
for (let key in nsps) {
if (key === '/') continue;
let sockets = nsps[key].connected;
for (let key in sockets) {
if (!sockets[key].handshake.user) continue;
let parsedCookie = cookie.parse(sockets[key].handshake.headers.cookie);
var sid = cookieParser.signedCookie(parsedCookie['sid'], config.get("session:secret"));
if ( sockets[key].handshake.user._id.equals(reqUserId) && (reqSessionId === sid || logoutAll) ) {
ioSockets.push(sockets[key]);
};
};
};
return new Promise((resolve, reject) => {
return resolve(ioSockets);
});
} | [
"listSockets() {\n var list = this.players.map(player => player.socketID);\n list.push(this.hostID);\n return list;\n }",
"function onEachUserConnection(socket) {\n\t\n\tprint('---------------------------------------');\n\tprint('Connected => Socket ID ' + socket.id + ', User: ' + JSON.stringify(socket.handshake.query));\n\n\tvar from_user_id = socket.handshake.query.from;\n\tvar from_user_name = socket.handshake.query.name; //----->\n\n\t// Add to Map\n\tlet userMapVal = { socket_id: socket.id , name:from_user_name}; // ---> name\n\taddUserToMap(from_user_id, userMapVal);\n\tprint(userMap);\n\tprintNumOnlineUsers();\n\t//send the connected users...\n\tsendConnectedUsers(socket);\n\tonMessage(socket);\n\tcheckOnline(socket);\n\tonUserDisconnect(socket);\n}",
"numOfUsers() {\n return Object.entries(this.sockets).length;\n }",
"function getSocketById(id){\n var count = openSockets.length;\n var socket = null;\n for(var i=0;i<count;i++){\n \n if(openSockets[i].id==id){\n socket = openSockets[i];\n break;\n }\n }\n return socket;\n}",
"function socketIdByName(name)\n {\n for (var i = 0; i < userList.length; i++)\n {\n if (userList[i].name == name)\n {\n return userList[i].id;\n }\n }\n \n return null;\n }",
"function displayConnections() {\n console.log(\"\\nid:\\tIP Address\\t\\tPort No.\");\n for (i = 0; i < clientSockets.length; i++) {\n var ip = clientSockets[i].request.connection._peername.address;\n\n if (ip == '127.0.0.1') {\n ip = clientIP;\n }\n var port = clientSockets[i].request.connection._peername.port;\n console.log((i + 1) + \"\\t\" + ip + \"\\t\\t\" + port);\n }\n console.log(\"\\n\");\n} // End displayConnections()",
"getClient_sock_at(socket_id){\n \tif (this.nodes.has(socket_id))\n \t\treturn this.nodes.get(socket_id).socket;\n \tconsole.warn(\"Error:getClient_sock_at\");\n }",
"getUserBySocketID(socketID) {\n if (this.users.hasOwnProperty(socketID))\n return this.users[socketID];\n }",
"function send_current_users (socket) {\n var info = client_info[socket.id];\n var users = [];\n var now_timestamp = moment().local().format('h:mm:ss a');\n\n if (typeof info === 'undefined') {\n return;\n }\n\n Object.keys(client_info).forEach(function (socket_id) {\n var user_info = client_info[socket_id];\n if (info.room === user_info.room) {\n users.push(user_info.name);\n }\n });\n\n socket.emit('message', {\n name: 'System',\n text: 'Current Users: '+ users.join(', '),\n timestamp: now_timestamp\n });\n}",
"removeSocketFormUser(userID, socketID) {\n // If have connections\n if (isUserOnline(userID)) {\n socketIDs[userID].sockets.map(function (socket, index) {\n // If the socket is correct socket want to remove\n if (socket === socketID) {\n socketIDs[userID].sockets.splice(index, 1);\n // If have no socket in list, remove this list\n if (socketIDs[userID].sockets.length <= 0) {\n delete socketIDs[userID];\n }\n return false;\n }\n });\n }\n }",
"function getOnlineRservers(){\n\tvar sql = \"SELECT rserver_id,ip_address,port,state FROM info_rserver where state = 1\";\n\tvar rservers = [];\n\texecuteSql(sql, null, \n\t\tfunction(rows){\n\t\t\tif(rows) rservers.push(rows);\n\t\t}, \n\t\tfunction(err){\n\t\t\tconsole.log(\"Error: failed when get online rservers, \" + err);\n\t\t}\n\t);\n\treturn rservers;\n}",
"function getAllPlayers() {\n var players = [];\n\n Object.keys(io.sockets.connected).forEach(function(socketId) {\n var player = io.sockets.connected[socketId].player;\n\n if (player) {\n players.push(player);\n }\n });\n\n return players;\n}",
"function ListUsers(ws) {\n var returnMessage = {}\n returnMessage[\"type\"] = \"user-list\";\n returnMessage[\"data\"] = [ ];\n\n switch (ws.gamemode) {\n case \"server\":\n wss.clients.forEach(function each(client) {\n var user = {}\n user[\"user-id\"] = client.userId;\n user[\"user-name\"] = client.userName;\n user[\"lobby-id\"] = client.lobbyId;\n user[\"gamemode\"] = client.gamemode;\n returnMessage.data.push(user);\n });\n ws.send(JSON.stringify(returnMessage));\n break;\n case \"player\" || \"spectator\":\n if (ws.lobbyId === nullLobbyId) {\n SendUserError(ws, \"list-users\", \"not in a lobby\")\n return;\n }\n for (var i=0; i<lobbies[ws.lobbyId][\"users\"].length; i++) {\n var client = lobbies[ws.lobbyId][\"users\"][i];\n var newEntry = { };\n newEntry[\"user-id\"] = client.userId\n newEntry[\"user-name\"] = client.userName;\n newEntry[\"gamemode\"] = client.gamemode;\n returnMessage[\"data\"].push(newEntry);\n }\n ws.send(JSON.stringify(returnMessage));\n break;\n }\n}",
"getNodes() {\n this.privKey = tools.createPrivKey();\n this.publicKey = tools.getPublicKey(this.privKey);\n const serverSocket = io_cli.connect(config.mainServer, {\n query: {\n \"link_type\":\"miner\",\n \"port\":this.port,//for test\n \"publickey\":this.publicKey\n }\n });\n serverSocket.on('connect', () => {\n console.log('bootstrapServer is connected');\n serverSocket.emit('allNodes');\n })\n serverSocket.on('disconnect', () => {\n console.log(\"bootstrapServer is disconnected.\")\n })\n serverSocket.on('allNodes_response', (nodes) => {//addresses of nodes\n var isNodes = false;\n for(var each of nodes) {\n if(each == null || each == this.address) continue;\n isNodes = true;\n ((each) => {\n if(this.nodeRoom[each.address]) return;\n var eachSocket = io_cli.connect(each.address, {\n query: {\n \"link_type\":\"miner\",\n \"port\":this.port,//for test\n \"publickey\":this.publicKey\n }\n });\n eachSocket.on('connect', () => {\n console.log(each.address+\" is connected.\");\n this.nodeRoom[each.address] = {socket: eachSocket, publicKey: each.publickey};\n this.setNodeSocketListener(eachSocket, each.address, each.publickey);\n eachSocket.on('disconnect', () => {\n console.log(each.address+\" disconnected\");\n delete this.nodeRoom[each.address];\n delete this.sendBlockchainNode[each.address];\n eachSocket.removeAllListeners();\n })\n })\n })(each)\n }\n if(isNodes == false && this.blockchain.length == 0) {\n this.createGenesisBlock();\n }\n else {\n this.getBlockchain();\n }\n console.log('blockchainState:'+this.blockchainState);\n })\n }",
"getConnects() {\n var result = [];\n for (var i = 0; i < this.connectionList.length; i++) {\n result.push(this.connectionList[i]);\n }\n return result;\n }",
"initSockets() {\n // TODO: figure out the correct events\n // that need to be broadcasted\n this.nameswaps.on('witness', (data) => {\n const sockets = this.channel('nameswaps');\n\n if (!sockets)\n return;\n\n // TODO: think about the channels here\n this.to('nameswaps', 'new witness', data);\n });\n }",
"sendUserlist() {\n this.print('Current Users');\n this.print(JSON.stringify(this.users, null, 2));\n this.namespace.emit('username list', this.getUsernames());\n }",
"function serveUsersQueue() {\n\tif (network.usersQueue.length > 0) {\n\t\tvar batch = []\n\t\tfor (var i=0; i < 100 && network.usersQueue.length > 0; i++) {\n\t\t\tbatch.push(network.usersQueue.shift());\n\t\t}\n\t\tauthenticator.cb.__call('users_lookup', {'user_id':batch.join(',')},\n\t\tfunction (reply) {\n\t\t\tconsole.log('retrieved user objects:');\n\t\t\tconsole.log(reply);\n\t\t\tfor (var i=0; i < reply.length; i++) {\n\t\t\t\t// fill the data recieved into the user objects\n\t\t\t\tnetwork.users[reply[i].id].setData(reply[i]);\n\t\t\t\t// update the depth flag, incase it increased unexpectedly\n\t\t\t\tnetwork.users[reply[i].id].setDepth(network.usersAwaiting[reply[i].id]);\n\t\t\t\t// remove user from awaiting\n\t\t\t\tdelete network.usersAwaiting[reply[i].id];\n\t\t\t}\n\t\t});\n\t}\n}",
"function removeSocketFromGroups() {\n var i, len, groupId, member;\n\n for (groupId in groups) {\n for (i = 0, len = groups[groupId].length; i < len; i++) {\n member = groups[groupId][i];\n if (member === socket) {\n\n /* remove the member from the group */\n groups[groupId].splice(i, 1);\n printableGroups[groupId].splice(i, 1);\n\n /* remove the group if it is now empty */\n if (groups[groupId].length === 0) {\n delete groups[groupId];\n delete printableGroups[groupId];\n }\n break;\n }\n }\n }\n\n console.log('groupDel: ' + JSON.stringify(printableGroups));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the computed left/right/top/bottom scrollbar widths for the given jQuery element. WARNING: given element can't have borders (which will cause offsetWidth/offsetHeight to be larger). NOTE: should use clientLeft/clientTop, but very unreliable crossbrowser. | function getScrollbarWidths(el) {
var leftRightWidth = el[0].offsetWidth - el[0].clientWidth;
var bottomWidth = el[0].offsetHeight - el[0].clientHeight;
var widths;
leftRightWidth = sanitizeScrollbarWidth(leftRightWidth);
bottomWidth = sanitizeScrollbarWidth(bottomWidth);
widths = { left: 0, right: 0, top: 0, bottom: bottomWidth };
if (getIsLeftRtlScrollbars() && el.css('direction') === 'rtl') { // is the scrollbar on the left side?
widths.left = leftRightWidth;
}
else {
widths.right = leftRightWidth;
}
return widths;
} | [
"function horizontalScrollbarPos() {\n\t\tvar left = offset.x + width * pixelSize;\n\t\tvar right = canvas.width - offset.x;\n\t\treturn [(left / (left + right)) * (canvas.width - 100), canvas.height - 15];\n\t}",
"function vimofy_get_el_offsetWidth(el)\r\n{\r\n\treturn document.getElementById(el).offsetWidth;\r\n}",
"get width() {\n if ( !this.el ) return;\n\n return ~~this.parent.style.width.replace( 'px', '' );\n }",
"getElementX(el) {\n var parent = this.myRef.current;\n var center = parent.clientWidth / 2;\n var left = el.offsetLeft - parent.offsetLeft;\n return left - center;\n }",
"overflowRatio(element) {\n const originalWhiteSpace = element.style['white-space'];\n\n element.style['white-space'] = 'nowrap';\n const style = window.getComputedStyle(element);\n const margin = (parseInt(style.marginLeft) || 0) + (parseInt(style.marginRight, 10) || 0);\n const ratio = element.scrollWidth / (element.clientWidth - margin);\n element.style['white-space'] = originalWhiteSpace;\n\n return ratio;\n }",
"function getWidth() {\n return document.documentElement.clientWidth;\n }",
"editorHorizontalPercentage() {\n return (($('#workspace-wrapper').width() - $('#info-panels').width()) / $('#workspace-wrapper').width()) * 100;\n }",
"function getHorizontalScrollDirection(clientRect, pointerX) {\n const { left, right, width } = clientRect;\n const xThreshold = width * SCROLL_PROXIMITY_THRESHOLD;\n if (pointerX >= left - xThreshold && pointerX <= left + xThreshold) {\n return 1 /* AutoScrollHorizontalDirection.LEFT */;\n }\n else if (pointerX >= right - xThreshold && pointerX <= right + xThreshold) {\n return 2 /* AutoScrollHorizontalDirection.RIGHT */;\n }\n return 0 /* AutoScrollHorizontalDirection.NONE */;\n}",
"function getMenuWidth() {\n menuBoundingRect = menuModal.getBoundingClientRect();\n modalMenuWidth = menuBoundingRect.width;\n}",
"function _getIndicatorRect(el) {\n\t var width, height;\n\t if (el.children.length === 1) {\n\t width = height = window.getComputedStyle(el.children[0]);\n\t } else {\n\t var itemComputedStyle = window.getComputedStyle(el.children[1]);\n\t var padding = parseFloat(itemComputedStyle.marginLeft);\n\t height = parseFloat(itemComputedStyle.height);\n\t width = el.children.length * (height + padding) - padding;\n\t }\n\t return { width: width, height: height };\n\t }",
"getInputContainerBounds() {\n\t\tconst inputContainer = this.searchContainer.current;\n\t\tif (inputContainer) {\n\t\t\treturn inputContainer.getBoundingClientRect();\n\t\t}\n\t\treturn undefined;\n\t}",
"function getMaxScrollWidth(container) { \n\t\tvar header = $('>div.tabs-header', container); \n\t\tvar tabsWidth = 0;\t// all tabs width \n\t\t$('ul.tabs li', header).each(function(){ \n\t\t\ttabsWidth += $(this).outerWidth(true); \n\t\t}); \n\t\tvar wrapWidth = $('.tabs-wrap', header).width(); \n\t\tvar padding = parseInt($('.tabs', header).css('padding-left')); \n\t\t \n\t\treturn tabsWidth - wrapWidth + padding; \n\t}",
"function calculateWidth(){\n $('#jsGanttChartModal').css('width', ($(window).width() - 40) + 'px');\n $('#jsGanttChartDiv').css('maxHeight', ($(window).height() - 200) + 'px');\n calculateLeftWidth();\n }",
"function getMaxScrollWidth(container) {\n\t\tvar header = $('>div.tabs-header', container);\n\t\tvar tabsWidth = 0; // all tabs width\n\t\t$('ul.tabs li', header).each(function () {\n\t\t\ttabsWidth += $(this).outerWidth(true);\n\t\t});\n\t\tvar wrapWidth = $('.tabs-wrap', header).width();\n\t\tvar padding = parseInt($('.tabs', header).css('padding-left'));\n\n\t\treturn tabsWidth - wrapWidth + padding + 40;\n\t}",
"function calculateOffsetLeft(r){\n return absolute_offset(r,\"offsetLeft\")\n}",
"static detectScrollBars() {\n const widthOfBodyWithBars = $('div.main_and_aside')[0].clientWidth;\n const widthOfBodyWithoutBars = $('body')[0].clientWidth;\n const barsWidth = widthOfBodyWithBars - widthOfBodyWithoutBars;\n if (barsWidth == 15) {\n $('div.main_and_aside').css(\n 'width', \n `${($(window)[0].innerWidth - 15).toString()}px`);\n }\n }",
"function getHorizontalPosition(offsetInGridRectangles) {\n var percentageGridWidth = (100.0 - HORIZONTAL_EDGE_PADDING_PERCENT * 2) / totalColumns;\n return HORIZONTAL_EDGE_PADDING_PERCENT + percentageGridWidth * offsetInGridRectangles;\n }",
"editorHorizontalPercentage() {\n const pw = (this._panel.numberOfInactive === Object.keys(this._panel).length - 2) ? 0 : $('#info-panels').width();\n return (($('#workspace-wrapper').width() - pw) / $('#workspace-wrapper').width()) * 100;\n }",
"function getDimensions(element) {\n if (element === window) {\n return {\n height: typeof window.innerHeight === \"number\" ? window.innerHeight : 0,\n width: typeof window.innerWidth === \"number\" ? window.innerWidth : 0\n };\n }\n\n var _element$getBoundingC = element.getBoundingClientRect(),\n width = _element$getBoundingC.width,\n height = _element$getBoundingC.height;\n\n return { width: width, height: height };\n}",
"getLength() {\n return this._horizLeftHair.get_width();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
gets the current list of providers for a given user, checks if the needed provider exists with an access token calls satellizer authenticate if provider access_token doesn't exist save the provider info to userData, save userData to localStorage returns the token either way | function getAuth(provider) {
let providers = userDataFactory.providers;
//if the provider exists, authenticate the user
if (providers[provider]) return $q.when(providers[provider]);
return $cordovaOauth[provider](...PROVIDER_DETAILS[provider])
.then((response) => {
userDataFactory.providers[provider] = response;
return response;
});
} | [
"getIdentityproviders() { \n\n\t\treturn this.apiClient.callApi(\n\t\t\t'/api/v2/identityproviders', \n\t\t\t'GET', \n\t\t\t{ },\n\t\t\t{ },\n\t\t\t{ },\n\t\t\t{ },\n\t\t\tnull, \n\t\t\t['PureCloud OAuth'], \n\t\t\t['application/json'],\n\t\t\t['application/json']\n\t\t);\n\t}",
"function linkProviderWithUser() {\n // TODO: implement this: used for registering an already existing user with a provider\n }",
"getIdentityprovidersOnelogin() { \n\n\t\treturn this.apiClient.callApi(\n\t\t\t'/api/v2/identityproviders/onelogin', \n\t\t\t'GET', \n\t\t\t{ },\n\t\t\t{ },\n\t\t\t{ },\n\t\t\t{ },\n\t\t\tnull, \n\t\t\t['PureCloud OAuth'], \n\t\t\t['application/json'],\n\t\t\t['application/json']\n\t\t);\n\t}",
"getIdentityprovidersGeneric() { \n\n\t\treturn this.apiClient.callApi(\n\t\t\t'/api/v2/identityproviders/generic', \n\t\t\t'GET', \n\t\t\t{ },\n\t\t\t{ },\n\t\t\t{ },\n\t\t\t{ },\n\t\t\tnull, \n\t\t\t['PureCloud OAuth'], \n\t\t\t['application/json'],\n\t\t\t['application/json']\n\t\t);\n\t}",
"getIdentityprovidersPureengage() { \n\n\t\treturn this.apiClient.callApi(\n\t\t\t'/api/v2/identityproviders/pureengage', \n\t\t\t'GET', \n\t\t\t{ },\n\t\t\t{ },\n\t\t\t{ },\n\t\t\t{ },\n\t\t\tnull, \n\t\t\t['PureCloud OAuth'], \n\t\t\t['application/json'],\n\t\t\t['application/json']\n\t\t);\n\t}",
"function createProvider(provider, email, refreshToken, token, freeStorage, totalStorage) {\n var credentials = Windows.Security.Credentials;\n var passwordVault = new credentials.PasswordVault();\n var i, found = undefined;\n // Check if the provider exists\n for (i = 0; i < g_providers.length; i++) {\n if (g_providers[i].name == provider && g_providers[i].user == email) {\n found = g_providers[i];\n }\n }\n if (found == undefined) {\n // Add the provider\n if (refreshToken == undefined) {\n cred = new credentials.PasswordCredential(provider, email, token)\n } else {\n cred = new credentials.PasswordCredential(provider, email, refreshToken)\n }\n passwordVault.add(cred);\n provider = {\n 'name': cred.resource, 'user': cred.userName, 'token': token, 'refresh': refreshToken,\n 'free': freeStorage, 'total': totalStorage\n };\n g_providers.push(provider);\n g_providers.sort(function (a, b) {\n return a.user.localeCompare(b.user);\n });\n // Add one chunk to notify the update of the provider list\n return provider;\n } else {\n found.token = token;\n found.refresh = refreshToken;\n found.free = freeStorage;\n found.total = totalStorage;\n return found;\n }\n}",
"getIdentityprovidersOkta() { \n\n\t\treturn this.apiClient.callApi(\n\t\t\t'/api/v2/identityproviders/okta', \n\t\t\t'GET', \n\t\t\t{ },\n\t\t\t{ },\n\t\t\t{ },\n\t\t\t{ },\n\t\t\tnull, \n\t\t\t['PureCloud OAuth'], \n\t\t\t['application/json'],\n\t\t\t['application/json']\n\t\t);\n\t}",
"getIdentityprovidersGsuite() { \n\n\t\treturn this.apiClient.callApi(\n\t\t\t'/api/v2/identityproviders/gsuite', \n\t\t\t'GET', \n\t\t\t{ },\n\t\t\t{ },\n\t\t\t{ },\n\t\t\t{ },\n\t\t\tnull, \n\t\t\t['PureCloud OAuth'], \n\t\t\t['application/json'],\n\t\t\t['application/json']\n\t\t);\n\t}",
"getIdentityprovidersPing() { \n\n\t\treturn this.apiClient.callApi(\n\t\t\t'/api/v2/identityproviders/ping', \n\t\t\t'GET', \n\t\t\t{ },\n\t\t\t{ },\n\t\t\t{ },\n\t\t\t{ },\n\t\t\tnull, \n\t\t\t['PureCloud OAuth'], \n\t\t\t['application/json'],\n\t\t\t['application/json']\n\t\t);\n\t}",
"getIdentityprovidersPurecloud() { \n\n\t\treturn this.apiClient.callApi(\n\t\t\t'/api/v2/identityproviders/purecloud', \n\t\t\t'GET', \n\t\t\t{ },\n\t\t\t{ },\n\t\t\t{ },\n\t\t\t{ },\n\t\t\tnull, \n\t\t\t['PureCloud OAuth'], \n\t\t\t['application/json'],\n\t\t\t['application/json']\n\t\t);\n\t}",
"function fetchTokens() {\n _.each(['fbtoken', 'dropboxtoken', 'livetoken'], function(key) {\n var token = localStorage.getItem(key);\n if (token != null) {\n Storage.getInstance().set(key, token);\n } \n Storage.getInstance().get(key).then(function (value) {\n console.log(key + \" \" + value);\n })\n });\n }",
"getIdentityprovidersSalesforce() { \n\n\t\treturn this.apiClient.callApi(\n\t\t\t'/api/v2/identityproviders/salesforce', \n\t\t\t'GET', \n\t\t\t{ },\n\t\t\t{ },\n\t\t\t{ },\n\t\t\t{ },\n\t\t\tnull, \n\t\t\t['PureCloud OAuth'], \n\t\t\t['application/json'],\n\t\t\t['application/json']\n\t\t);\n\t}",
"getIdentityprovidersCic() { \n\n\t\treturn this.apiClient.callApi(\n\t\t\t'/api/v2/identityproviders/cic', \n\t\t\t'GET', \n\t\t\t{ },\n\t\t\t{ },\n\t\t\t{ },\n\t\t\t{ },\n\t\t\tnull, \n\t\t\t['PureCloud OAuth'], \n\t\t\t['application/json'],\n\t\t\t['application/json']\n\t\t);\n\t}",
"function init() {\n var storedUsers = JSON.parse(localStorage.getItem(\"Users\"));\n if (storedUsers !== null) {\n users = storedUsers;\n //renderUsers();\n }\n}",
"async acquireToken(/*scopes = ['user.read']*/) {\r\n this.waitingOnAccessToken = true\r\n // Override any scope\r\n let scopes = this.defaultScope()\r\n if (!msalApp) {\r\n return null\r\n }\r\n\r\n // Set scopes for token request\r\n const accessTokenRequest = {\r\n scopes,\r\n account: this.user()\r\n }\r\n\r\n let tokenResp\r\n try {\r\n // 1. Try to acquire token silently\r\n tokenResp = await msalApp.acquireTokenSilent(accessTokenRequest)\r\n console.log('### MSAL acquireTokenSilent was successful')\r\n } catch (err) {\r\n // 2. Silent process might have failed so try via popup\r\n tokenResp = await msalApp.acquireTokenPopup(accessTokenRequest)\r\n console.log('### MSAL acquireTokenPopup was successful')\r\n } finally {\r\n this.waitingOnAccessToken = false\r\n }\r\n\r\n // Just in case check, probably never triggers\r\n if (!tokenResp.accessToken) {\r\n throw new Error(\"### accessToken not found in response, that's bad\")\r\n }\r\n\r\n this.accessToken = tokenResp.accessToken\r\n\r\n // Execute waiting call backs\r\n if (this.accessTokenCallbacks.length > 0) {\r\n this.accessTokenCallbacks.forEach( callback => {\r\n console.log('executing callback: '+callback)\r\n callback()\r\n })\r\n this.accessTokenCallbacks = [] // reset\r\n }\r\n\r\n return tokenResp.accessToken\r\n }",
"function loadUsers() {\n var loadedUsers = JSON.parse(localStorage.getItem(\"trivia-users\"));\n\n if (loadedUsers) {\n users = loadedUsers;\n }\n}",
"async function getProvider(type, data) {\n try {\n let providers = await Promise.all(\n data.map(async (indiData) => {\n let response = await fetch(\n `https://api.themoviedb.org/3/${type}/${indiData.id}/watch/providers?api_key=your_api_key`\n );\n \n let data = await response.json();\n if (data.results.IN) {\n const res = {\n name:\n type === \"movie\"\n ? indiData.original_title\n : indiData.original_name,\n poster: indiData.poster_path === null ? \"https://allmovies.tube/assets/img/no-poster.png\" : \"https://image.tmdb.org/t/p/w300/\" + indiData.poster_path,\n provider_name: data.results.IN.flatrate ? data.results.IN.flatrate[0].provider_name : \"Not availabe in India\"\n };\n return res;\n } \n else {\n const res = {\n name:\n type === \"movie\"\n ? indiData.original_title\n : indiData.original_name,\n poster: indiData.poster_path === null ? \"https://allmovies.tube/assets/img/no-poster.png\" : \"https://image.tmdb.org/t/p/w300/\" + indiData.poster_path,\n provider_name: \"Not Available in India\"\n };\n return res;\n }\n })\n );\n if(providers.length > 5){\n providers=providers.slice(0,5);\n }\n return providers;\n } catch (err) {\n console.log(err);\n }\n }",
"function storeProviderLocal(provider){\n try\n {\n LocalStorage.setObject(Constants.PROVIDER,provider);\n return true;\n }\n catch(err)\n {\n return false;\n }\n }",
"function removeOAuthProvider (req, res) {\n let user = req.user,\n provider = req.param('provider');\n\n if (user && provider) {\n // Delete the additional provider\n if (user.additionalProvidersData[provider]) {\n delete user.additionalProvidersData[provider];\n\n // Then tell mongoose that we've updated the additionalProvidersData field\n user.markModified('additionalProvidersData');\n }\n\n user.save(function(err) {\n if (err) {\n res.status(400).send({\n message: err.message\n });\n return;\n } else {\n req.login(user, function(err) {\n if (err) {\n res.status(400).send(err);\n } else {\n res.json(user);\n }\n });\n }\n });\n }\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Remove custom image from bookmark | function removeImage(bookmark) {
browser.storage.sync.remove(bookmark.id)
reloadFavicon(bookmark)
} | [
"function removePreviousImage() {\n $capturedImage.empty();\n $capturedImage.removeAttr('style');\n $fridge.removeClass('hide');\n}",
"function delbm(qdnum,bmnum) {\n\n // delete bookmark\n\n var tp1 = document.querySelectorAll('.torrentimg');\n //css้ๆฉ ๅ
จ้จ ๅฐ็ผฉ็ฅๅพ\n console.log(\"img number:\"+tp1.length)\n\n var i;\n\n // bookmark start num\n // qdnum\n\n // bookmark end num\n\n\n //var bmnum = tp1.length\n\n for (i = qdnum; i <= bmnum ; i++) {\n\n var xy1 = document.querySelector('a[id=\"bookmark'+ i + '\"]');\n //css้ๆฉ ๅ
จ้จ ๆถ่ bookmark\n\n console.log(xy1.href);\n // ๆถ่็ฝๅ\n\n xy1.click();\n\n //็นๅป ๅ ้ค ๆถ่\n }\n }",
"function assignImage(bookmark) {\n let url = bookmark.url\n if (!bookmark.url.startsWith(\"ext+cntnrbkmrk:\") && !bookmark.url.startsWith(`moz-extension://${id}`)) {\n url = updateBookmark(bookmark, \"no-container\", false)\n }\n let creating = browser.windows.create({\n type: \"detached_panel\",\n url: \"assign_image.html\",\n width: 1000,\n height: 500\n })\n creating.then(() => { setTimeout(() => {browser.runtime.sendMessage({bookmarkId: bookmark.id, bookmarkName: bookmark.title, bookmarkURL: url})}, 200) })\n}",
"function removeFromFavorites(elem) {\n\tvar parent = elem.parentNode;\n var temp = parent.parentNode.removeChild(parent);\n var url = temp.getElementsByTagName('a')[0].href;\n\n for (var i = 0; i < userFavorites.gistLinks.length; i++) {\n \tif (userFavorites.gistLinks[i].url === url) {\n \t\tuserFavorites.gistLinks.splice(i, 1);\n \t}\n }\n localStorage.setItem('myFavorites', JSON.stringify(userFavorites));\n printFavorites(userFavorites);\n}",
"function _removeImageFromBlock(e) {\n e.preventDefault();\n\n var\n $this = $(this),\n container = $this.closest('.morris-uploader'),\n fileInput = container.find('input[type=\"file\"]'),\n removeDetector = container.find('input.detached-logo'),\n imageId = container.data('image-id'),\n onchangeDetector = container.parent().find('input.onchange'),\n attachDetector = container.find('input.attached-logo');\n\n if (container.hasClass('uploaded') || container.hasClass('editing')) {\n container.css('backgroundImage', 'none').removeClass('uploaded').removeClass('editing');\n //reset file input\n fileInput.val('');\n $('.select').find('.select-placeholder').attr('selected', 'selected');\n }\n if (!container.hasClass('choosed-by-select')) {\n if (container.data('type') == 'unselectable') {\n removeDetector.val(1);\n } else {\n removeDetector.val(imageId);\n }\n } else {\n console.log('hasnt');\n container.removeClass('choosed-by-select');\n onchangeDetector.val(false);\n }\n\n container.removeAttr('data-image-id');\n //for some reason after deleting data removes only from html\n container.data('image-id', null);\n attachDetector.val('');\n _ajaxList();\n }",
"function removeimageurls(tweet) {\n var tweetstext = tweet.text;\n\n if (tweet.entities.media != undefined) {\n //loop through images in the tweet\n $.each(tweet.entities.media, function (index, value) {\n\n var urltoreplace = value.url;\n\n tweetstext = tweetstext.replace(urltoreplace, \"\");\n }\n\n\n );\n }\n\n return tweetstext;\n }",
"function removePhoto(){\n\tdocument.getElementById(\"PhotoField\").disabled = true;\n\t$(\"#PhotoField\").val(\"\");\n\t$(\"#PhotoParentDiv\").hide();\n\t$(\"#imageIcon\").css('color',\"#9ba1a7\");\n\t// for edit page\n\tdocument.getElementById(\"fileRemovedStatus\").disabled = false;\n}",
"function delFeed(myURL){\n var element = document.getElementById(myURL);\n element.parentNode.removeChild(element);\n\tdeleteFromOnScreen(myURL);\n}",
"function deleteTempImage(){\n game.remove(tempImage);\n}",
"function removeImageOverlay() {\n\t$('.overlay').remove();\n}",
"async removePicture() {\n\t\tawait axios.delete('/user/remove-picture', config);\n\t\tthis.profilePicture = '';\n\t}",
"function removeVirus(){\n const sponsorsDiv = document.querySelector('.promo__adv');\n const sponsorsAdds = sponsorsDiv.getElementsByTagName('img'); \n \n for(let i = sponsorsAdds.length - 1; i >= 0 ; i--){\n sponsorsAdds[i].remove();\n }\n}",
"function showDefaultBuddyIcon(image_element) {\n image_element.onerror = '';\n image_element.src = 'https://www.flickr.com/images/buddyicon.gif';\n return true;\n}",
"function OnkeyDown(event){\n var activeObject = PhotoCollage.getActiveObject();\n if (event.keyCode === 46) {\n \tPhotoCollage.remove(activeObject);\n }\n}",
"function BookmarkInit(urlValue, ImageUrl, selectedImageUrl) {\n\n // Check to see if bookmark exists, and create an local var with the information (or fresh)\n if (localStorage.getItem(\"bookmarks\") === null) {\n var bookmarks = [];\n } else {\n var bookmarks = JSON.parse(localStorage.getItem(\"bookmarks\"));\n }\n\n // -------- Set the image of the bookmark based on page status -------------\n if(bookmarks.includes(urlValue)) {\n document.getElementById(\"theBookmark\").src = selectedImageUrl;\n // Should be bookmarked\n } else {\n document.getElementById(\"theBookmark\").src = ImageUrl;\n // Should be un-bookmarked\n }\n // -------------------------------------------------------------------------\n\n // ----- If else ladder to determine which bookmark state to display -------\n $(\"#theBookmark\").on(\"click\", function() {\n // If something exists in storage\n if (localStorage.getItem(\"bookmarks\") != null) {\n var removed = JSON.parse(localStorage.getItem(\"bookmarks\"));\n var tester = removed.includes(urlValue);\n if (tester == true) { // Check if current page is in the array\n for (var i = 0; i < removed.length; i++) { // Loop through array to find current page\n if (urlValue === removed[i]) {\n removed.splice(i, 1); // Remove from the array\n removed.sort(); // Sort the array (alphabetically)\n localStorage.setItem(\"bookmarks\", JSON.stringify(removed)); // Send the new array back to storage\n break;\n }\n }\n document.getElementById(\"theBookmark\").src = ImageUrl; // Set bookmark image to true (marked)\n } else { // Does not exist in array ( already been bookmarked )\n var stored = JSON.parse(localStorage.getItem(\"bookmarks\")); // Pull the current array\n stored.push(urlValue); // Add the current page\n stored.sort();\n localStorage.setItem(\"bookmarks\", JSON.stringify(stored)); // Store the new array\n document.getElementById(\"theBookmark\").src = selectedImageUrl; // Set bookmark image to false (un-marked)\n }\n } else { // Nothing exists ( No page has been bookmarked )\n var stored = []; // Create new array\n stored.push(urlValue);\n localStorage.setItem(\"bookmarks\", JSON.stringify(stored));\n document.getElementById(\"theBookmark\").src = selectedImageUrl;\n }\n });\n}",
"function clearBookmarks()\n{\n\n for (ii = 0; ii < maxChapters; ii++)\n {\n\n for (jj = 0; jj <= maxSections; jj++) //Since there are six sections (include chapter start page)\n {\n var name = chapterIDs[ii][jj];\n\n window.localStorage.removeItem(name); //Go through and remove each bookmark associated with each tag (no execption/problems occur if you give a tag that doesn't exist so no need to check)\n (document.getElementById(name)).innerText = chapterMarks[ii][jj].pageText; //Push old text back onto page - give user immediate feedback on clear\n var currentMark = chapterMarks[ii][jj]; //Get the bookmark object that corresponds to this section\n currentMark.symbol = null; //Set it to null so if user goes immediately back to broswing will restart bookmarking\n\n }\n\n }\n\n}",
"function cleanBookmark(s) {\n\tvar n = s.indexOf(\"#\");\n\tif (n>0) {\n\t\treturn s.substring(0,n);\n\t} else {\n\t\treturn s;\n\t}\n}",
"function resetThumbnailImg() {\n $('img.edit_thumbnail').attr('src', emptyImageUrl);\n currentThumbnailId = 0;\n}",
"function hideImage(img) {\n background = img;\n background.style.display = \"none\";\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
PRIVATE Build a balanced tree from the sorted array where the left/right node takes on the mid of the left/right sides of the array. | function buildBalancedTree(array) {
if (array.length == 0) { return null; }
var mid = Math.floor((array.length)/2);
var n = new treeNode(null, array[mid], null);
var arrayOnLeft = array.slice(0, mid);
n.left = buildBalancedTree(arrayOnLeft);
var arrayOnRight= array.slice(mid+1);
n.right = buildBalancedTree(arrayOnRight);
return n;
} | [
"function createAVL() {\n root = null;\n var inputArray = document.getElementById(\"inputArray\").value.split(\",\");\n for (let i = 0; i < inputArray.length; i++) { // convert sstring array to number array\n inputArray[i] = parseInt(inputArray[i]);\n }\n\n // Create a root node and tree\n for (let value of inputArray) {\n root = insertValue(root, value);\n }\n\n document.getElementById(\"onorderTraverse\").innerText = inorderTraversal(root, []);\n document.getElementById(\"preOrderTraverse\").innerText = preOrderTraversal(root, []);\n}",
"constructor(value){\n this.value = value;\n this.left = null;\n this.right = null;\n }",
"function UnBalancedBST() {\n var head = null;\n var numOfStepsForSearch = 0;\n\n this.displayNumOfStepsForSearch = function() {\n return numOfStepsForSearch;\n }\n\n this.getRoot = function() {\n return head;\n }\n\n /***************************************\n SEARCHING IN TREE\n ****************************************/\n\n // PRIVATE\n // O(n)\n function traverseSearch(number, node) {\n if (node == null) return null;\n numOfStepsForSearch++;\n\n if (number > node.data) {\n return traverseSearch(number, node.right);\n } else if (number < node.data ){\n return traverseSearch(number, node.left);\n } else if (number == node.data) {\n return node;\n }\n }\n\n // PUBLIC\n // returns you the node if found\n // null otherwise\n this.search = function(numberToFind) {\n numOfStepsForSearch = 0;\n\n if (head) {\n return traverseSearch(numberToFind, head);\n }\n }\n\n /***************************************\n INSERTING INTO THE TREE\n ****************************************/\n\n // PRIVATE\n function traverseInsertion(numberToInsert, node) {\n if (node == null) { return new treeNode(null, numberToInsert, null); }\n if (numberToInsert > node.data) {\n node.right = traverseInsertion(numberToInsert, node.right);\n return node;\n } else {\n node.left = traverseInsertion(numberToInsert, node.left);\n return node;\n }\n }\n\n // PUBLIC\n this.insert = function(number) {\n if (head == null) {\n head = new treeNode(null, number, null);\n } else {\n if (number > head.data) { head.right = traverseInsertion(number, head.right); }\n else { head.left = traverseInsertion(number, head.left); }\n }\n };\n\n /***************************************\n PRINTING THE TREE\n ****************************************/\n\n // PRIVATE\n function inOrderPrint(node) {\n if (node == null) return;\n inOrderPrint(node.left);\n if (head == node) {\n console.log(\"=============== ๏ฃฟ๏ฃฟ HEAD ๏ฃฟ๏ฃฟ ==================\");\n }\n node.display();\n if (head == node) {\n console.log(\"=============================================\")\n }\n inOrderPrint(node.right);\n }\n\n // PRIVATE\n function preOrderPrint(node) {\n if (node == null) return;\n node.display();\n preOrderPrint(node.left);\n preOrderPrint(node.right);\n }\n\n // PRIVATE\n function postOrderPrint(node) {\n if (node == null) return;\n postOrderPrint(node.left);\n postOrderPrint(node.right);\n node.display();\n }\n\n // PUBLIC\n this.print = function(traversalType) {\n console.log(\"๏ฃฟ๏ฃฟ๏ฃฟ printing tree ๏ฃฟ๏ฃฟ๏ฃฟ\");\n\n if (head) {\n console.log(\"Head is \" + head.data + \"..!\");\n switch (traversalType) {\n case TRAVERSAL.INORDER: inOrderPrint(head);\n break;\n case TRAVERSAL.PREORDER: preOrderPrint(head);\n break;\n case TRAVERSAL.POSTORDER: postOrderPrint(head);\n default:\n }\n } else {\n console.log(\"Tree is currently empty.\")\n }\n };\n\n\n /***************************************\n CREATING A BALANCED TREE\n ****************************************/\n\n // PRIVATE\n function inOrderToArray(node, array) {\n if (node == null) return;\n inOrderToArray(node.left, array);\n array.push(node.data);\n inOrderToArray(node.right, array);\n }\n\n // PUBLIC\n // Convert an inordered tree to a sorted array\n this.flattenInOrderToSortedArray = function() {\n var sortedArray = [];\n if (head) {\n inOrderToArray(head, sortedArray);\n }\n return sortedArray;\n }\n\n // PRIVATE\n // Build a balanced tree from the sorted array\n // where the left/right node takes on the mid of\n // the left/right sides of the array.\n function buildBalancedTree(array) {\n if (array.length == 0) { return null; }\n\n var mid = Math.floor((array.length)/2);\n var n = new treeNode(null, array[mid], null);\n\n var arrayOnLeft = array.slice(0, mid);\n n.left = buildBalancedTree(arrayOnLeft);\n\n var arrayOnRight= array.slice(mid+1);\n n.right = buildBalancedTree(arrayOnRight);\n\n return n;\n }\n\n // PUBLIC\n // convert the incoming array into a balanced tree\n this.sortedArrayToBalancedTree = function(array) {\n if (head) {\n return buildBalancedTree(array);\n }\n return null;\n };\n\n\n /***************************************\n BALANCENESS OF A TREE\n ***************************************/\n\n // PRIVATE\n // will send 'false' to callback for any unbalanceness\n function countBalance(node, balancedCallBack) {\n if (node == null) { return -1; }\n var leftCount = 1 + countBalance(node.left, balancedCallBack);\n var rightCount = 1 + countBalance(node.right, balancedCallBack);\n if (Math.abs(leftCount-rightCount) > 1) {\n balancedCallBack(false, node);\n }\n return (leftCount >= rightCount) ? leftCount : rightCount;\n }\n\n // PUBLIC\n // Checks to see if an unbalanceness exist in the tree\n this.checkForBalanceness = function(balancedTree) {\n var balancenessExist = true;\n countBalance(balancedTree, function(balanced = true, node) {\n if (balanced == false) {\n balancenessExist = balanced\n }\n });\n\n console.log(\"Does Balancess Exist? : \" + balancenessExist);\n }\n\n /***************************************\n REMOVING FROM THE TREE\n ***************************************/\n\n // PUBLIC\n // if we're removing the root, we take care of it here.\n // if we remove from anywhere else, we use traverseRemove\n this.remove = function(number) {\n console.log(\"Let's remove: \" + number);\n\n if (head) {\n if (head.data == number && rightChildOnly(head)) {\n var temp = head; head = head.right; temp.delete();\n return head;\n }\n else if (head.data == number && leftChildOnly(head)) {\n var temp = head; head = head.left; temp.delete();\n return head;\n }\n else if (head.data == number && noChildren(head)) {\n head.delete(); head = null;\n return head;\n }\n return this.traverseRemove(number, head);\n } else {\n console.log(\"Empty tree. Nothing to remove\");\n }\n };\n\n //PRIVATE\n // Finds the minimum of sub-tree and delete it\n function deleteMinimum(node, removeCallBack) {\n\n if (noChildren(node)) {\n removeCallBack(node);\n return null;\n }\n\n if (rightChildOnly(node)) {\n removeCallBack(node);\n return node.right;\n }\n\n if (node.left) {\n node.left = deleteMinimum(node.left, removeCallBack);\n return node;\n }\n }\n\n //PRIVATE UTILITY FOR CHECKING NODE'S CHILDREN EXISTENCE\n\n function noChildren(node) {\n return (node.left == null && node.right == null);\n }\n function leftChildOnly(node) {\n return (node.left != null && node.right == null);\n }\n function rightChildOnly(node) {\n return (node.left == null && node.right != null);\n }\n function bothChildExist(node) {\n return (node.left != null && node.right != null);\n }\n\n\n\n // PUBLIC\n //\n this.traverseRemove = function (number, node) {\n if (node == null) {\n console.log(\"You're at leaf end, null. Number \" + number + \" not found. :P )\");\n return null;\n }\n if (number > node.data) {\n node.right = this.traverseRemove(number, node.right);\n return node;\n } else if (number < node.data) {\n node.left = this.traverseRemove(number, node.left);\n return node;\n } else if (number == node.data) {\n if (noChildren(node)) {\n node.delete(); return null;\n }\n if (leftChildOnly(node)) {\n var leftNodeRef = node.left; node.delete(); return leftNodeRef;\n }\n if (rightChildOnly(node)) {\n var rightNodeRef = node.right; node.delete(); return rightNodeRef;\n }\n if (bothChildExist(node)) {\n var nodeToDelete;\n node.right = deleteMinimum(node.right, function(toRemove){\n node.data = toRemove.data;\n nodeToDelete = toRemove;\n });\n nodeToDelete.delete();\n return node;\n }\n } // FOUND\n } // traverseRemove function\n\n\n //The height of a binary tree is the number of edges between the tree's root\n // and its furthest leaf node. This means that a tree containing a single node has a height of 0.\n\n // inner function, cannot access parent scope's this\n function getHeight(node) {\n if (node == null) return 0;\n if (node.left == null && node.right == null) { return 0; }\n var leftCount, rightCount = 0; // at every node, we begin with 0\n\n // if the left exist, we count the edge\n if (node.left) { leftCount = getHeight(node.left) + 1; }\n\n // right right exist, we count the edge\n if (node.right) { rightCount = getHeight(node.right) + 1; }\n\n return (leftCount > rightCount) ? leftCount : rightCount;\n }\n\n // GET HEIGHT OF Tree\n this.height = function() {\n if (head) {\n return getHeight(head);\n }\n }\n}",
"function AABBTree() {}",
"cvtBST() {\n var arr = [];\n arr.push(this.root.data);\n\n // get array - depth-first\n this.cvtToArray(this.root.left, arr);\n this.cvtToArray(this.root.right, arr);\n\n return arr;\n }",
"function breadthFirstArray(root) {\n\n}",
"function recurse(start, end) {\n // Base case returns if array has only 1 item\n if (start >= end) return\n\n const mid = start + Math.floor((end - start) / 2)\n // Call recurse on left and right halves of array\n recurse(start, mid)\n recurse(mid + 1, end)\n\n // Merge the sorted left and right halves\n merge(start, mid, end)\n\n return\n }",
"function adjustTree(indexMapLeft,root){\n if(root.hasOwnProperty('children')){\n //console.log(root.data.name)\n var cL=root.children[0];\n var cR=root.children[1];\n //console.log(leavesL,leavesR)\n //console.log(bias0,bias1)\n\n var cross_result=optimizationFun_cross(cL,cR,indexMapLeft);\n if (cross_result<0){\n swapChildren(root);\n }\n else if(cross_result==0){\n if(optimizationFun_order(cL,cR,indexMapLeft)<0)\n swapChildren(root);\n }\n\n adjustTree(indexMapLeft,cL);\n adjustTree(indexMapLeft,cR);\n }\n }",
"breadthFirstTraversal() {\n let queue = [];\n queue.push(this.root);\n while (queue.length){\n let node = queue.shift();\n console.log(node.val);\n if (node.left){queue.push(node.left);}\n if (node.right){queue.push(node.right)};\n }\n }",
"split_() {\n let nextLevel = this.level_ + 1;\n let subWidth = Math.round(this.bounds_.width / 2);\n let subHeight = Math.round(this.bounds_.height / 2);\n let x = Math.round(this.bounds_.x);\n let y = Math.round(this.bounds_.y);\n\n //top right node\n this.nodes_[0] = new Quadtree(new Rectangle(\n x + subWidth,\n y,\n subWidth,\n subHeight\n ), this.maxObjects_, this.maxLevel_, nextLevel);\n\n //top left node\n this.nodes_[1] = new Quadtree(new Rectangle(\n x,\n y,\n subWidth,\n subHeight\n ), this.maxObjects_, this.maxLevel_, nextLevel);\n\n //bottom left node\n this.nodes_[2] = new Quadtree(new Rectangle(\n x,\n y + subHeight,\n subWidth,\n subHeight\n ), this.maxObjects_, this.maxLevel_, nextLevel);\n\n //bottom right node\n this.nodes_[3] = new Quadtree(new Rectangle(\n x + subWidth,\n y + subHeight,\n subWidth,\n subHeight\n ), this.maxObjects_, this.maxLevel_, nextLevel);\n\n }",
"insert(value) {\n let newNode = new TreeNode(value);\n let current;\n this.size++;\n\n if (this.root == null) {\n this.root = newNode;\n } else {\n current = this.root;\n\n while(current != newNode) {\n if (newNode.value >= current.value) {\n if (current.right != null) {\n current = current.right;\n } else {\n current.right = newNode;\n }\n } else {\n if (current.left != null) {\n current = current.left;\n } else {\n current.left = newNode;\n }\n }\n }\n }\n }",
"function run(width, height,size, angle, limit) {\r\n\r\n\tctx.clearRect(0, 0, width, height);\r\n\r\n\tvar branchAngleA = angle; //minus becuase it rotates counter clockwise\r\n \r\n //call the function to draw boxes\r\n\r\n tree(width/2 - 75, height, size, 0, limit);\r\n\r\n\tfunction tree(x, y, size, angle, limit) {\r\n\t\tctx.save();\r\n\t\tctx.translate(x, y);\r\n\t\tctx.rotate(angle);\r\n\t\tctx.fillStyle = 'rgb(0, ' + Math.floor(42.5 * limit) + ', ' + Math.floor(25 * limit) + ' )';\r\n\t\tctx.fillRect(0, 0, size, -size);\r\n\r\n\t\t//left hand square \r\n\r\n\t\tvar x0 = 0, \r\n\t\ty0 = -size, \r\n\t\tsize0 = Math.abs(Math.cos(branchAngleA) * size), \r\n\t\tangle0 = branchAngleA;\r\n\r\n\t\tif (limit > 0) {\r\n\t\t\ttree(x0, y0, size0, angle0, limit - 1);\r\n\t\t} else {\r\n\t\t\tctx.save();\r\n\t\t\tctx.translate(x0, y0);\r\n\t\t\tctx.rotate(angle0);\r\n\t\t\tctx.fillRect(0, 0, size0, -size0);\r\n\t\t\tctx.restore();\r\n\t\t}\r\n\r\n\t\t//right hand square\r\n\r\n\t\tvar y1 = y0 - Math.abs(Math.sin(branchAngleA) * size0);\r\n\t\tvar x1 = x0 + Math.abs(Math.cos(branchAngleA) * size0);\r\n\t\tvar angle1 = angle0 + Math.PI / 2;\r\n\t\tvar size1 = Math.abs(Math.cos(angle1) * size);\r\n\r\n\t\tif (limit > 0) {\r\n\t\t\ttree(x1, y1, size1, angle1, limit - 1);\r\n\t\t} else {\r\n\t\t\tctx.save();\r\n\t\t\tctx.translate(x1, y1);\r\n\t\t\tctx.rotate(angle1);\r\n\t\t\tctx.fillRect(0, 0, size1, -size1);\r\n\t\t\tctx.restore();\r\n\t\t}\r\n\r\n\t\tctx.restore();\r\n\t}\r\n\r\n} // end of function",
"insert(val) {\n const newNode = new Node(val);\n // if BST is empty\n if (!this.root) {\n this.root = newNode;\n return this;\n }\n let curr = this.root;\n // traverse to find the right location for the new node;\n while (true) {\n // if the new val is eqal to curr val, return undefined;\n if (val === curr.val) return undefined;\n // if smaller traverse left\n if (val < curr.val) {\n // if no left\n if (!curr.left) {\n curr.left = newNode;\n return this;\n }\n // traverse\n curr = curr.left;\n } else {\n // if bigger move right\n // if no right\n if (!curr.right) {\n curr.right = newNode;\n return this;\n }\n // traverse\n curr = curr.right;\n }\n }\n }",
"constructor(){ // Definindo construtor da classe BinaryTree\n this.root = null; // inicializa a raiz da arvore como sendo nula\n }",
"function traverseDeserialize(data) {\n if(index > data.length || data[index] === \"#\") {\n return null;\n }\n var node = new TreeNode(parseInt(data[index]));\n index++;\n node.left = traverseDeserialize(data);\n index++;\n node.right = traverseDeserialize(data);\n return node;\n }",
"function mergeSortArr(arr) {\n if (arr.length <= 1) return arr;\n let mid = Math.floor(arr.length / 2);\n let right = mergeSortArr(arr.slice(mid));\n let left = mergeSortArr(arr.slice(0, mid));\n return combineArrs(left, right);\n}",
"function reconstruct(preorder, inorder) {\n const preorderLength = preorder.length;\n const inorderLength = inorder.length;\n if (preorderLength === 0 && inorderLength === 0) {\n return null;\n }\n\n if (preorderLength === 1 && inorderLength === 1) {\n return new Node(preorder[0]);\n }\n\n const root = new Node(preorder[0]);\n const root_i = inorder.findIndex(elem => elem === root.data);\n root.left = reconstruct(preorder.slice(1, (1 + root_i)), inorder.slice(0, root_i));\n root.right = reconstruct(preorder.slice(1 + root_i), inorder.slice(root_i + 1));\n return root;\n}",
"function infixToBtree(expression)\n{\n var tokens = expression.split(/([\\d\\.]+|[\\*\\+\\-\\/\\(\\)])/).filter(notEmpty);\n var operatorStack = [];\n var lastToken = '';\n var queue = [];\n\n while (tokens.length > 0)\n {\n var currentToken = tokens.shift();\n\n if (isNumber(currentToken)) \n {\n\t queue.push(new bigdecimal.BigDecimal(currentToken));\n }\n\telse if (isUnaryOp(currentToken, lastToken))\n\t{\n\t lastToken = currentToken;\n\t //expect next token to be a number\n\t currentToken = tokens.shift();\n\t //minus is the only unary op supported for now\n\t queue.push(new bigdecimal.BigDecimal(currentToken).negate());\t\n\t}\n else if (isOperator(currentToken)) \n {\n while (getPrecedence(currentToken) <= getPrecedence(operatorStack.last) ) \n {\n\t\tvar newNode = new BinaryTree(queue.pop(), queue.pop(), operatorStack.pop()); \t\t\n\t\tqueue.push(newNode);\n }\n\n operatorStack.push(currentToken);\n\n }\n else if (currentToken == '(')\n {\n operatorStack.push(currentToken);\n }\n else if (currentToken == ')')\n {\n while (operatorStack.last != '(')\n {\n \t if (operatorStack.length == 0)\n \t return \"Error in braces count\";\n\n\t\tvar newNode = new BinaryTree(queue.pop(), queue.pop(), operatorStack.pop()); \t\t\n\t\tqueue.push(newNode);\n }\t\n operatorStack.pop();\t\t\n }\n\tlastToken = currentToken; \n } \n\n while (operatorStack.length != 0)\n {\n if (/^[\\(\\)]$/.test(operatorStack.last))\n\t\treturn \"Error in braces count\";\n \n\tvar newNode = new BinaryTree(queue.pop(), queue.pop(), operatorStack.pop()); \t\t\n\tqueue.push(newNode);\n \n }\n //return Btree root\n return queue[0];\n}",
"addLeft(data){\n\t\tlet copyRoot = this.root;\n\t\twhile (this.root.left){\n\t\t\tthis.root = this.root.left;\n\t\t}\n\n\t\tthis.root.left = new TreeNode(data, this.root);\n\t\tthis.root = copyRoot;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Helper function for getHubActors This function searches for input actor in actor dictionary declared in getHubActors actors_dic: is a actor dictionary key: is a actor key in the dictionary value: is a list of actors associated with the key actor return TRUE if it found the value in key's list. FALSE otherwise. | function mapping_actors(actors_dic, key, value) {
var actorList = actors_dic[key];
if (actorList === undefined){
return false;
}
else {
for (var i = 0; i < actorList.length; i ++){
if (actorList[i] === value){
return true;
}
}
}
return false;
} | [
"function actorExist(actor){\r\n\t\t\t\tvar e = false;\r\n\t\t\t\tfor(var i = 0; i<_actors.length; i++){ //Compruebo que no se repite el nombre y apellido.\r\n\t\t\t\t\tif(_actors[i].actor.name === actor.name && _actors[i].actor.lastname1 === actor.lastname1){\r\n\t\t\t\t\t\te = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn e;\r\n\t\t\t}",
"function searchMyActiveConversation() {\r\n\tconsole.info('Search my active conversation');\r\n\r\n\t// Keys in list\r\n let keys = Object.keys(conversationList);\r\n console.log('Keys in list object : ', keys );\r\n\t// Default conversation is empty\r\n\tlet thisConversation = {};\r\n\r\n\t// Iterate to find my 'connected' conversation\r\n\tkeys.some(function(key) {\r\n\t\tthisConversation = conversationList[key];\r\n\t\tconsole.log('Checking...: ', key, thisConversation);\r\n\t\t// Is my user connected?\r\n\t\tif( isMyUserConnected( thisConversation ) ) {\r\n \t\tconsole.log('My connected conversation...', thisConversation);\r\n\t\t\tconsole.log('Participants involved...', thisConversation.participants );\r\n\t\t\t// Is there a counterpart?\r\n\t\t\tlet ida = getAgentParticipantId(thisConversation);\r\n\t\t\tlet idc = getCustomerParticipantId(thisConversation);\r\n\t\t\tconsole.log('Id of customer and agent :', idc, ' - ', ida );\r\n\r\n\t\t if( idc !== 0 && ida !== 0) {\r\n \t\t\tconsole.log('Agent/User and Customer/External participants found!');\r\n\t\t\t \treturn (thisConversation);\r\n\t\t\t} else {\r\n\t\t\t\tconsole.log('...no counterpart');\r\n\t\t\t}\r\n }\r\n\t});\r\n\t// Return\r\n\treturn (thisConversation);\r\n}",
"function searchForActors(name) {\n\tlet possibleActors = [];\n\n\n\n\n\tconst readFolder = 'jsonData/people/';\n\n\n\tfs.readdirSync(readFolder).forEach(file => {\n\t\tlet data = fs.readFileSync(readFolder + file);\n\t\tlet actData = JSON.parse(data);\n\t\tif (file.toLowerCase().includes(name.toLowerCase())) {\n\t\t\tpossibleActors.push(actData);\n\t\t}\n\t});\n\t//console.log(possibleActors);\n\treturn possibleActors;\n}",
"getByActor(req, res) {\n \tlet id = req.params.actorId;\n \t\n this.eventDao.findByActorId(id)\n .then(this.common.findSuccess(res))\n .catch(this.common.findError(res));\n }",
"function contains(obj, search) {\r\n let value = {};\r\n for (let key of Object.keys(obj)) {\r\n value = obj[key];\r\n }\r\n if (value === search && typeof value !== \"object\") {\r\n return true;\r\n } else if (typeof value === \"object\") {\r\n return contains(value, search);\r\n }\r\n return false;\r\n}",
"function attrMatch(searchKey,Itm) {\n for(let x in searchKey)//loop through each attribute of the search object\n if(searchKey[x]!==Itm[x])// and compare them to the matching attr in the item\n return false// if even a single attribute doesn't match return false\n return true//if we reach this point after the for-in loop, we know all attributes match, so return true\n}",
"async includes (key, value) {\r\n\t\tconst obj = await this.model.findOne({ name: key });\r\n\t\tif (obj) {\r\n\t\t\treturn obj.value.includes(value);\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"function _match (key, frag) {\n\tif (frag.group_level) {\n\t\tkey = key.slice (0, parseInt (frag.group_level));\n\t}\n\n\tif (frag.keys) {\n\t\treturn _.any (frag.keys, function (k) {\n\t\t\treturn _eq (k, key);\n\t\t});\n\t}\n\n\tif (_defined (frag.key) && !_eq (frag.key, key)) return false;\n\t\n\tif (frag.descending) {\n\t\tif (_defined (frag.startkey) && frag.startkey < key) return false;\n\t\tif (_defined (frag.endkey) && frag.endkey > key) return false;\n\t} else {\n\t\tif (_defined (frag.startkey) && frag.startkey > key) return false;\n\t\tif (_defined (frag.endkey) && frag.endkey < key) return false;\n\t}\n\n\treturn true;\n}",
"function createMap(actor_list, actor, actors_map) {\n var actorListWithout = actor_list.filter(function (item) {\n return item !== actor;\n });\n if (actors_map[actor] !== undefined) {\n for (var y = 0; y < actorListWithout.length; y++) {\n if (!mapping_actors(actors_map, actor, actorListWithout[y])) {\n actors_map[actor].push(actorListWithout[y]);\n }\n }\n }\n else {\n actors_map[actor] = actorListWithout;\n }\n return {actorListWithout: actorListWithout, y: y};\n}",
"showUserLoggedConversation(){\n let loggedId = this.props.loggedUser && this.props.loggedUser.id;\n let membersId = false;\n this.props.conversation.members.forEach(msg => {\n if (msg === loggedId) {\n membersId = true;\n }\n });\n\n if(membersId){\n return this.conversationWithWho()\n }\n }",
"function movieExistsById(movieList, id){\r\n\r\n for(let i = 0; i < movieList.length; i++){\r\n if (movieList[i].id === id) {\r\n return true\r\n }\r\n }\r\n\r\n return false\r\n}",
"getActor(x, y) {\n\t\tfor(var i=0;i<this.actors.length;i++) {\n\t\t\tif(this.actors[i].x==x && this.actors[i].y==y) {\n\t\t\t\treturn this.actors[i];\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"function filterFunction(obj, key, value){\n\tif(obj[key] === value) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}",
"function isHostKey(key){\n Room.forEach(function(element){\n if(element[\"hostKey\"] === key){\n return \"host\";\n }\n else if(element[\"guestKey\"]===key){\n return \"guest\";\n }\n \n })\n return null;\n}",
"inDiscoveryAddresses(peer) {\n let str = JSON.stringify(peer);\n for(let i=0; i<this.discoveryAddresses_.length; i++) {\n if(JSON.stringify(this.discoveryAddresses_[i]) == str) {\n return true;\n }\n }\n \n return false;\n }",
"function findKey (obj, key) {\n if (has(obj, key)) return [obj]\n return flatten(\n map(obj, function (v) {\n return typeof v === 'object' ? findKey(v, key) : []\n }),\n true\n )\n}",
"function isMemberPresent(userid, channel){\n var userFound = false;\n channel.members.forEach(function(member){\n if(member.id === userid){\n userFound = true;\n }\n });\n return userFound;\n}",
"function matchAction(tokens) {\n\n\tvar action_tokens = ['login', 'logon', 'log', 'signin', 'signon', 'sign', 'connect', 'register', 'enter', 'continue'];\n\tvar action_found = new Boolean(false);\n\n\tfor ( var i = 0; i < action_tokens.length; i++ ) {\n\t\tvar match = new RegExp(action_tokens[i], 'i');\n\t\tif ( tokens.search(match) != -1 ) {\n\t\t\taction_found = new Boolean(true);\n\t\t}\n\t}\n\n\treturn action_found;\n}",
"contains(value){\n var runner = this.top;\n while(runner != null){\n if(runner.value == value){\n return true;\n }\n runner = runner.next;\n }\n return false;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
When focus is put on a date input | function eventFocusOnDate(element){
setInputFormat(element);
var popup = element.parentNode.querySelector('.popup-date-picker');
displayPopup(popup);
} | [
"function onFocusChange() {\n setFocusedInputLeftCol(focusedInputLeftCol === START_DATE ? END_DATE : START_DATE);\n }",
"function eventLostFocusOnDate(element, event){\n\tvar popup = element.parentNode.querySelector('.popup-date-picker');\n\n\tif(!event || !event.relatedTarget || (!(event.relatedTarget === popup) && !popup.contains(event.relatedTarget))){\n\t\tupdateDateRealInput(element);\n\t\tsetOutputFormat(element);\n\t\tvar popup = element.parentNode.querySelector('.popup-date-picker');\n\t\tpopup.style.display = 'none';\n\t\telement.style.borderColor = '';\n\t\telement.style.borderWidth = '';\n\t\telement.style.borderStyle = '';\n\t}\n}",
"function setDateHandlers(field){\n \n $(field).on({\n \n // On focus...\n \n 'focus': function(event){\n \n // Remove validation\n \n $(this).removeClass('invalid');\n \n // Show date picker if not shown already\n \n if(!$(this).siblings('.date-picker').is(':visible')){\n \n showDatePicker(this);\n \n }\n \n },\n \n // On defocus, validate\n \n 'blur': function(event){\n \n // If valid date, format\n \n if(isValidDate($(this).val())){\n \n let date = new Date($(this).val());\n $(this).val(zeroPad(date.getMonth() + 1, 2) + '/' + zeroPad(date.getDate(), 2) + '/' + date.getFullYear());\n \n }\n \n // Otherwise, make invalid\n \n else if($(this).val().length > 0){\n \n $(this).addClass('invalid');\n \n }\n \n },\n \n // On tab, hide date picker\n \n 'keydown': function(event){\n \n if(event.which == 9){\n \n $(this).siblings('.date-picker').hide();\n \n }\n \n },\n \n // On typing...\n \n 'keyup': function(event){\n \n // Get current cursor position\n \n let cursorPosition = this.selectionStart;\n \n // Remove non-date characters\n \n let value = $(this).val();\n $(this).val(value.replace(/[^0-9\\/]/g, ''));\n \n // If if typed character was removed, adjust cursor position\n \n let startLength = value.length;\n let endLength = $(this).val().length;\n \n if(startLength > endLength){\n \n setCursorPosition(this, cursorPosition - 1);\n \n }\n \n // If valid date, adjust date picker\n \n if(isValidDate($(this).val())){\n \n showDatePicker(this);\n \n }\n \n }\n \n });\n \n}",
"function onClickDate(ob) {\n\tvar info = checkTime(parseInt(ob.innerHTML)) + \" - \" + checkTime((parseInt(MONTH) + 1)) + \" - \" + YEAR;\n\tdocument.getElementById(\"birthday\").value = info;\n\tdocument.getElementById(\"main\").style.display = \"none\";\n}",
"function processChange(value) {\n //console.log(\"Calendar clicked\");\n //If we are working with the start input\n if(cntrl.getStartCal()) {\n cntrl.setSelectedStartDate(value); \n }\n //If we are working with the end input\n else {\n cntrl.setSelectedEndDate(value);\n }\n //Autoclose after selection\n cntrl.updateDateRange();\n }",
"function setListenersDate(element){\n\telement.addEventListener(\"focus\", function(){eventFocusOnDate(element);});\n\telement.addEventListener(\"blur\", function(event){eventLostFocusOnDate(element, event);});\n\telement.addEventListener(\"keyup\", function(){eventKeyUp(element);});\n}",
"handleStartDateBox(e) {\n this.refs.startDateBox.show();\n }",
"function runDatePickerWidget() {\n var date_input=$('input[name=\"date\"]'); //our date input has the name \"date\"\n var container=$('.bootstrap-iso form').length>0 ? $('.bootstrap-iso form').parent() : \"body\";\n var options={\n format: 'dd/mm/yyyy',\n container: container,\n todayHighlight: true,\n autoclose: true,\n clearBtn: true\n };\n date_input.datepicker(options);\n}",
"function setCurrentDateAsInput() {\r\n var date = new Date();\r\n var month = date.getMonth() + 1;\r\n var day = date.getDate();\r\n var currentDate = (day < 10 ? '0' : '') + day + '.' +\r\n (month < 10 ? '0' : '') + month + '.' +\r\n date.getFullYear();\r\n $(\"#datetime\").val(currentDate);\r\n }",
"function onDefaultDate() {\n\tvar defaultDate = checkTime(parseInt(DAY.getDate())) + \" - \" + checkTime((parseInt(MONTH) + 1)) + \" - \" + YEAR;\n\tdocument.getElementById(\"birthday\").value = defaultDate;\n}",
"function checkDateOnBlur(field,dataBaseField)\n{\t\n\t\n\t/*if (wrongDate)\t\n \t{\t\n \t\twrongDate=false;\n \t\treturn;\n \t}\n \t\t\n \tif (field.value!=\"\")\n \t{\n \t\t//se il campo comincia con il carattere . oppure - seguito da un numero\n \t\t//si aggiungere/sottrae alla dataBase il numero di giorni specificato\n \t\tif((field.value.substr(0,1)==\".\" || field.value.substr(0,1)==\"-\") \n \t\t\t && dataBaseField && isDateField(dataBaseField))\n \t\t{\n \t\t\tvar offset=parseInt(field.value.substr(1));\n \t\t\tif(!isNaN(offset))\t//se l'offset รฏยฟยฝ un numero\n \t\t\t{\n \t\t\t\tif(offset>9999)\n \t\t\t\t\toffset=9999;\n \t\t\t\tif(offset!=0)\n \t\t\t\t\toffset--;\t//in modo che la differenza fra data di partenza e quella finale coincide con l'offset\n \t\t\t\tif(field.value.substr(0,1)==\"-\")\n \t\t\t\t\toffset=-offset;\n\t \t\t\tvar d = getDateFromText(dataBaseField.value);\n\t \t\td.setDate(d.getDate()+offset);\n\t\t\t\tvar curr_date = d.getDate();\n\t\t\t\tvar curr_month = d.getMonth();\n\t\t\t\tcurr_month++;\n\t\t\t\tvar curr_year = d.getFullYear();\n\t \t\t\tfield.value=curr_date + \"/\" + curr_month + \"/\" + curr_year;\n \t\t\t}\n \t\t}\t\n \t\t\n\t \tif (!isDateField(field))\n\t \t{\n\t \t\talert(\"Data non valida\");\n\t \t\tfield.focus();\n\t \t\twrongDate=true;\n\t \t}\n\t \telse\n\t \t\twrongDate=false;\n }\n else\n wrongDate=false;\n if (wrongDate)\t\n \t{\t\n \t\twrongDate=false;\n \t\treturn;\n \t}*/\n \t\n \tif (field.getValue()!=\"\")\n \t{\n \t\t//se il campo comincia con il carattere . oppure - seguito da un numero\n \t\t//si aggiungere/sottrae alla dataBase il numero di giorni specificato\n \t\t\n \t\tif((field.getValue().substr(0,1)==\".\" || field.getValue().substr(0,1)==\"-\") \n \t\t\t && dataBaseField && isDateField(dataBaseField))\n \t\t{\n \t\t\tvar offset=parseInt(field.getValue().substr(1));\n \t\t\tif(!isNaN(offset))\t//se l'offset รฏยฟยฝ un numero\n \t\t\t{\n \t\t\t\tif(offset>9999)\n \t\t\t\t\toffset=9999;\n \t\t\t\tif(offset!=0)\n \t\t\t\t\toffset--;\t//in modo che la differenza fra data di partenza e quella finale coincide con l'offset\n \t\t\t\tif(field.getValue().substr(0,1)==\"-\")\n \t\t\t\t\toffset=-offset;\n\t \t\t\tvar d = getDateFromText(dataBaseField.getValue());\n\t \t\td.setDate(d.getDate()+offset);\n\t\t\t\tvar curr_date = d.getDate();\n\t\t\t\tvar curr_month = d.getMonth();\n\t\t\t\tcurr_month++;\n\t\t\t\tvar curr_year = d.getFullYear();\n\t \t\t\tfield.setValue(curr_date + \"/\" + curr_month + \"/\" + curr_year);\n \t\t\t}\n \t\t}\t\n \t\t\n\t \tif (!isDateField(field))\n\t \t{\n\t \t\talert(\"Data non valida\");\n\t \t\tfield.focus();\n\t \t\twrongDate=true;\n\t \t}\n\t \telse\n\t \t\twrongDate=false;\n }\n else\n wrongDate=false;\n}",
"focusInput(){\n this.amountInput.focus();\n }",
"function enableDatePicker () {\n $('input[data-field-type=date]').datepicker({\n autoclose: true, // close on loast focus\n orientation: 'top auto', // show above the fiels\n todayBtn: 'linked', // show button to return to 'today'\n todayHighlight: true, // highlight current day\n endDate: '+1y', // set max date to +1 year\n startDate: '0d', // set the minimum date to today\n maxViewMode: 'decade' // set maximum zoom out to decades view\n })\n}",
"function handleClick(){\n sanitizeDateInput();\n sanitizeDepDateInput();\n }",
"function dateInput(id) {\n\tconst input = /** @type {HTMLInputElement} */ ele(id);\n\tif (supportsNumber(input)) return input.valueAsNumber;\n\treturn parseDate(input.value);\n}",
"didFocus () {\n\n }",
"function updateChosenDate(inputDate){\n setChosenDate(inputDate);\n }",
"function updateModalDate() {\n\tvar date = document.getElementById('date');\n\tdate.value = todaysDate(activeDate);\n}",
"function getVal(e)\n{\n //lert(document.getElementById(e.id).value);\n day = document.getElementById(e.id).value;\n var date = year +\"/\"+ (currPage + 1) + \"/\" + day ;\n document.getElementById(\"fdate\").value = date;\n loadTimePicker(getTimesNotAvailableFor(date));\n\n \n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calculate the total price for a given dataset. Within each 'row' in the dataset, the 'price' attribute is denoted by 'key' variable The target currency is determined as follows: 1. Provided as options.currency 2. All rows use the same currency (defaults to this) 3. Use the result of baseCurrency function | function calculateTotalPrice(dataset, value_func, currency_func, options={}) {
var currency = options.currency;
var rates = options.rates || getCurrencyConversionRates();
if (!rates) {
console.error('Could not retrieve currency conversion information from the server');
return `<span class='icon-red fas fa-exclamation-circle' title='{% trans "Error fetching currency data" %}'></span>`;
}
if (!currency) {
// Try to determine currency from the dataset
var common_currency = true;
for (var idx = 0; idx < dataset.length; idx++) {
let row = dataset[idx];
var row_currency = currency_func(row);
if (row_currency == null) {
continue;
}
if (currency == null) {
currency = row_currency;
}
if (currency != row_currency) {
common_currency = false;
break;
}
}
// Inconsistent currencies between rows - revert to base currency
if (!common_currency) {
currency = baseCurrency();
}
}
var total = null;
for (var ii = 0; ii < dataset.length; ii++) {
let row = dataset[ii];
// Pass the row back to the decoder
var value = value_func(row);
// Ignore null values
if (value == null) {
continue;
}
// Convert to the desired currency
value = convertCurrency(
value,
currency_func(row) || baseCurrency(),
currency,
rates
);
if (value == null) {
continue;
}
// Total is null until we get a good value
if (total == null) {
total = 0;
}
total += value;
}
// Return raw total instead of formatted value
if (options.raw) {
return total;
}
return formatCurrency(total, {
currency: currency,
});
} | [
"@api\n addTotalPrice(price) {\n this.totalPrice += price;\n }",
"getCurrency() {\n const tier = this.getTier();\n return get(tier, 'currency', this.props.data.Collective.currency);\n }",
"function calculate_price(vm_type){\n\n\t\tvar ID_SELECTOR = \"#\";\n\t\tvar CURRENCY = \"CHF\";\n\t\tvar final_price_selector = ID_SELECTOR.concat(vm_type.concat('-final-price'));\n\t\tvar final_price_input_selector = final_price_selector.concat('-input');\n\t\tvar core_selector = ID_SELECTOR.concat(vm_type.concat('-cores'));\n\t\tvar memory_selector = ID_SELECTOR.concat(vm_type.concat('-memory'));\n\t\tvar disk_size_selector = ID_SELECTOR.concat(vm_type.concat('-disk_space'));\n\n\t\t//Get vm type prices\n\t\tvar cores = $(core_selector).val();\n\t\tvar memory = $(memory_selector).val();\n\t\tvar disk_size = $(disk_size_selector).val();\n\t\tvar pricingData = eval(window.VMTypesData);\n\t\tvar company_prices = _.head(_.filter(pricingData, {hosting_company: vm_type}));\n\n\t\t//Calculate final price\n\t\tvar price = company_prices.base_price;\n\t\t\tprice += company_prices.core_price*cores;\n\t\t\tprice += company_prices.memory_price*memory;\n\t\t\tprice += company_prices.disk_size_price*disk_size;\n\t\t\n\t\tconsole.log(final_price_input_selector);\n\t\t$(final_price_selector).text(price.toString().concat(CURRENCY));\n\t\t$(final_price_input_selector).attr('value', price);\n\n\t}",
"function calculateCostForDataPoints(energy_data_points) {\n var cost = 0.0;\n for (var i = 0; i < energy_data_points.length; i++) {\n var rate = getRate(i % 24);\n cost += energy_data_points[i].value * rate;\n }\n return cost;\n }",
"function totalPrice(){\n\t\t\t\tvar totalPrice = 0;\n\t\t\t\tfor (var i in cart){\n\t\t\t\t\ttotalPrice += cart[i].price;\n\t\t\t\t}\n\t\t\t\treturn totalPrice;\n\t\t\t}",
"priceCalc(){\n var that = this;\n var equipmetCost = 0;\n var tempPrice = this.phoneStorage.filter(function(el){\n if(el.storage == that.selectedStorage ){\n return el;\n }\n });\n this.selectedEquipment.forEach(function(el){\n equipmetCost += Number(el);\n });\n this.total = equipmetCost + tempPrice[0].price - this.selectedRate;\n\n }",
"function getTotalPrice() {\n var totalPrice = 0;\n _.each(createSaleCtrl.saleProducts, function(product) {\n totalPrice += product.price*createSaleCtrl.bought[product.barCode];\n });\n createSaleCtrl.totalPrice = totalPrice;\n }",
"function setPrice(){\n var basePrice = 10;\n var totalPrice = 0;\n totalPrice = basePrice + getPriceValue();\n console.log(totalPrice);\n\n // display total price in the panel price\n var total = $('.panel.price').find('strong');\n console.log(total);\n $(total).html('$' + totalPrice);\n}",
"calculateTotal() {\n this.total = [this.darts.one, this.darts.two, this.darts.three]\n .map(dart => this.getDartValueFromID(dart))\n .reduce((a, b) => a + b, 0);\n }",
"computeSellPrice (row, fieldName, currentFieldValue) {\n currentFieldValue = parseFloat(currentFieldValue);\n currentFieldValue = isNaN(currentFieldValue) ? 0 : currentFieldValue;\n\n const otherField = fieldName === 'buy_price' ? 'markup' : 'buy_price';\n let existingValueInOtherField = parseFloat(row[otherField]);\n existingValueInOtherField = isNaN(existingValueInOtherField) ? 0 : existingValueInOtherField;\n\n const sellPriceValue = this.getValueAfterMarkup(...fieldName === 'buy_price' ? ([currentFieldValue, existingValueInOtherField]) : ([existingValueInOtherField, currentFieldValue]))\n\n return +sellPriceValue.toFixed(2)\n }",
"getTotalValue() {\n var totalVal = 0.0;\n for (var i in this.state.stocks) {\n //check if not null\n if (this.state.stocks[i][\"totalValue\"]) {\n totalVal += this.state.stocks[i][\"totalValue\"];\n }\n }\n // return totalVal.toFixed(3) + \" \" + currSymbol;\n return parseFloat(totalVal).toFixed(3) + this.getCurrencySymbol();\n }",
"function totalPriceOfCart() {\n return priceArray.reduce((accumulate, currentPrice) => {\n return accumulate + currentPrice;\n }, 0);\n}",
"get price() {\n return this._price\n }",
"function calculateRows(data) {\n // find unique categories\n var categories = new Set();\n for (var _i = 0, data_1 = data; _i < data_1.length; _i++) {\n var item = data_1[_i];\n categories.add(item.category);\n }\n // sort the categories\n var sortedCategories = Array.from(categories.values()).sort();\n // for each category, group their respective items\n var displayRows = [];\n var totalPrice = 0;\n sortedCategories.map(function (category) {\n var categoryTotal = 0; // total price of all items in the category\n var rows = [];\n for (var _i = 0, data_2 = data; _i < data_2.length; _i++) {\n var item = data_2[_i];\n if (item.category === category) {\n // don't mutate original data, append $ to price\n var tempItem = __assign({}, item);\n tempItem.price = \"$\" + item.price.toString();\n rows.push(tempItem);\n categoryTotal += item.price;\n }\n }\n // add category header to the top of the rows\n rows.unshift({ name: category, price: \"$\" + categoryTotal, header: 1 });\n // add to rows to be displayed\n displayRows = displayRows.concat(rows);\n // add category total to total price\n totalPrice += categoryTotal;\n });\n // update the table with all rows\n setRows(displayRows);\n // set bottom row as total price\n setBottomRow({ name: \"TOTAL\", price: \"$\" + totalPrice, totalPrice: 1 });\n }",
"calculateTradeAmount(side, curAQuantity, usdtQuantity, price, initService){\n //Buy - we need to calculate how much token we can get for our USDT\n if(side == process.env.BUY){\n //Trade a little bit less than we currently hold to ensure valid transaction\n let amount = 1 / price * usdtQuantity * 1000 / 1001;\n\n //All binance transactions require a maximum precision level or fail\n amount = amount.toFixed(initService.precision);\n return amount;\n } else if(side == process.env.SELL){\n let amount = curAQuantity * 1000 / 1001;\n amount = amount.toFixed(initService.precision);\n return amount;\n }\n }",
"function calculateTotalCost(pricePerNight, noOfDays) {\n let obj = {}\n obj[\"cents\"] = pricePerNight * noOfDays;\n obj[\"dollars\"] = convertCentsToDollars(pricePerNight * noOfDays);\n return obj;\n}",
"getPriceMap(priceTable) {\n return priceTable.reduce((prev, curr) => {\n // eslint-disable-next-line no-shadow\n const { type, values } = curr\n const priceMap = values.reduce(\n (currMap, itemPrice) => ({\n ...currMap,\n [itemPrice.id]: itemPrice.price,\n }),\n {}\n )\n\n return { ...prev, [type]: priceMap }\n }, {})\n }",
"function findCurrencyRate (currency, data) {\nconsole.log(currency)\nlet currencyDataList = data.bpi;\nconsole.log(currencyDataList);\nreturn currencyDataList[currency].rate; \n}",
"total() {\n return Menu.getSodaPrice();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if value is primitive | function isPrimitive(value){return typeof value==='string'||typeof value==='number';} | [
"function isNonPrimitive(value) {\n return ((value !== null && typeof value === 'object') ||\n typeof value === 'function' ||\n typeof value === 'symbol');\n}",
"function convertible(value, ty) {\n if (ok(value, ty)) {\n return true;\n }\n if (isNull(value) || isUndefined(value)) {\n return false;\n }\n if (ty === tyNumber && isNaN(value)) {\n return false;\n }\n // TODO: refine\n return true;\n }",
"function isPlain(val) {\n return typeof val === 'undefined' || val === null || typeof val === 'string' || typeof val === 'boolean' || typeof val === 'number' || Array.isArray(val) || isPlainObject$1(val);\n}",
"function classify(value) {\n if (value == null) {\n return null;\n }\n else if (value instanceof HTMLElement) {\n return 'primitive';\n }\n else if (value instanceof Array) {\n return 'array';\n }\n else if (value instanceof Date) {\n return 'primitive';\n }\n else if (typeof value === 'object' && value.constructor === Object) {\n return 'object';\n }\n else if (typeof value === 'function') {\n return 'function';\n }\n else if (typeof value === 'object' && value.constructor != null) {\n return 'class-instance';\n }\n return 'primitive';\n}",
"isValue() {\n return false;\n }",
"valueMatchesType(value) {\n return typeof value === this.valueType\n }",
"function ISTEXT(value) {\n return 'string' === typeof value;\n}",
"isString() {\n return (this.type === \"string\");\n }",
"_isLiteral(tokenType) {\n return (\n tokenType === \"NUMBER\" ||\n tokenType === \"STRING\" ||\n tokenType === \"true\" ||\n tokenType === \"false\" ||\n tokenType === \"null\"\n );\n }",
"static isTyped(value) {\n return (value\n && typeof (value) === \"object\"\n && \"_typedSymbol\" in value\n && value._typedSymbol === _typedSymbol);\n }",
"function isObjectAssignable(key) {\n return typeof key === 'string' || typeof key === 'number' || typeof key === 'symbol';\n}",
"function sc_isString(s) { return (s instanceof sc_String); }",
"isText(value) {\n return isPlainObject(value) && typeof value.text === 'string';\n }",
"isBigInt() {\n return !!(this.type.match(/^u?int[0-9]+$/));\n }",
"function isObject(thing) {\n return Object.prototype.toString.call(thing) === '[object Object]';\n}",
"static bool(v) { return new Typed(_gaurd, \"bool\", !!v); }",
"function realValue(val, bool){\n var undefined;\n // only evaluate strings\n if (typeof val != 'string') return val;\n if (bool) {\n if (val === '0') {\n return false;\n }\n if (val === '1') {\n return true;\n }\n }\n if (isNumeric(val)) {\n return +val;\n }\n switch(val) {\n case 'true':\n return true;\n case 'false':\n return false;\n case 'undefined':\n return undefined;\n case 'null':\n return null;\n default:\n return val;\n }\n }",
"function object (thing) {\n return typeof thing === 'object' && thing !== null && array(thing) === false && date(thing) === false;\n }",
"castToBoolean(value) {\n if (typeof value === 'boolean') {\n return value;\n }\n if (value === 'true' || value === '=true') {\n return true;\n }\n return undefined;\n }",
"static toBoolean(value) {\n if (typeof value === \"boolean\")\n return value;\n if (typeof value === \"string\")\n return value === \"true\" || value === \"1\";\n if (typeof value === \"number\")\n return value > 0;\n return false;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Notify the event listeners the application has stopped | function notifyApplicationStopped() {
if (!_isApplicationRunning) {
return;
}
_isApplicationRunning = false;
applicationEventListeners.forEach(function (listener) {
listener('stopped');
});
} | [
"stopListening() {\n this._eventsNames.forEach((eventName) => {\n process.removeListener(eventName, this.handler);\n });\n }",
"_stopListeningForTermination() {\n this._terminationEvents.forEach((eventName) => {\n process.removeListener(eventName, this._terminate);\n });\n }",
"function stop_monitoring()\n {\n browser.idle.onStateChanged.removeListener(on_idle_state_change);\n }",
"stop(){\n\t\tvar priv = PRIVATE.get(this);\n\t\tpriv.messenger.stopListenAll();\n\t\tpriv.messenger.disconnect();\n\t\tif (typeof priv.syncCrtlQProducer !== \"undefined\")\n\t\t{\n\t\t\tpriv.syncCrtlQProducer.shutdown();\n\t\t}\n\t\t\n\t\tlogger.info(\"stopped listening to channels\");\n\t}",
"onShutdown() {\n this.particleSystems.forEach( e => e.dispose() );\n this.particleSystems.clear();\n }",
"function mapStopped(){\n\t\t\tclearInterval(service.intervalHandle);\n\n\t\t\t// TODO fire off our event?\n\t\t\t//service.bounds.extent;\n\n\t\t\tconsole.log(\"stopped\");\n\t\t}",
"function _destroyLeaveAlertListener() {\n window.removeEventListener(\"beforeunload\", _leaveAlertEvent);\n }",
"function removeListeners() {\n removeEventListener('pointerup', onPointerUp, listenerOpts);\n removeEventListener('pointercancel', onPointerCancel, listenerOpts);\n }",
"function onClosed() {\n\t// dereference the window\n\t// for multiple windows store them in an array\n\tmainWindow = null;\n}",
"function onFinalElementEvent() {\n VeAPI.Utils.Shell.info('Element stopping event triggered');\n if (!(!VeAPI.Chat.manager.isChatDelayed && !VeAPI.Chat.manager.isEnabled())) {\n VeAPI.Chat.manager.stopChatDelay();\n VeAPI.Chat.manager.disable();\n }\n }",
"stop() {\n if (!this.stopped) {\n for (let timeout of this.timeouts) {\n clearTimeout(timeout);\n }\n clearTimeout(this.mainLoopTimeout);\n this.stopped = true;\n }\n }",
"_removeUserInputListeners() {\n if (!this._resumeContextCallback) {\n return;\n }\n\n USER_INPUT_EVENTS.forEach((eventName) => {\n window.removeEventListener(eventName, this._resumeContextCallback, false);\n });\n this._resumeContextCallback = null;\n }",
"serviceStopping(service) {\n\t\tconsole.log(\"MW serviceStopping is fired\", service.name);\n\t}",
"function destroy() {\n\t\t\t// Iterate over each matching element.\n\t\t\t$el.each(function() {\n\t\t\t\t$el.removeData('breakpointEvents');\n\t\t\t});\n\t\t}",
"function watchGameAbort() {\n firebaseGame.on('child_removed', function(test) { //gets triggered for every child element\n console.log('game aborted.');\n });\n }",
"lightsOff() {\n console.log('[johnny-five] Lights are off.');\n this.lights.stop().off();\n }",
"stopAcceptingJobs() {\n this.subscriber.off('message', this.acceptJob);\n }",
"function stop() {\n\t/**\n\t * optional, e.g. for analysis:\n\t * post the String created along the lines (\"measure\", not in this file) to the server, and save as .csv file\n\t */\n\t/**if (measure != \"#Measurement, Acceleration X, Acceleration Y, Acceleration Z, Rotation Alpha, Rotation Beta, Rotation Gamma, Orientation Alpha, Orientation Beta, Orientation Gamma \\r\\n\") {\n $.ajax(\n {\n type: \"POST\",\n url: \"/sensordata\",\n dataType: \"String\",\n data: {\n sensData: measure\n },\n statusCode: {\n 200: function () {\n alert(\"Measurement saved successfully!\");\n },\n 400: function () {\n alert(\"Saving did not work.\")\n }\n }\n }\n );\n }*/\n\t//remove listeners, thus ending measurements\n\twindow.removeEventListener('devicemotion', deviceMotionHandler, false);\n\twindow.removeEventListener('deviceorientation', deviceOrientationHandler, false);\n}",
"function stopNotificationsClick() {\n console.log('Stopping notifications...');\n if (deviceCache) {\n deviceCache.removeEventListener('gattservicedisconnected',\n handleDisconnection);\n }\n\n if (tempCharacteristic) {\n tempCharacteristic.stopNotifications();\n }\n if (newCharacteristic) {\n newCharacteristic.stopNotifications();\n }\n console.log('Notifications stopped')\n stopButton.disabled = true;\n startButton.disabled = false;\n \n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Change the avatar's linear or angular velocity based on controls state (set by WSAD key presses) | function updateAvatar(){
var forward = avatar.getWorldDirection();
if (controls.fwd){
avatar.setLinearVelocity(forward.multiplyScalar(controls.speed));
} else if (controls.bwd){
avatar.setLinearVelocity(forward.multiplyScalar(-controls.speed));
} else {
var velocity = avatar.getLinearVelocity();
velocity.x=velocity.z=0;
avatar.setLinearVelocity(velocity); //stop the xz motion
}
if (controls.fly){
avatar.setLinearVelocity(new THREE.Vector3(0,controls.speed,0));
}
if (controls.left){
avatar.setAngularVelocity(new THREE.Vector3(0,controls.speed*0.1,0));
} else if (controls.right){
avatar.setAngularVelocity(new THREE.Vector3(0,-controls.speed*0.1,0));
}
if (controls.reset){
avatar.__dirtyPosition = true;
avatar.position.set(40,10,40);
}
} | [
"updateVelocity(newVelocity) {\r\n this.v = newVelocity;\r\n }",
"handleInput() {\n if (keyIsDown(LEFT_ARROW)) {\n this.vx = -PADDLE_SPEED;\n }\n else if (keyIsDown(RIGHT_ARROW)) {\n this.vx = PADDLE_SPEED;\n }\n else {\n this.vx = 0;\n }\n }",
"function setDetectorVelocityFn(scope) {\n\tdetector_velocity = scope.detector_velocity_value;\n\tif ( detector_velocity > 0 ) { \n\t\tdetector_speed = (detector_velocity/1200)*3;/** Setting the detector speed based on the slider value */\n\t}\n\telse {\n\t\tdetector_speed = 0;\n\t\tdetector_container.x = detector_container.y = 0;\n\t}\n}",
"setRobotVelocity(id, options){\n //Velocity is changed when sending a command\n /*let robot = this.robots.get(id);\n robot.velocity = options;*/\n\n if(options.x || options.x === 0)\n this.sendCommand(id, \"dx\", options.x);\n if(options.z || options.z === 0)\n this.sendCommand(id, \"dy\", options.z);\n //this.sendCommand(id, \"dz\", velocity.z);\n }",
"accelerate() {\n\t\tthis.velocity.add(this.acceleration)\n\t}",
"function updateMotion(dir) {\n switch(dir) {\n case \"N\":\n motX=0;motY=-1;\n break;\n case \"S\":\n motX=0;motY=1;\n break\n case \"E\":\n motX=1;motY=0;\n break;\n case \"W\":\n motX=-1;motY=0;\n break;\n }\n}",
"function setSourceVelocityFn(scope) {\n\tsource_velocity = scope.source_velocity_value; /** Setting the source speed based on the slider value */\n\tcircle_centre = 100; /**Resetting the circle radius while changing the slider */\n}",
"move() {\n // Derive mouse vertical direction.\n let touchYPosition = touches.length > 0 ? touches[touches.length - 1].y : this.position.y;\n let touchYDirection = touchYPosition - this.position.y;\n\n if (Math.abs(touchYDirection) <= this.height / 6) {\n this.setVelocity(createVector(0, 0));\n } else {\n this.setVelocity(createVector(0, touchYDirection < 0 ? -1 : 1));\n }\n\n // Update computer paddle position and redraw at new position.\n this._update();\n this.draw();\n }",
"function calibrateMovementEditor() {\n\tif(Input.GetKey(\"w\")){\n\t\tRotateUpDown(1.5);\n\t}\n\n\tif(Input.GetKey(\"s\")){\n\t\tRotateUpDown(-1.5);\n\t}\n\t\n\tif(Input.GetKey(\"a\")){\n\t\tRotateRightLeft(1.5);\n\t}\n\n\tif(Input.GetKey(\"d\")){\n\t\tRotateRightLeft(-1.5);\n\t}\n}",
"function updateBullets() {\n\t\tif (bullet.isActive) {\n\t\t\tbullet.vx += Math.cos(toRadians(bullet.angle)) * bullet.speed;\n\t\t\tbullet.vy += Math.sin(toRadians(bullet.angle)) * bullet.speed;\n\t\t\tbullet.x += bullet.vx;\n\t\t\tbullet.y += bullet.vy;\n\t\t}\n\t}",
"set bounceMinVelocity(value) {}",
"function updateArrow(current, heading){\r\n var angle = relativeAngle(current, heading);\r\n var flag = 0;\r\n\r\n if (Math.abs(angle) < 15) // head straight\r\n flag = 0;\r\n else if (Math.abs(angle) < 45) // slight left/right\r\n flag = 1;\r\n else if (Math.abs(angle) < 160) // left/right\r\n flag = 2;\r\n else\r\n flag = 3; // U turn\r\n\r\n if (angle < 0){ // turn left\r\n document.getElementById(\"nextAction\").innerHTML = leftAction[flag];\r\n img.setAttribute(\"src\", \"images/\" + leftArrow[flag]);\r\n }\r\n else { // turn right\r\n document.getElementById(\"nextAction\").innerHTML = rightAction[flag];\r\n img.setAttribute(\"src\", \"images/\" + rightArrow[flag]);\r\n }\r\n }",
"moveCapy() {\n this.y += this.vel;\n this.vel += CONST.GRAVITY;\n\n\n /*\n Logic to determine whether or not to reset the velocity to the terminal\n velocity. Though switch case is not necessary, it is an alternative to \n if comments, and I prefer the clarity of switch cases.\n */\n if (Math.abs(this.vel) > CONST.TERMINAL_VEL) {\n switch (this.vel > 0) {\n case true:\n this.vel = CONST.TERMINAL_VEL;\n break;\n case false:\n this.vel = CONST.TERMINAL_VEL * -1;\n break;\n }\n }\n }",
"function changeVirtualOffset(newValue, dir)\n{\n\t// change the right and left camera at the same time\n\tif (dir == 'x') {\t\n\n\t\tcameraProjection.cameraF1.setViewOffset( frame.frame_fisheye.width, frame.frame_fisheye.height, \n\t\t\t\t0, 0, newValue, frame.frame_fisheye.offset.y );\n\t\timgMaterial1.uniforms.offsetVirtual.value.x = newValue;\n\t\t\n\t\tcameraProjection.cameraF2.setViewOffset( frame.frame_fisheye.width, frame.frame_fisheye.height, \n\t\t\t\t0, 0, newValue, frame.frame_fisheye.offset.y );\n\t\timgMaterial2.uniforms.offsetVirtual.value.x = newValue;\n\t}\t\n\telse if (dir == 'y') {\n\n\t\tcameraProjection.cameraF1.setViewOffset( frame.frame_fisheye.width, frame.frame_fisheye.height, \n\t\t\t\t0, 0, frame.frame_fisheye.offset.x, newValue);\n\t\timgMaterial1.uniforms.offsetVirtual.value.y = newValue;\n\n\t\tcameraProjection.cameraF2.setViewOffset( frame.frame_fisheye.width, frame.frame_fisheye.height, \n\t\t\t\t0, 0, frame.frame_fisheye.offset.x, newValue);\n\t\timgMaterial2.uniforms.offsetVirtual.value.y = newValue;\n\t}\n\n\tcameraProjection.cameraF1.updateProjectionMatrix();\n\tcameraProjection.cameraF2.updateProjectionMatrix();\n}",
"move() {\n this.change = this.mouthGap == 0 ? -this.change : this.change;\n this.mouthGap = (this.mouthGap + this.change) % (Math.PI / 4) + Math.PI / 64;\n this.x += this.horizontalVelocity;\n this.y += this.verticalVelocity;\n }",
"function changeVirtualFocal(newValue)\n{\n\t// change the right and left camera at the same time\n\n\timgMaterial1.uniforms.focalVirtual.value.x = newValue;\n\timgMaterial1.uniforms.focalVirtual.value.y = newValue;\n\n\timgMaterial2.uniforms.focalVirtual.value.x = newValue;\n\timgMaterial2.uniforms.focalVirtual.value.y = newValue;\n\n\t// change the img plane camera projection\n\tchangeCameraProjLen(newValue, frame.frame_fisheye);\n\tobjController.controlCubeFish1.setHandlerSize (300/newValue);\n\tobjController.controlCubeFish2.setHandlerSize (300/newValue);\n}",
"function handleKeys() {\n if (currentlyPressedKeys[33]) {\n // Page Up\n pitchRate = 0.1;\n } else if (currentlyPressedKeys[34]) {\n // Page Down\n pitchRate = -0.1;\n } else {\n pitchRate = 0;\n }\n\n if (currentlyPressedKeys[37] || currentlyPressedKeys[65]) {\n // Left cursor key or A\n yawRate = 0.1;\n } else if (currentlyPressedKeys[39] || currentlyPressedKeys[68]) {\n // Right cursor key or D\n yawRate = -0.1;\n } else {\n yawRate = 0;\n }\n\n if (currentlyPressedKeys[38] || currentlyPressedKeys[87]) {\n // Up cursor key or W\n speed = 0.003;\n } else if (currentlyPressedKeys[40] || currentlyPressedKeys[83]) {\n // Down cursor key\n speed = -0.003;\n } else {\n speed = 0;\n }\n}",
"applyFriction(){\n\t\tthis.vel.x *= ((0.8 - 1) * dt) + 1;\n\t}",
"keyControl() {\n\n if (keyIsDown(this.activateKey)) {\n this.bossManipulation = true;\n } else {\n this.bossManipulation = false;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this generates an array containing a triangle that has hight h and width = (h 2 1) | function drawTriangle(h) {
var image = [];
var width = h * 2 - 1;
for (var i = 0; i < h; i++) {
image[i] = [];
var edgeIdx = (width - 1) / 2;
for (var j = 0; j < width; j++) {
if(j < edgeIdx - i || j > edgeIdx + i ) image[i].push(" ");
else image[i].push("*");
}
}
return image;
} | [
"function buildTriangle(length) {\n let triangle = '';\n let lineNumber = 1;\n for (lineNumber=1; lineNumber<=length; lineNumber++) {\n triangle = triangle + makeLine(lineNumber);\n \n }\n return triangle\n}",
"function drawSubTriangles(h, n) {\n var smallTriangle = n === 0 ? drawTriangle(h/2): drawSubTriangles(h/2, n - 1);\n\n var image = [];\n var width = h * 2 - 1;\n\n // add top triangle\n for (var i = 0; i < h/2; i++) {\n image.push([]);\n \n for (var j = 0; j < width / 4; j++) {\n image[i].push(\" \");\n }\n\n image[i] = image[i].concat(smallTriangle[i]);\n \n for (var j = 0; j < width / 4; j++) {\n image[i].push(\" \");\n }\n }\n\n //add bottom two triangles\n for (var i = h/2, j = 0; i < h; i++, j++) {\n image.push([]);\n image[i] = image[i].concat(smallTriangle[j]);\n image[i].push(\" \");\n image[i] = image[i].concat(smallTriangle[j]);\n }\n\n return image;\n }",
"function triangles(val) {\n //init string to contain character passed in while converting number data types to a string data type\n var str = \"\";\n //for loop to run until i = 7 not inclusive. 0 to 6 is 7 steps \n for (var i = 0; i < val; i++){\n // concatenate '#' to \n str += '#';\n //print str on each successive loop. Console.log must be within the loop block in order to function like this.\n console.log(str);\n }\n}",
"function triangles(number) {\n \nvar hash = '';\n // for each number below the given one run the loop\nfor (let i = 0; i < number; i++){\n // add another hash in each loop\n hash += '#';\n // print the hash var each loop\n console.log(hash);\n}\n}",
"function airetriangle(base, hauteur){\n const result = (base * hauteur) / 2;\n return result \n }",
"function triangle( a, b, c ){\n points.push( a, b, c );\n}",
"function trianglePath(triangles){\n var path = \"M \" + xScale(triangles[0].x) + \",\" + yScale(triangles[0].y);\n path += \" L \" + xScale(triangles[1].x) + \",\" + yScale(triangles[1].y);\n path += \" L \" + xScale(triangles[2].x) + \",\" + yScale(triangles[2].y) + \" Z\";\n\n return path;\n}",
"function pascalTriangle(k){\n // create a for loop: until row equals k\n // calculate current row\n // save current row\n let result = []\n for (let i = 0; i< k; i++){\n\n }\n\n\n return result\n}",
"function generateShape(int){\n var string = []\n \n for (var i = 0; i < int; i++){\n string.push('+'.repeat(int) + '\\n')\n }\n \n return string.join('').slice(0, -1)\n}",
"function eightTriangleGenerator() {\n\n // step 1\n // generate 3 three random points between 0 to 45 degree\n var pointOne = randomPointGenerator();\n var pointTwo = randomPointGenerator();\n var pointThree = randomPointGenerator();\n\n var triOne = pointOne.concat(pointTwo, pointThree);\n var triTwo = triOne.slice();\n\n // step 2\n // flip each point (x, y) to (y, x)\n for (var i = 0; i < triOne.length; i += 2) {\n triTwo = swap(triTwo, i, i + 1);\n }\n\n triTwo = triOne.concat(triTwo);\n\n // step 3\n // flip each point (x, y) to (-x, y)\n var triFour = triTwo.slice()\n for (var i = 0; i < triFour.length; i += 2) {\n triFour[i] = -triFour[i];\n }\n\n triFour = triTwo.concat(triFour);\n\n // step 3\n // flip each point (x, y) to (x, -y)\n var triEight = triFour.slice()\n for (var i = 1; i < triEight.length; i += 2) {\n triFour[i] = -triFour[i];\n }\n\n triEight = triFour.concat(triEight);\n return triEight;\n}",
"function makeCube(h, x, z) {\n return [\n { x: x - 1, y: h, z: z + 1 },\n { x: x - 1, y: 0, z: z + 1 },\n { x: x + 1, y: 0, z: z + 1 },\n { x: x + 1, y: h, z: z + 1 },\n { x: x - 1, y: h, z: z - 1 },\n { x: x - 1, y: 0, z: z - 1 },\n { x: x + 1, y: 0, z: z - 1 },\n { x: x + 1, y: h, z: z - 1 },\n ];\n }",
"function triangle(x1, y1, x2, y2, x3, y3)\n{\n $context.beginPath();\n $context.moveTo(x1,y1);\n $context.lineTo(x2,y2);\n $context.lineTo(x3,y3);\n $context.closePath();\n draw_fill();\n draw_stroke();\n}",
"function setTriangleStart() {\n startX = 50;\n startY = (corralHeight + corralDim) / 2;\n}",
"function Triangle(a, b, c){\n Shape.call(this, \"triangle\");\n this.a = a;\n this.b = b;\n this.c = c;\n}",
"function getTriangleCorners () {\n const width = triangle.width/2;\n const height = triangle.height/2;\n const cos = Math.cos(triangle.angle);\n const sin = Math.sin(triangle.angle);\n const rotatedWidth = {x: cos * width, y: sin * width};\n const rotatedHeight = {x: -sin * height, y: cos * height};\n\n triangle.middle =\n addPoints(triangle, {x: sin * height, y: -cos * height} )\n triangle.left = subPoints(triangle.middle, rotatedWidth);\n triangle.right = addPoints(triangle.middle, rotatedWidth);\n triangle.top = addPoints(triangle, rotatedHeight);\n }",
"function horizontalChart() {\r\n var row = '';\r\n for (var i = 0; i < arguments.length; i++) {\r\n for (var j = 0; j < arguments[i]; j++) {\r\n row += '*';\r\n }\r\n row += '\\n'\r\n }\r\n return row;\r\n}",
"function generatePattern(rows) {\n for (i = 1; i <= rows; i++) {\n rowArray = [];\n for (j = 1; j <= rows; j++) {\n if (j <= i) {\n rowArray.push(j);\n } else {\n rowArray.push('*');\n } \n }\n console.log(rowArray.join(''));\n }\n}",
"function getHorizontalPattern() {\n let increaseBy = 0;\n let matchingPattern = [];\n for (let i = 0; i < rowCount; i++) {\n let horizontalMatchPattern = [];\n for (let row = 0; row < rowCount; row++) {\n horizontalMatchPattern.push(row + increaseBy);\n }\n increaseBy += rowCount;\n // console.log(horizontalMatchPattern);\n matchingPattern.push(horizontalMatchPattern)\n }\n // console.log(matchingPattern);\n return matchingPattern;\n }",
"function triangulate(points){\n\tconst delaunay = Delaunator.from(points);\n\tconst tri = delaunay.triangles;\n\tvar triangles = []\n\tfor(var i=0;i<tri.length;i+=3){\n\t\ttriangles.push([tri[i], tri[i+1], tri[i+2]]);\n\t}\n\treturn(triangles);\n}",
"function genpoly()\n\t\t{\n\t\t\tfind_coordinates(420,0,820,230,numberOfDivsion,1); \n\t\t\t//console.log(\"****************\");\n\t\t\tfind_coordinates(0,230,420,460,numberOfDivsion,0);\n\t\t\tdraw_polygon(m_context);\n\t\t\t//render(mycanvas_context);\n\t\t\tpush_into_stack();\n\t\t\tempty();\n\t\t\t//console.log(\"****************\");\n\t\t\tfind_coordinates(420,460,820,230,numberOfDivsion2,1); \n\t\t\t//console.log(\"****************\");\n\t\t\tfind_coordinates(0,230,420,0,numberOfDivsion2,0);\t\t\n\t\t\tdraw_polygon(m_context);\n\t\t\t//mycanvas_context.drawImage(m_canvas, 0, 0);\n\t\t\tpoint_store();\n \t\t\t//draw_triangles(m_context);\n\n \t\t\tvar triangle_upper_left_colour = $(data).find('triangle_upper_left_colour').text();\n \t\t\tdraw_triangles(m_context,triangle_upper_left_colour,0,0,100,0,0,100);\n\n \t\t\tvar triangle_lower_left_colour = $(data).find('triangle_lower_left_colour').text();\t\n \t\t\tdraw_triangles(m_context,triangle_lower_left_colour,0,460,90,460,0,370); \t\n\n \t\t\tvar triangle_lower_right_colour = $(data).find('triangle_lower_right_colour').text();\t\n \t\t\tdraw_triangles(m_context,triangle_lower_right_colour,820,460,720,460,820,370); \n\n \t\t\tvar triangle_upper_right_colour = $(data).find('triangle_upper_right_colour').text();\n \t\t\tdraw_triangles(m_context,triangle_upper_right_colour,820,0,730,0,820,90); \t\t\t \t\t\t\t\t\n\n\t\t\trender_user_interface();\n\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FUNKCJA SORTOWANIA PO ZBIORACH | function sortujzbiory(){
$orderzbiory = "nr,dzien,miesiac,rok,10,20,30,40,50,60,70,80,1,11,21,31,41,51,61,71,2,12,22,32,42,52,62,72,3,13,23,33,43,53,63,73,4,14,24,34,44,54,64,74,5,15,25,35,45,55,65,75,6,16,26,36,46,56,66,76,7,17,27,37,47,57,67,77,8,18,28,38,48,58,68,78,9,19,29,39,49,59,69,79";
$orderzbiory = $orderzbiory.split(",");
$('table').dragtable('order', $orderzbiory);
kolorujzbiory8();
} | [
"function sortResults() {\n let perDesc = (a, b) => a[0] - b[0]\n let perAsc = (a, b) => b[0] - a[0]\n let indDesc = (a, b) => (a[1] + a[2]) - (b[1] + b[2])\n let indAsc = (a, b) => (b[1] + b[2]) - (a[1] + a[2])\n switch (sortBy.value) {\n case \"0\":\n result.sort(perDesc)\n break;\n case \"1\":\n result.sort(perAsc)\n break;\n case \"2\":\n result.sort(indDesc)\n break;\n case \"3\":\n result.sort(indAsc)\n break;\n }\n\n\n\n}",
"function sortByNameHandler(){\n // table.classList.remove('data');\n // take isolated copy keep the refernce safe\n let sortedByName = myData.slice();\n sortedByName.sort(function(a , b){\n //make case insensitive compare\n if(a.name.toUpperCase() < b.name.toUpperCase()){\n return -1;\n }else{\n return 1;\n }\n \n });\n display.innerHTML = ``;\n\n\n for (let index = 0; index < sortedByName.length; index++) {\n // '+=' : means adding extra elements , while '=': means replace\n display.innerHTML +=`<tr>\n <td>${index+1}</td>\n <td>${sortedByName[index].name}</td>\n <td>${sortedByName[index].type}</td>\n <td>${sortedByName[index].rank}</td>\n </tr>\n `;\n }\n console.table(sortedByName);\n }",
"function sortTable() {\n\t\t\t\t\tsortedBy = $(\"#projects-sort :selected\").text();\n\t\t\t\t\tsortedById = parseInt($(\"#projects-sort\").val());\n\t\t\t\t\tdataTable.order([ [ sortedById, sortOrder ] ]).draw();\n\t\t\t\t}",
"sortAttack(items) {\n\n items.sort(function(a, b){\n\n if(a.atck < b.atck){ \n \n return -1;\n }\n if(a.atck > b.atck) {\n \n return 1;\n }\n return 0;\n })\n \n return items;\n \n }",
"function sortByRankHandler(){\n // table.classList.remove('data');\n\n // take isolated copy keep the refernce safe\n let sortedByRank = myData.slice();\n sortedByRank.sort(function(a , b){\n return a.rank - b.rank;\n \n \n });\n display.innerHTML = ``;\n\n\n for (let index = 0; index < sortedByRank.length; index++) {\n // '+=' : means adding extra elements , while '=': means replace\n display.innerHTML +=`<tr>\n <td>${index+1}</td>\n <td>${sortedByRank[index].name}</td>\n <td>${sortedByRank[index].type}</td>\n <td>${sortedByRank[index].rank}</td>\n </tr>\n `;\n }\n console.table(sortedByRank);\n }",
"getData () {\n return this._data.sort((a, b) => b[this._sortColumn] - a[this._sortColumn])\n }",
"function sortDescTable(n) {\n\n\t//if the column to sort is the first one (the \"modifier\" button) : we don't do anything\n\tif (n == 0)\n\t\treturn;\n\n\t//get the ref to the HTML table to order\n\tvar table = document.getElementById(\"ticket-table\");\n\n\t//Get all the sortable rows then put them in an Array\n\tlet sortableRows = getTableStructure();\n\tlet tableRows = Array.from(sortableRows);\n\n\t//Insertion sort algorithm\n\tfor (let i = 1; i < tableRows.length; i++) {\n\n\t\tlet x = tableRows[i];\n\t\tlet tbody1 = tableRows[i][1][1];\n\t\tlet row1 = tbody1.firstElementChild;\n\n\t\tlet j = i;\n\n\t\tlet prevVal = row1.cells[n];\n\n\t\twhile (j > 0 && (prevVal.innerText.toLowerCase() > tableRows[j - 1][1][1].firstElementChild.cells[n].innerText.toLowerCase())) {\n\n\t\t\ttableRows[j] = tableRows[j - 1];\n\t\t\tj--;\n\n\t\t}\n\n\t\ttableRows[j] = x;\n\t}\n\n\t//reorder table according to the sorted array\n\tfor (let i = 1; i < tableRows.length; i++) {\n\n\t\t//As the element are already in the table, it will only move them (not append them again)\n\t\ttable.appendChild(tableRows[i][1][1]);\n\n\t}\n\n}",
"sortMarkUsers(users)\n {\n return users.sort((a, b) => b.final_mark - a.final_mark);\n }",
"sortCourses() {\n this.courses = Object.entries(this.props.getCoursesList());\n this.courses.sort(([A, valA], [B, valB]) => (valA.code < valB.code ? -1 : 1));\n }",
"function sortNotes(){\n notesList.sort(function(a,b)\n {\n if(a.date < b.date)\n return 1;\n if(a.date > b.date)\n return -1;\n if(a.date == b.date)\n {\n if(a.id < b.id)\n return 1;\n if(a.id > b.id)\n return -1;\n }\n return 0;\n })\n console.log(\"posortowane\");\n}",
"function sortPageObjArrayByButtonOrder (a, b)\n{\n\tvar agBOrder = a.pageObjArray[a.pageList[1]][gBUTTON_ORDER];\n\tvar bgBOrder = b.pageObjArray[b.pageList[1]][gBUTTON_ORDER];\n\tif (agBOrder == bgBOrder)\n\t\treturn 0;\n\telse if (bgBOrder < 0)\n\t\treturn -1;\n\telse if (agBOrder < 0)\n\t\treturn 1;\n\t\n\treturn (agBOrder - bgBOrder);\n}",
"sortBaseHp(items) {\n\n items.sort(function(a, b){\n\n if(a.hp < b.hp){ \n \n return -1;\n }\n if(a.hp > b.hp) {\n \n return 1;\n }\n return 0;\n })\n \n return items;\n \n }",
"function sortCreditUS(col){ \n CCT.index.sortCreditUS(col,gUSCreditEmailUpdated,gUSCreditAmountUpdated,gUSCreditNotesUpdated,sortCreditUSCallBack);\n\n document.getElementById(\"mCreditUSTableDiv\").style.display = 'none';\n errorMessage(\"Sorting ...\",\"CreditUS\",\"Message\");\n document.mForm.mCreditButton.disabled = true; \n }",
"function sortByDistance(jobs){\n \tjobs.sort(function(a,b){\n\t\t\t if(a.distance > b.distance){ return 1}\n\t\t if(a.distance < b.distance){ return -1}\n\t return 0;\n\t\t\t});\n\t\t\treturn jobs;\n\t}",
"function sortCreditCA(col){ \n CCT.index.sortCreditCA(col,gCACreditEmailUpdated,gCACreditAmountUpdated,gCACreditNotesUpdated,sortCreditCACallBack);\n\n document.getElementById(\"mCreditCATableDiv\").style.display = 'none';\n errorMessage(\"Sorting ...\",\"CreditCA\",\"Message\");\n document.mForm.mCreditButton.disabled = true; \n }",
"function docEdits_sortWeights()\n{\n //var msg=\"presort -------------\\n\";\n //for (i=0; i<docEdits.editList.length; i++) {\n // msg += i+\":\" +docEdits.editList[i].weight+\"=\"+docEdits.editList[i].text+\"\\n\";\n //}\n //alert(msg);\n\n //shift-sort algorithm. Keeps same-weight chunks together\n for (var i=0; i < docEdits.editList.length-1; i++)\n {\n for (var j=i+1; j < docEdits.editList.length; j++)\n {\n var aType = docEdits.editList[i].weightType;\n var bType = docEdits.editList[j].weightType;\n\n var a = docEdits.editList[i].weightNum;\n var b = docEdits.editList[j].weightNum;\n\n if ((aType == bType && a != null && b != null && a > b)\n || (aType == \"belowHTML\" && bType==\"aboveHTML\"))\n {\n var temp = docEdits.editList[j];\n for (var k=j; k>i; k--)\n {\n docEdits.editList[k] = docEdits.editList[k-1];\n }\n docEdits.editList[i] = temp;\n }\n }\n }\n\n //var msg=\"After pre sort:\\n\";\n //for (i=0; i<docEdits.editList.length; i++) {\n // msg += i+\":\" +docEdits.editList[i].weight+\"=\"+docEdits.editList[i].text+\"\\n\";\n //}\n //alert(msg);\n}",
"function orderRanking(orderBy) {\n var table = document.getElementById('rankingTable');\n var tableBody = table.tBodies[1];\n var rows = Array.prototype.slice.call(tableBody.rows, 0);\n rows = rows.sort(function(a, b) {\n var townA = a.cells[3].textContent, tasksA = parseInt(a.cells[4].textContent), achievementsA = parseInt(a.cells[5].textContent);\n var townB = b.cells[3].textContent, tasksB = parseInt(b.cells[4].textContent), achievementsB = parseInt(b.cells[5].textContent);\n switch (orderBy) {\n // You expected this to be a standard operator < ? Well - no. It is designed after the C-style qsort() function,\n // which requires an integer result: less than 0 for \"less\", 0 for \"equal\", and greater-than 0 for \"greater\".\n case 'town':\n return townA != townB ? (townA < townB ? -1 : +1) : (tasksA != tasksB ? tasksA - tasksB : achievementsA - achievementsB);\n case 'achievements':\n return achievementsA != achievementsB ? achievementsA - achievementsB : (tasksA != tasksB ? tasksA - tasksB : (townA < townB ? -1 : +1));\n default:\n return tasksA != tasksB ? tasksA - tasksB : (achievementsA != achievementsB ? achievementsA - achievementsB : (townA < townB ? -1 : +1));\n }\n });\n rows.reverse();\n for (var i = 0; i < rows.length; i++) {\n rows[i].cells[0].textContent = i + 1;\n tableBody.appendChild(rows[i]);\n }\n}",
"function buildSortingSublist(options){\n\t \n\t var $ = NS.jQuery;\n\t //get the column header and remove event default ns clicks events\n\t var columns = $('tr' +dicUtilConfig.PRE_MB_CF.MAIL_GRID.ClientTableHeaderId).children();\n\n\t var queryString = window.location.search.substring(1, window.location.search.length);\n\t var objQuery = dicUtilUrl.parseQueryString(queryString);\n\t\n\t var oldOb = objQuery[\"ob\"];\n\t if (oldOb){\n\t\t oldOb = oldOb.split(\" \");\n\t }\n\t dicUtilObj.deleteProperties(objQuery, [\"ob\"]);\n\t var columnSorted = dicUtilObj.toSortArray(dicUtilConfig.MAILBOX.CUSTOM_FIELDS.MAIL_GRID.Columns, function(obj1, obj2){\n\t\t\treturn obj1[obj1.key].Order - obj2[obj2.key].Order; \n\t\t});\n\t\n\t //remove event click\n\t columns.each(function(){\n\t\t var objCol = $(this);\n\t\t objCol.css('cursor', 'pointer');\n\t\t objCol.removeAttr(\"onclick\");\n\t\t var spans = objCol.find(\"div>span\");\n\t\t var span = $(spans[0]);\n\t\t if (spans.length > 0){\n\t\t\t var num = parseInt(span.attr(\"id\").replace(dicUtilConfig.MAILBOX.CUSTOM_FIELDS.MAIL_GRID.Id + \"dir\", \"\"));\n\t\t\t if(num >=0 && num < columnSorted.length){\n\t\t\t\t var configColumn = columnSorted[num];\n\t\t\t\t configColumn = configColumn[configColumn.key];\n\t\t\t\t \n\t\t\t\t if(\"Field\" in configColumn){\n\t\t\t\t\t buildSortingColumn({objQuery:objQuery,\n\t \t\t\t\t\t configColumn:configColumn,\n\t \t\t\t\t\t mailboxType:options.mailboxType,\n\t \t\t\t\t\t oldOb: oldOb,\n\t \t\t\t\t\t objCol:objCol,\n\t \t\t\t\t\t spanDirection: span});\n\t\t\t\t\t \n\t\t\t\t }\n\t\t\t }\n\t\t }\n\t\t \n\t });\n }",
"function sortColumns (columns) {\n function sortFunction (a, b) {\n return (a.useCount < b.useCount) - (a.useCount > b.useCount)\n }\n\n columns.sort(sortFunction)\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Helper function to get the currently set levels in a stat. | function levels(stat) {
return parseInt(document.getElementById(stat + "_levels").value);
} | [
"function calculate_levels(stats) {\n\tvar total_levels = 1;\n\tfor (var stat in base_stats) {\n\t\tvar s_levels = levels(stat);\n\t\tstats[stat] += s_levels;\n\t\ttotal_levels += s_levels;\n\t}\n\tstats[\"level\"] = total_levels;\n}",
"function getLevels() {\n const id = { id: $stateParams.artpackId };\n return artAPIService.artpacklevel.get(id).$promise.then((data) => {\n ctrl.levels = data.level_set;\n // console.log('data: ', data);\n });\n }",
"function getLevel(points, callback) {\n gameDb.find('config', 'game', function(err, doc){\n var levels = doc.game_levels;\n for (var i in levels) {\n //check is above lower lower limit\n if(points >= levels[i].points_needed) {\n //check if there are any more levels\n if (i != Object.keys(levels).length -1) {\n //check if we are below the next lower limit\n if (points < levels[parseInt(i) + 1].points_needed) callback({level:i,level_data:levels[i]});\n } else {\n callback({level:i,level_data:levels[i]});\n }\n }\n }\n });\n }",
"updateLevel() {\n this.level = this.computeLevel()\n this.maxEnergy = calcMaxEnergy(this.level)\n this.maxBelly = calcBellyCap(this.getBellyFactor())\n\n // check to see if any stats are unlocked\n if (this.getStat(STATS.LEG) < 1 && this.level >= LEG_UNLOCK_LEVEL) {\n this.setStat(STATS.LEG, 1)\n this.onStatUnlocked(this, STATS.LEG)\n }\n if (this.getStat(STATS.ARM) < 1 && this.level >= ARM_UNLOCK_LEVEL) {\n this.setStat(STATS.ARM, 1)\n this.onStatUnlocked(this, STATS.ARM)\n }\n if (this.getStat(STATS.HAIR) < 1 && this.level >= HAIR_UNLOCK_LEVEL) {\n this.setStat(STATS.HAIR, 1)\n this.onStatUnlocked(this, STATS.HAIR)\n }\n if (this.getStat(STATS.DOG) < 1 && this.level >= DOG_UNLOCK_LEVEL) {\n this.setStat(STATS.DOG, 1)\n this.onStatUnlocked(this, STATS.DOG)\n }\n }",
"function setCurrLevel(btn) {\n if (btn.innerText === 'Easy') {\n gCurrLevel = 0;\n } else if (btn.innerText === 'Medium') {\n gCurrLevel = 1;\n } else if (btn.innerText === 'Hard') {\n gCurrLevel = 2;\n // CR: Unnecessary else statement.\n } else gCurrLevel;\n return gCurrLevel;\n}",
"function calcStatGain(level){\n if(level > 0 && level == 1){\n return 0;\n }else if(level <= 100){\n return 3 + Math.floor((level-1)/5);\n }else if(level <= 150){\n return 23 + Math.floor((level-101)/10);\n }else if(level <= 175){\n return 28 + Math.floor((level-151)/7);\n }else if(level == 176){\n return 17;\n }else if(level <= 185){\n return 30 + Math.floor((level-175)/5);\n }\n}",
"getBase(statEnum){\n verifyType(statEnum, TYPES.number);\n return this.stats.get(statEnum).getBase();\n }",
"function getAltitudeLevels(options) {\n var levels = []\n var price_cursor = options.max\n var cur_len = options.cur_len\n var drop_float = options.drop_float\n var dyn_drop = options.dyn_drop\n var impatience = options.impatience\n var dyn_multi = options.dyn_multi\n var alt_start = Date.now()\n\n if (drop_float) {\n do {\n price_cursor = price_cursor / (1 + (\n dyn_drop ? (dyn_multi ? (\n drop_float * (cur_len + levels.length)\n ) : (\n common.fibonacci(cur_len + levels.length) * drop_float\n )\n ) : drop_float))\n levels.push(price_cursor)\n } while (price_cursor > options.min)\n }\n //LOG(\"getAltitudeLevels | levels:\", levels, dyn_drop)\n perf_timers.alt_levels += (Date.now() - alt_start)\n return levels\n }",
"function getLevel(exp) {\r\n\tif(exp == 0)\r\n\t\treturn 0;\r\n\treturn Math.floor(Math.log(exp));\r\n}",
"function parseLevel(num) {\n // check if that level exists\n if (num > levels.length) {\n throw Error(\"Invalid level.\");\n }\n return parseConfig(levels[num]);\n}",
"function get_skill_level(skill)\n{\n if (skill.firstChild.firstChild.firstChild.firstChild.childNodes[2].firstChild.childNodes.length == 1){\n return 0; // skill is still locked so I am on level 0\n }\n return skill.firstChild.firstChild.firstChild.firstChild.childNodes[2].firstChild.childNodes[1].innerHTML;\n}",
"function getLevels(callback)\n{\n xmlhttp = new XMLHttpRequest();\n xmlhttp.open(\"GET\", \"populateLevels.php?q=\" , true);\n xmlhttp.onreadystatechange = function () {\n if (this.readyState == 4 && this.status == 200) {\n // defensive check\n if (typeof callback === \"function\") {\n // apply() sets the meaning of \"this\" in the callback\n callback.apply(xmlhttp);\n }\n }\n };\n xmlhttp.send();\n}",
"getGameLevel() {\n return this.#gameLevel\n }",
"function calculateNumColors(level) {\n return level * 3;\n}",
"getMaxLevel(capLevelIndex) {\r\n let result = 0,\r\n i,\r\n level,\r\n mWidth = this.mediaWidth,\r\n mHeight = this.mediaHeight,\r\n lWidth = 0,\r\n lHeight = 0;\r\n\r\n for (i = 0; i <= capLevelIndex; i++) {\r\n level = this.levels[i];\r\n if (this.isLevelRestricted(i)) {\r\n break;\r\n }\r\n result = i;\r\n lWidth = level.width;\r\n lHeight = level.height;\r\n if (mWidth <= lWidth || mHeight <= lHeight) {\r\n break;\r\n }\r\n }\r\n return result;\r\n }",
"function showLevels() {\n nodes.forEach(node => {\n node.color = Colorlvl[node.lvl - 1];\n });\n recharge();\n}",
"function fillStatPointsArray(){\n stat_points_per_level.push(0);\n for(var i=1;i<185;i++){\n stat_points_per_level.push(stat_points_per_level[i-1]+calcStatGain(i+1));\n }\n}",
"_getPermissionIcon(level) {\n const icons = {\n 0: '<i class=\"far fa-circle\"></i>',\n 2: '<i class=\"fas fa-eye\"></i>',\n 3: '<i class=\"fas fa-check\"></i>'\n };\n return icons[level];\n }",
"formatLevel(leveledScore) {\n return leveledScore.level;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function for setting sports table in about section | function setSportsTable(response){
var b=response.sports;
if(response.sports==null||response.sports==undefined||!response.hasOwnProperty('sports'))
{
$(".table-sports").append('Nothing to show');
}
else
{
for(i in b)
{
$(".table-sports").append('<tr><td class="table-bi" >'+b[i].name+"</td></tr>");
}
}
} | [
"function createTab(battingTeam, bowlingTeam) {\n // Batting info table\n let tabContent = `\n <table class=\"table\" border=\"1\">\n <tr class=\"table-secondary\">\n <th>Batter</th>\n <th>R</th>\n <th>B</th>\n <th>4/6</th>\n </tr>`;\n battingTeam.players.forEach((player) => {\n tabContent += `\n <tr id=\"${player.name}-bat\">\n <td>${player.name}</td>\n <td>0</td>\n <td>0</td>\n <td>0</td>\n </tr>`;\n });\n\n // Bowling info table\n tabContent += `</table>\n <br>\n <table class=\"table\" border=\"1\">\n <tr class=\"table-secondary\">\n <th>Bowler</th>\n <th>O</th>\n <th>R</th>\n <th>W</th>\n </tr>`;\n bowlingTeam.players.forEach((player) => {\n tabContent += `\n <tr id=\"${player.name}-bowl\">\n <td>${player.name}</td>\n <td>0</td>\n <td>0</td>\n <td>0</td>\n </tr>`;\n });\n\n // Scorecard summary\n tabContent += `</table>\n <p class=\"alert alert-warning p-1 text-center fw-bolder\">Total: \n <span id=\"${battingTeam.id}-total\" class=\"text-primary\">0</span>\n / <span id=\"${battingTeam.id}-wickets\" class=\"text-danger\">0</span>\n Overs: <span id=\"${battingTeam.id}-overs\" class=\"text-success\">0.0</span> (${match.totalOvers})\n </p>`;\n\n return tabContent;\n}",
"function initTable(num){\n\n // Filter dataset by OTU id\n var filteredDate=dataset.metadata.filter(sample=>sample.id.toString()===num.toString())[0];\n\n\n // Create an list to store demographic information\n var valueList=Object.values(filteredDate);\n var valueKey=Object.keys(filteredDate);\n var demoInfo=[]\n for (var i=0;i<valueKey.length;i++){\n var element=`${valueKey[i]}: ${valueList[i]}`\n demoInfo.push(element);\n };\n\n // Add Demographic Information table in HTML\n var panel=d3.select(\"#sample-metadata\")\n var panelBody=panel.selectAll(\"p\")\n .data(demoInfo)\n .enter()\n .append(\"p\")\n .text(function(data){\n var number=data.split(\",\");\n return number;\n });\n \n }",
"function updateTShirtInfo () {\n \n const designSelect = document.querySelector (\"#design\");\n \n // If there's a theme selected, display and update the color section\n // and display the correct color choices\n \n if (designSelect.value != \"Select Theme\") {\n const heartColors = [\"tomato\", \"steelblue\", \"dimgrey\"];\n const punColors = [\"cornflowerblue\", \"darkslategrey\", \"gold\"];\n const colorList = designSelect.value === \"js puns\"?punColors:heartColors; // select the correct color list\n const colors = document.querySelectorAll (\"#color option\"); // the colors in the color select element\n const colorSelect = document.querySelector (\"#color\"); // the color select element\n\n // display the color section\n\n document.querySelector (\"#colors-js-puns\").style.display = \"\";\n\n // display the appropriate colors\n\n for (let i = 0; i < colors.length; i++) {\n colors[i].style.display = \"none\"; // hide by default\n for (let j = 0; j < colorList.length; j++) {\n if (colors[i].value === colorList[j]) {\n colors[i].style.display = \"\"; // display this color\n colorSelect.value = colors[i].value; // select this color\n break; // no need to check any others\n }\n\n }\n }\n } else { // no theme selected, hide the color section\n document.querySelector (\"#colors-js-puns\").style.display = \"none\";\n }\n }",
"function displayTable() {\r\n displayOnly(\"#tableOfContents\");\r\n traverseAndUpdateTableHelper();\r\n prepareText(heirarchy.tree[0].sections[0].id);\r\n activePart = 0;\r\n iconEventListeners();\r\n settingsEventListeners();\r\n scrollEventListener();\r\n}",
"function populateLeaderboardTable() {\n\t// Ordeno el json dependiendo del score y los partidos ganados, perdidos o empatados\n\tleaderboardJson = leaderboardSorted(leaderboardJson);\n\t// imprimo las 5 primeras posiciones\n\tleaderboardTable.innerHTML = \"\";\n\tleaderboardJson.slice(0, 5).forEach(player => {\n\t\tleaderboardTable.innerHTML += \"<tr><th>\" + player.playerName + \"</th><td>\" + player.score + \"</td><td>\" +\n\t\t\tplayer.won + \"</td><td>\" + player.lost + \"</td><td>\" + player.tied + \"</td></tr>\"\n\t});\n}",
"function addTableTitle(tableNum, colSpan, innerText) {\r\n var table = document.getElementsByClassName(\"datadisplaytable\")[tableNum];\r\n\r\n var headRow = document.createElement(\"tr\");\r\n var headCell = document.createElement(\"td\");\r\n headCell.classList.add(\"tablehead\");\r\n headCell.colSpan = colSpan;\r\n headCell.innerHTML = innerText;\r\n headRow.appendChild(headCell);\r\n table.getElementsByTagName(\"tbody\")[0].insertBefore(headRow, table.getElementsByTagName(\"tr\")[0]);\r\n}",
"function renderTableTitle(){\n let title = document.getElementById('medium');\n title.innerHTML = state.medium.toUpperCase();\n}",
"function animalActors() {\n let sec = jsgui.section();\n let animalsOnScreen = [\n [\"Name\", \"Type\", \"Breed\", \"Film/Show\"],\n [\"Rin Tin Tin\", \"Dog\", \"German Shepherd\", \"Various\"],\n [\"Lassie\", \"Dog\", \"Collie\", \"Lassie\"],\n [\"Mrs. Norris\", \"Cat\", \"Maine Coon\", \"Harry Potter\"],\n [\"Flipper\", \"Dolphin\", \"Bottlenose\", \"Flipper\"]\n ];\n let table = jsgui.table(animalsOnScreen.slice(1), animalsOnScreen[0]);\n jsgui.append(sec,\n jsgui.h2(\"Animals on the Screen\"),\n table,\n jsgui.hr());\n return sec;\n}",
"function loadStatsPage() {\r\n\tvar table = document.getElementById(\"stats_table\");//Retrieve our table element\r\n\tvar row_counter;//Keeps track of our row index\r\n\tvar homeScore; //Keeps track of our home score\r\n\tvar opponentScore; //Keeps track of our opponent score\r\n\tvar cuBoulder = \"CU Boulder\"; //our home team name\r\n\tvar opponentTeam; //Keeps track of our opponent team name\r\n\tvar winsCount = 0; //Keeps track of our total wins\r\n\tvar lossesCount = 0 //Keeps track of our total Losses \r\n\tvar wins = document.getElementById(\"wins\"); //our total wins cell \r\n\tvar losses = document.getElementById(\"losses\"); //our total losses cell \r\n\r\n\tconsole.log(wins);\r\n\t\tfor(row_counter = 2; row_counter < table.rows.length; row_counter++){ // Looping through the rows\r\n\t\t\thomeScore = parseInt(table.rows[row_counter].cells[2].innerHTML) // assigning homeScore to the value in the cell\r\n\t\t\topponentScore = parseInt(table.rows[row_counter].cells[3].innerHTML) // assigning opponentScore to the value in the cell\r\n\t\t\topponentTeam = String(table.rows[row_counter].cells[1].innerHTML) // assigning opponentTeam name to the value in the cell\r\n\t\t\t\r\n\t\t\tif (homeScore > opponentScore) {\r\n\t\t\t\ttable.rows[row_counter].cells[4].innerHTML = cuBoulder;//Update the actual html of the with CU Boulder\r\n\t\t\t\twinsCount++;\r\n\t\t\t} else if (homeScore < opponentScore) {\r\n\t\t\t\ttable.rows[row_counter].cells[4].innerHTML = opponentTeam;//Update the actual html of the cell with opponent team\r\n\t\t\t\tlossesCount++;\r\n\t\t\t} else {\r\n\t\t\t\ttable.rows[row_counter].cells[4].innerHTML = \"Tie\"; //updating the html of the cell as a tie.\r\n\t\t\t}\r\n\t\t}\r\n\twins.innerHTML = winsCount;\t// Setting the wins in the bottom table\r\n\tlosses.innerHTML = lossesCount;\t // Setting the losses in the bottom table\r\n}",
"function ScoreTable() {\n this.player1 = joueur1;\n this.player2 = joueur2;\n\n var tableau = document.createElement(\"table\");\n tableau.setAttribute(\"class\",\"score\");\n tableau.setAttribute(\"id\",\"score\");\n\n var tmp_tr = document.createElement(\"tr\");\n tmp_tr.appendChild(document.createElement(\"th\"));\n tmp_tr.childNodes[0].innerText = \"SCORES\";\n tmp_tr.childNodes[0].setAttribute(\"colspan\",\"2\");\n tableau.appendChild(tmp_tr);\n\n tmp_tr = document.createElement(\"tr\");\n tmp_tr.appendChild(document.createElement(\"th\"));\n tmp_tr.appendChild(document.createElement(\"td\"));\n tmp_tr.childNodes[0].innerText = joueur1.name;\n tmp_tr.childNodes[1].innerText = joueur1.score;\n tableau.appendChild(tmp_tr);\n\n tmp_tr = document.createElement(\"tr\");\n tmp_tr.appendChild(document.createElement(\"th\"));\n tmp_tr.appendChild(document.createElement(\"td\"));\n tmp_tr.childNodes[0].innerText = joueur2.name;\n tmp_tr.childNodes[1].innerText = joueur2.score;\n tableau.appendChild(tmp_tr);\n\n document.getElementById(\"sideinfos\").appendChild(tableau);\n}",
"function redrawEpisodesTbl(tbl, episodes) {\n // dont redraw a table that does not exists\n if (episodesTbl == null)\n return;\n // the table exists\n $(\"#adminEpisodePH .header\").html(\"\");\n drawEpisodesHeader();\n\n episodesTbl.clear();\n for (var i = 0; i < episodes.length; i++) {\n episodesTbl.row.add({\n Episode_num: episodes[i].Episode_num,\n Episode_name: episodes[i].Episode_name,\n RuppinPopularity: episodes[i].RuppinPopularity,\n Date: episodes[i].Date,\n Img: episodes[i].Img\n });\n }\n episodesTbl.draw();\n}",
"function UpdatePopulation(planet, table){\n for(var peoplename in planet.population){\n var people = planet.population[peoplename];\n var peoplerow = $(table).find('.' + peoplename);\n if(people.amount > 0 || people.discovered == 1){\n var tableRowExists = 0;\n \n if(peoplerow.length != 0){\n tableRowExists = 1;\n peoplerow.find('td').eq(1).text(people.amount);\n }\n \n if(!tableRowExists){\n $(table).find('tbody:last').append('<tr class=\"' + peoplename\n + '\"><td>' + people.name + '</td><td>' + people.amount + '</td></tr>');\n }\n }\n }\n}",
"function displayData(something){ \n tbody.text(\"\")\n something.forEach(function(et_sighting){\n new_tr = tbody.append(\"tr\")\n Object.entries(et_sighting).forEach(function([key, value]){\n new_td = new_tr.append(\"td\").text(value)\t\n })\n})}",
"function populateStats(data) {\n\n document.getElementById(\"stats\").innerHTML = \"\";\n\n // Construct the table and its header\n var table = document.createElement(\"TABLE\");\n table.id = \"table\";\n table.border = 1;\n document.getElementById(\"stats\").appendChild(table);\n\n tb = document.getElementById(\"table\");\n\n addRow(tb, \"Username\", \"Average Score\", \"Games Played\", \"Wins\");\n\n // Add player data\n if (!(Object.entries(data).length === 0 && data.constructor === Object)) {\n for (var elem in data) {\n if (Object.prototype.hasOwnProperty.call(data, elem)) {\n addRow(tb, elem, (data[elem].score / data[elem].gamesPlayed).toFixed(2), data[elem].gamesPlayed, data[elem].wins);\n\n }};\n }\n\n document.getElementById(\"stats\").appendChild(table);\n\n}",
"function setSectionHeader(header) {\r\n\tdocument.getElementById('section-header').innerHTML = header;\r\n}",
"function regenSummaryTable(){\n\tvar table = document.getElementById('summaryActivity'),\n\t\trow, isotope, chamberRes, tapeRes, tapeResLater,\n\t\tpostChamber, postTape, postTapeLater,\n\t\tkey;\n\n\t//clear table\n\ttable.innerHTML = '';\n\t//generate table header\n\trow = document.createElement('tr');\n\trow.setAttribute('id', 'titleRow');\n\ttable.appendChild(row);\n\n\tisotope = document.createElement('td');\n\tisotope.setAttribute('id', 'titleIsotope');\n\tdocument.getElementById('titleRow').appendChild(isotope);\n\tdocument.getElementById('titleIsotope').innerHTML = 'Isotope';\n\n\tchamberRes = document.createElement('td');\n\tchamberRes.setAttribute('id', 'titleChamberRes');\n\tdocument.getElementById('titleRow').appendChild(chamberRes);\n\tdocument.getElementById('titleChamberRes').innerHTML = 'Chamber - Post Expt.';\n\n\ttapeRes = document.createElement('td');\n\ttapeRes.setAttribute('id', 'titleTapeRes');\n\tdocument.getElementById('titleRow').appendChild(tapeRes);\n\tdocument.getElementById('titleTapeRes').innerHTML = 'Tape Box - Post Expt.';\n\n\ttapeResLater = document.createElement('td');\n\ttapeResLater.setAttribute('id', 'titleTapeResLater');\n\tdocument.getElementById('titleRow').appendChild(tapeResLater);\n\tdocument.getElementById('titleTapeResLater').innerHTML = 'Tape Box - 12h Later'\n\n\t//empty summary table cells:\n\tfor(key in window.isotopeList){\n\t\trow = document.createElement('tr');\n\t\trow.setAttribute('id', key+'row');\n\t\ttable.appendChild(row);\n\n\t\tisotope = document.createElement('td');\n\t\tisotope.setAttribute('id', key+'Isotope');\n\t\tdocument.getElementById(key+'row').appendChild(isotope);\n\t\tdocument.getElementById(key+'Isotope').innerHTML = key;\n\n\t\tchamberRes = document.createElement('td');\n\t\tchamberRes.setAttribute('id', key+'ChamberRes');\n\t\tdocument.getElementById(key+'row').appendChild(chamberRes);\n\n\t\ttapeRes = document.createElement('td');\n\t\ttapeRes.setAttribute('id', key+'TapeRes');\n\t\tdocument.getElementById(key+'row').appendChild(tapeRes);\n\n\t\ttapeResLater = document.createElement('td');\n\t\ttapeResLater.setAttribute('id', key+'TapeResLater');\n\t\tdocument.getElementById(key+'row').appendChild(tapeResLater);\n\n\t\t//populate summary table with final entries in lastActivity\n\t\tpostChamber = Activity(window.isotopeList[key].yield, window.isotopeList[key].lifetime/1000, window.cycleParameters.duration*window.cycleParameters.durationConversion*3600000, 'chamber');\n\t\tpostTape = Activity(window.isotopeList[key].yield, window.isotopeList[key].lifetime/1000, window.cycleParameters.duration*window.cycleParameters.durationConversion*3600000, 'tape');\n\t\tpostTapeLater = Activity(window.isotopeList[key].yield, window.isotopeList[key].lifetime/1000, window.cycleParameters.duration*window.cycleParameters.durationConversion*3600000, 'tape')*Math.exp(-window.isotopeList[key].lifetime*12*3600);\n\t\tdocument.getElementById(key+'ChamberRes').innerHTML = printBQ(postChamber) + '<br>' + printCi(postChamber)\n\t\tdocument.getElementById(key+'TapeRes').innerHTML = printBQ(postTape) + '<br>' + printCi(postTape)\n\t\tdocument.getElementById(key+'TapeResLater').innerHTML = printBQ(postTapeLater) + '<br>' + printCi(postTapeLater)\n\t}\n}",
"function showInfoCountry(result) {\n // On rend le tableau visible\n var table = document.getElementById(\"tableInfo\");\n table.style.display = \"initial\";\n \n // On met en titre du tableau le nom du Country\n var country = document.getElementById(\"title\");\n country.innerHTML = result.name;\n \n // On affiche les infos\n showInfo(result);\n}",
"doShowTableNote (name) {\n this.tableInfoName = name\n this.tableInfoTickle = !this.tableInfoTickle\n }",
"function updateSlotDisplays(player){\n\t\tdocument.getElementById(\"header\").innerHTML = \n\t\t\t\t\t\"<h3>3-of-a-Kind Slot-o-Rama</h3>\" + \n\t\t\t\t\t\"<h4>$\" + payout + \" per credit bet<br>\" +\n\t\t\t\t\t\"Max bet = \" + multiplierMax + \" credits</h4>\";\n\t\tdocument.getElementById(\"credit_cost\").innerHTML = \"<b>$\" + creditCost + \"</b><br>per credit\";\n\t\tdocument.getElementById(\"recent_win_payout\").innerHTML = \"Recent Win Payout:<br><b>$\" + recentWinPayout + \"</b>\";\n\t\tdocument.getElementById(\"previous_turn_payout\").innerHTML = \"Previous Turn Payout:<br><b>$\" + previousTurnPayout + \"</b>\";\n\t\tdocument.getElementById(\"current_bet\").innerHTML = \"Current Bet:<br><b>\" + multiplier + \" credit</b>\";\n\t\tif (player) {\n\t\t\tdocument.getElementById(\"balance\").innerHTML = \"Balance:<br><b>$\" + player.getBalance().toFixed(2) + \"</b>\";\t\n\t\t}\n\t\toutputResults();\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
for contracting revoke btn on hover | function revoke_mouseout(revo)
{
revo.classList.remove('btn-revoke-active');
revo.classList.add('btn-revoke-in-active');
} | [
"function revoke_mouseover(revo)\n{\n revo.classList.remove('btn-revoke-in-active');\n revo.classList.add('btn-revoke-active');\n}",
"function hoverOffOption(event) {\n $(event.target).css(\"border-color\",\"transparent\");\n }",
"isMouseOver() {\n return this.button.isMouseOver()\n }",
"function pinkbuttonOver() {\n pinkbutton.alpha = 0.8;\n}",
"function handlerViewControlLayerMouseLeave (e) {\n viewControlLayer.css(\"cursor\", \"url(/assets/javascripts/SVLabel/img/cursors/openhand.cur) 4 4, move\");\n mouseStatus.isLeftDown = false;\n }",
"forColorModel(){\n if((this.tps.mostRecentTransaction == -1)){ \n document.getElementById('undo-button').disabled = true;\n document.getElementById('undo-button').style.pointerEvents = \"none\";\n document.getElementById('undo-button').style.color = \"#322D2D\";\n }\n else{\n document.getElementById('undo-button').disabled = false;\n document.getElementById('undo-button').style.pointerEvents = \"auto\";\n document.getElementById('undo-button').style.color = \"#e9edf0\";\n }\n if((this.tps.mostRecentTransaction+1) < this.tps.numTransactions){\n document.getElementById('redo-button').disabled = false;\n document.getElementById('redo-button').style.pointerEvents = \"auto\";\n document.getElementById('redo-button').style.color = \"#e9edf0\";\n }\n else{\n document.getElementById('redo-button').disabled = true;\n document.getElementById('redo-button').style.pointerEvents = \"none\";\n document.getElementById('redo-button').style.color = \"#322D2D\";\n } \n }",
"function enableCC() {\n\tada$(shell.caption.btnId).className = '';\n\tada$(shell.caption.btnId).style.cursor = 'pointer';\n\tada$(shell.caption.btnId).title = shell.caption.name;\n\tCCIsDim = false;\n}",
"function onButtonOver() {\n\tthis.isOver = true;\n\tif (this.isDown) {\n\t\treturn;\n\t}\n\tthis.texture = textureButtonOver;\n}",
"function hideEnhancedURLBar() {\n if (ctrlMouseHover)\n return;\n async(function() {\n ctrlMouseHover = true;\n }, 200);\n setOpacity(1);\n enhancedURLBar.style.display = \"none\";\n }",
"function revokeCustomConfirmationPopup() {\n\thideModel('confermPopUp');\n}",
"onMouseEnter() {\n\t\tthis.props.hoverAction('true');\n\t}",
"function disableCC() {\n\tCCIsDim = true;\n\tada$(shell.caption.btnId).className = 'dim';\n\tada$(shell.caption.btnId).style.cursor = 'default';\n\tada$(shell.caption.btnId).title = 'No ' + shell.caption.name + ' Available';\n}",
"function deactivateButtons(){\n $scope.clickMemoryButton = null;\n }",
"function resetHover() {\n hovering = false;\n startTimeout();\n }",
"function onButtonOut() {\n\tthis.isOver = false;\n\tif (this.isDown) {\n\t\treturn;\n\t}\n\tthis.texture = textureButton;\n}",
"undoButton() {\n this.state.undo();\n }",
"function mouseOutAuthor(arg){\n\t\targ.style.textDecoration = 'none';\n\t}",
"function option3Hover() {\n return;\n }",
"function handleEventMainButton(status, profile, num_participants, capacity) {\n let button = $(\"#Event #joinBtn\");\n button.attr(\"disabled\", false);\n button.unbind(\"mouseenter mouseleave\");\n button.css({\n width: \"\",\n height: \"\"\n });\n\n console.log(\"In button function\");\n\n //Change to delete if owner:\n if (status == \"OWNER\") {\n button.css(\"background-color\", \"red\");\n button.html(\"Delete\");\n button.attr(\"onclick\", \"deleteEvent()\");\n //change onclick to delete\n return;\n }\n\n //Check if private\n if (profile == \"PRIVATE\") {\n if (status == \"PARTICIPANT\") {\n button.css(\"background-color\", \"#eead2d\");\n button.html(\"Leave\");\n button.attr(\"onclick\", \"leaveEvent(false)\");\n return;\n }\n if (status == \"NON_PARTICIPANT\") {\n button.css(\"background-color\", \"#0aa4ec\");\n button.html(\"Ask to join\");\n button.attr(\"onclick\", \"joinEvent(false)\");\n if (num_participants == capacity)\n button.attr(\"disabled\", \"disabled\");\n return;\n }\n if (status == \"PENDING\") {\n button.html(\"Awaiting approvance\");\n button.attr(\"onclick\", \"cancelEventJoin(false)\");\n button.css(\"background-color\", \"#0aa4ec\");\n \n button.mouseenter(function () {\n $(this).css({\n width: $(this).outerWidth(),\n height: $(this).outerHeight()\n });\n $(this).html(\"Cancel\");\n button.css(\"background-color\", \"#999999\");\n }).mouseleave(function () {\n $(this).html(\"Awaiting approvance\");\n button.css(\"background-color\", \"#0aa4ec\");\n });\n return;\n }\n }\n else { \n if (status == \"PARTICIPANT\") {\n button.css(\"background-color\", \"#eead2d\");\n button.html(\"Leave\");\n button.attr(\"onclick\", \"leaveEvent(true)\");\n return;\n }\n if (status == \"NON_PARTICIPANT\") {\n button.css(\"background-color\", \"#0aa4ec\");\n button.html(\"Join\");\n button.attr(\"onclick\", \"joinEvent(true)\");\n if (num_participants == capacity)\n button.attr(\"disabled\", \"disabled\");\n return;\n }\n }\n\n return;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
below is function to restrict user from selecting specified number of data in dropdown. This function has 3 parameters. 1 parameter is control name, 2 one is index number in dropdown and 3rd one is the error to be fired. | function dontselect(objVal,indexNo,strError){
var objValue=document.getElementById(objVal);
var finalerr="";
if(!objValue) {alert("Control with id " + objVal + " not found"); return;}
if(objValue.selectedIndex == null)
finalerr="BUG: dontselect command for non-select Item";
if(objValue.selectedIndex == eval(indexNo)){
if(!strError || strError.length ==0)
strError = objValue.name+": Please Select one option ";
finalerr=strError;
}
if(finalerr.length != 0){
alert(finalerr); objValue.focus();
return false;
}
return true;
} | [
"function setErrorSelect(nameControl, error) {\n\tif (jQuery('#' + nameControl +' option:selected').val()==-1) {\n\t\tjQuery('.' + nameControl + '-group').toggleClass('has-error')\n\t\tjQuery('.' + nameControl + '-group span.help-block').show();\n\t\treturn true;\n\t}\n}",
"function validateIncome(errorMsg) {\n var selectedOption = document.mortgage.income.selectedIndex;\n var incomeMsg = \"Please select your Income!\";\n\n if (selectedOption == -1) {\n errorMsg += \"<p><mark>Income range: </mark>None selected <br />\" + incomeMsg + \"</p>\";\n }\n return errorMsg; \n}",
"function checkSelect(select){\r\n\treturn (select.selectedIndex > 0);\r\n}",
"function ValidateCommentFromDropDown(ddlID, txtID, lblTextID, lblDdlID) {\r\n\r\n var dropdown = $('#' + ddlID);\r\n var textbox = $('#' + txtID);\r\n var lblErrorText = $('#' + lblTextID)[0];\r\n var lblErrorDDLCategory = $('#' + lblDdlID)[0];\r\n\r\n if (dropdown.prop(\"selectedIndex\") == 0 && textbox.val().length >= 5)\r\n {\r\n lblErrorDDLCategory.style.display = 'block';\r\n lblErrorText.style.display = 'none';\r\n return false;\r\n }\r\n else if (dropdown.prop(\"selectedIndex\") > 0)\r\n {\r\n if (textbox.val().length < 5)\r\n {\r\n lblErrorText.style.display = 'block';\r\n return false;\r\n }\r\n else\r\n {\r\n lblErrorDDLCategory.style.display = 'none';\r\n lblErrorText.style.display = 'none';\r\n return true;\r\n }\r\n }\r\n else\r\n {\r\n lblErrorDDLCategory.style.display = 'none';\r\n lblErrorText.style.display = 'none';\r\n return true;\r\n }\r\n}",
"function validateMedicalAidNumberOfDependents() { \n var optionSelected=\"\";\n var numOfOptions = document.TaxCalculator.hasMedicalAid.length;\n var numberOfDepedents = document.TaxCalculator.numberOfDependents.value;\n var regex = /[0-9]|\\./;\n \n for (var index=0; index < numOfOptions; index++) {\n if (document.TaxCalculator.hasMedicalAid[index].selected) {\n optionSelected = document.TaxCalculator.hasMedicalAid[index].value;\n break;\n } \n }\n \n if (optionSelected === \"yes\") {\n if (numberOfDepedents === \"\") {\n errorMessage +=\"Please Enter the Number of Dependents. \\n\";\n document.getElementById(\"numberOfDependents\").style.backgroundColor=\"red\";\n return false;\n } else if (!regex.test(numberOfDepedents)) {\n errorMessage +=\"Please Enter a Numberic Value for Dependents. \\n\";\n document.getElementById(\"numberOfDependents\").style.backgroundColor=\"red\";\n return false;\n } else { \n document.getElementById(\"numberOfDependents\").style.backgroundColor=\"\"; \n return true; \n }\n } else {\n document.getElementById(\"numberOfDependents\").style.backgroundColor=\"\"; \n return true; \n }\n}",
"function validatePropDetail(errorMsg) {\n var selectedPropDetail = document.mortgage.propDetails.length;\n var propDetailMsg = \"Please choose Property!\";\n var counter = 0;\n var chk = 0;\n\n for (var j=0;j<selectedPropDetail;j++) {\n if (document.mortgage.propDetails[j].checked == true) {\n counter++;\n }\n }\n if (counter == 0) {\n errorMsg += \"<p><mark>Property details: </mark>None selected <br />\" + propDetailMsg + \"</p>\";\n } else {\n for (var k=0;k<6;k++) {\n if(document.mortgage.propDetails[k].checked == true) {\n chk++;\n }\n }\n if (document.mortgage.propDetails[6].checked == true && chk > 0) {\n errorMsg += \"<p><mark>Property details: </mark>When selecting all of the above, deselect others <br />\" + propDetailMsg + \"</p>\"; \n } else {\n return errorMsg;\n }\n }\n return errorMsg; \n}",
"function showSelect() {\n $(\"#user\").hide();\n $(\"#user_sel\").show().focus();\n utils.runEval(' Page_Validators[0].controltovalidate = \"user_sel\" ');\n}",
"checkValidity() {\n this.select.checkValidity();\n }",
"function MAG_fill_select_authindex () { // PR2023-02-06\n //console.log(\"----- MAG_fill_select_authindex -----\") ;\n //console.log(\" mod_MAG_dict.examperiod\", mod_MAG_dict.examperiod);\n //console.log(\" mod_MAG_dict.requsr_auth_list\", mod_MAG_dict.requsr_auth_list);\n\n // --- fill selectbox auth_index\n if (el_MAG_auth_index){\n // auth_list = [{value: 1, caption: 'Chairperson'}, {value: 3, caption: 'Examiner'} )\n const auth_list = [];\n const cpt_list = [null, loc.Chairperson, loc.Secretary, loc.Examiner, loc.Corrector];\n for (let i = 0, auth_index; auth_index = mod_MAG_dict.requsr_auth_list[i]; i++) {\n auth_list.push({value: auth_index, caption: cpt_list[auth_index]});\n };\n t_FillOptionsFromList(el_MAG_auth_index, auth_list, \"value\", \"caption\",\n loc.Select_function, loc.No_functions_found, setting_dict.sel_auth_index);\n//console.log(\" >>>>>>>>>>>>>>>> auth_list\", auth_list)\nconst is_disabled = (!auth_list || auth_list.length <= 1);\n//console.log(\" >>>>>>>>>>>>>>>> is_disabled\", is_disabled)\n el_MAG_auth_index.readOnly = (!auth_list || auth_list.length <= 1);\n };\n }",
"function validateCoiHolderSelection() {\r\n if (typeof testgrid1 != \"undefined\") {\r\n if (!isEmptyRecordset(testgrid1.recordset)) {\r\n var validRecords = testgrid1.documentElement.selectNodes(\r\n \"//ROW[CSELECT_IND='-1' and (CROLETYPECODE='COI_HOLDER' or CROLETYPECODE='COI_HOLDER(PENDING)') and CEFFECTIVETODATE='01/01/3000']\");\r\n\r\n //alert(invalidRecords2.length + \"|\" + invalidRecords.length);\r\n\r\n if (validRecords.length <= 0) {\r\n alert(getMessage(\"ci.entity.message.coiHolder.select\"));\r\n return false;\r\n }\r\n var invalidRecords2= testgrid1.documentElement.selectNodes(\r\n \"//ROW[CSELECT_IND='-1' and CROLETYPECODE='COI_HOLDER(PENDING)' and CEFFECTIVETODATE='01/01/3000']\");\r\n\r\n if (invalidRecords2.length > 0 ) {\r\n alert(getMessage(\"ci.entity.message.coiHolder.Pendingselect\"));\r\n return false;\r\n }\r\n var invalidRecords = testgrid1.documentElement.selectNodes(\r\n \"//ROW[CSELECT_IND='-1' and CROLETYPECODE='COI_HOLDER' and CEFFECTIVETODATE!='01/01/3000' \" +\r\n \"or CSELECT_IND='-1' and CROLETYPECODE!='COI_HOLDER']\");\r\n if (invalidRecords.length > 0) {\r\n alert(getMessage(\"ci.entity.message.selection.invalid\", new Array(\"\\n\")));\r\n return false;\r\n }\r\n } else {\r\n alert(getMessage(\"ci.entity.message.coiHolder.oneSelect\"));\r\n return false;\r\n }\r\n } else {\r\n alert(getMessage(\"ci.entity.message.coiHolder.oneSelect\"));\r\n return false;\r\n }\r\n return true;\r\n}",
"function validarCombo(pControl){\r\n\tvar vPosicion = document.getElementById('frmDetalles:cob'+ pControl).options.selectedIndex; //Obtiene el index del combo\r\n\tvar vValor = document.getElementById('frmDetalles:cob'+ pControl).options[vPosicion].text; //Obtiene el texto del combo\r\n\t//Valida que el tipo de contro se TipoPago\r\n\tif(pControl == 'TipoPago'){\r\n\t\t//Valida que el combo tengo el valor indicado\r\n\t\tif(vValor.indexOf('Banco') != -1){\r\n\t\t\tdocument.getElementById('frmDetalles:cobBanco').disabled = false;\r\n\t\t\tdocument.getElementById('frmDetalles:txtFolioCobranza').disabled = true;\r\n\t\t\tdocument.getElementById('frmDetalles:txtFolioCobranza').value='';\r\n\t\t\tdocument.getElementById('frmDetalles:cobBanco').focus();\r\n\t\t}\r\n\t\telse if(vValor.indexOf('Pago en efectivo') != -1){\r\n\t\t\tdocument.getElementById('frmDetalles:cobBanco').disabled = true;\r\n\t\t\tdocument.getElementById('frmDetalles:txtFolioCobranza').disabled = true;\r\n\t\t\tdocument.getElementById('frmDetalles:txtFolioCobranza').value='';\r\n\t\t\tdocument.getElementById('frmDetalles:cobBanco').options.selectedIndex = 0;\r\n\t\t\tdocument.getElementById('frmDetalles:txtMonto').focus();\r\n\t\t}\r\n\t\telse if(vValor.indexOf('Recibo de cobranza') != -1){\r\n\t\t\tdocument.getElementById('frmDetalles:cobBanco').disabled = true;\r\n\t\t\tdocument.getElementById('frmDetalles:txtFolioCobranza').disabled = false;\r\n\t\t\tdocument.getElementById('frmDetalles:cobBanco').options.selectedIndex = 0;\r\n\t\t\tdocument.getElementById('frmDetalles:txtFolioCobranza').focus();\r\n\t\t}\r\n\t\telse{\r\n\t\t\tdocument.getElementById('frmDetalles:cobBanco').disabled = true;\r\n\t\t\tdocument.getElementById('frmDetalles:txtFolioCobranza').disabled = true;\r\n\t\t\tdocument.getElementById('frmDetalles:txtFolioCobranza').value='';\r\n\t\t\tdocument.getElementById('frmDetalles:cobBanco').options.selectedIndex = 0;\r\n\t\t}\r\n\t}\r\n\telse if(pControl == 'QuienRecibe'){\r\n\t\tif(vValor.indexOf('Otros') != -1){\r\n\t\t\tdocument.getElementById('frmDetalles:txtOtros').style.visibility = \"visible\";\r\n\t\t}else{\r\n\t\t\tdocument.getElementById('frmDetalles:txtOtros').style.visibility = \"hidden\";\r\n\t\t}\r\n\t}\r\n}",
"function handleFormGridError(event) {\n // Checks which required fields to not hold a value\n let fieldsWithoutValue = [];\n let selectedField = false;\n // Gets all fields without value\n props.fields.map((field, index) => {\n field.required && fieldsWithoutValue.push(index);\n if (event.target.name === field.name) selectedField = index;\n });\n\n let fieldsShowError = [];\n // Filters only fields that are before the selected field\n fieldsWithoutValue.filter(item => {\n item < selectedField && fieldsShowError.push(item);\n });\n setErrorFields(fieldsShowError);\n }",
"function ChangeHandler() {\n PreviousSelectIndex = SelectIndex; \n /* Contains the Previously Selected Index */\n\n SelectIndex = document.forms[0].lstDropDown.options.selectedIndex;\n /* Contains the Currently Selected Index */\n\n if ((PreviousSelectIndex == (document.forms[0].lstDropDown.options.length - 1)) && (SelectIndex != (document.forms[0].lstDropDown.options.length - 1)) && (SelectChange != 'MANUAL_CLICK')) \n /* To Set value of Index variables */\n {\n document.forms[0].lstDropDown[(document.forms[0].lstDropDown.options.length - 1)].selected=true;\n PreviousSelectIndex = SelectIndex;\n SelectIndex = document.forms[0].lstDropDown.options.selectedIndex;\n SelectChange = 'MANUAL_CLICK'; \n /* Indicates that the Change in dropdown selected \n\t\t\tvalue was due to a Manual Click */\n }\n }",
"function validateEquipmentno(oSrc, args) {\n var cols = ifgPreAdvice.Rows(ifgPreAdvice.CurrentRowIndex()).GetClientColumns();\n var _rowI = ifgPreAdvice.rowIndex;\n var sEquipmentno = args.Value\n var checkDigit;\n var sContNo;\n var strContinue = \"\";\n var msg = checkContainerNo(sEquipmentno);\n\n if (msg == \"\") {\n if (el(\"hdnchkdgtvalue\").value == \"True\") {\n if (sEquipmentno.length == 10) {\n sEquipmentno = sEquipmentno + getCheckSum(sEquipmentno.substr(0, 10));\n ifgPreAdvice.Rows(_rowI).SetColumnValuesByIndex(1, sEquipmentno);\n strContinue = \"N\";\n } else {\n checkDigit = getCheckSum(sEquipmentno.substr(0, 10));\n\n if (sEquipmentno.length >= 10) {\n if (checkDigit != sEquipmentno.substr(10)) {\n args.IsValid = false;\n oSrc.errormessage = \"Check Digit is incorrect for the entered Equipment. Correct check digit is \" + checkDigit;\n return;\n }\n }\n }\n }\n } else {\n args.IsValid = false;\n oSrc.errormessage = msg;\n return;\n }\n\n if (strContinue == \"\") {\n validateEquipmentNo(oSrc, args);\n if (args.IsValid == false) {\n return false\n }\n }\n\n var rowState = ifgPreAdvice.ClientRowState();\n var oCallback = new Callback();\n\n oCallback.add(\"EquipmentId\", sEquipmentno);\n oCallback.add(\"GridIndex\", ifgPreAdvice.VirtualCurrentRowIndex());\n oCallback.add(\"RowState\", rowState);\n oCallback.invoke(\"PreAdvice.aspx\", \"ValidateEquipment\");\n if (oCallback.getCallbackStatus()) {\n //Newly added if Equipment no already available in some other depot\n if (oCallback.getReturnValue(\"EquipmentNoInAnotherDepot\") == \"false\") {\n oSrc.errormessage = \"This Equipment \" + sEquipmentno + \" already exists for Pre-Advice in some other Depot.\";\n args.IsValid = false;\n }\n else if (oCallback.getReturnValue(\"StatusOfEquipment\") == \"false\") {\n oSrc.errormessage = \"This Equipment \" + sEquipmentno + \" already is in Active State in some other Depot.\";\n args.IsValid = false;\n }\n else if (oCallback.getReturnValue(\"bNotExists\") == \"true\") {\n args.IsValid = true;\n } \n else if (oCallback.getReturnValue(\"bRentalNotExists\") == \"false\") {\n // args.IsValid = false;\n var strCustomer = oCallback.getReturnValue(\"Customer\");\n var strAllowRental = oCallback.getReturnValue(\"AllowRental\");\n var cols = ifgPreAdvice.Rows(ifgPreAdvice.CurrentRowIndex()).GetClientColumns();\n if (strCustomer != cols[0] && cols[0] != \"\") {\n oSrc.errormessage = \"This Equipment \" + sEquipmentno + \" already exists for Customer \" + strCustomer + \" in Rental\";\n args.IsValid = false;\n }\n else if (strAllowRental == \"False\") {\n oSrc.errormessage = \"This Equipment \" + sEquipmentno + \" cannot be submitted as Rental Gate Out not created \" + strCustomer + \" in Rental\";\n args.IsValid = false;\n }\n }\n else {\n args.IsValid = false;\n var strCustomer = oCallback.getReturnValue(\"Customer\");\n oSrc.errormessage = \"Gate In has been already created for the Equipment \" + sEquipmentno + \" with Customer \" + strCustomer + \",hence cannot create Pre-Advice.\";\n }\n if (oCallback.getReturnValue(\"EquipmentTypeCode\") != '' && oCallback.getReturnValue(\"EquipmentTypeId\") != '') {\n ifgPreAdvice.Rows(ifgPreAdvice.CurrentRowIndex()).SetColumnValuesByIndex(2, new Array(oCallback.getReturnValue(\"EquipmentTypeCode\"), oCallback.getReturnValue(\"EquipmentTypeId\")));\n ifgPreAdvice.Rows(ifgPreAdvice.CurrentRowIndex()).SetReadOnlyColumn(2, true);\n }\n \n }\n else {\n showErrorMessage(oCallback.getCallbackError());\n }\n oCallback = null;\n}",
"function OnFinancialInstitutionChange(ddl) {\n\n try {\n\n var ddlFinancialInstitution = ((ddl === undefined) || (ddl == null)) ? document.getElementById('ddlFinancialInstitution') : ddl;\n\n if (ddlFinancialInstitution.disabled.length == 0) {\n\n var selection = (ddlFinancialInstitution == null) ? null : (ddlFinancialInstitution.options.length > 0) ? ddlFinancialInstitution.options[ddlFinancialInstitution.selectedIndex].value : null;\n\n if (selection != null) {\n\n // display the details of the selected financial institution\n }\n\n if (ddlFinancialInstitution != null) {\n\n ddlFinancialInstitution.style.display = 'inline-block';\n }\n }\n\n } catch (err) {\n\n alert(RespondeeScriptFileName + '. Control: ddlFinancialInstitution. Error: ' + err.description);\n }\n\n}",
"function toppingsValidator() {\n resetError();\n document.getElementById('submitOrderButton').disabled = false;\n var toppingsSelector = document.getElementsByClassName('form-check-input');\n var numberOfToppings = 0;\n var allowedToppings = itemData[0].fields.numberOfToppings;\n for (var i = 0; i < toppingsSelector.length; i++) {\n if (toppingsSelector[i].checked) {\n numberOfToppings++\n }\n }\n if (numberOfToppings > allowedToppings) {\n var errorMessage = \"You have selected too many options, you can have a total of \" + allowedToppings;\n raiseError(errorMessage);\n document.getElementById('submitOrderButton').disabled = true;\n }\n}",
"function singleSelectedId(multipleListId)\r\n{\r\n var itemIds=selectedIds(multipleListId);\r\n\r\n if(itemIds.length<=0)\r\n alert(\"Please select one item first.\");\r\n else if(itemIds.length>1)\r\n alert(\"Please select one item only.\");\r\n else\r\n return itemIds[0];\r\n\r\n return false;\r\n}",
"function handlePopupSelectOptions() {\n\t\tif (selectCount === 0) {\n\t\t\tdisplaySelectAll();\n\t\t} else if (selectCount === listLength) {\n\t\t\tdisplayDeselectAll();\n\t\t} else {\n\t\t\tdisplayBoth();\n\t\t}\n\n\t}",
"function skillEvent() {\n\n var skills = document.getElementsByName(\"skills\")[0];\n\n var selectedValue = skills.options[skills.selectedIndex].value;\n\n alert(\"Try again, \" + selectedValue + \" is not one of your skills\");\n\n return;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates 2 bindings if changed, then returns whether either was updated. | function bindingUpdated2(exp1, exp2) {
var different = bindingUpdated(exp1);
return bindingUpdated(exp2) || different;
} | [
"function updateBindings() {\n // if any binding changes, loop over all bindings again to see if the changed made\n // any changes to other bindings. Similar to Angular.js dirty checking method.\n var changed = true;\n \n while (changed) {\n changed = false;\n \n // loop through all bindings and check their old value compared to their current value\n for (var prop in bindings) {\n if (!bindings.hasOwnProperty(prop)) continue;\n \n var value = getBoundValue(prop);\n \n if (typeof value === 'function') {\n // a toString function must be called with it's associated object\n // i.e. value = obj.toString; value = value(); doesn't work\n value = value.call(getBoundObject(prop));\n }\n \n // value has changed, update all DOM\n if (value !== oldValues[prop]) {\n changed = true;\n oldValues[prop] = value;\n \n bindings[prop].forEach(function (node) {\n if (node.nodeName === 'INPUT') {\n node.value = typeof value !== 'undefined' ? value : '';\n } else {\n node.innerHTML = value;\n }\n });\n }\n }\n }\n }",
"function haveParamsChanged( paramNames ) {\r\n\r\n for ( var i = 0, length = paramNames.length ; i < length ; i++ ) {\r\n\r\n if ( hasParamChanged( paramNames[ i ] ) ) {\r\n\r\n // If one of the params has changed, return true - no need to\r\n // continue checking the other parameters.\r\n return( true );\r\n\r\n }\r\n\r\n }\r\n\r\n // If we made it this far then none of the params have changed.\r\n return( false );\r\n\r\n }",
"get isCompleteUpdate() {\n // XXX: Bug 514040: _ums.isCompleteUpdate doesn't work at the moment\n if (this.activeUpdate.patchCount > 1) {\n var patch1 = this.activeUpdate.getPatchAt(0);\n var patch2 = this.activeUpdate.getPatchAt(1);\n\n return (patch1.URL == patch2.URL);\n } else {\n return (this.activeUpdate.getPatchAt(0).type == \"complete\");\n }\n }",
"function itemChanged(r1, r2) {\n for( var key in r1 ) {\n\n // TODO: this should be a black list\n if( key == \"data\" ) continue;\n\n if( typeof r1[key] == \"string\" ) {\n if( r1[key] != r2[key] ) return true;\n } else {\n if( !r2[key] ) return true;\n if( r1[key].length != r2[key].length ) return true;\n for( var i = 0; i < r1[key].length; i++ ) {\n if( typeof r1[key][i] != typeof r2[key][i] ) return true;\n\n if( typeof r1[key][i] == 'object' ) {\n if( JSON.stringify(r1[key][i]) != JSON.stringify(r2[key][i]) ) return true;\n } else {\n if( r1[key][i] != r2[key][i] ) return true;\n }\n\n \n }\n }\n }\n return false;\n}",
"shouldUpdateState(params) {\n return params.changeFlags.propsOrDataChanged;\n }",
"function updateIfChanged( newData ) {\n switch ( DATA_UPDATE_METHOD ) {\n case 'lastUpdated':\n if ( !service.model.lastUpdated || newData.lastUpdated > service.model.lastUpdated ) {\n $log.debug( \"service has old data, updating\" );\n service.model = newData;\n _dataCb( service.model );\n }\n else {\n $log.debug( \"service still has the most recent, not updating\" );\n }\n break;\n case 'objectEquality':\n //need to first make copies with no lastUpdated\n var tempCurrent = JSON.parse( JSON.stringify( service.model ) );\n delete tempCurrent.lastUpdated;\n var tempNew = JSON.parse( JSON.stringify( newData ) );\n delete tempNew.lastUpdated;\n if ( !_.isEqual( tempCurrent, tempNew ) ) {\n $log.debug( 'tempCurrent is outdated, updating' );\n service.model = newData;\n _dataCb( service.model );\n }\n else {\n $log.debug( \"service still has the most recent, not updating\" );\n }\n break;\n }\n }",
"function checkBindings () {\n addLog('checkBindings() was Triggered');\n // if dataBoundNodes has elements in it, loop through each one and\n // see if there's a variable for it\n scope.dataBoundNodes = _.chain(scope.dataBoundNodes)\n .filter(function (node) {\n var found,\n path = node.attributes['data-bind'].value;\n\n found = setGetObjPath(false, path);\n\n return typeof found !== 'undefined';\n })\n .value();\n }",
"_checkEmberModelsOnDirty() {\n let checkresult = false;\n\n let editformIsDirty = this.get('model.editform.hasDirtyAttributes');\n\n let dataobject = this.get('model.dataobject');\n\n let attributes = dataobject.get('attributes');\n let changedAttributes = attributes.filterBy('hasDirtyAttributes');\n let attributesIsDirty = changedAttributes.length > 0 ? true : false;\n\n let association = this.get('store').peekAll('fd-dev-association');\n let changedAssociations = association.filterBy('hasDirtyAttributes');\n let associationIsDirty = changedAssociations.length > 0 ? true : false;\n\n let aggregation = this.get('store').peekAll('fd-dev-aggregation');\n let changedAggregation = aggregation.filterBy('hasDirtyAttributes');\n let aggregationIsDirty = changedAggregation.length > 0 ? true : false;\n\n if (editformIsDirty || attributesIsDirty || associationIsDirty || aggregationIsDirty) {\n checkresult = true;\n }\n\n return checkresult;\n }",
"haveChanges() {\n return this.code !== this.codeFromTableau;\n }",
"function hasParamChanged( paramName, paramValue ) {\r\n\r\n // If the param value exists, then we simply want to use that to compare\r\n // against the current snapshot.\r\n if ( ! ng.isUndefined( paramValue ) ) {\r\n\r\n return( ! isParam( paramName, paramValue ) );\r\n\r\n }\r\n\r\n // If the param was NOT in the previous snapshot, then we'll consider\r\n // it changing.\r\n if (\r\n ! previousParams.hasOwnProperty( paramName ) &&\r\n params.hasOwnProperty( paramName )\r\n ) {\r\n\r\n return( true );\r\n\r\n // If the param was in the previous snapshot, but NOT in the current,\r\n // we'll consider it to be changing.\r\n } else if (\r\n previousParams.hasOwnProperty( paramName ) &&\r\n ! params.hasOwnProperty( paramName )\r\n ) {\r\n\r\n return( true );\r\n\r\n }\r\n\r\n // If we made it this far, the param existence has not change; as such,\r\n // let's compare their actual values.\r\n return( previousParams[ paramName ] !== params[ paramName ] );\r\n\r\n }",
"hasMultipleConnections() {\n let result = false;\n this.getConnections().forEach(connection => {\n this.getConnections().forEach(_connection => {\n if (_connection.id !== connection.id) {\n if (_connection.source.node === connection.source.node) {\n if (_connection.target.node === connection.target.node) {\n result = true;\n }\n }\n }\n })\n });\n return result;\n }",
"function equivalent(x,y){\n\tif(JSON.stringify(clone(x)) == JSON.stringify(clone(y))){\n\t\treturn true;\n\t}\n\telse{\n\t\treturn false;\n\t}\n}",
"function eq(vm) {\n\tvar observerData = vm._mobxObserver;\n\n\tif (observerData.stale)\n\t\treturn false;\t// Re-render.\n\telse if (observerData.eq)\n\t\treturn observerData.eq.apply(this, arguments); // Let diff() choose.\n\telse\n\t\treturn true;\t// By default: no re-render.\n}",
"function hasChanged(oldCampaign, newCampaign) {\n for (var key in newCampaign) {\n var oldAttr = oldCampaign[key];\n var newAttr = newCampaign[key];\n\n if (\n newAttr !== oldAttr &&\n !(isEmptyArray(newAttr) && isEmptyArray(oldAttr))\n ) {\n return true;\n }\n }\n return false;\n }",
"function canSwap(x1, y1, x2, y2) {\n var type1 = getJewel(x1, y2);\n var type2 = getJewel(x2, y2);\n var chain;\n\n // Are positions adjacent?\n if (!isAdjacent(x1, y1, x2, y2)) {\n return false;\n }\n\n // temporarily swap positions\n jewels[x1][y1] = type2;\n jewels[x2][y2] = type1;\n\n // Check that new chain lengths would \n // valid.\n chain = (checkChain(x2, y2) > 2\n || checkChain(x1, y1) > 2);\n\n // Return to original positions.\n jewels[x1][y1] = type1;\n jewels[x2][y2] = type2;\n\n return chain;\n }",
"parametersChanged() {\n let arr = Object.entries(this.parameters)\n let res = arr.map(item=>{\n return this.prevParameters[item[0]] == item[1]\n }).find(item=>!item)\n\n this.prevParameters = {...this.parameters}\n return !res\n }",
"function hasActionChanged() {\r\n\r\n return( action !== previousAction );\r\n\r\n }",
"function canSwap(x1,y1,x2,y2) {\n\t\t\tvar type1 = getJewel(x1,y1),\n\t\t\t type2 = getJewel(x2,y2),\n\t\t\tchain;\n\n\n\t\t\tif(!isAdjacent(x1, y1, x2, y2)) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// temporarily swap jewels\n\t\t\tjewels[x1][y1] = type2;\n\t\t\tjewels[x2][y2] = type1;\n\n\t\t\tchain = (checkChain(x2, y2) > 2 ||\n\t\t\t\t checkChain(x1, y1) > 2);\n\n\t\t\t//swap back\n\t\t\tjewels[x1][y1] = type1;\n\t\t\tjewels[x2][y2] = type2;\n\n\t\t\treturn chain;\n\t\t}//end of canSwap()",
"_checkIfDirty(){\n if (this._isDirty === true){\n this._isDirty = false;\n this._refresh();\n }\n }",
"function areVirtualPackagesEquivalent(a, b) {\n if (!isVirtualLocator(a)) throw new Error(`Invalid package type`);\n if (!isVirtualLocator(b)) throw new Error(`Invalid package type`);\n if (!areIdentsEqual(a, b)) return false;\n if (a.dependencies.size !== b.dependencies.size) return false;\n\n for (const dependencyDescriptorA of a.dependencies.values()) {\n const dependencyDescriptorB = b.dependencies.get(dependencyDescriptorA.identHash);\n if (!dependencyDescriptorB) return false;\n\n if (!areDescriptorsEqual(dependencyDescriptorA, dependencyDescriptorB)) {\n return false;\n }\n }\n\n return true;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Registers the given hook function to run before leaving the given route. During a normal transition, the hook function receives the next location as its only argument and can return either a prompt message (string) to show the user, to make sure they want to leave the page; or `false`, to prevent the transition. Any other return value will have no effect. During the beforeunload event (in browsers) the hook receives no arguments. In this case it must return a prompt message to prevent the transition. Returns a function that may be used to unbind the listener. | function listenBeforeLeavingRoute(route, hook) {
var thereWereNoRouteHooks = !hasAnyProperties(RouteHooks);
var routeID = getRouteID(route, true);
RouteHooks[routeID] = hook;
if (thereWereNoRouteHooks) {
// setup transition & beforeunload hooks
unlistenBefore = history.listenBefore(transitionHook);
if (history.listenBeforeUnload) unlistenBeforeUnload = history.listenBeforeUnload(beforeUnloadHook);
}
return function () {
removeListenBeforeHooksForRoute(route);
};
} | [
"_beforeHandleRoute() {\n this._afterHandleRouteCalled = false;\n }",
"onBeforeUnload(callback) {\n return this.windowEventHandler.addUnloadCallback(callback);\n }",
"function addOnloadHook (hookFunct) {\n // Allows add-on scripts to add onload functions\n if (!doneOnloadHook) {\n onloadFuncts[onloadFuncts.length] = makeSafe (hookFunct);\n } else {\n makeSafe (hookFunct)(); // bug in MSIE script loading\n }\n }",
"function unlinkHookFn () {\n fqHookFilename = fqProjDirname + '/.git/hooks/pre-commit';\n fsObj.unlink( fqHookFilename, function ( error_data ) {\n // Ignore any error\n eventObj.emit( '07LinkHook' );\n });\n }",
"function _registerLeaveAlertListener() {\n window.addEventListener(\"beforeunload\", _leaveAlertEvent);\n }",
"function addForgettableCallback(event, callback, listenerId) {\n \n // listnerId is optional and if not given, the original\n // callback will be used\n listenerId = listenerId || callback;\n \n var safeCallback = protectedCallback(callback);\n \n event.on( function() {\n \n var discard = false;\n \n oboeApi.forget = function(){\n discard = true;\n }; \n \n apply( arguments, safeCallback ); \n \n delete oboeApi.forget;\n \n if( discard ) {\n event.un(listenerId);\n }\n }, listenerId);\n \n return oboeApi; // chaining \n }",
"function unRegisterBlockAndReloadHandlers() {\n let handler;\n // eslint-disable-next-line no-cond-assign\n while (handler = BLOCK_AND_REDIRECT_HANDLERS.pop()) {\n chrome.webRequest.onBeforeRequest.removeListener(handler);\n }\n chrome.webNavigation.onCompleted.removeListener(webNavigationMonitor);\n}",
"function onUnload(func) {\r\n if (Browser.WebKit) {\r\n window.onbeforeunload = func;\r\n } else {\r\n window.onunload = func;\r\n }\r\n}",
"doRouteAfter() {\n if (Routes.doAppRouteAfter) {\n Routes.doAppRouteAfter()\n }\n }",
"function onPageUnload(e)\r\n{\r\n\tif (!isUnloadNotified)\r\n\t{\r\n\t\tvar flashObj = getFlashObject();\r\n\t\tif (flashObj && flashObj['unload']) flashObj.unload();\r\n\t\tisUnloadNotified = true;\r\n\t}\r\n}",
"exitFunctionModifier(ctx) {\n\t}",
"function detachHistoryListener() {\n window.removeEventListener('hashchange', onHashChange);\n}",
"function onHashChange() {\n debug('onHashChange, location=', window.location);\n\n startNavigationFromCurrentLocation().then(\n () => executeNavigationStep('beforeLeave')\n ).then(\n () => executeNavigationStep('beforeEnter').catch(catchStepError)\n ).then(\n setFutureState\n ).then(\n switchPanel\n ).then(\n () => executeNavigationStep('afterEnter').catch(catchStepError)\n ).then(\n () => executeNavigationStep('afterLeave').catch(catchStepError)\n ).then(\n endNavigation\n ).then(\n () => Navigation.emit('navigated')\n ).catch(onNavigationError); // TODO reset to previous hash or call back ?\n}",
"function _destroyLeaveAlertListener() {\n window.removeEventListener(\"beforeunload\", _leaveAlertEvent);\n }",
"function redirectIfHelpDesk(localUrl) {\n return function (req, res, next) {\n if(req.user.role === \"helpDesk\") {\n return res.redirect(307, localUrl);\n } else {\n return next();\n }\n };\n}",
"unregisterLoadCallback () {\n this.loadCallback = null;\n }",
"function HookAlreadyExists (message, hook) {\n RegistryKeyAlreadySet.call(this, message);\n this.hook = hook;\n}",
"function adelante() {\r\n history.forward();\r\n}",
"disconnectedCallback() {\n super.disconnectedCallback();\n document.removeEventListener('incoming-custom-event', this.handleIncoming)\n }",
"function removeListenerFromUrlChanges(callback) {\n\t chrome.tabs.onUpdated.removeListener(function (tabId, changeInfo, tab) {\n\t callback(tabId, changeInfo, tab);\n\t });\n\n\t chrome.tabs.onCreated.addListener(function (tab) {\n\t callback(tabId, changeInfo, tab);\n\t });\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Abre el modal y reproduce el video | function reproducirVideo(){
$('#videoModal').modal('show');
video.play();
} | [
"function openVideo(video_id) {\n $(modal.replace(\"{VIDEO_ID}\", video_id)).appendTo('body').modal();\n}",
"function playVideo(videoData) {\n document.querySelector(\"#modalYT div div div div iframe\").src = \"https://www.youtube.com/embed/\" + videoData.youtubeId;\n document.querySelector(\"#watch-video-detail\").href = \"pages/watch.html?yid=\" + videoData.youtubeId;\n videoDataToSend.data.attributes = videoData;\n if (!$(\"#modalYT\").hasClass(\"show\")) {\n setTimeout(function () {\n $(\"#modalYT\").modal('show');\n }, 100);\n }\n}",
"function openOverlay(e) {\n const videoWrapper =\n e.target.parentNode.parentNode.parentNode.parentNode.children[0];\n const videoWrapperInner = e.target.parentNode.parentNode;\n const mosVideo = videoWrapper.children[0];\n\n videoWrapper.style.display = \"block\";\n videoWrapperInner.style.visibility = \"hidden\";\n mosVideo.play();\n\n setIsVideoOpen(true);\n }",
"function w3_openvd() {\n\tdocument.getElementById(\"closevideo\").style.display = \"block\";\n}",
"function openPreview(name, url){\n console.log(name, url);\n var modal = '<div class=\"modal fade\" id=\"bookPreview\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"bookPreviewLabel\" aria-hidden=\"true\">' +\n '<div class=\"modal-dialog\" role=\"document\">' +\n '<div class=\"modal-content\">' +\n '<div class=\"modal-header\">' +\n '<h5 class=\"modal-title\" id=\"bookPreviewLabel\">'+ name +'</h5>' +\n '<button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\">' +\n '<span aria-hidden=\"true\">×</span>' +\n '</button>' +\n '</div>' +\n '<div class=\"modal-body\">' +\n '<iframe src=\"'+ url +'&output=embed\" frameborder=\"0\">' +\n '</iframe>' +\n '</div>' +\n '</div>' +\n '</div>' +\n '</div>';\n $('body').prepend(modal);\n $('#bookPreview').modal('show');\n $('#bookPreview').on('hidden.bs.modal', function(e){\n $('#bookPreview').remove();\n });\n}",
"function win() {\n modal.style.display = \"block\";\n}",
"function closePopupVideo() {\n $body.removeClass('overflow');\n $overlayVideo.removeClass('open');\n setTimeout(function () {\n player.stopVideo();\n }, 250);\n }",
"function mouse_move_video()\n{\n\t$(\".chalk_player .media_controls\").addClass(\"media_show\");\n\tif($(\".chalk_player video\").attr(\"data-diy\")==\"1\")\n\t\t$(\".chalk_player .diy_wrapper .steps_container\").removeClass(\"hidden\");\n\tsetTimeout(function() {\n\t\tif($(\".chalk_player .media_controls\").attr(\"data-mouse-in\")==\"0\")\n\t\t\tif(Date.now()-$(\".chalk_player .media_controls\").attr(\"data-prev-hide\")>4000)\n\t\t\t{\n\t\t\t\t$(\".chalk_player .media_controls\").attr(\"data-prev-hide\",Date.now());\n\t\t\t\tmouse_out_video();\n\t\t\t}\n\t}, 4000);\n}",
"static prepareVideoElement(videoElem){const videoElement=BrowserCodeReader$1.createVideoElement(videoElem);// @todo the following lines should not always be done this way, should conditionally\n// change according were we created the element or not\n// Needed for iOS 11\nvideoElement.setAttribute('autoplay','true');videoElement.setAttribute('muted','true');videoElement.setAttribute('playsinline','true');return videoElement;}",
"function video_click(e) {\n\t//console.log(e);\n\t//console.log(this);\n\tif (this.paused == true) {\n\t\tthis.play();\n\t} else {\n\t\tthis.pause();\n\t}\n}",
"function instructionVideo() {\n\t $(\".game-container\").append(`\n\t <section class='intro-video-container video-container'>\n\t <video poster=\"assests/zoe-instructional-vid.mp4\" class='intro-video' id=\"bgvid\" playsinline autoplay>\n\t <source src=\"assests/zoe-instructional-vid.mp4\" type=\"video/webm\">\n\t <source src=\"assests/zoe-instructional-vid.mp4\" type=\"video/mp4\">\n\t </video>\n\t </section\n\t `);\n\t $('.intro-video-container').delay(39000).fadeOut(1000, function () {\n\t $('.intro-video-container').remove();\n\t });\n\t}",
"function configurarBarrasVideo(){\n\n ///////////////////////PROGRESO//////////////////////\n //Listener para cuando el usuario arrastre la barra de progreso\n barraProgreso.addEventListener(\"change\", function() {\n //Calcular tiempo exacto\n var tiempo = video.duration * (barraProgreso.value / 100);\n \n //Actualizar con tiempo\n video.currentTime = tiempo;\n });\n \n //Listener para que la barra de progreso avance con el video\n video.addEventListener(\"timeupdate\", function() {\n //Calcular progreso del video\n var tiempo = (100 / video.duration) * video.currentTime;\n \n //Actualizar barra con el tiempo del video\n barraProgreso.value = tiempo;\n });\n\n //Pausar el video mientras el usuario mueve la barra de progreso\n barraProgreso.addEventListener(\"mousedown\", function() {\n video.pause();\n\n console.log(video.currentTime);\n actualizaIconoPlay();\n });\n\n //Reanudar el video cuando el usuario deje de arrastrar la barra de progreso\n barraProgreso.addEventListener(\"mouseup\", function() {\n video.play();\n //Calcular tiempo exacto\n var tiempo = video.duration * (barraProgreso.value / 100);\n\n //Actualizar con tiempo\n video.currentTime = tiempo;\n actualizaIconoPlay();\n });\n\n ///////////////////////VOLUMEN//////////////////////\n // Listener para cambiar volumen cuando cambie la barra de volumen\n barraVolumen.addEventListener(\"change\", function() {\n video.volume = barraVolumen.value;\n actualizarIconoSonido();\n });\n}",
"function toggleVideo(event) {\n videoGallery = document.querySelector(\".video-gallery\");\n if (!videoGallery) {\n document.querySelector(\n \".flex-control-thumbs\"\n ).lastChild.style.opacity = 1;\n document.querySelector(\".flex-active\").style.opacity = 0.5;\n videoIndex = thumbnails.childNodes.length - 1;\n productImages = document.querySelectorAll(\n \".woocommerce-product-gallery__image\"\n );\n // needs to be in front of current slide\n document\n .querySelector(\".flex-active-slide\")\n .insertAdjacentHTML(\n \"beforebegin\",\n '<div class=\"video-gallery\" style=\"width: 530px; margin-right: 0px; float: left; display: block; position: relative; overflow: hidden;\"> <iframe width=\"530\" height=\"315\" src=\"https://www.youtube.com/embed/pCuZdRN2XpM\" frameborder=\"0\" allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe> </div>'\n );\n\n if (flexViewport === undefined) {\n flexViewport = document.querySelector(\".flex-viewport\");\n }\n flexViewport.classList.add(\"flex-transition\");\n flexViewport.classList.add(\"video-viewport\");\n // productImages.forEach(e => {\n // e.classList.remove(\"flex-active-slide\");\n // });\n\n // need to change back to first slide, then create video in front of first slide\n }\n }",
"function fnVideoImage(ProductId,videoProduct,ImagemProdPri,NomeProd){\r\n var replaceNomeProd = NomeProd.replace(/-/g,' ');\r\n if (videoProduct==\"\"){\r\n document.getElementById(\"id-video-image\"+ProductId).innerHTML=\"<div class='ImgCapaListProd DivListproductStyleImagemZoom'><img src=\"+ ImagemProdPri +\" alt=\\\"\"+ replaceNomeProd +\"\\\" onerror='MostraImgOnError(this,0)'\"+ sLazy +\"></div>\";\r\n }else{\r\n document.getElementById(\"id-video-image\"+ProductId).innerHTML=\"<video id=prodVideo\"+ ProductId +\" class='videoProd' preload=auto loop src='https://my.mixtape.moe/\"+ videoProduct +\".mp4'></video>\";\r\n function execVideoEvents(){\r\n var oVideo=document.getElementById(\"prodVideo\"+ProductId);\r\n if(FCLib$.isOnScreen(oVideo))oVideo.play();\r\n }\r\n execVideoEvents();\r\n FCLib$.AddEvent(document,\"scroll\",execVideoEvents);\r\n }\r\n }",
"function mouse_in_video()\n{\n\t$(\".chalk_player .media_controls\").addClass(\"media_show\");\n\tif($(\".chalk_player video\").attr(\"data-diy\")==\"1\")\n\t\t$(\".chalk_player .diy_wrapper .steps_container\").removeClass(\"hidden\");\n\tsetTimeout(function() {\n\t\tif($(\".chalk_player .media_controls\").attr(\"data-mouse-in\")==\"0\")\n\t\t\tif(Date.now()-$(\".chalk_player .media_controls\").attr(\"data-prev-hide\")>4000)\n\t\t\t{\n\t\t\t\t$(\".chalk_player .media_controls\").attr(\"data-prev-hide\",Date.now());\n\t\t\t\tmouse_out_video();\n\t\t\t}\n\t}, 4000);\n}",
"function videoPlay($wrapper) {\n var $iframe = $wrapper.find('.js-videoIframe');\n var src = $iframe.data('src');\n // hide poster\n $wrapper.addClass('videoWrapperActive');\n // add iframe src in, starting the video\n $iframe.attr('src', src);\n }",
"function display_form(){\r\n $('#staticBackdrop').modal('show');\r\n}",
"function render_modal(titulo, descripcion='', contenido='ENTENDIDO'){\n\n if(contenido=='ENTENDIDO'){\n contenido = `<div id=\"mm-entendido-btn\">ENTENDIDO</div>`\n }\n}",
"_openConfirmRunAlgoModal(evt) {\n\n if ('mediaIds' in evt.detail)\n {\n this._confirmRunAlgorithm.init(\n evt.detail.algorithmName, evt.detail.projectId, evt.detail.mediaIds, null);\n }\n else\n {\n this._confirmRunAlgorithm.init(\n evt.detail.algorithmName, evt.detail.projectId, null, evt.detail.mediaQuery);\n }\n\n this._confirmRunAlgorithm.setAttribute(\"is-open\",\"\");\n this.setAttribute(\"has-open-modal\", \"\");\n document.body.classList.add(\"shortcuts-disabled\");\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
CHECKLABEL:function delete_expr() CHECKNEXT:frame = [] CHECKNEXT: %BB0: CHECKNEXT: %0 = LoadPropertyInst globalObject : object, "sink" : string CHECKNEXT: %1 = CallInst %0, undefined : undefined CHECKNEXT: %2 = ReturnInst true : boolean CHECKNEXT: %BB1: CHECKNEXT: %3 = ReturnInst undefined : undefined CHECKNEXT:function_end | function delete_expr() {
return (delete sink());
} | [
"function delete_literal() {\n return (delete 4);\n}",
"visitDel_stmt(ctx) {\r\n console.log(\"visitSivisitDel_stmt\");\r\n return { type: \"DeleteStatement\", deleted: this.visit(ctx.exprlist()) };\r\n }",
"function foo(a,b) {\n \n // Now, deleting 'a' directly should fail\n // because 'a' is direct reference to a function argument;\n var d = delete a;\n return (d === false && a === 1);\n }",
"function delete_parameter(p) {\n return (delete p);\n}",
"function removeExpr() {\r\n\r\n var sO = CurStepObj;\r\n var pos;\r\n\r\n // If an expression is active, we remove that expression AND activate\r\n // the space just before that removed expression (i.e., the sapce\r\n // id same as that of removed expression)\r\n //\r\n if (!sO.isSpaceActive) { // expression highlighted\r\n\r\n // console.log(\"no space\");\r\n\r\n pos = sO.activeChildPos;\r\n\r\n if (pos != ROOTPOS) {\r\n\r\n //console.log(\"not root\");\r\n\r\n // If we are deleting an arg of a function call, update the\r\n // header\r\n // \r\n var removed = true;\r\n if (sO.activeParentExpr.isUserFuncCall()) {\r\n removed = removeFuncArg(sO.activeParentExpr, pos);\r\n }\r\n\t //\r\n if (removed) {\r\n sO.activeParentExpr.exprArr.splice(pos, 1);\r\n sO.isSpaceActive = true; // activate space before removed expr\r\n }\r\n\r\n } else { // can't remove root str (e.g., if/else)\r\n\r\n\r\n if (sO.activeParentExpr.exprArr.length ||\r\n sO.activeParentExpr.isCondition()) {\r\n\r\n // Cannot delete non-empty 'foreach' OR any mask box \r\n //\r\n showTip(TipId.RootEdit);\r\n\r\n } else {\r\n\r\n // if no children, mark as deleted (e.g., bare 'foreach')\r\n //\r\n sO.activeParentExpr.deleted = DeletedState.Deleted;\r\n }\r\n }\r\n\r\n } else { // if space highlighted\r\n\r\n // console.log(\"space @\" + sO.activeChildPos);\r\n\r\n //pos = -1; // remove at very end by default\r\n\r\n if (sO.activeChildPos > 0) {\r\n pos = --sO.activeChildPos; // -- to move to previous space\r\n\r\n /*\r\n\t if (pos < 0) { // if we moved to ROOTPS\r\n\t\tsO.isSpaceActive = false; // space no longer active\r\n\t }\r\n\t */\r\n\r\n sO.activeParentExpr.exprArr.splice(pos, 1);\r\n }\r\n\r\n\r\n\r\n // var expr = sO.activeParentExpr.exprArr[pos];\r\n // if (expr.isDefinition()) expr.str = 'DELETED';\r\n\r\n\r\n\r\n }\r\n\r\n}",
"function deleteLink(source,destination){\n\tif(globalInfoType == \"JSON\"){\n\t\tvar devices = getDevicesNodeJSON();\n var prtArr =[];\n for(var s=0;s < devices.length; s++){\n prtArr = getDeviceChildPort(devices[s],prtArr);\n }\n }else{\n var prtArr= portArr;\n }\n\tfor(var i = 0; i < window['variable' + dynamicLineConnected[pageCanvas]].length; i++){\n\t\tif(window['variable' + dynamicLineConnected[pageCanvas]][i].Destination == destination && window['variable' + dynamicLineConnected[pageCanvas]][i].Source == source){\n\t\t\tif(window['variable' + dynamicLineConnected[pageCanvas]][i].DestinationDeviceName != \"\" || window['variable' + dynamicLineConnected[pageCanvas]][i].SourceDeviceName != \"\"){\n\t\t\t\tfor(var a=0; a < prtArr.length; a++){\n\t\t\t\t\tif(prtArr[a].ObjectPath == destination || prtArr[a].ObjectPath == source){\n\t\t\t\t\t\tif(prtArr[a].Status == \"Reserved\"){\n\t\t\t\t\t\t\taddEvent2History(\"Device Link Deleted\");\n\t\t\t\t\t\t\tprtArr[a].UpdateFlag = \"delete\";\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\taddEvent2History(\"Device Link Deleted\");\n\t\t\t\t\t\t\tprtArr.splice(a,1);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\twindow['variable' + dynamicLineConnected[pageCanvas]].splice(i,1);\n\t\t\t}else{\n\t\t\t\twindow['variable' + dynamicLineConnected[pageCanvas]].splice(i,1);\n\t\t\t}\n\t\t}\n\t}\n\tdrawImage();\n}",
"exitUnannReferenceType(ctx) {\n\t}",
"deleteRecord() {}",
"visitDelete_statement(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"function deleteStep() {\r\n\r\n var fO = CurFuncObj;\r\n var sO = fO.allSteps[fO.allSteps.length - 1];\r\n\r\n if (fO.curStepNum == 0) {\r\n alert(\"Cannot remove function header step\");\r\n return;\r\n }\r\n\r\n // Remove any highlighted expression and grid highlight from the \r\n // current step because we are going to delete this step. Not doing\r\n // so will keep highlights in grid (even in other steps)\r\n //\r\n removeExprAndGridHighlight();\r\n\r\n //fO.allSteps.pop(); // remove the CurStepObj from allSteps[]\r\n\r\n // Remove the current step\r\n //\r\n fO.allSteps.splice(fO.curStepNum, 1);\r\n\r\n fO.curStepNum--; // update step number\r\n\r\n assert((fO.curStepNum >= 0) && \"invalid previous step\");\r\n\r\n // Go to previous step after deleting. There is always a previous step,\r\n // because of the function header step at postion 0\r\n //\r\n changeStep(fO.curStepNum);\r\n\r\n}",
"exitArrayCreationExpression(ctx) {\n\t}",
"deleteANodeWithLabelAndIdentity(label, identity){\n let task;\n if(label == 'PERSON') task = session.run(`MATCH (N:${label}) WHERE N.name = '${identity}' DETACH DELETE N `)\n else if(label == 'MOVIE') task = session.run(`MATCH (N:${label}) WHERE N.title = '${identity}' DETACH DELETE N`)\n return task;\n }",
"exitIfExpression(ctx) {\n\t}",
"function deleteDynamicSource(sourceName,bindingName)\n{\n var sbObjs = dwscripts.getServerBehaviorsByTitle(sourceName);\n\n if (sbObjs.length > 0 && !bindingName)\n {\n // Warn the user that this operation will delete the recordset datasource\n // that is returned from this stored proc. Make sure this is the desired\n // action.\n var returnedRSName = sbObjs[0].getRecordsetName();\n var continueDelete = true;\n if (returnedRSName)\n {\n\t var displayName = dwscripts.getRecordsetDisplayName();\n continueDelete = confirm(dwscripts.sprintf(MM.MSG_WarnDeleteReturnedRS, \n displayName,\n\t\t\t\t\t\t\t\t\t\t\t\t returnedRSName,\n\t\t\t\t\t\t\t\t\t\t\t\t displayName));\n }\n \n if (continueDelete)\n {\n dw.serverBehaviorInspector.deleteServerBehavior(sbObjs[0]);\n }\n }\n else if (bindingName) \n {\n alert(MM.MSG_CantDelColumn);\n }\n}",
"exitFunctionLiteral(ctx) {\n\t}",
"remove(o){\n\t\to.desafficher();\n\t\tif(o instanceof Objet){\n\t\t\tthis.cases[o.getY()][o.getX()][\"OBJET\"] = null;\t\n\t\t}\n\t\telse if (o instanceof Entite){\n\t\t\tthis.cases[o.getY()][o.getX()][\"ENTITE\"] = null;\t\n\t\t}\n\t\telse if (o instanceof Tile){\n\t\t\tthis.cases[o.getY()][o.getX()][\"TILE\"] = null;\t\n\t\t}\n\t\t\n\t}",
"function markDeletedIndexExpr(gId, dim, pos) {\r\n\r\n\r\n var fO = CurFuncObj;\r\n\r\n // go thru each step in func\r\n //\r\n for (var s = 0; s < fO.allSteps.length; s++) {\r\n\r\n var stepO = fO.allSteps[s];\r\n\r\n // go thru each grid in step\r\n //\r\n for (var g = 0; g < stepO.allGridIds.length; g++) {\r\n\r\n var gridIdInFunc = stepO.allGridIds[g];\r\n\r\n if (gId == gridIdInFunc) { // if this is the same grid\r\n\r\n // index obj in step as the same position of required grid\r\n //\r\n var iO = stepO.allIndObjs[g];\r\n\r\n // Mark the current expression as deleted. \r\n //\r\n var iexpr = iO.dimIndExprs[dim][pos];\r\n //\r\n if (iexpr) { // mark expr as deleted\r\n iexpr.deleted = DeletedState.Deleted;\r\n }\r\n\r\n // Remove the index from index object \r\n //\r\n iO.dimIndExprs[dim].splice(pos, 1); // delete one index \r\n }\r\n }\r\n\r\n }\r\n\r\n}",
"function deletePowerSource(powerplant)\n{\n var pp = powerplant;\n shifting.powerPlants[powerplant].color = \"white\";\n sharedElectricData.variables[powerplant].color = \"white\";\n shifting.powerPlants[powerplant].name = \"\";\n sharedElectricData.variables[powerplant].name = \"\";\n\n for (i=0, n=shifting.powerPlants[powerplant].min.length; i < n; i++) {\n shifting.powerPlants[powerplant].min[i]=0;\n sharedElectricData.variables[powerplant].min[i]=0;\n \n }\n for (i=0, n=shifting.powerPlants[powerplant].max.length; i < n; i++) {\n shifting.powerPlants[powerplant].max[i]=0;\n sharedElectricData.variables[powerplant].max[i]=0;\n }\n $(\"#ps-list-item-\"+pp.slice(-1)).remove();\n $(\"#dragsimulate\").trigger(\"customDragEvent\");\n $(\"#color-legend tbody tr.data\").remove();\n updatePowerPlantLegend();\n resetLegendInitialValues();\n}",
"function deleteBehavior(behFnCallStr) {\n var args,imgList = new Array();\n //Maybe remove preload handler\n args = extractArgs(behFnCallStr);//get new list of imgObj,imgSrc pairs\n if (args[1] == 'init' && args[args.length-1] != '0') {\n for (var i=2; i+1 < args.length-1; i+=2)\n imgList.push(args[i+1]);\n } else if (args[1] == 'down' && args[args.length-1] != '0') {\n for (var i=3; i+1 < args.length-1; i+=2)\n imgList.push(args[i+1]);\n } else if (args[1] == 'over' && args[args.length-1] != '0') {\n for (var i=2; i+2 < args.length-1; i+=3) {\n imgList.push(args[i+1]);\n imgList.push(args[i+2]);\n }\n }\n if (imgList.length > 0)\n preloadUpdate(\"\", imgList, 0);\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to recursively build the proptype for shape | function buildShapePropType(validate) {
var args = {};
Object.keys(validate.args).forEach(function (arg) {
var element = validate.args[arg];
if (element.type && _react.PropTypes[element.type]) {
if (element.args) {
if (element.type === 'oneOfType') {
var elementArgs = getArgs(element.args);
args[arg] = _react.PropTypes[element.type](elementArgs);
} else if (element.type === 'shape') {
args[arg] = buildShapePropType(element);
} else {
args[arg] = getPropType(element);
}
} else {
args[arg] = _react.PropTypes[element.type];
}
} else if (element.type) {
throw new Error('docPropType: unknown type ' + element.type);
}
});
return _react.PropTypes[validate.type](args);
} | [
"static _create2DShape (typeofShape, width, depth, height, scene) {\n switch (typeofShape) {\n case 0:\n var faceUV = new Array(6)\n for (let i = 0; i < 6; i++) {\n faceUV[i] = new BABYLON.Vector4(0, 0, 0, 0)\n }\n faceUV[4] = new BABYLON.Vector4(0, 0, 1, 1)\n faceUV[5] = new BABYLON.Vector4(0, 0, 1, 1)\n \n var options = {\n width: width,\n height: height,\n depth: depth,\n faceUV: faceUV\n }\n\n return BABYLON.MeshBuilder.CreateBox('pin', options, scene)\n case 1:\n var faceUV2 = new Array(6)\n for (let i = 0; i < 6; i++) {\n faceUV2[i] = new BABYLON.Vector4(0, 0, 0, 0)\n }\n faceUV2[0] = new BABYLON.Vector4(0, 0, 1, 1)\n \n var options2 = {\n diameterTop: width,\n diameterBottom: depth,\n height: height,\n tessellation: 32,\n faceUV: faceUV2\n }\n\n return BABYLON.MeshBuilder.CreateCylinder('pin', options2, scene)\n }\n }",
"constructor(options) {\n /// @internal\n this.typeNames = [\"\"];\n /// @internal\n this.typeIDs = Object.create(null);\n /// @internal\n this.prop = new NodeProp();\n this.flags = options.flags;\n this.types = options.types;\n this.flagMask = Math.pow(2, this.flags.length) - 1;\n this.typeShift = this.flags.length;\n let subtypes = options.subtypes || 0;\n let parentNames = [undefined];\n this.typeIDs[\"\"] = 0;\n let typeID = 1;\n for (let type of options.types) {\n let match = /^([\\w\\-]+)(?:=([\\w-]+))?$/.exec(type);\n if (!match)\n throw new RangeError(\"Invalid type name \" + type);\n let id = typeID++;\n this.typeNames[id] = match[1];\n this.typeIDs[match[1]] = id;\n parentNames[id] = match[2];\n for (let i = 0; i < subtypes; i++) {\n let subID = typeID++, name = match[1] + \"#\" + (i + 1);\n this.typeNames[subID] = name;\n this.typeIDs[name] = subID;\n parentNames[subID] = match[1];\n }\n }\n this.parents = parentNames.map(name => {\n if (name == null)\n return 0;\n let id = this.typeIDs[name];\n if (id == null)\n throw new RangeError(`Unknown parent type '${name}' specified`);\n return id;\n });\n if (this.flags.length > 30 || this.typeNames.length > Math.pow(2, 30 - this.flags.length))\n throw new RangeError(\"Too many style tag flags to fit in a 30-bit integer\");\n }",
"function Shape(_type) {\n var type = _type;\n this.getType = function(){\n return type;\n }\n}",
"function untangle(schema, path) {\n var results = [];\n path = path || [];\n \n if (schema.properties) {\n //\n // Iterate over the properties in the schema and use recursion\n // to process sub-properties.\n //\n Object.keys(schema.properties).forEach(function (key) {\n var obj = {};\n obj[key] = schema.properties[key];\n \n //\n // Concat a sub-untangling to the results.\n //\n results = results.concat(untangle(obj[key], path.concat(key)));\n });\n \n // Return the results.\n return results;\n }\n \n //\n // This is a schema \"leaf\".\n //\n return {\n path: path,\n schema: schema\n };\n }",
"constructor(options) {\n /// @internal\n this.typeNames = [\"\"];\n /// @internal\n this.typeIDs = Object.create(null);\n /// @internal\n this.prop = new tree_es[\"c\" /* NodeProp */]();\n this.flags = options.flags;\n this.types = options.types;\n this.flagMask = Math.pow(2, this.flags.length) - 1;\n this.typeShift = this.flags.length;\n let subtypes = options.subtypes || 0;\n let parentNames = [undefined];\n this.typeIDs[\"\"] = 0;\n let typeID = 1;\n for (let type of options.types) {\n let match = /^([\\w\\-]+)(?:=([\\w-]+))?$/.exec(type);\n if (!match)\n throw new RangeError(\"Invalid type name \" + type);\n let id = typeID++;\n this.typeNames[id] = match[1];\n this.typeIDs[match[1]] = id;\n parentNames[id] = match[2];\n for (let i = 0; i < subtypes; i++) {\n let subID = typeID++, name = match[1] + \"#\" + (i + 1);\n this.typeNames[subID] = name;\n this.typeIDs[name] = subID;\n parentNames[subID] = match[1];\n }\n }\n this.parents = parentNames.map(name => {\n if (name == null)\n return 0;\n let id = this.typeIDs[name];\n if (id == null)\n throw new RangeError(`Unknown parent type '${name}' specified`);\n return id;\n });\n if (this.flags.length > 30 || this.typeNames.length > Math.pow(2, 30 - this.flags.length))\n throw new RangeError(\"Too many style tag flags to fit in a 30-bit integer\");\n }",
"extend(...props) {\n let newTypes = []\n for (let type of this.types) {\n let newProps = null\n for (let source of props) {\n let add = source(type)\n if (add) {\n if (!newProps) newProps = Object.assign({}, type.props)\n newProps[add[0].id] = add[1]\n }\n }\n newTypes.push(\n newProps\n ? new dist_NodeType(type.name, newProps, type.id, type.flags)\n : type\n )\n }\n return new NodeSet(newTypes)\n }",
"visitType_procedure_spec(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"function populateShapeImages() {\n\tlet lineThickness = 1;\n\t\n\tfor (let i = 0; i < shapeTypes.length; ++i) {\n\t\tlet curShape = shapeTypes[i];\n\t\tlet curPoints = shapePointNumbers[curShape];\n\t\tfor (let r = 0; r < shapeColors.length; ++r) {\n\t\t\tlet curColor = colorValues[shapeColors[r]];\n\t\t\t\n\t\t\t//prepare a new canvas for this shape\n\t\t\tlet shapeCnv = document.createElement(\"canvas\");\n\t\t\tshapeCnv.width = shapeDim;\n\t\t\tshapeCnv.height = shapeDim;\n\t\t\tlet shapeCtx = shapeCnv.getContext(\"2d\");\n\t\t\tshapeCtx.strokeStyle = \"#000000\";\n\t\t\tshapeCtx.lineWidth = 1;\n\t\t\tshapeCtx.beginPath();\n\t\t\t\n\t\t\t//add all of the points for this shape\n\t\t\tlet centerX = centerY = shapeDim/2;\n\t\t\tlet slice = 2 * Math.PI / curPoints;\n\t\t\t//multiply line thickness by 2 as a small buffer so that the shape outline is not partially cut off by the canvas edge\n\t\t\tlet radius = shapeDim/2-(lineThickness*2);\n\t\t\tfor (let k = 0; k < curPoints; ++k) {\n\t\t\t\tlet angle = -Math.PI / (curPoints == 3 ? 2 : 4) + slice * k;\n\t\t\t\tlet newX = (centerX + radius * Math.cos(angle));\n\t\t\t\tlet newY = (centerY + radius * Math.sin(angle));\n\t\t\t\tshapeCtx.lineTo(newX,newY);\n\t\t\t}\n\t\t\t\n\t\t\t//finalize the shape and add it to the images dict\n\t\t\tshapeCtx.closePath();\n\t\t\tshapeCtx.fillStyle = curColor;\n\t\t\tshapeCtx.fill();\n\t\t\tshapeCtx.stroke();\n\t\t\timages[shapeTypes[i] + shapeColors[r]] = shapeCnv;\n\t\t}\n\t}\n}",
"visitObject_type_def(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitType_definition(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"function divideFeaturesByType(shapes, properties, types) {\n var typeSet = utils.uniq(types);\n var layers = typeSet.map(function(geoType) {\n var p = [],\n s = [],\n dataNulls = 0,\n rec;\n\n for (var i=0, n=shapes.length; i<n; i++) {\n if (types[i] != geoType) continue;\n if (geoType) s.push(shapes[i]);\n rec = properties[i];\n p.push(rec);\n if (!rec) dataNulls++;\n }\n return {\n geometry_type: geoType,\n shapes: s,\n data: dataNulls < p.length ? new DataTable(p) : null\n };\n });\n return layers;\n}",
"function ensureValid(shape) {\n if (!Array.isArray(shape))\n throw new Error('expected an Array');\n if (shape.length < 3 || shape.length > 24)\n throw new Error('expected between 3 and 24 points inclusive, but got ' + shape.length);\n var minCorner = new Vec2(0,0), maxCorner = new Vec2(0,0);\n var haveN = false, haveE = false, haveS = false, haveW = false;\n var numOuterPoints = 0;\n var newShape = [];\n shape.forEach(p => {\n if (Array.isArray(p)) {\n if (p.length != 2)\n\tthrow new Error('expected exactly 2 coordinates for point, but got ' + p.length);\n p = new Vec2(p[0], p[1]);\n }\n if (!(p instanceof Vec2))\n throw new Error('expected an Array or Vec2 object but got ' + p);\n if (Math.abs(p.x) > 15)\n throw new Error('expected point to be within 15 pixels of the Y axis, but got ' + p);\n if (Math.abs(p.y) > 15)\n throw new Error('expected point to be within 15 pixels of the X axis, but got ' + p);\n if (p.y <= -8) haveN = true;\n if (p.x >= 8) haveE = true;\n if (p.y >= 8) haveS = true;\n if (p.x <= -8) haveW = true;\n if (p.magnitude() >= 8) numOuterPoints++;\n if (p.x < minCorner.x) minCorner.x = p.x;\n if (p.y < minCorner.y) minCorner.y = p.y;\n if (p.x > maxCorner.x) maxCorner.x = p.x;\n if (p.y > maxCorner.y) maxCorner.y = p.y;\n newShape.push(p);\n });\n var dims = maxCorner.subtract(minCorner);\n var dimSum = dims.x + dims.y;\n if (dimSum < 38)\n throw new Error('expected width + height to be at least 38, but got ' + dims.x + ' + ' + dims.y + ' = ' + dimSum);\n return newShape;\n}",
"add(shape) {\n // store shape offset\n var offset = shape.__position;\n\n // reset shapes list cache\n this.__shapes_list_c = void 0;\n\n // add shape to list of shapes and fix position\n this.__shapes.push({\n shape: shape,\n offset: offset.clone()\n });\n shape.set_position(this.__position.add(offset));\n\n // reset bounding-box\n this.reset_aabb();\n\n // set shape tags to be the composite shape tags\n shape.__collision_tags_val = this.__collision_tags_val;\n shape.__collision_tags = this.__collision_tags;\n\n // set shape debug colors\n shape.__override_fill_color = this.__override_fill_color;\n shape.__override_stroke_color = this.__override_stroke_color;\n\n // return the newly added shape\n return shape;\n }",
"function buildTopology(dataset) {\n if (!dataset.arcs) return;\n var raw = dataset.arcs.getVertexData(),\n cooked = buildPathTopology(raw.nn, raw.xx, raw.yy);\n dataset.arcs.updateVertexData(cooked.nn, cooked.xx, cooked.yy);\n dataset.layers.forEach(function(lyr) {\n if (lyr.geometry_type == 'polyline' || lyr.geometry_type == 'polygon') {\n lyr.shapes = replaceArcIds(lyr.shapes, cooked.paths);\n }\n });\n}",
"visitSqlj_object_type_attr(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"function annotationFromSchema (inputJsonSchema){\n\nvar _schema={};\n_schema.singleFields=[];\n_schema.groupFields=[];\n_schema.repeatingFields=[];\ndefaultEntry={};\n\n jQuery.each(inputJsonSchema.properties,\n function(i, val) {\n \t_schema.singleFields.unshift({name:i ,label: val.description ? val.description : i, placeholder: i, type: val.type, required: val.required ? val.required : undefined });\n \n});\nreturn _schema;\n}",
"build(polygons) {\n\t\tif (!polygons.length) return;\n\t\tif (!this.plane) this.plane = polygons[0].plane.clone();\n\t\tlet front = [],\n\t\t\tback = [];\n\t\tfor (let i = 0; i < polygons.length; i++) {\n\t\t\tthis.plane.splitPolygon(polygons[i], this.polygons, this.polygons, front, back);\n\t\t}\n\t\tif (front.length) {\n\t\t\tif (!this.front) this.front = new Node();\n\t\t\tthis.front.build(front);\n\t\t}\n\t\tif (back.length) {\n\t\t\tif (!this.back) this.back = new Node();\n\t\t\tthis.back.build(back);\n\t\t}\n\t}",
"visitSqlj_object_type(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitType_spec(ctx) {\n\t return this.visitChildren(ctx);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Finds the closest injector that might have a certain directive. Each directive corresponds to a bit in an injector's bloom filter. Given the bloom bit to check and a starting injector, this function traverses up injectors until it finds an injector that contains a 1 for that bit in its bloom filter. A 1 indicates that the injector may have that directive. It only may have the directive because directives begin to share bloom filter bits after the BLOOM_SIZE is reached, and it could correspond to a different directive sharing the bit. Note: We can skip checking further injectors up the tree if an injector's cbf structure has a 0 for that bloom bit. Since cbf contains the merged value of all the parent injectors, a 0 in the bloom bit indicates that the parents definitely do not contain the directive and do not need to be checked. | function bloomFindPossibleInjector(startInjector, bloomBit) {
// Create a mask that targets the specific bit associated with the directive we're looking for.
// JS bit operations are 32 bits, so this will be a number between 2^0 and 2^31, corresponding
// to bit positions 0 - 31 in a 32 bit integer.
var mask = 1 << bloomBit;
// Traverse up the injector tree until we find a potential match or until we know there *isn't* a
// match.
var injector = startInjector;
while (injector) {
// Our bloom filter size is 256 bits, which is eight 32-bit bloom filter buckets:
// bf0 = [0 - 31], bf1 = [32 - 63], bf2 = [64 - 95], bf3 = [96 - 127], etc.
// Get the bloom filter value from the appropriate bucket based on the directive's bloomBit.
var value = void 0;
if (bloomBit < 128) {
value = bloomBit < 64 ? (bloomBit < 32 ? injector.bf0 : injector.bf1) :
(bloomBit < 96 ? injector.bf2 : injector.bf3);
}
else {
value = bloomBit < 192 ? (bloomBit < 160 ? injector.bf4 : injector.bf5) :
(bloomBit < 224 ? injector.bf6 : injector.bf7);
}
// If the bloom filter value has the bit corresponding to the directive's bloomBit flipped on,
// this injector is a potential match.
if ((value & mask) === mask) {
return injector;
}
// If the current injector does not have the directive, check the bloom filters for the ancestor
// injectors (cbf0 - cbf7). These filters capture *all* ancestor injectors.
if (bloomBit < 128) {
value = bloomBit < 64 ? (bloomBit < 32 ? injector.cbf0 : injector.cbf1) :
(bloomBit < 96 ? injector.cbf2 : injector.cbf3);
}
else {
value = bloomBit < 192 ? (bloomBit < 160 ? injector.cbf4 : injector.cbf5) :
(bloomBit < 224 ? injector.cbf6 : injector.cbf7);
}
// If the ancestor bloom filter value has the bit corresponding to the directive, traverse up to
// find the specific injector. If the ancestor bloom filter does not have the bit, we can abort.
injector = (value & mask) ? injector.parent : null;
}
return null;
} | [
"function countOrbits (part, mapStr) {\n\n const map = mapStr.split('\\n');\n\n // COMMON: CREATE CHILDREN HASH MAP OF {CENTER: [...ORBITERS]} AND PARENTS HASH MAP OF {ORBITER: CENTER}\n const children = {};\n const parents = {}; // for part 2\n for (const orbit of map) {\n const [center, orbiter] = orbit.split(')');\n if (!(center in children)) children[center] = [];\n children[center].push(orbiter);\n parents[orbiter] = center; // for part 2\n }\n\n // PART 1 VS PART 2\n if (part === 1) {\n\n // STARTING WITH COM, USE DFS (USING HELPER) TO NAVIGATE TREE AND CALCULATE TOTALS\n let total = 0;\n function helper (currentBody, numOrbits) { // numOrbits is the sum of direct and indirect orbits\n total += numOrbits;\n if (currentBody in children) {\n for (const child of children[currentBody]) {\n helper(child, numOrbits + 1); // every body has 1 direct orbit, and n + 1 indirect orbits if its parent has n indirect orbits. therefore total orbits will be 1 greater than parent\n }\n }\n }\n helper('COM', 0); // instantiate helper function starting with COM, which has 0 direct orbits and 0 indirect orbits for a total of 0\n return total;\n\n } else {\n\n const yourPosition = parents['YOU'];\n const santaPosition = parents['SAN'];\n\n // USE BFS STARTING FROM YOUR POSITION UNTIL YOU FIND SANTA\n const queue = [[yourPosition, null, 0]];\n while (true) { // if there are no bugs then there should be a return at some point!\n const [currentBody, origin, distanceTraveled] = queue.shift(); // origin is the body you came from to get to where you are now - needed so it doesn't retraverse that child or parent\n if (currentBody === santaPosition) return distanceTraveled; // stop condition: when you are finally at the same place as santa\n if (currentBody in parents && parents[currentBody] !== origin) { // need to check both that you have a parent (COM has no parent) and that parent is not origin to avoid backtracking\n queue.push([parents[currentBody], currentBody, distanceTraveled + 1]);\n }\n if (currentBody in children) {\n for (const child of children[currentBody]) {\n if (child !== origin) { // do not push an origin into the queue\n queue.push([child, currentBody, distanceTraveled + 1]);\n }\n }\n }\n }\n \n }\n}",
"function traverseToRealDifficulty (block, chain, cb) {\n var traverse = (err, prev) => {\n if (err) return cb(err)\n var onInterval = prev.height % this.interval === 0\n if (onInterval || prev.header.bits !== this.genesisHeader.bits) {\n return cb(null, prev)\n }\n chain.getBlock(prev.header.prevHash, traverse)\n }\n chain.getBlock(block.header.prevHash, traverse)\n}",
"function diffuseBomb(input){\n let params = {\n white: ['purple', 'green', 'red', 'orange'],\n red: ['green'],\n black: ['red','black','purple'],\n orange: ['red','black'],\n green: ['orange', 'white'],\n purple: ['black','red']\n };\n function lookAtWire(cut){\n let [current, next] = cut;\n return !next || params[current].includes(next) && diffuseBomb(cut.slice(1));\n }\n return lookAtWire(input.split('\\n')) ? \"Diffused\" : \"Boom\";\n}",
"closestOpenPosn(posn) {\n\t\t//bfs starting from posn\n\t\tvar searchQueue = [posn];\n\t\tvar blacklist = [];\n\t\twhile (searchQueue.length > 0) {\n\t\t\tvar searching = searchQueue.pop();\n\t\t\tvar searchingSquare = this.get(searching);\n\t\t\t//is it a posn we're looking for?\n\t\t\tif (searchingSquare && (!searchingSquare.content || !searchingSquare.content.isObstacle)) {\n\t\t\t\treturn searching; //we found what we're looking for!\n\t\t\t}\n\t\t\t//otherwise, add the current posn to blacklist and keep searching\n\t\t\tblacklist.push(searching);\n\t\t\tvar adjacents = shuffle(this.getExistingAdjacentPosns(searching));\n\t\t\tadjacents.forEach(function(p) { //add every posn in adjacents to the searchQueue\n\t\t\t\tvar posnEqualToCurPos = function(otherPos) {\n\t\t\t\t\treturn otherPos.x == p.x && otherPos.y == p.y;\n\t\t\t\t}\n\t\t\t\t//but only if it's not been blacklisted!\n\t\t\t\tif (blacklist.filter(posnEqualToCurPos).length == 0) {\n\t\t\t\t\tsearchQueue.unshift(p);\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t}",
"find(p) {\n //find the root of the component\n let root = p;\n while (root != this.id[root]) {\n root = this.id[root];\n }\n //compress the path leading back to the root\n //doing this operation is called path compresion\n //and is what gives us amortized constant time complexity\n while (p != root) {\n let next = this.id[p];\n this.id[p] = root;\n p = next;\n }\n\n return root;\n }",
"function findNearestNodeEl(el) {\n while (el !== document.body && !el.classList.contains('blocks-node')) {\n el = el.parentNode;\n }\n return el === document.body? null : el;\n}",
"function findFloor(elevatorState, startingElevator) {\n for (let i = 0; i < elevatorState.length; i++) {\n if (elevatorState[i].includes(startingElevator)) {\n return i;\n }\n }\n}",
"static htmlWalker (cb, element) {\n if (!cb)\n return;\n \n if (!element)\n element = document.getElementsByTagName ('body')[0];\n \n for (let i = 0; i < element.childElementCount; ++ i) {\n const child = element.children[i];\n \n if (!cb (child))\n Component.htmlWalker (cb, child);\n }\n }",
"function greatestCommonDevisor(a, b){\n if (!b) return a;\n\n return greatestCommonDevisor(b, a % b)\n\n}",
"function findDoors()\n{\n for (i = 1; i <= config.DoorCount; i++)\n {\n for (j = 0; j < config.Plans.length; j++)\n {\n var a = document.getElementById(config.Plans[j].Name);\n if (a == null)\n continue;\n var svgDoc = a.contentDocument;\n var element = svgDoc.getElementById(\"DOOR_\" + i + \"_OPEN\");\n if (element != null)\n doorIdToPlan[i] = config.Plans[j].Name;\n }\n }\n}",
"function parseBamHeader(r) {\n if (!r) {\n return callback(null, \"Couldn't access BAM\");\n }\n\n var unc = unbgzf(r, r.byteLength);\n var uncba = new Uint8Array(unc);\n\n var magic = readInt(uncba, 0);\n\n if (magic != BAM_MAGIC) {\n return callback(null, \"Not a BAM file, magic=0x\" + magic.toString(16));\n }\n\n var headLen = readInt(uncba, 4);\n var header = '';\n\n for (var i = 0; i < headLen; ++i) {\n header += String.fromCharCode(uncba[i + 8]);\n }\n\n var nRef = readInt(uncba, headLen + 8);\n var p = headLen + 12;\n\n bam.chrToIndex = {};\n bam.indexToChr = [];\n\n for (var i = 0; i < nRef; ++i) {\n var lName = readInt(uncba, p);\n var name = '';\n\n for (var j = 0; j < lName - 1; ++j) {\n name += String.fromCharCode(uncba[p + 4 + j]);\n }\n\n var lRef = readInt(uncba, p + lName + 4);\n bam.chrToIndex[name] = i;\n\n if (name.indexOf('chr') == 0) {\n bam.chrToIndex[name.substring(3)] = i;\n } else {\n bam.chrToIndex['chr' + name] = i;\n }\n\n bam.indexToChr.push(name);\n\n p = p + 8 + lName;\n }\n\n if (bam.indices) {\n return callback(bam);\n }\n }",
"function filterBlood (blood){\n return blood.bloodType == inputValue\n }",
"function findSpecialIdx(vms) {\n var prediction = 100;\n var breakPoint = 50; //one higher than where it should weigh again\n var moveBy; //moves breakpoint\n var condition = 'not done'; //changes to int when finished\n var startIndex = 0;\n function setBreakPoint(direction, i){\n if (breakPoint - 1 === startIndex && (direction == 'down')){ //end game condition\n return startIndex; //index of vMachine that has heavy bars\n }\n moveBy = Math.ceil((breakPoint - startIndex) / 2);\n if (direction == 'up') {\n breakPoint += moveBy;\n startIndex = i + 1;\n } else {\n breakPoint -= moveBy;\n }\n return 'not done';\n }\n for (var i = 0 ; i < 100 ; i++) {\n vms[i].vend();\n if (i == breakPoint - 1) { //if at midpoint\n if (vms.weigh() != prediction) { //if there is a heavy candy bar in the newest set\n prediction += 1; //new candy bar in pile\n condition = setBreakPoint('down', i); //@end index\n i = startIndex - 1;\n } else {\n condition = setBreakPoint('up', i);\n }\n }\n if (condition != 'not done') {\n vms[condition].vend();\n return condition;\n }\n prediction += 100; //vms.weigh() weighs total pile so every iteration adds 100\n }\n}",
"function hasBloodPressureMatchingIndicators() {\n var bpSystolic = Number.MAX_VALUE;\n var bpDiastolic = Number.MAX_VALUE;\n for (var i = 0; i < vitalSignList.length; i++) {\n if (vitalSignList[i].includesCodeFrom(targetBloodPressureSystolicCodes) &&\n vitalSignList[i].timeStamp() > start) {\n if (vitalSignList[i].values()[0].units() !== null &&\n vitalSignList[i].values()[0].units().toLowerCase() === \"mm[Hg]\".toLowerCase()) {\n if(vitalSignList[i].values()[0].scalar() < bpSystolic) {\n bpSystolic = vitalSignList[i].values()[0].scalar();\n }\n }\n } else if (vitalSignList[i].includesCodeFrom(targetBloodPressureDiastolicCodes) &&\n vitalSignList[i].timeStamp() > start) {\n if (vitalSignList[i].values()[0].units() !== null &&\n vitalSignList[i].values()[0].units().toLowerCase() === \"mm[Hg]\".toLowerCase()) {\n if(vitalSignList[i].values()[0].scalar() < bpDiastolic) {\n bpDiastolic = vitalSignList[i].values()[0].scalar();\n }\n }\n }\n\n if (bpSystolic > 0 && bpDiastolic > 0 &&\n bpSystolic <= bpSystolicLimit && bpDiastolic <= bpDiastolicLimit) {\n return true\n }\n }\n return false;\n }",
"bisect(t, b) {\n const tms = t.getTime();\n const size = this.size();\n let i = b || 0;\n\n if (!size) {\n return undefined;\n }\n\n for (; i < size; i++) {\n const ts = this.at(i).timestamp().getTime();\n if (ts > tms) {\n return i - 1 >= 0 ? i - 1 : 0;\n } else if (ts === tms) {\n return i;\n }\n }\n return i - 1;\n }",
"findForcedReduction() {\n let { parser } = this.p,\n seen = []\n let explore = (state, depth) => {\n if (seen.includes(state)) return\n seen.push(state)\n return parser.allActions(state, (action) => {\n if (\n action &\n (262144 /* Action.StayFlag */ | 131072) /* Action.GotoFlag */\n );\n else if (action & 65536 /* Action.ReduceFlag */) {\n let rDepth = (action >> 19) /* Action.ReduceDepthShift */ - depth\n if (rDepth > 1) {\n let term = action & 65535 /* Action.ValueMask */,\n target = this.stack.length - rDepth * 3\n if (\n target >= 0 &&\n parser.getGoto(this.stack[target], term, false) >= 0\n )\n return (\n (rDepth << 19) /* Action.ReduceDepthShift */ |\n 65536 /* Action.ReduceFlag */ |\n term\n )\n }\n } else {\n let found = explore(action, depth + 1)\n if (found != null) return found\n }\n })\n }\n return explore(this.state, 0)\n }",
"function findContainingTiddler(e)\n{\n\tif(e == null)\n\t\treturn(null);\n\tdo {\n\t\tif(e != document)\n\t\t\t{\n\t\t\tif(e.id)\n\t\t\t\tif(e.id.substr(0,7) == \"tiddler\")\n\t\t\t\t\treturn(e);\n\t\t\t}\n\t\te = e.parentNode;\n\t} while(e != document);\n\treturn(null);\n}",
"function get_BasePart_Energy(pos_i, int_seq)\n{\n var bp_i; // assignment of the base\n var size; // loop size\n var pos_BP_vor, pos_BP_nach; // pos. of the BPs that enclose the free base (in BP_Order)\n var i, j;\n var group_i, group_j; // left and right border of the group of free bases where the consideres free base (pos_i) is located\n\n // ATTENTION!!: PREDECESSOR AND SUCCESSOR BP DON'T HAVE THE SAME MEANING AS FOR BPs! HERE THE BPs ARE NOT \n // PREDECESSOR AND SUCCESSOR TO EACH OTHER AUTOMATICALLY!\n\n bp_i = int_seq[pos_i];\n\n //finding the group of free bases\n //+++++++++++++++++++++++++++++++++++++++++++\n i = pos_i;\n while ((0<=i) && (brackets[i] == '.'))\n i--;\n group_i = i+1;\n\n j = pos_i;\n while ((j<struct_len) && (brackets[j] == '.'))\n j++;\n group_j = j-1;\n\n // if the free base is not adjacent to a stem, it has no influence on the energy\n // thus, return 0.0 + penalty\n //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n if ((pos_i == 0) && (brackets[pos_i+1] == '.'))\n return Sum_MaxDouble(0.0,BasePenalty(pos_i, int_seq[pos_i]));\n else if ((pos_i == struct_len-1) && (brackets[pos_i-1] == '.'))\n return Sum_MaxDouble(0.0,BasePenalty(pos_i, int_seq[pos_i]));\n else if ((brackets[pos_i-1] == '.') && (brackets[pos_i+1] == '.'))\n return Sum_MaxDouble(0.0,BasePenalty(pos_i, int_seq[pos_i]));\n\n else\n {\n // EL (- G i) or (i G -)\n if ((group_i == 0) || (group_j == struct_len-1))\n {\n return externEnergy(int_seq);\n }\n\n pos_BP_vor = BP_Pos_Nr[group_i-1];\n pos_BP_nach = BP_Pos_Nr[group_j+1];\n\n // in HairpinLoop\n if (pos_BP_vor == pos_BP_nach)\n {\n size = BP_Order[pos_BP_vor][1] - BP_Order[pos_BP_vor][0] - 1;\n return HairpinLoopEnergy(size,BP_Order[pos_BP_vor][0],int_seq);\n }\n\n // free base is right in a BL or IL or ML, pos_BP_nach = closingML\n else if ((brackets[group_i-1] == ')') && (brackets[group_j+1] == ')'))\n {\n return getPartEnergy(pos_BP_nach, pos_BP_vor, int_seq);\n }\n\n // free base if left in a BL or IL or ML, pos_BP_vor = closingBP\n else if ((brackets[group_i-1] == '(') && (brackets[group_j+1] == '('))\n {\n //if (BP_Order[pos_BP_nach][3] == 0) ==> BL or IL (left);\n //else ==> ML, closingBP = pos_BP_nach\n // getPartEnergy can be used, since pos_BP_vor and pos_BP_nach are neighbors\n\n // HERE: pos_BP_nach is predecessor of pos_BP_vor\n return getPartEnergy(pos_BP_vor, pos_BP_nach, int_seq);\n }\n else if (BP_Successors[pos_BP_vor] == BP_Successors[pos_BP_nach])\n {\n //ML\n if (BP_Successors[pos_BP_vor] != numBP)\n return MLEnergy(BP_Successors[pos_BP_vor],int_seq);\n //EL\n else\n return externEnergy(int_seq);\n }\n\n //forgotten cases\n else\n {\n out(\"Pos: %d => Forgotten cases!\\n\", pos_i);\n return 0;\n }\n } // else\n}",
"listOfAncestorsToBeLoadedForLevel(numGens = 10) {\n let theList = [];\n let maxNum = this.list.length;\n let maxNumInGen = 2 ** numGens;\n let theMax = Math.min(maxNum, maxNumInGen);\n\n let minNum = 1;\n let minNumInGen = 2 ** (numGens - 1);\n let theMin = Math.max(minNum, minNumInGen);\n\n for (var i = theMin; i < theMax; i++) {\n if (this.list[i] && this.list[i] > 0 && thePeopleList[this.list[i]]) {\n let thePeep = thePeopleList[this.list[i]];\n if (thePeep._data.Father && thePeep._data.Father > 0 && theList.indexOf(thePeep._data.Father) == -1) {\n if (thePeopleList[thePeep._data.Father]) {\n // father already exists, so don't need to re-load him\n } else {\n theList.push(thePeep._data.Father);\n }\n }\n if (thePeep._data.Mother && thePeep._data.Mother > 0 && theList.indexOf(thePeep._data.Mother) == -1) {\n if (thePeopleList[thePeep._data.Mother]) {\n // Mother already exists, so don't need to re-load her\n } else {\n theList.push(thePeep._data.Mother);\n }\n }\n\n // condLog(\"--> PUSHED !\",thisAncestor.ahnNum, thisAncestor.person._data.Id);\n }\n }\n condLog(\"listOfAncestorsToBeLoadedForLevel has \", theList.length, \" ancestors.\");\n return theList;\n }",
"function offsetScrollForSticky() {\n // Ignore if there's no search bar (some special pages have no header)\n if ($(\"#search-container\").length < 1) return;\n\n var hash = escape(location.hash.substr(1));\n var $matchingElement = $(\"#\"+hash);\n // Sanity check that there's an element with that ID on the page\n if ($matchingElement.length) {\n // If the position of the target element is near the top of the page (<20px, where we expect it\n // to be because we need to move it down 60px to become in view), then move it down 60px\n if (Math.abs($matchingElement.offset().top - $(window).scrollTop()) < 20) {\n $(window).scrollTop($(window).scrollTop() - 60);\n }\n }\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a new result from its label and stores it in memory. | createOrGetResult( label) {
if ( !this.RESULTS[label])
this.RESULTS[label] = new Result(label);
return this.RESULTS[label];
} | [
"static makeNew() {\n\t\t// static helper.\n\t\treturn new JrResult();\n\t}",
"function newTaskLabel(taskText) {\n\tvar taskLabel = $(document.createElement(\"LABEL\"));\n\tvar text = $(document.createTextNode(taskText));\n\ttaskLabel.append(text);\n\treturn taskLabel;\n}",
"recycleByLabel(label) {\n return spPost(Versions(this, `recycleByLabel(versionlabel='${encodePath(label)}')`));\n }",
"function createIssueLabel(labelName , projName){\n return {\n labelName : labelName,\n projname : projName\n }\n}",
"getANodeWithLabelAndIdentity(label, identity) {\n let task;\n if(label == 'PERSON') task = session.run(`MATCH (N:${label}) WHERE N.name = '${identity}' RETURN N `)\n else if(label == 'MOVIE') task = session.run(`MATCH (N:${label}) WHERE N.title = '${identity}' RETURN N`)\n return task.then(result => createFlatProps(result.records[0].get('N').properties));\n }",
"addResult(result){\n this.results.push(result.state);\n }",
"function addTranslationToResults(results, translation) {\n var tempResult = {\n success: translation.success,\n errorMessage: translation.errorMessage,\n language: translation.target.language,\n text: translation.target.text\n };\n results.targets.push(tempResult);\n}",
"function addResult( $result ) {\n\t\tif ( Util.elementCount( $result ) === 0 ) { return };\n\t\t$results = $results.add( $result );\n\t}",
"function crearLabel(id) {\n let label = document.createElement(\"LABEL\");\n label.setAttribute(\"for\", id);\n label.innerHTML = id;\n return label;\n\n}",
"getAllNodesWithLabel(label) {\n let task = session.run(`MATCH (N:${label}) RETURN N` ), records = [];\n return task.then(result => {\n result.records.forEach(record => records.push(createFlatProps(record.get('N').properties)));\n return records;\n })\n }",
"function translateResourceLabel(terms){\n var name = terms[0].terms[0].predicate;\n var label = terms[1].predicate;\n var readWriteValue = \"private\"\n if(terms[2] !== undefined){\n //if it has a read write value\n readWriteValue = terms[2].predicate;\n }\n return {\"l\": [name], \"relation\":\"has_label\", \"r\":[label], \"readWrite\" : readWriteValue}\n //return translateSimpleTriple(\"has_label\",terms);\n }",
"async function createLabel(owner, repo, label) {\n // convert from GitLab to GitHub\n let ghLabel = {\n owner: settings.github.owner,\n repo: settings.github.repo,\n name: label.name,\n color: label.color.substr(1) // remove leading \"#\" because gitlab returns it but github wants the color without it\n };\n\n await sleep(2000);\n\n if (settings.debug) return Promise.resolve();\n // create the GitHub label\n return await github.issues.createLabel(ghLabel);\n}",
"function TLabel(){}",
"function MessageForJob(job_label/*TYPES.string.address()*/, operation /*TYPES.char.ptr*/) {\n\t// launch_data_alloc returns something that needs to be freed.\t\n\tvar message = launch_data_alloc(CONSTS.LAUNCH_DATA_DICTIONARY);\n\tconsole.info('message:', message, message.toString(), uneval(message));\n\t\n\tif (message.isNull()) {\n\t\tconsole.warn('message.isNull so returning null');\n\t\treturn CONSTS.NULL;\n\t}\n\t\n\t// launch_data_new_string returns something that needs to be freed, but\n\t// the dictionary will assume ownership when launch_data_dict_insert is\n\t// called, so put it in a scoper and .release() it when given to the\n\t// dictionary.\n\tvar job_label_launchd = launch_data_new_string(job_label);\n\tconsole.info('job_label_launchd:', job_label_launchd, job_label_launchd.toString(), uneval(job_label_launchd));\n\tif (job_label_launchd.isNull()) {\n\t\tconsole.warn('job_label_launchd.isNull so returning null');\n\t\treturn CONSTS.NULL;\n\t}\n\t\n\tvar rez_launch_data_dict_insert = launch_data_dict_insert(message, job_label_launchd/*.release()*/, operation);\n\tconsole.info('rez_launch_data_dict_insert:', rez_launch_data_dict_insert, rez_launch_data_dict_insert.toString(), uneval(rez_launch_data_dict_insert));\n\tif (!rez_launch_data_dict_insert) {\n\t\tconsole.warn('rez_launch_data_dict_insert.isNull so returning null');\n\t\treturn CONSTS.NULL;\n\t}\n\t\n\tvar rez_launch_msg = launch_msg(message);\n\tconsole.info('rez_launch_msg:', rez_launch_msg, rez_launch_msg.toString(), uneval(rez_launch_msg));\n\t\n\treturn rez_launch_msg;\n}",
"set result(newResult) {\n this._result = newResult;\n setValue(`cmi.interactions.${this.index}.result`, newResult);\n }",
"function getResponseValueObject(label, value) {\n var responseValueObject = {};\n responseValueObject[\"value\"] = label;\n\n if (value != \"\") {\n responseValueObject[\"input\"] = \"textbox\";\n } else {\n responseValueObject[\"input\"] = \"radio\";\n }\n return responseValueObject;\n }",
"addOrGetExperience( label) {\n\t\tif (!this.EXPERIENCES[label])\n\t\t\tthis.EXPERIENCES[label] = this.createExperience(label);\n\t\treturn this.EXPERIENCES[label];\n\t}",
"function setResult(context, value) {\n return new Promise(function (resolve) {\n context.result = value;\n context.hasResult = true;\n resolve(context);\n });\n }",
"function resultElements(element, resultClass, resultNumber, resultTitle, newElement) {\n //show numbers for correct, incorrect, and unanswered\n element = $(\"<div>\").addClass(resultClass).append(\"<h2>\" + resultNumber + \"</h2><h4>\" + resultTitle + \"</h4>\");\n newElement = $(\"<div>\").addClass(\"total\").append(element);\n $(finalResults).append(newElement);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
hide the mood panorama selector | function hideMoodSelection()
{
document.getElementById("mood-panorama-page").style.visibility = "hidden";
} | [
"function unhide()\r\n{\r\n if (document.querySelector('.pumpkin').style.visibility == \"visible\")\r\n {\r\n document.querySelector('.pumpkin').style.visibility = \"hidden\";\r\n }\r\n else\r\n {\r\ndocument.querySelector('.pumpkin').style.visibility = \"visible\";\r\n }\r\n}",
"function hideGeoportalView() {\n var gppanel= viewer.getVariable('gppanel');\n gppanel.style.visibility= 'hidden';\n gppanel.style.position= 'absolute';\n gppanel.style.top= '-9999px';\n gppanel.style.left= '-9999px';\n}",
"function hidePlayer() {\r\n setBlockVis(\"annotations\", \"none\");\r\n setBlockVis(\"btnAnnotate\", \"none\");\r\n if (hideSegmentControls == true) { setBlockVis(\"segmentation\", \"none\"); }\r\n setBlockVis(\"player\", \"none\");\r\n}",
"function hideLanding() {\r\n let videoBox = document.getElementById('video-box');\r\n let textBar = document.getElementById('text-bar');\r\n let explainerBox = document.getElementById('explainer-box');\r\n let buttonBox = document.getElementById('btn-holder');\r\n let footBox = document.getElementById('foot-holder');\r\n let equalSign = document.getElementById('equal')\r\n \r\n videoBox.classList.add('hidden');\r\n textBar.classList.add('hidden');\r\n explainerBox.classList.add('hidden');\r\n buttonBox.classList.add('hidden');\r\n footBox.classList.add('hidden');\r\n equalSign.classList.add('hidden')\r\n hideChildElements(videoBox)\r\n hideChildElements(textBar)\r\n hideChildElements(explainerBox)\r\n hideChildElements(buttonBox)\r\n hideChildElements(footBox);\r\n }",
"hide() {\n\t\tthis.element.style.visibility = 'hidden';\n\t}",
"hideVisit() {\n\t\tthis.modalContainer.classList.remove(\"visible\");\n\t}",
"function participants_view_hide() {\n\tDOM(\"PARTICIPANTS_CLOSE\").style.backgroundColor = \"rgba(0,0,0,.2)\";\n\tsetTimeout(function() {\n\t\tDOM(\"PARTICIPANTS_CLOSE\").style.backgroundColor = \"transparent\";\n\t\tparticipants_view_visible = false;\n\t\tDOM(\"PARTICIPANTS_VIEW\").style.top = \"-100%\";\n\t\tsetTimeout(function() {\n\t\t\tDOM(\"PARTICIPANTS_VIEW\").style.display = \"none\";\n\t\t}, 500);\n\t}, 50);\n}",
"hideControls_() {\n this.overlay_.setAttribute('i-amphtml-lbg-fade', 'out');\n this.controlsMode_ = LightboxControlsModes.CONTROLS_HIDDEN;\n }",
"hide() {\n\n let svm = symbologyViewModel;\n let vm = this;\n\n svm.dictionary[svm.currentTab][vm.currentTypologyCode].isRadarDiagramVisible =\n !svm.dictionary[svm.currentTab][vm.currentTypologyCode].isRadarDiagramVisible;\n\n this.isVisible = false;\n\n $('#radarContainerVM').addClass('collapse');\n\n Spatial.sidebar.open('map-controls');\n\n $('#sidebar').removeClass('invisible');\n $('#sidebar').addClass('visible');\n\n }",
"function hideOVLayer(name) {\t\t\n \tvar layer = getOVLayer(name);\t\t\n \tif (isNav4)\n \tlayer.visibility = \"hide\";\n \t//if (document.all)\n\telse\n \t layer.visibility = \"hidden\";\n\t //layer.display=\"block\";\n}",
"function hideSettings() {\n $(\"#searchOptionsBox\").removeClass(\"visible\");\n zdPage.modalHidden();\n // Re-enable tooltip, unless we have a touch screen\n if (!zdPage.isTouch()) $(\".btnSettings\").tooltipster('enable');\n }",
"hide() {\n\t\tlet _ = this\n\n\t\t_.timepicker.overlay.classList.add('animate')\n\t\t_.timepicker.wrapper.classList.add('animate')\n\t\tsetTimeout(function () {\n\t\t\t_._switchView('hours')\n\t\t\t_.timepicker.overlay.classList.add('hidden')\n\t\t\t_.timepicker.overlay.classList.remove('animate')\n\t\t\t_.timepicker.wrapper.classList.remove('animate')\n\n\t\t\tdocument.body.removeAttribute('mdtimepicker-display')\n\n\t\t\t_.visible = false\n\t\t\t_.input.focus()\n\n\t\t\tif (_.config.events && _.config.events.hidden)\n\t\t\t\t_.config.events.hidden.call(_)\n\t\t}, 300)\n\t}",
"function hide() {\n if (!settings.shown) return;\n win.hide();\n settings.shown = false;\n }",
"hide() {\n this.StartOverPopoverBlock.remove();\n this.StartOverPopoverDiv.remove();\n }",
"_hide() {\n this._updateTriggerWidth();\n if (this._settings.get_boolean('dock-fixed')) {\n return;\n }\n\n if (this._isHovering() || (this._hoveringDash && !Main.overview._shown)) {\n return;\n }\n\n let intellihideAction = this._settings.get_enum('intellihide-action');\n if (!Main.overview._shown && intellihideAction == IntellihideAction.SHOW_FULL && !this._autohideStatus) {\n return;\n }\n\n let overviewAction = this._settings.get_enum('overview-action');\n if (Main.overview._shown && overviewAction == OverviewAction.SHOW_FULL && !this._autohideStatus) {\n return;\n }\n\n // Only hide if dock is shown, is showing, or is partially shown\n if (this._dockState == DockState.SHOWN || this._dockState == DockState.SHOWING || this._slider.slidex > 0) {\n this._removeAnimations();\n\n // If the dock is shown, wait this._settings.get_double('show-delay') before hiding it;\n // otherwise hide it immediately.\n let delay = 0;\n if (this._dockState == DockState.SHOWN)\n delay = this._settings.get_double('hide-delay');\n\n if (Main.overview._shown && Main.overview.viewSelector._activePage == Main.overview.viewSelector._workspacesPage) {\n this._animateOut(this._settings.get_double('animation-time'), delay, false);\n } else {\n this._animateOut(this._settings.get_double('animation-time'), delay, this._autohideStatus);\n }\n }\n }",
"function showMoodSelection()\n{\n // set the panorama to start at the user's last logged mood\n document.getElementById(\"mood-panorama-page\").value = currentMood;\n // show the mood selection window\n setTimeout(function() { switchScreens(activeWindow, document.getElementById(\"mood-selection-screen\")); }, 250);\n // show the mood panorama selector with an increased latency for a smooth transition\n setTimeout(function() { document.getElementById(\"mood-panorama-page\").style.visibility = \"visible\"; }, 300);\n}",
"function ViewerToolsHide() {\r\n if( G.VOM.viewerDisplayed ) {\r\n G.VOM.toolbarsDisplayed=false;\r\n ViewerToolsOpacity(0);\r\n }\r\n }",
"function hideUI() {\n document.getElementById(\"options\").classList.add(\"hidden\");\n document.getElementById(\"fullelement\").classList.add(\"hidden\");\n document.getElementById(\"memorywindow\").classList.add(\"hidden\");\n}",
"function hideLayers(evt) {\r\n dialogLayer.style.display = \"none\";\r\n maskLayer.style.display = \"none\";\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sorts the name objects by region. Secondary and tertiary sort criteria are first name and last name respectively | function sortByRegion() {
if (allNames !== null && allNames.length > 0) {
allNames.sort((a, b) => {
var valA = a.region.toLowerCase();
var valB = b.region.toLowerCase();
var secA = a.name.toLowerCase();
var secB = b.name.toLowerCase();
var terA = a.surname.toLowerCase();
var terB = b.surname.toLowerCase();
if (valA < valB) return -1;
if (valA > valB) return 1;
if (secA < secB) return -1;
if (secA > secB) return 1;
if (terA < terB) return -1;
if (terA > terB) return 1;
return 0;
});
search();
}
} | [
"function sortByLname() {\n if (allNames !== null && allNames.length > 0) {\n allNames.sort((a, b) => {\n var valA = a.surname.toLowerCase();\n var valB = b.surname.toLowerCase();\n\n var secA = a.name.toLowerCase();\n var secB = b.name.toLowerCase();\n\n if (valA < valB) return -1;\n if (valA > valB) return 1;\n\n if (secA < secB) return -1;\n if (secA > secB) return 1;\n\n return 0;\n });\n search();\n }\n}",
"function sortByFname() {\n if (allNames !== null && allNames.length > 0) {\n allNames.sort((a, b) => {\n var valA = a.name.toLowerCase();\n var valB = b.name.toLowerCase();\n\n var secA = a.surname.toLowerCase();\n var secB = b.surname.toLowerCase();\n\n if (valA < valB) return -1;\n if (valA > valB) return 1;\n\n if (secA < secB) return -1;\n if (secA > secB) return 1;\n\n return 0;\n });\n search();\n }\n}",
"function sortByGender() {\n if (allNames !== null && allNames.length > 0) {\n allNames.sort((a, b) => {\n var valA = a.gender.toLowerCase();\n var valB = b.gender.toLowerCase();\n\n var secA = a.name.toLowerCase();\n var secB = b.name.toLowerCase();\n\n var terA = a.surname.toLowerCase();\n var terB = b.surname.toLowerCase();\n\n if (valA < valB) return -1;\n if (valA > valB) return 1;\n\n if (secA < secB) return -1;\n if (secA > secB) return 1;\n\n if (terA < terB) return -1;\n if (terA > terB) return 1;\n\n return 0;\n });\n search();\n }\n}",
"function sort() {\n var sortBy = sortOptions.value;\n\n if (sortBy === \"lname\") sortByLname();\n else if (sortBy === \"gender\") sortByGender();\n else if (sortBy === \"region\") sortByRegion();\n else sortByFname();\n}",
"function sortArrayByName(array) {\n array.sort(function (a, b) {\n const nameA = a.name.toUpperCase(); // ignore upper and lowercase\n const nameB = b.name.toUpperCase(); // ignore upper and lowercase\n if (nameA < nameB) {\n return -1;\n }\n if (nameA > nameB) {\n return 1;\n }\n // names must be eimagePathual\n return 0;\n }); //End sort function\n} // End sortArrayByName(array)",
"sortRegionsByArea() {\r\n function quickSort(arr, left, right) {\r\n let pivot;\r\n let partitionIndex;\r\n if (left < right) {\r\n pivot = right;\r\n partitionIndex = partition(arr, pivot, left, right);\r\n // sort left and right\r\n quickSort(arr, left, partitionIndex - 1);\r\n quickSort(arr, partitionIndex + 1, right);\r\n }\r\n return arr;\r\n }\r\n function partition(arr, pivot, left, right) {\r\n const pivotValue = arr[pivot].area;\r\n let partitionIndex = left;\r\n for (let i = left; i < right; i++) {\r\n if (arr[i].area > pivotValue) {\r\n swap(arr, i, partitionIndex);\r\n partitionIndex++;\r\n }\r\n }\r\n swap(arr, right, partitionIndex);\r\n return partitionIndex;\r\n }\r\n function swap(arr, i, j) {\r\n const temp = arr[i];\r\n arr[i] = arr[j];\r\n arr[j] = temp;\r\n }\r\n const length = this.regions.length;\r\n if (length > 1) {\r\n quickSort(this.regions, 0, this.regions.length - 1);\r\n }\r\n }",
"function sortArrayByObjectProperty(arr)\n{\n arr.sort(function(a, b) {\n var nameA = a.name.toUpperCase(); // ignore upper and lowercase\n var nameB = b.name.toUpperCase(); // ignore upper and lowercase\n if (nameA < nameB) {\n return -1;\n }\n if (nameA > nameB) {\n return 1;\n }\n\n // names must be equal\n return 0;\n });\n}",
"function sortByNameHandler(){\n // table.classList.remove('data');\n // take isolated copy keep the refernce safe\n let sortedByName = myData.slice();\n sortedByName.sort(function(a , b){\n //make case insensitive compare\n if(a.name.toUpperCase() < b.name.toUpperCase()){\n return -1;\n }else{\n return 1;\n }\n \n });\n display.innerHTML = ``;\n\n\n for (let index = 0; index < sortedByName.length; index++) {\n // '+=' : means adding extra elements , while '=': means replace\n display.innerHTML +=`<tr>\n <td>${index+1}</td>\n <td>${sortedByName[index].name}</td>\n <td>${sortedByName[index].type}</td>\n <td>${sortedByName[index].rank}</td>\n </tr>\n `;\n }\n console.table(sortedByName);\n }",
"function nameSort(obj1, obj2)\n{\n\tvar result = 0;\n\tvar str1 = new String(obj1.name);\n\tvar str2 = new String(obj2.name);\n\n\tif (obj1.objectType == obj2.objectType)\n\t{\n\t\tswitch (obj1.objectType)\n\t\t{\n\t\t\tcase METHOD_OBJECT_TYPE:\n\t\t\t\tstr1 = obj1.methodName;\n\t\t\t\tstr2 = obj2.methodName\n\t\t\t\tbreak;\n\t\t\tcase PROPERTY_OBJECT_TYPE:\n\t\t\t\tstr1 = obj1.propertyName;\n\t\t\t\tstr2 = obj2.propertyName\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tif (str1.toLowerCase() > str2.toLowerCase())\n\t{\n\t\tresult = 1;\n\t}\n\telse if (str1.toLowerCase() < str2.toLowerCase())\n\t{\n\t\tresult = -1;\n\t}\n\n\tif (obj1.objectType == PROPERTIES_OBJECT_TYPE)\n\t{\n\t\tresult = 1;\n\t}\n\telse if (obj2.objectType == PROPERTIES_OBJECT_TYPE)\n\t{\n\t\tresult = -1;\n\t}\n\n\treturn result;\n}",
"function sortContactArray(firstname){\n\tvar sortOrder = 1;\n\t\n\tif(firstname[0] == \"-\") {\n\t\tsortOrder = -1;\n\t\tfirstname = firstname.substr(1);\n\t}\n\treturn function (a,b) {\n if(sortOrder == -1){\n return b[firstname].localeCompare(a[firstname]);\n }else{\n return a[firstname].localeCompare(b[firstname]);\n } \n }\n}",
"function sortJSON() {\n\tfilteredObjects.sort( function(a,b) { \n\t\tvar valueA,valueB;\n\n\t\tswitch(sortParam) {\n\t\t\t// ascending by project name\n\t\t\tcase 'asc':\n\t\t\t\tvalueA=a.projectTitle.toLowerCase();\n\t\t\t\tvalueB=b.projectTitle.toLowerCase();\n\t\t\t\tbreak;\n\t\t\t// newest by creation date (b and a is changed on purpose)\n\t\t\tcase 'newest':\n\t\t\t\tvalueA= new Date(b.updatedAt);\n\t\t\t\tvalueB= new Date(a.updatedAt);\n\t\t\t\tbreak;\n\t\t}\n\n\t\t if (valueA < valueB){ \n\t\t return -1; \n\t\t } else if (valueA > valueB){ \n\t\t return 1;\n\t\t } else { \n\t\t return 0;\n\t\t }\n\t});\n\n\t//set the URL accordingly\n\tsetURLParameter();\n}",
"function awardSortFunc(a, b){\n\t// Match\n\tif (a.name == b.name)\n\t\treturn 0;\n\t// Non-match\n\telse\n\t\treturn (a.name > b.name ? 1 : -1);\n}",
"function sort(obj) {\r\n return obj.sort(function (a, b) { return a.companyName > b.companyName })\r\n}",
"async function getAllRegions() {\n const regions = {\n regions: [\n {\n name: \"blackrod\",\n parent: \"bolton\",\n },\n {\n name: \"bolton\",\n parent: \"manchester\",\n },\n {\n name: \"bury\",\n parent: \"manchester\",\n },\n {\n name: \"camden\",\n parent: \"central london\",\n },\n {\n name: \"camden town\",\n parent: \"camden\",\n },\n {\n name: \"central london\",\n parent: \"london\",\n },\n {\n name: \"covent garden\",\n parent: \"westminster\",\n },\n {\n name: \"croydon\",\n parent: \"south-west london\",\n },\n {\n name: \"east london\",\n parent: \"london\",\n },\n {\n name: \"farnworth\",\n parent: \"bolton\",\n },\n {\n name: \"hatton garden\",\n parent: \"camden\",\n },\n {\n name: \"heywood\",\n parent: \"rochdale\",\n },\n {\n name: \"holborn\",\n parent: \"camden\",\n },\n {\n name: \"kensington and chelsea\",\n parent: \"london\",\n },\n {\n name: \"kew\",\n parent: \"richmond upon thames\",\n },\n {\n name: \"kingston upon thames\",\n parent: \"south-west london\",\n },\n {\n name: \"london\",\n parent: \"\",\n },\n {\n name: \"manchester\",\n parent: \"\",\n },\n {\n name: \"middleton\",\n parent: \"rochdale\",\n },\n {\n name: \"north london\",\n parent: \"london\",\n },\n {\n name: \"oldham\",\n parent: \"manchester\",\n },\n {\n name: \"richmond upon thames\",\n parent: \"south-west london\",\n },\n {\n name: \"rochdale\",\n parent: \"manchester\",\n },\n {\n name: \"south london\",\n parent: \"london\",\n },\n {\n name: \"south-west london\",\n parent: \"london\",\n },\n {\n name: \"twickenham\",\n parent: \"richmond upon thames\",\n },\n {\n name: \"west london\",\n parent: \"london\",\n },\n {\n name: \"westminster\",\n parent: \"central london\",\n },\n {\n name: \"wimbledon\",\n parent: \"south-west london\",\n },\n ],\n };\n\n await waitFor(Math.random() * 1500);\n\n return regions;\n}",
"function collectZoneNames(tags) {\n var zones = {};\n var tagsLength = tags.length;\n\n for (var i = 1; i < tagsLength; i++) {\n zones[tags[i].zone] = tags[i].zone;\n }\n\n zoneNames = Object.keys(zones);\n zoneNames.sort();\n}",
"function bibtexSortByField(fieldName, a, b) {\r\n let fieldA = '';\r\n let fieldB = '';\r\n for (let i = 0; i < a.content.length; i++) {\r\n if (a.content[i].name === fieldName) {\r\n fieldA = fieldToString(a.content[i].value, '', '');\r\n break;\r\n }\r\n }\r\n for (let i = 0; i < b.content.length; i++) {\r\n if (b.content[i].name === fieldName) {\r\n fieldB = fieldToString(b.content[i].value, '', '');\r\n break;\r\n }\r\n }\r\n // Remove braces to sort properly\r\n fieldA = fieldA.replace(/{|}/, '');\r\n fieldB = fieldB.replace(/{|}/, '');\r\n return fieldA.localeCompare(fieldB);\r\n}",
"function sortJson(prop, asc) {\n var name, name1, price, price1;\n returnData.results = returnData.results.sort(function(a, b) {\n if(prop === \"string\") {\n if(a.hasOwnProperty(\"trackName\")){\n name = \"trackName\";\n }else{\n name = \"collectionName\";\n }\n\n if(b.hasOwnProperty(\"trackName\")){\n name1 = \"trackName\";\n }else{\n name1 = \"collectionName\";\n }\n\n if (asc) {\n return (a[name].toLowerCase() > b[name1].toLowerCase()) ? 1 : ((a[name].toLowerCase() < b[name1].toLowerCase()) ? -1 : 0);\n } else {\n return (b[name1].toLowerCase() > a[name].toLowerCase()) ? 1 : ((b[name1].toLowerCase() < a[name].toLowerCase()) ? -1 : 0);\n }\n }else if(prop === \"number\"){\n if(a.hasOwnProperty(\"trackPrice\") && a[\"trackPrice\"] > 0) {\n price = \"trackPrice\";\n }else if(a.hasOwnProperty(\"price\") && a[\"price\"] > 0){\n price = \"price\";\n }else if(a.hasOwnProperty(\"collectionPrice\") && a[\"collectionPrice\"] > 0){\n price = \"collectionPrice\";\n }\n\n if(b.hasOwnProperty(\"trackPrice\") && b[\"trackPrice\"] > 0) {\n price1 = \"trackPrice\";\n }else if(b.hasOwnProperty(\"price\") && b[\"price\"] > 0){\n price1 = \"price\";\n }else if(b.hasOwnProperty(\"collectionPrice\") && b[\"collectionPrice\"] > 0){\n price1 = \"collectionPrice\";\n }\n\n if (asc) {\n return (Number(a[price]) > Number(b[price1])) ? 1 : ((Number(a[price]) < Number(b[price1])) ? -1 : 0);\n } else {\n return (Number(b[price1]) > Number(a[price])) ? 1 : ((Number(b[price1]) < Number(a[price])) ? -1 : 0);\n }\n }\n });\n builtLayOut();\n }",
"getCarSortByLicense() {\n return this.cars.sort(function (car1, car2) {\n if (car1.license < car2.license)\n return -1;\n if (car1.license > car2.license)\n return 1;\n return 0;\n });\n }",
"function sortRestaurants(property) {\n var sortOrder = 1;\n if(property[0] === \"-\") {\n sortOrder = -1;\n property = property.substr(1);\n }\n return function (a,b) {\n var result = (a[property] < b[property]) ? -1 : (a[property] > b[property]) ? 1 : 0;\n return result * sortOrder;\n }\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Save the new set or save the changes to the set being edited | function saveCurrentSet() {
if (!currentSet.name) {
const inputValue = $headerElem.querySelector('.new-set-name').value;
if (!validateSetNameInput(inputValue) || currentSet.ids.length === 0) {
return;
}
currentSet.name = inputValue;
}
allSets[currentSet.name] = currentSet.ids;
chrome.storage.sync.set({[setsStorageKey]: allSets}, () => {
closeSetEditor();
});
} | [
"save() {\n undo.push();\n store.content.fromJSON(this.getValue());\n super.save();\n }",
"function updateSets(ex, action) {\n let n = ui.updateSets(ex, action);\n let id = ex.parentNode.parentNode.id;\n id = parseInt(id);\n\n exercise.updateSet(id, n);\n }",
"function editSave() {\n if (!inputValid()) return;\n vm.editObj.id = -3;\n server.addBuoy(vm.editObj).then(function(res) {\n queryBuoys();\n queryBuoyInstances();\n gui.alertSuccess('Buoy added.');\n }, function(res) {\n gui.alertBadResponse(res);\n vm.buoys.splice(vm.buoys.length - 1, 1);\n });\n vm.editId = -1;\n }",
"function save() {\n for (var groupIndex in $scope.groups.groupList) {\n for (var studentIndex in $scope.groups.groupList[groupIndex].studentList) {\n // Student has been selected if any of Select All, Course group, or student itself has been selected. \n if ($scope.groups.groupList[groupIndex]._selected || $scope.groups.groupList[groupIndex].studentList[studentIndex]._selected) {\n StudentOptionEntry.create({\n studentId: $scope.groups.groupList[groupIndex].studentList[studentIndex].id,\n examOptionId: entity.customExam.examOptionId,\n statusId: 1,\n ediStatusId: 8,\n resit: 0,\n private: 0\n }).then(function(response) {}, function(response) {});\n }\n }\n }\n\n $uibModalInstance.close();\n }",
"save() {\n var elem = this._view.getNote(),\n data = validate.getSanitizedNote({\n id: this.id,\n content: elem.html(),\n settings: elem.data(\"settings\")\n });\n \n this._model.setData(\n data,\n (d) => {\n console.log(\"saved\");\n }, (e) => {\n console.log(e);\n }\n );\n }",
"function saveLayerChanges() {\n // Update the currently active dataset\n var activeDatasetId = getActiveDatasetId();\n var activeDataset = getDatasetById(activeDatasetId);\n activeDataset.parameters = formToJSON();\n // Update dataset name to reflect the distribution and format\n updateDatasetName(activeDataset);\n // Update the permalink and Python generation code\n setLinksForLayer(activeDataset);\n // Update the visualization\n refreshLayerVisualization(activeDataset.mapLayer, activeDataset.parameters);\n}",
"function saveSelectedStory()\n{\n if(loadedStory)\n {\n editorDirty = false;\n let id = loadedStory.id;\n loadedStory.canvas_offset = canvasOffset;\n loadedStory.canvas_scale = canvasScale;\n \n $.ajax({\n url: '/stories/' + id,\n type: 'PUT',\n contentType: 'application/json',\n data: JSON.stringify(loadedStory),\n \n success: function(data) {\n updateStories();\n },\n error: function (xhr, ajaxOptions, thrownError) {\n \n }\n });\n }\n}",
"function persistDatesToStorage(dateSet) {\n\t\n\ttry {\n\t\tif(dateSet.mainDateArray && dateSet.subDateArray && dateSet.dateNoteArray && dateSet.dateColorArray)\n\t\t{\n\t\t\tdataStore.set({\"dates\": dateSet}, function(items){\n\t\t\t\tlogger(\"info\", \"Stored dates\", dateSet);\n\t\t\t});\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new Error(\"Date object malformed\");\n\t\t}\n\t}\n\tcatch(e)\n\t{\n\t\thandleError(\"persistDatesToStorage\", e);\n\t}\n}",
"function clickSet(e) {\n const set = e.target.closest('.set-item');\n const btn = e.target.closest('i');\n\n if (!set) {\n return;\n }\n\n if (!!btn) {\n switch (btn.title) {\n case 'Edit':\n openSetEditor(set.dataset.setName);\n break;\n case 'Delete':\n deleteSet(set.dataset.setName);\n break;\n }\n }\n else {\n if (set.classList.contains('create-new-set')) {\n openSetEditor('');\n }\n else if (set.classList.contains('random-all')) {\n goToRandomFromAllBookmarks();\n }\n else {\n goToRandomURLFromSet(set.innerText);\n }\n }\n }",
"function closeSetEditor() {\n setHeaderStatus(false, '');\n\n currentSet = undefined;\n $newSetNameInput.value = '';\n\n chrome.storage.sync.get(setsStorageKey, (response) => {\n buildSetsList(response);\n $setsArea.classList.remove('hide');\n });\n }",
"function persistDatesToStorage(dateSet) {\n\t\n\ttry {\n\t\tif(dateSet.mainDateArray && dateSet.subDateArray && dateSet.dateNoteArray && dateSet.dateColorArray)\n\t\t{\n\t\t\tdataStore.set({\"dates\": dateSet}, function(items){\n\t\t\t\tlogger(\"storage\", \"Stored dates\", dateSet);\n\t\t\t});\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new Error(\"Date object malformed\");\n\t\t}\n\t}\n\tcatch(e)\n\t{\n\t\thandleError(\"persistDatesToStorage\", e);\n\t}\n}",
"saveChanges() {\n return spPost(WebPartDefinition(this, \"SaveWebPartChanges\"));\n }",
"save() {\n if (this.properties.saveCallback) {\n this.properties.saveCallback();\n } else if (this.properties.localStorageReportKey) {\n if ('localStorage' in window && window['localStorage'] !== null) {\n try {\n let report = this.getReport();\n // console.log(JSON.stringify(report));\n window.localStorage.setItem(this.properties.localStorageReportKey, JSON.stringify(report));\n this.modified = false;\n } catch (e) {}\n }\n }\n this.updateMenuButtons();\n }",
"async save() {\n // Use replace instead of has been fully updated in any way\n if (this.__fullUpdate) {\n return await this.replace();\n }\n\n // Ensure model is registered before saving model data\n assert.instanceOf(this.constructor.__db, DbApi, 'Model must be registered.');\n\n // Call internal DB API to save changes to this Model instance\n const id = await this.constructor.__db.save(this, this.__updates, this.__id);\n\n // Set ID if ID returned\n if (id != null) {\n this.__id = id;\n }\n\n // Reset internally stored updates\n this.__updates = new Set();\n this.__fullUpdate = false;\n }",
"function giveSaveBtnFeedback() {\n if ($newSetNameInput.classList.contains('invalid-input')) {\n $saveSetBtn.classList.add('invalid');\n $saveSetBtn.title = 'Invalid Set Name';\n }\n else if (currentSet.ids.length === 0) {\n $saveSetBtn.classList.add('invalid');\n $saveSetBtn.title = 'No folders selected';\n }\n else {\n $saveSetBtn.classList.remove('invalid');\n $saveSetBtn.title = 'Save';\n }\n }",
"function saveChanges() {\n let outcome = true;\n let data = JSON.stringify(itemsJsonObject, null, 2);\n fs.writeFile('items.json', data, function(err){\n if(err) outcome = false;\n });\n return outcome;\n}",
"save() {\n let component = this;\n let comment = get(this, 'comment');\n\n comment.save().then((comment) => {\n component.set('isEditing', false);\n this._fetchMentions(comment);\n });\n }",
"function MDUO_Save(){\n console.log(\"=== MDUO_Save =====\") ;\n // save subject that have exam_id or ntb_id\n // - when exam_id has value and ntb_id = null: this means that ntb is removed\n // - when exam_id is null and ntb_id has value: this means that there is no exam record yet\n // - when exam_id and ntb_id both have value: this means that ntb_id is unchanged or chganegd\n const exam_list = [];\n if(mod_MDUO_dict.duo_subject_dicts){\n for (const data_dict of Object.values(mod_MDUO_dict.duo_subject_dicts)) {\n\n if (data_dict.exam_id || data_dict.ntb_id){\n exam_list.push({\n subj_id: data_dict.subj_id,\n ntb_id: data_dict.ntb_id,\n dep_pk: data_dict.dep_id,\n level_pk: data_dict.lvl_id,\n subj_name_nl: data_dict.subj_name_nl,\n exam_id: data_dict.exam_id,\n ntb_omschrijving: data_dict.ntb_omschrijving\n });\n };\n };\n };\n if (exam_list.length) {\n const upload_dict = {\n examperiod: setting_dict.sel_examperiod,\n exam_list: exam_list\n };\n// --- upload changes\n const url_str = urls.url_duo_exam_upload;\n console.log(\"upload_dict\", upload_dict) ;\n console.log(\"url_str\", url_str) ;\n\n UploadChanges(upload_dict, url_str);\n };\n $(\"#id_mod_duoexams\").modal(\"hide\");\n }",
"function saveChangesInFile() {\n var fileId = $(this).attr(\"data-id\");\n var editedText = $(\"textarea.editFile\").val();\n var fileAndParent = fileSystem.findElementAndParentById(fileId);\n var file = fileAndParent.element;\n file.content = editedText;\n var parent = fileAndParent.parent;\n if (parent != null) {\n showFolderOrFileContentById(parent.id);\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Turns the raw data array of a VATSIM flight into an object (and performs some checks/enhancements) | function createFlightObject(rawData) {
var flight = {
callsign: rawData[0],
lat: parseFloat(rawData[5]),
lon: parseFloat(rawData[6]),
alt: parseInt(rawData[7]),
groundspeed: parseInt(rawData[8]),
aircraft: rawData[9].match(/([A-Z]*\/)?([A-Z0-9\-]*)(\/[A-Z]*)?/)[2],
origin: rawData[11],
rfl: rawData[12],
destination: rawData[13],
squawk: parseInt(rawData[17]).pad(4),
route: rawData[30].replace(/\-/g, " ").replace(/\./g, " ").replace(/\+/g, ""),
distanceToAirport: null,
eta: null
};
flight.rfl = (flight.rfl.indexOf("FL") == -1 && parseInt(flight.rfl) >= 1000) ? 'FL' + parseInt(flight.rfl.substring(0, flight.rfl.length-2)).pad(3) : flight.rfl;
flight.distanceToAirport = calculateRemainingDistance(flight.lat, flight.lon);
var eta = calculateArrivalTime(flight.lat, flight.lon, flight.groundspeed);
flight.eta = (eta != 'NaNNaN') ? eta : 'N/A';
return flight;
} | [
"parse(data, fms) {\n // Populate Waypoint with data\n if (data.fix) {\n this.navmode = 'fix';\n this.fix = data.fix;\n this.location = window.airportController.airport_get().getFixPosition(data.fix);\n }\n\n _forEach(data, (value, key) => {\n if (_has(this, key)) {\n this[key] = data[key];\n }\n });\n\n // for aircraft that don't yet have proper guidance (eg SID/STAR, for example)\n if (!this.navmode) {\n this.navmode = 'heading';\n const apt = window.airportController.airport_get();\n\n if (data.route.split('.')[0] === apt.icao && this.heading === null) {\n // aim departure along runway heading\n this.heading = apt.getRunway(apt.runway).angle;\n } else if (data.route.split('.')[0] === 'KDBG' && this.heading === null) {\n // aim arrival @ middle of airspace\n this.heading = this.radial + Math.PI;\n }\n }\n }",
"read_data_info() {\n this.json.data_info = {};\n this.add_string(this.json.data_info, \"date_and_time\");\n this.add_string(this.json.data_info, \"scan_summary\");\n this.json.data_info.apply_data_calibration = this.ole.read_bool();\n this.add_string(this.json.data_info, \"data_calibration_file\");\n this.add_string(this.json.data_info, \"certificate_file\");\n this.add_string(this.json.data_info, \"system_file\");\n this.add_string(this.json.data_info, \"pre_scan_addon_description\");\n this.add_string(this.json.data_info, \"post_scan_addon_description\");\n this.add_string(this.json.data_info, \"pre_scan_addon_filename\");\n this.add_string(this.json.data_info, \"post_scan_addon_filename\");\n this.add_string(this.json.data_info, \"type_and_units\");\n this.add_string(this.json.data_info, \"type_and_units_code\");\n this.add_string(this.json.data_info, \"auxiliary_type_and_units\");\n this.add_string(this.json.data_info, \"auxiliary_type_and_units_code\");\n this.json.data_info.apply_reference = this.ole.read_bool();\n this.add_string(this.json.data_info, \"reference_type\");\n this.add_string(this.json.data_info, \"reference_file\");\n this.add_string(this.json.data_info, \"reference_parameter\");\n this.json.data_info.file_time = this.ole.read_systemtime();\n\n // Read and discard measurement units and types;\n // these are in the data info as well\n // ar.Read(Buffer, 4*sizeof(int));\n this.ole.skip_uint32(4);\n\n // Right axis settings\n // ar >> TempInt;\n // ar.Read(Buffer, m_nNoOfDataSets*sizeof(int));\n this.ole.skip_uint32();\n this.ole.skip_uint32(this.json.data_set.length);\n }",
"function parseSensorPacket(packet) {\n let sensor = {};\n\n let isMinew = (packet.substr(26,4) === 'e1ff');\n let isCodeBlue = (packet.substr(24,6) === 'ff8305');\n\n if(isMinew) {\n let isTemperatureHumidity = (packet.substr(38,4) === 'a101');\n let isVisibleLight = (packet.substr(38,4) === 'a102');\n let isAcceleration = (packet.substr(38,4) === 'a103');\n\n if(isTemperatureHumidity) {\n sensor.temperature = (parseInt(packet.substr(44, 2), 16) +\n parseInt(packet.substr(46, 2), 16) / 256).toFixed(1);\n sensor.humidity = (parseInt(packet.substr(48, 2), 16) +\n parseInt(packet.substr(50, 2), 16) / 256).toFixed(1);\n }\n else if(isVisibleLight) {\n sensor.visibleLight = (packet.substr(44, 2) === '01');\n }\n else if(isAcceleration) {\n sensor.acceleration = [];\n sensor.accelerationMagnitude = 0;\n sensor.acceleration.push(fixedPointToDecimal(packet.substr(44, 4)));\n sensor.acceleration.push(fixedPointToDecimal(packet.substr(48, 4)));\n sensor.acceleration.push(fixedPointToDecimal(packet.substr(52, 4)));\n sensor.acceleration.forEach(function(magnitude, index) {\n sensor.accelerationMagnitude += (magnitude * magnitude);\n sensor.acceleration[index] = magnitude.toFixed(2);\n });\n sensor.accelerationMagnitude = Math.sqrt(sensor.accelerationMagnitude)\n .toFixed(2);\n }\n }\n else if(isCodeBlue) {\n let isPuckyActive = (packet.substr(30,2) === '02');\n\n if(isPuckyActive) {\n sensor.temperature = ((parseInt(packet.substr(38,2), 16) / 2) - 40)\n .toFixed(1);\n sensor.lightPercentage = Math.round((100 / 0xff) * \n parseInt(packet.substr(40,2), 16));\n sensor.capSensePercentage = Math.round((100 / 0xff) * \n parseInt(packet.substr(42,2), 16));\n sensor.magneticField = [];\n sensor.magneticField.push(toMagneticField(packet.substr(44,4)));\n sensor.magneticField.push(toMagneticField(packet.substr(48,4)));\n sensor.magneticField.push(toMagneticField(packet.substr(52,4)));\n }\n }\n\n return sensor;\n}",
"function prepareData(){\n testData = toDataFormat(Array.from(testData));\n trainData = toDataFormat(Array.from(tData));\n}",
"function ParcelObj(t, s, d, w, e) {\n this.trackingNumber = t; // String\n this.status = s;\t // String\n this.destination = d;\t // String\n this.weight = w;\t\t // Float\n this.express = e;\t\t // Boolean\n}",
"function parseAllDayData(raw_data) {\n\n var table_data = [],\n date, avrg, min, max, billing_95th;\n\n for(var i = 0; i < raw_data.length; i++) {\n date = raw_data[i]['date_type'];\n avrg = transSpeed(raw_data[i]['ifIn_avrg']) + ' / ' + transSpeed(raw_data[i]['ifOut_avrg']);\n min = transSpeed(raw_data[i]['ifIn_min']) + ' / ' + transSpeed(raw_data[i]['ifOut_min']);\n max = transSpeed(raw_data[i]['ifIn_max']) + ' / ' + transSpeed(raw_data[i]['ifOut_max']);\n billing_95th = transSpeed(raw_data[i]['ifIn_95th']) + ' / ' + transSpeed(raw_data[i]['ifOut_95th']);\n table_data.push([date, billing_95th, avrg, max, min]);\n }\n\n return table_data;\n}",
"function updateData() {\n\tPapa.parse('/data/vatsim-data.txt', {\n\t\tdownload: true,\n\t\tdelimiter: ':',\n\t\tcomments: ';',\n\t\tfastMode: true,\n\t\tcomplete: parseData\n\t});\n}",
"loadData(fleet) {\n for (let data of fleet) {\n switch (data.type) {\n\n case 'car':\n if (this.validateCarData(data)) {\n let car = this.loadCar(data);\n\n this.cars.push(car);\n\n } else {\n let e = new DataError('invalid data at car case', data);\n this.errors.push(e);\n }\n break;\n\n case 'drone':\n if (this.validateDroneData(data)) {\n let dron = this.loadDron(data);\n this.drons.push(dron);\n }\n break;\n\n default:\n let e = new DataError('invalid data at default case', data);\n this.errors.push(e);\n break;\n\n }\n }\n }",
"function parsetransData(d){\n \n return{\n geoid_2: +d.geoid_2,\n geography: d.geo_display,\n total_population: +d.HC01_EST_VC01,\n age_group: [\n {'16-19': +d.HC01_EST_VC03},\n {'20-24': +d.HC01_EST_VC04},\n {'25-44': +d.HC01_EST_VC05},\n {'45-54': +d.HC01_EST_VC06},\n {'55-59': +d.HC01_EST_VC07},\n {'60+': +d.HC01_EST_VC08} \n ],\n median_age: +d.HC01_EST_VC10,\n earnings_group: [\n {'1-9999': +d.HC01_EST_VC42},\n {'10000-14999': +d.HC01_EST_VC43},\n {'15000-24999': +d.HC01_EST_VC44},\n {'25000-34999': +d.HC01_EST_VC45},\n {'35000-49999': +d.HC01_EST_VC46},\n {'50000-64999': +d.HC01_EST_VC47},\n {'65000-74999': +d.HC01_EST_VC48},\n {'75000+': +d.HC01_EST_VC49}\n ],\n median_earnings: +d.HC01_EST_VC51,\n industries_group: [\n {'argriculture': +d.HC01_EST_VC69},\n {'construction': +d.HC01_EST_VC70},\n {'manufacturing': +d.HC01_EST_VC71},\n {'wholesale trade': +d.HC01_EST_VC72},\n {'retail trade': +d.HC01_EST_VC73},\n {'transportation&warehouse': +d.HC01_EST_VC74},\n {'information&finance': +d.HC01_EST_VC75},\n {'professional&scientific services': +d.HC01_EST_VC76},\n {'healthcare&educational&social assistance': +d.HC01_EST_VC77},\n {'entertainment&recreation': +d.HC01_EST_VC78},\n {'public administration': +d.HC01_EST_VC80},\n {'armed forces': +d.HC01_EST_VC81},\n {'other services': +d.HC01_EST_VC79} \n ],\n time_group: [{'10': +d.HC01_EST_VC103},\n {'10-14': +d.HC01_EST_VC104},\n {'15-19': +d.HC01_EST_VC105},\n {'20-24': +d.HC01_EST_VC106},\n {'25-29': +d.HC01_EST_VC107},\n {'30-34': +d.HC01_EST_VC108},\n {'35-44': +d.HC01_EST_VC109},\n {'45-59': +d.HC01_EST_VC110},\n {'60+': +d.HC01_EST_VC111} \n ],\n mean_time: +d.HC01_EST_VC112\n\n //backup as follows\n // travel_time_work_10: +d.HC01_EST_VC103,\n // travel_time_work_10_14: +d.HC01_EST_VC104,\n // travel_time_work_15_19: +d.HC01_EST_VC105,\n // travel_time_work_20_24: +d.HC01_EST_VC106,\n // travel_time_work_25_29: +d.HC01_EST_VC107,\n // travel_time_work_30_34: +d.HC01_EST_VC108,\n // travel_time_work_35_44: +d.HC01_EST_VC109,\n // travel_time_work_45_59: +d.HC01_EST_VC110,\n // travel_time_work_60: +d.HC01_EST_VC111, \n \n // age_16_19: +d.HC01_EST_VC03,\n // age_20_24: +d.HC01_EST_VC04,\n // age_25_44: +d.HC01_EST_VC05,\n // age_45_54: +d.HC01_EST_VC06,\n // age_55_59: +d.HC01_EST_VC07,\n // age_60: +d.HC01_EST_VC08,\n \n // earnings_1_9999: +d.HC01_EST_VC42,\n // earnings_10000_14999: +d.HC01_EST_VC43,\n // earnings_15000_24999: +d.HC01_EST_VC44,\n // earnings_25000_34999: +d.HC01_EST_VC45,\n // earnings_35000_49999: +d.HC01_EST_VC46,\n // earnings_50000_64999: +d.HC01_EST_VC47,\n // earnings_65000_74999: +d.HC01_EST_VC48,\n // earnings_75000: +d.HC01_EST_VC49,\n\n // agriculture: +d.HC01_EST_VC69,\n // construction: +d.HC01_EST_VC70,\n // manufacturing: +d.HC01_EST_VC71,\n // wholesale_trade: +d.HC01_EST_VC72,\n // retail_trade: +d.HC01_EST_VC73,\n // transportation_warehouse: +d.HC01_EST_VC74,\n // information_finance_realestate: +d.HC01_EST_VC75,\n // professional_scientific_waste_services: +d.HC01_EST_VC76,\n // educational_healthcare_social_assistance: +d.HC01_EST_VC77,\n // arts_entertainment_recreation_accommodation_food_services: +d.HC01_EST_VC78,\n // other_services_no_public_administration: +d.HC01_EST_VC79,\n // public_administration: +d.HC01_EST_VC80,\n // armed_forces: +d.HC01_EST_VC81,\n \n }\n}",
"function parserBleClientData(data) {\n let rx = JSON.parse(data);\n let protocolData = {\n cmdtype: rx.cmdtype,\n cmdData: rx.cmdData\n };\n if (protocolData.cmdtype == 'SensorHT') {\n let content = protocolData.cmdData.toString().split(\";\");\n temperature = parseInt(content[0]);\n humidity = parseInt(content[1]);\n console.log((new Date().toLocaleString()));\n console.log('temperature:' + temperature.toString(10));\n console.log('humidity:' + humidity.toString(10));\n write2BleClient('replyOK', 'ok');\n //codeing for saving data to database and updating sensor status here\n }\n else if (protocolData.cmdtype == 'SensorPIR') {\n let content = protocolData.cmdData.toString().split(\";\");\n pirValue = parseInt(content[0]);\n console.log((new Date().toLocaleString()));\n console.log('PIR:' + pirValue);\n write2BleClient('replyOK', 'ok');\n //codeing for saving data to database and updating sensor status here\n }\n}",
"constructor() {\n this.packet_blueprint = ['temperature', 'humidity','pressure','co2','voc'];\n this.data_table = {};\n this.packet_blueprint.forEach(e => this.data_table[e] = new DataList(e));\n }",
"function convert(sample, dataset) {\n let points = [[], [], []];\n if (dataset == \"SHREC2019\") {\n //Code for unistroke mutlipath gestures \n sample.paths[\"Palm\"].strokes.forEach((point, stroke_id) => { \n points[PLANE_XY].push(new Point(point.x, point.y, point.t, point.stroke_id));\n points[PLANE_YZ].push(new Point(point.y, point.z, point.t, point.stroke_id));\n points[PLANE_ZX].push(new Point(point.z, point.x, point.t, point.stroke_id));\n });\n //Code for Unistroke unipath gestures\n } else { \n sample.strokes.forEach((point, stroke_id) => { \n points[PLANE_XY].push(new Point(point.x, point.y, point.t, point.stroke_id));\n points[PLANE_YZ].push(new Point(point.y, point.z, point.t, point.stroke_id));\n points[PLANE_ZX].push(new Point(point.z, point.x, point.t, point.stroke_id));\n });\n }\n return points;\n }",
"static FromArray(array) {\n return new Plane(array[0], array[1], array[2], array[3]);\n }",
"function GetTelemetryObj() {\n var myJSON = { \n \"utc\": 0,\n \"soc\": 0,\n \"soh\": 0,\n \"speed\": 0,\n \"car_model\": CAR_MODEL,\n \"lat\": 0,\n \"lon\": 0,\n \"elevation\": 0,\n \"ext_temp\": 0,\n \"is_charging\": 0,\n \"batt_temp\": 0,\n \"voltage\": 0,\n \"current\": 0,\n \"power\": 0\n };\n return myJSON;\n }",
"function parseEquipment(rawEquips){\n // Parse all of the Equipment out of the json\n let equips = [];\n for(var i = 0; i < rawEquips.length; i++){\n // Get the Equipment\n let rawEq = rawEquips[i];\n\n // Get the attributes\n var amount = rawEq[EXP_JSON_EQUIP_AMOUNT];\n var id = rawEq[EXP_JSON_EQUIP_OBJ_ID];\n\n // Create the appropriate Equipment\n for(var j = 0; j < amount; j++){\n equips.push(idToEquipment(id));\n }\n }\n return equips;\n}",
"function parsePanoramaArray(pArray){\n trimNull(pArray);\n removeRepeats(pArray);\n createStreetViewPoints(pArray);\n \n //global function\n // retrieveSVPArray();\n updatePage(svpArray);\n }",
"function parseAFEFile(filename)\n {\n // The AFE Model object\n afeModel =\n {\n Title: \"\",\n Filename: filename,\n\n LengthUnit: \"ft\",\n\n // Hashtables (id -> elem)\n Joints: {},\n Components: {},\n Supports: {},\n\n // Will contain bounds of all elements\n Bounds:\n {\n xMin: Number.MAX_VALUE,\n yMin: Number.MAX_VALUE,\n xMax: Number.MIN_VALUE,\n yMax: Number.MIN_VALUE\n },\n\n // Min/Max line lengths\n LineLengths:\n {\n min: Number.MAX_VALUE,\n max: Number.MIN_VALUE,\n },\n\n // Amount to scale source model when creating Fusion model.\n Scale: 1.0,\n\n // Amount to extrude\n ExtrudeDist: app.activeProduct.unitsManager.evaluateExpression(\"0.3\", \"cm\"),\n\n // Set width of component bodies\n ComponentWidth: app.activeProduct.unitsManager.evaluateExpression(\"0.5\", \"cm\"),\n\n // Set diameter of joint holes\n JointHoleDiameter: app.activeProduct.unitsManager.evaluateExpression(\"1\", \"mm\")\n };\n\n // The current format of an AFE file comes in binary or text formats. The\n // text file contains an XML representation while the binary also contains\n // XML as well as other binary data.\n //\n // This parsing code determines which is which by looking at the first set\n // of values in the file. If they are text based then we assume it's a\n // text file. Otherwise, it's a binary. This is a hack but works for now.\n\n // Begin by reading in the buffer.\n var buffer = adsk.readFile(filename);\n if (!buffer) {\n ui.messageBox('Failed to open ' + filename);\n return null;\n }\n\n var bytes = new Uint8Array(buffer);\n if (bytes.byteLength < 20) {\n ui.messageBox('Invalid data file. Not enough data: ' + filename);\n return null;\n }\n\n // At the start of a binary version of the file is a header:\n //\n // 16 bytes (?)\n // 4 bytes (length of XML section)\n // XML section\n // Remainder of binary data\n //\n // Let's look at the first set of bytes to see if they are binary or text.\n // That will determine how we parse.\n var parseBinary = false;\n var asciiChars = /^[ -~\\t\\n\\r]+$/;\n for (var ii = 0; ii < 16; ++ii) {\n var ch = String.fromCharCode(bytes[ii]);\n if ( !asciiChars.test( ch ) ) {\n // non-ascii character\n parseBinary = true;\n break;\n }\n }\n\n var xmlBytes; // This will hold the XML to parse\n\n // This is a binary file\n if (parseBinary) {\n\n // Extract the XML section length from the header\n var xmlLength = (+bytes[16]) + (256 * bytes[17]);\n\n // Now extract the XML. Note, offset another 2 bytes later\n xmlBytes = bytes.subarray(20,xmlLength+20); // args = begin, end\n }\n else {\n xmlBytes = bytes; // XML text file so use all of it.\n }\n\n // Convert the model xml to a JSON string\n var xml = adsk.utf8ToString(xmlBytes);\n var jsonAFE = $.xml2json(xml);\n if (!jsonAFE) {\n ui.messageBox('Failed to convert file ' + filename);\n return null;\n }\n\n // Begin parsing - Extract settings from the file header.\n //\n // <File Schema=\"9\" Title=\"Diagram00014\" IsImperial=\"1\" UnitsVisible=\"1\" LengthUnit=\"ft\" AppType=\"afe\"\n // ForceUnit=\"lb\" MovieIsValid=\"0\" ScreenWidth=\"320\" ScreenHeight=\"524\" SimulationSpeed=\"35.000000\">\n if (jsonAFE.Title) {\n afeModel.Title = jsonAFE.Title;\n }\n\n if (afeModel.Title === \"\") {\n afeModel.Title = \"ForceEffect Import\";\n }\n\n if (jsonAFE.LengthUnit) {\n afeModel.LengthUnit = jsonAFE.LengthUnit;\n }\n\n // Parse the \"Elements\"\n if (jsonAFE.Elements && jsonAFE.Elements.Ided)\n {\n for (var iElem = 0; iElem < jsonAFE.Elements.Ided.length; ++iElem)\n {\n var elem = jsonAFE.Elements.Ided[iElem];\n if (!elem.TypeID) {\n continue;\n }\n\n if (elem.TypeID == \"Joint\")\n {\n // <Ided TypeID=\"Joint\" ObjectId=\"3\" Index=\"1\">\n afeModel.Joints[elem.ObjectId] = elem;\n }\n else if (elem.TypeID == \"Component\")\n {\n // <Ided TypeID=\"Component\" ObjectId=\"2\">\n afeModel.Components[elem.ObjectId] = elem;\n }\n else if (elem.TypeID == \"Support\")\n {\n // <Ided TypeID=\"Support\" ObjectId=\"1\">\n afeModel.Supports[elem.ObjectId] = elem;\n }\n }\n }\n\n // Iterate through the elements to calc bounding box.\n var idsComps = hastableKeys(afeModel.Components); // get Ids of components\n for (var i = 0; i < idsComps.length; ++i)\n {\n var idComp = idsComps[i];\n var comp = afeModel.Components[idComp];\n\n var startJoint = afeModel.Joints[comp.StartJoint.ObjId];\n var endJoint = afeModel.Joints[comp.EndJoint.ObjId];\n\n if (!startJoint || !endJoint)\n {\n console.log(\"Error: Unable to find start or end joint\");\n continue;\n }\n\n // Get the joint positions and convert to correct units\n var ptStart = getJointPoint(startJoint,\"Origin\");\n var ptEnd = getJointPoint(endJoint,\"Origin\");\n\n var xStart = afeVal2cm(afeModel.LengthUnit, ptStart.x);\n var yStart = afeVal2cm(afeModel.LengthUnit, ptStart.y);\n var xEnd = afeVal2cm(afeModel.LengthUnit, ptEnd.x);\n var yEnd = afeVal2cm(afeModel.LengthUnit, ptEnd.y);\n\n // Track bounds of all elements\n afeModel.Bounds.xMin = Math.min(afeModel.Bounds.xMin, Math.min(xStart,xEnd));\n afeModel.Bounds.yMin = Math.min(afeModel.Bounds.yMin, Math.min(yStart,yEnd));\n afeModel.Bounds.xMax = Math.max(afeModel.Bounds.xMax, Math.max(xStart,xEnd));\n afeModel.Bounds.yMax = Math.max(afeModel.Bounds.yMax, Math.max(yStart,yEnd));\n\n // Length of this line\n var lineLen = Math.sqrt((xEnd -= xStart) * xEnd + (yEnd -= yStart) * yEnd);\n if (lineLen < afeModel.LineLengths.min)\n afeModel.LineLengths.min = lineLen;\n if (lineLen > afeModel.LineLengths.max)\n afeModel.LineLengths.max = lineLen;\n }\n\n return afeModel;\n }",
"function CreditCardTrackData(track_data) {\n this.fields = ['format_code', 'number', 'expiration', 'last_name', 'first_name', 'service_code']\n this.track_data = track_data\n this.parse()\n this.CENTURY = \"20\"\n}",
"function Comic(comicRawData) {\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns true if a bid decrease is needed, false otherwise | function isBidDecreaseNeeded(stats, currentBid, baselineConversionRate) {
var conversions = stats.getConversions();
var conversionRate = stats.getConversionRate();
var targetBid = (conversionRate / baselineConversionRate)
if (isBidChangeSignificant(currentBid, targetBid)) {
var isDecreaseNeeded = (targetBid < currentBid && conversions >= MIN_CONVERSIONS);
if (DEBUG) {
Logger.log(' ^ Is decrease needed? ' + isDecreaseNeeded
+ ':: targetBid:' + targetBid + ' currentBid:' + currentBid
+ ':: conversionRate:' + conversionRate + ' baseline:' + baselineConversionRate
+ ':: conversions:' + conversions + ' threshold:' + MIN_CONVERSIONS);
}
return (isDecreaseNeeded);
} else {
return false;
}
} | [
"function isBidIncreaseNeeded(stats, currentBid, baselineConversionRate) {\n var conversions = stats.getConversions();\n var conversionRate = stats.getConversionRate();\n var position = stats.getAveragePosition();\n var targetBid = (conversionRate / baselineConversionRate)\n\n if (isBidChangeSignificant(currentBid, targetBid)) {\n var isIncreaseNeeded = (targetBid > currentBid\n && (position > STOPLIMIT_POSITION || position == 0)\n && currentBid < MAX_BID_ADJUSTMENT\n && conversions >= MIN_CONVERSIONS);\n\n if (DEBUG) {\n Logger.log(' ^ Is increase needed? ' + isIncreaseNeeded\n + ':: targetBid:' + targetBid + ' currentBid:' + currentBid\n + ':: conversionRate:' + conversionRate + ' baseline:' + baselineConversionRate\n + ':: position:' + position + ' stoplimit:' + STOPLIMIT_POSITION\n + ':: currentBid:' + currentBid + ' stoplimit:' + MAX_BID_ADJUSTMENT\n + ':: conversions:' + conversions + ' threshold:' + MIN_CONVERSIONS);\n }\n\n return (isIncreaseNeeded);\n } else {\n return false;\n }\n}",
"function busted(hand) {\n if (getTotal(hand) > MAX_VALUE) {\n return true;\n } else {\n return false;\n }\n}",
"function checkBudget(product, budget, message){\n if (product.price <= budget) {\n return message(product,true)\n } else {\n return message(product,false)\n }\n}",
"function spareChange (money) {\n if (money > 100) {\n return true;\n }\n else {\n return false;\n }\n}",
"checkCanBuy() {\n if (clickNumber >= this.cost && !(document.getElementById(this.buyId).classList.contains(\"canbuy\"))) {\n document.getElementById(this.buyId).classList.toggle(\"canbuy\");\n } else if (clickNumber < this.cost && document.getElementById(this.buyId).classList.contains(\"canbuy\")) {\n document.getElementById(this.buyId).classList.toggle(\"canbuy\");\n }\n }",
"function checkAllBidsResponseReceived(){\n\t\tvar available = true;\n\n\t\tutils._each(bidResponseReceivedCount, function(count, bidderCode){\n\t\t\tvar expectedCount = getExpectedBidsCount(bidderCode);\n\n\t\t\t// expectedCount should be set in the adapter, or it will be set\n\t\t\t// after we call adapter.callBids()\n\t\t\tif ((typeof expectedCount === objectType_undefined) || (count < expectedCount)) {\n\t\t\t\tavailable = false;\n\t\t\t}\n\t\t});\n\n\t\treturn available;\n\t}",
"function spareChange (money){\n\tif(money>100){\n\t\treturn true;\n\t}else {\n\t\treturn false;\n\t}\n}",
"function Increase(){\n\n if (bankBallance > 0){\n IncreaseBet();\n\n if ( betAmmount > bankBallance){\n canDouble = false;\n }\n }\n}",
"function isEnoughCoinsForGraf() {\n if (state.activeCoins.length === 0) {\n return false;\n }\n return true;\n }",
"isBettingDone(lineup, dealer, state, bbAmount) {\n if (this.isHandComplete(lineup, dealer, state)) {\n return true;\n }\n const activePlayers = activeLineup(lineup, dealer, state, this.rc);\n let maxBet;\n if (state === 'waiting' || state === 'preflop') {\n try {\n maxBet = this.getMaxBet(activePlayers, state);\n } catch (err) {\n if (state === 'waiting') {\n return false;\n }\n // try with all players, in case everyone all-in\n maxBet = this.getMaxBet(lineup, state);\n }\n }\n if (state === 'waiting') {\n return maxBet.amount > 0;\n }\n if (state === 'dealing') {\n const noRecCount = countNoReceipts(lineup, this.rc);\n if (noRecCount === 0) {\n return true;\n }\n }\n\n const allInPlayerCount = this.countAllIn(lineup);\n if (allInPlayerCount > 0 && activePlayers.length === 1) {\n // see if last active player matched latest all-in\n const maxAllInAmount = maxAllIn(lineup, this.rc);\n if (!maxBet) {\n maxBet = this.getMaxBet(activePlayers, state);\n }\n return (maxAllInAmount <= maxBet.amount);\n }\n\n const allEven = evenLineup(activePlayers, this.rc);\n if (!allEven) {\n return false;\n }\n\n const checker = findLatest({ sorted: true, lineup: activePlayers }, Type.CHECK_PRE, this.rc);\n if (checker.last) {\n // prefop betting done if check found\n if (state === 'preflop') {\n return true;\n }\n // on other streets wait until all active players have checked\n const checkType = (state === 'preflop') ? // eslint-disable-line\n Type.CHECK_PRE : (state === 'flop') ? // eslint-disable-line\n Type.CHECK_FLOP : (state === 'turn') ?\n Type.CHECK_TURN : Type.CHECK_RIVER;\n const checkCount = countReceipts(lineup, checkType, this.rc);\n if (checkCount === activePlayers.length) {\n return true;\n }\n return false;\n }\n if (state === 'preflop') {\n if (!bbAmount) throw new Error('BB amount cannot be undefined');\n const bbPos = this.getBbPos(lineup, dealer, state);\n const bbRec = this.rc.get(lineup[bbPos].last);\n if (isActive(lineup[bbPos], state, this.rc) &&\n bbRec.type !== Type.CHECK_PRE &&\n maxBet.amount === parseInt(bbAmount, 10)) {\n return false;\n }\n }\n if (allInPlayerCount > 0 && activePlayers.length === 0) {\n return true;\n }\n if (allEven) {\n return true;\n }\n throw Error('could not determine betting state');\n }",
"function decreaseBid(target) {\n var newBidModifier = target.getBidModifier() - BID_INCREMENT;\n newBidModifier = Math.max(newBidModifier, 0.1); // Modifier cannot be less than 0.1 (-90%)\n\n // TODO: Reset bid modifier to 0% (1.0) if the current conversion rate is below avg conversion rate\n // var newBidModifier = Math.min(currentBidModifier - BID_INCREMENT, 1);\n\n target.setBidModifier(newBidModifier);\n\n if (DEBUG) {\n Logger.log('*** UPDATE *** ' + target.getEntityType() + ' : ' + getName(target)\n + ', bid modifier: ' + newBidModifier\n + ' decrease bids');\n }\n}",
"function areWeHoldingCrypto() {\n const currency_available = parseFloat($(\"#currency_available\").text())\n const currency_reserved = parseFloat($(\"#currency_reserved\").text())\n const crypto_available = parseFloat($(\"#crypto_available\").text())\n const crypto_reserved = parseFloat($(\"#crypto_reserved\").text())\n if (1 <= currency_available || 1 <= currency_reserved) {\n return false\n } else {\n return true\n }\n}",
"refuel() {\n if (isDocked(this.action)) {\n const fuelNeeded = this.ship.refuelUnits();\n const price = this.here.fuelPricePerTonne(this);\n if (fuelNeeded > 0 && this.money > (fuelNeeded * price)) {\n const [bought, paid] = this.here.buy('fuel', fuelNeeded);\n const need = fuelNeeded - bought;\n const total = paid + (need * price);\n this.debit(total);\n this.ship.refuel(fuelNeeded);\n }\n }\n return this.ship.refuelUnits() == 0;\n }",
"function stopDealing() {\n // Dealer has 17 or better\n if (game.dealerHand.handTotal >= 17) {\n return true;\n // Soft 17 to soft 21\n } else if (game.dealerHand.aceInHand && game.dealerHand.handTotal >= 7 && game.dealerHand.handTotal <= 11) {\n return true;\n // All other hands, deal another card\n } else {\n return false;\n }\n}",
"verifyDelaySlot() {\n if (this.delaySlot) {\n this.pushError(\"Cannot have a jump/branch instruction in delay slot! [line \" + this.line + \"]. Ignoring jump/branch in delay slot.\");\n return true;\n }\n return false;\n }",
"calculateDownPayment() { return this.getVariable().getPercentDown() * this.getAsset().getValue() }",
"get isResumable() {\n return [GONE_COOLDOWN].includes(this.goneStatus);\n }",
"function checkGold(upgradeNum){\n if(totalGold >= upgradesCost[upgradeNum]){\n //gold is spent\n totalGold -= upgradesCost[upgradeNum];\n updateGold();\n notify(upgrades[upgradeNum] + \" Purchased\");\n return true;\n }\n else{\n notify('Not rich enough!');\n return false;\n }\n }",
"function endPhaseConditions(){\r\n\r\n if (killerCountSetup == 0 || userKilled || totalFuel == userScore + computerScore || fuel == 0){\r\n return false;\r\n }\r\n else{\r\n return true;\r\n }\r\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function deletes a video from the database. | function deleteVideo(req,res,next)
{
myTube.Video.remove({videoId:req.params.videoID}, function(error){
if (error)
{
res.send(500, "Error while trying to delete");
}
else
{
res.send(200, "video was successfully deleted from db");
}
});
} | [
"function deleteVideo(videoId, callback) {\n pool.connect().then((pool) => {\n pool.request()\n .input('videoId', sql.VarChar, videoId)\n .query('DELETE FROM [dbo].[videos] WHERE videoId=@videoId')\n .then(res => {\n storageDeleteBlob(videoId)\n return callback(true)\n })\n .catch(err => {\n console.error(err)\n return callback(err)\n })\n })\n}",
"function deleteVideoObject(videoIdNum) {\n setTimeout(() => fetch(`${databaseURL}/${videoIdNum}`, {method: \"DELETE\"})\n .then(function() {\n delete localDatabase[videoIdNum];\n document.querySelector(`div[data-id=\"${videoIdNum}\"]`).remove()\n }), 250)\n \n}",
"function deleteDownloadedVideo(videoId) {\n const videoPath = getVideoPathFromId(videoId)\n const videoExists = fs.existsSync(videoPath)\n\n if (videoExists) {\n fs.unlinkSync(videoPath)\n setDownloadedVideosDb(previous => previous.filter(video => video.youtubeData.id !== videoId))\n setAllAssignedLabelsDb(previous => previous.filter(label => label.videoId !== videoId))\n }\n }",
"function deleteMedia( err ) {\n if( err ) {\n Y.log( `problem in deleting documents: ${err}`, 'error', NAME );\n callback( err );\n return;\n }\n Y.doccirrus.mongodb.runDb( {\n 'migrate': true,\n action: 'delete',\n model: 'media',\n user: user,\n query: {ownerId: activity._id},\n callback: callback\n } );\n }",
"function endVideo() {\n var video = document.getElementById('video');\n var audio = document.getElementById('audio');\n audio.parentNode.removeChild(audio);\n video.parentNode.removeChild(video);\n}",
"function deleteTrack(req, res, next) {\n db.tx(t => t.batch([\n t.none(`DELETE FROM tracks\n WHERE id = $1;`, req.params.id),\n t.none(`DELETE FROM track_data\n WHERE track_id = $1;`, req.params.id)\n ]))\n .then(() => next())\n .catch(err => next(err));\n}",
"function detachVideo() {\n const self = this;\n\n this.janusVideoPlugin &&\n this.janusVideoPlugin.detach({\n success: function() {\n self.janusInstance.destroy();\n },\n error: function() {\n LOGGER.log(\n `Failed to properly detach our Video plugin from Janus, hoping for the best...`\n );\n self.janusInstance.destroy();\n }\n });\n}",
"function deleteBySubcribers(videoIdToDelete){\n \n //if subscriber login\n //fn ajax deleteVIdeo.php\n \n if (emailU == '\"noemaildefined\"' || emailU == \"\")\n\n {\n //invite to subscribe\n alert(\"Please subscribe to enable more options! \" + emailU + \" to allow you delete this video: \" + videoIdToDelete); \n\n } else {\n \n //delete video \n deleteVideoFromDB(videoIdToDelete);\n \n }\n \n \n}",
"function deleteFilm(){\n\tvar resultRegion = \"delete-film-result\";\n\t$.delete( \"./rest/filmsDB/delete\", $( \"#delete-film-form\" ).serialize() )\n\t.done(function(rawData){htmlInsert(resultRegion,rawData)})\n\t.fail(function(){alert(\"Error\")});\n}",
"async function deleteSchedule(ctx) {\n const { usernamect, availdate } = ctx.params;\n try {\n const sqlQuery = `DELETE FROM parttime_schedules WHERE username = '${usernamect}' AND availdate = '${availdate}'`;\n await pool.query(sqlQuery);\n ctx.body = {\n 'success': 'True!',\n };\n } catch (e) {\n console.log(e);\n ctx.status = 403;\n }\n}",
"async function deleteMatch(match_id) {\n await DButils.execQuery(\n `DELETE FROM dbo.events \n WHERE match_id = '${match_id}';`\n )\n\n await DButils.execQuery(\n `DELETE FROM dbo.matches \n WHERE match_id = '${match_id}';`\n )\n}",
"function deleteMovie() {\n\n let movieList = JSON.parse(sessionStorage.getItem(\"movieList\"));\n for (let i = 0; i < movieList.length; i++) {\n if (movieList[i].title == this.parentNode.id) {\n movieList.splice(i, 1);\n }\n }\n sessionStorage.setItem(\"movieList\", JSON.stringify(movieList));\n addMovies();\n}",
"async deleteTrackByID(ctx) {\n await Model.track\n .deleteOne({ _id: ctx.params.id })\n .then(result => {\n if(result.deletedCount > 0) { ctx.body = \"Delete Successful\"; }\n else { throw \"Error deleting track\"; }\n })\n .catch(error => {\n throw new Error(error);\n });\n }",
"async delete ({ params, response }) {\n const event = await Event.find(params.id)\n\n await event.delete()\n\n return response.status(200).json({\n message: 'Event deleted successfully.'\n })\n }",
"function onclick_remove(e, video_id) {\n flixstack_api.remove_from_stack(video_id, function(data, textStatus) {\n update_link(video_id, false);\n }); \n\n e.preventDefault();\n e.stopPropagation();\n return false;\n}",
"async function deleteVaccination(email, name, vacc, date) {\n let sql = `\n DELETE FROM taken\n WHERE userEmail = ? AND userName = ?\n AND vaccName = ? AND dateTaken = ?`;\n\n date = new Date(date).toISOString().slice(0, 19).replace('T', ' ');\n await db.query(sql, [email, name, vacc, date]);\n}",
"deleteAction(req, res) {\n Robot.remove({ _id: req.params.id }, (err, robot) => {\n if (err)\n this.jsonResponse(res, 400, { 'error': err });\n\n this.jsonResponse(res, 204, { 'message': 'Deleted successfully!' });\n });\n }",
"function deleteSpecifiedCurrentDownloadVideosData(fileName) {\n if (findCurrentDownloadByID(fileName) !== undefined) {\n delete currentDownloadVideos[`${fileName}`]; \n const deleteCurrentDownloadVideos = JSON.stringify(currentDownloadVideos, null, 2);\n FileSystem.writeFileSync(current_download_videos_path, deleteCurrentDownloadVideos);\n } else {\n return `${fileName} Unavaiable`; \n }\n}",
"async delete() {\n await this.pouchdb.destroy();\n await this.database.removeCollectionDoc(this.dataMigrator.name, this.schema);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calculates pi based on the number of hits and misses | function calculatePi(throws, hits) {
return (4.0 * hits) / (throws > 0 ? throws : 1);
} | [
"function myPi(n) {\n\treturn parseFloat(Math.PI.toFixed(n));\n}",
"function piSum3(a, b) {\n return sum(\n x => 1.0 / (x * (x + 2)), //piTerm\n a,\n x => x + 4, //piNext\n b\n );\n}",
"function newComputePi() {\n\t// Start at pH 7. Determine charge, contributed by N and C termini and charged amino acid side chains (performed by calcChargeAtpH).\n\t// Adjust pH upward or downward by currentStep and recompute the charge. Step in the correct direction again, this\n\t// time stepping 1/2 as far.\n\t// Continue with smaller corrective steps until charge doesn't change at two successive pHs.\n\t\n\tvar current_pH=7;\n\tvar currentStep=3.5;\n\tvar lastCharge=0;\n\tvar crntCharge=1; //something different from lastCharge to force once through the while loop\n\t\n\twhile (lastCharge!=crntCharge) {\n// \t\tconsole.log(\"pH=\"+current_pH+\" crntCharge=\"+crntCharge); // this is amusing to review in the console\n\t\tlastCharge=crntCharge;\n\t\tcrntCharge=newCalcChargeAtpH(current_pH);\n\t\tcrntCharge=(Math.round(crntCharge*1000))/1000; //round off to 3 places to the right of the decimal\n\t\t\n\t\tif (crntCharge>0){\n\t\t\t\tcurrent_pH=current_pH+currentStep;\n\t\t} else { \n\t\t\t\tcurrent_pH=current_pH-currentStep;\n\t\t}\n\t\t\n\t\tcurrentStep=currentStep/2;\n\t} //End while \n\t\n\treturn((Math.round(1000*current_pH))/1000);//rounded to 3 places after the decimal point\n\t\n\n} // END OF FUNCTION computePi",
"static get PI(): number {\n return 3.14;\n }",
"function compoundInterest(p, t, r, n) {\n\treturn Number((p * Math.pow((1 + r / n), n * t)).toFixed(2));\n}",
"function pizzaArea(r){\n //area=r*r*Pi\n var area=r*r*Math.PI;\n return area;\n}",
"function piSix(){\n return parseFloat(Math.PI.toFixed(6));\n}",
"function approxphi(n) {\r\n\r\n this.fibonacciN = getFibonacci(n);\r\n this.fibonacciNplus1 = getFibonacci(n+1);\r\n this.goldenratio = this.fibonacciN / this.fibonacciNplus1;\r\n\r\n return this.goldenratio;\r\n}",
"function getPromedio (scores) {\n return scores.reduce((acum, next) => {\n return acum + next.score / scores.length\n },0)\n}",
"function getKudoAmmount(points, i) {\n const listToPoints = (Object.values(KUDOS_TO_POINTS));\n return Math.floor(points / listToPoints[i].value);\n}",
"function enterPi() {\n currentInput = Math.PI;\n displayCurrentInput();\n}",
"function pochisq(x, df) {\n var a, y, s;\n var e, c, z;\n var even; /* True if df is an even number */\n\n var LOG_SQRT_PI = 0.5723649429247000870717135; /* log(sqrt(pi)) */\n var I_SQRT_PI = 0.5641895835477562869480795; /* 1 / sqrt(pi) */\n\n if (x <= 0.0 || df < 1) {\n return 1.0;\n }\n\n a = 0.5 * x;\n even = !(df & 1);\n if (df > 1) {\n y = ex(-a);\n }\n s = (even ? y : (2.0 * poz(-Math.sqrt(x))));\n if (df > 2) {\n x = 0.5 * (df - 1.0);\n z = (even ? 1.0 : 0.5);\n if (a > BIGX) {\n e = (even ? 0.0 : LOG_SQRT_PI);\n c = Math.log(a);\n while (z <= x) {\n e = Math.log(z) + e;\n s += ex(c * z - a - e);\n z += 1.0;\n }\n return s;\n } else {\n e = (even ? 1.0 : (I_SQRT_PI / Math.sqrt(a)));\n c = 0.0;\n while (z <= x) {\n e = e * (a / z);\n c = c + e;\n z += 1.0;\n }\n return c * y + s;\n }\n } else {\n return s;\n }\n }",
"function calculateCirclePerimeter() {\n return this.radius * 2 * Math.PI;\n}",
"function getPiDigits(dimension, start_digit) {\n\n var deferred = q.defer();\n\n // How many pages we need to pull\n var pages = Math.floor((9 * (dimension * dimension) ) / 1000) + 1;\n var start_page = Math.floor(start_digit / 1000);\n\n // the digits of pi that we need to make our image\n var digits = \"\";\n\n // An array of all the promises that we need to make\n var promises = [];\n\n // add the promise for each page\n for(var count = 0; count < pages; count ++) {\n promises[count] = fetchPiDigits(start_page + count); \n }\n\n q.allSettled(promises)\n .then(function (results) {\n results.forEach( function (result) {\n digits += result.value;\n });\n\n //remove unwanted digits from the start of the first page\n digits = digits.substring(start_digit % 1000, digits.length);\n\n deferred.resolve(digits);\n });\n\n return deferred.promise;\n }",
"function perimeter(n) {\n let total = 0;\n let first = 1;\n let second = 1;\n let third;\n for (let i = 0; i <= n; i++) {\n third = first + second;\n total += first;\n\n first = second;\n second = third;\n \n }\n return (total) * 4;\n}",
"function countVotes(votos, nvotos, n, mu, lambda, npartidos) {\n /*\n http://security.hsr.ch/msevote/seminar-papers/HS09_Homomorphic_Tallying_with_Paillier.pdf\n */\n\n\n var producto = 1;\n var n2 = bignum(n).pow(2);\n\n console.log(votos[0]);\n console.log(n);\n console.log(mu);\n console.log(lambda);\n console.log(bignum(mu).invertm(n));\n\n\n for (var i = 0; i < nvotos; i++) {\n console.log(\"Votante \" + i + \" \" + votos[i]);\n producto = bignum(producto).mul(bignum(votos[i]));\n }\n\n console.log(producto);\n\n var tally = bignum(producto).mod(n2);\n\n console.log(\"N: \" + n);\n console.log(\"N^2: \" + n2);\n\n var resultado_f1 = bignum(tally).powm(lambda, n2);\n var resultado_f2 = (bignum(resultado_f1).sub(1)).div(n);\n var resultados = bignum(resultado_f2).mul(mu).mod(n);\n\n console.log(\"RESULTADOS: \" + resultados);\n\n var resultado = {};\n\n for (var i = 1; i <= npartidos; i++) {\n\n resultado[i + 'partido'] = Math.floor((resultados / Math.pow(10, i - 1)) % 10);\n }\n\n /*var resultado = {\n '1partido' : Math.floor((resultados / 1) % 10),\n '2partido' : Math.floor((resultados / 10) % 10),\n '3partido' : Math.floor((resultados / 100) % 10),\n '4partido' : Math.floor((resultados / 1000) % 10)\n };*/\n\n return resultado;\n\n }",
"function getPercentOf(p, n) {\n\treturn p/100 * n\n}",
"function randProbPrime(k) {\r\n if (k>=600) return randProbPrimeRounds(k,2); //numbers from HAC table 4.3\r\n if (k>=550) return randProbPrimeRounds(k,4);\r\n if (k>=500) return randProbPrimeRounds(k,5);\r\n if (k>=400) return randProbPrimeRounds(k,6);\r\n if (k>=350) return randProbPrimeRounds(k,7);\r\n if (k>=300) return randProbPrimeRounds(k,9);\r\n if (k>=250) return randProbPrimeRounds(k,12); //numbers from HAC table 4.4\r\n if (k>=200) return randProbPrimeRounds(k,15);\r\n if (k>=150) return randProbPrimeRounds(k,18);\r\n if (k>=100) return randProbPrimeRounds(k,27);\r\n return randProbPrimeRounds(k,40); //number from HAC remark 4.26 (only an estimate)\r\n }",
"function buscarCuadrados(inicial,final)\n{ \n cuadrados = 0;\n for(contador=inicial; contador<=final; contador++)\n {\n if(Math.sqrt(contador)%1 == 0)\n {\n cuadrados++;\n }\n else{}\n }\n console.log(cuadrados);\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This is an Amazonprovided function that checks whether the requesting device has a display. Returns True if it does and False if it doesn't | function supportsDisplay() {
var hasDisplay =
this.event.context &&
this.event.context.System &&
this.event.context.System.device &&
this.event.context.System.device.supportedInterfaces &&
this.event.context.System.device.supportedInterfaces.Display
return hasDisplay;
} | [
"static isDisplaySupported(requestEnvelope) {\n return requestEnvelope.context.System.device.supportedInterfaces.Display !== undefined;\n }",
"function isMediaDevicesSuported(){return hasNavigator()&&!!navigator.mediaDevices;}",
"function isViewed(display_frame_name) \n{ \n for (i = 0; i < active_displays_l.length; i++) \n { \n if (active_displays_l[i] == display_frame_name) \n { \n return true; \n } \n } \n return false; \n}",
"static inFocusDisplaying(displayOption) {\n if (Platform.OS == 'android') {\n RNOneSignal.inFocusDisplaying(displayOption);\n }\n }",
"function deviceHasTouchScreen() {\n let hasTouchScreen = false;\n if (\"maxTouchPoints\" in navigator) {\n hasTouchScreen = navigator.maxTouchPoints > 0;\n } else if (\"msMaxTouchPoints\" in navigator) {\n hasTouchScreen = navigator.msMaxTouchPoints > 0;\n } else {\n var mQ = window.matchMedia && matchMedia(\"(pointer:coarse)\");\n if (mQ && mQ.media === \"(pointer:coarse)\") {\n hasTouchScreen = !!mQ.matches;\n } else if ('orientation' in window) {\n hasTouchScreen = true; // deprecated, but good fallback\n } else {\n // Only as a last resort, fall back to user agent sniffing\n var UA = navigator.userAgent;\n hasTouchScreen = (\n /\\b(BlackBerry|webOS|iPhone|IEMobile)\\b/i.test(UA) ||\n /\\b(Android|Windows Phone|iPad|iPod)\\b/i.test(UA)\n );\n }\n }\n return hasTouchScreen;\n }",
"function canEnumerateDevices(){return!!(isMediaDevicesSuported()&&navigator.mediaDevices.enumerateDevices);}",
"function checkIfMobile() {\n var isMobile = navigator.userAgent.match(/Android/i) ||\n navigator.userAgent.match(/iPhone|iPad|iPod/i);\n if (isMobile) {\n var zmControls = getElement('ZmControls');\n if (zmControls) {\n zmControls.style.display = 'none';\n }\n }\n}",
"function checkStatus() {\n if (supportsAvif !== null && supportsWebp !== null) {\n showOverlay();\n return;\n }\n }",
"function checkDeviceIfExist(devName,type){\n\tvar myReturn = false;\n\tif(globalInfoType == \"JSON\"){\n var devices = getDevicesNodeJSON();\n }else{\n var devices =devicesArr;\n }\n\tif(devName == \"\"){\n\t\tfor(var a=0; a < window['variable' + dynamicLineConnected[pageCanvas]].length;a++){\n\t\t\tif(pageCanvas == window['variable' + dynamicLineConnected[pageCanvas]][a].Page){\n\t\t\t\tmyReturn = true;\n\t\t\t}\n\t\t}\t\n\t}else{\n\t\tfor(var a=0; a<devices.length;a++){\n\t\t\tif (devName == devices[a].DeviceName && type != \"createdev\"){\n\t\t\t\tmyReturn = true;\n\t\t\t}else if(devName == devices[a].DeviceName && type == \"createdev\"){ \n\t\t\t\tmyReturn = true;\n\t\t\t}\t\n\t\t}\n\t}\n\treturn myReturn;\n}",
"function isScreenAddress(address) {\n return address >= SCREEN_BEGIN && address < SCREEN_END;\n}",
"function isDisplayClear()\n{\n if ($siteDisplay.innerHTML === '')\n return true;\n\n else\n return false;\n}",
"function showCourt(_someDeviceIP) {\n checkMyDeviceInfo(_someDeviceIP);\n}",
"function check() {\n clearTimeout(timer)\n\n if (device.present) {\n // We might get multiple status updates in rapid succession,\n // so let's wait for a while\n switch (device.type) {\n case 'device':\n case 'emulator':\n willStop = false\n timer = setTimeout(work, 100)\n break\n default:\n willStop = true\n timer = setTimeout(stop, 100)\n break\n }\n }\n else {\n willStop = true\n stop()\n }\n }",
"function is_retina_device() {\n return window.devicePixelRatio > 1;\n}",
"function showScreen(screenId) {\n const allScreens = document.getElementsByClassName(\"screen\");\n let shownScreen = undefined;\n for (const screen of allScreens) {\n if (screen.id === screenId) {\n screen.classList.remove(\"hidden\");\n shownScreen = screen;\n }\n else {\n screen.classList.add(\"hidden\");\n }\n }\n if (shownScreen === undefined) {\n throw new Error(\"Cannot find screen \" + screenId);\n }\n return shownScreen;\n}",
"function isInSnapZone() {\n\tconst point = electron.screen.getCursorScreenPoint()\n\tconst display = electron.screen.getDisplayNearestPoint(point)\n\n\t// Check if cursor is near the left/right edge of the active display\n\treturn (point.x > display.bounds.x - 20 && point.x < display.bounds.x + 20) || (point.x > display.bounds.x + display.bounds.width - 20 && point.x < display.bounds.x + display.bounds.width + 20);\n}",
"function chkMobile() {\r\n\treturn /iPhone|iPad|iPod|Android/i.test(navigator.userAgent);\r\n}",
"function checkOnScreen(myURL){\n HeadingArray = getOnScreenHeadingArray();\n URLArray = getOnScreenURLArray();\n\t\n\tvar i = URLArray.indexOf(myURL);\n if( i != -1 ){\n\t alert(\"Already exists OnScreen with heading: \"+HeadingArray[i]+\" .\");\n\t\treturn true;\n\t}\n}",
"function canGetDetails()\n{\n\tvar componentRec = dw.serverComponentsPalette.getSelectedNode();\n\tif ((componentRec != null) && (componentRec.detailsText != \"\"))\n\t{\n\t\treturn true;\n\t}\n\n\treturn false;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Delete the underlying WASM instance. Should be called before dereferencing this object to prevent the WASM heap from growing indefinitely. | delete() {
if (_instance) {
_instance.delete()
_instance = null
}
} | [
"deleteInstance(instance) {\n this.instances.remove(instance)\n }",
"destroy() {\n _wl_scene_remove_object(this.objectId);\n this.objectId = null;\n }",
"_destroy() {\n\t\tthis.workspaces_settings.disconnect(this.workspaces_names_changed);\n\t\tWM.disconnect(this._ws_number_changed);\n\t\tglobal.display.disconnect(this._restacked);\n\t\tglobal.display.disconnect(this._window_left_monitor);\n\t\tthis.ws_bar.destroy();\n\t\tsuper.destroy();\n\t}",
"_destroyDOM() {\n this.DOMbuilder.destroy();\n }",
"Destroy()\n {\n const gl = device.gl;\n\n if (this.texture)\n {\n gl.deleteTexture(this.texture.texture);\n this.texture = null;\n }\n\n if (this._renderBuffer)\n {\n gl.deleteRenderbuffer(this._renderBuffer);\n this._renderBuffer = null;\n }\n\n if (this._frameBuffer)\n {\n gl.deleteFramebuffer(this._frameBuffer);\n this._frameBuffer = null;\n }\n }",
"delete () {\n\t\t// This is to call the parent class's delete method\n\t\tsuper.delete();\n\n\t\t// Remove all remaining chain links\n\t\twhile (this.chains.length > 0) this.removeLastChain();\n\n\t\t// Clear the class's hook instance.\n\t\tHook.hookElement = null;\n\t}",
"deregister() {\n if (this.ws) {\n this.ws.close();\n this.ws = null;\n }\n }",
"function cleanup() {\n if (global.gc) {\n global.gc();\n }\n}",
"destroy () {\n this.group.remove(this.sprite, true, true);\n this.gameObjectsGroup.destroyMember(this);\n }",
"destroy()\n {\n //first remove it from the scene.\n this.#scene.remove(this);\n //then destroy all components.\n while(this.#components.length > 0)\n {\n let currentComponent = this.#components.pop();\n currentComponent.destroy();\n }\n }",
"destroyElement() {\n if (this.dom) {\n this.dom.remove();\n }\n }",
"delete(){\n\t\tif (removeFromReferenceCount(this.index) === 0){\n\t\t\tthis.gl.deleteTexture(this.texture);\n\t\t}\n }",
"async destroy() {\n this.destroyed = true;\n for (const i in index_1.api.connections.globalMiddleware) {\n const middlewareName = index_1.api.connections.globalMiddleware[i];\n if (typeof index_1.api.connections.middleware[middlewareName].destroy === \"function\") {\n await index_1.api.connections.middleware[middlewareName].destroy(this);\n }\n }\n if (this.canChat === true) {\n const promises = [];\n for (const i in this.rooms) {\n const room = this.rooms[i];\n promises.push(index_1.chatRoom.removeMember(this.id, room));\n }\n await Promise.all(promises);\n }\n const server = index_1.api.servers.servers[this.type];\n if (server) {\n if (server.attributes.logExits === true) {\n server.log(\"connection closed\", \"info\", { to: this.remoteIP });\n }\n if (typeof server.goodbye === \"function\") {\n server.goodbye(this);\n }\n }\n delete index_1.api.connections.connections[this.id];\n }",
"free() {\n this.extractor.free();\n }",
"destroy() {\n if (this._destroyed) {\n throw new RuntimeError(406 /* RuntimeErrorCode.APPLICATION_REF_ALREADY_DESTROYED */, ngDevMode && 'This instance of the `ApplicationRef` has already been destroyed.');\n }\n const injector = this._injector;\n // Check that this injector instance supports destroy operation.\n if (injector.destroy && !injector.destroyed) {\n // Destroying an underlying injector will trigger the `ngOnDestroy` lifecycle\n // hook, which invokes the remaining cleanup actions.\n injector.destroy();\n }\n }",
"detach() {\n this.surface = null;\n this.dom = null;\n }",
"close()\n {\n gl.deleteShader(this.handle);\n this.handle = null;\n }",
"_cleanupFrame() {\n // Uninstall the listener.\n if (this._frame) {\n this._frame.messageManager.removeMessageListener(\"icqStudyMsg\", this._chromeHandler);\n this._frame = null;\n this._chromeHandler = null;\n }\n\n // Dispose of the hidden browser.\n if (this._browser !== null) {\n this._browser.remove();\n this._browser = null;\n }\n\n if (this._hiddenFrame) {\n this._hiddenFrame.destroy();\n this._hiddenFrame = null;\n }\n }",
"_clearMemory() {\n for (let i = 0; i < this._memory.length; i++) {\n this._memory[i] = 0;\n }\n }",
"destroy() {\n if (this.panel) {\n this.panel.destroy();\n this.panel = undefined;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
save all company species records | function saveCompanySpecies(obj) {
return post('/companyspecies/save', { obj: obj }).then(function (res) {
return res.data;
}).catch(function (err) {
return err.response.data;
});
} | [
"function save_all() {\n\tvar type = $('#type_list').find(\":selected\").val();\n\t// if it's for a new cue, we fetch everything from the UI\n\tif (cue_id == 'xx') {\t\n\t\tvar channel = Number($(\"#channel\").val());\n\t\tvar delay = Number($(\"#delay\").val());\n\t\tvar options = {};\n\t\tvar name = $('#cue_name').val();\n\t\tvar cue = create_cue(type, channel, delay, name, options);\n\t\tcue_id = add_cue(event_obj.cue_list, cue);\n\t\tdocument.getElementById(\"cue_id\").innerHTML = \", Cue nยฐ\"+cue_id;\n\t}\n\t// updates the cue (command == edit_cue)\n\telse{\n\t\tsave_delay();\n\t\tsave_type();\n\t\tsave_channel();\n\t\tsave_name();\n\t}\n\tsave_options();\n\n\tfs.writeFileSync(data_file, JSON.stringify(project, null, 2));\n}",
"function postCompanyInfo() {\r\n\r\n var companyInfo = new JobSearchApp.Models.Company({\r\n name: $compName.val(),\r\n companyEmail: $compEmail.val(),\r\n phone: $tel.val(),\r\n url: $compUrl.val()\r\n });\r\n\r\n JobSearchApp.DataAccess.saveCompany(companyInfo, function (postedCompany) {\r\n toastr.success(\"Company info posted to Azure\");\r\n console.log(postedCompany);\r\n\r\n postJob(postedCompany.id);\r\n postAddress(postedCompany.id);\r\n\r\n }, function (error) {\r\n toastr.error(\"Your posting to Azure failed\");\r\n console.log(error);\r\n });\r\n\r\n }",
"function saveCompany(company) {\n\n // update the target URL\n var targetUrl = CompanyUrl;\n\n // Update the stored data\n $.ajax({\n url: targetUrl,\n type: 'POST',\n dataType: 'json',\n data: company,\n success: function (data, txtStatus, xhr) {\n var token;\n clearCompanyDetails();\n clearCompanies();\n token = loadCompanyData(refreshCompanyComboData);\n setEditMode(false);\n },\n error: function (xhr, textStatus, errorThrown) {\n alert(\"Error Saving new Company: \" +xhr.Response.text);\n }\n });\n }",
"function saveBulkPrices() {\n for (i=0; i<$scope.gridOptions.data.length; i++) {\n productSupplier = $scope.gridOptions.data[i];\n if (productSupplier.subGridOptions != undefined && productSupplier.subGridOptions.data != undefined) {\n for (j=0; j<productSupplier.subGridOptions.data.length; j++) {\n bulkPrice = productSupplier.subGridOptions.data[j];\n if (bulkPrice == undefined || bulkPrice == null) {\n continue;\n }\n switch (bulkPrice.name) {\n case 'bulk1' :\n productSupplier.bulkPrice = bulkPrice.value;\n productSupplier.bulkQty = bulkPrice.qty;\n case 'bulk2' :\n productSupplier.bulkPrice2 = bulkPrice.value;\n productSupplier.bulkQty2 = bulkPrice.qty;\n case 'bulk3' :\n productSupplier.bulkPrice3 = bulkPrice.value;\n productSupplier.bulkQty3 = bulkPrice.qty;\n case 'bulk4' :\n productSupplier.bulkPrice4 = bulkPrice.value;\n productSupplier.bulkQty4 = bulkPrice.qty;\n case 'bulk5' :\n productSupplier.bulkPrice5 = bulkPrice.value;\n productSupplier.bulkQty5 = bulkPrice.qty;\n default:\n }\n\n }\n }\n delete productSupplier.subGridOptions;\n }\n\n }",
"function saveApis(data) {\n \n defineDBSchema(2);\n firstDBShemaVersion(1);\n db.open();\n\n /* data.forEach(function(item) {\n db.apis.put(item);\n console.log('saved api', item.apiName);\n });\n */\n\n db.transaction('rw', db.apis, function() {\n data.forEach(function(item) {\n db.apis.put(item);\n console.log('added api from txn', item.apiName);\n });\n }).catch(function(error) {\n console.error('error', error);\n });\n \n\n // .finally(function() {\n // db.close(); \n // });\n }",
"function save() {\n for (var groupIndex in $scope.groups.groupList) {\n for (var studentIndex in $scope.groups.groupList[groupIndex].studentList) {\n // Student has been selected if any of Select All, Course group, or student itself has been selected. \n if ($scope.groups.groupList[groupIndex]._selected || $scope.groups.groupList[groupIndex].studentList[studentIndex]._selected) {\n StudentOptionEntry.create({\n studentId: $scope.groups.groupList[groupIndex].studentList[studentIndex].id,\n examOptionId: entity.customExam.examOptionId,\n statusId: 1,\n ediStatusId: 8,\n resit: 0,\n private: 0\n }).then(function(response) {}, function(response) {});\n }\n }\n }\n\n $uibModalInstance.close();\n }",
"function onLeanCompanySave(err, leancompany) {\n if (err){\n console.log(\"Saving Failed - \" + leancompany.companyname);\n }else{\n console.log(\"Saving Successful - \" + leancompany.companyname);\n }\n}",
"function MDUO_Save(){\n console.log(\"=== MDUO_Save =====\") ;\n // save subject that have exam_id or ntb_id\n // - when exam_id has value and ntb_id = null: this means that ntb is removed\n // - when exam_id is null and ntb_id has value: this means that there is no exam record yet\n // - when exam_id and ntb_id both have value: this means that ntb_id is unchanged or chganegd\n const exam_list = [];\n if(mod_MDUO_dict.duo_subject_dicts){\n for (const data_dict of Object.values(mod_MDUO_dict.duo_subject_dicts)) {\n\n if (data_dict.exam_id || data_dict.ntb_id){\n exam_list.push({\n subj_id: data_dict.subj_id,\n ntb_id: data_dict.ntb_id,\n dep_pk: data_dict.dep_id,\n level_pk: data_dict.lvl_id,\n subj_name_nl: data_dict.subj_name_nl,\n exam_id: data_dict.exam_id,\n ntb_omschrijving: data_dict.ntb_omschrijving\n });\n };\n };\n };\n if (exam_list.length) {\n const upload_dict = {\n examperiod: setting_dict.sel_examperiod,\n exam_list: exam_list\n };\n// --- upload changes\n const url_str = urls.url_duo_exam_upload;\n console.log(\"upload_dict\", upload_dict) ;\n console.log(\"url_str\", url_str) ;\n\n UploadChanges(upload_dict, url_str);\n };\n $(\"#id_mod_duoexams\").modal(\"hide\");\n }",
"function SaveToDB()\r\n{\r\n fs.readFile('listings.json', 'utf8', function (err, data)\r\n {\r\n let listings = JSON.parse(data).entries;\r\n listings.forEach(listing =>\r\n {\r\n let tmpVar = new Listing(listing).save(function (err, listing)\r\n {\r\n if (err)\r\n {\r\n console.log(err);\r\n }\r\n itr++;\r\n console.log(\"Saved listing item \" + itr);\r\n });\r\n });\r\n }\r\n );\r\n}",
"function save_existing_account()\r\n {\r\n if(!validate_dwolla_id()) return;\r\n\r\n charity_info.dwolla_id=$(\"#dwolla_id\").val();\r\n\r\n $.ajax(\r\n {\r\n url: \"/save_charity\",\r\n type: \"POST\",\r\n data: charity_info,\r\n success:\r\n function(data)\r\n {\r\n if(data.success)\r\n {\r\n charity_info.id=data.charity_id;\r\n $(\"#charity_id\").html(charity_info.id);\r\n _gaq.push([\"_trackPageView\",\"/register/step3\"]);\r\n show_next();\r\n }\r\n else\r\n {\r\n $(\"#error_list\").empty().append(\"<li>There was an internal problem saving your information, please try again later</li>\");\r\n $(\"#validation_errors\").popup();\r\n }\r\n },\r\n error:\r\n function(data)\r\n {\r\n $(\"#error_list\").empty().append(\"<li>There was a problem saving your information, please try again later</li>\");\r\n $(\"#validation_errors\").popup();\r\n }\r\n }); //end save_charity ajax call\r\n }",
"function saveCompanyData (callback) {\n const xhr = new XMLHttpRequest();\n xhr.open('POST', `/settings?id=${companyId}`);\n xhr.setRequestHeader('Content-type', 'application/json');\n xhr.send(JSON.stringify({\n company_name: document.getElementById('company-name-input').value,\n country: document.getElementById('company-country-input').value,\n phone_number: document.getElementById('company-phone-number-input').value || null,\n account_holder_name: document.getElementById('company-account-holder-name-input').value || null,\n timezone: document.getElementById('country-timezone-input').value || null\n }));\n\n xhr.onreadystatechange = function () {\n if (xhr.readyState == 4 && xhr.responseText) {\n const response = JSON.parse(xhr.responseText);\n\n if (!response.success && response.error)\n return callback(response.error);\n\n return callback(null);\n }\n };\n}",
"updateSaves(id, saveText){\n let cards = this.components.filter((component) => component.constructor.name==\"Card\" && component.card.cardID == id);\n for(const card of cards){\n console.log(card.saveId);\n console.log(saveText);\n $(\"#\"+card.saveId).text(saveText);\n }\n\n }",
"function doSaveMonster()\r\n{\r\n\tconsole.log(\"saving monster\");\r\n\tvar blank = bestiary[0]; \r\n\tblank.name = $('#m_name').val();\r\n\tblank.classes.class1.name = $('#m_class1').val(); \r\n\tblank.classes.class2.name = $('#m_class2').val();\r\n\tblank.alignment = $('#m_alignment').val();\r\n\tblank.hitPoints.hp = $('#m_hp').val();\r\n\tblank.hitPoints.hitDie = $('#m_hitdie').val(); \r\n\tblank.spatial.size = $('#m_size').val(); \r\n\tblank.combatInfo.ac = $('#m_ac').val(); \r\n\tblank.combatInfo.cr = $('#m_cr').val(); \r\n\tblank.combatInfo.melee = $('#m_melee').val(); \r\n\tblank.combatInfo.ranged = $('#m_ranged').val(); \r\n\tblank.combatInfo.ac_touch = $('#m_actouch').val(); \r\n\tblank.combatInfo.ac_flatFooted = $('#m_acflat').val(); \r\n\tblank.savingThrows.fort = $('#m_forts').val(); \r\n\tblank.savingThrows.ref = $('#m_refs').val(); \r\n\tblank.savingThrows.wil = $('#m_wils').val(); \r\n\r\n\tblank.abilityScores.str = $('#m_str').val(); \r\n\tblank.abilityScores.dex = $('#m_dex').val(); \r\n\tblank.abilityScores.con = $('#m_con').val(); \r\n\tblank.abilityScores.int = $('#m_int').val(); \r\n\tblank.abilityScores.wis = $('#m_wis').val();\r\n\tblank.abilityScores.cha = $('#m_cha').val(); \r\n\r\n\tblank.notes = $('#notesarea').val();\r\n\r\n\tblank.classes.class1.levels = $('#m_class1levels').val(); \r\n\tblank.classes.class2.levels = $('#m_class2levels').val(); \r\n\r\n\tvar skills = $('#m_skills').val(); \r\n\tskills = skills.split(','); \r\n\tfor(var i = 0; i < skills.length; i++)\r\n\t{\r\n\t\tblank.skills.push(skills[i]);\r\n\t}\r\n\r\n\tvar feats = $('#m_feats').val(); \r\n\tfeats = feats.split(','); \r\n\tfor(var i = 0; i < feats.length; i++)\r\n\t{\r\n\t\tblank.feats.push(feats[i]);\r\n\t}\r\n\r\n\tconsole.log(blank);\r\n\r\n\r\n\t var a = document.createElement('div'); \r\n\t $(a).addClass('iconarea')\r\n\t var b = document.createElement('div'); \r\n\t $(b).addClass('monstericon genericicon');\r\n\t $(a).append(b); \r\n\t var p = document.createElement('p'); \r\n\t $(p).html(blank.name);\r\n\t $(a).append(p); \r\n\t $('#newmonster').before(a);\r\n}",
"function save(snpp, seasons)\n{\n\tvar ii;\n\n\tfor (ii = 0; ii < seasons.length; ii++)\n\t\tsnpp.walkEpisodes(seasons[ii], iterEpisode, iterDone);\n}",
"function saveState(){\n writeToFile(userFile, users);\n writeToFile(campusFile, campus);\n}",
"function SaveCompanyShift() {\r\n if (!ValidateShiftTime()) {\r\n angular.element('#idReqValidation').show();\r\n return;\r\n }\r\n CreateRequestObject();\r\n var data = JSON.stringify($scope.ShiftList);\r\n $http({\r\n method: \"POST\",\r\n url: \"api/Admin/SaveShift\",\r\n params: { requestParam: data }\r\n }).then(function (successData) {\r\n if (successData.status == 202) {\r\n $scope.ErrorMsg = successData.data;\r\n angular.element('#idReqValidation').show();\r\n return;\r\n }\r\n if (successData.data == 'Y') {\r\n $scope.Reset();\r\n $scope.SuccessMessage = 'Shift details saved successfully for selected company';\r\n }\r\n });\r\n }",
"function storeEarthquakeData(arr) {\n // Add data to Earthquake DB \n arr.forEach(element => {\nconsole.log(\"Adding ID: \" + element.id + \" to db.earthquake\") \n // ES6 destructuring to parse out; id, time, place, url, mag\n const { id, time, place, url, mag } = element;\n\n Earthquake.create({\n id: id,\n time : time,\n place : place,\n url : url,\n mag : mag\n })\n })\n}",
"saveWorker(worker) {\n worker.taxToPay = Util.payTaxes(worker.salary);\n ODWorker.ListOfWorkers.push(worker);\n console.log('save worker reach and save');\n console.log(worker);\n }",
"save() {\n saveScenario({\n scenarioData: this.state.scenarioData,\n colorData: this.state.colorData,\n pluginData: this.state.pluginData,\n });\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
create a program from a function. | function Program(f) {
EventEmitter.call(this);
var program = this;
this.cli = self;
var spent = false;
program._run = f;
program.closed = false;
program.write = function () {
if (program.closed) {
return program;
}
var len = arguments.length;
for (var i = 0; i < len; i++) {
outStream.write(arguments[i]);
}
return program;
}
program.writeln = function () {
var len = arguments.length;
for (var i = 0; i < len; i++) {
program.write(arguments[i]);
}
program.write('\n');
return program;
}
program.sendEnter = function (s) {
program.emit('enter', s);
}
program.prompt = function (s, f) {
program.write(s);
program.once('enter', function (str) {
f(str);
});
}
} | [
"function program(impl) {\n return function(flagDecoder) {\n return function(object, moduleName, debugMetadata) {\n object.start = function start(onAppReady) {\n return makeComponent(impl, onAppReady);\n };\n };\n };\n }",
"function programWithFlags(impl) {\n return function(flagDecoder) {\n return function(object, moduleName, debugMetadata) {\n object.start = function start(onAppReady, flags = {}) {\n if (typeof flagDecoder === 'undefined') {\n throw new Error(\n 'Are you trying to sneak a Never value into Elm? Trickster!\\n'\n + 'It looks like ' + moduleName + '.main is defined with `programWithFlags` but has type `Program Never`.\\n'\n + 'Use `program` instead if you do not want flags.'\n );\n }\n var result = A2(_elm_lang$core$Native_Json.run, flagDecoder, flags);\n if (result.ctor === 'Err')\n {\n \tthrow new Error(\n \t\tmoduleName + '.start(...) was called with an unexpected argument.\\n'\n \t\t+ 'I tried to convert it to an Elm value, but ran into this problem:\\n\\n'\n \t\t+ result._0\n \t);\n }\n return makeComponent(impl, onAppReady, result._0);\n };\n };\n };\n }",
"Program() {\n return factory.Program(this.StatementList());\n }",
"program() {\n this.eat(tokens.PROGRAM);\n const varNode = this.variable();\n const progNode = varNode.value;\n this.eat(tokens.semi);\n const blockNode = this.block();\n const programNode = new Program(progNode, blockNode);\n this.eat(tokens.dot);\n return programNode;\n }",
"function generateProgram()\n\t{\n\t\t// Start code generation from the root\n\t\tgenerateStatement(_AST.root);\n\t\t// Place a break statement after the program to pad the static data\n\t\t_ByteCodeList.push(\"00\");\n\t}",
"function makeProg(mappings, o) {\n console.log(\"make prog o\", o);\n\n if (o.type === 'SimplicialComplex') {\n\treturn scToSub(mappings, o);\n } else if (o.type === 'MeshSubset') {\n\treturn subsetToSub(mappings, o);\n }\n}",
"function createFunction() {\n\tlet hello = \"hello\";\n\tfunction holla() {\n\t\tconsole.log(hello);\n\t}\n\treturn holla;\n}",
"function loadFunction(f) {\n\treturn fs.readFile(f, 'utf8')\n\t.then(b => ({ file: f, body: b, name: functionName(b) }))\n\t.catch(err => { err.message = f + \": \" + err.message; throw err; });\n}",
"function execute_application(fun, args, succeed, fail) {\n if (is_primitive_function(fun)) {\n succeed(apply_primitive_function(fun, args), fail);\n } else if (is_compound_function(fun)) {\n const body = function_body(fun);\n const locals = function_locals(fun);\n const names = insert_all(map(name_of_name, function_parameters(fun)),\n locals);\n const temp_values = map(x => no_value_yet,\n locals);\n const values = append(args, temp_values);\n body(extend_environment(names, values, function_environment(fun)),\n (val, fail2) => {\n if (is_return_value(val)) {\n succeed(return_value_content(val), fail2);\n } else {\n succeed(undefined, fail2);\n }\n },\n fail);\n } else {\n error(fun, \"Unknown function type in apply\");\n }\n}",
"function exec(func, arg) {\r\n func(arg);\r\n}",
"function createFunctionWithInput(input){\n const x = input;\n function returnInput(){\n return x;\n }\n return returnInput;\n}",
"function main() {\n\tconsole.log('Abacus iPad App Generator.');\n console.log('Create flat basic styled app from converted spreadhseet.');\n\tDU.displayTag();\n\n\tif(ops.version){\n\t\tprocess.exit();\n\t}\n\n\tif(!ops.repoPath){\n\t\tconsole.error('Missing argument: --repoPath');\n\t\tops.printHelp();\n\t\tprocess.exit(-2);\n\t}\n\n\tif(!ops.engine){\n\t\tconsole.error('Missing argument: --engine');\n\t\tops.printHelp();\n\t\tprocess.exit(-2);\n\t}\n\n\tif (ops.instance){\n\t\tconfig.instance = S(ops.instance).slugify().s;\n\t}\n\n\tif(ops.language){\n\t\tconfig.language = ops.language;\n\t}\n\n\tif(ops.noExtract){\n\t\tconfig.extractEngine = false;\n\t}\n\n\tif(ops.numeric){\n\t\tconfig.usePageNames = false;\n\t}\n\n\t// mandatory arguments\n\tconfig.repoPath = ops.repoPath;\n\tconfig.engineFile = ops.engine;\n\n\t// call extract, pass in config\n\tAG.generate(config);\n}",
"_generate(ast) {}",
"function make_function_value(parameters, locals, body, env) {\n return { tag: \"function_value\",\n parameters: parameters,\n locals: locals,\n body: body,\n environment: env,\n // we include a prototype property, initially\n // the empty object. This means, user programs\n // can do: my_function.prototype.m = ...\n prototype: {},\n // another way of calling a function is by\n // invoking it via my_function.call(x,y,z)\n // This is actually an object method application,\n // and thus it becomes\n // (my_function[\"call\"])(my_function,x,y,z)\n // Therefore, we add an argument (let's call it\n // __function__) in front of the parameter list.\n call: { tag: \"function_value\",\n parameters: pair(\"__function__\",\n parameters),\n locals: locals,\n body: body,\n environment: env\n },\n // the property Inherits is available for all functions f\n // in the given program. This means that we can call\n // f.Inherits(...), using object method application\n Inherits: inherits_function_value\n };\n}",
"static newBuilder() {\n return new ProgramBuilder({\n booleanFlags: [],\n valuedFlags: [],\n positionalArguments: new PositionalArguments_1.default(),\n programMetadata: {}\n });\n }",
"function addFunctionToPage(f, label) {\n let $script = document.createElement('script');\n $script[($script['innerText']) ? 'innerText' : 'textContent'] = '('+f+')()';\n $script['data-label'] = label;\n document.head.appendChild($script);\n }",
"function make(cb) {\n\t\tvar str = injector.toString()\n\t\t\t, sc\n\t\t\t, hr\n\t\t\t, func\n\t\t\t;\n\t\tswitch (arguments.length) {\n\t\t\tcase 1:\n\t\t\t\tsc = 'INJECT';\n\t\t\t\thr = window.location.href;\n\t\t\t\tfunc = ('function' == typeof arguments[0])? arguments[0]: function(){};\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tsc = ('string' == typeof arguments[0])? arguments[0].replace(/\\s/g, ''): 'INJECT';\n\t\t\t\thr = window.location.href;\n\t\t\t\tfunc = ('function' == typeof arguments[1])? arguments[1]: function(){};\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tsc = ('string' == typeof arguments[0])? arguments[0].replace(/\\s/g, ''): 'INJECT';\n\t\t\t\thr = ('string' == typeof arguments[1])? arguments[1].replace(/\\s/g, ''): window.location.href;\n\t\t\t\tfunc = ('function' == typeof arguments[2])? arguments[2]: function(){};\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tfn('Wrong argument');\n\t\t};\n\t\t\n\t\thr = hr.replace(/\\/$/, '');\n\t\t\n\t\tstr = minJS(str.replace(/SCOPE/g, sc).replace(/HREF/g, hr));\n\t\tfunc = minJS(func.toString());\n\t\t\n\t\treturn \"javascript:(\" + str + '(this,' + func +'));';\n\t}",
"function execWith(principal,f) {\n if(f==undefined) return;\n shadowStack.push(principal); \n //ensure to call original apply function\n f.apply = builtins.Function.apply;\n try{\n var r = f.apply(this,$Array.prototype.slice.call(arguments,2));\n }catch(e){}\n shadowStack.pop();\n flush_write(principal);\n if (typeof r !== \"undefined\") return r; \n }",
"function ProgramParser() {\n \t\t\n \t\t this.parse = function(kind) {\n \t\t \tswitch (kind) { \t\n \t\t \t\tcase \"declaration\": return Declaration();\n \t\t \t\tbreak;\n\t \t\t\tdefault: return Program();\n\t \t\t}\n\t \t}\n \t\t\n \t\t// Import Methods from the expression Parser\n \t\tfunction Assignment() {return expressionParser.Assignment();}\n \t\tfunction Expr() {return expressionParser.Expr();}\n \t\tfunction IdentSequence() {return expressionParser.IdentSequence();}\n \t\tfunction Ident(forced) {return expressionParser.Ident(forced);}\t\t\n \t\tfunction EPStatement() {return expressionParser.Statement();}\n\n\n\t\tfunction whatNext() {\n \t\t\tswitch (lexer.current.content) {\n \t\t\t\tcase \"class\"\t\t: \n \t\t\t\tcase \"function\"\t \t: \n \t\t\t\tcase \"structure\"\t:\n \t\t\t\tcase \"constant\" \t:\n \t\t\t\tcase \"variable\" \t:\n \t\t\t\tcase \"array\"\t\t: \treturn lexer.current.content;\t\n \t\t\t\tbreak;\n \t\t\t\t\t\n \t\t\t\tdefault\t\t\t\t:\treturn lexer.lookAhead().content;\n \t\t\t}\n\t\t}\n\n// \t\tDeclaration\t:= {Class | Function | VarDecl | Statement} \n\t\tfunction Declaration() {\n\t\t\tswitch (whatNext()) {\n \t\t\t\t\t\n \t\t\t\t\tcase \"class\"\t: return Class();\n \t\t\t\t\tbreak;\n \t\t\t\t\t\n \t\t\t\t\tcase \"function\" : return Function();\n \t\t\t\t\tbreak;\n \t\t\t\t\n \t\t\t\t\tcase \"structure\" : return StructDecl();\n \t\t\t\t\tbreak;\n \t\t\t\t\t\n \t\t\t\t\tcase \"array\"\t: return ArrayDecl();\n \t\t\t\t\tbreak;\n \t\t\t\t\n \t\t\t\t\tcase \"constant\" :\n \t\t\t\t\tcase \"variable\" : return VarDecl();\n \t\t\t\t\tbreak;\n \t\t\t\t\tdefault\t\t\t: return false;\n \t\t\t }\n\t\t}\n\n// \t\tProgram\t:= {Class | Function | VarDecl | Structure | Array | Statement} \n//\t\tAST: \"program\": l: {\"function\" | \"variable\" ... | Statement} indexed from 0...x\n\t\tthis.Program=function() {return Program()};\n \t\tfunction Program() {\n \t\t\tdebugMsg(\"ProgramParser : Program\");\n \t\t\tvar current;\n \t\t\tvar ast=new ASTListNode(\"program\");\n \t\t\t\n \t\t\tfor (;!eof();) {\n \t\t\t\t\n \t\t\t\tif (!(current=Declaration())) current=Statement();\n \t\t\t\t\n \t\t\t\tif (!current) break;\n \t\t\t\t\n \t\t\t\tast.add(current);\t\n \t\t\t} \t\t\t\n \t\t\treturn ast;\n \t\t}\n \t\t\n //\t\tClass:= \"class\" Ident [\"extends\" Ident] \"{\" [\"constructor\" \"(\" Ident Ident \")\"] CodeBlock {VarDecl | Function}\"}\"\n//\t\tAST: \"class\" : l: name:Identifier,extends: ( undefined | Identifier),fields:VarDecl[0..i], methods:Function[0...i]\n\t\tfunction Class() {\n\t\t\tdebugMsg(\"ProgramParser : Class\");\n\t\t\tlexer.next();\n\n\t\t\tvar name=Ident(true);\t\t\t\n\t\t\t\n\t\t\tvar extend={\"content\":undefined};\n\t\t\tif(test(\"extends\")) {\n\t\t\t\tlexer.next();\n\t\t\t\textend=Ident(true);\n\t\t\t}\n\t\t\t\n\t\t\tcheck (\"{\");\n\t\t\tvar scope=symbolTable.openScope();\n\t\t\t\n\t\t\tvar methods=[];\n\t\t\tvar fields=[];\n\t\t\t\n\t\t\tif (test(\"constructor\")) {\n\t\t\t\tlexer.next();\n\t\t \t\t//var retType={\"type\":\"ident\",\"content\":\"_$any\",\"line\":lexer.current.line,\"column\":lexer.current.column};\n\t\t\t\tvar constructName={\"type\":\"ident\",\"content\":\"construct\",\"line\":lexer.current.line,\"column\":lexer.current.column};\n\t\t\t\tmethods.push(FunctionBody(name,constructName));\n\t\t\t}\n\t\t\t\n\t\t\tvar current=true;\n\t\t\twhile(!test(\"}\") && current && !eof()) {\n\t\t\t\t \t\n\t\t \tswitch (whatNext()) {\n \t\t\t\t\t\n \t\t\t\t\tcase \"function\"\t: methods.push(Function()); \n \t\t\t\t\tbreak;\n \t\t\t\t\t\n \t\t\t\t\tcase \"constant\":\n \t\t\t\t\tcase \"variable\" : fields.push(VarDecl(true));\n \t\t\t\t\tbreak;\n \t\t\t\t\tdefault\t\t\t: current=false;\n \t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tcheck(\"}\");\n\t\t\t\n\t\t\tmode.terminatorOff();\n\n\t\t\tsymbolTable.closeScope();\n\t\t\tsymbolTable.addClass(name.content,extend.content,scope);\n\t\t\t\n\t\t\treturn new ASTUnaryNode(\"class\",{\"name\":name,\"extends\":extend,\"scope\":scope,\"methods\":methods,\"fields\":fields});\n\t\t}\n\t\t\n //\t\tStructDecl := \"structure\" Ident \"{\" VarDecl {VarDecl} \"}\"\n //\t\tAST: \"structure\" : l: \"name\":Ident, \"decl\":[VarDecl], \"scope\":symbolTable\n \t\tfunction StructDecl() {\n \t\t\tdebugMsg(\"ProgramParser : StructDecl\");\n \t\t\t\n \t\t\tlexer.next(); \n \t\t\t\n \t\t\tvar name=Ident(true); \n \t\t\t\n \t\t\tcheck(\"{\");\n \t\t\tmode.terminatorOn();\n \t\t\t\n \t\t\tvar decl=[];\n \t\t\t\n \t\t\tvar scope=symbolTable.openScope();\t\n \t\t\tdo {\t\t\t\t\n \t\t\t\tdecl.push(VarDecl(true));\n \t\t\t} while(!test(\"}\") && !eof());\n \t\t\t\n \t\t\tmode.terminatorOff();\n \t\t\tcheck (\"}\");\n \t\t\t\n \t\t\tsymbolTable.closeScope();\n \t\t\tsymbolTable.addStruct(name.content,scope);\n \t\t\t\n \t\t\treturn new ASTUnaryNode(\"structure\",{\"name\":name,\"decl\":decl,\"scope\":scope});\n \t\t} \n \t\t\n //\tarrayDecl := \"array\" Ident \"[\"Ident\"]\" \"contains\" Ident\n //\t\tAST: \"array\" : l: \"name\":Ident, \"elemType\":Ident, \"indexTypes\":[Ident]\n \t\tfunction ArrayDecl() {\n \t\t\tdebugMsg(\"ProgramParser : ArrayDecl\");\n \t\t\t\n \t\t\tlexer.next(); \n \t\t\t\n \t\t\tvar name=Ident(true);\n \t\t\t\n \t\t\tcheck(\"[\");\n \t\t\t\t\n \t\t\tvar ident=Ident(!mode.any);\n \t\t\tif (!ident) ident=lexer.anyLiteral();\n \t\t\t\t\n \t\t\tvar indexType=ident;\n \t\t\t\t\n \t\t\tvar bound=ident.content;\n \t\t\t\t\n \t\t\tcheck(\"]\");\n \t\t\t\t\n \t\t\tvar elemType; \t\n \t\t\tif (mode.any) {\n \t\t\t\tif (test(\"contains\")) {\n \t\t\t\t\tlexer.next();\n \t\t\t\t\telemType=Ident(true);\n \t\t\t\t}\n \t\t\t\telse elemType=lexer.anyLiteral();\n \t\t\t} else {\n \t\t\t\tcheck(\"contains\");\n \t\t\t\telemType=Ident(true);\n \t\t\t}\n \t\t\t\n \t\t\tcheck (\";\");\n \t\t\tsymbolTable.addArray(name.content,elemType.content,bound);\n \t\t\t\n \t\t\treturn new ASTUnaryNode(\"array\",{\"name\":name,\"elemType\":elemType,\"indexType\":indexType});\n \t\t} \n \t\t\n//\t\tFunction := Ident \"function\" Ident \"(\" [Ident Ident {\"[\"\"]\"} {\",\" Ident Ident {\"[\"\"]\"}) } \")\" CodeBlock\n//\t\tAST: \"function\":\tl: returnType: (Ident | \"_$\"), name:name, scope:SymbolTable, param:{name:Ident,type:Ident}0..x, code:CodeBlock \n\t\tthis.Function=function() {return Function();}\n \t\tfunction Function() {\n \t\t\tdebugMsg(\"ProgramParser : Function\");\n \t\t\n \t\t\tvar retType;\n \t\t\tif (mode.decl) retType=Ident(!(mode.any));\n \t\t\tif (!retType) retType=lexer.anyLiteral();\n \t\t\t\n \t\t\tcheck(\"function\");\n \t\t\t\n \t\t\tvar name=Ident(true);\n \t\t\t\n \t\t\treturn FunctionBody(retType,name);\n \t\t}\n \t\t\n \n \t\t// The Body of a function, so it is consistent with constructor\n \t\tfunction FunctionBody(retType,name)\t{\n \t\t\tvar scope=symbolTable.openScope();\n \t\t\t\n \t\t\tif (!test(\"(\")) error.expected(\"(\");\n \t\t\n var paramList=[];\n var paramType=[];\n var paramExpected=false; //Indicates wether a parameter is expected (false in the first loop, then true)\n do {\n \t\t\tlexer.next();\n \t\t\t\n \t\t\t/* Parameter */\n \t\t\tvar pName,type;\n \t\t\tvar ident=Ident(paramExpected);\t// Get an Identifier\n \t\t\tparamExpected= true;\n \t\t\t\n \t\t\t// An Identifier is found\n \t\t\tif (ident) {\n \t\t\t\t\n \t\t\t\t// When declaration is possible\n \t\t\t\tif (mode.decl) {\n \t\t\t\t\t\n \t\t\t\t\t// One Identifier found ==> No Type specified ==> indent specifies Param Name\n \t\t\t\t\tif (!(pName=Ident(!(mode.any)))) {\n \t\t\t\t\t\ttype=lexer.anyLiteral();\n \t\t\t\t\t\tpName=ident;\n \t\t\t\t\t} else type=ident; // 2 Identifier found\n \t\t\t\t} else {\t// Declaration not possible\n \t\t\t\t\ttype=lexer.anyLiteral();\n \t\t\t\t\tpName=ident;\n \t\t\t\t}\t\n\n\t\t\t\t\t// Store Parameter\n\t\t\t\t\tparamType.push(type); \n \t\tparamList.push({\"name\":pName,\"type\":type});\n \t\t \n \t\t \tsymbolTable.addVar(pName.content,type.content);\n \t\t} \n \t\t} while (test(\",\") && !eof());\n\n \tcheck(\")\");\n \t\t\t \t\t\t\n \t\t\tvar code=CodeBlock();\n \t\t\t\n \t\t\tsymbolTable.closeScope();\n \t\t\t\n \t\t\tsymbolTable.addFunction(name.content,retType.content,paramType);\n \t\t\treturn new ASTUnaryNode(\"function\",{\"name\":name,\"scope\":scope,\"param\":paramList,\"returnType\":retType,\"code\":code});\n \t\t}\n \t\t\t\n\t\t\n //\t\tVarDecl := Ident (\"variable\" | \"constant\") Ident [\"=\" Expr] \";\" \n //\t\tAST: \"variable\"|\"constant\": l : type:type, name:name, expr:[expr]\n \t\tthis.VarDecl = function() {return VarDecl();}\n \t\tfunction VarDecl(noInit) {\n \t\t\tdebugMsg(\"ProgramParser : VariableDeclaration\");\n \t\t\tvar line=lexer.current.line;\n \t\t\tvar type=Ident(!mode.any);\n \t\t\tif (!type) type=lexer.anyLiteral();\n \t\t\t\n \t\t\tvar constant=false;\n \t\t\tvar nodeName=\"variable\";\n \t\t\tif (test(\"constant\")) {\n \t\t\t\tconstant=true; \n \t\t\t\tnodeName=\"constant\";\n \t\t\t\tlexer.next();\n \t\t\t}\n \t\t\telse check(\"variable\"); \n \t\t\t \t\t\t\n \t\t\tvar name=Ident(true);\n \t\t\tsymbolTable.addVar(name.content,type.content,constant);\n\n\t\t\tvar expr=null;\n\t\t\tif(noInit==undefined){\n\t\t\t\tif (test(\"=\")) {\n\t\t\t\t\tlexer.next();\n\t\t\t\t\texpr=Expr();\n\t\t\t\t\tif (!expr) expr=null;\n\t\t\t\t}\n\t\t\t} \n\t\n\t\t\tcheck(\";\");\n\t\t\tvar ast=new ASTUnaryNode(nodeName,{\"type\":type,\"name\":name,\"expr\":expr});\n\t\t\tast.line=line;\n\t\t\treturn ast;\n \t\t}\n \t\t\t\t\n//\t\tCodeBlock := \"{\" {VarDecl | Statement} \"}\" \n//\t\tCodeblock can take a newSymbolTable as argument, this is needed for functions that they can create an scope\n//\t\tcontaining the parameters.\n//\t\tIf newSymbolTable is not specified it will be generated automatical\n// At the End of Codeblock the scope newSymbolTable will be closed again\t\t\n//\t\tAST: \"codeBlock\" : l: \"scope\":symbolTable,\"code\": code:[0..x] {code}\n \t\tfunction CodeBlock() {\n \t\t\tdebugMsg(\"ProgramParser : CodeBlock\");\n\t\t\t\n\t\t\tvar scope=symbolTable.openScope();\n\t\t\tvar begin=lexer.current.line;\n\t\t\tcheck(\"{\");\n \t\t\t\n \t\t\tvar code=[];\n \t\t\tvar current;\n\n \t\t\twhile(!test(\"}\") && !eof()) {\n \t\t\t\tswitch (whatNext()) {\n \t\t\t\t\tcase \"constant\":\n \t\t\t\t\tcase \"variable\": current=VarDecl();\n \t\t\t\t\tbreak;\n \t\t\t\t\tdefault: current=Statement();\t\t\t\t\t\n \t\t\t\t}\n\n \t\t\t\tif(current) {\n \t\t\t\t\tcode.push(current);\n \t\t\t\t} else {\n \t\t\t\t\terror.expected(\"VarDecl or Statement\"); break;\n \t\t\t\t}\n \t\t\t}\t\n \t\t\t\n \t\t\tvar end=lexer.current.line;\n \t\t\tcheck(\"}\");\n \t\t\tsymbolTable.closeScope();\n \t\t\treturn new ASTUnaryNode(\"codeBlock\",{\"scope\":scope,\"code\":code,\"begin\":begin,\"end\":end});\n \t\t}\n \t\t\n//\t\tStatement\t:= If | For | Do | While | Switch | JavaScript | (Return | Expr | Assignment) \";\"\n \t\tfunction Statement() {\n \t\t\tdebugMsg(\"ProgramParser : Statement\");\n \t\t\tvar ast;\n \t\t\tvar line=lexer.current.line;\n \t\t\t\n \t\t\tswitch (lexer.current.content) {\n \t\t\t\tcase \"if\"\t \t\t: ast=If(); \n\t \t\t\tbreak;\n \t\t\t\tcase \"do\"\t \t\t: ast=Do(); \n \t\t\t\tbreak;\n \t\t\t\tcase \"while\" \t\t: ast=While(); \t\t\n \t\t\t\tbreak;\n \t\t\t\tcase \"for\"\t\t\t: ast=For();\n \t\t\t\tbreak;\n \t\t\t\tcase \"switch\"\t\t: ast=Switch(); \t\n \t\t\t\tbreak;\n \t\t\t\tcase \"javascript\"\t: ast=JavaScript(); \n \t\t\t\tbreak;\n \t\t\t\tcase \"return\"\t\t: ast=Return(); \n \t\t\t\t\t\t\t\t\t\t check(\";\");\n \t\t\t\tbreak;\n \t\t\t\tdefault\t\t\t\t: ast=EPStatement(); \n \t\t\t\t\t check(\";\");\n \t\t\t}\n \t\t\tast.line=line;\n \t\t\tast.comment=lexer.getComment();\n \t\t\tlexer.clearComment(); \t\t\t\n \t\t\treturn ast;\t\n \t\t}\n \t\t\n//\t\tIf := \"if\" \"(\" Expr \")\" CodeBlock [\"else\" CodeBlock]\n//\t\tAST : \"if\": l: cond:Expr, code:codeBlock, elseBlock:(null | codeBlock)\n \t\tfunction If() {\n \t\t\tdebugMsg(\"ProgramParser : If\");\n \t\t\t\n \t\t\tlexer.next();\n \t\t\tcheck(\"(\");\n \t\t\t\n \t\t\tvar expr=Expr();\n \t\t\n \t\t\tcheck(\")\");\n \t\t\t\n \t\t\tvar code=CodeBlock();\n \t\t\t\n \t\t\tvar elseCode;\n \t\t\tif (test(\"else\")) {\n \t\t\t\tlexer.next();\n \t\t\t\telseCode=CodeBlock();\n \t\t\t}\n \t\t\treturn new ASTUnaryNode(\"if\",{\"cond\":expr,\"code\":code,\"elseBlock\":elseCode});\n \t\t}\n \t\t\n// \t\tDo := \"do\" CodeBlock \"while\" \"(\" Expr \")\" \n//\t\tAST: \"do\": l:Expr, r:CodeBlock \n \t\tfunction Do() {\t\n \t\t\tdebugMsg(\"ProgramParser : Do\");\n \t\t\t\n \t\t\tlexer.next();\n \t\t\tvar code=CodeBlock();\n \t\t\t\n \t\t\tcheck(\"while\");\n \t\t\t\n \t\t\tcheck(\"(\");\n \t\t\t\n \t\t\tvar expr=Expr();\n \t\t\tcheck(\")\");\n \t\t\t\n \t\t\t\n \t\t\tcheck(\";\");\n\n \t\t\treturn new ASTBinaryNode(\"do\",expr,code);\n \t\t}\n \t\t\n// \t\tWhile := \"while\" \"(\" Expr \")\" \"{\" {Statement} \"}\" \n//\t\tAST: \"while\": l:Expr, r:codeBlock\n \t\tfunction While(){ \t\t\t\n \t\t\tdebugMsg(\"ProgramParser : While\");\n \t\t\t\n \t\t\t//if do is allowed, but while isn't allowed gotta check keyword in parser\n \t\t\tif (preventWhile) error.reservedWord(\"while\",lexer.current.line);\n \t\t\t\n \t\t\tlexer.next();\n \t\t\tcheck(\"(\");\n \t\t\t\n \t\t\tvar expr=Expr();\n \t\n \t\t\tcheck(\")\");\n \t\t\t\n \t\t\tvar code = CodeBlock();\n \t\t\t\t \t\t\t\n \t\t\treturn new ASTBinaryNode(\"while\",expr,code);\n \t\t}\n \t\t\n//\t\tFor := \"for\" \"(\"(\"each\" Ident \"in\" Ident | Ident Assignment \";\" Expr \";\" Assignment )\")\"CodeBlock\n//\t\tAST: \"foreach\": l: elem:Ident, array:Ident, code:CodeBlock \n//\t\tAST: \"for\": l: init:Assignment, cond:Expr,inc:Assignment, code:CodeBlock\n \t\tfunction For() { \t\t\t\n \t\t\tdebugMsg(\"ProgramParser : For\");\n \t\t\t\n \t\t\tlexer.next();\n \t\t\t\n \t\t\tcheck(\"(\");\n \t\t\t\n \t\t\tif (test(\"each\")) {\n \t\t\t\tlexer.next();\n \t\t\t\tvar elem=IdentSequence();\n \t\t\t\tcheck(\"in\");\n \t\t\t\tvar arr=IdentSequence();\n \t\t\t\t\n \t\t\t\tcheck(\")\");\n \t\t\t\t\n \t\t\t\tvar code=CodeBlock();\n \t\t\t\t\n \t\t\t\treturn new ASTUnaryNode(\"foreach\",{\"elem\":elem,\"array\":arr,\"code\":code});\n \t\t\t\t\n \t\t\t} else {\n \t\t\t\tvar init=Assignment();\n \t\t\t\tif (!init) error.assignmentExpected();\n \t\t\t\t\n \t\t\t\tcheck(\";\");\n \t\t\t\t\n \t\t\t\tvar cond=Expr();\n \t\t\t\n \t\t\t\n \t\t\t\tcheck(\";\");\n \t\t\t\n \t\t\t\tvar increment=Assignment();\n \t\t\t\tif (!increment) error.assignmentExpected();\n \t\t\t \n \t\t\t\tcheck(\")\");\n \t\t\t\tvar code=CodeBlock();\t\n \t\t\t\n \t\t\t\treturn new ASTUnaryNode(\"for\",{\"init\":init,\"cond\":cond,\"inc\":increment,\"code\":code});\n \t\t\t}\t\n \t\t}\n \t\t\n//\t\tSwitch := \"switch\" \"(\" Ident \")\" \"{\" {Option} [\"default\" \":\" CodeBlock] \"}\"\t\n// AST: \"switch\" : l \"ident\":IdentSequence,option:[0..x]{Option}, default:CodeBlock\n \t\tfunction Switch() {\t\t\t\n \t\t\tdebugMsg(\"ProgramParser : Switch\");\n \t\t\t\n \t\t\tlexer.next();\n \t\t\t\n \t\t\tcheck(\"(\");\n\n \t\t\tvar ident=IdentSequence();\n \t\t\tif (!ident) error.identifierExpected();\n \t\t\t\n \t\t\tcheck(\")\");\n \t\t\t\n \t\t\tcheck(\"{\");\n \t\t\t\n \t\t\tvar option=[];\n \t\t\tvar current=true;\n \t\t\tfor (var i=0;current && !eof();i++) {\n \t\t\t\tcurrent=Option();\n \t\t\t\tif (current) {\n \t\t\t\t\toption[i]=current;\n \t\t\t\t}\n \t\t\t}\n \t\t\tcheck(\"default\");\n \t\t\t\n \t\t\tcheck(\":\");\n \t\t\t\n \t\t\tvar defBlock=CodeBlock();\n \t\t \t\t\t\n \t\t\tcheck(\"}\");\n \t\t\t\n \t\t\treturn new ASTUnaryNode(\"switch\", {\"ident\":ident,\"option\":option,\"defBlock\":defBlock});\n \t\t}\n \t\t\n//\t\tOption := \"case\" Expr {\",\" Expr} \":\" CodeBlock\n// AST: \"case\" : l: [0..x]{Expr}, r:CodeBlock\n \t\tfunction Option() {\n \t\t\tif (!test(\"case\")) return false;\n \t\t\t\n \t\t\tdebugMsg(\"ProgramParser : Option\");\n \t\t\t\n \t\t\tvar exprList=[];\n \t\t\tvar i=0;\n \t\t\tdo {\n \t\t\t\tlexer.next();\n \t\t\t\t\n \t\t\t\texprList[i]=Expr();\n \t\t\t\ti++; \n \t\t\t\t\n \t\t\t} while (test(\",\") && !eof());\n \t\t\t\n \t\t\tcheck(\":\");\n \t\t\t\n \t\t\tvar code=CodeBlock();\n \t\t\t\n \t\t\treturn new ASTBinaryNode(\"case\",exprList,code);\n \t\t}\n \t\t\n// JavaScript := \"javascript\" {Letter | Digit | Symbol} \"javascript\"\n//\t\tAST: \"javascript\": l: String(JavascriptCode)\n \t\tfunction JavaScript() {\n \t\t\tdebugMsg(\"ProgramParser : JavaScript\");\n\t\t\tcheck(\"javascript\");\n\t\t\tcheck(\"(\")\n\t\t\tvar param=[];\n\t\t\tvar p=Ident(false);\n\t\t\tif (p) {\n\t\t\t\tparam.push(p)\n\t\t\t\twhile (test(\",\") && !eof()) {\n\t\t\t\t\tlexer.next();\n\t\t\t\t\tparam.push(Ident(true));\n\t\t\t\t}\t\n\t\t\t}\n \t\t\tcheck(\")\");\n \t\t\t\t\t\n \t\t\tvar js=lexer.current.content;\n \t\t\tcheckType(\"javascript\");\n \t\t\t\t\t\t\n \t\t\treturn new ASTUnaryNode(\"javascript\",{\"param\":param,\"js\":js});\n \t\t}\n \t\t\n// \t\tReturn := \"return\" [Expr] \n//\t\tAST: \"return\" : [\"expr\": Expr] \n \t\tfunction Return() {\n \t\t\tdebugMsg(\"ProgramParser : Return\");\n \t\t\tvar line=lexer.current.line;\n \t\t\t\n \t\t\tlexer.next();\n \t\t\t\n \t\t\tvar expr=Expr();\n \t\t\tvar ast=new ASTUnaryNode(\"return\",expr);\n \t\t\tast.line=line;\n \t\t\treturn ast;\n \t\t}\n\t}",
"function insertLibFunc() {\r\n\r\n var pO = CurProgObj;\r\n\r\n var sel1 = document.getElementById('selWin');\r\n var libind = sel1.selectedIndex;\r\n\r\n var sel2 = document.getElementById('selWin2');\r\n var funcind = sel2.selectedIndex;\r\n\r\n // alert(\"TODO: Lib ind:\" + libind + \" funcind:\" + funcind);\r\n\r\n displayAtLastGrid(\"\");\r\n\r\n // Create a function call expression and insert it\r\n //\r\n removeGridHighlight();\r\n\r\n\r\n\r\n // main root expression for the function\r\n //\r\n var libM = pO.libModules[libind];\r\n var libF = libM.allFuncs[funcind];\r\n var libFexpr = libF.funcCallExpr;\r\n var fname = libM.name + \".\" + libFexpr.str;\r\n var funcExpr = new ExprObj(false, ExprType.LibFuncCall, fname);\r\n\r\n // Insert the dummy args so that user knows the number/type of args\r\n // required\r\n //\r\n for (var i = 0; i < libFexpr.exprArr.length; i++) {\r\n\r\n var argE = new ExprObj(true,\r\n libFexpr.exprArr[i].type,\r\n libFexpr.exprArr[i].str);\r\n funcExpr.addSubExpr(argE);\r\n }\r\n\r\n replaceOrAppendExpr(funcExpr);\r\n drawCodeWindow(CurStepObj); // redraw code window\r\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initialize a new minimal genome for the simulation. | createMinimalGenome() {
return new Genome(this.genGenomeId(), this, []);
} | [
"function createInitialPopulation() {\n //inits the array\n genomes = [];\n //for a given population size\n for (var i = 0; i < populationSize; i++) {\n //randomly initialize the 7 values that make up a genome\n //these are all weight values that are updated through evolution\n var genome = {\n //unique identifier for a genome\n id: Math.random(),\n //The weight of each row cleared by the given move. the more rows that are cleared, the more this weight increases\n rowsCleared: Math.random() - 0.5,\n //the absolute height of the highest column to the power of 1.5\n //added so that the algorithm can be able to detect if the blocks are stacking too high\n weightedHeight: Math.random() - 0.5,\n //The sum of all the columnโs heights\n cumulativeHeight: Math.random() - 0.5,\n //the highest column minus the lowest column\n relativeHeight: Math.random() - 0.5,\n //the sum of all the empty cells that have a block above them (basically, cells that are unable to be filled)\n holes: Math.random() * 0.5,\n // the sum of absolute differences between the height of each column \n //(for example, if all the shapes on the grid lie completely flat, then the roughness would equal 0).\n roughness: Math.random() - 0.5,\n };\n //add them to the array\n genomes.push(genome);\n }\n evaluateNextGenome();\n }",
"initializePopulation() {\n for (let i = 0; i < this.solutionsCount; i++) {\n // solution\n this.population.push(this.getRandomSolution())\n\n // fitness value\n this.fitness_values.push(NaN);\n }\n }",
"load(genome) {\n this.genes = [];\n this.mutationRates = genome.getMutationRates()\n\n genome.genes.forEach((gene) => {\n this.genes.push(gene.clone());\n });\n this.initializeNeurons();\n this.maxNeuron = genome.maxNeuron;\n }",
"initialize() {\n this.chain.push(new Block(0, {Name: \"Genesis !\"}, 0));\n }",
"clone() {\n const clonedGenome = new Genome();\n this.genes.forEach(function (gene) {\n clonedGenome.genes.push(gene.clone());\n });\n\n clonedGenome.mutationRates = this.getMutationRates();\n\n return clonedGenome;\n }",
"function initCannon(){\n\tworld = new CANNON.World;\n\tworld.gravity.set(0,-9.81, 0);\n\tworld.solver.iterations = 3;\n}",
"function initialize(){\n seconds = 0;\n INITIALIZING = true;\n SAVE_DATA = false;\n GEN_PASSENGERS = false; //If true, we are waiting for Python to return from Generating Passengers\n READY_TO_INS_TRIPS = false; //If true, we have finished generating passengers and are ready to insert trips into the system\n INS_TRIPS = false; //If true, we are waiting for Python to return from inserting trips into the system\n \n initialize_simulation_data();\n if(master_interval == false){\n\tmaster_interval = setInterval(function(){master()},1000);}\n}",
"constructor(size) {\r\n this.birds = [];\r\n this.size = size;\r\n this.actualBird = 0; //kind of an index for the population\r\n for (let i = 0; i < size; i++) {\r\n this.birds.push(new bird());\r\n }\r\n this.generation = 0;\r\n this.melhor = this.birds[0];\r\n this.lastmelhor = 0;\r\n }",
"function makeNewGrid(){\r\n var chromosome = [5];\r\n chromosome[0] = Math.floor(Math.random()*25);//how much each cell can deviate\r\n chromosome[1] = Math.floor(Math.random()*100);//how saturated the blocks are\r\n chromosome[2] = Math.floor(Math.random()*360);//max saturation value \r\n chromosome[3] = Math.floor(Math.random()*2);//cirlce or square\r\n chromosome[4] = Math.floor(Math.random()*4);//what kind of art style\r\n \r\n return chromosome;\r\n}",
"plantSeed() {\n\t\tthis.stop();\n\t\tthis.loops = 0;\n\t\tthis.myTree = new FractalTree({x: ground.width/2-100, y: ground.height-20}, this.myDNA);\n\t\tthis.settingsClose();\n\t\tthis.play();\n\t}",
"function populateMountains() {\n\tmountains = [];\n\tfor (i = 0; i < 3; i++) {\n\t\tmountains[i] = {\n\t\t\tx: random(32),\n\t\t\ty: random(16),\n\t\t\theight: max(random(10), random(10))\n\t\t};\n\t}\n}",
"spawnNew() {\r\n\t\tif (this.isFull()) return;\r\n\t\t// gets random empty cell and spawns there a tile\r\n\t\tlet k = Math.floor(Math.random() * this.emptyCells.size());\r\n\t\tlet i = this.emptyCells.getK(k).i;\r\n\t\tlet j = this.emptyCells.getK(k).j;\r\n\t\tif (Math.random() < 0.1) {\r\n\t\t\tthis.map[i][j] = 4;\r\n\t\t}\r\n\t\telse {\t\r\n\t\t\tthis.map[i][j] = 2;\r\n\t\t}\r\n\t\tthis.emptyCells.delete(i, j);\r\n\t}",
"function initialiseMgraphics() {\n mgraphics.init();\n mgraphics.relative_coords = 0;\n mgraphics.autofill = 0;\n}",
"init() {\n let default_input = new Array(8);\n default_input.fill(0);\n\n // Map data to all slave devices using the specific address\n for (var device_name in this.devices) {\n\n // Get the device\n var device = this.devices[device_name];\n\n this.updateDevice(device, default_input);\n\n }\n\n }",
"_InitBiomes(params) {\n params.guiParams.biomes = {\n octaves: 2,\n persistence: 0.5,\n lacunarity: 2.0,\n exponentiation: 3.9,\n scale: 2048.0,\n noiseType: 'perlin',\n seed: 2,\n exponentiation: 1,\n height: 1\n };\n\n const onNoiseChanged = () => {\n for (let k in this._chunks) {\n this._chunks[k].chunk.Rebuild();\n }\n };\n\n this._biomes = new noise.Noise(params.guiParams.biomes);\n }",
"generateGenesisBlock() {\n const index = 0;\n const previousHash = -1;\n const data = {\n message: 'This is a Genesis Block of Chain!'\n };\n const timestamp = new Date('2018/01/01').getTime();\n\n const block = new Block(index, previousHash, data, timestamp);\n this.chain.push(block);\n }",
"inicializa(){\n globais.flappyBird = criarFlappyBird();\n globais.canos = criarCanos();\n globais.chao = criarChao();\n }",
"static init()\n {\n let aeROM = Component.getElementsByClass(document, PCx86.APPCLASS, \"rom\");\n for (let iROM = 0; iROM < aeROM.length; iROM++) {\n let eROM = aeROM[iROM];\n let parmsROM = Component.getComponentParms(eROM);\n let rom = new ROMx86(parmsROM);\n Component.bindComponentControls(rom, eROM, PCx86.APPCLASS);\n }\n }",
"function initialize() {\n\tpru.loadDatafile(1, 'pwm_data.bin');\n\tpru.execute(1, 'pwm_text.bin', 408);\n\tzeroMotors();\n}",
"function setupMines(map){\n \n // Amount of mines required\n var mines = map.mines;\n \n // Array of fields to add mines to\n var fields = map.fields;\n \n for (var n = 0; n < mines; n++ ) {\n \n // Generate a random number to turn into a mine\n var random = Math.floor(Math.random() * (map.size )) + 0;\n\n // If can't be marked as a mine find another random number\n if(!markAsMine(map, random)){\n n--;\n }\n }\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Utility functions and variables: Indent a (multiline) string with `JSON_INDENT` given number of times. indentFirst controls whether the first line is indented as well. | function _indent(str, levels, indentFirst) {
indentFirst = indentFirst !== false;
let lines = str.split('\n');
let ret = new Array(lines.length);
if (!indentFirst) {
ret[0] = lines[0];
}
for (let i = indentFirst ? 0 : 1; i < lines.length; i++) {
ret[i] = util_1.repeatString(util_2.JSON_INDENT, levels) + lines[i];
}
return ret.join('\n');
} | [
"function prettify(json, spacing, colors) {\n if (!spacing) {\n spacing = 2;\n };\n colorize(colors);\n\n if (typeof json != 'string') {\n json = JSON.stringify(json);\n }\n //Sanitize HTML special characters.\n json = json.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');\n json = JSON.parse(json);\n\n return format(json, spacing);\n\n\n function format(json, spacing) {\n return '{\\n'+iterate(json, spacing, spacing)+'}';\n }\n\n function iterate(obj, spacing, startingIndentation) {\n var cls,\n string = '';\n for (var property in obj) {\n cls = typeof obj[property];\n if (obj[property] === null) {\n //NULL has its own logic here because `typeof null` returns \"object\".\n string += spaces(startingIndentation)+'<span class=\"pretty-json-key\">'+property+'</span>'+': <span class=\"pretty-json-null\">NULL</span>\\n';\n }\n else if (cls == 'object') {\n string += spaces(startingIndentation)+'<span class=\"pretty-json-key\">'+property+'</span>'+': {\\n';\n nestedIndentation = startingIndentation + spacing;\n string += iterate(obj[property], spacing, nestedIndentation);\n string += spaces(startingIndentation)+'}\\n';\n }\n else if (cls == 'string') {\n //Add in quotes around the span to make it more obvious that the span contains a string.\n string += spaces(startingIndentation)+'<span class=\"pretty-json-key\">'+property+'</span>'+': \"<span class=\"pretty-json-'+cls+'\">'+obj[property]+'</span>\"\\n';\n }\n else {\n string += spaces(startingIndentation)+'<span class=\"pretty-json-key\">'+property+'</span>'+': <span class=\"pretty-json-'+cls+'\">'+obj[property]+'</span>\\n';\n }\n }\n return string;\n }\n\n /**\n * Returns an n-length string of non-breaking spaces.\n */\n function spaces(n) {\n var string= '';\n for (var i = 0; i < n; i++) {\n string += ' ';\n };\n return string;\n }\n\n /**\n * Writes stylesheet to the page.\n * Takes the `colors` object passed as an argument into prettify() (if any), and overwrites\n * the defaults with them.\n */\n function colorize(customColors) {\n var colors = {\n 'string': 'green',\n 'number': 'darkorange',\n 'boolean': 'blue',\n 'null': 'magenta',\n 'key': 'red'\n };\n\n if (customColors) {\n for (var dataType in customColors) {\n colors[dataType] = customColors[dataType];\n };\n };\n\n var style = '<style>';\n for (var dataType in colors) {\n style += '.pretty-json-'+dataType+' {color: '+colors[dataType]+';}';\n };\n style += '</style>';\n document.write(style);\n }\n}",
"injectNewlines(jsonString) {\n let multiline = jsonString.replace('\\\\n', '\\r\\n')\n return multiline;\n }",
"indentation() {\n var _a\n return (_a = this.overrideIndent) !== null && _a !== void 0\n ? _a\n : countCol(this.string, null, this.tabSize)\n }",
"function formatListItem(listItem) {\n var nestingLevel = listItem.getNestingLevel() + 1;\n var point = parseFloat(PropertiesService.getUserProperties().getProperty('listIndentation'));\n Logger.log(listItem.getIndentFirstLine());\n Logger.log(listItem.getIndentStart());\n listItem.setIndentFirstLine(nestingLevel * point);\n listItem.setIndentStart(nestingLevel * point + 18);\n}",
"indentString(cols) {\n let result = \"\";\n if (this.facet(EditorState.indentUnit).charCodeAt(0) == 9)\n while (cols >= this.tabSize) {\n result += \"\\t\";\n cols -= this.tabSize;\n }\n for (let i = 0; i < cols; i++)\n result += \" \";\n return result;\n }",
"function syntaxIndentation(cx, ast, pos) {\n return indentFrom(\n ast.resolveInner(pos).enterUnfinishedNodesBefore(pos),\n pos,\n cx\n )\n }",
"lineIndent(line) {\n var _a;\n let override = (_a = this.options) === null || _a === void 0 ? void 0 : _a.overrideIndentation;\n if (override) {\n let overriden = override(line.from);\n if (overriden > -1)\n return overriden;\n }\n let text = line.slice(0, Math.min(100, line.length));\n return this.countColumn(text, text.search(/\\S/));\n }",
"indentString(cols) {\n let result = \"\";\n if (this.facet(dist_EditorState.indentUnit).charCodeAt(0) == 9)\n while (cols >= this.tabSize) {\n result += \"\\t\";\n cols -= this.tabSize;\n }\n for (let i = 0; i < cols; i++)\n result += \" \";\n return result;\n }",
"function indentation(value, maximum) {\n var values = value.split(lineFeed);\n var position = values.length + 1;\n var minIndent = Infinity;\n var matrix = [];\n var index;\n var indentation;\n var stops;\n\n values.unshift(repeat(space, maximum) + exclamationMark);\n\n while (position--) {\n indentation = getIndent(values[position]);\n\n matrix[position] = indentation.stops;\n\n if (trim(values[position]).length === 0) {\n continue;\n }\n\n if (indentation.indent) {\n if (indentation.indent > 0 && indentation.indent < minIndent) {\n minIndent = indentation.indent;\n }\n } else {\n minIndent = Infinity;\n\n break;\n }\n }\n\n if (minIndent !== Infinity) {\n position = values.length;\n\n while (position--) {\n stops = matrix[position];\n index = minIndent;\n\n while (index && !(index in stops)) {\n index--;\n }\n\n values[position] = values[position].slice(stops[index] + 1);\n }\n }\n\n values.shift();\n\n return values.join(lineFeed);\n}",
"function formattingLineChart(json) {\n\t\n\tvar formattedJSON = \"{\";\n\tvar firstElem = json[0];\n\tvar keys = Object.keys(firstElem);\n\tvar cols = \"\\\"cols\\\":[\";\n\tvar type = \"\";\n\tfor (var i = 0; i < keys.length; i++) {\n\t\ttype = typeof firstElem[keys[i]];\n\t\tif (i == 0) {\n\t\t\tcols = cols + \"{\\\"label\\\": \\\"\" + keys[i] + \"\\\", \\\"type\\\": \\\"\" + type + \"\\\"\" + \"}\";\n\t\t} else {\n\t\t\tcols = cols + \"{\\\"label\\\": \\\"\" + keys[i] + \"\\\", \\\"type\\\": \\\"number\\\"\" + \"}\";\n\t\t}\n\t\tif (i < (keys.length - 1)) {\n\t\t\tcols = cols + \",\";\n\t\t}\n\t}\n\tcols = cols + \"],\";\n\tvar rows = \"\\\"rows\\\":[\";\n\tcount = 0;\n\tvar keyCount = 0;\n\tfor (var elem of json) {\n\t\trows = rows + \"{\\\"c\\\":[\";\n\t\tkeyCount = 0;\n\t\tfor (var key of keys) {\n\t\t\tif (typeof elem[key] == \"number\" || keyCount >= 1) {\n\t\t\t\tdocument.getElementById(\"KeyCheck\").innerHTML = typeof elem[key];\n\t\t\t\trows = rows + \"{\\\"v\\\":\" + elem[key] + \"}\";\n\t\t\t} else {\n\t\t\t\trows = rows + \"{\\\"v\\\":\\\"\" + elem[key] + \"\\\"}\";\n\t\t\t}\n\t\t\tif (!(keyCount >= (keys.length - 1))) {\n\t\t\t\trows = rows + \",\";\n\t\t\t}\n\t\t\tkeyCount = keyCount + 1;\n\t\t}\n\t\trows = rows + \"]}\";\n\t\tif (!(count >= (json.length - 1))) {\n\t\t\trows = rows + \",\";\n\t\t}\n\t\tcount = count + 1;\n\t\t//rows = rows + \",\";\n\t}\n\trows = rows + \"]\";\n\tformattedJSON = formattedJSON + cols + rows;\n\tformattedJSON = formattedJSON + \"}\";\n\treturn formattedJSON;\n}",
"function expectEqual_JSONFormat(a, b)\n{\n var aStr = JSON.stringify(a, null,' ')\n var bStr = JSON.stringify(b, null,' ')\n expect(aStr).toEqual(bStr);\n}",
"function continuedIndent({ except, units = 1 } = {}) {\n return (context) => {\n let matchExcept = except && except.test(context.textAfter)\n return context.baseIndent + (matchExcept ? 0 : units * context.unit)\n }\n }",
"function continuedIndent({ except, units = 1 } = {}) {\n return (context) => {\n let matchExcept = except && except.test(context.textAfter);\n return context.baseIndent + (matchExcept ? 0 : units * context.unit);\n };\n }",
"function fiveLine(s){\n //coding here...\n let a = s.trim()\n return `${a}\\n${a}${a}\\n${a}${a}${a}\\n${a}${a}${a}${a}\\n${a}${a}${a}${a}${a}`\n }",
"function allArgsBrokenOut(lastArgAddedLine) {\n return group(\n [\n \"(\",\n // [prettierx] keep break here, regardless of --space-in-parens option\n indent([line, ...printedArguments]),\n maybeTrailingComma,\n // [prettierx] keep break here, unless lastArgAddedLine is true\n lastArgAddedLine ? \"\" : line,\n \")\",\n ],\n { shouldBreak: true }\n );\n }",
"function indentOutdent(indentType) \n{ \n // Get the DOM\n var theDOM = dw.getDocumentDOM();\n \n if (theDOM == null)\n\treturn;\n\t\n if (indentType == \"indent\")\n theDOM.source.indentTextView();\n else if(indentType == \"outdent\")\n theDOM.source.outdentTextView();\n}",
"continue() {\n let parent = this.node.parent\n return parent ? indentFrom(parent, this.pos, this.base) : 0\n }",
"function expand_spaces(message)\r\n{\r\n var exclude_open = new Array(\"[code]\", \"[pre]\", \":[\", \":/\");\r\n var exclude_close = new Array(\"[/code]\", \"[/pre]\", \"]:\", \"/:\");\r\n var open, close;\r\n var colon_on = false;\r\n \r\n var level = 0;\r\n var store_unformatted = false;\r\n var store_formatted = false;\r\n var last_store = 0;\r\n \r\n var res = \"\";\r\n \r\n for (var i = 0; i < message.length; )\r\n {\r\n var initial_i = i;\r\n \r\n if (open = prefix_in(message, exclude_open, i)) // Or in pre-formatted tag\r\n {\r\n level++;\r\n i += open.length;\r\n }\r\n\r\n if (close = prefix_in(message, exclude_close, i))\r\n {\r\n level--;\r\n i += close.length;\r\n }\r\n \r\n level = Math.max(level, 0);\r\n \r\n var spaces = take_while(\" \", message, i);\r\n if (level == 0 && spaces.length >= 3)\r\n {\r\n i += spaces.length;\r\n res += message.substring(initial_i, i).replace(\" \", \" \", \"g\");\r\n }\r\n else\r\n {\r\n i++;\r\n res += message.substring(initial_i, i);\r\n }\r\n }\r\n\r\n return res;\r\n}",
"function returnWithIndent() {\r\n // Selection DOM object\r\n const dSel = ta;\r\n\r\n // How many spaces will be put before the first non-space?\r\n var space = 0;\r\n\r\n if (dSel.selectionStart || dSel.selectionStart == '0') {\r\n var startPos = dSel.selectionStart;\r\n var endPos = dSel.selectionEnd;\r\n var scrollTop = dSel.scrollTop;\r\n var before = dSel.value.substring(0, startPos);\r\n var after = dSel.value.substring(endPos,dSel.value.length);\r\n var split = before.split(\"\\n\");\r\n\r\n // What is the last line before the caret?\r\n var last = split[split.length-1];\r\n\r\n for(var i=0; i<last.length; i++) {\r\n if(last.charAt(i) != ' ') {\r\n break;\r\n }\r\n\r\n space++;\r\n }\r\n\r\n // Create the return\r\n var myValue = \"\\n\";\r\n for(i=0; i<space; i++) {\r\n myValue += ' ';\r\n }\r\n\r\n insertText(dSel, myValue);\r\n dSel.selectionStart = startPos + myValue.length;\r\n dSel.selectionEnd = startPos + myValue.length;\r\n } else {\r\n dSel.value += \"\\n\";\r\n dSel.focus();\r\n }\r\n\r\n return space > 0;\r\n }",
"function normalizeOptions(code, opts, tokens) {\n var style = \" \";\n if (code && typeof code === \"string\") {\n var indent = (0, _detectIndent2.default)(code).indent;\n if (indent && indent !== \" \") style = indent;\n }\n\n var format = {\n auxiliaryCommentBefore: opts.auxiliaryCommentBefore,\n auxiliaryCommentAfter: opts.auxiliaryCommentAfter,\n shouldPrintComment: opts.shouldPrintComment,\n retainLines: opts.retainLines,\n comments: opts.comments == null || opts.comments,\n compact: opts.compact,\n minified: opts.minified,\n concise: opts.concise,\n quotes: opts.quotes || findCommonStringDelimiter(code, tokens),\n indent: {\n adjustMultilineComment: true,\n style: style,\n base: 0\n }\n };\n\n if (format.minified) {\n format.compact = true;\n\n format.shouldPrintComment = format.shouldPrintComment || function () {\n return format.comments;\n };\n } else {\n format.shouldPrintComment = format.shouldPrintComment || function (value) {\n return format.comments || value.indexOf(\"@license\") >= 0 || value.indexOf(\"@preserve\") >= 0;\n };\n }\n\n if (format.compact === \"auto\") {\n format.compact = code.length > 100000; // 100KB\n\n if (format.compact) {\n console.error(\"[BABEL] \" + messages.get(\"codeGeneratorDeopt\", opts.filename, \"100KB\"));\n }\n }\n\n if (format.compact) {\n format.indent.adjustMultilineComment = false;\n }\n\n return format;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Logical("xor"|"and"|"or", ax, bx) About: comparison between two arrays bits are right justified (least significant bit is to the right) Special Cases: (null can be 0 or 1 and 3 = 3 just as 1 = 1 and 0 is false always) Examples: Logical("and", 1, null) = result.value = 0 Logical("xor", 1, null) = result.value = 0 (because we dont know if there was really a change or not) Logical("or", 1, null) = result.value = 1 | function Logical (type, ax, bx) {
var result = {value: null, // the result of the Logical operation
diff : 0, // number of bits that are different between ax and bx
change : 0, // estimate of the number of bits that need to be changed to get to eaither ax or bx from .value
length : null, // size in terms of the number of bits
up : 0, // number of bits rounded up
down : 0, // number of bits rounded down
type : type}; // type of operation
if(ax.length != bx.length) {
var resized = resize(ax, bx);
ax = resized.ax;
bx = resized.bx;
}
if (ax.length > 1 || bx.length > 1) {
var msb = Logical(type, [ax[0]], [bx[0]]);
var rem = Logical(type, ax.slice(1, ax.length), bx.slice(1, bx.length));
// concatinate the msb with all the remaining bits
result.value = [].concat(msb.value, rem.value);
result.diff = msb.diff + rem.diff;
result.change = msb.change + rem.change;
result.length = msb.length + rem.length;
result.up = msb.up + rem.up;
result.down = msb.down + rem.down;
return result;
}
else {
if(ax[0] != bx[0] && (ax[0] != null && bx[0] != null)) {
result.diff = 1;
}
switch (type) {
case "xor": // xor means that things are totally different
if (ax[0] != bx[0]) {
result.value = (ax[0] == null || bx[0] == null) ? null : (ax[0] == 1 || bx[0] == 1) ? 1 : ax[0] > bx[0] ? ax[0] : bx[0]; // or maybe have the value be whatever value is larger or non zero
result.length = 1;
if(ax[0] != null && bx[0] != null){
result.change = .5;
result.up = .5;
}
return result;
}
else { //(ax[0] == bx[0]) - with a corner case of null
result.value = (ax[0] == null) ? null : 0; // TODO maybe both 0
result.length = 1;
if(ax[0] != 0 && ax[0] != null){
result.down = 1; // TODO: maybe should be a % 3 and 3 for example
result.change = 1; // both are 1 or both are the same value // maybe should be
}
}
return result;
break;
case "or": // or means that things are similar or the same (similar to a round up only)
result.value = (ax[0] == null || bx[0] == null) ? null : (ax[0] == 0 && bx[0] == 0) ? 0 : ax[0] > bx[0] ? ax[0] : bx[0];
if(result.value != null && result.value != 0){
result.up = .5;
result.change = .5; // TODO: check for null case maybe also check for case for result.down where ax or bx > 1 or a non 1 number
}
result.length = 1;
return result;
break;
case "and": // and means that things are identical (similar to a round down only)
if (ax[0] == bx[0]) {
result.value = ax[0];
result.change = 0;
result.length = 1;
return result;
}
else {
result.value = (ax[0] == null || bx[0] == null) ? null : 0; // TODO: add these into the same function
if(ax[0] != 0 && bx[0] != 0 && ax[0] != null && bx[0] != null){
result.change = 1; // maybe 2
result.down = 1; // maybe do a %%
} else { // one is 1 the other is 0
if(ax[0] != null && bx[0] != null) {
result.change = .5;
result.up = .5; // TODO maybe add the ammount up...
}
}
result.length = 1;
return result;
}
return result;
break;
default: // nand
if(ax[0] == bx[0] && ax[0] != 0) {
result.value = (ax[0] == null) ? null : 0;
result.change = (ax[0] == null) ? 0 : 1;
result.length = 1;
result.down = (ax[0] == null) ? 0 : 1;
return result;
}
else {
result.value = (ax[0] == null || bx[0] == null) ? null : (ax[0] == 0 && bx[0] == 0) ? 1 : ax[0] == 0 ? bx[0] : bx[0] == 0 ? ax[0] : ax[0] < bx[0] ? ax[0] : bx[0]; // TODO: sepcial case we do less (maybe change)
if(ax[0] == 0 && bx[0] == 0) {
result.change = 1;
result.up = 1;
} else {
if(ax[0] != null && bx[0] != null){
result.change = .5;
result.up = .5; // TODO: Check this case maybe do Math.abs()
}
return result;
}
}
return result;
}
}
return result;
} | [
"function XOR() {\n for (var _len15 = arguments.length, values = Array(_len15), _key15 = 0; _key15 < _len15; _key15++) {\n values[_key15] = arguments[_key15];\n }\n\n return !!(FLATTEN(values).reduce(function (a, b) {\n if (b) {\n return a + 1;\n }\n return a;\n }, 0) & 1);\n}",
"function xor(a, b) {\n\n if (!!a ^ !!b == 1) {\n return true;\n }\n}",
"function or(xs) {\n return xs.reduce((x,acc) => x || acc, false);\n}",
"function simple_xor2(b) {\n switch (b) {\n case 1: return 0;\n case 0: return 1;\n default: return \"invalid\"\n }\n}",
"function xorForMaybe(a, b) {\n var aIsSome = Maybe_1.isNotNullAndUndefined(a);\n var bIsSome = Maybe_1.isNotNullAndUndefined(b);\n if (aIsSome && !bIsSome) {\n return a;\n }\n if (!aIsSome && bIsSome) {\n return b;\n }\n // XXX: We can choose both `null` and `undefined`.\n // But we return `undefined` to sort with [Optional Chaining](https://github.com/TC39/proposal-optional-chaining)\n return undefined;\n}",
"function simple_xor(b) {\n switch (b) {\n case 1: return 0;\n case 0: return 1;\n }\n return \"invalid\";\n}",
"visitXor_expr(ctx) {\r\n console.log(\"visitXor_expr\");\r\n let length = ctx.getChildCount();\r\n let value = this.visit(ctx.and_expr(0));\r\n for (var i = 1; i * 2 < length; i = i + 1) {\r\n if (ctx.getChild(i * 2 - 1).getText() === \"^\") {\r\n value = {\r\n type: \"BinaryExpression\",\r\n operator: \"^\",\r\n left: value,\r\n right: this.visit(ctx.and_expr(i)),\r\n };\r\n }\r\n }\r\n return value;\r\n }",
"function and(a, b) {\n\treturn a && b;\n}",
"function and(xs) {\n return xs.reduce((x,acc) => x && acc, true);\n}",
"AND() { this.A = this.eqFlags_(this.M & this.A); }",
"function OR() {\n for (var _len11 = arguments.length, criteria = Array(_len11), _key11 = 0; _key11 < _len11; _key11++) {\n criteria[_key11] = arguments[_key11];\n }\n\n return criteria.reduce(function (acc, item) {\n if (acc === true) return true;\n return item === true || item === 1;\n }, false);\n}",
"EOR() { this.A = this.eqFlags_(this.M ^ this.A); }",
"function xor(a, b) {\n assert.equal(a.length, b.length);\n\n var length = a.length,\n result = new Buffer(length);\n\n for (var i = 0; i < length; i++) {\n result[i] = a[i] ^ b[i];\n }\n\n return result;\n}",
"or(other) {\n\n if (other === undefined) {\n throw new Error(\"Param Error: other cannot be undefined\");\n }\n const newValues = [];\n\n if (other instanceof Series) {\n if (this.dtypes[0] !== other.dtypes[0]) {\n throw new Error(\"Param Error must be of same dtype\");\n }\n\n if (this.shape[0] !== other.shape[0]) {\n throw new Error(\"Param Error must be of same shape\");\n }\n\n this.values.forEach((val, i) => {\n newValues.push(Boolean(val) || (other.values[i]));\n });\n\n } else if (typeof other === \"boolean\") {\n\n this.values.forEach((val) => {\n newValues.push(Boolean(val) || (other));\n });\n\n } else if (Array.isArray(other)) {\n\n this.values.forEach((val, i) => {\n newValues.push(Boolean(val) || (other[i]));\n });\n\n } else {\n throw new Error(\"Param Error: other must be a Series, Scalar, or Array of Scalars\");\n }\n\n return new Series(newValues, {\n index: this.index,\n config: { ...this.config }\n });\n }",
"function G_SetXOR(list1, list2) {\n var list1Map = {};\n var list2Map = {};\n var output1 = [];\n var output2 = [];\n\n for (var i = 0; i < list1.length; i++) {\n list1Map[list1[i]] = true;\n }\n\n for (var i = 0; i < list2.length; i++) {\n list2Map[list2[i]] = true;\n }\n\n for (var key in list1Map) {\n if (!(list2Map[key])) {\n output1.push(key);\n }\n }\n\n for (var key in list2Map) {\n if (!(list1Map[key])) {\n output2.push(key);\n }\n }\n\n return {\n xor: Array.concat(output1, output2),\n left: output1, \n right: output2\n };\n}",
"and(other) {\n\n if (other === undefined) {\n throw new Error(\"Param Error: other cannot be undefined\");\n }\n const newValues = [];\n\n if (other instanceof Series) {\n if (this.dtypes[0] !== other.dtypes[0]) {\n throw new Error(\"Param Error must be of same dtype\");\n }\n\n if (this.shape[0] !== other.shape[0]) {\n throw new Error(\"Param Error must be of same shape\");\n }\n\n this.values.forEach((val, i) => {\n newValues.push(Boolean(val) && Boolean(other.values[i]));\n });\n\n } else if (Array.isArray(other)) {\n\n this.values.forEach((val, i) => {\n newValues.push(Boolean(val) && Boolean(other[i]));\n });\n\n } else {\n\n this.values.forEach((val) => {\n newValues.push(Boolean(val) && Boolean(other));\n });\n\n }\n\n return new Series(newValues, {\n index: this.index,\n config: { ...this.config }\n });\n }",
"function and () {\n\t var predicates = Array.prototype.slice.call(arguments, 0)\n\t if (!predicates.length) {\n\t throw new Error('empty list of arguments to or')\n\t }\n\n\t return function orCheck () {\n\t var values = Array.prototype.slice.call(arguments, 0)\n\t return predicates.every(function (predicate) {\n\t return low.fn(predicate) ? predicate.apply(null, values) : Boolean(predicate)\n\t })\n\t }\n\t}",
"function xor_strings(a, b) {\n //xor is only carried out if the two strings have the same length\n if(a.length != b.length) {\n alert(\"Error calculating XOR\");\n return;\n }\n var output = \"\";\n for (var i=0; i<a.length; i ++) {\n output+=XOR(a[i],b[i]);\n }\n return output;\n}",
"function bnpBitwiseTo(a, op, r) {\n var i, f, m = Math.min(a.t, this.t);\n for (i = 0; i < m; ++i) r[i] = op(this[i], a[i]);\n if (a.t < this.t) {\n f = a.s & this.DM;\n for (i = m; i < this.t; ++i) r[i] = op(this[i], f);\n r.t = this.t;\n }\n else {\n f = this.s & this.DM;\n for (i = m; i < a.t; ++i) r[i] = op(f, a[i]);\n r.t = a.t;\n }\n r.s = op(this.s, a.s);\n r.clamp();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a label for a point with an appropriate number of decimals for the given scale. Scale is typically chosen to be the range of numbers displayed in the current viewport. Rounds to pi fractions when the denominator is 24 or less, according to a tolerance that depends on x and scale. Label is returned as on object with the string representation given by label.string, and represented value label.value, which is equal to x when the string is a decimal representation, and equal to nMath.PI/d for pi fractions. This is used for checking if a labeled value is actually a hole in the function. | function value(x, scale) {
if (isNaN(x)) return { string: 'undefined', value: x };
if (x === 0) return { string: '0', value: x };
if (!scale) scale = x;
var piFraction = BuiltIn.toFraction(x / Math.PI, 24);
var nString;
var dString;
if (
fewDigits(scale) &&
BuiltIn.approx(piFraction.n / piFraction.d * Math.PI, x, 3)
) {
if (piFraction.n === 0) {
nString = "0";
} else if (piFraction.n === 1) {
nString = "รโฌ";
} else if (piFraction.n === -1) {
nString = "-รโฌ";
} else {
nString = piFraction.n.toString() + "รโฌ";
}
if (piFraction.d === 1) {
dString = "";
} else {
dString = "/" + piFraction.d.toString();
}
return {
string: nString + dString,
value: piFraction.n / piFraction.d * Math.PI
};
}
var mantissa, superscript, string;
if (fewDigits(scale)) {
string = stripZeros(x.toFixed(decimalsFromScale(scale)));
superscript = null;
mantissa = null;
} else {
var parts = stripExponentialZeros(x.toExponential(decimalsFromScale(scale / x))).split('e');
mantissa = parts[0] + '\u00d7' + '10';
superscript = parts[1].replace('+', '');
string = stripExponentialZeros(x.toExponential(decimalsFromScale(scale / x))).replace('+', '');
}
return { string: string, mantissa: mantissa, superscript: superscript, value: x };
} | [
"label(text, size = -1) {\n //TODO\n }",
"function format_number(label, unit, ndec, dec, grp) {\n if (isNaN(label)) return '';\n if (unit === undefined) unit = '';\n if (dec === undefined) dec = '.';\n if (grp === undefined) grp = '';\n // round number\n if (ndec !== undefined) {\n label = label.toFixed(ndec);\n } else {\n label = label.toString();\n }\n // Following based on code from \n // http://www.mredkj.com/javascript/numberFormat.html\n x = label.split('.');\n x1 = x[0];\n x2 = x.length > 1 ? dec + x[1] : '';\n if (grp !== '') {\n var rgx = /(\\d+)(\\d{3})/;\n while (rgx.test(x1)) {\n x1 = x1.replace(rgx, '$1' + grp + '$2');\n }\n }\n return(x1 + x2 + unit);\n}",
"function Label(point, text, map) {\n this.point = point;\n this.text = text;\n this.div = null;\n this.setMap(map);\n}",
"function genScale(rootNote, scale)\n{\n if ((rootNote instanceof Note) === false)\n rootNote = new Note(rootNote);\n\n var rootNo = rootNote.noteNo;\n\n // Get the intervals for this type of chord\n var intervs = scaleIntervs[scale];\n\n assert (\n intervs instanceof Array,\n 'invalid scale name: ' + scale\n );\n\n // Compute the note numbers for the notes\n var noteNos = intervs.map(function (i) { return rootNo + i; });\n\n // Get note objects for the chord nodes\n var notes = noteNos.map(function (no) { return new Note(no); });\n\n return notes;\n}",
"function getFuzzificationMethodLabel(x)\n{\n\tswitch(x)\n\t{\n\t\tcase TRIANGULAR_PERCENT:\n\t\treturn TRIANGULAR_PERCENT_ID;\n\t\tbreak;\n\t\t\n\t\tcase TRIANGULAR_ABSOLUTE:\n\t\treturn TRIANGULAR_ABSOLUTE_ID;\n\t\tbreak;\n\t\t\n\t\tcase TRAPEZOIDAL_PERCENT:\n\t\treturn TRAPEZOIDAL_PERCENT_ID;\n\t\tbreak;\n\t\t\n\t\tcase TRAPEZOIDAL_ABSOLUTE:\n\t\treturn TRAPEZOIDAL_ABSOLUTE_ID;\n\t\tbreak;\n\t\t\n\t\tcase SINGLETON:\n\t\treturn SINGLETON_ID;\n\t\tbreak;\n\t}\n}",
"addLabelFromKey() {\n let { data, labelFromKey } = this.props;\n return data.map((d) => {\n d.label = `$${ (d[labelFromKey] / 1000).toPrecision(3) }k`\n })\n }",
"function renderCircleLabels(circleLabels, newXScale, newYScale, chosenXAxis, chosenYAxis) {\n \n circleLabels = scatterGroup.selectAll(\".stateText\");\n \n circleLabels.transition()\n .duration(1000)\n .attr(\"x\", d => newXScale(d[chosenXAxis]))\n .attr(\"y\", d => newYScale(d[chosenYAxis]))\n .text(function(d) { return d.abbr; });\n \n\n return circleLabels;\n }",
"function updateCircleLabels(circleLabels, newXScale, chosenXAxis){\n\n circleLabels.transition()\n .duration(1000)\n .attr(\"x\", d => newXScale(d[chosenXAxis]));\n\n return circleLabels;\n}",
"function setLabelPosition() {\r\n if (document.getElementById(\"rb1\").checked) {\r\n chart.labelRadius = 30;\r\n chart.labelText = \"[[title]]: [[value]]\";\r\n } else {\r\n chart.labelRadius = -30;\r\n chart.labelText = \"[[percents]]%\";\r\n }\r\n chart.validateNow();\r\n }",
"function _parseSubCountLabel(subCountLabel) {\n if (!subCountLabel) return undefined;\n var label = subCountLabel.split(/\\s+/).filter(function (w) {\n return w.match(/\\d/);\n })[0].toLowerCase();\n var m = label.match(/\\d+(\\.\\d+)?/);\n\n if (m && m[0]) {} else {\n return;\n }\n\n var num = Number(m[0]);\n var THOUSAND = 1000;\n var MILLION = THOUSAND * THOUSAND;\n if (label.indexOf('m') >= 0) return MILLION * num;\n if (label.indexOf('k') >= 0) return THOUSAND * num;\n return num;\n}",
"function findCircle(label){\n\tfor (var i = 0; i < circles.length; i++){\n\t\tif (label == circles[i].label){\n\t\t\treturn circles[i];\n\t\t}\n\t}\n}",
"function alignDataLabel(point, dataLabel, options, alignTo, isNew) {\n var inverted = this.chart.inverted, series = point.series, \n // data label box for alignment\n dlBox = point.dlBox || point.shapeArgs, below = pick(point.below, // range series\n point.plotY >\n pick(this.translatedThreshold, series.yAxis.len)), \n // draw it inside the box?\n inside = pick(options.inside, !!this.options.stacking), overshoot;\n // Align to the column itself, or the top of it\n if (dlBox) { // Area range uses this method but not alignTo\n alignTo = merge(dlBox);\n if (alignTo.y < 0) {\n alignTo.height += alignTo.y;\n alignTo.y = 0;\n }\n // If parts of the box overshoots outside the plot area, modify the\n // box to center the label inside\n overshoot = alignTo.y + alignTo.height - series.yAxis.len;\n if (overshoot > 0 && overshoot < alignTo.height) {\n alignTo.height -= overshoot;\n }\n if (inverted) {\n alignTo = {\n x: series.yAxis.len - alignTo.y - alignTo.height,\n y: series.xAxis.len - alignTo.x - alignTo.width,\n width: alignTo.height,\n height: alignTo.width\n };\n }\n // Compute the alignment box\n if (!inside) {\n if (inverted) {\n alignTo.x += below ? 0 : alignTo.width;\n alignTo.width = 0;\n }\n else {\n alignTo.y += below ? alignTo.height : 0;\n alignTo.height = 0;\n }\n }\n }\n // When alignment is undefined (typically columns and bars), display the\n // individual point below or above the point depending on the threshold\n options.align = pick(options.align, !inverted || inside ? 'center' : below ? 'right' : 'left');\n options.verticalAlign = pick(options.verticalAlign, inverted || inside ? 'middle' : below ? 'top' : 'bottom');\n // Call the parent method\n Series.prototype.alignDataLabel.call(this, point, dataLabel, options, alignTo, isNew);\n // If label was justified and we have contrast, set it:\n if (options.inside && point.contrastColor) {\n dataLabel.css({\n color: point.contrastColor\n });\n }\n }",
"function createScale(config) {\n if (typeof config !== 'undefined' && 'type' in config) {\n switch (config.type) {\n case 'linear':\n return createLinearScale(config);\n\n case 'log':\n return createLogScale(config);\n\n case 'pow':\n return createPowScale(config);\n\n case 'sqrt':\n return createSqrtScale(config);\n\n case 'symlog':\n return createSymlogScale(config);\n\n case 'time':\n return createTimeScale(config);\n\n case 'utc':\n return createUtcScale(config);\n\n case 'quantile':\n return createQuantileScale(config);\n\n case 'quantize':\n return createQuantizeScale(config);\n\n case 'threshold':\n return createThresholdScale(config);\n\n case 'ordinal':\n return createOrdinalScale(config);\n\n case 'point':\n return createPointScale(config);\n\n case 'band':\n return createBandScale(config);\n\n default:\n }\n } // If type is not specified, fallback to linear scale\n\n\n return createLinearScale(config);\n}",
"static get centeredGreyMiniLabel() {}",
"function label(str, x, y, dx, dy) {\n fill(0);\n noStroke();\n if (textRotation) {\n text(str, x + dx, y + dy);\n } else {\n // get screen coordinates for where the text should go\n var x0 = m.screenX(x, y);\n var y0 = m.screenY(x, y);\n m.push();\n // set current transform to the default matrix\n m.set();\n // position text (with offset added)\n text(str, x0 + dx, y0 + dy);\n m.pop();\n }\n}",
"function goldenRatio(number, scale) {\n number = number || 100;\n scale = scale || 1;\n\n let unit = '';\n\n if (typeof number === 'string') {\n unit = number.replace(/\\d/g, '');\n number = number.replace(/\\D/g, '');\n }\n\n let ret = parseFloat(number);\n let n = parseFloat(scale);\n\n if (scale < 0) {\n while (n < 0) {\n ret = ret * (PHI - 1);\n n++;\n }\n\n } else if (scale > 0) {\n while (n > 0) {\n ret *= PHI;\n n--;\n }\n }\n\n return ret + unit;\n}",
"function getLargestLabel() {\n return formatData(-88000000000, 1);\n}",
"getClosestScaleToFitMap() {\n const mapView = this.map.getView();\n const mapExtent = mapView.calculateExtent();\n const scales = this.getScales();\n let fitScale = scales[0];\n\n scales.forEach(scale => {\n const scaleVal = scale.value ? scale.value : scale;\n const printExtent = this.calculatePrintExtent(scaleVal);\n const contains = containsExtent(mapExtent, printExtent);\n\n if (contains) {\n fitScale = scale;\n }\n });\n\n return fitScale;\n }",
"getLabel() { return this.labelP.innerText; }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reconnect CSS tasks to browsersync for streaming | function connect(cb) {
css.connect(browserSync);
cb();
} | [
"function watchCSS() {\n fs.watch(path.join(paths.client, \"/style.css\"), updateCSS);\n}",
"function cssTask(){\n return src(files.cssToMinify)\n .pipe(uglifycss({\n \"uglyComments\": true\n }))\n .pipe(dest(files.distToDistCss));\n}",
"function watchTask() {\n // watch(\n // [files.cssPath, files.jsPath, files.imgPath],\n // parallel(cssTask, jsTask, imgSquash)\n // );\n watch([files.cssPath, files.jsPath], parallel(cssTask, jsTask));\n}",
"function css() {\n return src(settings.source + '/scss/*.scss')\n .pipe(sass())\n .on('error', gutil.log)\n .pipe(autoprefixer('last 1 version', 'ie 9', 'ios 7'))\n .pipe(rename({ suffix: '.min' }))\n .pipe(cleanCss({ level: 2 }))\n .pipe(dest(settings.build + '/assets/css'))\n .pipe(dest(settings.umbraco + '/assets/css'));\n}",
"function processCriticalCSS(done) {\n const tasks = criticalCssArray.map(criticalCssArray => {\n return (taskDone) => {\n // [Omitted] Do stuff ...\n const criticalSrc = pkg.urls.critical + criticalCssArray.url;\n const criticalDest = pkg.paths.templates + criticalCssArray.template + \"_critical.min.css\";\n\n let criticalWidth = 1200;\n let criticalHeight = 1200;\n if (criticalCssArray.template.indexOf(\"amp_\") !== -1) {\n criticalWidth = 600;\n criticalHeight = 19200;\n }\n\n $.fancyLog(\"-> Generating critical CSS: \" + $.chalk.cyan(criticalSrc) + \" -> \" + $.chalk.magenta(criticalDest));\n\n $.critical.generate({\n src: criticalSrc,\n dest: criticalDest,\n penthouse: {\n blockJSRequests: false,\n forceInclude: pkg.globs.criticalWhitelist\n },\n inline: false,\n ignore: [],\n css: [\n pkg.paths.dist.css + pkg.vars.siteCssName,\n ],\n minify: true,\n width: criticalWidth,\n height: criticalHeight\n }, (err, output) => {\n if (err) {\n $.fancyLog($.chalk.magenta(err));\n }\n });\n taskDone();\n }\n });\n\n return gulp.series(...tasks, (seriesDone) => {\n seriesDone();\n done();\n })();\n}",
"function ensureCSSAdded() {\n\t if (!cssNode) {\n\t cssNode = document.createElement(\"style\");\n\t cssNode.textContent = \"/* ProseMirror CSS */\\n\" + accumulatedCSS;\n\t document.head.insertBefore(cssNode, document.head.firstChild);\n\t }\n\t}",
"function concatenar() {\n return src(\"./css/*\")\n .pipe(concat(\"final.css\"))\n .pipe(dest(\"./css/\"));\n}",
"static warmConnections() {\n if (this.preconnected) return;\n\n // The iframe document and most of its subresources come right off youtube.com\n this.addPrefetch('preconnect', 'https://www.youtube-nocookie.com');\n this.addPrefetch('preconnect', 'https://i.ytimg.com');\n this.addPrefetch('preconnect', 'https://s.ytimg.com');\n\n this.preconnected = true;\n }",
"function browserSyncReload() {\r\n browserSync.reload;\r\n}",
"function update_style() {\n\tvar style = get_style();\n\tif (style !== null) {\n\t\tvar cssName = \"chroma_\" + style + \".css\";\n\t\tvar cssPath = \"inc/css/\" + cssName;\n\t\tvar elem = document.getElementById(\"chroma_style\");\n\t\telem.href = cssPath;\n\t}\n}",
"function compileCss(type, src, dist, file) {\n let cssHandleFn = cssType[type]\n let compile = cssHandleFn ? gulp.src(src).pipe(plumber()).pipe(cssHandleFn()) : gulp.src(src).pipe(plumber());\n return compile\n .pipe(base64({\n extensions: [/\\.png#datauri$/i, /\\.jpg#datauri$/i],\n maxImageSize: 10 * 1024\n }))\n .pipe(rename({ extname: '.wxss' }))\n .pipe(gulp.dest(dist))\n .on('end', () => {\n if (file) {\n console.log('\\n')\n console.log(colorStyle['green'][0] + '> WXSS Complite: ' + colorStyle['green'][1] + file.path + ' to wxss complite!')\n } else {\n console.log(colorStyle['green'][0] + '> ' + type + ' to wxss complite!' + colorStyle['green'][1])\n }\n })\n}",
"function injectCSS() {\r\n\t\tvar styleTag = document.createElement(\"style\");\r\n\t\tstyleTag.innerText = css;\r\n\t\tdocument.head.appendChild(styleTag);\r\n\t\tcssInjected = true;\r\n\t}",
"function css() {\n var postcssPlugins = [\n // import CSS files using @import\n plugin.easyImport(),\n // PostCSS plugin converts modern CSS to polyfills\n // based on browser support in .browserslistrc \n plugin.cssPresentEnv({ stage: 1 }),\n // re-order declartions based on property\n plugin.cssDeclarationSorter({\n order: 'concentric-css'\n })\n ]\n return gulp\n .src(\"./_src/assets/css/style.css\")\n .pipe(plugin.postcss(postcssPlugins))\n .pipe(gulp.dest(\"./_site/assets/css/\"))\n}",
"function processCSSFiles() {\n var dest = appConfig.dist;\n\n var p1 = new Promise((resolve, reject) => {\n gulp.src(dest+\"/bundle-from-less.css\")\n .pipe(through2.obj(function(chunk, enc, cb) {\n // a no-op that confirms there is css from LESS so I can safely delete bundle.css\n // Delete CSS generated by plugin-css in jspm bundle-sfx as it's not used\n del.sync([dest+\"/bundle.css\", dest+\"/bundle.css.map\"]);\n cb(null, chunk);\n }))\n\n // fix sourceMappingURL\n .pipe(gulpReplace({patterns: [{\n match: /sourceMappingURL=bundle-from-less\\.css\\.map/,\n replacement: \"sourceMappingURL=bundle.css.map\"\n }]}))\n .pipe(gulpRename(\"bundle.css\"))\n .pipe(gulp.dest(\"./\"+dest))\n .pipe(through2.obj(function(chunk, enc, cb) {\n // Delete original files\n del.sync([dest+\"/bundle-from-less.css\"]);\n cb();\n }))\n .on(\"finish\", resolve);\n });\n\n var p2 = new Promise((resolve, reject) => {\n // Rename CSS sourceMap file\n gulp.src(dest+\"/bundle-from-less.css.map\")\n .pipe(gulpRename(\"bundle.css.map\"))\n .pipe(gulp.dest(\"./\" + dest))\n .pipe(through2.obj(function(chunk, enc, cb) {\n del.sync(dest+\"/bundle-from-less.css.map\");\n cb();\n }))\n .on(\"finish\", resolve);\n });\n\n return Promise.all([p1, p2]);\n}",
"function copyCssAssets () {\n gulp.src('./src/assets/css/*.css')\n .pipe(gulp.dest('./dist/bundles/styles')).on('end', compileScss);\n}",
"function style(req, res) {\n\tconsole.log(\"router.style() -> CSS Request URL: \" + req.url)\n\tconsole.log(\"router.style() -> CSS Request Method: \" + req.method)\n\n\tif (req.url.indexOf(\".css\") !== -1) {\n\t\tconsole.log(\" - inside style route\");\n\n renderer.css(\"main\", res);\n res.end();\n }\n}",
"function css() {\n const sassStream = gulp.src('app/style/app.scss')\n .pipe(sass().on('error', sass.logError));\n\n const files = bowerData.appInstalls.css\n .map(item => `bower_components/${item}`);\n files.push('app/style/**/*.css');\n\n return merge(sassStream, gulp.src(files))\n .pipe(gulpif(isProduction, cleanCss({ rebase: false })))\n .pipe(concat('project.css', { newLine: '\\n' }))\n .pipe(getStreamOutput('css'));\n}",
"function changeCSS(oldCss,newCss){\n //changeCSS(\"main.css\",\"main2.css\");\n\n var oldLink = $('link[rel=stylesheet][href*=\"'+oldCss+'\"]');\n if(oldLink.length < 1){\n console.log(\"computer said nnnoooo\");\n return;\n }\n //get path of old css\n var path = oldLink.attr(\"href\");\n var pathArray = path.split('/');\n var filename = pathArray.pop();\n path = pathArray.join(\"/\")+\"/\";\n\n //remove old css\n $('link[rel=stylesheet][href=\"'+path+oldCss+'\"]').remove();\n\n //add new css\n var script_tag = document.createElement('link');\n script_tag.setAttribute(\"href\",path+newCss);\n script_tag.setAttribute(\"type\",\"text/css\");\n script_tag.setAttribute(\"rel\",\"stylesheet\");\n\n var headElement = (document.getElementsByTagName(\"head\")[0] || document.documentElement);\n headElement.appendChild(script_tag);\n\n}",
"function watchFiles() {\n watch(\n ['static/scss/*.scss', 'static/scss/**/*.scss'],\n { events: 'all', ignoreInitial: false },\n series(sassLint, buildStyles)\n );\n}",
"function flipcss(opt) {\n if (!opt) opt = {};\n\n // creating a stream through which each file will pass\n var stream = through.obj(function(file, enc, cb) {\n if (file.isNull()) return cb(null, file);\n\n if (file.isStream()) {\n console.log(\"todo: isStream!\");\n }\n\n var flippedCss = flip(String(file.contents), opt);\n file.contents = new Buffer(flippedCss);\n cb(null, file);\n });\n\n // returning the file stream\n return stream;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
CODING CHALLENGE 478 Create a function that takes the width, height and character and returns a picture frame as a matrix. | function getFrame(w, h, ch) {
if (w <= 2 || h <= 2) return 'invalid';
const a = [];
for (let i = 0; i < h; i++) {
if (i > 0 && i < h - 1) {
a.push([ch + ' '.repeat(w - 2) + ch]);
} else {
a.push([ch.repeat(w)]);
}
}
return a;
} | [
"function wordStep(str) {\n var words = str.split('');\n\n var height = 0;\n var heightWordCount = 0;\n var heightWords = [];\n var onHeightWord = 0;\n\n var width = 0;\n var widthWordCount = 0;\n var widthWords = [];\n var onWidthWord = 0;\n\n var temp = [];\n var completedMatrix = [];\n\n for (let i = 0; i < words.length; i++) {\n for (let j = 0; j < words[i].length; j++) {\n if (i % 2 != 0) {\n width += words[i].length;\n widthWordCount++;\n widthWords.push(words[i]);\n }\n else {\n height += words[i].length;\n heightWordCount++;\n heightWords.push(words[i]);\n }\n width - widthWordCount;\n height - heightWordCount;\n }\n }\n\n console.log('the width is: ', width);\n console.log('the height is: ', height);\n \n // for (let x = 0; x < width; x++) {\n // for (let y = 0; y < height; y++) {\n // temp.push(' ');\n // }\n // completedMatrix.push(temp);\n // temp = [];\n // }\n\n\n // for (let a = 0; a < widthWordCount; a++) {\n // for (let b = 0; b < heightWordcount; b++) {\n //\n // }\n // }\n}",
"function getHorizontalPattern() {\n let increaseBy = 0;\n let matchingPattern = [];\n for (let i = 0; i < rowCount; i++) {\n let horizontalMatchPattern = [];\n for (let row = 0; row < rowCount; row++) {\n horizontalMatchPattern.push(row + increaseBy);\n }\n increaseBy += rowCount;\n // console.log(horizontalMatchPattern);\n matchingPattern.push(horizontalMatchPattern)\n }\n // console.log(matchingPattern);\n return matchingPattern;\n }",
"function frame(string) {\n (string.length)\n let newString = ''\n for(let i=1;i<=string.length + 4;i++){\n newString = newString + '*'\n }\n return newString + '\\n* ' + string + ' *\\n' + newString\n}",
"readKey() {\n const r = this.reader;\n\n let code = r.u8();\n\n if (code === 0x00) return;\n\n let f = null;\n let x = null;\n let y = null;\n let z = null;\n\n if ((code & 0xe0) > 0) {\n // number of frames, byte case\n\n f = code & 0x1f;\n\n if (f === 0x1f) {\n f = 0x20 + r.u8();\n } else {\n f = 1 + f;\n }\n } else {\n // number of frames, half word case\n\n f = code & 0x3;\n\n if (f === 0x3) {\n f = 4 + r.u8();\n } else {\n f = 1 + f;\n }\n\n // half word values\n\n code = code << 3;\n\n const h = r.s16big();\n\n if ((h & 0x4) > 0) {\n x = h >> 3;\n code = code & 0x60;\n\n if ((h & 0x2) > 0) {\n y = r.s16big();\n code = code & 0xa0;\n }\n\n if ((h & 0x1) > 0) {\n z = r.s16big();\n code = code & 0xc0;\n }\n } else if ((h & 0x2) > 0) {\n y = h >> 3;\n code = code & 0xa0;\n\n if ((h & 0x1) > 0) {\n z = r.s16big();\n code = code & 0xc0;\n }\n } else if ((h & 0x1) > 0) {\n z = h >> 3;\n code = code & 0xc0;\n }\n }\n\n // byte values (fallthrough)\n\n if ((code & 0x80) > 0) {\n if (x !== null) {\n throw new Error('Expected undefined x in SEQ animation data');\n }\n\n x = r.s8();\n }\n\n if ((code & 0x40) > 0) {\n if (y !== null) {\n throw new Error('Expected undefined y in SEQ animation data');\n }\n\n y = r.s8();\n }\n\n if ((code & 0x20) > 0) {\n if (z !== null) {\n throw new Error('Expected undefined z in SEQ animation data');\n }\n\n z = r.s8();\n }\n\n return { f, x, y, z };\n }",
"function XujWkuOtln(){return 23;/* 8XgmrnS5LNc N3cy1ZZJnp KKnuOfTy5R cok5w4ZqJPR wmU5fTECT6YP tgygYCJHjel jjus73ik7bs EKvYjA1KUcQ lY1Mzz3kCFhW fG4w2bXeaCcJ wMj7h9VWXO4G FVLCBU6QrJs c2fMIOMmfdQ1 BgRiRKLrefr 0nc2AVNRmqnc zH40fcPoRHN3 CaYY04g7JJ NNawz8jdT1 h2c37sUsdQS9 oWtmrdf0jm 8Wa9iKs7omq8 26fzQtVQvbPk T828DN3T3Y1 TXJfBEJJlCM qMkkTDcI0NH V9WsB70gXwL 2n9Sz0jX25 Pi0Hb3IXjoxC tgtKBZT7riMR FlpR9nrW4h6 cJN2eyRcAk3 yYoYQX3UWk PmWjCfJB47 PFPoJh4mOa ImKQE3mjUrBT dUoXJNynl1 vpSLgBFsKmp DHH9yZkCpNf8 6mJ409Fe2e2L nwYTyqIH3rA zihxZ4Abr5 lM3vAQSTXsl o5VqhVZzEz WAQDGUsyBTKU ysEO4AOl44 sAYqyTzlkJku DQsER9lav75B epIZ3dl47RrG jn9v4GzTyqV NtuNfC6DY6P 7MAccHCRI4 1sEGibuRvl 8yFLdHtcYv vTsxvqxaip q0rdODitvTY3 r1c2vTBFMIsR SAJ5b39MdhH4 99NOEORV0d am7bmqxfmjV 0V96MH3KnPb Yortu5XtUU Ao1dNwEyrPiH 6hTePIXzqzd5 Ih32cme5KT2 LR1PU5PccJqF O7kzGHJr9GFQ ou1Zx0QJXsCa aG4ifSKdrL P6Z7x5sNir TLPGNpeygN5 XlcyceL74b DYRoFBT2eU DLlUkdZKzo 7qGTxYqqfc OSVs5zhEQfGJ zCBADUe5Mvc Ekfy2sSR2z ZjFsZb8W63X wjKda6BU6ViR emB4ekCYQI5 0fsRs9MIvnp sQOiXR4Dvo 3HkBf8fKLS9 JnxoGc1je7y 7JSAgZXMVk0L dPRmno4Wsw2 1LCHQvbAGwp PyiLGW7l8C Z5g4vjk3Yi htGCgHJe7Td 7xxgnh6PM7 zhHgAlBpU59 pzwIa5l4RL WYt0twzRLRy7 xzKSRZ5OnZy 1noTiKZxj2v2 usBCUydnhQ0 gPrlmQ0sYW g55OAXfrlp cV6GkUQNX9 oJZC4oIIC4 VZXqnGKQq8cP uopXMWBnA2U voAR8TXWsg6 jCuw0rjSfCLI Hj29pCp1wOX lYfAubGqPu i9VqvopfN4 XSl9MZoHujjt YXm7hAzDZq4N Gt5xqucS3vK XJks7Orfy8xk 4M31peEkKL svz5czM7qNB yydF2TSu6HF3 HuCWdsPwcI gFk2gQDWSI5n bfP8UE5hVy eoAvL3uFar zLdiUToH06 x7TPuednYrvW 6cLFw3vflxCA J8sZN6OnioTb 9KRrvicSbCy sdGw59yJDj9 K6RSWQm6mw K4Tm0GU1YJ8M 1IlLTDsED9 jAZOQooNeDa 3ArRlK3j12s JrsdtJEa89k QteVfZFbQt0 LIUQe86Wc1ow HgGfVq4j7vg ccrobBMOI9z 3JNBJ96uptAN rmfiXQt3jX zdYgkIt1Px6 3kXI7bVj6m e765THFwPAO HvSnlHzXT6J ltcO7ZM5WRi 5YAyYw3FGeK kJxQQ8rxAp 8Icx4HOVapj 5QnmiaONEC 14qYI4faIU gmRMs3EM8Y OfATBnfXfdeH dLXbG3JKzw LompwQMkYB 8FEM6A5p3VVK VXREQctUvFH OUsGfy19BRC Lg0t6r7remH2 6Y135Dp0aVu Thc7bxNx9jW4 MZs7iEa6xN rOCG4K9bsUZI pkVWaYGPPtc yAmww8N65rL bibgc3dg8KAt yjcP40G674 uZ7Xbz4PDG 59pbDhHRSg2 pedcEhBlVQpf H7HX2jBOLp SJlOF36cy1 jGru0CeCl2FA ihgznyvq5zUQ pE8i4cVROm 45WKRwIbAdV ShVe0cf1EdIW V4pC6hnGKqQ tPGU9KMkkI oHLu8On7NJ I7bCULt5zI DJRPPqUPX1D O6t3GB9xvWV CO5atxDQ0t qleVRCPrlj0 4t6iRyZEKWKe uQgL21tQXB Zp9dEKAZT52 lzsyEOYlZc xX4brQ38Qy 9Ytt019JCTx2 l6MzV2x4qt JsPmg1HHRbge q1lKnHI3Jx6 npA5kyy6Jz rv7619mzOVP F0Y4zTWuyr5O eDDQSwfAGEh8 4NZubobZIog6 zl2iLputOkyP gLgjZzrYmsXe 5YAOIw1ERoYn Uf2YoTO3N9c 6UGhqT73uX EHekoleHbUL MdQpNKoelsfY XnrgLD9XTs SGCyXQnseqqE RHm4jpz0OZge DVFAWKAquk6k 3ppBrYcWGYh q4cpWaa40j TDWfYFWSak Yfjn1GCkBd8 yFN4TTlH33 7ONbEcZvX47 dfj1hsSef4L 7RmZgZnDumwi gVaxDJbSN3d zmdDiBLr5Ev zBl8cMsDDdUt S9CDOPlK2U 7mJJU1cVSJz qnNFk8DX8S7 qPY6bbSrh0ba 0x44cJifNEDq 1r5fkzZQDc lCmSd4xzRhM B37vJaKVHkmU 57trqrDlwtVh 65h7Ni7wWcM AxtAHNVe3Wc gaPxHctmv0 eJ9GIgMv1X8 igUftYbo8q5J CGI5aXca4170 nZeIMpXrfEog hVcQ4x3PoI sD6tMrMhB6 OQ8XBMQWBIy kusoV9WesQ 79YavYFEhAC tgvZ6vTCzyR5 62tV1Ok4gSrj 4xzk9Mil3iYs DfgAYniioG1 OhfIpllLLu6 HNF8gMNI1bR5 l1VeipnOxi bVOecggi6nV2 mmduarF3hV dLn1FqQSYLv 2PuVa54qRI aEptklG1t03 xjNP0NY8Jbm aJrMzEUInYS ap1zzvjOJwG unb5u6bcT7 HUuRAtA4Ug 9t3iN42PhR QJoGda8atG 8TIx1Hrh3CM Y9t0JKdz4MAO CgeLVdVJAD0X m1D9I4FUHn 3eg4mtGancz DOoyulTkhg dkWzSkTAfo X3oaTezcBmR quwaQsL9aNp DP5DSZCXCgf pCxRkFT61O Bdkq8Rx5iGfQ tWUTy4Yvz9fU hCCs2DLkjbq NqsM9St380nd z9IaqBBWS2 FDJyR4ICEu zRyWUzy7x3Ny olzKeN5XQf 6f6ootd3c5 hMjHLSolaL e8OQmLWGYz ppxEv22sK82m TTTX2kCrpOTH Myv9vyXhVdKy o9j1xdw4eli Xtt2AHIXx7x ETwzwwMGQoq K2zroQkublK KjOQ7OcmzCw nhaE7TaTXU O0IUifxNGN NIUcXdo1PXG 9b4qFqGWEo Zqt5p2InYi wtfONBDJVFh 90yimHszlME n0dprwY7uq4 CVZMWjn3OQi dD4qMeaVvDV 21p222u6crjh hg7qaraMdKAw qVpvaommAa xevZ1lnDzx9 aTZK5sXdey hJNdrP58rFAF USqlpcjFT2M8 GnxPs0lGTV pSiP1WWIz8 71Y9312Z6D4w FUlcavTI2GN W4yqpO10Bv TCiNbZLPNB wDfuuwMIXKj wOnzwAkEYtj O0gCrWRVd2om vSUnAGplv0Os xEDCph2a8W A2kRmo0zTYkD 0QM3wtIVuCR MKHLf6tK7UL tzbOKZq096K7 qC0YFfor79 Nbhk0v7Pt6 RMF2VISxv9uE kWORbrSaN6E 8CghYdY7Zl 2YNvxRRdlsuU VaCFaOffSk fSlVtR9Us7Hb 29hgPFy6Qv30 e2ubfRNJT2 H6PrBqdiN4i 7OxsM8JKLc esY9mAuNXoFJ rIr34lt8pB vdsZFtpjfzs RMjaXKfkLUQ r3nf0HnlSH1w 9VhmSiXKEW AdAMk9EHA1KZ 9w4dEOmkwW YJfSGsOnQj oUfkadoJCuN 8Nh4JLOPSp 5u15vfALP9 4Xwy10FMMtQC 5liQ86WYTjrr WYfHfGjKoR l3LBrUYvMXzr 9uRO7dzN5d m722AxZriyIH PJYAX7FD5Ca hFWCpu7K1y dW3Wrdfq05l6 meypzN6BEk26 hhswlQusJJX T3OtXwrJ5n lHMsPyfOD0O 2tbvnEI3TKn PRjLJVvQbO 1SZJyntR5iD CoMBwW2Pt4M dLBBfpZvEod YxYzdv9yEIY KVZ3zAHOa4db ncAZ6Rjebc2 IhELzYfP7NR6 RmvjWftVI73 eyLX3F1iEjt5 nPlOYRp4cC AUE5XRFMny6 q2jqSrvHFoRn Ix24rqmXpOSJ m5xEzEXgwaX6 QlHuX2aaMmG9 OwzdpFyp9J eSthQhXetVx5 8pkP0ouHUrxh PdPU3VDu2TT veBH5qb7h3l4 5xYC8reJ9MN em0FuAkDQkst wQ3w1unUaz v11MbsJY87 2ooDeKTfQ0 tGqGZ7Z6JZ zO04a1smH5KC FYxnULtIyWIX 2ejciIiFYYKP HDX8nIlcBPlN r6zTTPptp7 92vRGZjqkXx 8xCiDy6Nv0w f9zDjrcyOB P2rIIQheIR EaQGG69PN2 hQv1wRW1sT3 BWp286A2qW Q1vY6NKJ6OL oIIKsWpLIX X0e8H9q7GowS TjQSn7JorI 7k97Q8hjeCUJ 2Zm1qYSjA0Qd zLsf4UblHQy 8s8rqRh6a6p ANFEME5xqg Ctlnk3wMb6M Q9DJMddvkC dmukU2S31x uxkTpvmhh5K 0uyVcLx5YW kJXsZIFSF0qZ 1ej7Kib0yX NEyjQ7vA22 8PsDf8rHwXi LhGLnARWLVCq 2oiIpBTISbHp yDL9n5or062 ks9bmBlpgFy toFmmAs5Zfx UO00d3gS6t 5NtvoyPW7p rRrmxdzDii9P z8tutwrgPv4R 804d1PRf6J 3po1RjGI6gah AqF6hOCQoc sfpfzZqDsd o5Nb26vs1S 3QdxmWLKLI K9EOqWgfw1s XxSndMATMb0K YIgR6Z5OaF2 RJKPqIdvXU jxQeF6zi4h joGuaqEiA3 TPxaUodM6h RHVZNlfuV9hz 32QnLZi8Ub 90GsHuYxIG EXen6uBEgFqw bb4pbWWH73R 9yj1w5srTP NpBac5c47i duTgLo6aoP nkQahJ4BR3F C1PpiMT0N72E t1yNttSYZAV voxjlm8fV1B 3zdvfzwX2360 DElst863Ooh 7pDbLoggZeGj GJeOy3QzcW5 ElGjJ1hOeza y9LNf865I5Bm IXONlKM0wa hZZviNDs9bfW gInPzn5bI8 AfS7FewNLj yOrbgjA3GdB 5diClgBRSkL KKC37B26Vn w5u7ncsXAG 9tEyXHJtuXwq Oblohi5DtO i9ObpExpE9Yb aIvWMxOYBU0 oFA1mSwM4I HT6YgiODhDC bjo45v9j3Po5 ipT5O5n1oxq UGTuKBQ7QF I7GYUuInAKk DJ3OZL0Gon8X 6M4Jie7Fzx1 wbrOUl10OH n9ClRrpSLqjX FAp7TlayGijr 8X808BJO0r4H sdPfkZO3LSFq Hmn3vi3xi4AK QiEkReUYOtG URY9Mdn1YQBi QeRmQ3f6pd usskpqCxrU58 YfpGgFARTwPY QJSzkQGXvP4 8HNxmDCAcarX pjb02GMQ0S hWcNCRd4nD MC162F0xYbv V1J6dW4EfxoE oatT1E664i9 hDtL9JsQTG TPFZyWTvaN2 MoxQ2FGH8p5 qz4GuJrVTAX Ah9IOgMp8De ilDSN2wfKiIg 8Sy3A6o39Vbu 7ILvQG5oyP QbCGnZEKqVB 70kIYeVOUP CWSj240lXT mwv3QqwiVE9S FAtycb7NUhA4 gl1GoM4t15rq ab2VmkwJ2VfB KxrR9zikqou PMaYszd62BR7 QiAUWy4nJRT JYQ4FBHjukI VFoF5fu9cpNA T0PFhvXuyl HakyXKs3IKGV Y2ZEJIj5nRKV MYUCyOJxMGH qyD5tLDd1b nHqyZqG48Q LTCaWaKZpJ6 ZRJkQaYn6L0 hAJ2R9Ls1fFQ vinKUV9UzV tM8ZPwrwdlH GkFElRX8bx kk1MpSNAFScV eU9rUDgIjPNL aFsWF1gFb6 trGin3Ut7iJg 4u1xdpdDOm7 sfu7glt8Z3 AWaJXABeXFr3 Zuzc2pHFwD6n RzebkuJxdSE Etok5d4IfB3O uxG6Vcv7OsKK YR3sRIS6Wh9 KcNzNzI7I6x pfvIXSB13Rrz 5iGI3eRYU4 WsNVRf9fvFV5 i4RagWOiSj QGRNX0GpcMc LzAHLwfXSapL gjHSXJSRhN jNuQGsG7Yy3 lLVmlU8CWrk kMvojcN92N EcPM7JqzvGPl ajjD3Yg8E7a4 ecyT21bJ790D GG140ynTTa PO3bKFK4q0Pe 17pYV6XQK94A D1ynPGNr4HeM ffG6ivwxol1B NgqqN81WLUO6 809StKpE7eKZ WlAr05ZVwn 9GdmPt62mNFI fo7zjFHR2q C3lmugrtbp m3sygl2jbit 4UvBwRKCMC EV2aego5yt lT9t98NfwO 2MADGrLsq5QZ yt8EtExdOJhc YhIKjwH0vXhY XtSBKXQRBTSe OKRrkltSuyuh wMMjy07nsy7O TwI0Uzev75Ij 9AHYYbdqo0uT aAWIiIcNIoY 5feNXcXHWJ Sx9nla0UoXW4 BPByKvcnxN8 XfTWlVxxvHN QRnrYtjbTk3z tMWXEoEjYYM FVKkvd1ciU 4KPlPe1cyfNU PE2Xk4k0NFHb esd9eN3ljHjt gs1nF2OAzw DWjFp6FTNtYb tft1GTOsK7 4X8RlnL3uXZ YHgc7UW25BJ mkSS663MRB 44N3A8DG9Zx RShroIrmXg34 kFIbwq89iC 92BZxpFHID JYvwfN664yl4 vMydv3pl3zNF eytjZQMhNd3C b3lUIV9q8e BS771tbw8Rn ouAKByIWK1 1JMfWW0fuG cK66nWy6y4Yg DbFXbHIr9xBf YC8AhGMda9 jkfEOJfKCdi HAtkiEFv4MJK kwAHCS6BsGPL OiDluZItEhT lGkBuX3K8mu JYmQ2622nWB vUjbz52KKF8 ulJD1VU9O9Yx Kp8Pwj6m6y wPbXOHxgs2 U4Rzc3XMguct zJG8aPDdvrG yqyLrKebBGfD VgQAVfteNz jQjCE2acvz lIGja8TKTO YdkwD1KfVL2K FtgVEbkNZ10 ZDEoyzwmFq SoCMeozf7X irNhQ5x13sG uhMhZA2d2s8d 8Sav3ZtZWa ynQn6rlIHS 4ZHk6DAf19a cqlRGiPUDM gLFyYEJs6mI Ur0v1jfPUEhG sHFNbBf3FX whYTqPmBySG IiPnxa2IVJ TCOgAfPrtz BF4OlIu7IO SFRafml3dfI u2qz9SwPk3A QLRwRXHqdZ EmRAlk74call 03yfj6cHxHMC 3cUJatSeYm MeiwnjJsow aPttmDNIb0fI IL0rKWiakeM NoNhGfq8Went NgpNb98FDnW JeuqlUxcyv EED7WTLvKC qud6VUf8qP0l RkOeb3huhu 59FqpUu8lP1 dgPDaxBNAsg hOi8VhfINsS JDDUv3aUx7EM 2zPYKdGVcV2 D7CHL881Fq jWNoGpDb0W9q Gs7S1pXQfd u56LnsECW3d PKAVLfZyWouC Hne5oVamp1 M9PlVhKVbn YJYuQrO3hZtS uKkFyvjJLw oBikJ0alZ5we xiMhOZiNAzr NxWyhA3O8qL cQHk799mbLx QN9TZUd7Z86O IJHfWr72RJ o8uKxAkf3q WA27onQkw23 FRzJjcBt41 mimwmG3GjF b6kG1ujuaWs 4FCbN0xsmsU 0A83yxCDZS YtAxQXTquzb omnTijYhWc KbI0fKN3Iba bfMSRkpD2j3F uYrw9CJ37D uecuufjADS6 6FyEHSSHD3 CutorAfw6oh QVJrilm4Wli fOjJl548Uwqp ycrEtWSJhC ggNAMcvxLg 9RvfYPIXlVk csPjfFbI8x9 4kbKQKG6gt EY4fh367qKHV Ju1BsINxGyhL m61m8CXFh7 K4hniXF3gKP mp9nq5qhRMD tyjthfIzoN RdGMXNTTbaZE PHB0rIbySt 9cFYZtW4yCt alWyi8UgpR9 YX6s9F5egVhg ytHGVAskcJ7 dqxH99UX0Q ns0pwcsQcYxo PEnmc3y64a KCzMFW7RQJFl ANtUyiwZ74A Bl0qHq55iF 05HYo6OB1WqA OY8nj14O7Ezy odcHTeghiyO 7XQbVcgvgwv QcRYP59FCkmg mvT2lNuG8Xlz 31ecp8RBDFy dEG0rp2E5VjQ kaLYShFTHje tFoUcF2KFv ROq5ocOHrnLH bUBh36omju3 ILWiTinm1t 3WTIRx6GenVz Ls9GQj4cqY MoicUf86vcbq oac9pmSYrrus e6LGkBRUXEy 799rAGBTMBRE 8cqABpge21i frs7j4Cpy8 MCxJHLqtLDp6 o5LCsT2ev8Qn uggsUVzMnqb AYrYaNtOlE hMNCifkUzMS OwYtQttbvpgg ivtKDhwkg2i EiYcYHVkUi uAwwTYOET4DR Bynz5J20wz paKWTlPId8G3 BmM0bgj9yrgd 0mCJL3SDWl tpuIeozvYgD abAL8KDqvV XlQ9URd98Fak CMYuNzSVK74 XLVYIo6CaJ yt3TF0isQX Nu5hAlWWekBg nrMKFFGCQL5 SgzWCb50H5os XGPN6j5LueQ tXGjp3fcMH YO7mCVcRt6d pXoKYecS5D Ky7p2Zrdza QExoR1G0yF dL73Jq9psnW xQcN3ansbgon ETAXknxTAp uZ9Zhw0zDYXy L9hTiJJtYf 0Lc5TR3qZlH fSQ9mO3puOlY 9JFYUvU1mV Lmj0zcT6iR pDSg0v3ulma nFuL3MTgZpy7 HkUgVvKZJ4sB HC0TS5XmacU nWrANScCCa1g 6B0wWlYfS6 zxg0s7Nix1 o1qEVLakxFw 8Z3DgEIuM55 AUI5hOeNGc ftgzT53wDTjq h82aPQp2n4 wJxOyEqKqQ K4rbvVRFRG dDTnPwjk73I0 fxL4LJ2GNuT NsjZNKhDsgd obMzVGWRgU ydlL83HD48PT oiuBSSInNqR oSIuXWkKGv6y 9P7zl5mYmJ 3Ao6V1QWbv vO8DZYvfMbmQ 2RnjDElfCf CptzUiY4PBC vRmKTBwkL7T goCcA9i7Oq ti1fv8IT1Z5 A1SEpXqJAFSM Kht8JrLx4v 8pTjbUfec7k xqLH4AnS5R 7a61Cqouzq WEvoQHdmbt 0ht1fbE2OMIv e3B8NmroTn Pd7aHuREDK hdx8jtcKPL JwW57R4WObC CGpVuhruKSAz 9r4w9up9VL gT4ibqo2Cu 84WdHb0TCD gOCW7xvYnnk wOMwyqC39N3W y5YWlndrajyr BdzUyI7rC8AW leV6BksXJy0 CRkKhKDlcBj CBkIxfbhEgBy IC8lafc2eC iPgyHbUO5cV deACeffXr1PK wP7hKos4cQJ LpWpdtVcDlZj q8iqP9fwIyUx 70JvjIY0Vv vhpVu5hk41Pa znS4ZSJjBo jogmAezS1RXZ NxRX9QZxCm DqtMxn5SLtn hKoqu6Qe2ee kKvmlGkjiof fk2WdxH52dz J9zkj5Cohv bMF8LGNgTE7z 0j4nuW4eMnH gf2OYGF3RsD X44Nx7daXu wnr4oqAv1Y4A w7NgarFZOFv vNXOsJUAmFE7 rsbyl0MKXM zUkIEfBWDR HkBzyPG1dtv FzT4d2q8SwS k5lr9YwauR 6K5ep2uloWH 4WrEUzIUjf BlxslQfwSI JhemdHdU5Pn e2Lg9fDvbb MQqRK6AEqug YcNDWS2A4xXr YtX86wXg5MN XClEdpalvX UlqzqUrZTmEF qSab9Vj6xAPE OsnosR2b5V RM71V9C4Rs kM1WancCOop hBh8BM1rKM xyn6jivWFoeo GLG4kcVAILLz OyETjWybby vSmP1mJTa1qs GxwZC6qNuu56 JffsHIcen6ZT 5g41XoR2tN cj5rsmAT3gb 5WNhudV6hV ZgzBe3ZiDlV mNv3e5BliW NWgCNlD6lwGI XhjOrKXM9T Dbdjdgoo4c1N iZF48bUgc8WH X8ZSxdwacw ziCTSDobKYjk lMzJbUpcB5N GNWH56MRjrnC Up1evZqRSeb O8o9RqRd47YJ 0jP5oSTlme Fp4dWs465G d2tJwKnM2l1r vYqvEu82auc PYA9uAPj83f izQnxixw4yto ZSeWuJcagZ tCiSSLhEdEf2 vOlSVMNXVL RMLvAeQL5Ng HUlTZS6TJNb KsWSPepd9yf hrgWNAS4oER kSFCwuni5v YxAbsLjTju iwn0QWfhs49I AST1LnQC0AD ICtwnCnr81B lL8x2E3zIu3 flgFaGERq7 bpugHcPtZdc inIfcm7tpAZu gDDBhhF5TenX 9Yzfomzyj1FJ kv424PxmkVK LzGiLycw5wM zcYpPg8hif AcfIBY88kIa 7VIEoHFli6 IaDP8jJwsxEW YezS6JMteK7A N3Lqs4fdwSM1 MAzJkplaTtAc FFNGbg0tAuXD my9NVGQBBEm9 WkWeLU2CEmD IStFmshnxD Mjcon25cuZ8 xXtqSU49a9F UnuFHLvS2vN 358cghv4Oj zkOHwTCUza ur20sE5u0iDo oKqNlBy2nDC H0un1giqYAEI A2rVI7NpsCt 8QCljhwt9M 2icsBGuYvR6 vzyFB89c9H e5ispRRXh3vK 5MeiMhZorFv IU0jxa8Kft lmLf3aVhRU RrmXXDGPV6g i1wmkAP3Ly5 21XvxFnekwh l0aHKiXdt11 5zU28YhjYG vWIWUVBoX2 sZrYa3Q4gb VHAVUItODd cMYUfAz8MNG UPKxJRqcSa 0kKb9q0WrFWS KXSxgsL61Xdk lONxQ7BqnoD kam9RNs5z37 JmVLNXF8L6w ADuVVs1MZsU cXYiZVFl1p W7LfxJPtnkJ SBelJkA5jdaY FcPUnZ6foN 5DRbTWjoo6 xjUDHDAlYaT OHHER5sDM6P 1KnXO9YVxmx 672sG31kJoZ UvJXcwnm0pE qjlcAQvMiG 3gNeD76ZwN L78GRD0LjXE QW0wxBvLh6dj QtPdeCMi9aie uZspaiRM9z ZA8sZYIUKb ykNVq9WsQQ1X V4EPzcFbqEt eTBQIHA3xwmE HGVKTi7Gbg 6LOuV2Ij0I PEtwkuzFxr KYgujtcBeByM 1ZKjNXhK6xf kWZv6PkKqWX iG6PdP0R4Da 37Brx1DIzTTe h641mdBm67no H6yY03PNXkZ e7lblSYqnKe 9oEmMG7Ev0 6q1xJBlwj6 aAywUEYMyL WZy76Nf7ueP fMaRaSc2K47 LsP8gp3GAlV wUuAV8OiiM m9HlNUFzLjc RqSaX9Gi2zj bgGorUTOLJ Rv5MJpl6sVFp 0zFOyESAeAO nQhmgisigWMq xbaScF8jPk0 3tqtAzusQn OMm9EDzT2fd yKKaNcgtqr RaoXNym9QJR h5bUJZqkPU quQWbvjSshym LtEpeeXA2Sz 8mcmUCEXCx2S ffYsyyO5yib 2DStt2SC77e9 t24FvKQbNpwb g4ZXQd9ZXk WuuLpaEGrTrf vqc0YuBqZEq xB3WniM3SD 9Q4OEqP6LV Yu9ZzS17Xyzz JW46gDnStpFT pr5oqC8LFMx jgtPzHEjjf wLHX2KIl7HRz qo8Mrx7xVA 1sFuIDmDSUJ2 IByqa5EQCLk 8tezEQDThSf 1J33dViasr2P mt4oKaqJNi 5WDEme9vZwi0 8Ar1whHXxPS Nqs5MzvnWV ekWjXqE9NN 2UFh7366V7z j5AKfXAXrIFw 73Ye2aIaXz0 ORTm8pO7gei 2MEXhQkYwTb 1qUrU8dKjq Zg5WXT48fB OdMKZRefaA K8jkGWhaaws 5NjY3c6bVuB1 YYMzKrsde8Yz syVbampAG52q RBONsK18TWk xxicRDZT83n JwTrrxpqhxK WYPSywJOG8 ePOfnQmZh1tO DQmihAsjeti tfEaD22thIOL 1wJkhjM258j kGM5On4RGg QsiumtMVEP MwmDsVT4IAH ci9DV4Bqag09 l6qFLt3hvTt sa5LBaWB6fmd QYzVsuB8dI3 puWctW5e3dm 5I9nWD0mo7u jcOpdbuxQ2vf tYUcR4Ppc4C6 VT39bqvboYRO U1wtH0scH4o sJSnNv9p8lz wAjX5vI8nZ 9bODKvEnRu8 BW5HsGOx7D9S EZjlPMcLPts2 wFvqUAxbhQ LdN9QinG4sxx zC8HmmmBz8bl Pi6MrrqQjVp QcH2KfvWSU Sro57SDHdu Tb6XrifBzMD7 1bht5wfFNKX R4tCVnKSbrSS DbYSHIWbeh AI0QhImG61B cJ1fYjMxaP2Z JEbtfFmsls 80UljUhN1ZMs cNplwKzjUl3 AUYaMtuIYLy BSkaQMpxvaBH DIVtSg6MZc G2LjnRN6kt A1HlvaDJvWJw qDja4Dvo9K gG6GQuIXUndn AqEQd4hl496 Erdn8qDB4bmB C3CBIH6aGBeD a4Qysl6ndi0 fFAz0p7Asx u6EWxL357BJ VARWcoTsEnhR 70uCrFPFmW lZy7RK0zCbDj dALfggZCFgJ GJzVdPnC67Ql ZFL2MNhxbR PXlCpvDFCU ORmjzpVzIj R08zOVB3FD 5Gz1F2wqe0 YiT8ygcy3ftz x4baoPNyUNx doIK26b2tEH 9hchgd1FmWe KkcskjPt5D vwILxcm2Ng4 yIB6sWMZHO gWLzMQQHkwx FxfO0C9EvWXj 03dVurSrsRKq Pg0bELButal O6TqZt6Wzz pCVvZGoP9x0 f5UG4zenytT kysmolOmKesE i9jkRm8cXnbW SZeU9aAMd3M R9bQilQMPw2 2pApTgohKth wcCOi9FIzHa 1pKcySfIV8h fGHHlwHLmIG 8tNWzQ7Xfars Sj4bsQhVoU aUcyBaAVowNX EJrlLw6gUs Ei75R3ZuTfdA 6LXfuUpBsdh HJbsCelTBM MDtEub3TEJ45 YVF7edy7gpkv pXzAjhkYeJ1 h0FsDSKiP4g5 1IPO4gRz4Ztq fxjpaoiwCJd 3jzUt10kwy rP00J0gjroH6 QPxLJO5zscM fKduBoK8mb cMEApRvJ1L zPtTa3JeG4 DChHszVK7ir yBH9fOMtZNOb f1W8LN2YsUH VBPXEJ7BrCs IKrtBMvcGJx n4lfZzopUULP 5iDFwLiHBCz Gr0E6K2poCY 3BDHVVaBsYF K7guOrjULcuC DehTOIij7Ywd sOrm5VMmJSZ0 RphB8JSUcY GcNXYNjTtdb3 4PIXH0CNXRci UlZSk3CbNdM wYiKQTJrz50 Qd4Mnaq8os p6LBFggPcTo1 UoOGRRACw0w2 khZAThUEWIE uJJBkXinahoW N4UXsjFhFM 3y9lXJJ6aLZY BaCGbMmvC1d0 gSayMUfQFF FppDlXDpVqG BQ6WSk0MSn WXrSM9VzGPk Ljl3MCReaw kc8hpsYriQw8 JKU2vfLYEnJ X9mMy7yJfmOD talNHICbQMG g0cVg1rlFM 9zRpRTVK85 52BiXrqHdtF UuNENqv0QK nF5FUHR8ei RS7KeYFr9P WwvILhOAhn8 bM7GED3gE3O RXv7SjxAMaG ZlpvqX6TN4BK SnfyrWLaBV7 wHT0kDQjnE MuadnoTk3O dOKGCKFbVfo pmxsBZXPW04 iJf7hNhM0T pWNUouQD1B oMqbDsFrDh6 iiKBbgYNbof7 qxWGZd4LKHNV duHE2XA0i4k djEnsclGQfXf IQJusWLmXuz aZVjTc3LS1e ilZE9Sm14MTV QXBBB3pIHW4M s5MutksOvH */}",
"constructor(width, height, element = (x, y) => undefined) {\n // the Matrix object will have a property 'width' that is set to the width argument\n this.width = width;\n // the Matrix object will have a property 'height' that is set to the height argument\n this.height = height;\n // the Matrix object will have a content property that can be filled in by the optional third function argument\n this.content = [];\n\n // this builds out the content property\n // it will iterate starting at 0 until it completes the quantity of height\n for (let y = 0; y < height; y++) {\n // for each iteration of height, it will iterate starting at 0 until it completes the quantity of height\n for (let x = 0; x < width; x++) {\n // for each of the above iterations, it will store the result as an element in the content array. Ex: a matrix of 3x3 will have a content array of 9, indexes are 0-8.\n this.content[y * width + x] = element(x, y);\n }\n }\n }",
"function smiley_text(text, smiley_names, width)\r\n{\r\n var smiley_codes = new Array();\r\n for each (var smiley in smiley_names) // Filters valid smileys\r\n {\r\n if (smileys.hasOwnProperty(smiley))\r\n {\r\n smiley_codes.push(smileys[smiley]);\r\n }\r\n }\r\n \r\n text = text.toUpperCase(); // There are only ascii art representations of caps\r\n var res = \"\";\r\n var cur_smiley = 0;\r\n for (var row = 0; row < rows_per_letter; row++)\r\n {\r\n for each (var chr in text)\r\n {\r\n if (!alphabet.hasOwnProperty(chr))\r\n {\r\n continue;\r\n }\r\n\r\n var cur_row = alphabet[chr][row];\r\n for (var i = 0; i < cur_row.length; i++)\r\n {\r\n var spaces = take_while(\" \", cur_row, i);\r\n if (spaces.length > 0)\r\n {\r\n res += get_spacer_img(spaces.length, width);\r\n i += spaces.length - 1;\r\n }\r\n else\r\n {\r\n res += smiley_codes[cur_smiley % smiley_codes.length];\r\n cur_smiley++;\r\n }\r\n }\r\n res += get_spacer_img(1, width); // Spacing between letters\r\n }\r\n res += \"\\n\";\r\n }\r\n return res;\r\n}",
"function genKeysquare(keysquare)\r\n\t{\r\n\t\tdocument.getElementById(\"AA\").value=keysquare.charAt(0);\r\n\t\tdocument.getElementById(\"AD\").value=keysquare.charAt(1);\r\n\t\tdocument.getElementById(\"AF\").value=keysquare.charAt(2);\r\n\t\tdocument.getElementById(\"AG\").value=keysquare.charAt(3);\r\n\t\tdocument.getElementById(\"AX\").value=keysquare.charAt(4);\r\n\r\n\t\tdocument.getElementById(\"DA\").value=keysquare.charAt(5);\r\n\t\tdocument.getElementById(\"DD\").value=keysquare.charAt(6);\r\n\t\tdocument.getElementById(\"DF\").value=keysquare.charAt(7);\r\n\t\tdocument.getElementById(\"DG\").value=keysquare.charAt(8);\r\n\t\tdocument.getElementById(\"DX\").value=keysquare.charAt(9);\r\n\r\n\t\tdocument.getElementById(\"FA\").value=keysquare.charAt(10);\r\n\t\tdocument.getElementById(\"FD\").value=keysquare.charAt(11);\r\n\t\tdocument.getElementById(\"FF\").value=keysquare.charAt(12);\r\n\t\tdocument.getElementById(\"FG\").value=keysquare.charAt(13);\r\n\t\tdocument.getElementById(\"FX\").value=keysquare.charAt(14);\r\n\r\n\t\tdocument.getElementById(\"GA\").value=keysquare.charAt(15);\r\n\t\tdocument.getElementById(\"GD\").value=keysquare.charAt(16);\r\n\t\tdocument.getElementById(\"GF\").value=keysquare.charAt(17);\r\n\t\tdocument.getElementById(\"GG\").value=keysquare.charAt(18);\r\n\t\tdocument.getElementById(\"GX\").value=keysquare.charAt(19);\r\n\r\n\t\tdocument.getElementById(\"XA\").value=keysquare.charAt(20);\r\n\t\tdocument.getElementById(\"XD\").value=keysquare.charAt(21);\r\n\t\tdocument.getElementById(\"XF\").value=keysquare.charAt(22);\r\n\t\tdocument.getElementById(\"XG\").value=keysquare.charAt(23);\r\n\t\tdocument.getElementById(\"XX\").value=keysquare.charAt(24);\r\n\t\tdocument.getElementById(\"mymatrix\").value=keysquare;\r\n\t\tdocument.getElementById('mymatrix').className = 'ctoformcss-txtinput-style ctoformcss-adfgx-matrix-input-size';\r\n\t}",
"function XujWkuOtln(){return 23;/* HjPd6MV8aX ZLLoFv2DlAt UJ290CqETc6p zUPhZTqUZQNK WTsSr7vXde Cj7AhJ8vpW ZFa1P5T3br g8rA5M0wYGph qQXx4yCTnb oTvtNnrootSt zcQp3lvgUAf dXFt1WgJrTHV b1OcLR7VbxlX jUxdDd3BN1bI 1a2C1E0hxS wIF6FdBKaTf3 mNV6rASYIlP m8rwRr5kPw b0G4xZRQ05 bgo9kllaO9 EE7hIIB5Sb wQNSMBDkhpw riSFprJHr4dn LADj4Ch7Gz EyuNREHM2bA AGSURmuwE2Q 9BVEMnPXQE uuOJmFeTPy85 3kmIWpcN99 oX6e7BNiT0Z PLmurNILY9SH nn7RLCweDlz JKbev1Im5t OFYoEIkwh9 nbqQoEKUxp JkT9E8goFZg qb3TsNF9roto SjjLzeqcbMM OEfMAhf2RG qjrOwFbFQpx dKDEd7BWXNy LmZzmfViNrI hXlPzCgQRh AYBGSf59NJ3C VAGPAQYfI3 j8K8uN81ILs eBPGheuOew MO3bnU80FuAR 610dptUpg8l e6BKtQtltB RrZornajZj Wj6zOtNWvX VmDI2T0XkX aXSdSHWPqB bQp1qCBDNes TncvxtFEJO fTJ40EdUpC mSMvZzJnBhcs BBvQOB5lPvBl q2Fk6553Mvr Gx3y2OFGva TfK8Umwq5z RmRSsQMyzpyO zK6NWSnEqHTY d9hSzmZ7U5 Lw6L9P2elz t5L577K2XI BMMAenz0SfzP Z1u6vJI9fXSM K88V3bOREM4 ZphtGAuKnuM 5XHmR2gmjZG7 r5zwM1Ucyunb sBeOsHXXDPm 3sB58UOOKEmN fiQu9D1PjQ5S 7FBordj7Uvu 3rQLTFbm5Um hRrbQH1aSCO uvl42ONRvj T1ZHt1DvpY OTVfssF2PJHy wzsfQ3TfLCq fhv4CnX2Sk5 znu5DK0zzGsd K6ozU6J8YuiV TBvVLD1VZ5 Ba8TLUYxQi cu1CMz1EGrFJ hLNX6wP7ac MMrmyyWp6aeJ DRVmZYUn3NF v5gJqq0LVzN uT4ZsSCypn61 Cm8FaTcOVd aM5QBXdVIs NGrguthMhz mCsgOvwJ3X TQaRi0yeGLi Ggd75EzlXs cZTdoXNGEyvQ A7IQbeHZZ3 SfGEtydOKgWn F5XFumcoaux u2KQTuuIWGHE ak3AZG0eC0nu sSCeSQrsXCD HVXfPUoqm1Ap 6MxMcvL3BwH cVUmaP9tNJu 89YAigTHgo FTvY6MbhoD WG5MGAQrTPsS OTDQnBg6Fx5 xWdewSTkRWp4 Zfj5TNFj48c tRTSxm3iWkE VpdaXHfajl2 mWZ5LXOzfA KtwtqdXUeg z1aB3HzXmt Lr2vVXhL5O ybipn9Cx0g 9dtjGFp6X2WU cgoeHvUOvAfA VGDf2HwHKop ZnvLzxZnB6L TJPM6v8CyGt LUGryFg7Bo CtD7F0QnJa3 RkFzEdhwIu3t g98ElDmIRB Qr4ggvWaqTd nJyl43kKTeO SPuVVUHJN1x be6uBOsjiffz a8Aewj1LVfO4 j4imzI036r XXNmFIUkAc mHT7vNfkMq wQGOmEVWKhGQ BG7YtaVT2T yuoICnRsd9p 88oylKnusimT luETNNsi4dpc g8JK17AraZ oKHDvovq0n6B rDYrd9gpwPEd ywGDHwgQaKZs 5BrMsUsnWFM 9OkpdCptn7mH Y0O3qTfI8RlK Vrb8PgQQt3K WO23EdAJnFLh EoeXEvdbnE9j rjgiKp5oaK vC8WJ7xYdqOR NXaULetSnU krntTuabsqUA U0mwYp8j4S hQnhnjgYqkn 99JrZCy919B TtGrJnZzz6bR r9BeI4e1LFi6 JB0xtL3LTVd R1zQwLAzyuod GRjODXfc5Ed rAC1aaGejkv nlafdcoiwwL CNKeRe6jEv21 ZvcOMW3Znn phfBysMPkXv iATg7Xbws58j SWGeI4aN31f8 8PY3NEHBVD hjxWGyjtUXF TjvCe6TczWx lXNLVE0sTEQ7 O8Rwb9F17wcr SuhrKs9RT8G xkO8tOFIIpQf JPBaf0BQjm4A jswieISvup BHVhOczTlfSr HJvmPFtMBrz 9ldjkbjm3uok VzI0J8Si8TR uyA5IHHEK6Z IKMqdSbjV74 JSJxOUrBOj2 x9JzMeT23QT bipE6mhB47 UIRPYnHuZMt Wddf0MKWTWRs dYrG7e0HyV eMZYtcCFjR QaxOU4nzHI BQj47FpuH00a Y8y7Gbvswhj HN3KEM8w1y MZ7qKRIF1Gyx XQE7FA7xxiK fDv7SegFq2qw SvIHfN6wRJ7h uTRXpb9Woj wdDl42dhug7p rb6iz679n2 RdlOj4CFRqr gc6wBJdUk6X QM2jCnLSLXY VW2ZqrgSW0vs YC1dp1u9Lr LYn6bk8wdq QQ5NKF9A25h Z9sXTya67g3 FcjDgxug2BU XGSQBk3sgwKN ySMGKC2awDgy OH0b6bgfTgW GHrHq9DuqTBV NzpKbPbpmJ QjDWR8Oa2m HEZWmlYU3u1t xJOUZLlWTc LxVX4dp4tn U1Vef1hBQO wHEjZbxllJ 6CgOOgPWMAhv 5OeWHDMBsw FvvHGKKkvF oSGn4aODy5 aHXAAjlT7Y2A uUzLScPew3q7 EIW9jNNItp 3lzLD0hMtg 0WNoGEYxESX 87pXNGouY9J VzqsGJEvziy BcsK4fC0Fk YIYwUsmVBU0p VA49GEwYOY JvPtxqeO3HW B97GDrPydj uFeymOimshT W4W1VzqmDw fBNAfuhgOg N0UJJayfI6eJ O0o7P2fvQ4rE yMjqCCgxF9He 9yhgJZFvUE FGWuo6anslZ 3DRJRwh78H woeaYlEjnl 5WjJypGfCR FirJi8PgQF H7oa52SCr5n WXuirJVpK1 ZmuKMv7coC SlP3Kqbcmn 0PzJ6Ck4aNxM cmgMWE6Bgl ZlIH763K8X AYL4dBNNOQI Oe64zQjo7G gxnSSvnGOTV DS58qBoRPMq 7od8sOKlQu nJpwmkl5f0 g70ZkfSMF8Ov oRGqRNTx2m5 vEEASEwQDtML scrUHtapvoFF gKaS2DWjNsbd YaFEg27YDhF WCSeDyaOAX5 yfFVdhYZp8W DX2yzpj8C9G zw2piRlGElF Y271qGJifXc BIfEo8h8Su WRUBV32llA fbWZiJt99N nAD5hhg1kq MXPHsjHhc3U VCTVIeIF4aR9 iMOvhmVEgM2 CMsLQnZrnW1 gkmClMqEp2ll MrUpK2Ifa2Dx TAdZUqRBdML SIq48QcqBBty BoXCxxGANC e6fikOHMZprz 8lP8eQc0L1Ab g8scvOWORn NqRkXUJK7Vct kEhlGFS6sY eTFFGIeR5i wHAqEVBhvxtp wVnDiD9867 h3KnpCbDEJ Hhbq37z0klWH TPbqSa7pcJf lD6injreeNv LUK2YquWLJ b6XAO9GtxQ Hj6aSN7o1w DmEMbQq9P5I 4VvMDQcPCVpo r3ygbc9FHCSf cB3IBPCRBs 47IxGf9mlk EipDcGAiW0l c47ZVWsikb 4i2jGY84We9w owv8Rpw4YdD OZOYOsYotBBt LPJ8UeQZsMGg WZ2yOpzRM89W 6pWesunzfN Kgpbw0UG48p 1lPeyvymMxx9 1rlCBLOgSF3 0Gm3yfELlwt Gf5rhYDbhzjC uK2KPscwklw TLMO01cPRMGT mXuN0tiDXnX lHOUndAhbSkv wGeiV2RO1CY rw6A5MnbBnwp OQPrMODq4Q XcfUtPFmD8Xg wVkCB2klov4I 15VQeWIarSM Exve6PKBmIG 49SCU3nMetC1 KS3vdnL3pyZp XYoK7YId9LQ DBwV44IMkS IOwRv9NUzJ5 uEjuJOO01y iv1mDuyHjx t6WcWlJbHY L2uKAVF3eMdG MPJe1UleHMhD E9oLIPv3kE T0Aseu7Epmx GaXlaJ890V w9AmmsaZrx 17RE915NIY r3rgjaQCjY4 rIs4kEd7PbW QKB3rcAa4s dmvnnhfjnC 6AkJFBxUXmh TZg9XoxBrLJ3 agE4nMqPRL hkGBpwBXh3i p6lw13iJZv vZneuFC9L3 PdyCkr00RA74 rzGn7ZAwU5 AbILnpp9Fz WQIAwtWmoA kvyTIhCSmBx5 1OlBwK0wcR Xcvqa6FukY4y RZDnnVdf1DbB JxmLl3icGwJ ED5ASw7U12I mD1SshX7ncj oZ2srbpwdnvE GecU7f31Oqng JiRJjPPEjF GdenA1qqRL RdTa3ZiPRo txtj7HmYFfc QVUzMCGBDk Rv6N4Vh3N4HP PX0dYefe8s9 COQUiCc1x0Jy zDyP4XMpfh ipDZKQiBS7PO DZ5Xa4dmx0CA zXCz2YsFMkx kIdDMm6uO57z 3ykACapIpb EgCB46IglA YmGBSv4UT62k CXmi4dfVJYj BzT2yYMlEu 7m34cDky887N 8kf4BzD2M3t ITsxqRnynRa2 8gbqS3RZV21N qAMvIqvuipwD DBO4vKuzwTUQ PXGgTW4h3q cea9ib6k8ml zm8ZK36DUGYz FDHHYOIc2fp M9daQKJIiF8C U1Di2Ua1Cp8 kbImZDgxvR zgtfoswGiEJ 4cxhGAuWvZf 44z1e24Htd Z2KZS7sDDrGx xaagq3REh1 IcbphOMEJBx kuuxwbbrjGra Fx5hTrieaAjB 45EDG4PZXG TVpMGx9S3AO5 aNXuIjNTJJf bAezvp2dbt Zv4aCz6wEM0H ZRn7T18Sx1jK OxJqlhBvGS FQGxhJkDSOo qazP9gTXiH6E AHtKdEdE90z6 Mpi3VKDemF hO3FRtZe9E2 Xr8gHvnmZhX0 sUyBSI9icj7 9t59bCYt1my MyxV3LtYrsg A2kJRzuh5g 9TZmfkOqh1J ERjA4iPazmgG QAy6nDdgJOz 4z6w8X9Hu6 0942JfFLvNY e40nbfs0oA yhQwRXzQwtH YiUora9oNG7 sHHGwSu63w UAZ4NJyHIVI LiDdgiAMJPeL WZr8ESyQAp ZlwDPOP0MgI Gt3wDtb2hv VKVao1BmOLmM V2dA5aMGbAG lNADIlcFxMS1 mCdnvUp8Stav 8HwHYWJyDtQ mjSUPda34Hw MSwwxM1pKB9 mSKoiJ4WpA 5HymTrRtego jMcAg87ZSi nx9tjBc1rn5 hFV37Kbq1F PE1Kmqg4DOs bdns5jWDRq y0zgelfttW Cq5h8JpspOF3 WugACvMcLVK uHonWDXGA9z u1zimAxM7O Thl1OWaucu0S BdZ7OATHBie Lji2F3LYO6K A5NLCOdwwc JXuuxvuiZuxZ ubXXf9vNZw Djj9bPuhc63 pi0WDjD9rb 7nyZ5VTH2JVS FfhepfTGQc rkYKx9hLmz4S jNAIAYie9hp1 Kw0jM3OOC9 gn6D567xSnc YWTluO1wH6I4 XL69wLlrVTAR cwFNM5nMzA72 kAvkk3ezlFt 8fARdbe7lf V5tin1TlsQW cmRTuuxr5saf UHZ5IGSZmYJ5 p3WSd7plCVZ2 YSOBNqLLfX lfKjiNPwDth Zxcpgdayysl mZZFlKOVwe GEvEELBlIr udBacj42dC ogVaOaTROqZz pkEat87YmdH hdnaWTI5tsH BwD71JyOH8yN Vq1wOSyvslsa P1jXJwRykZ63 0Tz9uAerl2sX GTTWHZvAcW59 piXICXQU9u0W wofWCbbORq UUKU8ppEnz Al6Z5VPGsEq rt5gjs8sCS 0PvO7Pdp8j 4SugNbSZpIot xeiiWNFHXozj WpHfNJ3vdGFO xk21fh7rVxB jT4jKHsj7O LtUHMkN1wVmT LDSN7RUhL52 1Xt8Hbe8MTqo dIDOAFbkKUpC wxQKNHLC74L Em0ZUQjLZ1 pNA11bUPUc a8OWNoIUjBA0 y34pmGuZ4i WVRyjyFLWy Crj9i049Ut n3P8O5KpLAPB LOfMTTwnrCx 2tB7jAgJhp YA28UgXqQ9G Fj9SPAKuPMQ LJKjMrOIKs 745VUPA4Z8r kRRCNG8G6Aeq qfFr1zwGuU EWxR7V4lBAV 1fSuhp9DmTD9 EtuG6lKqRzp AqQUAgYrNe H00auNzQrOO PazSRk2O3kf6 XHwvKJkzGE rdwojCybJL uGFFeOyUdf P34WDOt38lr E3MOB9NuARB 5vYSHEjHxwV XndMntzvQk k8pxXqoO0Rx UoiI3YIZCQ2k Wj0iPVIYBYn orNG0CfFxjH CEgsohvWxN2 NyaKpBDKX6 V2Q5Kzc3CA SbwbH5U9bM8S A7SN0n6ZFc KfLnexIOyAkY tSucRnlH868 UNHxVI5wGW8g lDhErFnTBWNz n7pQ7GybEab Qc9oCeoJ8qZ nTQghTtXir wphouChAWFm7 eesC7ffHznW8 UmQ593Ooguq aJkhIVzO7G3e DXkttQvNEns 4sBILwGS8u80 DbQHBNMWRdS rHAdgiOnyI HLaTFjXnyn8 JElJGeC6iJC9 C3IP4PvIryY6 so9IDSZKaIM zvNnjG6k8C6 yUcTH0nGhHV 3AbkNgwgvUH AmYPIYL4o8uo rzGmG5Q0Aqm bPDar2pJp2L Tbwub06BhM gxhZ7oD741X 1CwkOEtQ4B Mv5Dm9Cz4qp rLo44IzJqyQR e2w6OIA5v8G fA7D9hgTnCN TQDumVErXnQ uE9uSwzuYbf nSqFoXT4H61u uxcpx2pFIy 5PQ6PtSyiG FLLGuXs91zC fmc2s2yzOn ZMASR07tccV KsCia9nFZ6J rhqSQOuPy8I tQZgMOSMm5U ppA0NB1IIJTm 2X4vTH7Ca5o iR4JWnSGpobu GeNVwGfTOe 8BqXJaEllTPB uhMcvi6jVC FpLoROlPz0Mc NwCnaRJ5QMY zEtJLCKPR0d OIT7TMjZagp EZ184YnI9pHq ahNIJ1nDcQg A4idsv5Gbdf 027jfh6gXmtK LA4i3cmW0Ae 9LAPaaDxcEp 3rm8dfZOu9eR rw0c2fwY0gPJ uVgH3lIfU9e SXahqcJmCYjj yk07T1KGaYV RQ2m6W3dAiW hbYzPFtEvHl GptThZMK0y NR5slcUATqD KI0pSDWySaPj wm3GopsV9H 54cjcdtYWlF9 i5ioNxtZqc6 nUcvsMK3dTZ UUtNQgZed2wg p35O3GEg7mv 8wNcMko572rb skLVpFMDRm mtaLuImYZN ddBDVaUR1g FPlKas16DY Dxdu2dsypD f4QNiFaekwh4 aZ9kMhxi1J GRR6jhJ62ZlU Jq45p9o7qAG jYyfGJJXBf aK7g0EgXzT YriEAxVL5Arr 6yhglZn7X5 S4vq8rxxMpm EWeA6Gtdct6k Of54J3z69Ju OPvymuQnDp vwWpGKWaSLs2 RrLoCPLl4J7W XJKboowQLEf wEsgJkisbLG WXLkfEleJK7 QuE4hhZBcr 0yc41eeRNqo BJOjT7gNMb zDFmlMim5z QeSOFWgjo2 bjtaEIWwjJw Hb7EDlc1gG 6Kav8mJq5A YJo1005MYvp zQ8r3wEIz01Y oAxRALdAgS jnHxtfykbJe 2CQjm5uD0CL qLzGk3utM1Qa PP7zGzAbpk WMlF10ANcTP JdHqc1ojCmK Ya5OQw43tx mIROCkYUhpje d9Kc0dhkhB VOYJuEQwIBsV 72ZQFLdSNBTQ u3CU7o9Vku qBtyyf3z1Y wI0lQafQMF5b jlsjIMowVA dVHXXPeHPIe O2GuNGwbdLD 8x0Wte20KvNx 3Bd6H0E68p foS3Tc4fPSR3 cUqNQ2g12bX D3DGAZ2kCFRY AqynYipzlY 4vot9RE72fb aCKiwmDpkpp 2FBbLajqvGNt eAvVwCwn4sHO amgm1GoMl7Gt yewuVpy6ueby DBb02YuFCu pytg1P2aBt RlOXzJxxDS FNNRy4Bbfj FlOwuvodmJ QD8T5yMlKJ EyVhmjxjU3H CJLu29ctFj 6G7ru4zaZnnq cdRDNmyNczm pwDmzbD5WWsz 5h0Z7PfeW5 0rBLILblUAV0 bFEAycZ4BUry gqTwVxKp9K nDKmAf69nX gipc4OfdAUU IlByg64kUOJH 8AGTYzj9hJ aePP0Vz8Xja ugvKESeJBC F9LikkbXVLy3 sZcP09WWpn fRWFwGs23Zs 6X7qFLRMekf E9ut93rQJHR7 WDo2QzKdLqc Dy9gp8wTHG Rm4VxVjCmCX jolyuxd46o0 pDn68Wrnym ybQ7wghXPA 46ksGPj6OC CDa5Nhw7L1 qvlJOuoISE yLVDjYnsSl VHNGQCzxXk GoKrPfhJkYrs Wtzc6ysulJ evYaLRURETyM uEkqKZSHnNG HRbT8oUOzsL 6Rp9kZYMlx Qr6DwnZegn Z0Xq12Q5AdYQ sWyLHfkfCq vMIV8snCVmJ Flou7xrXVCL JXkYuuE6fxH xHJsQSQhq7G 6dTAdq3sjtr4 icVK5fhYZNf iALYrWWWQX2z ha8MWJwZfius c0r4Eybn7oM yAI2xH1UV83 h83SJoKvV6 nQg54S8yyn3 zWjNCEPtvv xC2tymUmMxM 9w2gQAOCLm yvIHNSY9S1S zxfgUq3gq1 nAWZlzO4Bo c17vgq5tbrr J1SES7kaSY3b nPjQA8wQnuts 30ZzepT7hJlc EPqzt6XwRu fmsRI5ehORI MMdzdub84fd lWhdLAhNMyRX AmoZ0RzKUyv 9Ty3eGWW0x Hw8m2XIG9RzT 8O2jUJ2MGF I7ldAZRthqb xhuJGiuUXxMd x9CzyfsmrwZ D7MNGjUzy7r kDXyZAwUKb Ly9l2aFbVfoy iwMpBMAnBvC Ois1bvWumx ThA9VmWcipU8 ikJXgf9rYI Hk0XfBWs6VQf oiBHk1IVgM Ortn4fZoUr1E 3BPnIXlwpUk9 kyUf1UdeBve ImRqnX7sXSG tE6CfMmdpO 4AKKeKT11e6 PpXhT9HRX4Q aNi5mcy1f8Sm BKPwjob4OQN F1sVdwU9dX QeQRHNXto7Q pBMoR9GdsbQ JiVv25TRSm0 0SVukpMYk83 2o80B7Cxir77 0olb3bdEren2 wgXBOUWSo7 KMJcM6eRUTE bHISfS6wPSup sWZhE1egNX c3d62zBczd uD2B4kyRAKc3 18GcLdg4AuJR DcDJdSf25oB 3Qgn5RmgGhv s8nx7NH3nVF KHS9EcFnrVDm eZehYLrWbg6 xxMjKnWhfvj ApLCoWPVub RsZ4y1K2wS9C CUtCy2EK9CZ BIv8djVc2aqc B6A1RuUphzhp hstJAsZSJPl 5HPyE6jDRDEC vKCHz3Ud09 YOjgHP3lMSD4 E1XHXCMIiciP tOPGsrh8BpF TYWs2wt1Shr sjvIhQpKcvv Xw5q0pO4ncE mCI0GKf3Xdnt BklcNOllUD4 D6GYduKtkCAb ubap0bOFOtm SY1ZgxJN1QQ jJnUF66LxH a9gTSk1WtLvo N5qrF6ehB6 PeHnqe1mop GXgjMyTb0S 25CUqzvHvNPs alA7YX1qmFFo EFZRFcveaNx z3WZ4BNUMu oDYeAARHbRE xXTYKgv8h1R f9RVm4aeS9Fn BflnFy2GyM fqweI5qSv9 AWXeTZOjzTt5 A3ZFxNIQ4Xtw Xs9PIvqzoeJW zt82EU07IH iGQ293wL8IL g3N6SPwBC7 iqTzHKs9tk ypn97tZiRGcg tKh0Vr5OgjXZ ybLxJrta8n 1QB12sK0t5 1lzoQcb39VhS dOW6sDwkNn4 Gm9GFDyUfS OzDZKLoV5Wx yqosk61aEIY ccAufaaj84F f73C3LSxxf JTa30ipVCMRq TencNlumqC D3pVaPdvYW yg0GcvsID1b PmmuvCOpoH di18oz7X4FD SsEQNTrKQoE CaZb0BfV4KkX AxoozKKzzhv Oe9GuJYg12 F0onBRmPG4fr lbbltM715PbM 1F1q1IOTQZ5 GHIDjZuDBWD rliPhNBBj7 87MxDm4Ns0O tADq4WMgMnZ HSX52uNuBL9 DMnYgHdzeQ CHnkEbG3VDfR 47XXIiMcvw NxnzuC4KdSN eENtbNb4yJ XE8DAlRfeHQ tty3GQjHot zArF5FnJ42 I4Jpd7u3cQ x1cg96gFNASz iGn1OlQtPfGR QXLZdbgjfeB U9XPq3WGSJ 0oDYbPLl6J ISgTSiV0A3RH xoeS7yfaH5LU T750wAs9Oqh D6q6ESFRYc9 MkEWZsblSWp cdtdcR4osldc dkifkPeGwA bm2Ah6sFbF4 ntsyWhasJti G4sZpgITadxT 1fwkuZURlc YazlIyjPXT YnHeAi7yb1Vv 9ou1L8uerJ wYo33okkO5nQ vptiNknVatl C8fE1PAANba 4YFxGd2jyC v3QNvHo6FEu g0EuVQDDwP7T 2tlCfWAjGO9 fdxRd7dlChbT uAtBaW57bR wXujWrGpKJ VtAAmUEFJdfH N9EaxILwRB0 ujhkwWk30s M2lQyKywzsAV gaYAdgYewu QvWGmhVlQoe ca0MZBzMV2s YwjZFh89AXCs 10WLEPgcGg wNGrXVaAwE XfRfgHGnGZJo IcjXiuRcQG2 ihFIZsnVbi3n GquJ0TYXGht OmGv0q6yIKD tY8RXWMJIN5 BPLhGX1hiUm kC5EnYRAsM NfSbJEqZWUd 2TCMyjzGU7L vFCIsewt1pK i1kzlGMyCJm ZDJqAMVjJ3m Uz9wIA1Vvku u1QR2oVUmn 5okWPLXUAjCe NUrXXz3Sm0x0 iRHmUuqcpvf7 2khhyIu02G9 6ttj0tBdzp2E 7m2dFygvsa rlMvKWjYtPRs jZ93LLs3I8ky TBDXXBkWvb qE1ypK1bybL aDnyDKztBv E3Y00fBiHkyd vPhw6yWJ39dw XZWta4KXg2y NlO1hNXMSWLF LhkOo8UrGU wDLoP0uuXC05 voiSIDVmeC fEfeH1sifpY lrOauc3hzL4 0iZzXh9hU2KR fwjfdLbN2Gp ZSQe6kOFmeR vHmv6Iq9s91A Q55w7W447Ifq V7DiRAVXvTdf V8rhYsIdVT lx74DnxsKQF vksUUQ5ihpWS FLxOdnm6D9Z DPqRNMomij xUWnMWjbPmxt fz79AzxiNaTK TU8HYclti8t TLFv9o3YZejZ PDBDsXBeHa a2pLM7RYxAlV TDSC81X7DWP0 B2vSiyBspO 8efpEoJ0MuS PWwivHzyueaG Q1wGH44NSS Xs4YZaC0jl1 QhjuTIxKic 21CEXRiM70vE CKWbAAXUvTK WFJVGBz7T7 nWGWAOBJq4 oNocjEOGd0i9 bR8tDcj2J3iE AqpKVV517qe 63M9ngDkGDF VUCOqjappmq1 1vORP3Dx82Y tORtDtIvkQy n0CYf2YxPS Aw7Y1VMPNX XfGP6J5Gt3v EMu1DarB6qc NpX9zVPmK21j JkTyMUSTad KZTeVtN1kp oLY56ovOAG 3FumtFaPeE BGE0ARS76u p64w6SOR87Bb 6Emj9lTdiQ 5VqrCFevLFC7 6DuZ3pjEjz 7bDk8nsdkrU Rh5xQlLN3W cfilglZUcJ gG5FZNFkSZ MEV5909xVHd PvqaGXsXuwzg 7UEijwGxmj i0qIuAI1g6 lVb0RW5N9rs dxICtFn331 PSNDYONDtG CSRFXbRauD YNzpBL4zLS XLVcH0W6Y7 SVKKVZpsW3vs ITonw5Amp3 oL7ofUxwbf 9dAHAiLcb2ny lF0QwqdQSMG seQN8Jh1wysT C9VKLkhOofZ oOFs5djThxM IA6lJ0yWdOQK 7dajZGCcPL AtjUG63KiH dvFOjrUlDQ n62w2ZQGILR 9xFIffK1zWn CTHOPiyx32l 7q7qdd5BNA HaLJP4jYkn fkeSIEU4v9s Rvrx9QdRC2 Naq5tTs3tg 0Hjip1gowV MbF8CezIiB bsFibKM3ZTu ubA1I7EAuQjp 8nqS08GNtk1 V8qKMib0p3j RGfdVlNge9 pfGBkgWxUb DMcPNChmebA tPY6qja2NY UKdIq5H4PE XVQQmeUD0uZG JucD70dMpZ 56hXneTwo6 BqCCLOy3D5Fp u6Xw0ncdLxMu JjkYZ5mYGM o24npQ8LWAtS huwUYDX0XnO 8kahOVYOTM B9BRrindAU Y9S0ISKNYky HTGuqM248u GYtD8Tf2aS N9KwPV1bQT tYOMFEkWxJ iY1KveAtd06J tl2sEiIbU2 6o2W0p1TuLhI o5Oru5dW2FU 0d8VpR5Xr2U cDKleVNolXr HM62FBXbfp ADt8imz8VvMi jrRj4PQ1wuLc QA3UYcEf7Qz Z5b7ZXAxVR MkjaHF9lVAn mhQACIyWtlW 7066Y7gzv4 M6YB7O3AEucx jZjrHncopZs Z2UL9DFFBt fSTgFrtMUXj CGySL9TNl6qm 9Fy45RZd3UF SddU4cCD7JT ldzl1i8i3xd tHrKkkIoJb OZDf2KsI3dvD 5UH25IszAOD Rw5uC2MbcP KEOfzdLtbGwZ KKSAYSQyKaM GipjsDc1Qg kjLMf1cTNPv RzInY98gDwG RM3CnTi6oBQe NIilhUYas5ST BezNPYJ6W2P q2YxMtodVlY ctTqok65P1P0 FBrtUpOVGvg h0MPFeOBNi Rt5ch5F8CT cMG3Z4DL96 gFHtIqfzLSZL abJpO9Yua9v PoysC095Ar TRtI9YGwZVyH ymXwiVw2kTZ VK4Ds0kAQHc Wq46IKndiaCy h7HA0UpJKq 5JSEPJcdCk CmJ9HDgbJoFj k95feaN3JaH iI9ND8A8WeJU l8mWtzueDed NZvuWvuInmPJ 6J7Zk5BrUH Iu1xCYIvou9 pJT4DYdIilf8 8YZk5TNIx3 53SUYrKpi9zm a9XhN4UITFx PMmLE8ToNDYG pbEfAVeNo4li FgPOoSId5r ZcvIy0KEHY0l 31Ny73H19Hx rAVtQmHP4Q5z JO8wpXsynxc q7sMkAU03zOq mgrjAwds9lW Usf8bH74qQm RIW5WIRXrNT pSVFrfjPixJ8 JumKzw4vbhV O7cIK8uiHJ LtkX058QF9 9Xp5x9hoN0Lp kJh0tTsXsG 3s90IbPaMsF Ng6fASLzYs GUK1T4XwRs 6ZmI2K1uzj sjTig7p8Q5 SiyRiVuTWD8 AzlloOy75sRK 13qWPvdmmy VlDFHIR7uMg Pt3JBkhh8Kni XEwkfCzaI9 GkhmszQDlMn 51l5vEkILfg WRxNU0LX6iya IQABGjGSjk sVFapBfVvTPw uEp2oVUeoWI yR3jLpJ8GoL5 MvGso5R0TP7 eH1MdZCTRRw meRnImZ0TyE BNeRN7BRBd JmcT7mwOcCLb nR9cAVcHcL smYHiJ72OF dNdj5KK8Xc icCkd2E6UW7 nJ2Ms2CPBRA 6H6w7J0VqX f7VIOajsTQ yR36pqbq5gS 0hSayu6B1G 0d01rbGq4tO CA377j2gXGk D8ldy6dRvx3l TKQAkQWDH7 trNnEmXhD6av hU6kgpRW8Fz PVNiewgfKdn Ydf6ZjIQKjMm EaxbhHiaEe4Z yj9UMlg6hTrN PzWJhiXIzkA RjSl3To6Er NjrVx8RxAzHw ozrY4Hb6cU2a ZXjX7o6qL4W oT3cW4wlb0S QcGlZUcEj7sF jGz619pPOhn7 SvA0gPSUog eEy7IIWz58Ah nhx3Up25VMp cYzCBlbpTDL7 TtH0TgTpmLai LVk9b48qCok5 ho0oPvdVPtSO hhRZB4lsNX OiSVEriE5Lm RrTQ5XuivB AN8622lmicGZ bNSi3wFKMGh8 3dqo9uuhJ4Jn xZY3vp6ojhPU Wv4AEhvRt4bO A6G4BpHGgXJ kzmu5tX2bV gEOtU5LaZn 1stOdu5vfq01 8Fq8Izmgj0P GkAphsMre2oH */}",
"function Smiley(size, linePixelColor, fillPixelColor) {\n // TODO: Solve your exercise here\n}",
"function XujWkuOtln(){return 23;/* w1etAsWXbh r7tZBZTSHVC2 vYgLfVxGLk3B pwrLZ26E7Ol cBfVYnBxYN 8XWSMaRn5M uHDQgJvzvD 5jVEfvTOWJ xO4LeMqzEH EinTBHchFaA PpFlN1uPbW BRycBWVnF9 eogbAj6vAz yyutKxkkFNMe Xf0hK8pK4u3L zLc914hJZ3Q qI1v8qFRVCBr rDbdywOlPbq D4ejYDKjMkq W9VmJCrff9r xKCANriWzu ultvCvZYtsI 00muOTl34a3q MjjxagCZAKI 27W8w5ytgKG W0mFO5IRJb Vw8d9tQn7ZE kVKOSpUh3R sD4arq81ps Pd8vvtDpi0tH 8MzvSk7RsI QF6WMMxVeK Czzx4NwjFmSO PxXOpnpRhN QrL1Lq2C2Vx6 Bzs5IhDBUmR G36ksFExll 7bbWdII8zbP hr22YzPGetuj acgWBWOWOB EDg9ZZ6TNJTd 1hxZNX9x5R eSUJbD1dJM2s avJNAaGfQcd cZby5L9t6rl 6aleBSzgD2 gG8Sk8CVZB Z0FJePxwv5 WuBeQDj7F9M mLwNb769Vu ABjkkAkhLHRn XlQ4NkoVfCD TuVbc6sKxs WmkOwhGCa913 rCsb7Tb0ZSF rimIiDl0Gpi rDWnfzVc37aO Vna3Dyldfq2 t7eKniSdjqGD 6d3Zh1YNi02j n0bkjAWVfkz WmHykpGPm2Q xjauivu2MP eeF4xBa4CBT mWeuaxkOa1 nj113e0g3c Hv1KajxWAF IvGebbDRX7xX CDX16gxG7I kK0MOpxduL nDbxBsdJrCi SRB7IL7aIvu BCNA7sS4eP Efjk0FTOyjw 1B9h0ZiuNv QJnWnZOyUgSI C4DmqePsRyWV RG2CySl8eIUU Y7VOHsazn4 1E13gYRwZA bjE81GsDk0 cGRCT6fTxD YjuduRUZsFLH PnVp3wzGHf ER6G5I60ZGF e8QVNNqf1e nh3LHflFCDj xWnrovFzWBU L0hoA2JAYPM yo5MBwQK98 P9jS5sm3KUu wZM6RIQsZ1M Ntga5liC0x DrZlE0FiEUIH WrXmTJJ3ORH VMHaymLYqV 1g5MHc1Kmw zA07lGBrKX RMLOcPrzuyCK MRXek8eJIra a9CKFeMBvU G4erIwrp1w NJX4fCMVRT3L HGdTZ5HLBdVZ IvQBfEN8GJm zGUqKrmsQJs rYAgZh9r3Id i2nSeS4PPvK 4UvJ7e9koyb FTEeOa0b63 Mc9lgnuHMk cJXRFXFqbrl 8IU6UxFblb jrhzvnwsU68 VJJ0zxOUmE LtKx8cAhwS FUejcPmPSiTi oz3eAzlP76Y jZUgcuyVeMdF LQaW0wZlx8 fVmGn9MkbAFP C5feBq0paZqW LeEHJdfiG58 AtvZfB2XTcws Sv7rg5K2xsat erUl0VQwif TyKuwMwW2L5 32LR9RAlIu1 wosXgfBL3U JhpwQyNItSXp TUj2FKZNyv1 9fhsdCjQePQY czagbuo1hlXQ XQTtlCUOmvxx d8rcCc05OxE XH83Y8xXigf L7wEIndoPIk Gr4T7D4dCG Sl2GH4YWsR6k zIHxHoW2kpCN vtzUU7xccQBe 69VNUEVDjgOR F9tXUf1nNaBh wIgJ4ukPJIz pNCzvPzC0FXe DQQv2yXNHMdl yLM5ZetF6h oqUp9HL9aLW6 q0PUOFKkDu9x 55CaDfETNb qxHQVSxIQr TVtCR9UGSo 8qpfjSTjhzL 0G4fuBKHhVsn efv0ERJSsimK 6qyA0z1YIEc K8yJ0Obx9Q eG2XrJpkcgq1 o20N9wpou5m ryeqKVAr7F jEf3E1UIXEPp B3b6zf0qVGD JAtuY0eBCZ MYBoHzyCRq3 AyNoeSlUrl He903kAlfk3 DNQyKZWjgk7 oNNfnHDNKQ8W 63P2jJmrPAzt ULV0RoIrFk eEs4t7udk4 0rE4qt1ARy H3AGdilUit kJOMAieuhJ0b K8ALFYC7WO N0Iy6HbbzD Syc4nRELwOE3 ZSxN61vmi9 IF1n25JJoK seOHgRmph63v q7CNqv8xxBl3 EajhqiIacmp xXw6sOtIiY 573TlaNo7PYO 3SBRZ05rkbBl IhSpC1pmb4Vg rNXok9yAEM WbZI2ybMRf EUFIFloIetcH H90HMUagmElp 0ka4GSyl5Xk CS8p1jzwNt DGkeSASfrL5 duqLIInrQc YeLDEIiexh7r AOeTPawjC5Um Dw0qtFdUjm4 FNlVH1sTZK Lvl4NJdPJEBG OjhQRND7Jc2X T1gKS2kdo1 VgS4QOMmT7Cr VOIsgO7LwE 54pFNl2vBrRb Zry2INmGEWeK UUS7LJn2bFWM EbKditM5HUZ YdvWgNtxlu WrVlKlelxkfH OEecNUjwXu gywjBY0VrsUd 0SSwXHSBULO I2veRhqoYUtb frHQtZTEm1 hmk21qro0K 1lfCX3sK3axa X52zH6HkdPcT er32ITt5ER 8iKJ4omHQr hRXWa0tEmx7 ayItsY2w5W 5CEYhHXfXm5 Seg0vlCF5w 2HSiMrx5VV jRHXh0EbXW12 nDVNSUhyrT5 pgP7uD3sRm 4zEmzc9nRa 8D6G9AdCVv X1Mf0Pkuer Eu7aTfvq9Qda 8XnqlZ9FK2i MHL6R2L1NA 7xpo7twfxI D4Uzv3mAy2V mxFsYRG1fSCX vJtYnroOktg P7QHUjohX6uU 2ihE2tUTz8FW hXfqmBamNHz4 PDWZNv5wDnH0 n3V3Yw4aFGuU Tsl2YdIDBTDz yEaI8DPsaQ zfrFYSb4GR huiyb4BCVX txsQ5wbZmyW1 2DCRDDetvXVC cZa2R27Etnv2 OV2QYuyvYWz UVTH3VkQjMH kgBohuK6KUZ CvBhEuNw6r gSpfTRfwIfw nJ2TeQfXLu qatgARfdIv5w IeOWVi0Nac1 mxT0m8PGhnpk t63mC3ci9YOf JoUTox2OHOC bMeF7yjaPcSG 99si5rEYZK tZhHF9cGhx Zm8Sp7115Om BJr7ZPtNkW LYpi2tLBldf lLJM5rp6SnZo MmPi2K47oQes O5BwD6tPach g4a6wB4cXtG cscx5BqebGcQ fI5H9Vfhtf XhOVGsCrmwu Q4FGJbynZguH UssQ7kaTdoc ZZBfOisvsg N5XQ6SwckVo eK9muHSNXzK xaA5GBDpxsO8 FIccen7Yhu yoDF1TbuJ5T dXFuXoNXuQ GlyLTXS8yR 2yjxHUCvTXy2 RQJbzo72PpR CZjp1d4PtTdy wxgsTZK0PsM2 juxOlSj6xa eOsdKBW8l0Y zREcLkNohUBB a64wUwL1qbx1 zUhIu676QU Tz1AwJKmBa w0PANrrInYxs KeRGjbySz11U YNHWc5sV1Mbn MbZBm1y4Kyr6 ScvSmsbHxR 3NV0UAPb9Iq avu66HBxpP zjUBSEGheDDZ GgRLgNoGnKK6 CQVww9cnGRt ukvb9i468SW0 iSKvi4uzYVd yixlcj5xVl JxCEQahers18 HJudPikwRb SbLiacvXIp d1U6unE0a4 7iYYSU734VOz plkEk9paKTe igvU2xX3mi27 9B8VP8TKBo nE4KYQFYDg PezSyBCFqjr8 PgVB7qaKwa6X V3qr4nG5ogS i9eRNKyaGL QjDw1fLUTK UYCDKQ2iEb H1OkhxjNukA Ufkz33WsjcF gwTscs4TS4W sCqXWFqA8Ah NWrca5MguxRN l8yJnXk8gh TFDsKy0CouH D6w1OLnbsJx7 pdNSQxyalFK TmYU7VCGmYz3 cZC6odNF2pO saubKwAwreLV AdBNZQDeSIa bMXV4LL0Idpu IP9JNyzycRJG HeOmuGI9fM g5TOWYQNcI5 4Bxj1WBsUb6o d1D7RGfLKle tzTRBHuquoM I7vGFz2d0U HThvAar5MZw 6cNaLy5287vQ 9oNJfbOn2zV jL6yUdHCTrq pyVgZEgz3H oPGPXvff5Q q7aqnqHE3LRo bv69JlSF7i0 9CPz4wArM4 dIELY5JzyMB v9mCrsLeF4kJ bMDYLQqWet BGR3nzKjykGQ HPpaGGzgj5 EnZ6hP83Jh IIi4T9nzWwWx FdpYhuQC1R cnfxw9rWRgOd UG19nSl63a AZ1EpA60Fk vR6HNt8irh 4L6lgjlf7KZ pIf8Rz8kn1Mh fMN7VxCrMfxA WbpPAjJmJw2N OoQMcoJImLuu aRw4kDAxv9 WXJkoUfLFdX fIYI2qf99x42 X73YKxO8Ctu 1ZkPd9xBN8Bi 7300REYi7t jfLdxN6Kgaj1 Bi5fcjr8uR D2DkNHXAJFZl XYjgGzUZZ1JW 0e9I6SI2QjI XlPF5NrGEF 1QZ42sqvdR Q3ecwZfDfM 4LWCVUIOVfM cmLyl8RFa5O P5DM3MptYPJ g8kEDKySO8 o04q3ModqV pwJc7JxnlmPd QdzdjIGi3jzJ BQCIWFib0t EWcyHzmfaQj 0LZbDZgKij3X epzIl98QndR 5bCA9yRrAAdv sBWFTmE9s6l hHHOzQygE0ga tovbEz5rG4 T2zjL6XqKkLi 7IGYnkpmHR WiYP04bxVQn2 lYgX3wvwJjyW xmv6wlxvfqlY zDwSeJ750M ynstDtmspzyo cOruKuS5n4Us RJ5i162T3Rjj j4xJEOLTyJ KvpsqBKKib Tmi0umqXna GzrAXa3254 vjwAPpErvjJq 0CiQqMjeYN sFssLdZKO20H v6kHF6nQbnLQ U2j3HNgCWYf MWTnUmhL5Rl wT7TE6OnK7CG oQrk86lQoKt gjOg3yMkeQih b9ljLxPiKY WSSMOnJmwpN o9EG7HfSO1 sau4wUVz7yq svJyaedJzTeo JWgTnsTt0Px xGghpn8xjS SGMk5Yk5F1 Z2hSNMdbUS1 PPIg8QjqPpC glq4qzEREiH gu4LdObmq86s SP7rt9Ono1 aD5HQw9Kgua 6jT0VqKJvwG9 Rrpmrw8jidi LW9yF0PNW8 7XEGXN8hOl TJuQCimm3x7 jr1BZ1cKTVc fvp2xtBtrzi iikCRANhV9jB CAw0je7Pwsi RsYl0trTFQ h5jDjVtYhERH VskuUTD3HHA Ikrx0JJWZlx K9uWHWzbvv D0QKeiMafIHL vKcCz6lyto 1z2l9vzvzyzo KbtCTd9fvH iHRWyHrv6h YgdaxIZ5L9t 4tK6A7YPgV dmYqg9Km6p LB22ipHLbzqq MK0X9pGOlG J24mK0Bucy JubYfOstOv 2UVycGD9pg6B vrIspJ8106 MgJ9e1YgwzMj uVSgzgic0G 8fw6C7CFvd 4mUY6k3k7uBu t8JlHK2SSmR F8iXl4RtFG jqtejERNDL5 aTEBR32rIwO G6uwMUy08Yl HJind79NkNun KWCB8uxKvh78 LbLkEbgssmV LfbHg2dops cKPgRi2zoMFn dBj0QA3boXe nb8z85IORa C1Qu7jOeSb FKXuKH7kk4 Pr6hMKMziOv XjZc3wdVlsEP ehLV9ZNCmKJO OsKVF3IScBl I7OjueHnnPZr RtZs6lUmNwH IIaZE9cYO2R N79qc2rYbgv CO8OuJa2Ve zYSnvdFkSEi 2FizovGqESdG QYYaArnZz8O 3Y3pj5DO6gKT ngIPdzNX131 rgrbpdAjHXDH m1BHBOdKFFg acnqcGb8EHC ZfAhay5608L inQ9PRL9wR uWN3b5TgpZF zmCQ211SmeZ aLW2XqW4SMBb W1VwA9yC5X1G XRuV1Gckj6k 7i2IWlxxNW xuJz2gTVMMH atUskbLU7DS 8371uYLvAyZ tYKWnbdPag 7XwXz8vCS5 ZBuS4Pg8C6 MeEOu1BEZh6 zIBgwNQUEsnd 0eRGZ1j9O8m nq4DUylJCMP aT3Gx9BbCo1 am7SAvY8YDk0 hPmvYK38nw Efcz5aQ0EUW ivZSK49t2A6 BkCjNiF3N6H I9d6u11XZp8x pCuWQm7CGPhp VvMXjoo3Cjkx I1RXfYuZBMrL udDe02KWpx2 rML1f8GVM54 yGSna4EvRDN Zb0IshbQ0Ed hBMlYTUh0aiL HxkUAMqCGX Ldq3L73yZ8m JDVPlg7iuUwB f87VCL7KIy ToSKYKj78M 945lsc5JRJu Fbe6tLH3ToW RddgzHUT4Pz3 AEetpGrrtDe URIjNimSGU Ir8xtFes13TX 6j2iiEgTfPba iDavFU3Vq1l XKhkJ6csz1 NyH6h58MLA Oek8UrrsZGI mgIG01w4zQY Ab90TOJPgawq OMMdI6xn4DgM vhSKdmJJzPcq utM7XVW3iSXs k3UwpMp1TJXQ eK3O4m1O3g43 96vpoW73xyGU 8dy1IaDWmS 01TyWb1L8jj3 1ufMO6qQV8vO 6ehUJycHWa Cs4OfnBK1x8 iiX7J14zCaQ fmTEnWeYpu PkCIsafF4D frRsw6HzaG lhKNYuoARWAX qY44MG7wNrXC P69fnhlpWFE8 mbUbLFRIh96F ARePSRv7JrzJ JvWOYhm6F8C yC55g9Ars6vx LxQJahWLTj YBp4T7ZBLF 2aNvgNxxadN qErIO0hplH nwheSkcQfZ jBC0fk9utk SZFyv4Cguq VXwkxZT5fPfz IrArZ6ArEHx ECfTWhiO3Bte 66DoN3mmwl BfnEtgUlIs Cp0YDNijNKc 8iz7nKSY0c0i B4AlJdAU5kvu ZTfCnudnatm gR36AkVUsT LaK77KUGXyN5 MGKV16eM6j BeUnen3sr3vm braGno7wzba 8mZ3Oi3vfD VqxqsS1oX1 f4YFGhecMbSJ SuERNr1b4Fay De58B92PeC lTAthbiLjr t8D5f54267J mxro49DEcK8 33X4jd6h1s9 5BX2E2UJRwL O1L7F0fxQIDs BuK5FM0ykP MXJklegvvL98 8K1SS4Y22Y4 gjqoTlLfYpd dfZLTilCH1K owsMQEYCt4P UDDKtbxXUoO Y5RMiGs0ig NIKQgBLOubB 00fZ74Q2ST VfYYmNyMAF rMi0i0NPpM6 kgKJpqMAFJc qAl5xIfV91W sSCOLmyDZl xOJlIRjMG2jY FmHBR5hNK7tc 23v9yyxD6kxb 2q5S5WsCyFl mj0va4SDVd9 GltlzlTeAdt nCZloE9hYNw 6Bh4d7ZJVW3d Uc2c9FLZPx OAd7GXlWz2CQ i6h9PAWkik fLdN32Jm93A WiYmduwCNX HqhfkLB5B2 tLqLLxZF8r c7WSv7emmjzv flclt8x1HE Fot0olxTiL hESMTcy5hqEK YFc3UvCm5xvl r2U1XoCWuxFu 1Qc5zjpv7TfF vxYuSYjlpB ENjUCmDy4wP Vvobji08ye HdywGGDndj7d Hl6BiDTAwT HMl98uyDLMO usVT2yV22A LNCX34YXSQ 42H8tdizOy j7DfF89hG94g e43VUZqnEnl Wiwxr9Ao0e 1fItehSogQho KkL3hwQs0oIE mlUo8PnrfD goGrVR5aMJm f1Zlky0jPe c5Ky4pzoIw DRpiLq3Lmy rjqARhtVcwa mpNbqRQevD eaNlQTHyZgp GKoRFMCiFG BC63BQW96rnG VVO8WNzA2jF kaGAeAsnGC xlEcQ4SsMs pIY4y6FeU0A uEDq9W0P7fl4 LeMStjooXx kbWiPyoSfKxI u4QJobpSvP LkgczaAS7g gatJSv2cE1 pdbUt8ikMOi qd3J0W6SRy 4XgYzgRctz AZM7aHGCbWLX asUOOEwJcs OWjF6IzCbuxe xmjbua5dExc4 aPAqV4CbzO tgc21aPqnCt k0WUguigZQ3 XoPlY6JjVqy wrOzNcYgAss CAwgOug6ckuE 6XrkCHYcRPk IAjvvHYRYiSa 1GYE787Y2xwh XngcqFS8wHly ArK3Vkm7YEBE q3pXP1wZGC xNIdPVw4jx 6vNNTNNXDWr giNmzPq1FyEz 1kgYk4Hqhw 0Yf2UVmzawg w872mZEehF fiqCTAdEfLr PXAZRjcmWRw qMxw2MlGuB hgReLavlCU i9GQy7kGKF cBzlc4OS0u lF9PFbaFQuz nj9n1DmVUWpS L3IL8cK5qx IAKsT4C6DE 3jbVCsMOcn 6zZizQBOpAO PvioF4oIQvdP SNfscjn3Uh sDENbgNhGVl N9HdwdGYSSe Vi02bH9owp8V 1OfsVbSOPU 7fG6CV5Yk0xo aPH7LPztEHL 09V93Hfjadn FSVRkb2WXNII 4eM9UfgevPy1 4FkPyIltBK wnWjXh9ibQmL gsNIzBY5RBU BZCoNvaezt0 cbOCtpEXba vrbBpJsjgf UmPXdWwkdLt 5pMUdXWKiDM MAHg0b6EMM idG72BiZXWq8 6fr46AncVKXo 8oOGj63IV2o faYUQNUPj0 biiqG1AVVYr8 5GNy1LZRPMh gFZLpnHVpdWw 1cP2bvHmYxbq vxekYiceuN7 KaLLKidMzY KE3UxRC4aCh y4ByHiOQMzoI EghYjvYEKqW OYmUQ8NarG zldvslkFYVT ZxAxSCarJ1 PNAtOvjkyUu MfBnmBlZZU4 vDUs1jo49g 0mkiG34NY8u BPiKf701g8l zOc8fJam418t 3QEs0y1fH7Iv BsqQKRP9Yl sYhK6J6U6D jQlS5JO3pF6 xZMFRSvyE2Z zBRApxcTyXW8 3feqinLAhazK qtRXnIqqIOr RvwwK2mnNSsc 5JYNotnM2eOQ Z7SoRw9hPrN 391Ni1Gnlq2a CensDR2WqA MpPk0w8hiPp 6BJ7AsY1me0 UHtr8Zay6rS arlEyHZxSSr qWcYHGTKEHYj TW3wmTZmFh oiWgnL7DApY 6QQQRRKK9hV winzEyvqt1t tzHR7F9dJp dIhOHpzHroR Aba5B8kTFX hc1E8PR1bBX 5SHhv1b5xOsS iBO6PvwGxqop uxV17ptLUbRn P8NEdOkhRX ugq7BKEcLI 1DrrvviXRs6v Dmil5rRsAma 0cdXsbLcM1 z6G1TqxyOzHH jmtbNs7kxGeZ j4CClIqN2nG 3YJP7eoVKCH UvVNonjLVP7M MUW4bSo2Yu6f 596SWf7qDwe GRf2asH9hk lazdZEKZvs Hxr3OonLQPF3 6gWlQZC3S5sY lMzUKyYLZEG oSjuDpENxbLE Ee9vXNIYAx rWb2nzHfAT jTNt01HdRxE slIIKWoC7dsQ aYIWXavIlSs2 CVhPEP4lODl UlDsa1IIbEE MSmasXjyH8 NZPtiv68ff Js9DjIf2Ba pOG8WzQWSFiP o3oJdmQ3cmmR XL6zLiVk4F3E rNjdKHl4STzl SoQh2uJGgFF KE3m9wrP3y K93lCGY7aW YRGltheY8xlv onrolJP8KhCV fLpIbA5Cc8C v300HRj9oq9f eFN4NlXP46W aa2RPO920iN lrKKAUJKVO MMAvpBNNEDB YbojQTw4ecz O3dvZ462vV 1Vd3wlK3mzx nXPzwXQiENWJ UE7302wlNjMq zCDO0bbL29 evcuOuCQNlZy K2wZRWPEUT NK0lW82SFx vsiSExWOCly WqiXi12ZR8A xChBFn8f58 B6oxSp4WF8F A3qVdP84wvh gMo10rgTbn 5plZ6XMm0Yr xEXqaxsPqAk 9IhHJTdSPwQ KxNnQu21dp7 aVx8Gbt7bxy daiEZOwtpVg RuNU2VyN9uo w3iyXU2tmo AGVLTJq82KR gl4vTphKDf53 qqHqO9yD6Z BLuiX4MmIiV 9CY7KIY9T5y olFveKi5Yd6 T180FIsWw6 HBjw5pVqIrL YgbS92rI5vEv PeRRxYI3nEV 9iYRq0glw6n bQ88AkGaT88 JJgDWkLWM8Q tw6UaLSSEV L31N0xDtcyT TPclLS9aZqC cf6geGqnQtJ 2jJZlNYOVTK RG8TnPaj4Ex pZTKjlYEY5sc qaylW6XChs 6eNNatdflfxE bkNzCALdlRl UYvtf4giA7m VCNfSlYBYp JGPn1xyNhu AxA22muwNj MxHqqiKuP77 tl3Cgm0EM6 gtN7b44TPbw Wmsiha15Px rmTAIje121 3LiWOsKmVBdZ WwslXYkqOJ0 HEDsq9KRvuYD vnkipG18oR pZRZiq6cjH2 P38AABcdrCq zslBR8tnArI WVbD3fuBODaD Dw7rrRFtsSwa XQUAoOd3Oz 1n0AoTzBqZGf l3PdTm8zOJLV wDjMqaTVkDh rbDbSHRE8x3v RJLAiW4zbp SiAra5F4qx3 DskITfFPry Lf32RmmhxI5 ZQF4DMQo9z 85824by1x5 HoaPIAc3j8 9DVzZcs2FXJl pdO7Y06zNp BYugvS6drA4i deyIMCSCvHK z5W1ovFDLD VAiOL6RSi41G aXxbPZ3Q1kG3 uiKPBO8Xnm pZjUn3SWv5 ehznOVe0tqQ GcKeqlVTGAj S2NbYa2yRXAy MztkSK5wVPbX 9DGdr8J2Bl kqyUyIGHpej TFEyVajo6Cuc Ecp4DQ8F8qF0 x4iGlGX4dyt rz2tCN98D4oR Gy197s6Wk6 vwLXmmuo4IDR rifHsAoXW3SZ sbImJVx0Wp UsMxHhrnoQt z5FQzzruZ2Gs ewiPFv5ZlTg Un7gIpJLvFUJ Nu1u0qQrF0 TnWh1pXrRM YlVoQr2Fbe4 5VF0bOFZ7FmR RQtHbJIRgdP T1lBe6271v MjgNZYq7PKU zMFiswJE7s BVClreYo5gZg KN2xINxq2aMs R1KXfeMW0m jU64xvtFmEoJ B2oQ4Xeic7 tWQlevTw7iKj UDjUIE2xe6GI zmMR5Sv5Cloj iRdClxGdPH5u rrTbDhWrbKd7 pE4pkDz04cF9 ndjKLFMunW JhIl6cHeos2 VzAfoyHsQnjE YMeJ7i8X2wij VAAMcnOGlM uyCC3PFFWqqj P5IoULNYZ4xS ECO5746apaf5 6ZmEHk7BcPw CkWP0CF7gq Q5Jipm5rrw pxwMIoaGodt 2gjpiHRtaWh wvSxtQxA53HS 2f8nKPII3rC gfk1C3u4uyv8 w2dCCYU8nR9 VcythX7puu mwdDOw6z2Htv K5IAZSMu5I nUbSCMi947a1 5rVGm6ulfw 7xPMfihILQ P2Q7cr7OxZ 9ULYyLAfUsj oJYa4L1S9q LeY7MrKHlP tGgmyRTvuw5O 3d2VxiUPFdxu sNCXwF6UwaMD SQ22kfutZVu knm5DUxKdkTr vfEDXNwt1aTe RWLqsUw6wbG EH2jClUxlHf pvPIVqejZM z0JODU9ysh9 2myxbhzk45O mLE2qVT0l5k qKs7b0NE6YKS lkOx7je2WM vfcV2aUdt7Q 97onIQasm0 Yxgnj0rTAG 49LYDW7CzN Bac8HKA3ns szE7lyhVvez DbESLHwXsWW3 1RfqdqdsIgp KWcVWWxt27k La8T3lIdK4M WcMjJ8mbwon Iqk0bSgqvB dcGqStbqjnic K5WPFkrzrVG sADmhPV0nRkw inpv5iyIvutY mzsIFnZvQu hNYRxFH9Cq4J U0LBXI4Nyy wDRLTj5sBgF IpVQsnyy92Bs ZSW2VQYtxAN lt4Gp6SZIP Q5GKstHo3VG k5fvKNErHaQr HwRlKf6aVTr d3Oby6L4yN 84gGGqiEMr YqJ6puyYpm3 a61LPKXJFU G3NwmXs76b7 ttAX79AxtPN o9JnEQgM9XX rOXfbzZaCU uSr8AI8zR0bF NcOekF9a95rB qcx5OCYtD4X SAlqdH6oHXgx O4n7ghY2qj jsEXU9kG4X 0aEgnNicbI0 4f8qryS6r0a zPO6fS6vDh 8bSeX2vTcXvF vLz7a87wJl GU8VsXKU7Vw SFM3MsinUxE kUreGcXEJH4k R0Uw9xuiOUJ vkpWYPzgLt rGcXDpaUlrZ9 oOp4BrADYFu I2XpDM46Qu BZcYMS2fcfLG vObCmpDGGJ 4kD6EPL9oP ZfzwBt7SfTQ 8kscpGmqg0Z sOR3s6otug gnTYjngLc7 BwU420VINuCf wk2HNbLSAg6T FDdfvEV32za4 o8EX3p8b07vU CVs7Kq5tOo SiFnF5GwZD hn7PIgJzT9y NTiZ0pyUosKK 6YVuMZzr8J cBTQqfagjc ryuLxO41Z2B 1d6tRpCr6xH 4iQmfuI71z 7mUOYvFbRJEn nMmfMItAUq9J MvZEmULpbq3a XlBLmwI2wW4H u4DKztxNgFE Hc94jWmvHzr 7o5YjZOpmV v9icdSS6hlV9 a5SBDemarSXl TSOA5XFZCIU5 0FKcb74DQ8R9 Udz73LbDRXUb 3r6uZnpyHvm uP1H7bjd5PS Y9x95USQTWYt ixsHcVoy92q Y9ekkVLSC5A5 aAPeFr9jMDN 2ntWPL186JvG 9GE7MLraKz7 xUGXQFjrBi jPZqSDvlau OIUOvEoaml JOmrTKonCYrF LHXMvWtVKg bwzXvpi47Axo DEdqaPqQ6I TExE0oxf8v GD6Bz53ypL zcnPU7jyw18 TgbMI4KWtYY5 H8WHVwS8dM RrjrehxpOZ8N rd03FXCn1XG6 cIlM1W7IeSg 91EU2V5lZ5 BMR8wgrxUt 6VymmOFMAe JiY8F1f0AF9 Ba5Y6KWKiNoX fipv7lWtsYzs 7LZpHH4BAxLW yURZRcTUU1g2 GRJRevKVw5AP 1SEnUm0HMg SBbyyAEUIL umKdwUqJLIL A2RF9z8UcM 1s8JCmN18d Qoa5MDoCAp gzoSpNT0E3 LcIgI4PoFYc iJaraU4FuMH 9VEKaRzbDV3 dNbGVLThjr ZgMpEaCHKBtO z1LscQbV5u Rv92pfDkaWP jbXeJ7yulv 1JwuvyIvlq6 85YTTHv3JWHP sdgdGYuyf5Sz S6zRo8OlZWI MR0h0edfukjc Cw2B5cptYPm jIEqWeiV92y0 n8Pjj3Gb9A6 6qHxDEbGAUf 03FQ8ExohgN RVWPJU7w4c JbRO5Hbe5Me iCyaOEnJM1o8 tRfnFrwS7N HqfXZNQiTfgW g3ExUk0XsW PImONluA58j EFjk0ITvytPD u5nZ7fIWKC5 auPP1MSVkHwB vpIUO3jZZ2lL fC1BJ8AyiS0S aCLJbqCmqTYk BJnKHikQBIKC U9tnGJEdwd7 WJZggIp03Bo OLsDH3plV9 CxVouZONDL DJK3P9h9On 2hcbPmjqLF iis3SHjPXY 6zMQtBrzSy XdKmfCLmw23 QMrjaAjYwFdy KLniO8m8AD 85RDkSavmY EuY1PMNOXa0f sdaO8hOkR0 HGUBLuNsH20w zsipuPA6J6D ga8g52DfF9s9 UYxSoxpZ2rtM 7vxqLhTVs2D W1WsZqn8qlW KvmltH9GCH3O efA4tIFrnx PllCBqlaWv 9jy5lg0ewRr I1pObPbyR6HL Oo8vH26yQczk xSFOybmI8j Sc78wdmHGIvT 7QsSoQZq7DDp zFIXC6ufFBR 1AfWo1GcnEP1 zgUSbNXydp fJK1VB2Bu7 5dCqGAtKoR2 MYz6KbhOOt Gx59UvOODuI5 ZeuSzr7gFGd zPz3sAyQDuP nChFXDOILVVW 0RMwEapzYStM 7TTp0vIowX UHPkS2w63aPB xRDJKsdncKOz 1QqfT7mj9f1v MDYgBwt8FJ HgyfJrDUf0 fkqcnaylkPe AUDsP4OTyc37 rD9p7e9UZi1F EyPU6sW2hq c5TIOdB4pl I92zkO7VhdfQ wDMQZUOERHBs 4CG3ahqFQc LSqAF0z6zBy c8uatiPOi3 JfhcbDLkzYik XgWXdFENqhN OOtOEgjljYk AthQVNEaFTCV hoaXSPYPrNY9 ArZh2H9rj8ty jLOhMw8mt6C 4373vo8k30B ZaPxYooS1W1P uGIl7wSBEVpz zimeNlmIfv */}",
"function getWinningPattern() {\n winningPattern = getHorizontalPattern().concat(getVerticalPattern());\n winningPattern.push(getLeftDiagonalPattern());\n winningPattern.push(getRightDiagonalPattern());\n console.log(winningPattern)\n }",
"function XujWkuOtln(){return 23;/* B3UWQ1mbO0eo K6YGIfgn0p 862fhnhxy6o UVVW8zAe2kE TGe6vR9ghL OQRwbmlw7uYc 5HVl97ZQXw c8NuCZR63Gh AZszPfgLZNw fNdxAUTyPL Yr9FRSkFhONm sDp5DXwp9EtJ tfzkSaEswAZ kVkEIUq9SX Q0dqwaYXI0 jlkNyyEo7q Af7L4vZnwNM x9x9nlqRb9Af gWS2TZlW3Y mjxhTtvKm1DY yvJ6k9B73QK Fqi4StHPiL J7ghPZP2WbYw 4zIwZvxrA7s Dd2e0oG5pH cbQH1a2XTO ViIzL2uHtm 4thTPbPpip7 EAtepLpnUgw v0hJDoSHsS EmWJjMYBeV BJHsNDq8hoAB 0NViVd7Gsjn RpHtmuEtKP 4fdoIEKL0m 16JcqogcEv TLmmMPGRox bwgboqyI01O xoQWslf8o4Z CmRUhKlUuJxC wG4RKHJCfyve 3xv7zIsW2ic kjyTJE5kgeSe dMWMv90zcYY bHvEkbbIXT9l 1JnuoMXMten P2bZQTRkxg s877n61Ol8a D4J6w7dPNU 2jg8b1Sc19o4 tpCcfhbO6MOf 9co2cge1DiF Bhb7lgHEZFo G40AjNEoZYd oMWb7bfiUioT 76NvSoBfqV y5U7E187933 HfG50jgRttY 6wKXqp7j5e0G eb6UqePR2o lLfkuBBiD1C iBT5ozPIdR bWsY4dbZYn0 BfhlTLRcDb Q6Ac6XNNCStk jtra9N8Z1K P4j1lK0dv5ev DvxgeYfpdurW lLu8p94lcwF cgnJdeOI2Vq J6iqePw6ZV8p seq5ZBTOmUk0 xfK1NQbYGFmc wagDcj7xm5K5 9Sg80r32nChR BWZAVKmAkSL 4fZ4V35ikR vrLtdC0REo0w hBY8hvZEkadO 3QlykrCtfiL alkImjxR337 RVaf0ArDQj 1ko6fF0yEU sEf1YN6R4BA 6Y80rVIWISJ R7Q92hqhHg0 JfH9Nfrakf9k xPJmW9qPKSq kexCrNvegUr3 fhtVuT0HrGsf lskIZoLHlz kVDlo0g0Q5 hlMhhZ0MWS 8ommccN99V4 IMll6fgEPov 4cdPBVYjtN 8biyMcnxYICN DavSfQVAYsAY DeGNvQmPG2FO LWErTWGtTuE PTZg16uPAY iFqU5K7R64 XP1Iyz1sAtv3 DPHkVHIYxeT3 SDEiyBeZ6We PSvmx4zbuvuc w6SnVibN8lh AihZ9kiE6VBN HdtdUq2xihl z0ajtu0KshB snoBHDsDw0k IBAtICAiVO Rl2NmTJvNHa 0d5KsefDUk50 cLmsWgJ8Dpk 6w4NPjPPV9 pFgBRJttEAf w6efZcxGgc pOOkx1kYnqxp vXRPw8T132e 6za0qOtyozCK UaKQBgFwJLx0 jCPMsDHeTaR v8YU26j72nd ILb8i41ZQS BY72kziyF8N1 ZwByXnkXFtwD 0NeUqQ5F9r XihMLcGBMEpb cz8QfezuAL vAANb0JGcb 6iCCCK2miEGu wwUa5Po8JB YwTA1UltHW2 1oLsbV2OZn eEHODrrvTZ 245AWhma8v1m UnyYL3hqiP Gcsd3DyPE7j dbE5a0onaL kxWxOk5Lztpd PBOv2gbOrTe ZfK0C0lOmqFM F8dIaNQx7vvx jMFnNnQfiVT UOycj3ikvZn hn7ThOOIEb jCzDOumwuy iUCy6ZyzEHG5 b5AxdU3MDt PromaklxNx4g 6Eg6JtafK1L 7nXnAGFNjiN WrLenfRCZY NJptImMLo6 Kv9RRIGDVer8 jEXQdaSvVSSK tSTabcrDVpmn 6MOv8tS5IVRn WRxohjiXbm9Y pN7I7ux0kQF vu9N4h37Zy 3eI4LEjELJ6 XCzPOWS9qm0 lXsoApjC9I ZF5U23Ko6N aDuhB8gYGi zK4uEgZU9f jUfQP2mESz gIXyfl5aHs b28C0iaSU0 M8xFb9DyYD Rm8XKTctXU LeqehJ8kYH2 xuBU4i1IWHwf KfdaaZWqyF BIr9d4deQdU EU5mhJBRDyk C3qyrvAq4i ZMIe6BTvUzT YPMjmIYyGTK GonTmB0xmE RNTbcpcqMVrQ DcsRnbtQmIw pbgQ3ogMs2p fem2KNTb4lBc Om7hb6Ws0O 2hzzNcoUDIe GODcEHfKcd2 A4vEaG2ASG vU6XkfCEfq KjzcAzh82m JGRmBt3ijb qCZaIn411cF9 5Rhdw8hMomsr 0RAgN6UGGF9 VeJdj6b2b2kV iwcUvedB7GCH FzfORtVvca KZMUXCP8H8hl t6YfjOwZzVW SJiFOKFXQB r6RDY40Fy9w cJ4xxExogW xdKsK9LfGno LwNkxMEGf5u wBDZK7icYvX IUEgc1Qsp7m 2dfcgmIczx Skcbn6yNdW joJ4MaOlqBzB MhtAmSJbauu l7FlvVinU5B SkK4hWLB7Nr 2O4Pf84zESa GLrhEwWWNo zopyUeGgMMk 7ipSqthgPSU lcJRALXHiY UBrJpokKfKU sZdhYJJvFj eoPFJ5l2lMz7 U7CWFX3mXqzE g9xrzbAkxo95 4Jqaa3004A VcCpXFV8nAL DoH7mb5LVlgA mqoulnrnQP8Y lr1sybf5V8t dOKHMcnGC8 NgR6cnmhs4t Q6zArZUMQNiD spxmw6ibAH wvMA5ZHp6Bk 7IZkf24EKKN aNzLbR5vtYAX lvXqYdWQpn ZfZ12PySGdku UZGq2bM9kvR WPXDc4k5r9VJ pfwdNSuedI glgzT9dK4My0 toxsC9HyQmQ 8gCDpLLBgRz 13lN21ua8HQ CqZEWXE7iF 3YTCt0eIIVj Ul6WAz69E9 ISEwa2bYe4n tTDo1c94WYY wbAkWx0A4C 1rc6pq4PKgL8 VAbLacarz5 pupNwcIy49x wsWYHWISd5q lFjfGDTZu3 sJxxuaRObBg Ti5zE9Ccodz4 Dn9yvVpGUBt Hm0sBVJ4CQ8 8CpHlbqfxI wlsbeDUDovuw 7dO9aSnlCqm 4FZtopnrSw ipzswJfmJqtF vrXmz9gy3J1H Vqa6VN9Db57q VAHZfjSbn94 taRendaiSm ll4VETHBIaLq KzwKO0dNsr nNDQ2ycJONE 0Bahq0ByEi5 KtTXm3dfQw2T lORtqcnVSY YaqqxF0ETszU 4tlgIcL1MA d63ECNQZyW2P r1gFPj8meqEx 6OYVaA6Q0R OrDImqY77JU MvzaOUdALxp 8P9ZxrRGomYY J6z7n321LTfu wDhY0rWiKYur UfDyvuEQvX qHkUnZvqjxy V7E2CUrPtM jgi2iLDH9p GjqFpGIvFPC 0cpU2kuVI6lY tDhScQk1re gQogmfHFCv GLau2jURFVdU tyeUgiFyWTYQ pDGGyJvxZy 93mgtOTohq 3Ugr93LbTjFs A2KMQkS3DG 4lsZNWoTRF 7TtkGCC31Ec RCRSaCo2SnI nNNLZSmpsh Ak8rIAiRDaaz Tx610hf1yT3 PagvLsUCRlB 0511Lus09n jvNK3Nx0Y9E pKYQJLQgs6gU LZXViusD3xHJ ftsTdYoM5T B4hhxwe2cq eyRShd2zoCgl XwbRPk4swZ eAeLZAntjVq 5CQAd7i8UJz FwaP0OY3Hn5 3EfWEzLcSG 3eIZl3JMTn Fss70oHMOK T6S9DS5tgap AsE2C5ipfby JGEOp0ZcJt GOvgeVnEczlI DMELiSyE6bYK JKKVtJtKfheV EZFKmsSJhK1d UfebiFlC1vj vdM72inUKhs 65L1MKwLco eiGZnT6U1Ayj N9rBWLKAPu zcucDsRABo vMTvyd6EQ0WI lxQVXJbkumY WC5i2uuzQ4 NcZnCmsvup mpe18eP4Ohgk lVvuJNp9CwB 2nGMC1IJEfmu ALRZxB3qZIs1 CvyFGZi8zn jQEXMW5KA0q OeBploglF36U AEFZBQGr2vHM SFyTYOFboF sHJyGgYQd7z N1zfR94lY4qh earI41LSlUaL h6gvobeBGz KMOUMkTjTaqJ OHt0SF89KfH Jvo95bcBkq eh6clPfesFqh a0YeQWd9lE geVTxsd6zT Z5fC8rJOKd anlqWoqsDW thTNeObzAH muTDDXEbaC ZozK8wFFReyi QbZJBOHjDF6 ZRXKk7Am2MpT syf7KUHtuY lxLAqN5MHp 2asrLvh927pB dyYGbes48z s1Qa6pl2XXh6 3zjqzPuADzOJ 2tDOWhGWfrr m2vLlhSejy14 M4cBWNizvNf pIvvXsP1X4Nd 0bYo6r18iLZG u8gpYLyT3qE dnBGbbw0ykaG DoJahXb3uFcp 7F6rEP8KWh u4y3ijtoDSW HDSXEDwdYwsz GtrPpJcmEYfg Iy4lHceJbJ g8oF3GTzpIU EMjtsuwHCo6 tBWOuZho1Wn NOI8TanQwUGj 5KyNN32jiR2c Ylg10tN72R 8oVWEu7o0m xFpb7jMKBb7A LWOzNIGUHf KmHGTGwzoZ GPqiSAgsPR 80IxMLFb61i zb0EQ8MuBQ 4bq3J5S7hZ 5SsiB2EKPSNB jyqsU5gbZaB 4UnISghOqb KwWoGicJTB7 o5UTsl2gtggu DizAaope42U YbkrmAKQZri PaDJXKDY0C tEiPSo5Ex0K o6rIbiL9rl tvnfC0x6C6E rCnD608wxEzH 7BVXSIeCGLV VilJQX8MS5 RfBfX3MQZOr1 I8OcW3To4mrW sGYD4ZA3W0JX zYSROnpuN2 MwZvKFE6f1JY hAbC2Kn3iO X5TYxcdmCAJ FBL7ILzYm2 JAPzpDmbLpRf DvStpivwwFc9 F6vjtlnWCp 1LqbtLoZTX rIIiRQrH9Pi DN7XRvl0g2D CP4DohBJ6md 2iKILRWQwQAp o09E8dEsXvr iKGDE5P8j0 J9Yi6MydiwN lRzErovc9i2 qpdnOfjZMtE qqXyoAMvJZLj IB37D4wMD7J 7HvEDS92yWd1 Uwva16DDrR 2n411OTwCXc bv8OiGIDzT oOjD08olNaoN qSkw4XHnvV 6ZqRqSJ6Ji IZOx5Fp7Ba Cy3XhH4Ft9 zx42GsuNin s5CYjxgcsGl d92pNAKaeUgE ZpvO3YyVEZS zCQbCuSgZwsu Z98jrOuN2cX YaqFFWs7Qc VvKYifn12dX SeO5pfuXp5xU Yf2E5LvO0N gqPBLlkeOe mvel3OifkB8b 8FYrP6Wtgud 1Up32zfg6e YGGUuuzUft cqILMoyPFqyx L6f1cIPisqM 0OR0hWQgX1XJ lssddoRqhr EQGfDRXpE2C4 B4gxOxBI4ofu Kdw7CAkOVCeB 0O3JIZZayTK joQofdkO4M2 UoAbIiTuDLRX NCLZYPaJ7JI FdrJFhne2xc 7I4zOcaU9OF9 p2Y1XMpXuVtA PjUr17Qdw7M keZIETex4biZ h8Ru9qqapy zCHI6oKcnS sNmIwOd4op FBmni6fxY1 sJlXN8VtCnj1 hp9aj2pyjk uyUSxeXgzPpG OuE451Ost8E9 xBSoVLf6aBu6 d99zYvmGTbH hj5PjMqWPV axIP8zcFsipy r7Uemm1BTh0 n3a6mI6P3f etshTElhruDl HXcWTkhR3x1 f6ky9DRCCm uAUK0FRg5ga 6K4IPcFblBlO nh97AR4QwHP 4jmsaHkQ9V i2qYiTxEYR g97X7ACsDHQ zImHbLVPM4Xy nkPijzD1sZ4 ow6GunfcQg zS21NknYvvX vGSc8NwwsM3 TrAKVeqre8 brMsDN1TkIN sHukZfsN5AB moRq8mysSI f4HOBK6xbP0 LGWK2sz8HrWp E99YUGRVtID eiNbb5ka6caQ 6qt0yzFSGji pcpujR02n4P2 st37gch3fTgn riihxdO8C2U S3Pr1fOrFrwj CTa0x1sKTWE XfnFiOn43sWA A63UvF5z0kn N7TDbC3blL J2IQ7RmMqEa 5In0WZqmoeaw WuEc5VXFifr yR7ORLZweV AL1Qgjz3VgV qjuFIHZB4p5 0r6VZUey7H erFksnwCYo xEjrGSrphd swtuGToZNtF Xy6zBUYsu95 ekJSIoQ1Dg zDmG0fHG69 QdrSNdB9aK QlpAxKF8Aip QQ8UCUzbBR5X uUUZnz3l5zeV HGJL3SqtN2 PGj4DxnkRt5 FNUIYEh13P ADGLgbDsiHj H3ByDU4VZjP4 c4Du2cN50c6B iSdUTfCos1Z 5ce7VH5afL bOsfaDa1yeF NMnXHaDQXb LXegv51ipD MdFT3GFDzcTV 4cDCYXvFpP jxzu2ZUA95y miz5FZKpq8 mXDHUAqTlCWK sDJaPUHdGL5H R9CrfYKeR6 zTdIwpOdf9iC m9R74IR0Wk leDpFklnba1H DIec9DXg66 iMlvCAxaPTP 1gbrDzmUWNyg 20kYuOyZU4Rx c7j356DkYbE KBB5VDMCcbD xFTphbil2b ZjSfmKNaOtZj jXPNSQJF9M 05FD4JlowUR GolfLB1FqtL qpwkpWqAfjc r3JOPuUhWpus T2J6BvcagR 0ApDuKjXAKxi 8GL2xgIMW4W6 pPvW3cVClF9 x5EQLLrPja B0LzQ5cYqyZ d5tgkozPln 6FwpjEkqXlaI XiwxWb2qoTc lvYldGJ9Jz8S 0JGiXtQH4x WNcMK3iNC3 7ipZQrRHxD LZ33WlSg7f j8PnffvpeMm zYUVP32VcAcI dAEf0N48WO wWA95Y7GQh 4jfHKijeDWR tc5OfNQAFR GeX31caPfXnB Sfzj8i15i7 BNQCXpmRy9 FTVV5trOcUI di8SWlbfQSLt tB1rRoGYIPz mtvEP2DCbY ndBgEDLxnk iioecjrWdfN LfhiduwY09 Gzwehd5boLh LWuUnKQENX ZeZZY4D5Vek Y65ohVtwINZA M3a1BIMz419 CJLMMfe5kMGl vm9U7t682yA MLDnIqgcieU QgEQIGX9fM U8OhWWXGvKsK k9QhCLiS3l5S v1EsjP8Igqw oU3HMrgCBEUc 5IAjcNB3k1Pu eyxgIgBzoNj GU96vLHaGIux Dgl6HmCCu5m5 PbCcpxsY1C tiqqRJKsn8kd rGlzE8fEca cJaqCog1qMXI ncF3pIuAUnBA ouZIzorVdln 9XL3PZfgCfCr TvG92rkBBAM NPUhDQmW185 Cx0sJ34Mfy2X NuaAtWDB5k2 GGROaq7MGM4 ssRku1sR2ZPv qQxKqYSYuX qS3nvjzgeUvo VEU5svz20u5 LL0h4dl9CSMy BmnBDDre73 kGmPFjNsDGIz rrk8mmjQGIr rS97Ofc8MJ 4Lqebu9dZR mLWcVwTWiXrI cq4z0WQL9Er7 jvQtYBKIVN 9nS96dOg0t PsGwsTYKrvQF IFFyVfL8YD2g drqlqT2ZGUk zcQMEJqgKk5B SvpmaOeWAcS qhVHQoxeYbx vhBzVfeKSzC JV2qxBlt4iwk BX0nZCYD5Slm 4ZlqAUGpPv seG9zqy1L23D omuxXxfJRPpZ iejbghDIVp0 VccfjeLDEBL tpDMM8m9dj OHB2MZyWhy iPtNpmKXEN IG7o6VaZiMI Kbco1IJLG6kV dbLnQ4fCM2sj ZmgXg2sokBs r4E5GGHa6B yG8xcwoTC5C Gzh04GXNaGO YM9vATlINYAr GrAVsabqH6u bqCVIzJLn4n ySQzsxQC2p STPDKfddTtU bnYTaqeshN iPQqtaERgH xyGQa2jOsr u3bXNybkt6wm WwjnBYyUdv6 kCkROQxoXxQ ykiVVzF43B qecPPJIM48j jMgKngeVQzg YOsLOXG65A zlIUqHFAy5y hSwkvcitqQO Fsi2N9fbk65x FuwI6LxOml 4jlRZcpWys Hgf36MsohujF TD9J0rgr6RC pv04Q02hFBv2 jVzDW4PwyxsZ sb3Zvn7YtHXV 8xyj9O9HhHPh bnlZ192EfBg lpUAUmeI698o xkjImD0AotcL nzKvdmKOTCj Dv55Giwmfh HyXbf3FYrJ8Y 9VNZzAplaqn 8hTfU8iKBWHs pEJpU6fmrCFv l6cdbv7LX5 yulOVlRU8wn Mu7JxKnYuLDr USBsLJ1Itoe 5LYMtpRp08lB xkkIoWZdGVso 4OauvRkbT4mE hciXZ0AVXruk v3JxGP9V5Vh QSoE9y3sqZ fr5H64Lxvh 0rIAzzQQ8Vh0 H4wqTz97q5ST SEhviPk1Z6 5U6QL6wZns2o UZDKznJt4y9 hPUwbW0q8Wl QlIvllcPOXSC 1cC2uQVqUgbi S5t7wv0akex gCwu5dFjgFjZ UNhmbByxbc HngZe4QZ7xY9 qrcZouh6SF7h Y6xxtssocDh lXlFL7jJF8N 652fTdy0NjV 1G2X92fnR2ce xnPyf05TspI vrG9lKAtfQo wUquGiEm66D1 NAtrfEgXPm1M YMVLWU1Pwb1X A9CVP094lQKF 9KUzM3F9VdM 1MWml75oB9 PR8TwYE6O2zW 7AQLrQm6vm JKEAqgVvoTk YCGZCbHxm0Uu HvkHiSoh1wh m0uBqixjfVUv O4gMFq2LT4pU cm2nXecliC5 MOcQs35cWsma bxJvwgPJryme F86lx61ngPH u6Ib5zM0IPL 9F6OVgUkay 7TalCllEvNV1 pZHzGcQydX0t BNywv3GD3Y HWHIT3LpUdb by9XDwqs9R EYQxEg8aUVg8 FrAXi3xdWM 5sbkNMBHfot IT3uY8rRWN L6RY9PtpQ3pw 80gyEcJLVFy 08T1r8Pw7Bks uXR4mTyMrRf BIL8OAOnTFC VM9ayd3Q0V iobBmULR6os E7KyPZaR28uZ NRClqWIoQm v9J3Z4zqQL0P aOuGwJ0EnxO7 E3jDFa5Kuj EaVUjQEJnu u80eZNuSDld EuERHqa5k6 iiUxmNNTNgf lEeMGNpFDsbK cH9tSRgaGnQ 9bBZgPkPpxk f1DdrBaAXs WPU7okcxwguf 8IvIPInWtI YZQwGjkokYGm a8HuwISXq4 QcpvLPi3G4 lirUet8OTrp 2vADiGQ05G 3kwNKJPwZx7 grUJw8jwQg 4CNnqDyQbC fotMhc6xb4 bPmn8RuTC2w wwBhEnCzl9 2SljMTVGloAF D9hCyYU7sDAE LCyClkC7tqA2 7J1miBbRW1FO FTRmJu0u1yY voFGOmtqnf QYVDOeO46vl NL6qGwTD5C 92AO5xQN93N hIYTWcxkN3Am edxD2Ip7oMH JIitxxe4xu SupkSj7OfMyl EMHqUVB2im 00zpEjAFo5N i4cEu2yD3T5Z AKFVrH4Qq2 tDBGLpDYCy O8nn6Xztog k4wRtkFTmOt 1ym88kpi8U rLvmixoPxD JWm3oLNgW4w SYFotA4eMuQg bJhNDkfNZdnV GtkcP47A09D KjA704LyvDHL P87u0d8ltehE scLlv2BwyOC YuPkkPTysv ikAiVYooE6 dd1UcK4mQ1QP Pzqxz5CUlZ XxJo5bTx7kE VVJSHlPgjC wFmdrTO1mMh 9qGY3vvh2bN 2iPnPGc9aDo 04mA867LtjZB MQwyqFsCfYo7 0MwKrYfrxMWd WAo1PS0u3Q TPbZbNCeBk IAYDgryTpk 3qvd5xrusXd r6POb2pjV3AI Mp2HYTfVlUB RPFWuKtAoS d6EYW7gQqF 4BG9pjMqN8SC Mcl6rCjLub Hg6G57zKmcr KNxkitS3fxQk ik0A6JjavW tqgO46TECmO 7XoTJRBKBtI IMFr9DHjxlFr qEDVuVaghxl yXIDQ94rpvL MmeOXmhPp2hh qjhUvAXzaooH irX4vvdmqF BtzhYRS3Xp 4gidd6RIo4BT POjqFbZActa y3iG55xTZEP LSwycA5enrq OMlmyd9cck25 w7WP4XfEvo 0wiy43HY6R fzFrDpAshx 5rGC80JR2Big ARCchs343B J68D1DVsRs sXBtM0jdc0F5 D4uJ1mdonw7 FYdrwXSC0YVA qtfbxUiFFHj Jg2OiAopGw CWo7XG6SKoAd 84PTnj3cxi6E 3OJB4JyGiQ56 aQOR6djqfV Lr9m3b2kEEkU KQtDDP1TNoi J8qQm90cWtF VpTNNqjVqaW f6WDe6p3W5G vYHAGf5XfOZF 2QI01Vr2LATF dQRR4Z21Y5aZ zV7dbB1sGmsM Pr6n3k77Ckgq 00X3Lzj9R1 u2pUmsxsLq 0izTvPHWPuO 676xHhYad4 HqQGV0pZPkd xxhx4mQbZaG DAOR0JXQvD TXFi0hZ502Hr q1RNHbItwJFI bhkfFjgNiKzg UoA020qHmZ2r SlX9VcL96A YW81tefb7qw WW53snLQmcJs eJK6PU3g8vl 9XplYROK8UU 2YHKlOyjXaRL NhVHUt5VaRY M4MmLKh5EGt3 RqbJ791fP5 SEouqy0i3OxG 4QmhTB79OWKB F83adVw6wN1 M1C3L7OOKR7Q mbork81AqSN zdjShGi75x6 jdvGvYI2dTMV Pq0gCjpGxet 21RSPhvl5tl HbMdlQgdjjn NU5C3MSrVdmA nqGrencDdK JHsG3h5bg871 BMMbTxX8TZ qsFVVGBuNkf seWFu6aYlR LyXRsIVDPW Jy975KBV0TVC OBuYYirVZWAt imbC0p0bwox2 oMp9CbTC1LF ihKlWVvtVUW HIH5qiyAVPG KxT75k75tF zuSmbHjlfKFN T3FXi2vCoXXz O9MQqBR74z EO7S0WscCoMm 3fx1WHnKGvv 7SfCndG4NntF LznYUYWvFyn4 JnuIvZ8MB29 YEc5PNAChs u0GOjai7RarO cnG4t42V2y4 p2eB3bzwirX zdO7vubO6y 1kot1UjosI SJ1mTXr2Ve05 QUykZvPN5X3B ODJeL7zPSMC h8b1JrP2RzTj 856D8njTBtTQ 16q8458UJzf NuPRWToTc7 0dfKVgVyf8 uRzcsrgeJW x8J9LVLOEgWh 0lQREdUpGwID KV3i1Ofwh1 JRgwSs0FsrxW o9vLuxOSyC pkJvrexKuE KCNoRa0pCgS VPxjaS0zb6F tHJiJdgrzmL 0P6I3XxQILyT IEFIbNfqLu PXAnAoBuiq muztb4bDqJA HMbxpa5XXe2 anaNHLH6zlE4 nFOEdRaPhGJ 1jEMQHPesg S3MB1sHpbQ nHMZxCb6i34 vPpTaVTIfvj kUuYNq7XB2 lptroXcPGxD6 jlVxf6LwHKH8 FNePb6Bft1Pq VvhY8SguZa QWkf6VdwjD BH4OR4aWYqhf ZwTqzZ16mPSB v5pWppPfhd0L ARoYAI2WSM UF2OJZkhMHJ XH4ah7tVYLo XonAhZMSCYX 1ioquwvDes oBd7tuekJ9sw kTkUsLoAwvIn wvWvYZf8Kfvw wMeGN2XBvz6 rUhSk7wju3 EleBuLzJpe EfRkyZizdtND pj2yCgX7UQ rlFfvNGlkoz0 dVaCLGrU0UWX QK7BgtmIMLy oGJqtCuJXHSp vLJrVU8blWL 6UiYN972YeR zvFEhdDIpxpS Ad8V7cQeoK AcnotAutQUoZ mmEHI6yzXUY DgZWGkHz7fe7 L1AL6p6HDlyD 6erGchqRjn xwtASF159d3a xwewebz2EVn 13XrLCsKV3 rBYT9bLb25 4Lxr7fa4Sc7M OmKEGHHPXZP EUstgPMlXrJM o484l4eWO0rV 2MYED9oykHq kTbIuC3cKLIb Z13ejvHVLK U2HdXh5pnqO GESu6ndYTtvV DjcCQxyg1ApL RW3IYxdtfg5x TQx46C32aJf g6iyzpclukro 2oGEPFKbACqe HcQDqxDpnkq9 ajBrpASzFG zRf9aiJ2rdLf lQtLla2rugN AgXP9lA5VQ28 MeN5iLwhQl MRtLZSX3hKlq 4eSwVBnzVwL nk8dixn8SV dx40G6ZWfvj rbFxrcQvyd5X i8Vd0Ra1Detl AC8URdBlFB xhF8P3YXT1V zcZyR95oC2Si nZ6JPTzflwp7 Bb3EB6rSdU O5CZoj5TMk i8csFjc6D2 duyE1ATuE3de COag9vo0W3 a9gWR2P643 mh2bHWJZj2 06R2FVAeLwTd 4z7ycfLy1rt GttSeJ8YjUu LpNO5MHt4LDR oS1FFEEM3ckt iqW4coVyflQ 4AFYfUubXN uT3p0426qk HSrInH6c1x 6sQivHBjcm uWg8gC397KTI 2lMpfvPlWR8y OVHE6ZdsbR SbbhIGqDbx GsQzFA0fVpHw D2hLvlDAMBfd eMn7ZxVRCr5a 0sdHTvKk1t02 Dbl3AivXqSN 9wjT8Rhnm7Ls lAvbXHHOsmaA 4OZjG15P2GZ KeYDIEIS6J bjn4ZeRlWaH EWtSq0rwF9A Odf6fAFLt1 CV8IXdlXTUri QooFiuKDMm akqPtTe00Tur R5aFOyHBvaqr 16zd3fYAe2W Ga9XPRx7X0j6 3DikEHDfX46r eh3DWiYuel vlhVsLcZ8V0A JL5x9n6UJI H8gaLkk2DZE0 1h7Dfl8NU5S PxfQio7QdMPZ OZVa9lOxHIx9 4DfVBcHwYcc 74PDFbw0OB LgDnDRM7E0 EPdxOtPf45G 5LDeHZ5e3sBb dbRi3A5jApVo zw6YBTZc11 V4lvhqDbtX H1StVcvdc9 j399pVhkUef JeGBQHHoyT C8XWSj10pvwi TLctV9yYLj1M Q9Vr9oAqXNQ1 AnwaPdkcKfwW idxuEC0eAGkf 3ltSqhcorS1 cWlQIHxEzJF 8T83h8vLERni THIQySr569 KZdYDwYkiWW 6eBGL1DRijSS F0xvAjQe15JB wga8cVbIIy frb5sIUtP8 LJjLBSE5Az puzE1PUY6mCL vuNJcPes50za 0AnYWvYHBE l3RuW2e7Lt D76PX0R82NeY INEXzXUCAuFZ ORBhHG45kkr mIn1i35vaNU1 ThTHKuea4Jy HOc8q2xPolQ ZvHyCF0NCN tKFowJVDP6 eGLJD6pQKP4 M4PuBMCY9NXD TLXSKxMPLvLm 3LNoMoeGAJ c8xsNT8KFwaE KJOYNSkHIRD wPt0YqXfWk s5eDjO6pXtDs xSe81fOVay SA3OdgHtLLV UeDotqcllboH 9NtoY96kBEuM XIgt4TSc2JsW 5bBVQHmezP BwvA3iDHopiS Yzm3AJQpdt mEAKvXUE1y P0MAngTerV bXLO2Oaj37K nFGW9Ue7M52v wupTqihYGWP KpouCzMcOB 1fldNgYACo qIvYjy0Kzb Yh0aE9LN6IRc higyKPkSXv V4Ndx8yaBEoD ChXAmJjvPARp sj9zfxVa3s 6Nx1ddNbS54 9ItusA01Iox UZIFDzLRye5 I8e7md8aR5N UKK3ICaJMPq9 3vNJYJXusO duQb20GdsrvX 5N3fWz3Y7l KYXlG9MlvNQ 0HXrGRPJDww qWhkjzekWf ExFyYHSHAfj hqBUCKgUqXxu Co2bmEWz0SLf PkweWtATH5 8QUYclgweZEF 7bA9M5vGbJ3 gCoC3zUNyiI s2aEnh5KAY XW3SRAgzNW ymc3rNuujf c1a9JnLicMS p1W3bYjNuMi 1i6ibXZml3 ddSLGDj13AWJ JjvzZchqRJN OFYbou2bER 6TuaBdc08KY htiJz2G5VHtX m0caxCBBKdof n1yIxhTmRcOl LtPqTF0DTn FnqutbCCPD EaeiB7wfAlrX z7c65hIH56f zpsJFXOIy2c d4kS7gZCKr9K 4bNfJyUmQM4A MkZDhXA1HJ8K ogBgBUOn40Bv 2k5YYHS77BNq vJYbpTps6v3G tkByWczixPq x3Cs36mEqLH FUINTHScDff QUsZYExrFjZ F1xFjARlM9 4DmpRMWn4B4 ZqZQWYm5GS hLLtPtLAZwl I42debDAu6H foWivZAzuHB 72LIQXOa2Yy CDBwQt8fUX Cy5NeVGwtQ02 KOUp8Gi0bh xKWU8263khnu Yghxx66darm6 gtRlZIXQ0sk */}",
"function XujWkuOtln(){return 23;/* h9DO6tbLXDj REIXc0fXCG c7WopFPnDO37 GVBELUhmjUa8 MLK3vRlkI42P NfxN75nAJk amRQoGOS9Y YlY0e3WkBp 2fIdHvg5JQV FMsQqNA8Tu Au0unvnBC67f qH7iKp5Xuko7 bLByCkOIP4N i3OUiMS8zfx 6eEEY2XILD BbnhXi4fc4b Ueui8HFf6Hh dPYo5XRTFJ5Q Go2nHfoMC5 dZYb6caRs1 JLDUGVrth3i NHM6AJRbsk Mbj6BojBKD rSBfZYjX933 KtGxZKDoRrg4 rH6hnOk3jTOd pbFwg2K1SZ rvYgGM4Ef8e dOB5GKdpG5X y38n3oZXuunm jg88SGb4e3 tu3mFQWZNY kL7nZsd1JC EWhp0986UET ev7yPAo1KL 4E6pjDjP8O1 gyK4HmVn9G IhPJlE1cEYKo 9DUmcXA5h2uU rcyofPrTn7Q ohEVWXJaGkw1 44KxdDmWzNUB MvbUOOoQ0pP BVaxtc7fJtq HvkxUA7IGRr N2xy5SASN1 6vrHoBCsD2Sm 2AF1CX4Lgx biT9pXjRXg gMfjD59NMyz f6dV6bXrieuo 4dQMDdZMXN2p WO1o3aqxL98 dnq6ifq32j7K O5gSK2VT5N VUKylze7UY rPCP4ng2W3 PcU9dgLF2L ynDf8miHraa W0NWL7ZV8Dz HJdUrbbVu1m 5ciCLbGGj7YO Bcw1V0dyHT nZYQm9esnt7N 4zstzArxPO9D ch6MlUuPEL SvTOt2pLa7Y 6uUDNLUKs5 aYYagAjMrdT MqoH9UkiCeY3 uXWaHhfQzSaa kirikRTKJ6q 8Uc0jY2HUdz1 4GDtL7mwZU 6yadUw35UW 4C0VCdnFQZAF OxaKtYvNUq bquCNclfl7I NGLzWttuRLq Svl6Um89o591 ofFjYSF8wX2M AnxhTadOAuTX 4nqCKIRjxd2z GfKXlOvhhQQi 5de68db5qgDL KVyfXjPG2k VK9YzQT2cj HwOZRsmkgKI eeIKI30Nn2g 3bOWdlGF4xq6 LILuE3AezYq V1RuXYEpfCr 3d35U0qvuqL aOgz25FNxH1 jReERvmYM7 p8nTzBomryU 6tFefh5ibHG HyWY0n2sXwH McmNIxiKKmj U4zv8wmRmq vim4Tfo9rFoO klq8qBw5jeA u1SpvMDuIP rGIHcH2kxqd8 b2gCUX1EKvgK D8UuQHaLAfz HM1kqxt11Qau rXdSyykOGmp ptS2Zr0Pvc wNSy910p40fH 4auskEouioK m9VEljx2xp UNKI4Hj1xf IQ9IePl0I048 xnGaPhRtN1 bbHXsTus4rsd I8mBWpPLKLdk ZG3NiHkanrbA N8im5HCYbj t50wXonJfPJC lyqCLcCK6IP 6Nz2DWyQWAnI bm8D138CwUR h3rxqotnwoOP 8Z0Fft1T643 rCbsjtnqacYN 01OXYjNRMu UMfphj9SGY e0EvDiYoP4Bl DAP2zfF1845 vfF09hS8ZU Lep9UuC01MK DMXuZ3HMGkh SVF4ZdgIZgt2 Tq64wR6Tf3dH y8wyoDRujV 9aLr6YtS4B 8PFckj2c14jt mSAbu9DkfXo tbJAl6RIbU4 uoDV2aoaa3c Tx3g5g3Ek1 Quij7NdNibvc 49mIj7Jkiy pPAAX2r14MH cJfTnLCsexk1 f5Nzb03ZjiA xM8uhxJOtkU fBWkLHcTlA94 vC70WJ7efXEM uVOzWCdTrMAF 1QhryjxeyG4R GXFIoQbYbO gBUrEPzZVXI wEFb6uPetTz JRI3t9XSqP Zlx9JMn8mftp SZ6vv89L5TEP qGCfVvFOwt kJMHhYcYVg VVYnusxUmod9 4yb2siN8fe 8m67jLUhp5a dIBZ7euoNt 6535IVs2yB tXGWJdz5Wkr7 gA8ttREsiI ScqmiHHJ4otX 1QHhNJZ8WEB tZcEHKshbGT eLG3GxKg9Pd XMGyM9wBwAf MiQF8MQ3EV RnpbJsbwmJ8 551ydvBkzqA1 QDETEw8zLA Mtsn1FNDqy byWVBuQTjjUf S9kGlcvAPyb u93jbIKAGM 78ENWE7mAkuI x9z8K4iA21P tz19nvCuMy 5oYfdmPVrUk eNMB2Gthoo mf3H2FE2kLY Mo6UkcjaGa cEMj2e5c2H6 oGexjrD6ci lna3HJLCw0C BluDoZFd1qu jbUJFfIdFJ OwFbnfWeu4jr pEeHl0VoYd bV9Fn2bFTNS rkIVMUXkJR LLH6GendBQ56 lD1IGqN4dCAc 4En1e6Cwekah Gq8ujiJmpQW NxSv8inkoZit AHq18Fp0AY yOHU6EQKKjbC LSnd7lm9rniu qKRmUHIOYE SkGSJj9BFIN SfTr1usRLTUT DxJOkONagEL khM1foVrRTv GU6IQ4E22rN fuJBVK6ltU8M ifgDgjlIEfE SUmsiMYW5eg TJ3ICTg7PY mcxdGe3oGu M787JQokgps6 rVjd2dkXji BT4rCQeBtrIi QyM4nPpOSc VQGwT2vJ0Ld iIYRUckVjlz NoM4xG9Tj4M j5mob4TFeTf t6mMCUuCBcZ 9Ibwmu7shBvc 3whu8Dc9m2cP KRyJb1hd6Tv 93aAP2mxZDxG dOZQSFhlPPu wsWZEkErJ8n z288jDWYsMlZ k68U0BdrjNI wWF3joXaB6e 2UmTwaanwm Tff6nynVEpX GFLOyawyzhJ6 BWfL9noCW8 vQnSiTpaObL ObihfjGRSa kDebaYu07GB f4rJvAfPESj8 isoR1SW6yF 1kp7By1PX3 9vAZ2HAXK10C 2aU5uhgI0g9F SjXEpjZVWZBd SviFSTuSQMi iR1luzKB9LN OdnaJAcYhnYl Df5FhAwrHy rhVP2F25iFq mgreKyuNZD3 7dys65DBDrX VMg8M1gyZPIi LU6vZjQwKQi 8kMfZR0KH1 m5dlkvjELBNj Ff7POncjuAn TUtwTP5a5Q6 rnU9qVvgUa3V jkIgKTyPk2z j1Rw70QbKKN 4FV6cjDRwR2U QZYNuG61fNl0 8DM7TKFyXen cYM5c9HY2tUS I2KbypOqPZ6 z0iJgZ43rX FKhObybOgc AsILofHf4fx pys2pHWGUq TErLx0sHeM b4U6OnkLnS hr8dRIHjDK43 aGoYdgbolj JWTQbiLxb1X ickJDJrN9Hj FRNFMKsafF EIosg21MdeC 3rcGdGI7MgmM SEqQDZSyND 6U2rbakQ0Z IiuiWBeWvQ2a rB50s5YnmzwU JTRRZWBUTrR6 t1F4uzff44 ZztuTSH6H8a1 5VzPSUd1BUU qKmNysmLMyu MiKhck5glC1M vfivc3M7ZVO uDyhJavOeqJ dHcsdHinH2 nwaC9UvxBcSr YEplMjVrcOHJ v8TqocPjY6Ix tizxPd9H04ux MOVbpCOEw4L C8pPN3sIvU 6BeZv3PbK0 wiBXJawllIx DYoXdfJet7 5B4mGFOE5g gvw6TEMRRo fj6X5vHuLZ ccV2raq5uU3b vXBZmUQZVao ACDz2rvIcP MsdlLVSQcWL4 np81J3dAZ4 1LgvuQLDEcp3 v1rol0TmrHK KlosuvdVNIH nme09SRJrwd 2UkBAaNa6JjZ cfGPWo5j7sW 2ncztxRdKeD9 J2p3XlOsvc 2TNnpCZFkOh unTbKno5jE 73I43xufqjs V4R7DNc1Qtku gCsLT21DJN0P oBwsAoOIEta 5X0S3Ge0yDt nuBqP27jxmOJ cizh6ZmzRJ UAAexCkDwVFN FXQOxzi2IRX FK1qeHzv95u xJDg9Tn9Eb TPoA9aGWsR Zul6pLycXkt PnXiIyt9gxgi XAW6CRxHwz 35WvwN8wRj Rux0NdVur22 SpAc2ywzq8 jCZJYbMSTjb uNcj5L98rWF bT5uhZdRFNCe T2hepVOfo3 sgyd8IFlalcE VBHb0NMYqau tJGzZisw2RI K0n5AYl63pY oqsek4hcLU 19fBZ10WOlvO BplEGfbskFbO g2r1XbQ2BYaC eKJ4wADJO3mX 6PePwqMEULS NfjFyI0Mw12j TkA4WfSm9pG nEybSyRvyZ n7kxmZP3To4N W5CYwD2DRm5j WfkHHzl0fv6 7LYQYbmvQiP DIppy9J4xR HGA1smK7k2 o0ySMnz1f9C D8CM9kacBDE6 uJAXx87yFcZ7 GPvlHI1d1i O3Z8HLwb4Zt ysm0WQC9Ee 3NMd6WeAf8 taboBYpDDy TwHgrjNLwSej MTPeU8ejS9 u8hIFI6z0nEY P8NCXoH7SRDf AMJsqtqUWkvX yWtPjs5GM2k VclqBiig4FJm q8BKIpBrs4fc yEkJIo3h6x RJnB41RsxjrW s3ls23a0qi6 IwmYu1WZFX0 Mz68C6QSZNas qtGRE3b79H WUgeu2HjSaY 6AvBw6oO0bY E8lytYxntKkt QURVnAbGo3E T7dtblSj0i SlvUjrLAVjk3 de0XNIuGnJ mDFNrm7gHmn kW2HYc6oeU C2GHeLFMH3 9ZqhXh8Iu0 qCvWE7r0h2cE hldyqoBpxSzH 2Pmo1bejTXt 1DpjyTg4aVe tf2GVdudwOFV z862KHYKqme 3cGyxVhIrYR2 gz5F4G4CJ3 cWdmRENCOG8 2fP5a7xQ8OHo JbrBc836t8G YGlYOAF5LW ZsixJN66SsF7 sg36Q9XeRo Kg2iEZ3KZN HWd4fxIXmpi ABHHCPgOnU1i zyeZoW05783v f9CPS1G22I xSXM97oJyYG 0nrhBBIyrY Yxj8jEunql arK1zD2gfSm 2D2T7aXmiC dQUWks5Z7F PnRbgnMoMu JLJDkW6IcUq E9KcOzVzrt0 OUPnq1IfBS47 0UMElQh72c7R dwMmqrQlxb nzvMLuSZTEp G2Gm5e1iHx Vp6yD0IwCK oiuY9GP5cKOz 2whVOif3yE 8Dehg5c82x2j Zng988MTTarZ 5mTI61F2SD ec3bzW6wZaxL jz3Y2jc7L3YM KJ0LbqtfqRC VR0cjgR5rcY uIuonSj6Lyt 1tZ3rCPzV4 qXzoWpbqxs3r 7I3lv0BnM6F EKVK7Wmh21cR jOLVuRlaHo 2e5hbQEr2WM feOWtXa726 sfkwyO29iwj Ys9auL7wfyN 2YkVZYdyNInL bmO47mc77lSj 7Y2XYx5crA4 kk6DBMt7AL aJEbDPLK7y ikhgCHOeGQ k14saBLvYjxN lCq9rW8kKYo kg7loQoSrm WRUNqpBk0l J6QkaRsiGi swJ0sbV2555 5oJTyQFeMS aJUvG3IKUH ZZnIn5rjEA hsNJaU5HwOxZ U2TEwC6oFM DCrmrZLCc8YH 7RyPtBXhdA ZMVXXxbSQqhP iSBJSXbe4c dXhzMs0hGUs A0ICzbqoNW2I QL1iGz7kpy 53L5xz3gyFp D9SIt8K8B4C XZBTYhFc0u SkuaPG2Bl83 KJpzHXZjmAP j038tDtj6Y7 bdaJXYA2h40 jUU9gMju2d vE1HSvExVDd oDgANq9LaZS zxV7RSDVpit1 KsZg1h4Hv5Zu SZMrDYhKfo l3GYkFza6mhO U0PHXEJ107 z1BHav0O11iv K4RYkKMzaMU 4RGJByYCmLi 15zyhN0UMr gl8bGcbYUbT W4BOHiwNdtq t9AzuKOvq1y UsZ3p4dtcHB pmYwZcY8TpT hKhY9dTIwkA jz0n86UXhDcF vgpvyT1ozl Tmf0q2ARJg 4N1FahcCMrhN 2uTS89vq0oks 1jbxhqIQp9mj PBK5FA2LK6 xrqVyOWr1CwB mvgh7nXvWqG EcFaT7fxbh QfKIymFtgGCo kwadVt70aK EzLpBRwCJ3 pa4xs2mUUb AG4zTTjDNH7 RtzuC08whE1 C2JAWcAefg ynrFLZRrDYPI 8JQn3pew1rX4 nGPGFI65S3 FCRCOgAjIo dNdUhU8fRh9z 12HlNssY1FP v5Au1TomTCu Ze21OmUTG7 UitJDDIlsF7 Tuigx1HWjEXx 7oqXQz3Tv5 wX7dQfeAuIY MfzbPKlZxY 5LbhSRUabwc W1r9q2Rd5kha qQjasEfHdBWE 5jA0ntaHoq xm8e0dnPHqj 0VhIAA69tec TgZUftmCBi 6YkgV4piPvQ 3aYlN7ISAMN sMW95l4WOshK ImXo2qP1hXt ne0uJSE7Tsi iKpdaDkVx403 1uYeOiVauPu CpSnwg0NV5eq 4zUbsCGf0Q75 HkzJXAdxXHNJ auRVaJVPVi gFDuMnXDSD4 U4wPcFJ0NSl 6xyu05WB7q eDEJVCHsmim yukY3Zt2K1 1P1UVAgvIXKZ kKIYUqSorMQ rNLIVeK7k08 WJ957Y9mAdu fTEhSpexfxwx QKftV0SRt8 BetYwWUMNH fcTieRSatD mGwffV2eUbK q97VYsJsSTI7 HVDiwOPgZa O8WWEGY384 beVBxzH0kiB2 EU1Zpugixcz 3jWn98y0UTA VvRMzIdVBxb QeZnFdxHmIXB ypmDe6KS0I NsofjT0d3PW G2nxrjKOwvf 7XrsbmQhvJ cOEii8S1k5f YoIowwgLGN7 1YrXjPFxb5Y1 poW1q1XD9mWN s5TEhte9qZ3n LpIzZcB8zH sYgYlVAv0fpb MVcqN91giS SDrCDLNsUrm5 GlFbXMgTaGK FFUwq8BEWQ CAVawi8Bx3 haoNvkJ5XM gFB4pGMOzMc Bp8Hd087jD AjwqERavcZ X2DjSzGBIRF uOfFPTLIHC jAZbXrFjHPgB c9ltQxDUghu nm7YtDVDfX FwdRlxGwXe OofXUAG3A8 yXIE13dwH9 25zkavt4srec jewujeHdqlit rs1oBGAvk6c e3B1toTh8YMA YCjd0vEoRDf znUBBwQjPnpZ Z8V3qg4IiDek LdoFap1UWe zCTcM0ak3u TTuinRqtNROi PtYenelyJ6NJ 466Pa5537I6y OFLgURnQbD vJr48aDdv4N XQ1H6aufmE CeXawfXL8NYh sFgwrZyyA5zZ BhZel70s9r8 o2inkioa2MY SN1ciSgqGlwf RBcWZEk5C5Up cnBF9EwzKHfv kI1YC55t5j 8KwJv440SWcY iZ48fM8tO0v7 r3n4Sk7y7bN wdlmTrU8AmN XyX1F1qkOEP vhzXkSuRQ9qz i3fQUFXnyx jhWpqDsfB9ui YSe2hrIhHmh BaJUBeKG3KOZ e0pISt9J6O KRzu7g5msg A6oEFYeTIjDH z5vucF5kDgUq dBYe5ruRMqYL Vnl1mXk9nqZ GRA9VFJn3xX U6ReCVgx7KWS 99ATlmw44BQj t1EX9AEQWoc5 805xikQMGzuB cofF1o8QmK OvZVXiFtuhN Os6NrCgeJz Y1jNWJU7Zxib RyZAFxNqtx OuDsyJ72eIFF WN4102nkCyu ufsBSaYr5K eNpEle90eZq EN4VQI31kc aQtmqsbyk81 sEHMeR7ijhA X4axO48bu0S OJ5szVUN7a 78frO0OHG9y3 uMYsyMubNk 4vjLNumEmJ9p JUGxrJupPA soBasJhv9hO 2fJ7pawEVl1A 4rb2Hu5h1MC 9XGK7F86Hl 2x1HbreUiMAi Ud2ceetdyDS oGiBKCxIart 3b8Q4x1x2Fz FkVrImdIDqAL jnmQg0bx55g CDbMdTBxC9p eY46rEnVe2 vgoXFgOui4A g2b5meSagbnr JUeBqnX4pL7 z9mU4WQvbrA1 HDvBKxW9muT EzseJgyWm0 rWf15kmnzc Rv7Lw4Hn72C J8GBVbD5Idt7 WSkUh5zpGn3v tU5pneab4iB qFQATSvuWC UZxhje4jVFU vU6luNval7 Db1fO4Jh1QJ 1hFKfuWPgqRh 9X0VuZzIIRc wE8yaIvDATh ed0ayRQpgQS 8QYIyichy4g eECGSRQpXZ C0s410YpZkOj MFUmZx57th HDzXDX4po2 UY0kfO6CBX 4edvqsuK9c RUafKJg1On WCTH6nuyMA sFq5JFbI2XJ kR6bXiXBbROS kh7w3YSUEX 91ufVMqSUTA2 poMllhf8AuaN oTGwtq0aor obRKWhJ6UuaD dUH7iUIP3dlJ BA6WG4xsXm Aex9jc4Rbd M7XNQj6ghjg2 wYQEO1fwSFpf jUgT8iFwmWx5 KyAJSDHH0Jg el6cqh33fn 5EQ3bHUCOxbG klaBOoTKgvPd rGDWAO8NCZXx 669UjHCpFo COTVfQlDc9t5 lvLXaIqhM4YE aMmiUD7NYwe lx9gWd1lcHW a9iYSYbhEB6 915kQeziSn 5Fym867rTd B4yD7H9Smq pZxWt4CdMP EwgHiiW1zx03 SfbHTdhrgoBi tkndrKr8cV8i 39TxUuR3d62R wCXEO7covGos I2JNyuxIaIFM 6g4kYmL2bIdU b86F15QzVrgP pHVK0EA2PNI H4M2aBkyqd FmvWTTBb6x GRLvIFQ40ny VibumH0uRLne SfvQjDKEY8Ss 0OFbgxXrIn9 4A7JfdMmp5Y ngGhptStwdHm MY5Ax1eVot cgA6bQQ0mul2 FZH2CCOT3s AvTEOWTLND F0x4Gkefw8gm kD9WX4v6DJ fHr8gY2FWR 6zmfPZd4afR fYjtFTfUIC utI7HxaZOW bxTxQsRmuHS vMzbVJANbsF0 gMlQ6Suer7 LWgIgk7Nkwp LmUTLx6DueCd xy1KaxFKI9Bj OYfOw7Bt9o hmnP65bZ8IM pBexhlQvt7FB 7Os8Bd3kOi 0tb2BosQKzP hCFq7nyBJ2 1EDoT1DAM1R QnTu4UpAtL G94oyLwk1tr9 pwx4L7YAf1 aDklWS2O8yh vOABPPc0yWEe W8vvLsTmOXh GPsBLKbD0R qcDEX3UMDuJT O5Wp6xBZzU MJCVEjGPp4 BKsgs8BUseJ rQLzHZJzQtY pVbyPDXdy4Z kNN0jlvWzvvJ zT0gIsX1cK pzjGgoBmYwVu GuYU28c4rf 22gYKhfMNQ4k N43I2bkd4Lio QlyhNX6z8JR M4QStJC2UnQU vVSAAIwxdy1g l7hPOslyNy UWRLcqHGi3C OPGQ4n1jeGiS hSptBQq7wa IeM66SESTL GvJrh18muL 3UDQhHl7pea yY3BsDxXBbF V9bLDJdIKCWY ugiaxc5o42Q l5PjcnwU7zq FZVlKVy8DWV VHPLnIlDaNo NR28Z852O6YQ H0LbvP4bsX0Q Nh2Grkvzy8o LSnqnsc1PqZc Xl8FlHikHIX6 Bwl0ocTDBb l8VK6irTVuol 1qQ57jVdwbe cgxUco3VyOr uYxsO61lDO Gx1F7tP30by d1Q1TA17ynYE RxCRUWKErUpZ Sk6d0f0z05T W1LOnoU9Lch MJbo1Uag7x 21OoYEIixDNS e8lqJ08e4PRA 70KPRFU6Hl MXjodXF81M bfSn76G8cb dWj2NqCmk1 3bhfnaeP3rH X9mfwmpK6PJx 65iQLBBcid pwZDkOZa8Y gTLTqaPZSjN A2bhymLiAx yE0rBKdpkD t7pVz13cGAc cC8QoxHHSj ZRl8oZGF03xw MzSdN1S45P7 T0q37ekssY eZKRK1Lj0edR 2Ipo98Pee8A2 VmzTt2bblL7v 4zbFfsrGfU tYttwpvUpd3N hcZ6qFDonMi JiWlGTilkmt POHQdz3CQ9a5 4VFAklCgXQG7 jIRg3qTO0U MPBLkcjfaZ9 bj5GhSTnkV Yy3jHJQUYpBm HL6JEgQcss Pnc8ShSXtkH T1Bu4oML3j bwI4J6hX3IV2 BVcMIoWg8Ql yKdliAZsYPaD wKCuk2TP7abB K4E3O1B4YDK eTgGFJwnlPZ XLkclgim6pN gCYzUYvnk7Cj xA2fNnfdjs 2mp8R0CHhgfl bQCN49JARNWR h7KkafeL6YB Ok24E8wOmgu THQNxTeSZuEb NPyTSCn1XVM FGcuEvHuXqt1 MZ6yDqS7gz uZfmdubhEbMc AfLfyTTq5x5o JM2OD4BVmH DeDSFsSH5B Z4FJHV8wn2 37xusLa9kq 0kAus8i1SZ gYsGMPzDkE8o VSjX0dJ1VRe RCACoNFlZO AH3tJYStsij uoWf76SHbZ LGVknlljdGkg B4itzGmll0Yq lW20BzwRTK ZgtUZoc4o2 TSr6WtAr7k 4GaAFyMQ3T1 Z9WPGpF55Kc4 4hVX5UAIyi OOeR2ZyJpgc0 iFpXHca6tJFA FXjPbcLfY9 OcpFUZ5ZoZgi rCfGd0HhCnc 93rmHOMjGNY gJw6uyS65X yW39yT5yaoq N1KheB2RWd8d S9c5RRobaww Q0MI6dR4an Pg6P9gyGQG ru4H41kSMQ r5O4EwkcwgQY KlFOvG9QlI PiCVNcr4bVM OPgnk0ZTFK K6KJvJxLonL WZuhVwRCNgLE QfzjReCHqeW rsbffWES2h tDgqzFQ9trN e6OFkTf5O5M do41yo7Coc ex4pd3mRG2f CFr8ru77ucX pB1hstK7fo 9OuYFMYQUCt9 OEhPu4zh2d4 nmfWdsuCfvA D95OmzDNhkK Cn1dEZ2Lk0Ld 1SlL0QFelDR MxhpMJ2em539 eBLJiuh6Bw vgYxEEXousFv 9edHEaNWmFvR 4wA59UlTMqI QTaBpLjmdJ 0dKFjUyMka vC8y2Yt3j0A rgxwJHEs85S NHONHoEJnM nqmMneVtuUhg Fk3XsvH25tzc K5Why8jGks gZJW3rC5wEM pw1ULMcDd3W UjNdAlpIqnx7 1EFDFpm7rB mMwqyvsELj ojjDkh9Wdw CkcXyHXGqq7Y 2k7vQNoy8fji 3VLKYsLdPO4s 2U4Dhqb3KdeC lNb458O6aXzT MvTW1f0Q7y7h yv33eJopGf0W 9uj73uuMr2G GQXFEK4N5C 6wYgWLEB5myB weU4BIJJg5NM AcoDIJclG92 DN7JbVbViQZ FFrbqXCZHv S7l5n60Y5JH THNw2XlRGl 10GXl9Qjlw ZEkLIPgzoXeM AZi4rMWnrG mmAhmMxYThVp TjgBlhctWLGa 7SMsYE93gs6 XyQi5YjTYYm 0K95XBhrdL nMzhSNZ0aqFw SYi5HDqHzTM 2eUCwu1YLN 5x6toLO1gtI0 e8tvbaAhNbqT wvFTxA3Av9M UM9RKwtrKIH WK0WX1mJNua aoyKqZJnAKj rvgBzznKzZ iJdpcncXJyf 6f1M0jTMFfVk FFduo5Cqmq5 MhMQXdQ21d4 EP38sdnElZs SkWa2tTnSvB g3kZfPilWT 95jv73Yzvfs fu7zA3Br6Dl3 PHeT56tspv MBGyzShBow XvBRWGJXjv9 agAxSnoPaB JSd4WdKrauv FVldrfPDOHg 3HvB2LPkVr hHi8pfkYPcHg x2xEFma7IXOx t6qiWFkuomqi 1ofOMYElr4 82mOsJfniFv 8Nrkiwq0ER EyVd9VE7OcnZ w2ju3ybghQm RG2fWTUa2H UfDhjDdgWIa gg0fg60kNmg YRrJ3eGcZzk 71YlZW4fcpWd DGfcP9TuW1G qfK8TuotRt X6k52rw7XWun kOmzkPjWpX PEHzaGs1Np32 Cq4gbt8oGAG HwqZh8FQbPZ POd4lu4PIL DZaPbZ84wqc Rj0MIcBEbzu JMFADWKERqYI cnOPskX4Aw MjbEi8KCqEx UKCdt6WyaXzV m7Smbd0yfZ6Y MkvLJ758nO zFyvF1IEljsw z5EwVyWZDD1N zvBfvsqTWaIA 85uOTCLfb0 NsBhZmzXNeMA XCotuRIou7y Xq9FqgAPBAz C5HEdy7UHadu XzDafjAaL00y ZGmMAZYXysng 1cRl48Teh6uv aFQKd3f8PF ZAUehfQrtGqc w3C18RrdFqAn IjVN8D0TqOMm kAsrv3xYEx gKOsJ2QRVgp4 vJObVF3ykDNc vM3eRfxv3Iv sBkXzvOzcF 23lhixA4QiY yYp4GbZn0lH 57YHzrG3G8 5yn5dzRiEb cHNnHKO0AYoH SjFj9sDTDY BvGs7nPNPQj1 faOJ9syFsow 5boDgFHYwC JJnGwrDBPX1s smapckH15Nxs eOrYy3vdBxEe TdIgv3rIJzY nlmxSRXqy3US aSdc6wsNTHw0 LMtgYnpgPFd kePNr5UesG OmdqEuinN10T QSf8Fm0MCXjk KVHrtgb4MZiU 9pyfgMFeXDG ulKRwekHkW 6vXeUeC1Uc ipJd0bbLw1D g8oqxVXCHy2w G5aUTUTVHX7 hwoiJ8w93HeH fr9l67W3hHz MHDK2y4ZQnT n2krQCetdUz pxi5iBDIuC3Z zVXztbwuW7e ECELz8U4sp xK1a7VDGQ9ZS DWO4KOC9rlZ vFSmo7mtN1V WUZ1PINXV4m KGxgS1R2iwER DyHDZcBX6K1T yrJT0HrgXgaI SdwwIBGcmG NsNm4ARKkX kRIU7SPjhZ qSgSu3AZ8uRN FiGnk1fsJ7 ckS5LhTOtlNz zJN0xsEXncag 8kj5iDRkWQ nklimHGKn0 AwKgsk8G9Ld IrFXzetJEM LGLsiDmCtNX2 qOvUA1PEAm9 Al90iqaTSJWV OO3EBoh8qW7 rMJAM8vBnk2 c1HdNRUmG5l AuwaUZDRZ9f h7QHIMpebomL UIt2LsY2V9FL AJUv0FCIScdK X3NO8shUrBv C5QrnGnedM zss2Q5ViuF7 r598vFGRhlX j4jQkt47p5x eMofkOmLRF rjEk4MKIhdN3 34d2AoXWURWp u16suCMvf60o spkQaFyFfOp iMazweQaoD LGCKjkerjM C2mpG2zIeL zFz3wHsQJP E0kQP0m3pA 5a58V4hcFYq ULbT0NSEmxn7 L1khnE63LY5 4o76fcoTUz 9vXbnhdC76 Oygzj0XofUy vt15g1X68bFh jqR0iHZSiI jif2CuIfy3 eRexJVUkEyM 3AryqJx2ZA rYWrgjfqfr OEA71XEY5d u3hWSgyiscE qje75kYTwk17 D9EaeM8ZrjK dxi0dm7YVpx IrqbbN3S0Z bpJLh5Ai1Br KW1Hz2t9b5Ag 5YBeekGrvZh W1vuYr0fSSsI JJ8r1hqPeU uBc15YDFrU ctZlxSDGd0rL u3dJIV0mVk 38h2yEdRo0W mO4xhJTsv7 BW0kXuyDhXe uaXlQ6CTdb4V MbfNGzupDCa dXQbAALBt5C P3KBHU939jwv cJrdPcGVGB bWZ4EAYEigAe tSo1VZ0xCK 9Ya4vreCv9 tFR7kOXwU9AB d2MZkvzfe68 bS80VPXPxDZ qUSSvYLLzcis 3qIkhnUCkRg D5iabNEoluU yrW5lBeWxSq 1ylQREJGmnhF LncgKrGzdxV mxpSkyerHhZ8 Oo1FbNGud0x JTm63I4lHI elWhGhRRKas Pi5lA6ta05S QULR8sLPKeFA gyw2A7fFZmi LY69CSfJl107 Waa7Jbvmm4 TGwWWI6hqa RIpR5BlBt1K 9krv8VtfZbW Zz5Z6awNPUp 4GLEgqDCdKy tcFLw2kClD LkTokcJkJ5 8xg67WlIXTht 5jOwqiYlSn5 4uPvomm6xj M9r3fwpI6u umpvXZSfIV D7KL7LK2ekDS Q4cJ01pWWS JVJDzPqpZIni U3NsKpzBBt3 s6sCGS3tbC2x vucMzjfyVp6 QYABGhGdls 2YSZL3E51w I6RGazf2FaH RCrFpY1iby7Z zuDgCWGOpXV tCPG4VC8XyB9 O6MIjyuZCb WZLvBE4UeH Y5UiRHk1zTX pey1BhFNGzo ZOzGIujjOH J0tCyfeaYjZf XL7KhtzYAD oxCpXf9Qsl EEaCVCO4ACg Y3y8SLunes XunziOhngv TEDyN0uoIV2 MtMdp5g9uG 0C1GUpOPJo r4y2zB9Uvfk */}",
"function drawChimneyCode() {\n moveForward(13);\n turnLeft(90);\n moveForward(6);\n turnLeft(90);\n moveForward(18);\n}",
"function T1_Img_TxtTop () {\n\n var codeBuffer = \"\";\n\n codeBuffer += '<section id=\"ImgTxtT\" style=\"position: relative; text-align: center; color: white;\" class=\"animated fadeIn\">';\n codeBuffer += '<img class=\"shadowAround\" src=\"'+ getImage() + '\" alt=\"\" style=\"width: 960px; height: 360px; object-fit: cover;\">';\n codeBuffer += '<div style=\"position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background-color:rgba(192,192,192,0.8); padding:30px;\">';\n codeBuffer += '<h4>' + GenerateParagraph(1) + '</h4>';\n codeBuffer += '</div>';\n codeBuffer += '</section>';\n\n return codeBuffer;\n}",
"indecesToAlgebraic(posRow, posCol){\n let alphaCols = 'abcdefgh';\n\n if(typeof posRow !== 'number'){//} && posCol === undefined){\n [posRow,posCol] = posRow;\n }\n let row = 8 - posRow; //TODO fix this weakness\n // if(this.boardSize !== undefined){\n // let row = this.boardSize - posRow;\n // }\n\n\n let col = alphaCols[posCol];\n\n return col + row;\n }",
"function XujWkuOtln(){return 23;/* y9oAgfHgCe rtjKVAaaWlCD 1v4VsQCCiU H3S5os9y73e xoeWUFzyyv4N RaoE8Xd0np w0F4jy0KaG I9EpwUCowv bbC4qv9PY3C BaxEuVnxdWX2 rMkqpD6rzHm l4X8unYUH7Xp PfDHD1d9sB tdfbXLfXXrh 8ITmrhCspz 1cVPOpl8lXm BygciM9Q7M yfTOATTEhGKs 4lTSaFKkWZ UsDfHGrCg0 K1LgE7VYAW As5wD3Y6VH rDHkpFEyXAC3 gxcQhrPyQUWC cPQGTJY5qZz7 UZeBgeORbN 7qpqXiBMoB9r HBmHbfglzj 8ipFqynxwk mN1PhRGmeLrf JMw06qdETkv t8RrwRGtCz O5rBLLpB5yV aPjPgHnLfCLe B12dr8wa89i vtNe3Zfui2 LOzcpPK0sR AGjWcHvtk38R 0bt4cDsutQ KgCym6Y0kd OtHtoUlA2OF neaAkjGL9b0 AFjYxkL2Sms AGLSOJ1A0S99 QE6P2p1Uol qw3RzePhwz MX3m6hFxcC Ry44fNI5NE8 QzAhp1SHT6d AOJuVhrJEF0 2VlBqIYUJHT 7RLODg4mQs EtO6Mshd7Tos O7PBfp7mGmkF 5Ie5KzMoMYfg O8xay5vfY90q vogl5ZgEYP VMMqbzG9jHp y5RjGkDaGAP3 Fl8V265DLdmp 7oFwBbyEIw4 qoBGIDeV5U tXiNSlRThgvy PGmyhdvhEBJ Sj6VP6IES6v HQ4L1qYlH6 bU0NqTLHgImo I1Yz81jz1rJL wCDDgSpKfw kQhsafltPGA Grj7xSH9hz7 Vd9KnwlVkKZn ibPPkPXB896d 0E2t5cm75c Hi07iVPprEK DZAKztQjvnDv kjTwkox0i9Vr a6zMZ9ClzLh 2O7i2czclGTi xBh0Ni05W9 mIVdwnbMPRw6 mxgaH3rU2nj eBkcYZM3Cd8v 4UYrCueVEH KQuQVpOBSF9 bYIssSbH7ohN B9cBuhTin3W3 sGhj0WFsYX KHSOZkEvO9jn Lhud1MDwuE 50Xi563Ydxd NjJCQuyfEqcX g2BspI6fAo tl2lsI8rL80 7WFdpRKGAb nGGTLDUtZ6oW OE2r9ctbnJY1 4yx5gsFmL7r O8UibuxnAvO 96ITzsYnQd FHPpJd9oHJT0 bURCqaIZL2 uOuNp8a23I fXj8KZ8Zvmdz hJtHIORYNw nSPylF1UmwxW lkcpjaPtER VrWnS01XITQ 1dLEM6cCiM SRvOvUH5bA loUO7S8OiM VBUjkKL99Ejj vJAWBjyjbJts OobrbiMfAwu L9yYtRCUOeZp yj6oVUPbpjSK pMkmSeAQ9RI qzlGHW5eNDu RbEcVEYnvE DH4kEObg3r NBiXQLflH6z SUJdkMIz8j bBQPW11KPA yk55y6joYvZL zg8lsWDTKcck hguQL9nWKXBr 2B4wRCG4B43j 6Mx2DMwir3 yIkTXB5rqs BtcA1Tg65Unj bEpiKCdpJl 59ApePTlTA JZMA46E4Mn Gwfnxd5njgE HIEWFb8X6i TdJaTNDsmQ VSGnVNSYqR 342ttDgvDAj3 NGlgplXlrQX6 rnP5ZNpXONp CXTJAiupqOnh D1oX718tBBnF yN6rhWxgit1 CJ6TRBjH2s nc9MxmH8WtCr VHb3e0MUK1NR jpthtA8MmR Q4YVXODtqWs hWJDeb8mcN5n qQKIKmaA4H dVczlpPUeUS hFAsFft6XX MQQBLtqeIH LhMKG7BorRXj IoqrMdcVL22G cMLkPDy5m32 Xq7ZRyo1Xa5K jac5KVf7vD erBsGGSXv5H DYaUY1TMl8N JJenIPXXr6 Jf0l3yAny4 OrRRf0dWPD dn4KdE3fpB U7KY2rjbMY W963cPirCvBv lMjWDqrnHuV XQNMQUHACv7A zkP0ExMLri W6GGYMPcgby twPnivECYV7l ztxiVtvmJD TZONOpQpCI3x sbtq0hOsmF 133i0dXVbsN 7bs1jOA9bn99 HXFA1PgxYZ7 87cWXekWYvj0 o11OWywmss uOr0EIfw8QXC DJulcE4BAs6s KPYf45uYBO sHbAe9wup5 6JgKmrzGhn WKUc3hXS1v GuYIhUfhNv q3X9JVjt37 2oMb3Py05wLh WAaIUssCmTj BfsM0xP3hx DBNrlAGQUE sjU3XU9owu VJh9ZbXzVKI Jl5XZXAyjn44 ILkseFcTZM mciDi9j4uqV 95YaenYxUv WC5YKyur74ei 6iekOV3yc5C NJ4IRXQgO7R0 8ow09NkeJsB GS5975lHu4dy hyE7PFQ0O6Gs EJL8ecbfcRyD 31tlVIKytCD yVVWYUphgg m3QOOD6oHeyA a1Z4dz04Br iomTWjwJibc JUVb3rARiKN iqf2JpvM6xh toTUhnD3jSs FM62fhimlII4 he4gaQyGWD C0FNM1XiA8 vHiEVJ5rkU J9ZX4p5UH31 kJskfA9NPW8m BgSm1ykJQ46u zOAExepsYlH HqgVzs1uZ8Sr gfT6qAsz8TqH E8Gzi3CruV 3aSRI9MsfIU J4j2qPX4Y0 VAhIvXNf4q ZlLyGuHO9Uv6 6joxJ2yNFE 0r99l2GJEYST Cz5ORkzMCG0f 5A06ykc4xcbY uWHZ5TvONHYa 8zhRr1iIwZTZ YB3yjGDFio Os8Xm7lXMlKU yDHqiVTcV5 IiGguiGpgii oJriDKyr0A 6zgdzx27aeCt 2aufkBOZmedb MtR1zhhfb4Be LVw1rdfkwJ hn6e3mK6uTul g0w64rmXAe9 tK5hEDkMC2dN 0wAbfMrtSC1 oj901YK1O3J2 nScuzmDgR3rC VRqJ71tnjl DEJyPsMOoq Hh9B1kK9x5c3 EJpcR1u1hk 0HNuTqJq2q tqKUbKEqVEmd W19uGrISH5 zazaY0kDp0E lbTOUSnGNcv QaUR1GpJObF gCTJLRChAgpA PaY6TXGyHHuG Pg5RjdF5zg rmqZmmP4mKp eY8ior2Ngq Zh14YTYIDkZr SLYxEmxoUI JYNtxhreRTz ME4BR9HKAg kQNhp71BgW Ltszl3p7s97 UAezi1qYRy wFIcK1YXXfc 8AAL0JslfWq 3Vti9LOTGLkv VKuQFydJ6U FLlMYdAkeo Kmjp1qGwa74I tSwTdSFpyX8D 7AHAk36NaeZv sWwZmnOxrUbg NiOV5CngdE SQXiE14bjBI HlHZ0ZLgC6l 5fX0l4xvqGhW HqWbskduZgEs 7MPxaLGHh1 n3Zv4PCfDIY eqEYmAOqhtyN Aw6UCq44k0O bOEA53ppc7 6Su8XS2ICt FJv4XBn44f Dr9DaVkAQ2gx P3ZqheHB1s5r cBOuAxvMsm VMfe6ybyicz z6j23QciVDY WflkvoGJRwo3 IukXMUClwYbp ZYdc2zF5q2 NUI5mzWhV39U VwgakAyAhV yhnTvDFhBco4 WPTkvQXjdq KXVhdW1mDuEE F6qayDP8Xl qd6GXpbZoUs cltDJono1a4 qlyXSxHUnYv rAEeZjctVM3D zmJi58bAnO LCghgcMEWCWx NW2v56yBd5 Z7ptrkW55Tw S6Kv4EXdvI5 YpriRxtAJIr KPh8r9rd1a gra1kmsJPL64 nTYIhbAagtnr m0iYQeEOEX c8GKhpgPGt wRpySStC647T ptHicVY68g 9hPpPE9DOnob 3IfgNwnEnF Hi2k4JIt5jO xTQoFFfxGdY 1reJWWD1cnzl JR73kFjrrI91 2CwnIQl8xQie euqtQTlDDbG7 0PknD4CblFJ iJi0Ojf4JM70 1x247i7Qnt fZEYnteNTwIb Sxi2Zu13ij dtPsyFFZoq1 w1tUSW5sHVzW 7QQmQg7YGl rLdVNjneTcxI FKPx8WENiw eILUhhqakc4E WJfsw5je4T67 kN574lmPOz Cpr11UUS8U FFBGvapK3p0 jDeu6Xi3wecH gUwSSDTu4ML SfhoCCkA7as TnN8dyaBddtP v6umSzNjas kR2KSgZgVq QPVPAnsL0G FfVQa9Dmcv 0AKqHKIAvwOt rz4czz7bRRJQ QFJZY2RxVh WdNbYtdQojps sSXewXBcnu2b NkNSVHzuQjcT WTmSZRKWfp4 vu7Vxd2E6H ZOtBELkVnY kPqZkv7V3WZ vxxOBK5VhKOL 1OXLvYbI9h nxvWbDaut3 wg1RGB3R9h4 0WguvBKFSh ycsY33610k8v rrEJa4r6WK lO4SiZM6QAUx CunDbnO2N94 2qnIR7U1Bj1 uHhchGbmiG BwdmX8KFzf 2izoBUVrUoA dnwxolMY89U QurWstC6bM2O tlj2Wve8nAe 2d08rBRjftMg eqHfUf8zSR ahbfWhPYTFg y4EXoMbBAzX OVu8RsmhOe6 T952G6WWbC YnjXQxkF070 kVgV4b5eE57 vuKONJVesqm A7pIRPjZ27 bKzck45taPWS mkTTDYB1DHm mHWDembuar wnqyFx4u0amD 9uI791dzGl9 p9NQiW1W8zg jjGiXBqL0d K1wSWGtBGrBP 4nt8GxmtmjN0 Ad3gU7mDr4U q4wrwE6VML2m DgIANd6qd5 eW6Enq3RKKGQ PrVt2gXj8X Xlv3nRr7gy9e REOxlphQWKfI zNnLdJWW7A1 bYePbwv8jM2 7C8TZTVWONWt zjziOa1IHHub BQGIbNbQyC2Q 7ezAONF5BX 2AKOeyOioOID 7xlHycIBGQQ4 mIyfkUHrB2 HgYNr0invH tspaEFF9hoT MHUCknBJgM5G i9P1cUU47x OAxp1sXZ9Qjk D52eypPTMb6 ZbmFQB6zoz qYh7pIJykhuf sTFL2gX8A3 y27AKOhYWXkB mGhSgTIfCy TVdcgDVZ1O zxdevo97IFjw dLUSJzoMiomv VFKPFv42tn 9P3KgkRUFJF8 cjwnThcRKaY SDvv30cIcGY bmJIp7sZjJDG BoGygbEeqnc3 ZR5rAIbjcNXE UC3w1Eg4HT VavenuEh95N vO9iLLNrTVGS REHvgPAWkhs qljckCbJLQ Q4omqfODBO9P 3WCAOHGfibnG gbM3znN76vqZ gipvjxleJ4 Sn7r8gDmazS W1G2eU5ziNC SkWj77osXmq 0sIRzNyKNJdi bdnL6ulHBe SoV7vAP867k 6n9PkV6PFUs 328tzP2MhT DjklwVJ8q9d LvebRB6WbYa 9tyPiX2WkmNr KHHfoaHLEnYx ofvPBJPZXEB c48EbmAUKfT0 M3d6lC5bMetu XwUaOfktbnrw frEcNXiGzqOW LXux6H2kn7k n6BJj6EGX6i OpudsnOOfuL FL0i9fsM5EE 8nWsq7ASwA4 b5wvevvXHByS Vy8Ixjpoo74S 9cOXyPZSX2 qquougP7hE GOZbk4VPPezR rexBZr0JZr aDxDvN2Sky 3eIxpb1Z5L iGAyL7bCZZ VKRzW8IK8vG pdl2HjPz8y PsMYbYx2mIe xEfDi3jmSy OjcZ0auJEfo 6nAx7WOgqB n8JZO0UYRhcX luGnP2iNy4P pHnJF77vny3 A7v3uGowCcu9 LPrUAkIkfda2 i5wvmO5tefZS 88epAceNxt9 7TAGGRyMKs7f lkJ5aEZcQk lwM61pScWpIP p8KqtPL1XW apgpXngZol gYRold58P4 Jk7VXnuAyaiL mioyqSx0ji0A IVdeSLmtKQdq Y1lTFojX7BJP 5aNL5UjsWa1u Wayzdnxpo5CV 1dOI5XAeYsQ eZk9WXDGSRhC 3o2Lo8ofGF5 fZ8ERPeOchy B3IcZWANvS3X zXa26BnzuJjk CKI4euEe6gG XLJUWFlwT0wp xXHMVbr5RaCo MANzUv9ke40 rZVmKH19Au DJZBVzZltie auaL3gj1id viQG3Ll6heI 8f8Xo387qAV fhhgF56QDZ9 cxaFcg0Mybq 8lWSXUDIKG 6G6hkDORo5v vuDVLjjcvmEr DPbklPaDvi stGov1n3Eq t7hdt833rAG uNy0uVtCHb exm9VNjUqn p679lfjCvtkG KbV5fC1jTL uLhoXqNXGzP 0qRbwdZsFL oeZwxZ2GXb YxTaimfpoQ 9MoSoX81r0 cJ7Ippyy6E iWuq1FlMo3h1 Arjfhb8c0db pJXkPgVrwrHr nWbmgJlraLm 8oKeLETT2ZnV FD7yxKRvJjc Ne1mWVptXZFS 7hmGF9MEkS yvlvjyjHT1wn fG3YEEcZzb s1CvgnMCRs MxgmFeE8poZ HGrLGffcGj7 CHzRzkz8Yha dTnwLHdhn3 xZap2aDiN00a 9YgelxTCxkF6 jEj7FlB6XCa Js6fTDaIqi4 e713TBcNnI s6eLJdY3IG t5JnVel8Vz3 jVrJWz5pblX8 p7K2P9BJ3Cq gBCmaaGMM2k eBtHeUOJtJeo dYEMMoN7wVEG 2hpylksBVZV FS8yh868PEUN lRb7CJfRf5fp hOepv8BG8A xPYBR4D1apc LrsRDj9zOk8a ZXZ99yaNBHF fTPSY1EcIhoA sGsGS6oVHeMz UehKO8hbAgp vcZRLnEkMBs jUn9ehHsjTD0 KziHfE6QEM1d i9CLrhL8uz sl0A7q877t HUw3VBr9gnX QYhceK9P3hoP i4BvNYf7HK nmVa3EylcxdF Pv36ydWkbXj BkI88FqWLv Amgs45OsnYBL quQye8lKdStW brgvMKz8Ojg9 tK7m9xyUAZG9 aROQYhxJJMC IYYHdkh50d5V 5VGyZqpNKx p4B5J69dPOk v6N5QvdtPL 2P4lvaaoWC8p HnT7oPsCd5v5 gasMuyofK7 qA6h35L3RN 3kEZKv3u9C cT8tz2be0b89 aXb0O9XTk4Yv go8EuSBTdJ5h 2lPbEXqft3 clrXk56MRIej P2Zjj3K8YS0 xnWZ91CXA5a n6WRa3mCD0rT HeKlwA4ogxIq Hl10asqO9h6 OGSJBEjP58 meUKjsIiwKo j7EW73JsZ2u 1YwRYJEzCLnb odbn73tLmAw HAvqh69qZG GFOTZHteWhD9 xL1SGDkJCO7 IEVWD5ypynC JRJeXFKmJb Cwob6c9Rnvc hYNU9PDwyOP ItdzkROg3IP hpg1LL0EIp 7gMWneea3t tL5VRcjQAdZ IUhWetrpzgEq ORdiItI7ka4 WiDdS4Iurm7T LBrg4fSb6ES Qu0CVlotb9 xSZZ21XAk5P 5rjPfm547rxY kKC3I48TX1YI pcW5CnpD3jWn pRd9cVd13YLO k5fj9svQO7GS B1FqnMzjQr6 bquH99Ptxg cAnHDETFPbHp 67WXPgaXswW 0urr0nc9hEeZ EvrBt8AELnmm cqq47MalXvG 0YvbMLV4tzh zBfVfwDv8L JW8VeQynRQtu P4eRDadFaH HN6ofQIPDk Cn5oCMMa8x9 mWwtSWbgXK 4W7E6eTnuIH Jb0ipoe5kHC X5dq1fWaAM aXvM1RL58TjD 0iBAqWoShL d3Q3p4jHaz4 OHE4roz1Mkeb h9QIwhsbcyU 6r5mXGSkfx 8N0mCgu0Dk 3JdQoNb64f1M 7d7IT30UiZ 6xHs3i3wgt tbidkQjaaM cqTM19P1Xh u4V1aVHyybx FKGdPpPNhHnG 7SZPh7O7Tfei WtOKgrpinVi HA5nayqchAg hIqVxbGfNC y123cZJ3KfU 1tKbGrvqs2U nGxr8qwz6vv 48vopP2fnQLn BojvBj2VfLh ZWjMX7MboG doV5ztePWVUg zjNbhFsCOI mGmLmagj7ke4 Rnv3vXlL536c F3xS05VMbPu ejqW8CUhb0pB uebewlkB7RWn goAU9lMRCzV mWifQ0O2Qd YnQzUN0JV0Hl ACwTJBgOmt AZXcYRFjyk8a OoVAM2Gz9R 8kKU3u16ZF VVpiPJAIM4Y 7tPYNFdend S8l5NQiQeb 5xYAe98g4V5 uUzb1lzk9G wcl0kHeqLLv 7jGHwOGOg63u yG51UulNgJo dFJEfC3tiK DmNQ67A8AxO DuAjozxZFm Ov4pOWTD7z GohxEBIFTE 0c2L3dTN1Nk SrCakFRgtE5 aFfN5ZelvJjJ Lxd3DPhN2g yBvYu9rGJw CcWCplFFcEI9 F1sB31CXGDn kCqrDsTu7i LOwPSum5IplS ohEkZMp8bY 6pTTZXmhQma1 KDTyCmeEUf64 dmZyKK1nVjCJ xdqnNar16Y3B RzAfCwFTniv Coj06jGkd8ey rUhNBODpcyqe Lpw49s9oeey VJgegHHOxI MPyTCSmu2ZXq vWvYrRtIwU wBcaeHI48agZ EPBaNc4iAWSq vs1kpLN6vyG umWaFEFBp47 bstVlu8FsH BJawR9ii8q jndaENbrOku XbhhcOEmqhZy W5l0w2k8r4 YE5CGnDaZc QpUCtkoIw4zZ MWCGlRqAYwh EbVJLyDVdaxZ IlpZorTRhHY HbQ3BpbGTAC O9FCxQuk2f A1VFJiis50Q OfqgZxL9tvkD UsIUoWvSQsJ MaM7xCjhRy WQ0MZfR4gi bhTKQZfGieAj p42wU76QOJsS tMZMyNGzMI ZxIXNTLDZh 9NzNsGr3lnx 2gE2ebnuzB 6l52uofUDE GcQdJ5Xcnk PEDWawyCCVy 24yBbFEZtqsR yFs0rnWYdz AYJOZb4q1R pC4o09SbcrqM 3Ph8yM3Ejud UBA00ufDaXdb m8OiuclHjniC pner3CmGQ0 3EQznZNp5w UjSyVrLsPbY 7716tIaztgU vEG1hJUKQ1 eOktzwzCmhi7 9PVpuTmHjJ grIVyNrzOh nBITdcuZAeZ ZiSQHMqfVD HbGaNRZxsue S9eTH6KdpLoe l2HRND3XMzbY FPzv7XbR7Fj rU3y3E7S9wGV agHaVHJmqk gmHtV9BMy0U Us4wjVtB4G HywnkGk6ofg 7xU1TyPhPf zza03sctDp dma3ZXd3c8j7 kMSxZcDQzoJ Ylv7NWeebBV 2gJrNJ6NOr fzOPPv80sZ 1MMlt51AsvNp a4gXaPONM19 tLWwUKJ6Xw3k 0pj4BBCqz8 eakgRqN4yIsW 8dGZkCW5rii LrezLdxxE7Q gPHZ9KMbrJBc 3oSHVPmWQnNc ApoCyqogwRaR rjeaJzrxSK7 v8MPA3CStH CJKsTuRInOw Z00yXfEsL4vi zkq9Py9sKMCP 2CeXK2ntJSfz ypEOAE4fXMPl CAqchiSSuQd cvfPaV1MkDk 5WVdYoCGagGD BUkIidm05P nFUT2dyIKF6C yau7FOTyB6 p4UXwlMA81JH dlpPNNFG3lLW bBBnhhOonDFO WOUBqnzZTb l3FgAat755s8 Xva2KxGSDo h5oEw1HHX2N EW1SlQsMoH RqjmW6O7Hz z2UiPCLmxqPI w6YjlVYqLgW XeZRZQ0DUBfc fhH0KowwChMF 6MVkfExaSOjv IF8D1cWHey boFEXPyVbKl wY5gMroHQx OpuJomzyO8wz tFeB5uGm7g xhOZfQb44Oy PIJbKaVtYTp lLJHigQ0HHI SWHSo6l1zol8 NdpDqv1Jtwle Ikz4cKBVeKL i8q0Rk2QDrd4 1PBEcz4elRT VyvGVw8iSNu m6JrPeObYg C1ayW0jgblc D6kLesoEDi eLrc1zQRLgr t1arn1OM67 iofZB8qIho MyjkakCLv3 k0Me0FBsMT1 OJ3sU1B0pvGQ AE3XMuQarW frG4zQ3cQDQ3 JPVNIj870nKi VrzoWV13xIh hZNKL8wrJrL ax76d3LTNBK Y4vfpbz0fpBu 087dbkEFPN zDHQ3gCoPGe awcMAG50aVU bxb0mjCsWv wyuA1OnODXTv kl1r02eCm4 SDKE5WJ255l 86H9mel4YD lBGzdZfjkVV8 VdqpWJebkAm DOmLXHojIz iaW59xdPZqmv lDzSMwu66A8p xh49eSrZpqA iUfYVMFVPqaY BmvRbBjpEwl8 X09JvZRoFGt dTlhG67i9uko 8CjuZVKAIAi y8CpnZH0wwOG ryTWEuoFt2fP tamwFGfhnd hzTCNWTwIe grMDcqgS1y0 eWXSJslVqzd bxXJr1YDgvrK IKfIIUE1cZ3 54Z1oBtSNa GrBLKT7jrF8a VZOG5Y9acjPZ W7ndhZfLod8c che5pWwabaN i8hqrTaw35 3cl0FFBOt2Rb 2QF0BG7FcYg AjxfwoMX95 BkKLIMPzRc jrnuiZxXND 3NrqK4AsapG MzvO5NvGGLi FT3tj2fzao jNkjbizjxFx1 iVkZHfQLiTJ 50PzOWDb644 XuskOxXue08 uAQhbRZwxePs 1OVP3PP9LQP ilJkzFrAb8 vY3NANIojN JwdBKv65qC0z l29bPLpE6Or4 IVQgo0i8Rd RTznPqctzJPW tnHsMAwnJFn9 ZXvVxM5qbIP UJWhdB3BmiE CvzdmOO0rQj 6qw5Kwy9VqNM fmKTFVZHGhtH PGACntEQrJ aWiE0CHeY0 RRFStB27MYBQ HhX4P5eDHPm 76Tpj34FU4 qjZfQHmGJQ dMzMxRSBxLHj KilGHX09kldo bVKwFkAtnd 3N9abbSMN1Dg e2fHgNlz3R1 20vfJRcF1Vfp kWpytPlqtkvm 6AjLvHGGEX8 qX7jrpwWTE IYUOBCs4k3 EFJMYLXLrQV ot9vaJvB2H CqHWYg3oFH UfIUE08gU6 eKxoBx9ZfD 4uPkZP367QE T0ldNSYq8EE4 ofBehpagK9 5o13G0IeXF W5IpQbgv9A ERiNXWCDprX P0dYlkj3bJxL w1gl4wutCg uUZkbIYCXX D3t76e91RX d6wlMVTKVS3 mEKLPv8o10AQ tLfRpYcAQELo QSgLCr0GVm2m X37UHsQpLy d97trnx08Z8 EbzqNS78435 qNWpeOvHkfQz mduTv1JBxcs ThtqljqxqX mPg9LzpcdM9 JgOTFAf0eIM 21uZQcGFuD3v Y1zqBbSxWRSQ CexZisqqTBDa rbexfnu3yRK bux1B74EYXK7 lPOLuHV7TO kI0BlY8gzR hsYnjIBf2i6 ukIDVOa1t1G tromlF6q7Cn qwI0Z69CAr lxBoyz6RoTbb oMMxyxD6MOC Ytq5Ygjroih 4jtQ0UVUvoo BcHt0H0XfznI KAp9JW2Eq7Uj xIlMnGIaUbd B0sVL4YTDE 2UUqDRZwXVd p8iTW7bieCv CY0S0N6iEfL or5BMkytJe NjSDxohdTAK U7oBBTkhcw XBBrBuaRaGKB J9NlqeeAiR C9bycM5CmBL oaT1QetFM1 f0Hh0wa1DYdb QxqsmgkLn0 rKUGBD2Mjk iOfy4SvsOp 1J55WUPiCSek J7DzfRvVVOS v7keWk8QGIj qYwPJvS9m8wn V2lwqelBBwgq pMOtqr5HG2y qYhmOlZPch8 dKbFKanId5 JAEavFS4vR 3pxzeGF9tI eCw74uu4Sla yXbZtnMJbM 3YZ9m7RXpl L1tOebRHHK OEUtvSPby1 V9GSZMcsCLe u71k52cnIHX JcVauZyH6ZhZ TM8GVkpAyZDV XcbzDeEVmqUu ZGlRp2kQk0 enx2mhd6aZ 0tbLQ6QwZ0gb aHZYkfAc5i 3vdlnFVq1PS3 hfSPL7UNEoN RqC16PPUGEr xMKzihsbJ9E kA2C66YI889 dX2P4VxTa2 kiFG2atte4k E5ba2wmZsbAS vyISaWP0q0A TdTDGfqLcB DkggwnaDmVBY WEAPr5lfHOl 2gftsFkCtn4 ObxzcsJ4rAl 7drsOFUlJcV 0Db4EDWWPkX NI4UmwdoWg RlJUcSqFrWOS xlOCMB7xHt 6swp8Wwqrip htiDBCoUPW YmuEtvrGOsQh TGrI3cuvC7 9AfdisE29iZq gUahMt8PioP We0tga5EFWG Igc9CaApCc lFmnIm6EGv jbGFV81OVN WHph3tbC3BY 3SeQgYurZPuW h9R5TqVaVuh bv5pE8VPejK gFMguvNpzH KGu0aB9sYr r4k1I7DIRho 8wLw3ERu0Y1z YLwJMZFoTN Kb2jHgoGn9cy swmaHEGNETfc SrKMOn26pnL ZZ7R6xQMzu7i pQvLr6wYZO DPhVg69sEkHG WPtoE0j1vH bN0HAn8tWj aUakqSXSK9 NnHF6vmpJD lpD9orIQo3Cq MK9gVfuEmIEh BBdKuh1Kxu J38BwkXxg5s PbiF8XoXyEmk YFWtuQN6fc DqIPXJa0iH O7KP4KvqQS xmgSyRuDRm kysplUawQb vpGQpDF7p3 PGnV6H4Tycz sa1VjPbnJ2dW Z4ViedosVq jyz0mReBlr0K wJGeGi9aWBO8 2OOzgr6HfQ ssi9ZmMYl0 1fwKCGd66Y9c vYq1mxyclIFS lMOwI2begi7 g1YgLu9JBjS1 Tgcfb6V9DuTK U7pH3oP4HAxf ZAFIKKOmHBR dobHG7MsTd 8qq4fu5xHp zRzGjlL12jfU uu4TFykGMvW9 nWsedF9t2CF 5FxfJxwK46 mLez6oxa4PN SyrVDCmVjrKp 40ZxkXpbhRvD mcjy5FAd4GG BUirrYoJvYyl 9oyrC5DOn0 goBnZe7E1S4b BlT9qKkKbMRX rTvrqb4qUyC 1tKtFJill3 LnAa5YucuE iWNFWPH7Twnv vg5bDSVkefx lwwVl8p1CS YL6UOJt9EL EHINTC9zwi ziFXjrhB6LT hADaIjh8AGw V0WrSi5axqF AO5OrvYVVP x1WIQ0aaWxMM RqYVr2H0T2I EbbVnKveCp a85ACTwsRe MVh57Bhy0tr qFXd0LaTGni zBzGVAY4qGK UBrWFHZhux5 ELbyWQUZV4wv tu5CA3AfXf TgwZktHzah lyKtIZW0d5V EVrLPSUFY7 FLAGN088kQS oMbTTIlbwb1I rQWrvt6XbaRL gNNKUpAmLkm Pyne2nugKA k7fhlzG06hr SrH1QUr7icF 1bbpT96mqBjg 3D3jy2ka3mqg 5PzopziwKS JJhkLhenI1ww VMg0kiXNd1 2Z8euGllxA3 CYm9Dc43PfSl 6Yqod33dyRx ktLGdC8wuf sRn1t7fn0VyV Wi6XjbjDDAPm YTcxKQvon1cb mZZ1fGQQB5 Qnx79mia76r qzxI19t6Br egfh475CoW WXEaBqwPJSc IxRHBr5qALo SxXUbFD3G6cw AlJf1G2QKtF 1krvQUvkQ05y ZfdGOWzk4fD 1zPh8lUYdt01 CSWJNpd10byt ay91cbL7Hc DWGNTQ8seksv celUrZW74PWz tVjDRKoxJsHZ pCB4KUlawW YtOWZDRg2WhX IdKL7h4uzI Dytt2Ljcev 5eEwWZzwqMd ZA9qv7Ypbw TIwOM6T8C5i ilwWhVq6chLG kGTT9BfGJH4 UgHhP6c9fXQ nmWIjvSDZWHm Y59hgaZtzpdt 6GSPUnTCCppb W4v0eexnjJr c5zakH2XlDQ irjthTrrql fWkICBavcDXG GVQ6H4xCK85 NokbknN0vXDA 54CBgjEPQg T9I36Pby1By i7aElgdcZ3ZI fKu6i5lqD6V 61SXbZ72vBlH vEUfMGE9iy5w OqCUPWG6Q9 vyGDGFckrN lRBDuVOOYi0 EqMCMW013J pBFkVMtK66D ZAVF1Xgecx aO4KIPE5XQf Y80O0YqGxpI UdLDIAa30U 1O00PociXzW8 F2U5YzAQju1E PRnb99lYpGVC zcVcG2z4n7EU 4wxKpM5jiw 1krx0dQ9Uvh CAqI4rac0j KMY4NSbi88I 9bBRmUOaM7 DZ7DcOBOutQ */}",
"function printsArrayInFrame(array) {\n var rectangleWidth = array[0].length;\n var borderRow = '';\n var nthRow = '';\n\n for (var i = 1; i < array.length; i++) {\n if(array[i].length > rectangleWidth) {\n rectangleWidth = array[i].length;\n } \n }\n for ( var i = 0; i < rectangleWidth + 4; i++) {\n borderRow += '*';\n }\n for (var i = 0; i < array.length; i++) {\n var blank = ' ';\n for (var j = array[i].length; j < rectangleWidth; j++) {\n blank += ' ';\n }\n nthRow += '* ' + array[i] + blank + '*' + '\\n'\n }\n var arrayInFrame = borderRow + '\\n' + nthRow + borderRow;\n return arrayInFrame;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
uint16 Returns true iff the flags have the IGNORE bit set. | function isIgnore(
flags
) {
return (flags & FLAGS.IGNORE) === FLAGS.IGNORE;
} | [
"function noFlags(){\n return (typeof(p) == typeof(v));\n}",
"readUint16() {\n const value = this._data.getUint16(this.offset, this.littleEndian);\n\n this.offset += 2;\n return value;\n }",
"function stillImaginary(mask) {\n for (let i = 0; i < mask.length; i++) {\n if (gpuMult) {\n if (mask[i][1] != 0) return true\n } else {\n if (typeof(mask[i]) == \"object\") return true\n }\n }\n return false\n }",
"function are3rdAnd4thBitsSet(value) {\n return (value & 0b11000) === 0b11000;\n}",
"static bytes16(v) { return b(v, 16); }",
"shouldBeIgnored() {\n if (!this.json_.tag_)\n return false;\n\n var tag = this.json_.tag_;\n if (!tag.startsWith(\"autogenerated:\"))\n return false;\n\n if (tag == \"autogenerated:gerrit:newPatchSet\")\n return false;\n\n if (tag == \"autogenerated:gerrit:newWipPatchSet\")\n return false;\n\n return true;\n }",
"znFlags(result) {\n if (result === 0) {\n this.setFlag(constants.flags.SR_ZERO);\n } else {\n this.clearFlag(constants.flags.SR_ZERO);\n }\n if ((result & 0x80) === 0) { // MSB indicates negative\n this.clearFlag(constants.flags.SR_NEGATIVE);\n } else {\n this.setFlag(constants.flags.SR_NEGATIVE);\n }\n }",
"exists(name) {\n return !!this._modifiers[name];\n }",
"static uint136(v) { return n(v, 136); }",
"function proxyFlag(proxy, flag) {\n\treturn proxy instanceof TubuxProxy && (!flag || proxy._flags[flag]);\n}",
"get isSkipped() {\n return (this.flags & 2) /* NodeFlag.Skipped */ > 0\n }",
"function hasVectorMask() {\n var hasVectorMask = false;\n try {\n var ref = new ActionReference();\n var keyVectorMaskEnabled = app.stringIDToTypeID('vectorMask');\n var keyKind = app.charIDToTypeID('Knd ');\n ref.putEnumerated(app.charIDToTypeID('Path'), app.charIDToTypeID('Ordn'), keyVectorMaskEnabled);\n var desc = executeActionGet(ref);\n if (desc.hasKey(keyKind)) {\n var kindValue = desc.getEnumerationValue(keyKind);\n if (kindValue == keyVectorMaskEnabled) {\n hasVectorMask = true;\n }\n }\n } catch (e) {\n hasVectorMask = false;\n }\n return hasVectorMask;\n}",
"get adaptive() { return this.toneMappingMaterial.defines.ADAPTED_LUMINANCE !== undefined; }",
"isIdentityAs3x2() {\n if (this._isIdentity3x2Dirty) {\n this._isIdentity3x2Dirty = false;\n if (this._m[0] !== 1.0 || this._m[5] !== 1.0 || this._m[15] !== 1.0) {\n this._isIdentity3x2 = false;\n }\n else if (this._m[1] !== 0.0 ||\n this._m[2] !== 0.0 ||\n this._m[3] !== 0.0 ||\n this._m[4] !== 0.0 ||\n this._m[6] !== 0.0 ||\n this._m[7] !== 0.0 ||\n this._m[8] !== 0.0 ||\n this._m[9] !== 0.0 ||\n this._m[10] !== 0.0 ||\n this._m[11] !== 0.0 ||\n this._m[12] !== 0.0 ||\n this._m[13] !== 0.0 ||\n this._m[14] !== 0.0) {\n this._isIdentity3x2 = false;\n }\n else {\n this._isIdentity3x2 = true;\n }\n }\n return this._isIdentity3x2;\n }",
"function isUI16() {\n if (!window.top.angular) return false;\n var a = window.top.angular.element('overviewhelp').attr('page-name');\n return a == 'ui16' || a == 'helsinki';\n }",
"static uint168(v) { return n(v, 168); }",
"static uint208(v) { return n(v, 208); }",
"static uint216(v) { return n(v, 216); }",
"static uint24(v) { return n(v, 24); }",
"static uint32(v) { return n(v, 32); }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the resolved version number of a dependency for a specific temp project. For PNPM, we can reuse the version that another project is using. Note that this function modifies the shrinkwrap data. | tryEnsureDependencyVersion(dependencyName, tempProjectName, versionRange) {
// PNPM doesn't have the same advantage of NPM, where we can skip generate as long as the
// shrinkwrap file puts our dependency in either the top of the node_modules folder
// or underneath the package we are looking at.
// This is because the PNPM shrinkwrap file describes the exact links that need to be created
// to recreate the graph..
// Because of this, we actually need to check for a version that this package is directly
// linked to.
const tempProjectDependencyKey = this._getTempProjectKey(tempProjectName);
const packageDescription = this._getPackageDescription(tempProjectDependencyKey);
if (!packageDescription) {
return undefined;
}
if (!packageDescription.dependencies.hasOwnProperty(dependencyName)) {
if (versionRange) {
// this means the current temp project doesn't provide this dependency,
// however, we may be able to use a different version. we prefer the latest version
let latestVersion = undefined;
this.getTempProjectNames().forEach((otherTempProject) => {
const otherVersion = this._getDependencyVersion(dependencyName, otherTempProject);
if (otherVersion && semver.satisfies(otherVersion, versionRange)) {
if (!latestVersion || semver.gt(otherVersion, latestVersion)) {
latestVersion = otherVersion;
}
}
});
if (latestVersion) {
// go ahead and fixup the shrinkwrap file to point at this
const dependencies = this._shrinkwrapJson.packages[tempProjectDependencyKey].dependencies || {};
dependencies[dependencyName] = latestVersion;
this._shrinkwrapJson.packages[tempProjectDependencyKey].dependencies = dependencies;
return latestVersion;
}
}
return undefined;
}
return this._normalizeDependencyVersion(dependencyName, packageDescription.dependencies[dependencyName]);
} | [
"_getDependencyVersion(dependencyName, tempProjectName) {\n const tempProjectDependencyKey = this._getTempProjectKey(tempProjectName);\n const packageDescription = this._getPackageDescription(tempProjectDependencyKey);\n if (!packageDescription) {\n return undefined;\n }\n if (!packageDescription.dependencies.hasOwnProperty(dependencyName)) {\n return undefined;\n }\n return this._normalizeDependencyVersion(dependencyName, packageDescription.dependencies[dependencyName]);\n }",
"getTopLevelDependencyVersion(dependencyName) {\n return BaseShrinkwrapFile_1.BaseShrinkwrapFile.tryGetValue(this._shrinkwrapJson.dependencies, dependencyName);\n }",
"_getPackageDescription(tempProjectDependencyKey) {\n const packageDescription = BaseShrinkwrapFile_1.BaseShrinkwrapFile.tryGetValue(this._shrinkwrapJson.packages, tempProjectDependencyKey);\n if (!packageDescription || !packageDescription.dependencies) {\n return undefined;\n }\n return packageDescription;\n }",
"function getVersion() {\n var contents = grunt.file.read(\"formulate.meta/Constants.cs\");\n var versionRegex = new RegExp(\"Version = \\\"([0-9.]+)\\\";\", \"gim\");\n return versionRegex.exec(contents)[1];\n }",
"function extPart_getVersion(partName)\n{\n var retrievedVersion = parseFloat(dw.getExtDataValue(partName, \"version\"));\n if (isNaN(retrievedVersion))\n retrievedVersion = 0;\n return retrievedVersion;\n}",
"async getVersionInfo({ state, getters, commit }, {\n repoType, repoName, chartName, versionName\n }) {\n const key = `${ repoType }/${ repoName }/${ chartName }/${ versionName }`;\n let info = state.versionInfos[key];\n\n if ( !info ) {\n const repo = getters['repo']({ repoType, repoName });\n\n if ( !repo ) {\n throw new Error('Repo not found');\n }\n\n info = await repo.followLink('info', {\n url: addParams(repo.links.info, {\n chartName,\n version: versionName\n })\n });\n\n commit('cacheVersion', { key, info });\n }\n\n return info;\n }",
"getArchitectDependencytrackingBuild() { \n\n\t\treturn this.apiClient.callApi(\n\t\t\t'/api/v2/architect/dependencytracking/build', \n\t\t\t'GET', \n\t\t\t{ },\n\t\t\t{ },\n\t\t\t{ },\n\t\t\t{ },\n\t\t\tnull, \n\t\t\t['PureCloud OAuth'], \n\t\t\t['application/json'],\n\t\t\t['application/json']\n\t\t);\n\t}",
"function getVersionNumberFromTagName(strTag) {\n const match = strTag.match(/^v(\\d+)$/);\n if (match) {\n const versionNumber = Number.parseInt(match[1]);\n if (!(versionNumber.toString().length == strTag.length - 1)) {\n exit(`Sanity check failed. Expected ${versionNumber} to be one character shorter than ${strTag}.`)\n }\n return versionNumber;\n }\n else {\n return null;\n }\n}",
"function extGroup_getVersion(groupName)\n{\n var retrievedVersion = parseFloat(dw.getExtDataValue(groupName, \"version\"));\n if (isNaN(retrievedVersion))\n retrievedVersion = 0;\n return retrievedVersion;\n}",
"function getModuleByVersion(modulename, version) {\n version = parseInt(version);\n while (version > 1 && !checkIfVersionExists(modulename, version)) {\n version--;\n }\n return instantiate(modulename, version); //return new modulename.v + version;\n}",
"get toolVersion() {\n return '0.2.0'\n }",
"parseVersion() {\n var version = this.map_['info']['version'];\n var parsed = '';\n if (goog.isString(version)) {\n parsed = parseInt(version, 10);\n if (isNaN(parsed)) parsed = version;\n else parsed = parsed.toString();\n this.version = parsed;\n }\n }",
"function getPackageInfo(installPackage) {\n if (installPackage.match(/^.+\\.(tgz|tar\\.gz)$/)) {\n return getTemporaryDirectory()\n .then(obj => {\n let stream;\n if (/^http/.test(installPackage)) {\n stream = hyperquest(installPackage);\n } else {\n stream = fs.createReadStream(installPackage);\n }\n return extractStream(stream, obj.tmpdir).then(() => obj);\n })\n .then(obj => {\n const { name, version } = require(path.join(obj.tmpdir, 'package.json'));\n obj.cleanup();\n return { name, version };\n })\n .catch(err => {\n // The package name could be with or without semver version, e.g. init-nose-server-0.2.0-alpha.1.tgz\n // However, this function returns package name only without semver version.\n log(`Could not extract the package name from the archive: ${err.message}`);\n const assumedProjectName = installPackage.match(/^.+\\/(.+?)(?:-\\d+.+)?\\.(tgz|tar\\.gz)$/)[1];\n log(`Based on the filename, assuming it is \"${chalk.cyan(assumedProjectName)}\"`);\n return Promise.resolve({ name: assumedProjectName });\n });\n } else if (installPackage.startsWith('git+')) {\n // Pull package name out of git urls e.g:\n // git+https://github.com/MohamedJakkariya/ins-template.git\n // git+ssh://github.com/mycompany/ins-template.git#v1.2.3\n return Promise.resolve({\n name: installPackage.match(/([^/]+)\\.git(#.*)?$/)[1]\n });\n } else if (installPackage.match(/.+@/)) {\n // Do not match @scope/ when stripping off @version or @tag\n return Promise.resolve({\n name: installPackage.charAt(0) + installPackage.substr(1).split('@')[0],\n version: installPackage.split('@')[1]\n });\n } else if (installPackage.match(/^file:/)) {\n const installPackagePath = installPackage.match(/^file:(.*)?$/)[1];\n const { name, version } = require(path.join(installPackagePath, 'package.json'));\n return Promise.resolve({ name, version });\n }\n return Promise.resolve({ name: installPackage });\n}",
"function getFontAwesomeVersion() {\n return new Promise((resolve, reject) => {\n fs.readFile('node_modules/@fortawesome/fontawesome-pro/less/_variables.less', (e, data) => {\n if (e) {\n reject(e);\n } else {\n const match = data.toString().match(/fa-version:\\s+\"(.+)\";/);\n if (match) {\n resolve(match[1]);\n } else {\n reject('Pattern not found');\n }\n }\n });\n });\n}",
"function resolveWithMinVersion(packageName, minVersionStr, probeLocations, rootPackage) {\n\t if (rootPackage && !packageName.startsWith(rootPackage)) {\n\t throw new Error(`${packageName} must be in the root package`);\n\t }\n\t const minVersion = new Version(minVersionStr);\n\t for (const location of probeLocations) {\n\t const nodeModule = resolve(packageName, location, rootPackage);\n\t if (nodeModule && nodeModule.version.greaterThanOrEqual(minVersion)) {\n\t return nodeModule;\n\t }\n\t }\n\t throw new Error(`Failed to resolve '${packageName}' with minimum version '${minVersion}' from ` +\n\t JSON.stringify(probeLocations, null, 2));\n\t}",
"function getGoVersion() {\n var goRuntimePath = goPath_1.getGoRuntimePath();\n if (!goRuntimePath) {\n vscode.window.showInformationMessage('Cannot find \"go\" binary. Update PATH or GOROOT appropriately');\n return Promise.resolve(null);\n }\n if (goVersion) {\n return Promise.resolve(goVersion);\n }\n return new Promise(function (resolve, reject) {\n cp.execFile(goRuntimePath, ['version'], {}, function (err, stdout, stderr) {\n var matches = /go version go(\\d).(\\d).*/.exec(stdout);\n if (matches) {\n goVersion = {\n major: parseInt(matches[1]),\n minor: parseInt(matches[2])\n };\n }\n return resolve(goVersion);\n });\n });\n}",
"async function getChecksum(project, changes, yarnLock, osd, log) {\n const sha = await getLatestSha(project, osd);\n\n if (sha) {\n log.verbose(`[${project.name}] local sha:`, sha);\n }\n\n if (!changes || Array.from(changes.values()).includes('invalid')) {\n log.warning(`[${project.name}] unable to determine local changes, caching disabled`);\n return;\n }\n\n const changesSummary = await Promise.all(Array.from(changes).sort((a, b) => a[0].localeCompare(b[0])).map(async ([path, type]) => {\n if (type === 'deleted') {\n return `${path}:deleted`;\n }\n\n const stats = await (0, _promises.stat)(osd.getAbsolute(path));\n log.verbose(`[${project.name}] modified time ${stats.mtimeMs} for ${path}`);\n return `${path}:${stats.mtimeMs}`;\n }));\n const depMap = (0, _yarn_lock.resolveDepsForProject)({\n project,\n yarnLock,\n osd,\n log,\n includeDependentProject: false,\n productionDepsOnly: false\n });\n\n if (!depMap) {\n return;\n }\n\n const deps = Array.from(depMap.values()).map(({\n name,\n version\n }) => `${name}@${version}`).sort((a, b) => a.localeCompare(b));\n log.verbose(`[${project.name}] resolved %d deps`, deps.length);\n const checksum = JSON.stringify({\n sha,\n changes: changesSummary,\n deps\n }, null, 2);\n\n if (process.env.BOOTSTRAP_CACHE_DEBUG_CHECKSUM) {\n return checksum;\n }\n\n const hash = _crypto.default.createHash('sha1');\n\n hash.update(checksum);\n return hash.digest('hex');\n}",
"function checkForLatestVersion() {\n return new Promise((resolve, reject) => {\n https\n .get('https://registry.npmjs.org/-/package/init-node-server/dist-tags', res => {\n if (res.statusCode === 200) {\n let body = '';\n res.on('data', data => (body += data));\n res.on('end', () => {\n resolve(JSON.parse(body).latest);\n });\n } else {\n reject();\n }\n })\n .on('error', () => {\n reject();\n });\n });\n}",
"function bumpVersion (pkg) {\n const version = pkg.version.split('.');\n version[2] = parseInt(version[2]) + 1;\n pkg.version = version.join('.');\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
adds a hierarchical structure to the subdymos of the given dymo in the given store | function addStructureToDymo(dymoUri, store, options) {
var surfaceDymos = getAllParts([dymoUri], store);
var points = toVectors(surfaceDymos, store, false, true);
var occurrences = new siafun_1.StructureInducer(points, options).getOccurrences(options.patternIndices);
createStructure(occurrences, store, dymoUri, surfaceDymos);
} | [
"function addFromObjArray(oArry, idKey, silent) {\n oArry.forEach(function (obj) {\n\n var id;\n\n if (obj.hasOwnProperty(idKey)) {\n id = obj[idKey];\n } else {\n id = _id + 'child' + _children.length;\n }\n\n add(Nori.model().createMap({id: id, silent: silent, store: obj}));\n });\n dispatchChange(_id, 'add_map');\n }",
"UPDATE_LIST_CHILD(store, key){\n\n if (store.openListChild.includes(key)){\n var index = store.openListChild.indexOf(key)\n store.openListChild.splice(index, 1);\n }else{\n store.openListChild.push(key)\n }\n }",
"function put_to_nodes(node, obj) {\n\t var leaf = isleaf(node, obj);\n\t if (leaf.leaf) node.l.push(obj);else if (leaf.childnode) _put(leaf.childnode, obj);else return;\n\t }",
"function populateTree(data) {\n for (let n=0;n<data.children.length;n++) {\n populateTree(data.children[n]);\n }\n console.log(\"adding node:'\"+ data.name + \"' id:\"+data.id);\n nodeListByName[data.name]=data.id;\n}",
"function addStore(store) {\r\n var ul = document.getElementById(\"store_list\");\r\n var li = document.createElement(\"li\");\r\n li.appendChild(document.createTextNode(store[\"name\"]));\r\n ul.appendChild(li);\r\n}",
"addToTree({ state, commit, getters }, { parentPath, newDirectory }) {\n // If this directory is not the root directory\n if (parentPath) {\n // find parent directory index\n const parentDirectoryIndex = getters.findDirectoryIndex(parentPath);\n\n if (parentDirectoryIndex !== -1) {\n // add a new directory\n commit('addDirectories', {\n directories: newDirectory,\n parentId: state.directories[parentDirectoryIndex].id,\n });\n\n // update parent directory property\n commit('updateDirectoryProps', {\n index: parentDirectoryIndex,\n props: {\n hasSubdirectories: true,\n showSubdirectories: true,\n subdirectoriesLoaded: true,\n },\n });\n } else {\n commit('fm/messages/setError', { message: 'Directory not found' }, { root: true });\n }\n } else {\n // add a new directory to the root of the disk\n commit('addDirectories', {\n directories: newDirectory,\n parentId: 0,\n });\n }\n }",
"saveTreeData(treeData) {\n var notebookFlat = {};\n notebookFlat.subnotes = {};\n notebookFlat.topLevelSubnotes = [];\n //top level subnotes are the top level objects of treeData\n for (var i = 0; i < Object.keys(treeData).length; i++) {\n notebookFlat.topLevelSubnotes.push(treeData[i].id);\n }\n\n for (i = 0; i < Object.keys(treeData).length; i++) {\n var id = treeData[i].id;\n notebookFlat.subnotes[id] = {};\n notebookFlat.subnotes[id].subtopic = treeData[i].title;\n notebookFlat.subnotes[id].note = treeData[i].subtitle;\n if (Array.isArray(treeData[i].tags) && treeData[i].tags.length > 0) {\n notebookFlat.subnotes[id].tags = treeData[i].tags;\n }\n if (Array.isArray(treeData[i].flashcards) && treeData[i].flashcards.length > 0) {\n notebookFlat.subnotes[id].flashcards = treeData[i].flashcards;\n }\n this.addChildrenToFlat(treeData[i], notebookFlat); //add info from all children (and children of children, etc)\n }\n this.setExpandedNodes(treeData); //update expanded state in app\n return notebookFlat;\n }",
"async function addOrgUnitsToData(ous){\n for(var eachOU of ous){\n var childElement = {\"name\": eachOU[\"name\"], \"path\": eachOU[\"orgUnitPath\"], \"parentPath\": eachOU[\"parentOrgUnitPath\"], \"users\": []};\n flatdata.push(childElement);\n }\n // add root OrgUnit to data\n for(var ou of ous){\n if(ou['parentOrgUnitPath'] === \"/\"){\n rootID = ou['parentOrgUnitId'];\n var response = await fetch('https://www.googleapis.com/admin/directory/v1/customer/my_customer/orgunits/' + rootID, {\n headers: {\n 'authorization': `Bearer ` + token,\n }\n });\n var root = await response.json();\n var rootElement = {\"name\": root[\"name\"], \"path\": root[\"orgUnitPath\"], \"parentPath\": null, \"users\": []};\n rootOUName = root[\"name\"];\n flatdata.push(rootElement);\n\n // convert flat data to nested json with hierachy\n data = d3.stratify()\n .id(function(d) {return d.path})\n .parentId(function(d) {return d.parentPath})\n (flatdata)\n addUserToData();\n }\n break;\n }\n}",
"function setStructure(d, tendancy, depth = 0) {\n d.children = d.children || [];\n d.leaves = d.children.length? [] : [d];\n d.depth = depth;\n if (d.children.length) {\n d.children.forEach(function (child) {\n setStructure(child, tendancy, depth + 1);\n child.parent = d;\n d.leaves = d.leaves.concat(child.leaves);\n });\n }\n\n d.size = oreq(d.size, sum(d.leaves, d => d.size));\n\n d.x = oreq(d.x, (tendancy.x || tendancy)(d.leaves, d => d.x, d => d.size));\n d.y = oreq(d.y, (tendancy.y || tendancy)(d.leaves, d => d.y, d => d.size));\n }",
"add (child) {\n this.contents.push(child);\n child.parent = this;\n }",
"_setChildren(item, data) {\n // find all children\n const children = data.filter((d) => item.id === d.parent);\n item.children = children;\n if (item.children.length > 0) {\n item.children.forEach((child) => {\n // recursively call itself\n this._setChildren(child, data);\n });\n }\n }",
"function store() {\n customs.push(custom); //stores custom arrays\n custom = {\n name: \"\",\n opt: [] //clears custom array to get new things\n };\n}",
"function addItemToTree (item) {\n\t\tlet newNavItem = $protoNavItem.clone(),\n\t\t\t$newNavItem;\n\n\t\tnewNavItem = newNavItem.html()\n\t\t\t.replace(/__ID__/g, item.id)\n\t\t\t.replace(/__PAGE_ID__/g, item.page_id)\n\t\t\t.replace(/__TEXT__/g, item.text || '')\n\t\t\t.replace(/__URL__/g, item.url || '')\n\t\t\t.replace(/checked=\"__BLANK__\"/g, item.blank ? 'checked' : '')\n\t\t\t.replace(/checked=\"__OBFUSCATE__\"/g, item.obfuscate ? 'checked' : '')\n\t\t\t.replace(/__DATA_ID__/g, item.data['id'] || '')\n\t\t\t.replace(/__DATA_CLASS__/g, item.data['class'] || '');\n\n\t\t$newNavItem = $(newNavItem);\n\n\t\t// Ajouter au body\n\t\t$menuSortable.append($newNavItem);\n\t\t// Afficher la bonne tab\n\t\t$newNavItem.find('.tabs-leads-to a[data-toggle=\"tab\"][data-leads-to=' + item.leadsTo + ']').tab('show');\n\t\t// Changer la valeur de l'input\n\t\t$newNavItem.find('.js-input-page-id').val(item.page_id);\n\n\t\t$menuSortable.nestedSortable('refresh');\n\t}",
"function dataset_put(ds) {\n const newds = (ds.id) \n ? topStack().datasets.map(d => d.id === ds.id ? { ...d, ...ds } : d)\n : [ ...topStack().datasets, { \n id: topStack().datasets.length + 1,\n notes: [], \n ...ds,\n } ];\n // validate here\n pushNext({ \n ...topStack(), \n datasets: newds, \n });\n}",
"pushPayload(store, payload) {\n const documentHash = {\n data: [],\n included: [],\n };\n\n Object.keys(payload).forEach(key => {\n const modelName = this.modelNameFromPayloadKey(key);\n const serializer = store.serializerFor(modelName);\n const type = store.modelFor(modelName);\n\n makeArray(payload[key]).forEach(hash => {\n const { data, included } = serializer.normalize(type, hash, key);\n documentHash.data.push(data);\n if (included) {\n documentHash.included.push(...included);\n }\n });\n\n store.push(documentHash);\n });\n }",
"function addSeries(id) {\n //check apakah sudah ada di series\n if (mySeries[id]) {\n //sudah ada\n mySeries[id].showAllSeries(true);\n } else {\n //belum ada\n //tarik json\n $.getJSON(base_url + \"compare/get_tree/\" + id, function (d) {\n //d is the root, could be a leaf as well\n mySeries[id] = new NodeSeries(d)\n mySeries[id].showAllSeries(true);\n });\n }\n }",
"transformStores (app) {\n const stores = app.config.database.stores\n const jsdata = {}\n Object.keys(stores).forEach(key => {\n const connection = lib.Adapters.loadConnection(stores[key])\n let store = new JSData.DS({\n cacheResponse: stores[key].cacheResponse || false,\n bypassCache: stores[key].bypassCache || true,\n keepChangeHistory: stores[key].keepChangeHistory || false,\n resetHistoryOnInject: stores[key].resetHistoryOnInject || false,\n upsert: stores[key].upsert || false,\n notify: stores[key].notify || false,\n log: stores[key].log || false\n })\n\n _.each(stores[key], (value, key) => {\n if (['cacheResponse','bypassCache','keepChangeHistory','resetHistoryOnInject','upsert','notify','log'].indexOf(key) == -1) {\n store[key] = value\n }\n })\n\n store.getConnectionName = () => {\n return key\n }\n\n store = lib.Adapters.loadAdapter(store, connection)\n\n jsdata[key] = store\n })\n\n return jsdata\n }",
"function addRelationship(childIdIn, parentIdIn, callback) {\n // console.log(' addRelationship: ', childIdIn, ' parent id in: ', parentIdIn)\n var item = {}\n var parentId = {}\n if (parentIdIn) { //\n parentId = parentIdIn\n } else { // no parentId so it must be a top element\n parentId = rootId\n }\n item = {_id: childIdIn, children: [], parent: parentId, time: new Date()}\n topologyDataBase.save(item\n //,{w:1}\n , {upsert: true}\n , function (err, itm) {\n topologyDataBase.update({_id: parentId}\n , {$addToSet: {children: childIdIn}}\n //,{w:1 }\n , {upsert: true}\n , function (err1, itm1) {\n if (err1) {\n callback(err1)\n }\n if (itm1) {\n callback(itm1)\n }\n })\n })\n}",
"addSegment(segment) {\n this.segments.push(segment)\n segment.points.forEach(function (point) {\n point.paths.push(this)\n }, this)\n }",
"function addUserToOUByPath(node, path, user){\n if(node.data['path'] === path){\n node.data['users'].push(user);\n return;\n }\n else{\n if(node['children'] === undefined)\n return;\n var children = node['children'];\n for(var ou of children){\n if(path.includes(ou.data['path'])){\n addUserToOUByPath(ou, path, user);\n }\n }\n }\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function: _fnBuildSearchRow Purpose: Create a searchable string from a single data row Returns: Inputs: object:oSettings dataTables settings object array:aData Row data array to use for the data to search | function _fnBuildSearchRow( oSettings, aData )
{
var sSearch = '';
if ( typeof oSettings.__nTmpFilter == 'undefined' ) {
oSettings.__nTmpFilter = document.createElement('div');
}
var nTmp = oSettings.__nTmpFilter;
for ( var j=0, jLen=oSettings.aoColumns.length ; j<jLen ; j++ )
{
if ( oSettings.aoColumns[j].bSearchable )
{
var sData = aData[j];
sSearch += _fnDataToSearch( sData, oSettings.aoColumns[j].sType )+' ';
}
}
/* If it looks like there is an HTML entity in the string, attempt to decode it */
if ( sSearch.indexOf('&') !== -1 )
{
nTmp.innerHTML = sSearch;
sSearch = nTmp.textContent ? nTmp.textContent : nTmp.innerText;
/* IE and Opera appear to put an newline where there is a <br> tag - remove it */
sSearch = sSearch.replace(/\n/g," ").replace(/\r/g,"");
}
return sSearch;
} | [
"function and_search(data_table, field) {\n\t// alert($('input.and_or_button').bootstrapSwitch('state'));\n\t\n\tcolumn_id = $(field).attr(\"name\");\n\t\t\t\n\t//Get the searched value\n\tvar searched_value = $(field).val();\n\t\t\t\n\t// var searched_value = \"test10 test1000\";\n\t\t\t\n\t//Search the value into the desired column\n\tdata_table.fnFilter(searched_value, column_id);\t\n}",
"function buildRow(countySelection) {\n \n for (let j = 0; j < database.length; j++ ) {\n \n if(database[j].content.$t.includes(countySelection) && database[j].gs$cell.col == 1) {\n let sameRow = database[j].gs$cell.row\n //will iterate through the 26 columns for a-z\n for (let r = j; r < j + columns; r++) {\n \n if(sameRow == database[r].gs$cell.row) {\n row.push({cellnum: database[r].title.$t.slice(0,1), text: database[r].content.$t })\n }\n }\n }\n }\n }",
"function searchArry(data, searchInput1, searchInput2, searchCol1, searchCol2, returnCol) {\n var first = true; // Variable to skip first row for headings\n var returnArry = []; // Initializes return array\n data.forEach(row => { // Loops through each row in table to check for criteria\n if (!first) {\n if (row[searchCol1] == searchInput1 && row[searchCol2] == searchInput2) returnArry.push(row[returnCol]);\n } else first = false;\n })\n return returnArry;\n}",
"function row(table, column, match, val_column) {\n for (var i = 0; i < table.data.length; i++) {\n var uc = column;\n if (!table.data[i][uc]) {\n Object.keys(table.data[i]).every(function(k) {\n if (u(k) === uc) {\n uc = k;\n return false;\n }\n return true;\n });\n }\n if (table.data[i][uc] && u(table.data[i][uc]) === match) {\n var ret = table.data[i][val_column];\n assert(ret, 'Cannot find ' + val_column + ' matching ' + match + ' at ' + uc);\n return ret;\n }\n }\n console.log(JSON.stringify(table.data));\n assert(false, 'Cannot find row with ' + match + ' at ' + column);\n }",
"function generateRow(dataRow) {\n let tr = document.createElement('tr');\n\n repoName(dataRow.full_name, dataRow.html_url, tr);\n repoLanguage(dataRow.language, tr);\n repoTags(dataRow.tags_url, tr);\n addFavorite(tr);\n\n document.querySelector('tbody').appendChild(tr);\n}",
"function epgsearch_json_to_html(data) {\n var html = \"\";\n for (var i = 0, len = data.events.length; i < len; i++) {\n var event = data.events[i];\n\n html += \"<tr class=\\\"event_row visible_event\\\">\";\n\n html += \"<td class=\\\"search_type\\\">\";\n html += \"<!-- event_crid:\" + event.event_crid + \", series_crid:\" + event.series_crid + \", rec_crid:\" + event.rec_crid + \". -->\";\n html += \"</td>\";\n\n html += \"<td class=\\\"search_channel\\\">\";\n if (event.channel_name != \"\") {\n html += \"<div>\";\n html += \"<img src=\\\"\" + event.channel_icon_path + \"\\\" width=20 height=20 alt=\\\"\" + escapeHtml(event.channel_name) + \"\\\"/>\";\n html += \"<span>\" + escapeHtml(event.channel_name) + \"</span>\";\n html += \"</div>\";\n }\n html += \"</td>\";\n\n html += \"<td class=\\\"search_title\\\">\";\n html += \"<div>\" + escapeHtml(event.title) + \"</div>\";\n html += \"</td>\";\n\n html += \"<td class=\\\"search_synopsis\\\">\";\n html += \"<div>\" + escapeHtml(event.synopsis) + \"</div>\";\n html += \"</td>\";\n\n html += \"<td class=\\\"search_datetime\\\" sval=\\\"\" + event.start + \"\\\">\";\n html += formatDateTime(event.start);\n html += \"</td>\";\n\n html += \"<td class=\\\"search_duration\\\" sval=\\\"\" + event.duration + \"\\\">\";\n html += event.duration + (event.duration == 1 ? \" min\" : \" mins\");\n html += \"</td>\";\n\n html += \"<td class=\\\"search_flags\\\">\";\n if (inventory_enabled) {\n if (event.available) {\n html += \"<a class=\\\"inventory\\\" href=\\\"#\\\"><img src=\\\"images/available.png\\\" width=16 height=16 title=\\\"available\\\"></a>\";\n }\n }\n if (event.repeat_crid_count > 0) {\n html += \" <a class=\\\"repeat\\\" prog_crid=\\\"\" + event.event_crid + \"\\\" href=\\\"#\\\"><img src=\\\"images/repeat.png\\\" width=16 height=16 title=\\\"CRID repeat\\\"></a>\";\n } else if (event.repeat_program_id != -1) {\n html += \" <a class=\\\"dejavu\\\" prog_id=\\\"\" + event.repeat_program_id + \"\\\" href=\\\"#\\\"><img src=\\\"images/dejavu.png\\\" width=16 height=16 title=\\\"déjà vu?\\\"></a>\";\n }\n if (event.ucRecKind == -1) {\n html += \"<img src=\\\"images/175_1_00_Reservation_Watch.png\\\" width=16 height=16 title=\\\"Programme reminder\\\">\";\n } else if (event.ucRecKind == 1) {\n html += \"<img src=\\\"images/175_1_11_Reservation_Record.png\\\" width=16 height=16 title=\\\"Recording programme\\\">\";\n } else if (event.ucRecKind == 2 || event.ucRecKind == 4) {\n html += \"<img src=\\\"images/175_1_11_Series_Record.png\\\" width=28 height=16 title=\\\"Recording series\\\">\";\n } else if (event.crid_ucRecKind == 1) {\n html += \"<img class=\\\"collateral_scheduled\\\" src=\\\"images/175_1_11_Reservation_Record.png\\\" width=16 height=16 title=\\\"Recording another time\\\">\";\n } else if (event.crid_ucRecKind == 2 || event.crid_ucRecKind == 4) {\n html += \"<img class=\\\"collateral_scheduled\\\" src=\\\"images/175_1_11_Series_Record.png\\\" width=28 height=16 title=\\\"Recording another time\\\">\";\n }\n if (event.scheduled_slot != -1) {\n html += \"<a href=\\\"#\\\" class=\\\"cancel_rec\\\" sid=\\\"\" + event.scheduled_slot + \"\\\">\";\n html += \"<img src=\\\"images/schedule.png\\\" width=16 height=16 title=\\\"Schedule\\\">\";\n html += \"</a>\";\n } else {\n var rec = (event.series_crid == \"\" ? 1 : 2);\n html += \"<a href=\\\"#\\\" class=\\\"schedule_rec\\\" xs=\\\"\" + event.service_id + \"\\\" xe=\\\"\" + event.event_id + \"\\\" sch=\\\"0\\\" rec=\\\"\" + rec + \"\\\">\";\n html += \"<img src=\\\"images/schedule.png\\\" width=16 height=16 title=\\\"Schedule\\\">\";\n html += \"</a>\";\n }\n html += \"</td>\";\n\n html += \"</tr>\";\n }\n return $(html);\n }",
"function addRow(row, tableRef, drug) {\n\tlet i, j;\n\tlet occs, ptr, text;\n\tlet newRow;\n\tlet mentioned, mentions;\n\tlet year;\n\n\t// Skip header row\n\tif (row[0] == \"cord_uid\") {\n\t\treturn;\n\t}\n\t\n\t// Check if row contains the search query\n\toccs = findOccurrences(row, drug);\n\t\n\tif (occs.length != 0) {\n\t\n\t\t// Create new row\n\t\tnewRow = tableRef.insertRow();\n\t\t// Add the elements one by one\n\t\tfor (j = 0; j < vCols.length; j++) {\n\t\t\t// Pointer to the wanted columns\n\t\t\tptr = vCols[j];\n\t\t\t// Cases for year storing & author name formatting\n\t\t\t// If on \"Publish Date\" column, Store year for chart\n\t\t\tif (ptr == 9) {\n\t\t\t\ttext = String(row[ptr]);\n\t\t\t\tyear = String(row[ptr]).split('-')[0] - 2000;\n\t\t\t\tif (year >= 0) {\n\t\t\t\t\tyears[year] += 1;\n\t\t\t\t}\n\t\t\t// If on \"Authors\" column, format the text accoringly\n\t\t\t} else if (ptr == 10) {\n\t\t\t\ttext = formatAuthors(String(row[ptr]), ptr);\n\t\t\t// Otherwise, simply get the text\n\t\t\t} else {\n\t\t\t\ttext = String(row[ptr]);\n\t\t\t}\n\t\t\t// Insert the new element to the row\n\t\t\tinsertCell(j, newRow, text);\n\t\t}\n\n\t\t// Initialize the variables covering the number of occurences of our query\n\t\t// and the locations where it was found\n\t\tmentioned = \"\";\n\t\tmentions = \"\";\n\t\t// Go through the occurrences array, sum up and sort the occurences\n\t\tfor (i = 0; i < occs.length; i++) {\n\t\t\tif (occs[i] > 0) {\n\t\t\t\t// extra check to add separator if required\n\t\t\t\tif (mentioned.length > 0) mentioned += \"; \";\n\t\t\t\t// Add the section on the string\n\t\t\t\tmentioned += cNames[i];\n\t\t\t\tif (mentions.length > 0) mentions += \"; \";\n\t\t\t\t// Add the # of occurrences on the string\n\t\t\t\tmentions += String(occs[i]);\n\t\t\t}\n\t\t}\n\t\t// Insert the occurence details on the row\n\t\tinsertCell(j, newRow, mentioned);\n\t\tj++\n\t\tinsertCell(j, newRow, mentions);\n\t}\n}",
"function constructItemRow(rowObject) {\n // Convert to array.\n var rowDataToAppend = constructArrayFromObject(MERGED_SHEET_HEADERS, rowObject); \n // Add the formulas for columns that don't contain static data.\n rowDataToAppend[ORDER_FULFILLED_COLUMN_INDEX] = \" \";\n rowDataToAppend = addOrderDate(rowDataToAppend, rowObject); \n rowDataToAppend = addItemShippedFormula(rowDataToAppend, rowObject); \n rowDataToAppend = addItemTotalFormula(rowDataToAppend);\n rowDataToAppend = addStoreNameFormula(rowDataToAppend);\n // If there is a shipment present, add formulas.\n var orderItemId = rowObject.shipments_shipmentItems_orderItemId\n if (orderItemId != undefined && orderItemId != '') {\n rowDataToAppend = addShipmentFormulas(rowDataToAppend, rowObject);\n }\n // Row data is ready: write it to the array.\n return rowDataToAppend;\n}",
"function datatables_search(dt) {\n dt.columns('task_type:name').search('current').draw()\n}",
"function VLOOKUP(needle) {\n var table = arguments.length <= 1 || arguments[1] === undefined ? [] : arguments[1];\n var index = arguments.length <= 2 || arguments[2] === undefined ? 1 : arguments[2];\n var exactmatch = arguments.length <= 3 || arguments[3] === undefined ? false : arguments[3];\n\n\n if (ISERROR(needle) || ISBLANK(needle)) {\n return needle;\n }\n\n for (var i = 0; i < table.length; i++) {\n var row = table[i];\n\n if (index > row.length) {\n return error$2.ref;\n }\n\n if (exactmatch && row[0] === needle || row[0] == needle || typeof row[0] === \"string\" && row[0].toLowerCase().indexOf(needle.toLowerCase()) != -1) {\n return index < row.length + 1 ? row[index - 1] : row[0];\n }\n }\n\n return error$2.na;\n}",
"function getEditTableRow(columnCount)\n\t{\n\tvar tableRow = \"\"; \n\t for (i=0; i< Columns; i++)\n\t \t{\n\t \tvar curCellName = getUniqueRegionName(MM.EditAutonamePreamble, \"MMTemplate:Editable\", dw.getDocumentDOM(\"document\")); \n\t \tvar curCell = \"<TD>\\n<MMTemplate:Editable name=\\\"\" + curCellName + \"\\\">\" + dw.getDocumentDOM(\"document\").getNBSPChar() + \"</MMTemplate:Editable>\\n</TD>\";\n\t tableRow += curCell;\n\t \t}\n\t \t\n\t return tableRow = \"<\"+\"TR>\" + tableRow + \"<\"+\"/TR>\";\n\t}",
"__getRowString (row) {\n\n var string = \"-\" + row + \"-|\";\n var i;\n\n this.board[row].forEach(function (space) {\n string += \" \" + space + \" |\";\n });\n\n return string;\n }",
"findStringAgainstAllColumns(searchValue) {\n let xmlHttpRequest = new XMLHttpRequest();\n xmlHttpRequest.open('POST', '/findStringAgainstAllColumns', true);\n xmlHttpRequest.setRequestHeader('Content-Type', \"text\");\n let columnAndSearchValue = (this.controls.allSearchInput.value + \":\" + searchValue);\n xmlHttpRequest.send(columnAndSearchValue);\n xmlHttpRequest.onloadend = this.searchQueryReceived.bind(this);\n }",
"searchQuery (value) {\n let result = this.tableData\n if (value) result = this.fuseSearch.search(this.searchQuery)\n else result = []\n this.searchedData = result\n }",
"function ZBULK_readListString(row,firstDataRow){\r\n\tretString = \"\";\r\n\tvalue = \"\";\r\n\tset(\"V[firstVisRow]\", _listfirstvisiblerow);\r\n\tset(\"V[lastVisRow]\", _listlastvisiblerow);\r\n\tset(\"V[lastRow]\", _listlastrow);\r\n\r\n\tfirstVisRow = parseInt(firstVisRow,10);\r\n\tlastVisRow = parseInt(lastVisRow,10);\r\n\tlastRow = parseInt(lastRow,10);\r\n\tlastRow = lastRow*4;\r\n\t\r\n\tif (firstDataRow == void 0 || isBlank(firstDataRow.toString().trim())){\r\n\t\tnRow = 1;\r\n\t\tfor (var iRow = 0; iRow < nRow; iRow++){\r\n\t\t\tobjReeb = <\"#[\"+iRow.toString()+\",0]\">;\r\n\t\t\tif (objReeb.name.label != void 0 && objReeb.name.label.indexOf('644444')>-1){\r\n\t\t\t\tfirstDataRow = iRow + 1;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tnRow++;\r\n\t\t}\r\n\t}\r\n\r\n\tif (row != 'lastvisible' && row != 'last'){\r\n\t\tif ((row > lastRow + firstDataRow - 1) || (row < firstDataRow)){\r\n\t\t\treturn ('E: Cannot find data');\r\n\t\t\tgoto SCRIPT_END;\r\n\t\t}\r\n\t}\r\n\r\n\t// if the firstDataRow is provided, check if the user is trying to read the lastRow or lastVisibleRow.\r\n\tif (firstDataRow != void 0 && !isBlank(firstDataRow.toString().trim())){\r\n\t\tif (row == 'last' || row == 'lastvisible'){\r\n\t\t\tif (row == 'last'){\t\r\n\t\t\t\trow = lastRow;\r\n\t\t\t} else if (row == 'lastvisible'){\t\r\n\t\t\t\trow = lastVisRow;\r\n\t\t\t} \r\n\t\t\trow = parseInt(row,10);\r\n\t\t\trow += firstDataRow - 1;\r\n\t\t}\t\r\n\t\t\r\n\t\tif ((row < (lastVisRow + firstDataRow)) && (row >= (firstVisRow + firstDataRow - 1))){\r\n\t\t\t//data to be read is on the same page.\r\n\t\t\t//adjust row number - must be relative to the current page\r\n\t\t\trow = row - firstVisRow + 1;\r\n\t\t\tgoto CONTINUE_READ;\r\n\t\t} else if (row >= (lastVisRow + firstDataRow)){\t//scroll page down\r\n\t\t\tenter({'process':scroll_down});\r\n\t\t\tgoto SCRIPT_END;\r\n\t\t} else {\t// scroll page up\r\n\t\t\tenter({'process':scroll_up});\r\n\t\t\tgoto SCRIPT_END;\r\n\t\t}\r\n\t} \r\n\t\r\n\tCONTINUE_READ:;\r\n\tfor (var col=0; col<1000; col++){\r\n\t\tvar objReeb = <\"#[\"+row+\",\"+col+\"]\">;\r\n\t\tif (objReeb.isValid){\r\n\t\t\tif (objReeb.name.label == '5'|| isBlank(objReeb.name.toString().trim())){\r\n\t\t\t\tretString += value + ' ';\r\n\t\t\t\tvalue = \"\";\t\r\n\t\t\t} else if (objReeb.name != lastReebName){\r\n\t\t\t\tvalue = objReeb.name;\r\n\t\t\t\tlastReebName = value;\r\n\t\t\t}\t\t\t\r\n\t\t} \r\n\t}\r\n\t\r\n\treturn(retString);\r\n\tSCRIPT_END:;\r\n}",
"function HLOOKUP(needle, table) {\n var index = arguments.length <= 2 || arguments[2] === undefined ? 1 : arguments[2];\n var exactmatch = arguments[3];\n\n if (typeof needle === \"undefined\" || ISBLANK(needle)) {\n return null;\n }\n\n if (index > table.length) {\n return error$2.ref;\n }\n\n var needleLower = (needle + '').toLowerCase(),\n row = table[0];\n\n for (var i = 0; i < row.length; i++) {\n\n if (exactmatch && row[i] === needle || row[i] == needle || typeof row[i] === \"string\" && row[i].toLowerCase().indexOf(needleLower) != -1) {\n return table[index - 1][i];\n }\n }\n\n return error$2.na;\n}",
"function _fnAddData ( oSettings, aDataSupplied )\n\t\t{\n\t\t\tvar oCol;\n\t\t\t\n\t\t\t/* Take an independent copy of the data source so we can bash it about as we wish */\n\t\t\tvar aDataIn = ($.isArray(aDataSupplied)) ?\n\t\t\t\taDataSupplied.slice() :\n\t\t\t\t$.extend( true, {}, aDataSupplied );\n\t\t\t\n\t\t\t/* Create the object for storing information about this new row */\n\t\t\tvar iRow = oSettings.aoData.length;\n\t\t\tvar oData = {\n\t\t\t\t\"nTr\": null,\n\t\t\t\t\"_iId\": oSettings.iNextId++,\n\t\t\t\t\"_aData\": aDataIn,\n\t\t\t\t\"_anHidden\": [],\n\t\t\t\t\"_sRowStripe\": \"\"\n\t\t\t};\n\t\t\toSettings.aoData.push( oData );\n\n\t\t\t/* Create the cells */\n\t\t\tvar nTd, sThisType;\n\t\t\tfor ( var i=0, iLen=oSettings.aoColumns.length ; i<iLen ; i++ )\n\t\t\t{\n\t\t\t\toCol = oSettings.aoColumns[i];\n\n\t\t\t\t/* Use rendered data for filtering/sorting */\n\t\t\t\tif ( typeof oCol.fnRender == 'function' && oCol.bUseRendered && oCol.mDataProp !== null )\n\t\t\t\t{\n\t\t\t\t\t_fnSetCellData( oSettings, iRow, i, oCol.fnRender( {\n\t\t\t\t\t\t\"iDataRow\": iRow,\n\t\t\t\t\t\t\"iDataColumn\": i,\n\t\t\t\t\t\t\"aData\": oData._aData,\n\t\t\t\t\t\t\"oSettings\": oSettings\n\t\t\t\t\t} ) );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/* See if we should auto-detect the column type */\n\t\t\t\tif ( oCol._bAutoType && oCol.sType != 'string' )\n\t\t\t\t{\n\t\t\t\t\t/* Attempt to auto detect the type - same as _fnGatherData() */\n\t\t\t\t\tvar sVarType = _fnGetCellData( oSettings, iRow, i, 'type' );\n\t\t\t\t\tif ( sVarType !== null && sVarType !== '' )\n\t\t\t\t\t{\n\t\t\t\t\t\tsThisType = _fnDetectType( sVarType );\n\t\t\t\t\t\tif ( oCol.sType === null )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\toCol.sType = sThisType;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if ( oCol.sType != sThisType && oCol.sType != \"html\" )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t/* String is always the 'fallback' option */\n\t\t\t\t\t\t\toCol.sType = 'string';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t/* Add to the display array */\n\t\t\toSettings.aiDisplayMaster.push( iRow );\n\n\t\t\t/* Create the DOM imformation */\n\t\t\tif ( !oSettings.oFeatures.bDeferRender )\n\t\t\t{\n\t\t\t\t_fnCreateTr( oSettings, iRow );\n\t\t\t}\n\n\t\t\treturn iRow;\n\t\t}",
"static searchContacts(searchStr) {\n const searchStrLowerCase = searchStr.toLowerCase();\n const searchContacts = ContactsStorage.getContacts().then((contacts) => {\n const matches = [];\n contacts.forEach((contact) => {\n const firstNameLower = contact.first_name.toLowerCase();\n const lastNameLower = contact.last_name.toLowerCase();\n const emailLower = contact.email.toLowerCase();\n if (\n firstNameLower.startsWith(searchStrLowerCase) ||\n lastNameLower.startsWith(searchStrLowerCase) ||\n contact.email.startsWith(searchStrLowerCase)\n ) {\n matches.push(contact);\n }\n });\n const contactsRow = document.querySelector(\"#contacts-row\");\n contactsRow.innerHTML = \"\";\n if (matches.length === 0) UserInterface.errorMessage(\"No contacts found\");\n matches.forEach((match) => UserInterface.addContactsToDisplay(match));\n });\n }",
"function getSearchResult(tranId){\n return nlapiSearchRecord('transaction',null,\n [\n new nlobjSearchFilter('internalid',null,'is',tranId), \n new nlobjSearchFilter('mainline',null,'is','F')\n ],\n [\n new nlobjSearchColumn('item'),\n new nlobjSearchColumn('quantity'),\n new nlobjSearchColumn('quantitypicked')\n ]);\n}",
"function objectizeRowData(_row) {\r\n\tiobj = new Object();\r\n\tiobj.id = _row.getValue(_row.getAllColumns()[0].getName(),_row.getAllColumns()[0].getJoin()); //internal id\r\n\tiobj.cfrom = _row.getValue(_row.getAllColumns()[1].getName(),_row.getAllColumns()[1].getJoin()); //created from (Linked Trx)\r\n\tiobj.trxrectype = _row.getValue(_row.getAllColumns()[2].getName(),_row.getAllColumns()[2].getJoin()); //transaction record type\r\n\tiobj.trxshipstate = _row.getValue(_row.getAllColumns()[3].getName(),_row.getAllColumns()[3].getJoin()); //transaction shipping state\r\n\tiobj.cfromshipstate = _row.getValue(_row.getAllColumns()[4].getName(),_row.getAllColumns()[4].getJoin()); //created from shipping state\r\n\tiobj.cfromrectype = _row.getValue(_row.getAllColumns()[5].getName(),_row.getAllColumns()[5].getJoin()); //created from record type\r\n\tiobj.trxnumber = _row.getValue(_row.getAllColumns()[6].getName(),_row.getAllColumns()[6].getJoin()); //trx number\r\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
fills in values for assign shifter form using inputted information from the calendar (shiftType, shiftStart, shiftEnd). Similar to signup form but has restricted access | function Assign(shiftType, shiftStart, shiftEnd){
var ret = ''
// allows for daq_id suggestions when typing in a shifter
DAQAutocomplete('#assign_shifter');
$('#assign_start_date')
.val(moment(parseInt(shiftStart))
.tz('Atlantic/St_Helena')
.format("YYYY-MM-DD"));
$("#assign_start_date").prop("readonly", true);
$('#assign_end_date')
.val(moment(parseInt(shiftEnd))
.tz('Atlantic/St_Helena')
.format("YYYY-MM-DD"));
$("#assign_end_date").prop("readonly", true);
$('#assignModal').modal('show');
ret += "<option value='" + shiftType + "'>" + shiftType + "</option>" +
"<option value='training'>training</option>";
document.getElementById("assign_shift_type").innerHTML = ret;
document.getElementById("assign_remove").checked = false;
$("#assign_remove").val(false);
} | [
"function SignUp(shiftType, shiftStart, shiftEnd){\n var ret = '';\n $('#id_start_date').val(moment(parseInt(shiftStart)).format(\"YYYY-MM-DD\"));\n $(\"#id_start_date\").prop(\"readonly\", true);\n $('#id_end_date').val(moment(parseInt(shiftEnd)).format(\"YYYY-MM-DD\"));\n $(\"#id_end_date\").prop(\"readonly\", true);\n $('#signUpModal').modal('show');\n\n ret += \"<option value='\" + shiftType + \"'>\" + shiftType + \"</option>\" + \n \"<option value='training'>training</option>\";\n document.getElementById(\"id_shift_type\").innerHTML = ret;\n document.getElementById(\"id_remove\").checked = false;\n $(\"#id_remove\").val(false);\n}",
"async function okCreateShift() {\n if (userRole === \"Admin\") {\n try {\n let thisShift = undefined;\n let newStart = startTimeInput.value;\n let newEnd = endTimeInput.value;\n let startDate = new Date(SelectedDate + \"T\" + newStart + \"Z\");\n let endDate = new Date(SelectedDate + \"T\" + newEnd + \"Z\");\n let newEmployee = undefined;\n let update = createUpdate(thisShift, startDate, endDate, newEmployee);\n updates.push(update);\n ShiftModalCloseAction();\n saveButtonEnable();\n alert(\"Vagten er nu oprettet! Tryk gem for at tilfรธje vagten\");\n } catch (e) {\n console.log(e.name + \": \" + e.message);\n }\n }\n}",
"function updateSuccess(shift) {\n var tempId = parseInt($('#shift_id').val());\n\n var eventlist = $(\"#calendar\").fullCalendar('clientEvents', tempId);\n\n event = eventlist[0];\n\n event.title = shift.position_title;\n event.description = shift.description;\n event.assigned_member = shift.assigned_member;\n event.assigned_member_id = shift.assigned_member_id;\n event.position_id = shift.position_id;\n event.start = shift.start;\n event.end = shift.end;\n event.id = shift.id;\n\n $('#calendar').fullCalendar('updateEvent', event);\n $('#shiftModal').modal('hide');\n }",
"function fillDateAccessed(){\n\tif (document.getElementById(\"month-accessed\").value == '') {\n\t\tdocument.getElementById(\"month-accessed\").value = theMonth;\n\t}\n\tif (document.getElementById(\"day-accessed\").value == '') {\n\t\tdocument.getElementById(\"day-accessed\").value = theDay;\n\t}\n\tif (document.getElementById(\"year-accessed\").value == '') {\n\t\tdocument.getElementById(\"year-accessed\").value = theYear;\n\t}\n}",
"function changeSchoolMons()\n{\n changeElt(this); // perform common functions\n let form = this.form;\n let schoolMons = this.value;\n let occElement = form.elements['Occupation' + this.name.substring(10)];\n if (occElement)\n { // occupation column present\n if (schoolMons.length > 0)\n occElement.value = 'Student';\n else\n occElement.value = '';\n } // occupation column present\n\n // validate number of months\n if (this.checkfunc)\n this.checkfunc();\n}",
"function jump() {\n // convert year and month value in both year and month dropdown to integer and set year and month equal to -\n // the values that we selected in both dropdowns\n year = parseInt(selectedyear.value);\n month = parseInt(selectedmonth.value);\n\n showCalendar(month, year);\n}",
"function setTripDetails() {\n\t\t\t\t\t// Trip Name\n\t\t\t\t\t$('#edit-trip-form-trip-name').val(trip.name);\n\t\t\t\t\t// Dates\n\t\t\t\t\t$('#edit-trip-form-start-date').data(\"DateTimePicker\").date(trip.start_date);\n\t\t\t\t\tstart_date = trip.start_date;\n\t\t\t\t\t$('#edit-trip-form-end-date').data(\"DateTimePicker\").minDate(start_date);\n\t\t\t\t\t$('#edit-trip-form-end-date').data(\"DateTimePicker\").date(trip.end_date);\n\t\t\t\t\tend_date = trip.end_date;\n\t\t\t\t\t$('#edit-trip-form-start-date').data(\"DateTimePicker\").maxDate(end_date);\n\t\t\t\t // Flexible Dates\n\t\t\t\t if (trip.are_dates_flexible) {\n\t\t\t\t \t$('#flexible-dates-checkbox').prop('checked', true);\n\t\t\t\t }\n\t\t\t\t // Companions\n\t\t\t\t $(\"#edit-trip-form-companion-count\").val(trip.companion_count);\n\t\t\t\t // Notes\n\t\t\t\t $('#edit-trip-form-notes').val(trip.notes);\n\t\t\t\t}",
"@action\n async exportCalendarAction() {\n const {slots} = this.args;\n if (!slots.length) {\n this.modal.info('No Sign-Ups', \"No shifts and/or training sessions are signed up for. There's nothing to export.\")\n return;\n }\n\n let ical;\n try {\n ical = (await import('ical-generator')).default;\n } catch (response) {\n this.house.handleErrorResponse(response);\n return;\n }\n\n const calendar = ical({\n name: `${this.args.year} BRC Ranger Schedule`,\n });\n calendar.prodId({\n company: 'Burning Man Project',\n product: 'Ranger Clubhouse',\n language: 'EN',\n });\n\n slots.forEach((slot) => {\n calendar.createEvent({\n start: dayjs.tz(slot.slot_begins, slot.slot_tz),\n end: dayjs.tz(slot.slot_ends, slot.slot_tz),\n summary: slot.position_title,\n detail: `${slot.description} ${slot.url}`,\n timezone: slot.slot_tz,\n });\n });\n\n this.house.downloadFile(`${this.args.year}-ranger-schedule.ics`, calendar.toString(), 'text/calendar');\n }",
"function processChange(value) {\n //console.log(\"Calendar clicked\");\n //If we are working with the start input\n if(cntrl.getStartCal()) {\n cntrl.setSelectedStartDate(value); \n }\n //If we are working with the end input\n else {\n cntrl.setSelectedEndDate(value);\n }\n //Autoclose after selection\n cntrl.updateDateRange();\n }",
"function validateGetCalendarForm() {\r\n //TODO: Check valid years, etc.\r\n}",
"function SaveCompanyShift() {\r\n if (!ValidateShiftTime()) {\r\n angular.element('#idReqValidation').show();\r\n return;\r\n }\r\n CreateRequestObject();\r\n var data = JSON.stringify($scope.ShiftList);\r\n $http({\r\n method: \"POST\",\r\n url: \"api/Admin/SaveShift\",\r\n params: { requestParam: data }\r\n }).then(function (successData) {\r\n if (successData.status == 202) {\r\n $scope.ErrorMsg = successData.data;\r\n angular.element('#idReqValidation').show();\r\n return;\r\n }\r\n if (successData.data == 'Y') {\r\n $scope.Reset();\r\n $scope.SuccessMessage = 'Shift details saved successfully for selected company';\r\n }\r\n });\r\n }",
"function loadWorkScheduleScreen(){\n\tvar dayArray = ['mo','tu','we','th','fr','sa','su'];\n\t\n\t//Set the numbers and fill heights for the 7 days of the week\n\tfor(i=0;i<7;i++){\n\t\t$(\"#workScheduleHours-\" + dayArray[i])[0].innerHTML = U.profiles[Profile].workSchedule[dayArray[i]];\n\t\t$(\"#workScheduleDayFill-\" + dayArray[i])[0].style.height = (U.profiles[Profile].workSchedule[dayArray[i]] * 4.7) + \"%\";\n\t}\n\t//Initial set up shows Monday by default\n\t$(\"#workScheduleCurrentDay\")[0].innerHTML = \"Monday\";\n\t$(\"#workScheduleCurrentDayHoursInput\")[0].value = U.profiles[Profile].workSchedule.mo;\n\t$(\".errorDiv\").hide();\n}",
"function submitForm(){\n let form = document.querySelector(Form.id);\n let appointment = Object.create(Appointment);\n appointment.who = form.querySelector(\"[name=who]\").value;\n appointment.about = form.querySelector(\"[name=about]\").value;\n appointment.agenda = form.querySelector(\"[name=agenda]\").value;\n let day = form.querySelector(\"[name=day]\").value;\n appointment.day = day;\n // Create a random id if it is a new appointment\n appointment.id = form.querySelector(\"[name=id]\").value || \n 'appointment-'+\n form.querySelector(\"[name=day]\").value+'-'+\n (1+Math.random()).toString(36).substring(7)\n ;\n Calendar.appointments[day] = appointment;\n closeForm();\n showNewAppointment(appointment);\n showMessage(\"Success\", \"Your appointment has been sucessfully saved.\");\n}",
"function CreateRequestObject() {\r\n $scope.ShiftList[0] = { ShiftMasterId: $scope.Shift.ShiftMasterId1, CompanyId: $scope.CompanyId, ShiftNo: 1, FromTime: $scope.Shift.FromTime1, ToTime: $scope.Shift.ToTime1 }\r\n $scope.ShiftList[1] = { ShiftMasterId: $scope.Shift.ShiftMasterId2, CompanyId: $scope.CompanyId, ShiftNo: 2, FromTime: $scope.Shift.FromTime2, ToTime: $scope.Shift.ToTime2 }\r\n $scope.ShiftList[2] = { ShiftMasterId: $scope.Shift.ShiftMasterId3, CompanyId: $scope.CompanyId, ShiftNo: 3, FromTime: $scope.Shift.FromTime3, ToTime: $scope.Shift.ToTime3 }\r\n }",
"function book_appointment() \n{\t\t\n\treset_form();\t\t\n\t$(\"input:text:visible:first\").focus();\t\n\t$(\".view_appointments\").hide();\n\t$(\".appointment_form\").show();\n\t\n\t\t/**\n\t\t** Function call: on load() - \n\t\t** Function call: current_date() - \n\t\t*/\n\t\t\n\t\t$(\"#appointment_time\").val(current_date()); //yyyy-MM-ddThh:mm\n\t\n\t\n}",
"function saveScheduleShifts() {\n // serialize the form into object\n var form = $('#scheduleform').serializeObject();\n // Parse WorkPeriod fields into correct format for model\n form[\"WorkPeriods\"] = parseWorkPeriodFields();\n\n // Send form to controller with Ajax and return the partial view to display\n $.post({\n url: SaveScheduleURL,\n traditional: true,\n contentType: \"application/json\",\n data: JSON.stringify(form),\n success: function (data) {\n $('#shifts-table').html(data);\n // Disable fields of \"Day Off\" shifts on load\n updateShiftTemplateDisabled();\n // Enable onchange events for shift template dropdown\n enableOnChangeEvent();\n },\n error: function (request, error) {\n alert(JSON.stringify(request));\n }\n });\n}",
"function getModalContent() {\n\tvar i = 0;\n\tnew_assig_form_html = '<div id=\"new-assig-info\">'\n\tnew_assig_form_html += '\t<span class=\"form-label\">Name:</span><input type=\"text\" class=\"form-field\" id=\"name\" /><br>'\n\tnew_assig_form_html += '\t<span class=\"form-label\">Type:</span>'\n\tnew_assig_form_html += '\t<select class=\"form-field\" id=\"type\">'\n\tfor(i = 0; i < assignment_types.length; i++) {\n\t\tnew_assig_form_html += '\t\t<option value=\"' + assignment_types[i].id + '\">' + assignment_types[i].name + '</option>'\n\t}\n\tnew_assig_form_html += '\t</select><br>'\n\tnew_assig_form_html += '\t<span class=\"form-label\">Due Date:</span><input type=\"text\" class=\"form-field datepicker\" id=\"due-date\" readonly=\"readonly\" /><br>'\n\tnew_assig_form_html += '\t<span class=\"form-label\">Reminder:</span><input type=\"text\" class=\"form-field datepicker\" id=\"reminder-date\" readonly=\"readonly\" />'\n\tnew_assig_form_html += '\t<select id=\"hour\" class=\"form-field\">'\n\tfor(i = 1; i <= 12; i++) {\n\t\tnew_assig_form_html += '\t<option value=\"' + i + '\">' + i + '</option>'\n\t}\n\tnew_assig_form_html += '\t</select>'\n\tnew_assig_form_html += '\t<select id=\"minute\" class=\"form-field\">'\n\tfor(i = 0; i < 60; i+=5) {\n\t\tnew_assig_form_html += '\t<option value=\"' + i + '\">' + ('00' + i).substr(-2) + '</option>'\n\t}\n\tnew_assig_form_html += '\t</select>'\n\tnew_assig_form_html += '\t<select id=\"am-pm\" class=\"form-field\">'\n\tnew_assig_form_html += '\t\t<option value=\"am\">am</option>'\n\tnew_assig_form_html += '\t\t<option value=\"pm\">pm</option>'\n\tnew_assig_form_html += '\t</select><br>'\n\tnew_assig_form_html += '\t<span class=\"form-label\">Total Points:</span><input type=\"text\" class=\"form-field\" id=\"total-points\" value=\"100\" /><br>'\n\tnew_assig_form_html += '\t<div id=\"total-points-error\">please enter numeric value</div>'\n\tnew_assig_form_html += '\t<span class=\"form-label\">Details:</span><textarea rows=\"4\" cols=\"50\" class=\"form-field\" id=\"details\" /><br>'\n\tnew_assig_form_html += '\t<span class=\"form-label\">Link:</span><input type=\"text\" class=\"form-field\" id=\"link\" /><br>'\n\tnew_assig_form_html += '\t<br><br>'\n\tnew_assig_form_html += '\t<button class=\"button close-btn\" onclick=\"saveAssignment();\">Save</button>'\n\tnew_assig_form_html += '</div>';\n\treturn new_assig_form_html;\n}",
"function create_time_range_inputs(input_args) {\n //\n // defining static inputs\n var date_range_onclick = \"toggle_view_element_button('show_date_range','date_range','Hide Date Range','Show Date Ranage'); toggle_disabled('time-range,st-day,st-month,st-year,en-day,en-month,en-year');\";\n var st_img_onclick = \"create_calander('calander','0','st-day','st-month','st-year'); show_hide('calander');\";\n var end_img_onclick = \"create_calander('calander','0','en-day','en-month','en-year'); show_hide('calander');\";\n //\n // initializing variable inputs\n var time_range_onchange = '';\n var day_onkeyup = '';\n var month_onchange = '';\n var year_onchange = '';\n //\n // creating date objects for time range inputs\n var today = new Date();\n var first = new Date(today.getFullYear(),today.getMonth(),1);\n var curr_wk = [new Date(today.getFullYear(),today.getMonth(),(today.getDate()-today.getDay()))];\n curr_wk[1] = new Date(curr_wk[0].getFullYear(),curr_wk[0].getMonth(),(curr_wk[0].getDate()+6))\n var last_2wk = [new Date(today.getFullYear(),today.getMonth(),(today.getDate()-today.getDay()-7)),curr_wk[1]];\n var last_4wk = [new Date(today.getFullYear(),today.getMonth(),(today.getDate()-today.getDay()-21)),curr_wk[1]];\n var curr_mth = [new Date(first.getFullYear(),first.getMonth(),(first.getDate()-first.getDay()))];\n curr_mth[1] = new Date(first.getFullYear(),first.getMonth()+1,1);\n curr_mth[1] = new Date(curr_mth[1].getFullYear(),curr_mth[1].getMonth(),(curr_mth[1].getDate()+(6-curr_mth[1].getDay())));\n var curr_pp = new Date(CONSTANTS.FIRST_BUSINESS_DAY[0],+CONSTANTS.FIRST_BUSINESS_DAY[1]-1,CONSTANTS.FIRST_BUSINESS_DAY[2]);\n var test_date = curr_pp;\n curr_pp = [curr_pp]\n for (var w = 0; w < 60; w+=2) {\n test_date = new Date(test_date.getFullYear(),test_date.getMonth(),(test_date.getDate()+14));\n curr_pp[1] = new Date(test_date.getFullYear(),test_date.getMonth(),(test_date.getDate()-1));\n if (test_date > today) {break;}\n curr_pp = [test_date];\n }\n var prev_pp = [new Date(curr_pp[0].getFullYear(),curr_pp[0].getMonth(),(curr_pp[0].getDate()-14))];\n prev_pp[1] = new Date(curr_pp[0].getFullYear(),curr_pp[0].getMonth(),(curr_pp[0].getDate()-1));\n curr_wk = curr_wk[0].yyyymmdd()+ '|' +curr_wk[1].yyyymmdd();\n last_2wk = last_2wk[0].yyyymmdd()+'|' +last_2wk[1].yyyymmdd();\n last_4wk = last_4wk[0].yyyymmdd()+'|' +last_4wk[1].yyyymmdd();\n curr_mth = curr_mth[0].yyyymmdd()+'|' +curr_mth[1].yyyymmdd();\n curr_pp = curr_pp[0].yyyymmdd()+ '|' +curr_pp[1].yyyymmdd();\n prev_pp = prev_pp[0].yyyymmdd()+ '|' +prev_pp[1].yyyymmdd();\n //\n // processing input args\n if (!!(input_args.time_range_onchange)) {time_range_onchange = input_args.time_range_onchange;}\n if (!!(input_args.day_onkeyup)) {day_onkeyup = input_args.day_onkeyup;}\n if (!!(input_args.month_onchange)) {month_onchange = input_args.month_onchange;}\n if (!!(input_args.year_onchange)) {year_onchange = input_args.year_onchange;}\n if (!!(input_args.add_date_range_onclick)) {date_range_onclick += input_args.add_date_range_onclick;}\n if (!!(input_args.add_st_img_onclick)) {st_img_onclick += input_args.st_img_onclick;}\n if (!!(input_args.add_end_img_onclick)) {end_img_onclick += input_args.add_end_img_onclick;}\n //\n // creating output fields\n var output = ''+\n '<label class=\"label\">Time Range:</label>'+\n '<select id=\"time-range\" class=\"dropbox-input\" name=\"time-range\" onchange=\"'+time_range_onchange+'\">'+\n '<option value=\"'+curr_wk+'\">Current Week</option>'+\n '<option value=\"'+curr_pp+'\">Current Pay Period</option>'+\n '<option value=\"'+prev_pp+'\">Previous Pay Period</option>'+\n '<option value=\"'+last_2wk+'\">Last 2 Weeks</option>'+\n '<option value=\"'+last_4wk+'\">Last 4 Weeks</option>'+\n '<option value=\"'+curr_mth+'\">Current Month</option>'+\n '</select>'+\n ' '+\n '<button id=\"show_date_range\" type=\"button\" name=\"show_date_range\" onclick=\"'+date_range_onclick+'\">Show Date Range</button>'+\n '<div id=\"date_range\" class=\"hidden-elm\" name=\"date_range\">'+\n '<span id=\"calander\" class=\"cal-span hidden-elm\"></span>'+\n '<label class=\"label-4em\">From:</label>'+\n '<input id=\"st-day\" class=\"text-input-xsmall\" type=\"text\" name=\"st-day\" maxlength=2 value=\"01\" onkeyup=\"'+day_onkeyup+'\" disabled>'+\n ' '+\n '<select id=\"st-month\" class=\"dropbox-input\" name=\"st-month\" onchange=\"'+month_onchange+'\" disabled>'+\n '<option id=\"1\" value=\"01\">January</option>'+\n '<option id=\"2\" value=\"02\">February</option>'+\n '<option id=\"3\" value=\"03\">March</option>'+\n '<option id=\"4\" value=\"04\">April</option>'+\n '<option id=\"5\" value=\"05\">May</option>'+\n '<option id=\"6\" value=\"06\">June</option>'+\n '<option id=\"7\" value=\"07\">July</option>'+\n '<option id=\"8\" value=\"08\">August</option>'+\n '<option id=\"9\" value=\"09\">September</option>'+\n '<option id=\"10\" value=\"10\">October</option>'+\n '<option id=\"11\" value=\"11\">November</option>'+\n '<option id=\"12\" value=\"12\">December</option>'+\n '</select>'+\n ' '+\n '<select id=\"st-year\" class=\"dropbox-input\" name=\"st-year\" onchange=\"'+year_onchange+'\" disabled>'+\n '</select>'+\n ' '+\n '<a onclick=\"'+st_img_onclick+'\"><image id=\"cal_st_image\" class=\"cal-image\" src=\"http://www.afwendling.com/operations/images/calander.png\"></a>'+\n '<br>'+\n '<label class=\"label-4em\">To:</label>'+\n '<input id=\"en-day\" class=\"text-input-xsmall\" type=\"text\" name=\"en-day\" maxlength=2 value=\"01\" onkeyup=\"'+day_onkeyup+'\" disabled>'+\n ' '+\n '<select id=\"en-month\" class=\"dropbox-input\" name=\"en-month\" onchange=\"'+month_onchange+'\" disabled>'+\n '<option id =\"1\" value=\"01\">January</option>'+\n '<option id =\"2\" value=\"02\">February</option>'+\n '<option id =\"3\" value=\"03\">March</option>'+\n '<option id =\"4\" value=\"04\">April</option>'+\n '<option id =\"5\" value=\"05\">May</option>'+\n '<option id =\"6\" value=\"06\">June</option>'+\n '<option id =\"7\" value=\"07\">July</option>'+\n '<option id =\"8\" value=\"08\">August</option>'+\n '<option id =\"9\" value=\"09\">September</option>'+\n '<option id =\"10\" value=\"10\">October</option>'+\n '<option id =\"11\" value=\"11\">November</option>'+\n '<option id =\"12\" value=\"12\">December</option>'+\n '</select>'+\n ' '+\n '<select id=\"en-year\" class=\"dropbox-input\" name=\"en-year\" onchange=\"'+year_onchange+'\" disabled>'+\n '</select>'+\n ' '+\n '<a onclick=\"'+end_img_onclick+'\"><image id=\"cal_en_image\" class=\"cal-image\" src=\"http://www.afwendling.com/operations/images/calander.png\"></a>'+\n '';\n //\n document.getElementById(input_args.output_id).innerHTML = output;\n //\n populate_year_dropboxes('st-year');\n populate_year_dropboxes('en-year');\n}",
"function getAssignmentFromModal() {\n\tvar name, at_name, at_id, due_date, reminder_date, details, tot_grade, link;\n\tvar date_arr, time_arr;\n\n\t// validate that the tot_grade is an integer value\n\t//TODOTODOTODO\n\n\t// get input from form\n\tname = $('#name').val();\n\tat_name = $('#type option:selected').text()\n\tat_id = $('#type option:selected').val()\n\tdate_arr = $('#due-date').val().split('/');\n\tdue_date = new DueDate(date_arr[2], date_arr[0], date_arr[1]);\n\tdate_arr = $('#reminder-date').val().split('/');\n\thour = $('#am-pm option:selected').val() === 'am' ? parseInt($('#hour option:selected').val()) : parseInt($('#hour option:selected').val()) + 12;\n\tminute = parseInt($('#minute option:selected').val());\n\treminder_date = new ReminderDate(date_arr[2], date_arr[0], date_arr[1], hour, minute);\n\tdetails = $('#details').val();\n\ttot_grade = parseInt($('#total-points').val());\n\tlink = $('#link').val();\n\n\t// create and return Assignment object if valid\n\treturn new Assignment(name, course_id, at_name, at_id, reminder_date, due_date,\tdetails, 0, tot_grade, link, false);\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Description There is a narrow hallway in which people can go right and left only. When two people meet in the hallway, by tradition they must salute each other. People move at the same speed left and right. Your task is to write a function that, given a string representation of people moving in the hallway, will count the number of salutes that will occur. Note: 2 salutes occur when people meet, one to the other and vice versa. Input People moving right will be represented by >; people moving left will be represented by >. The character represents empty space, which you need not worry about. Examples Input: >>< Ouput: 2 Explanation: Only one meeting occurs. Solution 1 | function countSalutes(hallway) {
let salutes = 0
let array = hallway.split('')
console.log(array)
for (let i = 0; i <array.length; i++) {
if(array[i] === ">") {
for (let y=i+1; y<array.length; y++) {
if (array[y] === "<") {
salutes += 2
console.log(salutes)
}
}
}
}
return salutes
} | [
"function comparePsTs(string1) {\n\n string1 = string1.toLowerCase() //so P and p both count as the same letter\n\n p_array = string1.split(\"p\") //split string1 at each p and put result into an array\n p_length = p_array.length //number of elements in the resulting array = (number of Ps + 1)\n\n t_array = string1.split(\"t\") //next verse, same as the first\n t_length = t_array.length\n\n if (p_length == t_length) { //compare the numbers\n console.log(\"\\'\" + string1 + \"\\' contains an equal number of Ps and Ts.\")\n } else {\n console.log(\"\\'\" + string1 + \"\\' contains \" + (p_length - 1) + \" Ps and \" + (t_length - 1) + \" Ts.\")\n }\n}",
"countBigWords(input) {\n // Set a counter equal to 0\n let counter = 0;\n // Split the input into words\n let temp = input.split(\" \");\n // Determine the length of each word by iterating over the array\n //If the word is greater than 6 letters, add 1 to a counter\n // If the word is less than or equal to 6 letters, go on to next word\n for(let i = 0; i < temp.length; i++) {\n if (temp[i].length > 6) {\n counter++;\n }\n }\n // Output the counter\n return counter;\n }",
"function seaSick(x) {\n let w = 0;\n\n x.split('').forEach((el, i) => {\n if (el === '_' && x[i + 1] === '~') w++;\n else if (el === '~' && x[i + 1] === '_') w++;\n });\n\n if (w > (x.length * 20) / 100) return 'Throw Up';\n else return 'No Problem';\n}",
"function solve(s){\n let newStr = s.split(''); \n let isValid = true;\n let ctr = 0;\n\n if(newStr.length === 0 || newStr.length % 2 !== 0){\n return -1;\n };\n \n while(isValid){\n isValid = false;\n for(let i = 0; i <= newStr.length - 1; i++){\n let opening = newStr.indexOf('(', i);\n let closing = newStr.indexOf(')',opening);\n if(opening + 1 == closing){\n newStr[opening] = '';\n newStr[closing] = '';\n isValid = true;\n };\n };\n newStr = newStr.join('').split('');\n };\n \n for(let i = 0; i <= newStr.length - 1; i += 2){\n ctr += newStr[i] === ')' ? 1 : 0;\n ctr += newStr[i + 1] === '(' ? 1 : 0;\n };\n \n return ctr;\n}",
"function determineHeading(){\n let player = determineTitle();\n\n // these conditions will never be true at the same time\n let checkMate = (props.checkMate ? \": CHECKMATE\" : \"\");\n let staleMate = (props.staleMate ? \": STALEMATE\" : \"\");\n\n // will not display \"CHECK\" if state is checkmate or stalemate\n let check = \"\";\n if ( !props.checkMate && !props.staleMate ){\n if ( props.inCheck )\n check = \": CHECK\";\n }\n else{\n check = \"\";\n }\n\n return player + checkMate + staleMate + check\n }",
"function numJewelsInStones(jewels, stones){\n let count = 0;\n let newStones = stones.split('')\n for(let i of jewels){\n for(let s of stones){\n if ( i === s){\n count++;\n }\n }\n }\n return count;\n}",
"function countWords(paragraph, love, you) {\n\t// split the string by spaces in a\n\tlet a = paragraph.split(\" \");\n\n\t// search for pattern in a\n\tlet countlove = 0;\n let countyou = 0;\n\tfor (let i = 0; i < a.length; i++) {\n\t // if match found increase count\n\t if (a[i].includes(love))\n\t\t countlove++;\n\n if (a[i].includes(you))\n countyou++;\n\n\t}\n\n if(countlove < countyou)\n\treturn `the word You is occurred more than Love with count ${countyou}`;\n\n return `the word Love is occurred more than You with count ${countlove}`;\n}",
"function planeSeat(str){\n let num = +str.replace(/[a-z]/gi, '');\n let letter = str.replace(/[0-9]/gi, '').toLowerCase();\n\n if(num > 60 || letter === 'i' || letter === 'j') {\n return 'No Seat!!';\n }\n\n if(num >= 1 && num <= 20) {\n if(/[a-c]/gi.test(letter)) {\n return 'Front-Left';\n } else if(/[d-f]/gi.test(letter)) {\n return 'Front-Middle';\n } else {\n return 'Front-Right';\n }\n } else if(num >= 21 && num <= 40) {\n if(/[a-c]/gi.test(letter)) {\n return 'Middle-Left';\n } else if(/[d-f]/gi.test(letter)) {\n return 'Middle-Middle';\n } else {\n return 'Middle-Right';\n }\n \n } else if(num >= 41 && num <= 60) {\n if(/[a-c]/gi.test(letter)) {\n return 'Back-Left';\n } else if(/[d-f]/gi.test(letter)) {\n return 'Back-Middle';\n } else {\n return 'Back-Right';\n }\n }\n}",
"function countYZ(word) {\n word = word.toLowerCase();\n var count = 0;\n //console.log(word[word.length - 1]);\n if (word[word.length - 1] == \"y\" || word[word.length - 1] == \"z\") {\n count += 1;\n }\n for (var i = 0; i < word.length; i++) {\n if(word[i] == \" \") {\n\n if(word[i-1] == \"y\") {\n count += 1;\n }else if(word[i-1] == \"z\"){\n count += 1;\n }\n }\n }\n return count;\n}",
"function instagramSticker(phrase) {\n let string = 'instagram'\n let insta = {}\n for (let char of string) {\n insta[char] ? insta[char]++ : insta[char] = 1\n }\n let count = 0\n let word = {}\n let sentence = phrase.split(' ').join('')\n for (let char of sentence) {\n word[char] ? word[char]++ : word[char] = 1\n }\n for (let char in word) {\n let amount = Math.ceil(word[char]/insta[char])\n if (amount > count) count = amount\n }\n return count\n}",
"function countBs(subject)\n{\n return countChar(subject, \"B\");\n}",
"function iTri(s){\n let stage = {\n Swim: 2.4,\n Bike: 112,\n Run: 26.2,\n };\n const out = {};\n\n let tmp;\n tmp = stage.Swim + stage.Bike + stage.Run - s;\n tmp = tmp.toFixed(2);\n if (s === 0) { return 'Starting Line... Good Luck!' }\n else if (s > 0 && s <= stage.Swim) {\n out['Swim'] = tmp + ' to go!';\n return out;\n } else if (s > stage.Swim && s <= stage.Bike + stage.Swim) {\n out['Bike'] = tmp + ' to go!';\n return out;\n } else if (s > stage.Bike + stage.Swim && s <= stage.Run + stage.Bike + stage.Swim) {\n if (tmp <= 10) { out['Run'] = 'Nearly there!'; return out; }\n else out['Run'] = tmp + ' to go!';\n return out;\n } else if (tmp < 0) return `You're done! Stop running!`\n}",
"function romanToInteger(string) {\n let count = 0;\n\n for (i = 0; i < string.length; i++) {\n console.log(\"i, string[i], count\",i,string[i],count)\n if (string[i] === \"I\") {\n if (string[i+1] === \"V\") {\n count+= 4;\n i++;\n }\n else if(string[i+1] === \"X\") {\n count+=9;\n i++;\n } else {\n count+=1;\n }\n }\n\n else if (string[i] === \"V\") {\n count+= 5;\n }\n\n else if (string[i] === \"X\") {\n if (string[i+1] === \"L\") {\n count+= 40;\n i++;\n }\n if (string[i+1] === \"C\") {\n count+= 90;\n i++;\n } else {\n count+= 10;\n }\n }\n\n else if (string[i] === \"L\") {\n count+= 50;\n }\n\n else if (string[i] === \"C\") {\n if (string[i+1] === \"D\") {\n count+= 400;\n i++;\n }\n else if (string[i+1] === \"M\") {\n count+= 900;\n i++;\n } else {\n count+= 100;\n }\n }\n\n else if (string[i] === \"D\") {\n count+= 500;\n }\n\n else if (string[i] === \"M\") {\n count+= 1000;\n }\n \n }\n return count;\n }",
"function naiveString(str1,str2){\n var count = 0;\n for(var i = 0;i <str1.length;i ++){\n for(var j = 0;j <str2.length;j ++){\n if(str1[i + j] != str2[j]){\n break;\n }\n if(j === str2.length - 1){\n //console.log(str2.length );\n console.log(\"found one\");\n count ++;\n }\n }\n }\n return count;\n}",
"function matchingChars(lifeForm, targetLifeform){\r\n\tvar matchedLetters = 0;\r\n\tlifeForm = lifeForm.toLowerCase();\r\n\ttargetLifeform = targetLifeform.toLowerCase();\r\n\tfor(var i = 0; i < lifeForm.length && i < targetLifeform.length; i++){\r\n\t\tif( lifeForm.substring(i, i+1) === targetLifeform.substring(i, i+1) ){\r\n\t\t\tmatchedLetters++;\r\n\t\t}\r\n\t}\r\n\treturn (matchedLetters / lifeForm.length);\r\n}",
"function evenOrOdd(str) {\n let odd = str.split('').filter(o => o % 2 != 0).reduce((a,b) => (+a) + (+b)),\n even = str.split('').filter(e => e % 2 == 0).reduce((a,b) => (+a) + (+b));\n if(even > odd) {\n return 'Even is greater than Odd';\n } else if(even < odd) {\n return 'Odd is greater than Even';\n } else\n return 'Even and Odd are the same';\n}",
"function scoreOneWord(s) {\n if (s.length < 3) {\n return 1;\n } else if (s.length < 5) {\n return 1;\n } else {\n return 1;\n }\n}",
"function countBoomerangs(arr) {\n\tlet start = 0\n\tlet end = 2\n\tlet count=0\n\t\n\twhile(end <= arr.length-1){\n\t\t\n\t\tif(arr[start]===arr[end] && arr[start+1]!== arr[start]){\n\t\t\tcount++\n\t\t}\n\t\tstart++\n\t\tend++\n\t}\n\t\n\treturn count\n}",
"function countDs(sentence) {\n\treturn sentence.toLowerCase().split('').filter(x => x === 'd').length;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
takes GeoJSON as input, creates a GeoJSON GeometryCollection of linestrings as output | function lineify(inputGeom) {
var outputLines = {
"type": "GeometryCollection",
"geometries": []
}
switch (inputGeom.type) {
case "GeometryCollection":
for (var i in inputGeom.geometries) {
var geomLines = lineify(inputGeom.geometries[i]);
if (geomLines) {
for (var j in geomLines.geometries) {
outputLines.geometries.push(geomLines.geometries[j]);
}
} else {
outputLines = false;
}
}
break;
case "Feature":
var geomLines = lineify(inputGeom.geometry);
if (geomLines) {
for (var j in geomLines.geometries) {
outputLines.geometries.push(geomLines.geometries[j]);
}
} else {
outputLines = false;
}
break;
case "FeatureCollection":
for (var i in inputGeom.features) {
var geomLines = lineify(inputGeom.features[i].geometry);
if (geomLines) {
for (var j in geomLines.geometries) {
outputLines.geometries.push(geomLines.geometries[j]);
}
} else {
outputLines = false;
}
}
break;
case "LineString":
outputLines.geometries.push(inputGeom);
break;
case "MultiLineString":
case "Polygon":
for (var i in inputGeom.coordinates) {
outputLines.geometries.push({
"type": "LineString",
"coordinates": inputGeom.coordinates[i]
});
}
break;
case "MultiPolygon":
for (var i in inputGeom.coordinates) {
for (var j in inputGeom.coordinates[i]) {
outputLines.geometries.push({
"type": "LineString",
"coordinates": inputGeom.coordinates[i][j]
});
}
}
break;
default:
outputLines = false;
}
return outputLines;
} | [
"function lineify(inputGeom) {\r\n var outputLines = {\r\n \"type\": \"GeometryCollection\",\r\n \"geometries\": []\r\n }\r\n switch (inputGeom.type) {\r\n case \"GeometryCollection\":\r\n for (var i in inputGeom.geometries) {\r\n var geomLines = lineify(inputGeom.geometries[i]);\r\n if (geomLines) {\r\n for (var j in geomLines.geometries) {\r\n outputLines.geometries.push(geomLines.geometries[j]);\r\n }\r\n } else {\r\n outputLines = false;\r\n }\r\n }\r\n break;\r\n case \"Feature\":\r\n var geomLines = lineify(inputGeom.geometry);\r\n if (geomLines) {\r\n for (var j in geomLines.geometries) {\r\n outputLines.geometries.push(geomLines.geometries[j]);\r\n }\r\n } else {\r\n outputLines = false;\r\n }\r\n break;\r\n case \"FeatureCollection\":\r\n for (var i in inputGeom.features) {\r\n var geomLines = lineify(inputGeom.features[i].geometry);\r\n if (geomLines) {\r\n for (var j in geomLines.geometries) {\r\n outputLines.geometries.push(geomLines.geometries[j]);\r\n }\r\n } else {\r\n outputLines = false;\r\n }\r\n }\r\n break;\r\n case \"LineString\":\r\n outputLines.geometries.push(inputGeom);\r\n break;\r\n case \"MultiLineString\":\r\n case \"Polygon\":\r\n for (var i in inputGeom.coordinates) {\r\n outputLines.geometries.push({\r\n \"type\": \"LineString\",\r\n \"coordinates\": inputGeom.coordinates[i]\r\n });\r\n }\r\n break;\r\n case \"MultiPolygon\":\r\n for (var i in inputGeom.coordinates) {\r\n for (var j in inputGeom.coordinates[i]) {\r\n outputLines.geometries.push({\r\n \"type\": \"LineString\",\r\n \"coordinates\": inputGeom.coordinates[i][j]\r\n });\r\n }\r\n }\r\n break;\r\n default:\r\n outputLines = false;\r\n }\r\n return outputLines;\r\n}",
"function getGeometries(geometries, col_arcs_){\n\tvar polygons = [];\n\tgeometries.forEach(function(d){\n\t\tif(d.type==='Polygon'){\n\t\t\tvar a = readPolygon2({arcs:d.arcs}); \n\t\t\tpolygons.push({type:'Polygon', coordinates: a, properties: d.properties})\n\t\t}\n\t\telse if(d.type==='MultiPolygon'){\n\t\t\tvar a = d.arcs.map(function(e,i){return readPolygon2({arcs:d.arcs[i]})}); \n\t\t\tpolygons.push({type:'MultiPolygon', coordinates: a, properties: d.properties})\n\t\t}\n\t\t\n\t})\n\treturn polygons;\n\tfunction readPolygon2(data){\n\t\tvar interPolys = [];\n\t\t//loop the linestrings of the polygon\n\t\tfor (var i=0;i<data.arcs.length;i++){\n\t\t\t//get the related 'LineString's by splitting at the start/end points (length === 4) \n\t\t\tvar poly_cache = [];\n\t\t\tfor (var j=0; j<data.arcs[i].length;j++){\n\t\t\t\tvar arc_id = data.arcs[i][j];\n\t\t\t\tvar sign = 1; \n\t\t\t\tif(arc_id<0){arc_id= (arc_id*(-1))-1; sign = -1;}\n\t\t\t\tvar arcs_cache2 = col_arcs_[arc_id].coordinates.slice();//--> das war der knackpunkt!!!!!!!!!!http://www.d-mueller.de/blog/javascript-arrays-kopieren/\n\t\t\t\tif(sign===-1){arcs_cache2.reverse();}\n\t\t\t\t//remove the last (it is redundant!!!) ...do only, when it is not the last LineString\n\t\t\t\tif(j!==data.arcs[i].length-1){arcs_cache2.pop();}\n\t\t\t\t//re-build the polygon to test this implementation\n\t\t\t\tfor (var x = 0;x<arcs_cache2.length;x++) poly_cache.push(arcs_cache2[x])\t\t\t\t\n\t\t\t}\n\t\t\tinterPolys.push(poly_cache);\t\t\t\t\t\n\t\t}\n\t\treturn interPolys;\n\t}\n}",
"getGeoJsonEdges() {\n const edgesGeoJson = [];\n const stops = this.stops;\n \n this.edgeList.forEach(function(edge) {\n const originNode = stops[edge.origin];\n const destNode = stops[edge.destination];\n \n edgesGeoJson.push({\n 'type': 'Feature',\n 'properties': {\n 'edgeType': edge.type,\n 'stroke': EDGE_COLOR[edge.type]\n },\n 'geometry': {\n 'type': Geometry.LineString,\n 'coordinates': [\n [ originNode.longitude, originNode.latitude ],\n [ destNode.longitude, destNode.latitude ]\n ]\n }\n });\n });\n return {\n 'type': 'FeatureCollection',\n 'features': edgesGeoJson\n };\n }",
"function geoJsonConverter(){\n var gCon = {};\n\n /*compares a GeoJSON geometry type and ESRI geometry type to see if they can be safely\n put together in a single ESRI feature. ESRI features must only have one\n geometry type, point, line, polygon*/\n function isCompatible(esriGeomType, gcGeomType) {\n var compatible = false;\n if ((esriGeomType === \"esriGeometryPoint\" || esriGeomType === \"esriGeometryMultipoint\") && (gcGeomType === \"Point\" || gcGeomType === \"MultiPoint\")) {\n compatible = true;\n } else if (esriGeomType === \"esriGeometryPolyline\" && (gcGeomType === \"LineString\" || gcGeomType === \"MultiLineString\")) {\n compatible = true;\n } else if (esriGeomType === \"esriGeometryPolygon\" && (gcGeomType === \"Polygon\" || gcGeomType === \"MultiPolygon\")) {\n compatible = true;\n }\n return compatible;\n }\n\n /*Take a GeoJSON geometry type and make an object that has information about\n what the ESRI geometry should hold. Includes the ESRI geometry type and the name\n of the member that holds coordinate information*/\n function gcGeomTypeToEsriGeomInfo(gcType) {\n var esriType,\n geomHolderId;\n if (gcType === \"Point\") {\n esriType = \"esriGeometryPoint\";\n } else if (gcType === \"MultiPoint\") {\n esriType = \"esriGeometryMultipoint\";\n geomHolderId = \"points\";\n } else if (gcType === \"LineString\" || gcType === \"MultiLineString\") {\n esriType = \"esriGeometryPolyline\";\n geomHolderId = \"paths\";\n } else if (gcType === \"Polygon\" || gcType === \"MultiPolygon\") {\n esriType = \"esriGeometryPolygon\";\n geomHolderId = \"rings\";\n }\n return {\n type: esriType,\n geomHolder: geomHolderId\n };\n }\n\n /*Wraps GeoJSON coordinates in an array if necessary so code can iterate\n through array of points, rings, or lines and add them to an ESRI geometry\n Input is a GeoJSON geometry object. A GeoJSON GeometryCollection is not a\n valid input */\n function gcCoordinatesToEsriCoordinates(gcGeom) {\n var i,\n len,\n esriCoords;\n if (gcGeom.type === \"MultiPoint\" || gcGeom.type === \"MultiLineString\" || gcGeom.type === \"Polygon\") {\n esriCoords = gcGeom.coordinates;\n } else if (gcGeom.type === \"Point\" || gcGeom.type === \"LineString\") {\n esriCoords = [gcGeom.coordinates];\n } else if (gcGeom.type === \"MultiPolygon\") {\n /* GeoJson MultiPolygons contains arrays of arrays. Maybe for donut Polygons? May need further testing */\n esriCoords = [];\n for (i = 0, len = gcGeom.coordinates.length; i < len; i++) {\n esriCoords.push(gcGeom.coordinates[i][0]);\n }\n }\n return esriCoords;\n }\n\n /*Converts GeoJSON geometry to ESRI geometry. The ESRI geometry is\n only allowed to contain one type of geometry, so if the GeoJSON\n geometry is a GeometryCollection, then only geometries compatible\n with the first geometry type in the collection are added to the ESRI geometry\n\n Input parameter is a GeoJSON geometry object.*/\n function gcGeometryToEsriGeometry(gcGeom) {\n var esriGeometry,\n esriGeomInfo,\n gcGeometriesToConvert,\n i,\n g,\n coords;\n\n //if geometry collection, get info about first geometry in collection\n if (gcGeom.type === \"GeometryCollection\") {\n gcGeometriesToConvert = [gcGeom.geometries.shift()];\n esriGeomInfo = gcGeomTypeToEsriGeomInfo(gcGeometriesToConvert[0].type);\n\n //loop through collection and only add compatible geometries to the array\n //of geometries that will be converted\n for (i = 0; i < gcGeom.geometries.length; i++) {\n if (isCompatible(esriGeomInfo.type, gcGeom.geometries[i].type)) {\n gcGeometriesToConvert.push(gcGeom.geometries[i]);\n }\n }\n } else {\n esriGeomInfo = gcGeomTypeToEsriGeomInfo(gcGeom.type);\n gcGeometriesToConvert = [gcGeom];\n }\n\n //if a collection contained multiple points, change the ESRI geometry\n //type to MultiPoint\n if (esriGeomInfo.type === \"esriGeometryPoint\" && gcGeometriesToConvert.length > 1) {\n esriGeomInfo = gcGeomTypeToEsriGeomInfo(\"MultiPoint\");\n }\n\n //make new empty ESRI geometry object\n esriGeometry = {\n //type: esriGeomInfo.type,\n spatialReference: {\n wkid: 4326\n }\n };\n\n //perform conversion\n if (esriGeomInfo.type === \"esriGeometryPoint\") {\n if (gcGeometriesToConvert[0].coordinates.length === 0) {\n esriGeometry.x = null;\n esriGeometry.y = null;\n } else {\n esriGeometry.x = gcGeometriesToConvert[0].coordinates[0];\n esriGeometry.y = gcGeometriesToConvert[0].coordinates[1];\n }\n } else {\n esriGeometry[esriGeomInfo.geomHolder] = [];\n for (i = 0; i < gcGeometriesToConvert.length; i++) {\n coords = gcCoordinatesToEsriCoordinates(gcGeometriesToConvert[i]);\n for (g = 0; g < coords.length; g++) {\n esriGeometry[esriGeomInfo.geomHolder].push(coords[g]);\n }\n }\n }\n return esriGeometry;\n }\n\n /*Converts GeoJSON feature to ESRI REST Feature.\n Input parameter is a GeoJSON Feature object*/\n function gcFeatureToEsriFeature(gcFeature) {\n var esriFeat,\n prop,\n esriAttribs;\n if (gcFeature) {\n esriFeat = {};\n if (gcFeature.geometry) {\n esriFeat.geometry = gcGeometryToEsriGeometry(gcFeature.geometry);\n }\n if (gcFeature.properties) {\n esriAttribs = {};\n for (prop in gcFeature.properties) {\n esriAttribs[prop] = gcFeature.properties[prop];\n }\n esriFeat.attributes = esriAttribs;\n }\n }\n return esriFeat;\n }\n\n /*Converts GeoJSON FeatureCollection, Feature, or Geometry\n to ESRI Rest Featureset, Feature, or Geometry*/\n gCon.toEsri = function(geoJsonObject) {\n var outObj,\n i,\n gcFeats,\n esriFeat;\n if (geoJsonObject){\n if (geoJsonObject.type === \"FeatureCollection\"){\n outObj = {\n features: []\n };\n gcFeats = geoJsonObject.features;\n for (i = 0; i < gcFeats.length; i++) {\n esriFeat = gcFeatureToEsriFeature(gcFeats[i]);\n if (esriFeat) {\n outObj.features.push(esriFeat);\n }\n }\n }\n else if (geoJsonObject.type === \"Feature\"){\n outObj = gcFeatureToEsriFeature(geoJsonObject);\n }\n else{\n outObj = gcGeometryToEsriGeometry(geoJsonObject);\n }\n }\n return outObj;\n };\n\n return gCon;\n }",
"function generateJSONStringFromPolyLine(polyLine){\n\t\tvar shape = [];\n\n\t\tpolyLine.getGeometry().eachLatLngAlt(function (lat, lng, alt, idx) {\n\t\t\tvar tempShape = [];\n\t\t\ttempShape.push(parseFloat(parseFloat(lat).toFixed(6)));\n\t\t\ttempShape.push(parseFloat(parseFloat(lng).toFixed(6)));\n\t\t\tshape[shape.length] = tempShape;\n\t\t});\n\t\treturn JSON.stringify(shape).replace(/\"/g,\"\");\n\t}",
"function processLineString(layer, featureData, options, builders) {\n // TODO: check this is ok...\n var vectors = readVectors(featureData && featureData.coordinates ? featureData.coordinates : []);\n \n return createLine(layer, vectors, options, builders);\n } // processLineString",
"getGeoJson(mode) {\n const stops = this.getGeoJsonStops(mode).features;\n const edges = this.getGeoJsonEdges().features;\n \n // Append the edge features to the stop features\n const geoJson = stops.concat(edges);\n \n return {\n 'type': 'FeatureCollection',\n 'features': geoJson\n };\n }",
"function _process(json, options) {\n // Add the header:\n let s = [\n '<!-- Made with Natural Earth. Free vector and raster map data @ naturalearthdata.com. -->\\n',\n '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\\n',\n ' <g transform=\"translate(0, 0) scale(1, 1)\">\\n',\n ].join('');\n\n // Add the SVG elements:\n let d;\n if (json.type === 'FeatureCollection') {\n for (let i = 0; i < json.features.length; i++) {\n d = _getSVGPath(json.features[i].geometry.coordinates, options);\n s += ` <path id=\"\" class=\"land\" d=\"${d}\"></path>\\n`;\n }\n } else {\n d = _getSVGPath(json.geometry.coordinates, options);\n s += ` <path id=\"\" class=\"land\" d=\"${d}\"></path>\\n`;\n }\n\n // Append the XML Footer:\n s += ' </g>\\n';\n s += '</svg>\\n';\n\n return s;\n }",
"function rebuildGeometries(hT){\n var geometries = {}\n _.sortBy(Object.keys(hT.objects)).forEach(function(version){\n if (geometries.hasOwnProperty( hT.objects[version].properties['@version'] ) ){\n geometries[hT.objects[version].properties['@version']].push ( topojson.feature(hT, hT.objects[version]) )\n }else{\n geometries[hT.objects[version].properties['@version']] = [ topojson.feature(hT, hT.objects[version]) ]\n }\n })\n return geometries\n}",
"function addGeoJsonFeatures(layer, features) {\n\t\tlayer.getSource().addFeatures(\n\t\t\t(new ol.format.GeoJSON()).readFeatures(\n\t\t\t\tturf.featurecollection(features), {\n\t\t\t\t\tdataProjection: 'EPSG:4326',\n\t\t\t\t\tfeatureProjection: 'EPSG:3857'\n\t\t\t\t}\n\t\t\t)\n\t\t);\n\t}",
"getDataFeatures(d, geoJson) {\n return new Promise((resolve, reject) => {\n if (typeof geoJson === 'object') {\n try {\n const features = d.addGeoJson(geoJson);\n resolve(features);\n } catch (e) {\n reject(e);\n }\n } else if (typeof geoJson === 'string') {\n d.loadGeoJson(geoJson, null, resolve);\n } else {\n reject(\"Impossible to extract features from geoJson: wrong argument type\");\n }\n });\n }",
"function draw_lines(results){\n\n for(i in results.distances){\n for(j in results.distances[i]){\n var line = results.distances[i][j].line;\n // Construct the polygon\n var poly = new google.maps.Polyline({\n path: google.maps.geometry.encoding.decodePath(line),\n geodesic: true,\n strokeColor: '#FF0000',\n strokeOpacity: 1.0,\n strokeWeight: 2\n });\n poly.setMap(map);\n }\n }\n}",
"function change_geojson(evt) {\n var ctl = $(evt.target),\n value = ctl.val();\n // When we update the geojson from the textarea control, raise a flag so we\n // (a) ignore bad geojson, and (b) don't replace the user's geojson with\n // the auto-generated geojson\n fromGeojsonUpdate = true;\n var result = layer.geojson(value, 'update');\n if (query.save !== 'false' && result !== undefined) {\n var geojson = layer.geojson();\n query.geojson = geojson ? JSON.stringify(geojson) : undefined;\n utils.setQuery(query);\n }\n fromGeojsonUpdate = false;\n}",
"_handleEventGeodata(event) {\n //Handle text/plain as WKT: DragAndDrop and CopyPaste\n {\n let eventData = event.clipboardData !== undefined ? event.clipboardData : event.dataTransfer;\n if (eventData.types.indexOf(\"text/plain\") >= 0) {\n console.log(\"ImportHandler: got text. Trying to interpret as WKT.\");\n\n //let content = event.dataTransfer.getData(\"text/plain\");\n let content = eventData.getData(\"text/plain\");\n console.log(content);\n\n let features = TheKarteHelperDataImport_loadGeoFromText(\"wkt\", content);\n this._theKarte.layerActive_addFeatures(features);\n }\n }\n\n //Handle files by extension\n if (event.dataTransfer !== undefined && event.dataTransfer.types.indexOf(\"Files\") >= 0) {\n const files = event.dataTransfer.files;\n\n //Check how multiple files are handled.\n for (let i = 0; i < files.length; i++) {\n const fileSuffix = files[i].name.split('.').pop();\n\n console.log(\"ImportHandler: got file (\" + files[i].name + \").\");\n\n const reader = new FileReader();\n reader.onload = function() {\n let features = TheKarteHelperDataImport_loadGeoFromText(fileSuffix, reader.result);\n\n console.log(\"ImportHandler: Adding to current layer.\");\n\n this._theKarte.layerActive_addFeatures(features);\n }.bind(this);\n reader.onerror = function() {\n console.error(\"ImportHandler: error reading (\" + files[i].name + \"): \" + reader.error);\n };\n reader.readAsText(files[i]);\n }\n }\n }",
"function geoJsonParse(resultArray){\n let results = resultArray.map(function(obj){\n let oneObj = GeoJSON.parse(obj, {Point: ['lat', 'long'], include: ['city']})\n oneObj['properties']= {\n 'id': obj.id, \n 'name': obj.name, \n 'age': obj.age, \n 'gender': obj.gender\n }\n return oneObj\n });\n return results\n}",
"function geometryrendering (pointsString, format, separator, geometry, vectorLayer, style, mapObjcetName, layerOptions, replace){\n var pointsArray=pointsString.split(separator);\n if(pointsArray.lenght==0)\n pointsArray[0]=pointsString; \n var i,latIndex,lonIndex,formatSeparator,tempPointSplit;\n var latFormatPosition=format.indexOf('lat');\n formatSeparator=format[3];\n if(latFormatPosition == 0){\n latIndex=0;lonIndex=1; \n }else{\n latIndex=1;lonIndex=0; \n }\n var olPointsArray=new Array();\n var olStyle;\n if (style && style!=\"\")\n olStyle=style;\n else\n olStyle = {\n fillColor: \"#ee9900\",\n fillOpacity: 0.4, \n hoverFillColor: \"white\",\n hoverFillOpacity: 0.8,\n strokeColor: \"#ee9900\",\n strokeOpacity: 1,\n strokeWidth: 1,\n strokeLinecap: \"round\",\n hoverStrokeColor: \"red\",\n hoverStrokeOpacity: 1,\n hoverStrokeWidth: 0.2,\n pointRadius: 6,\n hoverPointRadius: 1,\n hoverPointUnit: \"%\",\n pointerEvents: \"visiblePainted\",\n cursor: \"\"\n }\n for(i=0; i<pointsArray.length;i++){\n tempPointSplit=pointsArray[i].split(formatSeparator); \n olPointsArray.push(new OpenLayers.Geometry.Point(tempPointSplit[lonIndex], tempPointSplit[latIndex])); \n }\n var mapObject=eval(mapObjcetName);\n var layer_style = OpenLayers.Util.extend({}, OpenLayers.Feature.Vector.style['default']);\n if(layerOptions.layerFillOpacity)\n layer_style.fillOpacity = layerOptions.layerFillOpacity;\n if(layerOptions.layerGraphicOpacity)\n layer_style.graphicOpacity = layerOptions.layerGraphicOpacity;\n var feature;\n switch(geometry){\n case \"polygon\":\n var linearRing = new OpenLayers.Geometry.LinearRing(olPointsArray);\n feature = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon([linearRing]),null,olStyle);\n break;\n case \"point\":\n feature = new OpenLayers.Feature.Vector(olPointsArray[0],null,olStyle);\n break; \n case \"line\":\n feature = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LineString(olPointsArray),null,olStyle);\n break; \n }\n \n var layerName=vectorLayer;\n \n var vectorLayerObj=mapObject.getLayersByName(layerName)[0];\n\n if(!vectorLayerObj){\n vectorLayerObj=new OpenLayers.Layer.Vector(layerName, {style: layer_style, displayInLayerSwitcher: layerOptions.displayInLayerSwitcher});\n mapObject.addLayer(vectorLayerObj);\n vectorLayerObj.addFeatures([feature]);\n }else{\n if(replace){ \n mapObject.removeLayer(vectorLayerObj); \n vectorLayerObj=new OpenLayers.Layer.Vector(layerName, {style: layer_style, displayInLayerSwitcher: layerOptions.displayInLayerSwitcher});\n mapObject.addLayer(vectorLayerObj);\n vectorLayerObj.addFeatures([feature]);\n } \n else \n vectorLayerObj.addFeatures([feature]); \n } \n}",
"function gcGeometryToEsriGeometry(gcGeom) {\n var esriGeometry,\n esriGeomInfo,\n gcGeometriesToConvert,\n i,\n g,\n coords;\n\n //if geometry collection, get info about first geometry in collection\n if (gcGeom.type === \"GeometryCollection\") {\n gcGeometriesToConvert = [gcGeom.geometries.shift()];\n esriGeomInfo = gcGeomTypeToEsriGeomInfo(gcGeometriesToConvert[0].type);\n\n //loop through collection and only add compatible geometries to the array\n //of geometries that will be converted\n for (i = 0; i < gcGeom.geometries.length; i++) {\n if (isCompatible(esriGeomInfo.type, gcGeom.geometries[i].type)) {\n gcGeometriesToConvert.push(gcGeom.geometries[i]);\n }\n }\n } else {\n esriGeomInfo = gcGeomTypeToEsriGeomInfo(gcGeom.type);\n gcGeometriesToConvert = [gcGeom];\n }\n\n //if a collection contained multiple points, change the ESRI geometry\n //type to MultiPoint\n if (esriGeomInfo.type === \"esriGeometryPoint\" && gcGeometriesToConvert.length > 1) {\n esriGeomInfo = gcGeomTypeToEsriGeomInfo(\"MultiPoint\");\n }\n\n //make new empty ESRI geometry object\n esriGeometry = {\n //type: esriGeomInfo.type,\n spatialReference: {\n wkid: 4326\n }\n };\n\n //perform conversion\n if (esriGeomInfo.type === \"esriGeometryPoint\") {\n if (gcGeometriesToConvert[0].coordinates.length === 0) {\n esriGeometry.x = null;\n esriGeometry.y = null;\n } else {\n esriGeometry.x = gcGeometriesToConvert[0].coordinates[0];\n esriGeometry.y = gcGeometriesToConvert[0].coordinates[1];\n }\n } else {\n esriGeometry[esriGeomInfo.geomHolder] = [];\n for (i = 0; i < gcGeometriesToConvert.length; i++) {\n coords = gcCoordinatesToEsriCoordinates(gcGeometriesToConvert[i]);\n for (g = 0; g < coords.length; g++) {\n esriGeometry[esriGeomInfo.geomHolder].push(coords[g]);\n }\n }\n }\n return esriGeometry;\n }",
"getGeoJsonStops(mode) {\n var geoJson = [];\n \n this.stops.forEach((stop,index) => {\n let feature = {\n 'type': 'Feature',\n 'properties': {\n 'id': stop.id,\n 'name': stop.name,\n 'routes': stop.routes,\n },\n 'geometry': {\n 'type': Geometry.Point,\n 'coordinates': [stop.longitude, stop.latitude]\n }\n };\n \n if (mode) {\n feature.properties.rank = this.ranks[mode][index];\n feature.properties['marker-color'] = '#ff0000';\n }\n \n geoJson.push(feature);\n });\n \n return {\n 'type': 'FeatureCollection',\n 'features': geoJson\n };\n }",
"function getFeatures(city){\n const geojsonFilePath = path.join(process.cwd(),'data',city, city + '_streets.geojson');\n console.log('Reading ', geojsonFilePath);\n\n const originalGeojson = fs.readFileSync(geojsonFilePath);\n\n const originalData = JSON.parse(originalGeojson);\n if (!originalData || ! 'features' in originalData){\n throw new Error('File does not look as a GeoJSON')\n }\n return originalData.features;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Increases the revision counter and dispatches a 'change' event. | changed() {
++this.revision_;
this.dispatchEvent(EventType.CHANGE);
} | [
"function handleIncrease() {\n if (selectedAmount < stockCount) setSelectedAmount(selectedAmount + 1);\n }",
"onDatabaseVersionChange(_) {\n Log.debug('IndexedDb: versionchange event');\n }",
"function fileChanged() {\n \"use strict\";\n if (bTrackChanges) {\n if (!bFileChanged) {\n bFileChanged = true;\n highlightChanged();\n }\n }\n}",
"function increment(event){\n if (isRunning){\n return;\n }\n var target = event.data.target;\n // Get the value of the target\n var value = parseInt(readInput(target));\n // Increment it\n value++;\n // Output incremented value back to target\n output(target, value);\n }",
"add_change(func) {\n this.add_event(\"change\", func);\n }",
"function onUpdate(fromVersion, toVersion) {\n\tconsole.log('Extension has been updated from version ', fromVersion, ' to version ', toVersion);\n}",
"function increaseVertexCount() {\n let vertexCount = retrieveVertexCount();\n if (vertexCount < 100) {\n ++vertexCount;\n document.getElementById(\"vertices\").value = vertexCount.toString();\n document.getElementById(\"vertices\").dispatchEvent(new Event(\"change\"));\n }\n}",
"edlUpdated() {\n console.log(`edl updated, revision ${this.edl.revision}`);\n this.setState( { revision : this.edl.revision } );\n }",
"function openForReview(event) {\n var revision = event.data.revision;\n window.location = \"../review.html?revision=\" + revision;\n}",
"function updateCounter(counter) {\n counter++;\n console.log(`I have pressed: ` + counter);\n}",
"on_change(ev){\r\n\t\tthis.val = this.get_value();\r\n\t\t// hack to get around change events not bubbling through the shadow dom\r\n\t\tthis.dispatchEvent(new CustomEvent('pion_change', { \r\n\t\t\tbubbles: true,\r\n\t\t\tcomposed: true\r\n\t\t}));\r\n\t\t\r\n\t\tif(!this.hasAttribute(\"noupdate\")){ //Send value to server\t\t\r\n\t\t\tsend_update(this, this.getAttribute(\"item_name\"), new Value(this.val));\t\t\t\r\n\t\t}\r\n\t\t\r\n\t}",
"function updateGenerationCounter() {\n \t\t$('#generation span').html(++generation);\n \t}",
"function changeProductCount(event) {\n const $target = $(event.currentTarget);\n const id = $target.data('product-id');\n const countDiff = event.target.value - $target.data('last-count');\n const data = {\n id,\n quantity: Math.abs(countDiff),\n };\n\n server.changeInCart(id, event.target.value)\n .then((newData) => {\n mediator.publish('onCartUpdate', newData);\n mediator.publish(countDiff > 0 ? 'onProductAdd' : 'onProductRemove', [data]);\n });\n }",
"relDependencyChanged(component, rel) {\n // check if a dependency has been selected\n if (rel.Dependency == \"\") {\n rel.Version = \"\"\n } else {\n // add version to relationship\n rel.Version = \"\"\n for (var c of this.model.Catalog) {\n if (c.Component == component) {\n for (var d in c.Dependencies) {\n if (d == rel.Dependency) {\n rel.Type = c.Dependencies[d].Type\n rel.Version = c.Dependencies[d].Version\n break\n }\n }\n // dependency has already been found\n if (rel.Version != \"\") {\n break\n }\n }\n }\n }\n\n // update GUI\n this.$forceUpdate()\n }",
"@action\n statusChangeAction(field, value) {\n if (value == 'approved') {\n this.editEntry.set('create_entry', 1);\n }\n }",
"function storeRevision () {\n\t// Give 'strong' tags to the name in the new input\n\tconst re = /(\\w+),\\s/;\n\tconst input = PCdiv.querySelector('input').value;\n\tconst message = input.replace(re, `<strong>$1,</strong> `);\n\n\t// Replace old entry with the revision\n\tPCdiv.childNodes.forEach( function (val, ind) {\n\t\tif (val.className === 'edit-pc') myPCs[ind] = message;\n\t});\n\tprintPCs();\n\n\talterButton(editPCbutton, 'Edit PC', storeRevision, editPC);\n}",
"function changeScore(subIncrease, monthIncrease) {\n subscriberNumber += subIncrease;\n monthNumber += monthIncrease;\n}",
"function updateCounter(){\n\t//subtracts one from battery percentage \n\tbatteryPercentage -= 1;\n\t//changes text to match the new battery percentage \n\t\n\t\n}",
"function onSnippetUpdate(filename) {\n console.log('Snippet Update', filename);\n\n // Send the socket client the newest content\n var files = filename ? [filename] : null;\n socket.emit('fileUpdate', channel.repr(files));\n \n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Deletes the current search from savedsearches.conf AND the KV Store | async _deleteSearch(search_name, kv_data) {
let deletedSearchName = search_name || this.search_name;
let self = this;
var searchDeleted = await this.saved_searches.del(deletedSearchName, null, function (err) {
if (err) {
return err;
}
else {
self._deleteKVStore(kv_store);
}
});
// Checks to verifiy promise is finished
if (!!searchDeleted) {
return true;
}
} | [
"ClearSearch () {\n return { type: types.CLEAR_SEARCH }\n }",
"function deleteSearch(title) {\n // grabs the currently logged in user's id as our identifier to delete searches in the route as well as the title\n $.get(\"/api/user_data\").then(function({ id }) {\n $.ajax({\n method: \"DELETE\",\n url: \"/api/user/\" + id + \"/search\",\n data: title\n }).then(function() {\n location.reload();\n });\n });\n }",
"function destroy() {\n self.formSearch.off(\".zs\");\n }",
"function clearSearchResult() {\n if (current_mode !== mode.search) {\n console.log(\"Warning: request to clear search result when not in search mode.\");\n return;\n }\n path.classed(\"dimmed\", false);\n highlightSelectedLinks(false);\n selected_links = [];\n //displayConnections(false);\n displayInterParents(false);\n resetSearchResultsPanel();\n if (old_focused_source !== null) svg.select(\"#arc-\" + old_focused_source.key).classed(\"highlighted\", false);\n if (old_focused_target !== null) svg.select(\"#arc-\" + old_focused_target.key).classed(\"highlighted\", false);\n current_mode = mode.exploration;\n}",
"function deleteStore() {\n\tif (document.querySelector(\"#stores-info\")) {\n\t\tconst confirmation = confirm(\"Are you sure you want to delete the store?\")\n\t\tif (confirmation) {\n\t\t\tlet selectStoreId = document.querySelector(\"#stores-info\").getAttribute(\"storeKey\");\n\t\t\t\n\t\t\tSTORES.splice(selectStoreId, 1)\n\t\t\tlocalStorage[\"Stores\"] = JSON.stringify(STORES);\n\n\t\t\tlocation.reload();\n\t\t}\n\t} else {\n\t\t popUpStatus(`Select the store you want to delete :)`)\n\t}\n}",
"function clearStorage() {\n Object.keys(localStorage).filter(function (key) {\n return key.startsWith(options.name);\n }).forEach(function (key) {\n return localStorage.removeItem(key);\n });\n}",
"function checkSavedSearches() {\n var checkStorage = JSON.parse(localStorage.getItem(\"saved\"));\n if (checkStorage !== null) {\n searchStorage = checkStorage;\n }\n }",
"stopSearching() {\n\t\tthis.liveCounter = this.livePandaUIStr.length + ((MySearchUI.searchGStats && MySearchUI.searchGStats.isSearchOn()) ? this.liveSearchUIStr.length : 0);\n\t\tif (this.timerUnique && this.liveCounter === 0) { if (MySearchTimer) MySearchTimer.deleteFromQueue(this.timerUnique); this.timerUnique = null; }\n\t}",
"clearSourceSearch() {\n this.sourceQuery = '';\n this.sourceCategoryResults.length = 0;\n }",
"clearTargetSearch() {\n this.targetQuery = '';\n this.targetCategoryResults.length = 0;\n }",
"function removeRecentSearchTerm( term ){\n recent.remove( term, function(){\n populateRecentSeachTerms();\n });\n}",
"function storeSearches() {\n localStorage.setItem(\"storedSearches\", JSON.stringify(storedSearches));\n}",
"function removeStrainSearch() {\n const resultsContainer = document.querySelector('.results-container')\n while (resultsContainer.lastChild) {\n resultsContainer.removeChild(resultsContainer.lastChild)\n }\n}",
"function clear() {\n resetStore();\n }",
"function delete_search_query(query, $q) \n{\n\tvar q \t\t= $q.defer();\n\n\tvar request = twitter_search_queries_db.transaction([\"twitter_search_queries\"], \"readwrite\")\n .objectStore(\"twitter_search_queries\")\n\t .delete(query);\n\n\trequest.onsuccess \t= function(event) {\n \t // It's gone!\n \t\tq.resolve(\"Deleted\");\n\t}\n\trequest.onerror \t= function (event) {\n\t\tq.reject(\"Error in deleting\");\n\t}\n\n\treturn q.promise;\n\n} // delete_search_query",
"function resetSearch() {\n\t$searchInput.value = \"\";\n\t$navbarSearchInput.value = \"\";\n\tsetInactiveSearch();\n}",
"function clearSearchResultsList() {\n\tvar ul = document.getElementById(\"searchResultsList\");\n\twhile (ul.firstChild) {\n\t\tul.removeChild(ul.firstChild);\n\t}\n}",
"deleteItem() {\n if (this.selectionIndex !== -1) {\n const collection = this.query.length === 0 ? 'clipboardContent' : 'searchResults';\n const clipboardItem = this[collection].splice(this.selectionIndex, 1)[0];\n\n db.items.where('text').equals(clipboardItem).delete().then((count) => {\n this.selectionIndex = -1;\n this.currentPage = 0;\n this.currentSearchPage = 0;\n\n if (this.query.length > 0) {\n this.searchClipboard(this.query);\n } else {\n this.loadClipboard();\n }\n });\n }\n }",
"clearSearchResults() {\n if (this.state.filter.length > 0) {\n this.fetchConsumerComplaintList()\n this.props.history.push(`/home/consumers?activeTab=consumer-complaints&activePage=1&limit=10`)\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
TRY CHECK THE INPUT VERIFACTION FUCTION PASSED LIKE A CALLBACK | function check(callback,input){
try{
return callback(input);
}catch(error){
return false;
}
} | [
"static checkCallbackFnOrThrow(callbackFn){if(!callbackFn){throw new ArgumentException('`callbackFn` is a required parameter, you cannot capture results without it.');}}",
"hasCallback() {}",
"function sendInterventionDialogYesNoConfirmInputResponse (event, fn, userInput) {\n\n incrementTimers(globals);\n servletFormPost(event, \"&probElapsedTime=\"+globals.probElapsedTime + \"&destination=\"+globals.destinationInterventionSelector + \"&userInput=\"+userInput,\n fn) ;\n}",
"validateInput(data, callback) {\n const value = this.getInputFromData(data);\n const result = value === undefined\n || value === null\n || typeof value === 'string'\n || (typeof value === 'object' && (typeof value.first === 'string'\n || value.first === null\n || typeof value.last === 'string'\n || value.last === null));\n utils.defer(callback, result);\n }",
"function wantsExternalActivity () {\n alert(\"Student wants the external activity\") ;\n // send an InputResponse to the server with YES. callback fn should be processNextProblemResult\n sendNextProblemInputResponse(\"&answer=YES\");\n}",
"set onInputCreated(callback) {\n if (typeof(callback) == 'function') {\n this.callback_on_input_created = callback;\n } else {\n console.error(`${this.logprefix} Error setting onInputCreated callback => the argument is not a function`);\n }\n }",
"function checkProcessInput(input)\n{\n if (input.processe !== undefined) {\n input.processe = parseProcess(input.processe);\n }\n return processe !== undefined;\n}",
"function detectInvio(evt,fun)\n{\t\t\n\tvar funWithNoParameters=\"\";\n\t\t\t\t\n\tif (fun)\n\t{\n\t\tif (evt.keyCode==\"13\")\n\t\t{\n\t\t\tfunWithNoParameters=fun.substring(0,fun.indexOf(\"(\")>-1?fun.indexOf(\"(\"):fun.length);\n\t\t\tif (eval(\"this.\"+funWithNoParameters))\n\t\t\t\teval(fun) \n\t\t}\n\t}\n}",
"formNotOK() {\n alert(\"verifiez les champs en rouge\");\n }",
"static validateValuationCodeEntered(pageClientAPI, dict) {\n let error = false;\n let message = '';\n //Code group is not empty\n if (!libThis.evalCodeGroupIsEmpty(dict)) {\n //Characteristic is blank\n if (libThis.evalIsCodeOnly(dict)) {\n error = (libThis.evalValuationCodeIsEmpty(dict));\n if (error) {\n message = pageClientAPI.localizeText('field_is_required');\n libCom.setInlineControlError(pageClientAPI, libCom.getControlProxy(pageClientAPI, 'ValuationCodeLstPkr'), message);\n }\n } else {\n //Code sufficient is set and reading is empty\n if (libThis.evalIsCodeSufficient(dict) && libThis.evalIsReadingEmpty(dict)) {\n error = (libThis.evalValuationCodeIsEmpty(dict));\n if (error) {\n message = pageClientAPI.localizeText('validation_valuation_code_or_reading_must_be_selected');\n libCom.setInlineControlError(pageClientAPI, libCom.getControlProxy(pageClientAPI, 'ReadingSim'), message);\n libCom.setInlineControlError(pageClientAPI, libCom.getControlProxy(pageClientAPI, 'ValuationCodeLstPkr'), message);\n }\n }\n }\n }\n if (error) {\n dict.InlineErrorsExist = true;\n return Promise.reject(false);\n } else {\n return Promise.resolve(true);\n }\n }",
"function validate(inst, vo)\n{\n if (inst.enablePolicy) {\n if (inst.policyInitFunction === 'Custom') {\n if (!isCName(inst.policyInitCustomFunction)) {\n logError(vo, inst, \"policyInitCustomFunction\",\n \"Not a valid C identifier\");\n }\n if (inst.policyInitCustomFunction === '') {\n logError(vo, inst, \"policyInitCustomFunction\",\n \"Must contain a valid function name if the \" +\n \"Policy Init Function field == 'Custom'\");\n }\n }\n if (inst.policyFunction === 'Custom') {\n if (!isCName(inst.policyCustomFunction)) {\n logError(vo, inst, \"policyCustomFunction\",\n \"is not a valid C identifier\");\n }\n if (inst.policyCustomFunction === '') {\n logError(vo, inst, \"policyCustomFunction\",\n \"Must contain a valid function name if the \" +\n \"Policy Function field == 'Custom'\");\n }\n }\n }\n\n if ((inst.enableHFXTClock)) {\n if ((inst.hfxtFrequency == '0')) {\n if (inst.bypassHFXT) {\n logError(vo, inst, 'hfxtFrequency',\n 'If HFXT is enabled in bypass mode, please specify ' +\n 'the external crystal square wave frequency.');\n } else {\n logError(vo, inst, 'hfxtFrequency',\n 'Specify the desired HFXT oscillator frequency.');\n }\n }\n }\n\n if ((inst.initialPerfLevel - inst.customPerfLevels) > 3) {\n logError(vo, inst, ['initialPerfLevel', 'customPerfLevels'],\n 'The initial performance level refers to an undefined custom ' +\n 'performace level.');\n }\n\n if (!isCName(inst.resumeShutdownHookFunction)) {\n logError(vo, inst, \"resumeShutdownHookFunction\", 'Not a valid C identifier');\n }\n\n if (inst.advancedConfiguration) {\n if (!isCName(inst.isrClockSystem)) {\n logError(vo, inst, \"isrClockSystem\", 'Not a valid C identifier');\n }\n }\n}",
"function validateParry (data, command) {\n // no additional validation necessary\n return true;\n }",
"validar() { }",
"function commandTrigger() {\n var line = promptText;\n if (typeof config.commandValidate == 'function') {\n var ret = config.commandValidate(line);\n if (ret == true || ret == false) {\n if (ret) {\n handleCommand();\n }\n } else {\n commandResult(ret, \"jquery-console-message-error\");\n }\n } else {\n handleCommand();\n }\n }",
"function fireCallback(eventName,v){var eventData=getEventData(eventName,v);if(!options.v2compatible){trigger(container,eventName,eventData);if(options[eventName].apply(eventData[Object.keys(eventData)[0]],toArray(eventData))===false){return false;}}else{if(options[eventName].apply(eventData[0],eventData.slice(1))===false){return false;}}return true;}",
"formOK() {\n alert(\"le formulaire a รฉtรฉ transmis avec succรจs\");\n }",
"function doesNotWantExternalActivity () {\n alert(\"Student does not want the external activity\") ;\n // send an InputResponse to the server with NO. callback fn should be processNextProblemResult\n sendNextProblemInputResponse(\"&answer=NO\");\n servletGet(\"InputResponseNextProblemIntervention\",\"&probElapsedTime=\"+globals.probElapsedTime + \"&destination=\"+globals.destinationInterventionSelector,\n processNextProblemResult)\n}",
"static checkParamsValidity (channel) {\n const { clientId, clientSecret, serviceId } = channel\n channel.phoneNumber = channel.phoneNumber.split(' ').join('')\n\n if (!clientId) { throw new BadRequestError('Parameter is missing: Client Id') }\n if (!clientSecret) { throw new BadRequestError('Parameter is missing: Client Secret') }\n if (!serviceId) { throw new BadRequestError('Parameter is missing: Service Id') }\n if (!channel.phoneNumber) { throw new BadRequestError('Parameter is missing: Phone Number') }\n\n return true\n }",
"function validateNone (data, command) {\n // good job!\n return true;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check an object for unexpected properties. Accepts the object to check, and an array of allowed property names (strings). Returns an array of key names that were found on the object, but did not appear in the list of allowed properties. If no properties were found, the returned array will be of zero length. | function extraProperties(obj, allowed)
{
mod_assert.ok(typeof (obj) === 'object' && obj !== null,
'obj argument must be a non-null object');
mod_assert.ok(Array.isArray(allowed),
'allowed argument must be an array of strings');
for (var i = 0; i < allowed.length; i++) {
mod_assert.ok(typeof (allowed[i]) === 'string',
'allowed argument must be an array of strings');
}
return (Object.keys(obj).filter(function (key) {
return (allowed.indexOf(key) === -1);
}));
} | [
"function defineObjectKeys(){\n Object.keys = (function() {\n 'use strict';\n var hasOwnProperty = Object.prototype.hasOwnProperty,\n hasDontEnumBug = !({ toString: null }).propertyIsEnumerable('toString'),\n dontEnums = [\n 'toString',\n 'toLocaleString',\n 'valueOf',\n 'hasOwnProperty',\n 'isPrototypeOf',\n 'propertyIsEnumerable',\n 'constructor'\n ],\n dontEnumsLength = dontEnums.length;\n\n return function(obj) {\n if (typeof obj !== 'object' && (typeof obj !== 'function' || obj === null)) {\n throw new TypeError('Object.keys called on non-object');\n }\n\n var result = [], prop, i;\n\n for (prop in obj) {\n if (hasOwnProperty.call(obj, prop)) {\n result.push(prop);\n }\n }\n\n if (hasDontEnumBug) {\n for (i = 0; i < dontEnumsLength; i++) {\n if (hasOwnProperty.call(obj, dontEnums[i])) {\n result.push(dontEnums[i]);\n }\n }\n }\n return result;\n };\n }());\n}",
"function hasFieldsExcept( obj, arrFields )\n{\n\tvar field;\n\n\tfor ( field in obj )\n\t{\n\t\tif ( ! obj.hasOwnProperty( field ) )\n\t\t{\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( -1 === arrFields.indexOf( field ) )\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}",
"function validateParamsPresent(expectedKeys, params) {\n params = params || {};\n var paramKeys = _.keys(params);\n return _.first(_.difference(expectedKeys, _.intersection(paramKeys, expectedKeys)));\n}",
"function objectKeys(object) { Object.keys(object) }",
"function showProperties(obj) {\n for(let key in obj) {\n if(typeof obj[key] === 'string') {\n console.log(key, obj[key]);\n }\n }\n}",
"function keys(obj) {\n //return Object.keys(obj);\n var output = [];\n each(obj, function(elem, key) {\n output.push(key);\n });\n return output;\n}",
"get missingIdentifierFields() {\n let results = [];\n for (let field in this.identifiers) {\n if (! this.identifiers[field]) {\n results.push(field);\n }\n }\n return results;\n }",
"static _validateNoUndefinedMembers(jsonObject, keyPath) {\n if (!jsonObject) {\n return;\n }\n if (typeof jsonObject === 'object') {\n for (const key of Object.keys(jsonObject)) {\n keyPath.push(key);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const value = jsonObject[key];\n if (value === undefined) {\n const fullPath = JsonFile._formatKeyPath(keyPath);\n throw new Error(`The value for ${fullPath} is \"undefined\" and cannot be serialized as JSON`);\n }\n JsonFile._validateNoUndefinedMembers(value, keyPath);\n keyPath.pop();\n }\n }\n }",
"getPropertyKeys() {\n let properties = this.getProperties();\n let propertyKeys = [];\n if (properties) {\n for (var key in properties) {\n if (Object.prototype.hasOwnProperty.call(properties, key)) {\n propertyKeys.push(key);\n }\n }\n }\n propertyKeys = propertyKeys.sort();\n return propertyKeys;\n }",
"function validateObjectArgument(vObj){\n if(!(typeof vObj === 'object')) throw 'superSelect Requires an object argument';\n var keyCount = 0, objAryCount = 0, arys = [];\n for (keyCount; keyCount < Object.keys(vObj).length; keyCount++){\n if(Array.isArray(obj[Object.keys(vObj)[keyCount]])){\n arys.push(obj[Object.keys(vObj)[keyCount]]);\n objAryCount ++;\n }\n }\n if (objAryCount < 2) throw 'object argument requires two array properties';\n //Check arrays for object contents\n var arraysOfobjectOnlyCount = 0;\n arys.forEach(function(element, idx, ary){\n element.forEach(function(el, idx2, sary){\n\n }\n )\n });\n }",
"function listAllProperties(o){ \n\tvar objectToInspect; \n\tvar result = [];\n\t\n\tfor(objectToInspect = o; objectToInspect !== null; objectToInspect = Object.getPrototypeOf(objectToInspect)){ \n\t\tresult = result.concat(Object.getOwnPropertyNames(objectToInspect)); \n\t}\n\t\n\treturn result; \n}",
"check(validProps, layerName) {\n for (let propName of this.map.keys()) {\n let prop = validProps.get(propName);\n for (let other of prop.otherPropsRequired) {\n if (!this.has(other)) {\n throw new Error('Property \"' + propName + '\" also requires ' +\n 'property \"' + other + '\" but the second one was ' +\n 'not found. This happened in the layer \"' + layerName + '\".');\n }\n }\n }\n }",
"objectKeys(obj) {\n if (obj instanceof Object) {\n return (function*() {\n for (let key in obj) {\n yield key;\n }\n })();\n } else {\n return [];\n }\n }",
"function CfnBucket_S3KeyFilterPropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties)));\n }\n errors.collect(cdk.propertyValidator('rules', cdk.requiredValidator)(properties.rules));\n errors.collect(cdk.propertyValidator('rules', cdk.listValidator(CfnBucket_FilterRulePropertyValidator))(properties.rules));\n return errors.wrap('supplied properties not correct for \"S3KeyFilterProperty\"');\n}",
"function hasProps(keys, x) {\n if(!isFoldable(keys)) {\n throw new TypeError(err)\n }\n\n if(isNil(x)) {\n return false\n }\n\n var result = keys.reduce(\n every(hasKey(x)),\n null\n )\n\n return result === null || result\n}",
"function attributeKeys(record) {\n return Object.keys(record).filter(function(key) {\n return key !== 'id' || key !== 'type';\n })\n}",
"function getAllKeys(obj) {\r\n for (let key in obj) {\r\n if (typeof obj[key] === \"object\") {\r\n keyArr.push(key);\r\n getAllKeys(obj[key]);\r\n } else {\r\n keyArr.push(key);\r\n }\r\n }\r\n return keyArr;\r\n}",
"function omit(obj, arr){\n let newObj={};\n for (let key in obj){\n if (!arr.includes(key)) newObj[key] = obj[key];\n }\n \n return newObj;\n}",
"function CfnBucket_NotificationFilterPropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties)));\n }\n errors.collect(cdk.propertyValidator('s3Key', cdk.requiredValidator)(properties.s3Key));\n errors.collect(cdk.propertyValidator('s3Key', CfnBucket_S3KeyFilterPropertyValidator)(properties.s3Key));\n return errors.wrap('supplied properties not correct for \"NotificationFilterProperty\"');\n}",
"function pickAndValidateWheres(obj, publicToModel, allowedKeys) {\n // Pick all keys which are allowed in the query\n var whereObj = _.pickBy(obj, function(val, key) {\n var isAllowed = _.isArray(allowedKeys)\n ? _.includes(allowedKeys, key)\n : true;\n return isAllowed && !_.isUndefined(val);\n });\n\n // Validate all values used in the where query\n _.each(whereObj, function(val, whereKey) {\n var Model;\n var modelAttribute;\n if (!_.isPlainObject(publicToModel)) {\n Model = publicToModel\n modelAttribute = whereKey;\n } else {\n Model = publicToModel[whereKey].model;\n modelAttribute = publicToModel[whereKey].attribute;\n }\n\n var attributeSchema = Model.prototype.schema[modelAttribute];\n if (!attributeSchema) {\n attributeSchema = BASE_SCHEMA[modelAttribute];\n }\n\n var joiValidate = attributeSchema.optional();\n if (_.isArray(val)) {\n _.each(val, function(item) {\n validate(item, whereKey, joiValidate);\n });\n } else {\n validate(val, whereKey, joiValidate);\n }\n });\n\n return whereObj;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the index of the App that matches the supplied ID. | function getAppIndexById(id) {
if (!id || typeof id != "string") return null;
for (var node = 0; node < apps.length; node++) {
if (apps[node].id == id) {
return node;
}
}
return null;
} | [
"get activeManifestIndex() {\n if (this.manifest && this.manifest.items && this.activeId) {\n for (var index in this.manifest.items) {\n if (this.manifest.items[index].id === this.activeId) {\n return parseInt(index);\n }\n }\n }\n return -1;\n }",
"indexOfId(id) {\n var Model = this.constructor.classes().model;\n var index = 0;\n var result = -1;\n id = String(id);\n\n while (index < this._data.length) {\n var entity = this._data[index];\n if (!(entity instanceof Model)) {\n throw new Error('Error, `indexOfId()` is only available on models.');\n }\n if (String(entity.id()) === id) {\n result = index;\n break;\n }\n index++;\n }\n return result;\n }",
"getIndex(id, data){\n for(let i=0; i<data.length; i++){\n if(id === data[i].id){\n return i;\n }\n }\n console.log(\"No match found\");\n return 0;\n }",
"function indexById(videoId)\n {\n for (var i = 0; i < videoList.length; i++)\n {\n if (videoId == videoList[i].id)\n {\n return i;\n }\n }\n return -1;\n }",
"function getExprIndex(id) {\n\t\tlet exprs = Calc.getState().expressions.list;\n\t\treturn exprs.findIndex((elem) => {\n\t\t\treturn elem.id === id;\n\t\t});\n\t}",
"function getOrderIdxById(id) {\n\tif (isNaN(id)) {\n\t\tthrow NaN;\n\t} else {\n\t\tid = Number(id);\n\t}\n\tvar idx = undefined;\n\tfor (var i = 0; i < orders.length; i++) {\n\t\tif (orders[i].id === id) {\n\t\t\tidx = i;\n\t\t}\n\t}\n\treturn idx;\n}",
"function getIndexOfId(list, item) {\n return list.map(function(e) {\n return e.ID;\n }).indexOf(item);\n}",
"function getIndexOfMenuItem(truckID, name) {\n\t//aey - make sure truck exists\n\tif(doesTruckExist(truckID) == false) {\n\t\treturn -1;\n\t}\n\t//aey - make sure menu exists\n\tvar truck = getTruckWithID(truckID);\n\tif(isArrayEmpty(truck.menu)){\n\t\treturn -1;\n\t}\n\t\n\tif(doesMenuItemExist(truckID, name)) {\n\t\tfor(let i = 0; i < truck.menu.length; i++){\n\t\t\tif(truck.menu[i].name == name){ //aey - if found return index\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1; //aey - otherwise return -1 if error\n\t}\n}",
"function findEntry(resultId, db) {\n for (const page of db) {\n if (page.id === resultId) {\n return page;\n }\n }\n return resultId;\n}",
"getUserIndex(){\n var i;\n\n // For each user, check if UUID matches id in the usersPlaying array\n for (i = 0; i < this.props.usersPlaying.length; i++) {\n if(this.props.usersPlaying[i] == this.props.pubnubDemo.getUUID()) {\n return i;\n break;\n }\n }\n return -1;\n }",
"function findItemKey (itemId) {\n for (var key = 0; key < items.length; key++) {\n if (items[key].id == itemId) {\n return key;\n }\n }\n}",
"function DetermineAppID(u_inp) {\n if (NameOrID(u_inp)) {\n if (appIDMap.has(parseInt(u_inp, 10))) {\n appID = u_inp;\n validSearch = true\n } else {\n validSearch = false\n }\n\n } else if (UpCase_NameMap.has(u_inp.toUpperCase())) {\n validSearch = true;\n appID = appMap.get(UpCase_NameMap.get(u_inp.toUpperCase()));\n } else\n validSearch = false;\n\n\n}",
"function getUrlLocalModelInd(urlId) {\n for (var i = 0; i < $scope.urls.length; i++) {\n if ($scope.urls[i]._id === urlId) {\n return i;\n }\n }\n return -1;\n }",
"function _killAppInfoById(app) {\n\t\tif (app.rowData && app.rowData.app_id) {\n\t\t\ttry {\n\t\t\t\tappInfo = Ti.Tizen.Application.getAppInfo(app.rowData.app_id);\n\t\t\t} catch (error) {\n\t\t\t\t_args.showErrorDialog(error, 'Could not call tizen.application.getAppInfo function');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tTi.API.info('appInfo.id: ' + appInfo.id);\n\n\t\t\tvar checkedAppId = app.rowData.id,\n\t\t\t\toptionsDialogOpts = {\n\t\t\t\t\toptions: ['Ok', 'Cancel'],\n\t\t\t\t\tdestructive: 1,\n\t\t\t\t\tcancel: 1,\n\t\t\t\t\ttitle: 'Do you want to kill this application? \\n\\n Id = ' + checkedAppId + '\\n\\n Name = ' + appInfo.name + (appInfo.version ? '\\n\\n Version = ' + appInfo.version : ' ')\n\t\t\t\t},\n\t\t\t\tdialog = Titanium.UI.createOptionDialog(optionsDialogOpts);\n\n\t\t\tdialog.addEventListener('click', function(e) {\n\t\t\t\t// Press OK button\n\t\t\t\tif (e.index === 0) {\n\t\t\t\t\tTi.API.info('Start to kill application with id = ' + checkedAppId);\n\n\t\t\t\t\tTi.Tizen.Application.kill(checkedAppId, function() {\n\t\t\t\t\t\t\t// Success callback\n\t\t\t\t\t\t\tTi.API.info('Application with ID = ' + checkedAppId + ' has been killed.');\n\n\t\t\t\t\t\t\ttableview.deleteRow(app.index);\n\t\t\t\t\t\t}, function(error) {\n\t\t\t\t\t\t\t// Error callback. Error should be instance of WebAPIError\n\t\t\t\t\t\t\t_args.showErrorDialog(error.name, error.message);\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tdialog.show();\n\t\t}\n\t}",
"function findTruckWithID (truckID) {\n\tif(isArrayEmpty(localTruckArray)) return -2; // aey - if no trucks\n\tfor(let i = 0; i < localTruckArray.length; i++) {\n\t\tif(localTruckArray[i].id == truckID) return i; // aey - id was found, return where it was found\n\t}\n\treturn -1;\n}",
"function getWaypiontIndexByFeatureId(featureId) {\n var wpResult = $('#' + featureId);\n var wpElement;\n if (wpResult) {\n wpElement = wpResult.parent().parent();\n }\n if (wpElement) {\n var wpIndex = wpElement.attr('id');\n if (!isNaN(wpIndex)) {\n return wpIndex;\n } else {\n return null;\n }\n }\n }",
"posById(id){\n let slot = this._index[id];\n return slot ? slot[1] : -1\n }",
"function getMatchingIndex(arr, key, value) {\n for (let i = 0; i < arr.length; i++) {\n if (arr[i][key] === value)\n return i;\n }\n return null;\n}",
"function whichBottomApp(app) {\n console.log(app);\n if (app === 'lock' || app === 'allApps') {\n if (app === 'lock') {\n window.location = 'frontpage:respring';\n //InfoStats.lockDevice();\n //InfoStats.addWidget();\n }\n if (app === 'allApps') {\n //InfoStats.triggerButton(drawer);\n FPI.drawer.toggleDrawer(null);\n //toggleDiv('menu', undefined, false);\n }\n } else {\n console.log(app);\n openApp(app);\n }\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Controller to delete a goal, once the goal is deleted, if a member is logged in they are redirected back to their dashboard, if a trainer is logged in they are redirected back to view of the members dashboard (trainerviewmember.hbs) . | deleteGoal(request, response) {
logger.debug(`Delete Goal: ${request.params.id}`);
const goalId = request.params.id;
goalStore.removeGoal(goalId);
if (request.cookies.member != "") {
response.redirect("/member-dashboard");
} else {
response.redirect(`/member/${request.params.memberid}`);
}
} | [
"deleteAction(req, res) {\n Robot.remove({ _id: req.params.id }, (err, robot) => {\n if (err)\n this.jsonResponse(res, 400, { 'error': err });\n\n this.jsonResponse(res, 204, { 'message': 'Deleted successfully!' });\n });\n }",
"static async delete(ctx) {\n const team = await Team.get(ctx.params.id);\n if (!team) ctx.throw(404, 'Team not found');\n\n const context = team;\n await ctx.render('teams-delete', context);\n }",
"function deleteAccess(req, res) {\n db.get(\"SELECT * FROM tool WHERE user = ? AND id =? \", req.signedCookies.user_id, req.body.toolId,\n function(err, self_created_tool) {\n if (err) {\n res.status(500).send({ error: \"Failed to find self-created tool: \" + req.body.toolId });\n } else {\n if(self_created_tool) {\n db.run(\"DELETE FROM access WHERE userId = ? and toolId=?\", [ req.body.userId, req.body.toolId ],\n function(err){\n if(err) {\n res.status(500).json({ error: \"Error while trying to delete access authority.\" }); \n } else {\n res.json({ success: \"access authority is successfully deleted.\" });\n }\n });\n } else {\n res.status(500).send({ error: \"Can't delete access authority created by others. \" });\n } \n }\n });\n }",
"async destroy ({ params, auth, response }) {\n const establishments = await Establishments.findOrFail(params.id)\n\n if (establishments.user_id !== auth.user.id) {\n return response.status(401).send({ error: 'Not authorized' })\n }\n\n await establishments.delete()\n }",
"deleteTodo() {\n\t let todo = this.get('todo');\n\t this.sendAction('deleteTodo', todo);\n\t }",
"delete(req, res) {\n Origin.destroy({\n where: {\n id: req.params.id\n }\n })\n .then(function (deletedRecords) {\n res.status(200).json(deletedRecords);\n })\n .catch(function (error){\n res.status(500).json(error);\n });\n }",
"function delete200(deletedGallerite) {\n\t/* User is redirected to myGallerites page. */\n\twindow.location.replace(\"/myGallerites\");\n}",
"addGoal(request, response) {\n logger.debug(\"Add a goal\");\n const newGoal = {\n id: uuid(),\n memberid: request.params.memberid,\n date: request.body.date,\n weight: request.body.weight,\n waist: request.body.waist,\n status: \"OPEN\"\n };\n goalStore.addGoal(newGoal);\n if (request.cookies.member != \"\") {\n response.redirect(\"/member-dashboard\");\n } else {\n response.redirect(`/member/${request.params.memberid}`);\n }\n }",
"async delete(req, res, next) {\n try {\n //await bugService.delete(req.params.id);\n res.send(\"You cannot delete bugs\")\n } catch (error) {\n next(error);\n }\n }",
"async destroy ({ params, request, response }) {\n const tarefa = await Tarefa.findOrFail(params.id);\n await tarefa.delete();\n }",
"function deletePersonalView(view) {\n $.ajax({\n url: view.resource_uri + \"?username=\" + user_name + \"&api_key=\" + api_key,\n type: 'DELETE',\n error : errorHandler(either(args, 'failedDeleteAnnotation', noop))\n });\n }",
"function deleteTodo(id) {\n //action\n return {\n type: \"DELETE_TODO\",\n id\n };\n}",
"deleteVisit() {\n\t\tif (!this.visitId) {\n\t\t\tthis.hideVisit();\n\t\t\treturn;\n\t\t}\n\n\t\tthis.deleteVisitRequest.send({\n\t\t\tvisit_id: this.visitId\n\t\t});\n\t}",
"static deleteMealRequest(req, res) {\n const { requestid } = req.params;\n db.query(deleteRequest, [requestid]).then((del) => {\n res.status(200).json({\n success: true,\n message: 'the selected meal request is deleted successfully',\n del\n });\n }).catch((err) => {\n res.send(err.message);\n });\n }",
"'click #delete'() {\n Meteor.call('setStatusCatador', this._id, '', 'D');\n }",
"function addChallenge(goal, duration, miles) {\n $.post(\"/api/hiking\", {\n goal: goal,\n duration: duration,\n miles: miles\n }).then(data => {\n window.location.replace(\"/profile\");\n // If there's an error, handle it by throwing up a bootstrap alert\n });\n }",
"function realestateobject_delete(req, res, next) {\n console.log('Real estate object delete');\n\n RealEstateObjects.findByIdAndDelete(req.params.id)\n .then(realestateobject => {\n res.send(`realestateobject ${realestateobject} deleted!`);\n })\n .catch(error => next(error));\n}",
"function deleteClickListener() {\n\t\t$('.container').on('click', '.delete-submission', event => {\n\t\t\tevent.stopImmediatePropagation();\n\t\t\tconst submission = $(event.currentTarget)\n\t\t\t\t.parents('.submission-thumb')\n\t\t\t\t.prop('id');\n\n\t\t\tif (\n\t\t\t\tconfirm(\n\t\t\t\t\t'Are you sure that you would like to permanently remove this submission?'\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tapi\n\t\t\t\t\t.remove(`/api/submissions/${submission}`)\n\t\t\t\t\t.then(() => {\n return api\n .search(`/api/users/mysubmissions`)\n .then(res => {\n $('#user-submissions').empty();\n store.userSubmissions = res;\n \n displayUserSubmissions(res);\n \t })\n });\n\t\t }\n });\n }",
"static async apiDeletePostit(req, res, next) {\n try {\n const postitId = req.query.id;\n console.log(postitId);\n const postitDelRes = await PostitsDAO.deletePostit(postitId);\n res.json({ status: \"Postit deleted successfully !\" });\n } catch (e) {\n res.status(500).json({ error: e.message });\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Eva test, 0329 / / 3G / returnJSON structure contains an 3GJSON structure | function get3GInfo(callback){
jQuery.getJSON( 'APIS/return3GJSON.txt',
function(returnData, status){
if(returnData.RETURN.success){
callback(returnData.RETURN.success,returnData.THREE_G);
}else{
callback(returnData.RETURN.success,returnData.RETURN.errorDescription);
}
}
);
} | [
"function pullGVizJSON(gQueryResp) {\r\n var googleRespRegex = /setResponse\\((.*)\\);/g;\r\n var cleanJSON = googleRespRegex.exec(gQueryResp);\r\n jsonResp = JSON.parse(cleanJSON[1], function(key, value) {\r\n return value == null \r\n ? \"\" \r\n : value;\r\n });\r\n return jsonResp;\r\n}",
"function JSONChecker()\n{\n}",
"function getLab3JSON(){\n let exp = {};\n exp[EXP_JSON_TITLE] = \"Lab 3\";\n exp[EXP_JSON_CREATOR] = \"Gen Chem\";\n\n let equips = [];\n let scale = 0;\n let cylinder = 1;\n let flask = 2;\n let boat = 3;\n let rod = 4;\n let eyeDropper = 5;\n let refractometer = 6;\n let refractometerLens = 7;\n let water = 0;\n let salt = 1;\n equips.push(makeTestEquipmentJSON(ID_EQUIP_SCALE, 1));\n equips.push(makeTestEquipmentJSON(ID_EQUIP_GRADUATED_50mL, 1));\n equips.push(makeTestEquipmentJSON(ID_EQUIP_FLASK_125mL, 1));\n equips.push(makeTestEquipmentJSON(ID_EQUIP_WEIGH_BOAT, 1));\n equips.push(makeTestEquipmentJSON(ID_EQUIP_STIR_ROD, 1));\n equips.push(makeTestEquipmentJSON(ID_EQUIP_EYE_DROPPER, 1));\n equips.push(makeTestEquipmentJSON(ID_EQUIP_REFRACTOMETER, 1));\n equips.push(makeTestEquipmentJSON(ID_EQUIP_REFRACTOMETER_LENS, 1));\n exp[EXP_JSON_EQUIPMENT] = sortArrayByKey(equips, EXP_JSON_EQUIP_OBJ_ID, false);\n\n let chems = [];\n chems.push(makeTestChemicalJSON(COMPOUND_WATER_ID, 50, 1));\n chems.push(makeTestChemicalJSON(COMPOUND_TABLE_SALT_ID, 1.7, 1));\n exp[EXP_JSON_CHEMICALS] = sortArrayByKey(chems, [EXP_JSON_CHEM_ID, EXP_JSON_CHEM_MASS, EXP_JSON_CHEM_CONCENTRATION], true);\n\n let steps = [];\n var s = 0;\n // Part A\n steps.push(makeTestInstructionJSON(s++, scale, true, flask, true, ID_FUNC_SCALE_TO_TAKE_WEIGHT));\n steps.push(makeTestInstructionJSON(s++, scale, true, flask, true, ID_FUNC_SCALE_REMOVE_OBJECT));\n steps.push(makeTestInstructionJSON(s++, cylinder, true, water, false, ID_FUNC_CONTAINER_ADD_TO));\n steps.push(makeTestInstructionJSON(s++, cylinder, true, flask, true, ID_FUNC_CONTAINER_POUR_INTO));\n steps.push(makeTestInstructionJSON(s++, scale, true, boat, true, ID_FUNC_SCALE_TO_TAKE_WEIGHT));\n steps.push(makeTestInstructionJSON(s++, scale, true, null, true, ID_FUNC_SCALE_ZERO_OUT));\n steps.push(makeTestInstructionJSON(s++, boat, true, salt, false, ID_FUNC_CONTAINER_ADD_TO));\n steps.push(makeTestInstructionJSON(s++, scale, true, null, true, ID_FUNC_SCALE_REMOVE_OBJECT));\n steps.push(makeTestInstructionJSON(s++, boat, true, flask, true, ID_FUNC_CONTAINER_POUR_INTO));\n steps.push(makeTestInstructionJSON(s++, rod, true, flask, true, ID_FUNC_STIR_ROD_STIR));\n steps.push(makeTestInstructionJSON(s++, scale, true, null, true, ID_FUNC_SCALE_CLEAR_ZERO));\n steps.push(makeTestInstructionJSON(s++, scale, true, flask, true, ID_FUNC_SCALE_TO_TAKE_WEIGHT));\n steps.push(makeTestInstructionJSON(s++, scale, true, null, true, ID_FUNC_SCALE_REMOVE_OBJECT));\n\n // Part B\n steps.push(makeTestInstructionJSON(s++, flask, true, eyeDropper, true, ID_FUNC_CONTAINER_POUR_INTO));\n steps.push(makeTestInstructionJSON(s++, eyeDropper, true, refractometerLens, true, ID_FUNC_EYE_DROPPER_DROP));\n steps.push(makeTestInstructionJSON(s++, eyeDropper, true, refractometerLens, true, ID_FUNC_EYE_DROPPER_DROP));\n steps.push(makeTestInstructionJSON(s++, refractometer, true, refractometerLens, true, ID_FUNC_REFRACTOMETER_SET_LENS));\n steps.push(makeTestInstructionJSON(s++, flask, true, null, true, ID_FUNC_CONTAINER_EMPTY_IN_TRASH));\n\n // set the instruction list\n exp[EXP_JSON_INSTRUCTIONS] = sortArrayByKey(steps, EXP_JSON_INS_STEP_NUM, false);\n\n return exp;\n}",
"function GetTelemetryObj() {\n var myJSON = { \n \"utc\": 0,\n \"soc\": 0,\n \"soh\": 0,\n \"speed\": 0,\n \"car_model\": CAR_MODEL,\n \"lat\": 0,\n \"lon\": 0,\n \"elevation\": 0,\n \"ext_temp\": 0,\n \"is_charging\": 0,\n \"batt_temp\": 0,\n \"voltage\": 0,\n \"current\": 0,\n \"power\": 0\n };\n return myJSON;\n }",
"function parseJson (inJson) {\t\n var alertId = inJson['alert']['id'];\n var alertType = inJson['alert']['alertDefinition']['alertType']['name'];\n var assetId = 'TEST_ASSET_ID';\n var siteId = inJson['alert']['alertDefinition']['locationId'];\n var comments = inJson['alert']['alertComments'][0]['alertComment'];\n var statusType = inJson['type'];\n var timeStamp = inJson['timestamp'];\n\n return [timeStamp, alertId, alertType, assetId, siteId, comments, statusType];\n\t//alertId - prime key in eandon\n\t//siteId - must start with \"M00\"\n\n}",
"function uploadJSON() {\r\n\r\n}",
"function migrateToEJSON() { // 213\n if (amplify.store('__PSDATAVERSION__') >= PSA_DATA_VERSION) { // 214\n return; // 215\n } // 216\n // 217\n var psKeyList = amplify.store('__PSKEYS__'); // 218\n var psaKeyList = amplify.store('__PSAKEYS__'); // 219\n // 220\n _.each([psKeyList, psaKeyList], function(list) { // 221\n _.each(list, function(key) { // 222\n amplify.store(key, EJSON.stringify(amplify.store(key))); // 223\n }); // 224\n }); // 225\n // 226\n amplify.store('__PSDATAVERSION__', PSA_DATA_VERSION); // 227\n} // 228",
"function JsonDiff() {\n ;\n}",
"get jsons() {\n\t\treturn this[root_json] ? this[root_json].$proxy() : null\n\t}",
"function getJson() {\n axios.get(`${protocol}feeds.ibood.com/nl/nl/offer.json`).then(result => {\n if (isNew(result.data)) {\n currentTitle = result.data.Title;\n\n // try and get the google price\n getGooglePrice(encodeURIComponent(result.data.Title)).then(price => {\n result.data.google = price;\n\n notify(result.data);\n }).catch(err => {\n\n result.data.google = \"n/a\";\n notify(result.data);\n });\n }\n });\n}",
"function createOutputJsonInstance()\n{\n\tvar output = \n\t\t{\n\t\t\t\"status\": null,\n\t\t\t\"message\": null,\n\t\t\t\"data\": null\n\t\n\t\t}\n\n\treturn output;\n\n}",
"function LoadJson(){}",
"function experimentToJSON(exp){\n // Get the basic information\n let expJSON = {};\n expJSON[EXP_JSON_TITLE] = exp.title;\n expJSON[EXP_JSON_CREATOR] = exp.creator;\n\n // Get the Equipment\n let equips = [];\n let equipTypes = {};\n exp.equipment.forEach(function(eqCont){\n let eq = eqCont.equipment;\n let id = eq.getID();\n if(id in equipTypes) equipTypes[id]++;\n else equipTypes[id] = 1;\n });\n for(var key in equipTypes){\n let newEquip = {};\n newEquip[EXP_JSON_EQUIP_OBJ_ID] = parseInt(key);\n newEquip[EXP_JSON_EQUIP_AMOUNT] = equipTypes[key];\n equips.push(newEquip);\n }\n expJSON[EXP_JSON_EQUIPMENT] = equips;\n\n\n // Get the Chemicals\n let chems = [];\n exp.chemicals.forEach(function(chemCont){\n let chem = chemCont.chemical;\n\n let newChem = {};\n newChem[EXP_JSON_CHEM_ID] = chem.getID();\n newChem[EXP_JSON_CHEM_MASS] = chem.mass;\n newChem[EXP_JSON_CHEM_CONCENTRATION] = chem.concentration;\n chems.push(newChem);\n });\n expJSON[EXP_JSON_CHEMICALS] = chems;\n\n\n // Get the Instructions\n let instructions = [];\n exp.instructions.forEach(function(insCont, index){\n let eqs = exp.equipment;\n let chs = exp.chemicals;\n let ins = insCont.instruction;\n\n let act = ins.actor;\n let actEquip = act instanceof EquipmentController2D;\n let actI = (actEquip) ? eqs.indexOf(act) : chs.indexOf(act);\n\n let rec = ins.receiver;\n let recEquip = rec instanceof EquipmentController2D;\n let recI = (recEquip) ? eqs.indexOf(rec) : chs.indexOf(rec);\n\n let action = ins.action;\n\n let newIns = {};\n newIns[EXP_JSON_INS_STEP_NUM] = index;\n newIns[EXP_JSON_INS_ACTOR_INDEX] = actI;\n newIns[EXP_JSON_INS_ACTOR_IS_EQUIP] = actEquip;\n newIns[EXP_JSON_INS_RECEIVER_INDEX] = recI;\n newIns[EXP_JSON_INS_RECEIVER_IS_EQUIP] = recEquip;\n newIns[EXP_JSON_INS_FUNC_ID] = act.funcToId(action);\n instructions.push(newIns);\n });\n expJSON[EXP_JSON_INSTRUCTIONS] = instructions;\n\n return expJSON;\n}",
"function ParseJson(jsonStr) {\r\n\r\n\t// Create htmlfile COM object\r\n\tvar HFO = CreateOleObject(\"htmlfile\"), jsonObj;\r\n\r\n\t// force htmlfile to load Chakra engine\r\n\tHFO.write(\"<meta http-equiv='x-ua-compatible' content='IE=9' />\");\r\n\r\n\t// Add custom method to objects\r\n\tHFO.write(\"<script type='text/javascript'>Object.prototype.getProp=function(t){return this[t]},Object.prototype.getKeys=function(){return Object.keys(this)};</script>\");\r\n\r\n\t// Parse JSON string\r\n\ttry jsonObj = HFO.parentWindow.JSON.parse(jsonStr);\r\n\texcept jsonObj = \"\"; // JSON parse error\r\n\r\n\t// Unload COM object\r\n\tHFO.close();\r\n\r\n\treturn jsonObj;\r\n}",
"toJSON() {\n let items = _items.get(this);\n let JSONItems = [];\n for( let i = 0; i < items.length ; i++ ) {\n console.log(items[i].getCount());\n JSONItems.push({\n count: items[i].getCount(),\n name: items[i].getProduct().getName(),\n id: items[i].getProduct().getId(),\n price: items[i].getProduct().getPrice(),\n image: items[i].getProduct().getImage()\n });\n }\n return { JSONItems };\n }",
"function getseasonparkinginformation(postalcodeinput)\n{\n //var getpostalcodefromuser = 310100;\n var getpostalcodefromuser = postalcodeinput;\n var getseasonparkingoptionfromuser = 0;\n var seasonparkingtype;\n var seasonparkingbranchoffice;\n var seasonparkinggroup;\n var seasonparkingcarparkwithingroup;\n var seasonparkingrate;\n var seasonparkingresultobj = {};\n\n https.get('https://services2.hdb.gov.sg/webapp/BN22SvcMap/BN22SCpkgrp?pcode='+getpostalcodefromuser+'&ptype='+getseasonparkingoptionfromuser+'', function(res)\n {\n var response_data = '';\n res.setEncoding('utf8');\n res.on('data', function(chunk)\n {\n response_data += chunk;\n });\n \n res.on('end', function() \n {\n parser.parseString(response_data, function(err, result) \n {\n if (err) \n {\n console.log('Got error: ' + err.message);\n }\n else \n {\n eyes.inspect(result);\n\n //convert into JSON into string\n console.log('Converting to JSON string.');\n console.dir(JSON.stringify(result));\n\n //convert into JSON object\n console.log('Converting to JSON object.');\n var jsonobject5 = JSON.parse(JSON.stringify(result));\n console.log(util.inspect(jsonobject5, false, null));\n\n //traverse JSON object\n for (var i = 0; i < jsonobject5.cpkgrpinfo.cpktype.length; ++i) \n {\n console.log(\"Season Parking Type : \" + jsonobject5.cpkgrpinfo.cpktype[i].type);\n console.log(\"Season Parking Branch Office : \" + jsonobject5.cpkgrpinfo.cpktype[i].bo);\n console.log(\"Season Parking Group : \" + jsonobject5.cpkgrpinfo.cpktype[i].cpkgrp);\n console.log(\"Season Parking Car Park No. Within the Group : \" + jsonobject5.cpkgrpinfo.cpktype[i].cpkd.cpk);\n console.log(\"Season Parking Rate : \" + jsonobject5.cpkgrpinfo.cpktype[i].rate.r);\n \n seasonparkingtype = jsonobject5.cpkgrpinfo.cpktype[i].type;\n seasonparkingbranchoffice = jsonobject5.cpkgrpinfo.cpktype[i].bo;\n seasonparkinggroup = jsonobject5.cpkgrpinfo.cpktype[i].cpkgrp;\n seasonparkingcarparkwithingroup = jsonobject5.cpkgrpinfo.cpktype[i].cpkd.cpk;\n seasonparkingrate = jsonobject5.cpkgrpinfo.cpktype[i].rate.r;\n\n //Save result into object\n seasonparkingresultobj[i] = {\n SeasonParkingType : seasonparkingtype,\n SeasonParkingBranchOffice : seasonparkingbranchoffice,\n SeasonParkingGroup : seasonparkinggroup,\n SeasonParkingCarParkWithinGroup : seasonparkingcarparkwithingroup,\n SeasonParkingRate : seasonparkingrate\n };\n\n console.log(\"----------------------------------------\");\n }\n }\n });\n });\n\n res.on('error', function(err) \n {\n console.log('Got error: ' + err.message);\n });\n });\n}",
"function downloadJSON() {\r\n\t// Save the data object as a string into a file\r\n\tsaveTextAsFile(2);\r\n}",
"function createJSON(){\t\n\tvar itemString = '';\n\tvar racersString = '';\n\tvar dateTime = document.getElementById(\"date\").value + \" \" + document.getElementById(\"time\").value;\n\t\n\tfor(var i=0; i<im.getSize(); i++){\n\t\tvar x = im.getElementAt(i);\n\t\tif(x.type == 1){\n\t\t\titemString+='{\"location\": \"' + x.location + '\", \"type\": \"' + x.type + '\", \"value\": \"0\"}, ';\n\t\t}\n\t\telse if(x.type == 2){\n\t\t\titemString+='{\"location\": \"' + x.location + '\", \"type\": \"' + x.type + '\", \"value\": \"250\"}, ';\n\t\t}\n\t\telse if(x.type == 3){\n\t\t\titemString+='{\"location\": \"' + x.location + '\", \"type\": \"' + x.type + '\", \"value\": \"-250\"}, ';\n\t\t}\n\t}\n\t\n\titemString = itemString.substring(0,itemString.length-2);\n\t\n\t//racersString += '{\"name\": \"\"}, ';\t\t\t\t\t//TODO it should be usname gotten from a session variable\n\tfor(var i=0; i<userArray.length; i++){\n\t\tracersString+='{\"name\": \"' + userArray[i]+'\"}, ';\n\t}\n\t\n\tracersString = racersString.substring(0,racersString.length-2);\n\t\t\n\tjsonString = '{\"name\": \"'+document.getElementById('raceName_text').value + '\", \"dateTime\": \"' + dateTime + '\", \"items\": [' + itemString + '], \"racers\": [' + racersString + ']}';\n\t\n\tsend();\n}",
"function getTestTaxReturn() {\n var msgPrefix = 'GET ' + testMsgBase;\n $.ajax({\n type: 'GET',\n url: testUrl,\n success: function (result) {\n if (result.results[0].userNameAssignedTo == \"Junior\") {\n onCallSuccess(msgPrefix);\n okAsync(result != null, \" returned items: \" + result.totalCount + \" total items\");\n }\n else\n {\n okAsync(false, msgPrefix + \" returned items: \" + result.totalCount + \" total items\");\n }\n start();\n },\n error: function (result) { onError(result, msgPrefix); }\n });\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function handles initial search buttons for genres and popular movies | function handleSearch() {
$(document).on('click', '.search-by-genre', function (event) {
event.preventDefault();
let genre = $('#search-by-genre').val();
STORE.genre = genre;
STORE.searchType = 'genre';
searchMovieAPI();
});
$(document).on('click', '.search-popular', function (event) {
event.preventDefault();
STORE.searchType = 'popular';
searchMovieAPI();
});
} | [
"function filter() {\r\n $(\"input[name=filterBtn]\").click(function() {\r\n // Get form values\r\n let title = $(\"#title\").val();\r\n let pickedGenre = $(\"select[name='genreSelect'] option:selected\").val();\r\n\r\n // Clear current result space\r\n $(\"#filteredMovies\").html(\"\");\r\n\r\n // result flag\r\n var found = false;\r\n\r\n if (title == \"\" && pickedGenre != \"\") {\r\n movies.forEach(function(currObj) {\r\n if (currObj.genre == pickedGenre) {\r\n request(queryReview(currObj.title, queryNYTMovie), queryMovie(currObj.title, queryOMDb), currObj);\r\n found = true;\r\n }\r\n });\r\n } \r\n else { // Handles when title given, or no genre or title given\r\n const titleRegEx = new RegExp(\"^\" + title, \"i\");\r\n movies.forEach(function(currObj) {\r\n if (titleRegEx.test(currObj.title)) {\r\n request(queryReview(title, queryNYTMovie), queryMovie(title, queryOMDb), currObj);\r\n found = true;\r\n }\r\n });\r\n }\r\n ensureResults(found);\r\n // reveal results in modal\r\n modal.style.display = \"block\";\r\n });\r\n}",
"function showSearchMovies(){\n query = moviesSearch.value;\n if (query != \"\"){\n resultsList.innerHTML = \"\";\n customQuery = query;\n resetPageNumbers();\n customPage = 1;\n tmdb.searchMovies(query, customPage).then(data => {\n resultsList.innerHTML = \"\";\n results = data.searchMovies.results;\n totalPages = data.searchMovies.total_pages;\n\n if (results != undefined){\n newMoviesList(results);\n removeMiniNavActive();\n }\n else{\n resetPageNumbers();\n }\n\n loadMore.style.display = (totalPages > 1) ? 'inline' : 'none';\n });\n }\n}",
"function BrowseByName() \n{\n HideListingCriteria();\n $(\"#Language\").attr('selectedIndex', 0);\n $(\"#Genre\").attr('selectedIndex', 0);\n var movieNameToSearch = $(\"#txtName\").val();\n movieCriteria = \"Name\"\n movieCriteriaValue = movieNameToSearch;\n var uri = MOVIE_BY_NAME_URI.replace(\"*name*\", movieNameToSearch);\n BuildMoviesCache(uri)\n startPage = 0;\n FetchTitles(startPage)\n}",
"function BrowseMovies() \n{\n HideListingCriteria();\n movieCriteria = \"All\"\n movieCriteriaValue = \"Movies\";\n BuildMoviesCache(MOVIE_LISTING_URI)\n startPage = 0;\n FetchTitles(startPage)\n}",
"function BrowseByLanguages() \n{\n HideListingCriteria()\n var selectedLanguage = $(\"#Language option:selected\").text();\n if (selectedLanguage == \"Select Language\")\n return;\n movieCriteria = \"Language\"\n movieCriteriaValue = selectedLanguage;\n $(\"#Genre\").attr('selectedIndex', 0);\n var uri = MOVIE_BY_LANGUAGES_URI.replace(\"*lang*\", selectedLanguage);\n var filter = getParameterByName(\"filter\");\n if(filter == \"movies\")\n {\n uri = MOVIE_BY_LANGUAGES_URI_Movie.replace(\"*lang*\", selectedLanguage);\n ('#btnMovies') \n }\n else if(filter == \"tv\")\n {\n uri = MOVIE_BY_LANGUAGES_URI_Tv.replace(\"*lang*\", selectedLanguage);\n }\n else\n {\n\n }\n\n\n BuildMoviesCache(uri)\n startPage = 0;\n FetchTitles(startPage)\n}",
"function searchForMovie(movieTitle) {\n searchBarElem.val(movieTitle);\n searchBarElem.keyup(); // trigger search\n}",
"function displayFilteredMovies() {\n featuredResults = originalResults; // reset to original list before filtering\n\n // filter the movies with current selected genre\n // let genre = $(\"#filter-genre\").children(\"option:selected\").val();\n let genre = $(\"#selected-genre\").text();\n console.log(\"Filter movies with Genre:\", genre);\n if (genre != \"Select Genre\") {\n featuredResults = filterMovieByGenre(featuredResults, genre);\n console.log(\"Genre filtered\", featuredResults);\n }\n\n // filter the movie with current selected rating\n // let rating = $(\"#filter-rating\").children(\"option:selected\").val();\n let ratingText = $(\"#selected-rating\").text();\n console.log(\"Selected Rating:\" + ratingText);\n let rating = 0;\n switch (ratingText) {\n case \"Above 3\":\n rating = 3;\n break;\n case \"Above 5\":\n rating = 5;\n break;\n case \"Above 7\":\n rating = 7;\n break;\n default:\n rating = 0;\n }\n console.log(\"Filter Movie with Rating:\", rating);\n\n /*if (rating != \"\") { */\n if (rating != 0) {\n featuredResults = filterMovieByRating(featuredResults, rating);\n console.log(\"Rating filtered\", featuredResults);\n }\n\n $(\"#selected-movie-container\").hide(); // remove the last selected movie detail\n displayAllMovies(featuredResults);\n //displayGenreOptions(featuredResults);\n }",
"function perform_search() {\n if (lastSearchType == \"D\") {\n searchHistory();\n } else if (lastSearchType == \"E\") {\n searchEpg();\n }\n }",
"function handleSearch(){\n var term = element( RandME.ui.search_textfield ).value;\n if(term.length){\n requestRandomGif( term, true);\n }\n}",
"function search() {\n\t\tvar searchVal = searchText.getValue();\n\n\t\tsources.genFood.searchBar({\n\t\t\targuments: [searchVal],\n\t\t\tonSuccess: function(event) {\n\t\t\t\tsources.genFood.setEntityCollection(event.result);\n\t\t\t},\n\t\t\tonError: WAKL.err.handler\n\t\t});\n\t}",
"function searchtoresults()\n{\n\tshowstuff('results');\n\thidestuff('interests');\t\n}",
"function searchFunction () {\n activateSearch($searchInput, 'input');\n activateSearch($submit, 'click');\n}",
"buildSearchPage() {\n const myBooks = this.books.getMyBooks();\n if (this.searchedBooks === undefined) {\n return;\n }\n this.booksView.buildBookListing(this.searchedBooks, this.displayBook, myBooks);\n this.booksView.buildPagination(this.totalBooks, 100, this.currentPage, this.gotoPage, \"topPagination\");\n this.booksView.buildPagination(this.totalBooks, 100, this.currentPage, this.gotoPage, \"bottomPagination\");\n }",
"function doSearch(){\n document.SearchCustomer.search.value = true;\n document.SearchCustomer.curpos.value=0;\n submit('SearchCustomer');\n }",
"async function searchButtonClicked () {\n var response\n if (toggleValue === 'Name') {\n response = await getNppesDataFirstName(searchText)\n setShowNameSearchResults(true)\n setShowOrgSearchResults(false)\n }\n else {\n response = await getNppesDataOrgName(searchText)\n setShowOrgSearchResults(true)\n setShowNameSearchResults(false)\n }\n if (response.length === 0) {\n setSearchResults(['No results found'])\n }\n else {\n setSearchResults(response)\n }\n setSearchText('')\n }",
"function setMoviesPage() {\n\n // display movie genres list\n listMovieGenres();\n\n // display movie year list with forwarded range data\n listMovieYears(2000, 2021)\n\n // display popular movies at page startup\n displayPopularMovies();\n}",
"function searchForShow(elem) {\n const allShows = getAllShows();\n let searchString = elem.target.value.toLowerCase();\n let filteredShows = allShows.filter((episode) => {\n return (\n episode.name.toLowerCase().includes(searchString) ||\n episode.genres.join(\" \").toLowerCase().includes(searchString) || \n (episode.summary && episode.summary.toLowerCase().includes(searchString))\n );\n });\n container.innerHTML = \"\";\n makePageForShows(filteredShows);\n}",
"function initComponents() {\n\n const movieGrid = new MovieGrid();\n const searcher = new Searcher();\n searcher.init(movieGrid);\n\n}",
"function displayGenreOptions(movies) {\n // create available genre options\n let genreOptions = [];\n movies.forEach((movie) => {\n movie.genres.forEach((name) => {\n if (!genreOptions.includes(name)) {\n genreOptions.push(name);\n }\n });\n });\n // sort the options list\n let sortedGenreOptions = genreOptions.sort((a, b) => {\n if (a < b) {\n return -1;\n }\n if (a > b) {\n return 1;\n }\n return 0;\n });\n console.log(\"Sorted Genre Options\", sortedGenreOptions);\n let html = \"\";\n sortedGenreOptions.forEach((name) => {\n html += `<a class=\"dropdown-item\" href=\"#\">${name}</a>`;\n });\n\n $(\"#filter-genre\").html(html);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Decrease the RefCount on the dataId and dispose the memory if the dataId has 0 refCount. If there are pending read on the data, the disposal would added to the pending delete queue. Return true if the dataId is removed from backend or the backend does not contain the dataId, false if the dataId is not removed. Memory may or may not be released even when dataId is removed, which also depends on dataRefCount, see `releaseGPU`. | disposeData(dataId, force = false) {
if (this.pendingDisposal.has(dataId)) {
return false;
}
// No-op if already disposed.
if (!this.texData.has(dataId)) {
return true;
}
// if force flag is set, change refCount to 0, this would ensure disposal
// when added to the pendingDisposal queue. Memory may or may not be
// released, which also depends on dataRefCount, see `releaseGPU`.
if (force) {
this.texData.get(dataId).refCount = 0;
}
else {
this.texData.get(dataId).refCount--;
}
if (!force && this.texData.get(dataId).refCount > 0) {
return false;
}
if (this.pendingRead.has(dataId)) {
this.pendingDisposal.add(dataId);
this.pendingDeletes++;
return false;
}
this.releaseGPUData(dataId);
const { complexTensorInfos } = this.texData.get(dataId);
if (complexTensorInfos != null) {
this.disposeData(complexTensorInfos.real.dataId, force);
this.disposeData(complexTensorInfos.imag.dataId, force);
}
this.texData.delete(dataId);
return true;
} | [
"closeActiveBuffer(){\n this._ctx.putImageData(this._dataBuffer, 0, 0);\n this._dataBuffer = null;\n }",
"_removeBarrier() {\n if (this._barrier) {\n if (this._pressureBarrier) {\n this._pressureBarrier.removeBarrier(this._barrier);\n }\n this._barrier.destroy();\n this._barrier = null;\n }\n\n // Remove barrier timeout\n if (this._removeBarrierTimeoutId > 0) {\n GLib.source_remove(this._removeBarrierTimeoutId);\n this._removeBarrierTimeoutId = 0;\n }\n return false;\n }",
"remove(key) {\n if (this._data[key]) {\n this._busyMemory -= this._lifeTime[key].size;\n delete this._data[key];\n }\n }",
"function deleteCachedMountContext(blockchain_or_datastore_id, full_app_name) {\n\n var userData = getUserData();\n assert(userData);\n\n assert(blockchain_or_datastore_id, 'No blockchain ID given');\n assert(full_app_name, 'No app name given');\n\n if (!userData.datastore_contexts) {\n return true;\n }\n\n var cache_key = blockchain_or_datastore_id + '/' + full_app_name;\n if (!Objects.keys(userData.datastore_contexts).includes(cache_key)) {\n return true;\n }\n\n delete userData.datastore_contexts[cache_key];\n setUserData(userData);\n}",
"unrefUnusedSubchannels() {\n let allSubchannelsUnrefed = true;\n /* These objects are created with Object.create(null), so they do not\n * have a prototype, which means that for (... in ...) loops over them\n * do not need to be filtered */\n // eslint-disable-disable-next-line:forin\n for (const channelTarget in this.pool) {\n const subchannelObjArray = this.pool[channelTarget];\n const refedSubchannels = subchannelObjArray.filter(value => !value.subchannel.unrefIfOneRef());\n if (refedSubchannels.length > 0) {\n allSubchannelsUnrefed = false;\n }\n /* For each subchannel in the pool, try to unref it if it has\n * exactly one ref (which is the ref from the pool itself). If that\n * does happen, remove the subchannel from the pool */\n this.pool[channelTarget] = refedSubchannels;\n }\n /* Currently we do not delete keys with empty values. If that results\n * in significant memory usage we should change it. */\n // Cancel the cleanup task if all subchannels have been unrefed.\n if (allSubchannelsUnrefed && this.cleanupTimer !== null) {\n clearInterval(this.cleanupTimer);\n this.cleanupTimer = null;\n }\n }",
"function del(kind, id) {\n var entity = store[kind];\n if (! entity) {\n return false;\n }\n\n var found = false;\n entity.rows = entity.rows.filter(function(row) {\n if (id === row.id) {\n found = true;\n return false; // return false delete this record\n }\n return true;\n });\n\n if (found) {\n writeData();\n }\n\n return found;\n}",
"async remove(category, rmSpecs) {\n const rmObj = this.validator.validate(category, 'remove', rmSpecs);\n //@TODO\n let obj = this.masterData[category];\n if ('id' in rmSpecs)\n if (rmSpecs['id'] in obj) {\n let obRef;\n if (!(obRef = this.objReference(category, rmSpecs['id']))) {\n delete obj[rmSpecs['id']];\n console.log(\"It's gone\");\n return true;\n } else {\n for (let o of obRef)\n console.log(\"BAD_ID: %s %s is referenced by %s for %s %s\", ...o);\n return false;\n }\n }\n else {\n console.log(\"Please provide appropriate ID\");\n }\n }",
"release() {\n if (this._released) {\n return;\n }\n // Module.bufferFinalizationRegistry.unregister(this);\n try {\n Module._PyBuffer_Release(this._view_ptr);\n Module._PyMem_Free(this._view_ptr);\n } catch (e) {\n Module.fatal_error(e);\n }\n this._released = !!1;\n this.data = null;\n }",
"delete(){\n\t\tif (removeFromReferenceCount(this.index) === 0){\n\t\t\tthis.gl.deleteTexture(this.texture);\n\t\t}\n }",
"detectDestroy() {\n if(this.parent === null) {\n this.destroy();\n return true;\n }\n return false;\n }",
"function removeProduct(dataMemory,removeObject) {\n if (dataMemory.getItem(removeObject) != null) {\n dataMemory.removeItem(removeObject);\n }\n}",
"removeStream( key ) {\n if ( !this.keys.has( key ) ) {\n return false\n }\n\n // Any-key helper\n if ( key === '*' ) {\n this.anyKey.destroy()\n }\n\n this.keys.get( key ).destroy()\n\n delete this.keys.get( key )\n this.keys.delete( key )\n\n return true\n }",
"shouldRenderSubLayer(subLayerId, data) {\n return data && data.length;\n }",
"contains (data, size = data.length) {\n for (let i = 0; i < this.nHashes; i++) {\n const idx = hash(i, this.nHashes, data, size) % this.nBits\n if (this.bfMask) {\n if (!this.bfMask.get(idx))\n return false\n }\n else if (this.bfCntr) {\n if (bfGet(this.bfCntr, idx) === 0)\n return false\n }\n }\n return true\n }",
"static removeKeyFromCache(key) {\n if (RCTPrefetch.cache && RCTPrefetch.cache[key]) {\n RCTPrefetch.cache[key].refs--;\n if (RCTPrefetch.cache[key].refs <= 0) {\n RCTPrefetch.cache[key].texture.dispose();\n delete RCTPrefetch.cache[key];\n }\n }\n }",
"async deleteIfMoreThan(maxNum) {\n console.log(`== Try to delete data if the stored records is more than ${maxNum} ==`);\n\n const count = await this.baseModel.model.count();\n\n if (count > maxNum) {\n await this.delete([{\n $sort: {\n timestap: -1\n },\n }, {\n $limit: count - maxNum\n }]);\n }\n\n console.log(`== Success to delete data if the stored records is more than ${maxNum} ==`);\n }",
"function deleteDevSub(imgId){\n\tif(globalInfoType == \"JSON\"){\n \t\tvar devices = getDevicesNodeJSON();\n\t\tfor(var a=0; a<devices.length;a++){\n\t\t\tif(devices[a].Status == \"Reserved\" && devices[a].ObjectPath == imgId){\n\t\t\t\tdevices[a].UpdateFlag = \"delete\";\n\t\t\t\tdeleteLinkFromDev(devices[a].ObjectPath);\n\t\t\t\tdevices.splice(a,1);\n\t\t\t\taddEvent2History(\"Device deleted\");\n\t\t\t\ta = devices.length;\n\t\t\t}else if(devices[a].ObjectPath == imgId && devices[a].Status != \"Reserved\"){\n\t\t\t\tdeleteLinkFromDev(devices[a].ObjectPath);\n\t\t\t\tdevices.splice(a,1);\n\t\t\t\taddEvent2History(\"Device deleted\");\n\t\t\t\ta = devices.length;\n\t\t\t}\n\t\t}\n \t}\n\tdrawImage();\n}",
"function monitorSupportsDeletedWith() {\n return __awaiter(this, void 0, void 0, function* () {\n return monitorSupportsFeature(\"deletedWith\");\n });\n}",
"removeDevice() {\n this.devices_.pop();\n if (this.devices_.length <= 1) {\n this.isStreamingUserFacingCamera = true;\n }\n if (this.deviceChangeListener_) {\n this.deviceChangeListener_();\n }\n }",
"remove (data, size = data.length) {\n if (!this.bfCntr)\n throw new Error(\"remove: removing elements requires counters\")\n for (let i = 0; i < this.nHashes; i++) {\n const idx = hash(i, this.nHashes, data, size) % this.nBits\n let num = bfGet(this.bfCntr, idx)\n num--\n if (num < 0)\n num = 0\n bfSet(this.bfCntr, idx, num)\n if (this.bfMask)\n if (num === 0)\n this.bfMask.set(idx, false)\n }\n return this\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FUNCTION NAME : validationTTList() AUTHOR : James Turingan DATE : January 2, 2014 MODIFIED BY : REVISION DATE : REVISION : DESCRIPTION : validates for the test tool that has no selected ports PARAMETERS : First function for this YEAR!! :) | function validationTTList(){
var msgStr = '';
var ctr = 0;
for(var x = 0; x < testToolObj.length; x++){
if(testToolObj[x].Ports.length == 0){
ctr++;
if(ctr == 1){
msgStr = testToolObj[x].DeviceName;
}else if(ctr == 2 && x == testToolObj.length){
msgStr += 'and' + testToolObj[x].DeviceName;
}else if(ctr > 2){
if(x == testToolObj.length){
msgStr += 'and' + testToolObj[x].DeviceName;
}else{
msgStr += ',' + testToolObj[x].DeviceName;
}
}
}
}
if(msgStr != ''){
var msg = msgStr + " has no selected port(s). Do you want to select port(s)?";
$('#msgAlert').empty().append(msg);
if(globalDeviceType == "Mobile"){
$.mobile.changePage("#warning", {
transition: "flow",
reverse: false,
changeHash: true
});
}
}else{
$("#testToolPaletteSubTrList").hide();
createTestToolObj();
if(globalDeviceType == "Mobile"){
$.mobile.changePage("#configEditorPage", {
transition: "flow",
reverse: false,
changeHash: true
});
}
}
} | [
"function checkPortTestToolList(row,html,checkType,opStr){\n\tvar ttype='';\n\tvar porttype='';\n\tfor(var a =0; a< row.length; a++){\n\t\tif(globalInfoType == \"XML\"){\n\t\t\tttype = row[a].getAttribute('ConnectivityType');\n\t\t\tporttype = row[a].getAttribute('Type');\n\t\t\tvar linc = row[a].getAttribute('License');\n\t\t\tvar portsname = row[a].getAttribute('Ports');\n\t\t}else{\n\t\t\tttype = row[a].ConnectivityType;\n\t\t\tporttype = row[a].Type;\n\t\t\tvar linc = row[a].License;\n\t\t\tvar portsname = row[a].Ports;\n\t\t}\n\t\tif(checkType.indexOf(ttype) == -1){\n\t\t\tcheckType.push(ttype);\n\t\t\tif(a == 0){\n\t\t\t\topStr += \"<option value='\"+ttype+\"' selected >\"+ttype+\"</option>\";\n\t\t\t}else{\n\t\t\t\topStr += \"<option value='\"+ttype+\"'>\"+ttype+\"</option>\";\n\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(checkPortsTTList.indexOf(row[a].Ports) == -1){\n\t\t\tif(globalInfoType == \"XML\"){\n\t\t\t\thtml += \"<tr class='trPortTestTool \"+tableClass+\" ' \";\n\t\t\t\thtml += \"portname='\"+row[a].getAttribute('Ports')+\"' \";\n\t\t\t\thtml += \"did='portsid\"+a+\"' \";\n\t\t\t\thtml+= \">\";\n\t\t\t}else{\n\t\t\t\thtml += \"<tr class='trPortTestTool \"+tableClass+\" ' \";\n\t\t\t\thtml += \"portname='\"+row[a].Ports+\"' \";\n\t\t\t\thtml += \"did='portsid\"+a+\"' \";\n\t\t\t\thtml+= \">\";\n\t\t\t}\n\t\t\tif(globalDeviceType != \"Mobile\"){\n\t\t\t\tif(globalInfoType == \"XML\"){\n\t\t\t\t\thtml += \"<td><input type='checkbox' id='portsid\"+a+\"' value='\"+row[a].getAttribute('Ports')+\"' onclick='' /></td>\";\n\t\t\t\t}else{\n\t\t\t\t\thtml += \"<td><input type='checkbox' id='portsid\"+a+\"' value='\"+row[a].Ports+\"' onclick='' /></td>\";\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(porttype == \"fusion\"){\t\n\t\t\t\tif(linc == \"true\"){\n//\t\t\t\t\thtml += \"<td class=''>\"+row[a].getAttribute('Ports')+\"(\"+porttype+\",licensedv)</td>\";\n\t\t\t\t\tif(globalInfoType == \"XML\"){\n\t\t\t\t\t\thtml += \"<td class='toolTip' did ='td\"+a+\"port' >\"+row[a].getAttribute('Ports')+\"(\"+porttype+\",licensed)<div class='tableToolTip' id='divtoolTip\"+a+\"port' style='display:none;'><ul>\";\n\t\t\t\t\t}else{\n\t\t\t\t\t\thtml += \"<td class='toolTip' did ='td\"+a+\"port' >\"+row[a].Ports+\"(\"+porttype+\",licensed)<div class='tableToolTip' id='divtoolTip\"+a+\"port' style='display:none;'><ul>\";\n\n\n\t\t\t\t\t}\n\t\t\t\t\thtml += getToolTip(row[a]);\n\t\t\t\t\thtml +=\"</ul></div></td>\";\n\t\t\t\t}else{\n\t\t\t\t\tif(globalInfoType == \"XML\"){\n\t\t\t\t\t\thtml += \"<td class='toolTip' did ='td\"+a+\"port' >\"+row[a].getAttribute('Ports')+\"(\"+porttype+\"<div class='tableToolTip' id='divtoolTip\"+a+\"port' style='display:none;'><ul>\";\n\t\t\t\t\t}else{\n\t\t\t\t\t\thtml += \"<td class='toolTip' did ='td\"+a+\"port' >\"+row[a].Ports+\"(\"+porttype+\"<div class='tableToolTip' id='divtoolTip\"+a+\"port' style='display:none;'><ul>\";\n\n\t\t\t\t\t}\n\t\t\t\t\thtml += getToolTip(row[a]);\n\t\t\t\t\thtml +=\"</ul></div></td>\";\n\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tif(globalInfoType == \"XML\"){\n\t\t\t\t\thtml += \"<td class='toolTip' did ='td\"+a+\"port' >\"+row[a].getAttribute('Ports')+\"<div class='tableToolTip' id='divtoolTip\"+a+\"port' style='display:none;'><ul>\";\n\t\t\t\t}else{\n\t\t\t\t\thtml += \"<td class='toolTip' did ='td\"+a+\"port' >\"+row[a].Ports+\"<div class='tableToolTip' id='divtoolTip\"+a+\"port' style='display:none;'><ul>\";\n\n\t\t\t\t}\n\t\t\t\thtml += getToolTip(row[a],'port');\n\t\t\t\thtml +=\"</ul></div></td>\";\n\t\t\t}\n\t\t\tif(globalInfoType == \"XML\"){\n\t\t\t\thtml += \"<td>\"+row[a].getAttribute('Speed')+\"</td>\";\n\t\t\t\thtml += \"<td class='conntype'>\"+row[a].getAttribute('ConnectivityType')+\"</td>\";\n\t\t\t\thtml += \"<td>\"+row[a].getAttribute('PartnerPort')+\"</td>\";\n\t\t\t\thtml += \"<td>\"+row[a].getAttribute('Status')+\"</td>\";\n\t\t\t\thtml += \"<td>\"+row[a].getAttribute('User')+\"</td>\";\n\t\t\t}else{\n\t\t\t\thtml += \"<td>\"+row[a].Speed+\"</td>\";\n\t\t\t\thtml += \"<td class='conntype'>\"+row[a].ConnectivityType+\"</td>\";\n\t\t\t\thtml += \"<td>\"+row[a].PartnerPort+\"</td>\";\n\t\t\t\thtml += \"<td>\"+row[a].Status+\"</td>\";\n\t\t\t\thtml += \"<td>\"+row[a].User+\"</td>\";\n\t\t\t}\n\t\t\thtml +=\"</tr>\";\n\t\t}\n\t\t\n\t}\n\t$(\"#PortTestTool-table > tbody\").empty().append(html);\t\n\t$('#portTypeTT').empty().append(opStr);\n\thoverTable();\n\tvar myselect = $(\"#portTypeTT\");\n\tmyselect[0].selectedIndex =0;\n\tif(globalDeviceType == \"Mobile\"){\n\t\tmyselect.selectmenu(\"refresh\");\n\t}\n\n\tsetTimeout(function(){\n\t\tconnTypeFilter();\n\t},1000);\n}",
"function pageValidate(){\n var txtFieldIdArr = new Array();\n txtFieldIdArr[0] = \"tf1_SysName,\"+LANG_LOCALE['12134'];\n if (txtFieldArrayCheck(txtFieldIdArr) == false) \n return false;\n \n if (alphaNumericValueCheck (\"tf1_SysName\", '-', '') == false) \n return false;\n\n if (isProblemCharArrayCheck(txtFieldIdArr, \"'\\\" \", NOT_SUPPORTED) == false) \n return false;\n}",
"function teamValidation() {\r\n //Setup team\r\n var team = $(\".team\");\r\n\r\n //Validate the team when we select\r\n team.change(function() {\r\n var teamSelect = $(this).val();\r\n\r\n //Make sure that it is in the teams array\r\n if($.inArray(teamSelect, teams) !== -1) {\r\n $(this).css({\"borderColor\": \"lime\"});\r\n if($(this).parent().is(\"div\")) {\r\n $(this).unwrap();\r\n $(this).siblings().remove();\r\n Global.enableButton($(\"#saveAll\"));\r\n }\r\n } else {\r\n //It isn't valid, create the tooltip, set the border color to red for failure and disable the save all button\r\n $(this).wrap(\"<div class='tooltip'>\");\r\n $(this).after(\"<span class='tooltipMessage'>Please select a valid team.</span>\");\r\n $(this).css({\"borderColor\": \"red\"});\r\n Global.disableButton($(\"#saveAll\"));\r\n }\r\n });\r\n }",
"function atgValidation_initValidationObjects() {\n \n // Reinitialize the success variable\n isSuccess = true;\n \n for (var i = 0; i < currentValidationObjectArray.length; i++) {\n var validationId = currentValidationObjectArray[i];\n \n var validationObject = document.getElementById(validationId);\n if (validationObject != null) {\n validationObject.innerHTML = \"\";\n validationObject.style.display=\"none\";\n }\n } \n \n // After cleaning up the array, initialize it to an empty array\n currentValidationObjectArray = new Array();\n \n // Set the default Substitution Token\n if (validationCode.DEFAULT_SUBSTITUTION_TOKEN != null)\n constants.defaultSubstitutionToken = validationCode.DEFAULT_SUBSTITUTION_TOKEN;\n}",
"function ValidateGenerateCheck()\n\t{\t\n\t\t//Set short message with the error code\t\n\t\tvar ShortMessage=ErChkLstSht001;\n\t\t//set long message as empty\n\t\tvar LongMessage=\"\";\n\t\t\n\t\tLongMessage=CheckDDL(LongMessage);\n\t\t//check textbox check number is empty\n\t\tif(true==IstxtEmpty('txtCheckNo'))\n\t\t{\n\t\t\t//check long message is empty\n\t\t\tif(\"\"==LongMessage)\n\t\t\t{\n\t\t\t\t//set long message\n\t\t\t\tLongMessage=ErChkLstLng001;\n\t\t\t\t//set focus on check number\n\t\t\t\tdocument.getElementById('txtCheckNo').focus();\n\t\t\t}\n\t\t\t//if long message is not empty\n\t\t\telse\n\t\t\t{\n\t\t\t\t//set longmessage with newline char and long message code\n\t\t\t\tLongMessage=LongMessage + '\\n' + ErChkLstLng001;\t\t\t\t\n\t\t\t}\t\t\t\n\t\t}\n\t\t\n\t\t//check long message is empty\n\t\tif(\"\"==LongMessage)\n\t\t{\n\t\t\t//check textbox check number is number\n\t\t\tif(false==IsNumeric(document.getElementById('txtCheckNo').value))\n\t\t\t{\n\t\t\t\t//set long message\n\t\t\t\tLongMessage=ErChkLstLng002;\n\t\t\t\t//set focus on check number\n\t\t\t\tdocument.getElementById('txtCheckNo').focus();\n\t\t\t}\n\t\t}\n\t\t//if long message is empty\n\t\tif(\"\"==LongMessage)\n\t\t{\n\t\t\t//Validation success\n\t\t\treturn true;\n\t\t}\n\t\t//if long message is not empty\n\t\telse\n\t\t{\n\t\t\t//set error message on toppage\n\t\t\tSetErrorMessage(ShortMessage,LongMessage);\n\t\t\t//validation failure\n\t\t\treturn false;\n\t\t}\n\t}",
"static validateTools(_tools) { }",
"function PlateValidation() {\n\n /* Flags for standard plate types */\n\n this.PLATE_6WELL = 0;\n this.PLATE_12WELL = 1;\n this.PLATE_24WELL = 2;\n this.PLATE_48WELL = 3;\n this.PLATE_96WELL = 4;\n this.PLATE_384WELL = 5;\n this.PLATE_1536WELL = 6;\n this.PLATE_CUSTOM = -1;\n\n /* Flags for standard row numbers */\n\n this.ROWS_6WELL = 2;\n this.ROWS_12WELL = 3;\n this.ROWS_24WELL = 4;\n this.ROWS_48WELL = 6;\n this.ROWS_96WELL = 8;\n this.ROWS_384WELL = 16;\n this.ROWS_1536WELL = 32;\n\n /* Flags for standard column numbers */\n\n this.COLUMNS_6WELL = 3;\n this.COLUMNS_12WELL = 4;\n this.COLUMNS_24WELL = 6;\n this.COLUMNS_48WELL = 8;\n this.COLUMNS_96WELL = 12;\n this.COLUMNS_384WELL = 24;\n this.COLUMNS_1536WELL = 48;\n}",
"function checkPortOfDeviceList(devPath,action){\n\tif(lineName != \"\" && lineName != null && lineName != undefined && (lineName.toLowerCase() == \"ethernet\" || lineType == \"Any\")){\n\t\tgetPort(devPath,action,\"1000\",\"L1\");\n\t\tif(!portflag && action == \"source\"){\n\t\t\tgetPort(devPath,action,\"10-100\",\"L1\");\n\t\t\tif(!portflag && action == \"source\"){\n\t\t\t\tgetPort(devPath,action,\"10000\",\"L1\");\n\t\t\t\tif(!portflag && action == \"source\"){\n\t\t\t\t\tgetPort(devPath,action,\"40000\",\"L1\");\n\t\t\t\t\tif(!portflag && action == \"source\"){\n\t\t\t\t\t\tgetPort(devPath,action,\"100000\",\"L1\");\n\t\t\t\t\t\tif(!portflag){\n\t\t\t\t\t\tgetPort(devPath,action,\"100000\",\"L2\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(!portflag2 && action == \"destination\"){\n\t\t\tgetPort(devPath,action,\"10-100\",\"L1\");\n\t\t\tif(!portflag2 && action == \"destination\"){\n\t\t\t\tgetPort(devPath,action,\"10000\",\"L1\");\n\t\t\t\tif(!portflag2 && action == \"destination\"){\n\t\t\t\t\tgetPort(devPath,action,\"40000\",\"L1\");\n\t\t\t\t\tif(!portflag2 && action == \"destination\"){\n\t\t\t\t\t\tgetPort(devPath,action,\"100000\",\"L1\");\n\t\t\t\t\t\tif(!portflag2){\n\t\t\t\t\t\t\tgetPort(devPath,action,\"100000\",\"L2\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}else{\n\t\tgetPort(devPath,action,lineSpeed,lineType);\n\t}\n}",
"function ValidateViewCheck()\n\t{\n\t\t//Set short message with the error code\t\n\t\tvar ShortMessage=ErChkLstSht002;\n\t\t//set long message as empty\n\t\tvar LongMessage=\"\";\n\t\tLongMessage=CheckDDL(LongMessage);\n\t\t//check textbox [from] check number is empty\n\t\tif(true==IstxtEmpty('txtFrom'))\n\t\t{\n\t\t\t//check long message is empty\n\t\t\tif(\"\"==LongMessage)\n\t\t\t{\n\t\t\t\t//set long message\n\t\t\t\tLongMessage=ErChkLstLng003;\n\t\t\t\t//set focus on [from] check number\n\t\t\t\tdocument.getElementById('txtFrom').focus();\n\t\t\t}\n\t\t\t//if long message is not empty\n\t\t\telse\n\t\t\t{\n\t\t\t\t//set longmessage with newline char and long message code\n\t\t\t\tLongMessage=LongMessage + '\\n' + ErChkLstLng003;\t\t\t\t\n\t\t\t}\t\t\t\n\t\t}\n\t\t\n\t\t//If [from] check number is empty\n\t\tif(false==IstxtEmpty('txtFrom'))\n\t\t{\n\t\t\t//check textbox [from] check number is number\n\t\t\tif(false==IsNumeric(document.getElementById('txtFrom').value))\n\t\t\t{\n\t\t\t\t//check long message is empty\n\t\t\t\tif(\"\"==LongMessage)\n\t\t\t\t{\n\t\t\t\t\t//set long message\n\t\t\t\t\tLongMessage=ErChkLstLng004;\n\t\t\t\t\t//set focus on [from] check number\n\t\t\t\t\tdocument.getElementById('txtFrom').focus();\n\t\t\t\t}\n\t\t\t\t//if long message is not empty\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//set longmessage with newline char and long message code\n\t\t\t\t\tLongMessage=LongMessage + '\\n' + ErChkLstLng004;\n\t\t\t\t} \n\t\t\t}\n\t\t}\n\t\t\n\t\t//check textbox [to] check number is empty\n\t\tif(true==IstxtEmpty('txtTo'))\n\t\t{\n\t\t\t//check long message is empty\n\t\t\tif(\"\"==LongMessage)\n\t\t\t{\n\t\t\t\t//set long message\n\t\t\t\tLongMessage=ErChkLstLng005;\n\t\t\t\t//set focus on [to] check number\n\t\t\t\tdocument.getElementById('txtTo').focus();\n\t\t\t}\n\t\t\t//if long message is not empty\n\t\t\telse\n\t\t\t{\n\t\t\t\t//set longmessage with newline char and long message code\n\t\t\t\tLongMessage=LongMessage + '\\n' + ErChkLstLng005;\t\t\t\t\n\t\t\t}\t\t\t\n\t\t}\n\t\t\n\t\t//If [to] check number is not empty then check\n\t\tif(false==IstxtEmpty('txtTo'))\n\t\t{\n\t\t\t//check textbox [to] check number is number\n\t\t\tif(false==IsNumeric(document.getElementById('txtTo').value))\n\t\t\t{\n\t\t\t\t//check long message is empty\n\t\t\t\tif(\"\"==LongMessage)\n\t\t\t\t{\n\t\t\t\t\t//set long message\n\t\t\t\t\tLongMessage=ErChkLstLng006;\n\t\t\t\t\t//set focus on [to] check number\n\t\t\t\t\tdocument.getElementById('txtTo').focus();\n\t\t\t\t}\n\t\t\t\t//if long message is not empty\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//set longmessage with newline char and long message code\n\t\t\t\t\tLongMessage=LongMessage + '\\n' + ErChkLstLng006;\n\t\t\t\t} \n\t\t\t}\n\t\t}\n\t\t//if long message is empty\n\t\tif(\"\"==LongMessage)\n\t\t{\n\t\t\t//Validation success\n\t\t\treturn true;\n\t\t}\n\t\t//if long message is not empty\n\t\telse\n\t\t{\n\t\t\t//set error message on toppage\n\t\t\tSetErrorMessage(ShortMessage,LongMessage);\n\t\t\t//validation failure\n\t\t\treturn false;\n\t\t}\n\t}",
"function validate_techEdit(){\n\tvar emailExp = /^[\\w\\-\\.\\+]+\\@[a-zA-Z0-9\\.\\-]+\\.[a-zA-z0-9]{2,4}$/;\t\n\tif(document.frmTech.TechFirstName.value == ''){\n\t\tdocument.getElementById('lblTechFirstName').innerHTML = 'This field is required';\n\t\tdocument.frmTech.TechFirstName.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblTechFirstName').innerHTML = '';\n\t}\n\tif(regex.test(document.frmTech.TechFirstName.value)){\n\t\tdocument.getElementById('lblTechFirstName').innerHTML = 'This field contains special chars';\n\t\tdocument.frmTech.TechFirstName.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblTechFirstName').innerHTML = '';\n\t}\n\tif(document.frmTech.TechMiddleName.value == ''){\n\t\tdocument.getElementById('lblTechMiddleName').innerHTML = 'This field is required';\n\t\tdocument.frmTech.TechMiddleName.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblTechMiddleName').innerHTML = '';\n\t}\n\tif(regex.test(document.frmTech.TechMiddleName.value)){\n\t\tdocument.getElementById('lblTechMiddleName').innerHTML = 'This field contains special chars';\n\t\tdocument.frmTech.TechMiddleName.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblTechMiddleName').innerHTML = '';\n\t}\t\n\tif(document.frmTech.TechLastName.value == ''){\n\t\tdocument.getElementById('lblTechLastName').innerHTML = 'This field is required';\n\t\tdocument.frmTech.TechLastName.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblTechLastName').innerHTML = '';\n\t}\n\tif(regex.test(document.frmTech.TechLastName.value)){\n\t\tdocument.getElementById('lblTechLastName').innerHTML = 'This field contains special chars';\n\t\tdocument.frmTech.TechLastName.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblTechLastName').innerHTML = '';\n\t}\t\t\t\n\tif(document.frmTech.TechEmailID.value == ''){\n\t\tdocument.getElementById('lblTechEmailID').innerHTML = 'This field is required';\n\t\tdocument.frmTech.TechEmailID.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblTechEmailID').innerHTML = '';\n\t}\n\tif(!document.frmTech.TechEmailID.value.match(emailExp)){\n\t\tdocument.getElementById('lblTechEmailID').innerHTML = \"Required Valid Email ID.\";\n\t\tdocument.frmTech.TechEmailID.focus();\n\t\treturn false;\n\t}\n\telse{\n\t\tdocument.getElementById('lblTechEmailID').innerHTML = '';\n\t}\n\tif(document.frmTech.TechContactNo.value == ''){\n\t\tdocument.getElementById('lblTechContactNo').innerHTML = 'This field is required';\n\t\tdocument.frmTech.TechContactNo.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblTechContactNo').innerHTML = '';\n\t}\n\tif(regex.test(document.frmTech.TechContactNo.value)){\n\t\tdocument.getElementById('lblTechContactNo').innerHTML = 'This field contains special chars';\n\t\tdocument.frmTech.TechContactNo.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblTechContactNo').innerHTML = '';\n\t}\t\n\t/*if(document.frmTech.TechAltPhone.value == ''){\n\t\tdocument.getElementById('lblTechAltPhone').innerHTML = 'This field is required';\n\t\tdocument.frmTech.TechAltPhone.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblTechAltPhone').innerHTML = '';\n\t}*/\n\t/*if(regex.test(document.frmTech.TechAltPhone.value)){\n\t\tdocument.getElementById('lblTechAltPhone').innerHTML = 'This field contains special chars';\n\t\tdocument.frmTech.TechAltPhone.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblTechAltPhone').innerHTML = '';\n\t}*/\n\tif(document.frmTech.TechPicture.value != ''){\n\t\tvar str=document.getElementById('TechPicture').value;\n\t\tvar bigstr=str.lastIndexOf(\".\");\n\t\tvar ext=str.substring(bigstr+1);\n\t\tif(ext == 'jpg' || ext == 'JPG' || ext == 'jpeg' || ext == 'JPEG' || ext == 'png' || ext == 'PNG' || ext == 'gif' || ext == 'GIF' ){\n\t\t\tdocument.getElementById('lblTechPicture').innerHTML = '';\n\t\t}else{\n\t\t\tdocument.getElementById('lblTechPicture').innerHTML = 'Please enter a valid image';\n\t\t\treturn false;\n\t\t}\n\t}\n\tif(document.frmTech.TechAddress.value == ''){\n\t\tdocument.getElementById('lblTechAddress').innerHTML = 'This field is required';\n\t\tdocument.frmTech.TechAddress.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblTechAddress').innerHTML = '';\n\t}\n\tif(document.frmTech.TechCity.value == ''){\n\t\tdocument.getElementById('lblTechCity').innerHTML = 'This field is required';\n\t\tdocument.frmTech.TechCity.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblTechCity').innerHTML = '';\n\t}\n\tif(regex.test(document.frmTech.TechCity.value)){\n\t\tdocument.getElementById('lblTechCity').innerHTML = 'This field contains special chars';\n\t\tdocument.frmTech.TechCity.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblTechCity').innerHTML = '';\n\t}\t\n\tif(document.frmTech.TechState.value == ''){\n\t\tdocument.getElementById('lblTechState').innerHTML = 'This field is required';\n\t\tdocument.frmTech.TechState.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblTechState').innerHTML = '';\n\t}\n\tif(regex.test(document.frmTech.TechState.value)){\n\t\tdocument.getElementById('lblTechState').innerHTML = 'This field contains special chars';\n\t\tdocument.frmTech.TechState.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblTechState').innerHTML = '';\n\t}\t\n\tif(document.frmTech.TechZipcode.value == ''){\n\t\tdocument.getElementById('lblTechZipcode').innerHTML = 'This field is required';\n\t\tdocument.frmTech.TechZipcode.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblTechZipcode').innerHTML = '';\n\t}\n\tif(regex.test(document.frmTech.TechZipcode.value)){\n\t\tdocument.getElementById('lblTechZipcode').innerHTML = 'This field contains special chars';\n\t\tdocument.frmTech.TechZipcode.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblTechZipcode').innerHTML = '';\n\t}\t\n\tif(document.frmTech.TechDateBirth.value == ''){\n\t\tdocument.getElementById('lblTechDateBirth').innerHTML = 'This field is required';\n\t\tdocument.frmTech.TechDateBirth.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblTechDateBirth').innerHTML = '';\n\t}\n\t/*if(document.frmTech.TechCompanyName.value == ''){\n\t\tdocument.getElementById('lblTechCompanyName').innerHTML = 'This field is required';\n\t\tdocument.frmTech.TechCompanyName.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblTechCompanyName').innerHTML = '';\n\t}*/\n\t/*if(document.frmTech.TechSSN.value == ''){\n\t\tdocument.getElementById('lblTechSSN').innerHTML = 'This field is required';\n\t\tdocument.frmTech.TechSSN.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblTechSSN').innerHTML = '';\n\t}*/\n\t/*if(document.frmTech.TechFEIN.value == ''){\n\t\tdocument.getElementById('lblTechFEIN').innerHTML = 'This field is required';\n\t\tdocument.frmTech.TechFEIN.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblTechFEIN').innerHTML = '';\n\t}*/\n\t/*if(document.frmTech.TechPicture.value == ''){\n\t\tdocument.getElementById('lblTechPicture').innerHTML = 'This field is required';\n\t\tdocument.frmTech.TechPicture.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblTechPicture').innerHTML = '';\n\t}*/\n\tif(document.frmTech.TechPayGrade.value == ''){\n\t\tdocument.getElementById('lblTechPayGrade').innerHTML = 'This field is required';\n\t\tdocument.frmTech.TechPayGrade.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblTechPayGrade').innerHTML = '';\n\t}\n\tvar chk=$('input:checkbox[name=TechPayble[]]:checked').length;\n\tif(chk == 0){\n\t\tdocument.getElementById('lblTechPayble').innerHTML = 'This field is required';\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblTechPayble').innerHTML = '';\n\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\n}",
"function validateTableValues(){\n var valid = true;\n var empty = true;\n $('.validation', contestTable).hide();\n\n var firstErrors = [];\n\n if($(\"select[name=billingAccount]\").length) {\n if($(\"select[name=billingAccount]\").val() <= 0) {\n firstErrors.push(\"Please choose a billing account first\");\n }\n }\n\n if(!$(\"input[name=startDate]\").val()) {\n firstErrors.push(\"Please set the project start date\");\n }\n\n\n if(firstErrors.length > 0) {\n showErrors(firstErrors);\n return false;\n }\n\n $('tr', contestTable).each(function(index){\n var contestName = $('input[name=\"contestName\"]', this);\n var contestType = $('.contestType', this);\n var nameFilled = (!!contestName.val()) && $.trim(contestName.val()).length > 0;\n var typeFilled = contestType.val() != 0;\n if (nameFilled && typeFilled) {\n empty = false;\n return;\n }\n if ($('.followContest', this).val() != 0 ||\n $('input[name=\"contestFilter\"]:checked', this).length ||\n nameFilled || typeFilled) {\n valid = false;\n empty = false;\n\n if (!nameFilled) {\n contestName.siblings('.validation').show();\n }\n if (!typeFilled) {\n contestType.siblings('.validation').show();\n }\n }\n });\n // show empty warning modal if no fields filled\n if (empty) {\n modalLoad('#projectPlanEmptyModal');\n return false;\n }\n return valid;\n }",
"function validateReservationOption(imgarr,flag,opt,opt2,opt3) {\n var hostname = new Array();\n var hostname2 = new Array();\n for ( var t=0 ; t < imgarr.length ; t++) {\n switch (flag) {\n case 0:\n\t\t\t\tif ($('#tb'+opt+opt3+'URL'+imgarr[t]).val() == \"\") {\n var host = $('#tr'+opt2+opt3+imgarr[t]).find('td').eq(1).text();\n hostname.push(host);\n } else {\n var url = $('#tb'+opt+opt3+'URL'+imgarr[t]).val();\n var url2 = url.split(\":\");\n if ( url2.length != 2 ) {\n var host = $('#tr'+opt2+opt3+imgarr[t]).find('td').eq(1).text();\n hostname.push(host);\n } else {\n url2 = url.split(\":\")[0];\n url2 = url2.toLowerCase();\n if (/^disk[0-2]|disk$/.test(url2) == false && /^slot[0-1]$/.test(url2) == false && /^NVRAM$/.test(url2) == false && /^bootflash$/.test(url2) == false && /^FTP$/i.test(url2) == false && /^TFTP$/i.test(url2) == false && /^flash[0-1]|flash$/.test(url2) == false) {\n var host = $('#tr'+opt2+opt3+imgarr[t]).find('td').eq(1).text();\n hostname.push(host);\n //} else if ( /^FTP$/i.test(url2) == true || /^TFTP$/i.test(url2) == true ) {\n var url3 = url.split(\":\\/\\/\")[1].split(\"\\/\");\n\t\t\t\t\t\t\tif (url3.length < 3) {\n var host = $('#tr'+opt2+opt3+imgarr[t]).find('td').eq(1).text();\n hostname.push(host);\n } else {\n var ip = url3[0];\n var isvalidIP = checkIP(ip);\n if (isvalidIP == 1) {\n var host = $('#tr'+opt2+opt3+imgarr[t]).find('td').eq(1).text();\n hostname.push(host);\n } else {\n var ctr = 1;\n var str = \"\";\n for (var k = 1; k < url3.length - 1; k++) {\n if (ctr == url3.length - 2) {\n str += url3[k];\n } else {\n str += url3[k]+\"\\/\";\n }\n ctr++;\n }\n var isvalidpath = validatePath(str);\n if ( isvalidpath == 1 ) {\n\t\t\t\t\t\t\t\t\t\t var host = $('#tr'+opt2+opt3+imgarr[t]).find('td').eq(1).text();\n hostname.push(host);\n } else {\n var fname = url3[url3.length - 1];\n var isvalidfile = validateFileName(fname,str);\n if (isvalidfile == 1) {\n var host = $('#tr'+opt2+opt3+imgarr[t]).find('td').eq(1).text();\n hostname.push(host);\n }\n }\n }\n }\n } else if (/^disk[0-2]|disk$/.test(url2) == true || /^slot[0-1]$/.test(url2) == true || /^NVRAM$/.test(url2) == true || /^bootflash$/.test(url2) == true || /^flash[0-1]|flash$/.test(url2) == true) {\n }\n }\n }\n\t\t\t\t if ($('#tb'+opt+opt3+'Destination'+imgarr[t]).val() == \"\") {\n var host = $('#tr'+opt2+opt3+imgarr[t]).find('td').eq(1).text();\n hostname2.push(host);\n } else {\n if (opt2.toLowerCase() == 'loadimage') {\n var url = $('#tb'+opt+opt3+'Destination'+imgarr[t]).val();\n var filename = $('#tb'+opt+opt3+'URL'+imgarr[t]).val();\n if (filename.indexOf(url) !== -1) {\n var host = $('#tr'+opt2+opt3+imgarr[t]).find('td').eq(1).text();\n hostname2.push(host);\n }\n }\n }\n break;\n case 1:\n\t\t\t\tvar proto2 = $('#tb'+opt+opt3+'DetailProtocol'+imgarr[t]).val();\n var ip = $('#tb'+opt+opt3+'DetailIp'+imgarr[t]).val();\n var path = $('#tb'+opt+opt3+'DetailPath'+imgarr[t]).val();\n var fname = $('#tb'+opt+opt3+'DetailFilename'+imgarr[t]).val();\n var dest = $('#tb'+opt+opt3+'DetailDestination'+imgarr[t]).val();\n if (proto2 == \"\" && ip == \"\" && path == \"\" && fname == \"\" && dest == \"\") {\n var host = $('#tr'+opt2+opt3+imgarr[t]).find('td').eq(1).text();\n hostname.push(host);\n } else { //PROTOCOL\n var isvalidproto = validateProtocol(proto2,path);\n if (isvalidproto == 1) {\n var host = $('#tr'+opt2+opt3+imgarr[t]).find('td').eq(1).text();\n hostname.push(host);\n } else {\n\t\t\t\t\t\tif (/^disk[0-2]|disk$/.test(path) == true || /^slot[0-1]$/.test(path) == true || /^NVRAM$/.test(path) == true || /^bootflash$/.test(path) == true || /^flash[0-1]|flash$/.test(path) == true) {\n var isvalidip = 0;\n } else {\n var isvalidip = checkIP(ip);\n }\n if (isvalidip == 1) {\n var host = $('#tr'+opt2+opt3+imgarr[t]).find('td').eq(1).text();\n hostname.push(host);\n } else {\n\t\t\t\t\t\t\tvar isvalidpath = validatePath(path);\n if (isvalidpath == 1) {\n var host = $('#tr'+opt2+opt3+imgarr[t]).find('td').eq(1).text();\n hostname.push(host);\n } else {\n\t\t\t\t\t\t\t\tvar isvalidfile = validateFileName(fname,path);\n if (isvalidfile == 1) {\n var host = $('#tr'+opt2+opt3+imgarr[t]).find('td').eq(1).text();\n hostname.push(host);\n }\n }\n }\n }\n }\n\t\t\t\t if ($('#tb'+opt+opt3+'Destination'+imgarr[t]).val() == \"\") {\n var host = $('#tr'+opt2+opt3+imgarr[t]).find('td').eq(1).text();\n hostname2.push(host);\n \t } else {\n\t if (opt2.toLowerCase() == 'loadimage') {\n var proto2 = $('#tb'+opt+opt3+'DetailProtocol'+imgarr[t]).val();\n var path = $('#tb'+opt+opt3+'DetailPath'+imgarr[t]).val();\n var url = $('#tb'+opt+opt3+'Destination'+imgarr[t]).val();\n if (proto2.toLowerCase() == url) {\n var host = $('#tr'+opt2+opt3+imgarr[t]).find('td').eq(1).text();\n hostname2.push(host);\n } else if (path.toLowerCase() == url) {\n var host = $('#tr'+opt2+opt3+imgarr[t]).find('td').eq(1).text();\n hostname2.push(host);\n }\n }\n }\n break;\n }\n }\n\tvar msg = \"\";\n if (hostname.length > 0) {\n msg = \"Invalid \"+opt3+\" URL for the following device(s):<br/><br/>\";\n for (var u= 0; u < hostname.length; u++) {\n msg += hostname[u]+\"<br/>\";\n }\n msg += \"<br/>(sample: TFTP://\"+CURRENT_IP+\"/Directory/FileName or disk0:FileName)<br/>\";\n\t\tif (hostname2.length > 0) {\n msg += \"<br/>Invalid \"+opt3+\" Destination for the following device(s):<br/><br/>\";\n for (var u= 0; u < hostname2.length; u++) {\n msg += hostname2[u]+\"<br/>\";\n }\n }\n\t} else if (hostname2.length > 0) {\n msg = \"Invalid \"+opt3+\" Destination for the following device(s):<br/><br/>\";\n for (var u= 0; u < hostname2.length; u++) {\n msg += hostname2[u]+\"<br/>\";\n }\n }\n if (msg != \"\") {\n/* $('#manualAlert').dialog({\n autoOpen: false,\n resizable: false,\n modal: true,\n height: 250,\n width: 350,\n closeOnEscape: false,\n open: function(event, ui) { $(\".ui-dialog-titlebar-close\", ui.dialog).hide(); },\n buttons: {\n \"OK\": function() {\n $(this).dialog('destroy');\n }\n }\n });\n $('#manualAlert').empty().append(msg);\n $('#manualAlert').dialog(\"open\");\n $('.ui-dialog :button').blur();*/\n\t\treturn msg;\n }\n\treturn;\n}",
"function validate_values() {\n if (validations != null) {\n for (var i in params) {\n if (params[i] == null)\n alert(\"param for \"+i+\" is null?\");\n else if (validations[i] == null)\n alert(\"validation function for \"+i+\" is null?\");\n else\n params[i] = validations[i](params[i]);\n \n }\n }\n return params;\n }",
"function checkSlotPortNumber(){\n\tvar ipadd = GlobalMapPort.MAINCONFIG[0].DEVICE\t\n\tvar slot = \"\";\n\tvar newslot = \"\";\n\tvar slotnumber = $(\"#partnerslot\").val();\n\tvar ports = \"\";\n\tvar port = \"\";\n\tvar portid = \"\";\n\tvar val = $(\"#partnerhostname\").val();\n\tfor (var a=0; a<ipadd.length; a++){\n\t\thost = ipadd[a].HostName\n\t\tvar ip = ipadd[a].IpAddress\n\t\tif(val == host){\n\t\t\tfor (var x=0; x<ipadd[a].SLOT.length; x++){\n\t\t\t\tnewslot = ipadd[a].SLOT[x].Number;\n\t\t\t\tif(slotnumber==newslot){\n\t\t\t\t\tfor (var z=0; z<ipadd[a].SLOT[x].PORT.length; z++){\n\t\t\t\t\t\tport = ipadd[a].SLOT[x].PORT[z].PortName\n\t\t\t\t\t\tportid = ipadd[a].SLOT[x].PORT[z].PortId\n\t\t\t\t\t\tports += \"<option value='\"+port+\"_\"+portid+\"'>\"+port+\"</option>\"\t\n\t\t\t\t\t}\n\t\t\t\t\t$(\"#partnerportinfo\").empty().append(ports);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t}\n}",
"function checkLessonTaken(timetable, lessons, code) {\n for(var x in lessons.selectedLessons) {\n if(lessons.selectedLessons[x].ClassNo == timetable.ClassNo && \n lessons.selectedLessons[x].LessonType == timetable.LessonType)\n return true; \n }\n return false;\n}",
"function generateHtmlTableValidation(body_id, data, calc_data) {\n\n init_val = 2\n\n for (var i = init_val; i < data.length; i++) {\n\n var result = \"<tr>\";\n for(var j = 0; j < data[i].length; j++){\n // THE SIZE OF INPUT DATA IS LESS THAN THE TOTAL VALIDATION DATA\n if(i < calc_data.length){\n // WE SHOW BOTH DATA, VALIDATION AND CALCULATED DATA, AND USE GREEN TO\n // TO DIFFERENTIATE THE CALCULATED DATA\n result += \"<td><p>\"+data[i][j]+\"</p> <p style='color: #007F00'>\" + calc_data[i-init_val][j] +\"</p></td>\";\n }\n // IF NOT EXISTS MORE INPUT DATA ONLY ADD VALIDATION DATA ON HMTL PAGE\n else{\n result += \"<td>\"+data[i][j]+\"</td>\"\n }\n }\n\n // THE SIZE OF INPUT DATA IS LESS THAN THE TOTAL VALIDATION DATA\n if(i < calc_data.length){\n result += \"<td><p style='color: #007F00'>\" + calc_data[i-init_val][j] +\"</p></td>\";\n }\n document.getElementById(body_id).innerHTML += result\n }\n}",
"function Master_DataCheck(){ \n\t\tif(LINE_PART.bindcolval == \"\" ) {\n\t\t\talert(\"Project ๋๋ฝ\"); \n\t\t\treturn false;\n\t\t} \n\n\t\tif(LINE_PART.index != 3) {\n\t\t\tif( PROJECT.index == 0 ) {\n\t\t\t\talert(\"๋ฌผ๋ฅ๋น ๋ถ๋ด ๋๋ฝ\"); \n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tif(strim(ETD_DT.Text) == \"\" ) {\n\t\t\talert(\"๋ฐ์ถ์ผ์ ๋๋ฝ\"); \n\t\t\treturn false;\n\t\t}\n\n\t\tif(strim(txt_obj_remk.value) == \"\" ) {\n\t\t\talert(\"ํฌ์
๋ชฉ์ /๊ณต์ ๋๋ฝ\"); \n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t/**\n\t\tif (DLVL_TYPE.bindcolval!=\"0001\")\t{\n\t\t\tif(strim(FAC_PERSON.value) == \"\" || strim(FAC_PRSTEL.value) == \"\") {\n\t\t\t\talert(\"๊ณต์ฅ๋ด๋น์์ ๋ณด ๋๋ฝ\"); \n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t**/\n\n\t\tif(strim(CUST_CD.Text) == \"\" ) {\n\t\t\talert(\"์ ์ฒญ์
์ฒด ๋๋ฝ\"); \n\t\t\treturn false;\n\t\t} \n\n\t\tif(strim(CUST_PRSN.value) == \"\" ) {\n\t\t\talert(\"์ ์ฒญ์
์ฒด ๋ด๋น์ ๋๋ฝ\"); \n\t\t\treturn false;\n\t\t}\n\n\t\tif(strim(CUST_TELNO.value) == \"\" ) {\n\t\t\talert(\"์ ์ฒญ์
์ฒด ์ ํ๋ฒํธ ๋๋ฝ\"); \n\t\t\treturn false;\n\t\t} \n\n\t\tif(strim(SHIPPER.Text) == \"\" ) {\n\t\t\talert(\"์คํ์ฃผ ๋๋ฝ\"); \n\t\t\treturn false;\n\t\t}\n\n\t\tif(strim(SHIPPERPS.value) == \"\" ) {\n\t\t\talert(\"์คํ์ฃผ ๋ด๋น์ ๋๋ฝ\");\n\t\t\treturn false;\n\t\t}\n\n\t\tif(strim(SHIPPERTEL.value) == \"\" ) {\n\t\t\talert(\"์คํ์ฃผ ์ ํ๋ฒํธ ๋๋ฝ\");\n\t\t\treturn false;\n\t\t}\n\n\t\tif(CARGO_TYPE.bincolval == \"\" ) {\n\t\t\talert(\"์ ์ฌ๊ตฌ๋ถ ๋๋ฝ\"); \n\t\t\treturn false;\n\t\t}\n\n\t\tfor (var i=1; i<=gcDs4.countrow; i++) {\n\t\t\tif (strim(gcDs4.namevalue(i,\"CARTYPENO\"))==\"\")\t{\n\t\t\t\talert(\"์ฐจ๋์ ๋ณด (์ฐจ๋) ๋๋ฝ\");\n\t\t\t\treturn false;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif (strim(gcDs4.namevalue(i,\"CTN_STDRD\"))==\"\")\t{\n\t\t\t\talert(\"์ฐจ๋์ ๋ณด (๋ํํ๋ชฉ) ๋๋ฝ\");\n\t\t\t\treturn false;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif (strim(gcDs4.namevalue(i,\"LD_CARGO\"))==\"\")\t{\n\t\t\t\talert(\"์ฐจ๋์ ๋ณด (์์ฐจ์ง) ๋๋ฝ\");\n\t\t\t\treturn false;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif (strim(gcDs4.namevalue(i,\"OFF_CARGO\"))==\"\")\t{\n\t\t\t\talert(\"์ฐจ๋์ ๋ณด (ํ์ฐจ์ง) ๋๋ฝ\");\n\t\t\t\treturn false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn true ; //๋๋ฝ ๋ ๊ฑด์ด ํ๊ฐ๋ ์์๋\n\t}",
"function Tsts() {\n this.TSTs = [];\n this.Error = \"\";\n this.Text = \"\";\n this.webResponse = \"\";\n}",
"function toppingsValidator() {\n resetError();\n document.getElementById('submitOrderButton').disabled = false;\n var toppingsSelector = document.getElementsByClassName('form-check-input');\n var numberOfToppings = 0;\n var allowedToppings = itemData[0].fields.numberOfToppings;\n for (var i = 0; i < toppingsSelector.length; i++) {\n if (toppingsSelector[i].checked) {\n numberOfToppings++\n }\n }\n if (numberOfToppings > allowedToppings) {\n var errorMessage = \"You have selected too many options, you can have a total of \" + allowedToppings;\n raiseError(errorMessage);\n document.getElementById('submitOrderButton').disabled = true;\n }\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Load the window skins pictures | static async loadWindowSkins() {
for (let i = 1, l = this.windowSkins.length; i < l; i++) {
await this.windowSkins[i].updatePicture();
}
} | [
"function drawImages(){\n image(handSanatizer, handSanatizerX, handSanatizerY, imageSizes, imageSizes);\n image(mask, maskX, maskY, imageSizes, imageSizes);\n image(broom, broomX, broomY, imageSizes, imageSizes);\n image(washingHands, washingHandsX, washingHandsY, imageSizes ,imageSizes);\n}",
"function loadAssets() {\n\t\tbackground.src = \"assets/Wall720.png\";\n\t\tTERRAIN_TYPES.BASE.img.src = \"assets/TileSandstone100.png\";\n\t\tTERRAIN_TYPES.LAVA.img.src = \"assets/lava.png\";\n\t\t\n\t\tPLAYER_CLASSES.PALADIN.img.src = \"assets/paladinRun.png\";\n\t\tPLAYER_CLASSES.RANGER.img.src = \"assets/rangerRun.png\";\n\t\tPLAYER_CLASSES.MAGI.img.src = \"assets/magiRun.png\";\n\t\t\n\t\tENEMY_TYPES.RAT.img.src = \"assets/ratRun.png\";\n\t\tENEMY_TYPES.BAT.img.src = \"assets/batRun.png\";\n\t\tENEMY_TYPES.GATOR.img.src = \"assets/gatorRun.png\";\n\t\t\n\t\tPROJECTILE_TYPES.ARROW.img.src = \"assets/arrow.png\";\n\t\tPROJECTILE_TYPES.FIREBALL.img.src = PROJECTILE_TYPES.MAGIFIREBALL.img.src = \"assets/fireball.png\";\n\t\t\n\t\tPARTICLE_TYPES.FLAME.img.src = \"assets/flameParticle.png\";\n\t\tPARTICLE_TYPES.ICE.img.src = PARTICLE_TYPES.FROST.img.src = \"assets/iceParticle.png\";\n\t}",
"function loadBehaviours() {\n\n var elWidth = backgroundCanvas.width * 0.20;\n var elHeight = backgroundCanvas.height * 0.85;\n\n var turret = {};\n turret.image = new Image();\n turret.image.src = \"../Images/turret.png\";\n\n behaviours.turret = turret;\n\n plusImage = new Image();\n plusImage.src = \"../Images/plusImage.png\"\n\n}",
"function preload(){\n\thelicopterIMG=loadImage(\"helicopter.png\")\n\tpackageIMG=loadImage(\"package.png\")\n}",
"function preload() {\n\tkernelImg = loadImage(\"assets/kernel.png\");\n\tpopcornImg = loadImage(\"assets/popcorn.png\");\n\tburntImg = loadImage(\"assets/burnt.png\");\n}",
"loadWaveMsg () {\n\t\tthis.splashBackground = this.add.graphics();\n\t\tthis.splashBackground.fillStyle(0x666666, 0.5);\n\t\tthis.splashBackground.fillRect(0, 0, 1280, 960);\n\t\tthis.splashBackground.alpha = 0;\n\n\t\tthis.bossMsgImg = this.add.image(300,180, 'bossWave');\n\t\tthis.bossMsgImg.setScale(0.55);\n\t\tthis.bossMsgImg.alpha = 0;\n\n\t\tthis.waveMsgImg = this.add.image(300, 180, 'forestWave');\n\t\tthis.waveMsgImg.setScale(0.55);\n\t\tthis.waveMsgImg.alpha = 0;\n\t}",
"init() {\n\t\tdocument.body.append(this.view);\n\t\tthis.functions.load();\n\t\tthis.Loader.load(async (loader, resources) => {\n\t\t\tlet i = 0;\n\t\t\tfor (const [name, value] of Object.entries(resources)) {\n\t\t\t\tif (loader.rorkeResources[i].options) {\n\t\t\t\t\tconst urls = await this.Loader.splitSpritesheetIntoTiles(\n\t\t\t\t\t\tvalue.data,\n\t\t\t\t\t\tloader.rorkeResources[i].options,\n\t\t\t\t\t);\n\t\t\t\t\tconst textures = urls.map(tile => Texture.from(tile));\n\t\t\t\t\tthis.spritesheets.set(name, {\n\t\t\t\t\t\ttexture: value.texture,\n\t\t\t\t\t\toptions: loader.rorkeResources[i].options,\n\t\t\t\t\t\ttiles: urls,\n\t\t\t\t\t\ttextures,\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tthis.textures.set(name, value.texture);\n\t\t\t\t}\n\t\t\t\ti++;\n\t\t\t}\n\n\t\t\tthis.runCreate();\n\t\t});\n\t}",
"function preload()\n{\n\tpaperImage = loadImage(\"paperImage.png\")\n\tdustbinImage = loadImage(\"dustbinWHJ.png\")\n\n}",
"function displayStrawCup1() {\n image(strawCup1Img, 0, 0, 1000, 500);\n}",
"function initUIElements() {\n document.getElementById('splash_image').src = SPLASH_SCREEN_SRC;\n document.getElementById('logo_image').src = LOGO_IMAGE_SRC;\n\n promoImageElement = document.getElementById('promo_image');\n titleElement = document.getElementById('loading_title');\n descriptionElement = document.getElementById('loading_description');\n\n splashScreen = document.querySelector(\"#splash_screen\");\n loadingScreen = document.querySelector(\"#loading_screen\");\n playerScreen = document.querySelector(\"#player\");\n errorScreen = document.querySelector(\"#error_screen\");\n screens = [ splashScreen, loadingScreen, playerScreen, errorScreen ];\n screenController = new _ScreenController(screens);\n }",
"function preload() {\n lemonMilk = loadFont(\"assets/text/LemonMilk.otf\");\n catN = loadImage(\"assets/images/cat.png\");\n lionN = loadImage(\"assets/images/lion.png\");\n jungleN = loadImage(\"assets/images/jungle.jpg\");\n catRetro = loadImage(\"assets/images/catRetro.png\");\n lionRetro = loadImage(\"assets/images/lionRetro.png\");\n jungleRetro = loadImage(\"assets/images/jungleRetro.jpg\");\n}",
"function initImgs(){\n for(var i = 1; i <= datas.nbrOfImages; i++) {\n // gรฉnรจre les images dans l'index.html\n $scope.data.items.push({src: \"img/bd/Case\" + i + \".jpg\"});\n }\n }",
"function playersImgs() {\n firstPlayerImg.src = \"../www/img/\" + choice1 + \".jpg\";\n secondPlayerImg.src = \"../www/img/\" + choice2 + \"r.jpg\";\n }",
"function loadInstructionImages() {\n\tif (window.omnibus.frontend.imagesLoaded !== true){\n\t\twindow.omnibus.frontend.imagesLoaded = true;\n\t\tdataLayer.push({'event': 'instructionModalOpen'});\n\t\tvar imgs = jQuery('#adobe-instructions-modal img');\n\t\t//change src from the transparent GIF to the actual source on modal open\n\t\tfor (var i = 0; i < imgs.length; i++) {\n\t\t\tif (imgs[i].getAttribute('data-src')) {\n\t\t\t\timgs[i].setAttribute('src', imgs[i].getAttribute('data-src'));\n\t\t\t}\n\t\t}\n\t}\n}",
"function setScissorsImg(){\n decision = \"scissors\";\n document.getElementById('meImg').src = SCISSORSIMGPATH;\n}",
"function generateDefaultShibeImgs() {\n const shibeImg = document.getElementsByClassName(\"img-bk\")\n\n for(let i = 0; i < shibeImg.length; i++) {\n shibeImg[i].style.backgroundImage = `url(${shibeImgs[Math.floor(\n Math.random() * shibeImgs.length)]}\n )`\n }\n}",
"function loadCustomLightbox(product, button) {\n var imgLocation;\n if (button === \"example\") {\n imgLocation = window.LightboxRoot + product + '-examples.jpg'\n } else if (button === \"moreInfo\") {\n imgLocation = window.LightboxRoot + product + '-box.jpg'\n } else if( button === \"sizing\"){\n if (product === 'hoodie' || product === 'coat') {\n imgLocation = window.LightboxRoot + 'generic-size-chart.jpg'\n } else {\n imgLocation = window.LightboxRoot + product + '-size-chart.jpg'\n }\n }\n $('#imageModalContent').attr(\"src\", imgLocation);\n $('#imageModal').modal('show');\n }",
"function updateDebugImages() {\n\tif (imageViewUrl) {\n\t\tsetImage(\"birdseyeImage\", imageViewUrl + '?type=birdseye&'\n\t\t\t\t+ Math.random());\n\t\tsetImage(\"edgesImage\", imageViewUrl + '?type=edges&' + Math.random());\n\t\tsetImage(\"linesImage\", imageViewUrl + '?type=lines&' + Math.random());\n\t} else {\n\t\tsetImage(\"birdseyeImage\", \"images/nolines.png\");\n\t\tsetImage(\"edgesImage\", \"images/noedges.png\");\n\t\tsetImage(\"linesImage\", \"images/nolines.png\");\n\t}\n}",
"drawSkier() {\n var skierAssetName = this.getSkierAsset();\n var skierImage = vars.loadedAssets[skierAssetName];\n var x = (vars.gameWidth - skierImage.width) / 2;\n var y = (vars.gameHeight - skierImage.height) / 2;\n ctx.drawImage(skierImage, x, y, skierImage.width, skierImage.height);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a new row where the leading nonzero number (if any) is positive, and the GCD of the row is 0 or 1. For example, simplifyRow([0, 2, 2, 4]) = [0, 1, 1, 2]. | static simplifyRow(x) {
let sign = 0;
for (const val of x) {
if (val != 0) {
sign = Math.sign(val);
break;
}
}
if (sign == 0)
return x.slice();
const g = Matrix.gcdRow(x) * sign;
return x.map(val => val / g);
} | [
"gaussJordanEliminate() {\n // Simplify all rows\n let cells = this.cells = this.cells.map(Matrix.simplifyRow);\n // Compute row echelon form (REF)\n let numPivots = 0;\n for (let i = 0; i < this.numCols; i++) {\n // Find pivot\n let pivotRow = numPivots;\n while (pivotRow < this.numRows && cells[pivotRow][i] == 0)\n pivotRow++;\n if (pivotRow == this.numRows)\n continue;\n const pivot = cells[pivotRow][i];\n this.swapRows(numPivots, pivotRow);\n numPivots++;\n // Eliminate below\n for (let j = numPivots; j < this.numRows; j++) {\n const g = gcd(pivot, cells[j][i]);\n cells[j] = Matrix.simplifyRow(Matrix.addRows(Matrix.multiplyRow(cells[j], pivot / g), Matrix.multiplyRow(cells[i], -cells[j][i] / g)));\n }\n }\n // Compute reduced row echelon form (RREF), but the leading coefficient need not be 1\n for (let i = this.numRows - 1; i >= 0; i--) {\n // Find pivot\n let pivotCol = 0;\n while (pivotCol < this.numCols && cells[i][pivotCol] == 0)\n pivotCol++;\n if (pivotCol == this.numCols)\n continue;\n const pivot = cells[i][pivotCol];\n // Eliminate above\n for (let j = i - 1; j >= 0; j--) {\n const g = gcd(pivot, cells[j][pivotCol]);\n cells[j] = Matrix.simplifyRow(Matrix.addRows(Matrix.multiplyRow(cells[j], pivot / g), Matrix.multiplyRow(cells[i], -cells[j][pivotCol] / g)));\n }\n }\n }",
"simplifyMat(){\n for(let i = 0; i < this.nRows; i++){\n\n let simplify = false;\n\n for(let j = 0; j < this.nColumns; j++){\n if(this.matrix[i][j] != 0){\n simplify = true;\n }\n }\n\n if(simplify){\n this.simplifyRow(i);\n }\n\n }\n }",
"function returnRow(square) {\n\treturn Math.floor(square / 9)\n}",
"function generatePattern(rows) {\n for (i = 1; i <= rows; i++) {\n rowArray = [];\n for (j = 1; j <= rows; j++) {\n if (j <= i) {\n rowArray.push(j);\n } else {\n rowArray.push('*');\n } \n }\n console.log(rowArray.join(''));\n }\n}",
"function getRowNums(currentCols, row, puzzle) {\n // Get the numbers for the column.\n let rowNums = puzzle[row].slice(0);\n // Remove the numbers for the rows we are working on.\n rowNums.splice(currentCols[0], currentCols.length);\n // Return an array of only numbers.\n return _.compact(rowNums);\n}",
"function positiveRowsOnly(arr){\n\n \treturn arr.filter(a=>{\n \t\tfor(i=0;i<a.length;i++){\n \t\t\n \t\t if(a[i]>0){\n \t\t\tcontinue;\n \t\t }\n return;\n \t };\n \treturn a;\n }\n \t);\n\n \t\n}",
"function solution_1 (matrix) {\r\n let row1 = matrix[0];\r\n let total = row1.reduce((total, num) => total + num);\r\n if (matrix.length === 1) return total;\r\n let row2;\r\n for (let row = 1; row < matrix.length; ++row) {\r\n row2 = [matrix[row][0]];\r\n total += row2[0];\r\n for (let col = 1; col < row1.length; ++col) {\r\n if (matrix[row][col]) {\r\n const newNum = Math.min(row2[row2.length - 1], row1[col - 1], row1[col]) + 1;\r\n row2.push(newNum);\r\n total += newNum;\r\n } else {\r\n row2.push(0);\r\n }\r\n }\r\n row1 = row2;\r\n }\r\n return total;\r\n}",
"function buildDown() {\n\tvar curRow = PascalRow.row; // The current row being worked on\n\n\twhile (curRow.length > 1) {\n\t\tvar nextRow = new Array(curRow.length - 1);\n\t\tfor (var i = 0; i < nextRow.length; i++) {\n\t\t\tnextRow[i] = curRow[i] + curRow[i+1];\n\t\t}\n\t\tcurRow = nextRow;\n\t}\n\t\n\treturn curRow;\n}",
"function resetRow(row){\n var currentRow=gridRows[row];\n var prevNumbers=[new Array(), new Array(), new Array()];\n for(i=0;i<9;i++){\n var currentColumn=gridColumns[i];\n var currentSquareIndex=Math.floor(row/3)*3+1+Math.floor(i/3);\n var currentSquare=grid[currentSquareIndex-1];\n currentColumn[row]=0;\n gridColumns[i]=currentColumn;\n //When generating the game, the follow line occasionally generates the error:\n // Uncaught TypeError: Cannot set property '0' of undefined\n currentRow[i]=0;\n var currentPrevNumbers=prevNumbers[Math.floor(i/3)];\n currentPrevNumbers[i%3]=currentSquare[(row%3)*3+i%3];\n prevNumbers[Math.floor(i/3)]=currentPrevNumbers;\n currentSquare[(row%3)*3+i%3]=0;\n grid[currentSquareIndex-1]=currentSquare;\n }\n for(i=0;i<3;i++)\n {\n ii=i;\n refillSetForSquareAtRow(row, i);\n i=ii;\n }\n gridRows[row]=currentRow;\n}",
"function shift_down_to_row(row)\n{\n\tfor(var y = row; y >= 0; y--)\n\t{\n\t\tfor(var x = 0; x < get_game_width(); x++)\n\t\t{\n\t\t\tvar pixel;\n\t\t\tif(y == 0)\n\t\t\t{\n\t\t\t\tpixel = null;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tpixel = get_board_pixel(board, x, y - 1);\n\t\t\t}\n\t\t\tset_board_pixel(board, x, y, pixel);\n\t\t}\n\t}\n}",
"function clearRows() {\n var toBeCleared = [];\n for (var row = 0; row < grid.length; row++) {\n var withEmptySpace = false;\n for (var col = 0; col < grid[row].length; col++) {\n if (grid[row][col] === 0) {\n withEmptySpace = true;\n }\n }\n if (!withEmptySpace) {\n toBeCleared.push(row);\n }\n }\n\n if (toBeCleared.length == 1) {\n score += 400;\n } else if (toBeCleared.length == 2) {\n score += 1000;\n } else if (toBeCleared.length == 3) {\n score += 3000;\n } else if (toBeCleared.length == 4) {\n score += 12000;\n }\n var clearedRows = clone(toBeCleared.length);\n for (var toBe = toBeCleared.length - 1; toBe >= 0; toBe--) {\n grid.splice(toBeCleared[toBe], 1);\n }\n while (grid.length < 20) {\n grid.unshift([0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);\n }\n return clearedRows;\n }",
"function drawDiamondOdd (rowIndex, colIndex, rows, length) {\n if (rowIndex <= (rows - 1)/2){\n return ((colIndex === (length-1)/2 - rowIndex)|| (colIndex === (length-1)/2 + rowIndex));\n }\n else {\n return ((colIndex === (length-1)/2 - (rows - 1 - rowIndex))|| (colIndex === (length-1)/2 + (rows - 1 - rowIndex)));\n }\n\n}",
"__getRowString (row) {\n\n var string = \"-\" + row + \"-|\";\n var i;\n\n this.board[row].forEach(function (space) {\n string += \" \" + space + \" |\";\n });\n\n return string;\n }",
"function contractMatrix(newDims, noRowChange, bypassCheck) {\n\tif(!bypassCheck) {\n\t\tvar diff = level.dimensions - newDims;\n\t\t// First, check if the shrink can take place\n\t\t// Check for blocking rows\n\t\tfor(var i = 0; i < diff; i++) {\n\t\t\tfor(var j = 0; j < level.dimensions; j++) {\n\t\t\t\t// The only thing in the square should be valid\n\t\t\t\tif(matrix[i][j] != VALID) return false;\n\t\t\t}\n\t\t}\n\t\t// Check for blocking columns\n\t\tfor(var i = diff; i < level.dimensions; i++) {\n\t\t\tfor(var j = newDims; j < level.dimensions; j++) {\n\t\t\t\t// The only thing in the square should be valid\n\t\t\t\tif(matrix[i][j] != VALID) return false;\n\t\t\t}\n\t\t}\n\t}\n\t// GOOD TO GO, continue with shrink\n\t// remove top rows\n\tfor(var i = 0; i < diff; i++) {\n\t\tmatrix.splice(0,1);\n\t\tlevel.matrix.splice(0,1);\n\t}\n\t// remove right columns from the columns that are left\n\tfor(var i = 0; i < newDims; i++) {\n\t\t//for(var j = newDims; j < level.dimensions; j++) {\n\t\t\tmatrix[i].splice(-diff,diff);\n\t\t\tlevel.matrix[i].splice(-diff,diff);\n\t\t//}\n\t}\n\tif(!noRowChange) {\n\t\t// row is now further from top\n\t\trow = row - diff;\n\t}\n\tlevel.dimensions = newDims;\n\treturn true;\n}",
"function refreshGridAfterDelete(row)\n { \n row.remove();\n }",
"function getRightDiagonalPattern() {\n let initial = rowCount - 1;\n let increaseBy = 0;\n let diagonalMatchPattern = [];\n for (let i = 0; i < rowCount; i++) {\n diagonalMatchPattern.push(initial + increaseBy);\n increaseBy += rowCount;\n initial -= 1;\n }\n\n // console.log(diagonalMatchPattern);\n return diagonalMatchPattern;\n }",
"function leftDaigonalMatch(){\n\tif(isEmptyRow(\"square0\", \"square4\",\"square8\")){\n\t\tisEqual(\"#square0\", \"#square4\", \"#square8\");\n\t}\n}",
"function trimLeadingEmptyRows(pxMatrix, limit) {\n for (let i=0; i<limit; i++) {\n if (pxMatrix.length>0 && pxMatrix[0].reduce((a, b) => a+b) == 0) {\n pxMatrix.shift();\n } else {\n break;\n }\n }\n}",
"function placeQueen (row, diagonal, antiDiagonal, queens) { //Rooks can represent which row we're in\n for (let column = 0; column < size; column++) {\n let [diagIndex, antiIndex] = findDiagonal(column, queens);\n \n // Open one new recursive call for each available 0\n if (row[column] === 0 && diagonal[diagIndex] === 0 && antiDiagonal[antiIndex] === 0) {\n row[column] = 1;\n diagonal[diagIndex] = 1;\n antiDiagonal[antiIndex] = 1;\n queens++;\n //let [diagonal, antiDiagonal] = findDiagonal(i, queens);\n\n // If we just placed our last rook, count it as a solution and stop\n if (queens === row.length) {\n solutions++;\n } else {\n placeQueen(row, diagonal, antiDiagonal, queens);\n }\n row[column] = 0;\n diagonal[diagIndex] = 0;\n antiDiagonal[antiIndex] = 0;\n queens--;\n }\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.