query
stringlengths
9
14.6k
document
stringlengths
8
5.39M
metadata
dict
negatives
listlengths
0
30
negative_scores
listlengths
0
30
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
HttpClient API post() method => Create ticket API service
createTicket(requestData) { let head = new Headers({ 'Content-Type': 'application/json' }); let ticketCreateApiUrl = "/ticket_management/tickets/?format=json"; return this.http.post(this.apiURL + ticketCreateApiUrl, requestData, this.httpOptions); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createTicket(params) {\n getDomElement('submitModal').innerText = 'Sending feedback...';\n getDomElement('closeModal').style.visibility = 'hidden';\n\n setMouseCursor('wait');\n\n var http = new XMLHttpRequest();\n var url = 'http://localhost:8000/api/post/ticket';\n http.open('POST', ur...
[ "0.73044145", "0.71022964", "0.6786054", "0.67750365", "0.6536244", "0.6489773", "0.61741656", "0.6149243", "0.6136819", "0.6012006", "0.60055035", "0.59881335", "0.5945021", "0.5929234", "0.5929134", "0.58736455", "0.5855036", "0.58190215", "0.58174837", "0.57988393", "0.575...
0.7632309
0
HttpClient API post() method => Add ticket comment API service
addTicketComment(data) { let head = new Headers({ 'Content-Type': 'application/json' }); let ticketCommentCreateApiUrl = "/ticket_management/ticket_comments/?format=json"; return this.http.post(this.apiURL + ticketCommentCreateApiUrl, data, this.httpOptions); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "add(comment, taskId) {\n return this._$http({\n url: `${this._AppConstants.api}/comment`,\n method: 'POST',\n headers: {\n Authorization: this._JWT.get()\n },\n data: { comment: comment, task: taskId }\n }).then((res) => res.data);\n\n }", "createTicket(requestData) {\n ...
[ "0.7051891", "0.69201356", "0.684175", "0.6524745", "0.64914143", "0.64590245", "0.6378622", "0.6349011", "0.6263393", "0.62508667", "0.6250466", "0.6234374", "0.62034744", "0.613996", "0.6138319", "0.6081848", "0.60629976", "0.60580295", "0.6043433", "0.60299194", "0.597129"...
0.7989614
0
====================== Create a function that receives a list of commands These commands will be the first letter of either (f)orward, (r)ight, or (l)eft ======================
function commands(command) { for (var i = 0; i < command.length; i++) { //Use a loop to iterate over the string switch (command[i]) { //write a switch or if statement to call the correct function case 'f': //(f)orward moveForward(); break; case 'r': //(r)ight turnRight(); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function movements (rover) {\n var commands =\"rffrfflfrff\"\n for (var i = 0; i < commands.length; i++) {\n \n if (commands [i] === \"r\") {\n turnRight(rover);\n }\n else if (commands [i] === \"l\") {\n turnLeft(rover);\n }\n else if (commands [i] === \"f\") {\n moveForward(rover);...
[ "0.6701413", "0.6590746", "0.6404254", "0.63029474", "0.6037585", "0.59415674", "0.5933261", "0.58670986", "0.5778929", "0.57053834", "0.5689", "0.5506415", "0.541498", "0.5413634", "0.54044497", "0.5389367", "0.53842103", "0.5381861", "0.5363518", "0.53499603", "0.53446335",...
0.7413257
0
helper method to format release date
function _formatReleaseDate(releaseDate) { if(releaseDate.date) { return releaseDate.date; } else if(releaseDate.quarterTime) { return releaseDate.quarterTime.quarter + '-' + releaseDate.quarterTime.year; } else { return '-'; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function date_format() { }", "formatDate() {\n const date = new Date()\n const day = `0${date.getDate()}`.slice(-2)\n const month = `0${date.getMonth() + 1}`.slice(-2)\n const year = date.getFullYear()\n const dateString = `${year}-${month}-${day}`\n\n return dateString\n }", "function getSc...
[ "0.71290874", "0.6884931", "0.68315756", "0.6795103", "0.6772756", "0.6772756", "0.6767428", "0.67557645", "0.6727195", "0.66675395", "0.66170025", "0.65630764", "0.6497979", "0.6497979", "0.6497979", "0.6497979", "0.6497979", "0.6497979", "0.6497979", "0.64905477", "0.636086...
0.8156248
0
convert competitorPlatforms into matrix format to print in angular.ngrepeat i.e: [[1,2,3], [4,5,6], [7,8,9]];
function matrixData() { //TO DO - THIS IS FIXED IN 'EDIT' BRANCH try{ concept = conceptDataCache.getConcept(); plannedCompetitorPlatforms = (concept) ? concept.proposal.plannedCompetitorPlatforms : conceptCommonServiceConfig.config('competitorPlatforms'); comp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function render() {\n var returns = [], data = conceptProposalServiceConcept.field('proposal.plannedCompetitorPlatforms').value() || [];\n\n data.forEach(angular.bind(this, function(platform) {\n if(platform.selected) {\n var competitorPlatform = {competitorP...
[ "0.631295", "0.6065803", "0.59887064", "0.5933581", "0.5805154", "0.5411192", "0.52998316", "0.5227184", "0.52241546", "0.52178824", "0.5071882", "0.50535434", "0.5028423", "0.49993524", "0.49182463", "0.4882371", "0.48696002", "0.48557228", "0.48330536", "0.4822489", "0.4805...
0.6826655
0
The objective of this test is to create as many smt as possible in order to drastically increase the chances of having a nai collision
async function nai_collision_test() { let created = 0; while (true) { await bulk_smt_object_create(); created += 10; console.log(`created ${created} smts`); await wait(3); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loop(){\n setTimeout(loop, 1000/60);\n counter ++;\n\n // generate enemy\n if((counter % 600) === 0){\n enemyGenRate ++;\n }\n if(counter % Math.floor( 192 / enemyGenRate) === 0){\n for(var i = 0; i < enemys.length; i++){\n if (enemys[i].alive === false){\n ...
[ "0.65059054", "0.6452249", "0.632524", "0.6304112", "0.6258071", "0.6175478", "0.6154344", "0.6151119", "0.6149054", "0.6100338", "0.60905373", "0.60785276", "0.60631764", "0.6062742", "0.6060836", "0.6019974", "0.5976558", "0.5964669", "0.5954302", "0.59295225", "0.59282255"...
0.753035
0
Check if a function have been passed only numbers as parameters
function numbers() { for (var i = 0; i < arguments.length; ++i) { if (typeof(arguments[i]) !== "number" ) return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function numbers() {\r\n const args = Array.from(arguments);\r\n return args.every(x=> typeof x == 'number');\r\n}", "function argumentTypeChecker() {\n\n const isNumber = (argument) => Array.prototype.map.call(argument, (current) => {\n return isNaN(current);\n });\n\n const hasOnlyNumbers = (...
[ "0.74602306", "0.72979844", "0.71801174", "0.711095", "0.7102981", "0.7027717", "0.69838494", "0.6944614", "0.69380957", "0.6936177", "0.6934145", "0.69168335", "0.68213856", "0.68213856", "0.6739206", "0.6739206", "0.6732348", "0.67281187", "0.6711009", "0.6695932", "0.66959...
0.79394317
0
Check if the string contains ending string
function solution(str, ending){ return (str.substring(str.length - ending.length) === ending); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function solution(str, ending){\n return str.substring(str.length - ending.length) === ending;\n}", "function solution(str, ending) {\n\t// TODO: complete\n\treturn str.slice(-ending.length) === ending ? true : false;\n}", "function solution(str, ending) {\n return ending === \"\" ? true : str.slice(-ending....
[ "0.8059652", "0.8040564", "0.8022811", "0.7982227", "0.7844521", "0.77995086", "0.7727161", "0.7673053", "0.76724136", "0.75883585", "0.7568207", "0.755879", "0.75392866", "0.74542254", "0.74455506", "0.7427089", "0.7419517", "0.74028563", "0.7394931", "0.7392801", "0.7390356...
0.8046882
1
Call this after xhr.open(...) to prevent the Jira browser session from invalidating. Problem seems to be caused by xhr sending cookies. Setting LOAD_ANONYMOUS flag will prevent cookies being sent.
function applyJiraLogoutFix(xhr) { xhr.channel.loadFlags |= Components.interfaces.nsIRequest.LOAD_ANONYMOUS; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function applyXSRFCheckFix(xhr) {\n //xhr.setRequestHeader(\"User-Agent\", \"epoqcreatejiraissue; (Totally not Thunderbird, don't XSRF check me, bro. Also why does X-Atlassian-Token: no-check no longer work?)\");\n xhr.setRequestHeader(\"User-Agent\", \"xx\");\n xhr.setRequestHeader(\"X-Atlassian-Token\",...
[ "0.6007567", "0.599695", "0.56215525", "0.5569982", "0.5568559", "0.5499238", "0.549128", "0.5426285", "0.54183704", "0.53764886", "0.53312886", "0.5312156", "0.5284856", "0.5275865", "0.525279", "0.52400196", "0.5169996", "0.51632905", "0.51552236", "0.51552236", "0.5134689"...
0.7354362
0
As of 21.09.2015 Jira seems to apply selective XSRF checks based on UserAgent headers. This also cannot be bypassed with the 'XAtlassianToken: nocheck' header. Workaround: Override UserAgent
function applyXSRFCheckFix(xhr) { //xhr.setRequestHeader("User-Agent", "epoqcreatejiraissue; (Totally not Thunderbird, don't XSRF check me, bro. Also why does X-Atlassian-Token: no-check no longer work?)"); xhr.setRequestHeader("User-Agent", "xx"); xhr.setRequestHeader("X-Atlassian-Token", "no-check"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function overrideUA(req) {\n for (const header of req.requestHeaders) {\n if (header.name.toLowerCase() === \"user-agent\") {\n header.value = CUSTOM_USER_AGENT;\n }\n }\n return { requestHeaders: req.requestHeaders };\n}", "function spoof(value) {\n spoofUserAgent = value;\n}"...
[ "0.6385053", "0.602833", "0.56040424", "0.556836", "0.556836", "0.549416", "0.54440755", "0.54312176", "0.5167783", "0.5092022", "0.5059265", "0.50312555", "0.49516103", "0.4873079", "0.48604646", "0.4814379", "0.48100275", "0.48029795", "0.47951683", "0.4791901", "0.47808248...
0.86122644
0
pushes all beer types to array to store individual beerSales information
function createBeerArray() { globalData.barData.storage.forEach((beerType) => { const beerObject = {beerName: beerType.name, beerSales: 0}; globalData.ranking.push(beerType.name = beerObject); }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getStorageBeer() {\n var productData = localStorage.getItem('beerData');\n var parsedData = JSON.parse(productData);\n Addbeer.beerDrink = [];\n\n for (var i = 0; i < parsedData.length; i++) {\n new Addbeer(parsedData[i].name, parseFloat(parsedData[i].abv), parsedData[i].type, parsedData[i].written...
[ "0.5808839", "0.56663615", "0.55646724", "0.55314237", "0.5497261", "0.5497036", "0.5364533", "0.53331596", "0.5309525", "0.5199284", "0.5188361", "0.5158343", "0.51531774", "0.5139468", "0.51259923", "0.5118041", "0.50989586", "0.50861275", "0.5061356", "0.5054287", "0.50500...
0.73344344
0
goes through all current orders and if id is > than currentRankCounter that orders beer sales get counted in the ranking array.
function rankBeers() { globalData.barData.queue.forEach((que) => { if (que.id > globalData.currentRankCounter) { const itemsToCountUp = que.order; itemsToCountUp.forEach((order) => { const currentIndex = globalData.ranking.findIndex(x => x.beerNa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function processOrders() {\n // Sort the orders list, prioritizing most cookies first, then lowest order ID.\n // Source: http://stackoverflow.com/a/4576720\n retrievedOrders.sort(function(x, y) {\n let cookieAmountPriority = y.cookieAmount - x.cookieAmount;\n if (cookieAmountPriority !== 0) {\n retu...
[ "0.56806564", "0.5616624", "0.5482062", "0.5435", "0.53048", "0.5277943", "0.525031", "0.5205941", "0.5169713", "0.51682186", "0.506297", "0.50409883", "0.4994079", "0.4991637", "0.49759313", "0.49625474", "0.49559993", "0.49538505", "0.4952558", "0.4949185", "0.49467027", ...
0.6833901
0
Code caves (override) Return true if you want to display the chat message normally
function on_chat(color, message, some_int) {return true;}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_isChatMessage(message) {\n\t\treturn message.type === 'message' && Boolean(message.text);\n\t}", "displayMessage(newPayload, isUser) {\n var textExists = (newPayload.input && newPayload.input.text)\n || (newPayload.output && newPayload.output.text);\n if (isUser !== null && textExists) {\n // Cr...
[ "0.6794951", "0.65678257", "0.65129715", "0.65129715", "0.6511492", "0.65003073", "0.6473928", "0.644278", "0.64319116", "0.64150757", "0.64146626", "0.6377614", "0.637117", "0.6356323", "0.6341821", "0.6332349", "0.63315487", "0.62967443", "0.62712705", "0.6270125", "0.62640...
0.65708244
1
All functions to be called on $(window).load() should be in this function
function mkdOnWindowLoad() { mkdCardsGallery(); mkdInfoBox(); mkdAdvancedSlider().load(); mkdPortfolioAppearEffect(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function qodefOnWindowLoad() {\n qodefInitBlogMasonry();\n qodefInitBlogGallery();\n qodefInitBlogGalleryAppear();\n qodefInitBlogNarrowAppear();\n }", "function eltdOnWindowLoad() {\n eltdCheckHeaderStyleOnScroll(); //called on load since all content needs to be loaded in o...
[ "0.7303125", "0.72744477", "0.7180351", "0.7031616", "0.7008606", "0.70008165", "0.6931226", "0.6905358", "0.69031304", "0.68864584", "0.6866138", "0.68445617", "0.6841398", "0.6841398", "0.68329424", "0.681387", "0.6811809", "0.6747475", "0.67356", "0.67326146", "0.67046607"...
0.7304674
0
Init Pie Chart and Pie Chart With Icon shortcode
function mkdInitPieChart() { var pieCharts = $('.mkd-pie-chart-holder, .mkd-pie-chart-with-icon-holder'); if (pieCharts.length) { pieCharts.each(function () { var pieChart = $(this), percentageHolder = pieChart.children('.mkd-percentage, .mkd-percentage-with-icon'), barColor, trackColor, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get pie_chart () {\n return new IconData(0xe6c4,{fontFamily:'MaterialIcons'})\n }", "function initPie() {\n var chart;\n\n\tvar data = dataArmenia = [{\n\t\tcategory : \"WOMEN\",\n\t\tvalue : 50,\n\t\timpressions : \"10,883\",\n\t\tspots : \"43\"\n\t}, {\n\t\tcategory : \"VIEWS\",\n\t\tvalue : 25,\n\t\tim...
[ "0.71943974", "0.71078074", "0.678526", "0.6693069", "0.6634462", "0.6615846", "0.6592712", "0.6553908", "0.6475658", "0.64661396", "0.64643306", "0.6440674", "0.6425825", "0.63860905", "0.6380094", "0.62987494", "0.626081", "0.6260137", "0.6235342", "0.6189786", "0.61676097"...
0.7219643
0
Counter for pie chart number from zero to defined number
function initToCounterPieChart(pieChart) { pieChart.css('opacity', '1'); var counter = pieChart.find('.mkd-to-counter'), max = parseFloat(counter.text()); counter.countTo({ from: 0, to: max, speed: 1500, refreshInterval: 50 }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initToCounterPieChart(pieChart){\n\t\tvar counter = pieChart.find('.qodef-pc-percent'),\n\t\t\tmax = parseFloat(counter.text());\n\t\t\n\t\tcounter.countTo({\n\t\t\tfrom: 0,\n\t\t\tto: max,\n\t\t\tspeed: 1500,\n\t\t\trefreshInterval: 50\n\t\t});\n\t}", "function counterColor() {\n\tvar places = document...
[ "0.73759943", "0.6504837", "0.6407217", "0.6407217", "0.6357167", "0.63550866", "0.6251221", "0.6176325", "0.614566", "0.6123045", "0.6076467", "0.6044905", "0.6025865", "0.60234165", "0.59816873", "0.5945906", "0.59307456", "0.5882101", "0.58756095", "0.58644086", "0.5861447...
0.7258543
1
Generate icons in tabs navigation
function mkdInitTabIcons() { var tabContent = $('.mkd-tab-container'); if (tabContent.length) { tabContent.each(function () { var thisTabContent = $(this); var id = thisTabContent.attr('id'); var icon = ''; if (typeof thisTabContent.data('icon-html') !== 'undefined' || thisTabContent.data('ico...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderIcons() {}", "function Tabs() {\n return (\n <div class=\"tabs\">\n <ul>\n <li>\n <a href=\"\" class=\"active\">\n <svg\n width=\"36\"\n height=\"36\"\n viewBox=\"0 0 36 36\"\n fill=\"none\"\n xmln...
[ "0.6573846", "0.64658964", "0.6440234", "0.6239629", "0.61552125", "0.6107012", "0.5986175", "0.5925125", "0.59061277", "0.58929855", "0.5854236", "0.5843186", "0.5822438", "0.57908887", "0.5767673", "0.57616335", "0.57547146", "0.57509047", "0.5742129", "0.57385147", "0.5727...
0.7422088
0
Init blog list masonry type
function mkdInitBlogListMasonry() { var blogList = $('.mkd-blog-list-holder.mkd-masonry'); if (blogList.length) { blogList.each(function () { var container = $(this); container.waitForImages(function () { container.css('visibility', 'visible'); container.isotope({ itemSelector: 'article...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function eltdfInitShortcodeBlogMasonry() {\n\n if($('.eltdf-blog-list-holder.eltdf-masonry').length) {\n\n var container = $('.eltdf-blog-list-holder.eltdf-masonry'),\n blogListHolder = container.children('.eltdf-blog-list');\n\n blogListHolder.waitForImages(function() {...
[ "0.7817669", "0.73879135", "0.7109554", "0.66046345", "0.6513938", "0.6474605", "0.64302725", "0.6408685", "0.63847536", "0.6372042", "0.63711953", "0.6341796", "0.6314711", "0.6291285", "0.6232641", "0.62224776", "0.6221223", "0.6213978", "0.6195665", "0.61567503", "0.603956...
0.79475933
0
Initializes mixItUp function for specific container
function mkdInitPortMixItUp(container) { var filterClass = ''; if (container.hasClass('mkd-ptf-has-filter')) { filterClass = container.find('.mkd-portfolio-filter-holder-inner ul li').data('class'); filterClass = '.' + filterClass; } var holderInner = container.find('.mkd-portfolio-list-holder'); holde...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function enableMixItUp() {\n\n $('#projects-container').mixItUp();\n $('#sortable-shop-products').mixItUp();\n $('.faq-accordions').mixItUp();\n $('.projects-container').mixItUp({\n controls: {\n enable: false\n }\n ...
[ "0.6424598", "0.601862", "0.60153306", "0.59341913", "0.58245915", "0.5789961", "0.5759196", "0.57480514", "0.57480514", "0.5593499", "0.55347854", "0.5378554", "0.53655016", "0.53440315", "0.5328002", "0.5328002", "0.5321825", "0.52631515", "0.52631515", "0.52631515", "0.526...
0.76263636
0
Init portfolio list masonry type
function mkdInitPortfolioListMasonry() { var portList = $('.mkd-portfolio-list-holder-outer.mkd-ptf-masonry'); if (portList.length) { portList.each(function () { var thisPortList = $(this).children('.mkd-portfolio-list-holder'); mkdResizeMasonry(thisPortList); mkdInitMasonry(thisPortList); $(wi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mkdInitBlogListMasonry() {\n\t\tvar blogList = $('.mkd-blog-list-holder.mkd-masonry');\n\t\tif (blogList.length) {\n\t\t\tblogList.each(function () {\n\t\t\t\tvar container = $(this);\n\n\t\t\t\tcontainer.waitForImages(function () {\n\t\t\t\t\tcontainer.css('visibility', 'visible');\n\n\t\t\t\t\tcontainer...
[ "0.74553627", "0.7120018", "0.7083592", "0.70676666", "0.7019814", "0.6850503", "0.68084705", "0.66482294", "0.6625303", "0.6594481", "0.6581303", "0.657586", "0.652385", "0.65130687", "0.64934653", "0.64926255", "0.64853513", "0.64844245", "0.64838547", "0.64578027", "0.6437...
0.8199313
0
Initializes portfolio masonry filter
function mkdInitPortfolioMasonryFilter() { var filterHolder = $('.mkd-portfolio-filter-holder.mkd-masonry-filter'); if (filterHolder.length) { filterHolder.each(function () { var thisFilterHolder = $(this); var portfolioIsotopeAnimation = null; var filter = thisFilterHolder.find('ul li').data('c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initIsotope()\r\n {\r\n \tif($('.grid').length)\r\n \t{\r\n \t\t$('.grid').isotope({\r\n\t \t\t\titemSelector: '.grid-item',\r\n\t \t\t\tpercentPosition: true,\r\n\t \t\t\tmasonry:\r\n\t \t\t\t{\r\n\t\t\t\t horizontalOrder: true\r\n\t\t\t \t}\r\n\t });\r\n\r\n\t if($('.po...
[ "0.7654464", "0.7511976", "0.72823524", "0.7269643", "0.7267963", "0.71755075", "0.71582997", "0.7100407", "0.7071343", "0.70136905", "0.69576174", "0.68427294", "0.68397087", "0.6767019", "0.67618203", "0.6742593", "0.67318386", "0.66493464", "0.6621616", "0.66036713", "0.65...
0.840747
0
Initializes portfolio load more function
function mkdInitPortfolioLoadMore() { var portList = $('.mkd-portfolio-list-holder-outer.mkd-ptf-load-more'); if (portList.length) { portList.each(function () { var thisPortList = $(this); var thisPortListInner = thisPortList.find('.mkd-portfolio-list-holder'); var nextPage; var maxNumPages; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init_portfolio()\n{\n\t/* --- Hide portfolio excerpts --- */\n\t$('.portfolio .cycle .excerpt').css('display', 'none');\n\n\t/* --- Category filter --- */\n\tvar speed = 500;\n\tvar ease = 'easeOutQuart';\n\n\t$('#category_filter ul li a').click(function(){\n\t\tvar title = $(this).attr('title');\n\t\t$('...
[ "0.69238174", "0.6884969", "0.68536645", "0.6806883", "0.670553", "0.6677458", "0.661675", "0.661675", "0.66119087", "0.65870744", "0.6574663", "0.6533862", "0.6506967", "0.64718693", "0.64718693", "0.6403768", "0.6384668", "0.6378446", "0.6355966", "0.6351041", "0.6260977", ...
0.7870767
0
Sets portfolio load more data params for ajax function
function mkdSetPortfolioAjaxData(container) { var returnValue = { action: 'mkd_core_portfolio_ajax_load_more', type: container.type, columns: container.columns, gridSize: container.gridSize, orderBy: container.orderBy, order: container.order, number: container.number, imageSize: container.imag...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mkdInitPortfolioLoadMore() {\n\t\tvar portList = $('.mkd-portfolio-list-holder-outer.mkd-ptf-load-more');\n\t\tif (portList.length) {\n\t\t\tportList.each(function () {\n\n\t\t\t\tvar thisPortList = $(this);\n\t\t\t\tvar thisPortListInner = thisPortList.find('.mkd-portfolio-list-holder');\n\t\t\t\tvar nex...
[ "0.702569", "0.70166254", "0.6766615", "0.66702175", "0.6660917", "0.6642039", "0.6614744", "0.65043014", "0.6458528", "0.6429453", "0.64228237", "0.6276348", "0.6212112", "0.6211432", "0.61724955", "0.61641616", "0.615517", "0.6087138", "0.6074931", "0.6074931", "0.60391223"...
0.7392514
0
Check if slide effect on header style changing
function mkdCheckSliderForHeaderStyle(slide, headerEffect) { if ($('.mkd-slider .carousel').not('.mkd-disable-slider-header-style-changing').length > 0) { var slideHeaderStyle = ""; if (slide.hasClass('light')) { slideHeaderStyle = 'mkd-light-header'; } if (slide.hasClass('dark')) { slideHeaderS...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkAnimation() {\r\n var $elem = $('h1');\r\n $elem.each(function() {\r\n if ($(this).hasClass('slide')) return;\r\n if (isElementInViewport($(this))) {\r\n $(this).addClass('slide');\r\n }\r\n });\r\n}", "function checkSliderForHeaderStyle(a, c) {\r\n\tvar b =...
[ "0.6562255", "0.64068645", "0.62823266", "0.6257653", "0.622831", "0.61806816", "0.6176716", "0.61656755", "0.6152144", "0.61126614", "0.60424787", "0.6037895", "0.6010587", "0.59388185", "0.5908334", "0.58499277", "0.58422756", "0.58189476", "0.57870454", "0.5785811", "0.573...
0.7340401
0
Init product list Masonry type
function mkdInitProductListMasonry() { var productList = $('.mkd-pl-holder.woocommerce.masonry'); if (productList.length) { productList.each(function () { var thisProductList = $(this).children('.mkd-pl-outer'); mkdResizeProductMasonry(thisProductList); mkdInitProductMasonry(thisProductList); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mkdInitProductListLookbookMasonry() {\n\t\tvar productList = $('.mkd-pl-holder.woocommerce.lookbook-masonry');\n\t\tif (productList.length) {\n\t\t\tproductList.each(function () {\n\t\t\t\tvar thisProductList = $(this).children('.mkd-pl-outer');\n\n\n\t\t\t\tmkdResizeProductMasonry(thisProductList);\n\t\t...
[ "0.7435276", "0.6951", "0.6621368", "0.6526454", "0.64761883", "0.63113624", "0.61561984", "0.60741645", "0.6066634", "0.60570467", "0.604989", "0.60045844", "0.5999743", "0.59899443", "0.5931668", "0.59080094", "0.58145577", "0.5811735", "0.579866", "0.5786807", "0.57190853"...
0.77153945
0
Init product list Lookbook Masonry type
function mkdInitProductListLookbookMasonry() { var productList = $('.mkd-pl-holder.woocommerce.lookbook-masonry'); if (productList.length) { productList.each(function () { var thisProductList = $(this).children('.mkd-pl-outer'); mkdResizeProductMasonry(thisProductList); mkdInitProductMasonry(thisPr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mkdInitProductListMasonry() {\n\t\tvar productList = $('.mkd-pl-holder.woocommerce.masonry');\n\t\tif (productList.length) {\n\t\t\tproductList.each(function () {\n\t\t\t\tvar thisProductList = $(this).children('.mkd-pl-outer');\n\n\n\t\t\t\tmkdResizeProductMasonry(thisProductList);\n\t\t\t\tmkdInitProduc...
[ "0.75822914", "0.69506973", "0.6625463", "0.65551925", "0.6517171", "0.62931436", "0.6179705", "0.6147926", "0.61221856", "0.6096774", "0.60938084", "0.60573167", "0.6021768", "0.59907275", "0.59817797", "0.59030545", "0.586324", "0.5827248", "0.5772272", "0.5771211", "0.5729...
0.7841447
0
Reload Users Extra Fields
function reload_users_extra_fields(typeId,userId) { $("body").css("cursor", "progress"); $('#usersExtraFields').html('Loading...'); $.post("split/ajax/load/action.json.reloadUsersExtraFields.php",{typeId:typeId,userId:userId},function(data,status){ if(status=='success') { $('#usersExtraFields').h...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reloadfields(){\n\tloadcontent('thefields','index.cfm?fa=c.custom_fields_existing');\t\n}", "function reload_users_extra_fields(typeId,userId)\r\t{\r\t\t$(\"body\").css(\"cursor\", \"progress\");\r\t\t$('#usersExtraFields').html('Loading...');\r\t\t\r\t\t$.post(\"split/ajax/load/action.json.reloadUsersE...
[ "0.675807", "0.6711589", "0.6145067", "0.61229426", "0.599229", "0.59591347", "0.58946425", "0.58048075", "0.57011765", "0.56246734", "0.55508596", "0.5494814", "0.5463753", "0.54574835", "0.54534835", "0.54520386", "0.54512256", "0.54379445", "0.54288715", "0.54245263", "0.5...
0.6953687
0
This function will remove bitcoin as soon as one player wins
function removeBitcoin(){ var bitcoin = document.getElementById('bitcoin'); bitcoin.remove(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "newRound() {\n //How many players still have credit\n let solventPlayers = this.countActivePlayers(); \n if (solventPlayers ==1 ){\n console.log(\"No more players\");\n this.game.queue.push(`winner\\t${this.firstActivePlayer()}`);\n return 1;\n }else if (this.game.state.player.length > 2...
[ "0.6579555", "0.65515023", "0.63929224", "0.63284236", "0.6315331", "0.6287307", "0.62676674", "0.6264899", "0.6245306", "0.6168684", "0.6137339", "0.6128846", "0.6101676", "0.6094707", "0.6093046", "0.6087107", "0.6072933", "0.6042785", "0.60394996", "0.6017212", "0.6015466"...
0.6898177
0
clear task from LS
function clearTasksFromLS(){ localStorage.clear(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clearTaskFromLS() {\n localStorage.clear();\n}", "function clearTaskLS() {\n localStorage.clear();\n}", "function clearAllTask() {\n localStorage.clear();\n}", "function clearTasksFromLocalStorage() {\n localStorage.clear(); //clears all the tasks -li - in the Local storage\n}", "functio...
[ "0.80411524", "0.77768284", "0.7517503", "0.75102633", "0.74940735", "0.7483433", "0.74720144", "0.7415329", "0.73893726", "0.73798645", "0.736881", "0.7367562", "0.7366119", "0.7364474", "0.7359139", "0.7324969", "0.73208696", "0.7318342", "0.73104274", "0.7309529", "0.72934...
0.7919252
1
refTasksActive() => Returns the firebase reference where the user's active tasks are located.
function refTasksActive() { return firebase.database().ref('/' + firebase.auth().currentUser.uid + '/tasksActive'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function refTasksCompleted() {\n return firebase.database().ref('/' + firebase.auth().currentUser.uid + '/tasksCompleted');\n }", "function getCurrentSubTasks(res, context, complete) {\n var sql = `SELECT \n st.*,\n u.name AS assignee_name,\n pu.user_id,\...
[ "0.7965472", "0.55165946", "0.54717755", "0.53165185", "0.528983", "0.52543783", "0.5251864", "0.5247344", "0.51803327", "0.5177293", "0.5173389", "0.51588833", "0.51554894", "0.5140534", "0.5135071", "0.511613", "0.5101656", "0.5099565", "0.5037272", "0.49112394", "0.4895334...
0.92228967
0
refTasksCompleted() => Returns the firebase reference where the user's completed tasks are located.
function refTasksCompleted() { return firebase.database().ref('/' + firebase.auth().currentUser.uid + '/tasksCompleted'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function refTasksActive() {\n return firebase.database().ref('/' + firebase.auth().currentUser.uid + '/tasksActive');\n }", "function taskCompleted() {\n //Append the task list item to the #completed-tasks\n let listItem = this.parentNode;\n completedTasksHolder.appendChild(listItem);\n bin...
[ "0.75156444", "0.6413312", "0.62555397", "0.5796048", "0.57860255", "0.5565332", "0.552385", "0.55157864", "0.5490658", "0.5459232", "0.54549277", "0.54220873", "0.5370824", "0.5367454", "0.53670716", "0.53450847", "0.5306618", "0.53022504", "0.5297858", "0.5279581", "0.52575...
0.91490746
0
Fires when an attribute was added, removed, or updated.
attributeChangedCallback(attr, oldVal, newVal) {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "attributeChangedCallback(name, oldValue, newValue) {\n \n }", "attributeChangedCallback(attr, oldVal, newVal) {\n \n }", "attributeChangedCallback(name, oldValue, newValue) {\n // implement by subclass\n }", "attributeChangedCallback(name, oldValue, newValue) {\n // do stuff\n }", "at...
[ "0.7274376", "0.71901935", "0.71628755", "0.71364015", "0.7118078", "0.7093941", "0.7063483", "0.70240164", "0.70240164", "0.6985378", "0.68553966", "0.6850244", "0.6808217", "0.680258", "0.6781571", "0.6751302", "0.67473876", "0.67348367", "0.67078805", "0.67078805", "0.6707...
0.7326251
0
Show the the provided course on the map... clear any existing overlays and tie in the course name.
function showonmap(courseId, courseName, lat, lon, city, state) { if (map == null) { map = new GMap2(document.getElementById("map")); } // display the course on the map, geocode if needed if (lat == 0.0 && lon == 0.0) { geocoder.getLatLng(city + ", " + state, function(point) {_createMarkerAtPoint(poi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayCurrentCourses(){\n\n}", "function initMaps() {\n\n // Place location coordinates here for next event\n var myLatlng = new google.maps.LatLng(37.431472,-122.175661);\n\n var mapOptions = {\n zoom: 17,\n center: myLatlng, // Drop marker at these coordinates\n mapTypeId: goo...
[ "0.580305", "0.5739081", "0.56535316", "0.560473", "0.55579156", "0.55369866", "0.55286425", "0.55214566", "0.55181056", "0.5485934", "0.54145837", "0.53910434", "0.53436244", "0.5311255", "0.5308172", "0.52986705", "0.5263502", "0.5257077", "0.52518713", "0.5251684", "0.5243...
0.64269835
0
import mongoose from 'mongoose' user index
async function userIndex (_req, res, next) { try { const users = await User.find() return res.status(200).json(users) } catch (err) { next(err) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function users_index(req, res){\n db.User.find({}, function(err, users) {\n if(err){\n return console.log(\"index error: \" + err);\n }\n\n res.json(users);\n });\n}", "function index(req, res) {\n __WEBPACK_IMPORTED_MODULE_0__student_model__[\"a\" /* default */].find({}, (err, docs) => {\n r...
[ "0.6507881", "0.6428591", "0.63477516", "0.634191", "0.634123", "0.6172632", "0.6170599", "0.61372715", "0.5991379", "0.5978142", "0.5903289", "0.5884844", "0.57858485", "0.5713482", "0.5692471", "0.56775075", "0.56378204", "0.5635176", "0.5626935", "0.5596695", "0.5561129", ...
0.6591537
0
Build the ping info section of the ping.
_buildPingInfo() { let { startTime, endTime } = this._getStartEndTimes(); return { seq: this._getNextSequenceNumber(), experiments: {}, start_time: startTime, end_time: endTime, } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function buildPing(pingSize, options) {\n let stringPing = '';\n let possibleChars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n for (let i = 0; i < pingSize / 2; i++) {\n stringPing += possibleChars.charAt(Math.floor(Math.random() * possibleChars.length));\n }\n options.stringPing ...
[ "0.58397263", "0.55785286", "0.5371737", "0.51213795", "0.50952905", "0.5093931", "0.5000237", "0.49901223", "0.49794003", "0.49713254", "0.4966461", "0.48720947", "0.48575944", "0.48258817", "0.48047444", "0.4747976", "0.4692586", "0.46902615", "0.46750584", "0.46666977", "0...
0.70209867
0
Builds the client info section of the ping.
_buildClientInfo() { return { app_build: "Unknown", app_display_version: "Unknown", architecture: "Unknown", client_id: this._clientId, first_run_date: this._firstRunDate, os: this._os, os_version: "Unknown", telemet...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get clientInfo() {\n return this.clientInfo_;\n }", "_buildPingInfo() {\n let { startTime, endTime } = this._getStartEndTimes();\n return {\n seq: this._getNextSequenceNumber(),\n experiments: {},\n start_time: startTime,\n end_time: endTime,\n ...
[ "0.62042797", "0.6105542", "0.6036216", "0.58897626", "0.58897626", "0.5861968", "0.57853395", "0.56716526", "0.5434151", "0.5355254", "0.5245839", "0.52255505", "0.51969904", "0.5187835", "0.51399964", "0.51259625", "0.5125574", "0.5108606", "0.5078848", "0.50546074", "0.504...
0.6612072
0
Get rid of inputted value when another unit is selected
static clearText() { document.getElementById('unitInput').value = '0'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function unselect() {\n document.getElementById(\"lengthOutput\").value = \"\";\n document.getElementById(\"widthOutput\").value = \"\";\n document.getElementById(\"areaOutput\").value = \"\";\n document.getElementById(\"volumeOutput\").value = \"\";\n}", "update(){if(this.originalInputValue===''){th...
[ "0.67434496", "0.64484346", "0.6332879", "0.6328869", "0.6265634", "0.62645054", "0.6222908", "0.61911404", "0.608736", "0.60709393", "0.60292554", "0.6026176", "0.60175943", "0.5986751", "0.59582525", "0.59385693", "0.59385693", "0.59385693", "0.59385693", "0.59368426", "0.5...
0.6792784
0
Prerequisities: An appliance with ``/api`` available. VM Steps: POST /api/vms/ (method ``retire``) OR POST /api/vms (method ``retire``) with ``href`` of the vm or vms Metadata: test_flag: rest Bugzilla: 1805119 Polarion: assignee: pvala casecomponent: Infra caseimportance: high initialEstimate: 1/3h pass Test retiremen...
function test_check_vm_retirement_requester(appliance, request, provider, vm_retirement_report) { // // Polarion: // assignee: pvala // casecomponent: Infra // caseimportance: medium // initialEstimate: 1/2h // tags: retirement // setup: // 1. Add a pro...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _getSpecification(){\n\t\t\tsalesfactoryData.getData(attribute_requirment_url,'GET','')\n\t\t\t.then((r)=>{\n\t\t\t\tvar attrData = r.data;\n\t\t\t\tif(attrData){\n\t\t\t\t\t_.forEach(attrData.attributes,(item,key)=>{\n\n\t\t\t\t\t});\n\t\t\t\t\t$scope.prdData.specslist=attrData.attributes;\n\t\t\t\t\t$sc...
[ "0.51445067", "0.4886637", "0.43979818", "0.4397474", "0.4362263", "0.43507227", "0.43369973", "0.42893556", "0.42812338", "0.42802283", "0.42634383", "0.426146", "0.4254757", "0.42544344", "0.4240225", "0.42333058", "0.42259982", "0.42206883", "0.42158163", "0.4203624", "0.4...
0.5374827
0
render any console object
function render(data){ if(data && data.console){ var messages = data.console; for(var i=0, l=messages.length; i<l; i++){ var item = messages[i]; console[item.type](item.message); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "drawConsole()\n\t{\n\t\tPromise.all( this.templatesLoaded ).then( () =>\n\t\t{\n\t\t\tconst template = this._getTemplate( 'console' ),\n\t\t\t\t container = document.querySelector( '[data-nonogram-console]' ),\n\t\t\t\t node = template.getNode(),\n\t\t\t\t output = node.querySelector( '[data-nonogram-c...
[ "0.67435384", "0.66979796", "0.62885404", "0.6248232", "0.6234271", "0.61663467", "0.61663467", "0.61663467", "0.61663467", "0.61663467", "0.61663467", "0.61663467", "0.61663467", "0.6141027", "0.6141027", "0.6118975", "0.61065614", "0.6099344", "0.60720974", "0.60720974", "0...
0.6960236
0
getPHID method getPHID function to fetch the PHID
function getPHID(pid, username, password){ var searchInput = { method : 'post', body : { contentType : "application/json", content : "username="+ username +"&password="+ password +"&login-form-type=pwd&host-request-type=" }, headers : { "Cookie" : pid }, path : '/pkmslogin.form' }; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function loadOrGetPhid(token) {\n try {\n const { phid } = await browser.storage.local.get(\"phid\");\n if (phidPattern.test(phid)) {\n return phid;\n }\n } catch (e) {\n }\n\n const whoami = await ConduitAPI(\"user.whoami\", [\n [\"api.token\", token],\n ]);\n const phid = whoami.resu...
[ "0.648494", "0.56613", "0.5640459", "0.55707365", "0.53608567", "0.5277584", "0.5233639", "0.52022314", "0.5202029", "0.51484835", "0.5116941", "0.5113049", "0.51110315", "0.5110849", "0.5100397", "0.5079113", "0.5014942", "0.49912435", "0.4989844", "0.4985932", "0.49791822",...
0.6820044
0
A class that defines how a paddle behaves, including the ability to specify the input keys to move it up and down Paddle constructor Sets the properties with the provided arguments or defaults
function Paddle(x,y,w,h,speed,downKey,upKey,leftKey,rightKey) { this.x = x; this.y = y; this.vx = 0; this.vy = 0; this.w = w; this.h = h; this.speed = speed; this.downKey = downKey; this.upKey = upKey; ///////NEW/////// this.leftKey = leftKey; this.rightKey = rightKey; this.gainScore = false; //...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Paddle(x,y,w,h,speed,downKey,upKey) {\n this.x = x;\n this.y = y;\n this.xv = 0;\n this.yv = 0;\n this.w = w;\n this.h = h;\n //////////////// FIXED typo 'speeed' as 'speed'\n this.speed = speed;\n this.downKey = downKey;\n this.upKey = upKey;\n}", "function Paddle(x,y,w,h,speed,upKey,downKey)...
[ "0.8013715", "0.7959683", "0.78525925", "0.7621029", "0.72563004", "0.7123077", "0.7079474", "0.70320934", "0.70239925", "0.6951945", "0.68846977", "0.68692726", "0.6848306", "0.68252885", "0.68243086", "0.6795415", "0.67877805", "0.67836064", "0.67792535", "0.67722905", "0.6...
0.8009157
1
Pick random option taking into account their scores. Side effects: updates this.fate float as value between (0, this.sum) updates this.idx index of picked option
pick(rand01 = Math.random()) { this.fate = rand01 * this.sum; var fate = this.fate; for(var i=0; i < this.options.length; i++) { var opt = this.options[i]; if (fate < opt.value) { this.idx = i; return this.idx; } else { fate -= opt.value; } } this.idx ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "select() {\n if (this.timeUpdateSeconds) {\n this.pick(new SimplePRNG().seedByTime(this.timeUpdateSeconds).nextFloat());\n } else {\n this.pick(Math.random());\n }\n var option = this.options[this.idx];\n option.element.selected = true;\n return option\n }", "handlePickOption(){\n ...
[ "0.7031245", "0.67266333", "0.66420245", "0.651803", "0.64487153", "0.63735497", "0.6258274", "0.6198899", "0.6142992", "0.61213464", "0.609991", "0.60520893", "0.600581", "0.5997797", "0.59861314", "0.5932325", "0.58945876", "0.58377415", "0.5823842", "0.5785094", "0.5728846...
0.74367267
0
Select random element and update view
select() { if (this.timeUpdateSeconds) { this.pick(new SimplePRNG().seedByTime(this.timeUpdateSeconds).nextFloat()); } else { this.pick(Math.random()); } var option = this.options[this.idx]; option.element.selected = true; return option }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function randomItem () {\n\tvar randIndex= Math.floor(Math.random()*3); // bound of index 0-3\n\tconsole.log(randIndex);\n\tdocument.getElementById(\"two\").innerHTML= groceyList[randIndex];\n\t\n\tchangeColor(\"two\"); \n}", "updateSelectedVariant() {\n this.recompute = Math.random();\n }", "function ...
[ "0.6896842", "0.6638477", "0.64868236", "0.64698714", "0.6468803", "0.64620715", "0.6383859", "0.63453627", "0.62830085", "0.6268728", "0.62301755", "0.6217967", "0.6202111", "0.62008625", "0.6192062", "0.61717695", "0.61548704", "0.61471516", "0.6140434", "0.6109818", "0.610...
0.6668165
1
Alien attack function. Targets the USS Nova every time. Open interaction by having Alien Pilot talk. Series of different console.logs based on how much damage THE USS NOVA has sustained.
attack() { this.talkIsh(); if (checkIfHit(this) === true) { ussNova.hull -= this.firepower; if (ussNova.hull <= 0) { ussNova.hull = 0; console.log(`The Nova has been destroyed — your watch has ended.`); } else if (ussNova.hull > 0 && ussNova.hull < 6) { console.log( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function attackTracking() {\n\t\t// attack cycle of points adjustment\n\t\t// only run if game has begun and it is not over\n\t\tif(isGameBegun === true && isGameOver === false && gamePausedForAnotherDefender === false){\n\t\t\tswitch(playerName){\n\t\t\t\tcase \"luke\":\n\t\t\t\t if(defenderName === \"yoda\" ){...
[ "0.6475366", "0.63223225", "0.6258424", "0.62177485", "0.60337657", "0.6031385", "0.6002279", "0.6001171", "0.5998367", "0.5981022", "0.5971983", "0.5942577", "0.59172827", "0.5914402", "0.59080863", "0.59080863", "0.58952063", "0.5884102", "0.5873867", "0.58243924", "0.57991...
0.6727754
0
animates the jumbotron color on scroll
function handleJumbotronColor(siteTitle) { if ($(window).scrollTop() >= 0 && $(window).scrollTop() <= window.innerHeight) { animate(siteTitle, 'color', 'rgb(255, 255, 255)', '2s'); } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function chgColorNavbar() {\n\t$(window).scroll(function() {\n\t \tif ($(\"#bar\").offset().top > 631) {\n\t $(\"#bar\").addClass(\"bg-white\");\n\t }\n\t else {\n\t $(\"#bar\").removeClass(\"bg-white\");\n\t }\n\t });\n}", "function triggerAnimation(scroll){\n ...
[ "0.62608075", "0.6212135", "0.6104732", "0.60858506", "0.59875435", "0.5980079", "0.59771687", "0.59598356", "0.59580934", "0.5940471", "0.5929956", "0.5912014", "0.5912014", "0.58894855", "0.5880634", "0.58730906", "0.582573", "0.579259", "0.57869464", "0.57641613", "0.57387...
0.7448765
0
handles all animations within the jumbotron
function handleJumbotronAnimations(backgroundImage, siteTitle, navbar) { handleNavbarAnimation(navbar); handleSiteTitleAnimation(siteTitle); handleBackgroundAnimation(backgroundImage); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function animationHandler(){\n\n // Background\n handleStaticEffects(staticEffectElem);\n handleNoiseEffects(noiseEffectElem);\n moveScanLine(scanLineOneElem,1);\n moveScanLine(scanLineTwoElem,4);\n\n // Hero\n handleLogoEffects(heroLogoElem);\n modJitter(heroSectionElem.querySelector(\".sc...
[ "0.6377036", "0.62643397", "0.6125875", "0.60975045", "0.6072229", "0.6052994", "0.60271084", "0.5993232", "0.5928955", "0.5858946", "0.5828836", "0.5824417", "0.5802435", "0.57872134", "0.57844245", "0.576798", "0.57457656", "0.57246387", "0.57130617", "0.5704565", "0.569391...
0.7339045
0
Method for inputing fahrenheit via prompt an converting it to celsius which is displayed in a alert. Also includes limits for Max/min values.
function promptfahrenheitToCelsius() { var fahrenheit = promptFloatDecimalValidation("Farenheit?"); if (isNaN(fahrenheit)) { alert("Input temperature is not in fahrenheit"); } else if (fahrenheit < -459.671 || fahrenheit > 2.5502994000000000000000000000052e+32) { alert("Chosen temperatur...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function promptcelsiusToFahrenheit() {\n var celsius = promptFloatDecimalValidation(\"Celsius?\");\n if (isNaN(celsius)) {\n alert(\"Din input är ej i fahrenheit\");\n }\n else if (celsius < -273.15 || celsius > 1.4168330000000000000000000000027e+32) {\n alert(\"Chosen temperature is unre...
[ "0.7464824", "0.740475", "0.71462053", "0.71048325", "0.6815715", "0.6802339", "0.67091686", "0.64828557", "0.6445674", "0.6258496", "0.6221209", "0.618736", "0.6148781", "0.6122065", "0.60819244", "0.6057686", "0.6052061", "0.6045363", "0.60426307", "0.6028633", "0.6024298",...
0.7556399
0
Method for inputing celsius via prompt an converting it to fahrenheit which is displayed in a alert. Also includes limits for Max/min values.
function promptcelsiusToFahrenheit() { var celsius = promptFloatDecimalValidation("Celsius?"); if (isNaN(celsius)) { alert("Din input är ej i fahrenheit"); } else if (celsius < -273.15 || celsius > 1.4168330000000000000000000000027e+32) { alert("Chosen temperature is unreal(either to hig...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tempCel() { \t//C to F Converter\n\tvar value = parseFloat(prompt(\"Enter a temperature in Celsius\",\"0\")); \t//?prompt input value\n var fahrNum = value *(9/5) + 32;\t\t\t\t\t\t\t\t\t\t\t//temp maths\n \treturn \"The temperature is \" + fahrNum.toFixed(1) + \" degrees, Fahrenheit.\";\t//return val...
[ "0.7582698", "0.73771745", "0.7156488", "0.7100164", "0.6890424", "0.68424404", "0.6616054", "0.65319127", "0.64672905", "0.64559644", "0.6401884", "0.6393311", "0.6311939", "0.62735647", "0.62482154", "0.62448686", "0.6181381", "0.6171073", "0.614353", "0.61090964", "0.60644...
0.75230527
1
Takes input via a prompt. Validates that a string is really a integer decimal number if not it returns NaN
function promptIntegerDecimalValidation(textString) { var chosenDecimalNumber = prompt(textString); return parseInt(chosenDecimalNumber, 10); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function input(str) {\n var answer = prompt(str)\n if (answer != null && answer.length > 0 && !isNaN(answer)) {\n return parseFloat(answer)\n }\n else {\n return answer\n }\n}", "function isNumber(str){ return !isNaN(parseInt(str)); }", "isValid(input) {\n if (!isNaN(input)) return parseInt(input...
[ "0.74478376", "0.7225889", "0.71109086", "0.7088585", "0.7048491", "0.69963235", "0.6926197", "0.6926197", "0.68912834", "0.6868218", "0.68427414", "0.68419886", "0.6831044", "0.66997576", "0.66836655", "0.66666645", "0.6660598", "0.66568094", "0.6651908", "0.6646278", "0.663...
0.73638344
1
Takes input via a prompt. Validates that a string is really a float decimal number if not it returns NaN
function promptFloatDecimalValidation(textString) { var chosenDecimalNumber = prompt(textString); return parseFloat(chosenDecimalNumber, 10); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toFloatOrInvalid(input) {\n let length = input.length;\n if (length == 0) {\n return Invalid();\n }\n let first = charAt(input, 0);\n if (first == \"0\") {\n if (length == 1) {\n return 0.0;\n } else if (charAt(input, 1) != \".\") {\n return Invali...
[ "0.751411", "0.74977237", "0.7456429", "0.74444103", "0.74102914", "0.72909814", "0.71310765", "0.709149", "0.701984", "0.6969366", "0.6951112", "0.69155794", "0.6876022", "0.6838577", "0.6804986", "0.6785676", "0.6649595", "0.6595409", "0.6587074", "0.65684116", "0.6542546",...
0.7789165
0
Search the database for an item by its unique ID If user enters 0, return to the beginning of the search process.
function searchById() { console.log("") inquirer .prompt([{ type: "input", name: "searchId", message: "Enter the ID number of the item you'd like to purchase (Enter 0 to start over):", validate: function (value) { const valid = (!isNaN(parseInt(value))) && (parseInt(value) >= 0);...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "findItem(input) {\n return this.currRoom.items.filter((item) => {\n if (item.id == input) return item;\n })[0];\n }", "function searchItem(){\r\n if($rootScope.online == false){\r\n FactoryIndexedDBLoad.getItemsData().then(function (result) {\r\n vm.searchIte = result;\...
[ "0.66345155", "0.6528758", "0.63712394", "0.6159203", "0.61164564", "0.6096604", "0.5980698", "0.5972672", "0.59628826", "0.5944298", "0.58184403", "0.58050376", "0.5739787", "0.57361907", "0.5699282", "0.5694686", "0.5686651", "0.56178045", "0.5615569", "0.5602337", "0.55818...
0.69857395
0
Search the database for items by name Searches for all names that include the search term
function searchByName() { console.log("") inquirer .prompt([{ type: "input", name: "searchTerm", message: "Enter the item you would like to search for:" }]) .then(answers => { connection.query("SELECT * FROM products WHERE product_name LIKE ?", [`%${answers.searchTerm}%`], function (err, res)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findItemsByName(name) {\n return R.filter(\n R.propEq('name', name),\n set\n )\n }", "function getAllTextItems(searchTerm) {\n return knexInstance.select('*')\n .from('shopping_list')\n .where('item_name', 'ILIKE', `%${searchTerm}%`)\n .then(result => con...
[ "0.7218149", "0.7144877", "0.70811015", "0.70447075", "0.7039785", "0.6990949", "0.69788957", "0.6937717", "0.6864098", "0.68608254", "0.68003666", "0.67985445", "0.6663663", "0.6619894", "0.66183037", "0.6567526", "0.6557631", "0.6465793", "0.6461892", "0.6452251", "0.644803...
0.7438845
0
Search the database for items by department User may choose from all available departments
function searchByDept() { console.log("") connection.query("SELECT DISTINCT department_name FROM products", function (err, res) { if (err) throw err; const deptList = res.map(item => item.department_name) deptList.push("New Search") inquirer .prompt([{ type: "list", name: "chooseDep...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function viewDepartments() {\n\n connection.query(\"SELECT * FROM department\", function(err, res) {\n if (err) throw err;\n //console.log(res);\n for (var i = 0; i < res.length; i++) {\n console.log(\"Dept ID: \" + res[i].id + \" || Name: \" + res[i].name);\n }\n runSearch();\n }); ...
[ "0.67724234", "0.6596602", "0.64845854", "0.647574", "0.6451343", "0.6415647", "0.6407516", "0.6378712", "0.6362372", "0.63481796", "0.62671244", "0.6241471", "0.6237906", "0.6234623", "0.6231088", "0.6210172", "0.61907786", "0.6120978", "0.6103838", "0.6102969", "0.6080421",...
0.70481575
0
Takes the results of a database search Depending on length of results array, either start the search over, prompt user for a confirmation, or ask user to choose which of a narrower selection they would like.
function searchResults(res) { console.log("") if (res.length === 0) { console.log("No results found. Please try a different search.") chooseSearch() } else if (res.length === 1) { confirmSelection(res[0]) } else { console.log("Search Results:") printTable(res) const options = [] re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function runSearch() {\n inquirer.prompt({\n name: \"selection\",\n type: \"list\",\n message: \"Hello & Welcome to the Employee Tracker Database. Please select an option from list below.\",\n choices: [\n \"List Of All Employees\",\n \"Observe Division\",\n \"Observe Occu...
[ "0.68774897", "0.67965263", "0.6517037", "0.6472147", "0.6405082", "0.63949996", "0.6373479", "0.63470745", "0.6327041", "0.63196415", "0.63079524", "0.6296214", "0.62710214", "0.61868733", "0.60878366", "0.6079861", "0.6048748", "0.5955084", "0.5951882", "0.5848644", "0.5846...
0.7025019
0
Prompts user to confirm if the item is the one they'd like to purchase If yes, move on to select amount If no, start over
function confirmSelection(item) { console.log("") inquirer .prompt([{ type: "confirm", name: "selectConfirm", message: `Purchase ${item.product_name}?`, default: true }]) .then(answers => { if (answers.selectConfirm) { purchaseNumber(item) } else { chooseSearch() } })...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function promptToPurchase() {\n\n inquirer.prompt([{\n\n type: \"confirm\",\n name: \"yesPurchase\",\n message: \"Would you like to purchase an item?\",\n default: true\n\n }]).then(function(customer) {\n if (customer.yesPurchase === true) {\n selectionPrompt();\...
[ "0.8025907", "0.77405995", "0.7669473", "0.7551968", "0.7427", "0.73453856", "0.7318254", "0.7291844", "0.72805804", "0.7273955", "0.72543126", "0.72170144", "0.7193864", "0.71882147", "0.71754104", "0.7173572", "0.71524054", "0.7115769", "0.7082471", "0.7061486", "0.7059407"...
0.79062045
1
Prompts user to input the number of the item that they wish to buy If 0 is entered, start over If a value greater than 0 is entered, compare to current inventory for the item If not enough items, alert user as such, and start over If there are enough items, then proceed to a purchase confirmation
function purchaseNumber(item) { console.log("") inquirer .prompt([{ type: "input", name: "purchaseNum", message: `How many ${item.product_name} would you like to buy? (Enter 0 to start over)`, validate: function (value) { const valid = (!isNaN(parseInt(value))) && (parseInt(value...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function quantPurchase() {\n\tinquirer.prompt(\n \t{\n name: \"item\",\n type: \"input\",\n message: \"How many of the item would you like to purchase?\"\n })\n .then(function(answer) {\n \tvar want = answer.item;\n \tvar has = itemTobuy.stock;\n \tvar total = has - want;\n\n\t\tif(t...
[ "0.76854414", "0.7583829", "0.7526338", "0.7507621", "0.7457479", "0.74464923", "0.7418013", "0.74031216", "0.74022585", "0.73940307", "0.73258245", "0.7311441", "0.7303832", "0.7293198", "0.72846496", "0.7274289", "0.7272255", "0.72679704", "0.7259029", "0.7251404", "0.72487...
0.7942377
0
Asks for a purchase confirmation If yes, tell the user their purchase went through, and update database accordingly If no, do nothing In both cases, start a search over again.
function confirmPurchase(item, num) { console.log("") inquirer .prompt([{ type: "confirm", name: "purchaseConfirm", message: `Purchase ${num} ${item.product_name}(s) for $${parseFloat(item.price) * num}?`, default: true }]) .then(answers => { if (answers.purchaseConfirm) { con...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function confirmation(newStock, purchaseId) {\n\n inquirer.prompt([{\n\n type: \"confirm\",\n name: \"confirmPurchase\",\n message: \"Are you sure you want to buy this?\",\n default: true\n\n }]).then(function(userConfirm) {\n if (userConfirm.confirmPurchase === true) {\n\n...
[ "0.72843343", "0.713824", "0.7131897", "0.7069501", "0.6831799", "0.6827453", "0.67595506", "0.67523295", "0.67511857", "0.6707006", "0.67058647", "0.6670781", "0.666383", "0.66050994", "0.6528709", "0.65055835", "0.6497561", "0.6485038", "0.6461152", "0.64437026", "0.6427545...
0.7290115
0
save user's city into local storage
function saveLocalCity() { localStorage.setItem("currentCity", JSON.stringify(cityName)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setLocationData(city) {\n localStorage.setItem(\"city\", city);\n }", "function storeCity(boop){\n localStorage.setItem(`${boop}`, JSON.stringify(currentCity)); \n}", "function storeCity(city) {\n var cityArray = [];\n if (localStorage.getItem(\"cities\") !== null) {\n var cities = JSON.parse...
[ "0.8083038", "0.7889926", "0.7842358", "0.78298527", "0.7747854", "0.7728047", "0.76952", "0.7644759", "0.7621247", "0.76148725", "0.75525874", "0.7521592", "0.73995256", "0.73915356", "0.73814625", "0.7336434", "0.729081", "0.71794266", "0.7172177", "0.71278244", "0.7089125"...
0.84718156
0
save city array into local storage
function storeArrayOfCity() { localStorage.setItem("currentCity", JSON.stringify(CityList)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function storeCityArray(){\n localStorage.setItem(\"storedCitiesArray\", JSON.stringify(citiesArray)); \n}", "function saveCities() {\n var str = JSON.stringify(cities);\n localStorage.setItem('cities', str);\n}", "function saveLocalData() {\n localStorage.setItem(\"cities\", JSON.stringify(cities)...
[ "0.8479331", "0.8382906", "0.8349719", "0.8210408", "0.81939536", "0.81048656", "0.78913033", "0.7873291", "0.7860903", "0.7860127", "0.78035975", "0.7661843", "0.7655399", "0.76245534", "0.75308937", "0.74857455", "0.7468311", "0.7410303", "0.7289774", "0.7281464", "0.721510...
0.84923637
0
Recursively unpacks objects, replacing "JSON pointers" with typed arrays
function unpackJsonArraysRecursive(json, topJson, buffers, options = {}) { const object = json; const buffer = decodeJSONPointer(object, buffers); if (buffer) { return buffer; } // Copy array if (Array.isArray(object)) { return object.map(element => unpackJsonArraysRecursive(element, topJson, buff...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function unflatten(flatObject) {\n \"use strict\";\n if (Object(flatObject) !== flatObject || Array.isArray(flatObject)) return data;\n var regex = /\\.?([^.\\[\\]]+)|\\[(\\d+)\\]/g;\n var result = {};\n for (var pp in flatObject) {\n var cur = result;\n var property = \"\";\n var...
[ "0.6119505", "0.5967219", "0.59233075", "0.5822936", "0.57015276", "0.56895655", "0.5661531", "0.565627", "0.5646873", "0.5642877", "0.56312275", "0.56312275", "0.5614872", "0.5547051", "0.552194", "0.54975307", "0.5486174", "0.5466842", "0.54649925", "0.5446238", "0.5426488"...
0.66467905
0
Generic fork function, with callbacks for incoming data on stdin, stdout, stderr and exit
function fork(command, args, onStdinData, onStdoutData, onStderrData, onExit){ var exec = spawn(command, args); exec.stdin.on('data', function(data){ if(onStdinData){ onStdinData(data); } }); exec.stdout.on('data', function(data){ if(onStdoutData){ onStdoutData(data); } }); exec.stderr.on('data', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fork(command, input_args, opts, ignore_rc) {\n return new P((resolve, reject) => {\n let options = opts || {};\n let args = input_args || [];\n dbg.log0('fork:', command, args.join(' '), options, ignore_rc);\n options.stdio = options.stdio || 'inherit';\n var proc = c...
[ "0.63674766", "0.607562", "0.6057064", "0.59977055", "0.59935254", "0.5788061", "0.5774396", "0.55120736", "0.5357678", "0.53508824", "0.53099436", "0.5264236", "0.5206207", "0.51766413", "0.51148266", "0.5001024", "0.4915889", "0.48893797", "0.48681894", "0.48462927", "0.484...
0.7623261
0
Traverses the siblings on the DOM tree to find the element with the given class
function closestByClass(el, name) { while (el.className != name) { el = el.nextSibling; if (!el) { alert('An error has been encountered'); } } return el; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findElement(parent, className) {\n return parent.querySelector(\".\" + className);\n }", "function findNodeByClass(node, className) {\n return node.getElementsByClassName(className)[0];\n}", "function findNodeByClass(node, className) {\n return node.getElementsByClassName(className)[0];\n}...
[ "0.6382932", "0.6377665", "0.6377665", "0.6373838", "0.6280242", "0.62498087", "0.6224606", "0.6188539", "0.6188539", "0.6178715", "0.61229354", "0.61185366", "0.61063665", "0.6032573", "0.60316324", "0.60144687", "0.5976816", "0.5963506", "0.5956026", "0.593302", "0.5921115"...
0.6624756
0
Your job is to change the given string s using a nonnegative integer n. Each bit in n will specify whether or not to swap the case for each alphabetic character in s: if the bit is 1, swap the case; if its 0, leave it as is. When you finish with the last bit of n, start again with the first bit. You should skip the che...
function swap(s, n) { const num = n.toString(2); let result = ""; let count = -1; for (let i = 0; i < s.length; i++) { if (/[a-z]/i.test(s[i])) { count++; if (num[count % num.length] === "1") { if (/[a-z]/.test(s[i])) { result += s[i].toUpperCase(); } else { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SwapII(str) { \n\tvar output = [];\n numbers = /[0-9]/g,\n upperLetters = /[A-Z]g/,\n lowerLetters = /[a-z]/g;\n temp = str.split(\"\"),\n x;\n \n for (var i = 0; i < temp.length; i++) { // swap cases\n if (upperLetters.test(temp[i])) {\n output.push(temp[i].toLowerCase(...
[ "0.66929615", "0.6492095", "0.64806986", "0.64747494", "0.6406134", "0.6313515", "0.6294523", "0.6233185", "0.611785", "0.6107247", "0.60626453", "0.6056781", "0.5975376", "0.59529406", "0.5939593", "0.5937291", "0.5934621", "0.59064424", "0.5903132", "0.5900021", "0.5897316"...
0.7652826
0
Method to change the classTask property and its position in LS
changePositionInLS(divTask) { let task; task = this.changeLSinArray(); let indexTask; let taskChanged; indexTask = divTask.getAttribute('data-id'); task[indexTask].classTask = this.classTask; task[indexTask].toDo = this.toDo; task[indexTask].done...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "changeDefaultValues() {\n this.edgeTask = taskList.firstElementChild;\n this.removeClass = 'greenTasks';\n this.addedClass = 'redTasks';\n }", "function setTaskId(index){\n //set up taskId variable\n taskData.taskId = index; \n }", "changeDataIdAndTaskPosition(ch...
[ "0.6181548", "0.6140292", "0.60096294", "0.59602296", "0.5937469", "0.5825591", "0.5793004", "0.56652087", "0.55996376", "0.55722725", "0.55392164", "0.55061185", "0.54739654", "0.54217315", "0.5407148", "0.5403635", "0.53868794", "0.5369991", "0.53647995", "0.5357649", "0.53...
0.65667504
0
Method to insert the task in DOM
insertTaskInDOM(task) { //List element creation const divTask = document.createElement('div'); divTask.classList.add('task__container', task.classTask); divTask.innerHTML = `<span class="task">${task.task}</span> <input type="checkbox" class="task__column" val...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "appendTask() {\n this.target.appendChild(this.taskTr)\n }", "function addTaskToDom(task) {\n const clone = document.querySelector(\"template\").content.cloneNode(true);\n\n clone.querySelector(\"article\").dataset.id = task._id;\n clone.querySelector(\"h2\").textContent = task.name;\n clone.querySelector...
[ "0.7724694", "0.7523165", "0.70197016", "0.6998627", "0.6913922", "0.6874683", "0.6840569", "0.6790532", "0.67809314", "0.67675537", "0.6731388", "0.6730599", "0.67111206", "0.6675819", "0.66736686", "0.666922", "0.66387814", "0.65969485", "0.6545127", "0.65408176", "0.653678...
0.7612082
1
Method to change the default values when a task change to toDo
changeDefaultValues() { this.edgeTask = taskList.firstElementChild; this.removeClass = 'greenTasks'; this.addedClass = 'redTasks'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "todoStatus(currentTask, newTodo) {\n // modify todo in currentTask\n const newTodos = currentTask.todos.map((todo) =>\n todo.id === newTodo.id\n ? { ...todo, isCompleted: newTodo.status }\n : { ...todo }\n );\n // modify tasks in state\n this.modifyCurrentTask(currentTask, { ...cu...
[ "0.6040417", "0.5931279", "0.586116", "0.5841701", "0.581883", "0.58082265", "0.58061343", "0.5748662", "0.5732113", "0.57269675", "0.57204205", "0.5716322", "0.568623", "0.5667164", "0.5652072", "0.56423753", "0.5637115", "0.56143457", "0.5601761", "0.55900013", "0.5577929",...
0.69590527
0
function retruns eigther true if two positive integers are coprime or false
function isCoprime(number1,number2) { var gcdNumber=gcd(number1,number2); if(gcdNumber===1) { return 'TRUE'; } else return 'FALSE'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function kangaroo(x1, v1, x2, v2) {\n \n if (((x2 - x1) * (v2 - v1) < 0) & ( (x2 - x1) % (v2 - v1) === 0)){\n return \"YES\"\n }else{\n return \"NO\"\n }\n\n}", "function ceq(x, y) {\n return ((x ^ y) === 0n) | 0;\n}", "function cekPrima (x) {\n var c = x;\n var i = 0;\n var...
[ "0.5880223", "0.5776494", "0.57714516", "0.5732286", "0.5719423", "0.56782246", "0.5675374", "0.56737137", "0.56655824", "0.5587427", "0.5584888", "0.5533155", "0.5533155", "0.5533155", "0.5533155", "0.5533155", "0.5497725", "0.5443901", "0.5442338", "0.5429921", "0.54107183"...
0.6520372
0
Function return the range of prime numbers between upper and lower limit
function primeRange(number1,number2) { var rangeArr=[]; var index=0; for(var i=number1;i<=number2;i++) { var flag=primeNumber(i); if(flag==='TRUE') { rangeArr[index]=i; index++; } } return rangeArr; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function allPrimes(end,start=0) {\n\t range(end,start)\n\t .filter(elem=> isPrime(elem));\n}", "function primes(num) {}", "function sieve(lim){ //prime sieve generates primes to lim\n\n let limit = lim;\n let composites = [];\n let primes = [];\n\n for(let i = 0; i < limit; i++){ composites.push(false)...
[ "0.701445", "0.66630775", "0.6615323", "0.6583631", "0.6543757", "0.6527816", "0.65253407", "0.6522079", "0.64639026", "0.6444172", "0.6444172", "0.6430404", "0.6396735", "0.6383353", "0.63500977", "0.6331151", "0.631627", "0.6276115", "0.6264964", "0.6251435", "0.624986", ...
0.7104515
0
list of Goldbach compositions from given number
function goldbachCompositions(number1,number2) { var composition=[]; // array for holding the compositions for(var i=number1;i<=number2;i++) { composition=goldBach(i); if(composition!='NUMBER IS NOT EVEN') { document.write("<br> for number "+i+" Composition is: "+composition); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function GCF(arr) {\n function getFactors(num) {\n let res = [];\n if (num == 1) {\n return [1];\n }\n res.push(1, num);\n\n for (let i = 2; i <= num / 2; i++) {\n if (num % i === 0) {\n res.push(i);\n }\n }\n return res;\n }\n let factors = getFactors(parseInt(arr[0])...
[ "0.5891768", "0.5806914", "0.57258016", "0.57233334", "0.56032467", "0.5578622", "0.55284023", "0.550882", "0.54877734", "0.5451186", "0.5401826", "0.53707343", "0.53570515", "0.5340623", "0.53245205", "0.5308907", "0.52927935", "0.5280268", "0.52752656", "0.52577275", "0.524...
0.7072799
0
Creates a symbol that is brought in by a whole module import that "augments" an existing symbol. e.g. `import 'rxjs/add/operator/flatMap'`
static augmented(symbolName, from, target) { return new Augmented(symbolName, from, target); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function extendExportSymbols(target, source, lookupTable, exportNode) {\n source && source.forEach(function (sourceSymbol, id) {\n if (id === \"default\") return;\n var targetSymbol = target.get(id);\n if (!targetSymbol) {\n ...
[ "0.57831675", "0.5774694", "0.57681113", "0.57402736", "0.5618286", "0.5542168", "0.5542168", "0.5519968", "0.5486065", "0.5369688", "0.53596324", "0.53509706", "0.53350145", "0.53306055", "0.53306055", "0.53306055", "0.53245735", "0.5313024", "0.5313024", "0.5313024", "0.531...
0.60114837
1
Creates an import of a single named symbol from the module's exported default. e.g. `import Engine from 'engine';`
static importsDefault(exportedName, from) { return new ImportsDefault(exportedName, from); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createDefaultImportNode({\n name,\n from\n}) {\n return {\n type: 'mdxjsEsm',\n value: '',\n data: {\n estree: {\n type: 'Program',\n sourceType: 'module',\n body: [{\n type: 'ImportDeclaration',\n specifiers: [{\n type: 'ImportDefaultSpec...
[ "0.63033706", "0.6127116", "0.59815466", "0.59644103", "0.5957183", "0.5905731", "0.5845713", "0.57720196", "0.573723", "0.56407994", "0.56243604", "0.56243604", "0.56039995", "0.5603079", "0.5583745", "0.5547792", "0.5468736", "0.54652053", "0.54494435", "0.5438586", "0.5438...
0.6713614
1
FUNCTION: addDetectionScript() DESCRIPTION: inserts a script that detects whether the end user has the correct version of Flash to view the video NOTE: This function's only in here in case we decide to put in an Add option and corresponding UI. Currently, it's not called. TO DO: Modify so that the automatic checking fo...
function addDetectionScript(reqVerStr, msg){ // Determine whether reqVerStr is the latest version required // by all Flash movies on the page var dom = dw.getDocumentDOM(); var reqVerArr = reqVerStr.split(","); var requiredVersion = parseFloat(reqVerArr[0] + "." + reqVerArr[2]); var allObjects = new Array()...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkScriptVersion(version, msg) {\r\n\t\tvar tmp = new Date().getTime();// Obtains time in milliseconds \r\n\t\tvar tm = getValue('tcv', 0);// Obtains value when last check was performed, default value is 0\r\n\t\tif (tm == 0) { // Checks whether check was performed before\r\n\t\t\tsetValue('tcv', parseI...
[ "0.64424455", "0.5871974", "0.58311397", "0.5771844", "0.57443166", "0.57268715", "0.5708184", "0.56626964", "0.55961144", "0.55794036", "0.5579117", "0.5575098", "0.55741954", "0.55710244", "0.55698323", "0.55545217", "0.55545217", "0.55545217", "0.55545217", "0.5554211", "0...
0.8032341
0
FUNCTION: removeDetectionScript() DESCRIPTION: deletes the script that detects whether the end user has the correct version of Flash to view the video, and the event handler that calls it ARGUMENTS: none RETURNS: nothing.
function removeDetectionScript(){ var dom = dw.getDocumentDOM(); var selArr,bodyArr,newBodyArr; // get current selection and remember the whole body offset selArr = dom.getSelection(); bodyArr = dom.nodeToOffsets(dom.body); var bodyTag = dom.body; var handler = bodyTag.getAttribute("onload"); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addDetectionScript(reqVerStr, msg){\n // Determine whether reqVerStr is the latest version required\n // by all Flash movies on the page\n var dom = dw.getDocumentDOM();\n var reqVerArr = reqVerStr.split(\",\");\n var requiredVersion = parseFloat(reqVerArr[0] + \".\" + reqVerArr[2]);\n var allObject...
[ "0.61558706", "0.5843113", "0.56314707", "0.55525666", "0.5495459", "0.53144854", "0.5299512", "0.5298161", "0.5293393", "0.5293393", "0.52250737", "0.5199895", "0.51492804", "0.51275235", "0.51259536", "0.510962", "0.51079357", "0.50942683", "0.5090731", "0.5086861", "0.5076...
0.81616807
0
calculates the total volume of a house
function houseVolume(width, height, depth, sweep){ const lv = livingVolume(width, height, depth); const rv = roofVolume(sweep, width, depth); return lv + rv; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calculateVolume (platesSide, barWeight,sets, reps){\n\n\tvar totalPlatesWeight;\n\tvar totalWeight;\n\tvar totalVolume;\n\n\ttotalPlatesWeight = platesSide * 2;\n\ttotalWeight = totalPlatesWeight + barWeight;\n\ttotalVolume = sets * reps * platesSide;\n\treturn totalVolume;\n\t}", "function volume(lengt...
[ "0.70935315", "0.67751324", "0.66290075", "0.64920235", "0.64231366", "0.64070976", "0.6384217", "0.6311968", "0.6270305", "0.6251137", "0.62492657", "0.6239137", "0.6237675", "0.62363267", "0.62363267", "0.6204628", "0.6166758", "0.6160245", "0.6150055", "0.6126491", "0.6105...
0.7859486
0
takes zipcode value from db.query and executes current weather api call
function getWeather() { zip = zipcode; let weather_url = `http://api.openweathermap.org/data/2.5/weather?zip=${zip},us&units=${units}&appid=${apiKey}`; console.log(zipcode); request(weather_url, function (err, response, body) { if (err) { console.log('error:', error); } else...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getWeatherDataByZip(zipCode, callback) {\n var callback = callback || function() {};\n\n $.ajax({\n url : apiUrl + apiKey + '/conditions/q/'+ zipCode +'.json', //the final url should be like this: http://api.wunderground.com/api/625172310aff38a6/conditions/q/10003.json\n dataType : \"jsonp\",\n ...
[ "0.7569484", "0.74611634", "0.72343916", "0.7223805", "0.721754", "0.7053281", "0.68589747", "0.68383646", "0.67637", "0.67496", "0.67408806", "0.6714633", "0.666682", "0.6581025", "0.6579821", "0.6578379", "0.655909", "0.65283036", "0.6528049", "0.6497292", "0.64907897", "...
0.7545198
1
Sample the SVG path string "d" uniformly with the specified precision.
function sample(d, precision) { var path = document.createElementNS(d3.ns.prefix.svg, "path"); path.setAttribute("d", d); var n = path.getTotalLength(), t = [0], i = 0, dt = precision; while ((i += dt) < n) t.push(i); t.push(n); return t.map(function(t) { var p = path.getPointAtLength(t)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function samples(path, precision) {\n const n = path.getTotalLength();\n const normalizedLengths = [0];\n const dt = precision;\n for (let i = dt; i < n; i += dt) {\n normalizedLengths.push(i);\n }\n normalizedLengths.push(n);\n return normalizedLengths.map((t) => {\n var p = path.getPointAtLength(t),...
[ "0.6067071", "0.57851434", "0.5567076", "0.53711975", "0.5337782", "0.5314855", "0.52628726", "0.52069414", "0.5164277", "0.5155713", "0.5153819", "0.514983", "0.5149035", "0.51170695", "0.51169676", "0.51104414", "0.5109339", "0.5102345", "0.51023155", "0.50984186", "0.50944...
0.8014435
0
Compute quads of adjacent points [p0, p1, p2, p3].
function quad(points) { return d3.range(points.length - 1).map(function(i) { var a = [points[i - 1], points[i], points[i + 1], points[i + 2]]; a.t = (points[i].t + points[i + 1].t) / 2; return a; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function quads(points) {\n return [...Array(points.length - 1).keys()].map(function (i) {\n const a = [points[i - 1], points[i], points[i + 1], points[i + 2]];\n a.t = (points[i].t + points[i + 1].t) / 2;\n return a;\n });\n}", "function quad(vert, pts, norm, a, b, c, d, n){\n for(var i=0; i <6; i+...
[ "0.73135036", "0.6271472", "0.61685514", "0.6128509", "0.60367644", "0.5958739", "0.5955121", "0.5694415", "0.567539", "0.5660105", "0.5576388", "0.5529477", "0.54478264", "0.5424952", "0.5413456", "0.5352051", "0.5351221", "0.53501415", "0.5329071", "0.53173465", "0.5274936"...
0.63420093
1
Compute intersection of two infinite lines ab and cd.
function lineIntersect(a, b, c, d) { var x1 = c[0], x3 = a[0], x21 = d[0] - x1, x43 = b[0] - x3, y1 = c[1], y3 = a[1], y21 = d[1] - y1, y43 = b[1] - y3, ua = (x43 * (y1 - y3) - y43 * (x1 - x3)) / (y43 * x21 - x43 * y21); return [x1 + ua * x21, y1 + ua * y21]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lineIntersect(a,b,c,d){\n // http://paulbourke.net/geometry/lineline2d/\n var f = ((d.y - c.y)*(b.x - a.x) - (d.x - c.x)*(b.y - a.y)); \n if(f == 0){\n return null;\n }\n f = 1 / f;\n var fab = ((d.x - c.x)*(a.y - c.y) - (d.y - c.y)*(a.x - c.x)) * f ;\n...
[ "0.73147756", "0.71880925", "0.7162484", "0.7162484", "0.716229", "0.716229", "0.70940655", "0.7040148", "0.7035009", "0.6991837", "0.6967109", "0.6961958", "0.6957614", "0.6957614", "0.6947434", "0.6939698", "0.69336545", "0.6920939", "0.69208014", "0.69018394", "0.69018394"...
0.7261634
1
calculates the heat from the mantle with given inputs
function mantle_heat(){ heat = 0; // W/cm^2 k_heat = 0; u_heat = 0; th_heat = 0; mass = 0; for (var i = 0; i < prem.length; i++){ if (parseFloat(prem[i][0]) > prem_bottom && (parseFloat(prem[i][1]) < prem_top)){ u_heat = u_heat + (prem[i][4]/1e9 * prem[i][2] * u238_heat); th_heat = th_heat ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "heat(citationCount) {\n // TODO use a more interesting heat function than this linear one.\n return 0.1 + (citationCount / this.citations.maxCitations) * 0.9;\n }", "function calculateHeat(datax , datay){\n\n // heatArray[datax][datay] = heatArray[datax][datay]+10;\n for (var i = datax-30; i < datax+3...
[ "0.6366356", "0.6288912", "0.5896424", "0.5833528", "0.5715393", "0.5543723", "0.55376697", "0.5494806", "0.54651845", "0.5439037", "0.5415476", "0.5396276", "0.5308614", "0.5293409", "0.52500415", "0.5210772", "0.51885414", "0.5161886", "0.5145476", "0.506952", "0.5058969", ...
0.69988763
0
Promise to update all objects in a bucket
function updateMetadataBucket(destBucket) { var listParams = { Bucket: destBucket, } return new Promise((resolve, reject) => { s3.listObjectsV2(listParams, function(err, data) { if(err) { reject(err); } else { data.Contents....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function syncAll(creds, buckets, uploadOpts) {\n let strLength = maxLength(buckets);\n return Q.all(buckets.map(function(bucket, index) {\n let color = BAR_COLORS[index % BAR_COLORS.length];\n return syncToS3(creds, bucket, uploadOpts, color, strLength);\n }));\n}", "updateBucket(id, options) {\n ...
[ "0.66326493", "0.64262784", "0.6397782", "0.590614", "0.57289886", "0.5700708", "0.5653334", "0.5644866", "0.56343573", "0.5625502", "0.56205356", "0.5605209", "0.5592869", "0.55893534", "0.55392915", "0.55353945", "0.55155337", "0.5483713", "0.54806656", "0.54627484", "0.542...
0.70046574
0
Notify AWS CodePipeline of a failed job
function putJobFailure(message, jobId, callback, context) { var codepipeline = new aws.CodePipeline(); var params = { jobId: jobId, failureDetails: { message: JSON.stringify(message), type: 'JobFailed', externalExecutionId: context.invokeid } }; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handleFailure(job, error) {\n console.log(`Queue ${job.queue.name}: Failed`, error);\n }", "retry (req, res, next) {\n let jobId = req.params.jobId;\n let mongoJobId = typeof jobId != 'object' ? ObjectID(jobId) : jobId;\n\n // find job\n c.crn.jobs.findOne({_id: mongoJobId}, {}, (...
[ "0.688983", "0.6118091", "0.60331213", "0.59704715", "0.59020007", "0.58865786", "0.5799208", "0.56524897", "0.560122", "0.5563277", "0.5563277", "0.5517397", "0.5517397", "0.5517397", "0.5517397", "0.5517397", "0.5517397", "0.5517397", "0.5517397", "0.5517397", "0.5517397", ...
0.70858496
0
Load the queue file (synchronously)
function _loadSync() { var self = this, header = new Buffer("OIIIIIIIIIIIIIIIISSSST"), stats = { added: 0, removed: 0 }, fd; if ( !fs.existsSync(self._opts.file) ) return; // Open and read all data inside of the file fd = fs.openSync(this._opts.file,"r"); while ( fs.readSync(fd,header,0,header.length)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _loadAsync(handler) {\n\n\tvar\n\t\tself\t= this,\n\t\theader\t= new Buffer(5),\n\t\tstats\t= { added: 0, removed: 0 },\n\t\tfd;\n\n\t// Check if the file exists\n\treturn fs.exists(self._opts.file,function(exists){\n\t\tif ( !exists )\n\t\t\treturn handler(null,false);\n\n\t\t// Open file for reading\n\t...
[ "0.71533054", "0.649316", "0.63473934", "0.6220452", "0.6134635", "0.61175954", "0.6075641", "0.6055777", "0.58990896", "0.58990896", "0.58990896", "0.5874752", "0.58650815", "0.5791408", "0.5782577", "0.5765122", "0.5730159", "0.572951", "0.5719934", "0.56825864", "0.5676038...
0.7217312
0
Load the queue file (asynchronous)
function _loadAsync(handler) { var self = this, header = new Buffer(5), stats = { added: 0, removed: 0 }, fd; // Check if the file exists return fs.exists(self._opts.file,function(exists){ if ( !exists ) return handler(null,false); // Open file for reading return fs.open(self._opts.file,"r",funct...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _loadSync() {\n\n\tvar\n\t\tself\t= this,\n\t\theader\t= new Buffer(\"OIIIIIIIIIIIIIIIISSSST\"),\n\t\tstats\t= { added: 0, removed: 0 },\n\t\tfd;\n\n\tif ( !fs.existsSync(self._opts.file) )\n\t\treturn;\n\n\t// Open and read all data inside of the file\n\tfd = fs.openSync(this._opts.file,\"r\");\n\twhile ...
[ "0.7202276", "0.6525806", "0.6295902", "0.61454535", "0.61352557", "0.6100302", "0.6096485", "0.60532606", "0.5884118", "0.5884118", "0.5884118", "0.5871536", "0.5796205", "0.5757108", "0.57478356", "0.5745081", "0.57151186", "0.5710351", "0.56993616", "0.5698175", "0.569588"...
0.71630985
1
Acknowledge an item (synchronous)
function _itemAckSync(item) { var b; // Delete from acknowledge waiting list // delete this._waitAck[item.id]; this._waitAck[item.id] = null; this._waitAckCount--; // Write a "shift" to file b = _entryEncode({op:2,id:item.id}); // Remove from file asynchronously _writeFileSync.apply(this,[b]); // We are...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _itemAckAsync(item,handler) {\n\n\tvar\n\t\tself = this,\n\t\tb;\n\n\t// Write a \"shift\" to file\n\tb = _entryEncode({op:2,id:item.id});\n\treturn _writeFileAsync.apply(self,[b,function(err){\n\t\tif ( err ) {\n\t\t\tconsole.log(\"Error writing the shift to disk: \",err);\n\t\t\treturn handler(err,null)...
[ "0.69085556", "0.6010451", "0.5962745", "0.5843702", "0.5815559", "0.57048666", "0.57048666", "0.5679339", "0.5652714", "0.56235147", "0.5622102", "0.5542752", "0.55373174", "0.5468257", "0.5437808", "0.54336315", "0.5431893", "0.5401088", "0.5368053", "0.53635633", "0.536356...
0.70036304
0
Acknowledge an item (asynchronous)
function _itemAckAsync(item,handler) { var self = this, b; // Write a "shift" to file b = _entryEncode({op:2,id:item.id}); return _writeFileAsync.apply(self,[b,function(err){ if ( err ) { console.log("Error writing the shift to disk: ",err); return handler(err,null); } // We are dirty (requiring ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _itemAckSync(item) {\n\n\tvar\n\t\tb;\n\n\t// Delete from acknowledge waiting list\n//\tdelete this._waitAck[item.id];\n\tthis._waitAck[item.id] = null;\n\tthis._waitAckCount--;\n\n\t// Write a \"shift\" to file\n\tb = _entryEncode({op:2,id:item.id});\n\n\t// Remove from file asynchronously\n\t_writeFileS...
[ "0.7020099", "0.60458565", "0.60178214", "0.57861876", "0.5750063", "0.5741687", "0.5741687", "0.57290584", "0.57097393", "0.5664344", "0.5652418", "0.5560224", "0.5549902", "0.5519003", "0.5508921", "0.5492583", "0.54764485", "0.54342526", "0.54342526", "0.5401614", "0.53890...
0.69221145
1
Convert a data item into a buffer for being stored
function _itemToBuffer(item) { var strData; // Detect item type item.type = (typeof item.data == "string") ? 1 : (typeof item.data == "number") ? 2 : (item.data == null) ? 3 : 4; // Convert item into a string strData = (item.type == 1) ? item.data : (item.type == 2) ? item.data.toString() : (item.type == 3) ?...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rawEncodeItem(dat, bufs){\n\tvar size, buf, val;\n\tswitch (typeof dat){\n\t\tcase 'string':\n\t\t\tval = new Buffer(dat);\n\t\t\tbuf = new Buffer(1 + 4);\n\t\t\tbuf[0] = TYPE_STRING;\n\t\t\tbuf.writeUInt32LE(val.length, 1);\n\t\t\tbreak;\n\n\t\tcase 'number':\n\t\t\tif (isNaN(dat)){\n\t\t\t\tbuf = new Bu...
[ "0.6667094", "0.6660021", "0.63988787", "0.6255659", "0.6169524", "0.6169524", "0.61179394", "0.6079571", "0.6079571", "0.6079571", "0.6078635", "0.60241586", "0.60241586", "0.60241586", "0.60241586", "0.59975445", "0.5926006", "0.5835277", "0.57760376", "0.5765373", "0.57523...
0.81385297
0
Decode the header of an entry
function _entryDecodeHeader(b) { var item = {}; // Operation item.op = b[0]; // Convert the binary ID into a string ID item.id = uuid.unparse(b,1); // Data size item.size = (b[17] << 24) | (b[18] << 16) | (b[19] << 8) | b[20]; // Type item.type = b[21]; return item; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get hdr() {}", "function parseCFFHeader(data, start) {\n\t var header = {};\n\t header.formatMajor = parse.getCard8(data, start);\n\t header.formatMinor = parse.getCard8(data, start + 1);\n\t header.size = parse.getCard8(data, start + 2);\n\t header.offsetSize = parse.getCard8(data, start + 3);\n\...
[ "0.61364955", "0.60711217", "0.60711217", "0.6028347", "0.5999588", "0.59769815", "0.59769815", "0.59769815", "0.59769815", "0.59756356", "0.59602135", "0.5905376", "0.5870451", "0.58664036", "0.57907665", "0.56904435", "0.5671419", "0.5662325", "0.5660952", "0.5567548", "0.5...
0.81546843
0
function to add a note to myNotes. passed to as a prop
function addNote(note) { setMyNotes((prevValue) => { //spread operator allows us to add new note to existing array return [...prevValue, note]; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addNote(newNote) {\n setNotes((prevNotes) => {\n return [...prevNotes, newNote];\n });\n }", "addNotes(note) {\n const {\n title, text\n } = note;\n const id = uuidv4();\n const newNote = {\n title, text, id\n }\n const previous...
[ "0.793359", "0.7916118", "0.7890231", "0.7885813", "0.778749", "0.7703385", "0.76973975", "0.76859236", "0.7607767", "0.7589954", "0.72677916", "0.726689", "0.72401816", "0.7238097", "0.72051466", "0.7194794", "0.71102333", "0.7056216", "0.70208645", "0.6981374", "0.6979414",...
0.801392
0
Gets any registrations that match a given command and status.
function getRegistration(pool: any, command: Tagged, status: Status) { let answer = [] if (pool == null) { return answer } let alias = STATUS[status] console.assert(alias, 'Invalid action status ' + status) console.assert( command.__tagged, `Unable to register ${command.name || 'action'}(). ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function recherche_cmd(mes,cmd){\nfor(var i=0 ; i<commands.length ; i++){\nif(cmd==commands[i].command){\nreturn commands[i];}}\nreturn false;\n}", "register(commandName) {\n commands = [commandName, commandName + bot.botUsername];\n return commands;\n }", "function populateCmds(status) {\n l...
[ "0.51911485", "0.5086286", "0.49436128", "0.49367452", "0.49354565", "0.4926369", "0.4925248", "0.4846106", "0.48203465", "0.48010403", "0.47834703", "0.47023305", "0.4689544", "0.4685646", "0.46437407", "0.46298653", "0.45982108", "0.4595745", "0.45685428", "0.4567513", "0.4...
0.67729723
0
changes our environment from splash screen to actual experience
changeEnvironment() { this.loader.visible = false; this.enviroment._threeObject.material.map = RODIN.Loader.loadTexture('./src/assets/env.jpg'); let videoContainer = new VideoContainer(this.transition); this.containers.navigation = new Navigation(videoContainer); this.containers....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_initEnvironment() {\n if (this.logiInfo.login) {\n document.body.classList.add('lcDeveloperBar_hidden-tlg-window');\n\n this._appendStructure();\n this._initSearch();\n\n if (this.logiInfo.devOpenSaas) {\n this._initDevOpenSaas();\n } else if (this.logiInfo.proOpenSaas) {\n ...
[ "0.61356753", "0.60690147", "0.6047729", "0.5941576", "0.59324723", "0.5915022", "0.5877324", "0.5864842", "0.5840387", "0.58241916", "0.58227825", "0.5762979", "0.57559144", "0.57503533", "0.57479894", "0.5716551", "0.5696597", "0.5686339", "0.56784683", "0.5663466", "0.5656...
0.6225434
0
exchange our authorization code for an access token
function exchangeToken(code, callback) { // make POST to /oauth/token with x-www-form-urlencoded client_id etc. request.post({ url: oauth_config.host+'/oauth/token', form: { client_id: oauth_config.client_id, client_secret: oauth_config.client_secret, redirect_uri: oauth_config.redirect_ur...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function exchangeCodeForToken(code){\n let tokenRequest = await superagent.post(tokenURL)\n .send({\n code: code,\n client_id: process.env.CLIENT_ID,\n client_secret: process.env.CLIENT_SECRET,\n redirect_uri: process.env.REDIRECT_URI,\n grant_type: 'authorization_code'\n })...
[ "0.77440476", "0.7479808", "0.7455173", "0.71893734", "0.7077445", "0.7050786", "0.7018051", "0.70017314", "0.69665205", "0.6947565", "0.69423205", "0.6938823", "0.6894396", "0.6849189", "0.6800513", "0.6721569", "0.67133224", "0.6712279", "0.6702098", "0.6697029", "0.669429"...
0.77720344
0
Choose a random element from array. Set power > 1 to leftbias selection
function choose(array, power = 1) { return array[rndInt(array.length, power)] }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pick (array) {\n return array[Math.floor(random(array.length))];\n}", "function randomPick(array) {\n const choice = Math.floor(Math.random() * array.length);\n return array[choice]\n }", "function selectRandom(array) {\r\n\treturn array[Math.floor(Math.random()*array.length)]\r\n}", "functi...
[ "0.6804545", "0.6628398", "0.6566106", "0.6561984", "0.65088224", "0.6485367", "0.6478548", "0.64044696", "0.6379222", "0.6372155", "0.6361664", "0.63612586", "0.63492304", "0.6335135", "0.6316361", "0.63035107", "0.6289258", "0.6287499", "0.6283225", "0.62476337", "0.6242890...
0.74283105
0
Random note from 2octave range
function randomNote() { return choose(scale) + choose([0,12]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pickNote() {\n\t/*index = Math.floor(Math.random()*curScale.length);\n\tnote = note+curScale[index];\n\t//range consideration\n\tif (note < 48) {\n\t\t//note = Math.floor((Math.random()*12)+60);\n\t\tnote += 12;\n\t}\n\telse if (note > 96) {\n\t\t//note = Math.floor((Math.random()*12)+60);\n\t\tnote -= 12...
[ "0.68680173", "0.6796246", "0.66550326", "0.6554543", "0.65497327", "0.65157926", "0.6437272", "0.64165604", "0.6369642", "0.6357382", "0.60722286", "0.6066123", "0.6066123", "0.6066123", "0.6009243", "0.60029274", "0.59964705", "0.5986855", "0.59606063", "0.59251565", "0.590...
0.7942764
0
Truncate or extend sequence to new length. Fill any empty slots with random notes
function reshapeSequence() { const seqLength = choose([3,4, 5,8,12]); seq.length = seqLength; for (let i =0 ; i < seqLength; i++) { if (seq[i] === undefined) { seq[i] = randomNote(); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function randomizeOne() {\n let index = rndInt(seq.length);\n seq[index] = randomNote();\n }", "function seqGenerator() {\nconsole.clear();\ntheSacredSequence = [];\nvar seqLen = Limit; // lenght of the sacred sequence (it varies with level progress)\n\nfor (i=1; i<seqLen; i++) {\nlet theNote = ...
[ "0.6197331", "0.56670433", "0.56600714", "0.5597839", "0.5589056", "0.55460715", "0.5507289", "0.54970795", "0.54775625", "0.54724026", "0.5456261", "0.53856164", "0.5342689", "0.5323349", "0.53070337", "0.5306784", "0.5270193", "0.5263913", "0.52628374", "0.5261624", "0.5216...
0.72824323
0
randomize single element in sequence
function randomizeOne() { let index = rndInt(seq.length); seq[index] = randomNote(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rndEl(x){return x[Math.floor(Math.random()*x.length)];}", "function rndEl(x){return x[Math.floor(Math.random()*x.length)];}", "function randElement(item){\n\treturn item[Math.floor(Math.random() * item.length)];\n}", "function R(a){return a.splice(0|a.length*Math.random(),1)[0]}", "function random...
[ "0.7508063", "0.7508063", "0.75006735", "0.7348906", "0.7292669", "0.70783734", "0.702754", "0.695608", "0.6942798", "0.69308895", "0.6893589", "0.68188995", "0.68188995", "0.6801194", "0.6782043", "0.6765485", "0.67644525", "0.67342186", "0.6721939", "0.6720212", "0.6715326"...
0.7697246
0
A parameter that randomly wanders between the lowerBound and upperBound, using 2nd order random variation.
function WanderingParameter(lowerBound, upperBound, drift, correction) { let value = (lowerBound + upperBound) / 2; let direction = Math.random() * 20 * drift - 10 * drift; function moveAndGet() { value += direction; direction *= 0.95; if (value < lowerBound) { direction...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getRandomCoord(lowerBound, upperBound) {\n\n return Math.floor(lowerBound + Math.random()*(upperBound + 1));\n\n }", "function hyperRange (a, b) {\n return Math.random() * Math.random() * Math.random() * (b - a) + a;\n}", "function randomFromRealRange(bound1, bound2) {\n return bound1 + (bound2 - bound1)...
[ "0.68038857", "0.6802303", "0.67674845", "0.67395437", "0.67003775", "0.67003775", "0.6674677", "0.6654576", "0.66392463", "0.6562154", "0.6562154", "0.6560179", "0.6541252", "0.6536172", "0.65287536", "0.65287536", "0.65273255", "0.6525265", "0.6464521", "0.64355826", "0.642...
0.68584985
0
Helper function updates the Participants' list in the browser
function updateParticipants(participants) { // clear the Participants list in the browser $('#participants').html(''); // loop through each Participant and append a Span, their Name and (if the sessionId's match) the word 'You' for (var i = 0; i < participants.length; i++) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateParticipants(participants) {\n $('#participants').html('');\n for (var i = 0; i < participants.length; i++) {\n $('#participants').append('<div id=\"' + participants[i].id + '\"><img src=\" ' + participants[i].image + '\" class=\"participantPhoto\"> <span>' +\n participants[i].name...
[ "0.6980655", "0.6850091", "0.68470913", "0.6428558", "0.6358531", "0.63483834", "0.6305534", "0.6251034", "0.6214261", "0.6207615", "0.6191568", "0.6189715", "0.618445", "0.6045864", "0.600853", "0.6004158", "0.6003316", "0.5987964", "0.5975401", "0.5973721", "0.5935444", "...
0.7852877
0
"sendCoords" will do a simple ajax POST call to our server with whatever coords we have in our textarea
function sendCoords(latitude, longitude, userID) { var outgoingLat = latitude; var outgoingLng = longitude; var id = userID; $.ajax({ url: '/coords', type: 'POST', contentType: 'application/json', dataType: 'json', data: JSON.stringify({lat: outgo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pushCoords()\n\t{\n\t\tvar lat=$(\"#lat\").text();\n\t\tvar lng=$(\"#lng\").text();\n\t\t\tvar d =$(\"#distfromyou\").val();\n\t\t\n\t\tif ($(\"#sid\")==null) return;\n\t\tvar sid=$(\"#sid\").val();\n\t\tif (sid==null)\n\t\t\treturn;\n\n\t\t$(\"#sid\").attr(\"readonly\",\"readonly\");\n\t\t$(\"#sid\").att...
[ "0.68725246", "0.62581384", "0.60495186", "0.59573287", "0.59043545", "0.5902782", "0.58644253", "0.58233196", "0.57764554", "0.5713152", "0.56956595", "0.56887907", "0.5669249", "0.5664461", "0.56373847", "0.5606896", "0.56042314", "0.56000274", "0.558216", "0.55615044", "0....
0.70568156
0
new state of previously dead cells
function newState2(counter, deadCell) { var $this = deadCell; if (counter >= genMin && counter <= genMax){ if ($this.is('.livedb4')){ $this.attr('bgcolor', '#29228e'); } else { $this.attr('bgcolor', '#29228e'); $th...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "step() {\n //sets the board with placeholders\n let newState = new Array(this.width).fill('placeholder').map(ele => []);\n\n this.forEachCell((cell, row, col) => {\n newState[row][col] = this.aliveOrDeadCells(cell, row, col)\n })\n this.applyState(newState)\n\t}", "update()\r\n {\r\n ...
[ "0.67767084", "0.66706383", "0.6646437", "0.66141194", "0.65893996", "0.64505774", "0.6421159", "0.6335307", "0.63280225", "0.6312063", "0.630867", "0.6296037", "0.6270876", "0.62616116", "0.62271535", "0.6189652", "0.6186034", "0.6151255", "0.6137525", "0.61253214", "0.61212...
0.6831341
0
function to check the level of the progress bar
checkLevelOfProgressBar() { if (this.state.currentStatus.state === "DELIVERED") { return 100; } else if (this.state.currentStatus.state === "PACKAGE_RECEIVED") { return 34; } else if (this.state.currentStatus.state === "TICKET_CREATED") { return 0; } else { return 67; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkPct() {\n cy.get('.progress-bar').invoke('text').then(val => {\n\n var pct = parseInt(val.replace(/\\D/g, \"\"))\n\n // Without an explicit wait, the test spirals into an infinite loop\n // before the bar even starts moving\n cy.wait(100)\n\n ...
[ "0.7133793", "0.64572", "0.63935775", "0.635317", "0.6261341", "0.6258488", "0.6255978", "0.6255066", "0.6210386", "0.616219", "0.6138815", "0.61384684", "0.61238974", "0.60810745", "0.60413456", "0.60389763", "0.5970763", "0.59694993", "0.5939846", "0.59216326", "0.5890752",...
0.81686336
0