Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Further Abstraction for my GET Call
function appendDetails(taskArray, id, $el) { //I put the the code into different variables to help trim down the inevitably long concatenation var inputTaskName = "<p class='pastTaskName' contenteditable='true'>" + taskArray[0].name + "</p>"; var inputTaskSummary = "<p class='pastTaskSummary' contentedita...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get(id, params) {}", "GET() {\n }", "get (path, params) { return this.request(path, 'get', null, params) }", "get(url, callback) {}", "get(url, params) {\n\t\treturn request.get(this.proxy + url).query(params).then((response) => response.data);\n\t}", "get(url, opt = {}) {\n opt.method =...
[ "0.72578484", "0.7050501", "0.699543", "0.6517979", "0.651044", "0.6455326", "0.636967", "0.6369339", "0.6345259", "0.6336366", "0.6323896", "0.6323018", "0.6290905", "0.6285073", "0.6243817", "0.6243817", "0.62337124", "0.6198845", "0.61882186", "0.6181577", "0.61654615", ...
0.0
-1
A function to abstract the appending of buttons, mainly here to clear up clutter in my GET call
function appendButtons($el, id) { $el.append('<button id=' + id + ' class="update button">Update</button>'); $el.append('<button id=' + id + ' class="delete button">Delete</button>'); $el.append('<button id=' + id + ' class="status button">Complete</button>'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderButtons(savedButtons) {\n $(\"#api-list\").empty();\n // Looping through the array of topics\n for (var i = 0; i < savedButtons.length; i++){\n $(\"#api-list\").append(\n addObj({\n type: \"button\"\n ...
[ "0.7487837", "0.72505677", "0.71979266", "0.71706796", "0.71623796", "0.71014595", "0.7099532", "0.7090589", "0.70729774", "0.7056695", "0.7050964", "0.70506424", "0.70463645", "0.70235777", "0.7013233", "0.70095557", "0.6991323", "0.69873077", "0.6984765", "0.6984663", "0.69...
0.0
-1
Function to delete with a confirm, just in case
function deleteTask() { var ans = confirm("Are you sure you want to delete this Task?"); if (ans == false) { return; } else { var taskToDelete = $(this).parent().data("id"); $.ajax({ type: 'DELETE', url: '/tasks/' + taskToDelete, success: function(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function confirmDelete() {\n var x = confirm(\"¿Estás seguro?\");\n if(x) return true;\n else return false;\n}", "function confirmDelete(){\n\treturn confirm('Are you sure you want to delete this post?');\n}", "function confirmDelete() {\n\tconfirm('Are you sure you want to delete this post?');\n}", ...
[ "0.8273461", "0.8126716", "0.8111506", "0.80176044", "0.7998372", "0.79763836", "0.79510874", "0.78252167", "0.77203834", "0.77153206", "0.7659715", "0.7644498", "0.7619513", "0.76109165", "0.7587421", "0.751479", "0.751438", "0.75062674", "0.74892473", "0.74870527", "0.74740...
0.0
-1
Checks the input vs. Max string length so the user can't try to put something SQL wouldn't like
function checkStringLength() { var stringName = $(this).prev().children(".pastTaskName").text(); var stringDescription = $(this).prev().children(".pastTaskSummary").text(); var stringDescriptionLength = stringDescription.length; var stringNameLength = stringName.length; var id = $(this).parent().dat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isValidMaxLength(input) {\n return input && input !== '' && input.length <= this.maxLength;\n }", "function checkLengthStringInput(strInput, lengthIn){\n\tvar strLetter = StringUtilNVL(strInput);\n\tif(strLetter.length > lengthIn){\n\t\treturn false;\n\t}\n\treturn true;\n}", "function checkLength(in...
[ "0.73632157", "0.71822304", "0.71512485", "0.7136158", "0.7120436", "0.7027694", "0.6997142", "0.69937414", "0.6964556", "0.69580764", "0.69523096", "0.69388187", "0.6936625", "0.68474406", "0.6845341", "0.683016", "0.67739266", "0.6771002", "0.67619675", "0.6760741", "0.6755...
0.0
-1
Dura 3400 milisegundos maso o menos
function animacion1(id,nombre,cual,nom){ //Animamos el circulo var padre = $(id).parent(); padre.animate({borderWidth:10,opacity:0},350,function(){ padre.animate({opacity:1,borderWidth:3},350); }); if(nom){ //Animamos el nombre var palabras = creaPalabras(alfabeto,nombre); $(id+"_n").animate({o...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cargarMiniaturas()\n{\n obtenerNoticiasPorCategoria(\"Miniaturas\", 5);\n}", "function proximo_mes(){\n if(mes_actual!=10){\n mes_actual++;\n }else{\n mes_actual=0;\n año_actual++;\n }\n dibujar_fecha();\n escribir_mes();\n escogerdia1();\n escogerdia2();\n}"...
[ "0.56805694", "0.5375886", "0.53658944", "0.53070015", "0.5280712", "0.527615", "0.52501017", "0.52423435", "0.5233867", "0.5230559", "0.5204134", "0.51940113", "0.5188612", "0.5171939", "0.51684386", "0.5153656", "0.51215655", "0.50932896", "0.5083328", "0.5082977", "0.50755...
0.0
-1
a.addEventListener('keyup', upKey) a.addEventListener('keydown', downKey) b.addEventListener('keyup', upKey) b.addEventListener('keydown', downKey)
function upKey(e) { a.getAttribute("value").textContent += `${e.code}`; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addEventListeners() {\n document.addEventListener('keydown', (e) => {\n this.eventListener(e, true);\n });\n document.addEventListener('keyup', (e) => {\n this.eventListener(e, false);\n });\n }", "static _addKeyboardEventListeners() {\n window.addEventListener(\"keydown\"...
[ "0.69511616", "0.6787802", "0.6783607", "0.6773791", "0.67428803", "0.6673002", "0.66494024", "0.65845317", "0.6516877", "0.65012044", "0.6492263", "0.64836985", "0.64647925", "0.6457797", "0.6420025", "0.6411364", "0.6402594", "0.6398715", "0.63978356", "0.6372821", "0.63657...
0.0
-1
This function is defined in the global scope
function multiply() { return num1 * num2; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _____SHARED_functions_____(){}", "private internal function m248() {}", "private public function m246() {}", "static private internal function m121() {}", "static private protected internal function m118() {}", "static final private internal function m106() {}", "protected internal function m2...
[ "0.70232385", "0.68621445", "0.6852822", "0.6738726", "0.66033405", "0.6590163", "0.6491934", "0.644776", "0.64116174", "0.6375606", "0.6363173", "0.6343801", "0.63034755", "0.63034755", "0.63034755", "0.6286793", "0.6259817", "0.6254689", "0.62303656", "0.6208314", "0.615097...
0.0
-1
Returns 60 A nested function example
function getScore() { num1 = 2, num2 = 3; function add() { return name + ' scored ' + (num1 + num2); } return add(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Count() { //first nested function containing a variable and another nested function\n var starting_point = 500;\n function plus_sixty() {starting_point += 60;} // function used to add 60 to our variable from Count() function\n plus_sixty(); // actually calling the plus_sixty() functio...
[ "0.674809", "0.6656857", "0.64487946", "0.6278077", "0.6244116", "0.62119156", "0.6187011", "0.61625093", "0.6138467", "0.61103463", "0.60844356", "0.6039982", "0.6039732", "0.6031589", "0.6023692", "0.60011655", "0.59969705", "0.5977829", "0.5964158", "0.59583765", "0.595383...
0.0
-1
Returns "Chamakh scored 5" Scope and the function stack In fact, recursion itself uses a stack: the function stack. The stacklike behavior can be seen in the following example:
function foo(i) { if (i < 0) return; console.log('begin: ' + i); foo(i - 1); console.log('end: ' + i); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Stack_A_A_R() {\r\n}", "function Stack_A_R() {\r\n}", "function Stack_R() {\r\n}", "function greet(who) {\n //2. call stack here and runs console.log\n console.log(`Hello ${who}`)\n}", "function DEBUG_STACK(stack) {\n console.log(\"@@@ [FUNCTION CALL STACK]\");\n for (let i = 0; i < 5; ++i...
[ "0.66964054", "0.6669368", "0.6547826", "0.6543137", "0.6501399", "0.6489708", "0.6466351", "0.6452818", "0.64520335", "0.6451726", "0.6447406", "0.6425234", "0.6419933", "0.63274276", "0.63153297", "0.6228993", "0.62262845", "0.6191661", "0.615588", "0.61363477", "0.6109261"...
0.0
-1
Output: begin: 3 begin: 2 begin: 1 begin: 0 end: 0 end: 1 end: 2 end: 3 Nested functions and closures =>The inner function can be accessed only from statements in the outer function. =>The inner function forms a closure: the inner function can use the arguments and variables of the outer function, while the outer funct...
function addSquares(a, b) { function square(x) { return x * x; } return square(a) + square(b); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function outer() {\n var start = \"Closures are\";\n \n // here the function inner is \n // using 'closure' to pass values\n return function inner() {\n return start + \" \" + \"awesome\";\n };\n}", "function outerFunction (outerArg) { // begin of scope outerFunction\r\n // Variable d...
[ "0.73830247", "0.7139616", "0.7043275", "0.7021843", "0.6938498", "0.6921965", "0.6919123", "0.6912029", "0.6903323", "0.69023633", "0.68941873", "0.68936545", "0.68443227", "0.6815411", "0.6812214", "0.67945945", "0.67925847", "0.675289", "0.67316693", "0.67076504", "0.66494...
0.0
-1
isNaN()=The isNaN() function determines whether a value is NaN or not. Because coercion inside the isNaN function can be surprising, you may alternatively want to use Number.isNaN().
function milliseconds(x) { if (isNaN(x)) { return 'Not a Number!'; } return x * 1000; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isNaN(value) {\n return Number(value) !== value;\n}", "function isNaN(val){\n\t // based on the fact that NaN !== NaN\n\t // need to check if it's a number to avoid conflicts with host objects\n\t // also need to coerce ToNumber to avoid edge case `new Number(NaN)`\n\t ret...
[ "0.84117347", "0.83711094", "0.8317572", "0.83030874", "0.8202663", "0.81608665", "0.8108662", "0.79178774", "0.79178774", "0.79178774", "0.79178774", "0.79178774", "0.79178774", "0.79178774", "0.79178774", "0.79178774", "0.7868156", "0.7755547", "0.7699871", "0.757818", "0.7...
0.0
-1
Determine whether the cliententered passwords match, and enable 'Register' button if so. Also display messages in the DOM to let the client know whether or not their passwords match
function passwordsMatch() { if (register_password.value.length !== 0 && register_password_again.value.length !== 0) { if (register_password.value === register_password_again.value) { document.querySelector('.btn-register').disabled = false; document.querySelector('#passwords_match').classList....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkPasswordMatch() {\n\t\tvar password = $(\"#txtNewPassword\").val();\n\t\tvar confirmPassword = $(\"#txtConfirmPassword\").val();\n\n\t\tif (password != confirmPassword) {\n\t\t\t$(\"#txtConfirmPassword\").removeClass(\"border-success\");\n\t\t\t$(\"#txtConfirmPassword\").addClass(\"border-danger\");\...
[ "0.7671788", "0.76224583", "0.7511357", "0.74488276", "0.7405222", "0.73731333", "0.7348286", "0.7338213", "0.7328608", "0.72970265", "0.7189459", "0.7142058", "0.708714", "0.7074959", "0.7018172", "0.69843423", "0.6927696", "0.6919228", "0.69150996", "0.6902247", "0.68959224...
0.82210404
0
endregion region BEHAVIORS initializers
function activate() { loadList(); //hideSidebar(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "init() {\n }", "function init() {\n\t \t\n\t }", "__previnit(){}", "function init() {\n //UH HUH, THIS MY SHIT!\n }", "function init() {\n\t// Constants\n\tslotCount = 6\n\tcodeComplexity = 6\n\tcodeLength = 4\n\taugmentedContrast = false\n\n\tCONTROLS.init()\n}", "...
[ "0.62069374", "0.6078228", "0.60743487", "0.6056453", "0.6042974", "0.5999865", "0.59972215", "0.5994408", "0.5953863", "0.59533274", "0.5950528", "0.5931757", "0.5931269", "0.5861097", "0.5851972", "0.58456504", "0.58401006", "0.58392787", "0.58392787", "0.58392787", "0.5839...
0.0
-1
Understand how to do the forcedirected graphs: 1. 2. 3. 4. 5. (Old example, with V.3, but very ordered)
function startCharting(j) { //console.log(j) const w = 800; const h = 500; var div = d3.select("#chartHolder").append("div") .attr("class", "tooltip") .style("opacity", 0); var svg = d3.select('#chartHolder').append('svg') .attr('width', w) .attr('height', h); // Define the data ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function UndirectedGraph() {\n this.edges = {}\n}", "function forceDirected_array(graph) {\n //alt: \n //var graf = [[[],[],[],[]],[[],[],[],[]],[[],[],[],[]],[[],[],[],[]]];\n //var graf = [[[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]],[[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]...
[ "0.62846875", "0.61432016", "0.60773456", "0.5969117", "0.59567356", "0.59567356", "0.585596", "0.5788542", "0.5771745", "0.5754524", "0.5748198", "0.5718805", "0.57184017", "0.57148874", "0.5683502", "0.5617242", "0.55769557", "0.55711937", "0.5525768", "0.5453921", "0.54517...
0.0
-1
Init the service worker
_initServiceWorker() { if (process.browser && 'serviceWorker' in navigator) { if (envBoolean(process.env.ENABLE_SERVICE_WORKER)) { navigator.serviceWorker .register('/service-worker.js') .then(() => { console.log('> service worker registration successful'); })...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initServiceWorker () {\n if ('serviceWorker' in navigator) {\n window.addEventListener('load', () => {\n navigator.serviceWorker.register('/service-worker.js')\n })\n }\n}", "function initializeServiceWorker() {\n /**\n * TODO - Part 2 Step 1\n * Initialize the service worker set up ...
[ "0.79768693", "0.7528543", "0.7183059", "0.70229346", "0.6996132", "0.6989264", "0.66701365", "0.6575522", "0.6575522", "0.65641046", "0.65609473", "0.6449076", "0.6437769", "0.64253384", "0.6419075", "0.6417752", "0.637477", "0.62800294", "0.62559855", "0.62447137", "0.62199...
0.7686187
1
Below function gets executed when user clicks on any of the 4 product types in dashboard page
function loadpage() { var pageurl = window.location.href; //On page load, the content of all the 4 product types is disabled var elements = document.getElementsByClassName("productCont"); for (var x = 0; x < elements.length; x++) { elements[x].style.display = "none"; } //Below line rea...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function product_type_click() {\n\tvar type = $('#product_type').val();\n\tif (type == 'variant') {\n\t\t$('.js-non-variant-unit-div').hide();\n\t\t$('#js-non-variant-weight-div').hide();\n\t\t$('#js-non-variant-dimentions-div').hide();\n\t\t$('.js-variant-div').show();\n\t\t// $('.js-variant-price-div').hide();\n...
[ "0.68682545", "0.6650526", "0.655875", "0.65394926", "0.65244514", "0.6369848", "0.63136494", "0.62428063", "0.6241456", "0.6208039", "0.62070394", "0.6187699", "0.61743736", "0.6129571", "0.6123166", "0.6114022", "0.60316765", "0.6030814", "0.60298115", "0.6026676", "0.60234...
0.6119229
15
Navigation to accept suite pages on button click from dashboard page
function LoadAcceptPage(pageType) { switch (pageType) { case "acceptJs": window.location.href = "index.html?producttype=acceptjs"; break; case "acceptUi": window.location.href = "index.html?producttype=acceptui"; break; case "acceptHosted": window.location.href = "index.html?producttype=acce...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "navigateToVitalsPage() {\n return this._navigate(this.buttons.vitals, 'vitalsPage.js');\n }", "function stagePageOnClick() {\r\n let stages = document.querySelectorAll('.header.stages .stage.done');\r\n stages.forEach(function(item) {\r\n item.addEventListener('click', function() {\r\n ...
[ "0.6229624", "0.61969113", "0.6166055", "0.6110453", "0.6109018", "0.61037326", "0.6056728", "0.599422", "0.59665525", "0.5961577", "0.5954876", "0.59427714", "0.5924958", "0.5919525", "0.59064674", "0.5903798", "0.5893657", "0.5890465", "0.587043", "0.58490527", "0.5847333",...
0.0
-1
On cancel button click, the user navigates back to dashboard page
function RedirectToDashboard() { window.location.href = "index_all.html"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cancel() {\n history.goBack();\n }", "cancel() {\n this.props.history.push('/settings'); //route back to Home page if Cancel button has been selected\n }", "function cancelClick() {\n window.location.href = '/';\n}", "_cancel(){\n this.state.go('customer-overview');\n }", ...
[ "0.788466", "0.78590953", "0.7805156", "0.77253354", "0.77003", "0.7670275", "0.7635831", "0.7565985", "0.75495404", "0.7544268", "0.7543138", "0.7533708", "0.7518766", "0.7504011", "0.7487204", "0.7475615", "0.7438464", "0.741939", "0.7388205", "0.72928077", "0.7287186", "...
0.0
-1
To check if customer ID is passed by the user along with product type for Accept.js and Accept.js UI request URLs
function checkForCustomerIdInUrl(pageurl) { //Accept.js and Accept.js UI accepts only product type //If the user passes customer id to Accept.js or Accept.js UI product type, then user gets redirected to the error message section if (pageurl.toLowerCase().indexOf("&customerid=") > 0) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadpage() {\n var pageurl = window.location.href;\n\n //On page load, the content of all the 4 product types is disabled\n var elements = document.getElementsByClassName(\"productCont\");\n for (var x = 0; x < elements.length; x++) {\n elements[x].style.display = \"none\";\n }\n\n ...
[ "0.66749895", "0.5790179", "0.5618511", "0.5537893", "0.5505111", "0.54440516", "0.54425156", "0.54281956", "0.53835547", "0.5379952", "0.5379734", "0.5311646", "0.5307619", "0.52927625", "0.529242", "0.5270266", "0.5240019", "0.52395767", "0.5229511", "0.5216927", "0.5214099...
0.7299362
0
Below function is used to fetch the values of the parameters(producttype/customerid) passed in the URL.
function getParameterByName(name, url) { if (!url) url = window.location.href; name = name.replace(/[\[\]]/g, "\\$&"); var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"), results = regex.exec(url); if (!results) return null; if (!results[2]) return ''; return decodeURIComponent(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function obtainGETparameters() {\n\tvar oGetParameters = new Array();\n\n\tvar sLocation = location.search.split(\"?\");\t\n\tif(sLocation.length > 1) {\n\t\tvar sParameterList =sLocation[1].split(\"&\"); \n\n\t\tfor(var i=0; i < sParameterList.length; i++) { \n\t\t\tsParameterList[i] = sParameterList[i].split(\"+...
[ "0.5946301", "0.58673334", "0.5813835", "0.57900655", "0.5721252", "0.56994647", "0.56634843", "0.565515", "0.5650783", "0.5642641", "0.56176245", "0.5607645", "0.5593598", "0.55918974", "0.5551089", "0.55350435", "0.5531489", "0.55019265", "0.5498336", "0.5489029", "0.54864"...
0.0
-1
Accept.js functionality Begin On click of radio buttons in Accept.js page
function showData(option) { document.getElementById("msg").innerHTML = ""; document.getElementById("alert").style.display = "none"; if (option == "card") { document.getElementById("bank").style.display = "none"; document.getElementById("card").style.display = "block"; } else { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function formAccept() {\n\tvar $checkboxAccept = $('.form-accept-js');\n\tif($checkboxAccept.length) {\n\t\t$checkboxAccept.change(function () {\n\t\t\tvar accept = $(this).prop('checked');\n\t\t\t$(this).closest('form').find('.form-accept-submit-js').prop('disabled', !accept);\n\t\t});\n\t\t$checkboxAccept.trigge...
[ "0.63823646", "0.62408733", "0.6201573", "0.61962444", "0.61575305", "0.6061991", "0.60072607", "0.59379065", "0.5912861", "0.590876", "0.5900111", "0.58993584", "0.5856418", "0.5811332", "0.578538", "0.5777065", "0.5750749", "0.57501084", "0.57452", "0.5739617", "0.5738789",...
0.0
-1
To validate fields in Accept JS form
function validatePaymentFields() { var sel = document.querySelector('input[name="optradio"]:checked').value; if (sel == "card") { var currentYear = new Date(); if (cardNo.value == "") cardNo.classList.add("error"); else { cardNo.classList.remove("error"); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function js_validate_fields(text){\n\n\tvar canContinue = true;\n \n\tjQuery('.required-active').each(function(i, obj) {\t\t\n\t\tjQuery(obj).removeClass('required-active');\t\t\t\t\t \n\t});\t\n\t\n \tjQuery('.required-field').each(function(i, obj) {\t\t\n\t\t\t\t\n\t\tif(jQuery(obj).val() == \"\"){\t\t\t\n\t\t\...
[ "0.6551533", "0.6542459", "0.6447666", "0.6427334", "0.642315", "0.63969576", "0.6373322", "0.6357448", "0.6347742", "0.62981933", "0.6264808", "0.6264808", "0.62406075", "0.62272775", "0.62272334", "0.62212455", "0.62146175", "0.6213072", "0.62095255", "0.6202357", "0.620007...
0.0
-1
To restrict inputs to allow only numbers in Accept.js page
function isNumber(evt) { evt = (evt) ? evt : window.event; var charCode = (evt.which) ? evt.which : evt.keyCode; if (charCode > 31 && (charCode < 48 || charCode > 57)) { return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function allowNumbersOnly(e) {\n var code = (e.which) ? e.which : e.keyCode;\n if (code > 31 && (code < 48 || code > 57)) {\n e.preventDefault();\n }\n }", "function allowNumbersOnly(e) {\n\t\t\n\t var charCode = (e.which) ? e.which : e.keyCode;\n\t if (charCode > 31 && (charCode < 48 || charCod...
[ "0.77119374", "0.75268424", "0.7492605", "0.7403575", "0.73769057", "0.73603535", "0.7349957", "0.7344276", "0.73253894", "0.7321086", "0.73106956", "0.73106956", "0.73020655", "0.7261419", "0.72392756", "0.71955645", "0.7184814", "0.7172412", "0.71515644", "0.71508396", "0.7...
0.0
-1
On entering value in textboxes, validate input in Accept.js page
function onTextInput(id) { var visa = ["4"]; var JCb = ["3088"]; var discover = ["6011", "64", "65"]; var amex = ["37", "34"]; var dinersClub = ["38"]; var masterCard = ["51", "52", "53", "54", "55", "2221", "2222", "2223"]; var element = document.getElementById(id); var cardNumElem = do...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function valSearchUdhaarByFixedAmountInputs(obj) {\r\n if (validateEmptyField(document.srch_udhaar_fixedAmt.udhaarFixedAmt.value, \"Please enter udhaar principal amount!\") == false ||\r\n validateNum(document.srch_udhaar_fixedAmt.udhaarFixedAmt.value, \"Accept only Numbers without space character!\"...
[ "0.656945", "0.6501517", "0.64784074", "0.64750504", "0.63754857", "0.636114", "0.6328409", "0.63183135", "0.6294021", "0.6279173", "0.62353396", "0.62351364", "0.6189383", "0.6168268", "0.6154898", "0.61517316", "0.6088532", "0.6088241", "0.60589737", "0.60552186", "0.604969...
0.0
-1
Accept.js client side validation end Send payment information on Pay button click in Accept.js page
function sendPaymentDataToAnet() { var isvalid = validatePaymentFields(); //if all fields are valid if (isvalid == "true") { var authData = {}; authData.clientKey = globalVars.ClientKey;//Value fetched from the constants.js file authData.apiLoginID = globalVars.ApiLoginID;//Value fe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function AcceptUI() {\n\n //To set the action URL for the payment form in Accept UI section\n var form = document.getElementById(\"paymentForm\");\n form.setAttribute(\"action\", window.location.href.split('?')[0]);\n \n //Accept UI pay button has predefined attributes that are declared below.\n ...
[ "0.68897057", "0.66721576", "0.6324996", "0.61718714", "0.61149496", "0.61061496", "0.6066284", "0.6037493", "0.6018618", "0.60043246", "0.5991029", "0.599041", "0.5972311", "0.59486306", "0.58729035", "0.5842694", "0.5821368", "0.579992", "0.57903963", "0.5786764", "0.578155...
0.6751909
1
Response handler for accept js and accept ui
function responseHandler(response) { //if response has errors, then the below code gets executed if (response.messages.resultCode === "Error") { var i = 0; var container = document.getElementById("msg"); container.innerHTML = ""; var value = ""; var element; var ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async handle(_, ctx) {\n if (ctx.request.ajax()) {\n this.respondWithJson(ctx);\n return;\n }\n switch (ctx.request.accepts(['html', 'application/vnd.api+json', 'json'])) {\n case 'html':\n case null:\n this.respondWithRedirect(ctx);\n...
[ "0.66083544", "0.5916262", "0.5916262", "0.5817545", "0.574458", "0.57401496", "0.57152945", "0.5706524", "0.56862295", "0.56815284", "0.564871", "0.56363225", "0.56162643", "0.55879617", "0.55841786", "0.5579277", "0.55665046", "0.5565206", "0.5552067", "0.55331975", "0.5533...
0.6138598
1
Accept.js paymentFormUpdate functionality implementation
function paymentFormUpdate(opaqueData) { dataDescriptor.value = opaqueData.dataDescriptor; dataValue.value = opaqueData.dataValue; // To blank out the fields before submitting them to your server. //Clear all fields on submit in accept js cardNumber.value = ""; expMonth.value = ""; expYear...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onBalancePayFormSubmit() {\n this.loading.pay = true;\n\n return this.BillingDebtAccount.payDebtWithPaymentMethod(\n this.model.paymentMethod.id,\n )\n .then(() => {\n this.Alerter.success(\n this.$translate.instant('billing_history_balance_pay_success', {\n trackHref:...
[ "0.6206284", "0.6150925", "0.6144513", "0.6118185", "0.6005479", "0.59773535", "0.5833353", "0.5825814", "0.58161765", "0.581219", "0.5765108", "0.574778", "0.5716526", "0.57150555", "0.5706287", "0.5699714", "0.56990445", "0.5698191", "0.5697314", "0.5681169", "0.56356394", ...
0.73482835
0
Accept.js functionality End AcceptUI functionality implementation
function AcceptUI() { //To set the action URL for the payment form in Accept UI section var form = document.getElementById("paymentForm"); form.setAttribute("action", window.location.href.split('?')[0]); //Accept UI pay button has predefined attributes that are declared below. //To set values ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "acceptCancel() {}", "accept() {\n this._dialog_ref.close('done');\n this.event.emit({ reason: 'done' });\n }", "accept () {\n this.set('register', false)\n this.set('selectedAdjective', null);\n this.set('selectedNoun', null);\n this.set('selectedVer...
[ "0.65379196", "0.61311865", "0.6031069", "0.58663744", "0.5854628", "0.57834244", "0.5782324", "0.57814145", "0.5780034", "0.5766161", "0.56491745", "0.56413513", "0.5626157", "0.55645484", "0.55642146", "0.5540613", "0.55173284", "0.55050343", "0.55009437", "0.54632014", "0....
0.5737719
10
ValidateCustomer function validates the customer id which is declared in the URL
function ValidateCustomer(id) { var customerId; customerId = id; var result = {}; //Below ajax call to API to validate the customer id $.ajax({ type: 'GET', url: globalVars.ValidateCustomerRequestUrl,//Value fetched from the constants.js file data: { apiLoginId: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validateCustomer(customerForm){\n var customerPhone = $(customerForm).find('#customerPhone');\n var customerName = $(customerForm).find('#customerName');\n var customerId = $(customerForm).find('#customerId').val();\n var action = $('#action').val();\n var controller = $...
[ "0.6649035", "0.66416615", "0.6516509", "0.65156466", "0.6316869", "0.6224253", "0.6054896", "0.6029985", "0.5967468", "0.5946528", "0.5844364", "0.5794894", "0.5768766", "0.5725119", "0.5658262", "0.56052256", "0.55276847", "0.5515665", "0.55074304", "0.55010915", "0.5500912...
0.62990075
5
Show details on click of info icon in accept customer pop up
function showInfo() { var display = document.getElementById("idScenarios").style.display; if (display == "block") { document.getElementById("idScenarios").style.display = "none"; } else { document.getElementById("idScenarios").style.display = "block"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function editDeliveryInfoShow(){\n\t\t$(\".deliveryInfoDetails\").hide();\n\t\t$(\"#editDeliveryInfo\").show();\n\t\tviewMap();\n\t}", "function editRestaurantInfoShow(){\n\t\t$(\".restaurantInfoDetails\").hide();\n\t\t$(\"#editrestaurantinfo\").show();\n\t}", "function showTheInfobox(e) {\n if (e.targetTyp...
[ "0.666578", "0.66426504", "0.6601731", "0.6519383", "0.6518391", "0.65142006", "0.64781153", "0.6470317", "0.6452286", "0.6409005", "0.6408415", "0.63931304", "0.6385852", "0.6376245", "0.63359445", "0.63108087", "0.6263425", "0.62601006", "0.6241877", "0.6213808", "0.6208412...
0.0
-1
On click of continue button in accept customer pop up in dashboard page
function Redirect() { document.getElementById("invalidCustomer").style.display = "none"; customerId = document.getElementById("txtCustomerId").value; if (customerId == "") { document.getElementById("txtCustomerId").focus(); document.getElementById("invalidCustomer").style.display = "inherit"...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onclick_approveEmail() {\n\n try {\n\n // Pop up dialogue box for Approval\n\n var options = {\n title: \"Email for Account Confirmation Activated!\",\n message: \"Click Ok to Approve\"\n };\n\n } catch (err) {\n l...
[ "0.6717291", "0.6459788", "0.6387593", "0.63272554", "0.63078034", "0.6272132", "0.62710094", "0.6253202", "0.6206444", "0.62012595", "0.6153559", "0.6146562", "0.61421233", "0.60955614", "0.6060011", "0.60578066", "0.6035122", "0.60169244", "0.5995958", "0.5990588", "0.59774...
0.56711733
78
To close accept customer pop up on cancel button click
function CloseAcceptCustomer() { window.location.href = "index_all.html"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onCancelButtonClick() {\n modal.close();\n }", "function onCancelButtonClick() {\n modal.close();\n }", "function onCancelClick() {\n logger.info('cancel_button click event handler');\n clearAllErrors();\n closeKeyboards();\n $.edit_custo...
[ "0.7450916", "0.7450916", "0.7340903", "0.72838986", "0.710461", "0.7051045", "0.67508155", "0.6735426", "0.67352414", "0.66847616", "0.6682799", "0.66723025", "0.66655624", "0.664357", "0.6639845", "0.6631125", "0.6628747", "0.6622657", "0.6622657", "0.6622657", "0.6622657",...
0.6186374
93
Collision detection uses the minkowski sum
function collision (first, second){ const w = (first.width + second.width) / 2; const h = (first.height + second.height) / 2; const dx = Math.abs(first.x - second.x); const dy = Math.abs(first.y - second.y); if (dx <= w && dy <= h){ const wy = w * (first.y - second.y); const hx = h *...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkCollision(){\r\n\t//check se la macchina esce dalla pista\r\n\tif(center_carr[2]<-408)vz=0;\r\n\tif(center_carr[2]>109)vz=0;\r\n\t\r\n\tif(center_carr[0]<track_dimension[1])vz=0;\r\n\tif(center_carr[0]>track_dimension[0])vz=0;\r\n\t\r\n\t//check collisione con i booster\r\n\tif((center_carr[0]<2.3 &&...
[ "0.71120685", "0.6985065", "0.69442105", "0.6889642", "0.68872637", "0.68074757", "0.6776226", "0.6773446", "0.67548245", "0.66968787", "0.6695099", "0.66828924", "0.6671407", "0.6667727", "0.662962", "0.66229266", "0.6614236", "0.657547", "0.6572587", "0.6548497", "0.6532275...
0.6158056
100
Put all the questions into one function to call when the startgame button is clicked
function startGame () { var userName = prompt( 'What is your name?' ); askYorNQs(); askNumGuessQ(); askCityQ(); alert( userName + ', you got ' + tally + ' out of ' + questionArray.length + ' questions right.' ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gamestart() {\n\t\tshowquestions();\n\t}", "function startGame(){\n countdown();\n question();\n solution();\n }", "function startQuiz() {\n displayNo('startBtn');\n displayYes('card');\n displayYes('answers');\n nextQuestion();\n}", "function startGame() {\n ...
[ "0.811673", "0.78757703", "0.7815547", "0.7775108", "0.77626336", "0.7759225", "0.7668865", "0.7649885", "0.7597549", "0.7594809", "0.75675833", "0.75414616", "0.75387454", "0.7534516", "0.7530163", "0.74957746", "0.7476065", "0.7474252", "0.74667764", "0.7464358", "0.7433216...
0.0
-1
TODO: we don't really need all of this, just expose two functions that calculate the target cursor within a list given a target
function LinkedList($, set) { this.$ = $; this.$set = $(set); this.setCursor(0); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get targetPosition() {}", "extractTouchListTarget(touchList) {\n for (let i = 0, l = touchList.length; i < l; i++) {\n if ('$$id' in touchList[i]) {\n touchList[i].target = this.getNode(touchList[i].$$id);\n delete touchList[i].$$id;\n }\n }\n }", "function adjacentInList($list, ...
[ "0.6097036", "0.588342", "0.5801938", "0.56817096", "0.56634974", "0.5447286", "0.5445043", "0.54016817", "0.5378267", "0.5375537", "0.53538674", "0.53538674", "0.53538674", "0.53538674", "0.53538674", "0.5276556", "0.5201996", "0.51594347", "0.51263136", "0.51178443", "0.506...
0.0
-1
Create functions for each export
function access(req, res, next){ console.log(req.ip + "\t" + req.method + "\t" + req.url); next(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function exports() {}", "function exports() {}", "function exports() {}", "function exports(file_name, func_name, func) {\n window.modules = window.modules || {};\n window.modules[file_name] = window.modules[file_name] || {};\n if (func_name) {\n window.modules[file_name][func_name] = func;\n...
[ "0.72493076", "0.72493076", "0.72493076", "0.64742726", "0.64202476", "0.6368258", "0.6317611", "0.62790805", "0.62790805", "0.6278985", "0.6197487", "0.61387587", "0.61340714", "0.5963707", "0.58234733", "0.5808264", "0.5770972", "0.57648224", "0.5748814", "0.5712898", "0.56...
0.0
-1
let schemeId = NGL.ColormakerRegistry.addSelectionScheme([ ["red", "_O"], ["blue", "_N"], ["gold", "_S"], ["lightgray", '_C'], ["white", ""] ], "lightscheme");
function selectInterface(c) { // Because NGL is incredibly clutsy, we have to do this.. let radius = 5.0; let selection = ''; let neighborsE; let neighborsB; // neighbors of B belonging to A nglsele = new NGL.Selection(":B"); neighborsB = c.structure.getAtomSetWithinSelection(nglsele, radius...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function changeColorScheme() {\n\n}", "function colorPick(colorCode) {\n currentColor = colorCode;\n}", "function getColourSchemes() {\n \n \n // addColourList();\n palettes = [\"#ffffe5\", \"#f7fcb9\", \"#d9f0a3\", \"#addd8e\", \"#78c679\", \"#41ab5d\", \"#238443\", ...
[ "0.74664426", "0.61851805", "0.6128978", "0.60747504", "0.60150844", "0.60105675", "0.59598666", "0.5939607", "0.5934874", "0.5925714", "0.59230536", "0.5907326", "0.5901166", "0.5880159", "0.5874716", "0.58740574", "0.58415854", "0.5840602", "0.58355457", "0.5792602", "0.578...
0.0
-1
Function to calculate Words Per Minute (WPM) According to wpm = 5 Characters Per Minute (CPM)
function calculateWPM(){ var cpm = (strIndex/numOfSecPassed)*60; return (cpm/5).toFixed(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wordsPerMinute() {\n wpmSecondsCounter++;\n let inputText = TEXTAREA.value;\n let minutesPassed = wpmSecondsCounter / 60;\n let wordsTyped = inputText.length / 5; //1 word counts as 5 characters\n wpm = Math.trunc(wordsTyped / minutesPassed);\n\n WPM.innerHTML = wpm;\n return wpm;\n}"...
[ "0.8199115", "0.76183903", "0.7154409", "0.6458355", "0.61620677", "0.598468", "0.5948626", "0.5939845", "0.58704805", "0.58217245", "0.5760487", "0.571476", "0.56878376", "0.56842905", "0.565261", "0.5611942", "0.5611942", "0.55562705", "0.5514531", "0.54864115", "0.54447156...
0.73727393
2
listed below. Any JavaScript/Coffee file within this directory, lib/assets/javascripts, or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path. It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the compiled file. JavaScript code in this ...
function handleFileSelect() { //Check File API support if (window.File && window.FileList && window.FileReader) { var files = event.target.files; //FileList object var output = document.getElementById("result"); for (var i = 0; i < files.length; i++) { var file = files[i]; //...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function js(cb){\n src([jquery,bootstrap_js]).pipe(dest(jsDest));\n cb();\n}", "function javascript() {\n return gulp.src('src/assets/js/*.js')\n //.pipe($.sourcemaps.init())\n //.pipe($.babel())\n //.pipe($.concat('appfou.js'))\n .pipe($.if(PRODUCTION, $....
[ "0.62647367", "0.6003054", "0.5956357", "0.5864359", "0.5779508", "0.5731839", "0.5723338", "0.57149553", "0.56143343", "0.5559594", "0.5541073", "0.5516445", "0.5512399", "0.55011415", "0.549911", "0.5493115", "0.54571253", "0.54329157", "0.5431608", "0.54288155", "0.5423886...
0.0
-1
Adapted from convertsourcemap (MIT)
function toComment(sourceMap) { // eslint-disable-next-line no-undef var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))); var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64; return '/*# ' + data + ' */'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function extractSourceMap(fs, logger, file) {\n var inline = convert_source_map_1.commentRegex.test(file.text);\n var external = convert_source_map_1.mapFileCommentRegex.exec(file.text);\n if (inline) {\n var inlineSourceMap = convert_source_map_1.fromSource(file.text);\n ...
[ "0.6964916", "0.6937077", "0.67628086", "0.64402395", "0.63267565", "0.62970984", "0.62525105", "0.62076676", "0.619188", "0.6179115", "0.61730963", "0.6158623", "0.6158623", "0.6158623", "0.6155814", "0.6092864", "0.60372883", "0.59867525", "0.59786624", "0.59781057", "0.597...
0.0
-1
unused harmony export mapActions / unused harmony export createNamespacedHelpers vuex v3.1.0 (c) 2019 Evan You
function applyMixin (Vue) { var version = Number(Vue.version.split('.')[0]); if (version >= 2) { Vue.mixin({ beforeCreate: vuexInit }); } else { // override init and inject vuex init procedure // for 1.x backwards compatibility. var _init = Vue.prototype._init; Vue.prototype._init = function ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function appendComputed(actions) {\n let keys = Object.keys(actions)\n let states = {};\n keys.forEach((module) => {\n actions[module].states.forEach(state => {\n states['vuex_' + state] = function () {\n return Store.getters[module + '/' + state]\n }\n }...
[ "0.60137445", "0.5917593", "0.5661555", "0.5661555", "0.5556484", "0.5505577", "0.54803663", "0.5448244", "0.53627", "0.52799964", "0.5249612", "0.51987094", "0.5170645", "0.5170395", "0.5170395", "0.51445305", "0.51180893", "0.5114918", "0.50980294", "0.5072195", "0.5051441"...
0.0
-1
Vuex init hook, injected into each instances init hooks list.
function vuexInit () { var options = this.$options; // store injection if (options.store) { this.$store = typeof options.store === 'function' ? options.store() : options.store; } else if (options.parent && options.parent.$store) { this.$store = options.parent.$store; } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function vuexInit () {\n\t var options = this.$options;\n\t // store injection\n\t if (options.store) {\n\t this.$store = options.store;\n\t } else if (options.parent && options.parent.$store) {\n\t this.$store = options.parent.$store;\n\t }\n\t }", "function vuexInit () {\n\t var op...
[ "0.7633308", "0.7633308", "0.7633308", "0.7599646", "0.7563388", "0.75453377", "0.753497", "0.75165796", "0.75165796", "0.75165796", "0.75165796", "0.75165796", "0.7514896", "0.7492693" ]
0.7481329
96
make localized dispatch, commit, getters and state if there is no namespace, just use root ones
function makeLocalContext (store, namespace, path) { var noNamespace = namespace === ''; var local = { dispatch: noNamespace ? store.dispatch : function (_type, _payload, _options) { var args = unifyObjectStyle(_type, _payload, _options); var payload = args.payload; var options = args.options...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function NamespaceContext(){\n this.ns = null; //full namespace string e.g. www.bond.co.uk/jsocs/something\n this.type_ = {}; //e.g. type_[mytype] types referenceable by rulesets in this or parent context\n //this.rootRuleSet = null; //tree of RuleSets NOT USED?\n this.ns_ = {}; //e.g. ns_[prefix] = {other ...
[ "0.5412821", "0.53446436", "0.53051376", "0.52836347", "0.5190801", "0.5190801", "0.5190801", "0.5190801", "0.5190801", "0.5190801", "0.5190801", "0.5190801", "0.5178219", "0.5172645", "0.514954", "0.514877", "0.51378363", "0.51378363", "0.51378363", "0.5132862", "0.5113005",...
0.0
-1
update game and player object each turn
playTurn(data) { let user; let opp; this.players.map(x => { if (x.name === data.name) { user = x; } if (x.name !== data.name) { opp = x; } }); // client player if (user.name === data.name) { user.setCurrentTurn(false); user.updateScore(data.total); user.updateMovesPlayed(); t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateGame(){\n //Update state of objectives\n this.isObjectiveTaken();\n //Update if game is over \n this.isOver();\n\n //check whether game is over\n if(!this.gameOver){\n //updates all players data\n this.updatePlayers();\n }\n }", "upd...
[ "0.77651316", "0.7460796", "0.7348769", "0.7200106", "0.7167684", "0.71522814", "0.7109813", "0.71042436", "0.7073093", "0.705383", "0.70361584", "0.7031842", "0.69805163", "0.69566655", "0.6946694", "0.69454885", "0.6939658", "0.6934462", "0.6928848", "0.6923866", "0.6923611...
0.0
-1
shows the questions and choices
function showQuestions() { DOMSelectors.quizQuestion.innerHTML = questions[index].question; DOMSelectors.choice1.innerHTML = questions[index].choices[0]; DOMSelectors.choice2.innerHTML = questions[index].choices[1]; DOMSelectors.choice3.innerHTML = questions[index].choices[2]; DOMSelectors.choice4.innerHTML =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showQuestions() {\n $(questionText).text(quizObject[index].question);\n $(optionA).text(quizObject[index].answerA);\n $(optionB).text(quizObject[index].answerB);\n $(optionC).text(quizObject[index].answerC);\n $(optionD).text(quizObject[index].answerD);\n }", "display() {\n docume...
[ "0.7613717", "0.7460673", "0.7372236", "0.72802925", "0.72685486", "0.7194401", "0.7171393", "0.71692646", "0.71297264", "0.71039265", "0.7097073", "0.7046513", "0.7021019", "0.7005678", "0.69982654", "0.69955456", "0.69840056", "0.6981902", "0.6970707", "0.6963044", "0.69606...
0.76130915
1
`STANDARD` Modifies a schema object property to be `readonly` and `optional`.
ReadonlyOptional(item) { return { ...item, modifier: exports.ReadonlyOptionalModifier }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Required(schema, options = {}) {\r\n const next = { ...clone(schema), ...options };\r\n next.required = Object.keys(next.properties);\r\n for (const key of Object.keys(next.properties)) {\r\n const property = next.properties[key];\r\n switch (property.modifier) {\r\n ...
[ "0.6394612", "0.61462444", "0.5860987", "0.5817356", "0.56363064", "0.56103444", "0.55525595", "0.5471594", "0.5434034", "0.5400868", "0.53817284", "0.53660214", "0.53601336", "0.53493524", "0.53043497", "0.52171105", "0.51620775", "0.5131353", "0.51095283", "0.50852925", "0....
0.5617666
5
`STANDARD` Modifies a schema object property to be `readonly`.
Readonly(item) { return { ...item, modifier: exports.ReadonlyModifier }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get readonly() { return this._readonly; }", "set readOnly(value) {\n this._readonly = value;\n }", "enable() {\n this._readonly = false;\n }", "function readOnlyAttr (obj, name, value) {\n Object.defineProperty(obj, name, {\n value: value,\n writable: false\n })\n}", "get read...
[ "0.6556151", "0.6547126", "0.6516339", "0.6419973", "0.6385888", "0.6236534", "0.620631", "0.61970776", "0.59227675", "0.58914167", "0.57813257", "0.5750828", "0.5721052", "0.564661", "0.5639677", "0.5629985", "0.5617027", "0.5547171", "0.5531904", "0.5517409", "0.55013305", ...
0.5584821
17
`STANDARD` Modifies a schema object property to be `optional`.
Optional(item) { return { ...item, modifier: exports.OptionalModifier }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function optional(schema) {\n return {\n type: function () { return \"Optional<\" + schema.type() + \">\"; },\n validateBeforeMap: function (value, ctxt) {\n return value === undefined ? [] : schema.validateBeforeMap(value, ctxt);\n },\n validateBeforeUnmap: function (valu...
[ "0.61270493", "0.5895139", "0.5859327", "0.5849425", "0.5844301", "0.55605674", "0.55605674", "0.55579513", "0.55547035", "0.5460868", "0.53286266", "0.5282339", "0.5277152", "0.5277152", "0.5252163", "0.52406096", "0.51988834", "0.51128983", "0.50899786", "0.50427955", "0.50...
0.47236174
39
`STANDARD` Creates a Tuple schema.
Tuple(items, options = {}) { const additionalItems = false; const minItems = items.length; const maxItems = items.length; return (items.length > 0) ? { ...options, kind: exports.TupleKind, type: 'array', items, additionalItems, minItems, maxItems } : { ...op...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tuple() {\n var typeSpec = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n typeSpec[_i] = arguments[_i];\n }\n return new TTuple(typeSpec.map(function (t) { return parseSpec(t); }));\n}", "constructor(elements) {\n super();\n /**\n * The type name identif...
[ "0.6072262", "0.5872986", "0.58613706", "0.56599456", "0.55992424", "0.5586098", "0.53369284", "0.5260751", "0.516854", "0.5124725", "0.506848", "0.50228477", "0.50228477", "0.5016716", "0.49999428", "0.4860158", "0.48485577", "0.47590232", "0.47480473", "0.4742548", "0.47189...
0.49141207
15
`STANDARD` Creates a `object` schema with the given properties.
Object(properties, options = {}) { const property_names = Object.keys(properties); const optional = property_names.filter(name => { const candidate = properties[name]; return (candidate.modifier && (candidate.modifier === exports.OptionalModifier || ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "create (props) {\n const { clone, dynamic } = props || {}\n Schema.prototype.create.call(this, props)\n setKeyAndName(this, clone, dynamic)\n }", "static get jsonSchema() {\n return {\n type: 'object',\n required: ['firstName', 'lastName'],\n\n properties: {\n ...
[ "0.62933034", "0.6073984", "0.57733715", "0.56888574", "0.56834686", "0.5662079", "0.56430405", "0.56045413", "0.55871123", "0.5527106", "0.5456112", "0.54336256", "0.5401518", "0.5401518", "0.53496534", "0.5341427", "0.5337949", "0.53114027", "0.52992827", "0.5298313", "0.52...
0.64024585
0
`STANDARD` Creates an intersection schema. Note this function requires draft `201909` to constrain with `unevaluatedProperties`.
Intersect(items, options = {}) { return { ...options, kind: exports.IntersectKind, type: 'object', allOf: items }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "intersect (table) {\n this._add(table, 'INTERSECT');\n }", "intersect_all (table) {\n this._add(table, 'INTERSECT ALL');\n }", "function schema (predicates, obj) {\n\t return all(obj, predicates)\n\t}", "function intersection() {\n var typeSpec = [];\n for (var _i = 0; _i < arguments.l...
[ "0.4570576", "0.4520335", "0.45064655", "0.44995007", "0.4433934", "0.4433934", "0.43434483", "0.43241334", "0.4282645", "0.42492568", "0.42462975", "0.42451864", "0.4231231", "0.4193606", "0.41809738", "0.41632465", "0.41398537", "0.41333273", "0.41210434", "0.41210434", "0....
0.48471075
0
`STANDARD` Creates a Union schema.
Union(items, options = {}) { return { ...options, kind: exports.UnionKind, anyOf: items }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseUnionTypeDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('union');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n const types = this.parseUnionMemberTypes();\n return this.node(star...
[ "0.6010315", "0.59604955", "0.59209883", "0.59209883", "0.5683643", "0.5643874", "0.56211454", "0.5616796", "0.5516233", "0.5486258", "0.5451121", "0.54492027", "0.54482204", "0.54482204", "0.54482204", "0.54482204", "0.54482204", "0.54461807", "0.54461807", "0.54208297", "0....
0.5271482
29
`STANDARD` Creates an `Array` schema.
Array(items, options = {}) { return { ...options, kind: exports.ArrayKind, type: 'array', items }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function create(array) {\n return array || [];\n}", "function array(typeSpec) { return new TArray(parseSpec(typeSpec)); }", "function array(typeSpec) { return new TArray(parseSpec(typeSpec)); }", "function Array() {}", "static get schema() {\n return {\n name: { type: 'string' },\n version: {...
[ "0.60039485", "0.59501266", "0.59501266", "0.58993757", "0.58778447", "0.584615", "0.5823406", "0.57794756", "0.5767193", "0.57643837", "0.57335097", "0.57211566", "0.57052577", "0.56446266", "0.5618235", "0.55409276", "0.55409276", "0.5500262", "0.5499846", "0.54641354", "0....
0.59125805
3
`STANDARD` Creates an `Enum` schema from a TypeScript `enum` definition.
Enum(item, options = {}) { const values = Object.keys(item).filter(key => isNaN(key)).map(key => item[key]); const anyOf = values.map(value => typeof value === 'string' ? { type: 'string', const: value } : { type: 'number', const: value }); return { ...options, kind: exports.EnumKind, anyOf }...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseEnumTypeDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('enum');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n const values = this.parseEnumValuesDefinition();\n return this.node(s...
[ "0.65902615", "0.63627595", "0.6241217", "0.6174303", "0.61742204", "0.61742204", "0.6171461", "0.6161932", "0.6159961", "0.6155898", "0.61368483", "0.61368483", "0.61368483", "0.61368483", "0.61368483", "0.6078615", "0.59082496", "0.5808347", "0.5766464", "0.5766464", "0.576...
0.5342807
41
`STANDARD` Creates a literal schema. Supports `string | number | boolean` values.
Literal(value, options = {}) { return { ...options, kind: exports.LiteralKind, const: value, type: typeof value }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function boolStrNum() {\n return {\n type: [Boolean, String, Number],\n default: false\n };\n}", "function boolStrNum() {\n return {\n type: [Boolean, String, Number],\n default: false\n };\n}", "function boolStrNum() {\n return {\n type: [Boolean, String, Number],\n default: false\n };...
[ "0.5607602", "0.5607602", "0.5607602", "0.5607602", "0.5607602", "0.519142", "0.51513225", "0.50507146", "0.49490747", "0.49131688", "0.4891044", "0.48517394", "0.48128995", "0.48035303", "0.48035303", "0.48035303", "0.47842547", "0.47664478", "0.4705163", "0.46748447", "0.46...
0.5301735
5
`STANDARD` Creates a `string` schema.
String(options = {}) { return { ...options, kind: exports.StringKind, type: 'string' }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static string(options) {\n return new GraphqlType(schema_base_1.Type.STRING, options);\n }", "schema() { }", "function StringType(typeSpec) {\n if (Object.keys(typeSpec).length > 0) {\n throw new Error('StringType can not be customized');\n }\n}", "defineSchema() {\n\n }", "static get sch...
[ "0.60831064", "0.577871", "0.56763303", "0.5548425", "0.54405844", "0.53357756", "0.52693564", "0.52693564", "0.5251186", "0.52494615", "0.5234408", "0.5234299", "0.5234299", "0.5234299", "0.5234299", "0.5234299", "0.51677686", "0.51677686", "0.515017", "0.515017", "0.515017"...
0.577696
2
`STANDARD` Creates a `string` schema from a regular expression.
RegEx(regex, options = {}) { return this.String({ ...options, pattern: regex.source }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "toRegex() {\n }", "function regexVar(str) {\n\n\tlet re = new RegExp(/^([aeiou]).\\+1$/);\n\treturn re;\n\n}", "function matches(regex) {\n var res = function (val) {\n regex.lastIndex = 0;\n return (0, isString_1.default)(val) && regex.test(val);\n };\n res.assert = (0, assert_1.defaul...
[ "0.55497986", "0.53754485", "0.5350271", "0.5275799", "0.52351344", "0.51894313", "0.515279", "0.51436245", "0.5096049", "0.5092542", "0.5092542", "0.5092542", "0.5084615", "0.5074711", "0.5050404", "0.5031671", "0.5031671", "0.5031671", "0.50228107", "0.502258", "0.502192", ...
0.5783779
0
`STANDARD` Creates a `number` schema.
Number(options = {}) { return { ...options, kind: exports.NumberKind, type: 'number' }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function number() {\n return struct(`number`, value => {\n return typeof value === 'number' && !isNaN(value);\n });\n}", "function number() {\n return struct(`number`, value => {\n return typeof value === 'number' && !isNaN(value);\n });\n}", "function strNum() {\n return {\n type: [String, Numbe...
[ "0.5699268", "0.5699268", "0.5558848", "0.5558848", "0.5558848", "0.5507466", "0.5483682", "0.5483682", "0.5483682", "0.5467558", "0.5440262", "0.5425918", "0.53902644", "0.53902644", "0.53902644", "0.53902644", "0.5373641", "0.5354998", "0.5350724", "0.5339907", "0.5309877",...
0.5921664
0
`STANDARD` Creates a `integer` schema.
Integer(options = {}) { return { ...options, kind: exports.IntegerKind, type: 'integer' }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static int(options) {\n return new GraphqlType(schema_base_1.Type.INT, options);\n }", "static get netScheme() {\n return Object.assign({\n inputId: { type: Serializer.TYPES.INT32 }\n }, super.netScheme);\n }", "static get netScheme() {\n return Object.assign({\n ...
[ "0.6103856", "0.58867383", "0.58867383", "0.57783335", "0.55257285", "0.5301523", "0.52630055", "0.5226428", "0.5108683", "0.5101384", "0.5083552", "0.50647503", "0.5056852", "0.5026186", "0.49307108", "0.49307108", "0.49307108", "0.49232945", "0.48599362", "0.48484764", "0.4...
0.62373716
0
`STANDARD` Creates a `boolean` schema.
Boolean(options = {}) { return { ...options, kind: exports.BooleanKind, type: 'boolean' }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static boolean(options) {\n return new GraphqlType(schema_base_1.Type.BOOLEAN, options);\n }", "function boolean() {\n return struct('boolean', value => {\n return typeof value === 'boolean';\n });\n}", "function boolean() {\n return struct('boolean', value => {\n return typeof value === 'bo...
[ "0.6960398", "0.67695284", "0.67695284", "0.6445824", "0.6362801", "0.62225527", "0.600298", "0.57680464", "0.57596505", "0.57379097", "0.57322216", "0.5645317", "0.5645317", "0.5645317", "0.5645317", "0.5645317", "0.5645317", "0.5645317", "0.5645317", "0.5645317", "0.5645317...
0.68197423
1
`STANDARD` Creates a `null` schema.
Null(options = {}) { return { ...options, kind: exports.NullKind, type: 'null' }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "empty( data = {}, optional_data = null ) {\n if ( !this.modelDefinition ) {\n return null\n }\n\n if ( !( this.modelDefinition.schema && this.modelDefinition.schema.create ) ) {\n return null\n }\n\n this._check_required_create_arg( data );\n\n let payload = this.modelDefinition.schema....
[ "0.66328377", "0.62883854", "0.613641", "0.6004274", "0.5874818", "0.5711806", "0.54300815", "0.5416762", "0.528879", "0.5265356", "0.51539624", "0.51045144", "0.50929844", "0.50824326", "0.50824326", "0.50824326", "0.5048264", "0.5048264", "0.5048264", "0.5048264", "0.504826...
0.53764546
8
`STANDARD` Creates an `unknown` schema.
Unknown(options = {}) { return { ...options, kind: exports.UnknownKind }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static get schema() {\n return {};\n }", "schema() { }", "defineSchema() {\n\n }", "empty( data = {}, optional_data = null ) {\n if ( !this.modelDefinition ) {\n return null\n }\n\n if ( !( this.modelDefinition.schema && this.modelDefinition.schema.create ) ) {\n return null\n }\...
[ "0.61915976", "0.61658204", "0.6108186", "0.59430164", "0.5883143", "0.57971555", "0.568067", "0.5668073", "0.55965406", "0.54994255", "0.54894894", "0.53572243", "0.5248223", "0.523354", "0.5201599", "0.51951915", "0.51951915", "0.51951915", "0.51951915", "0.51951915", "0.51...
0.0
-1
`STANDARD` Creates an `any` schema.
Any(options = {}) { return { ...options, kind: exports.AnyKind }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "defineSchema() {\n\n }", "static get schema() {\n return {};\n }", "schema() { }", "empty( data = {}, optional_data = null ) {\n if ( !this.modelDefinition ) {\n return null\n }\n\n if ( !( this.modelDefinition.schema && this.modelDefinition.schema.create ) ) {\n return null\n }\...
[ "0.63793874", "0.63003635", "0.61861455", "0.5745691", "0.567466", "0.5632151", "0.56175625", "0.56097853", "0.5481631", "0.547176", "0.54605424", "0.5414038", "0.54132736", "0.5372618", "0.5340032", "0.53300905", "0.5307463", "0.528327", "0.52826893", "0.5244737", "0.5175705...
0.4853406
87
`STANDARD` Creates a `keyof` schema.
KeyOf(schema, options = {}) { const keys = Object.keys(schema.properties); return { ...options, kind: exports.KeyOfKind, type: 'string', enum: keys }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getKeyDefinition(key) { // eslint-disable-line class-methods-use-this\n return {};\n }", "function KeyValue() {}", "function KeyValue() {}", "function KeyValue() {}", "generateSchema() {\n const that = this;\n\n _.keys(this).forEach(function(k) {\n if (_.startsWith(k, '_')) {\n return...
[ "0.57124645", "0.5328641", "0.5328641", "0.5328641", "0.51927286", "0.51865155", "0.516567", "0.516567", "0.510173", "0.5079206", "0.49071315", "0.48937258", "0.48462182", "0.47525665", "0.46744117", "0.46689066", "0.46542442", "0.46205616", "0.4610988", "0.46074054", "0.4606...
0.6554167
0
`STANDARD` Creates a `Record` schema.
Record(key, value, options = {}) { const pattern = key.kind === exports.UnionKind ? `^${key.anyOf.map((literal) => literal.const).join('|')}$` : key.kind === exports.NumberKind ? '^(0|[1-9][0-9]*)$' : key.pattern ? key.pattern : '^.*$'; return { ...options, kind: exports....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "create(newRecord: Object) {\n // Asserting all values in record are valid\n if (!this._assertRecordValid(newRecord)) {\n return\n }\n\n // Asserting store is a server store\n if (this.crudStore.type === 'server') {\n // Executing record create action to server\n this.crudStore.execute...
[ "0.6156596", "0.614052", "0.6117758", "0.5985527", "0.59729743", "0.5953276", "0.5888347", "0.58468163", "0.5801153", "0.57910365", "0.55935645", "0.55935645", "0.55935645", "0.5540459", "0.5538978", "0.55313104", "0.54864013", "0.54864013", "0.54864013", "0.5475341", "0.5473...
0.5071348
42
`STANDARD` Make all properties in schema object required.
Required(schema, options = {}) { const next = { ...clone(schema), ...options }; next.required = Object.keys(next.properties); for (const key of Object.keys(next.properties)) { const property = next.properties[key]; switch (property.modifier) { case e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static get jsonSchema () {\n return {\n type: 'object',\n required: ['name']\n };\n }", "Strict(schema, options = {}) {\r\n return JSON.parse(JSON.stringify({ ...options, ...schema }));\r\n }", "static get schema() {\n return {};\n }", "static get jsonSchema() {\n return {\n...
[ "0.594695", "0.5851071", "0.58335346", "0.58086556", "0.5795465", "0.5754022", "0.56781584", "0.5672373", "0.5664372", "0.56370074", "0.56202304", "0.5605405", "0.55612975", "0.5453238", "0.54524815", "0.54524815", "0.5451847", "0.54438484", "0.5389561", "0.5383303", "0.53708...
0.67131716
0
`STANDARD` Make all properties in schema object optional.
Partial(schema, options = {}) { const next = { ...clone(schema), ...options }; delete next.required; for (const key of Object.keys(next.properties)) { const property = next.properties[key]; switch (property.modifier) { case exports.ReadonlyOptionalMo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Required(schema, options = {}) {\r\n const next = { ...clone(schema), ...options };\r\n next.required = Object.keys(next.properties);\r\n for (const key of Object.keys(next.properties)) {\r\n const property = next.properties[key];\r\n switch (property.modifier) {\r\n ...
[ "0.626798", "0.60549897", "0.59916365", "0.5953716", "0.56005204", "0.54749405", "0.54397136", "0.5379166", "0.53425425", "0.5320985", "0.52979124", "0.5241773", "0.5226836", "0.52091545", "0.5199227", "0.5199227", "0.51810235", "0.51053035", "0.50981826", "0.50937575", "0.50...
0.58585656
4
`STANDARD` Picks property keys from the given object schema.
Pick(schema, keys, options = {}) { const next = { ...clone(schema), ...options }; next.required = next.required ? next.required.filter((key) => keys.includes(key)) : undefined; for (const key of Object.keys(next.properties)) { if (!keys.includes(key)) delete next...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "KeyOf(schema, options = {}) {\r\n const keys = Object.keys(schema.properties);\r\n return { ...options, kind: exports.KeyOfKind, type: 'string', enum: keys };\r\n }", "function isSingleProperty (schema) {\n\t if ('type' in schema) {\n\t return typeof schema.type === 'string';\n\t }\n\t ret...
[ "0.6053809", "0.5359622", "0.53352547", "0.53276736", "0.5326462", "0.5295319", "0.5206774", "0.5191272", "0.5183147", "0.51709604", "0.51709604", "0.51585007", "0.51261085", "0.5093136", "0.5093136", "0.5087366", "0.5074404", "0.5037976", "0.50366026", "0.50198597", "0.49899...
0.52478397
6
`STANDARD` Omits property keys from the given object schema.
Omit(schema, keys, options = {}) { const next = { ...clone(schema), ...options }; next.required = next.required ? next.required.filter((key) => !keys.includes(key)) : undefined; for (const key of Object.keys(next.properties)) { if (keys.includes(key)) delete next...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Pick(schema, keys, options = {}) {\r\n const next = { ...clone(schema), ...options };\r\n next.required = next.required ? next.required.filter((key) => keys.includes(key)) : undefined;\r\n for (const key of Object.keys(next.properties)) {\r\n if (!keys.includes(key))\r\n ...
[ "0.60843056", "0.59514326", "0.587922", "0.58553976", "0.58361363", "0.58361363", "0.58361363", "0.58361363", "0.58361363", "0.58361363", "0.58361363", "0.58361363", "0.58361363", "0.5818411", "0.5782833", "0.5759965", "0.5759965", "0.5732496", "0.5690438", "0.56687915", "0.5...
0.6801417
0
`STANDARD` Omits the `kind` and `modifier` properties from the given schema.
Strict(schema, options = {}) { return JSON.parse(JSON.stringify({ ...options, ...schema })); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Partial(schema, options = {}) {\r\n const next = { ...clone(schema), ...options };\r\n delete next.required;\r\n for (const key of Object.keys(next.properties)) {\r\n const property = next.properties[key];\r\n switch (property.modifier) {\r\n case exports.R...
[ "0.5937533", "0.5839702", "0.56881076", "0.5665703", "0.556097", "0.51835907", "0.5172951", "0.5142317", "0.5142317", "0.5024318", "0.4992108", "0.49777797", "0.49717754", "0.48765406", "0.48447284", "0.48339245", "0.47993606", "0.46936473", "0.4676748", "0.4676748", "0.46767...
0.54454523
5
`EXTENDED` Creates a `constructor` schema.
Constructor(args, returns, options = {}) { return { ...options, kind: exports.ConstructorKind, type: 'constructor', arguments: args, returns }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "create (props) {\n const { clone, dynamic } = props || {}\n Schema.prototype.create.call(this, props)\n setKeyAndName(this, clone, dynamic)\n }", "function Constructor() {}", "function Constructor() {}", "function Constructor() {}", "function construct() { }", "schema() { }", "defineSchema() ...
[ "0.6469222", "0.6198695", "0.6198695", "0.6198695", "0.6168278", "0.61139274", "0.60802495", "0.5897244", "0.5838832", "0.58343655", "0.58158773", "0.5812413", "0.57984775", "0.5727404", "0.57213753", "0.5657933", "0.56563574", "0.56563574", "0.5640992", "0.56296957", "0.5622...
0.5570339
59
`EXTENDED` Creates a `function` schema.
Function(args, returns, options = {}) { return { ...options, kind: exports.FunctionKind, type: 'function', arguments: args, returns }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function schema(schema_fn) {\n\t\treturn valid_schema(new schema_fn());\n\t}", "FunctionDeclaration() {\n pushContext();\n }", "function functionDeclaration() {}", "defineSchema() {\n\n }", "function _exec_funcdef(ast, context, debug) {\n var FRecord = new ObjectClass.SF...
[ "0.58898675", "0.57361907", "0.57263964", "0.552323", "0.54343903", "0.5409739", "0.5350266", "0.53478515", "0.5340988", "0.53125584", "0.5309346", "0.5267209", "0.5252183", "0.5252183", "0.5252183", "0.52171695", "0.52171695", "0.5149846", "0.5123284", "0.50954664", "0.50641...
0.5115345
19
`EXTENDED` Creates a `Promise` schema.
Promise(item, options = {}) { return { ...options, type: 'promise', kind: exports.PromiseKind, item }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "deferred() {\n const struct = {}\n struct.promise = new MyPromise((resolve, reject) => {\n struct.resolve = resolve\n struct.reject = reject\n })\n return struct\n }", "function Promise() { return {\n\n\t/**\n\t * Add callback to be called when the promise is resolved, reject...
[ "0.6319328", "0.583082", "0.57778096", "0.57156044", "0.56774104", "0.5608088", "0.55674106", "0.5417132", "0.54009956", "0.536792", "0.53555506", "0.52972937", "0.5272243", "0.5254824", "0.52498513", "0.52387637", "0.5219867", "0.52086467", "0.5206417", "0.51910704", "0.5191...
0.55691034
6
`EXTENDED` Creates a `undefined` schema.
Undefined(options = {}) { return { ...options, type: 'undefined', kind: exports.UndefinedKind }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static get schema() {\n return {};\n }", "schema() { }", "createSchema() {\n this.schema = this.extensionManager.schema;\n }", "defineSchema() {\n\n }", "empty( data = {}, optional_data = null ) {\n if ( !this.modelDefinition ) {\n return null\n }\n\n if ( !( this.modelDefinition.s...
[ "0.6677496", "0.6500046", "0.644879", "0.6410124", "0.64023125", "0.6286095", "0.6220855", "0.6050352", "0.597582", "0.59395736", "0.5840488", "0.5840488", "0.58350027", "0.5797582", "0.5797582", "0.5792178", "0.56672186", "0.5603387", "0.56009984", "0.5600254", "0.5600254", ...
0.0
-1
`EXTENDED` Creates a `void` schema.
Void(options = {}) { return { ...options, type: 'void', kind: exports.VoidKind }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "defineSchema() {\n\n }", "schema() { }", "void() {\n return {};\n }", "empty( data = {}, optional_data = null ) {\n if ( !this.modelDefinition ) {\n return null\n }\n\n if ( !( this.modelDefinition.schema && this.modelDefinition.schema.create ) ) {\n return null\n }\n\n ...
[ "0.55866665", "0.5307304", "0.5241835", "0.5228925", "0.5204898", "0.5013034", "0.49591792", "0.48568466", "0.48075402", "0.47353965", "0.47227788", "0.4715414", "0.46791074", "0.46779072", "0.46774265", "0.46765926", "0.46765926", "0.46723595", "0.4640419", "0.46192524", "0....
0.56307805
0
`EXPERIMENTAL` Creates a recursive type.
Rec(callback, options = {}) { const $id = options.$id || ''; const self = callback({ $ref: `${$id}#/definitions/self` }); return { ...options, $ref: `${$id}#/definitions/self`, definitions: { self } }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function TypeRecursion() {}", "function buildWrappedType(innerType, inputTypeNode) {\n if (inputTypeNode.kind === Kind.LIST_TYPE) {\n return new _definition.GraphQLList(buildWrappedType(innerType, inputTypeNode.type));\n }\n if (inputTypeNode.kind === Kind.NON_NULL_TYPE) {\n var wrappedType = buildWrapp...
[ "0.7529868", "0.5697415", "0.5697415", "0.5585226", "0.54223245", "0.5377622", "0.5367001", "0.5355573", "0.5277684", "0.5261573", "0.52564806", "0.52564806", "0.52017903", "0.5200172", "0.5200172", "0.518456", "0.51576126", "0.5128939", "0.5118572", "0.50830275", "0.50731105...
0.0
-1
`EXPERIMENTAL` References a schema.
Ref(...args) { const $id = args[0]['$id'] || ''; const key = args[1]; return (args.length === 2) ? { $ref: `${$id}#/definitions/${key}` } : { $ref: $id }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "schema() { }", "defineSchema() {\n\n }", "setSchema(schema) {\n this.schema = schema;\n }", "setSchema(schema) {\n this.schema = schema;\n }", "function schema(schema_fn) {\n\t\treturn valid_schema(new schema_fn());\n\t}", "static get schema() {\n return {};\n }", "function isReference(s...
[ "0.7019886", "0.67952996", "0.66280216", "0.66280216", "0.6467315", "0.6432447", "0.6347548", "0.6183436", "0.61678135", "0.6096981", "0.60111207", "0.59887296", "0.59873945", "0.59582704", "0.59582704", "0.5937094", "0.584124", "0.5818572", "0.57877314", "0.57846296", "0.575...
0.0
-1
Deal function to activate on click of bet amounts
function deal(playerbet) { //check to be sure player has $ for bet if(playerbet > money){ document.getElementById("message").innerHTML = "Not enough money!"; return true; } deck = []; dealercards = []; playercards = []; //pulls 2 cards for each dealer and player pullcard(0); pullcard(0); pullcar...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "placeBet() {\n $(\"#bet\").on(\"click\", () => {\n if (this.currentBet > 0) {\n this.deal();\n this.afterPlaceBet();\n this.checkPlayerBlackjack();\n if(this.dealerHand[0].icon !== \"ace\"){\n this.checkDealerBlackjack...
[ "0.73307973", "0.70682967", "0.6999896", "0.68194216", "0.6781312", "0.66723704", "0.659116", "0.6552224", "0.650762", "0.6478265", "0.64229375", "0.6375461", "0.6365922", "0.6362853", "0.634279", "0.63184804", "0.6284661", "0.6245565", "0.624095", "0.6181628", "0.6140051", ...
0.0
-1
draws card for dealer (0) or player (1)
function pullcard(playernum) { var keepgoing = true; var cardpull; var suit; var value = 0; //checks deck isnt empty if (deck.length < 52) { while (keepgoing) { cardpull = Math.floor((Math.random() * 52) + 1); keepgoing = false; //checks to see if that card has been played for (i = 0; i ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function draw() {\n if(deck.length>0) {\n addCardToHand(deck.pop() );\n updateCard('forge', 0); // not necessairly, might be another revealed card...\n }\n if(deck.length==0) {\n updateCard('forge', 'none');\n }\n}", "function drawCard(player)\n{\n\tconsole.log(\"Drawing a card\");\n\tvar key = Obje...
[ "0.7347449", "0.7255754", "0.72353333", "0.7205705", "0.714485", "0.7110967", "0.70944744", "0.68211895", "0.67634714", "0.67599535", "0.6664332", "0.6644521", "0.6642607", "0.6636265", "0.6616979", "0.6616055", "0.66135836", "0.66135836", "0.6605955", "0.65926635", "0.658318...
0.0
-1
double down button (double bet, one more card then stand)
function doubledown() { //checks if can afford if(money < bet){ document.getElementById("message").innerHTML = "Not enough money to double down!"; return true; } //takes bet out of money, doubles bet, gives card, stands money -= bet; bet *= 2; hit(); stand(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "doubleDown() {\n this.money -= betAmount;\n betAmount *= 2;\n return this.addCards(1);\n }", "function doubleDown () {\n if (bet * 2 <= bank) {\n bank -= bet;\n bet *= 2;\n betMemo = bet;\n } else {\n bet += bank;\n bank = 0;\n betMemo = bet;\n }\n refreshBetHUD();\n\n $(...
[ "0.78509754", "0.7488192", "0.6684776", "0.657552", "0.6566717", "0.6396953", "0.6380879", "0.6367349", "0.63283867", "0.62960786", "0.6293945", "0.6285297", "0.6263519", "0.6249795", "0.6233561", "0.62076133", "0.616268", "0.61624324", "0.61616254", "0.61535305", "0.61327416...
0.7477365
2
dictates dealer play (pull card when under 17)
function dealerplay() { while (calcscore(dealercards) < 17) { pullcard(0); } document.getElementById("dealerscore").innerHTML = calcscore(dealercards); document.getElementById("dealercards").innerHTML = drawcards(dealercards, dealersuits); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ComputerPlay()\n {\n let randomChance = Math.random();\n if(randomChance<0.20)\n {\n dealerCardPlayed = dealerHand.cards[0].choice;\n }\n else if(randomChance<0.4&&randomChance>0.2)\n {\n dealerCardPlaye...
[ "0.66707194", "0.65293336", "0.6403831", "0.63194364", "0.63045156", "0.63034964", "0.62589717", "0.6167954", "0.6058208", "0.6008681", "0.5998382", "0.59777373", "0.59763277", "0.5975736", "0.5965981", "0.5959491", "0.5951798", "0.5936813", "0.59313154", "0.59142745", "0.591...
0.63122535
4
checks scored based on array of cards
function calcscore(cards) { var aces = 0; var endscore = 0; //count and check if ace for (i = 0; i < cards.length; i++) { if (cards[i] == 1 && aces == 0) { aces++; } else { //if it's not an ace if (cards[i] >= 10) { endscore += 10; } else { endscore += cards[i]; } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "acesCheck(hand) {\n\n // let newHandTotal = this.state.\n\n // //hand has an ace and point total is over 21\n // if( ) {\n // hand.total -= 10;\n // }\n \n // return newHandTotal;\n \n \n let testArray = [\n {\n id: ...
[ "0.69883853", "0.68706673", "0.6806259", "0.67545235", "0.67543775", "0.66964513", "0.6655571", "0.6641777", "0.6598614", "0.6482403", "0.6381121", "0.63170666", "0.630058", "0.6249799", "0.62441725", "0.6224411", "0.62033814", "0.6173056", "0.6168504", "0.61630243", "0.61497...
0.6647679
7
ascii drawing of card in 5 lines (1top, 2value, 3suit, 4value, 5bottom)
function drawcards(cards, suits) { var lines = ["", "", "", "", ""]; var value = []; if (cards.length == 1) { //if only one card is passed we draw the first card face down lines = [".---.", "|///|", "|///|", "|///|", "'---'"]; } //topline for (i = 0; i < cards.length; i++) { lines[0] += ".---."; }...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cardOutput(n, x) {\r\n var hpos = (x > 0) ? x * 60 + 100 : 100;\r\n return '<div class=\"icard '+ cards[n].icon +'\" style=\"left: '+hpos+'px;\"><div class=\"card-top-section suit\">'+cards[n].cardnum+'<br></div><div class=\"card-middle-section suit\"></div><div class=\"card-bottom-section s...
[ "0.68177897", "0.64254487", "0.63563347", "0.6350663", "0.63406175", "0.63008934", "0.62662405", "0.6208216", "0.6166984", "0.61430275", "0.6130936", "0.61138684", "0.6106581", "0.6094329", "0.6094033", "0.60934323", "0.6076346", "0.60638356", "0.6048805", "0.60386056", "0.60...
0.79053557
0
makes face cards their correct character instead of their number value from random (1,10,11,12 = ace, jack, queen, king)
function cardvalue(cardnum) { if (cardnum == 1) { return "A"; } if (cardnum == 11) { return "J"; } if (cardnum == 12) { return "Q"; } if (cardnum == 13) { return "K"; } else return cardnum; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function randomizer() {\n buildDeck();\n var index = Math.floor(Math.random() * deck.length); \n\n return \"Your card is **\" + deck[index] + \"**\";\n}", "function randomCard(){\n let randomIndex = Math.floor(Math.random()*13)\n return blackjackGame['cards'][randomIndex]\n}", "function randomCard(){...
[ "0.7030036", "0.6967949", "0.6945638", "0.6940211", "0.6914219", "0.6810975", "0.6771116", "0.676215", "0.6756863", "0.66939557", "0.66869044", "0.6618891", "0.66087943", "0.6608352", "0.6584145", "0.6573416", "0.65592384", "0.6552011", "0.6535336", "0.65288067", "0.6526164",...
0.0
-1
Convert a react internal instance to a sanitized data object.
function getData(internalInstance) { var children = null; var props = null; var state = null; var context = null; var updater = null; var name = null; var type = null; var key = null; var ref = null; var source = null; var text = null; var publicInstance = null; var n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function attachRenderer(hook, rid, renderer) {\n\n\n/**\n * Convert a react internal instance to a sanitized data object.\n */\nvar getData = (function() {\n return function getData(element) {\n var children = null;\n var props = null;\n var state = null;\n var context = null;\n var updater = null;\n var na...
[ "0.5487915", "0.5427521", "0.539943", "0.5378716", "0.5219861", "0.5187951", "0.5178856", "0.51670486", "0.5088217", "0.5088217", "0.4995298", "0.49929965", "0.49839634", "0.49713415", "0.49490482", "0.49362564", "0.49362564", "0.49187425", "0.48963767", "0.4884061", "0.48527...
0.5376543
4
TO DO: replace params from label.. do api call to get the name instead
function FoodEntryFormScreen({ navigation, route }) { const [numberOfServings, setNumberOfServings] = useState(0); const [err, setError] = useState({ numberOfServings: false }); const nutritionData = { label: route.params.item, nutrients: route.params.data, }; async function submit() { if (!isVa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function create_param_label(id, params, category, value){\n const item = params[category][value];\n //gets fields value from item\n const v = (item === Object(item)) ? Object.keys(item)[0] : 'q';\n const label = get_field_by_value(\"label\", v);\n const text = (item === Object(item)) ? Object.values...
[ "0.6700375", "0.661403", "0.65138495", "0.62445873", "0.621447", "0.6171758", "0.61639875", "0.61472994", "0.6087522", "0.60529125", "0.5999068", "0.59842795", "0.5978612", "0.5977131", "0.5966618", "0.5955953", "0.5936346", "0.58987266", "0.58906686", "0.5879759", "0.5874525...
0.0
-1
inserts a new node after a node containing the key
insertAfter(value, itemToInsert){ //find the item after which you want to insert //create node //keep track of node after it //new node tracker will point to that if(!this.head){ return null; } let currNode = this.head; while((currNode !== nu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "insertAfter(key, value) {\n if(this.head === null) {\n this.head = new _Node(value, this.head)\n }\n let currNode = this.head\n while(currNode !== null & currNode.value !== key) {\n currNode = currNode.next\n }\n currNode.next = new _Node(value, currN...
[ "0.80713224", "0.72943634", "0.7228477", "0.7080402", "0.6985557", "0.697695", "0.6957001", "0.69334674", "0.6830836", "0.6817756", "0.67769533", "0.6630389", "0.6617624", "0.6605144", "0.6544288", "0.65409553", "0.6524584", "0.6515479", "0.64591837", "0.6447535", "0.6441908"...
0.6795934
10
return size of the linked lst
function size(lst){ let currentNode = lst.head; let lstSize = 0; if(currentNode) { lstSize = 1; } while (currentNode.next !== null) { currentNode = currentNode.next; lstSize++; } console.log(lstSize); return lstSize; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getLength() {\r\n\t\tlet len = 0;\r\n\t\tlet itr = this.head;\r\n\t\twhile (itr) {\r\n\t\t\tlen++;\r\n\t\t\titr = itr.next;\r\n\t\t}\r\n\t\treturn len;\r\n\t}", "function size(ll) {\n let current = ll.head;\n let next = current.next;\n let count = 0;\n while (next !== null && next.value !== null) {\n coun...
[ "0.8313206", "0.8310912", "0.8301003", "0.8253481", "0.8213658", "0.81883496", "0.81556576", "0.81556576", "0.81556576", "0.81069815", "0.80928487", "0.80700016", "0.79698807", "0.7936826", "0.7814583", "0.7797699", "0.7707593", "0.7700317", "0.76340634", "0.76334167", "0.760...
0.83842546
0
finds if lst is empty or not without using size of function
function isEmpty(lst){ let currentNode = lst.head; if(!currentNode) { return "Empty"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isEmpty(xs) { return Z.size (xs) === 0; }", "function isEmpty(ll) {\n ll.head === null ? console.log('empty') : console.log('not empty');\n}", "function checkListLen() {\n return ul.children.length;\n}", "isEmpty(){ return this.size == 0; }", "function isEmpty(llist) {\n let currNode = llist.he...
[ "0.6931907", "0.67275345", "0.6695211", "0.6592961", "0.65290654", "0.6528468", "0.6505282", "0.6474574", "0.6439713", "0.64175624", "0.64175004", "0.6361953", "0.6339287", "0.6330868", "0.6330868", "0.6330868", "0.6330868", "0.6330868", "0.62996405", "0.62957835", "0.6295783...
0.6381995
11
find node before the item you are looking for
function findPrevious(lst, item) { let currentNode = lst.head; let previousNode = lst.head; while ((currentNode !== null) && (currentNode.value!==item)){ previousNode = currentNode; currentNode = currentNode.next; } console.log(previousNode.value); return previousNode.value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findPrev(item) {\r\n let currNode = this.head;\r\n while(currNode.next.element != item && currNode.next.element != \"head\") {\r\n currNode = currNode.next;\r\n }\r\n if(currNode.next.element == item) {\r\n return currNode;\r\n }\r\n return -1;\r\n }", "function findNodeBefo...
[ "0.71305406", "0.7064585", "0.7064585", "0.69697165", "0.694426", "0.69135725", "0.6904291", "0.68872255", "0.68810457", "0.68267864", "0.68138534", "0.6810364", "0.6747067", "0.67058855", "0.6638352", "0.65501726", "0.65501726", "0.65188533", "0.65188533", "0.65188533", "0.6...
0.607435
45
returns the last node in the linked lst
function findLast(lst){ let currentNode = lst.head; while(currentNode.next !== null) { currentNode = currentNode.next; } console.log(currentNode.value); return currentNode.value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "lastNode(list) {\r\n\t\t\t\t\tif (list.length === 0) {\r\n\t\t\t\t\t\treturn null;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\treturn list[list.length - 1];\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "function findLast() {\n var currNode = this.head;\n \n while (!(currNode.next == null)) {\n currNode = currNode.next;\n ...
[ "0.8362411", "0.8043449", "0.7960096", "0.79459", "0.79459", "0.79459", "0.7810032", "0.7779938", "0.7764271", "0.7751773", "0.7749967", "0.75423044", "0.7521414", "0.73089814", "0.7206942", "0.71679914", "0.7162551", "0.69417685", "0.69417685", "0.6936304", "0.688133", "0....
0.7984862
2
Mystery Program What is the problem trying to solve? What is the runtime of this algorithm?
function WhatDoesThisProgramDo(lst){ let current = lst.head; while(current !== null){ let newNode = current; while (newNode.next !== null) { if (newNode.next.value === current.value) { newNode.next = newNode.next.next; } else{ n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function problem9(){\n console.time('Problem 9 Runtime')\n let tripletProduct = null\n let startingValue = 500\n for(let c = startingValue; c > 2; c--){\n let c2 = c*c\n for(let b = c-1; b > 1; b--){\n let b2 = b*b\n for(let a = b-1; a > 0; a--){\n let...
[ "0.66540396", "0.6571764", "0.6496858", "0.6469749", "0.64493114", "0.64477587", "0.6432905", "0.62764025", "0.61834913", "0.6180669", "0.61705184", "0.6120816", "0.6113633", "0.6085229", "0.60450643", "0.6029619", "0.60290945", "0.60190195", "0.60148615", "0.6005744", "0.600...
0.0
-1
O(n^2) Polynomial time this function runs a loop within a loop. goes to the head of the linked list and places new value Reverse a list Linear algo for reverse linked list
function reverseList(lst) { let result = null; let stack = null; let current = lst.head; while(current) { stack.push(current) current = current.next; } // Set head to end of list. result = stack.pop() || []; current = result; while (current) { curren...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "reverse(){\n let prev = null;\n let current = this.head;\n let next;\n\n while(current != null){\n next = current.next;\n current.next = prev;\n prev = current;\n current = next;\n this.head = prev;\n }\n }", "reverse() ...
[ "0.7307773", "0.7251865", "0.7245355", "0.7154718", "0.71543276", "0.7140206", "0.71391076", "0.7106857", "0.7104084", "0.70733196", "0.706361", "0.7044144", "0.7042974", "0.6987704", "0.6956635", "0.69551855", "0.69426894", "0.69155383", "0.6906618", "0.6886394", "0.68709505...
0.6178837
61
handleNameChange accepts an event that is triggered by an onNameChange attribute in the App.js Playlist component which updates the input elements defaultValue
handleNameChange(e) { this.props.onNameChange(e.target.value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handleNameChange(event){\n this.props.updatePlaylistName(event.target);\n }", "function handleNameChange(e) {\n setName(e.target.value);\n }", "function handleChange(e){\n setNewName(e.target.value);\n }", "function nameInputChanged() {\n setState({ listNameInput: event.target.value ...
[ "0.75348574", "0.73102844", "0.722775", "0.72264946", "0.7110247", "0.70624334", "0.69517976", "0.68728554", "0.68404776", "0.68089104", "0.67891055", "0.67854536", "0.6774793", "0.6742614", "0.66948915", "0.66922474", "0.6672175", "0.6627615", "0.6613777", "0.6611127", "0.65...
0.7034783
6
Tell a Chuck Norris Joke
function chuckJoke() { axios.get('http://api.icndb.com/jokes/random').then(res => { const joke = res.data.value.joke; const params = { icon_emoji: ':laughing:' }; bot.postMessageToChannel('general', `Chuck Norris: ${joke}`, params); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function chuckJoke () {\n\taxios.get('http://api.icndb.com/jokes/random').then((res) => {\n\t\tconst joke = res.data.value.joke;\n\n\t\tconst params = {\n\t\t\ticon_emoji : ':laughing:'\n\t\t};\n\n\t\tbot.postMessageToChannel('general', `Chuck Norris: ${joke}`, params);\n\t});\n}", "function chuckJoke() {\n axi...
[ "0.77625453", "0.7484043", "0.69587445", "0.6862944", "0.68171936", "0.67648184", "0.67286944", "0.6694601", "0.6680489", "0.65364397", "0.6421591", "0.6365103", "0.6359989", "0.6218667", "0.62150073", "0.61422247", "0.61367196", "0.61347806", "0.6089844", "0.6085597", "0.608...
0.741376
2
Tell a Yo Mama Joke
function yoMamaJoke() { axios.get('http://api.yomomma.info').then(res => { const joke = res.data.joke; const params = { icon_emoji: ':laughing:' }; bot.postMessageToChannel('general', `Yo Mama: ${joke}`, params); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function yoMommaJoke () {\n\taxios.get('http://api.yomomma.info').then((res) => {\n\t\tconst joke = res.data.joke;\n\n\t\tconst params = {\n\t\t\ticon_emoji : ':laughing:'\n\t\t};\n\n\t\tbot.postMessageToChannel('general', `Yo Momma: ${joke}`, params);\n\t});\n}", "function yoMamaJoke() {\n axios.get('http://ap...
[ "0.7349824", "0.7343265", "0.67237806", "0.6661337", "0.6646262", "0.6607673", "0.6522651", "0.6495932", "0.64525425", "0.6402387", "0.6370484", "0.63042945", "0.6255777", "0.611364", "0.61107445", "0.6096131", "0.6083504", "0.6074587", "0.6066883", "0.6043141", "0.6009051", ...
0.72931314
2
Tell a Random Joke
function randomJoke() { const rand = Math.floor(Math.random() * 2) + 1; if (rand === 1) { chuckJoke(); } else if (rand === 2) { yoMamaJoke(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function randomJoke() {\n const rand = Math.floor(Math.random() * 2) + 1;\n if (rand === 1) {\n chuckJoke();\n } else if (rand === 2) {\n yoMamaJoke();\n }\n}", "function randomJoke() {\n const rand = Math.floor(Math.random() * 2) +1\n if(rand === 1){\n chuckJoke();\n } else if(rand ===...
[ "0.7658795", "0.7493465", "0.74769974", "0.7103342", "0.6850501", "0.6793707", "0.678462", "0.6756949", "0.663708", "0.65920717", "0.65354234", "0.64801395", "0.6399788", "0.6352826", "0.63422364", "0.6338049", "0.63196814", "0.6315573", "0.6308839", "0.6297401", "0.6287794",...
0.7592577
1
Function to send call to SharePoint, to update iFrame height
function updateIframeHeight(iHeight) { "use strict"; var iFrameURL = oGlobalConstants.Site_Url; iHeight = (iHeight) ? !isNaN(iHeight) ? iHeight + "px" : iHeight : ($(".LeftContent").height() + 230) + "px"; // Adding 230px to incorporate the height of footer window.top.parent.postMessage(iHeight, iFr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateFrame() {\r\n var iframe = parent.document.getElementById(\"iframeHelp\");\r\n var helpModule = iframe.contentWindow.document.getElementById(\"help-module\");\r\n // console.log(\"running updateframeHeight\");\r\n\r\n var newHeight = helpModule.offsetHeight + \"px\";\r\n var newWidth ...
[ "0.6850111", "0.68463665", "0.66972965", "0.6688136", "0.66503257", "0.6625635", "0.6508162", "0.6497894", "0.648413", "0.64058596", "0.6396513", "0.63839275", "0.6369797", "0.62324595", "0.62321275", "0.6191919", "0.6190925", "0.617823", "0.6168857", "0.61632097", "0.6124128...
0.68383056
2
Function to send call to SharePoint, to update scroll to top
function scrollIframeTop() { "use strict"; var iFrameURL = oGlobalConstants.Site_Url; var message = "scrolltop"; window.top.parent.postMessage(message, iFrameURL); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lti_scrollParentToTop() {\n parent.postMessage(JSON.stringify({\n subject: \"lti.scrollToTop\"\n }), \"*\");\n}", "function lti_scrollParentToTop() {\n parent.postMessage(JSON.stringify({\n subject: \"lti.scrollToTop\"\n }), \"*\");\n}", "function scrollUpToTop() {\n \t\tdocument...
[ "0.6680705", "0.6680705", "0.6678703", "0.6635758", "0.6634587", "0.6632491", "0.6597194", "0.65747285", "0.6530549", "0.64525723", "0.6395488", "0.6395488", "0.6395488", "0.6395488", "0.6395488", "0.63831747", "0.63597614", "0.63574934", "0.63241017", "0.6312026", "0.6305631...
0.6269693
27
Function to send call to SharePoint, to update the Query string based upon current view
function updateQueryString() { "use strict"; var sSectionValue = oGridConfig.isMatterView ? "1" : "2"; var message = oGridConfig.sSection + sSectionValue; window.top.parent.postMessage(message, oGlobalConstants.Site_Url); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function query() {\n Purge();\n var parameters = getQueryParameters();\n var urlParameters = objectToURLParameters(parameters);\n console.log(urlParameters);\n\n if (parameters.true == true) {\n console.log(\"Redirect to page here\");\n console...
[ "0.6141495", "0.5796317", "0.5677212", "0.56578237", "0.55946016", "0.55910546", "0.5581797", "0.55759424", "0.55215824", "0.547698", "0.54717165", "0.5439244", "0.54363936", "0.5431555", "0.5430095", "0.5414384", "0.53824425", "0.5357924", "0.53446466", "0.5340163", "0.53390...
0.69144964
0