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
Get JFire UserID as String by given attributes of an LDAP entry.
function getUserIDFromLDAPEntry(attributes){ var uid = LDAPScriptUtil.getAttributeValue(attributes, 'uid', 'userid'); if (uid != null){ return uid; } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getUserIDFromLDAPEntry(attributes){\r\n\tvar displayName = LDAPScriptUtil.getAttributeValue(attributes, 'displayName', null);\r\n\tif (displayName == null || displayName == ''){\t// assume it's not a Person\r\n\t\tvar uid = LDAPScriptUtil.getAttributeValue(attributes, 'uid', 'userid');\r\n\t\tif (uid != n...
[ "0.74538237", "0.53555983", "0.529863", "0.5142131", "0.51265013", "0.51169044", "0.5025913", "0.50195855", "0.5007644", "0.4991328", "0.4983166", "0.4970067", "0.49307352", "0.49223357", "0.49201116", "0.49048328", "0.49048328", "0.49043536", "0.49014828", "0.48860464", "0.4...
0.7540499
0
Get the name of SASL realm for given bind principal
function getSASLRealm(bindPrincipal){ return "nightlabs.de"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function saslName(aName) {\n // RFC 5802 (5.1): the client SHOULD prepare the username using the \"SASLprep\".\n // The characters ’,’ or ’=’ in usernames are sent as ’=2C’ and\n // ’=3D’ respectively.\n let saslName = saslPrep(aName)\n .replace(/=/g, \"=3D\")\n .replace(/,/g, \"=2C\");\n if (!saslName)...
[ "0.53267884", "0.4758299", "0.46672747", "0.46157458", "0.4614409", "0.45923495", "0.4581713", "0.45688176", "0.45428255", "0.4537789", "0.4498053", "0.44896817", "0.44892883", "0.44730222", "0.44278026", "0.44232503", "0.44049713", "0.43761936", "0.43496963", "0.43328908", "...
0.7642122
1
Produces a tone corresponding to the mouse's position, and Renders a visual representation of it.
function draw() { background(0, 70, 150); var waveform = fft.waveform(); beginShape(); strokeWeight(3); fill(0, 70, 150); for (var i = 0; i < waveform.length; i++) { var x = map(i, 0, waveform.length, 0, width); var y = map(waveform[i], -1, 1, height, 0); vertex(x, y); } endShape(); if ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function draw(){\n var dirY = (mouseY / height - 0.5) *2;\n var dirX = (mouseX / width - 0.5) *2;\n directionalLight(250, 250, 250, dirX, -dirY, 0.25);\n ambientMaterial(250);\n sphere(50, 64);\n\n\n}", "function printMousePos(event) {\n\n\t//create a new canvas\n\tvar canvas = document.createElement('canva...
[ "0.6908858", "0.6593415", "0.65450835", "0.651952", "0.6473209", "0.64656544", "0.6430102", "0.6291345", "0.6271276", "0.62353754", "0.6139029", "0.606802", "0.6027758", "0.6025142", "0.60013986", "0.59763163", "0.5971181", "0.5968482", "0.59579813", "0.5942706", "0.5926473",...
0.59207416
23
checking if the statment is true or false for each button clickable and adding to CA and IA
function trueOrFalse1() { console.log(eachone[count].option1.truth); if (eachone[count].option1.truth == true){ correctAnswers++; guessedIt = true; } else { incorrectAnswers++; guessedIt = false; }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addCompletedEvent() {\r\n let allCompleteBtn = Array.from(document.querySelectorAll(\".complete-btn\"));\r\n\r\n allCompleteBtn.forEach(button => {\r\n button.addEventListener(\"click\", function() {\r\n let index = allCompleteBtn.indexOf(button);\r\n\r\n if (myLibrary[i...
[ "0.6282295", "0.6213276", "0.6170941", "0.6105573", "0.60668635", "0.6010319", "0.6005075", "0.59649396", "0.59371084", "0.59257203", "0.5899214", "0.58941233", "0.58855706", "0.5876057", "0.58725137", "0.5863268", "0.5860449", "0.5857102", "0.5834666", "0.58285284", "0.58285...
0.0
-1
nextQuestion function should bring about the next function if time runs out
function displayQuestion() { startTime30(); $("#question").html(eachone[count].question); $("#option1").html(eachone[count].option1.answer); $("#option2").html(eachone[count].option2.answer); $("#option3").html(eachone[count].option3.answer); $("#option4").html(eachone[count].option4.answer); $("#...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "nextQuestion() {\n this.stoptimer();\n this.round++;\n if (this.round > 0) {\n this.canConnect = false;\n }\n this.resetReadystate();\n if ((this.round > 0 && this.round <= this.maxrounds) && this.round <= this.questions.length) {\n this.getQuestion()...
[ "0.7794493", "0.7688641", "0.7688641", "0.7688641", "0.76818365", "0.7678696", "0.76591635", "0.7589309", "0.75479156", "0.7514648", "0.75140464", "0.75094944", "0.7495867", "0.74932826", "0.7483218", "0.7481809", "0.74797267", "0.74544793", "0.74543995", "0.7453044", "0.7427...
0.0
-1
Send an SMS alert that a possible fire has been detected
function notifySMS() { if (!config.TWILIO_ACCT_SID || !config.TWILIO_AUTH_TOKEN) { return; } // only send an SMS every 1 minute if (smsSent) { return; } var opts = { to: config.NUMBER_TO_SEND_TO, from: config.TWILIO_OUTGOING_NUMBER, body: "fire alarm" }; // send SM...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function OnSMSAlert()\n{\n}", "function sendAlert(){\n\t\n\t// Request\n\tvar request = require('request');\n\t\n\t// Somebody has been detected\n\tif (value['value'] == true){\n\t\t\n\t\tvar subject = 'Alerte intrusion';\n\t\tvar message = 'Une présence a été détectée';\n\n\t// Nobody's here since few minutes\n...
[ "0.71997386", "0.6607478", "0.65619403", "0.6534377", "0.642321", "0.64169306", "0.63647664", "0.633626", "0.630486", "0.6284328", "0.62342876", "0.6157296", "0.6107118", "0.606861", "0.60617787", "0.6057583", "0.60484964", "0.6025312", "0.60244787", "0.59689885", "0.5959019"...
0.705321
1
Display and then store record in the remote datastore of each time a fire alarm condition has been triggered
function notify() { console.log("fire alarm"); notifySMS(); var payload = { value: "fire alarm", datetime: new Date().toISOString() }; datastore.log(config, payload); mqtt.log(config, payload); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onrecord() {}", "function sendNotification (record, action, done) {\n done()\n }", "function displayRecords() {\n Alert.render(\n `Current best times for running the 100 metres dash <br><br>\n <b>WOMEN'S RECORD:</b> <br>10.49 seconds (set by Florence Griffith-Joyner in 1988)<br>\n <...
[ "0.5850386", "0.56531584", "0.5559705", "0.55485225", "0.54517287", "0.5411378", "0.5401515", "0.5377097", "0.5357351", "0.5351732", "0.5347837", "0.53401124", "0.5305126", "0.5281665", "0.5266453", "0.52630925", "0.52368414", "0.52178437", "0.51933515", "0.51647913", "0.5147...
0.65875643
0
Loops every 500ms to check if the ambient temperature has exceeded the threshold, indicating that a possible fire emergency exists
function monitorTemperature() { var prev = 0; setInterval(function() { var currentTemp = board.getTemperature(); var currentLight = board.getLight(); board.message("Temperature: " + currentTemp); board.message("Light Level: " + currentLight, 1); // check if fire alarm should be triggered ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isHot(){\n\t\tconsole.log(temperature_measurement);\n\t\tif((temperature >= 8 && temperature_measurement === \"c\") || (temperature >= 46.4 && temperature_measurement === \"f\")){\n\t\t\t$('table').addClass('glow');\n\t\t}\n\t}", "function setTemperature() {\n setInterval(function() {\n var change =...
[ "0.6422574", "0.60709774", "0.6061272", "0.59592307", "0.5924581", "0.5861093", "0.58515", "0.58093494", "0.5805756", "0.5798695", "0.57489234", "0.57290334", "0.5727916", "0.57130414", "0.5696346", "0.56935227", "0.56670284", "0.5662054", "0.56329054", "0.5625378", "0.560686...
0.66445374
0
Called to start the alarm when a possible fire
function alarm() { notify(); var tick = true; board.color("red"); board.message("fire detected!", 1); board.buzz(); board.closeDamper(); var interval = setInterval(function() { board.color(tick ? "white" : "red"); if (tick) { board.stopBuzzing(); } else { board.buzz(); } tick = !tick; }, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "doFullAlarm() { this.playSound('queueFull'); }", "function fireAlarm(x)\n{\n console.log(\"fire alarm getting called\")\n jQuery.noConflict();\n $('#alarmModal').modal('show');\n //deleteAlarm(document.getElementById(x));\n setInactiveOnRing(x);\n\t// start ringtone\n\tstartRingtone();\n}", "fun...
[ "0.6707339", "0.6480688", "0.64219505", "0.63324267", "0.6230626", "0.6163512", "0.60637903", "0.5979596", "0.596735", "0.59068614", "0.5835888", "0.58107007", "0.57844085", "0.5781623", "0.5759777", "0.5756429", "0.57437336", "0.57296026", "0.5716578", "0.57136536", "0.57049...
0.6521722
1
The main function makes sure the alarm buzzer and LCD are turned off, then starts checking the ambient temperature using the connected hardware. The custom event `startalarm` is fired, if a possible fire emergency exists, which calls the `alarm()` function.
function main() { board.reset(); board.bootSounds(); //board.motorCheck(); board.openDamper(); monitorTemperature(); events.on("start-alarm", alarm); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function monitorTemperature() {\n var prev = 0;\n \n setInterval(function() {\n var currentTemp = board.getTemperature();\n var currentLight = board.getLight();\n board.message(\"Temperature: \" + currentTemp);\n board.message(\"Light Level: \" + currentLight, 1);\n\n // check if fire alarm shoul...
[ "0.7059272", "0.67878", "0.6386984", "0.60475194", "0.6011463", "0.58629817", "0.58150065", "0.57468647", "0.57363236", "0.572289", "0.5704093", "0.56860125", "0.55097127", "0.54973686", "0.548266", "0.5480396", "0.5477637", "0.5467635", "0.54211104", "0.54065335", "0.5387732...
0.8090627
0
sum of all positive integers up to the given number (inclusive). Ex: sigma(3) = 6 (or 1+2+3); sigma(5) = 15 (or 1+2+3+4+5).
function sigma(num) { var sum = 0; for (var i = 0; i <= num; i++) { sum += i; } return sum; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sigma(num){\n var sum = 0 // total starts at 0 because anything added to 0 is itself\n for(var i=1;i<=num;i++){\n sum += i\n }\n return sum\n}", "function sigma(num) {\n // set variable sum\n // loop through each number\n // start with num\n // end with 0\n // run while ...
[ "0.7691128", "0.76375026", "0.7630259", "0.7544485", "0.7502752", "0.7490478", "0.74881244", "0.742034", "0.7410363", "0.7308888", "0.71713305", "0.71448034", "0.68668365", "0.6842574", "0.672964", "0.6725164", "0.6708768", "0.67035604", "0.66950005", "0.6662965", "0.66500086...
0.75580275
3
Factorial Write a function factorial(num) that, given a number, returns the product (multiplication) of all positive integers from 1 up to the given number (inclusive). For example, factorial(3) = 6 (or 123); factorial(5) = 120 (or 12345).
function factorial(num) { var mult = num; for (var i = num - 1; i > 0; i--) { mult *= i; } return mult; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function factorial(num){\n var product = 1 // total starts at 1 because anything multipled by 1 is itself\n for(var i=1;i<=num;i++){\n product *= i\n }\n return product\n}", "function factorial(num){\n var product = 1;\n for(var i = 1; i <= num; i++){\n product *= i;\n }\n ...
[ "0.87408686", "0.8663989", "0.8649378", "0.8538159", "0.8511555", "0.84554505", "0.84293956", "0.84283394", "0.84152573", "0.8383183", "0.83638716", "0.8351601", "0.83297557", "0.83142054", "0.83122194", "0.829275", "0.829039", "0.8287276", "0.8283235", "0.82608044", "0.82468...
0.83619124
11
Fibonacci Create a function to generate Fibonacci numbers. In this famous mathematical sequence, each number is the sum of the previous two, starting with values 0 and 1. Your function should accept one argument, an index into the sequence (where 0 corresponds to the initial value, 4 corresponds to the value four later...
function fibonacci(num) { var temp; var num1 = 0; var num2 = 1; // index starts at 2, since first two numbers are given for (var i = 2; i <= num; i++) { temp = num2; num2 = num1 + num2; num1 = temp; } return num2; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fibonacci(index) {\n\tif(index > 2) {\n\t\treturn fibonacci(index - 1) + fibonacci(index - 2)\n\t} else {\n\t\treturn index;\n\t}\n}", "function fib(index){\n \n if(index==0){\n return 0; // Seed case.\n }\n \n else if (index==1){\n return 1; // Seed case.\n }\n \n ...
[ "0.8268912", "0.8092696", "0.8084588", "0.8000884", "0.7987742", "0.783548", "0.78214985", "0.780417", "0.78012824", "0.7790842", "0.7767535", "0.7754398", "0.7754398", "0.7754398", "0.77324784", "0.7725063", "0.77171165", "0.77078176", "0.76950705", "0.76913214", "0.76800555...
0.7408184
61
Array: SecondtoLast: Return the secondtolast element of an array. Given [42, true, 4, "Liam", 7], return "Liam". If array is too short, return null.
function secondToLast(arr) { if (arr.length < 2) { return null; } else { return arr[arr.length - 2]; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function secondToLast(arr){\n if(arr.length >1){\n return arr[arr.length-2];\n }else {\n return null;\n }\n}", "function secondToLast(arr) {\n if(arr.length < 2) {\n return null\n }\n return arr[arr.length - 2]\n}", "function secondToLast(arr){\n if(arr.length < 2){\n return ...
[ "0.85078883", "0.84310555", "0.8396434", "0.83031124", "0.8085481", "0.8044978", "0.7808903", "0.7549724", "0.7537397", "0.7510483", "0.74137795", "0.7371646", "0.7341322", "0.7287883", "0.7245952", "0.7218892", "0.7210932", "0.7200662", "0.71641773", "0.7138854", "0.71203315...
0.8451035
1
Array: NthtoLast: Return the element that is Nfromarray'send. Given ([5,2,3,6,4,9,7],3), return 4. If the array is too short, return null.
function nthToLast(arr, num) { if (arr.length < num) { return null; } else { return arr[arr.length - num]; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nthToLast(arr, n){\n if(arr.length >=n){\n return arr[arr.length-n];\n }else {\n return null;\n }\n}", "function nthToLast(arr, n){\n if (arr.length < 3){\n return null;\n }\n else{\n return arr.length-n\n }\n}", "function nthToLast(arr, num){\n return (num > arr.le...
[ "0.8137172", "0.80220425", "0.7921594", "0.77858275", "0.7673939", "0.7543015", "0.75037", "0.7460987", "0.7460807", "0.7295233", "0.72701263", "0.7080304", "0.70738685", "0.70595455", "0.7027008", "0.7026748", "0.70237213", "0.7017911", "0.69782424", "0.69393086", "0.6937793...
0.7964791
2
Array: SecondLargest: Return the secondlargest element of an array. Given [42,1,4,3.14,7], return 7. If the array is too short, return null.
function secondLargest(arr) { if (arr.length < 2) { return null; } var max, secondmax; // Since we know array length is at least 2, we can compare first two elements right away. if (arr[0] > arr[1]) { max = arr[0]; secondmax = arr[1]; } else { max = arr[1]; secondmax = arr[0]; } // First t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function secondLargest(arr){\n var sortedArray = sort(arr),\n len = arr.length,\n max = sortedArray[len - 1]\n\n for(let i = len - 2; i >= 0; i--){\n if (sortedArray[i] < max){\n return sortedArray[i]\n }\n }\n\n return null\n}", "function secondLargest(arr){\n arr.sort((a,b)=> b-a);\n ...
[ "0.86024207", "0.8461484", "0.84594214", "0.8349839", "0.83421135", "0.8330127", "0.8325237", "0.8164272", "0.813484", "0.8132926", "0.81239855", "0.8105864", "0.808559", "0.7899708", "0.7672996", "0.7613461", "0.76016873", "0.7557603", "0.7516347", "0.750852", "0.7399712", ...
0.8862716
0
Double Trouble: Create a function that changes a given array to list each existing element twice, retaining original order. Convert [4, "Ulysses", 42, false] to [4,4, "Ulysses", "Ulysses", 42, 42, false, false].
function convert(arr) { orig_length = arr.length; arr.length = arr.length * 2; for (var i = orig_length - 1; i >= 0; i--) { arr[i * 2] = arr[i]; arr[i * 2 + 1] = arr[i]; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function four(arr){\n for(var i = 0; i < arr.length; i+1){\n var temp = arr[i];\n arr[i] = arr[i+1];\n }\n return arr;\n}", "function repeatTwice(arr){\n for (var i=0; i<arr.length; i+=2){\n for (var x=arr.length-1; x>i-1; x--){\n arr[x+1] = arr[x];\n }\n ...
[ "0.64016104", "0.6379637", "0.63774914", "0.63419056", "0.6280478", "0.6259223", "0.62588906", "0.6251088", "0.6231037", "0.6205656", "0.6193226", "0.61822146", "0.6176182", "0.6137768", "0.6135131", "0.6131167", "0.61267245", "0.6116873", "0.60917133", "0.60811645", "0.60661...
0.614432
13
usare sleep(valore in millisecondi) provare a vedere
function getOutput() { document.getElementById("div_sort").innerHTML = print_don(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "sleep(){\n\n }", "function sleep(delay_in_ms) {var start_time = new Date().getTime();\nfor (var sleep_count = 0; sleep_count < 1e7; sleep_count++)\n{if ((new Date().getTime() - start_time) > delay_in_ms) break;}}", "sleep() {}", "function sleep(miliseconds) \n \t{\n var currentTime = new Date()...
[ "0.74498487", "0.7370369", "0.7300591", "0.725524", "0.7235673", "0.72171116", "0.721019", "0.7201925", "0.71424365", "0.71349776", "0.7098256", "0.7094084", "0.7090149", "0.707969", "0.7072786", "0.7067778", "0.7063896", "0.7056086", "0.7032005", "0.70293885", "0.70024675", ...
0.0
-1
funzione per stampare le persone che hanno donato
function print_don() { // quando il metodo mi deve ritornare qualcosa per prima cosa inizializzo la variabile e in fondo // metto il "return nomevariabile;" let text = ""; //let miosaldo = 0; //let maxver = 0; for (i = 0; i < ar_numeri.length; i++) { // In questo modo tutte le linee ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function stampPR(id,stamp){\n xpr.update({where:{id:id}},{translationStamp:stamp}).exec(function(err,updated){});\n }", "function saveTranscriptEntries(players) {\n transcriptHistory.push(new RollbackPoint(players));\n}", "sauvegardePanier(){\n localS...
[ "0.6292504", "0.5754932", "0.5733642", "0.5706674", "0.5663977", "0.56145823", "0.55495906", "0.5538026", "0.5517973", "0.5517281", "0.54782146", "0.54618394", "0.5432906", "0.53917104", "0.53699696", "0.5334858", "0.533091", "0.5327704", "0.53183717", "0.5277075", "0.5272463...
0.0
-1
React router demo declaring pages of application
function AppRouter(props) { return ( // Switch acts as switch case statement in cascading order <Switch> {ROUTES.map( (r, i) => ( <Route key={i} path={r.path} component={r.component} exact={r.exact} /> ), this ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Pages() {\n return (\n <main role=\"application\">\n {/* <Header /> */}\n\n {/* Home */}\n <Match\n pattern=\"/\"\n exactly\n component={Home}\n />\n {/* quienes somos */}\n <Match\n pattern=\"/about\"\n exactly\n component={About...
[ "0.7185975", "0.71224207", "0.71005356", "0.70834136", "0.7074759", "0.70523775", "0.7044667", "0.7034547", "0.70295405", "0.7001658", "0.7000645", "0.6998032", "0.6981698", "0.69731855", "0.69706774", "0.69584405", "0.69578266", "0.6952484", "0.6937797", "0.6926053", "0.6924...
0.0
-1
Function to update character counter
function updateCharCount(input){ var characters_left = 160 - input.val().length; $('#character-count').text(characters_left); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateChar() {\n tweet1Count.textContent = tweet1.textLength;\n}", "function updateCounter() {\n var charCount = tweetBody().length;\n $('#counter').html(140 - charCount);\n }", "function updateCharacterCount(elem)\n{\n\t(function( $ ) {\n\n\t $('#character_counter').css('display', 'b...
[ "0.79364026", "0.76886773", "0.7459544", "0.74517757", "0.7242023", "0.7204488", "0.7103953", "0.7103953", "0.7103953", "0.7103953", "0.70954424", "0.7094406", "0.7094406", "0.7094406", "0.7094406", "0.7094406", "0.7058013", "0.7048873", "0.7005649", "0.69876677", "0.6954713"...
0.7581094
2
Function to be triggered on ListItem componentWillUnmount to cancel fetcher Promise if is still fetching.
onListItemComponentWillUnmount(_this) { if (_this.removeFetcher instanceof Promise) { _this.removeFetcher.cancel(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "cancel () {\n this._fetching = false\n }", "cancel () {\n this._fetching = false\n }", "componentWillUnmount() {\n this.source.cancel('cancel request');\n }", "componentWillUnmount() {\n request.abort();\n }", "componentWillUnmount() {\n this.stopPolling();\n }", "co...
[ "0.65528923", "0.65528923", "0.64069635", "0.63353896", "0.63303953", "0.61881167", "0.59976965", "0.59717", "0.59550035", "0.59459955", "0.59459955", "0.59432805", "0.5926176", "0.5926176", "0.5925648", "0.5900788", "0.58764565", "0.5817255", "0.58034056", "0.5792575", "0.57...
0.8201541
0
we are not using this.handleClick() beacuse it will automatically fires
render() { return ( <form onSubmit={this.handleSubmit}> <label htmlFor='name'>Name</label> <input type="text" id='name' onChange={this.handleChange} /> <label htmlFor='age'>Age</label> <input type="text" id='age' onChange={this.handleCh...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handleClick() {}", "handleClick( event ){ }", "function handleClick(event)\n{\n}", "onClick() {\n // Verifica se existe a função para processar o click e a invoca\n if(this.handleClick) {\n this.handleClick(this);\n }\n }", "function handleClick(){\n console.log(\"clicked\");\n}", "_han...
[ "0.8524789", "0.8349428", "0.79083973", "0.78584814", "0.7789202", "0.77822554", "0.77038217", "0.7616496", "0.7527853", "0.7500059", "0.7439271", "0.74072224", "0.73925406", "0.7364062", "0.7364005", "0.7328929", "0.7286824", "0.72826535", "0.72826535", "0.7254469", "0.72349...
0.0
-1
Counting time from 0 100
function countTime() { document.getElementById("time").innerHTML = "Vreme: " + ++ value; if (value == list[0].vreme) { console.log("Kraj igre..."); localStorage.setItem('allAnswersLs', JSON.stringify(allAnswers)); stop(); finishGame(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "counter(i) {\n // call a decrement function for the seconds\n this.count()\n // check if seconds is = 0\n this.checkIfTimeIsZero(i)\n }", "function start_counting(){\n\tvar counter = hours + \":\" + minutes + \":\" + seconds;\n\tseconds += 1;\n\tif (seconds == 60) {\n\t\tminutes += 1;\n\t\tseconds =...
[ "0.6451978", "0.6413707", "0.63991845", "0.63963217", "0.6393429", "0.6381961", "0.634628", "0.6310589", "0.6295486", "0.6288267", "0.6240212", "0.6194486", "0.61587286", "0.6133757", "0.6084119", "0.6082095", "0.60649514", "0.6055021", "0.60353535", "0.5998732", "0.5980368",...
0.0
-1
Find city with dropdown list
function findCity() { for ( var i = 0; i < list[0].ponudjene.length; i++) { if (list[0].ponudjene[i].indexOf(autocomplete.value) >= 0) { var newOption = document.createElement("option"); newOption.value = list[0].ponudjene[i]; document.getElementById("guessCity").appendChild(newOptio...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function askAndReturnSearchCity() {\n return readline.question('Digite uma cidade: ')\n }", "function geoIdentify() {\n var searchCity = $(\"#inputGroupSelect03\").val();\n console.log(searchCity);\n localStorage.setItem(\"cityName\", searchCity);\n selectedCity = searchCity;\n $.ajax({\...
[ "0.68204725", "0.68178815", "0.68106824", "0.6777997", "0.6760226", "0.66938007", "0.6663458", "0.6635499", "0.661264", "0.6589164", "0.65759635", "0.6566407", "0.6532744", "0.65244704", "0.65224594", "0.64343834", "0.6429225", "0.64231336", "0.6420545", "0.64098895", "0.6404...
0.7294768
0
Function for adding cities in the list
function addCity() { var choosenCity = document.getElementById('autocomplete').value; if( choosenCity == "") { document.getElementById("messages").innerHTML = "Polje je prazno."; } else { if (correctCities.indexOf(choosenCity) > -1) { document.getElementById("messages").innerHTML = "Pogodili ste gra...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static addCity(city) {\n\t\tdestinationCities.push(city);\n\t}", "function addNewCity() {\n checkIfExists();\n cities.unshift(searchInput.value);\n cityLimit();\n}", "function addCityFn() {\n addCity();\n}", "addCity(city) {\n // If we already have the city in our map, nothing needs to be done.\...
[ "0.74560255", "0.71909916", "0.7164466", "0.6972138", "0.69689226", "0.69265586", "0.67603546", "0.6722549", "0.6665217", "0.66409945", "0.6604382", "0.6529772", "0.64588505", "0.64188695", "0.6386173", "0.63550615", "0.6348193", "0.6306394", "0.62567014", "0.62260014", "0.62...
0.590137
43
Remove item on click
function removeItem (itemid) { var item = document.getElementById(itemid); listCities.removeChild(item); allAnswers.splice(0, 1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteItem(){ \n $(this).parent().remove();\n }", "function removeItem(e) {\n e.target.parentElement.removeChild(e.target);\n}", "remove() {\n this._item = null;\n this.render();\n }", "function handleClick(){\n props.removeItem(props.item.id)\n }", "function remove...
[ "0.7636382", "0.7629769", "0.7533484", "0.743696", "0.7406032", "0.7386161", "0.73835486", "0.73690814", "0.7331197", "0.73108655", "0.7272894", "0.7264888", "0.72630584", "0.7251198", "0.72508746", "0.72506225", "0.72278327", "0.7215087", "0.71824706", "0.7173802", "0.716859...
0.0
-1
Finish game on button click
function finishGame() { stop(); localStorage.setItem('allAnswersLs', JSON.stringify(allAnswers)); window.location.href = "second.html"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function finish () {\n $(\".game\").html(\"\");\n $(\"#choices\").html(\"\");\n $(\"#wins\").text(\"Correct: \" + wins);\n $(\"#losses\").text(\"Incorrect: \" + losses);\n restart();\n }", "function finish(){\n\n // sound-effect\n playIncorrect()\n // Disable buttons, bec...
[ "0.77153313", "0.7693188", "0.7597214", "0.75774974", "0.7501223", "0.742665", "0.73363256", "0.7296121", "0.7271414", "0.7237656", "0.72006845", "0.7177559", "0.7168415", "0.7162969", "0.709192", "0.7090438", "0.70832926", "0.70651406", "0.70609605", "0.7043325", "0.7038665"...
0.0
-1
Showing progress on horisontal chart
function progress() { var allGuesses = JSON.parse(localStorage.getItem('allAnswersLs')) || []; var guessedItems = JSON.parse(localStorage.getItem('list')) || []; var canvas = document.querySelector("canvas"); var context = canvas.getContext("2d"); var count = 0; var showProcent = 0; context.fillStyle = "#696969...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setTopoPetsCaught(){\n\tdocument.getElementById(\"topoPetsFoundTitle\").innerHTML = \"<p> Recorder: \" + topoPetsCaught.total() + \"/\" + getTotalAmountTopoPets() + \" <br/><progress id='health' value=\" + topoPetsCaught.total() + \" max=\" + getTotalAmountTopoPets() + \" style='height:1vh;width:60%;'>\";...
[ "0.65421164", "0.6475017", "0.64660484", "0.63821954", "0.6321529", "0.6300846", "0.62895733", "0.6279283", "0.6240907", "0.6214271", "0.6212887", "0.6159531", "0.61511785", "0.61343044", "0.6109647", "0.60960656", "0.6094807", "0.60913515", "0.60653156", "0.60573226", "0.605...
0.0
-1
Called by IDE when a new object type is to be created
function CreateIDEObjectType() { return new IDEObjectType(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function CreateIDEObjectType()\r\n{\r\n\treturn new IDEObjectType();\r\n}", "createTypes(){\n }", "function CreateIDEObjectType() {\n\treturn new IDEObjectType()\n}", "function NewObj(){}", "function newObject(object) {\n switch (object) {\n case 'sketch':\n create(\"canvas\");\n ...
[ "0.7329899", "0.6995128", "0.69282615", "0.65377545", "0.6481848", "0.62783927", "0.62783927", "0.62783927", "0.6247697", "0.62258005", "0.6224964", "0.6188589", "0.6179595", "0.61108255", "0.5990517", "0.5927083", "0.5926398", "0.5869749", "0.58104813", "0.58080876", "0.5793...
0.71119785
22
Class representing an object type in the IDE
function IDEObjectType() { assert2(this instanceof arguments.callee, "Constructor called as a function"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function CreateIDEObjectType()\r\n{\r\n\treturn new IDEObjectType();\r\n}", "function CreateIDEObjectType()\n{\n\treturn new IDEObjectType();\n}", "function CreateIDEObjectType()\n{\n\treturn new IDEObjectType();\n}", "function CreateIDEObjectType()\n{\n\treturn new IDEObjectType();\n}", "function CreateID...
[ "0.72987866", "0.7225791", "0.7225791", "0.7225791", "0.7225791", "0.7225791", "0.7225791", "0.7225791", "0.7225791", "0.7225791", "0.7225791", "0.7225791", "0.7225791", "0.7225791", "0.7225791", "0.7225791", "0.7225791", "0.7225791", "0.7225791", "0.7225791", "0.7225791", ...
0.0
-1
Class representing an individual instance of an object in the IDE
function IDEInstance(instance, type) { assert2(this instanceof arguments.callee, "Constructor called as a function"); // Save the constructor parameters this.instance = instance; this.type = type; // Set the default property values from the property table this.properties = {}; for (var i = 0; i < property_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function CreateIDEObjectType()\r\n{\r\n\treturn new IDEObjectType();\r\n}", "function IDEInstance(instance, type)\r\n{\r\n\tassert2(this instanceof arguments.callee, \"Constructor called as a function\");\r\n\t\r\n\t// Save the constructor parameters\r\n\tthis.instance = instance;\r\n\tthis.type = type;\r\n\t\r\...
[ "0.6700975", "0.66469646", "0.6633252", "0.6633252", "0.6633252", "0.6633252", "0.6633252", "0.6633252", "0.6633252", "0.6633252", "0.6633252", "0.6633252", "0.6633252", "0.6633252", "0.6633252", "0.6633252", "0.6633252", "0.6633252", "0.6633252", "0.6633252", "0.6633252", ...
0.66014403
54
funciones relacionadas con los Gastos
function saveGastos(nuevoGasto) { let gastos = getGastos(); gastos.unshift(nuevoGasto); updateGastos(gastos); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Go_Funciones()\n {\n if( g_listar == 1 )\n {\n Get_Marca_Producto();\n }\n \n }", "function miFuncion(){}", "function miFuncion(){}", "function miFuncion(){}", "function miFuncion (){}", "function cargarpista1 (){\n \n}", "function fun1(){} //tod...
[ "0.6610976", "0.6299701", "0.6299701", "0.6299701", "0.62564987", "0.6078253", "0.60611624", "0.6029226", "0.59670305", "0.5945532", "0.5931808", "0.5922256", "0.59208757", "0.5910826", "0.5894993", "0.5853905", "0.58425933", "0.583888", "0.58201087", "0.57881284", "0.5753941...
0.0
-1
Gets the subform that is currently displaying (firstForm, secondForm...) and collects all the values inside. Then puts the values in the correct state.
submitForm(e) { e.preventDefault() let inputValues = {} let checkboxValues = {} let id = '' /* The form set active (firstSet, secondSet ...) */ for (let formSet in this.refs) { id = formSet /* Each input field in set */ for (let inputField in this.refs[formSet].refs)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function populateJs2Form(){\n\t//Primero determinamos el modo en el que estamos;\n\tvar mode = getMMGMode(get('cccSubprFrm.accion'), \n\t\tget('cccSubprFrm.origen'));\n\n\n\tset('cccSubprFrm.id', jsCccSubprId);\n\tset('cccSubprFrm.ccprOidProc', [jsCccSubprCcprOidProc]);\n\tset('cccSubprFrm.codSubp', jsCccSubprCodS...
[ "0.61156213", "0.6093819", "0.6031699", "0.59810567", "0.58977956", "0.5792851", "0.57549006", "0.5710491", "0.56891245", "0.5667808", "0.5634643", "0.5632021", "0.5596986", "0.5573797", "0.5557833", "0.55183434", "0.551395", "0.5512422", "0.5509621", "0.54935014", "0.5466178...
0.5461178
22
Used by the arrow to submit the current form and to go back or forth
clickSubmitButton(direction) { document.getElementById('submitButton').click() this.setState({ complete: false }) if(direction == "back") { this.props.decreaseStepCounter() } else if (direction == "forward") { this.props.increaseStepCounter() } // If the la...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function goBack()\n{\n if (document.forms[0].calledFrom.value==\"onGoingProjects\")\n {\n document.forms[0].action=\"/ICMR/allocatorAbstract.do?hmode=ongoingDetails\";\n }\n else if (document.forms[0].calledFrom.value==\"fullPaper\")\n {\n document.forms[0].ac...
[ "0.7378159", "0.7168328", "0.6995804", "0.69280726", "0.68050843", "0.67471886", "0.6601531", "0.6570943", "0.65574926", "0.654882", "0.6477917", "0.64691955", "0.6464225", "0.6464225", "0.6434781", "0.64254725", "0.64182115", "0.6414392", "0.63715494", "0.6357086", "0.633841...
0.68877757
4
const fogColor = 0xed5628;
function start() { //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // This section just checks if the libraries and APIs are compatible with the user's browser container = document.getElementById("con...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getColor(magnitude) {\r\n if (magnitude > 5) {\r\n return \"#ea2c2c\";\r\n }\r\n if (magnitude > 4) {\r\n return \"#ea822c\";\r\n }\r\n if (magnitude > 3) {\r\n return \"#ee9c00\";\r\n }\r\n if (magnitude > 2) {\r\n return \"#eecc00\";\r\n }\r\n if (magnitude > 1) {\r\n return \"#d...
[ "0.6376569", "0.6363412", "0.6353625", "0.63404024", "0.6323016", "0.6304014", "0.6282675", "0.62651795", "0.62606823", "0.6254571", "0.62543386", "0.6249618", "0.6236016", "0.62343204", "0.61820483", "0.61633307", "0.6162167", "0.6151022", "0.61469465", "0.61330646", "0.6132...
0.0
-1
set text of percentage or absolute amount of refugees in tooltip
function setTextTooltipTimeline(title, amount) { svgTooltipTimelineCountry.select("text.textAmount") .attr("transform", "translate(" + xTooltipTimeline + "," + yTooltipTimeline + ")") .text(title + amount.toLocaleString()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setToolTipContent(element, item) {\n element.text('Unemployed: ' + Math.round(this.valueAccessor(item) * 100) +'%');\n }", "function updateProgressTooltip()\n {\n my.html.progress.title =\n 'This lesson contains ' + my.current.subunitText.length +\n ' characters.'\n ...
[ "0.71805096", "0.6873654", "0.68532634", "0.6786721", "0.66615427", "0.6485261", "0.6455398", "0.6407328", "0.63282746", "0.6208611", "0.62038696", "0.6136119", "0.6128903", "0.6125928", "0.60926664", "0.6080274", "0.60755455", "0.6053023", "0.60503435", "0.60187805", "0.6006...
0.5904081
38
change tooltip when mouse is moved
function mousemoveCountry() { // set correct domain yG.domain([0, maxDataGraphCountryAmount]); // select correct year and data var timeMouse = xG.invert(d3.mouse(this)[0]), i = bisectDate(dataGraphCountry, timeMouse, 1), dataLeft = dataGraphCountry[i - 1], dataRight = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "set tooltip(value) {}", "function moveTooltip() {\n\t tooltip.style(\"top\",(d3.event.pageY+tooltipOffset.y)+\"px\")\n\t .style(\"left\",(d3.event.pageX+tooltipOffset.x)+\"px\");\n\t}", "function mousemoveDeputy() { return tooltip.style(\"top\", (event.pageY - 10)+\"px\").style(\"left\",(event.pageX + 10...
[ "0.77612", "0.77122474", "0.7696088", "0.76348853", "0.7326356", "0.7322236", "0.727797", "0.7230713", "0.72055286", "0.71360296", "0.7135747", "0.7131376", "0.7108333", "0.7093858", "0.7077062", "0.70742923", "0.70598894", "0.70517653", "0.70350415", "0.699022", "0.69888604"...
0.0
-1
add the tooltip for the timeline for countries
function addTooltipTimelineCountry() { // make svg for tooltip svgTooltipTimelineCountry = svgGraphCountry.append("g") .style("display", "none"); // append vertical line svgTooltipTimelineCountry.append("line") .attr("class", "xTooltip") .style("stroke", "black") ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tooltip_text(d) {\n\t\t\ttext = '<h4>' + d['Country'] + '</h4>' + \n\t\t\t\t'<ul><li><b>Location</b>: '+ d['Detailed Locations'] +\n\t\t\t\t'</li><li><b>Duration</b>: '+ d['Duration'] + ' days' +\n\t\t\t\t'</li><li><b>Main Cause</b>: ' + d['Main cause'] + \n\t\t\t\t'</li><li><b>Displaced</b>: ' + numberFo...
[ "0.6496237", "0.6443862", "0.6393793", "0.62697685", "0.6230814", "0.6173228", "0.6123911", "0.61227447", "0.6102292", "0.60511374", "0.6006429", "0.5983125", "0.5950453", "0.5937911", "0.5918584", "0.59122473", "0.58976835", "0.58749914", "0.5853458", "0.58484405", "0.583061...
0.77612704
0
Sent the HTTP request to reset the account's password
function resetPassword(e) { e.preventDefault(); axios .put(`${defaults.serverUrl}/account/change-credentials/${accountID}`, { security: questions, newPW: password, }) .then((res) => { localStorage.setItem("token", res.data); alert("Your password has been change...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resetPassword() {\r\n \tconsole.log(\"Inside reset password\");\r\n \t//self.user.userpassword = self.user.password;\r\n \tself.user.user_id = $(\"#id\").val();\r\n \tself.user.obsolete = $(\"#link\").val();\r\n \tdelete self.user.confpassword;\r\n \tUserService.changePassword(self.user)...
[ "0.6885612", "0.6855502", "0.68040204", "0.67182285", "0.66987187", "0.664433", "0.6633846", "0.65740794", "0.6572098", "0.6553493", "0.65175575", "0.65152925", "0.6512206", "0.6479541", "0.6461162", "0.64426136", "0.6410817", "0.63861954", "0.6264042", "0.6257844", "0.625008...
0.68578917
1
Set process.env from .env
function env() { var e; try { e = fs.readFileSync('.env', { encoding: 'utf-8' }).split('\n'); } catch (b) { return; } for (var i = 0; i < e.length; i++) { process.env[e[i].split('=')[0].trim()] = e[i].split('=')[1].trim(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setEnv(env) {\n\n if (env === 'prod') {\n process.env.NODE_ENV = 'production';\n } else {\n process.env.NODE_ENV = 'development';\n }\n\n}", "addEnv() {\n this.config = Object.assign(this.config, process.env);\n }", "function processEnv() {\n process.env.NODE_ENV = env.NODE_ENV || 'dev';...
[ "0.74280155", "0.74022406", "0.728741", "0.7228225", "0.70579505", "0.69020456", "0.67117107", "0.66866064", "0.6649357", "0.66219944", "0.6588975", "0.6558506", "0.6558506", "0.6519788", "0.64954036", "0.6447252", "0.6384709", "0.6372811", "0.63621795", "0.63111293", "0.6212...
0.77474797
0
Set keys from `process.env`.
function config() { for (var i = 0; i < keys.length; i++) { var line = keys[i] + ' = ' + process.env[keys[i]] + '\n'; debug('added %s to config.ini', line); fs.appendFileSync('config.ini', line); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setEnvironmentVariables() {\n process.env.apiKey = this.configuration.apiKey;\n }", "function env() {\n var e;\n try {\n e = fs.readFileSync('.env', { encoding: 'utf-8' }).split('\\n');\n } catch (b) {\n return;\n }\n for (var i = 0; i < e.length; i++) {\n process.env[e[i].split('=')[0].t...
[ "0.6974592", "0.6631043", "0.6314492", "0.6303617", "0.62899244", "0.62740564", "0.62082565", "0.6137163", "0.60513496", "0.5992437", "0.59615093", "0.594787", "0.5923202", "0.58681744", "0.57432294", "0.5742751", "0.57295847", "0.5722862", "0.5721887", "0.559386", "0.5589966...
0.5593438
20
Function that converts date (todays date) into a mm/dd/yyyy format
function Currentdaydate() { var date = new Date(); var dd = date.getDate(); var mm = date.getMonth() + 1; var yyyy = date.getFullYear(); if (dd < 10) { dd = '0' + dd; } if (mm < 10) { mm = '0' + mm; } var today = mm + '/' + ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static formatDateDDMMYYYY(date) {\n if (Common.isNullOrUndifined(date)) return \"\";\n try {\n return moment(date).format(\"DD/MM/yyyy\");\n } catch (error) {\n console.log(\"formatDateDDMMYYYY\\n\" + error);\n }\n }", "function dateFmtStr(today) {\n\n var ...
[ "0.7434295", "0.7406543", "0.73594046", "0.7334521", "0.732538", "0.73111355", "0.73108107", "0.72979057", "0.726679", "0.724643", "0.7231359", "0.72290117", "0.7194551", "0.7191779", "0.71907705", "0.71685696", "0.71516776", "0.7133136", "0.71132916", "0.7107537", "0.7105762...
0.0
-1
Function that converts dates of the week into mm/dd/yyyy format
function WeekDates() { var weekdates = new Date; var dd = weekdates.getDate(); var mm = weekdates.getMonth() + 1; var yyyy = weekdates.getFullYear(); if (dd < 10) { dd = '0' + dd; } if (mm < 10) { mm = '0' + mm; } return { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function weekToDate(weekNum){\n return formatDate(new Date(weekNum*weekfactor));\n}", "function getMondayToFridayFromWeekNum(weekNum, year) {\n var date = new Date(year, 0, (1 + (weekNum - 1) * 7));\n var monday = new Date(date.setDate(date.getDate() - date.getDay() + 1));\n var...
[ "0.69551307", "0.6303111", "0.62364167", "0.61838824", "0.61767834", "0.6166002", "0.6161657", "0.6159947", "0.61371833", "0.61274964", "0.6107329", "0.6106592", "0.61010456", "0.60969067", "0.6082028", "0.60463965", "0.60344523", "0.60171026", "0.5998131", "0.5992984", "0.59...
0.6238799
2
Function that displays API response in dashboard display
function DashboardDisplay(response) { // Todays weather data var iconurl = "http://openweathermap.org/img/w/" + response.daily[0].weather[0].icon + ".png"; $("#wicon").attr("src", iconurl); currentweather.find("#cheader").text(`${cityname} ${today}`); var temperature = (response....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showOutput(res) {\n document.getElementById('res').innerHTML = `\n <div class=\"card card-body mb-4\">\n <h5>Status: ${res.status}</h5>\n </div>\n <div class=\"card mt-3\">\n <div class=\"card-header\">\n Headers\n </div>\n <div class=\"card-body\">\n <pre>${JSON.stringify(res....
[ "0.6997377", "0.6975931", "0.6904419", "0.6828513", "0.6826299", "0.6756402", "0.6752761", "0.6705051", "0.6650868", "0.65838546", "0.64838684", "0.6443718", "0.642263", "0.6351554", "0.6339345", "0.63309455", "0.6329146", "0.631492", "0.6285627", "0.6268224", "0.62532383", ...
0.60800594
35
Sets and gets value from local storage and creates search history button with value from local storage (city name)
function createbutton(a, obj){ //storing and retrieving data from local storage var history = JSON.parse(localStorage.getItem("cities")) || [] history.push({ city: a, data: obj, }) localStorage.setItem("cities", JSON.stringify(history)) //creating ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onLoad() {\n if (localStorage.getItem('cityname') != '') {\n var cityStore = JSON.parse(localStorage.getItem('cityname'));\n if (cityStore != null) {\n for (var i = 0; i < cityStore.length; i++) {\n var btn = $(\"<button>\");\n btn.text(cityStore[i...
[ "0.81398344", "0.7990267", "0.7784191", "0.7744496", "0.7721498", "0.76338166", "0.7628726", "0.76230025", "0.75352126", "0.74576616", "0.74259967", "0.7403428", "0.74018306", "0.7387331", "0.73589844", "0.7222343", "0.71503246", "0.71500474", "0.7141769", "0.7133429", "0.713...
0.68917084
47
the History of Javascript
function Person(firstname, lastname) { console.log(this); this.firstname = firstname; this.lastname = lastname; console.log('this functions is invoked'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function History() {\n}", "function setHistory() {\n // clear undo history\n $('#undoHistoryList')\n .empty();\n\n // load new history list from server\n getHistoryFromServer(addHistList);\n}", "function History_History()\n{\n\t//call reset\n\tthis.Reset();\n}", "function voltarHistory()\n...
[ "0.75971776", "0.6737789", "0.6690706", "0.6634076", "0.66028786", "0.6581085", "0.649387", "0.6430169", "0.63954294", "0.63365626", "0.6335077", "0.6317353", "0.6317353", "0.6317353", "0.63099736", "0.62789166", "0.62193084", "0.617301", "0.61521304", "0.6115871", "0.6102432...
0.0
-1
Give enough info to display list of players
toDisplay() { return { player_names: this.p_name, player_LIDs: this.p_lid, player_active: this.p_active }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayPlayers(players) {\n\t\tplayerList.html('');\n\t\tfor (var i = players.length-1; i >= 0; i--) {\n\t\t\tvar listItem = $('<li></li>');\n\t\t\tvar playerName = $('<span class=\"player-name\"></span>');\n\t\t\tplayerName.append(players[i].name);\n\t\t\tvar playerPoints = $('<span class=\"player-points...
[ "0.8064442", "0.7376131", "0.7294596", "0.7191747", "0.7123725", "0.71196705", "0.7095715", "0.6987875", "0.6930124", "0.6882796", "0.68824977", "0.6826414", "0.67521375", "0.6704832", "0.66649246", "0.66487", "0.6584979", "0.650994", "0.6485073", "0.64635193", "0.6460917", ...
0.6945908
8
For returning the old name of a player in case of change name error
getCurrentName(socket_id) { return this.p_name[this.p_sid.indexOf(socket_id)]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "changeNameClickHandler() {\n const playerName = prompt('Enter Player Name');\n const isValid = this.isNameValid(playerName);\n if (!isValid) {\n return;\n }\n\n this.newGame.setPlayerName(playerName);\n this.playerID.textContent = this.newGame.getPlayerName();\n }", "function renamePlayer...
[ "0.7138832", "0.710955", "0.7051467", "0.693635", "0.6881693", "0.6809672", "0.6714552", "0.6689671", "0.66835594", "0.6662057", "0.65859735", "0.6585129", "0.65540665", "0.6528199", "0.6504903", "0.65005285", "0.64991343", "0.64723194", "0.6470646", "0.6450081", "0.6409081",...
0.0
-1
Similar to getCurrentName, but the existence of the socket id is not guaranteed
getName(socket_id) { return this.p_sid.includes(socket_id) ? this.retSuccess(this.p_name[this.p_sid.indexOf(socket_id)]): this.retError(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getCurrentName(socket_id) {\n return this.p_name[this.p_sid.indexOf(socket_id)];\n }", "getNameFromSocket(socket) {\n return this.socketNames[socket.id];\n }", "function getSocketId() {\n const socketId = socket ? socket.id : 'none';\n\n return socketId || 'none';\n}", "function get...
[ "0.8487431", "0.78297514", "0.71970487", "0.6667891", "0.66554207", "0.62347203", "0.6212068", "0.61965036", "0.6025337", "0.60131174", "0.5995728", "0.5986967", "0.5955317", "0.59235895", "0.58686024", "0.5794246", "0.5687194", "0.5674834", "0.567271", "0.5621823", "0.560683...
0.7423767
2
Give enough info to create a game object using existing player list
toGame() { return { player_names: this.p_name, player_SIDs: this.p_sid, } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addPlayer(no,firstName,lastName,pos,bat,thw,age,ht,wt,birthplace) {\n let player = {\n No: no,\n firstName: firstName,\n lastName: lastName,\n POS: pos,\n BAT: bat,\n THW: thw,\n AGE: age,\n HT: ht,\n WT: wt,\...
[ "0.69133663", "0.6874447", "0.68508977", "0.68196446", "0.6717609", "0.660727", "0.6570168", "0.6569331", "0.6555672", "0.6526303", "0.65090996", "0.65070254", "0.6502719", "0.64461917", "0.64411837", "0.64387226", "0.63757217", "0.6350539", "0.6313563", "0.63062394", "0.6292...
0.58707476
90
Game ends and all DCed players must be removed
purge() { const purged_ids = []; for (let i = this.p_active.length - 1; i >= 0; i-=1) { if (!this.p_active[i]) { purged_ids.push(this.p_lid[i]); this.p_name.splice(i, 1); this.p_lid.splice(i, 1); this.p_sid.splice(i, 1); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function endGame() {\r\n newGameCounter = 0;\r\n gameStarted = false;\r\n players = players.concat(audience);\r\n audience = [];\r\n io.emit('update users', players, audience)\r\n io.emit('end game on client');\r\n\r\n }", "function gameEnd(){\n\tplayer.start = false;...
[ "0.74747807", "0.7256139", "0.724489", "0.72368884", "0.7146473", "0.7005696", "0.69400615", "0.6922172", "0.69055885", "0.6901846", "0.69012976", "0.6890636", "0.68015563", "0.67526734", "0.67371345", "0.6707909", "0.67044693", "0.6645592", "0.66443807", "0.6643921", "0.6632...
0.0
-1
End click Function Reset Form Add New Service
function resetFormAddProduct() { $('.toast_added').stop().fadeIn(400).delay(3000).fadeOut(500); $('#productName').val(''); $("#ddlType").val('2'); $('#ddlProductType').val('1'); document.getElementById("productId").textContent = 0; $('#ddlType').prop('disabled', false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cancelNewLead() {\n clearNewLeadForm();\n}", "function resetNewService() {\n $scope.newService = {\n student: $scope.student.id,\n title: '',\n description: '',\n fulfilled: 'No',\n fulfilled_date: null,\n fulfilled_user: null,\...
[ "0.66552293", "0.6602084", "0.65506375", "0.65506375", "0.6493321", "0.6493321", "0.6422808", "0.642111", "0.6405088", "0.6403277", "0.6312157", "0.63097864", "0.6296998", "0.62826365", "0.62766314", "0.625459", "0.61162746", "0.610817", "0.6103717", "0.6100362", "0.60981685"...
0.59282714
45
load results from web worker
function loadResult() { console.log("[loadResult] blob = ", blob); workerFor.postMessage(blob, [blob]); workerFor.postMessage(blobObj, [blobObj.img1]); // transfer only blobObj.img1 workerFor.postMessage(blobArr, [blobArr[1]]); // transfer only blobObj[1] }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startWorker()\n {\n if (typeof(Worker) !== \"undefined\")\n {\n _searchThread = new Worker(\"js/loadCubeList.js\");\n _searchThread.onmessage = function(event)\n {\n var list = event.data;\n loadFilteredNCubeListView(list);\n ...
[ "0.64165545", "0.6358327", "0.61882794", "0.59129167", "0.58392197", "0.5823597", "0.5758627", "0.57364094", "0.5735686", "0.5638091", "0.56309766", "0.5627992", "0.5624551", "0.5619162", "0.5590466", "0.5566276", "0.5553714", "0.5544564", "0.55393785", "0.5524943", "0.548623...
0.65303236
0
Given a string, return the character that is most commonly used in the string. Examples maxChar("abcccccccd") === "c" maxChar("apple 1231111") === "1"
function maxChar(str) { let obj={} for (let l of str){ obj[l] ? obj[l]++ : obj[l]=1 } let max = 0 let maxChar = '' for (o in obj){ if(obj[o]>max){ max = obj[o] maxChar = o } } return maxChar }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function maxChar(string){\n\tlet max = 1;\n\tconst chars = {};\n\tlet maxChar = '';\n\n\tfor(let char of string){\n\t\tif(!chars[char]){\n\t\t\tchars[char] = 1;\n\t\t} else {\n\t\t\tchars[char]++;\n\t\t\tif(chars[char] > max){\n\t\t\t\tmax = chars[char];\n\t\t\t\tmaxChar = char;\n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn ...
[ "0.8331735", "0.82964784", "0.8292285", "0.8290599", "0.82865804", "0.82846874", "0.8271469", "0.82687974", "0.82592064", "0.8223037", "0.8206115", "0.817491", "0.81650627", "0.8143253", "0.8109554", "0.81030214", "0.8016722", "0.8001023", "0.7980841", "0.7977067", "0.7968101...
0.78715706
23
Adds ctx.getTransform() returns an SVGMatrix Adds ctx.transformedPoint(x,y) returns an SVGPoint
function trackTransforms(ctx){ var svg = document.createElementNS("http://www.w3.org/2000/svg",'svg'); var xform = svg.createSVGMatrix(); ctx.getTransform = function(){ return xform; }; var savedTransforms = []; var save = ctx.save; ctx.save = function(){ savedTransforms.push(xform.tran...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_transformedPoint(x, y) {\n let pt = this._svg.createSVGPoint()\n pt.x = x * this._pixelRatio()\n pt.y = y * this._pixelRatio()\n return pt.matrixTransform(this._transform.inverse())\n }", "function trackTransforms(ctx){\n let svg = document.createElementNS(\"http://www.w3.org/2000/svg\",'svg');\...
[ "0.77840143", "0.69103014", "0.67860043", "0.674424", "0.6743247", "0.6728668", "0.66698474", "0.6600177", "0.6512291", "0.64716774", "0.6413057", "0.6377274", "0.6180481", "0.61788034", "0.61553687", "0.6115088", "0.61076355", "0.6074629", "0.6053022", "0.60376143", "0.59993...
0.68571794
2
This will handle the submit form event.
handleSave(event) { event.preventDefault(); const data = new FormData(event.target); // PUT request for Edit customer. if (this.state.customers.id) { var id = this.state.customers.id; fetch('api/Customer/Edit/'+id, { method: 'PUT', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function formSubmitHandler(event) {\n event.preventDefault();\n buttonSubmitHandler(deck);\n }", "function handleFormSubmit(event) {\n event.preventDefault();\n // Wont submit the report if we are missing a body, title, or member\n if (!titleInput.val().trim() || !bodyInput.val().trim() || !membe...
[ "0.7670349", "0.7506133", "0.7462313", "0.74342716", "0.74313647", "0.7410035", "0.7381698", "0.73371285", "0.7258174", "0.72256947", "0.7214125", "0.71919626", "0.7171068", "0.7128045", "0.70996714", "0.7088517", "0.70812315", "0.70763206", "0.70709765", "0.70573086", "0.703...
0.0
-1
This will handle Cancel button click event.
handleCancel(e) { e.preventDefault(); this.props.history.push("/"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleCancelButton() {\n\t\tconsole.log(\"Now cancelling action..\");\n\t\tCounterStart = 0; \t// reset counter\t\t\t\t\n\t\tcloseCancelPopup();\n\t\trevertChanges(command);\n\t\tconsole.log(\"Reverting changes..\");\t\n\t}", "_handleClickCancel(e) {\n if (DEBUG) {\n console.log('[*] '...
[ "0.8231483", "0.8052951", "0.8039786", "0.78985137", "0.7888834", "0.7888834", "0.7888743", "0.78493476", "0.7800163", "0.77988017", "0.7706504", "0.769318", "0.76929975", "0.76896024", "0.7637529", "0.7572422", "0.7572422", "0.7572422", "0.7572422", "0.7572422", "0.7572422",...
0.0
-1
Returns the HTML Form to the render() method.
renderCreateForm() { return ( <form onSubmit={this.handleSave} > <Errors errors={this.state.errors} /> <div className="form-group row" > <input type="hidden" name="id" value={this.state.customers.id} /> ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "render() {\n this.formElement.setAttribute(\"id\", this._id);\n this.formElement.setAttribute(\"method\", this._method);\n if (this._acceptFiles) {\n this.formElement.setAttribute(\"enctype\", \"multipart-form-data\");\n }\n\n // Append all of the field in collection\n this._fieldCollection....
[ "0.76319176", "0.66202164", "0.65379584", "0.6508061", "0.6504819", "0.6390697", "0.62578857", "0.62578857", "0.62578857", "0.6168713", "0.61665964", "0.6109711", "0.6097447", "0.60909843", "0.60907227", "0.6059021", "0.6034647", "0.6002963", "0.60023874", "0.5986226", "0.596...
0.0
-1
Removes the route from the API server is already registered.
function removeRouteIfAvailable(app, endpoint) { if(removeRoute.findRoute(app, endpoint.url)) { removeRoute(app, endpoint.url); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clearRoutes () {\n app._router.stack = app._router.stack.filter(\n k => !(k && k.route && k.route.path && k.route.path.startsWith(apiRoot))\n )\n}", "function removeRoute() {\n if (listRoute && listRoute.length) {\n for (let route of listRoute) {\n map.removeObject(route);\n ...
[ "0.6743372", "0.6713041", "0.6597121", "0.64533126", "0.64533126", "0.64280546", "0.60321087", "0.6011689", "0.6000098", "0.59792256", "0.5940388", "0.57285243", "0.57113576", "0.5707843", "0.569918", "0.5625375", "0.5624261", "0.56003106", "0.5596467", "0.5579974", "0.557629...
0.7122652
0
Reads all from db and calls to render page
function readAllItemsAndRender(aData) { try { let res = aData[0]; let page = aData[1]; let params = { "imageWidth": IMAGE_WIDTH, "imageHeight": IMAGE_HEIGHT, "numItems": 0, "sItemNames": "", "sItemIds": "", "aItemImages"...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderHomePage(request, response) {\n let selectBooks = 'SELECT id, author, title, isbn, image_url, description FROM books;';\n client.query(selectBooks).then(result => {\n response.render('pages/index', { booksList: result.rows, booksCount: result.rows.length });\n });\n}", "async function init...
[ "0.6565778", "0.65285575", "0.6402749", "0.63693386", "0.6364372", "0.63326573", "0.6329032", "0.629263", "0.6269655", "0.6188449", "0.61872447", "0.6184494", "0.61770594", "0.6142173", "0.6106076", "0.60953903", "0.60838735", "0.606812", "0.6052416", "0.60426825", "0.6039896...
0.5952687
28
Render everything. Initially I wasn't sure if it would all be single page, hence Page1
function renderPage1(aData) { try { let res = aData[0]; let params = aData[1]; let aItems = aData[2]; params = getHomePageParams(params, aItems); res.render("Page1.html", params, function (err, data) { if (!err) { res.writeHead(200, { "Content-Type...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "renderPage() {\t\t\n\t\tswitch (this.props.data.active) {\n\t\t\tcase 'user': \n\t\t\t\treturn this.renderUserInfo(this.props.data.body);\t\t\t\n\t\t\tcase 'repos': \n\t\t\t\treturn this.renderRepos(this.props.data.body);\n\t\t\tcase 'about': \n\t\t\t\treturn this.renderAbout();\t\t\t\t\t\n\t\t}\n\t}", "renderPa...
[ "0.76055104", "0.75027585", "0.74462473", "0.72763485", "0.7054052", "0.70471704", "0.69375575", "0.6770603", "0.67650604", "0.6701247", "0.664945", "0.664945", "0.6613953", "0.6600782", "0.6573721", "0.6573721", "0.6573721", "0.6573721", "0.6573721", "0.6573721", "0.6573721"...
0.6669768
10
Partially render home page
function renderHomePageDiv(aData) { try { let res = aData[0]; let params = aData[1]; let aItems = aData[2]; params = getHomePageParams(params, aItems); res.render("AjaxPartialHomePageRes.html", params, function (err, data) { if (!err) { res.writeHe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function home(){\n\tapp.getView().render('vipinsider/insider_home.isml');\n}", "function renderHomePage() {\n var items = $('.cvt-report li');\n if (items) {\n items.remove();\n }\n \n var page = $('.home');\n page.addClass('visible');\n }", "function dis...
[ "0.7709018", "0.7700168", "0.7634254", "0.7617942", "0.7480066", "0.74229676", "0.74064505", "0.73551846", "0.7259968", "0.7151924", "0.70688546", "0.70616597", "0.70309275", "0.69990826", "0.6904058", "0.6875607", "0.6863733", "0.68540764", "0.684149", "0.6836323", "0.683486...
0.0
-1
Partially render view page
function renderViewPageDiv(aData) { try { let res = aData[0]; let params = aData[1]; let item = aData[2]; if (!item) { item = { name: "dummy name", image: "dummy image", comment: "dummy comment", yum: "0" }; } params.itemInfo = { name: item.name, image: it...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "renderPage() {}", "function renderPage() {\n\n if (STORE.view === 'start') {\n if (game1.sessionToken) {\n $('start-button').attr('disabled', false);\n }\n $('.page').html(renderStartView());\n }\n if (STORE.view === 'questions') {\n console.log('about to render');\n $('.page').html(render...
[ "0.79525185", "0.74772537", "0.7126627", "0.69879466", "0.69879466", "0.697621", "0.6969227", "0.695133", "0.69325143", "0.69325143", "0.69325143", "0.68702453", "0.6823557", "0.6782566", "0.67491513", "0.67484164", "0.6747563", "0.6677262", "0.6665194", "0.6658673", "0.66167...
0.6335175
41
need to figure out if I want to manually add all the stuff for the projects. If mapped out. the first project needs to have a rounded aspect to it, then the last one
render() { return ( <div> <Navbar/> <div className="container p-2"> <div className="row m-0 p-2 offcolor rounded"> <div className="row m-0"> <div className="col-md-12 col-lg-6 p-3 contentcolor text-center"> ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function projectConstruction() {\n $(\".models canvas\").wrap(\"<div class='project-link'>\");\n\n $(\".project\").each(function(i, el) {\n $(\".project-link:nth-of-type(\"+(i+1)+\")\")\n .append(\"<span>\"+('0' + (i+1)).slice(-2)+\"</small>\")\n .append(\"<h2>\"+$(el).find(\"h1\").text(...
[ "0.5588585", "0.55809176", "0.53148746", "0.5299922", "0.5239121", "0.52333903", "0.51042473", "0.50530356", "0.5034233", "0.5011784", "0.4997622", "0.49945346", "0.4971142", "0.49628448", "0.4960284", "0.4951821", "0.49437776", "0.49378806", "0.49359965", "0.4931281", "0.490...
0.0
-1
expected = 6; actual = multBY(2)(3); console.log('actual=', actual, ', expected=', expected); expected = 24; actual = mul(2)(3)(4); console.log('actual=', actual, ', expected=', expected); timeout();
function countClicks() { var counter = 0; document.querySelector('button').onclick = (function() { counter++; console.log(counter);}) console.log(counter); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function TestMultiply(a, b) {\n return a * b;\n}", "multiply(times) {\n\n }", "function multiplytest(v1, v2, expected) {\n results.total++;\n var r = calculator.multiplication(v1, v2);\n if (r !== expected) {\n results.bad++;\n console.log(\"Expected \" + expected +\n \", but was ...
[ "0.6795513", "0.6717841", "0.6690728", "0.6462638", "0.629231", "0.6286349", "0.6276542", "0.6082003", "0.6031317", "0.5977373", "0.5970824", "0.59646326", "0.5941469", "0.5930199", "0.5930199", "0.59182054", "0.5912663", "0.5884301", "0.5874819", "0.58625376", "0.58625376", ...
0.0
-1
Defines how to detect object's type:
function subjectName(subject) { if (!subject || typeof subject === 'string') { return subject } return subject.constructor.mapper.name }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function is( obj, type ) {\n return typeof obj === type;\n }", "function is( obj, type ) {\n return typeof obj === type;\n }", "function is( obj, type ) {\n return typeof obj === type;\n }", "function is( obj, type ) {\n return typeof obj === type;\n }", "function is( obj,...
[ "0.7268146", "0.719434", "0.719434", "0.719434", "0.719434", "0.719434", "0.719434", "0.719434", "0.719434", "0.719434", "0.719434", "0.719434", "0.719434", "0.719434", "0.719434", "0.719434", "0.719434", "0.719434", "0.719434", "0.719434", "0.70895785", "0.70895785", "0....
0.0
-1
Gets current account and displays it in the header
async function getAccount() { let account = "No account"; if (web3.currentProvider) { account = await web3.eth.getAccounts(); } return account }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async show({ auth }) {\n return auth.user.account().fetch()\n }", "function updateHeader(){\n if(currentUser){\n document.getElementById(\"me\").innerHTML = currentUser.username;\n } else {\n document.getElementById(\"me\").innerHTML = \"LOGIN\";\n }\n}", "function userInfo() {\n var ur...
[ "0.69056207", "0.6627995", "0.6443837", "0.64022356", "0.6368886", "0.6270809", "0.6243097", "0.62370116", "0.6159391", "0.6151816", "0.6148803", "0.6120977", "0.6108576", "0.6092795", "0.5992005", "0.5989754", "0.59561676", "0.59339195", "0.59239894", "0.5922234", "0.5918231...
0.5587856
41
Pseudocode 1. assume an array arr 2. let sum equal to first item of arr 3. let i = 1 4. if i 6 [1,2,3] > 6 Steps: 1+2 = 3 3+3 = 6 [5,6,7,1] > 19 5 + 6 = 11 11 + 7 = 18 18 + 1 = 19 Write a program that sorts an array of numbers
function sortArray(arr) { let sortedArray = []; for (let i = 0; i < arr.length + sortedArray.length; i++) { let min = getMin(arr); let smallestNumbIndex = arr.indexOf(min); arr.splice(smallestNumbIndex, 1); sortedArray.push(min); } console.log(sortedArray) return sortedArray; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function three(nums, target) {\n // store count of how many times a triplet sum is less than target number\n // sort array\n // iterate through array stopping 2 numbers before end\n}", "function createArray(arr) {     \n //var arr = [1,2,5] ;  \n    for (var i = 0; i < arr.length; i++) { \n //...
[ "0.70348257", "0.68799204", "0.67726105", "0.6772183", "0.67581385", "0.66321045", "0.6562214", "0.6542885", "0.6490468", "0.6458733", "0.64172775", "0.63804764", "0.63741946", "0.6373", "0.6344536", "0.633968", "0.6332896", "0.632854", "0.6320693", "0.6298092", "0.6280722", ...
0.0
-1
4 push > [4] 5 unshift > [5,4] 3 push > [5,4,3] 7 unshift > [7,] [4] sortArray([4,5,3,7])
function getMin(arr) { let min = arr[0]; for (let i = 1; i < arr.length; i++) { if (arr[i] < min) { min = arr[i]; } } return min; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sort(arr) {\n var aux = new Array(arr.length);\n mergeSort(arr, aux, 0, arr.length - 1);\n}", "function insertionSort(arr) {\n \n}", "function sortArray(a) {\n // From start to \"this point\" | Controller\n for (var i = 0; i <= a.length; i++) {\n // Moving the elements to the next point \n ...
[ "0.68236035", "0.66861784", "0.6655724", "0.6644781", "0.662679", "0.65981454", "0.6591462", "0.65527254", "0.6551005", "0.6514252", "0.6509864", "0.64947855", "0.6488941", "0.6484915", "0.64837426", "0.64781296", "0.64588237", "0.64530045", "0.64427227", "0.6419553", "0.6419...
0.0
-1
[4,5,3,7] > [3,4,5,7] 1. identify smallest number 2. let indexMin be the smallest number's index 3. let indexSecond be indexMin + 1 4. Create a program that finds the sum of all numbers in an array
function sumArrayItems(arr) { let sum = 0; for (let i = 0; i < arr.length; i++) { sum = sum + arr[i]; } return sum; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sumTwoSmallestNumbers(numbers) {\n smallest = Number.POSITIVE_INFINITY;\n second = Number.POSITIVE_INFINITY;\n for (let i = 0; i < numbers.length; i++){\n if (smallest > numbers[i]){\n smallest = numbers[i];\n }\n if (numbers[i+1] == smallest){\n second ...
[ "0.7641968", "0.7521737", "0.72211134", "0.7095551", "0.7072265", "0.70660335", "0.704841", "0.70407844", "0.70337254", "0.7030721", "0.700035", "0.6990757", "0.6983118", "0.6977945", "0.69750214", "0.69591117", "0.6950834", "0.6937361", "0.69277906", "0.6917126", "0.690468",...
0.0
-1
1. check first item. Assume it is max 2. check next item. if it is greater than previous max, then it will become my new max 3. if there is still another item in array, repeat step 2. Write a program that finds the smallest number in an array Write a program that finds the largest word in a sentence
function findLargestWord(sentence) { let words = sentence.split(' '); let largestWord = words[0]; for (let i =1; i< words.length; i++) { if(words[i].length > largestWord.length) { largestWord = words[i]; } } return largestWord; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findLargest(array) {\n larget = array[0]\n for(i = 1; i < array.length; i++) {\n if(array[i] > larget) {\n larget = array[i]\n }\n }\n return larget\n}", "function secLargest(array) {\n var firsLargest = 0\n var arr = array[0];\n for (var i = 0; i < array.length; i++) {\n...
[ "0.71092665", "0.70331705", "0.6914782", "0.6906081", "0.6888958", "0.6840245", "0.68381596", "0.6823604", "0.6798827", "0.67981696", "0.6790314", "0.67857575", "0.6783013", "0.6768631", "0.67573434", "0.6750599", "0.6735461", "0.67331934", "0.6731584", "0.6721748", "0.671839...
0.64445794
85
Write a program that reverses an array
function reverse(arr) { let reversedArr; for (let i = arr.length - 1; i >= 0; i--) { reversedArr.push(arr[i]) } return reversedArr; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reverse(arr){\n //code\n}", "function rev_array()\n {\n \tvar rev_arr = create_array();\n\tvar swap_num = 0;\n\tvar j = rev_arr.length-1;\n\n\t \tfor (var i=0; i<rev_arr.length/2; i++)\n\t \t{\n\t \t\tswap_num = rev_arr[i];\n\t \t\trev_arr[i] = rev_arr[j];\n\t \t\trev_arr[j] = swap_num;\n\t \t\tj--;\...
[ "0.7907202", "0.773994", "0.76816016", "0.7671324", "0.7595907", "0.7591716", "0.75820714", "0.7579203", "0.7569279", "0.7557558", "0.75255406", "0.75213945", "0.7511059", "0.74799037", "0.74728394", "0.74709994", "0.746402", "0.7436176", "0.7429482", "0.7422889", "0.7413868"...
0.6973035
96
Write a program that checks if a word is a palindrome
function checkPalindrome(word) { let isPalindrome; let reverseWord = reverse(word); if(word === reverseWord) { isPalindrome = true; } else { isPalindrome = false; } return isPalindrome; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function palindrome(word){\n \n}", "function palindrome(word) {\n var ln = word.length;\n for (var i = 0; i <= ln / 2;)\n if (word[i++] !== word[ln - i]) return false;\n return true\n}", "function palindrome(word){\r\n\t\t\t\tvar middle=Math.ceil(word.length/2), i;\r\n\r\n\t\t\t\tfor (i=0; i...
[ "0.8675366", "0.8537262", "0.85365254", "0.8481311", "0.84741735", "0.84428895", "0.8404269", "0.83105904", "0.8294043", "0.8265162", "0.8224047", "0.81518024", "0.8106671", "0.8059939", "0.80491614", "0.80235934", "0.80123186", "0.8010508", "0.7991307", "0.799065", "0.798874...
0.79856414
21
Image Plane Function Creates geometry given an image ==============================================================================
function ImgPlane(texture, scale = 1){ this.Buffer = {}; this.Buffer.position = gl.createBuffer(); this.Buffer.normal = gl.createBuffer(); this.Buffer.uv = gl.createBuffer(); this.Textures = {}; var scale = 2/canvas.height*scale; this.transform = new Transform(undefined, vec3.fromValues(scale, scale, 1), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function PlaneGeometry() {\n var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n _classCallCheck(this, PlaneGeometry);\n\n var _opts$type = opts.type,\n type = _opts$type === void 0 ? 'x,y' : _opts$type,\n _opts$offset = opts.offset,\n offset = _opts...
[ "0.7137011", "0.7121524", "0.6771253", "0.65629447", "0.6552637", "0.6360061", "0.6352914", "0.63161474", "0.6289868", "0.6279622", "0.62460464", "0.6201116", "0.61801034", "0.61445624", "0.6098785", "0.6040798", "0.60253114", "0.60026234", "0.5989071", "0.59817934", "0.59644...
0.56815535
38
FACTORY FUNCTIONS (QUITE SIMILAR TO CONSTRUCTORS)
function robotFactory(model, mobile) { return { model, mobile, beep() { console.log("Hello human"); }, }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function factory() {}", "function factory() {}", "function Factory(){}", "function compileFactoryFunction(meta){var t=variable('t');var statements=[];// The type to instantiate via constructor invocation. If there is no delegated factory, meaning\n// this type is always created by constructor invocation, the...
[ "0.7547178", "0.7547178", "0.71434736", "0.64683545", "0.6407083", "0.63621205", "0.6226166", "0.61952865", "0.61952865", "0.61241806", "0.6063013", "0.60275775", "0.6020177", "0.5951193", "0.59448636", "0.592797", "0.591593", "0.591593", "0.59126127", "0.589863", "0.5897711"...
0.0
-1
let c = carNew('toyota', 'RAV4') let d = carNew('benz', 'c300')
function Car(brand, model) { this.brand = brand this.model = model }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function CarMaker() {}", "function Car() {}", "function CarMaker(){}", "function Car() { }", "function Car(){}", "function createCar(newCarMake, newCarYear, newCarColor) {\n let speed = 0;\n return {\n // car looks\n make: newCarMake,\n year: newCarYear,\n color: newCarColor,\n carInfo: ...
[ "0.7670441", "0.76526517", "0.7616607", "0.7563097", "0.74469966", "0.74010205", "0.73865724", "0.7313631", "0.7274736", "0.7223639", "0.7107282", "0.7058415", "0.70433956", "0.7031785", "0.70296896", "0.70127064", "0.70100033", "0.70034254", "0.70020306", "0.7000533", "0.699...
0.69853103
22
import SvgIcon from 'SvgIcon';
function setOption(chartDisplayType, option, yySetting, data, skinConfig, panelType) { // let dimensionCodeFileld = yySetting.dataField.dimensionX[0].codeField;///store_code // let dimensionNameFileld = yySetting.dataField.dimensionX[0].nameField;//store_name var dimensionCodeFileld = eChartCommon.eChartLabel.un...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "icons () {\n return require('@packages/icons')\n }", "function HomeIcon(props) {\n return (\n <SvgIcon {...props}>\n <path d=\"M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z\" />\n </SvgIcon>\n );\n}", "getIcon() {\n if (!this.state.toggler) {\n return <FontAwesomeIcon icon={sol...
[ "0.65877604", "0.6351272", "0.61405104", "0.6130497", "0.6086252", "0.6006612", "0.59562147", "0.592674", "0.5892835", "0.5890198", "0.5876703", "0.5876703", "0.5862701", "0.58625174", "0.5825", "0.58186394", "0.58116376", "0.5811589", "0.5809949", "0.57895654", "0.57821816",...
0.0
-1
actualizeaza datele din tabel si imaginea specifice modelului de telefon selectat;
function renderCard (phone) { var imgContainer = document.getElementById('imgContainer'); const addBtn = document.createElement('button'); addBtn.innerText = 'Adaugă în coș'; addBtn.setAttribute('id', phone._id); imgContainer.appendChild(addBtn); const imageImg = document.getElementById('imageImg'); imag...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "probarFechaNacimiento(){\n //lectura del atributo fecha\n console.log(this.fecha.getFecha())\n\n //escritura del atributo\n console.log(this.fecha.setFecha(new Date(2000, 4, 6)))\n console.log(this.fecha.getFormatoLargo())\n console.log(this.fecha.setFecha(new Date(2000, 4...
[ "0.6138854", "0.6096422", "0.60469025", "0.6042061", "0.59878767", "0.59751964", "0.59182847", "0.5912172", "0.5905591", "0.5896349", "0.5883624", "0.5879274", "0.58374274", "0.58306444", "0.5812919", "0.5784058", "0.5760301", "0.5742132", "0.57405376", "0.5727755", "0.572665...
0.0
-1
Start popup login form script
function openForm() { document.getElementById('loginwindow').style.display = 'block'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function doModalLogin() {\n\tcustomModalBox.htmlBox('yt-LoginContent_Popup', '', 'Log in'); \n\t$('ctl00_txtLoginUsername1').focus();\t\n\tloginClose();\n}", "function doModalLogin_() {\n\tcustomModalBox.htmlBox('yt-LoginContent_Popup', '', 'Log in'); \n\tloginClose_();\n}", "function login() {\n var lo...
[ "0.76744103", "0.766162", "0.7558287", "0.731366", "0.7093431", "0.7042772", "0.70231146", "0.70220786", "0.7007423", "0.69410676", "0.6886706", "0.686626", "0.6853034", "0.6819983", "0.68125707", "0.6810628", "0.6790641", "0.67868215", "0.6774761", "0.6761299", "0.6729376", ...
0.63895136
55
Adds events to main buttons
function addClickEventOnFetchAllItemsButton() { const btn = document.getElementById("all-btn"); btn.addEventListener("click", () => fetchAllItems()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "initButtonEvents() {\n let allButtons = document.querySelectorAll('#buttons > g, #parts > g');\n Array.from(allButtons).forEach((btn, index) => {\n this.addEventListenerAll(btn, 'click drag', e => {\n let textBtn = btn.className.baseVal.replace('btn-', '');\n ...
[ "0.74638844", "0.7304171", "0.7186906", "0.7082511", "0.70740867", "0.6917375", "0.6873329", "0.6856635", "0.68161964", "0.68137336", "0.6808781", "0.67855483", "0.67573506", "0.67553514", "0.6700757", "0.6694012", "0.6687438", "0.664754", "0.6635127", "0.662856", "0.66283447...
0.0
-1
Extracts templates for items, searchdisplay, form and error Item template
function extractItemTemplate() { const template = document.getElementById("item-template"); const listItem = template.content.cloneNode(true); return listItem; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_handleItemTemplate() {\n const that = this;\n let template = that.itemTemplate;\n\n if (!('content' in document.createElement('template'))) {\n that.error(that.localize('htmlTemplateNotSuported', { elementType: that.nodeName.toLowerCase() }));\n return;\n }\n\n ...
[ "0.6311001", "0.6198896", "0.59800035", "0.5965334", "0.5919234", "0.5803946", "0.5774645", "0.5756558", "0.5695425", "0.56745774", "0.5630723", "0.56186503", "0.56148595", "0.56012595", "0.5571221", "0.55708283", "0.5540585", "0.5513572", "0.54972833", "0.5455757", "0.543131...
0.56406194
10
Sets the small header above result depending on type of result
function setSubHeader(text) { subHeader = document.querySelector(".sub-header"); subHeader.innerHTML = text; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setResHeaders (req, res, result) {\n const totalPages = Math.ceil(result.total / result.perPage)\n if (result.page > 1) {\n res.set('X-Prev-Page', result.page - 1)\n }\n if (result.page < totalPages) {\n res.set('X-Next-Page', result.page + 1)\n }\n res.set('X-Page', result.page)\n res.set('X...
[ "0.62618697", "0.61859864", "0.60894114", "0.59260786", "0.57794774", "0.5673447", "0.5635744", "0.56307745", "0.5628491", "0.5599588", "0.5568082", "0.54816556", "0.54771686", "0.5467679", "0.543989", "0.54210585", "0.5379027", "0.53508407", "0.53508407", "0.53508407", "0.53...
0.0
-1
Clears HTMLelements(tags) when switching feature
function clearElements() { const ul = document.getElementById("item-list"); const searchField = document.getElementById("search-field"); const formContainer = document.getElementById("form-container"); const subHeader = document.querySelector(".sub-header"); ul.innerHTML = ""; searchField.innerHTML = ""; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resetTags(){\r\n document.querySelectorAll('.tag').forEach(function(tag){\r\n tag.parentElement.removeChild(tag);\r\n })\r\n}", "function clearTags() {\n\t_clearActiveTags();\n}", "clear() {\n Array.prototype.forEach.call(this._el, function(profile) {\n profile.innerHTML = '';\n ...
[ "0.7416169", "0.7407128", "0.7198411", "0.7085561", "0.70144427", "0.69427663", "0.69164985", "0.68915755", "0.6880985", "0.6854383", "0.67785263", "0.6768035", "0.67300403", "0.67175627", "0.6705202", "0.6696952", "0.669649", "0.66673714", "0.6659759", "0.6652763", "0.665276...
0.6569899
33
Displays the searchfield when clicking main search button
function displaySearchField() { clearElements(); const searchField = document.getElementById("search-field"); const template = document.getElementById("search-template"); const inputField = template.content.cloneNode(true); const btn = inputField.getElementById("submit-search-btn"); btn.addEventListener("cl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "openSearch() {\n this.element_main.style.visibility = \"visible\"; // show search box\n this.element_input.focus(); // put focus in input box so you can just start typing\n this.visible = true; // search visible\n }", "function searchThis(e) ...
[ "0.7436015", "0.71666855", "0.71257335", "0.7094298", "0.7057337", "0.70555586", "0.70495063", "0.7045854", "0.69762814", "0.6943839", "0.6933188", "0.69159573", "0.6915775", "0.6877542", "0.68660975", "0.6863452", "0.6848532", "0.68228316", "0.6821032", "0.6791512", "0.67915...
0.7438845
0
Sets values on form input fields based on item to edit
function setInputValuesWhenEditItem(form, item) { const type = form.getElementById("item-type"); const colour = form.getElementById("item-colour"); const material = form.getElementById("item-material"); const size = form.getElementById("item-size"); const quantity = form.getElementById("item-quantity"); typ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function editItem(){\n changeItemIndex = index;\n food = item[changeItemIndex].food;\n calory = item[changeItemIndex].calory;\n document.querySelector('.add-item').style.display = \"none\";\n document.querySelector('.change-item').style.display = \"block\";\n ...
[ "0.7254705", "0.69944286", "0.6864236", "0.6830795", "0.6753071", "0.6735183", "0.67335165", "0.6727018", "0.67154753", "0.66763526", "0.6619922", "0.661218", "0.66067183", "0.65903443", "0.6542911", "0.6533239", "0.6493683", "0.6467728", "0.6447233", "0.64340824", "0.6423425...
0.8069615
0
Displays form for adding or editing item
function displayForm(item) { clearElements(); const formContainer = document.getElementById("form-container"); const formTemplate = extractFormTemplate(); const form = formTemplate.getElementById("post-edit-form"); if (item) { setInputValuesWhenEditItem(formTemplate, item); } formContainer.append(fo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addNewItem() { switchToView('edit-form'); }", "function editItem(){\n changeItemIndex = index;\n food = item[changeItemIndex].food;\n calory = item[changeItemIndex].calory;\n document.querySelector('.add-item').style.display = \"none\";\n document.q...
[ "0.7324878", "0.6548508", "0.6534319", "0.6514215", "0.6432238", "0.64013565", "0.6363614", "0.63134754", "0.6307852", "0.6263131", "0.6243086", "0.6198306", "0.61875606", "0.61483413", "0.61153805", "0.6100476", "0.60807085", "0.6072614", "0.60583085", "0.60330397", "0.60150...
0.70953625
1
Creates a list item
function createListItem(item) { const ul = document.getElementById("item-list"); const listItem = extractItemTemplate(); const deleteBtn = listItem.getElementById("delete-btn"); const editBtn = listItem.getElementById("edit-btn"); const itemContainer = listItem.getElementById("item-container"); itemContaine...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createListItem(item) {\n text += '<li>' + item + '</li>\\n';\n}", "function ListItem() {}", "function ListItem() {}", "function ListItem() {}", "function newItem(todo) {\n var listItem = document.createElement(\"li\");\n listItem.textContent = todo;\n list.appendChild(listItem);\n}", "func...
[ "0.76207936", "0.7553275", "0.7553275", "0.7553275", "0.7474131", "0.7189512", "0.7124347", "0.71229947", "0.7109766", "0.7107384", "0.71004075", "0.7074031", "0.703517", "0.70330554", "0.7017802", "0.6964895", "0.6964004", "0.6963939", "0.6953058", "0.69479716", "0.69445753"...
0.72072786
5
Creates a error item (error message)
function createErrorItem(item) { const ul = document.getElementById("item-list"); const errorTemplate = extractErrorTemplate(); const errorContainer = errorTemplate.getElementById("error-container"); console.log(errorContainer); errorContainer.innerHTML = item; ul.append(errorTemplate); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addItemError() {\n noty({\n text: 'Text can not be empty',\n type: 'error',\n layout: 'topCenter',\n timeout: 1000\n });\n }", "function ProductCreateError (message) {\n this.name = 'ProductCreateError';\n this.message = message || 'Product ...
[ "0.7055283", "0.6582618", "0.6530846", "0.6408187", "0.63857716", "0.6352088", "0.62821317", "0.62587744", "0.6204949", "0.608759", "0.6042701", "0.6017866", "0.5971918", "0.5928524", "0.5922367", "0.5888489", "0.5875191", "0.58748746", "0.58617234", "0.58455575", "0.5844204"...
0.7137355
0
Fetches all items from api
async function fetchAllItems() { clearElements(); setSubHeader("All items in storage"); const response = await fetch("/api/shoes"); const items = await response.json(); if (response.ok) { for (const item of items) { createListItem(item); } } else { setSubHeader(""); createErrorItem...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "fetchItems(){\n\t\tfetch(Constants.restApiPath+'items')\n\t\t.then(function(res){\n\t\t\tif(res.ok){\n\t\t\t\tres.json().then(function(res){\n\t\t\t\t\tdispatcher.dispatch({\n\t\t\t\t\t\ttype: \t\"FETCH_ITEMS_FROM_API\",\n\t\t\t\t\t\tres,\n\t\t\t\t\t});\n\t\t\t\t})\n\t\t\t}\n\t\t\telse{\n\t\t\t\tconsole.log(String...
[ "0.79296714", "0.76392", "0.71158904", "0.7066839", "0.68145764", "0.68113196", "0.6809353", "0.6809353", "0.6788326", "0.675714", "0.67511094", "0.67468053", "0.6740703", "0.6704015", "0.66724366", "0.66702646", "0.6664463", "0.66475487", "0.662335", "0.6618629", "0.65545833...
0.73405844
2
Fetches one specific item from api, by requested Id
async function fetchOneItem() { setSubHeader("Result after search"); const ul = document.getElementById("item-list"); ul.innerHTML = ""; const input = document.getElementById("search-item"); const response = await fetch("/api/shoes/" + input.value); const item = await response.json(); if (response.ok) {...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "fetchInventoryItem(id){\r\n return Api().get('/inventory/' + id)\r\n }", "static getById(request, response) {\r\n\r\n itemsModel.getById(request.params.id)\r\n .then( data => {\r\n if (data.length > 0) {\r\n response.json(data); \r\n } else {\...
[ "0.72595197", "0.71964246", "0.7111052", "0.71099925", "0.6883462", "0.6869521", "0.6833988", "0.6822346", "0.68085223", "0.68069434", "0.67775023", "0.67722774", "0.6749216", "0.67423576", "0.6730185", "0.6707605", "0.6671497", "0.6635407", "0.6629328", "0.6624024", "0.66091...
0.0
-1
Calls add or edit methods (PUT or POST)
function addOrEditItem(event, item) { event.preventDefault(); const inputType = event.target.querySelector("#item-type"); const inputColour = event.target.querySelector("#item-colour"); const inputMaterial = event.target.querySelector("#item-material"); const inputSize = event.target.querySelector("#item-size...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async edit({ params, request, response, view }) {}", "async edit ({ params, request, response, view }) {\n }", "async edit ({ params, request, response, view }) {\n }", "async edit ({ params, request, response, view }) {\n }", "async edit ({ params, request, response, view }) {\n }", "async edit ({ p...
[ "0.63927466", "0.6140237", "0.6140237", "0.6140237", "0.6140237", "0.6140237", "0.6140237", "0.6140237", "0.6003609", "0.586713", "0.584283", "0.573144", "0.56542385", "0.55776674", "0.55541193", "0.55368805", "0.55159926", "0.55011535", "0.54843503", "0.5482869", "0.5475245"...
0.0
-1
Adds one item thru api
async function addItem(item) { setSubHeader("Result"); const response = await fetch("/api/shoes", { method: "POST", headers: { "Content-Type": "application/json", }, body: JSON.stringify(item), }); const responseItem = await response.json(); if (response.ok) { createListItem(respon...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function add(item) {\n data.push(item);\n console.log('Item Added...');\n }", "addItem(req, res) {\n //grab the new item and push it to the list\n const { addOn } = req.body;\n list.push(addOn);\n res.status(200).send(list);\n }", "add(type, id) {\n let key = this.getKey(type)\n // Fi...
[ "0.71904314", "0.7119399", "0.70599395", "0.69715995", "0.6845333", "0.6786474", "0.67625433", "0.6747484", "0.6714456", "0.6676514", "0.6666742", "0.66657233", "0.66575056", "0.66502684", "0.6620797", "0.6620413", "0.6609986", "0.6598639", "0.65802264", "0.6567071", "0.65667...
0.6522411
23
Updates one specific item in api, by requested Id
async function editItem(item, update) { setSubHeader("Result"); const response = await fetch("/api/shoes/" + item.id, { method: "PUT", headers: { "Content-Type": "application/json", }, body: JSON.stringify(update), }); const responseItem = await response.json(); if (response.ok) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateItem(id) {\n axios.put(`/put/${id}`, updatedItem);\n }", "updateItemOfCurrentList(id, data) {\n\n return new TotoAPI().fetch('/supermarket/currentList/items/' + id, {\n method: 'PUT',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(da...
[ "0.8082182", "0.7318862", "0.7083713", "0.6998035", "0.69468886", "0.6928054", "0.6928054", "0.6897949", "0.6886994", "0.68823737", "0.68675005", "0.68446535", "0.68428034", "0.67993283", "0.6792078", "0.677472", "0.677104", "0.67679554", "0.6765274", "0.6758212", "0.6743872"...
0.6594073
40
Deletes one specific item in api, by requested Id
async function deleteItem(item) { const ul = document.getElementById("item-list"); ul.innerHTML = ""; setSubHeader("Result"); const response = await fetch("api/shoes/" + item.id, { method: "DELETE", headers: { "Content-Type": "application/json", }, body: JSON.stringify(item), }); cons...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteItem(id) {\n axios.delete(\"/delete/\" + id);\n }", "function deleteItem(id) {\n executeHTTPRequest(id, 'DELETE', '/remove')\n}", "function deleteItem(id) {\n fetch(`${uri}/${id}`, {\n method: 'DELETE',\n mode: 'cors',\n })\n .catch(error => console.error('Unable to del...
[ "0.8070499", "0.77977866", "0.7659436", "0.75554466", "0.74942243", "0.7426707", "0.7381991", "0.7316608", "0.7301728", "0.72634166", "0.72634166", "0.725055", "0.7225334", "0.72244495", "0.7208297", "0.7200236", "0.71933156", "0.717173", "0.7164532", "0.71552795", "0.7116626...
0.6741465
72
show/hide button depending on where user is in document.
function pageScroll() { if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) { document.getElementById("topPageBtn").style.display = "block"; } else { document.getElementById("topPageBtn").style.display = "none"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showManagementTab() {\n\tvar doc = document.getElementById('nickname_manage');\n\tvar doc2 = document.getElementById('user_recipes');\n\tif ($(doc2).is(':visible')) {\n doc2.style.display = 'none';\n }\n if ($(doc).is(':visible')) {\n doc.style.display = 'none';\n }\n else {\n ...
[ "0.66189027", "0.6504755", "0.6346008", "0.6343982", "0.6338783", "0.63162565", "0.6315357", "0.62838", "0.61897075", "0.6181463", "0.618069", "0.6179074", "0.6150796", "0.6142145", "0.6113148", "0.6110533", "0.6092321", "0.608966", "0.6050336", "0.6043991", "0.6043991", "0...
0.0
-1
scroll to top of page when user clicks on button
function topOfPage() { document.body.scrollTop = 0; // Safari document.documentElement.scrollTop = 0; // Chrome, Firefox, IE and Opera. }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toTheTopButton() {\n window.scrollTo({\n top: 0,\n behavior: \"smooth\",\n });\n }", "function scrollToTop () {\n //getting the currentPosition position of the button\n let currentPosition = document.documentElement.scrollTop || document.body.scrollTop;\n //if th...
[ "0.83976585", "0.83879167", "0.81795466", "0.81545955", "0.81510854", "0.8124924", "0.8043162", "0.79720265", "0.79566354", "0.79379296", "0.79343396", "0.7924792", "0.7875316", "0.7862262", "0.7859226", "0.7823137", "0.781722", "0.7814807", "0.7811418", "0.7804167", "0.77915...
0.0
-1
capture temperature input capture radio button selection
function getInput() { inTemp = Number(input.value); celsCheck = celsRadio.checked; if (celsCheck) { outScale = 'C'; } else { outScale = 'F'; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function determineConverter (clickEvent) {\n\tuserTemp = document.getElementById(\"userTemp\").value;\n\n\tif(fRadio.checked){\n\t\ttoFahrenheit(userTemp);\n\t\tconsole.log(\"FAHRENHEIT\");\n\t\treturn;\n\t}else if(cRadio.checked){\n\t\ttoCelsius(userTemp);\n\t\tconsole.log(\"CELSIUS\");\n\t\treturn;\n\t}else{\n\t...
[ "0.66377944", "0.6348036", "0.61555046", "0.60313773", "0.59660655", "0.59167385", "0.59141934", "0.5865859", "0.5860439", "0.5858744", "0.58352584", "0.5822406", "0.5687679", "0.5586374", "0.55499667", "0.5535597", "0.5534473", "0.5506979", "0.5498103", "0.54709977", "0.5448...
0.6121953
3
change output color depending on temperature
function changeOutputColor(temp, scale) { if (scale === 'C') { if (temp >= 32) { outBox.setAttribute('class', 'hot'); } else if (temp <= 0){ outBox.setAttribute('class', 'cold'); } else { outBox.setAttribute('class', 'normal'); } } else { if (temp >= 90) { outBox.setAttribute('class', 'hot'); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getColorTemp(temp) {\n//turn the power on, if already on, this will not turn it off\n//Needed because 'set_bright' only works if the bulb is on\n let message;\n if (temp < LOW_TEMP) {\n return \"2700\";\n } else if (temp > HIGH_TEMP) {\n return \"6500\";\n } else {\n let increment = ((6500 - ...
[ "0.72418123", "0.7118333", "0.703514", "0.70203876", "0.6834279", "0.67886364", "0.67365545", "0.65627956", "0.65591174", "0.64540297", "0.6445566", "0.6431103", "0.6425087", "0.64121383", "0.63702285", "0.63427913", "0.6323285", "0.62948114", "0.62326527", "0.6220522", "0.61...
0.72894996
0
User configuration to limit price or kcal
function summary(kcal, price) { return { type: 'SUMMARY', payload: { kcal, price }, }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setLimits() {\n var t, rx = /\\d+(\\.\\d+)?/g,\n s, d, res = {s:6, d:6},\n config = Celestial.settings();\n\n d = config.dsos.data;\n \n //test dso limit\n t = d.match(rx);\n if (t !== null) {\n res.d = parseFloat(t[t.length-1]);\n }\n\n if (res.d !== 6) {\n $form(\"dsos-limit\")....
[ "0.62087494", "0.60697085", "0.59437656", "0.580051", "0.57653433", "0.575291", "0.5739396", "0.56980246", "0.5664172", "0.56611294", "0.56347376", "0.55998415", "0.55719066", "0.5563047", "0.5535246", "0.5496549", "0.5494342", "0.54758537", "0.5468053", "0.54613537", "0.5457...
0.0
-1