query
stringlengths
9
14.6k
document
stringlengths
8
5.39M
metadata
dict
negatives
listlengths
0
30
negative_scores
listlengths
0
30
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
Shows a notification that Drive sync is disabled on cellular networks.
showDisabledMobileSyncNotification() { this.showingDisabledMobileSyncNotification_ = true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "disable() {\n return this._client.send(\"Network.disable\");\n }", "function on_external_disable()\n {\n options.do_sync_data_across_devices = false;\n return local.save(Key.Configuration, options);\n }", "setAsDisabled(callback) {\n let self = this;\n self.reportWor...
[ "0.6116139", "0.6017046", "0.58357894", "0.579997", "0.57449985", "0.5720701", "0.56947935", "0.56793773", "0.5611831", "0.5604891", "0.5597459", "0.54781276", "0.54226136", "0.5386799", "0.5386799", "0.53622156", "0.5345195", "0.52870595", "0.52870595", "0.5282384", "0.52823...
0.67150694
0
Sets up the form elements.
setup () { this._formElements = this._setupFormElements(this.options.inputs); this._UIElements = this._buildUIElements(this._formElements); this._setupEvents(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setupForms() {\n // comment form validation fix\n if ($(\"#commentform\").length) {\n $(\"#commentform\").addClass(\"validate-form\");\n $(\"#commentform\")\n .find(\"input,textarea\")\n .each(function (index, element) {\n if ($(this).attr(\"aria-required\") == \"tru...
[ "0.6913494", "0.67210174", "0.6590173", "0.65324026", "0.64742", "0.6466767", "0.6437329", "0.6427621", "0.6401094", "0.63987374", "0.62995034", "0.6223074", "0.6164282", "0.61425734", "0.613295", "0.6125524", "0.6121809", "0.6106684", "0.610223", "0.6070721", "0.6063774", ...
0.78377825
0
Deselects all form elements.
clear () { this.triggerAll(function (formElement, UIElement, idx) { this.deselect(idx); }.bind(this)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function unselect_all(form_element) \r\n{\r\n\tfor (i=0; i < form_element.options.length; i++) \r\n\t{\r\n\t\tform_element.options[i].selected = false;\r\n\t}\r\n}", "function unselectElements()\n {\n $(\".selected\").removeClass(\"selected\"); \n controls.hide();\n }", "function sel...
[ "0.7787262", "0.7324748", "0.70260715", "0.69039315", "0.6665446", "0.6638441", "0.6604703", "0.65598446", "0.64603454", "0.6449059", "0.6420548", "0.6416143", "0.6407225", "0.6391883", "0.63773817", "0.6356848", "0.6326037", "0.6304416", "0.62885404", "0.6276686", "0.6266628...
0.733104
1
Enables the form element.
enable () { this.triggerAll(function (formElement, UIElement) { formElement.disabled = false; UIElement.classList.remove(this.options.disabledClass); }.bind(this)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "enable() {\n this.setDisabled(false);\n if (this.getInputElement()) {\n this.getInputElement().removeAttribute('disabled');\n this.getInputElement().setAttribute('style', this.style);\n }\n }", "enable() {\n this._isEnabled = true;\n }", "enable()...
[ "0.7338836", "0.724267", "0.7235636", "0.72325927", "0.7104809", "0.7041975", "0.7025654", "0.6961115", "0.68920237", "0.6840905", "0.6837339", "0.6824805", "0.6735071", "0.6730272", "0.67275614", "0.67094505", "0.67094505", "0.67094505", "0.67094505", "0.67094505", "0.670945...
0.75962925
0
Disables the form element.
disable () { this.triggerAll(function (formElement, UIElement) { formElement.disabled = true; UIElement.classList.add(this.options.disabledClass); }.bind(this)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "disable() {\n this.setDisabled(true);\n if (this.getInputElement()) {\n this.getInputElement().setAttribute('disabled', '');\n this.getInputElement().setAttribute('style', this.style);\n }\n }", "function disable() {\n _enabled = false;\n hide();\n }...
[ "0.7310175", "0.7024038", "0.69183004", "0.6884409", "0.67581636", "0.67206573", "0.6717114", "0.67014474", "0.6611434", "0.6611434", "0.6611434", "0.6611434", "0.6611434", "0.6611434", "0.6611434", "0.6611434", "0.6611434", "0.6591287", "0.65870446", "0.6584047", "0.6573917"...
0.73452115
0
Sort Project By Filter
function _SortProjectByFilter(Filter){ _$sortedProjects = []; // id = category id for category // id = project id for project if(_currentSort === Filter.nameid || Filter == null){ _currentSort = null; _$currentSortType = null; _$sortedProjects = _$projects; for(var j=0; j<_$projects.length; j++){ $...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "doInitialProjectSort() {\n this.currentProjectView = this.projectConfig.projectViews.find(\n view => view.id === projectsToDisplay\n );\n if (!this.currentProjectView) {\n throw new Error(\n \"Could not find project ID: \" +\n projectsToDisplay +\n \", make sure the proj...
[ "0.66266614", "0.6561376", "0.6561376", "0.6134354", "0.60861266", "0.6078046", "0.60191864", "0.5912631", "0.5900652", "0.5808133", "0.57956606", "0.5751516", "0.57028085", "0.56685996", "0.566836", "0.56333", "0.5610129", "0.5583229", "0.5575241", "0.55644417", "0.55624276"...
0.7183
0
Check My current URL to sort
function _CheckMySortFromURL(){ // -- Check from Filter Array var i=0; var filterNumb=0; while(i<_$filterObjects.length){ if(window.location.hash.replace("#/", "") === _$filterObjects[i].nameid){ _SortProjectByFilter( _$filterObjects[i] ); filterNumb ++; i = _$filterObjects.length; } else { i++; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getVisibleSorting() {\n\tvar split = window.location.href.split(/[/#/?]/);\n\tfor (var i = 0; i < split.length; i++) {\n\t\tif (split[i].startsWith(\"sort=\")) {\n\t\t\treturn split[i].substring(5);\n\t\t}\n\t}\n\treturn \"\";\n}", "function ActionSort(isAddress)\n{\n\twindow.location.href = isAddress;\...
[ "0.6754086", "0.60282487", "0.57508296", "0.57023656", "0.5673186", "0.56636935", "0.56297946", "0.5623841", "0.5548537", "0.5485255", "0.54807585", "0.5455389", "0.54463863", "0.5446233", "0.54251635", "0.53725576", "0.53703785", "0.5345384", "0.5336532", "0.52804595", "0.52...
0.70238566
0
16 Write an expression in the console to evaluate the percentage of people in class who are wearing glasses today.
function evalPercent(totalStudents,glassesWearers){ return glassesWearers/totalStudents * 100; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function percentageofWorld1(countrys,population) { \n return `${countrys} has ${population} million people, so it's about ${population/7900*100} of the world population`\n}", "function percentOf(num1, num2) {\r var x = (num1/num2)*100;\r return(num1+\" is \"+x+\"% of\"+num2 );\r}", "function results() {...
[ "0.5928376", "0.58343714", "0.57209325", "0.5707698", "0.57037884", "0.5698457", "0.5696115", "0.5687251", "0.56154186", "0.56154186", "0.56153685", "0.5609402", "0.5586804", "0.55843216", "0.5578046", "0.5577777", "0.5575257", "0.5574221", "0.55665827", "0.5559778", "0.55566...
0.6705316
0
=> 144 Write a function passwordLongEnough that accepts a "password" as a parameter and returns true if that password is long enough you get to decide what constitutes long enough.
function pwLongEnough(password){ if(password.length >= 8){ return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function passwordLongEnough (password){\n\tif(password.length > 5){\n\t\treturn true\n\t}\n\telse return false;\n}", "function validPassword(password) {\n\treturn password.length >= 8;\n}", "function isValidPassword(password) {\n if (password.length >= 8) {\n return true;\n }\n return false;\n}", "func...
[ "0.8620219", "0.759509", "0.7429932", "0.73838335", "0.7358656", "0.73170006", "0.726318", "0.72618264", "0.72481805", "0.724443", "0.718629", "0.70966566", "0.7078005", "0.7067642", "0.69978064", "0.69663423", "0.69558465", "0.6944536", "0.69359666", "0.6930233", "0.69223887...
0.86267257
0
=> 14 Write functions larger and smaller that each accept two strings as arguments, and return the larger and smaller strings, respectively.
function larger(str1, str2){ if (str1.length > str2.length){ return str1; } return str2; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function larger(str1, str2){\nif (str1.length>str2.length){\n\treturn str1;\n}\nreturn str2;\n}", "function longer(stringOne, stringTwo) {\n \tvar a = stringOne.length;\n \tvar b = stringTwo.length;\n \tif (a > b) {\n \t\tconsole.log(stringOne);\n \t} else if (a === b) {\n \t\tconsole.log(\"It's a draw!\");\n \t...
[ "0.68699414", "0.63638085", "0.60353094", "0.6004259", "0.5965873", "0.5964802", "0.5962161", "0.59278196", "0.5919726", "0.58956414", "0.58861595", "0.58765084", "0.58764523", "0.5847132", "0.5845054", "0.5837895", "0.5832868", "0.5789422", "0.5775441", "0.5746243", "0.57446...
0.6592618
1
=> 'shawn loves me' implement the following functions: randInt: Should accept a single numeric argument (n), and return a number from 0 to n. guessMyNumber: Should accept a single numeric argument and compare it to a random number between 0 and 5. It should return one of the following strings: "You guessed my number!" ...
function guessMyNumber(n){ if (n === Math.floor((Math.random() * 5) + 1)){ return "You guessed my number!"; } return "Nope! That was not it!"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "userFeedback(guess, randNum) {\n if (guess === undefined) {\n return \"Make a guess!\";\n } else if (guess > randNum && guess < randNum + 10) {\n return \"Guess too high but warm\";\n } else if (guess < randNum && guess > randNum - 10) {\n return \"Guess too low but warm\";\n } else if (...
[ "0.72712797", "0.71845114", "0.7033583", "0.69712454", "0.68157846", "0.6775303", "0.6769875", "0.67196256", "0.66939557", "0.66562116", "0.66412485", "0.6619294", "0.6580436", "0.65618086", "0.6546133", "0.6539966", "0.65320134", "0.6525323", "0.6513438", "0.65064496", "0.64...
0.77508736
0
=> 2 + 3 + 4 + 5 + 6 + 7 => 27 What happens if start is larger than end? Modify sum to check for this case and, when found, swap the start and end arguments.
function sum (start, end) { if (start > end) { return sum(end, start); } else if (start === end) { return start; } else { return start + sum(start + 1, end); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sum (start, end) {\n return (end - start + 1) * (end + start)/2\n}", "function sum(end){\n let sum =0;\n if (end > 0){\n for(let i=1; i<=end; i++){\n sum += i;\n }\n }\n return sum;\n}", "function sumRange(start, end) {\n let result=0;\n for(let i = start; i...
[ "0.8013056", "0.724777", "0.71668816", "0.7125547", "0.69164705", "0.6869183", "0.6816506", "0.6812522", "0.68119025", "0.6779144", "0.6764048", "0.67103904", "0.66634077", "0.6625858", "0.6606461", "0.6522845", "0.6458342", "0.6444994", "0.638463", "0.63666666", "0.6336158",...
0.8328161
0
=> 72 Complete the function sumOfSquares that computes the sum of all the numbers from 0 to n, but where each number is squared.
function sumSquares(n){ if(n===0){ return 0; } return (n * n) + sumSquares(n-1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sumOfSquares(n) {\n var next = function(i) { return i + 1; };\n return sum(square, next, n);\n}", "function SumOfSquares(number) {\n\tvar n;\n\tvar square_n;\n\tvar sum = 0;\n\tn = number;\n\t\n\tfor (i=0;i<=n;i++) {\n\t\tsquare_n = (Square(i));\n\t\tprint(square_n);\n\t\tsum = sum + square_n;\n\t}\n\...
[ "0.89055866", "0.8040126", "0.77808976", "0.767584", "0.7643332", "0.7549715", "0.7534671", "0.7532827", "0.75226665", "0.7484863", "0.7459272", "0.74488616", "0.7428335", "0.7394557", "0.73899215", "0.73896915", "0.73893845", "0.7380239", "0.7357376", "0.7322514", "0.7298142...
0.8466079
1
=> (5 5) + (4 4) + (3 3) + (2 2) + (1 1) + (0 0) => 55 Write a function called sumEvens that works like the other summation functions that you've written, but only sums the even numbers between 0 and n.
function sumEvens(n){ if(n===0){ return n; }else if(n%2!==0){ return 0; }else{ return n+sumEvens(n-2); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function summationEven () {}", "function sumEven(n){\n let sum=0;\n for(let i =0; i<=n; i=i+2){\n sum+=i;\n }\n return sum;\n }", "function sumEvens(arr){\n var sum = 0;\n for(i=0;i<=arr.length;i++){\n if(arr[i]%2==0){\n sum+=arr[i];\n }\n }\n return sum;\n}", "function sumEv...
[ "0.78936154", "0.7851545", "0.7683867", "0.7562479", "0.7553887", "0.7411789", "0.7380284", "0.7327766", "0.73147655", "0.7299209", "0.7210613", "0.7192135", "0.7112467", "0.7102901", "0.7052034", "0.7026588", "0.69968784", "0.69632536", "0.69405365", "0.6920699", "0.6916329"...
0.8758557
0
Implement a function called indexOf that accepts two paramters: a string and a character, and returns the first index of character in the string. You'll need to make use of the techniques for accessing the first element of a string and the rest of the string (slice) as before.
function indexOf (str, char) { if (str === '') { return 1; } else if (str[0] === char) { return 0; } else { return 1 + indexOf(str.slice(1), char); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function indexCharString(str, char, start = 0) {\n var i, l = str.length;\n for(i = start; i<l; i++) {\n if(str.charAt(i) == char) {\n return i;\n }\n }\n return -1;\n}", "function test2() {\n var str1 = 'ABCD';\n console.log(str1.indexOf('B'));\n console.log(str1.in...
[ "0.75598377", "0.7395591", "0.727807", "0.72458655", "0.7185433", "0.7161553", "0.69927675", "0.6956698", "0.6890309", "0.6847678", "0.6807722", "0.67180574", "0.66613215", "0.6598644", "0.65969807", "0.65954626", "0.6471409", "0.64680254", "0.64201987", "0.63925844", "0.6346...
0.793193
0
=> 0 Write a function called billTotal that can be used to calculate the total to be paid at a restaurant including tip and tax given the subtotal (i.e. cost of food and drinks). We can assume that the tip will be 15% and tax will be 9.5%. Make sure that the tip does not include the tax!
function billTotal(subTotal){ return subTotal + subTotal*.095 + subTotal*.15; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calMyBillTotal(billAmt, taxRate = 0.13, tipRate = 0.2) {\n const total = billAmt + billAmt * taxRate + billAmt * tipRate;\n return total;\n}", "function billTotal(total) {\n\t// write code here\n\tvar totalWTax = (total * 0.095);\n\ttotal = total + (total * .15);\n\n\ttotal = total + totalWTax;\n\n\n\...
[ "0.7978084", "0.786602", "0.78235775", "0.7725356", "0.77193195", "0.7634622", "0.75856394", "0.7525327", "0.7467517", "0.745258", "0.7446857", "0.7418365", "0.73762757", "0.7283318", "0.72823614", "0.7263972", "0.72530055", "0.72367394", "0.72069955", "0.7136286", "0.710043"...
0.8124664
0
1. Change all odd numbers to be those numbers multiplied by two: [4, 9, 7, 2, 1, 8];
function multiplyOdds(array){ for(var i = 0; i < array.length; i++){ if(array[i] % 2 === 1){ array[i] *= 2; } } return array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function multipliedByTwoForEvenIndexes (array){\n for (var i = 0; i < array.length; i++){\n if (i % 2 === 0 && typeof(array[i]) === \"number\"){\n array[i] *= 2;\n }\n }\n return array;\n}", "function doubleEven(num) {\n for (let i = 0; i < num.length; i++) {\n if (num...
[ "0.75876707", "0.7528883", "0.74852306", "0.7466615", "0.74416244", "0.7199079", "0.7094263", "0.70863974", "0.70574075", "0.7057025", "0.705156", "0.6992278", "0.6981426", "0.6976678", "0.69746315", "0.69420636", "0.69307214", "0.6910147", "0.6897637", "0.68925315", "0.68582...
0.7595473
0
=> [4, 18, 14, 2, 2, 8] Write a function called nth that accepts an array and an index as parameters, and returns the element at that index.
function nth(array, i){ return array[i]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nth(array, n) {\n\tif (n < 0) {\n\t\tn += array.length;\n\t}\n\treturn array[n];\n}", "function getNthElement(array, n) {\n return array[n];\n}", "function getNthElement(array, n) {\n\tvar result;\n \tif (array !== undefined){\n \t\tresult = array[n]\n \t}\n \treturn result;\n}", "function find...
[ "0.8406951", "0.8263244", "0.817905", "0.79305106", "0.78590345", "0.770379", "0.75764066", "0.7455751", "0.7229321", "0.71585923", "0.7133395", "0.7128468", "0.70326114", "0.70251966", "0.69697523", "0.6835232", "0.6730969", "0.67287326", "0.66997075", "0.6694254", "0.664654...
0.86475027
0
3. Write a function butlast that returns all of the elements in the array except for the last one (you may want to use slice for this one as well).
function butlast(array){ return array.slice(0, array.length-1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function butlast(array){\n\tarray.pop();\n\treturn array;\n}", "function exceptLast(array) {\n\treturn array.slice(0, array.length - 1);\n}", "function withoutLast(arr) {\n return arr.slice(0, -1);\n}", "function arrayExceptLast(number){\n return number.slice(0,number.length-1);\n}", "function last (ar...
[ "0.8663128", "0.86602587", "0.8617871", "0.80339146", "0.77044505", "0.77018505", "0.77006084", "0.76768655", "0.76584494", "0.76443636", "0.7636654", "0.7633453", "0.76003176", "0.75982434", "0.75851077", "0.75749874", "0.7562227", "0.7550809", "0.75394285", "0.75391436", "0...
0.8888543
0
=> [ 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584 ] 4. Complete the function cons that accepts an element and an array, and returns an array with the element added to the front of the array:
function cons(element, array){ array.unshift(element); return array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cons(\n\t\t// The value to prepend.\n\t\tvalue,\n\t\t// The array to act upon.\n\t\tarray){\n\t\tif(!Array.isArray(array ))\n\t\t\tarray = this\n\n\t\t// A new array whose elements are the provided value, followed by the\n\t\t// elements of the provided array.\n\t\treturn [value].concat(array)\n\t}", "f...
[ "0.71151316", "0.7024176", "0.69478816", "0.6901517", "0.689801", "0.6837613", "0.6798987", "0.6739231", "0.67385274", "0.6715643", "0.6709582", "0.6668024", "0.6663903", "0.6643528", "0.66113687", "0.65705836", "0.65627015", "0.6556828", "0.65312433", "0.65312433", "0.653124...
0.81385946
0
=> [ 'methinks', 'the', 'lady', 'doth', 'protest', 'too', 'much' ] 5. Complete the function conj that accepts an array and an element, and returns an array with the element added to the end of the array:
function conj(array, element){ array.push(element); return array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function comfortable(element, index, array) {\n if (index < array.length - 1)\n return element + array[index + 1];\n else return element;\n}", "function addEndings(arr, ending) {\n let newWords = arr.map((elem) => elem.concat(ending));\n console.log(newWords);\n return newWords;\n}", "fun...
[ "0.6543967", "0.6397376", "0.6316562", "0.62429845", "0.62084967", "0.6201044", "0.6179711", "0.6161582", "0.61247414", "0.60862327", "0.603998", "0.603197", "0.5904251", "0.58617336", "0.5857112", "0.57511646", "0.5740419", "0.57012963", "0.5687188", "0.56713724", "0.5631772...
0.78013897
0
=> [ 'methinks', 'the', 'lady', 'doth', 'protest', 'too', 'much' Given an array, return a new array with each element squared
function squared(array){ var newArray = []; for(var i = 0; i < array.length; i++){ newArray[i] = array[i] * array[i]; } return newArray }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function squares(arr)\n{\n for(let i = 0; i < arr.length; i++)\n {\n arr[i] *= arr[i];\n }\n\n return arr;\n}", "function squaredValues(arr){\r\n for (var i = 0; i < arr.length; i++){\r\n arr[i] = arr[i]*arr[i];\r\n }\r\n}", "function returnSquares(arr) {\r\n for (var i = 0; i ...
[ "0.7426919", "0.7425423", "0.7424453", "0.7420306", "0.7395391", "0.739399", "0.7366084", "0.7335304", "0.7318717", "0.7306822", "0.7303467", "0.7258588", "0.7247482", "0.7209322", "0.7194356", "0.7190904", "0.71864814", "0.7160308", "0.7138198", "0.7135516", "0.7039376", "...
0.83137727
0
override making the postless codemark, to create some codemarks first, and then relate those, so they are "prerelated" to the codemark when we do the test
makePostlessCodemark (callback) { this.data = { relatedCodemarkIds: [] }; BoundAsync.series(this, [ this.createPrerelatedCodemarks, super.makePostlessCodemark ], callback); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "makeCodemarks (callback) {\n\t\tthis.testCodemarks = [];\n\t\tthis.doingPreRelatedCodemarks = false;\n\t\tBoundAsync.timesSeries(\n\t\t\tthis,\n\t\t\t2,\n\t\t\tthis.makeCodemark,\n\t\t\tcallback\n\t\t);\n\t}", "makePostlessCodemark (callback) {\n\t\tif (!this.goPostless) {\n\t\t\tthis.codemark = this.postData[0]...
[ "0.7047545", "0.65815115", "0.6527389", "0.64418155", "0.6406706", "0.6314237", "0.6276649", "0.62184346", "0.6120977", "0.6060946", "0.6026093", "0.602512", "0.59679353", "0.595866", "0.5926095", "0.59148043", "0.5901761", "0.5756894", "0.5744216", "0.56343824", "0.5627982",...
0.7104723
0
create several codemarks to be related to the codemark to be updated during the test
createPrerelatedCodemarks (callback) { this.prerelatedCodemarkIds = []; BoundAsync.timesSeries( this, 4, this.createPrerelatedCodemark, callback ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "makeCodemarks (callback) {\n\t\tthis.testCodemarks = [];\n\t\tthis.doingPreRelatedCodemarks = false;\n\t\tBoundAsync.timesSeries(\n\t\t\tthis,\n\t\t\t2,\n\t\t\tthis.makeCodemark,\n\t\t\tcallback\n\t\t);\n\t}", "setCodemarks (callback) {\n\t\tthis.codemarks = this.postData.map(postData => postData.codemark);\n\t\...
[ "0.7404443", "0.64933425", "0.6466943", "0.6302572", "0.6256712", "0.61984265", "0.61483103", "0.6141768", "0.60382205", "0.59819126", "0.5952065", "0.5925304", "0.5844665", "0.5840708", "0.581742", "0.5752", "0.5691026", "0.56516", "0.56379783", "0.5613338", "0.56034327", ...
0.6541884
1
Resolves the values from an individual 'resolve' dependency spec
function resolve(deps, dst) { forEach(deps, function (value, key) { promises.push($q .when(isString(value) ? $injector.get(value) : $injector.invoke(value, state.self, locals)) .then(function (result) { dst[key] = result; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resolver (value, resolve) {\n\t\t\tresolved[resolved.length] = value;\n\n\t\t\tif (resolved.length === deps.length) {\n\t\t\t\tresolve(resolved)\n\t\t\t}\n\t\t}", "resolve() {\n this.resolver.resolve(this.sources.definitions);\n }", "function resolve(val) {\n resolver(val);\n ...
[ "0.6988847", "0.6415372", "0.61686486", "0.61024207", "0.609944", "0.60914946", "0.60755986", "0.60755986", "0.60755986", "0.60282874", "0.5980156", "0.5921399", "0.58644336", "0.5787231", "0.5784892", "0.576887", "0.5731646", "0.5729608", "0.57112116", "0.5702767", "0.569408...
0.66065645
1
Define whether the week number are visible
function updateShowWeekNumbers() { scope.showWeekNumbers = ( scope.mode === 'day' && showWeeks ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onVisible() {\r\n if (this._weeks.length == 0)\r\n this._weeks = [0, 1, 2, 3, 4, 5];\r\n }", "function setWeek(week)\r\n{\r\n\tif(!isNaN(week) && (parseFloat(week) == parseInt(week)) && week >= 0 && week < 54)\r\n\t{\r\n\t\tWEEK = parseInt(week);\r\n\t\tsetBox(week); // tekstvak wordt gewijzigd\r\n\t\t\...
[ "0.7147136", "0.614242", "0.609182", "0.604086", "0.6034888", "0.59016925", "0.58883446", "0.5881009", "0.58582795", "0.58188546", "0.5806895", "0.5788911", "0.575892", "0.57279664", "0.5682446", "0.5680013", "0.5680013", "0.56673056", "0.56321454", "0.5628442", "0.5622115", ...
0.74872226
0
Get scope.hours in 24H mode if valid
function getScopeHours ( ) { var hours = parseInt( scope.hours, 10 ); var valid = ( scope.showMeridian ) ? (hours > 0 && hours < 13) : (hours >= 0 && hours < 24); if ( !valid ) { return; } if ( scope.showMeridian ) { if ( hours === 12 ) { hours = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getHoursFromTemplate() {\n\t var hours = +$scope.hours;\n\t var valid = $scope.showMeridian ? hours > 0 && hours < 13 :\n\t hours >= 0 && hours < 24;\n\t if (!valid || $scope.hours === '') {\n\t return undefined;\n\t }\n\n\t if ($scope.showMeridian) {\n\t if (hours === 12) {\...
[ "0.7627522", "0.7595388", "0.7543881", "0.7543881", "0.7532175", "0.75278544", "0.75278544", "0.75278544", "0.75278544", "0.75278544", "0.75278544", "0.75278544", "0.75278544", "0.75278544", "0.75278544", "0.75278544", "0.75278544", "0.75278544", "0.75278544", "0.75278544", "...
0.8203584
0
Downloads the pets data from the server and initialize them client side
function downloadPets() { ajax("GET", "getPets", {}, function (response) { for (const pet of JSON.parse(response)) { new Pet(pet.name, pet.type, parseFloat(pet.health), parseFloat(pet.spirit), parseFloat(pet.hunger), parseFloat(pet.fatigue), parseInt(pet.age), parseInt(pet.lastMetabolismTime), p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function requestPets() {\n // Wait in this function until pet.animals() finishes running and return that data\n const { animals } = await pet.animals({\n location,\n breed,\n type: animal,\n });\n\n // You know animals will be set because of requestPets() above, but if nothing gets...
[ "0.64613205", "0.6210199", "0.6115804", "0.6091464", "0.60614717", "0.60505015", "0.597836", "0.59265107", "0.5914409", "0.5899308", "0.58019835", "0.5797858", "0.5786762", "0.57749873", "0.57733595", "0.5772126", "0.5727587", "0.56976867", "0.568557", "0.5674971", "0.5648415...
0.69228965
0
Toggles the fade class of the cover and activePerson, which makes the popup visible
function openPopup() { if (popupOpen == false) { popupOpen = true; cover.classList.toggle('fade'); activePerson.classList.toggle('fade'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function closePopup() {\n if (popupOpen == true) {\n popupOpen = false;\n cover.classList.toggle('fade');\n activePerson.classList.toggle('fade');\n } \n}", "function openPopUp(open) {\n let popup = document.getElementById(\"victoryPopup\");\n if(open){\n popup.classList.re...
[ "0.74449307", "0.6632468", "0.66286004", "0.66286004", "0.66186786", "0.6596369", "0.65647125", "0.6549408", "0.65352345", "0.6505991", "0.64708567", "0.64492977", "0.6426917", "0.64135164", "0.6399458", "0.63408434", "0.63365114", "0.63072157", "0.6304364", "0.6294393", "0.6...
0.81667876
0
Toggles the fade class of the cover and activePerson, which makes the popup hidden
function closePopup() { if (popupOpen == true) { popupOpen = false; cover.classList.toggle('fade'); activePerson.classList.toggle('fade'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function openPopup() {\n if (popupOpen == false) {\n popupOpen = true;\n cover.classList.toggle('fade');\n activePerson.classList.toggle('fade');\n } \n}", "function toggleChangeCover(){$(\"#changeCoverPicture\").toggleClass(\"is-open\"),$(document.body).removeClass(\"o-hidden\")}", ...
[ "0.7919118", "0.6797458", "0.6543995", "0.65372217", "0.64938426", "0.6475344", "0.6475344", "0.640478", "0.63970864", "0.6387925", "0.6357954", "0.63441247", "0.6325899", "0.6324709", "0.6295986", "0.62905407", "0.6207765", "0.61974555", "0.6192926", "0.6168174", "0.6129663"...
0.77046436
1
set some invariants when any package / module / fn is selected in the top pane, clear the entrySelected entry (overrides what's shown in content)
function resetEntrySelected () { Store.set({ entrySelected: null }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onPackageDel() {\n\n\t// Delete the currently selected item, if any\n\tif (packageSelect.selectedIndex >= 0) {\n\t\tdelSelected(packageSelect);\n\t\tchanged = true;\n\t\tsetModuleButtons();\n\t}\n\tpackageDelButton.disabled = !packageSelect.length;\n\n}", "clearSelection() {\r\n this.clearInfoPan...
[ "0.63143295", "0.6018", "0.59901625", "0.5869993", "0.586723", "0.5801164", "0.57044476", "0.5649447", "0.56011295", "0.558043", "0.55517423", "0.553335", "0.5530086", "0.551954", "0.5499965", "0.5484806", "0.54764014", "0.5435395", "0.54341817", "0.5434034", "0.5432031", "...
0.61909515
1
Shortens the length of the account address just for viewing. But still the real data is safe
formatAccount(acc) { const formatted = acc.slice(0, 4) + "..." + acc.slice(acc.length - 2) return formatted }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function format_address(address)\n {\n const new_address = address.substring(0,5) + '...' + address.slice(-3)\n return new_address;\n }", "function refreshDerivedAddress(addressField) {\n\n let addressText = \"\";\n if (addressField.StreetAddress !== \"\") addressText += \" \" + titleCa...
[ "0.6418224", "0.5889269", "0.581988", "0.5790444", "0.5703802", "0.57013994", "0.5658303", "0.5643129", "0.55768526", "0.55768526", "0.55768526", "0.5558206", "0.555554", "0.5516982", "0.55053914", "0.5490128", "0.54674363", "0.5452101", "0.5343786", "0.5343786", "0.5325182",...
0.62577176
1
this function is looking the exist id for upvoted or favorites Items
function itemExists (id) { if(favorites !== null) { return favorites.some(function(el) { return el.id === id; }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function itemFavoritesHandler(meetupId) {\n return userFavorites.some((meetup) => meetup.id === meetupId);\n }", "function isItemAvailable(id) {\n return db('items').where({ id }).first();\n}", "function isFavourite(id){\n\t\tvar idsFound = idOfFavourites.filter(\n\t\t\titem => item == id\n\t\t\t);\n\t\ti...
[ "0.6669927", "0.61657584", "0.60939914", "0.6068622", "0.60550404", "0.60165566", "0.6011371", "0.59987664", "0.5978489", "0.58562213", "0.584292", "0.5785566", "0.5780387", "0.57647586", "0.5755397", "0.57493675", "0.5699512", "0.5696675", "0.56692946", "0.56629586", "0.5638...
0.6489672
1
Call click callbacks with given parameters. This is done in a separate function for being able to modify the response.
callClickCallbacks(features, layer, coordinate) { this.clickCallbacks.forEach((c) => c(features, layer, coordinate)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "performClickFunctionality() {}", "function genericOnClick(info, tab) {\n console.log(\"item \" + info.menuItemId + \" was clicked\");\n console.log(\"info: \" + JSON.stringify(info));\n console.log(\"tab: \" + JSON.stringify(tab));\n console.log(\"selection: \" + info.selectionText);\n pass_reques...
[ "0.63669145", "0.6028113", "0.58810896", "0.5750447", "0.5706529", "0.564575", "0.5531211", "0.55202854", "0.551861", "0.5486185", "0.54607856", "0.54205453", "0.541964", "0.5416126", "0.5409783", "0.5371922", "0.5241005", "0.52404875", "0.52396697", "0.5238774", "0.52377844"...
0.62285775
1
Gather all settings from the passed scan settings and call `propertyDidUpdate` to notify about the new settings.
onScannerNewScanSettings(scanSettings) { const allSymbologies = Object.values(Barcode.Symbology).filter((s) => { return typeof s === "string"; }); const changeSet = [ { key: Attribute.SCAN_SETTINGS_BLURRY_RECOGNITION, newValue: scanSettings...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "on_settings(values, prev) {\n\n if (!this.sett.scripts) return\n\n let delta = {}\n let changed = false\n\n for (var i = 0; i < values.length; i++) {\n let n = values[i]\n let arr = prev.filter(x => x.v === n.v)\n if (!arr.length && n.p.settings.$props) ...
[ "0.5963578", "0.5912523", "0.59088475", "0.5826621", "0.572376", "0.5700069", "0.5638146", "0.5557696", "0.5483794", "0.54810727", "0.54590106", "0.5379007", "0.5370342", "0.5332198", "0.5332004", "0.5261078", "0.52234495", "0.51845556", "0.51700777", "0.51609564", "0.5108016...
0.6187936
0
Transform the given attribute name to its camelcased version.
attributeToCamelCase(attrName) { const index = attributes.findIndex((k) => { return k.toLowerCase() === attrName.toLowerCase(); }); return attributes[index]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function attributeToPropertyName(attributeName) {\n var propertyName = attributeName.replace(/-([a-z])/g, function (m) {\n return m[1].toUpperCase();\n });\n return propertyName;\n}", "function attrName(name, config) {\n return strCase(name, config.options['output.attributeCase']);\n }", "funct...
[ "0.6868554", "0.6850875", "0.68042475", "0.66940266", "0.647637", "0.6453521", "0.6453287", "0.6453287", "0.6453287", "0.6453287", "0.6440805", "0.6436117", "0.64313406", "0.6406558", "0.6388169", "0.63832456", "0.6382229", "0.6382229", "0.6369774", "0.63308096", "0.6302471",...
0.7585325
0
Constant for the North direction
static get DIRECTION_NORTH() { return "N"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function North(){\n this.y--;\n this.grid_counter++;\n this.grid_matrix[this.y][this.x] = true;\n this.path_matrix[this.grid_counter][0] = this.x;\n this.path_matrix[this.grid_counter][1] = this.y;\n this.adj_matrix[(this.MAX * (this.y + 1)) + this.x][(this.MAX * y) + this...
[ "0.6837607", "0.6560457", "0.6464229", "0.63331336", "0.6314388", "0.6314388", "0.6148094", "0.6138103", "0.61374545", "0.6108312", "0.6059059", "0.5991431", "0.59723175", "0.5894794", "0.5888771", "0.5888771", "0.5774811", "0.5766903", "0.5761945", "0.5751688", "0.57166344",...
0.7127696
0
Constant for the East direction
static get DIRECTION_EAST() { return "E"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function East(){\n this.x++;\n this.grid_counter++;\n this.grid_matrix[this.y][this.x] = true;\n this.path_matrix[this.grid_counter][0] = this.x;\n this.path_matrix[this.grid_counter][1] = this.y;\n\n this.adj_matrix[(this.MAX * this.y) + (x - 1)][(this.MAX * this.y) + thi...
[ "0.7001732", "0.6719138", "0.660782", "0.585896", "0.5839277", "0.5831806", "0.57239735", "0.5649049", "0.5613672", "0.56017697", "0.56017697", "0.55754465", "0.5567377", "0.5543403", "0.5543403", "0.5507937", "0.54968345", "0.5495592", "0.5448064", "0.5447944", "0.54473495",...
0.73234147
0
Constant for the South direction
static get DIRECTION_SOUTH() { return "S"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function South(){\n this.y++;\n this.grid_counter++;\n this.grid_matrix[this.y][this.x] = true;\n this.path_matrix[this.grid_counter][0] = this.x;\n this.path_matrix[this.grid_counter][1] = this.y;\n\n this.adj_matrix[(this.MAX * this.y) + this.x][(this.MAX * (this.y - 1))...
[ "0.67182714", "0.6359417", "0.6234253", "0.6189052", "0.61310136", "0.61310136", "0.6088932", "0.6069028", "0.6067887", "0.60543305", "0.59898674", "0.5945984", "0.5924588", "0.5924588", "0.585385", "0.585385", "0.585385", "0.585385", "0.5839136", "0.5834473", "0.58139867", ...
0.7507848
0
Constant for the West direction
static get DIRECTION_WEST() { return "W"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function West(){\n this.x--;\n this.grid_counter++;\n this.grid_matrix[this.y][this.x] = true;\n this.path_matrix[this.grid_counter][0] = this.x;\n this.path_matrix[this.grid_counter][1] = this.y;\n\n this.adj_matrix[(this.MAX * this.y) + (x + 1)][(this.MAX * this.y) + thi...
[ "0.7031789", "0.6734293", "0.6265586", "0.6147249", "0.61011004", "0.60268027", "0.5940889", "0.5927989", "0.5910613", "0.5859574", "0.5858328", "0.58487785", "0.5800374", "0.5780897", "0.5735752", "0.57108253", "0.5642208", "0.5621947", "0.5618432", "0.5612013", "0.5589239",...
0.77855414
0
Returns an array of social items to render
getItems() { const { social, mobile, tablet, desk } = this.state; const out = social.map((post, i) => { // eslint-disable-line let item; if (post.posttype === 'instagram') { if (mobile) { if (i === length - 1) { item = ( <div id="socialItem" className="la...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_drawSocialList() {\n const Wrapper = make(\"DIV\", \"cdx-people-gallery-social-wrapper\");\n\n for (let i = 0; i < SOCIAL_LIST.length; i++) {\n const social = SOCIAL_LIST[i];\n const SocialEl = make(\"a\", \"cdx-people-gallery-social-icon\", {\n innerHTML: social.icon,\n });\n\n t...
[ "0.6749225", "0.6479056", "0.593407", "0.5902299", "0.5849721", "0.57574815", "0.5671011", "0.5671011", "0.5671011", "0.5603411", "0.5591342", "0.5569357", "0.5516797", "0.55116946", "0.5474302", "0.5466836", "0.54551786", "0.5446801", "0.54439425", "0.54411006", "0.5429919",...
0.66470045
1
Compares 2 String origin and target.
getTextInputComparison(origin, target) { if (origin.length === 0) return []; let comparisonResult = new Array(); for (let i = 0; i < origin.length; i++) { if (target.length >= i + 1) { if (target[i] === origin[i]) { comparisonResult.push(checkResult.SAME); } else { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function diffBetweenTwoStrings(source, target) {\n\t/**\n\t@param source: string\n\t@param target: string\n\t@return: string[]\n */\n let sourceLen = source.length;\n let targetLen = target.length;\n let dp = new Array(sourceLen+1);\n for(let i=0;i<=sourceLen;i++){\n dp[i]=new Array(targetLen+1);\n }\n f...
[ "0.62959224", "0.59284884", "0.57625234", "0.5741416", "0.57223016", "0.56201416", "0.560187", "0.55395633", "0.5534004", "0.55022436", "0.5451308", "0.5443568", "0.5424724", "0.53940016", "0.53775924", "0.53472406", "0.53460646", "0.53413314", "0.53239816", "0.531203", "0.53...
0.61833245
1
A motor joint is used to control the relative motion / between two bodies. A typical usage is to control the movement / of a dynamic body with respect to the ground.
function b2MotorJoint(def) { this.parent.call(this, def); this.m_linearOffset = def.linearOffset.Clone(); this.m_angularOffset = def.angularOffset; this.m_linearImpulse = new b2Vec2(); this.m_angularImpulse = 0.0; this.m_maxForce = def.maxForce; this.m_maxTorque = def.maxTorque; this.m_correctionFactor = def...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function WheelJoint ( config ){\n\n Joint.call( this, config );\n\n this.type = JOINT_WHEEL;\n\n // The axis in the first body's coordinate system.\n this.localAxis1 = config.localAxis1.clone().normalize();\n // The axis in the second body's coordinate system.\n this.localAxis2 = config.localAxis...
[ "0.70815694", "0.68543744", "0.66755146", "0.6323831", "0.61353785", "0.60254335", "0.5947929", "0.5811208", "0.58040106", "0.575231", "0.5718372", "0.56508034", "0.5650772", "0.56281453", "0.55775124", "0.55751765", "0.55663294", "0.55485505", "0.5544097", "0.5489736", "0.54...
0.72297454
0
Manages closing of lightboxes and modals
function close(args) { args = args || {}; var element = args.element || false; if (element) { $('#' + element).hide(); } else { $('div.lightbox').hide(); } // Only hide the modal if no other lightboxes exist // This is meant to prevent closing a lightbox on an lig...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "close() {\n this.stopSlideVideo(this.activeSlide)\n addClass(this.modal, 'glightbox-closing')\n animateElement(this.overlay, this.settings.cssEfects.fade.out)\n animateElement(this.activeSlide, this.settings.cssEfects.zoom.out, () => {\n this.activeSlide = null\n t...
[ "0.79487956", "0.7903241", "0.7711247", "0.75725746", "0.7549595", "0.7494429", "0.7392562", "0.7358839", "0.73280054", "0.72746", "0.72538805", "0.7195673", "0.7190882", "0.71885645", "0.71788734", "0.7172618", "0.7172618", "0.71718925", "0.7130104", "0.7109314", "0.7093278"...
0.79483
1
create divs to completed tasks
function showCompletedTasks(){ emptyTasksContainer(); localStorage.setItem('listType', 'completed'); if(list){ const div = document.createElement('div'); for(let i = 0 ; i < list.length; i++){ if(list[i].active === true){ addTaskToContainer(makeTask(list[i])); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawDoneList(){\n var text = '';\n if (taskDoneArray.length > 0)\n text+= 'Tarefas concluidas:<br>';\n for (var i = 0; i < taskDoneArray.length; i++) {\n text += '<div class=\"taskDoneDiv\">';\n text += '<div class=\"taskTitle\">'\n text += taskDoneArray[i].title;\n text += '</div>'\n ...
[ "0.7366282", "0.73144317", "0.71876323", "0.71675086", "0.71562654", "0.7115149", "0.7009979", "0.7006277", "0.70054626", "0.69780946", "0.696588", "0.69553196", "0.6940079", "0.69222033", "0.6915862", "0.69076407", "0.6902648", "0.68933517", "0.6830099", "0.6821508", "0.6805...
0.7316728
1
tasks container empty tasks container on dom
function emptyTasksContainer(){ let container = document.getElementById("tasksContainer"); container.innerHTML = ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clearTasks() {\n while (addedTasks.firstChild) {\n addedTasks.firstChild.remove();\n }\n addedTasks.className = 'noTask';\n }", "function clearTasks(){\n //taskList.innerHTML = ''; \n \n //snabbare\n while(taskList.firstChild){\n taskList.removeChild...
[ "0.76553285", "0.736332", "0.73069435", "0.7226751", "0.70036477", "0.69235885", "0.6838455", "0.6824953", "0.6781229", "0.6710921", "0.66444254", "0.6589261", "0.6541654", "0.6535101", "0.6456364", "0.6442971", "0.64167184", "0.64052737", "0.6392455", "0.63724846", "0.631671...
0.7927944
0
add task div to dom
function addTaskToContainer(taskDiv){ let container = document.getElementById("tasksContainer"); container.appendChild(taskDiv); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addTaskToDom(task) {\n const clone = document.querySelector(\"template\").content.cloneNode(true);\n\n clone.querySelector(\"article\").dataset.id = task._id;\n clone.querySelector(\"h2\").textContent = task.name;\n clone.querySelector(\".time\").textContent = \"when: \" + task.time;\n clone.querySel...
[ "0.77555954", "0.76864135", "0.76693285", "0.7567501", "0.7551594", "0.74246925", "0.72276527", "0.7199784", "0.71559346", "0.7147429", "0.7086184", "0.7024623", "0.6989368", "0.6927051", "0.6835979", "0.6794512", "0.67870307", "0.6781584", "0.6781317", "0.67548823", "0.67536...
0.7760928
0
change status to the all list
function changeStatus(){ if(list){ activeTasksCounter = 0; tasksStatus = !tasksStatus; for(let i = 0 ; i < list.length; i++){ tasksStatus == true ? changeTaskToCompleted(list[i]) : changeTaskToActive(list[i]); } } updateActiveTasksCounter(); localStorage.s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "set allstatuses(allstatuses){\n\t\tthis._allstatuses = allstatuses;\n\t}", "CHANGE_SELECT_ALL_STATUS (state, newValBoolen) {\n state.select_all = newValBoolen\n state.table_row_status = newValBoolen\n }", "function toggleAll() {\n all = true;\n active = false;\n completed = fals...
[ "0.699762", "0.66279954", "0.6487398", "0.64159244", "0.6339274", "0.63336784", "0.63139963", "0.6306601", "0.62991565", "0.62869716", "0.6262821", "0.6198563", "0.6156", "0.6129142", "0.61208606", "0.6079526", "0.6073496", "0.60558194", "0.6035883", "0.6035001", "0.6001529",...
0.67358947
1
delete task by X button (from list and dom)
function deleteTask(){ id = event.srcElement.parentElement.getAttribute('id'); let task = list.find(i => i.id === +id); task.active === true ? activeTasksCounter-- : activeTasksCounter; list.splice(list.indexOf(task),1); localStorage.setItem('tasksList', JSON.stringify(list)); removeTaskFrom...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteTask (btn) {\n\tlet task_li = btn.closest('li');\n\tlet task_text = task_li.querySelector('.task') ;\n\tlet isDeleting = confirm('Are you sure you want to remove this To Do?');\n\tif (isDeleting) {\n\t\ttask_li.remove();\n\t\tdecreaseCounter(task_counter);\n\t\tif (!hasClass(task_text,'cross-text'))...
[ "0.78211606", "0.768313", "0.7588353", "0.75604224", "0.7554836", "0.7524516", "0.74622536", "0.7440391", "0.7434395", "0.7377687", "0.736561", "0.73612326", "0.733146", "0.73221153", "0.7300767", "0.72850955", "0.7274417", "0.72187275", "0.7207618", "0.7131756", "0.71160054"...
0.7701949
1
Method createBallot Returns ENC_mix1(electionID, ENC_Mix2( electionID, ... ENC_MixN(electionID, choiceMsg, verificationCode)...) where verificationCode ::= (TAG_VERIFCODEAUTO, receiptID) | (TAG_VERIFCODEUSER, receiptID, userCode) Arguments: int choice stringuserCode: supposed to be a 10 characters string Returns: a rec...
function createBallot (choices, userCode) { // TODO choice now is an integer. It could be an arbitrary message // remove duplicates and sort choices by number choices = $.unique(choices); var choiceMsg = "ffffffff"; // "ffffffff" is used in front of the concatenated choices as a delimite...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateBallot() {\n // Elliptic curve cryptography params used for encryption of encrypted vote\n // fragments\n var ctx = new CTX(\"BN254CX\");\n var n = new ctx.BIG();\n var g1 = new ctx.ECP();\n var g2 = new ctx.ECP2();\n\n var parameter = $('#event-param').val();\n var tempPar...
[ "0.5709953", "0.5176053", "0.49183878", "0.48933196", "0.475276", "0.4747353", "0.4669607", "0.46652824", "0.46365824", "0.46090442", "0.45561245", "0.44999015", "0.44683146", "0.44483623", "0.44395766", "0.44307262", "0.44168118", "0.44114324", "0.43934157", "0.43929085", "0...
0.817541
0
Method validateReceipt Returns true if the given receipt is valid
function validateReceipt (receipt) { // check if there is no mismatch of election ids if (electionID !== receipt.electionID) return false; // check the signature message = pair(exports.TAG_ACCEPTED, pair(electionID, receipt.ballot)); return crypto.verifsig(colServVerifKey, messag...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ValidateRebate()\n\t{ \n\t\ttry\n\t\t{\n\t\t\t//Set short message with the error code\t\n\t\t\tvar ShortMessage=ErRbtSht001;\n\t\t\t//set long message as empty\n\t\t\tvar LongMessage=\"\";\n\t\t\t//check textbox store number is empty\n\t\t\tif(true==IstxtEmpty('txtStoreNumber'))\n\t\t\t{\n\t\t\t\t//check ...
[ "0.6239699", "0.56408525", "0.54798025", "0.544653", "0.54137796", "0.5406348", "0.53986704", "0.5315344", "0.5231756", "0.5226036", "0.51709884", "0.516074", "0.51483697", "0.5131594", "0.5111516", "0.5080532", "0.50758123", "0.5072057", "0.5069759", "0.5043275", "0.5040785"...
0.7068471
0
Check the result of the collecting server against the given receipt.
function checkColServerResult(data, receipt) { var res = validServerOutput(receipt.ciphertexts[0], data, colServVerifKey); if (res.blame) { // We need to add the blaming info to res. // In this case it is the signature of the collecting // server and expected ballot:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validateReceipt (receipt) {\n // check if there is no mismatch of election ids\n if (electionID !== receipt.electionID) return false;\n // check the signature\n message = pair(exports.TAG_ACCEPTED, pair(electionID, receipt.ballot));\n return crypto.verifsig(colServVerifK...
[ "0.5971246", "0.56445575", "0.5566012", "0.54875606", "0.5479615", "0.54295796", "0.5338693", "0.5326802", "0.53098303", "0.527382", "0.5196967", "0.5173034", "0.51680535", "0.5160432", "0.51579547", "0.5153426", "0.51319844", "0.5121013", "0.5095813", "0.5083886", "0.5065969...
0.66150826
0
Check the result of the mix server with the given index against the given receipt.
function checkMixServerResult(i, data, receipt) { var res = validServerOutput(receipt.ciphertexts[i+1], data, mixServVerifKeys[i]); if (res.blame) { // We need to add the blaming info to res. // In this case it input ciphertext (our ciphertex in // the output of the ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkColServerResult(data, receipt) {\n var res = validServerOutput(receipt.ciphertexts[0], data, colServVerifKey);\n if (res.blame) { \n // We need to add the blaming info to res.\n // In this case it is the signature of the collecting\n // server and expect...
[ "0.54879373", "0.5330106", "0.52283865", "0.5034022", "0.5024321", "0.4982716", "0.49455726", "0.48039243", "0.47773212", "0.47702193", "0.47663516", "0.47631735", "0.47456908", "0.47434843", "0.47302744", "0.47010618", "0.46852723", "0.4659502", "0.4655575", "0.46494037", "0...
0.66921663
0
Function: debug() Called when user clicks on "Debug" button. Does whatever you want it to do.
function debug() { console.log("You just pressed the debug button!") write("Hello World!") }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function functionIWantToDebug() {\n\tdocument.getElementById('debugMessage').innerHTML = \"This is a debug message\";\n}", "function functionIWantToDebug() {\n\tconsole.log(\"This is a debug message\");\n}", "function debug( debug ) {\n if(_ISDEBUG)\n console.log(debug);\n }", "function DebugC...
[ "0.77008426", "0.7458132", "0.7454297", "0.7283318", "0.72565526", "0.7255323", "0.72411436", "0.71346724", "0.71268374", "0.70950085", "0.7090473", "0.7090473", "0.7025173", "0.70141715", "0.6984186", "0.69705045", "0.69678867", "0.6956502", "0.695581", "0.69327396", "0.6918...
0.8209123
0
Function: calcAssoc() Called when user clicks the "Calculate Associations" button. Trains a linear regression model on the data.
function calcAssoc() { console.log("Let's get started!") /* * (1) Understand what our data looks like! Take a peek into our data files, or console.log the variables "matrix", "genes", and "labels"! */ /* * (2) Familiarize yourself with multiple linear regression, and the jsregression pack...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calculate() {\n //for .reduce() method\n function add(a, b) {\n return a + b;\n }\n scope.deleteModel = function(model) {\n scope.models.splice(scope.index, 1)\n scope.model.colorItem.inUse = false \n }\n var reducer = (accumulator, cu...
[ "0.5202588", "0.501684", "0.49340346", "0.49317622", "0.49015996", "0.48254016", "0.46983892", "0.46715364", "0.46582356", "0.46581042", "0.4622105", "0.4618211", "0.45979756", "0.45979756", "0.4572076", "0.45393506", "0.45382744", "0.45188072", "0.4505402", "0.4492955", "0.4...
0.719641
0
Update the various roll count locations to be in sync
function updateRollCounter() { rollElement.setAttribute('data-rolls-left', 3 - rollCount); scoreBoardElement.setAttribute('data-rolls-left', 3 - rollCount); diceElement.setAttribute('data-rolls-left', 3 - rollCount); if (rollCount >= 3) { disable(rollElement); } else { reenable(rollEleme...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateCounts() {\r\n $scope.thirdFloorCounts[0] =\r\n getNumberOfDirectoryDevices('notman:third:west');\r\n $scope.thirdFloorCounts[1] =\r\n getNumberOfDirectoryDevices('notman:third:centre');\r\n $scope.thirdFloorCounts[2] =\r\n getNumberOfDirectoryDevices('notman:third:east...
[ "0.6754717", "0.6540584", "0.6392635", "0.6392635", "0.63516116", "0.6126805", "0.59957284", "0.59139913", "0.58964795", "0.5764703", "0.5755423", "0.5745059", "0.57345456", "0.57035565", "0.5703335", "0.5700222", "0.56995827", "0.56921", "0.56725764", "0.56653965", "0.562995...
0.67403024
1
Reset the roll count to zero, and update the counters.
function resetRollCount() { rollCount = 0; updateRollCounter(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateRollCounter() {\n rollElement.setAttribute('data-rolls-left', 3 - rollCount);\n scoreBoardElement.setAttribute('data-rolls-left', 3 - rollCount);\n diceElement.setAttribute('data-rolls-left', 3 - rollCount);\n if (rollCount >= 3) {\n disable(rollElement);\n } else {\n reenab...
[ "0.7206873", "0.7048105", "0.6877367", "0.66799444", "0.6657478", "0.66023016", "0.63490313", "0.63108784", "0.62855685", "0.62669104", "0.6217046", "0.61540604", "0.6150811", "0.615073", "0.61382186", "0.6117445", "0.6085634", "0.6072294", "0.604468", "0.6011454", "0.5991869...
0.87502474
0
Automatically generated. Retrieves the `index` constructor field of the ":matched" type.
function index(matched0) /* (matched : matched) -> int */ { return matched0.index; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_getIndex() {}", "getIndex() { return this.index_; }", "function getIndex() {\n return internal.index;\n }", "function getIndex() {\n return index;\n }", "getIndex() {\n return this.index;\n }", "indexType() {\n let index_name = '';\n CSch...
[ "0.636511", "0.62285584", "0.6202539", "0.5989844", "0.58259094", "0.57568413", "0.5751214", "0.5740665", "0.56540245", "0.5549395", "0.552797", "0.5491342", "0.5438116", "0.5414221", "0.5381763", "0.5374128", "0.5314082", "0.5306624", "0.5278485", "0.52756506", "0.5250541", ...
0.6917633
0
Automatically generated. Retrieves the `next` constructor field of the ":matched" type.
function next(matched0) /* (matched : matched) -> int */ { return matched0.next; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "next() {\n if (!this.hasNext()) {\n throw \"Lexer error: reached end of stream\";\n }\n\n // Try to match each pattern in tokenPatterns to the remaining buffer.\n for (let i of tokenPatterns) {\n let type = i[0];\n let regex = i[1];\n\n // For...
[ "0.5775127", "0.56776214", "0.5650786", "0.56351274", "0.54967535", "0.5495664", "0.5450172", "0.54345864", "0.53758717", "0.532303", "0.5317", "0.52733827", "0.52321637", "0.5213864", "0.5127825", "0.51178145", "0.5099489", "0.5095578", "0.5083695", "0.50753915", "0.5074252"...
0.65764207
0
Automatically generated. Retrieves the `matched` constructor field of the ":matched" type.
function matched(matched0) /* (matched : matched) -> string */ { return matched0.matched; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get _firstMatch() {\n for (let [, variable] of this._store) {\n let match;\n if (variable._isMatch) {\n match = variable;\n } else {\n match = variable._firstMatch;\n }\n if (match) {\n return match;\n }\n }\n return null;\n }", "function index(matched...
[ "0.5207838", "0.5166447", "0.5010816", "0.4963876", "0.4956658", "0.4956658", "0.4956658", "0.49323186", "0.4914738", "0.48453036", "0.48421973", "0.48420113", "0.4837368", "0.4826541", "0.481042", "0.481042", "0.481042", "0.481042", "0.481042", "0.481042", "0.481042", "0.4...
0.6772675
0
Automatically generated. Retrieves the `groups` constructor field of the ":matched" type.
function groups(matched0) /* (matched : matched) -> groups */ { return matched0.groups; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getGroups() {\n return groups;\n}", "function getGroups() {\n return getExamples().map(function(example) {\n return example.group;\n }).filter(uniqueValues).sort(groupSort);\n }", "static get groups() {\n return Array.from(this._GROUPS.values());\n...
[ "0.6763537", "0.64206886", "0.62999403", "0.616328", "0.60095716", "0.6000316", "0.5909908", "0.5871061", "0.5860197", "0.5841152", "0.57965755", "0.5661407", "0.5657966", "0.5574666", "0.5566497", "0.5527722", "0.551364", "0.54265696", "0.54265696", "0.54089314", "0.5404191"...
0.75099814
0
Automatically generated. Retrieves the `obj` constructor field of the ":regex" type.
function obj(regex0) /* (regex : regex) -> any */ { return regex0.obj; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeRxObj ( arg_pattern_str, arg_option_str ) {\n var\n pattern_str = castStr( arg_pattern_str, __blank ),\n option_str = castStr( arg_option_str );\n\n if ( option_str ) {\n return new RegExp( pattern_str, option_str );\n }\n return new RegExp( pattern_str );\n }", "regex()...
[ "0.6652241", "0.63234544", "0.61621284", "0.58831656", "0.58270955", "0.5710616", "0.56856674", "0.5683109", "0.5665619", "0.5554126", "0.5554126", "0.5531526", "0.54898614", "0.54866964", "0.54852116", "0.5470836", "0.5452478", "0.5437155", "0.5403579", "0.5395269", "0.53942...
0.7201162
0
Find a match for a regular expression starting at start position "start" (by default "0"). See also "contains" (note: this function is called |exec| in JavaScript).
function find(s, regex0, start) /* (s : string, regex : regex, start : ?int) -> maybe<matched> */ { var start_248 = (start !== undefined) ? start : 0; return regexExec(obj(regex0), s, $std_core.max(start_248, 0)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findAll(s, regex0, start) /* (s : string, regex : regex, start : ?int) -> vector<matched> */ {\n var start_332 = (start !== undefined) ? start : 0;\n var _x0 = start_332 > (s).length;\n if (_x0) {\n return [];\n }\n else {\n $std_core._unit_;\n }\n return regexExecAll(obj(regex0), s, $std_c...
[ "0.6812057", "0.67816186", "0.67597115", "0.67255074", "0.6566224", "0.644629", "0.6215112", "0.6136649", "0.6109854", "0.60167015", "0.5983443", "0.5956265", "0.59289414", "0.59193075", "0.58557224", "0.5796306", "0.5775242", "0.5726932", "0.57194483", "0.5718529", "0.571852...
0.7729249
0
Return first group that was matched (or 1 if nothing was matched)
function firstMatchedOn(groups0, start, end) /* (groups : groups, start : ?int, end : ?int) -> int */ { var start_468 = (start !== undefined) ? start : 1; var end_472 = (end !== undefined) ? end : 10; var _x0 = $std_core.find($std_core.list(start_468, end_472), function(i /* int */ ) { return matchedOn(groups...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function firstMatched(groups0, start, end) /* (groups : groups, start : ?int, end : ?int) -> string */ {\n var start_579 = (start !== undefined) ? start : 1;\n var end_583 = (end !== undefined) ? end : 10;\n var i = firstMatchedOn(groups0, start_579, end_583);\n return (i >= 0) ? _index_(groups0, i) : \"\";\...
[ "0.71251994", "0.6780269", "0.6347832", "0.6143553", "0.61276037", "0.60222036", "0.60008895", "0.58650815", "0.5606629", "0.5601973", "0.5545602", "0.55404127", "0.54870707", "0.5486241", "0.5394128", "0.531759", "0.5317249", "0.52991", "0.5279213", "0.5279213", "0.5268161",...
0.715829
0
Return the first matched group (or "" if nothing matched) starting at "start" and returning at most group "end"
function firstMatched(groups0, start, end) /* (groups : groups, start : ?int, end : ?int) -> string */ { var start_579 = (start !== undefined) ? start : 1; var end_583 = (end !== undefined) ? end : 10; var i = firstMatchedOn(groups0, start_579, end_583); return (i >= 0) ? _index_(groups0, i) : ""; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function firstMatchedOn(groups0, start, end) /* (groups : groups, start : ?int, end : ?int) -> int */ {\n var start_468 = (start !== undefined) ? start : 1;\n var end_472 = (end !== undefined) ? end : 10;\n var _x0 = $std_core.find($std_core.list(start_468, end_472), function(i /* int */ ) { return matchedO...
[ "0.66748774", "0.5993382", "0.5951009", "0.5886159", "0.57502824", "0.57457626", "0.57332176", "0.5622869", "0.5606766", "0.55395526", "0.5537429", "0.55310434", "0.5501378", "0.54814583", "0.5477418", "0.54466856", "0.5431375", "0.5421846", "0.5421846", "0.5421846", "0.54218...
0.74404955
0
Create a new regular expression. Takes two optional parameters. Set "ignoreCase" to "True" to ignore uppercase/lowercase distinction. If "multiline" is set to "True", then "^" and "$" match also the beginning and end of every line (instead of the entire input).
function regex(regex0, ignorecase, multiline) /* (regex : string, ignorecase : ?bool, multiline : ?bool) -> regex */ { var ignorecase_962 = (ignorecase !== undefined) ? ignorecase : false; var multiline_966 = (multiline !== undefined) ? multiline : false; var _x0 = (ignorecase_962) ? 1 : 0; var _x1 = (multili...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function regexAlt(regexs, ignorecase, multiline) /* (regexs : list<string>, ignorecase : ?bool, multiline : ?bool) -> regex */ {\n var ignorecase_1106 = (ignorecase !== undefined) ? ignorecase : false;\n var multiline_1110 = (multiline !== undefined) ? multiline : false;\n var _x0 = (ignorecase_1106) ? 1 : 0;...
[ "0.71891034", "0.6083933", "0.6065795", "0.59458935", "0.57158434", "0.57008576", "0.56984127", "0.5682566", "0.5642113", "0.5635578", "0.5635578", "0.56172717", "0.5600873", "0.55326235", "0.55252904", "0.5513424", "0.54637855", "0.5462424", "0.5462424", "0.54332507", "0.542...
0.7713044
0
How many groups are captured by this regex?
function groupsCount(r) /* (r : regex) -> int */ { return (replaceAll_1(source(r), rxNonGroup, "", undefined)).length; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function regex_matchcount()\n{\n\treturn keys.length;\n}", "function groups(matched0) /* (matched : matched) -> groups */ {\n return matched0.groups;\n}", "function third() {\n console.log((arguments[0].match(new RegExp(arguments[1], \"g\")) || []).length);\n}", "function matches_entirely() {\n\tvar te...
[ "0.72149557", "0.61689734", "0.61571074", "0.5886547", "0.5886547", "0.55113184", "0.54392165", "0.5427607", "0.53909063", "0.53092164", "0.526432", "0.5257805", "0.5224403", "0.51908344", "0.51379853", "0.51274246", "0.5123239", "0.5111832", "0.50849706", "0.5080566", "0.502...
0.71551734
1
Create a new _alternative_ regular expression. Matches any of the given patterns but the groups are local to each alternative. See "alternative" to find out which alternative was matched. Contains an optimization where a common prefix of all patterns is lifted out of the alternative to increase efficiency. Takes two op...
function regexAlt(regexs, ignorecase, multiline) /* (regexs : list<string>, ignorecase : ?bool, multiline : ?bool) -> regex */ { var ignorecase_1106 = (ignorecase !== undefined) ? ignorecase : false; var multiline_1110 = (multiline !== undefined) ? multiline : false; var _x0 = (ignorecase_1106) ? 1 : 0; var _...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function regex(regex0, ignorecase, multiline) /* (regex : string, ignorecase : ?bool, multiline : ?bool) -> regex */ {\n var ignorecase_962 = (ignorecase !== undefined) ? ignorecase : false;\n var multiline_966 = (multiline !== undefined) ? multiline : false;\n var _x0 = (ignorecase_962) ? 1 : 0;\n var _x1 =...
[ "0.53610516", "0.5270113", "0.5267242", "0.5177124", "0.5151982", "0.5084758", "0.50824386", "0.49067256", "0.48524925", "0.48467886", "0.4843099", "0.46731552", "0.46525592", "0.46525592", "0.46525592", "0.46325186", "0.46134984", "0.46134984", "0.46004444", "0.45669138", "0...
0.7838331
0
Replace the first occurrence of "regex" by the result a replacement string "repl" in a string "s". The replacement string can contain `$$` for a `$` sign, `$n` for a capture group, `$&` for the entire match (`==$0`).
function replace_1(s, regex0, repl, start) /* (s : string, regex : regex, repl : string, start : ?int) -> string */ { var start_1278 = (start !== undefined) ? start : 0; return replaceEx_1(s, regex0, repl, false, start_1278); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function replaceAll_1(s, regex0, repl, start) /* (s : string, regex : regex, repl : string, start : ?int) -> string */ {\n var start_919 = (start !== undefined) ? start : 0;\n return replaceEx_1(s, regex0, repl, true, start_919);\n}", "function replace(s, regex0, repl, start) /* forall<e> (s : string, regex...
[ "0.6679901", "0.66049135", "0.6324558", "0.60957265", "0.60703206", "0.599775", "0.5918909", "0.58501613", "0.5839295", "0.57835686", "0.57805675", "0.5751056", "0.5670354", "0.5539047", "0.5539047", "0.5539047", "0.54730624", "0.54613477", "0.54613477", "0.5459916", "0.54462...
0.7047865
0
Split a string "s" in at most "n" parts using a regular expression "r" as separator.
function split(s, r, n, start) /* (s : string, r : regex, n : ?int, start : ?int) -> vector<string> */ { var n_1314 = (n !== undefined) ? n : $std_core.maxInt; var start_1318 = (start !== undefined) ? start : 0; if (n_1314 <= 0) { return []; } else { $std_core._unit_; } var _x0 = start_1318 > (s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function split(s, re, limit){\n if(!isStr(s))\n throw Error(`Cannot split with: ${rtti(s)}`);\n let\n out=toPair(),\n rc= typeof(limit) != \"undefined\" ? s.split(re, limit) : s.split(re)\n rc.forEach(c=>out.push(c));\n return out;\n }", "function _split(str, sep, n) {...
[ "0.67017263", "0.66553766", "0.6601426", "0.6576353", "0.6498688", "0.6321127", "0.63166517", "0.62841314", "0.62768507", "0.62164646", "0.6193319", "0.6131088", "0.6021562", "0.59780246", "0.59763175", "0.5960286", "0.58887565", "0.5814111", "0.577207", "0.57096153", "0.5601...
0.79714036
0
Split a string "s" over separator "sep" where "sep" does not occur in _tokens_ matching "exclude". For example: `splitExclude("comma,'sep,arated',values", regex(","),regex("'[^']'|[^',]"))`
function splitExclude(s, sep, exclude) /* (s : string, sep : regex, exclude : regex) -> list<string> */ { if ((s === "")) { return $std_core.Nil; } else { var splitr = regex(("^(?:((?:" + (source(exclude) + (")+)|(" + (source(sep) + "))")))), undefined, undefined); return splitExcludeX(s, splitr, ""...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function splitOnDelim(delim) {\n var re = new RegExp(\"(\" + delim + \")\", \"g\");\n return function (str) {\n return str.split(re).filter(common_1.identity);\n };\n}", "function splitOnDelim(delim) {\n var re = new RegExp(\"(\" + delim + \")\", \"g\");\n return function (str) {\n r...
[ "0.5983657", "0.5909891", "0.577467", "0.5762853", "0.5748738", "0.5648577", "0.5579735", "0.54803246", "0.54540616", "0.5427457", "0.54212326", "0.54038167", "0.54032975", "0.5385322", "0.5380803", "0.53712934", "0.53628194", "0.5338479", "0.53304774", "0.5292507", "0.525928...
0.8801117
0
Given a collection of plugin names verifies this collection against the blacklist. Returns an object with: [plugin name]=>[blacklisting reason] or an empty object if none of the dependencies to check are blacklisted.
function verifyDependencies(pkg, blacklist) { var blacklisted = matchdep .filterAll(Object.keys(blacklist), pkg) .reduce(function(blacklisted, pluginName) { blacklisted[pluginName] = blacklist[pluginName]; return blacklisted; }, {}); return blacklisted; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function blacklistCheck(locator) {\n if (locator === blacklistedLocator) {\n throw makeError(\n `BLACKLISTED`,\n [\n `A package has been resolved through a blacklisted path - this is usually caused by one of your tools calling`,\n `\"realpath\" on the return value of \"require.resolve\"...
[ "0.5248541", "0.5248541", "0.5248541", "0.522216", "0.5141909", "0.49953717", "0.49285015", "0.48996836", "0.48314244", "0.48120317", "0.48102495", "0.47706637", "0.4757893", "0.47266436", "0.46635973", "0.4653494", "0.46205208", "0.46086425", "0.45668584", "0.45620182", "0.4...
0.6956666
0
post comment to db and rerender component
postComment(){ axios.post(`/api/comment`, {route_id: this.props.route_id, body: this.state.newCommentBody}) .then(comments=>{ this.setState({ comments: comments.data, newCommentBody:'' }) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "postComment(comments) {\n this.post('comments', {\n comments,\n });\n }", "handleSubmit(evt) {\n evt.preventDefault();\n let comment = { text: this.state.comment };\n this.props.addComment(comment, this.props.postId);\n this.setState({ comment: '' });\n }", "async function submitCommen...
[ "0.72538686", "0.710164", "0.69837457", "0.69595283", "0.6953702", "0.69048923", "0.68964976", "0.68835163", "0.68585396", "0.68025196", "0.6756928", "0.67227185", "0.672263", "0.66793394", "0.6674538", "0.66506827", "0.66489595", "0.6632346", "0.66287565", "0.66168857", "0.6...
0.73985195
0
remove comment from db and rerender
removeComment(comment_id){ axios.delete(`/api/comment/${this.props.route_id}/${comment_id}`) .then(comments=>{ this.setState({ comments:comments.data, }) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "removeComment(id){\n let { comments } = this.state;\n let index = comments.map(function(comment) {\n return comment.id\n }).indexOf(id);\n\n comments.splice(index, 1);\n this.setState({comments, commentsLoading: false});\n }", "function remove() {\n // highlight and fade before doing ...
[ "0.67865133", "0.6720968", "0.67064387", "0.64881057", "0.6473744", "0.643556", "0.642214", "0.6371972", "0.62879163", "0.6254886", "0.6193253", "0.6188525", "0.6170072", "0.61658055", "0.61542577", "0.61515963", "0.61355644", "0.6122999", "0.6108749", "0.60901755", "0.608399...
0.68950313
0
Create an array of resolutionRangesArray for each resolution and for the window
getResolutionRanges(resolutionRangesArray) { const { activeIndex } = this.state; const length = this.props.data.length - 1; return resolutionRangesArray.map(range => { return { type: range.type, range: _.range( Math.max(activeIndex - range.name, 0), Math.min(active...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateImagesResolution(resolutionRangeArray, slidingWindow, imageType) {\n resolutionRangeArray.forEach(i => {\n const imageObj = _.find(slidingWindow, winObj => winObj.index === i);\n imageObj[imageType] = true;\n });\n }", "function resolution_to_range(args)\r\n{\r\n var resolution = args.r...
[ "0.5920413", "0.5754978", "0.5692169", "0.55643785", "0.5539157", "0.54988056", "0.54379576", "0.53944165", "0.5361169", "0.52368647", "0.5221729", "0.52098936", "0.51910144", "0.51773775", "0.5176555", "0.5175688", "0.51617026", "0.51584333", "0.5151837", "0.5121966", "0.507...
0.7685098
0
Iterate over the [type]resolution range and for each element check if its index in the sliding window and update accordingly to the resolution type
updateImagesResolution(resolutionRangeArray, slidingWindow, imageType) { resolutionRangeArray.forEach(i => { const imageObj = _.find(slidingWindow, winObj => winObj.index === i); imageObj[imageType] = true; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getResolutionRanges(resolutionRangesArray) {\n const { activeIndex } = this.state;\n const length = this.props.data.length - 1;\n\n return resolutionRangesArray.map(range => {\n return {\n type: range.type,\n range: _.range(\n Math.max(activeIndex - range.name, 0),\n M...
[ "0.57074", "0.52642393", "0.4981612", "0.4981612", "0.49690625", "0.4963113", "0.4927542", "0.49223205", "0.49038622", "0.48822063", "0.48569155", "0.4745276", "0.47335064", "0.47320428", "0.4723889", "0.47169638", "0.4703332", "0.46894357", "0.46733004", "0.4658372", "0.4580...
0.7263619
0
Render the images Resolution by their range resolution Type
renderImages() { const ResolutionsRanges = this.getResolutionRanges(RESOLUTION_RANGES); const [ windowRange, thumbnailRange, lowResolutionRange, standardResolutionRange ] = ResolutionsRanges; const slidingWindow = windowRange.range.map(i => { return { index: i, useColor: t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateImagesResolution(resolutionRangeArray, slidingWindow, imageType) {\n resolutionRangeArray.forEach(i => {\n const imageObj = _.find(slidingWindow, winObj => winObj.index === i);\n imageObj[imageType] = true;\n });\n }", "function range_to_resolution(args)\r\n{\r\n var range = args.range;...
[ "0.6694483", "0.6201667", "0.6201376", "0.5778422", "0.5707867", "0.56590474", "0.55418825", "0.544165", "0.5434958", "0.54075587", "0.53724426", "0.536737", "0.53496325", "0.5320729", "0.5310153", "0.5280906", "0.5275816", "0.52613074", "0.5244349", "0.52401525", "0.5212506"...
0.710215
0
Esta funcion verifica si hay conexion y los datos del API IPGeolocation fueron entregados correctamente
function consultarIpGeolocation (ciudad,pais){ const appGeoID= '025d2e92e55040dab74487eeecad9005' //KeyAPI de IPGeolocation const urlIpGeo= `https://api.ipgeolocation.io/timezone?apiKey=${appGeoID}&location=${ciudad},%20${pais}`; console.log(urlIpGeo); //Muestra la url que accede al json, que contiene la i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function geoCheck() {\n if (\"geolocation\" in navigator) {\n localStorage.setItem('geoPermission', \"true\");\n return true;\n } else {\n return false;\n }\n}", "function getLocation() {\n if (navigator.geolocation) {\n // console.log(navigator)\n // depende de la respuesta del usua...
[ "0.6205966", "0.61555576", "0.61501557", "0.61286175", "0.6094131", "0.6040408", "0.6005138", "0.5982594", "0.59520423", "0.5949846", "0.5924457", "0.5914799", "0.58798796", "0.587712", "0.58623", "0.5834493", "0.5813075", "0.58085436", "0.5790914", "0.57733005", "0.5769484",...
0.6312076
0
Creates a fixed size full screen scrollable window without status, scroll/toolbars
function openBareFullscreenWindow(id, url) { window.open(url, id, "status=no,resizable=yes,scrollbars=yes,toolbar=no,HEIGHT="+screen.height-20+",WIDTH="+screen.width) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fullwin() {\n\twindow.open(\"bigpage.html\",\"bfs\",\"fullscreen,scrollbars\")\n}", "function makeWindow(title, app) {\n\n var width = app.initialWidth || 320;\n var height = app.initialHeight || 200;\n var left = Math.floor(Math.random() * Math.max(windowWidth - width - 30, 0)) + 5;\n var t...
[ "0.6612639", "0.6070122", "0.6026549", "0.5993512", "0.59757304", "0.59428275", "0.59034735", "0.58795816", "0.58746976", "0.5873138", "0.57629347", "0.5740591", "0.567451", "0.56494904", "0.5638036", "0.5627175", "0.56213486", "0.55805004", "0.5561042", "0.55344987", "0.5488...
0.6156004
1
Returns a blank HTML page with the specified color
function blankPage(color) { return "<HTML><HEAD><META HTTP-EQUIV='Pragma' CONTENT='no-cache'></HEAD><BODY BGCOLOR="+color+"></BODY></HTML>" }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function htmlColorGenerator(){\r\n var colorIndex = Math.floor(Math.random() * colors.length);\r\n document.body.style.background = colors[colorIndex];\r\n document.getElementById(\"color\").innerHTML = colors[colorIndex];\r\n}", "function changePageColor(color) {\n document.getElementsByTagName(\...
[ "0.60138285", "0.58918333", "0.57533723", "0.55615056", "0.5551143", "0.55341977", "0.5528043", "0.5515392", "0.5386021", "0.53817093", "0.5365597", "0.5326743", "0.5290605", "0.52808374", "0.5255057", "0.52474564", "0.52403706", "0.5233953", "0.52008027", "0.5196271", "0.518...
0.8261501
0
$scope.login = login; Will search for user with the username and password in database
function login() { UserService.findUserByUsernameAndPassword(model.username, model.password) .then(function(response) { // test if user exists if (response != null) { // set rootscope to the user $rootScope.user = response; // redirect to profile page $location.url("/profile"); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function LoginCtrl ($scope, $location, $route, $timeout, ezSQL, ezUserData) {\n $scope.username = '';\n $scope.password = '';\n\n function loginAttempt() {\n var attrArr = ['UserID', 'UserPassword'];\n var table = ['Person'];\n var condition = 'UserID=\\'' + $scope.username + '\...
[ "0.7127389", "0.70894307", "0.7002905", "0.7001787", "0.68696785", "0.67496127", "0.6748663", "0.66349727", "0.6597459", "0.6540059", "0.65192115", "0.6515657", "0.651173", "0.65089965", "0.6487895", "0.6484958", "0.6461393", "0.64226246", "0.64146405", "0.6408307", "0.639992...
0.7648065
0
Retrieves data via the FDA API and proceeds to format the data for the chart presentation layer, then generates the charts.
function retrieveChartData() { /** * Calls the FDA REST web service API to obtain the request data sets. * Results will contain a time and a count of reports meeting the requested * classification: Class I, Class II, or Class III */ var getReportCounts = function(clscode){ var url="https://api.fda.g...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function GenerateCharts(){\n GetAllCategories();\n GenearateOrderPieCharts();\n GenearateFeedbackPieChart();\n GenerateMonthByOrderPieChart();\n GenerateHourlyPieChart();\n GenerateDailyPieChart();\n\n }", "function graphDemographics() {\n const admissionRateOptions = {\n title: 'Admission...
[ "0.6375445", "0.62621284", "0.6251403", "0.62317055", "0.62042874", "0.6198108", "0.61962044", "0.6150849", "0.61448365", "0.6132131", "0.61312795", "0.61273533", "0.61050284", "0.6066663", "0.6045857", "0.6026438", "0.602124", "0.6019497", "0.6014789", "0.6012233", "0.598694...
0.6773713
0
redirect user based on Role
checkForRedirection(role) { if (role.toLowerCase() === 'admin') { this.props.history.push('/users'); } else { this.props.history.push('/configurations'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function indexCtrl($scope, $http, $location) {\n //retrieves list of users from db\n $http.get('/api/user/').success(function (data) {\n $scope.user = data;\n var role = new String($scope.user.role);\n console.log(\"role: \" + role);\n\n //this condition used to redirect the page ...
[ "0.71229327", "0.70846635", "0.7061257", "0.6773705", "0.67198396", "0.6588369", "0.6582869", "0.65614134", "0.6499627", "0.64318186", "0.63784343", "0.6369916", "0.6347883", "0.63179314", "0.6310444", "0.6288417", "0.627939", "0.6194164", "0.6182718", "0.6177832", "0.6168242...
0.753062
0
Generate Difficulty Variables for the Level
function GenerateDifficulty(levelNumber){ d = new Difficulty(levelNumber); return d; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateLevel() {\r\n\t\t\tvar eCount = 4 + Math.floor(_level * 1.2);\r\n\t\t\tvar maxT1 = Math.floor(_level / 3);\r\n\t\t\tvar maxT2 = Math.floor(_level / 6);\r\n\t\t\tvar t1Count = 0;\r\n\t\t\tvar t2Count = 0;\r\n\t\t\tfor (var i = 0; i < eCount; i++) {\r\n\t\t\t\tvar rnd = randomNum(0, _words.length, t...
[ "0.63715136", "0.63588053", "0.6340183", "0.62530386", "0.60586876", "0.5936266", "0.59169257", "0.59001535", "0.5878449", "0.5837283", "0.58253217", "0.57448226", "0.57437414", "0.5722075", "0.5669027", "0.56629497", "0.5651673", "0.56324303", "0.5632342", "0.56318325", "0.5...
0.66666055
0
Changes bool values to Yes/No
function changeBool(element) { if (element.tenured == 1) { element.tenured = "Yes" } else { element.tenured = "No" } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setFriendlyBoolean(data){\n let output = '';\n if(data === true){\n output = 'yes';\n } else if (data === false){\n output = 'no';\n }\n return output;\n }", "SetBool() {}", "set Boolean(value) {}", "function convertYesNoToTrueFalse(vData) {\n\tvar datToBefo...
[ "0.6874995", "0.67618054", "0.6739999", "0.66828257", "0.6540409", "0.6497014", "0.64305073", "0.63833606", "0.63637906", "0.6342241", "0.63272464", "0.6305663", "0.62475014", "0.62322867", "0.6231244", "0.62209076", "0.62195456", "0.61834276", "0.61499685", "0.61383164", "0....
0.6814659
1
Reads listeners from `src/Listeners/` and from every `src/Services/` service directory and autoregisters them, called once on application startup
async register() { this.getApplication().log("REGISTER: Listeners"); const { rootDir, listenerPaths } = this.getApplication().getConfiguration(); // Register listeners from listeners static folder defined in configuration const staticListenersDirectory = join(rootDir, listenerPaths.staticPath); th...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "loadListeners() {\n return __awaiter(this, void 0, void 0, function* () {\n // The 'Listeners' folder will simply have a collection of Class files. We'll get the list here.\n // We'll ge the tentative path first.\n const listenerClassesPath = `${this.directory}/hooks/Listene...
[ "0.63579005", "0.62257123", "0.6162326", "0.61413693", "0.61379194", "0.60102874", "0.59938073", "0.58827114", "0.5868949", "0.5847863", "0.5838761", "0.58332074", "0.5804888", "0.5784746", "0.57772124", "0.57612485", "0.5745832", "0.5745832", "0.57342976", "0.57325983", "0.5...
0.6734113
0
This initializes the first dataPoint of observers collections with the position of the cycists before it starts running.
initializeObservers() { this.notifyObservers(this.latestDatapoint); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init() {\n\t// Only run this the first tick.\n\tif (Memory.tickCounter === undefined) {\n\t\tMemory.tickCounter = 0;\n\t\t\n\t\t// Create a two-dimensional array called moveTrail that keeps\n\t\t// track of where everyone is moving \n\t\tMemory.moveTrail = [];\n\t\tfor (var i = 0; i < 10; i++) {\n\t\t\tva...
[ "0.5775927", "0.56721973", "0.5653451", "0.56315833", "0.5522478", "0.5507374", "0.5507374", "0.5502765", "0.5485009", "0.54758644", "0.5437442", "0.5399121", "0.5399121", "0.5399121", "0.5396437", "0.5396437", "0.5396437", "0.5396437", "0.5391721", "0.53399044", "0.53399044"...
0.6900504
0
Private Makes a datapoint with current properties of this cyclists
generateDataPoint() { const datapoint = new DataPoint(this.myAcceleration, this.position, this.mySpeed, this.timeCounter); datapoint.suggestion = this.latestSuggestion; return (datapoint) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "drawDataPoints() {\n this.graphContainer.select('.graphCanvas').selectAll('circle.datum')\n .data(this.data)\n .enter()\n .append('circle')\n .attr('class', 'datum')\n .attr('r', 3)\n .attr('cx', d => { return this.xyInfo.x(d.get(...
[ "0.6326683", "0.5757048", "0.56132644", "0.5573789", "0.54983735", "0.54375243", "0.54026896", "0.54004884", "0.5390522", "0.53502357", "0.5346292", "0.5314101", "0.5309547", "0.52829623", "0.52786773", "0.5274074", "0.5267265", "0.5266694", "0.52368957", "0.5225627", "0.5205...
0.59329146
1
Get the encrypted sharing link
function getShareLink(calId) { var link = null; jQuery.ajax({ url: "/api/share/encrypt?calendarId=" + calId, type: "GET", dataType:"json", beforeSend: function (xhr) { xhr.setRequestHeader ("Authorization", token); }, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getShareUrl() {\n return url_1.URLExt.normalize(getOption('shareUrl') || getBaseUrl());\n }", "createSharingUrl (network) {\n const ua = navigator.userAgent.toLowerCase();\n\n /**\n * On IOS, SMS sharing link need a special formating\n * Source: https://weblog.west-wind.c...
[ "0.6173963", "0.58925545", "0.5818946", "0.5763291", "0.5707727", "0.5626925", "0.561285", "0.56110215", "0.5602472", "0.5602472", "0.5600769", "0.5527915", "0.5507016", "0.5495724", "0.5431185", "0.5391481", "0.53682077", "0.53424764", "0.5323775", "0.5321597", "0.5294827", ...
0.6533138
0
Refresh city table div
function refreshTableDiv() { var x; for (x in citiesData) { if (citiesData.hasOwnProperty(x)) { newTable.rows[x].style.backgroundColor = (citiesData[x][5] === 'deployedCities') ? '#BAF6A0' : (citiesData[x][5] === 'occupiedCities') ? '#DD5B4D' : ''; newTable.rows[x].cells[0].innerHTML = "<a id='" + cities...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function populateTable() {\n\n var tableContent = '';\n\n // jQuery AJAX call for JSON\n $.getJSON( '/cities/cityList',\n function( data ) {\n //Set data to current variable\n cityListData = data;\n\n // For each item in our JSON ,add to table\n $.each(data, function(){\...
[ "0.6821172", "0.64905703", "0.6441339", "0.64013314", "0.63994485", "0.63891345", "0.62943834", "0.62922746", "0.62245965", "0.6223002", "0.62025714", "0.61829376", "0.6166997", "0.61530083", "0.61176133", "0.61173654", "0.61060256", "0.60989", "0.6087515", "0.60346115", "0.6...
0.74060464
0
Clicking on an island will recalculate and redraw the new data
function changeIsland(a) { a = (a.explicitOriginalTarget) ? a.explicitOriginalTarget.parentNode : a.currentTarget; var mat = getIslandCoords(a.title); currCityXcoord = mat[1]; currCityYcoord = mat[2]; calculateDistance(); citiesData.sort(sortNum); refreshTableDiv(); $('#js_islandBreadName').text(a.title...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clicked(d) {\n var x;\n var y;\n var k;\n\n //if one island is clicked...\n if (d && centered !== d) {\n islandFilter.filterBy('island', d.name);\n var centroid = path.centroid(d);\n ...
[ "0.61417055", "0.6081942", "0.5922954", "0.5807681", "0.5754348", "0.5703144", "0.5701597", "0.5671963", "0.56537026", "0.5585008", "0.55730087", "0.55652356", "0.555846", "0.5556435", "0.5523195", "0.55208033", "0.552007", "0.5516515", "0.55140567", "0.55082244", "0.5498871"...
0.64832217
0
Asynchronously exit. Wait for all listeners of the 'asyncExit' event (on the 'process' object) to have called their callback. The listeners receive the exit code about to be produced and a completion callback.
function exit( code , timeout ) { // Already exiting? no need to call it twice! if ( exitInProgress ) { return ; } exitInProgress = true ; var listeners = process.listeners( 'asyncExit' ) ; if ( ! listeners.length ) { process.exit( code ) ; return ; } if ( timeout === undefined ) { timeout = 1000 ; } a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function exit(err, res) {\n setImmediate(done.bind(ctx, err, res));\n }", "function requestEventLoopExit() {\n EventLoop.requestExit();\n}", "function exit(err, res) {\n\t setImmediate(function(){\n\t done.call(ctx, err, res);\n\t });\n\t }", "function exit(err, res) {\n s...
[ "0.6141386", "0.60637295", "0.59754044", "0.59617496", "0.59617496", "0.59617496", "0.59332013", "0.5927731", "0.5926518", "0.592645", "0.5865268", "0.58557236", "0.5826325", "0.58035266", "0.5780346", "0.5740201", "0.5714154", "0.5644481", "0.5589574", "0.55871356", "0.55690...
0.70766926
0
expected, converter, input... expected, actual
function verify (expected, converter, input) { let argArr = Object.values(arguments) let actual, message = '' if (arguments.length >= 3) { actual = converter.apply(this, argArr.slice(2)) message = 'Input: ' argArr.slice(2).forEach(a => message += shrinkText('' + a) + '\n' ) } else if (arg...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function testConvert() {\n\tvar data = [\n\t\t[10, 20, 30, 40, 50, 60],\n\n\t\t[1, 5, 7, 4, 3, 4, 5],\n\n\t\t[2, 5, 10, 100, 0, 5, 7],\n\n\t\t[10, 10, 10]\n\t]\n\tvar output = [\n\t\t[72000000, 36000000, 24000000, 18000000, 14400000, 12000000],\n\t\t[8400, 1680, 1200, 2100, 2800, 2100, 1680],\n\t\t[0, 0, 0, 0, 350...
[ "0.6100637", "0.58367264", "0.5666422", "0.5516763", "0.542471", "0.5416094", "0.54012275", "0.5381433", "0.53649753", "0.5279494", "0.52677673", "0.5263738", "0.52526456", "0.5245019", "0.52234805", "0.51882887", "0.51880825", "0.5161119", "0.5151428", "0.51399946", "0.50967...
0.76109934
1
subtract 0 to 1000 objects, do the same on the next chance
function sub() { var times = Math.floor(Math.random()*101); while(times--) objects.pop(); process.nextTick(sub); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rand() {\n objData = Math.floor(Math.random()*100)+1;\n ObjDelay = Math.floor(Math.random()*10)+1;\n ObjDelay = ObjDelay * 1000;\n }", "static kill_the_weaklings(){\n for(let sample of Neat.species){\n let kill_amount = Math.floor(Neat.kill_rate * sample.players...
[ "0.6601992", "0.6365062", "0.63384235", "0.6330104", "0.6247766", "0.6230687", "0.61719155", "0.61641634", "0.61510026", "0.61272377", "0.60680735", "0.6016206", "0.6011081", "0.5979298", "0.5971418", "0.5945901", "0.5932106", "0.5931718", "0.59236705", "0.5920448", "0.591149...
0.6460583
1
Fit Add Activity Event
function fitAddActivityEvent(e){ console.log(e.target) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onAddNewActivity(){\n if(activityModel.state.nameEmpty){\n // empty activity name (or whitespaces only), raise warning\n warningModel.onAttemptToAddEmpty();\n } \n else if (activityModel.state.activityName.length > MAX_LENGTH){\n // activity name too long, rais...
[ "0.6542944", "0.6381022", "0.60382515", "0.5965755", "0.5853305", "0.5738228", "0.57151407", "0.56498027", "0.5612959", "0.56119645", "0.55886954", "0.55180824", "0.5475205", "0.54704934", "0.5458744", "0.5405145", "0.5383352", "0.53294677", "0.5271957", "0.52521336", "0.5228...
0.741937
0
Returns Hindi Phrase equivalent to English Phrase.
function mask_to_hindi(english_phrase) { var parsed_url = G.url.parse(location.href) var lang = parsed_url.searchKey.lang || null if(lang && lang.toUpperCase() == 'HIN'){ var hindi_phrase = hindi_words_mapping[english_phrase.toUpperCase()]; return hindi_phrase || english_phrase }el...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wordArrayToPhrase(words) {\n var phrase = words.join(\" \");\n var language = getLanguageFromPhrase(phrase);\n if (language == \"japanese\") {\n phrase = words.join(\"\\u3000\");\n }\n return phrase;\n }", "function sayHi(){\n \n speechRs.speech...
[ "0.5773779", "0.5769087", "0.5766217", "0.5718624", "0.5675728", "0.56542313", "0.5633108", "0.5497442", "0.5497442", "0.54888713", "0.54888713", "0.5488157", "0.54568404", "0.54483706", "0.5436827", "0.54024094", "0.5391608", "0.5376869", "0.5344427", "0.53406155", "0.528233...
0.6416652
0
This function is used for all calls to CMS API and returns the JSON parsed data, whatever that may be
function getCMSAPIData(options, callback) { var httpRequest = new XMLHttpRequest(), responseRaw, parsedData, requestParams; // set up request data requestParams = 'url=' + encodeURIComponent(options.url) + '&requestType=' + options.requestType; // set response handler httpRequest.o...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getReturnedData() {\n return JSON.parse(this.response.responseText);\n }", "function getJSONDataAsText() {\r\n\r\n\tvar jsonData = {};\r\n\t\r\n\tjQuery.ajax({\r\n\t type: \"GET\",\r\n\t url: '/Cryptics/rest/json/asText',\r\n\t success: function(result) {\r\n\t \tjsonData = result;\r\n\t }...
[ "0.6324177", "0.60380965", "0.60033786", "0.5840686", "0.57477134", "0.57090336", "0.5700057", "0.56969374", "0.56911445", "0.5683235", "0.5655551", "0.56337166", "0.5623651", "0.55894655", "0.5579683", "0.5563851", "0.5561256", "0.55589753", "0.55533946", "0.5550286", "0.552...
0.6125816
1
Starts initial playback of videos
function beginPlayingVideos(){ myPlayer.catalog.load(allVideoObjects[0]); myPlayer.play(); currentlyPlayingIndex = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "initalLoad(videos) {\n this.timeout = setTimeout(function () { videos[0].play(); }, 1000);\n }", "play() {\n this.nbrFacesOnCam = 0;\n this.onPause = false;\n this.video.play();\n setTimeout(this.processVideo, 0);\n\t\t// schedule the first one.\n }", "play() {\n\t\tif (this....
[ "0.75990254", "0.75120115", "0.7493602", "0.7445318", "0.7396981", "0.719422", "0.70519036", "0.7022736", "0.69615453", "0.6876464", "0.6805695", "0.67652607", "0.6760957", "0.67299336", "0.67117757", "0.6690937", "0.6681926", "0.6681548", "0.6672944", "0.6669092", "0.6665381...
0.7935114
0
jQuery to collapse the navbar on scroll
function collapseNavbar() { if ($(".navbar").offset().top > 100) { $(".navbar-fixed-top").addClass("top-nav-collapse"); } else { $(".navbar-fixed-top").removeClass("top-nav-collapse"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function collapseNavBar() {\n //var top = $(\".navbar\").offset().top;\n var top = window.scrollY;\n\n\n if (top > 50) {\n $(\".navbar-fixed-top\").addClass(\"top-nav-collapse\");\n } else {\n $(\".navbar-fixed-top\").removeClass(\"top-nav-collapse\");\n }\n}", "function navbarCollap...
[ "0.74061406", "0.7381125", "0.7358453", "0.7342912", "0.7308417", "0.7308417", "0.7308417", "0.7308417", "0.7308417", "0.7308417", "0.7308417", "0.7308417", "0.7308417", "0.7275709", "0.70951617", "0.7084986", "0.70500696", "0.7019792", "0.6929986", "0.68995935", "0.68351245"...
0.74896836
0
Class that can run the hierarchical clustering algorithm with the given parameters.
function HierarchicalClustering(distance, merge, threshold) { this.distance = distance || clusterlib.euclidean_distance; this.merge = merge || clusterlib.average_linkage; this.threshold = threshold == undefined ? Infinity : threshold; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "cluster(options = {}, refreshData = true) {\n if (options.joinCondition === undefined) {throw new Error(\"Cannot call clusterByNodeData without a joinCondition function in the options.\");}\n\n // check if the options object is fine, append if needed\n options = this._checkOptions(options);\n\n let chi...
[ "0.57940745", "0.5731663", "0.553856", "0.5528664", "0.5318705", "0.5282223", "0.527941", "0.52297664", "0.5181331", "0.5146583", "0.5138807", "0.5132402", "0.51323247", "0.51313424", "0.5129123", "0.5121875", "0.5107953", "0.50982165", "0.50409734", "0.50288934", "0.50227296...
0.6224176
0