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
Function for displaying image data
function renderButtons() { // Deleting the images prior to adding new topics // (this is necessary otherwise you will have repeat buttons) $("#buttons-view").empty(); // Looping through the array of topics for (var i = 0; i < topics.length; i++) { // Then dynamicaly generating buttons for each topic in the array // This code $("<button>") is all jQuery needs to create the beginning and end tag. (<button></button>) var a = $("<button>"); // Adding a class of topic to our button a.addClass("topic"); // Adding a data-attribute a.attr("data-name", topics[i]); // Providing the initial button text a.text(topics[i]); // Adding the button to the giphy-view div $("#buttons-view").append(a); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function image_display() {\r\n\r\n}", "function displayImage(){\n\n}", "function imageDisplay(index){\n\t\tif( index >= data.length ){\n\t\t\treturn;\n\t\t} else {\n\t\t\tcreateImage(data[index].src, data[index].width, data[index].height);\n\t\t}\n\t}", "function _show_image_data() {\r\n\r\n if (!...
[ "0.76033103", "0.72465867", "0.7238158", "0.6953018", "0.6856763", "0.6826307", "0.67901915", "0.67757076", "0.6698528", "0.6693946", "0.6683562", "0.66734797", "0.66083753", "0.65975916", "0.658593", "0.65274423", "0.65253866", "0.6512799", "0.64991796", "0.64919424", "0.649...
0.0
-1
for details on configuring this project to bundle and minify static web assets. Write your JavaScript code.
function checkResult(id, baseUrl) { if ($('input[name = "option"]').is(":checked")) { var option = $('input[name="option"]:checked').val(); var urlCheck = baseUrl+'/Quiz/CheckAnswer?id=' + id + '&option=' + option; $.ajax({ type: 'GET', url: urlCheck, dataType: 'json', success: function (jsonData) { var res = jsonData; $('#btnCheck').removeClass("btn-primary"); $('input[name="option"]').parent().removeClass("btn-info"); $('input[name="option"]').addClass("disabled"); $('input[name="option"]').parent().addClass("btn-secondary"); if (res == "Correct") { $('#btnCheck').addClass("btn btn-success"); $('input[name="option"]:checked').parent().removeClass("btn-secondary").addClass("btn btn-success disabled"); } else { $('#btnCheck').addClass("btn btn-danger"); $('input[name="option"]:checked').parent().removeClass("btn-secondary").addClass("btn btn-danger disabled"); } $('#btnCheck').text("Next"); $('#btnCheck').removeAttr("onClick"); $('#btnCheck').attr("href", baseUrl+"/Quiz"); }, error: function (error) { result.text(error); } }); } else { alert("Please select an answer!"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function javascript() {\n return gulp.src(PATHS.javascript)\n .pipe($.sourcemaps.init())\n .pipe($.babel({ignore: ['html2canvas.js', 'quill.min.js']}))\n .pipe($.concat('app.js'))\n .pipe($.if(PRODUCTION, $.uglify()\n .on('error', e => { console.log(e); })\n ))\n ...
[ "0.6915525", "0.6848662", "0.67323774", "0.656251", "0.6523141", "0.6499541", "0.64927965", "0.64870816", "0.6483991", "0.6456017", "0.64070636", "0.63733095", "0.63696456", "0.63490963", "0.63288784", "0.6327119", "0.632227", "0.6311692", "0.627115", "0.6269822", "0.6263955"...
0.0
-1
Initialize the div with the svg element
function updateStatisticsModal() { $(domSelector).empty(); let data = getStatisticData(); let tableString = ''; let markerEmtpyRow = data[0][0]; data = data.sort(compare); let minMax = [d3.min(data, function(d) { return d[15]; }), d3.max(data, function(d) { return d[15]; }) ]; let colorScale = d3.scaleSqrt() .domain(minMax) .range(['#fff', '#ef3b2c']); data.forEach(function(d) { if (markerEmtpyRow !== d[0]) { tableString += '<tr class="blank-row"></tr>'; markerEmtpyRow = d[0]; } tableString += '<tr id="' + (d[0] + '---' + d[1]) + '" style="background: ' + colorScale(d[15]) + '">'; d.forEach(function(elm) { if (elm !== undefined) { if (Number(elm) === elm && elm % 1 !== 0) { tableString += '<td>' + parseFloat(elm).toFixed(2) + '</td>'; } else { tableString += '<td>' + elm + '</td>'; } } else { tableString += '<td></td>'; } }); tableString += '</tr>'; }); $(domSelector).append(tableString); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "init() {\n var me = this,\n svg = document.createElementNS(this.xmlns, 'svg');\n svg.setAttribute('id', this.id);\n svg.setAttribute('width', this.coorWidth);\n svg.setAttribute('height', this.coorHeight);\n svg.setAttribute('zoomAndPan', this.z...
[ "0.75755286", "0.7352746", "0.72894794", "0.7113332", "0.7044979", "0.7011622", "0.69017595", "0.68702894", "0.6847543", "0.6847543", "0.6846032", "0.68422514", "0.6820393", "0.68028", "0.6793323", "0.6784797", "0.6781187", "0.6764799", "0.670179", "0.6698348", "0.66970134", ...
0.0
-1
Method to Capture All Movie Times into an Array & Print to Console
movieTimes() { let times = browser.elements('time.btn.btnhorario.ng-scope'); let timesArray = [] times.value.forEach(element => { if (browser.elementIdDisplayed(element.ELEMENT).value === true) { timesArray.push(browser.elementIdText(element.ELEMENT).value); } }); console.log(timesArray) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function consoleFn(Movie_rating, Movie_name, watch_Link, trailer_link){\n let movie_rates = document.querySelectorAll(Movie_rating);\n let Movie_names = document.querySelectorAll(Movie_name);\n let Watch_link = document.querySelectorAll(watch_Link);\n let Trailer_link = document.querySe...
[ "0.6048781", "0.597454", "0.59690094", "0.5913271", "0.58462644", "0.5841196", "0.58198756", "0.5768781", "0.57037723", "0.5703386", "0.5642293", "0.56299174", "0.5621972", "0.5540484", "0.55213475", "0.55095243", "0.54939854", "0.5451977", "0.54406416", "0.54406416", "0.5439...
0.55847126
13
Method to Capture All Movie Titles into an Array & Print to Console
movieTitles() { let movie = browser.elements('.datalayer-movie.ng-binding'); let movieArray = [] movie.value.forEach(element => { if (browser.elementIdDisplayed(element.ELEMENT).value === true) { movieArray.push(browser.elementIdText(element.ELEMENT).value); } }); console.log(movieArray) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function movieTitleToArray() {\n let string = movie.title.toLowerCase();\n return string.split(\"\");\n}", "function readTitles(_aMoviesArr) {\r\n var _stringToShow = \"The names of the movies are: \";\r\n\r\n for (var i = 0; i < _aMoviesArr.length; i++) {\r\n if (i < _aMoviesArr.length - 1) {\r\n _s...
[ "0.7261508", "0.7164864", "0.7103881", "0.6788674", "0.6521904", "0.64626354", "0.6450115", "0.6406812", "0.6204474", "0.6188783", "0.61534667", "0.60790044", "0.60475785", "0.60442215", "0.6035112", "0.6032532", "0.6011006", "0.6006025", "0.60040724", "0.5980247", "0.5977029...
0.58696437
40
Method to Cycle and Click Through Each Individual Movie Page
clickThrough() { let movie = browser.elements('.datalayer-movie.ng-binding'); movie.value.forEach(function (element) { element.click() browser.back(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function performPage() {\r\n var movie_title = $('[class^=TitleHeader__TitleText]').text().trim();\r\n // reference\r\n if (movie_title === \"\") {\r\n movie_title = $('h3[itemprop=\"name\"]').text().trim();\r\n movie_title = movie_title.substring(movie_title.lastIndexOf(\"\\n\") + 1, -1 ).trim();\r\n }\...
[ "0.6419166", "0.6275278", "0.62354785", "0.6154287", "0.60783213", "0.6074694", "0.60680723", "0.6021547", "0.59701854", "0.59179115", "0.5917031", "0.5912935", "0.59110445", "0.59108114", "0.5867433", "0.5818511", "0.580864", "0.5808399", "0.57993436", "0.57836354", "0.57826...
0.6516985
0
Method to Capture Individual Movie Times From Individual Pages into an Array & Print to Console
singleMovie() { console.log("singleMovie") }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function consoleFn(Movie_rating, Movie_name, watch_Link, trailer_link){\n let movie_rates = document.querySelectorAll(Movie_rating);\n let Movie_names = document.querySelectorAll(Movie_name);\n let Watch_link = document.querySelectorAll(watch_Link);\n let Trailer_link = document.querySe...
[ "0.62681186", "0.60520506", "0.58869755", "0.58587795", "0.5823599", "0.5811336", "0.58056545", "0.5804251", "0.57623607", "0.56571966", "0.56558657", "0.56411785", "0.56084615", "0.5586565", "0.558214", "0.556694", "0.55587894", "0.55558974", "0.55535245", "0.55494946", "0.5...
0.0
-1
Method to Compare Times Between Individual Pages and Theatre Page
compareTimes() { console.log("compareTimes") }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static compareTimes(t1, t2) {\n\t\twhile (t1.indexOf(\"p\") !== -1) {\n\t\t\tif (t1.substring(t1.indexOf(\"p\") - 5, t1.indexOf(\"p\") - 3) !== \"12\") {\n\t\t\t\tt1 = t1.substring(0, t1.indexOf(\"p\") - 5) +\n\t\t\t\t\t(~~t1.substring(t1.indexOf(\"p\") - 5, t1.indexOf(\"p\") - 3) + 12).toString()\n\t\t\t\t\t+ t1....
[ "0.5975966", "0.57812876", "0.5683081", "0.5614726", "0.55678546", "0.5492867", "0.5293943", "0.5289667", "0.5278887", "0.527291", "0.5257966", "0.5250143", "0.5244661", "0.5231617", "0.52157485", "0.5198458", "0.5192949", "0.5177092", "0.51759595", "0.5159185", "0.51490504",...
0.5621223
3
estaticas producto var Adicionales[];
function agregarProducto(){ //console.log('entro a agregarproductos'); if(validar()){ var idusuario= $('#codusu').val(); $.ajax({ data: {opcion : 'trade', facturado: facturado, idusuario:idusuario, origen:origen, tipodcto:tipodcto }, url: '../control/registro.php', type: 'post', success: function (response) { //console.log('Trade OK'); Productos(); } }); // final }else{ $('#modalError').modal({backdrop: 'static', keyboard: false}); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function inicializarArrayResultados() {\r\n for(var i=1;i<=totalPreguntas;i++) {\r\n resultadoEncuesta[\"p\"+i+\"-alt\"]=[0,0,0,0];\r\n }\r\n}", "arbol(){\n var arbol = new Array();\n var padres = this._buscarPadre(data.categories);\n var hijos = this._buscarHijos(data.categories,padres);\n...
[ "0.6982567", "0.68499863", "0.6550184", "0.6545968", "0.6535408", "0.6432104", "0.6370613", "0.6357162", "0.63181823", "0.6314732", "0.6289861", "0.6233907", "0.6211365", "0.61929584", "0.61897033", "0.6145835", "0.6142087", "0.61195624", "0.61015165", "0.6097602", "0.6083196...
0.0
-1
base64url encode stringOrBuffer ``` Example > base64url('ladies and gentlemen, we are floating in space') 'bGFkaWVzIGFuZCBnZW50bGVtYW4sIHdlIGFyZSBmbG9hdGluZyBpbiBzcGFjZQ' ```
function encode(input, encoding) { if (encoding === void 0) { encoding = "utf8"; } if (Buffer.isBuffer(input)) { return fromBase64(input.toString("base64")); } return fromBase64(new Buffer(input, encoding).toString("base64")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function base64url_encode(str) {\n var utf8str = unescape(encodeURIComponent(str))\n return base64_encode_data(utf8str, utf8str.length, b64u)\n }", "function stringToBase64Url(str) {\n var b64 = btoa(str);\n return base64ToBase64Url(b64);\n } // converts a standard base64-encoded ...
[ "0.8265343", "0.80151653", "0.78367305", "0.77729255", "0.77729255", "0.75920796", "0.7516804", "0.7502671", "0.7483557", "0.7454518", "0.7423198", "0.7416695", "0.74054503", "0.73559254", "0.7349591", "0.7335241", "0.7334521", "0.73307407", "0.73272485", "0.7325799", "0.7307...
0.0
-1
Convert a base64url encoded string into a raw string. Encoding defaults to 'utf8'. ``` > base64url.decode('cmlkZTogZHJlYW1zIGJ1cm4gZG93bg') 'ride: dreams burn down' ```
function decode(base64url, encoding) { if (encoding === void 0) { encoding = "utf8"; } return new Buffer(toBase64(base64url), "base64").toString(encoding); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function url_base64_decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '...
[ "0.78458863", "0.7844712", "0.7824566", "0.78074765", "0.7802375", "0.78018886", "0.7788602", "0.77871054", "0.7696004", "0.76193535", "0.7428136", "0.722185", "0.70573884", "0.69811887", "0.69313794", "0.69263846", "0.67858446", "0.6766219", "0.6747483", "0.67336303", "0.673...
0.7692854
9
Convert a base64url encoded string to a base64 encoded string ``` > base64url.toBase64('qL8R4QIcQ_ZsRqOAbeRfcZhilN_MksRtDaErMA') 'qL8R4QIcQ/ZsRqOAbeRfcZhilN/MksRtDaErMA==' ```
function toBase64(base64url) { // We this to be a string so we can do .replace on it. If it's // already a string, this is a noop. base64url = base64url.toString(); return padString(base64url) .replace(/\-/g, "+") .replace(/_/g, "/"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function stringToBase64Url(str) {\n var b64 = btoa(str);\n return base64ToBase64Url(b64);\n } // converts a standard base64-encoded string to a \"url/filename safe\" variant", "function base64url_encode(str) {\n var utf8str = unescape(encodeURIComponent(str))\n return base64_encode...
[ "0.8253048", "0.810408", "0.8092335", "0.8054918", "0.8038858", "0.8022879", "0.7992094", "0.7969552", "0.7969552", "0.7945164", "0.7945164", "0.79449964", "0.79290575", "0.79279673", "0.7888982", "0.78838384", "0.7867639", "0.7675953", "0.7584292", "0.7412218", "0.7359118", ...
0.8505418
0
Convert a base64 encoded string to a base64url encoded string Example ``` > base64url.fromBase64('qL8R4QIcQ/ZsRqOAbeRfcZhilN/MksRtDaErMA==') 'qL8R4QIcQ_ZsRqOAbeRfcZhilN_MksRtDaErMA' ```
function fromBase64(base64) { return base64 .replace(/=/g, "") .replace(/\+/g, "-") .replace(/\//g, "_"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function stringToBase64Url(str) {\n var b64 = btoa(str);\n return base64ToBase64Url(b64);\n } // converts a standard base64-encoded string to a \"url/filename safe\" variant", "function stringToBase64Url(str) {\n var b64 = (0, _webcrypto.btoa)(str);\n return base64ToBase64Url(b64);\n} ...
[ "0.832539", "0.82697713", "0.81613487", "0.8037191", "0.8037191", "0.8003788", "0.8003788", "0.7954142", "0.7917833", "0.79035836", "0.7884078", "0.7876257", "0.78435487", "0.78215635", "0.7786523", "0.777235", "0.77202135", "0.7631464", "0.75602", "0.7309471", "0.71726924", ...
0.74942607
19
Convert a base64url encoded string to a Buffer ``` > base64url.toBuffer('c3Bpcml0dWFsaXplZA') ```
function toBuffer(base64url) { return new Buffer(toBase64(base64url), "base64"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function base64ToBuffer(s) {\n var l = s.length * 6 / 8\n if(s[s.length - 2] == '=')\n l = l - 2\n else\n if(s[s.length - 1] == '=')\n l = l - 1\n\n var b = new Buffer(l)\n b.write(s, 'base64')\n return b\n}", "function base64ToBuffer( str ) {\n\n\t\t\tvar b = atob( str );\n\t\t\tvar buf = new Uint8...
[ "0.7596794", "0.7490258", "0.71877104", "0.68810594", "0.6857738", "0.6816563", "0.6808298", "0.6806062", "0.6789498", "0.6786183", "0.6778464", "0.677261", "0.6742628", "0.6730694", "0.67012304", "0.66876876", "0.6680805", "0.66783303", "0.6665888", "0.66353947", "0.66345745...
0.8812362
0
append the user's name being passed in the browser's url to the end of the heading
function gallery(){ showName(); //create the images to display in the gallery for (i = 1; i <= 60; i++){ //create a string adding the images directory and looping through the filename numbers //loop through images 1-9 due to the extra character space added after the number 9 if (i < 10){ var mySlides = "../static/javapic/images/pdxcg_0" + i + ".jpg"; } //loop through all image after the number 9 if(i > 9){ var mySlides = "../static/javapic/images/pdxcg_" + i + ".jpg"; //ignore missing file 42 and keep going if( i===42){ continue; } } //create an <li> in javascript var li = document.createElement("LI"); //create an image in javascript var img = document.createElement("IMG"); img.setAttribute("src", mySlides); //place the image in the <li> li.appendChild(img); //place the <li> in the gallery document.getElementById("gallery").appendChild(li); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayNameUser(responseAsJson, div, authToken, apiUrl, content){\n\tconst username = document.createElement(\"h1\");\n\tusername.style.textAlign = \"center\"; //display username\n\tusername.textContent = \"@\" + responseAsJson.username;\n\tusername.className = \"listAll\"; //make username linkable to pub...
[ "0.68608207", "0.68305606", "0.6623038", "0.6588593", "0.6545876", "0.6534924", "0.6534924", "0.6534924", "0.6534924", "0.65077037", "0.64973295", "0.64796966", "0.64661944", "0.6448432", "0.6329444", "0.6315587", "0.62866545", "0.6283378", "0.6274221", "0.6263746", "0.625529...
0.0
-1
Further exploration Find the middle word of a phrase and take care of all edge cases
function middleWord(string) { if (string.trim() !== '') { let wordsArray = string.split(' '); if (wordsArray.length % 2 === 1) { return wordsArray[Math.floor(wordsArray.length / 2)]; } else { return wordsArray[(wordsArray.length / 2) - 1] + ' ' + wordsArray[wordsArray.length / 2]; } } else { return 'Error: The string is empty'; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findMiddle(word) {\n if (word.length % 2 === 0) {\n let mid1 = Math.floor(word.length / 2) - 1;\n let mid2 = mid1 + 1;\n return word[mid1] + word[mid2];\n } else {\n let mid = Math.floor(word.length / 2);\n return word[mid];\n }\n //console.log(s.length);\n //console.log(Math.ceil(s.le...
[ "0.7172398", "0.68735045", "0.6397718", "0.6332119", "0.63306844", "0.63306844", "0.63306844", "0.63306844", "0.62016183", "0.6201138", "0.6158012", "0.61031693", "0.6042598", "0.60257244", "0.60142297", "0.5983992", "0.59764767", "0.5936545", "0.5919664", "0.5916847", "0.591...
0.6972745
1
5 digit zip code
function shipping_zip5(input1, input2, input3){ var result = new Object(); var error; var test2 = lkup_binary_m("lkup4","zipCode", input3).data; var test1 = { "city" : input1 , "state" : input2, "zipCode" : input3 }; result.flgname = []; result.flgs = []; result.flgvalue = []; result.flgmsg = []; result.pass = true; if (!check_allowed_char(input3, "numeric", "conf1")){ error = "E26_1" result.flgname.push(flags[error].name); result.flgs.push(flags[error].flag); result.flgvalue.push(flags[error].value); result.flgmsg.push(flags[error].msg); } if (!presence_check(input3)){ error = "E26_2" result.flgname.push(flags[error].name); result.flgs.push(flags[error].flag); result.flgvalue.push(flags[error].value); result.flgmsg.push(flags[error].msg); } if(!length_field_check(input3, "zipCode5", "conf1")){ error = "E26_4" result.flgname.push(flags[error].name); result.flgs.push(flags[error].flag); result.flgvalue.push(flags[error].value); result.flgmsg.push(flags[error].msg); } if((lkup_binary_m("lkup4","zipCode",input3).found )){ if(!matchObj(test1, test2, "zipCode")){ error = "E24_23" result.flgname.push(flags[error].name); result.flgs.push(flags[error].flag); result.flgvalue.push(flags[error].value); result.flgmsg.push(flags[error].msg); } } else{ error = "E26_22" result.flgname.push(flags[error].name); result.flgs.push(flags[error].flag); result.flgvalue.push(flags[error].value); result.flgmsg.push(flags[error].msg); } if (result.flgname.length>0){ result.pass = false; } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pinCode(pc){\n\tvar zip_regex = /^[0-9]+$/;\n}", "function validate_us_zip(value) {\n var zip = clean_nonnumbers(value);\n return validate(zip.length,eq,5);\n }", "function reformatZIPCode (ZIPString)\r\n{ if (ZIPString.length == 5) return ZIPString;\r\n else return (reformat (ZIPString, \...
[ "0.7411855", "0.74087983", "0.69555914", "0.69555914", "0.69477856", "0.6907515", "0.68813866", "0.68592626", "0.68517786", "0.68254465", "0.68043387", "0.67795885", "0.6768786", "0.66949826", "0.66823184", "0.66823184", "0.6635374", "0.66071427", "0.6530416", "0.6485722", "0...
0.6262763
35
4 digit zip code extension
function shipping_zip4 (input){ var result = new Object(); var error; result.flgname = []; result.flgs = []; result.flgvalue = []; result.flgmsg = []; result.pass = true; if (presence_check(input)){ if (!check_allowed_char(input, "numeric", "conf1")){ error = "E26_1" result.flgname.push(flags[error].name); result.flgs.push(flags[error].flag); result.flgvalue.push(flags[error].value); result.flgmsg.push(flags[error].msg); } if(!length_field_check(input, "zipCode4", "conf1")){ error = "E26_4" result.flgname.push(flags[error].name); result.flgs.push(flags[error].flag); result.flgvalue.push(flags[error].value); result.flgmsg.push(flags[error].msg); } if (result.flgname.length>0){ result.pass = false; } return result; } else{ return true } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkFormat(zipcode){\n const regex = /(\\d{5})(\\d{4})/;\n if (zipcode.length === 5){\n return true;\n }else if(zipcode.length === 9){\n ZIP = zipcode.replace(/(\\d{5})(\\d{4})/, \"$1-$2\");\n return true;\n }else \n return false;\n}", "function pinCode(pc){\n\tvar zip_regex = /^[0-9]+$/;...
[ "0.6625165", "0.6546688", "0.6442002", "0.6442002", "0.6430643", "0.64253825", "0.63797796", "0.6248388", "0.6221701", "0.6189001", "0.61838704", "0.6180855", "0.6180855", "0.61433303", "0.6141878", "0.6042912", "0.60285723", "0.60099375", "0.60014594", "0.5990262", "0.598735...
0.59193784
29
verification Mailing address integration functions
function Verfication_companyName_Shipping_address (input){ var result = new Object(); var error; result.flgname = []; result.flgs = []; result.flgvalue = []; result.flgmsg = []; result.pass = true; if (!presence_check(input)){ error = "E27_2" result.flgname.push(flags[error].name); result.flgs.push(flags[error].flag); result.flgvalue.push(flags[error].value); result.flgmsg.push(flags[error].msg); } if (result.flgname.length>0){ result.pass = false; } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkEmail() {}", "function verifyemail(addr){\n//\tif (document.layers||document.all){\n\t\treturn checkemail(addr);\n//\t}else{\n//\t\treturn true;\n//\t}\n}", "function simpleEmailValidation(emailAddress) {\n\n}", "function validateEmailCheck(mailAddr){\n var mail = document.getElementById(mai...
[ "0.771228", "0.72072214", "0.7081319", "0.67697686", "0.67225957", "0.6689953", "0.65419954", "0.65378463", "0.6448835", "0.644664", "0.6439708", "0.6433551", "0.64289755", "0.63960475", "0.6353966", "0.63469553", "0.634471", "0.63409764", "0.6340278", "0.6336402", "0.6333899...
0.0
-1
mailing address attributes integration functions
function mailing_company_name_1(input){ var result = new Object(); var error; result.flgname = []; result.flgs = []; result.flgvalue = []; result.flgmsg = []; result.pass = true if (!check_allowed_char(input, "alphanumeric", "conf1")){ error = "E28_1" result.flgname.push(flags[error].name); result.flgs.push(flags[error].flag); result.flgvalue.push(flags[error].value); result.flgmsg.push(flags[error].msg); } if (!presence_check(input)){ error = "E28_2" result.flgname.push(flags[error].name); result.flgs.push(flags[error].flag); result.flgvalue.push(flags[error].value); result.flgmsg.push(flags[error].msg); } if (result.flgname.length>0){ result.pass = false; } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getFormattedAddress() {\n\n }", "function getMailingAddress() {\n return {\n /**\n * Represents the actual text that should be put on the mailing label when delivering a physical package\n * @type {String}\n */\n label: '',\n\n /**\n ...
[ "0.6394994", "0.62641364", "0.59870005", "0.5966322", "0.5890654", "0.58588636", "0.5832224", "0.5806213", "0.57945144", "0.5773716", "0.573977", "0.573756", "0.5735306", "0.5735306", "0.5735306", "0.5735306", "0.5729625", "0.56956494", "0.56909823", "0.5690604", "0.5653948",...
0.0
-1
5 digit mailing zip code
function mailing_zip5(input1, input2, input3){ var result = new Object(); result.flgname = []; result.flgs = []; result.flgvalue = []; result.flgmsg = []; var error; var input1; var input2; var input3; var test2 = lkup_binary_m("lkup4","zipCode", input3).data; var test1 = { "city" : input1 , "state" : input2, "zipCode" : input3 }; result.pass = true; if (!check_allowed_char(input3, "numeric", "conf1")){ error = "E34_1" result.flgname.push(flags[error].name); result.flgs.push(flags[error].flag); result.flgvalue.push(flags[error].value); result.flgmsg.push(flags[error].msg); } if (!presence_check(input3)){ error = "E34_2" result.flgname.push(flags[error].name); result.flgs.push(flags[error].flag); result.flgvalue.push(flags[error].value); result.flgmsg.push(flags[error].msg); } if(!length_field_check(input3, "zipCode5", "conf1")){ error = "E34_4" result.flgname.push(flags[error].name); result.flgs.push(flags[error].flag); result.flgvalue.push(flags[error].value); result.flgmsg.push(flags[error].msg); } if((lkup_binary_m("lkup4","zipCode",input3).found )){ if(!matchObj(test1, test2, "zipCode")){ error = "E32_23" result.flgname.push(flags[error].name); result.flgs.push(flags[error].flag); result.flgvalue.push(flags[error].value); result.flgmsg.push(flags[error].msg); } } else{ error = "E26_22" result.flgname.push(flags[error].name); result.flgs.push(flags[error].flag); result.flgvalue.push(flags[error].value); result.flgmsg.push(flags[error].msg); } if (result.flgname.length>0){ result.pass = false; } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pinCode(pc){\n\tvar zip_regex = /^[0-9]+$/;\n}", "function validate_us_zip(value) {\n var zip = clean_nonnumbers(value);\n return validate(zip.length,eq,5);\n }", "function reformatZIPCode (ZIPString)\r\n{ if (ZIPString.length == 5) return ZIPString;\r\n else return (reformat (ZIPString, \...
[ "0.7333651", "0.72927225", "0.69804054", "0.69804054", "0.69656044", "0.68580306", "0.67568046", "0.67477405", "0.6739098", "0.6683621", "0.6617746", "0.66111475", "0.6603347", "0.6567997", "0.6463976", "0.6454968", "0.64455575", "0.64455575", "0.6397825", "0.6384164", "0.635...
0.6534419
14
4 digit mailing zip code extension
function mailing_zip4 (input){ var result = new Object(); var error; result.flgname = []; result.flgs = []; result.flgvalue = []; result.flgmsg = []; result.pass = true; if (presence_check(input)){ if (!check_allowed_char(input, "numeric", "conf1")){ error = "E34_1" result.flgname.push(flags[error].name); result.flgs.push(flags[error].flag); result.flgvalue.push(flags[error].value); result.flgmsg.push(flags[error].msg); } if(!length_field_check(input, "zipCode4", "conf1")){ error = "E34_4" result.flgname.push(flags[error].name); result.flgs.push(flags[error].flag); result.flgvalue.push(flags[error].value); result.flgmsg.push(flags[error].msg); } if (result.flgname.length>0){ result.pass = false; } return result; } else{ return true } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkFormat(zipcode){\n const regex = /(\\d{5})(\\d{4})/;\n if (zipcode.length === 5){\n return true;\n }else if(zipcode.length === 9){\n ZIP = zipcode.replace(/(\\d{5})(\\d{4})/, \"$1-$2\");\n return true;\n }else \n return false;\n}", "function pinCode(pc){\n\tvar zip_regex = /^[0-9]+$/;...
[ "0.6843275", "0.67388004", "0.6706737", "0.6706737", "0.659101", "0.655189", "0.6522375", "0.6351899", "0.6233588", "0.6220237", "0.6215889", "0.61986965", "0.6149164", "0.6148541", "0.61456317", "0.6127173", "0.6116874", "0.611603", "0.6111096", "0.6069575", "0.6069575", "...
0.6328126
8
Date of ceased operations
function date_Of_Ceased(input){ var result = new Object(); var error; result.flgname = []; result.flgs = []; result.flgvalue = []; result.flgmsg = []; result.pass = true if (!check_allowed_char(input, "dateOfCeased", "conf1")){ error = "E36_1" result.flgname.push(flags[error].name); result.flgs.push(flags[error].flag); result.flgvalue.push(flags[error].value); result.flgmsg.push(flags[error].msg); } //if (!presence_check(input)){ // error = "E31_2" //result.flgname.push(flags[error].name); //result.flgs.push(flags[error].flag); //result.flgvalue.push(flags[error].value); //result.flgmsg.push(flags[error].msg); //} if (check_req_char(input, "dateOfCeased", "conf1")){ error = "E36_3" result.flgname.push(flags[error].name); result.flgs.push(flags[error].flag); result.flgvalue.push(flags[error].value); result.flgmsg.push(flags[error].msg); } if (result.flgname.length>0){ result.pass = false; } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gps_fechasAyer() { \n var fecha = new Date();\n var fecha_ayer = new Date(fecha.getTime());\n fecha_ayer.setDate(fecha.getDate() - 1); \n gps_asignarFechaComp(fecha_ayer);\n}", "function calculateExpiry(date) {\n let currentDate = new Date();\n let dateparts = date.split('-');\n let...
[ "0.60748744", "0.60381556", "0.59472835", "0.59286726", "0.59286726", "0.5906522", "0.58121294", "0.5647625", "0.5622712", "0.56009334", "0.5551748", "0.5551748", "0.55324876", "0.5510323", "0.549991", "0.5499207", "0.5493478", "0.546905", "0.54151344", "0.5413814", "0.538910...
0.0
-1
Operating status and date of ceased operation cross check
function CrossCheck_operatingStatus_dateOfCeased (input1,input2){ var result = new Object(); var error; result.flgname = []; result.flgs = []; result.flgvalue = []; result.flgmsg = []; result.pass = true; if ((presence_check && ! presence_check(input2))||(!presence_check(input1) && presence_check(input2)) ){ error = "E5_1" result.flgname.push(flags[error].name); result.flgs.push(flags[error].flag); result.flgvalue.push(flags[error].value); result.flgmsg.push(flags[error].msg); } if (result.flgname.length>0){ result.pass = false; } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function CrossCheck_operatingStatus_dateOfCeased (input1,input2){\r\n\tvar result = new Object();\r\n\tvar error;\r\n\tvar input1;\r\n\tvar input2;\r\n\tvar test = {\r\n\t\t\"Ceased Operation \": input1,\r\n\t\t\"date of Ceased\" : input2\r\n\t};\r\n\tresult.flgname = [];\r\n\tresult.flgflag = [];\r\n\tresult....
[ "0.64863586", "0.5092882", "0.5054814", "0.4955838", "0.49546498", "0.49452978", "0.48403302", "0.4805371", "0.48015884", "0.4790848", "0.4779167", "0.4752892", "0.47342303", "0.47306263", "0.47246015", "0.4723393", "0.47053486", "0.47014406", "0.47013104", "0.4695447", "0.46...
0.6539003
0
Integration functions for verification of Primary Industry Activities
function Verfication_priamaryIndustry_checkBox (input){ var result = new Object(); var error; result.flgname = []; result.flgs = []; result.flgvalue = []; result.flgmsg = []; result.pass = true; if (!presence_check(input)){ error = "E37_2" result.flgname.push(flags[error].name); result.flgs.push(flags[error].flag); result.flgvalue.push(flags[error].value); result.flgmsg.push(flags[error].msg); } if (result.flgname.length>0){ result.pass = false; } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mainProcess() {\n\tlogDebug(\"This process inactivates Prequal license records that have been sitting in Additional Info Required, Pending, or Open status for longer than 6 months.\" + br);\n\t\n\tdtToday = new Date();\t\n\tdtSixMonthDate = new Date(dateAdd(dtToday, -183));\n\tstrSixMonthDate = jsDateToMM...
[ "0.6022709", "0.569086", "0.563815", "0.5602185", "0.55841076", "0.55833787", "0.5558942", "0.55513096", "0.5528109", "0.55053717", "0.54038364", "0.53995997", "0.5377862", "0.53629076", "0.53624785", "0.53555536", "0.5345466", "0.53391755", "0.53251266", "0.5295728", "0.5295...
0.0
-1
Integration function for Name of contact information
function contact_name(input){ var result = new Object(); var error; result.flgname = []; result.flgs = []; result.flgvalue = []; result.flgmsg = []; result.pass = true; if (!check_allowed_char(input, "alphabetic", "conf1")){ error = "E39_1" result.flgname.push(flags[error].name); result.flgs.push(flags[error].flag); result.flgvalue.push(flags[error].value); result.flgmsg.push(flags[error].msg); } if (!presence_check(input)){ error = "E23_2" result.flgname.push(flags[error].name); result.flgs.push(flags[error].flag); result.flgvalue.push(flags[error].value); result.flgmsg.push(flags[error].msg); } if (result.flgname.length>0){ result.pass = false; } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayContactInfo(display_name = \"No Contact\", handle = \"-\") {\n const nameElement = document.getElementById(\"name\");\n const handleElement = document.getElementById(\"handle\");\n\n nameElement.textContent = display_name;\n handleElement.textContent = handle;\n}", "function createContact(nam...
[ "0.6686675", "0.6544858", "0.6522142", "0.6483544", "0.6401891", "0.62962645", "0.6292751", "0.62887216", "0.628478", "0.62427735", "0.6213481", "0.6121481", "0.61122555", "0.6101261", "0.60932374", "0.6080004", "0.605018", "0.6030822", "0.6022016", "0.6016746", "0.6007238", ...
0.6146814
11
Integration function for title of contact information
function contact_title(input){ var result = new Object(); var error; result.flgname = []; result.flgs = []; result.flgvalue = []; result.flgmsg = []; result.pass = true; if (!check_allowed_char(input, "alphabetic", "conf1")){ error = "E40_1" result.flgname.push(flags[error].name); result.flgs.push(flags[error].flag); result.flgvalue.push(flags[error].value); result.flgmsg.push(flags[error].msg); } if (!presence_check(input)){ error = "E40_2" result.flgname.push(flags[error].name); result.flgs.push(flags[error].flag); result.flgvalue.push(flags[error].value); result.flgmsg.push(flags[error].msg); } if (result.flgname.length>0){ result.pass = false; } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getFormattedTitle() {\n return this.info.title.toUpperCase();\n }", "function title(titleinfo) /* (titleinfo : titleinfo) -> string */ {\n return titleinfo.title;\n}", "getTitle() {}", "function attachTitle(name) {\n return 'DR. ' + name;\n }", "getFormattedTitle(){\n ...
[ "0.6811259", "0.66690356", "0.6608191", "0.65580374", "0.6550961", "0.6536783", "0.64807093", "0.64555347", "0.6425385", "0.63935465", "0.63921887", "0.63586897", "0.6304204", "0.6295221", "0.61886", "0.6188326", "0.6172407", "0.61706644", "0.6130143", "0.61229265", "0.612008...
0.58453023
51
Integration function for phone number of contact information
function contact_phone(input){ var result = new Object(); var error; result.flgname = []; result.flgs = []; result.flgvalue = []; result.flgmsg = []; result.pass = true; if (!check_allowed_char(input, "phone", "conf1")){ error = "E41_1" result.flgname.push(flags[error].name); result.flgs.push(flags[error].flag); result.flgvalue.push(flags[error].value); result.flgmsg.push(flags[error].msg); } if (!presence_check(input)){ error = "E41_2" result.flgname.push(flags[error].name); result.flgs.push(flags[error].flag); result.flgvalue.push(flags[error].value); result.flgmsg.push(flags[error].msg); } //if (!check_required-char(input)){ //error = "E41_3" //result.flgname.push(flags[error].name); //result.flgs.push(flags[error].flag); //result.flgvalue.push(flags[error].value); //result.flgmsg.push(flags[error].msg); //} if (result.flgname.length>0){ result.pass = false; } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function phoneNumber(no){\n\t\n}", "function getcontact(name ,number)\n{\n if (typeof (webphone_api.plhandler) !== 'undefined' && webphone_api.plhandler !== null)\n return webphone_api.plhandler.GetContact(name, number);\n}", "function callContact(){\n\t\n\t/**\n\t * Appcelerator Analytics Call\n\t *...
[ "0.7507974", "0.70680225", "0.68469536", "0.6824079", "0.6705782", "0.6692577", "0.6673758", "0.6673442", "0.66428596", "0.6575103", "0.6558079", "0.6489116", "0.64809525", "0.6477917", "0.6444942", "0.6418272", "0.63971", "0.63627505", "0.63482195", "0.63274384", "0.6323966"...
0.66438663
8
Integration function for fax number of contact information
function contact_fax_number(input){ var result = new Object(); var error; result.flgname = []; result.flgs = []; result.flgvalue = []; result.flgmsg = []; result.pass = true; if (!check_allowed_char(input, "faxNum", "conf1")){ error = "E7_1" result.flgname.push(flags[error].name); result.flgs.push(flags[error].flag); result.flgvalue.push(flags[error].value); result.flgmsg.push(flags[error].msg); } if ( check_req_char(input, "faxNum", "conf1")){ error = "E42_3" result.flgname.push(flags[error].name); result.flgs.push(flags[error].flag); result.flgvalue.push(flags[error].value); result.flgmsg.push(flags[error].msg); } if (!presence_check(input)){ error = "E42_2" result.flgname.push(flags[error].name); result.flgs.push(flags[error].flag); result.flgvalue.push(flags[error].value); result.flgmsg.push(flags[error].msg); } if(!length_field_check(input, "faxNum", "conf1")){ error = "E7_2" result.flgname.push(flags[error].name); result.flgs.push(flags[error].flag); result.flgvalue.push(flags[error].value); result.flgmsg.push(flags[error].msg); } if (result.flgname.length>0){ result.pass = false; } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function contact_fax_number(input){\r\n\tvar result = new Object();\r\n\tvar error;\r\n\tresult.flgname = [];\r\n\tresult.flgflag = [];\r\n\tresult.flgvalue = [];\r\n\tresult.flgmsg = [];\r\n\tresult.pass = true;\r\n\tif (!check_allowed_char(input, \"faxNum\", \"conf1\")){\r\n\t\terror = \"E7_1\"\r\n\t\tre...
[ "0.6103495", "0.5506917", "0.54916734", "0.54750323", "0.5413505", "0.53329533", "0.52630657", "0.5251573", "0.5194549", "0.51921785", "0.51061815", "0.50646424", "0.50291324", "0.5021229", "0.50026774", "0.4974901", "0.49386153", "0.4937306", "0.4931722", "0.49151254", "0.48...
0.61291915
0
React methods Set the initial state
constructor (props) { super(props); this.state = {}; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setInitialState(initialState) {\n\t\tObject.assign(this.state, initialState);\n\t\tthis.setInitialState = noop;\n\t}", "setInitialState () {\n if (this.skipInitial) {\n this.showChooseOrSignIn();\n } else {\n this.setState('initial');\n }\n }", "reset() {\r\n this.state = this.initia...
[ "0.7903237", "0.7722899", "0.74768", "0.7333635", "0.7201478", "0.71797764", "0.71249515", "0.7118375", "0.70789105", "0.6967959", "0.6953219", "0.6941265", "0.69085836", "0.68308336", "0.68189764", "0.68017715", "0.67678165", "0.67580515", "0.67069733", "0.6686115", "0.66860...
0.0
-1
When component is mounted add the Change event listeners and get initial data
componentDidMount () { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_setOnChanges(){\n\t\tthis.inputs.forEach(i => i.addEventListener('change', this._onChange.bind(this)));\t\n\t}", "onDataChange() {}", "function othersInit(self) {\n const el = self.element;\n el.value = self.currentValue;\n self.subscribe({event: 'change', fn: self.onchange });\n}", "_addEventsList...
[ "0.6531918", "0.6411452", "0.64018303", "0.62857616", "0.6067784", "0.6067784", "0.6066856", "0.6066031", "0.60161185", "0.5953258", "0.59190184", "0.58913684", "0.58904344", "0.5873124", "0.582088", "0.5781589", "0.57530284", "0.57397085", "0.57384", "0.5724595", "0.56863993...
0.0
-1
Toggle the button text
function update_buttons() { $('.manage-button').each( (_, bb) => { let user_id = $(bb).data('user-id'); let manage = $(bb).data('manage'); if (manage != "") { $(bb).text("Unmanage"); } else { $(bb).text("Manage"); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function changeButtonText() {\n if ($(\"#myDiv\").hasClass(\"showText\")) {\n $(\"#btnShowText\").text(\"Hide Text\");\n } \n else {\n $(\"#btnShowText\").text(\"Show Text\");\n }\n }", "function toggleButton(b){\n let text = b ? \"Stop sharing\" : \"Split ...
[ "0.75863296", "0.74920326", "0.74669135", "0.71418184", "0.71360373", "0.71200794", "0.7113546", "0.709027", "0.7084675", "0.7077539", "0.70735127", "0.70667493", "0.7046846", "0.70334065", "0.69910175", "0.6945896", "0.69451416", "0.6885776", "0.6867392", "0.6808607", "0.679...
0.0
-1
Update the data so that the text is toggled properly
function set_button(user_id, value) { $('.manage-button').each( (_, bb) => { if (user_id == $(bb).data('user-id')) { $(bb).data('manage', value); } }); update_buttons(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateText(){\n scope.text = scope.on ? attrs.textwhenon : attrs.textwhenoff;\n }", "function toggleData() {\n $log.debug('toggleData');\n $scope.forecastData = $scope.forecastData ? false : true;\n $scope.locationInfo = $scope.locationInfo ? false : true;\n }", "function labelU...
[ "0.69083256", "0.6554544", "0.65307003", "0.64506376", "0.6370173", "0.6316227", "0.62945443", "0.6285619", "0.62518424", "0.62017626", "0.6191301", "0.6122778", "0.6100663", "0.6100663", "0.6093649", "0.60887194", "0.60714674", "0.6056333", "0.60465646", "0.60006624", "0.599...
0.0
-1
Create a Manage record
function manage(user_id) { let text = JSON.stringify({ manage: { manager_id: current_user_id, underling_id: user_id }, }); $.ajax(manage_path, { method: "post", dataType: "json", contentType: "application/json; charset=UTF-8", data: text, success: (resp) => { set_button(user_id, resp.data.id); }, error: (resp) => { console.log(resp); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "create(newRecord: Object) {\n // Asserting all values in record are valid\n if (!this._assertRecordValid(newRecord)) {\n return\n }\n\n // Asserting store is a server store\n if (this.crudStore.type === 'server') {\n // Executing record create action to server\n this.crudStore.execute...
[ "0.6617538", "0.631608", "0.6069174", "0.6044957", "0.6026474", "0.5908252", "0.5866363", "0.58499587", "0.58130187", "0.5810121", "0.5784484", "0.5732493", "0.5694448", "0.5691267", "0.5653262", "0.5634636", "0.56287307", "0.56148165", "0.55989474", "0.55906016", "0.5585141"...
0.0
-1
Delete a Manage record
function unmanage(user_id, manage_id) { $.ajax(manage_path + "/" + manage_id, { method: "delete", dataType: "json", contentType: "application/json; charset=UTF-8", data: "", success: () => { set_button(user_id, ""); }, }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "delete(recordId: number) {\n // Asserting store is a server store\n if (this.crudStore.type === 'server') {\n // Executing record delete action to server\n this.crudStore.executeServerDatabaseAction('delete', this.crudStore.getData().get(recordId))\n }\n else {\n // Retrieving store data...
[ "0.6907617", "0.6384775", "0.62680954", "0.6255711", "0.623355", "0.61950326", "0.6181109", "0.6154751", "0.61408454", "0.6102324", "0.607663", "0.6076215", "0.6067571", "0.6043711", "0.60216534", "0.6017096", "0.6000643", "0.60000104", "0.59948677", "0.59822595", "0.5968975"...
0.60706985
12
Manage or unmanage a user corresponding the the button clicked
function manage_click(ev) { let btn = $(ev.target); let manage_id = btn.data('manage'); let user_id = btn.data('user-id'); if (manage_id != "") { unmanage(user_id, manage_id); } else { manage(user_id); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function set_button(user_id, value) {\n $('.manage-button').each( (_, bb) => {\n if (user_id == $(bb).data('user-id')) {\n $(bb).data('manage', value);\n }\n });\n update_buttons();\n}", "_handleButtonAddAdmin()\n {\n Radio.channel('rodan').request(RODAN_EVENTS.REQUEST__PROJECT_ADD_USER_A...
[ "0.6860396", "0.6796665", "0.67126906", "0.6608286", "0.6574718", "0.6490629", "0.64260656", "0.6401233", "0.6337171", "0.6303121", "0.6264086", "0.62334836", "0.6207008", "0.618509", "0.61143035", "0.60488296", "0.60316664", "0.6026643", "0.60264945", "0.6025551", "0.6013679...
0.73570883
0
Initialize the click function for each manage button and update the button text
function init_manage() { if (!$('.manage-button')) { return; } $(".manage-button").click(manage_click); update_buttons(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function update_buttons() {\n $('.manage-button').each( (_, bb) => {\n let user_id = $(bb).data('user-id');\n let manage = $(bb).data('manage');\n if (manage != \"\") {\n $(bb).text(\"Unmanage\");\n }\n else {\n $(bb).text(\"Manage\");\n }\n });\n}", "function clickManage() {\n\t$.t...
[ "0.7035822", "0.66758835", "0.64078724", "0.6397366", "0.63584006", "0.63528085", "0.62530726", "0.6239302", "0.6207319", "0.6185898", "0.6181031", "0.6173993", "0.61525655", "0.6131418", "0.6096139", "0.60945183", "0.60889703", "0.60612595", "0.6057443", "0.6047189", "0.6040...
0.7350768
0
Toggle the link text
function end_links() { $('.time-button').each( (_, bb) => { let task_id = $(bb).data('task-id'); let type = $(bb).data('type'); let clicked = $(bb).data('clicked'); // Change the 'Start' link to a text-like 'In Progress' if (type === "Start" && clicked === "Yes") { $(bb).text('In Progress'); $(bb).click(function() { return false; }); $(bb).css('color', '#7c91af'); $(bb).css('cursor', 'default'); } // Change the 'In Progress' message back to a 'Start' link else if (type === "Start" && clicked === "No") { $(bb).text('Start'); $(bb).css('color', '#007bff'); $(bb).css('cursor', 'pointer'); } else if (type === "End") { $(bb).text('End'); } else if (type === "Edit") { // Submit button for the edit form $(bb).text('Submit'); } else { $(bb).text('Delete'); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function changelinkLabel(text) {\n link.textContent = text;\n }", "function toggleText() {\r\n var text = document.getElementById(\"instructions\");\r\n if (text.style.display === \"none\") {\r\n text.style.display = \"block\";\r\n } else {\r\n text.style.display = \"none\";\r\n }...
[ "0.72662044", "0.661231", "0.6559535", "0.6535035", "0.6457702", "0.638803", "0.63799006", "0.6282484", "0.6186118", "0.617684", "0.6173611", "0.6123726", "0.6123344", "0.61170644", "0.6101341", "0.610053", "0.6078152", "0.6020483", "0.60192025", "0.5991839", "0.59794354", ...
0.0
-1
Update the data so that the text is toggled properly
function set_time_link(task_id, type) { $('.time-button').each( (_, bb) => { if (type === "Start") { if (task_id == $(bb).data('task-id') && $(bb).data('type') === "Start") { $(bb).data('clicked', "Yes"); } } else { // Change the clicked flag of the Start button back to "No" so that it // will render as a 'Start' link again if (task_id == $(bb).data('task-id') && $(bb).data('type') === "Start") { $(bb).data('clicked', "No"); // Cleat the time id so that the user cannot click 'End' before // clicking 'Start' TIME_ID = ""; } } }); end_links(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateText(){\n scope.text = scope.on ? attrs.textwhenon : attrs.textwhenoff;\n }", "function toggleData() {\n $log.debug('toggleData');\n $scope.forecastData = $scope.forecastData ? false : true;\n $scope.locationInfo = $scope.locationInfo ? false : true;\n }", "function labelU...
[ "0.6906281", "0.6556035", "0.6529791", "0.6450783", "0.637052", "0.6315544", "0.62967503", "0.628318", "0.625214", "0.62003314", "0.6191188", "0.6124244", "0.6099167", "0.6099167", "0.6094342", "0.608985", "0.6072592", "0.605599", "0.6044063", "0.59991115", "0.59989", "0.59...
0.0
-1
Create a TimeBlock record
function start(task_id, time, btn) { let text = JSON.stringify({ time_block: { start: time, end: null, task_id: task_id, convert: true }, }); $.ajax(time_block_path, { method: "post", dataType: "json", contentType: "application/json; charset=UTF-8", data: text, success: (resp) => { TIME_ID = resp.data.id; set_time_link(task_id, "Start"); }, error: (resp) => { console.log(resp); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateTimeBlocks()\n {\n timeBlock.empty();\n\n console.log(startTime);\n console.log(endTime);\n\n for (let i=startTime; i<=endTime; i++)\n {\n let row = $(\"<div>\").addClass(\"row\").attr(\"data-time\", i);\n let timeEl = $(\"<div>\").addCla...
[ "0.645287", "0.64223707", "0.6391443", "0.63826853", "0.60701", "0.5992058", "0.5990356", "0.59520876", "0.58780956", "0.5817659", "0.5809999", "0.5726878", "0.5718676", "0.56982756", "0.56401026", "0.5627112", "0.5622484", "0.55665857", "0.5541021", "0.5536146", "0.5532674",...
0.0
-1
Update a time block
function end(task_id, time) { if (TIME_ID == "") { alert("You haven't started the task yet."); } else { let text = JSON.stringify({ time_block: { start: START_TIME, end: time, convert: true }, }); $.ajax(time_block_path + "/" + TIME_ID, { method: "put", dataType: "json", contentType: "application/json; charset=UTF-8", data: text, success: (resp) => { set_time_link(task_id, "End"); }, error: (resp) => { console.log(resp); } }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function update(time)\n {\n\t //console.log(\"UPDATE\");\n\t // calculation\n }", "function updateTime() {\n\n}", "function updateTime() {\n\t\tvar dateTime = tizen.time.getCurrentDateTime(), secondToday = dateTime.getSeconds() + dateTime.getMinutes() * 60 + dateTime.getHours() * 3600,\n\t\tminDigitLeft = ...
[ "0.73860586", "0.7151051", "0.6931225", "0.6910901", "0.68208736", "0.6799126", "0.6751489", "0.6722952", "0.6714556", "0.6646582", "0.6646582", "0.6643334", "0.66131854", "0.6612657", "0.6588057", "0.6539627", "0.6524335", "0.651179", "0.65029097", "0.6486211", "0.64763856",...
0.0
-1
Initialize sanitation processes to clean up sheets and instantiate properties
function init() { resetScript(); if (!saveAndTestSheets()) // break if sheets invalid return; let pointsSheet = new PointsSheet().sheet; let summarySheet = pointsSheet.getSheets()[0]; let membersRef = summarySheet.getRange(`${POINTS_FIELD.FIRST_NAME}3:${POINTS_FIELD.LAST_NAME}${summarySheet.getLastRow()}`); cleanMemberNames(membersRef); saveMemberKeys(membersRef); setTriggers(); runAllTests(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "newPropertiesSheet() {\n this.properties_sheet = new InstanceProperties(this.artefact)\n }", "_initializeProperties() {}", "newPropertiesSheet() {\n this.properties_sheet = new MysqlDatabaseSystemProperties(this.artefact)\n }", "function initializeSpreadsheet() {\n var ui = SpreadsheetAp...
[ "0.560905", "0.54945755", "0.54502386", "0.5349935", "0.5338927", "0.5281933", "0.52564126", "0.52491397", "0.52102023", "0.51928", "0.5192077", "0.5191688", "0.51606315", "0.51458764", "0.5133424", "0.5106165", "0.50655323", "0.50415117", "0.5039748", "0.5039748", "0.5039748...
0.55610746
1
To show notes in cards in the app
function displayMeetings() { // Fetch the meeting name from local let meetingName = localStorage.getItem("meetingName") // In case it doesn't exist if (meetingName === null) { meetingNameArray = [] } else { // Else, assign the input to meetingNameArray meetingNameArray = JSON.parse(meetingName) } // Empty at first let cardHTML = "" meetingNameArray.forEach(function (element, index) { cardHTML += ` <div class="cards"> <div class="card" style="width: 18rem;"> <div class="card-body"> <h5 class="card-title">${element.name}</h5> <p class="card-text">${element.note}</p> <div id="launchMeeting"><a href="${element.link}" class="btn btn-outline-primary">Launch Meeting</a></div> <div id="showLink"></div> <button id="${index}" onclick="deleteMeeting(this.id)" class="btn btn-outline-danger">Delete</button> <p class="card-text"><small class="text-muted-custom">${element.link}</small></p> </div> </div> </div> ` }) let meetingNameElem = document.getElementById("meetings") // If meetings exist if (meetingNameArray.length != 0) { meetingNameElem.innerHTML = cardHTML } // If there are no meetings else { meetingNameElem.innerHTML = `<div id="centre">You have no meetings. Add a meeting from above!</div>` } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showNotes() {\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesObj = [];\n } else {\n notesObj = JSON.parse(notes);\n }\n let html = \"\";\n notesObj.forEach(function(element, index) {\n html += `\n <div class=\"noteCard my-2 mx-2 card\" style=\"width:...
[ "0.70757735", "0.7068063", "0.7024401", "0.7015538", "0.6989494", "0.6975344", "0.69717884", "0.69599974", "0.6945203", "0.69298", "0.6918386", "0.69122684", "0.69076717", "0.6893904", "0.68903303", "0.688755", "0.688374", "0.6879642", "0.68733823", "0.68719006", "0.6840102",...
0.0
-1
! perfectscrollbar v1.5.2 Copyright 2021 Hyunje Jun, MDBootstrap and Contributors Licensed under MIT
function i(t){return getComputedStyle(t)}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initializeScrollbar() { \n $(\".mcustomScroll\").mCustomScrollbar({ \n theme:\"dark-3\",\n axis:\"yx\",\n advanced:{\n updateOnContentResize: true\n }\n });\n\n $(\".mcustomScroll.mcustomScrollVerticalOnly\")...
[ "0.7126427", "0.70151436", "0.6872108", "0.6663084", "0.6567266", "0.65367025", "0.65266114", "0.6506496", "0.6491185", "0.6491185", "0.6491185", "0.647677", "0.64085156", "0.63881856", "0.6376696", "0.6309872", "0.62993634", "0.62985206", "0.62977463", "0.6289795", "0.628414...
0.0
-1
this part to write comment and save it in the database
test() { fetch('http://192.168.0.14:3000/addcommint', { method: 'POST', headers: { 'Content-Type': 'application/json', Accept: 'application/json' }, body: JSON.stringify({ text: this.state.text, id: this.props.id }) }); this.setState({ commint: [ ...this.state.commint, this.state.text ], text: '' }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function saveComment(commentText) {\n // Add a new comment entry to the Firebase database.\n try {\n await addDoc(collection(db, 'resources', String(getResourceId()), 'comments'), {\n name: getUserName(),\n text: commentText,\n profilePicUrl: getProfilePicUrl(),\...
[ "0.6802722", "0.6678806", "0.66737837", "0.6659903", "0.66285425", "0.6554144", "0.6493956", "0.64838505", "0.64498883", "0.64467835", "0.6386688", "0.63586915", "0.6342971", "0.6340039", "0.6332928", "0.62971413", "0.62873894", "0.6283363", "0.6262518", "0.62509394", "0.6214...
0.0
-1
if we need to have authentication for the queries, then we can use this to generate the auth token
function requestAccess(){ if (!sessionStorage.getItem("auth_token")){ const tokenUrl = generateApiUrl('authentication/guest_session/new'); axios.get(tokenUrl) .then((response) => { let auth_token = response.data.guest_session_id; sessionStorage.setItem("auth_token", auth_token); }) .catch((err)=> { console.error(err); }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeAuthToken() {\n var token = 'Auth'+ new Date().getTime();\n\n return token;\n }", "getRequestToken() {\n return apiClient.get(\n '/authentication/token/new?api_key=6c1e80dae659cb7d1abdf16afd8bb0e3'\n )\n }", "function auth() {\n \n var token = getParameterByName('tok...
[ "0.7073702", "0.700345", "0.6820543", "0.6611227", "0.655493", "0.6486911", "0.6468615", "0.64642113", "0.63628393", "0.6355285", "0.6349255", "0.6341291", "0.6307538", "0.6296276", "0.6294572", "0.62880164", "0.62823623", "0.6269742", "0.6249149", "0.62170273", "0.62016165",...
0.0
-1
To return a movie listing based on the requested parameters ~ unused
function searchMovies(movies){ console.log("searching for:", movies); axios.get(generateApiUrl('search/movie')) .then( (response) => { console.log(response); }) .catch((err) => { console.error(err); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function list(name, year, genres, page) {\n return $.getJSON(\"/api/movies/?q=\" + encodeURIParam(name) + \"&year=\" + encodeURIParam(year) + \"&genres=\" + encodeURIParam(genres) + \"&page=\" + encodeURIComponent(page != null ? page.toString() : \"\"));\n }", "function getMovieList(movieList = [], pag...
[ "0.71758825", "0.7078094", "0.68603635", "0.6791005", "0.6753174", "0.67215526", "0.667687", "0.6663667", "0.6628633", "0.6621592", "0.6598538", "0.658426", "0.65795577", "0.6544884", "0.65394557", "0.65001637", "0.6490946", "0.64838654", "0.64812106", "0.64595306", "0.645400...
0.0
-1
Get the current genres available from the TMDB API
function getGenres(){ const genreUrl = generateApiUrl('genre/movie/list'); axios.get(genreUrl) .then((response) => { localStorage.setItem("currentGenres", JSON.stringify(response.data.genres)); return response.data.genres; }) .catch((err)=>{ console.error(err); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static getGenres() {\n return axios\n .request({\n baseURL: `${TMDB.API_URL}`,\n url: `/genre/tv/list?api_key=${TMDB.API_KEY}`,\n responseType: \"json\"\n })\n .then(response => {\n if (response.status !== 200) {\n return Promise.reject(new Error(response.stat...
[ "0.80582136", "0.80181473", "0.8017286", "0.7997309", "0.76911044", "0.7602529", "0.74328285", "0.73813987", "0.73503447", "0.7331327", "0.7286463", "0.7209106", "0.6930989", "0.68298477", "0.68271065", "0.68191725", "0.6716938", "0.669389", "0.6556808", "0.65087324", "0.6481...
0.7644877
5
Get the latest list of latest movies from the TMDB API
function getLatestMovies() { let latestUrl = generateApiUrl('movie/now_playing'); axios.get(latestUrl) .then((response) => { const latestMovies = response.data.results.sort((a,b) => b.popularity - a.popularity); localStorage.setItem("latestMovies", JSON.stringify(latestMovies)); return latestMovies; }) .catch((err)=>{ console.error(err); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getMovieList(callback){\n\tconst query = {\n\t\tapi_key: TMDB_API_AUTH.KEY,\n\t\tsort_by: \"release_date.desc\",\n\t\tpage: pageCounter\n\t};\n\t$.getJSON(TMDB_SEARCH_URL_MOVIES_LIST, query, callback);\n}", "async function getMovies(ctx) {\n const currentDate = getCurrentDate();\n const movies = ctx.m...
[ "0.79560894", "0.725326", "0.6973141", "0.691156", "0.68139607", "0.66686493", "0.6657678", "0.65678656", "0.65582055", "0.6554129", "0.65254754", "0.6483433", "0.6481418", "0.6458714", "0.64369994", "0.64369994", "0.6430123", "0.6428067", "0.63395256", "0.63120717", "0.62710...
0.7253222
2
base reader from the locally stored movie feed. / defaults to filter the movies by the rating of 3 or better / also accepts an array of genre ids to then filter the list from too
function setMovieListing(filters = "3", filter = "genre_ids"){ try{ let movies = localStorage.getItem("latestMovies") ? JSON.parse(localStorage.getItem("latestMovies")) : getLatestMovies(); let filteredMovies = movies; ///create a default object to start with //Now see if we've passed in an Array to filter by, which needs to go a bit deeper? if (Array.isArray(filters) && filters.length > 0){ filteredMovies = movies.filter((m) => m[filter].some(s=>filters.some(sieve => sieve === s))); } //Otherwise the filter is a string, more than likely to be if (typeof filters === 'string' || filters instanceof String){ filteredMovies = movies.filter((m) => m[filter] >= filters); } renderMovieListing(filteredMovies); }catch(err){ console.error(err); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getFilteredMovies(filter, callback) {\n var options = {\n method: 'GET',\n endpoint:'movies5s',\n qs: {ql:\"\"}\n };\n // Build query from params specified\n if (filter.name != '') {\n if (options.qs.ql != \"\") // For multiple parameters\n options.qs.ql ...
[ "0.58723307", "0.56935096", "0.56881374", "0.56881106", "0.5616227", "0.5546773", "0.55130726", "0.5501481", "0.55011076", "0.54993886", "0.5485237", "0.5466375", "0.54627585", "0.5451765", "0.54440784", "0.5442648", "0.5428851", "0.54076856", "0.53821534", "0.5366641", "0.53...
0.57119143
1
Send the results as template strings to their respective parent elements
function renderMovieListing(movies){ let filmstrip = ''; let movieGenres = []; let availableGenres = localStorage.getItem("currentGenres") ? JSON.parse(localStorage.getItem("currentGenres")) : getGenres(); for(let movie of movies){ movieGenres.push(... new Set(movie.genre_ids)); const filmGenres = filterArray("id", availableGenres, movie.genre_ids); filmstrip += ` <figure class="movie"> <img class="movie--poster" srcset="https://image.tmdb.org/t/p/w342/${movie.poster_path} 320w, https://image.tmdb.org/t/p/w500/${movie.poster_path} 480w, https://image.tmdb.org/t/p/original/${movie.poster_path} 800w" sizes="(max-width: 320px) 280px, (max-width: 480px) 440px, 800px" src="https://image.tmdb.org/t/p/w92/${movie.poster_path}" alt="${movie.title} Poster" /> <figcaption class="movie--credits"> <h2 class="movie--title">${movie.title}</h2> <h3 class="movie--rating">Rating: ${movie.vote_average}</h3> <ul class="movie--genres tags"> ${filmGenres.map(genre => (`<li class="genre tag"><span class="tag-label">${genre.name}</span></li>`)).join('')} </ul> </figcaption> </figure> `; } //set the cinema content to the template strings document.getElementById('cinema').innerHTML = filmstrip; //get unique set of genres to filter against available genres from api const currentGenres = [...new Set(movieGenres)]; //filter the current genres to create a new object const filmGenres = filterArray("id", availableGenres,currentGenres); let genres = ''; for(let genre of filmGenres ){ let name = genre.name.replace(" ","_").toLowerCase(); let id = genre.id; genres += ` <li class="genre tag"> <input class="genre--selector" type="checkbox" id="${name}-${id}" name="genre-tags" value="${id}"> <label class="tag-label" for="${name}-${id}" name="${name}-label">${genre.name}</label> </li>`; } document.getElementById('genres').innerHTML = genres; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _html(pobj, obj, template, options, index){\n \n //Create a new ihtml object for the parent and it's children\n var parent = new iHTML(),\n children = new iHTML();\n \n //Set the default html element key\n\t\tvar ele = \"<>\";\n\t\t\n\t\t//Look into the properties...
[ "0.6008728", "0.5752439", "0.5670244", "0.56100166", "0.56079936", "0.551152", "0.54627365", "0.54563415", "0.54531854", "0.5443828", "0.54157037", "0.5389362", "0.5387283", "0.5386114", "0.5369917", "0.5346776", "0.53292996", "0.5308876", "0.5307069", "0.528543", "0.5269255"...
0.0
-1
return 1 + 2; } console.log(questionOne());
function questionTwo (num1, num2, num3) { return Math.max(num1, num2, num3) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function answer1() {\n //the answer should be \"yes\" or \"no\"\n return \"no\";\n}", "function one(){\n\n return 'ONE';\n\n // Nothing after 'return' gets executed\n console.log('THIS WILL NOT WORK!');\n\n}", "function returnA() {\n checkAnswer(1);\n}", "function firstfunc (x, y){\n\tvar mathandstuf...
[ "0.7163506", "0.7046955", "0.7039151", "0.7008113", "0.69740045", "0.6943809", "0.6939151", "0.6912485", "0.6870749", "0.68200684", "0.6815296", "0.6810647", "0.68104225", "0.68104225", "0.6803816", "0.671336", "0.6706433", "0.6703776", "0.6694486", "0.6691704", "0.6632818", ...
0.0
-1
the first pair where the sum is 0. Return an array that includes both values that sum to zero or undefined if a pair does not exist. sumZero([3,2,1,0,1,2,3]) => [3,3] sumZero([2,0,1,3]) => undefined sumZero([1,2,3]) => undefined
function sumZero(arr){ for(let i = 0; i < arr.lenght; i++){ for(let j = 0; j < arr.lenght; j++){ if(arr[i] + arr[j] === 0){ return [arr[i], arr[j]]; } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sumZero(arr){\n for(let i=0; i<arr.length; j++){ //basic loop thru entire array\n for(let j=i+1; j<arr.length; j++){//basic loop thru entire array starting one ahead\n if(arr[i]+ arr[j]===0){// if the sum is 0\n return [arr[i], arr[j]]\n }\n }\n }\n...
[ "0.8179308", "0.8163827", "0.8161207", "0.81458807", "0.81294066", "0.81243056", "0.81243056", "0.81155276", "0.8112726", "0.8095359", "0.80748636", "0.80298185", "0.80258054", "0.7775838", "0.7745942", "0.7664678", "0.7644619", "0.7640978", "0.761199", "0.7609138", "0.758588...
0.8058502
11
global $, jQuery, QRCode, alert, console / todo ===================================================================== disable add button while waiting for ajax request so that user doesn't send too many ajax requests
function addRowToTable(action, name, instructions) { 'use strict'; var htmlName, newElement, pictureElement, medicineName, row; htmlName = JSON.stringify("medicine_" + name); console.log(name, instructions); if (action === "insert") { newElement = $("<tr name=" + htmlName + ">").append( $('<td/>').text(name), $('<td/>').text(instructions) ); $('table tbody').append(newElement); console.log("APPENDED"); pictureElement = $( "<iframe id='picture' scrolling='no'/>", {'class': "images"} ); pictureElement.attr( 'src', 'picture.php?' + $.param({'medicineName': name}) ); newElement.children('td').eq(0).append(pictureElement); pictureElement.ready(function () { pictureElement.height(pictureElement.width()); }); } else if (action === "update") { row = 'table tbody tr[name=' + htmlName + '] td:nth-child(2)'; $(row).html(instructions); } else if (action === "remove") { row = 'table tbody tr[name=' + htmlName + ']'; console.log(row); $(row).remove(); } else { console.error(action); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function add_license_keys(product_id) {\n var license_keys = $('#textarea_license_keys').val();\n if (license_keys.trim() != \"\") {\n $(\".btn-add-license-keys\").prop('disabled', true);\n $(\".loader-license-keys\").show();\n var data = {\n 'product_id': product_id,\n ...
[ "0.62738734", "0.6176023", "0.6144124", "0.61334085", "0.6055388", "0.6021078", "0.5984287", "0.59819", "0.5950669", "0.59487134", "0.59288216", "0.5913086", "0.5913086", "0.5883818", "0.58822864", "0.58688396", "0.5860038", "0.5848878", "0.58375543", "0.58309895", "0.5824634...
0.0
-1
a function to get the necessary data
async function getData() { // Commented below is a request I would have made to an API, instead I will just get the mock data try { // const response = await axios({ // method: "GET", // url: ``, // }); // setData(response) setData(mockData); } catch (error) { console.log(error); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_data() {}", "getData(){}", "function getData() {\n return {\n ergReps: ergReps,\n bikeReps: bikeReps,\n repRate: repRate,\n totTime: totTime,\n Distance: Distance\n }\n }", "GetData() {}", "getData () {\n }", "functio...
[ "0.8254262", "0.7244824", "0.6888166", "0.67836374", "0.66986525", "0.6668903", "0.6668903", "0.66401464", "0.66401464", "0.66159177", "0.643464", "0.64271647", "0.6343243", "0.6303485", "0.6292739", "0.6251069", "0.62485623", "0.62399894", "0.6235058", "0.62314785", "0.62154...
0.0
-1
Use of this source code is governed by a BSDstyle license that can be found in the LICENSE file.
function $(id) { return document.getElementById(id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "private public function m246() {}", "protected internal function m252() {}", "static final private internal function m106() {}", "transient private protected internal function m182() {}", "static private internal function m121() {}", "transient protected internal ...
[ "0.7138198", "0.6836233", "0.65235883", "0.6500098", "0.62371546", "0.61890924", "0.61654526", "0.6165028", "0.6161057", "0.6100218", "0.6043434", "0.60406536", "0.59524876", "0.5912759", "0.5884074", "0.5863032", "0.5859196", "0.57833964", "0.5691056", "0.5660413", "0.564540...
0.0
-1
! vuerouter v3.1.3 (c) 2019 Evan You
function d(t){return Object.prototype.toString.call(t).indexOf("Error")>-1}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function jj(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"source.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "private public function m246() {}", "function TM(t,e,n,i,r,o,a,s){var u=(\"functio...
[ "0.59254473", "0.58895314", "0.5834521", "0.58120894", "0.57648623", "0.5731167", "0.56673914", "0.56521726", "0.56487083", "0.5628806", "0.56131107", "0.5610753", "0.5605729", "0.5538249", "0.5529956", "0.54961896", "0.54924136", "0.5469004", "0.54286796", "0.54227495", "0.5...
0.0
-1
landing page app helper functions
function login_change() { window.location.reload(); set_cookie(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadApp() {\n console.log(\"loadApp\");\n displayHomePage();\n}", "function mobileLanding() {\n\tapp.getView().render('turnto/mobilelanding');\n}", "function home(){\n\tapp.getView().render('vipinsider/insider_home.isml');\n}", "function homePageLoader() {\n\n pageCreator(\"home-page\");\n n...
[ "0.69442725", "0.6828731", "0.6782684", "0.6760298", "0.67290443", "0.6654286", "0.66436094", "0.65650684", "0.65409404", "0.6529138", "0.6527243", "0.6512137", "0.6442465", "0.6423348", "0.640431", "0.6349092", "0.6341919", "0.6341177", "0.6338396", "0.62734365", "0.62496626...
0.0
-1
Object to store state in local storage.
function State() { // Adapted from here: http://diveintohtml5.info/storage.html var ls; try { ls = 'localStorage' in window && window['localStorage'] !== null; } catch (e) { ls = false; } //var user = (auth.isLoggedIn() ? auth.getUserData().user_id : 'public'); this.get = function(key) { if (!ls) { return null; } //key = user + '.' + key; var val = localStorage.getItem(key); try { val = JSON.parse(val); } catch(e) { return null; }; return val; }; this.set = function(key, val) { if (!ls) { return null; } //key = user + '.' + key; try { val = JSON.stringify(val); } catch(e) { return null; } return localStorage.setItem(key, val); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function storeState() {\n\n localStorage.setItem(STORAGE_KEY, JSON.stringify(data));\n }", "save() {\n localStorage.setItem(\"state\", this.getStateString());\n if (this.debug) {\n console.log(\"state saved\");\n console.log(this.state);\n }\n }", "functi...
[ "0.7660972", "0.759448", "0.71857816", "0.71806926", "0.7167772", "0.7139642", "0.71160245", "0.71047664", "0.7100408", "0.7078042", "0.70572275", "0.7047922", "0.7016288", "0.7000498", "0.6999444", "0.6996221", "0.6969661", "0.69569993", "0.69536465", "0.6952793", "0.6952086...
0.74729216
2
Check the consistency of the State
check(options) { this.constructor.check(this, options); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getValidStatus() {\n this.checkInput();\n return this.state.isValid;\n }", "async function assertState(state) {}", "async function checkState(_tokens, _stateChanges, _accounts) {\n let numTokens = _tokens.length\n assert.equal(numTokens, _stateChanges.length)\n for (let i = 0; i < numTokens; i++) {\n...
[ "0.634634", "0.63179356", "0.631463", "0.62222314", "0.62201065", "0.61089563", "0.60890144", "0.6063266", "0.60560477", "0.60407686", "0.6038451", "0.60109645", "0.58998275", "0.5887521", "0.5868892", "0.58535737", "0.58497894", "0.5820178", "0.5802804", "0.57777756", "0.576...
0.0
-1
Check the consistency of the State's attributes
static check(state, {dimension = null, title = null, eigen} = {}) { if (!(state instanceof State)) { throw (new TypeError( 'The argument is not a state \n' + 'Tips: maybe you are using 2 different version of kalman-filter in your npm deps tree' )); } const {mean, covariance} = state; // Index const meanDimension = mean.length; if (typeof (dimension) === 'number' && meanDimension !== dimension) { throw (new Error(`[${title}] State.mean ${mean} with dimension ${meanDimension} does not match expected dimension (${dimension})`)); } checkMatrix(mean, [meanDimension, 1], title ? title + '-mean' : 'mean'); checkMatrix(covariance, [meanDimension, meanDimension], title ? title + '-covariance' : 'covariance'); checkCovariance({covariance, eigen}, title ? title + '-covariance' : 'covariance'); // If (typeof (index) !== 'number') { // throw (new TypeError('t must be a number')); // } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "checkValidity() {\n this.validState = this.currentDataState.name && \n +this.currentDataState.amount && +this.currentDataState.maximumRides;\n }", "getValidStatus() {\n this.checkInput();\n return this.state.isValid;\n }", "function checkConsistency(selected) {\n var next;\n ...
[ "0.62308526", "0.6172292", "0.614439", "0.6132538", "0.6079051", "0.6039637", "0.59138834", "0.5861194", "0.5828843", "0.57531667", "0.57370085", "0.5721421", "0.5647467", "0.5646098", "0.56174374", "0.5614289", "0.5589433", "0.5580064", "0.5534819", "0.5532091", "0.55295765"...
0.51757425
65
JavaScript Turn Off Modal Contact
function closeImages1() { var nutButton = document.getElementById("buttonContactone") var modalOne1 = document.getElementById("full-modal-contact-two") var dongModal1 = document.getElementById("alway-close1") dongModal1.style.display = 'block' setTimeout(function(){ modalOne1.style.display = 'none' dongModal1.style.display = 'none' nutButton.style.display = 'block' },500) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toggleModalOff(){\n var modalWindow = document.querySelector('.modal')\n modalWindow.style.display = 'none';\n }", "function esconderModal() {\n\tmodal.style.display = 'none';\n}", "function toggleModalOff() {\n const modal = document.querySelector('.modal-background');\n modal.classList....
[ "0.7456289", "0.7248915", "0.71650547", "0.70707536", "0.69418395", "0.6911236", "0.68737406", "0.6826984", "0.67984414", "0.6797028", "0.67603946", "0.6719777", "0.6713316", "0.671285", "0.67083853", "0.66478986", "0.66270685", "0.6606114", "0.65982765", "0.65663403", "0.656...
0.0
-1
This function is unused. I wrote it to solve part 1, but later decided on a Regex approach for part 2 and adapted it for part 1 too.
function evalRule(ruleNum){ let reqRule = rules.get(ruleNum); if (reqRule.every(isNaN) && reqRule.find(e => e == '|') == undefined){return reqRule}; reqRule = reqRule.map(value => { if (isNaN(value)){ return value; } else { return evalRule(value); }; }); let orIndex = reqRule.findIndex(e => e == '|'); if (orIndex != -1){ if (orIndex == 2){ reqRule.splice(0, 2, cartesian(reqRule[0], reqRule[1])); } orIndex = reqRule.findIndex(e => e == '|'); if (reqRule.length - orIndex == 3){ reqRule.splice(orIndex+1, 2, cartesian(reqRule[orIndex+1], reqRule[orIndex+2])); } orIndex = reqRule.findIndex(e => e == '|'); } if (orIndex == -1){ reqRule = cartesian(...reqRule) } if (orIndex == 1 && reqRule.length == 3){ reqRule.splice(1,1) reqRule = reqRule.flat() } rules.set(ruleNum, reqRule); return reqRule }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function afterDotOptional(str) {\n\t\tind = str.indexOf(\"0\\\\s*1\\\\s*p\\\\s*e\\\\s*r\\\\s*c\\\\s*e\\\\s*n\\\\s*t\\\\s*o\\\\s*f\\\\s*z\\\\s*i\\\\s*n\\\\s*c\");\n\t\tif (ind != -1) {\n\t\t\tstr = str.substr(0,ind) + \"\\\\d?\\\\s*\" + str.substr(ind,str.length);\n\t\t\tind = -1;\n\t\t}\n\t\tind = str.indexOf(\"1\...
[ "0.61580044", "0.58097106", "0.5785728", "0.5627997", "0.5550984", "0.550861", "0.5475316", "0.54234326", "0.5383345", "0.5383345", "0.5382167", "0.53339595", "0.5315175", "0.5314426", "0.52914375", "0.5287212", "0.5280207", "0.5271225", "0.5266938", "0.5266938", "0.5266938",...
0.0
-1
creates default table row to display when user does not have any tickets.
function createNothingToDisplayElement() { let nothingToDisplayRow = document.createElement("tr"); let nothingToDisplayData = document.createElement("td"); nothingToDisplayData.setAttribute("colspan", "7"); nothingToDisplayData.innerHTML = "No reimbursment requests discovered."; nothingToDisplayRow.appendChild(nothingToDisplayData); return nothingToDisplayRow; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createRowWithTicket(pOneTicketData, pOrder) {\n\n var tableBody = $(\"#table-body\");\n var mainRow = $(\"#table-body-main-row\");\n var newRow = $(\"<tr>\");\n newRow.attr('data-ticket-DBID', pOneTicketData.ticketID);\n newRow.attr('data-ticket-custDBID', pOneTicketData...
[ "0.64105254", "0.61403865", "0.58570755", "0.5753898", "0.57094246", "0.5695277", "0.5616051", "0.56051475", "0.56041616", "0.55941886", "0.5586514", "0.558389", "0.551595", "0.54904765", "0.5488418", "0.54874057", "0.5483197", "0.5468182", "0.54633564", "0.54485804", "0.5441...
0.6236705
1
this function converts JSON data into a table row
function createTableRowDataEntry(JSONdata) { //nested function that generates td for our tr function appendTD(tr, data, colspan) { let td = document.createElement("td"); td.innerHTML = data + ""; //if user passed colspan param into function, //add the colspan attribute to td if (colspan !== undefined) td.setAttribute("colspan", colspan + ""); tr.appendChild(td); } function appendTDCheckBox(tr, requestId) { let td = document.createElement("td"); let bootstrapCheckbox = document.createElement("input"); bootstrapCheckbox.type = "checkbox"; bootstrapCheckbox.id = requestId; bootstrapCheckbox.checked = false; bootstrapCheckbox.className = "form-input-checkbox"; td.appendChild(bootstrapCheckbox); tr.appendChild(td); } let tr = document.createElement("tr"); let { dateSubmitted, description, amount, status, requestedBy } = JSONdata; //append all data to dynamically generated tr. appendTD(tr, dateSubmitted, 1); appendTD(tr, description, 3); appendTD(tr, amount, 1); //spaces added to fix offset caused by scroll on tbody appendTD(tr, status, 1); appendTD(tr, requestedBy, 1); appendTDCheckBox(tr, "test-id", 1); return tr; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeTable(json) {\n var obj = JSON.parse(json),\n table = $(\"<table>\"),\n row, value, i;\n\n for (i = 0; i < obj.rows.length; i++) {\n row = $(\"<tr>\");\n row.append(\"<td>\" + obj.rows[i].key + \"</td>\");\n value = obj.rows[i].value...
[ "0.78981584", "0.7365781", "0.71425265", "0.713016", "0.7094358", "0.7086602", "0.7082141", "0.70704246", "0.70545435", "0.6989933", "0.6942466", "0.6942466", "0.6913905", "0.69126475", "0.6903656", "0.68922955", "0.68397033", "0.6806975", "0.6803131", "0.67890894", "0.678400...
0.71474624
2
nested function that generates td for our tr
function appendTD(tr, data, colspan) { let td = document.createElement("td"); td.innerHTML = data + ""; //if user passed colspan param into function, //add the colspan attribute to td if (colspan !== undefined) td.setAttribute("colspan", colspan + ""); tr.appendChild(td); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function new_td(value) {\n var td = '<td>' + value + '</td>';\n\n return td;\n}", "function tdtr(a) {\n $(row).append(a)\n }", "function getTableHeader() {\n // 2nd tr\n var trTag = $j('<tr></tr>');\n var tdTag = $j('<td class=\"infoline\" style=\"width:60px;\"></td>').html(\n ...
[ "0.7012176", "0.6966401", "0.6890342", "0.683491", "0.68028265", "0.67603433", "0.671317", "0.6649285", "0.66363066", "0.65809524", "0.65722907", "0.6539012", "0.65388364", "0.65384126", "0.65228355", "0.6517728", "0.65143365", "0.65064824", "0.6506121", "0.6493017", "0.64630...
0.6381046
35
creates table body for user
function createTableBody(tableData) { let tableRows = createNothingToDisplayElement(); let tableRowElement = null; if (Array.isArray(tableData) && tableData.length > 0) { tableRows = []; for (let dataElement of tableData) { tableRowElement = createTableRowDataEntry(dataElement); tableRows.push(tableRowElement); } } return tableRows; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createTableBody(table) {\n // reset body containings\n let tableBody = $('#table-body');\n tableBody.html('');\n\n // displaying results\n headers = Object.keys(table[0].input).slice(2);\n let rowCount = 0;\n\n table.forEach(function(data) {\n le...
[ "0.7115923", "0.7095937", "0.6854381", "0.67715114", "0.6749804", "0.6730525", "0.67013925", "0.66728157", "0.6655575", "0.6581669", "0.65797275", "0.65745014", "0.6569324", "0.64977044", "0.6431798", "0.64284444", "0.6397294", "0.637533", "0.6367064", "0.6367064", "0.6342394...
0.6194941
29
Wrap this code in function
function askUserForName(){ var userName = prompt('Please Enter Your Name '); alert('Hello ' + userName); return userName; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function miFuncion (){}", "function fn() {\n\t\t }", "function miFuncion(){}", "function miFuncion(){}", "function miFuncion(){}", "function sdk_wrap(fn) {\n return wrap(fn)();\n}", "function __func(){}", "function wrapfunction(fn,message){if(typeof fn!=='function'){throw new TypeError('argument f...
[ "0.6362553", "0.63012534", "0.627982", "0.627982", "0.627982", "0.61530066", "0.6066746", "0.6057073", "0.60282576", "0.6016722", "0.6005612", "0.5921636", "0.5906515", "0.58965397", "0.58906937", "0.5886585", "0.5875306", "0.5861079", "0.5855512", "0.5855512", "0.57942814", ...
0.0
-1
Item owner gets money. Item transfer to \to_cont
function sell_item_transfer(to_cont, item, cost_adjustment) { return $q.all([ change_gold(item._2o.container(), item.cost*cost_adjustment), put_item(to_cont, item) ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function buy_item(to_cont, item, cost_adjustment) {\n return $q.all([\n change_gold(to_cont, -1*(item.cost*cost_adjustment)),\n put_item(to_cont, item)\n ]);\n }", "function _recordMoney(rest, item) {\n rest.foodCost += 5\n rest.revenue += floorToCents(item.price)\n}", ...
[ "0.7070466", "0.6346074", "0.6200739", "0.6120404", "0.6072922", "0.6057651", "0.6030295", "0.6030295", "0.6030295", "0.6030295", "0.6030295", "0.6030295", "0.60043234", "0.59226453", "0.58981985", "0.5893371", "0.586702", "0.58419544", "0.58244896", "0.58140206", "0.58131313...
0.70928687
0
Item owner gets money. Item destroyed
function sell_item_destroy(item, cost_adjustment) { //U.pluck(item._2o.container()._2m.items(), item); return $q.all([ change_gold(item._2o.container(), item.cost*cost_adjustment), Oit.destroy_item(item) ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onClick() {\n // Remove a bushel\n this.quantity -= 1;\n\n // Give the player money depending on the STATE.cashPerCrop variable\n STATE.resources.money += STATE.cashPerCrop;\n\n // Check if any bushels remain.\n // If not, destroy this wheat and\n // let the player know\n if (this.quantity ...
[ "0.63991505", "0.60630536", "0.60042256", "0.598459", "0.59381306", "0.5932423", "0.5908321", "0.5883736", "0.5836178", "0.5832816", "0.58318627", "0.58135724", "0.5797597", "0.5789406", "0.57611763", "0.57611763", "0.57611763", "0.57611763", "0.57611763", "0.57611763", "0.57...
0.6786365
0
\to_cont gets money and item
function buy_item(to_cont, item, cost_adjustment) { return $q.all([ change_gold(to_cont, -1*(item.cost*cost_adjustment)), put_item(to_cont, item) ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _recordMoney(rest, item) {\n rest.foodCost += 5\n rest.revenue += floorToCents(item.price)\n}", "function get_item(item) {\n money_count += item.price;\n return items[item.id];\n}", "function convertMoney(money) {\n return `$ ${money.toFixed(2).toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",...
[ "0.6196287", "0.6105152", "0.5942234", "0.5917596", "0.58974034", "0.582925", "0.5816826", "0.5787249", "0.5771156", "0.57099897", "0.5675126", "0.5673713", "0.5654836", "0.56474245", "0.5618255", "0.55915976", "0.5585326", "0.5561582", "0.5555752", "0.5553342", "0.55374587",...
0.6338091
0
Handles item instances and item dicts
function put_item(to_cont, item) { to_cont._2m.items().push(item); item.container = to_cont.id; item._2o.container = function(){ return to_cont; }; if(item.id) return EM.update('item', item); else return Oit.new_item(item).then(function(newE) { U.replace(to_cont._2m.items(), item, newE); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "processItems() {}", "function Item(item) {\n this.id = item.id\n this.name = item.name\n this.itemWeight = item.item_weight\n this.value = item.value\n}", "function itemToObject(item) {\n var data = {};\n \n data.type = item.getType().toString();\n \n // Downcast items to access type-specific ...
[ "0.670019", "0.64798", "0.63719356", "0.6331552", "0.62768364", "0.6251347", "0.62283534", "0.619127", "0.6072372", "0.6042383", "0.603565", "0.60290915", "0.6026444", "0.5973232", "0.59565175", "0.5942904", "0.5915795", "0.5900617", "0.5899283", "0.589006", "0.58808625", "...
0.0
-1
Options are: level(decorator with level+), cost, weight, name
function get_item_dict(opts) { var weight = 0, cost = 0, level, mundane, magic; var item = { cost: 0, weight: 0, level: 0, amount: 1 }; if(opts) { weight = opts.weight || 0; cost = opts.cost || 0; item.name = opts.name; level = opts.level; mundane = opts.mundane; magic = opts.magic; if(opts.amount) item.amount = opts.amount; } // Name if(!item.name) { if(magic) item.name = magic.name; else if(mundane) item.name = mundane.name; else item.name = 'Unnamed Item'; } // Cost if(cost) { item.cost = cost; } else if(level && level > magic.level) { item.cost = prices[level]; } else if(magic) { item.cost = magic.cost; } else if(mundane) { item.cost = mundane.cost; } // Weight if(weight) { item.weight = weight; } else if(mundane) { item.weight = mundane.weight; } item.cost *= item.amount; item.weight *= item.amount; // Level if(!level && magic) level = magic.level; item.level = level; // Put the relateds inside the EM list if(magic) { if(!EM.by_key('magic', magic.id)) EM.add_local('magic', magic); item.magic = magic.id; } if(mundane) item.mundane = mundane.id; EM.merge_related('item', item); return item; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function level(title, numTricks, expReq, prefix=\" a\") {\n this.prefix = prefix;\n this.title = title;\n this.numTricks = numTricks;\n this.expReq = expReq;\n}", "constructor(level = \"info\") {\n this.level = level;\n }", "constructor(name, lvl, health, stats)\n {\n this.name = name || \"St...
[ "0.5835962", "0.5690901", "0.56734717", "0.56602925", "0.5633798", "0.55206877", "0.55206877", "0.5517465", "0.5449514", "0.54214585", "0.5397725", "0.5386274", "0.5374661", "0.53259796", "0.5322912", "0.53166866", "0.5212185", "0.5196772", "0.51891017", "0.51315945", "0.5098...
0.46350038
93
STEP 1: Define a provider function
function ShoppingListServiceProvider() { /* What makes this whole setup very special is the fact that you could provide some config object inside the service provider, and that usually comes with defaults that you can later overwrite in the step where you configure the entire application */ this.config = { maxItems: 10 }; /* It is a special function that has a particular property on the actual instance of the function ($get) which is a factory function that create your service This $get property that's a function, is what makes the provider a provider AngularJS expects the provider to have a $get property whose value is a function that Angular will treat as a factory function */ this.$get = function() { return new ShoppingListService(this.config.maxItems); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ProviderData() {}", "function ProviderData() {}", "function ProviderData() {}", "function SubProvider() {\n\n}", "function SubProvider() {\n\n}", "function SubProvider() {\n\n}", "function ProviderData(){}", "function SubProvider() {\n\n\t}", "function ModuleWithProviders() {}", "functio...
[ "0.7395332", "0.7395332", "0.7395332", "0.73376346", "0.73376346", "0.73376346", "0.7324042", "0.7101354", "0.70876896", "0.70876896", "0.70876896", "0.7083232", "0.699762", "0.699762", "0.6956567", "0.6808574", "0.6808574", "0.67604995", "0.6649817", "0.65602934", "0.6560293...
0.0
-1
Select the text object Create a function that will do "something" when that button is clicked
function handleClick() { console.log("Test: the button was clicked!"); //Test to see if my funciton is tied to the button being clicked console.log(d3.event.target); // "d3.event.target" this will keep track of whatever the thing was that called a function (i.e. if you've got a web page with multiple buttons, this will keep track of which button called the function) //What we really want is to DO something when that button is clicked. What we want is to filter off of the datetime that is inputted //var inputElement = d3.select("#datetime"); // Grab the input box // Note: we already did this var inputValue = dateTime.property("value"); // this lets us get at the text that someone has typed into a form console.log(inputValue); //safety valve to make sure we're grabbing the right text out of the box console.log(tableData); // Create the filter variable var filteredData = tableData.filter(tableData => tableData.datetime === inputValue); //not entirely sure if tableData.Date is correct console.log(filteredData); // remove all the existing data within ufoReport (select all from the table tag, then add .remove() to delete the table tags) // tbody-select_all-tr-.remove // for each loop appending new filtered rows }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function changeText() {\n \n }", "clickObject(phrase){this.__text=phrase;this.commands[phrase].object.click();this.commands[phrase].object.focus()}", "doTextOperation(){let root=this,selection=root.selection;if(root.toggled&&null!==root.toggledCommand){document.execCommand(root.toggledCommand,!1,root.to...
[ "0.7166872", "0.7116108", "0.6713565", "0.66875803", "0.664191", "0.66394156", "0.6627204", "0.66228324", "0.64708835", "0.64210504", "0.64128876", "0.640329", "0.6396147", "0.6381871", "0.6375091", "0.636068", "0.6357999", "0.6354909", "0.63320595", "0.6331252", "0.6324269",...
0.0
-1
Returns all requests that needed to happen for all changes
async stopRecordingRequests() { if (!this.isRecordingRequests) { throw new Error('You need to start recording before stopping'); } const batch = { intent: this.intent, requests: this.currentRequestsRecorded, validationErrors: lodash_1.compact(this.currentValidationErrorsRecorded), runtimeErrors: this.currentRuntimeErrorsRecorded }; this.requestBatches.push(batch); this.isRecordingRequests = false; this.currentRequestsRecorded = []; this.currentValidationErrorsRecorded = []; this.intent = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "findRequestAll(qParams) {\n return this.request.get('requests', qParams);\n }", "getChanges() {\n return this.getStore().then(s => s.filter(undefined, 'id', {\n offset: 0,\n limit: 500\n })).then(changes => {\n changes.forEach(change => {\n change...
[ "0.6970937", "0.66357005", "0.6222595", "0.6088869", "0.5972922", "0.591496", "0.59128916", "0.5909605", "0.58772606", "0.58772606", "0.58516455", "0.584891", "0.581136", "0.5682478", "0.56738275", "0.5649433", "0.5599287", "0.5569104", "0.5562731", "0.55588675", "0.5533231",...
0.0
-1
Complete the anagram function below.
function anagram(s) { const sL = s.length; if ((sL & 1) === 0) { const mid = sL / 2; let firstSlice = s.slice(0, mid).split(''); let secondSlice = s.slice(mid).split(''); return sumUp(firstSlice, secondSlice); } return -1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isAnagram(str1, str2) {}", "function isAnagram(str1, str2) {}", "function isAnagram(str1, str2) {}", "function checkAnagram() {\t\n\t\tvar first_str, second_str, first_temp, second_temp;\n\t\tfirst_str = $(\"#anagram-a\").val();\n\t\tfirst_temp = first_str;\n\t\tsecond_str = $(\"#anagram-b\").val();...
[ "0.78004897", "0.78004897", "0.78004897", "0.76877123", "0.76792103", "0.76521707", "0.75690114", "0.7520472", "0.7510093", "0.75061995", "0.74499625", "0.7364239", "0.7334213", "0.72860384", "0.727025", "0.72685146", "0.7248051", "0.72329473", "0.7218033", "0.7197962", "0.71...
0.730545
13
Highschool mathematics warning, dist = sqrt((x1x2)^2 + (y1y2)^2)
function calculateDistance(point, station) { const x1 = _.get(point, 'x', 0); const x2 = _.get(station, 'x', 0); const y1 = _.get(point, 'y', 0); const y2 = _.get(station, 'y', 0); const distance = Math.sqrt(Math.pow((x1 - x2), 2) + Math.pow((y1 - y2), 2)); return distance; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dist(x, y, x2, y2) {return Math.sqrt((x2-x)*(x2-x) + (y2-y)*(y2-y));}", "function dist(x1,y1,x2,y2) {\n return Math.sqrt( (x2-=x1)*x2 + (y2-=y1)*y2 );\n}", "function dist(x1, y1, x2, y2) {\r\n return Math.sqrt(Math.pow(x1 - x2, 2) + Math.pow(y1 - y2, 2));\r\n }", "function distancia(x1, y...
[ "0.81116265", "0.78565085", "0.77300876", "0.7722012", "0.76973903", "0.7692252", "0.7638338", "0.76357305", "0.76067865", "0.75878924", "0.7513586", "0.75106466", "0.7503946", "0.74710935", "0.74632305", "0.74371576", "0.74142706", "0.7413438", "0.74131316", "0.74031514", "0...
0.0
-1
Set the resource route of the model
resource() { return 'clients' }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setResource(value) {\n super.put(\"resource\", value);\n }", "set routes(data) {\n _routes = data;\n }", "constructor(path) { \n\n // Initiate the model\n super(); \n \n // Bind the route path for models\n this.path = path;\n }", "set partialRoute(route) {\n\t this._setRo...
[ "0.64842165", "0.5853986", "0.5804267", "0.5721706", "0.56035805", "0.558378", "0.5468923", "0.5458069", "0.54301167", "0.5414134", "0.53462934", "0.5308919", "0.52932906", "0.52715904", "0.52672327", "0.5242718", "0.5200405", "0.51904047", "0.51419765", "0.5109765", "0.51090...
0.0
-1
preload, loading all images and font
function preload(){ bunnyLeft = loadImage("bunny/assets/bunnyLeft.png"); bunnyRight = loadImage("bunny/assets/bunnyRight.png"); bunnyFront = loadImage("bunny/assets/bunnyFront.png"); bunnyBack = loadImage("bunny/assets/bunnyBack.png"); carrotimg = loadImage("bunny/assets/carrot.png"); floorimg = loadImage("bunny/assets/floor.png"); tomatoimg = loadImage("bunny/assets/tomato.png"); grassimg = loadImage("bunny/assets/grass.png"); bunnyEnd = loadImage("bunny/assets/bunnyEnd.png"); font = loadFont('bunny/assets/Adelle_Reg.otf'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function preload() {\n customFont = loadFont(\"../assets/Suisse Bold.otf\");\n escargot = loadImage('img/Escargot.gif');\n soleil = loadImage('img/Soleil.png');\n lune = loadImage('img/Lune.png');\n Lapin = loadImage('img/Lapin.gif');\n}", "function preload(){\n\t\n\ttheFont = loadFont('data/font1.otf'); /...
[ "0.8559665", "0.84288347", "0.8199454", "0.8149187", "0.8138191", "0.8025162", "0.798966", "0.79816324", "0.7980898", "0.79611945", "0.7941168", "0.78085035", "0.78082323", "0.7803746", "0.77996004", "0.7797169", "0.77665937", "0.77497417", "0.7735261", "0.77293783", "0.77198...
0.79432815
10
moves the spot from one end to another
move() { //if I'm going east & I hit the edge... if(this.direction === 0) { this.x += this.speed; if (this.x > (WIDTH)){ this.place() } //if I'm going west & I hit the edge... } else if(this.direction === 1) { this.x -= this.speed; if (this.x < 0) { this.place() } //if I'm going south & I hit the edge... } else if(this.direction === 2) { this.y += this.speed; if (this.y > (HEIGHT)) { this.place() } //if I'm going north & I hit the edge... }else if(this.direction === 3) { this.y -= this.speed; if (this.y < 0) { this.place() } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function move(from, to) {\n\n}", "move_to(x, y) {\n this.move(x - this.abs_x, y - this.abs_y)\n }", "move() {\n\t\tthis.lastPosition = [ this.x, this.y ];\n\n\t\tthis.x += this.nextMove[0];\n\t\tthis.y += this.nextMove[1];\n\t}", "move() {\n let to_move = [this.head].concat(this.parts);\...
[ "0.6616146", "0.64257634", "0.6387195", "0.6274731", "0.624743", "0.61776567", "0.6156826", "0.61314493", "0.6117566", "0.60838693", "0.607974", "0.6046687", "0.60423315", "0.60184747", "0.5991001", "0.5991001", "0.5931017", "0.59229505", "0.5914694", "0.58582544", "0.5853832...
0.0
-1
repspawns the spot in a new place this could've been placed in the move class but also it's a bit wordy
place() { //decides the random direction of the spot var randomDirection = floor(random(0,4)); //alter this placement & direction based on the direction if(randomDirection === 0) { //east this.x = 0; this.y = (floor(random(0,3)) * (platformSize + 10) + HEIGHT/2 - movement); this.direction = 0; } else if(randomDirection === 1) { //west this.x = WIDTH; this.y = (floor(random(0,3)) * (platformSize + 10) + HEIGHT/2 - movement); this.direction = 1; } else if(randomDirection === 2) { //south this.x = (floor(random(0,3)) * (platformSize + 10) + WIDTH/2 - movement); this.y = 0; this.direction = 2; } else if(randomDirection === 3) { //north this.x = (floor(random(0,3)) * (platformSize + 10) + WIDTH/2 - movement); this.y = HEIGHT; this.direction = 3; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reposition() {\r\n\r\n\tif(play && isGameOver() === true) {\r\n\t\tif(verifyVacancy(DIR.down, xAxis.default)) {\r\n\t\t\ttry {\r\n\t\t\t\tmoveTo(block, DIR.down, xAxis.default);\r\n\t\t\t\tsetThePositions(currentRow, currentColl, nextRow - xAxis.default, nextColl + DIR.down);\r\n\t\t\t} catch(err) {\r\n\t...
[ "0.6826974", "0.6782445", "0.663343", "0.6616821", "0.6594524", "0.6468872", "0.6451867", "0.64217126", "0.6408598", "0.64078283", "0.64078283", "0.64005095", "0.6324242", "0.62991923", "0.6237701", "0.62346786", "0.6230376", "0.6226434", "0.62239015", "0.621295", "0.6204273"...
0.6084515
32
Fetch Images From Web
function fetch_images(evt){ var $btn=$(evt),$step=$btn.closest('.post_product'),$pg,$ind,url; // if($btn.hasClass('fetching')) return; url = $step.find('input.url_').val().trim().replace(/^https?:\/\//i,''); if(!url.length) return alert('Please enter a website address.'); $btn.addClass('fetching').val('Wait...'); if(/\.(jpe?g|png|gif)$/i.test(url)) return check(['http://'+url]); function check(images){ var fn=[], list=[], cur=80, step=30/images.length; for(var i=0,c=images.length; i < c; i++) fn[i] = load(images[i],i,c); function load(src,i,c){ var def = $.Deferred(), img = new Image(); img.onload = function(){ cur += step; if(cur > 100) cur = 100; // $ind.stop().animate({'width':cur+'%'},100); if(this.width > 99 || this.height > 99) list.push(this); def.resolve(this); // set_images(list); // $('#add_link').val('http://'+url); // $btn.removeClass('fetching').val('Submit'); // $('.example22').trigger('click'); }; img.onerror = function(){ def.reject(this); if(i==c) alert("Oops! Couldn't find any good images for the page."); }; img.src = src; return def; }; $.when.apply($,fn).always(function(){ if(list.length){ set_images(list); $('#add_link').val('http://'+url); $btn.removeClass('fetching').val('Submit'); $('.example22').trigger('click'); }else{ alert("Oops! Couldn't find any good images for the page."); } }); }; $.ajax({ type : 'get', url : baseURL+'site/product/extract_image_urls?url='+url, dataType : 'json', success : function(json){ if(!json) return; if(json.response){ check(json.response); } else if(json.error && json.error.message){ alert(json.error.message); } }, complete : function(){ $btn.removeClass('fetching').val('Submit'); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fetchImages(){\n const imgUrl = \"https://dog.ceo/api/breeds/image/random/4\";\n fetch(imgUrl)\n .then(response => response.json())\n .then(json => displayImages(json.message));\n}", "function getImages( url )\n {\n // attempt to create XMLHttpRequest object and make the request\n try\n ...
[ "0.73724777", "0.7289278", "0.72325224", "0.7149243", "0.7029612", "0.70182437", "0.699242", "0.68646646", "0.6835498", "0.6821814", "0.68143815", "0.67789155", "0.6755397", "0.67434156", "0.67392784", "0.673632", "0.6671058", "0.66604644", "0.66179496", "0.661623", "0.659415...
0.598933
85
Output logging information to console
function log(text) { var time = new Date(); console.log("[" + time.toLocaleTimeString() + "] " + text); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _log() {\n if (typeof (console) !== \"undefined\") {\n console.log('==START==');\n for (var i = 0; i < arguments.length; i++) {\n console.log(arguments[i]);\n }\n console.log('==END==');\n }\n }", "function log() {\n console....
[ "0.7208231", "0.7204922", "0.72031695", "0.71529204", "0.7122645", "0.71209806", "0.70932496", "0.70932496", "0.70932496", "0.7080266", "0.70704865", "0.70522773", "0.7045506", "0.70416737", "0.70416737", "0.7011705", "0.69807196", "0.69690263", "0.69628686", "0.69543636", "0...
0.0
-1
TODO: make it work
chooseLocation() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private public function m246() {}", "private internal function m248() {}", "protected internal function m252() {}", "obtain(){}", "transient private protected internal function m182() {}", "transient private internal function m185() {}", "transient protected internal function m189() {}", "static priv...
[ "0.63650036", "0.63054776", "0.5999615", "0.57544494", "0.57074064", "0.5617733", "0.55843526", "0.556996", "0.5441519", "0.5354898", "0.529819", "0.52406967", "0.5184848", "0.51588523", "0.5154342", "0.5151452", "0.5150462", "0.51276034", "0.5116967", "0.5092899", "0.5089644...
0.0
-1
============================== | Picker state functions | ============================== For coach
setPickerValue(newValue) { this.setState({ pickerSelection: newValue }); this.togglePicker(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Picker( ){}", "checkPickingState() {\n return false;\n }", "settingPickerTypeSelChange(params){\n this.setState({\n pickerType: params.target.value\n })\n }", "dropDownCompnent() {\n return (\n <Picker\n selectedValue={this.state.selectedValueFrom...
[ "0.7216407", "0.68951535", "0.6845155", "0.66380024", "0.6548477", "0.65253407", "0.6477068", "0.63730913", "0.62361926", "0.6196419", "0.60491556", "0.6031117", "0.60304826", "0.6018748", "0.5975368", "0.5966839", "0.5966839", "0.5962316", "0.595822", "0.59511197", "0.593562...
0.6951598
1
POLYFILL for not supporting properties document; codeMirror;
constructor() { super(); this._document= this.attachShadow( { mode: 'open', }, ); styleLoader.apply( this._document, ); const tags= document.createElement( 'div', ); tags.classList.add( 'tags', ); this._document.appendChild( tags, ); const filename= this.getAttribute( 'filename', ); const filenameTag= document.createElement( 'span', ); filenameTag.classList.add( 'filename-tag', ); filenameTag.appendChild( document.createTextNode( filename|| '', ), ) tags.appendChild( filenameTag, ); const langage= this.getAttribute( 'language', )|| 'text'; const languageTag= document.createElement( 'span', ); languageTag.classList.add( 'language-tag', ); languageTag.appendChild( document.createTextNode( langage, ), ) tags.appendChild( languageTag, ); const content= unifyCode( this.childNodes.mapAndFilter( node=> node instanceof Text&& node.data, ).implode(), ); this._codeMirror= new CodeMirror( this._document, { value: content, mode: langage, indentUnit: 4, indentWithTabs: true, readOnly: this.hasAttribute( 'readonly', ), }, ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "astProperties() {\r\n\t\t\t\t\treturn {};\r\n\t\t\t\t}", "function PropertyDetection() {}", "skipProperties() {\n return [];\n }", "parseProps(element, astElement, code, options) {\n // assign a unique `oid` to the element\n const { fragment } = options;\n if (fragment) {\n element.oid = fr...
[ "0.63012373", "0.5837011", "0.5776584", "0.56595856", "0.5427953", "0.53260076", "0.53260076", "0.5316607", "0.53124356", "0.52805024", "0.5271093", "0.5231861", "0.5216707", "0.5198099", "0.5123764", "0.51090115", "0.5108372", "0.5098512", "0.5093449", "0.5088203", "0.508032...
0.0
-1
Public Task, as it is exported
function build(cb) { cb(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function task(task) {\n\treturn task;\n}", "function createTask(v,t){\r\n \r\n }", "static async method(){}", "function TaskRepository () {\n\n }", "updateTask() { \r\n\r\n }", "constructor() {\n super(new Task());\n }", "function TaskParser() {\n}", "async prepareTask() {\n...
[ "0.6851279", "0.6821912", "0.6793472", "0.6753004", "0.6723646", "0.6612676", "0.6486797", "0.64152706", "0.64140767", "0.6365507", "0.6365507", "0.6365507", "0.6365507", "0.6365507", "0.6365507", "0.6365507", "0.6365507", "0.6365507", "0.6365507", "0.6365507", "0.6365507", ...
0.0
-1
3 Example of 'Returning a promise'
function promiseTask() { return Promise.resolve("the value is ignored"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tProm() {\n\n\tvar res = null;\n\tvar ref = null;\n\n\treturn new Promise(function(resolve, reject) {\n\t\tconsole.log('created promise');\n\n\t});\n/*\n\treturn {\n\t\tp: prom,\n\t\tres: \n\t\trej\n\t}\n*/\n}", "function promiseMaker() {\n //promise is a object which takes 2 callbacks, resolve and rej...
[ "0.69060785", "0.68793094", "0.6738662", "0.66707516", "0.6631428", "0.6629244", "0.6622063", "0.6622063", "0.6619598", "0.6610736", "0.6610736", "0.65989494", "0.6543901", "0.6527348", "0.65162736", "0.64883214", "0.64841634", "0.6478801", "0.64771414", "0.6470374", "0.64635...
0.6226449
39
helper function to display the first board
function displayBoard(board) { for (let i = 0; i < 4; i++) { const xVal = (i + 1) * 50; for (let j = 0; j < 4; j++) { const yVal = j * 50 + 50; if (board[4 * j + i] === "blank") { gameState.tiles.create(xVal, yVal, board[4 * j + i]).setScale(0.6); } else { gameState.tiles.create(xVal, yVal, board[4 * j + i]); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function DisplayBoard() {\n\tconsole.log(\"Turn \"+(TotalEmptyPegs-1))\n\tlet spacer = \" \"\n\tfor (var i = 0; i < board.length; i++) {\n\t\tlet text = \"\"\n\t\tfor (var y = 0; y < board[i].length; y++) {\n\t\t\tif(board[i][y].isFilled) { text+=\" X\" }\n\t\t\telse text+=\" O\"\n\t\t\t\n\t\t\tsp...
[ "0.7205085", "0.6928284", "0.6928284", "0.6895529", "0.6873766", "0.67997605", "0.6541394", "0.6444811", "0.6421637", "0.638864", "0.63535106", "0.6336691", "0.63349026", "0.62837195", "0.6278436", "0.62674", "0.62509006", "0.6249126", "0.62272125", "0.6226193", "0.6210919", ...
0.6497639
7
standalone helper functions to do stuff
function getTiles() { return gameState.tiles.getChildren(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _____SHARED_functions_____(){}", "function Helper() {}", "static private internal function m121() {}", "function Utils() {}", "function Utils() {}", "private internal function m248() {}", "private public function m246() {}", "function doStuff() {}", "function Utils(){}", "function Util()...
[ "0.6283045", "0.6150022", "0.60282177", "0.5986544", "0.5986544", "0.5873337", "0.5871494", "0.58672345", "0.58496845", "0.5817674", "0.5748905", "0.5722761", "0.57020885", "0.57020885", "0.57020885", "0.56997657", "0.5622381", "0.56147665", "0.55852026", "0.5560686", "0.5530...
0.0
-1
standalone helper functions to move tiles
function handleRight(board) { const emptySquareIndex = board.findIndex((item) => item === "blank"); if (emptySquareIndex % 4 === 0) { return; } else { board[emptySquareIndex] = board[emptySquareIndex - 1]; board[emptySquareIndex - 1] = "blank"; game.sound.play("click"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function moveTile() {\n moveTileHelper(this);\n }", "function move_tile(tile)\n{\n var x = tile.ix * tile_width+2.5;\n var y = tile.iy * tile_height+2.5;\n tile.elem.css(\"left\",x);\n tile.elem.css(\"top\",y);\n}", "function move_tiles(){\r\n\t\toriginalTop = parseInt(this.style.top);\r\n\t\tori...
[ "0.79237026", "0.76913923", "0.76522744", "0.7423677", "0.72792345", "0.72318584", "0.72235596", "0.7195952", "0.7185259", "0.7059824", "0.70462745", "0.69098467", "0.68338776", "0.6824372", "0.6817852", "0.67927927", "0.67829585", "0.6737448", "0.667811", "0.6669762", "0.666...
0.0
-1
push "current" into "data" for the number oh hours that separate "from" to "to"
function pushData(from, to) { let curr = new Date(from.getTime()); const color = current > rooms[roomNumber].peopleLimitNumber ? stdColor['alert'] : current >= rooms[roomNumber].peopleLimitNumber * 0.7 ? stdColor['warning'] : stdColor['normal']; do { data.push(current); labels.push(curr.toLocaleString()); colors.push(color); curr = curr.add("1h"); } while(curr.getTime() < to.getTime()); return to; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function appendTimeData(data) {\n let startTime = moment(new Date().setHours(9, 30, 0, 0))\n let endTime = moment(new Date().setHours(15, 0, 0, 0))\n let middleClose = moment(new Date().setHours(11, 30, 0, 0))\n let middleOpen = moment(new Date().setHours(13, 0, 0, 0))\n let dataLastTime = moment(data[data.le...
[ "0.645218", "0.6056108", "0.5870095", "0.58694327", "0.5809828", "0.56978", "0.5636531", "0.5636531", "0.5540302", "0.5517433", "0.55127144", "0.5452314", "0.544941", "0.5445816", "0.54395735", "0.5438016", "0.53598696", "0.53370005", "0.5328558", "0.5306034", "0.5274006", ...
0.72138286
0
Display phrase on game board
addPhraseToDisplay() { const ul = document.querySelector('#phrase ul'); const letter = this.phrase.split(""); console.log(letter); for (let i = 0; i < letter.length; i += 1) { if (letter[i] !== " ") { const li = document.createElement('li'); li.textContent = letter[i]; li.classList.add('letter'); ul.appendChild(li); } else { const li = document.createElement('li'); li.classList.add('space'); ul.appendChild(li); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addPhraseToDisplay(){\r\n this.setupLetterToBeDisplayed()\r\n }", "function drawboard(location, word) {\n for (var i = 0; i < word.length; i++) {\n context.fillText('_ ', (location[0] + i * 20), location[1]);\n }\n }", "function updateDisplay(wordArray, midGame) {\n // let wordJoin = w...
[ "0.6981534", "0.6814094", "0.6756181", "0.6754139", "0.6753017", "0.6712933", "0.66977984", "0.6695621", "0.66941845", "0.6662241", "0.6661621", "0.6653677", "0.6653079", "0.6649592", "0.66045856", "0.66037905", "0.6597609", "0.65925455", "0.6570283", "0.65651876", "0.6563421...
0.0
-1
Checks if passed letter in phrase
checkLetter(letter) { if ([...this.phrase].indexOf(letter) !== -1) { return true; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "checkLetter(letter) {\n return this.phrase.includes(letter.textContent);\n }", "checkLetter(letter) {\r\n // return true/false if passed letter, matches letter in phrase\r\n return this.phrase.includes(letter) ? true : false;\r\n }", "checkLetter(letter) {\r\n const phrase = this.phrase;\r\n i...
[ "0.8600367", "0.8563086", "0.856123", "0.85476077", "0.85334545", "0.8487538", "0.84864914", "0.84775525", "0.8461022", "0.8459542", "0.84491867", "0.8447511", "0.84447736", "0.8422459", "0.8378973", "0.83779925", "0.8377272", "0.83207", "0.8319432", "0.8298126", "0.829569", ...
0.84711576
8
Displays passed letter on screen after a match is found
showMatchedLetter(letter) { const list = document.querySelectorAll('li'); for (let i = 0; i < list.length; i+=1) { if (letter === list[i].textContent){ list[i].classList.add('show'); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "showMatchedLetter(letter){\r\n $(letter).addClass('show');\r\n // display the char of the corresponding letters check if game is won\r\n }", "function match(a,b) {\n\t//if the letter input matches the current string\n\tif(a==b){\n\t\t\n\t\tfinalDisplay(i,guess);\n\t\tmatched++;\t\n\t}\n\n\n\t\n}", "sh...
[ "0.7764646", "0.74672186", "0.7379272", "0.7344734", "0.72903204", "0.72504205", "0.7221005", "0.7158286", "0.71428436", "0.71275896", "0.7125284", "0.71249104", "0.70639473", "0.70473737", "0.70316774", "0.6985066", "0.69456464", "0.69390154", "0.69269377", "0.69063437", "0....
0.63411117
71
The CenterControl adds a control to the map that recenters the map on Chicago. This constructor takes the control DIV as an argument.
function CenterControl(controlDiv, map) { // Set CSS for the control border. var controlUI = document.createElement('div'); controlUI.className = "ControlContainer"; controlUI.title = 'Click to recenter the map'; controlDiv.appendChild(controlUI); // Set CSS for the control interior. var controlText = document.createElement('div'); controlText.className = "MyControl"; controlText.innerHTML = 'Center Map'; controlUI.appendChild(controlText); // Setup the click event listeners: simply set the map to Chicago. controlUI.addEventListener('click', function() { map.setCenter(myLatLng); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function CenterControl(controlDiv, map) {\r\n\r\n // Set CSS for the control border.\r\n var controlUI = document.createElement('div');\r\n controlUI.style.backgroundColor = '#fff';\r\n controlUI.style.border = '2px solid #fff';\r\n controlUI.style.borderRadius = '3px';\r\n controlUI.style.boxShadow = '0 2px...
[ "0.8013828", "0.7968754", "0.77727115", "0.76235056", "0.75115454", "0.75090045", "0.7507734", "0.7456348", "0.6888448", "0.688808", "0.6839767", "0.6628802", "0.6518375", "0.629978", "0.62581444", "0.61835754", "0.61082137", "0.60353446", "0.5949223", "0.59388125", "0.593619...
0.8255781
0
Clear WebGL (depth) after 1min of run
function clearDepth() { renderer.clearDepth(1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "cleanupWebGL() {}", "function setupWebGL() {\n\n // Get the canvas and context\n var canvas = document.getElementById(\"myWebGLCanvas\"); // create a js canvas\n gl = canvas.getContext(\"webgl2\"); // get a webgl object from it\n \n try {\n if (gl == null) {\n throw \"unable to create ...
[ "0.75271577", "0.71244013", "0.71184266", "0.70930094", "0.70930094", "0.7053501", "0.70499206", "0.6935659", "0.6922435", "0.69011056", "0.68858784", "0.67867905", "0.6778077", "0.6760073", "0.67220414", "0.6694737", "0.6636735", "0.6630691", "0.6625205", "0.6611403", "0.658...
0.7261925
1
From autobinddecorator ( Return a descriptor removing the value and returning a getter The getter will return a .bind version of the function and memoize the result against a symbol on the instance
function boundMethod(objPrototype, method, descriptor) { var fn = descriptor.value; return { configurable: true, get: function get() { if (this === objPrototype || this.hasOwnProperty(method)) { return fn; } var boundFn = fn.bind(this); Object.defineProperty(this, method, { value: boundFn, configurable: true, writable: true }); return boundFn; } }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Autobind(_, _2, descriptor) {\n return {\n enumerable: false,\n configurable: true,\n get() {\n return descriptor.value.bind(this);\n }\n };\n}", "function autobind(target, key, descriptor) {\n var fn = descriptor.value;\n var defining = false;\n ret...
[ "0.7106008", "0.7070857", "0.7055944", "0.70397377", "0.677762", "0.677762", "0.67497545", "0.67497545", "0.6745944", "0.6716756", "0.6619548", "0.6619548", "0.6573981", "0.6573981", "0.6380238", "0.6380238", "0.6362993", "0.61829334", "0.61829334", "0.61829334", "0.61329913"...
0.60606515
22
The function managing the console commands
async function consoleCommands() { console.log("c to clear temp files"); console.log("r to start server"); var rl = readline.createInterface(process.stdin, process.stdout); var prefix = '>'; rl.on('line', async function (line) { switch (line.trim()) { case 'c': //command to clean the temp file(serverRepos and other temp files of server) shell.exec("rm -r -f " + exports.serverDirectory + "/*"); shell.exec("rm -r -f ./server_0.9/.metadata"); shell.exec("rm -r -f ./server_0.9/jdt.ls-java-project"); exports.ReposInServer = []; console.log("done"); break; case 'r': //command to run the server t = await clientTest.startServer(exports.serverDirectory); fs.readdirSync(exports.serverDirectory).forEach(file => { exports.ReposInServer.push(file); //reading the repos already in the serverRepos directory }); //this.close();//closing the prompt after starting the server break; default: console.log("wrong input"); } this.setPrompt(prefix); this.prompt(); }).on('close', function () { }); rl.setPrompt(prefix); rl.prompt(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleCommand() {}", "function registerCommands()\n{\n addCMD([\"cmd\", listCmds, \"Prints list of available commands\"]);\n addSynonimOf(\"cmd\", \"cmds\");\n addSynonimOf(\"cmd\", \"commands\");\n\n addCMD([\"test\", test, \"Just a test\"]);\n addCMD([\"invi...
[ "0.7310625", "0.6996635", "0.69690686", "0.67440826", "0.670041", "0.66577625", "0.665758", "0.6646859", "0.6625957", "0.6619377", "0.66154593", "0.6614959", "0.6604315", "0.6603117", "0.64919156", "0.6487909", "0.64818466", "0.6470616", "0.64671856", "0.6457172", "0.64492464...
0.6514209
14