Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Alice is taking a cryptography class and finding anagrams to be very useful.We consider two strings to be anagrams of each other if the first string's letters can be rearranged to form the second string. In other words, both strings must contain the same exact letters in the same exact frequency For example, bacdc and ...
function makeAnagram(str1, str2) { let counter1 = str1.split("").reduce((acc, ltr) => { acc[ltr] = ++acc[ltr] || 1; return acc; }, {}); let counter2 = str2.split("").reduce((acc, ltr) => { acc[ltr] = ++acc[ltr] || 1; return acc; }, {}); for (let ltr in counter2) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makingAnagrams(s1, s2) {\n let charMatched = 0;\n let s1Arr = s1.split('');\n let s2Arr = s2.split('');\n let deletionCount = s1Arr.length+s2Arr.length;\n for(let i=0;i<s1Arr.length;i++){\n for(let j=0;j<s2Arr.length;j++){\n if(s1Arr[i]===s2Arr[j]){\n charMa...
[ "0.8315285", "0.82431215", "0.8105242", "0.79687524", "0.7902653", "0.78690124", "0.77428895", "0.7675236", "0.764186", "0.7633113", "0.76315475", "0.7595363", "0.75783294", "0.7524423", "0.7505146", "0.74883384", "0.74577504", "0.7426021", "0.742442", "0.7421284", "0.7413453...
0.7374646
22
update the new name as saved in the state.
updateNameValue(name) { this.setState({ newName: name }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateName(state, name) {\r\n state.name = name;\r\n }", "updateName() {\n App.elements.name.html(App.state.name);\n }", "function updateName() { changeTextField(name, nameLabel, isValidName()) }", "setName(state, name) {\n state.name = name\n }", "updateFamName(state, famName) ...
[ "0.8695909", "0.7870027", "0.7536061", "0.7422167", "0.74178606", "0.73745865", "0.7357234", "0.7351008", "0.7246639", "0.7167053", "0.71625674", "0.7110562", "0.7109646", "0.704872", "0.70113397", "0.6986893", "0.6965198", "0.69545084", "0.6946017", "0.6879588", "0.68730265"...
0.83930373
1
Make the request to update the name in the redux store and in async storage
updateDeckName() { this.props.dispatch(editDeckAsync(this.props.route.params.deckID, this.state.newName)); this.props.navigation.dispatch(CommonActions.goBack()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async saveName() {\n const _this = this;\n\n const {name: nameObject} = this.state;\n const {value: name} = nameObject; // const name = nameObject.name;\n const db = FirebaseLib.FIRESTORE_DB;\n\n try {\n await db.collection(config.DBPaths.INFO).doc(config.DBPaths.INFO_...
[ "0.69506806", "0.6893089", "0.6883832", "0.6731908", "0.6475555", "0.6433784", "0.64084", "0.64058065", "0.6350999", "0.6338092", "0.6323933", "0.6314223", "0.62822104", "0.62499887", "0.618528", "0.61830956", "0.6153154", "0.6148631", "0.61053437", "0.6099985", "0.6084902", ...
0.6416551
6
Map State to Props Gets the details of this specific deck
function mapStateToProps({ decks }, { route }) { const deckID = route.params.deckID; return { deck: decks[deckID] } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "render(props){\n const {deck,title,strategy} = this.props;\n return(\n <div className = \"deck\">\n <h2>{title}</h2>\n {deck.map((card,i) => <Card {...this.props} key = {i} i = {i} card = {card}/>)}\n <h3>Strategy</h3>\n <p className = \"deck-strategy\">{strategy}</p>\n ...
[ "0.71021634", "0.7090468", "0.66848785", "0.6366627", "0.6323783", "0.63237244", "0.62779206", "0.6274527", "0.6244692", "0.60698295", "0.6057729", "0.60418844", "0.6040912", "0.5962054", "0.59463906", "0.5933032", "0.5889422", "0.5878841", "0.58698124", "0.5857088", "0.58514...
0.6428431
3
Manage Franchise display and update
async function handleFranchiseName() { if (currGroup !== 0) { // get new franchisee name updated in database let newName = document.getElementById("franchiseeName").value; setFranchiseeName(newName); let backupName = (newName.length === 0) ? "FRANCHISEENAMENOTWANTED" : newName; console...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateDisplay() {\n UserService.getUserInfo().then(function(response) {\n displayLogs();\n })\n }", "function updateUI(){\n\t\t\t\tExt.each(toggleFields, function(fieldName){\n\t\t\t\t\t//var el = form.findField(fieldName).getEl().up('div.x-form-item');\n\t\t\t\t\t//el.setVis...
[ "0.59919775", "0.5969081", "0.5877515", "0.58180755", "0.5757809", "0.5748355", "0.57414955", "0.5658345", "0.56580204", "0.5654866", "0.56493145", "0.5634966", "0.5628041", "0.5627775", "0.56274295", "0.56222284", "0.5598025", "0.5597832", "0.5582104", "0.5564178", "0.555662...
0.5637448
11
Prize count and amount
async function writePrizeCount(count) { let sts = true; try { let myURL = `${process.env.REACT_APP_AXIOS_BASEPATH}/group/updateprizecount/${currGroup}/${localStorage.getItem("uid")}/${count}`; let resp = await axios.get(myURL); // setPrizeCount(count); // await generatePrizeTable(memberC...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ParsePrizePool()\n{\n // get prize array\n // count through each one\n}", "sumIndividualPrize(prizeRequested) {\n let sum = 0;\n if ((prizeRequested != null) && (prizeRequested.length > 0)) {\n prizeRequested.forEach(cr => {\n const idRequested = cr;\n const tempCoverageoR...
[ "0.6699185", "0.66172886", "0.6199797", "0.60788256", "0.60280627", "0.596544", "0.59430754", "0.5934192", "0.5934107", "0.59238344", "0.59236604", "0.58884466", "0.58846873", "0.5862595", "0.57817334", "0.5758412", "0.57524717", "0.5744625", "0.5742861", "0.5728022", "0.5725...
0.0
-1
input string output number create counter for number check each character to see if it is a vowel if character is a vowel, increase counter by 1 return counter
function numVowels(string) { var counter = 0; var newString = string.toUpperCase(); for (var i = 0; i < string.length; i++) { if ((newString[i] === 'A') || (newString[i] === 'E') || (newString[i] === 'I') || (newString[i] === 'O') || (newString[i] === 'U')) { counter++; } }...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function vowelCounter(string) {\n var vowelCount = 0;\n var input = string.toLowerCase();\n //loop throught string as an array\n for (var i=0; i < input.length; i++) {\n if (input[i] === 'a' || input[i] === 'e' || input[i] === 'i' || input[i] === 'o' || input[i] === 'u' ) {\n vowelCount++\n...
[ "0.81602985", "0.80760664", "0.8027288", "0.8016498", "0.7982992", "0.79802465", "0.7978687", "0.79714566", "0.79617983", "0.7957789", "0.7896201", "0.7886203", "0.7883838", "0.7864568", "0.7834019", "0.78236985", "0.7821965", "0.7813585", "0.7777625", "0.7763951", "0.7731768...
0.7905533
10
TODO replace 'expr' objects with 'literals'
function compareOutput(actual, expectedFn) { expectedFn = path.join(__dirname, 'expected', expectedFn); var data = fs.readFileSync(expectedFn); assert.equal(actual, data.toString().trim()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "$literal (obj, expr) {\r\n return expr\r\n }", "function expr(exprStr) {\n return startSymbol + exprStr + endSymbol;\n }", "function expr(exprStr) {\n return startSymbol + exprStr + endSymbol;\n }", "function expr(exprStr) {\n return startSymbol + exprStr + endSymbol;\n }", "fun...
[ "0.7698321", "0.7131559", "0.7131559", "0.7131559", "0.7131559", "0.69846433", "0.677387", "0.6554465", "0.6547778", "0.65259236", "0.64875", "0.64801735", "0.6425958", "0.6389052", "0.63562953", "0.6339318", "0.633737", "0.6303066", "0.62591195", "0.6257285", "0.6253831", ...
0.0
-1
does not mutate the driver and should return a new driver that has an pdated value for the key passed in.
function updateDriverWithKeyAndValue(driver, key, value) { const newObj = { ...driver }; newObj[key] = value; return newObj; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function destructivelyUpdateDriverWithKeyAndValue(driver, key, value) {\n \n driver[key] = value;\n \n return driver; \n}", "function destructivelyUpdateDriverWithKeyAndValue(driver, key, value){\n driver[key] = value;\n\n return driver;\n}", "function destructivelyUpdateDriverWithKeyAndValue(drive...
[ "0.6692181", "0.6653903", "0.66517067", "0.65887225", "0.6239976", "0.6230341", "0.6133015", "0.6087238", "0.60780394", "0.5878581", "0.5863496", "0.5828459", "0.57923806", "0.5780635", "0.5656854", "0.5438821", "0.5398964", "0.53197324", "0.5313778", "0.5311274", "0.52952313...
0.6620931
3
should mutate the driver parameter passed in.
function destructivelyUpdateDriverWithKeyAndValue(driver, key, value) { driver[key] = value; return driver; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function destructivelyUpdateDriverWithKeyAndValue(driver, key, value) {\n driver[key] = value;\n \n return driver;\n }", "function destructivelyUpdateDriverWithKeyAndValue(driver, key, value){\n driver[key] = value;\n\n return driver;\n}", "setDriver(driver, value, report = true, forceReport = false,...
[ "0.63263756", "0.61745363", "0.6037461", "0.60017616", "0.5921033", "0.58398396", "0.5793424", "0.57615423", "0.5746349", "0.5699301", "0.5675725", "0.5635432", "0.5631808", "0.5631808", "0.5595506", "0.5585864", "0.55199385", "0.5504957", "0.55039316", "0.5364369", "0.531225...
0.6260541
1
not mutate the driver passed in. take in a driver Object and a key. It should delete the key/value pair for the key that was passed in from the driver Object.
function deleteFromDriverByKey(driver, key, value){ const newObj = {...driver} delete newObj[key] return newObj }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function destructivelyDeleteFromDriverByKey(driver,key){\n delete driver[key]\n return driver\n}", "function destructivelyDeleteFromDriverByKey (driver, key) {\n delete driver[key];\n return driver;\n }", "function destructivelyDeleteFromDriverByKey(driver, key) {\n delete driver[key];\n \n ret...
[ "0.8621349", "0.8531518", "0.85244477", "0.8435629", "0.8334757", "0.8281884", "0.8271839", "0.8266965", "0.8107762", "0.8099587", "0.80622256", "0.740678", "0.70326823", "0.7021238", "0.6893035", "0.6484425", "0.6376292", "0.6340672", "0.63380104", "0.6331817", "0.62740606",...
0.82652885
8
t should mutate the driver passed in.
function destructivelyDeleteFromDriverByKey(driver, key) { delete driver[key]; return driver; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wi(t) {\n return t.store(ci.store);\n}", "function destructivelyUpdateDriverWithKeyAndValue(driver, key, value) {\n driver[key] = value;\n \n return driver;\n }", "update(t) {}", "function destructivelyUpdateDriverWithKeyAndValue(driver, key, value) {\n \n driver[key] = value;\n \n...
[ "0.5275492", "0.52468586", "0.52410764", "0.5228024", "0.5185016", "0.5136706", "0.51281744", "0.5127777", "0.5018389", "0.49822286", "0.49274042", "0.4925922", "0.49203816", "0.4917172", "0.49098536", "0.49029845", "0.49029845", "0.48250464", "0.4799615", "0.47880092", "0.47...
0.0
-1
Function to display the task list component
function displayTasks() { let height = document.getElementById('tasks').style.height; if (height != '30vh') { document.getElementById('tasks').style.height = '30vh'; } else { document.getElementById('tasks').style.height = '0vh'; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayTasks() {\n // Loop through all tasks in the local array\n for (let task of tasks) {\n // Call helper function to add to UI\n addTaskToDisplay(task);\n }\n}", "function displayTask() {\n if (tasks.length != 0) { \n panel.refreshTask(tasks[0]);\n ...
[ "0.776704", "0.7585536", "0.75113314", "0.7437772", "0.7423137", "0.73635644", "0.73401856", "0.73056215", "0.7233429", "0.7171959", "0.7164609", "0.71311545", "0.70922923", "0.7091223", "0.7079067", "0.70761055", "0.7065924", "0.70474696", "0.70409226", "0.70288235", "0.7019...
0.0
-1
Animation and styling when hovering over the active task
function showDone() { if (currDuration == workingTime) { document.querySelector('.active-task').innerHTML = 'Done'; document.querySelector('.active-task').style.backgroundColor = '#9bd89b'; document.querySelector('.active-task').style.color = 'white'; document.querySelector('.active-task').style.fontW...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ChangeStyle()\n{\n //loop through tasks to change style in finished tasks\n for(let i = 0; i < taskArr.length; i++)\n {\n \n if(taskArr[i].finished === 1) \n {\n document.getElementById('labelTask' + taskArr[i].position).innerHTML = `<s>${taskArr[i].text}</s>`; //strik...
[ "0.6339495", "0.60420936", "0.6003104", "0.58205223", "0.5804756", "0.57494605", "0.5722301", "0.5650614", "0.5641896", "0.56015164", "0.5575062", "0.55512345", "0.55324614", "0.5529126", "0.54950285", "0.5473117", "0.5465666", "0.54627323", "0.54622775", "0.54609865", "0.545...
0.5982807
3
Animation for task list hover
function taskPeak() { let height = document.getElementById('tasks').style.height; if (height == '0vh' || height == '') { document.getElementById('tasks').style.height = '2vh'; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Hover() {\n // loop through every task container and add mouse listner to it to show and hide buttons\n TaskContainer.forEach(container => {\n container.addEventListener('mouseenter', function () {\n if(container.getElementsByClassName('edit-icon')[0].classList.contains('hides')){\...
[ "0.61221486", "0.5818763", "0.5802839", "0.57727545", "0.57703054", "0.5763816", "0.57516074", "0.57294947", "0.5725405", "0.56960046", "0.5687115", "0.5659555", "0.56529754", "0.56442046", "0.5634316", "0.5604019", "0.5572155", "0.5552137", "0.55288965", "0.551988", "0.55121...
0.0
-1
Animation for task list hover
function taskUnpeak() { let height = document.getElementById('tasks').style.height; if (height == '2vh') { document.getElementById('tasks').style.height = '0vh'; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Hover() {\n // loop through every task container and add mouse listner to it to show and hide buttons\n TaskContainer.forEach(container => {\n container.addEventListener('mouseenter', function () {\n if(container.getElementsByClassName('edit-icon')[0].classList.contains('hides')){\...
[ "0.6121761", "0.58194566", "0.58025587", "0.5773587", "0.57710963", "0.5764596", "0.5751042", "0.5730032", "0.5726034", "0.5696455", "0.56866944", "0.5660126", "0.56525785", "0.56453085", "0.5635816", "0.5603586", "0.55714935", "0.555151", "0.55291283", "0.55192035", "0.55123...
0.0
-1
Function for when doneButton is clicked
function doneTask() { if (currDuration == workingTime) { doneClicked = true; skipAdd = true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onDone(event){\n\tconsole.log('done button clicked');\n\tif (validateContents() === true){ \n finishTest();\n }\n\telse {\n\t\trepeatTest();\n\t\treset();\n\t}\n}", "function done() {\n // User is done, remove buttons on the screen\n readNextInput = false;\n layout.RemoveChild(startBu...
[ "0.7658034", "0.73585165", "0.72990024", "0.7243795", "0.7105097", "0.7105097", "0.6853762", "0.6699364", "0.66111684", "0.6602904", "0.65597004", "0.65347135", "0.6497909", "0.6483497", "0.6476779", "0.6427469", "0.6413285", "0.64017546", "0.638548", "0.6371769", "0.6344095"...
0.6802861
7
Function to redirect back to the tasks page
function endSession() { let yesEnd = confirm('Are you sure you want to end the session?'); if (yesEnd) { window.location.href = '../pages/tasks.html'; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function redirectToBack(){\n\t\thistory.go(-1);\n\t}", "switchBackToShopmanagament() {\n window.location.assign(\"#/eventmgmt/shop\")\n }", "function goToTaskForm() {\n window.location.href = TASK_CREATOR + '?id=' + projectID;\n}", "return() {\n this.location.back();\n }", "function go...
[ "0.70868266", "0.69911987", "0.69814146", "0.69498765", "0.68463373", "0.6688831", "0.6682897", "0.66600394", "0.6645264", "0.6592874", "0.658439", "0.65780395", "0.6554378", "0.6554378", "0.6520263", "0.65060663", "0.64871585", "0.64750385", "0.64723486", "0.6452198", "0.643...
0.60822463
75
Function adds 1 to distractions
function distractionButtonFunc() { distractions = distractions + 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function distribution() {}", "function Distribution() {}", "function augmenterMultiplicateur (){\n multiplicateur = multiplicateur + 1;\n }", "function des()\n {\n\treturn (0|(Math.random()*12)+1);\n }", "function addquatity(){\n updateQuantity(quantity + 1);\n }", "function add...
[ "0.66132295", "0.6028516", "0.56793875", "0.5661211", "0.559455", "0.55129576", "0.5511685", "0.5483278", "0.54543155", "0.544421", "0.54313177", "0.5429452", "0.5415667", "0.539896", "0.5398071", "0.5398071", "0.53711534", "0.5366992", "0.5363519", "0.5361196", "0.535374", ...
0.7173387
0
Function displays the analysis modal at the end of the session
function showAnalysis() { var analysis = document.getElementById('analysis'); if (analysis) { analysis.style.display = 'block'; var distractElem = document.getElementById('distractionsAnalysis'); distractElem.innerHTML = `You were distracted a total of ${distractions} times.`; var pomosEstElem = doc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showLastRunDetails() {\n $('#modal-container').html(last_run_details_template(runResults))\n $('#modal-container').modal()\n}", "function showModal(parameters, count) {\n var msg = \"Scraped \" + count + \" \" + parameters.category + \" from \" + parameters.location + \".\";\n\n $('#...
[ "0.6767223", "0.6170127", "0.613676", "0.6071731", "0.6071032", "0.604101", "0.6034274", "0.6032285", "0.6029364", "0.6013705", "0.59811115", "0.5938261", "0.5917117", "0.59162486", "0.5891608", "0.58790654", "0.58757246", "0.5870807", "0.5855462", "0.58456886", "0.5838992", ...
0.64643186
1
Instance of an object that manipulates with elements css class names.
function changeOwletsCssOnClick(){ // for mobile we defined touch events, just like for clicking. owletCssClass.initClass("owlet"); // setting element that has css class name 'owlet' addEvent(owletCssClass.el, "mousedown", owletCssClass.addClass.bind(owletCssClass, "quoteClickRadiate")); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setClass(el, classname) {\n el.className += ' ' + classname;\n }", "_setClassNames() {\n const classNames = ['osjs-window', ...this.attributes.classNames];\n if (this.id) {\n classNames.push(`Window_${this.id}`);\n }\n\n classNames.filter(val => !!val)\n .forEach((val) => this.$element....
[ "0.6787765", "0.65703154", "0.656708", "0.64474034", "0.6427442", "0.6427442", "0.6421779", "0.6421779", "0.6378122", "0.63434774", "0.63281786", "0.61851245", "0.617223", "0.6149746", "0.61419684", "0.61419684", "0.61419684", "0.61419684", "0.610785", "0.60939753", "0.606890...
0.0
-1
when dom ready set click event handler on element with class "owlet". //////// left and right wings animation fix (cross browser)
function removeWingAnimationsOnEnd(){ // Removes css animations we used for owlets wingsFlap, tuckWing // and wingRadiate, after last animation(wingRadiate) in sequence ends. // All in order to correct animation bugs across browsers. ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function changeOwletsCssOnClick(){ // for mobile we defined touch events, just like for clicking.\n \n owletCssClass.initClass(\"owlet\"); // setting element that has css class name 'owlet'\n addEvent(owletCssClass.el, \"mousedown\", owletCssClass.addClass.bind(owletCssClass, \"quoteClickRadiate\...
[ "0.69495505", "0.60834396", "0.60657257", "0.6052225", "0.6039129", "0.5961477", "0.59009504", "0.5861065", "0.58417994", "0.58068806", "0.57490784", "0.57451147", "0.5731393", "0.5706327", "0.5682637", "0.5658545", "0.56425977", "0.5639629", "0.5637799", "0.5620979", "0.5611...
0.0
-1
temporary home page need to figure out loggin in
function Home() { return( <div> <Navbar></Navbar> <h1>temporary homepage</h1> {/* add link to other pages here for now */} <a href="/ticket">ticket</a> <br/> <a href="/enclosure">enclosure</a> <br/> </div> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function homePage(req, res){\n\n var loginCookies = cookieUtils.getLoginCookies(req, res)\n if (loginCookies.uId && loginCookies.uAuth){\n dbLogin(req, res, loginCookies.uId, loginCookies.uAuth, useCookies=true)\n }else{\n console.log(\"Cookie authentication failed: no cookies set\")\n loader.loadHTML(...
[ "0.75189817", "0.7215933", "0.7147686", "0.7129812", "0.69794244", "0.69639605", "0.68965405", "0.6860481", "0.68488556", "0.6819469", "0.6766093", "0.6757718", "0.6736196", "0.67348266", "0.6720503", "0.6697238", "0.6662772", "0.6659701", "0.66381264", "0.66370785", "0.66071...
0.0
-1
Read idea by id
async function get(req, res, next) { try { // gather data const { id } = req.params; // read the idea from database const idea = await models.idea.read(id); if (!idea) return res.status(404).json({ }); // serialize the idea (JSON API) const serializedIdea = serialize.idea(idea); //...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function read(id, cb) {\n const key = ds.key([kind, parseInt(id, 10)]);\n ds.get(key, (err, entity) => {\n cb(null, fromDatastore(entity));\n });\n}", "function findById(id) {\n return fs.readFile(dbPath, \"utf-8\").then((jsonData) => {\n const articles = JSON.parse(jsonData);\n\n const article = ar...
[ "0.6753522", "0.6751767", "0.6716564", "0.6700421", "0.669716", "0.65718687", "0.64882356", "0.626499", "0.6254584", "0.6244254", "0.6220472", "0.62056243", "0.61534154", "0.61452997", "0.61279446", "0.6109645", "0.609104", "0.608054", "0.6078753", "0.6060275", "0.606017", ...
0.6238603
10
Update idea's title or detail PATCH /ideas/:id
async function patch(req, res, next) { try { // gather data const { title, detail } = req.body; const { id } = req.params; const { username } = req.auth; // update idea in database const idea = await models.idea.update(id, { title, detail }, username); // serialize the updated idea (JSON...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "update (context, ideaPersistenceData) {\n return ideaAdapter.updateIdea(ideaPersistenceData)\n }", "function updateIdeaInDB(res, body) {\r\n fs.readFile(path.join(rootPath, 'database', body.user + '.json'), function (err, data) {\r\n if (err) {\r\n console.error(err);\r\n ...
[ "0.6668549", "0.65134555", "0.62737757", "0.6265305", "0.6107493", "0.6079027", "0.6018971", "0.5987656", "0.5981104", "0.5978277", "0.59525603", "0.59373116", "0.5934939", "0.59135634", "0.5912774", "0.5909973", "0.5898673", "0.58857685", "0.58857685", "0.58857685", "0.58857...
0.7337326
0
Check if URL is valid
function validateURL(textval) { // regex modified from https://github.com/jquery-validation/jquery-validation/blob/c1db10a34c0847c28a5bd30e3ee1117e137ca834/src/core.js#L1349 var urlregex = /^(?:(?:(?:https?):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static valid_url(value) {\n if (!value) return false;\n\n // check for illegal characters\n if (/[^a-z0-9:/?#[\\]@!$&'()*+,;=.\\-_~%]/i.test(value)) return false;\n\n // check for hex escapes that aren't complete\n if (/%[^0-9a-f]/i.test(value)) return false;\n if (/%[0-9a-f](:?[^0-9a-f]|$)/i.tes...
[ "0.82721263", "0.8067056", "0.8029412", "0.7987387", "0.7957287", "0.7923352", "0.7919537", "0.7837409", "0.7828997", "0.7828812", "0.782457", "0.78214866", "0.7816898", "0.78137314", "0.7808952", "0.7790165", "0.7780778", "0.7770747", "0.7728861", "0.7716099", "0.77126026", ...
0.73179114
46
Validate form before submitting
function validateForm() { var formValid = checkValidity($('form')) $('.form-control').removeClass('border-danger text-danger'); $('.form-control').each(function() { let inputValid = checkValidity($(this)) if ( ($(this).prop('required') && ($(this).val().length == 0 || $(this).val() == " ")) // test for ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validateForm() {\n\n\tvar valid = true;\n\n\tif (!validateField(\"firstname\"))\n\t\tvalid = false;\n\n\tif (!validateField(\"lastname\"))\n\t\tvalid = false;\n\n\tif (!checkPasswords())\n\t\tvalid = false;\n\n\tif (!checkEmail())\n\t\tvalid = false;\n\n\tif (valid)\n\t\tsubmitForm();\n\n\t// Return false...
[ "0.77934724", "0.761783", "0.7489386", "0.7421923", "0.74112755", "0.7356747", "0.7354874", "0.72598493", "0.72063446", "0.72055304", "0.72020805", "0.7167642", "0.7135257", "0.71290475", "0.71290475", "0.7116345", "0.70991194", "0.7094334", "0.70527667", "0.70527667", "0.701...
0.0
-1
arroz: 1 } var compra2 = compra; compra.arroz = 0;
function compras() { var arroz = 1; this.qualQtdArroz = function() { return 'Comprar ' + arroz + ' arroz!'; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor(alpha) {\n this.alpha = alpha\n this.y = 0\n this.z1 = 0\n }", "rotarx(angulo){\n this.helicoptero.rotar(angulo - this.rotx,[1.0,0.0,0.0]);\n this.rotx = angulo;\n }", "rotarz(angulo){\n this.helicoptero.rotar(angulo - this.rotz,[0.0,0.0,1.0]);\n this.rotz =...
[ "0.6337018", "0.63184816", "0.6301379", "0.6205707", "0.61660457", "0.6013952", "0.5999185", "0.5989006", "0.59366953", "0.59070075", "0.59017533", "0.5878729", "0.58186305", "0.57699245", "0.56584716", "0.56543344", "0.56451625", "0.5636629", "0.5625042", "0.56186223", "0.55...
0.61200887
5
Get all available pages
getFullList() { return new Promise((resolve) => { // get first page to refresh total page count this.getPageData(1).then((firstPage) => { const pages = { 1: firstPage }; // save totalPages as a constant to avoid race condition with pages added during this // process const...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getPages() {\r\n\treturn pages;\r\n}", "function pages() {\n //Return all pages\n // Group into cached and loading (which will include queued and waiting)\n var all = internal.loader.info();\n return all.map(mapInfo);\n\n /** Re...
[ "0.77761155", "0.7343549", "0.6969157", "0.6900134", "0.6792393", "0.6747671", "0.66904056", "0.66111946", "0.6579669", "0.6533255", "0.6515864", "0.65064126", "0.6504768", "0.6435197", "0.6423657", "0.64056605", "0.64013964", "0.6312359", "0.62839836", "0.62796736", "0.62161...
0.6434766
14
Constructor to initialize required Variables and arrays
constructor(){ this.queryArr = []; this.valuesArray = []; this.chunkSize = 10; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor() {\n super();\n this[0] = [0, 0, 0, 0];\n this[1] = [0, 0, 0, 0];\n this[2] = [0, 0, 0, 0];\n this[3] = [0, 0, 0, 0];\n }", "constructor() {\n super();\n this.b_prec = [null];\n this.b_val = [null];\n }", "Initialize(array) {\n this.ref_id_intervenant...
[ "0.686308", "0.64458597", "0.6443457", "0.64344907", "0.6433109", "0.63792527", "0.63658684", "0.6334381", "0.62619346", "0.6244721", "0.6241026", "0.6234789", "0.6229366", "0.62168354", "0.6216243", "0.61994195", "0.61782736", "0.61683834", "0.6154158", "0.615049", "0.614601...
0.0
-1
Function to create queries and fetch values for all keys. Async function/ Entry point from index.js to fetch SSM parameters
async fetchValuesFromAWS(keyArray) { console.log('keyArray:',keyArray); const KEYSARRAYCHUNKS = this.divideKeyArrayToChunks(keyArray); if (KEYSARRAYCHUNKS.length > 0) { let query; for (let arrChunk of KEYSARRAYCHUNKS) { query = { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async queryAllRequests(ctx) {\n const startKey = '';\n const endKey = '';\n const allResults = [];\n for await (const {key, value} of ctx.stub.getStateByRange(startKey, endKey)) {\n const strValue = Buffer.from(value).toString('utf8');\n let record;\n tr...
[ "0.627199", "0.60401064", "0.593327", "0.58922446", "0.5725534", "0.57132864", "0.56623137", "0.56623137", "0.5660975", "0.56475943", "0.56298035", "0.5628175", "0.56239146", "0.56239027", "0.5559397", "0.5546485", "0.55373883", "0.5527661", "0.55016524", "0.5451461", "0.5451...
0.6582101
0
function to initialize scoreboards
function initialiseScoreBoards(){ redScoreBoard.innerText=redWinsCount; yellowScoreBoard.innerText=yellowWinsCount; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initialiseLeaderboard() {\n //playEndSound();\n uploadScore();\n ctx.fillStyle = brandColor;\n ctx.fillRect(0, 0, canvas.width, canvas.height);\n Leaderboard();\n addButton();\n renderLeaderboardButtons();\n addLeaderboardEventListeners();\n getLeaderboard();\n leaderboardIni...
[ "0.7189419", "0.70785755", "0.70647883", "0.69933766", "0.6943253", "0.6917412", "0.68597347", "0.6831307", "0.6748004", "0.67064095", "0.6688837", "0.66829145", "0.6659814", "0.66550714", "0.66456145", "0.6641267", "0.6640087", "0.6634823", "0.66318315", "0.6629889", "0.6591...
0.6871183
6
function to start game only if stopGame is false
function startGame(){ if(stopGame===false){ setTimeout(playGame, 2000); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startGame () {\n\tplay = true;\n\n}", "function startGame() { }", "function restartGame() {\n\tstart = false;\n}", "continueGame () {\n if (this.pauseTimer > 0) return\n if (this.lives > 0) {\n this.startGame(false)\n }\n }", "function stop() {\n pausedGame = true;\n}", "function...
[ "0.7713725", "0.76381046", "0.75018716", "0.7480938", "0.74064994", "0.73506117", "0.7338656", "0.7290424", "0.7271796", "0.725853", "0.725559", "0.7212132", "0.7210515", "0.71798503", "0.71777344", "0.71697575", "0.71655124", "0.7158134", "0.7156732", "0.71527904", "0.713355...
0.79683065
0
function to play game
function playGame(){ console.log(stopGame); if(!stopGame){ changeMessageBoardBG(turn); setCirclesClass(turn); setCountdownTimer(); let circles=$GEBC('.circle'); for(let i=0; i < circles.length; i++){ console.log("click circle"); ci...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function playGame() {\n}", "function playGame(){\n createTimer();\n juego.resetScore();\n juego.resetCorrectLabel();\n juego.setStatePlaying(true);\n disablePlayButton();\n juego.updateExpression();\n enableSendResultButton();\n resetClasses();\n}", "function startGame() { }", "functi...
[ "0.83203924", "0.79455334", "0.78212255", "0.7580432", "0.7563668", "0.7557874", "0.74857503", "0.74506015", "0.74262476", "0.7425455", "0.74110943", "0.7399363", "0.7370334", "0.73630106", "0.73519623", "0.7338708", "0.73357373", "0.733374", "0.73096853", "0.730549", "0.7304...
0.0
-1
function to handle click event
function clickHandler(e, i){ e.preventDefault(); stopTimer(); let colIndex=i;//variable to denote column number clicked let dots=$GEBC('.dot'); //grabbing all dots of board for(let i=5; i >= 0; i--){ let index=i*7+colIndex; if(dots[index].classList.contains('blank...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handleClick( event ){ }", "handleClick() {}", "function handleClick(event)\n{\n}", "function handleClick() {\n\t\t window.ctaClick();\n\t\t}", "function handleClick() {\n\t\t window.ctaClick();\n\t\t}", "function handleClick(){\n console.log(\"clicked\");\n}", "function _click(d){\n \n }...
[ "0.805572", "0.7860582", "0.7804375", "0.75570416", "0.75570416", "0.7346251", "0.73334736", "0.7289743", "0.7260275", "0.7260129", "0.72569406", "0.7232381", "0.7218854", "0.71409994", "0.71099675", "0.70749515", "0.70726925", "0.7053734", "0.7040546", "0.70084417", "0.69941...
0.0
-1
function to display time countdown
function displayTime(){ let timeDisplayBoard=$QS('.time-display-board'); if(count <= 0){ stopTimer(); timeDisplayBoard.innerText=`${count} S`; } else { if(stopGame){ let btn=$CESC('button', 'play-again-btn'); btn.innerText="Play Again"; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showCountdown(){\n seconds--;\n \n if(seconds < 10) {\n $(\"#timeLeft\").html(\"00:0\" + seconds);\t\n } else {\n $(\"#timeLeft\").html(\"00:\" + seconds);\t\n }\n \n if(seconds < 1){\n clearI...
[ "0.78179914", "0.7802402", "0.76580215", "0.7651451", "0.7651193", "0.75611377", "0.75535446", "0.7541463", "0.7536088", "0.7525377", "0.7516622", "0.74882454", "0.7479807", "0.7471482", "0.7443893", "0.7435176", "0.74249446", "0.74025387", "0.73682237", "0.734947", "0.730204...
0.7153923
45
functions to check Game is won by anyone / if not to continue / if yes 1. stop timer, 2. show message modal , 3. disable clicks 4. show winner score function to check game stop or continue
function checkGame(stopFlag, t){ let player=t==='red' ? 'Player-1' : 'Player-2'; if(stopFlag){ stopTimer(); showWinMessage(player); gameCount++; turn= gameCount % 2 === 0 ? 'red' : 'yellow'; playGame(); } else { playGame(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "checkIfWon() {\n let func = () => {\n this.reset();\n }\n if (this.y < 0) {\n this.gameWon = true;\n document.querySelector('.modal').style.display = 'block';\n document.querySelector('.modal-wnd').style.display = 'block';\n document.getElementById('replay-btn').addEventListener('...
[ "0.7596018", "0.7586664", "0.75698924", "0.75398374", "0.750892", "0.7502287", "0.749238", "0.7468755", "0.7452566", "0.7448063", "0.74386674", "0.7427169", "0.7390028", "0.73888475", "0.73733854", "0.73187387", "0.73086655", "0.7281633", "0.7281587", "0.7279683", "0.72538024...
0.0
-1
function to stop timer when game is stopped or count down comes to 0
function stopTimer(){ clearTimeout(setCountdownTimer); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function timer(){\n countStartGame -= 1;\n console.log(countStartGame);\n if (countStartGame === 0){\n console.log (\"time's up\");\n //need to clear interval - add stop\n }\n}", "function countDown() {\n seconds -= 1;\n\n if (seconds < 0 && minutes > 0) {\n seconds += 60;\n ...
[ "0.8323808", "0.8031028", "0.79394895", "0.7865604", "0.7823604", "0.7815408", "0.7789204", "0.7769273", "0.7769242", "0.77671796", "0.77627075", "0.7761344", "0.77518535", "0.7730891", "0.77253205", "0.7710859", "0.77082914", "0.76689774", "0.7666173", "0.76625526", "0.76471...
0.7598051
26
function to display modal of Game stop message
function showModal(){ gamePaused=true; let container=$QS('.gameDisplayDiv'); let modal=$CESC('div', 'msg-modal'); let h2=$CESC('h2', 'modal-heading'); h2.innerText='pause'; //continue game , restart, quit game let continueBtn=$CESC('button', 'modal-btn continue-btn'); continueBtn.in...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onStopGameMessage(message) {\n\n }", "function endGame() {\n stopMusic();\n win.play();\n modal.style.display = \"block\";\n modalContent.innerHTML = `<h1 class=\"centered\">Congratulation!</h1><h3 class=\"centered\">You have completed the game!</h3><h3 class=\"centered\">Points scored: ${player....
[ "0.7148854", "0.69004875", "0.6757758", "0.67296714", "0.66798586", "0.6671921", "0.6666986", "0.66633356", "0.6654516", "0.6654199", "0.66423464", "0.661991", "0.6611241", "0.658398", "0.6541963", "0.6541059", "0.65379846", "0.65377635", "0.65280795", "0.6526195", "0.6513595...
0.6073249
99
function to display score of winner
function displayScore(){ if(turn==='red'){ redWinsCount++; redScoreBoard.innerText=redWinsCount; } else if(turn==='yellow'){ yellowWinsCount++; yellowScoreBoard.innerText=yellowWinsCount; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function score(winner) {\n if (winner === \"win\") {\n userScore++;\n console.log(\n `The score is Player: ${userScore} vs Computer ${computerScore}`\n );\n } else if (winner === \"lose\") {\n computerScore++;\n console.log(\n `The score is Player: ${userScore} vs Computer ${computerScor...
[ "0.81960183", "0.78193116", "0.7785972", "0.7730311", "0.77075785", "0.76568896", "0.7654341", "0.761772", "0.7598345", "0.75756866", "0.75537455", "0.7551384", "0.7550388", "0.7515461", "0.75072163", "0.7503372", "0.7489059", "0.74720263", "0.7463815", "0.7453451", "0.743622...
0.72450805
48
When Game is reset clicking reset or restart button function to continue geme
function continueGame(){ removeModal(); if(stopGame){ addCirclesToHoverBar(); //clearing all dots of game board clearGameBoard(); clearMessageBoard(); changeMessageBoardBG("none"); stopGame=false; count=30; startGame(); } if(gamePaus...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function actionOnResetClick () {\n gameRestart();\n }", "function restart(){\n myGameArea.reset();\n}", "function restartButton(k) {\n resetGame(k);\n }", "function restartGame()\n{\n\tSnake.reset();\n\tMouse.changeLocation();\n\tScoreboard.reset();\n\t\n\tenterState(\"countd...
[ "0.8424266", "0.78593314", "0.7804992", "0.7534082", "0.7513511", "0.74949354", "0.7490809", "0.7466991", "0.74666476", "0.7460582", "0.74289846", "0.74152744", "0.7405922", "0.73950064", "0.7383956", "0.737119", "0.7344536", "0.7338957", "0.73202515", "0.73028", "0.7296842",...
0.74806494
7
function to reset game
function resetGame(){ console.log(gamePaused); gamePaused=false; console.log(gamePaused); if(!gamePaused && !stopGame){ removeModal(); playGame(); } else{ removeModal(); addCirclesToHoverBar(); //clearing all dots of game board clearGameBoard();...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resetGame() {\n resetClockAndTime();\n resetMoves(); \n resetRatings();\n startGame();\n}", "function resetGame() {\n resetClockAndTime();\n resetMoves();\n resetStars();\n initGame();\n activateCards();\n startGame();\n}", "function reset() {\n //Reset the game\n c...
[ "0.8925137", "0.8868678", "0.8839611", "0.88265324", "0.87974507", "0.87514013", "0.8715469", "0.8713044", "0.8680245", "0.8623561", "0.8620319", "0.8616942", "0.85936975", "0.8580226", "0.8546222", "0.85140723", "0.85026693", "0.84723043", "0.84667", "0.8462359", "0.8455414"...
0.8181182
61
function to go to home page
function goToHomePage(){ window.location.href='./index.html'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function returnToHome(){\n\t\n}", "function goHome() {\n if (!isLoggedIn()) {\n return;\n }\n var home = '../personal/courses.html';\n window.location.assign(home);\n}", "function navigateToHome() {\n \twindow.location = \"/\";\n }", "function navigateToHome() {\n\t\t\twindow.location = \"/\";\n...
[ "0.7998372", "0.7879667", "0.78213966", "0.77909243", "0.7776929", "0.7723353", "0.76550305", "0.7626117", "0.7620382", "0.76113653", "0.7605658", "0.7548369", "0.7537111", "0.74890614", "0.74129784", "0.7386292", "0.7339281", "0.7338297", "0.73245275", "0.7275328", "0.725110...
0.7630557
7
function to show win message
function showWinMessage(player){ let playerName=$QS('.player-name'); let winMsgDiv=$QS('.win-msg-div'); playerName.innerText=player; winMsgDiv.innerText='Wins'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayWin() {\n $(\"#winner-message\").show();\n }", "function ShowMessage( _msg, _ok ) {\r\n var width = 300;\r\n var height = 120;\r\n var left = (window.outerWidth - width) / 2;\r\n var top = (window.outerHeight - height) / 2;\r\n var MsgWin = window.open(\"\", \"MSGWIN\", \"left=\"...
[ "0.7605373", "0.7476001", "0.72526807", "0.7231889", "0.71607304", "0.7146281", "0.71103865", "0.7083119", "0.70468307", "0.70447814", "0.7034093", "0.6896304", "0.6885838", "0.6808383", "0.67339015", "0.67061836", "0.6701926", "0.66962653", "0.6692943", "0.66543555", "0.6653...
0.6771934
14
========================================================================================= ================================== HELPER FUNCTIONS ===================================== =========================================================================================
function validate_session(req, res, next) { req.session = Util.get_session(req); if (req.session == undefined) return Util.session_error(req, res); next(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function DWRUtil() { }", "private public function m246() {}", "private internal function m248() {}", "protected internal function m252() {}", "function Utils() {}", "function Utils() {}", "transient private protected internal function m182() {}", "function Helper() {}", "function Utils(){}", "fun...
[ "0.6214703", "0.6107279", "0.6063505", "0.6007048", "0.5926388", "0.5926388", "0.577657", "0.5699383", "0.5697286", "0.5696301", "0.56733227", "0.5632669", "0.55550146", "0.5498294", "0.54927135", "0.548587", "0.547219", "0.54659355", "0.5457983", "0.5434144", "0.533946", "...
0.0
-1
gets round a deprecation without having to change the odata addin
query(store, type, query) { return this.findQuery(store, type, query); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get deprecated() {\n return false;\n }", "_mapDeprecatedFunctionality(){\n\t\t//all previously deprecated functionality removed in the 5.0 release\n\t}", "function depd(namespace){if(!namespace){throw new TypeError('argument namespace is required');}function deprecate(message){// no-op in browser\n}d...
[ "0.6715851", "0.66242397", "0.632622", "0.6126858", "0.6097917", "0.59899664", "0.59706295", "0.594865", "0.5934005", "0.5934005", "0.5927457", "0.5842993", "0.5842993", "0.5835382", "0.5835382", "0.583491", "0.5706166", "0.5706166", "0.5698918", "0.56739336", "0.56735367", ...
0.0
-1
Write a function cakes(), which takes the recipe (object) and the available ingredients (also an object) and returns the maximum number of cakes Pete can bake (integer). For simplicity there are no units for the amounts (e.g. 1 lb of flour or 200 g of sugar are simply 1 or 200). Ingredients that are not present in the ...
function cakes(recipe, available) { const numCakes = []; for(let key in recipe) { if(key in available) { numCakes.push(Math.floor(available[key]/recipe[key])) } else { return 0; } } return Math.min(...numCakes) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cakes(recipe, available) {\n let numCakesPerIngredient = {}\n for(let ingredient in recipe) {\n // If we don't have this ingredient, we can't make any cakes.\n if(!available.hasOwnProperty(ingredient)) {\n return 0;\n }\n\n // We have the ingredient and find out how many cakes we can ma...
[ "0.78966606", "0.70031714", "0.67391306", "0.6688384", "0.6279195", "0.6108461", "0.5717964", "0.5668199", "0.56306696", "0.5619878", "0.55454755", "0.5489386", "0.54656285", "0.52867377", "0.524506", "0.5211594", "0.51927793", "0.5179416", "0.51689297", "0.5153003", "0.50881...
0.6991665
2
Funcion: Para crear una template donde va a mostrar los datos que se ha almacenado en la BD datos como nombre telefono y id o insertarlos dinamicamente se recarga sola la pagina sin recargar e ir a otra
function construirTemplate(nombre, numero, registro_id){ //MANIPULANDO EL DOM para crear un formulario sin necesidad de etiquetas html //crear Nombre de contacto var tdNombre = document.createElement('TD'); var textoNombre = document.createTextNode(nombre); var parrafoNombre = document.createEleme...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function template_buscar_transaccion(transaccion) {\n\tvar indexTransaccion = -1\n\tvar arrayTipoInmueble = Array(\"template_renta_tipoInmueble\", \"template_venta_tipoInmueble\", \"template_rentaVac_tipoInmueble\");\n\tvar arrayEstados = Array(\"template_renta_estado\", \"template_venta_estado\", \"template_renta...
[ "0.68311167", "0.67837065", "0.67831945", "0.6757393", "0.6588948", "0.6573392", "0.64675474", "0.6459371", "0.6443944", "0.6419311", "0.6418114", "0.6375803", "0.6361402", "0.634337", "0.6323008", "0.6308788", "0.6302122", "0.6293883", "0.6285054", "0.6273442", "0.6260772", ...
0.7548068
0
2. selecciona los checkboxes seleccionado y se guardar en el arreglo
function checkboxSeleccionados(){ var contactos = []; for(var i = 0; i < checkboxes.length; i++){//for para rellenar el array if(checkboxes[i].checked == true){ //establece el estado marcado de una casilla de verificación //agregando los check seleccionados con su respectivo id al array contactos.pu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function excluyentes(seleccionado) {\n programador_web.checked = false; \n logistica.checked = false;\n peon.checked = false;\n \n seleccionado.checked = true; \n}", "handleCheckboxes(){\n\n for(let cb of this.checkboxes){\n\n if(cb.selected){\n cb.eleme...
[ "0.7414488", "0.71133614", "0.7111248", "0.70059663", "0.6934895", "0.6926487", "0.67845947", "0.67671645", "0.66830575", "0.6678835", "0.6677688", "0.6650872", "0.66195244", "0.65856", "0.65637", "0.6561076", "0.6561", "0.65520066", "0.65425754", "0.6515633", "0.6481957", ...
0.71544015
1
3. Creando la funcion contactos eliminar con un repectivo parametro u argumento de entrada en este caso son los contactos a eliminar creando encabezados por metod httprequest o post o get
function contactosEliminar(contactos){ //creando el DOM o AJAx var xhr = new XMLHttpRequest(); xhr.open('GET','eliminar.php?id=' + contactos, true); console.log('eliminar.php?id=' + contactos); xhr.setRequestHeader('X-Requested-With','XMLHttpRequest'); xhr.onreadystatechange = function(){ if(xhr.readySt...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Delete(uri, id) {\n\n //COMIENZO DE LA PETICION AJAX PARA ELIMINAR REGISTRO\n $.ajax({\n type: \"POST\", //TIPO DE ACCION\n url: uri,//ACCION O METODO A REALIZAR\n data: { \"id\": id }, //SERIALIZACION DE LOS DATOS A ENVIAR\n success: function (data) {\n if (da...
[ "0.68877524", "0.6841788", "0.67438173", "0.6724912", "0.67055094", "0.66813684", "0.6608119", "0.6601557", "0.65571636", "0.6551676", "0.65463877", "0.6541227", "0.6528961", "0.6520138", "0.65025246", "0.64966065", "0.648819", "0.64838815", "0.6459486", "0.6459177", "0.64368...
0.6724302
4
creando funcion para actualizar numero de personas registradas
function actualizarNumero(){ var registros = tableBody[0].getElementsByTagName('tr'); var cantidad = 0; var ocultar = 0; for (var i = 0; i < registros.length; i++) { var elementos = registros[i]; if (elementos.style.display == 'table-row') { cantidad++; totalRegistros.innerHTML = cantidad;...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function intName() {\n numEquipos = document.getElementById(\"numEquipos\");\n numPersonas = document.getElementById(\"numPersonas\");\n\n if(parseInt(numEquipos.value) <= 0) {\n alert(\"Asegurate de crear al menos un equipo.\");\n return;\n }\n\n if(parseInt(numPersonas.value) <= 0) {...
[ "0.5974597", "0.59243125", "0.5921465", "0.59042317", "0.58574104", "0.58322495", "0.58227235", "0.5796132", "0.57886165", "0.577128", "0.57641274", "0.5759008", "0.57548475", "0.5732454", "0.5726261", "0.57086366", "0.56920457", "0.5652268", "0.56233", "0.5602361", "0.560063...
0.0
-1
Creando Funcion editar contactos recorriendo botones con clases editarBtn
function botonEditarContacto(){ var btn_editar = tableBody[0].querySelectorAll('.editarBtn'); for (var i = 0; i < btn_editar.length; i++) { btn_editar[i].addEventListener('click', function(){ //desabilitar los demas campos cuando se requiera de editar uno desabilitarEdicion(); //ir de un hij...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Editar(pos){\r\n var Placa = document.getElementById(\"placa\");\r\n var Color = document.getElementById(\"color\");\r\n var Ano = document.getElementById(\"ano\");\r\n var Capacidad = document.getElementById(\"capacidad\");\r\n var Cilindraje= document.getElementById(\"cilind...
[ "0.6915935", "0.67938983", "0.6742497", "0.66856843", "0.66317064", "0.6573674", "0.6491856", "0.6480466", "0.63693714", "0.63632613", "0.6308224", "0.628688", "0.6283186", "0.62592554", "0.6253137", "0.625057", "0.6226529", "0.6220884", "0.6206988", "0.6198514", "0.6188966",...
0.74162006
0
Boton guardar contacto cuando se agrega un nuevo contacto
function botonGuardarContacto(id){ var btn_guardar = tableBody[0].querySelectorAll('.guardarBtn'); for(i = 0 ; i < btn_guardar.length; i++){ btn_guardar[i].addEventListener('click' , function(){ actualizarRegistro(id); }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function guardarContacto() {\r\n if (nuevo) {\r\n\r\n //Valores nuevos para guardar un nuevo contacto.\r\n nuevoNombre = document.getElementById('nombre').value;\r\n nuevoApellidos = document.getElementById('apellidos').value;\r\n nuevoTelefono = document.getElementById('telefono').v...
[ "0.7467643", "0.7191442", "0.7146774", "0.6713893", "0.6646413", "0.6552226", "0.6308416", "0.6237244", "0.6233249", "0.6221186", "0.6210521", "0.6197976", "0.61421674", "0.6105318", "0.60865647", "0.6011071", "0.5993117", "0.5984469", "0.5961551", "0.5949022", "0.59451956", ...
0.5737852
39
calculate size of file given its size in bytes
function calc_size(bsize) { var defs = ['B', 'KB', 'MB', 'GB', 'TB', 'PB']; var counter = 0; while(bsize > 1024) { bsize /= 1024; counter++; } console.log((Math.round(bsize * 100) / 100) + defs[counter]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getFilesizeInBytes(filename) {\n var stats = fs.statSync(filename)\n var fileSizeInBytes = stats[\"size\"]\n return fileSizeInBytes\n}", "function getFileSizeBytes(filepath){\n\tvar stats = fs.statSync(filepath);\n\treturn stats[\"size\"];\n}", "function getFileSizeInBytes(filename) {\n var stats = f...
[ "0.77511716", "0.75693727", "0.74258494", "0.73872375", "0.732108", "0.7293988", "0.7280568", "0.71915", "0.71111697", "0.7099693", "0.70001864", "0.6936076", "0.6917658", "0.69035375", "0.6800213", "0.67426586", "0.67222476", "0.66998965", "0.6537162", "0.642786", "0.641487"...
0.56049466
59
inherits the posts to show from the TabContainer.jsx
constructor(props) { super(props); this.state = { hasFetched: false, listOfPosts: [] }; this.removeOnePost = firebase.functions().httpsCallable("removeOnePost"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "render() {\n const username = this.props.username;\n const response = this.state.response;\n const onePost = this.state.onePost;\n var array = [];\n if (onePost){\n array.push(response.posts[Object.keys(response.posts)[0]]);\n }\n const posts = onePost ? ...
[ "0.6326194", "0.61536175", "0.6001829", "0.5968407", "0.58754194", "0.58410436", "0.5836392", "0.5830682", "0.5829328", "0.57906157", "0.5787371", "0.5779322", "0.5729084", "0.5713543", "0.57107884", "0.57034767", "0.5679895", "0.5675434", "0.56700885", "0.565692", "0.5630831...
0.0
-1
FINAL DEL DOCUMENT READY FUNCIONES ESPECIALES
function selectorOrganismo() { $('#ente').autocomplete({ minLength:1, //le indicamos que busque a partir de haber escrito dos o mas caracteres en el input delay:1, position:{my: "left top", at: "left bottom", collision: "none"}, source: function(request, response) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clean(){\n\t\twrench.rmdirRecursive( __dirname + '/docs/', function(){\n\t\t\tmsg('docs deleted');\n\t\t});\n\t}", "function borradoElemento () {\n\t/*\n\tinit_listener_file_upload();\n\t$(\".combo_tipo_doc\").val(\"\");\n\tfileUploadPreview ();\n\t\n\t\n\t\tcloseFancy();\n\t\n\t*/\n}", "static deldoc...
[ "0.6335438", "0.6146016", "0.6104337", "0.6092684", "0.60010326", "0.5903932", "0.5894285", "0.58845717", "0.58707035", "0.5862939", "0.58394873", "0.5833691", "0.58146816", "0.57952017", "0.57606626", "0.5753516", "0.57365686", "0.5725002", "0.57162076", "0.5652241", "0.5648...
0.0
-1
VERIFICAMOS QUE LA CORRESPONDENCIA NO ESTE REPETIDA
function BuscarCorrespondencia(entrante) { if (verificarFormulario()===false) { var Mensaje='Debe llenar los campos necesarios de manera correcta para poder registrar.'; CajaDialogo("Alerta", Mensaje); return false; } entrante=(entrante==='entrante')?'t':'f'; $.ajax({ type:'POST'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function verRepeticion(cadena) {\n cargarCadenaMovimientos(cadena);\n // Muestro el primer movimiento de la partida\n crearEventosMovRepeticion();\n cargarTablero(1);\n estilosMovActualRep(0);\n}", "function prikaziRezultat(){\r\n // na samom pocetku nije imao tacnih odgovora\r\n let brTacnih = ...
[ "0.66377115", "0.6026346", "0.5995619", "0.58914024", "0.5862017", "0.5861783", "0.58542275", "0.58516926", "0.5807159", "0.5776494", "0.5756482", "0.5756153", "0.5753843", "0.57445127", "0.5736915", "0.5708732", "0.5704579", "0.5696492", "0.56926197", "0.5690136", "0.5686223...
0.0
-1
identical to embercli/lib/models/addon.js's `_findHost` / used instead of breaking backwards compat. w/ older versions of cli
function findHost(addon) { var current = addon; var app; do { app = current.app || app; } while (current.parent.parent && (current = current.parent)); return app; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getHost() {\n let host = super.getAsNullableString(\"host\");\n host = host || super.getAsNullableString(\"ip\");\n return host;\n }", "_findHost() {\n let current = this;\n let app;\n\n // Keep iterating upward until we don't have a grandparent.\n // Has to do this grandparen...
[ "0.594034", "0.59276956", "0.59263796", "0.5865011", "0.5858375", "0.57286286", "0.5606085", "0.5606085", "0.5568873", "0.5508191", "0.54923254", "0.54365236", "0.5383245", "0.5356415", "0.53540707", "0.5349378", "0.53424865", "0.5322376", "0.5289775", "0.5284324", "0.5282823...
0.63231647
0
logger.info('I will be logged in allthelogs.log');
function PrintLog(a) { logger.info(a); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function log() {\n //log here\n }", "function logSomething(log) { log.info('something'); }", "function log(){\n console.log('logging');\n}", "function logger() {\n console.log('logger');\n\n}", "function logger(){\n console.log(\"you logged in\");\n}", "function logger() {}", "log() {}",...
[ "0.7380931", "0.73307496", "0.73228246", "0.7322594", "0.72263914", "0.7108291", "0.70890534", "0.7071065", "0.7052821", "0.7038859", "0.7021677", "0.7005486", "0.6912518", "0.68856585", "0.68810296", "0.6864176", "0.68452895", "0.6833887", "0.6802939", "0.66939825", "0.66698...
0.71808624
5
Cache data, make preparations and initialize common scripts.
constructor() { this.init(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initData(){\n dynarexDataIsland.init();\n loadFunctionTimes();\n setEventListener();\n}", "function preload() {\n\tclickablesManager = new ClickableManager('data/clickableLayout.csv');\n\tadventureManager = new AdventureManager('data/adventureStates.csv', 'data/interactionTable.csv', 'data/clickableL...
[ "0.6515674", "0.64769197", "0.644164", "0.6389205", "0.63734007", "0.6330773", "0.62608975", "0.62535554", "0.6234752", "0.6185967", "0.61771685", "0.61272", "0.6080968", "0.60731137", "0.60542667", "0.60260946", "0.60182506", "0.59435505", "0.5931191", "0.5926486", "0.592440...
0.0
-1
called when mytweets entered in command line to fetch last 20 tweets
function getTweets(){ var client = new Twitter({ consumer_key: keys.consumer_key, consumer_secret: keys.consumer_secret, access_token_key: keys.access_token_key, access_token_secret: keys.access_token_secret }); var params = {screen_name: 'LearningNPM', limit:20}; client.get('statuses/user_timeline',...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function twitter(){\n//This will show your last 20 tweets and when they were created at in your terminal/bash window//\n }", "function twitter() {\n var client = new Twitter(keys.twitter);\n var params = { screen_name: \"feartheturtle88\" };\n client.get(\"statuses/user_timeline\", params, function(\n erro...
[ "0.7513124", "0.74466985", "0.7281257", "0.7254597", "0.72514516", "0.7250744", "0.7231134", "0.7210018", "0.7193096", "0.7124004", "0.70886105", "0.7066069", "0.7053848", "0.7033079", "0.7029957", "0.7021611", "0.70113003", "0.70098245", "0.6998422", "0.69917536", "0.698477"...
0.68473333
30
! Pako Deflate (The MIT License) Copyright (C) 2014 by Vitaly Puzrin
function aI(dI){var dH,dF;if(dI){dH=self;dH.options=dF=dI.data;dH.WRCp=dH.WRCp||dG}function dG(dM,dR){(function(dT){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=dT()}else{if(typeof pakoDefine==="function"&&pakoDefine.amd){pakoDefine([],dT)}else{var dS;if(typeof window!=="undefined"){dS=wind...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function al(df){var de,dd;if(df){de=self;de.options=dd=df.data;de.WRCt=de.WRCt||dc}function dc(dj,dp){(function(dr){if(typeof exports===\"object\"&&typeof module!==\"undefined\"){module.exports=dr()}else{if(typeof pakoDefine===\"function\"&&pakoDefine.amd){pakoDefine([],dr)}else{var dq;if(typeof window!==\"undefin...
[ "0.6049781", "0.5990904", "0.54003316", "0.53884053", "0.53474885", "0.53117466", "0.53015393", "0.52280253", "0.5223539", "0.5209798", "0.5205599", "0.5165949", "0.513446", "0.51037014", "0.50952387", "0.50804996", "0.5017297", "0.5013385", "0.500667", "0.4997991", "0.499580...
0.60268986
1
Login to your Account
async function login(usernameLoginX, passwordLoginX) { const result = await fetch(endPointRoot + "/users/?usernameLogin=" + usernameLoginX) .then((res) => { if (res.ok) { return res.json(); } }) .then((res) => { if (passwordLoginX == res[0].passwordLogin) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function login() {\n User.login(self.user, handleLogin);\n }", "function login() {\n // We give username and password to log the user in\n // In case there is something wrong with the credentials\n // we use the setError to display it\n // If the user logs in successfully then the loginCallback i...
[ "0.78161836", "0.7511041", "0.74480087", "0.73538077", "0.7218957", "0.72063786", "0.7201331", "0.720077", "0.7196676", "0.7191659", "0.71779007", "0.7095403", "0.7091027", "0.7084139", "0.7082596", "0.7065975", "0.70416576", "0.7030689", "0.70204866", "0.7004626", "0.6975381...
0.0
-1
dateVal is a number like 20160212
function getDateAsString(dateVal) { if (dateVal) { var dateAsYYYYMMDD = dateVal.toString(), year = dateAsYYYYMMDD.substr(2, 2), month = dateAsYYYYMMDD.substr(4, 2), day = dateAsYYYYMMDD.substr(6, 2); return month + '/' + day + '/' + year; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkDateLen(val){\n if(val < 10)\n val = \"0\" + val;\n return val;\n}", "function setDate(number){\n if((number < 0) && (curr.month === 0)){\n curr.month = 11;\n curr.year--;\n }else if((number > 0) && (curr.month === 11)){\n curr.month = 0;\n curr.year++;\n ...
[ "0.64846164", "0.64566195", "0.6312637", "0.6296956", "0.6296956", "0.62340415", "0.61317116", "0.61030847", "0.60593694", "0.60565287", "0.60345566", "0.60296845", "0.60280395", "0.60133886", "0.5991949", "0.5991949", "0.5991949", "0.59776115", "0.59724057", "0.5967559", "0....
0.59721
19
date is a Date object
function getDateAsNumber(date) { const year = date.getFullYear(), month = date.getMonth() + 1, // getMonth() is zero-based day = date.getDate(), asString = '' + year + (month > 9 ? '': 0) + month + (day > 9 ? '': 0) + day; return parseInt(asString); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isDate(date) {\n return (date && date.getDate) ? date : false;\n }", "function isDate(date) {\n\treturn Object.prototype.toString.call(date) === \"[object Date]\";\n}", "function isDate(date) {\n\treturn Object.prototype.toString.call(date) === \"[object Date]\";\n}", "func...
[ "0.84142375", "0.77951604", "0.77951604", "0.77951604", "0.7494593", "0.7494515", "0.73837477", "0.7376617", "0.7371681", "0.73674357", "0.7286146", "0.7197669", "0.71888113", "0.7096602", "0.7093078", "0.7076825", "0.7040795", "0.7040795", "0.7040795", "0.7040795", "0.704079...
0.0
-1
Get the implementation for the entity.
getEntity() {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_getImplementation(entity) {\n return this.implementations[entity.collision.data.type];\n }", "entity() {\n return internal(this).entity;\n }", "get entity() {\n return this.__entityRepository.getEntity(this.__entityUid);\n }", "get(type, entity) {\n if (this.has(type, ...
[ "0.7514716", "0.6371969", "0.6367544", "0.5846419", "0.58428633", "0.575994", "0.56598264", "0.5566316", "0.5523109", "0.55023783", "0.52888006", "0.5266645", "0.51870465", "0.51436096", "0.5092015", "0.50771016", "0.5076623", "0.49754357", "0.49727228", "0.49701905", "0.4961...
0.5889326
3
The map has been loaded.
_mapLoaded(map) { // Notify the subclass the map has been loaded. this.didLoadMap(map); // Instruct the subclass to create its entity. We will then show the entity. const entity = this.createEntity(); this._showEntity(entity); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isMapLoaded() {\n if (!mapReceived) {\n currentNode.trigger('onMapRequested', eventName);\n }\n return mapReceived;\n }", "handleMapLoad(map) {\n }", "handleMapLoad...
[ "0.7533985", "0.7459703", "0.7360385", "0.729261", "0.72855926", "0.718857", "0.7126798", "0.7048372", "0.70037764", "0.69773567", "0.6975012", "0.6975012", "0.6951325", "0.68815154", "0.68734574", "0.6870107", "0.67979866", "0.6793164", "0.6777804", "0.6753791", "0.66944504"...
0.7207509
5
Either show or hide the entity.
_showEntity(entity) { if (isPresent(entity)) { const show = this.show === undefined ? true : this.show; const map = this.map; if (show) { entity.setMap(map); } else { entity.setMap(null); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "toggle() {\n\t\tif (this.isVisible) {\n\t\t\tthis.display();\n\t\t} else {\n\t\t\tthis.hide();\n\t\t}\n\t}", "function showEntity(entity) { //Updates entity UI\n $('#' + entity.id + '-hire').attr('disabled', !Game.canHire(entity));\n $('#' + entity.id + '-name').text(entity.name);\n $('#' + entity.id + ...
[ "0.67517745", "0.66957843", "0.664538", "0.6600586", "0.65531766", "0.6504778", "0.640902", "0.63497245", "0.6329681", "0.6296343", "0.62585646", "0.62379813", "0.61363274", "0.61123896", "0.6107176", "0.61056316", "0.60213506", "0.6019899", "0.6011181", "0.6002907", "0.59985...
0.7232424
0
! Complete the miniMaxSum function below.
function miniMaxSum(arr) { const sorted = arr.sort(); let max = 0; for (let i = 0; i <= array.length - 1; i++) { max += sorted[i]; } let withoutLast = max - sorted[sorted.length - 1]; let withoutFirst = max - sorted[0]; return `${withoutLast} ${withoutFirst}`; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function miniMaxSum(arr) {\n let sortedArray = arr.sort();\n \n let minSum, maxSum;\n \n let addAllNumbers = function (total, num) {\n return total + num;\n };\n \n maxSum = sortedArray.slice(1).reduce(addAllNumbers);\n minSum = sortedArray.slice(0, 4).reduce(addAllNumbers);\n \n cons...
[ "0.79091084", "0.76238716", "0.76102346", "0.76011246", "0.7589525", "0.7582664", "0.7545574", "0.7504164", "0.7489257", "0.748297", "0.74777997", "0.74649924", "0.7384725", "0.7356591", "0.7348765", "0.72327363", "0.71972656", "0.71235913", "0.6903978", "0.69028467", "0.6891...
0.72969913
15
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ custom function. (program section) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~...
function processRetrieve(param) { var args = { source: { type: "INLINE", argument: [ { name: "arg_rqst_no", value: v_global.logic.rqst_no }, { name: "arg_io_tp", value: v_global.logic.io_tp }, { name: "arg_wh_nm", value: gw_com_api.get...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Main()\n {\n \n }", "function main(){\n\n\n}", "function main(){\n\t\n}", "setupProgram(program) {\n }", "function main(){\r\n}", "function main(){\n//CODE//\n}", "function main() {\n\n}", "function Expt() {\r\n}", "enterProgram(ctx) { console.l...
[ "0.65993345", "0.64295185", "0.63452697", "0.6298471", "0.62612736", "0.62253624", "0.6206572", "0.612985", "0.6099024", "0.60414016", "0.60375565", "0.59604424", "0.5914563", "0.5860736", "0.5854349", "0.58289874", "0.57722336", "0.569827", "0.56929946", "0.56929946", "0.568...
0.0
-1
Logs an ErrnoException to the console
function logError(err) { console.error("ErrnoException: %s", JSON.stringify(err)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function err() {\n logWithProperFormatting(out.console.error, '(ERROR)', arguments);\n}", "function showErr (e) {\n console.error(e, e.stack);\n}", "function logError(err) {\n console.error(err);\n}", "function logThrow(msg){\n console.error.apply(null, arguments);\n throw new Error(msg);\n}", "...
[ "0.70532453", "0.68775713", "0.67829645", "0.66469467", "0.6622927", "0.6597435", "0.64867103", "0.645479", "0.6444838", "0.6444838", "0.64436954", "0.64418364", "0.6440297", "0.6435653", "0.64226806", "0.639851", "0.6371555", "0.6363118", "0.6363118", "0.63513726", "0.633024...
0.7320186
0
Returns the index at which the specified item must be inserted in the specified sorted array
function insertIndexSorted(arr, item, compFunc) { var len = arr.length; // If the array is empty, return position 0 if (len == 0) return 0; // Initialize binary search var a = 0; var b = len - 1; var aItem = arr[a]; var bItem = arr[b]; // Special case, check whether the ne...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function arrayInsertSorted(array, value) {\n var index = arrayIndexOfSorted(array, value);\n\n if (index < 0) {\n // if we did not find it insert it.\n index = ~index;\n arrayInsert(array, index, value);\n }\n\n return index;\n }", "function arrayInsert...
[ "0.7396126", "0.7375444", "0.7375444", "0.73351645", "0.73351645", "0.73351645", "0.73351645", "0.73351645", "0.73351645", "0.73351645", "0.72876257", "0.7287057", "0.7276941", "0.72211736", "0.72211736", "0.70019346", "0.69892335", "0.69892335", "0.69892335", "0.69892335", "...
0.76544386
0
Returns the index of the item with the specified key
function indexOfSorted(arr, key, compFunc) { var len = arr.length; // If the array is empty, return -1 if (len == 0) return -1; // Initialize binary search var a = 0; var b = len - 1; var aItem = arr[a]; var bItem = arr[b]; var comp = 0; // Start binary search var ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function positionFor(list, key) {\n for(var i = 0, len = list.length; i < len; i++) {\n if( list[i]._key === key ) {\n return i;\n }\n }\n return -1;\n}", "function keyIndexByKey (key) {\n return keys.findIndex(element => {return element.key === key});\n}", "function indexForKey(array, key) {\...
[ "0.79218006", "0.7883233", "0.78228074", "0.7353858", "0.71138966", "0.69812477", "0.6858405", "0.6825044", "0.68122023", "0.6795316", "0.67791927", "0.67088956", "0.6704493", "0.6671039", "0.66080457", "0.6598869", "0.6557131", "0.6556334", "0.6555452", "0.6555452", "0.65551...
0.5810314
91
Returns the highest rated listing among an array of Yelp listings
function getMaxListing(listings){ var maxRating = 0, maxListing = null; for (var j = 0; j < listings.length; j++){ var listing = listings[j]; // console.log("j: " + j + " listings[j] = listing = " + listings[j]); // console.log("listing.rating = " + listing.rating); // console.log("maxRating = " + maxRatin...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function highestRating(movieList){\r\n //first find out which video has the higest rating, then check to see if there are any other videos with that rating.\r\n //push all videos with highest rating into var topVideos array.\r\n //access movieLists[0].videos[0].rating\r\n //access movieLists[0].videos[0].t...
[ "0.6076147", "0.60745955", "0.56886125", "0.5601824", "0.5597667", "0.5573673", "0.55238223", "0.5508783", "0.54554653", "0.54432184", "0.5434897", "0.5395234", "0.5363746", "0.53532505", "0.53389823", "0.532668", "0.5307944", "0.5306016", "0.52943915", "0.52881986", "0.52309...
0.7418681
0
var globalRet = null;
function App(props) { const [tasks, setTasks] = useState(props.tasks) const [viewCriteria, setViewCriteria] = useState(props.criteria) function toggleTaskComplete(id) { console.log(`toggleTaskCompleted() being run on id: ${id}`) console.log(id) console.log(tasks) const newTasks = tasks.map(ta...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dummyReturn(){\n}", "function Success() {\n return null;\n}", "function fnGlobalObject() {\n return this\n}", "function globalFunction(){\n console.log(globalVariable);\n}", "function fun1(){\n // Note: Can be set without var, since within a function scoped with the function, since var is ...
[ "0.65233535", "0.6422589", "0.6306299", "0.6199128", "0.60509795", "0.6034292", "0.5997829", "0.5990304", "0.5987316", "0.59494734", "0.586811", "0.5864574", "0.58614856", "0.5851486", "0.5819097", "0.579933", "0.57596105", "0.57525826", "0.5729531", "0.57226557", "0.57210577...
0.0
-1
Function passed in to `connect` to subscribe to Redux store updates. Any time it updates, mapStateToProps is called.
function mapStateToProps(state) { return { user: state.user }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function connect(mapStateToProps, mapDispatchToProps) {\r\n // It lets us inject component as the last step so people can use it as a decorator.\r\n // Generally you don't need to worry about it.\r\n return function (WrappedComponent) {\r\n // It returns a component\r\n return class extends React.Componen...
[ "0.6871838", "0.6783097", "0.67120904", "0.66794795", "0.6663739", "0.6633198", "0.663164", "0.6492054", "0.6479069", "0.6465185", "0.64485955", "0.64041954", "0.63897926", "0.63866323", "0.63824576", "0.63824344", "0.6343868", "0.6335978", "0.6325723", "0.6317365", "0.630956...
0.0
-1
Help to recvive the updated state from the store
function mapStateToProps(state){ return { mydata:state.Films } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "update(data={}) {\n this.state = Object.assign(this.state, data);\n\n // notify all the Listeners of updated state\n this.notifyObervers(this.state);\n }", "storeChanged(){\n this.setState(this.getState());\n }", "update(data = {}) {\n this.state = Object.assign(this.state, data)...
[ "0.69803566", "0.687361", "0.6829496", "0.6803724", "0.67561483", "0.66702163", "0.66702163", "0.66487044", "0.6631587", "0.6626222", "0.6602155", "0.6602155", "0.65841883", "0.6465262", "0.6458464", "0.64274263", "0.6378514", "0.63506037", "0.63357973", "0.632652", "0.632321...
0.0
-1
screen container reference for sprite placement bricks list that will hold each of the bricks for the level timedelay how often to call the action subroutine funky if true then rotation phase is altered so we get non circular motion omega amount to adjust the phase of the rotation by each frame
constructor(screen, bricks, timedelay, funky, omega) { super(screen, bricks,timedelay); this.angle = 0; this.funky = funky; this.omega = omega; this.startup(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor(screen, bricks, timedelay)\n {\n super(screen, bricks, timedelay);\n\n //set colour (first colour 0 ignored)\n this.colorset = [\n \"black\",\n \"red\",\n \"orange\",\n \"yellow\",\n \"lime\",\n \"blue\",\n ...
[ "0.61111265", "0.609623", "0.59117776", "0.5894778", "0.5835138", "0.57873034", "0.57789177", "0.5755953", "0.5734129", "0.5705092", "0.56557924", "0.5647749", "0.56237835", "0.5603796", "0.5586626", "0.5572072", "0.55520785", "0.5544647", "0.553911", "0.5536297", "0.5519142"...
0.61185193
0
layout bricks then displace using rotation code so they assume correct layout
startup() { this.angle = 1; this.rows(5, 11, 1); this.action(0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rotate() {\n\n var newOrient = active.orientation + 1;\n undrawPiece();\n\n if (newOrient >= active.type.length) {\n newOrient = 0;\n }\n var test = active.type[newOrient];\n for (var i = 0; i < test.length; i++) {\n active.location[i][0] =test[i][0] + active.pivot....
[ "0.6155313", "0.6131836", "0.6128701", "0.6118344", "0.6083791", "0.6075342", "0.6034471", "0.6020685", "0.59899724", "0.59852684", "0.5951051", "0.5935575", "0.59106743", "0.5909028", "0.5900519", "0.5895107", "0.58815306", "0.5872497", "0.58413833", "0.5836607", "0.5826283"...
0.0
-1
delta fraction of a second this frame represents works through each brick and displaces it around a circle layout if funky is true then we add an additional phase offset for a weird effect
action(delta) { for (var i = 0; i < this.bricks.length; i++) { if (this.funky) this.bricks[i].rotate(this.angle, 1.25 * Math.sin(this.angle), -1.25 * Math.sin(this.angle + 0.2), 0, -50); else this.bricks[i].rotate(this.angle, 1.25 , -1.25 , 0, -50); } this.angle += this.omega * delta; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function animate() {\n var timeNow = new Date().getTime();\n if (lastTime != 0) {\n var elapsed = timeNow - lastTime; \n rotAngle= (rotAngle+1.0) % 360;\n }\n var elapsed=timeNow-lastTime;\n lastTime = timeNow;\n \n //when framecount is less than 120, the effect is just rotati...
[ "0.63385653", "0.62850475", "0.6206597", "0.60990554", "0.6097777", "0.60757416", "0.6065528", "0.6042655", "0.59969294", "0.5980588", "0.5974842", "0.5954197", "0.5934783", "0.5927832", "0.59253997", "0.5919802", "0.58970416", "0.5884751", "0.5860298", "0.58554846", "0.58484...
0.65644515
0
Creating the function to be called when the target is been intersected
function second_callback(entries) { //The callback function will return an array of entries, even if observing only one element entries.forEach(element => { //returns true if the element is intersecting with viewport if (element.isIntersecting) { //Incresing the width when inter...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onIntersectedByMouse(){\n }", "intersect() {\n return CSG.moduleOp('manifold.intersect', 'intersection', ...arguments);\n }", "intersect(other) { }", "function intersectionHandler(entries, observer) {\n //Do the stuff described above\n console.log(entries);\n entries.forEach(entry => {\...
[ "0.6531162", "0.6351334", "0.6315246", "0.6254971", "0.61194086", "0.6115626", "0.60486794", "0.60207874", "0.6014932", "0.59203136", "0.58264387", "0.5824615", "0.57804966", "0.57108337", "0.5694831", "0.5683053", "0.5680387", "0.562681", "0.55707544", "0.55641025", "0.55628...
0.0
-1
Currently in sync with Node.js lib/assert.js Originally from narwhal.js ( Copyright (c) 2009 Thomas Robinson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without l...
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof o...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function assert(b, err) { if(!b) { throw err; } }", "function t(e,t){/* istanbul ignore if */\nif(!e)throw new Error(\"ASSERT: \"+t)}", "function t(e,t){/* istanbul ignore if */\nif(!e)throw new Error(\"ASSERT: \"+t)}", "function okTest1() {\n assert(true, \"assert true\")\n}", "function assert(mustBeTr...
[ "0.69644743", "0.6829549", "0.6829549", "0.6785697", "0.66015065", "0.6586775", "0.65502244", "0.65502244", "0.65502244", "0.65352", "0.6504366", "0.64917696", "0.6487857", "0.64623135", "0.6448245", "0.64030266", "0.6356495", "0.6354135", "0.62892354", "0.6266839", "0.626190...
0.0
-1
Expose a strict only variant of assert
function strict() { for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) { args[_key6] = arguments[_key6]; } innerOk.apply(void 0, [strict, args.length].concat(args)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function assert(mustBeTruthy) {}", "function assert(x) {\n\tif (x !== true) throw new Error(\"Your assertion was not true!\");\n}", "function assert(cond) {\n if (!cond) throw new Error('Assertion error');\n }", "function assert(cond) {\n if (!cond) {\n throw new Error(\"assertion error\");\n }\n}",...
[ "0.73108166", "0.7035136", "0.69408566", "0.6903415", "0.6820907", "0.6817661", "0.67878187", "0.6742497", "0.67101806", "0.6679644", "0.6679644", "0.6630793", "0.65959215", "0.6581539", "0.65481424", "0.6543411", "0.6514344", "0.6514344", "0.6514344", "0.6514344", "0.6505672...
0.0
-1
Currently in sync with Node.js lib/internal/assert/assertion_error.js
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return O...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function assert(assertion, msg) {\n if (!assertion) {\n throw new Error(msg);\n }\n}", "function zg(e,t){if(!e){const r=new Error(t||\"Assertion failed\");throw Error.captureStackTrace&&Error.captureStackTrace(r,zg),r}}", "function assert(b, err) { if(!b) { throw err; } }", "function t(e,t){/* istanbul ...
[ "0.761905", "0.7421359", "0.72715497", "0.72697216", "0.72697216", "0.7241357", "0.7241357", "0.7241357", "0.71223766", "0.7037969", "0.6998159", "0.6983271", "0.68010706", "0.6783111", "0.67785406", "0.6774837", "0.6759268", "0.67429113", "0.67415243", "0.67357534", "0.67309...
0.0
-1
Currently in sync with Node.js lib/internal/util/comparisons.js
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "compare(expected) {\n return UNEQUAL;\n }", "function caml_compare (a, b) { return caml_compare_val (a, b, true); }", "function caml_compare_val (a, b, total) {\n var stack = [];\n for(;;) {\n if (!(total && a === b)) {\n if (a instanceof MlString) {\n if (b instanceof MlString) {\n ...
[ "0.64017904", "0.6359932", "0.62065136", "0.6188944", "0.61285263", "0.60826457", "0.6072396", "0.6038068", "0.60053426", "0.60053426", "0.60053426", "0.60053426", "0.60053426", "0.60053426", "0.60053426", "0.60053426", "0.60053426", "0.60053426", "0.60053426", "0.60053426", ...
0.0
-1
Taken from original notice: /! The buffer module from node.js, for the browser.
function compare(a, b) { if (a === b) { return 0; } var x = a.length; var y = b.length; for (var i = 0, len = Math.min(x, y); i < len; ++i) { if (a[i] !== b[i]) { x = a[i]; y = b[i]; break; } } if (x < y) { return -1; } if (y < x) { return 1; } return 0; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function typedBuffer() {\n}", "function typedBuffer() {\n}", "function typedBuffer() {\n}", "function typedBuffer() {\n}", "function typedBuffer() {\n}", "function typedBuffer() {\n}", "function Buffer(arg){if(!(this instanceof Buffer)){ // Avoid going through an ArgumentsAdaptorTrampoline in the commo...
[ "0.7224377", "0.7224377", "0.7224377", "0.7224377", "0.7224377", "0.7224377", "0.7175976", "0.7148338", "0.70770895", "0.7031922", "0.7031922", "0.7014993", "0.6998495", "0.69520426", "0.6938563", "0.68998414", "0.68569016", "0.6847383", "0.68406403", "0.68225396", "0.679525"...
0.0
-1
Check if they have the same source and flags
function areSimilarRegExps(a, b) { return regexFlagsSupported ? a.source === b.source && a.flags === b.flags : RegExp.prototype.toString.call(a) === RegExp.prototype.toString.call(b); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkFlagPosition() {\n let allFlagsCorrect = true;\n \n for (let f of placedFlags) {\n if (!f.isMine)\n allFlagsCorrect = false;\n }\n \n return allFlagsCorrect;\n}", "function checkIfMatchFound()\n{\n\tif(app.firstTile.src == app.secondTile.src)\n\t{\n\t\treturn true;\n\t}\n\telse\n\t{\n...
[ "0.5781939", "0.5747019", "0.5687875", "0.56595784", "0.56535673", "0.5571537", "0.5540249", "0.549616", "0.548684", "0.5424674", "0.537105", "0.537062", "0.5319596", "0.5255579", "0.5255579", "0.52452713", "0.5222725", "0.51507807", "0.5128019", "0.50973326", "0.5084396", ...
0.60573
0
FunctionTemplate::SetClassName() in C++ or Symbol.toStringTag in JS and retrieved using Object.prototype.toString.call(obj) in JS See for a list of tags predefined in the spec. There are some unspecified tags in the wild too (e.g. typed array tags). Since tags can be altered, they only serve fast failures Typed arrays ...
function innerDeepEqual(val1, val2, strict, memos) { // All identical values are equivalent, as determined by ===. if (val1 === val2) { if (val1 !== 0) return true; return strict ? objectIs(val1, val2) : true; } // Check more closely if val1 and val2 are equal. if (strict) { if (_typeof(val1) !== ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tagTester(name) {\n var tag = '[object ' + name + ']';\n return function(obj) {\n return toString.call(obj) === tag;\n };\n }", "function tagTester(name) {\n var tag = '[object ' + name + ']';\n return function(obj) {\n return toString.call(obj) === tag;\n };\n }", "funct...
[ "0.5581655", "0.5581655", "0.5581655", "0.5581655", "0.5581655", "0.5581655", "0.5581655", "0.5581655", "0.5581655", "0.5242836", "0.51774126", "0.51704043", "0.5163068", "0.5093788", "0.5063075", "0.5057406", "0.5051704", "0.50123453", "0.4966431", "0.49203613", "0.490942", ...
0.0
-1
Sadly it is not possible to detect corresponding values properly in case the type is a string, number, bigint or boolean. The reason is that those values can match lots of different string values (e.g., 1n == '+00001').
function findLooseMatchingPrimitives(prim) { switch (_typeof(prim)) { case 'undefined': return null; case 'object': // Only pass in null as object! return undefined; case 'symbol': return false; case 'string': prim = +prim; // Loose equal entries exist only if the ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function M(t) {\n return \"nullValue\" in t ? 0 /* NullValue */ : \"booleanValue\" in t ? 1 /* BooleanValue */ : \"integerValue\" in t || \"doubleValue\" in t ? 2 /* NumberValue */ : \"timestampValue\" in t ? 3 /* TimestampValue */ : \"stringValue\" in t ? 5 /* StringValue */ : \"bytesValue\" in t ? 6 /* BlobVa...
[ "0.70099866", "0.6940974", "0.68770635", "0.67696756", "0.67401505", "0.67401505", "0.6726853", "0.6571316", "0.6507014", "0.64725566", "0.63359934", "0.6330831", "0.63225186", "0.6300257", "0.6298196", "0.6273432", "0.627092", "0.62661994", "0.62661994", "0.62661994", "0.626...
0.0
-1
0 to MAX_INT32 / Create and return a BigNumber constructor.
function clone(configObject) { var div, convertBase, parseNumeric, P = BigNumber.prototype = { constructor: BigNumber, toString: null, valueOf: null }, ONE = new BigNumber(1), //----------------------------- EDITABLE CONFIG DEFAULTS ------------------------------- // The default values be...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "bigNumber(value) {\n return bignumber[\"a\" /* BigNumber */].from(value);\n }", "function _Big_() {\r\n\r\n /*\r\n * The Big constructor and exported function.\r\n * Create and return a new instance of a Big number object.\r\n *\r\n * n {number|string|Big} A numeric value.\r\n */...
[ "0.7271927", "0.7183414", "0.7183414", "0.71820825", "0.71820825", "0.717818", "0.7131853", "0.71276766", "0.70352036", "0.70352036", "0.69676596", "0.6960962", "0.69536173", "0.67984533", "0.6663184", "0.6649168", "0.6649168", "0.6649168", "0.6649168", "0.6649168", "0.664916...
0.0
-1
Convert string of baseIn to an array of numbers of baseOut. Eg. toBaseOut('255', 10, 16) returns [15, 15]. Eg. toBaseOut('ff', 16, 10) returns [2, 5, 5].
function toBaseOut(str, baseIn, baseOut, alphabet) { var j, arr = [0], arrL, i = 0, len = str.length; for (; i < len;) { for (arrL = arr.length; arrL--; arr[arrL] *= baseIn); arr[0] += alphabet.indexOf(str.charAt(i++)); for (j = 0; j < a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toBaseOut( str, baseIn, baseOut ) {\n\t var j,\n\t arr = [0],\n\t arrL,\n\t i = 0,\n\t len = str.length;\n\n\t for ( ; i < len; ) {\n\t for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\n\t arr[ j = 0 ] += ALPHABET.index...
[ "0.7782982", "0.7782982", "0.77159023", "0.77042556", "0.77042556", "0.7699728", "0.7699728", "0.7699403", "0.7687209", "0.7687209", "0.7687209", "0.7687209", "0.7687209", "0.7687209", "0.7687209", "0.7687209", "0.7679295", "0.7679295", "0.7679295", "0.7679295", "0.7679295", ...
0.72726357
43
Assume nonzero x and k.
function multiply(x, k, base) { var m, temp, xlo, xhi, carry = 0, i = x.length, klo = k % SQRT_BASE, khi = k / SQRT_BASE | 0; for (x = x.slice(); i--;) { xlo = x[i] % SQRT_BASE; xhi = x[i] / SQRT_BASE | 0; m = khi * xlo + xhi * klo; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function solution(k) {\n const res = Array.from({ length: k }, () => 0);\n\n // 생성자\n for (let i = 1; i <= k; i++) {\n if (d(i) <= 10000) res[d(i)] = 1;\n }\n\n for (let i = 1; i < k; i++) {\n if (res[i] === 0) console.log(i);\n }\n}", "function inout ( k ) {\n\n\t\tif ( ( k *= 2 ) < 1 ) return 0.5 *...
[ "0.68659186", "0.6801382", "0.65580535", "0.638755", "0.63541055", "0.6291123", "0.62724304", "0.62562656", "0.62041676", "0.61886704", "0.6161085", "0.6107696", "0.6103677", "0.6089188", "0.6075025", "0.6073309", "0.6056127", "0.6026094", "0.5986148", "0.5979488", "0.5896718...
0.55362296
93
Return a string representing the value of BigNumber n in fixedpoint or exponential notation rounded to the specified decimal places or significant digits. n: a BigNumber. i: the index of the last digit required (i.e. the digit that may be rounded up). rm: the rounding mode. id: 1 (toExponential) or 2 (toPrecision).
function format(n, i, rm, id) { var c0, e, ne, len, str; if (rm == null) rm = ROUNDING_MODE; else intCheck(rm, 0, 8); if (!n.c) return n.toString(); c0 = n.c[0]; ne = n.e; if (i == null) { str = coeffToString(n.c); str = id == 1 || id == 2 && (ne <= TO_EXP_NEG ||...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function format(n, i, rm, id) {\n var c0, e, ne, len, str;\n if (rm == null) rm = ROUNDING_MODE;else intCheck(rm, 0, 8);\n if (!n.c) return n.toString();\n c0 = n.c[0];\n ne = n.e;\n\n if (i == null) {\n str = coeffToString(n.c);\n str = i...
[ "0.8237718", "0.8219223", "0.8156333", "0.8100351", "0.8100351", "0.8100351", "0.8100351", "0.8100351", "0.8100351", "0.8100351", "0.80997634", "0.8097548", "0.8097548", "0.8097548", "0.8097548", "0.8097548", "0.8097548", "0.8097548", "0.8097548", "0.8086601", "0.8086601", ...
0.8068795
25
Handle BigNumber.max and BigNumber.min.
function maxOrMin(args, method) { var n, i = 1, m = new BigNumber(args[0]); for (; i < args.length; i++) { n = new BigNumber(args[i]); // If any number is NaN, return NaN. if (!n.s) { m = n; break; } else if (method.call(m, n)) { m = n; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function maxOrMin( args, method ) {\n\t var m, n,\n\t i = 0;\n\t\n\t if ( isArray( args[0] ) ) args = args[0];\n\t m = new BigNumber( args[0] );\n\t\n\t for ( ; ++i < args.length; ) {\n\t n = new BigNumber( args[i] );\n\t\n\t ...
[ "0.7295995", "0.7295995", "0.7219861", "0.7217631", "0.7217631", "0.7204642", "0.706041", "0.706041", "0.706041", "0.706041", "0.706041", "0.706041", "0.706041", "0.706041", "0.7016255", "0.7016255", "0.7016255", "0.7016255", "0.6993049", "0.6993049", "0.6993049", "0.699304...
0.6909877
40
Strip trailing zeros, calculate base 10 exponent and check against MIN_EXP and MAX_EXP. Called by minus, plus and times.
function normalise(n, c, e) { var i = 1, j = c.length; // Remove trailing zeros. for (; !c[--j]; c.pop()); // Calculate the base 10 exponent. First get the number of digits of c[0]. for (j = c[0]; j >= 10; j /= 10, i++); // Overflow? if ((e = i + e * LOG_BASE - 1) > MAX_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function noExponents(num) {\r\n var numStr = num.toString();\r\n var numParts = numStr.split(/[eE]/);\r\n\r\n if(numParts.length === 1) {\r\n return numParts[0];\r\n }\r\n\r\n var left = numParts[0];\r\n var right = numParts[1];\r\n\r...
[ "0.64426285", "0.62334293", "0.62072915", "0.62072915", "0.62072915", "0.62072915", "0.62072915", "0.62072915", "0.62003696", "0.6197138", "0.6177847", "0.61699426", "0.6162923", "0.61417186", "0.6004645", "0.5988466", "0.5965512", "0.5914372", "0.5914372", "0.5914372", "0.59...
0.0
-1
Round x to sd significant digits using rounding mode rm. Check for over/underflow. If r is truthy, it is known that there are more digits after the rounding digit.
function round(x, sd, rm, r) { var d, i, j, k, n, ni, rd, xc = x.c, pows10 = POWS_TEN; // if x is not Infinity or NaN... if (xc) { // rd is the rounding digit, i.e. the digit after the digit that may be rounded up. // n is a base 1e14 number, the value of the element of ar...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function round( x, sd, rm, r ) {\r\n\t\t var d, i, j, k, n, ni, rd,\r\n\t\t xc = x.c,\r\n\t\t pows10 = POWS_TEN;\r\n\t\t\r\n\t\t // if x is not Infinity or NaN...\r\n\t\t if (xc) {\r\n\t\t\r\n\t\t // rd is the rounding digit, i.e. the di...
[ "0.7531997", "0.75087404", "0.75087404", "0.74908483", "0.74805504", "0.74805504", "0.74805504", "0.74805504", "0.74805504", "0.74805504", "0.74805504", "0.74805504", "0.7479023", "0.74689263", "0.74689263", "0.74689263", "0.74689263", "0.74689263", "0.74689263", "0.74689263", ...
0.7317705
54
PRIVATE HELPER FUNCTIONS These functions don't need access to variables, e.g. DECIMAL_PLACES, in the scope of the `clone` function above.
function bitFloor(n) { var i = n | 0; return n > 0 || n === i ? i : i - 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clone(obj) {\r\n var i, p, ps;\r\n\r\n /*\r\n * The Decimal constructor and exported function.\r\n * Return a new Decimal instance.\r\n *\r\n * v {number|string|Decimal} A numeric value.\r\n *\r\n */\r\n function Decimal(v) {\r\n var e, i, t,\r\n x = this;\r\n\r\n // Decimal call...
[ "0.6400071", "0.6364422", "0.6353507", "0.63468933", "0.6342813", "0.6342813", "0.6342813", "0.6224396", "0.6221768", "0.6221768", "0.62011856", "0.6190018", "0.6155026", "0.6075608", "0.6075608", "0.60404867", "0.60142785", "0.59050965", "0.5881535", "0.58719844", "0.5834587...
0.0
-1
Return a coefficient array as a string of base 10 digits.
function coeffToString(a) { var s, z, i = 1, j = a.length, r = a[0] + ''; for (; i < j;) { s = a[i++] + ''; z = LOG_BASE - s.length; for (; z--; s = '0' + s); r += s; } // Determine trailing zeros. for (j = r.length; r.charCodeAt(--j) === 48;); return r.slice(0...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function coeffToString(a) {\r\n\t\t var s, z,\r\n\t\t i = 1,\r\n\t\t j = a.length,\r\n\t\t r = a[0] + '';\r\n\t\t\r\n\t\t for ( ; i < j; ) {\r\n\t\t s = a[i++] + '';\r\n\t\t z = LOG_BASE - s.length;\r\n\t\t for ( ; z--; s = '0' + s );\...
[ "0.7693161", "0.7626481", "0.7620941", "0.7620941", "0.76180404", "0.76180404", "0.76180404", "0.76180404", "0.76180404", "0.76180404", "0.76180404", "0.76180404", "0.7616083", "0.7604042", "0.7604042", "0.7595874", "0.7595874", "0.7595874", "0.7595874", "0.7595874", "0.75958...
0.75391763
51
Compare the value of BigNumbers x and y.
function compare(x, y) { var a, b, xc = x.c, yc = y.c, i = x.s, j = y.s, k = x.e, l = y.e; // Either NaN? if (!i || !j) return null; a = xc && !xc[0]; b = yc && !yc[0]; // Either zero? if (a || b) return a ? b ? 0 : -j : i; // Signs differ? if (i != j) re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function numberEquals(x, y) { \n return Math.abs(x - y) < Number.EPSILON;\n }", "function compare( x, y ) {\n\t var a, b,\n\t xc = x.c,\n\t yc = y.c,\n\t i = x.s,\n\t j = y.s,\n\t k = x.e,\n\t l = y.e;\n\n\t // Either NaN?\n\t ...
[ "0.7658416", "0.7205186", "0.7205186", "0.71960366", "0.7162354", "0.7153431", "0.71428573", "0.71428573", "0.71323186", "0.7126514", "0.7126514", "0.7120442", "0.7120442", "0.7120442", "0.7120442", "0.7120442", "0.7120442", "0.7120442", "0.7120442", "0.71157753", "0.71157753...
0.709027
32
Check that n is a primitive number, an integer, and in range, otherwise throw.
function intCheck(n, min, max, name) { if (n < min || n > max || n !== mathfloor(n)) { throw Error (bignumberError + (name || 'Argument') + (typeof n == 'number' ? n < min || n > max ? ' out of range: ' : ' not an integer: ' : ' not a primitive number: ') + String(n)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function intCheck(n,min,max,name){if(n<min||n>max||n!==mathfloor(n)){throw Error(bignumberError+(name||\"Argument\")+(typeof n==\"number\"?n<min||n>max?\" out of range: \":\" not an integer: \":\" not a primitive number: \")+String(n))}}// Assumes finite n.", "function intCheck(n, min, max, name) {\n if (n < ...
[ "0.8009637", "0.78952557", "0.7855038", "0.7855038", "0.7855038", "0.7855038", "0.7855038", "0.7855038", "0.7855038", "0.78494674", "0.78494674", "0.78494674", "0.78494674", "0.78362286", "0.7831469", "0.7827984", "0.7816811", "0.7816811", "0.7816811", "0.7816811", "0.7816811...
0.7751055
25