Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
End Helper Functions Begin Main Functions build the nav
function buildNav () { const fragment = document.createDocumentFragment(); const section_num = document.getElementsByClassName('landing__container'); for (let i = 1; i <= section_num.length; i++) { const newElement = document.createElement('li'); newElement.innerText = 'Section ' +...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function buildNavigation() {\n getSectionDetails();\n const nav = document.querySelector('#navbar__list');\n let navigation = '';\n for (let i = 0; i < sectionHeadings.length; i ++){\n // During initialisation, for the first nav item, use active state. For others, use standard state.\n na...
[ "0.74184036", "0.734599", "0.7277659", "0.71387225", "0.71048945", "0.70997626", "0.7038657", "0.70181227", "0.7008169", "0.6992675", "0.6944498", "0.69414985", "0.69396406", "0.6896925", "0.6884943", "0.6869996", "0.68690044", "0.685986", "0.6829289", "0.68258816", "0.677724...
0.6543993
47
Add class 'active' to section when near top of viewport
function addActiveClass(selector, class_name) { const sections = document.querySelectorAll(selector); const menu_items = document.querySelectorAll('.menu__link') for (let i = 0; i < sections.length; i++) { const section = sections[i]; const item = menu_items[i]; document.addEventList...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addActive() {\n sections.forEach(section => {\n const bounding = section.getBoundingClientRect();\n const sectionLink = document.querySelector(`a[href=\"#${section.getAttribute('id')}\"]`);\n const sectionHalfShown = section.offsetTop - (section.offsetHeight / 2);\n const sectionBehind = sect...
[ "0.7863753", "0.77333903", "0.7658542", "0.76350677", "0.7598333", "0.757019", "0.7561573", "0.7526791", "0.74802244", "0.74613166", "0.7449129", "0.74066305", "0.7391682", "0.73624265", "0.734945", "0.730748", "0.72757405", "0.72489023", "0.7228492", "0.7211652", "0.7202904"...
0.6632747
72
Scroll to anchor ID using scrollTO event
function scrollToSection() { const anchors = document.getElementsByClassName('scroll_to'); for (let i = 1; i <= anchors.length; i++) { let anchor = anchors[i-1]; anchor.addEventListener('click', function() { const section = document.getElementById('section' + i); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function scrollToAnchor(aid){\n var aTag = $(aid);\n var offSet = aTag.offset().top - 50;\n $('html,body').animate({scrollTop: offSet},'fast');\n }", "function goToByScroll(id) {\n $('html,body').animate({scrollTop: $(id).offset().top - 70}, 'slow');\n }", "function go...
[ "0.7818578", "0.77598286", "0.77598286", "0.77543926", "0.7743901", "0.7709342", "0.76487756", "0.7635304", "0.7635304", "0.7635304", "0.76170677", "0.76098096", "0.760885", "0.75889826", "0.75889826", "0.75889826", "0.7551641", "0.7551641", "0.7545856", "0.7545856", "0.75391...
0.0
-1
funcion para ingregar el nombre de la img en el input de texto
function getLink(link,id){ //alert(link); $("#imgLink").val(link); $("#getIdLink").val(id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "limpiarInputFoto(img, input, texto) {\r\r\n img.attr(\"src\", \"Imagenes/template.png\");\r\r\n input.val(\"\");\r\r\n texto.html(\"Click para subir una foto\");\r\r\n }", "function inputText() {\n memeChoise.text = elInput.value;\n // memeChoise.upperText = memeChoise.text.\n d...
[ "0.68156916", "0.6293101", "0.6282227", "0.62798697", "0.61647725", "0.61345285", "0.6129417", "0.6111185", "0.6038642", "0.59959847", "0.59712136", "0.5956676", "0.5939261", "0.59136593", "0.5904093", "0.5885982", "0.58823913", "0.5867611", "0.5851282", "0.58342445", "0.5833...
0.0
-1
given the movie title, let's make a url
function makeIMDbUrl(movietitle) { var imdburl = 'http://www.imdb.com/find?q='+ movietitle +';tt=on;nm=on;mx=20;'; return imdburl; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeIMDbUrl(movietitle) {\n\t\tvar imdburl = 'http://www.imdb.com/find?q='+ encodeURIComponent(movietitle) +';tt=on;nm=on;mx=20;';\n\t\treturn imdburl;\n\t}", "function makeNetflixUrl(movietitle) {\r\n\t\tvar Netflixurl = 'http://www.netflix.com/Search?v1='+ escape(movietitle);\r\n\t\treturn Netflixurl;...
[ "0.7134664", "0.6973424", "0.6614098", "0.650664", "0.630409", "0.6300527", "0.6283484", "0.6283484", "0.6230167", "0.62160265", "0.61969966", "0.6134357", "0.6114822", "0.61099404", "0.610328", "0.6034795", "0.5980471", "0.59640604", "0.5961667", "0.59535086", "0.59488845", ...
0.71711093
0
Create a link node with supplied data (title, rating, votes)
function makeIMDbLink(movietitle,movierating,movievotes, movieUrl, tagLine) { var container = document.createElement("span"); container.appendChild(document.createTextNode(" ")); var newLink = document.createElement("a"); newLink.setAttribute("href", movieUrl); newLink.setAttribute("target", "imdb"); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Node(id, data) {\n this.id = id;\n this.links = null;\n this.data = data;\n}", "function Node(id, data) {\n this.id = id;\n this.links = null;\n this.data = data;\n}", "function generate_link_element(link_data) {\n\tvar link = document.createElement(\"a\");\n\tlink.classList.add(\"link\");\n\tli...
[ "0.61039203", "0.61039203", "0.59924436", "0.5980047", "0.5936384", "0.5821182", "0.58177173", "0.581498", "0.5813846", "0.5793992", "0.5776143", "0.56610537", "0.5654613", "0.5654613", "0.5646638", "0.5617481", "0.5612776", "0.5604971", "0.5593503", "0.5545735", "0.55399543"...
0.0
-1
Scrape all movie titles from the index page (all links with class="filmname")
function getMovieTitles() { var findPattern = "//a[contains(@class, 'filmname')]"; var resultLinks = document.evaluate( findPattern, document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null ); var result = new Array(); var i=0; while ( (res = resultLinks.snapshotItem(i) )...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function allMovieTitleLinks() {\n return $('.movie .name a')\n}", "function loadMovies() {\n\t// Loop through first half array\n\tfor (var i=0;i<items.length/2;i++) {\n\t\tvar object = get_one_recommended_movie(i);\n\n\t\titems[i].children[0].children[1].children[0].innerHTML = object.name;\n\n\t\t// Set link t...
[ "0.7410419", "0.6848059", "0.6461625", "0.6371322", "0.63118833", "0.62452877", "0.620409", "0.61832476", "0.6164955", "0.6064411", "0.60536826", "0.60522854", "0.6049619", "0.6045573", "0.602872", "0.60277694", "0.5999617", "0.5996692", "0.59655875", "0.59274614", "0.5922711...
0.7779172
0
Fetch ratings for this movie title and append link node in document
function insertRating(node) { var title = removeProblematicChars(node.innerHTML.toLowerCase()); newurl = url + "?t=" + escape(title) + "&y=2005"; GM_xmlhttpRequest({ method:"GET", url:newurl, onload:function(result) { //remove xml declaration for XML() to work! var xmlD...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addRatings() {\n OMDBProvider.getMovie(vm.film.imdb_id).then(movie => {\n vm.film.ratings = movie.Ratings;\n getTrailers();\n })\n }", "function insertIMDbLinks() {\n\t\tvar movieNodes = getMovieTitles();\n \n\t\tvar i=0;\n while (...
[ "0.62621814", "0.6211314", "0.610048", "0.6044574", "0.6016381", "0.60112363", "0.5991729", "0.598349", "0.59679854", "0.586765", "0.58173704", "0.57802695", "0.5711075", "0.5657008", "0.565337", "0.5626846", "0.562358", "0.56159985", "0.56099194", "0.560343", "0.5590468", ...
0.6583159
0
Strip or replace cahracters/phrases that cause problems when looking up ratings & > and, trim spaces, remove (YEAR), remove (ST)
function removeProblematicChars(text) { var result = trimString(text); var result = result.replace(/&amp;/,'and').replace(/\s\(\d+\)/,'').replace(/\(\sst\s\)\s/,''); return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clean( w ){\n\treturn w.replace(/[^\\d\\w\\s,().\\?\\/\\\\n\\\\t{}<>=\\\"\\\":%-]/gi, '') // remove special chars\n\t\t\t.replace(/\\s+/g, \" \") // remove extra spaces\n\t\t\t.trim(); // remove trailing chars\n}", "function cleanUp(str) {\n\treturn str.replace(/<!--[\\w\\W]+?-->/g,'')\n\t\t.replace(/\...
[ "0.6336515", "0.6307293", "0.6251884", "0.6222688", "0.621307", "0.616657", "0.60299057", "0.5996469", "0.59954", "0.5953981", "0.58956456", "0.5893552", "0.5877306", "0.5830849", "0.5830849", "0.5830849", "0.5822966", "0.58060867", "0.579558", "0.5771171", "0.57696176", "0...
0.60823256
6
Trim leading and trailing spaces, is there no better way in JS?
function trimString (str) { var tStr = str.replace(/^\s+/g, '').replace(/\s+$/g, ''); return tStr; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function trim(s) { return s.replace(/^\\s+|\\s+$/g, ''); }", "function ltrim()\n{\n return this.replace( /^\\s+/g,'');\n}", "function trim(string) { return string.replace(/^\\s+|\\s+$/g , ''); }", "function di_trim(s) {\n var temp = s;\n return temp.replace(/^\\s+/,'').replace(/\\s+$/,'');\n}", "fun...
[ "0.7852352", "0.77933234", "0.7745009", "0.77094036", "0.7610386", "0.75367856", "0.75270265", "0.75239205", "0.7517778", "0.75100774", "0.75064194", "0.7473772", "0.7467464", "0.7457013", "0.7457013", "0.7423693", "0.7418575", "0.74174404", "0.7415403", "0.7415403", "0.74154...
0.0
-1
Main wrapper function that is executed by FireFox
function insertIMDbLinks() { var movieNodes = getMovieTitles(); var i=0; while ( movieNodes[i] !=null ) { insertRating(movieNodes[i]); i++; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function main(){\r\n}", "function main(){\n\t\n}", "function Main()\n {\n \n }", "function browser(){}", "function browser(){}", "function main() {\n}", "function ChildBrowser() {\n}", "function main(){\n\n\n}", "function main() {\n\n}", "function _main() {\n try {\n ...
[ "0.65953875", "0.65203744", "0.6404821", "0.6338292", "0.6338292", "0.6286658", "0.6237027", "0.6232812", "0.6209442", "0.6193743", "0.61146945", "0.6005074", "0.59356064", "0.5922131", "0.58880365", "0.584276", "0.5837822", "0.5836967", "0.5720293", "0.57006186", "0.5694905"...
0.0
-1
helper returns the swap index for the given from and pivot assumes nums after pivot are sorted
function getSwapIndex(nums, from, pivot) { let i; for (i = from; i < nums.length; i++) { if (nums[i] > pivot) { return i; } } return -1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getPivotIndex(nums) {\n let i = nums.length - 2;\n let j = nums.length - 1;\n while (i >= 0) {\n if (nums[i] < nums[j]) {\n return i;\n }\n i--;\n j--;\n }\n return -1;\n}", "function pivot(arr, start = 0, end = arr.length - 1) {\n // Swap functio...
[ "0.7335191", "0.7162682", "0.71486455", "0.71058613", "0.7076594", "0.7063631", "0.6988816", "0.69835687", "0.69835687", "0.69714653", "0.69386756", "0.69057286", "0.69046366", "0.6883237", "0.6883237", "0.68673325", "0.68393666", "0.68216836", "0.67504114", "0.67253906", "0....
0.8931718
0
helper returns the pivot's index assumes nums.length is >= 2
function getPivotIndex(nums) { let i = nums.length - 2; let j = nums.length - 1; while (i >= 0) { if (nums[i] < nums[j]) { return i; } i--; j--; } return -1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSwapIndex(nums, from, pivot) {\n let i;\n for (i = from; i < nums.length; i++) {\n if (nums[i] > pivot) {\n return i;\n }\n }\n return -1;\n}", "function findPivot(arr) {\n // logic is similar to binary search but instead you are only\n // moving one number up o...
[ "0.7870308", "0.7388299", "0.7125082", "0.6983415", "0.6971729", "0.6901897", "0.6894743", "0.68873936", "0.68873805", "0.68873805", "0.6865138", "0.6823807", "0.68153", "0.68091124", "0.68091124", "0.6805274", "0.6777173", "0.67715484", "0.67472905", "0.674655", "0.67192453"...
0.8556127
0
helper sort the given nums inplace cheats a little for now by using extra memory so we can use builtin sort improve later by implementing subarray sorting
function sort(nums, from) { const temp = nums.slice(from); temp.sort((n1, n2) => n1 - n2); let i; for (i = temp.length - 1; i >= 0; i--) { nums[from + i] = temp[i]; } return nums; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function MergeSort(nums) {\n\tif (nums.length < 2) return nums;\n\n\tvar middle = Math.floor(nums.length / 2);\n\tvar left = nums.slice(0, middle);\n\tvar right = nums.slice(middle, nums.length);\n\n\treturn merge(MergeSort(left), MergeSort(right));\n}", "function selectionSort(nums){\n for(var i=0; i < nu...
[ "0.7027825", "0.6923927", "0.6923897", "0.68978", "0.6871222", "0.68576646", "0.6836453", "0.6778894", "0.6705297", "0.6697153", "0.6650491", "0.66461754", "0.66221005", "0.6614722", "0.65942556", "0.65700763", "0.6520775", "0.6520775", "0.6512146", "0.6461088", "0.6428937", ...
0.6400642
23
This will be called externally, to render the scene
render() { const { height, width } = this.props const containerStyles = { width, height, margin: 0, overflow: 'hidden' } return <div ref={this._container} style={containerStyles} /> }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function render() {\n\t// actually display the scene in the Dom element\n\trenderer.render( scene, camera );\n}", "render() {\n\t\trenderer.render(scene, camera);\n\t}", "render() {\n\t\trenderer.render(scene, camera);\n\t}", "function render()\n {\n renderer...
[ "0.85837036", "0.8499652", "0.8499652", "0.84483755", "0.8437637", "0.8418247", "0.84007806", "0.83881074", "0.83259827", "0.8286511", "0.82732475", "0.82584405", "0.82584405", "0.82584405", "0.82519084", "0.8237774", "0.8219699", "0.8219699", "0.818419", "0.81765616", "0.817...
0.0
-1
dynamically creates HTML cards and adds to page
function generateCard(card) { return `<li class="card" data-card="${card}"><i class="fa ${card}"></i></li>`; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateCard(result){\nvar html = weatherTemplate;\n$(\"#cards\").append(html);\n}", "function createCard() {\n\n $(\"#card-div\").empty();\n\n $(\"#card-div\").html(\n \"<div class='card'>\" +\n \"<h5 class='card-header' id='event'></h5>\" +\n \"<div class='card-body'>\" +\n \...
[ "0.7538956", "0.7444483", "0.7244544", "0.72373104", "0.7233379", "0.7222329", "0.7196458", "0.7175949", "0.7169471", "0.7147648", "0.714671", "0.7145051", "0.7135275", "0.71087253", "0.71034676", "0.7101254", "0.7091819", "0.7081862", "0.7068749", "0.70614547", "0.70608103",...
0.0
-1
Display the cards on the page shuffle the list of cards using the provided "shuffle" method below loop through each card and create its HTML add each card's HTML to the page Shuffle function from
function shuffle(array) { var currentIndex = array.length, temporaryValue, randomIndex; while (currentIndex !== 0) { randomIndex = Math.floor(Math.random() * currentIndex); currentIndex -= 1; temporaryValue = array[currentIndex]; array[currentIndex] = array[randomIndex]; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createHTML() {\n let cardList = shuffle(myCards);\n cardList.forEach(function(card) {\n $(\".deck\").append('<li><i class=\"card fa ' + card + '\"></i></li>');\n })\n}", "function shuffleCards() {\n let shuffledCards = shuffle(cardsArray);\n\n for (let i = 0; i < shuffledCards.length; i++) {\n ...
[ "0.78765905", "0.7812713", "0.7795754", "0.77613914", "0.7732148", "0.76940626", "0.769223", "0.7622959", "0.7617408", "0.7617119", "0.7549082", "0.7543181", "0.7543003", "0.7542052", "0.75338775", "0.7510985", "0.7509751", "0.7505815", "0.7502341", "0.7497395", "0.7494171", ...
0.0
-1
Function that goes through each card, adds event listener, adds open/show classes when clicked, and adds match class when they match
function activateCards() { allCards.forEach(function(card) { card.addEventListener('click', function(e) { console.log("A card was clicked!"); if (!card.classList.contains('open') && !card.classList.contains('show') && !card.classList.contains('match')) { openCards.push...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clickCards(){\r\n let allCards = document.querySelectorAll('.card');\r\n let i, cardName;\r\n for (i = 0; i < allCards.length; i++) {\r\n allCards[i].setAttribute(cardName, deckOfCards[i]);\r\n }\r\n // To Read the card name use\r\n // allCards[i].getAttribute(cardName);\r\n let openCards = [];\...
[ "0.7837977", "0.78324944", "0.7792491", "0.77878314", "0.77845395", "0.77828324", "0.7778027", "0.7696576", "0.76852965", "0.7658755", "0.76580244", "0.7654082", "0.76442194", "0.76440173", "0.76361203", "0.76334035", "0.75926363", "0.75922745", "0.7590508", "0.7567688", "0.7...
0.83321637
0
checks for first click, starts timer
function startGame() { allCards.forEach(function(card){ card.addEventListener('click', function(){ if(initialClick === false) { initialClick = true; clockOff = false; startTimer(); } }) }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function moveCounter(){\n moves++;\n counter.innerHTML= moves;\n //start timer on first click\n if(moves == 1){\n second = 0;\n minute = 0; \n hour = 0;\n startTimer();\n } \n}", "function onStartClick() {\n resetTimer();\n interval = setInterval(function () {\n ...
[ "0.6850515", "0.68172723", "0.6768463", "0.6727973", "0.66885173", "0.6673724", "0.65799445", "0.6546596", "0.64121497", "0.6385715", "0.63715714", "0.6361816", "0.6323524", "0.6301957", "0.6299845", "0.62692904", "0.6228496", "0.6219589", "0.62188417", "0.617209", "0.6165039...
0.643066
8
adds a move to move counter
function addMove () { moves++; var movesCounter = document.querySelector('.moves'); movesCounter.innerHTML = moves; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addMove() {\n moves++;\n movesCount.innerHTML = moves;\n // start timer after first move\n if (moves == 1) {\n startTimer();\n }\n\n // Set rating after each move\n rating();\n }", "function moveCounter() {\n app.moves++;\n app.counter.innerHTML = app.moves;\n if (app...
[ "0.79117227", "0.7705796", "0.7605166", "0.7512613", "0.74930286", "0.7453232", "0.737568", "0.7362057", "0.73355865", "0.7334815", "0.7292384", "0.7282368", "0.7255038", "0.724579", "0.72359115", "0.72093916", "0.72017205", "0.70561165", "0.7032967", "0.6996129", "0.6986756"...
0.753269
3
removes a star grade in gradients
function checkScore() { if (moves === 10 || moves === 20) { removeStar(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "lighten() {\n this.pweighted = false;\n this.psquare.classList.remove('square--weighted');\n }", "function removeStar() {\n\tlet stars = document.querySelectorAll(\".fa-star\");\n\tif (stars.length === 1) {\n\t\treturn;\n\t}\n\tfor (let star of stars) {\n\t star.parentNode.remove();\n\t re...
[ "0.6128283", "0.6003096", "0.5980248", "0.5961858", "0.5956821", "0.59058714", "0.58958554", "0.58007854", "0.57851094", "0.57806706", "0.5764264", "0.574223", "0.57326424", "0.57226133", "0.57068604", "0.56872034", "0.56697994", "0.5581686", "0.5528567", "0.5528567", "0.5515...
0.0
-1
converts time after 60 seconds to minutes
function startTimer() { timer = setInterval(function(){ seconds++; if(seconds == 60) { minutes++; seconds = 0; } console.log(formatTime()); displayTime(); }, 1000); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function turnHoursToMinutes() {}", "function turnHoursToMinutes() {}", "function turnHoursToMinutes() {}", "function turnHoursToMinutes() {}", "function turnHoursToMinutes() {}", "function turnHoursToMinutes() {}", "function turnHoursToMinutes() {}", "function time_conversion(minutes) {}", "functio...
[ "0.7777226", "0.7777226", "0.7777226", "0.7777226", "0.7777226", "0.7777226", "0.7777226", "0.76848656", "0.7650148", "0.76338285", "0.7598035", "0.7595157", "0.7532253", "0.74831647", "0.738515", "0.73755467", "0.7354323", "0.73500705", "0.7214125", "0.72115934", "0.7204657"...
0.0
-1
used to display the time in modal
function displayTime() { const clock = document.querySelector('.clock'); console.log(clock); clock.innerHTML = formatTime(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function currentTime(){\n var getHour = moment().format('HH');\n var getMin = moment().format('mm');\n var getMonth = moment().format('MMMM');\n var getDay = moment().format('Do');\n var getYear = moment().format('YYYY');\n $('.month').text(getMonth);\n $('.day').te...
[ "0.7553795", "0.7383973", "0.73761654", "0.72236025", "0.7182131", "0.71814704", "0.7139611", "0.7065134", "0.70481664", "0.7041707", "0.70110804", "0.697119", "0.6930752", "0.6929097", "0.6920628", "0.6913482", "0.69121677", "0.69057053", "0.69019455", "0.6901298", "0.689273...
0.0
-1
adds stats to modal window
function writeModalStats() { const timeStat = document.querySelector('.modal__time'); const clockTime = document.querySelector('.clock').innerHTML; const movesStat = document.querySelector('.modal__moves'); const starsStat = document.querySelector('.modal__stars'); const stars = getStars(); tim...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function writeModalStats() {\n\tconst timeStat = document.querySelector('.modal_time');\n\tconst clockTime = document.querySelector('.clock').innerHTML;\n\tconst movesStat = document.querySelector('.modal_moves');\n\tconst starsStat = document.querySelector('.modal_stars');\n\tconst stars = getStars();\n\t\n\ttime...
[ "0.6929264", "0.6892564", "0.6846122", "0.6775491", "0.6772365", "0.67260504", "0.672377", "0.6722736", "0.6666268", "0.6650846", "0.6649396", "0.65810317", "0.6528118", "0.65030986", "0.64929855", "0.6469024", "0.638615", "0.6362549", "0.635077", "0.6321477", "0.6310799", ...
0.68138915
3
retrieves stars to add to modal stats
function getStars() { stars = document.querySelectorAll('.stars li'); starCount = 0; for (star of stars) { if (star.style.display !== 'none') { starCount++ } } console.log(starCount); return starCount; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function modalStarsStats(){\n var modalStars = document.querySelector('.modal-stars');\n var starsStats = document.querySelectorAll('.stars li');\n var starCount = 0;\n for (star of starsStats){\n if (star.style.display != 'none'){\n starCount++;\n }\n }\n modalStars.inne...
[ "0.6956873", "0.6903283", "0.682719", "0.6639326", "0.66081315", "0.65817344", "0.65545774", "0.6547107", "0.65284604", "0.6527223", "0.64433503", "0.6396669", "0.63713735", "0.6340763", "0.62268096", "0.62246174", "0.6176938", "0.6175719", "0.61747867", "0.6159496", "0.61538...
0.0
-1
resets game completely, resets game, resets clock, resets stars, restarts game/activates the click event listener
function resetGame() { resetClockAndTime(); resetMoves(); resetStars(); initGame(); activateCards(); startGame(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "resetGame() {\n DATA.boardCells = [0, 1, 2, 3, 4, 5, 6, 7, 8];\n VIEW.resetView();\n document.getElementById(\"main-game\").addEventListener('click', MODIFIER.turn, false);\n }", "function resetGame(){\t\t\n\thasStarted=false;\n\tinput=-1;\n\tsequence=[];\n\tlevel=0;\n\tdisplay(\"--\");\n\tsetTi...
[ "0.80244416", "0.7709345", "0.76599914", "0.75657046", "0.7523756", "0.7519188", "0.75072145", "0.75011826", "0.7484836", "0.7476817", "0.7453435", "0.74143517", "0.7413423", "0.7410183", "0.74054664", "0.73996323", "0.7384717", "0.73768777", "0.737154", "0.73703456", "0.7360...
0.7500875
8
resets clock to 0
function resetClockAndTime() { stopTimer(); clockOff = true; hour = 0; minutes = 0; seconds = 0; displayTime(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resetClockAndTime() {\n\tstopClock();\n\tclockOff = true;\n\ttime = 0;\n\tdisplayTime();\n}", "function resetTime () {\nstopClock();\ntimerOff = true;\ntime = 0;\ncountTime();\n}", "function resetClock() {\r\n centiSec = 0;\r\n sec = 0;\r\n secSaved = 0;\r\n gameIsStarted = false;\r\n c...
[ "0.8187637", "0.8011422", "0.7957492", "0.78612727", "0.78165233", "0.7802497", "0.7667117", "0.7637796", "0.7601174", "0.7562511", "0.75035137", "0.7493561", "0.745517", "0.7409765", "0.73918486", "0.73918486", "0.73177254", "0.73128253", "0.727017", "0.72623557", "0.7249459...
0.8139283
1
pops modal, stops timer, gathers game stats
function gameOver() { stopTimer(); toggleModal(); writeModalStats(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gameOver() {\n stopClock();\n writeModalStats();\n toggleModal();\n}", "function winGame() {\n stopTimer();\n toggleModal();\n}", "function gameOver() {\n\tstopTimer();\n\tupdateModal();\n\ttoggleModal();\n}", "function congratsPopup() {\n stopTimer();\n\n popup.style.visibility =...
[ "0.73912287", "0.73908025", "0.7145293", "0.7101805", "0.7091362", "0.70406216", "0.70374316", "0.6892552", "0.6883395", "0.68765867", "0.6826641", "0.67825675", "0.6766892", "0.6758757", "0.6756223", "0.6740938", "0.6726012", "0.6678632", "0.6674757", "0.6664316", "0.6658329...
0.77717954
0
checks for game over when 8 matches are made
function checkForGameOver() { if (matched === totalPairs) { gameOver(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gameOver() {\n return matchedCounter === 8;\n}", "function checkWin() {\n match_found += 1;\n if (match_found === 8) {\n showResults();\n }\n}", "function checkForMatch() {\n if (firstCard.dataset.framework === secondCard.dataset.framework) {\n countMatch ++;\n // In case ...
[ "0.8638692", "0.76609266", "0.75910723", "0.75117224", "0.7477974", "0.74766076", "0.7345884", "0.7319959", "0.72693884", "0.7258826", "0.72401494", "0.72117007", "0.7158232", "0.7143251", "0.7131258", "0.7125256", "0.7059623", "0.7034147", "0.7016181", "0.7014564", "0.699811...
0.7846911
1
resets game, toggles modal (hides)
function replayGame() { resetGame(); toggleModal(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function restartGameFromModal() {\n modal.style.display = \"none\";\n newGame();\n}", "function replayGame() {\n\tresetGame();\n\ttoggleModal();\n}", "function replayGame() {\n\tresetGame();\n\ttoggleModal();\n}", "function playAgain(){\n modal.classList.remove(\"show\");\n resetGame();\n}", "f...
[ "0.81814116", "0.7967547", "0.7967547", "0.78793025", "0.7828998", "0.77342165", "0.7649976", "0.75262177", "0.75243515", "0.7497202", "0.7430356", "0.7427676", "0.7409393", "0.73847413", "0.73599344", "0.72490287", "0.7236509", "0.7230621", "0.7224967", "0.72159374", "0.7212...
0.8151381
2
set up the event listener for a card. If a card is clicked: display the card's symbol (put this functionality in another function that you call from this one) add the card to a list of "open" cards (put this functionality in another function that you call from this one) if the list already has another card, check to se...
function initGame() { var deck = document.querySelector('.deck') var cardHTML = shuffle(cards).map(function(card) { return generateCard(card); }); deck.innerHTML = cardHTML.join(''); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clickCard(event) {\n // discard clicks on already matched or open cards\n if (event.target.nodeName === 'LI'\n && !(event.target.classList.contains(\"match\"))\n && !(event.target.classList.contains(\"open\")) ) {\n\n clickCounter += 1;\n\n if(clickCounter == 1) {\n st...
[ "0.84650975", "0.8290534", "0.8274512", "0.821721", "0.8083014", "0.80800116", "0.8069711", "0.80243254", "0.8019993", "0.7953358", "0.789378", "0.78573424", "0.7856824", "0.78423184", "0.7832454", "0.7811691", "0.7800598", "0.7800118", "0.7790354", "0.7782452", "0.77662545",...
0.0
-1
Function to pass filter to parent
updateFilter(){ if( //IF any of the inputs are invalid, alert this.state.minPrice < 0 || this.state.maxPrice < 0 || this.state.stat1 < 0 || this.state.stat2 < 0 ) { alert("Invalid Input!"); } else { //If inputs are valid, call prop-fun...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "filter() {\n\t}", "filter() {\n\t}", "function FilterDialog(parent){this.parent=parent;}", "function filter() {\n \n}", "function filter(parent$, fn) {\n\tvar newStream = stream(fn(parent$.value) ? parent$.value : null);\n\tparent$.listeners.push(function filterValue(value) {\n\t\tif (fn(value)) {\n\t\t...
[ "0.7040267", "0.7040267", "0.67506516", "0.66862357", "0.66210973", "0.65042365", "0.65042365", "0.6504202", "0.6476588", "0.6349101", "0.61671025", "0.60874623", "0.6064305", "0.6056781", "0.6040128", "0.6025908", "0.6008403", "0.5998406", "0.59667844", "0.5936037", "0.59337...
0.0
-1
function to set filterstate back to initial state
removeFilter() { this.setState({ rarity: "0", type: "0", minPrice: 0, maxPrice: 0, stat1: 0, stat2: 0 }) this.props.removeFilter(); this.props.toggleClose(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "startupFilter() {\n this.setdefault()\n let startupfilter = this.state.startupfilter\n if (!startupfilter) {\n startupfilter = true\n } else if (startupfilter) {\n startupfilter = false\n }\n this.setState({ startupfilter })\n }", "resetFilters (...
[ "0.7348857", "0.7327864", "0.7220413", "0.7040906", "0.69726735", "0.6965589", "0.6923078", "0.68680525", "0.6860536", "0.6796469", "0.6789046", "0.67815655", "0.6765963", "0.6739901", "0.6739901", "0.6739901", "0.6739901", "0.6739901", "0.6739901", "0.6739901", "0.6739901", ...
0.0
-1
Take the data and marshall it then unmarshall it
function marshallAndUnmarshall(signature, data, unmarshall_opts) { var marshalledBuffer = marshall(signature, data); var result = unmarshall( marshalledBuffer, signature, undefined, unmarshall_opts ); return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "rehydrate(data) {\n this.internalData = JSON.parse(uncompress(data));\n }", "_inflate(data) {\n for (var key in data)\n this[key] = data[key];\n }", "function marshal(dataSpace, data) {\n\tif (!data)\n\t\treturn;\n\t\n\tif (data.isMjEntity) {\n\t\tif (dataSpace && dataSpace.matches(data.data...
[ "0.6349593", "0.6073114", "0.5881406", "0.5728604", "0.5708206", "0.5682737", "0.55318975", "0.5468987", "0.540321", "0.5351722", "0.5340617", "0.53017175", "0.5294279", "0.5209512", "0.5132902", "0.5114939", "0.5072821", "0.502925", "0.5014315", "0.4991883", "0.49428728", ...
0.66784716
0
Enable or disable the Material Design Switch based on the enable parameter passed
function enableSwitch(enable) { // Explicit conversion to type Boolean const enabledBool = !!enable; subscriptionSwitch.disabled = !enabledBool; if (!enabledBool) { subscriptionLabel.classList.remove('is-checked'); subscriptionLabel.classList.add('is-disabled'); updateStatus(NOT_SUPPORTED_TEXT); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "enable() {\n\t\tthis.toggle(true);\n\t}", "toggle() {\n this.enabled = !this.enabled;\n }", "function switchOn() {\n setSwitchToggled(!switchToggled);\n }", "function uponEnabled() {\n\tenableSwitchPushed = true;\n\tbuttonLED.writeSync(1);\n\tconsole.log(\"ENABLED\")\n}", "toggleEnabled() {\n...
[ "0.6750361", "0.66518855", "0.66401327", "0.6582778", "0.6545887", "0.65411365", "0.65411365", "0.64770174", "0.64741737", "0.640495", "0.63538516", "0.63458246", "0.63458246", "0.63458246", "0.6328865", "0.6295228", "0.62861305", "0.62770027", "0.62770027", "0.62770027", "0....
0.68009645
0
In order to wait for the operation to complete before anyother operation is started `waitToggle` disables the toggle so it can't be used
function waitToggle() { subscriptionSwitch.disabled = true; subscriptionLabel.classList.add('is-disabled'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "wait() {\r\n this._wait = true;\r\n }", "function execToggle(wait) {\n //cancel any previously set timeout this execution so there is only one pending.\n if (hToggle) {\n $timeout.cancel(hToggle);\n hToggle = null;\n ...
[ "0.6671121", "0.6581988", "0.62628275", "0.62126106", "0.6065804", "0.596396", "0.59581554", "0.58275163", "0.5785553", "0.57805896", "0.5656431", "0.56076515", "0.5582495", "0.55770487", "0.5556964", "0.5551328", "0.5551328", "0.55418956", "0.5539305", "0.5534167", "0.553062...
0.66382307
1
Updates the Statu of the text in the card
function updateStatus(status) { subscriptionStatus.textContent = status; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateCurrentText() {\n curEl.innerText = `${curActCd + 1}/${cardsEl.length}` \n}", "function updateCurrentText() {\n currentEl.innerText = `${currentActiveCard + 1 }/${cardsEl.length}`;\n }", "updateText(text) {\n\t\tthis.text = text;\n\t}", "function updateText(){\n scope.text = scop...
[ "0.6785164", "0.67733246", "0.67067635", "0.6673004", "0.66676486", "0.6584975", "0.6530194", "0.65112555", "0.64699525", "0.6445518", "0.64278877", "0.6333308", "0.6273822", "0.6270604", "0.6227526", "0.6227526", "0.6192579", "0.61785614", "0.61553717", "0.61549646", "0.6152...
0.0
-1
Updates the Switch Status and enables or disabled according to the parameters
function updateSwitch(pushSubscription) { enableSwitch(true); changeSwitch(!!pushSubscription); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateEnabled(cb){\n\t//Log\n\tlog(\"Checking/Changing enable status\");\n\t//Get the pref value\n\texec('plutil -key \"enabled\" /var/mobile/Library/Preferences/com.chronic-dev.CDevReporter.plist', function (err, enabledvalue, stderr) {\n\t\t//Log\n\t\tlog(\"Read enabled value of: \"+(enabledvalue.trim()...
[ "0.66824543", "0.6551828", "0.64857846", "0.63472223", "0.6311208", "0.629631", "0.62686515", "0.6219743", "0.616777", "0.61545163", "0.61545163", "0.61545163", "0.61509746", "0.6115714", "0.60843873", "0.6055572", "0.60538274", "0.6046632", "0.6046318", "0.60408646", "0.6038...
0.6100114
14
Return the database file
dbPath() { var dbfile, found; var locations = []; dbfile = this.config.get( 'cachefile' ); if ( dbfile != '' && dbfile != undefined ) { if ( path.isAbsolute( dbfile ) || fs.existsSync( dbfile ) ) return dbfile; found = findConfig( dbfile, { dir: 'data' } ); if ( found != null ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getDBFilename(name){\n\treturn \"database/\" + name + \".txt\";\n}", "readFromDB() {\n return readFile(\"db/db.json\", \"utf8\");\n }", "function readFile( filename ){\n return fs.readFileSync( path.join(dbFolder(), filename)).toString();\n }", "getSqliteDB() {\n return th...
[ "0.72882926", "0.71691525", "0.69965345", "0.698127", "0.6788772", "0.6658327", "0.6643918", "0.6612074", "0.6594149", "0.6183669", "0.6166989", "0.60984606", "0.6074315", "0.60630864", "0.5987325", "0.5982212", "0.5959197", "0.59316677", "0.5924178", "0.5923937", "0.59084255...
0.630127
9
! Vue.js v2.1.8 (c) 20142016 Evan You Released under the MIT License.
function r(t){return null==t?"":"object"==typeof t?JSON.stringify(t,null,2):String(t)}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "mounted() {\n }", "mounted() {\n\n }", "mounted() {\n\n }", "constructor() {\n this.vue = new Vue();\n }", "mounted() {\n /* eslint-disable no-console */\n console.log('Mounted!');\n /* eslint-enable no-console */\n }", "created () {\n\n }", "created () {...
[ "0.7010019", "0.69773436", "0.6956064", "0.66578186", "0.6493504", "0.6491396", "0.6491396", "0.6402004", "0.6392541", "0.63785356", "0.6370798", "0.62939173", "0.6286827", "0.62834245", "0.62834245", "0.627493", "0.627493", "0.627493", "0.627493", "0.6270747", "0.62574637", ...
0.0
-1
type one text in the typwriter keeps calling itself until the text is finished
function typeWriter(text, i, fnCallback) { // chekc if text isn't finished yet if (i < (text.length)) { // add next character to h3 document.querySelector("h3").innerHTML = text.substring(0, i+1) +'<span aria-hidden="true"></span>'; // wait for a while and call this function again for next cha...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function type() {\n // Type as long as there are characters left in phrase\n if (char_index <= text[text_index].length) {\n if (!typing) set_typing(true);\n set_typed_text(text[text_index].substring(0, char_index++));\n setTimeout(type, type_delay);\n }\n ...
[ "0.8134806", "0.7946801", "0.77493554", "0.7747313", "0.7702574", "0.7630811", "0.7614043", "0.7600103", "0.7600103", "0.7586072", "0.7555002", "0.75112313", "0.75112313", "0.74557006", "0.7450767", "0.7448072", "0.7438254", "0.74353737", "0.74302804", "0.7421849", "0.7403945...
0.71296954
33
start a typewriter animation for a text in the dataText array
function StartTextAnimation(i) { if (typeof dataText[i] === 'undefined'){ setTimeout(function() { StartTextAnimation(0); }, 20000); } // check if dataText[i] exists if (i <= dataText[i].length) { // text exists! start typewriter animation typeWriter(dataText[i], 0...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function StartTextAnimation(i) {\r\n if (typeof dataText[i] == 'undefined'){\r\n setTimeout(function() {\r\n StartTextAnimation(0);\r\n }, 20000);\r\n }\r\n // check if dataText[i] exists\r\n if (i < dataText[i].length) {\r\n // text exists! start typewrit...
[ "0.84705985", "0.8425488", "0.8423421", "0.8398641", "0.8368707", "0.83426553", "0.8238835", "0.8178536", "0.80250746", "0.78592485", "0.77650225", "0.7303372", "0.71506786", "0.71217304", "0.7065817", "0.7065817", "0.69983804", "0.69718003", "0.69590026", "0.6950085", "0.694...
0.84225845
3
Return all of the articles
function getAllArticles(callback) { db.all("SELECT * FROM Articles", function(err,results) { callback(results); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function list() {\n return db.allDocs({\n /*This tells the server to get all docs that start with article*/\n startkey: 'article',\n endkey: 'article{}',\n inclusive_end: true,\n /*Include not just the key but...
[ "0.76813674", "0.7674215", "0.7458367", "0.7365853", "0.7313694", "0.7202276", "0.72000855", "0.716356", "0.7145757", "0.7142666", "0.71045023", "0.70727694", "0.7003006", "0.679058", "0.6790466", "0.67632776", "0.6758114", "0.67434525", "0.66898483", "0.66795254", "0.6655615...
0.69591135
13
Create a new article given a title, content and username
function createArticle(article,username,callback) { db.run("INSERT INTO Articles VALUES (?,?,?)", [article.title, username, article.content], function(err) { callback(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static create(req, res) {\n const { title, content } = req.body\n const dataUserId = req.userData.id\n\n Article.create({ title, content, UserId: dataUserId })\n .then((newArticle) => {\n res.status(201).json(newArticle)\n })\n .catch((err) => {\n res\n .status(500)\n...
[ "0.7095809", "0.67654246", "0.65793896", "0.6254764", "0.6249764", "0.6244989", "0.62414885", "0.6188629", "0.61745137", "0.61611277", "0.6142857", "0.6136255", "0.61280155", "0.60918564", "0.60757595", "0.6072612", "0.605724", "0.6043718", "0.6033597", "0.60250294", "0.59840...
0.75676495
0
The challenge word will be... we have to find the latest mining hash by asking the contract sha3( challenge_number , minerEthAddress , solution_number )
mineCoins(web3, contractData , minerEthAddress) { var solution_number = web3utils.randomHex(32) //solution_number like bitcoin var challenge_number = contractData.challengeNumber; var target = contractData.miningTarget; var digest = web3utils.solidit...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "mineCoins(web3, miningParameters , minerEthAddress, addressFrom)\n {\n\n\n var solution_number = web3utils.randomHex(32) //solution_number like bitcoin\n\n var challenge_number = miningParameters.challengeNumber;\n var target = miningParameters.miningTarget;\n ...
[ "0.7344562", "0.65998393", "0.6357676", "0.6307072", "0.6301719", "0.61529607", "0.61458486", "0.61458486", "0.58152974", "0.57831025", "0.5760263", "0.5735662", "0.5718843", "0.56968313", "0.5677491", "0.5658329", "0.5627841", "0.5595604", "0.5574112", "0.55699074", "0.55674...
0.74188286
0
function to instantiate the Leaflet map
function createMap() { //create the map using the L.map method var map = L.map('map', { center: [43.07, -89.403], zoom: 15 }); L.control.scale({'position':'bottomright'}).addTo(map); L.tileLayer('https://{s}.basemaps.cartocdn.com/rastertiles/voyager_labels_under/{z}/{x}/{y}{r}.png', { attribut...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initMap() {\n\n //Grap some map textures to use in our app.\n var mbAttr = 'Map data &copy; <a href=\"http://openstreetmap.org\">OpenStreetMap</a> contributors, ' +\n '<a href=\"http://creativecommons.org/licenses/by-sa/2.0/\">CC-BY-...
[ "0.81253874", "0.7944342", "0.7941511", "0.79245037", "0.78711873", "0.7802495", "0.7788358", "0.77855325", "0.777759", "0.77556187", "0.7750983", "0.7708977", "0.7651996", "0.7644368", "0.7634141", "0.7619724", "0.7549151", "0.7548791", "0.75386626", "0.75098455", "0.7486096...
0.75775385
16
Getting data through AJAX
function getData2(data, map) { console.log('getting-data',data) $.when(ajax5(), ajax10(), ajax_res()).then(function(a1, a2, a3) { console.log('DONE',a1, a2, a3) resSymbols(data, a1[0], a2[0], a3[0], map) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_data(){\r\n\t\tvar xhr = new XMLHttpRequest();\r\n\t\txhr.open('GET', 'http://localhost:5001/list', true);\r\n\t\txhr.send(null);\r\n\r\n\t\txhr.onreadystatechange = function() {\r\n\t\t\tif (xhr.readyState == 4 && xhr.status == 200) {\r\n\t\t\t\tmakeTable(xhr.responseText);\r\n\t\t\t\t$(\".table > tb...
[ "0.7152615", "0.70944655", "0.7085701", "0.70524067", "0.68908405", "0.6873779", "0.68206203", "0.6783758", "0.6782631", "0.67236835", "0.66738147", "0.6672879", "0.6634707", "0.66333383", "0.6580682", "0.65772194", "0.6573238", "0.6558907", "0.65586704", "0.65578157", "0.655...
0.0
-1
function to retrieve the data and place it on the map
function getData(map) { $.ajax("data/WITH_to_campus_2.geojson", { /* specify the file format the ajax method is to call*/ dataType: "json", success: function(response) { //var attributes = processData(response) enableMenuButtons(response, map) createBaseSymbols(response, map) } }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getMapData() {\n\t// Map style provided by StipeP on snazzymaps.com\n\tvar styles = [{\"featureType\":\"all\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"weight\":\"2.00\"}]},{\"featureType\":\"all\",\"elementType\":\"geometry.stroke\",\"stylers\":[{\"color\":\"#9c9c9c\"}]},{\"featureType\":\"all\",...
[ "0.7166806", "0.7047758", "0.6838566", "0.6837625", "0.6816968", "0.6808616", "0.67218703", "0.6711572", "0.67023325", "0.66672575", "0.663918", "0.66292626", "0.6629015", "0.65939564", "0.6586525", "0.65758336", "0.65317583", "0.65260977", "0.6524845", "0.6519953", "0.651651...
0.6481911
23
handle Bookmark creation and movement (via Star in browser UI)
async function bookmarkHandler(id,nodeorchange){ let node = null try { node = await chrome.bookmarks.get(String(id)) } catch(error) { // temp bookmark doesn't exist anymore return; } node = node[0] console.log(id,node); // Move the bookmark if it's in one of the base folders (bookmark b...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setBookmark(){\n\tclearBookmarks();\n\taddBookmark();\n}", "function onBookmarkClicked(oll, coll, zbll) {\n // add \"starred\" preset upon first use\n if (!zbllPresets.hasOwnProperty(mbPresetName)) {\n zbllPresets[mbPresetName] = \"{}\";\n }\n var needToRemove = isInBookmarks(oll, col...
[ "0.6820038", "0.659202", "0.6551658", "0.650412", "0.65032446", "0.6378009", "0.6324734", "0.6304004", "0.62685704", "0.62270176", "0.6142781", "0.610171", "0.6100434", "0.6093923", "0.60800815", "0.6060844", "0.6039871", "0.60386115", "0.6026226", "0.60156727", "0.59936637",...
0.5493355
70
Get a predictable Color for each tabGroup title
function getColor(name) { let colors = ["grey", "blue", "red", "yellow", "green", "pink", "purple", "cyan" ] let c = 0 for(var i=0;i<name.length;i++) { c = c + name.charCodeAt(i); } return colors[(c % 8)]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getBgColors (tab) {\n // But for now, let's just make sure what we have so\n // far is working as expected.\n alert('Selected text: ' + tab);\n}", "get title_color() {\n return `${this.map.map.name} &7${this.map.map.version.replace(/([.])/, '&8$1&7')}`\n }", "function assignColors(sta) {\...
[ "0.65442705", "0.63392025", "0.633696", "0.63036716", "0.6283777", "0.6194141", "0.61338496", "0.6053208", "0.5938421", "0.5889027", "0.5866081", "0.58442336", "0.58278304", "0.578581", "0.577172", "0.5762275", "0.57297856", "0.5712362", "0.5704894", "0.56989014", "0.56217974...
0.5167085
64
handle creation & renaming of tab groups
async function tabGroupHandler(group) { // console.log('tgu',tabgroupnames) if(group.title !== ""){ if(tabgroupnames[group.id] === undefined) { tabgroupnames[group.id] = group.title } else if(tabgroupnames[group.id] !== group.title) { console.log(group) tabgroupnames[group.id] = group.t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_insertIntoNewGroup(details) {\n const that = this,\n tab = details.tab,\n tabLabelContainer = details.tabLabelContainer,\n group = details.group,\n groupContainers = that._addGroupContainer(group),\n groupLabel = groupContainers.label,\n gro...
[ "0.69715524", "0.6675973", "0.6583375", "0.64967585", "0.6365528", "0.62205243", "0.6157014", "0.61307365", "0.6127406", "0.6074153", "0.60651076", "0.60600555", "0.60163385", "0.59889895", "0.5983497", "0.5897443", "0.5895542", "0.58522046", "0.5852042", "0.5849614", "0.5818...
0.5651009
26
determines whether a canton has to be initiated on page load.
function activateCanton(iso) { return initWithFollowingCantons.includes(iso) || initMapWithAllCantonsSelected; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkIfCanLoadPage()\n{\n\t// Show the document if canLoadAdminPage is true\n\tif (canLoadFeedbackPage)\n\t{\n\t\t// Show the body\n\t\t$(\"#loadingContainer\").removeClass(\"hidden\");\n\n\t\t// Create new check to see if data loaded\n\t\twindow.checkDataLoaded = setInterval(checkIfDataLoaded,50);\n\n\t\...
[ "0.6300997", "0.6220796", "0.6164097", "0.6164097", "0.610798", "0.60876137", "0.60813236", "0.60720795", "0.6035337", "0.6030918", "0.5989886", "0.5939584", "0.59137416", "0.5906592", "0.588042", "0.5871843", "0.58712584", "0.5856864", "0.5841724", "0.5821304", "0.5815327", ...
0.0
-1
helper function: makes cantonPM.iso comparable to
function getCantonIdFrom(cantonIdWithSuffix) { return cantonIdWithSuffix.substring(0, cantonIdWithSuffix.indexOf('-')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isIsoFormat(value) {\n let dateRegex = RegExp('[0-9][0-9][0-9][0-9]-[0-1][0-9]-[0-3][0-9]$');\n return dateRegex.test(value);\n }", "function isoToBytes(iso) {\n var bytes = buffer_1.Buffer.alloc(20);\n if (iso !== \"XRP\") {\n var isoBytes = iso.split(\"\").map(function (c) { return c.charCo...
[ "0.53861314", "0.52227193", "0.50667363", "0.50587136", "0.50049776", "0.49838993", "0.4962653", "0.49590918", "0.49210852", "0.49064153", "0.49064153", "0.48685583", "0.4866373", "0.4859094", "0.48557806", "0.48327333", "0.48298243", "0.48298243", "0.4812094", "0.4812094", "...
0.0
-1
function clear all item
function clearFunction(event){ if(items.textContent !== ''){ items.textContent = ''; todoItems = []; // setlocalStorage(todoItems); // update local storage localStorage.removeItem('todoItems'); // clear key items.insertAdjacentHTML('beforeend','<div>Clear all !</div>');...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "clearAll()\r\n { \r\n this.selectedItems=[];\r\n this.display = null;\r\n this.value = null;\r\n this.results = null;\r\n this.error = null;\r\n this.icon = false;\r\n this.Focusinputbox = false;\r\n this.source.forEach(function (item) {\r\n item.invisible = false;...
[ "0.8103675", "0.7818067", "0.76676655", "0.76341707", "0.7612511", "0.75796133", "0.7545524", "0.75442636", "0.7503373", "0.7465371", "0.73827416", "0.7363824", "0.7363824", "0.7363824", "0.7361016", "0.7313331", "0.7310977", "0.73015636", "0.73015636", "0.727284", "0.7268407...
0.6925606
57
function set key/value from localstorage
function setlocalStorage(todoItems){ let JSONready = JSON.stringify(todoItems) localStorage.setItem('todoItems',JSONready); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setLS(key,value){\n window.localStorage.setItem(key, JSON.stringify(value));\n\n}", "function setLocalStorageItem(key, value) {\n localStorage.setItem(key, value);\n}", "function setLocalStorage(key, value) {\n \t return localStorageService.set(key, value);\n }", "function setLo...
[ "0.79468125", "0.7809132", "0.7793861", "0.7735202", "0.77138686", "0.77015513", "0.765306", "0.7645143", "0.76200944", "0.7608066", "0.7568963", "0.7532416", "0.7524734", "0.74930996", "0.74890983", "0.7472419", "0.745939", "0.745939", "0.74526745", "0.7449296", "0.7416554",...
0.0
-1
function get key/value from localstorage
function getlocalStorage(){ let getlocalStorage = localStorage.getItem('todoItems'); if(getlocalStorage === 'undefined' || getlocalStorage === null){ todoItems = []; } else { todoItems = JSON.parse(getlocalStorage); addValue(items,todoItems); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_value_from_local_storage(key)\n{\n\ttry\n\t{\n\t\treturn localStorage.getItem(key);\n\t} catch(e)\n\t{\n\t\treturn false;\n\t}\n}", "function retrieFromLocal(key){\n\tconsole.log(\"recovered\");\n\treturn JSON.parse(localStorage.getItem(key));\t\n}", "function get (key) {\n return JSON.parse(wi...
[ "0.7948232", "0.7909471", "0.78205365", "0.7778944", "0.77613765", "0.77549195", "0.7679167", "0.76779187", "0.76508933", "0.76100594", "0.7600916", "0.7585359", "0.7551586", "0.752084", "0.7509142", "0.75077814", "0.7494896", "0.7479499", "0.7479499", "0.746829", "0.74312943...
0.0
-1
function add item todolist
function addValue(todoName,todoItems){ // Javascript Template Literals todoName.textContent = ''; todoItems.forEach(function(item){ todoName.insertAdjacentHTML('beforeend', `<div class='option'> <div class="list_item">${item}</div> <div class="list...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addTodo(item) {\n todoList.push(item);\n}", "function addToDoItems(todoItem) {\n const listItem = document.createElement('li');\n listItem.id = todoItem.id; \n listItem.className = 'list-item';\n listItem.innerHTML = `\n <input type=\"text\" class=\"todo-item\" value=\"${todoItem.title}\" read...
[ "0.84020936", "0.8340281", "0.8324449", "0.8315516", "0.82901394", "0.82819223", "0.8260848", "0.81738937", "0.8163221", "0.815801", "0.81204677", "0.81064576", "0.8105584", "0.80904806", "0.80749714", "0.8003545", "0.79998225", "0.79939365", "0.79871404", "0.7983872", "0.797...
0.0
-1
function click OK to rename
function Accept_rename(){ let option = document.querySelectorAll('.option'); // find class editing and rename Array.from(option).forEach(function(thing){ let findEdit = thing.firstElementChild; if(findEdit.classList.contains('editing')){ let findposEdit = document.querySe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renameMovie(id){\n showTheRenameDialog(id);\n}", "onOk(){\n var view = this.insideFrame().childViewByType('View')\n var path = view.childWidgetByType('Tree').getSelectionPath()\n path.push(this.fileName)\n this.onRenameFile(path)\n }", "function _onFileNameChange(e, ...
[ "0.6980525", "0.69754535", "0.6787728", "0.6748969", "0.67027587", "0.66717625", "0.6671279", "0.6588951", "0.65663624", "0.6517203", "0.65086573", "0.6502957", "0.64708763", "0.6420691", "0.63810104", "0.6376153", "0.6370205", "0.6324637", "0.6305449", "0.62968606", "0.62816...
0.57996607
63
function find parent of children
function parentwithClass(elem,nameclass){ while(elem = elem.parentElement){ if(elem.classList.contains(nameclass)){ return elem; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findParent(a,b){var c=a.$parent;if(c)return c.$options[b]?c:findParent(c,b)}", "findFirstParent(kindToMatch) {\n let current = this;\n while (current) {\n if (current.kind === kindToMatch) {\n return current;\n }\n current = current.parent;\n...
[ "0.7706931", "0.7448313", "0.73213613", "0.73213613", "0.73213613", "0.73213613", "0.73213613", "0.7225667", "0.7217448", "0.71700853", "0.7158704", "0.70944375", "0.70801824", "0.7033674", "0.7033674", "0.7033674", "0.7033674", "0.7033674", "0.7033674", "0.70252174", "0.7016...
0.0
-1
Adding a function to reset the game
function reset(){ Random=Math.floor(Math.random()*102+19); console.log(Random) $('.randomScore').text(Random); value1= Math.floor(Math.random()*12+1); value2= Math.floor(Math.random()*12+1); value3= Math.floor(Math.random()*12+1); value4= Math.floor(Math.random()*...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reset() {\n //Reset the game\n channelResetGame();\n }", "function resetGame() {\n resetClockAndTime();\n resetMoves(); \n resetRatings();\n startGame();\n}", "function resetGame() {\n clearGameCards();\n resetMoves();\n resetTimer();\n}", "function resetGame() {\n res...
[ "0.87037313", "0.8635506", "0.8605619", "0.85743576", "0.85741234", "0.854869", "0.8488378", "0.8480363", "0.8416462", "0.8406715", "0.8380464", "0.8350027", "0.8338113", "0.83204895", "0.83110124", "0.83067036", "0.8293497", "0.8278113", "0.82563174", "0.8248722", "0.8245724...
0.0
-1
Display wins using a function and the alert the message
function iWon(){ alert("Oh yeah! You won!"); wins++; $('#wins').text(wins); reset(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function winnerAlert() {\n alert(\"You've won! The solution was: \" + randomMovie.toUpperCase() + \" Press OK to play again\");\n wins++;\n displayWins.textContent = \"Wins: \" + wins;\n resetGame();\n }", "function winGame() {\n $('#status').text(\"You win!\");\n wins++;\n ...
[ "0.77227396", "0.7518119", "0.7493831", "0.7446553", "0.74127936", "0.74074256", "0.74037373", "0.73989546", "0.7394957", "0.7383824", "0.7383807", "0.73253757", "0.73208326", "0.73160726", "0.72859144", "0.72828907", "0.72804254", "0.72520006", "0.72486985", "0.72240114", "0...
0.0
-1
Display losses using a function and then alert the message
function loser(){ alert ("Oh no! You lose!"); losses++; $('#losses').text(losses); reset() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function show_lose(){\n alert(' You Lose :(');\n game_end();\n}", "function loserAlert() {\n alert(\"Sorry cowboy, the jig is up. The correct solution was: \" + randomMovie.toUpperCase() + \" Press OK to play again.\");\n losses++;\n displayLosses.textContent = \"Losses: \" + losses;\...
[ "0.7127665", "0.7080896", "0.6986827", "0.6920113", "0.69145375", "0.6902174", "0.68650436", "0.68381286", "0.68026316", "0.67923754", "0.67908937", "0.67349213", "0.6694424", "0.66623676", "0.66551656", "0.6643593", "0.66104025", "0.66085804", "0.65762913", "0.65527606", "0....
0.669127
13
This function deletes a list item
function deleteItem() { $('.shopping-list').on('click', '.shopping-item-delete', function (event) { this.closest('li').remove(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteListItem() {\n item.remove();\n }", "function deleteListItem(e) {\n\t\te.remove();\n\t}", "function deleteListItem(){\n \t\t$(this).parent().remove();\n \t}", "function deleteListItem() {\n\tthis.parentNode.remove();\n}", "function removeListItem() {\n li.parentNode.removeChild(li...
[ "0.8599189", "0.8068116", "0.8055651", "0.79630667", "0.7796632", "0.7790757", "0.77789617", "0.77692497", "0.77507746", "0.7713425", "0.76954585", "0.7689643", "0.76466274", "0.76445377", "0.7639327", "0.762513", "0.75920665", "0.75629157", "0.7541542", "0.753427", "0.753081...
0.68690825
92
This function checks a list item label
function checkItem() { $('.shopping-list').on('click', '.shopping-item-toggle', function (event) { $(this).closest('li').find('.shopping-item').toggleClass('shopping-item__checked'); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkLabel(name, value) {\n let input = doc.querySelector(`.shortcut-input[name=\"${name}\"]`);\n let label = input.previousElementSibling;\n if (label.dataset.l10nId) {\n is(label.dataset.l10nId, value, \"The l10n-id is set\");\n } else {\n is(label.textContent, value, \"The textCon...
[ "0.647903", "0.6466572", "0.6466066", "0.62316275", "0.60347134", "0.6026686", "0.5893276", "0.589185", "0.58854085", "0.58075684", "0.58057445", "0.57977754", "0.575805", "0.56936705", "0.5688086", "0.5677133", "0.5657428", "0.5637494", "0.56286764", "0.56285304", "0.5614363...
0.0
-1
Insert a swagger specification into a markdown file (str, obj) > (fn, obj) > null
function remarkSwagger (spec, opts) { opts = opts || {} assert.equal(typeof opts, 'object', 'opts is an object') const title = opts.title || 'API' const position = opts.position || 4 if (opts.yaml) spec = yaml.parse(spec) if (opts.json) spec = JSON.parse(spec) assert.equal(typeof spec, 'object', 'spec...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function exportIodocs(src){\n var obj = clone(src,false);\n obj.swagger = '2.0';\n obj.info = {};\n obj.info.version = obj.version || '1';\n obj.info.title = obj.name;\n obj.info.description = obj.description;\n obj.paths = {};\n\n var u = url.parse(obj.basePath+obj.publicPath);\n obj.sc...
[ "0.62114805", "0.57929015", "0.5747311", "0.56429225", "0.5578035", "0.5554343", "0.5549934", "0.5485854", "0.5451567", "0.54391235", "0.54380304", "0.5437037", "0.5430827", "0.54113215", "0.5408317", "0.54064614", "0.53977954", "0.53954965", "0.53817993", "0.5377292", "0.537...
0.7019318
0
create a table obj > [obj]
function createTable (spec) { assert.equal(typeof spec.paths, 'object', 'paths should be object') const tableHead = u('tableHeader', [ u('tableCell', [ u('text', 'Path') ]), u('tableCell', [ u('text', 'Method') ]), u('tableCell', [ u('text', 'Summary') ]) ]) // convert swagger to table rows cons...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createTable() {\n\n db.transaction(function (tx) { tx.executeSql(createStatement, [], showRecords, onError); });\n\n}", "function createTable() {\n const sql = `CREATE TABLE ${table} (c1 int, c2 int)`;\n const request = new Request(sql, (err, rowCount) => {\n if (err) {\n throw err;\n }\...
[ "0.6950717", "0.692927", "0.68486375", "0.6806216", "0.675935", "0.6671816", "0.6634691", "0.6604819", "0.65969634", "0.6590883", "0.6575184", "0.6572509", "0.65560746", "0.6545415", "0.6475638", "0.6464172", "0.644985", "0.6441055", "0.6433179", "0.6432733", "0.6425419", "...
0.0
-1
the following functions are for test purpose
function drawDot(center, radius, color) { ctx.beginPath(); ctx.arc(center.x, center.y, radius, 0 , 2 * Math.PI); ctx.fillStyle = color; ctx.fill(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function testRun()\r\n{\r\n}", "function testFunction() {\n\t\t\treturn true;\n\t\t}", "function testFunction() {\n\t\t\treturn true;\n\t\t}", "function startAllTests(){ \n testGetObjectFromArrays();\n testNormalizeHeader();\n testFillInTemplateFromObject();\n testIsCellEmpty();\n testIsAlnum();\n test...
[ "0.63185245", "0.6226984", "0.6226984", "0.61660945", "0.61211586", "0.61101055", "0.60194725", "0.6016664", "0.59990495", "0.5981174", "0.5963118", "0.59533757", "0.5939675", "0.5874326", "0.58742183", "0.58662075", "0.58428943", "0.5814909", "0.5805138", "0.5797657", "0.579...
0.0
-1
Bending the title Credit to: circularText(" Traveling Tails", 230, 0);
function circularText(txt, radius, classIndex) { txt = txt.split(""), classIndex = document.getElementsByClassName("circTxt")[classIndex]; let deg = 360 / txt.length, origin = 86; txt.forEach((ea) => { ea = `<p style='height:${radius}px;position:absolute;transform:rotate(${origin}deg);transform-orig...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function taskTitle(text, y){\n ctx.fillStyle = white;\n ctx.font = '21pt apollo';\n var w = ctx.measureText(text).width;\n var x = (800 - w)/2\n ctx.fillText(text, x, y);\n }", "function title(){\n ctx.font=getFont();\n ctx.fillStyle = \"#7f7e7e\";\n ctx.textAlign = \"center\...
[ "0.7282499", "0.71725714", "0.71324325", "0.7127076", "0.7037386", "0.69545674", "0.6952364", "0.6905293", "0.6873405", "0.671089", "0.6660289", "0.6637906", "0.6636793", "0.65984875", "0.6597843", "0.6528771", "0.64967304", "0.64958996", "0.6444024", "0.6402352", "0.6375381"...
0.6640003
11
Function to grab and return the data
function get(url) { return fetch(url) .then(function(response) { return response.json() }) .then(function(data) { if (data.status === "ZERO_RESULTS"){ alert('Enter a valid location.'); secondPage.style.display = 'none'; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_data() {}", "getData(){}", "GetData() {}", "function getData () {\n return requestService.getTop()\n .then(response => {\n return parser.parseBody(response);\n })\n}", "function getData(data) {\n return data;\n}", "function getData(data) {\n return data;\n}", "getData () {\...
[ "0.8363286", "0.7214725", "0.6993458", "0.6836171", "0.67946035", "0.6785124", "0.67047775", "0.65931857", "0.64183986", "0.64183986", "0.6412866", "0.63772684", "0.63772684", "0.63607514", "0.6324901", "0.63243526", "0.63194656", "0.631566", "0.62923723", "0.6292341", "0.628...
0.0
-1
Making the map, setting it to the first coordinates in the location inputed Array
function markPlaces(name, rating, latitude, longitude, inDesLat, inDesLong, iconPix) { const options = { zoom: 11, center: {lat:parseFloat(inDesLat[0]),lng:parseFloat(inDesLong[0])}, } let map = new google.maps.Map(document.getElementById('map'), options); //Places a marker on each locat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function precal_loc() {\n buffer_loc.forEach((obj)=>{obj.x = (obj.longitude + 180) * 10; obj.y = (90 - obj.latitude) * 10;});\n}", "function edit_location_map() {\n initialize_add_location_map();\n convert_points_to_markers();\n if (typeof triangles != 'undefined') {\n createCurrentPolygons(tr...
[ "0.66791517", "0.6529163", "0.6406441", "0.63903046", "0.63588434", "0.6331525", "0.62881815", "0.6225719", "0.6219073", "0.6129983", "0.6068356", "0.60658574", "0.6065543", "0.60478294", "0.6042294", "0.60165316", "0.60097694", "0.60021275", "0.59876925", "0.59794503", "0.59...
0.0
-1
var hangmanMMAFightersArrayLowerCase = hangmanMMAFightersArray.toLowerCase(); func to reset game after loss or win
function resetFunc() { // vars and innerHTML for guessesRemaining guessesRemaining = 15; document.querySelector("#guessesRemainingId").innerHTML = "<p>" + guessesRemaining + "</p>"; // vars and innerHTML for letters guessed lettersGuessed = []; document.querySelector("#lettersGuessedId").innerHTML = "<p>" + lett...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resetGame() {\n remainingGuesses = maxTries;\n document.getElementById(\"beginningMessage\").innerText = \"Press any letter to play.\";\n listOfWords = Math.floor(Math.random() * (wordChoices.length));\n guessedLetters = [];\n guessingWord = [];\n for (var i = 0; i < wordChoices[listOfWo...
[ "0.7168151", "0.70647705", "0.70638114", "0.70410216", "0.70313394", "0.70101106", "0.6958066", "0.68644077", "0.6854148", "0.6830688", "0.6814757", "0.674572", "0.67232275", "0.67179376", "0.67008007", "0.6689089", "0.66871125", "0.66867906", "0.6681466", "0.66624486", "0.66...
0.62592846
71
endregion region METAR / TAF
function getAreaWeatherInfos(extent, successCallback, errorCallback) { if (containsExtent(weatherInfoCache.extent, extent) && !isWeatherCacheExpired()) successCallback(weatherInfoCache.weatherInfos); // return from cache else loadAreaWeatherInfos(calcOversizeExtent(extent, EX...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static ToMetres(ac) {\n if (AltitudeCode.IsMetric(ac)) {\n throw \"Metric altitude decoding is not supported.\";\n } else {\n return AltitudeCode.ToFt(ac) * 12 * 2.54 / 100;\n }\n }", "function Ti(a,b){this.tx=a;this.MA=b}", "function MT(a,b){this.ai=[];this.yl=a;this.Fk=b||nu...
[ "0.61749625", "0.5856121", "0.57995087", "0.5759507", "0.56610537", "0.5606526", "0.543352", "0.5363235", "0.5315919", "0.52531534", "0.52531534", "0.52531534", "0.52531534", "0.52531534", "0.52531534", "0.5198581", "0.5198581", "0.5198581", "0.5198581", "0.5198581", "0.51985...
0.0
-1
console.log("total score 1") define
function win() { wins = wins + 1; $('#wins').text(wins); alert("You Won!!!"); reset(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function scoreQ10a() {\n console.log(\"q10a answer: \" + q10a)\n}", "function totalScore() {\n console.log(chalk.bold.bgBlack(\"Hey! \" + playerName.toUpperCase() + \" Thanks for taking out the time to play the quiz. your Total score is \" + score + \"/25\"));\n console.log(\"\");\n}", "function score...
[ "0.75199616", "0.75085", "0.74888957", "0.7434641", "0.7420253", "0.73362887", "0.733566", "0.7315781", "0.7310354", "0.7276932", "0.7276673", "0.72325164", "0.7228785", "0.7210254", "0.7188653", "0.71830475", "0.7162059", "0.7137843", "0.71178526", "0.7095638", "0.70013857",...
0.0
-1
Try to define map using parallel
function map (collection, iteratee, callback) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function map() {\n\n}", "function myMap(arr, cb) {\n // enter your code here\n}", "function Map() {}", "function myMap(arr, fn) {\n var tasksNo = arr.length;\n var resultArray = [];\n for (var i =0; i < tasksNo; i++){\n // resultArray.push(fn(arr[i]));\n resultArray[i] = fn(arr[i]);\n }\n return ...
[ "0.6439699", "0.63330114", "0.629902", "0.60862756", "0.5891236", "0.58621806", "0.58457905", "0.58457905", "0.5790313", "0.5775871", "0.576655", "0.5669787", "0.55954444", "0.557612", "0.55590415", "0.54846066", "0.54846066", "0.548013", "0.5476617", "0.54731566", "0.5473156...
0.5189838
50
If we want to add more players to our team, we can use this method.
addPlayer(firstName, lastName, age) { let player = { firstName: firstName, lastName: lastName, age: age } this.players.push(player); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addPlayer(team) {\n if (team) {\n const index = this.getTeamSpawn(team)\n this.player = this.newPiece({ team, type: 'warrior', player: true, index })\n }\n }", "function addOtherPlayers(self, playerInfo) {\n // Create new player, and add to Group `otherPlayers`\n var spriteName = `${player...
[ "0.7297494", "0.71919596", "0.7154878", "0.7112726", "0.69288844", "0.6830277", "0.683026", "0.68250924", "0.68132335", "0.6809901", "0.680646", "0.6794364", "0.6724896", "0.6591349", "0.65909183", "0.6584505", "0.6570556", "0.6565165", "0.6564205", "0.65487546", "0.6524582",...
0.70411
4
If we want to add more games that our team played, we can use this method.
addGame(opponentName, teamGoals, opponentGoals) { let game = { opponent: opponentName, teamGoals: teamGoals, opponentGoals: opponentGoals } this.games.push(game); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addGame (newWeek, newHomeTeamRank, newAwayTeamRank, newDateTime) {\n let newGame = new Game(newWeek, newHomeTeamRank, newAwayTeamRank, newDateTime)\n// as list's index start from 0 but there is no week 0. so minus 1 from week\n this.allGames[newWeek - 1].push(newGame)\n }", "addTeam (newRank, newName, new...
[ "0.7289703", "0.6880756", "0.66837394", "0.66560787", "0.66306216", "0.66293216", "0.66120255", "0.6497638", "0.64346063", "0.6404795", "0.63601625", "0.63318586", "0.6325301", "0.63130254", "0.6230429", "0.61645687", "0.61604524", "0.6152909", "0.61392313", "0.6124738", "0.6...
0.7642443
0
Here we can get the information about a random player in our team.
getRandomPlayer() { let randomIndex = Math.floor(Math.random() * this.players.length); let firstName = this.players[randomIndex].firstName; let lastName = this.players[randomIndex].lastName; let age = this.players[randomIndex].age; return `The player is ${firstName} ${lastName}. ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static selectRandomPlayer() {\n let newTeamPlayers = Character.instances.filter((player) => {\n player.state != LOSER;\n });\n return newTeamPlayers.sort(() => Math.random() - 0.5);\n }", "function determineStartingPlayer()\n{\n // @TODO: Random laten bepalen welke speler aa...
[ "0.7091243", "0.69893587", "0.69863576", "0.68284243", "0.67674243", "0.6715088", "0.6691123", "0.66623354", "0.6648766", "0.6645502", "0.6642848", "0.6626305", "0.657523", "0.65316474", "0.65005916", "0.64865583", "0.64832497", "0.64673793", "0.6440845", "0.64320767", "0.639...
0.76653767
0
Here we can get the information about a random game our team has played.
getRandomGame() { let randomIndex = Math.floor(Math.random() * this.players.length); let team = 'PSG'; let opponent = this.games[randomIndex].opponent; let teamGoals = this.games[randomIndex].teamGoals; let opponentGoals = this.games[randomIndex].opponentGoals; return `Th...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async getGame() {\n return (await this._client.helix.games.getGameById(this._data.game_id));\n }", "function initGame() {\n const estado = createGameEstado()\n randomcomida(estado);\n return estado;\n}", "function renderRandomGame() {\n if (listOfUserGames[0] != null) {\n var randomGameArray =...
[ "0.6672205", "0.6640187", "0.6626864", "0.6437991", "0.6386176", "0.6312254", "0.6283168", "0.62740797", "0.62570745", "0.62566274", "0.61379343", "0.6130199", "0.611917", "0.61139506", "0.61125517", "0.6092627", "0.6074016", "0.6071004", "0.60699", "0.6059558", "0.6050818", ...
0.7812938
0
var Remote = require('./Remote');
function activate (context) { var disposableLocal = vscode.commands.registerCommand('viewReadme.markdown', function () { local(); }); // var disposableRemote = vscode.commands.registerCommand('viewReadme.showRemote', function () { // vscode.window.showInputBox({ // prompt: INPUT...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "initRemote() {\n let me = this,\n remote = me.remote,\n className = me.className,\n currentWorker = Neo.currentWorker,\n listenerId;\n\n if (!me.singleton) {\n throw new Error('Remote method access is only functional for Sin...
[ "0.6159477", "0.6159477", "0.5824955", "0.5686694", "0.5668841", "0.5535676", "0.55276793", "0.55276793", "0.55276793", "0.55276793", "0.55276793", "0.55066377", "0.5411534", "0.53814024", "0.5376418", "0.5304418", "0.5280499", "0.52711934", "0.52321905", "0.51925457", "0.519...
0.0
-1
FIXME: Step 3.1 / FIXME: step 4.1 / FIXME: Step 6.1
function App() { const prefersDarkMode = useMediaQuery('(prefers-color-scheme: dark)'); const theme = React.useMemo( () => createMuiTheme({ palette: { type: prefersDarkMode ? 'dark' : 'light', }, }), [prefersDarkMode], ); return ( <DAppProvider appName={ appName...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "private public function m246() {}", "protected internal function m252() {}", "transient private protected internal function m182() {}", "static private internal function m121() {}", "static transient final private internal function m43() {}", "transient protected ...
[ "0.64462024", "0.6297628", "0.6003776", "0.5935064", "0.58816767", "0.58104444", "0.57970905", "0.57202274", "0.5656324", "0.56529903", "0.55239177", "0.5465177", "0.54441196", "0.5443962", "0.5412984", "0.5405801", "0.54016036", "0.5314907", "0.52166754", "0.5164226", "0.515...
0.0
-1
use setState rather than = to modify state
componentWillMount() { axios.get('https://rallycoding.herokuapp.com/api/music_albums').then(response => this.setState({ albums: response.data })); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setState (state) {\r\n this.state = state;\r\n }", "setState (newState) {\n this._state = assign({}, this._state, newState);\n this.trigger(assign({}, this._state));\n }", "setState(newState, cb) {\n // Merge both new and old state to replace whats new an keep whats old.\n this.state = {.....
[ "0.78440946", "0.7769645", "0.76178896", "0.7583461", "0.7580751", "0.74613935", "0.73783445", "0.73543906", "0.7353474", "0.73183626", "0.73170316", "0.73091865", "0.727348", "0.72134364", "0.7133132", "0.70806336", "0.70679855", "0.7067962", "0.70624596", "0.70432854", "0.7...
0.0
-1
========================================================================== takes over for continuing game play after the initial playGame() setup
function gamePlay(word, guesses) { inquirer .prompt({ name: "letter", type: "input", message: "Guess a letter!\n" }) .then(function(answer) { // call .checkGuess() method on whole word, passing in answer.letter // switches guessed...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startGame() {\n pairMovieWithSounds();\n randomSounds(movie);\n addPhraseToDisplay();\n keyboardSetup();\n}", "function startGame() {\n //hide the deal button\n hideDealButton();\n //show the player and dealer's card interface\n showCards();\n //deal the player's c...
[ "0.73900187", "0.73675835", "0.73505247", "0.7344954", "0.7296219", "0.7275537", "0.7266986", "0.72496104", "0.7218716", "0.7204752", "0.720449", "0.718345", "0.7180463", "0.71735317", "0.7169509", "0.7145476", "0.71021163", "0.7091916", "0.70775795", "0.7074538", "0.70614815...
0.0
-1
========================================================================== ========================================================================== after game play ends in gamePlay(), anotherGame() asks if player wants another game
function anotherGame() { inquirer .prompt({ name: "newgame", type: "confirm", message: "\nWanna try again?\n" }) .then(function(newanswer) { if (newanswer.newgame === true) { // if player wants to guess another word, then ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onChooseGame(proceed, game) {\n this.chooseGameScreen.hide();\n if (proceed) {\n this.chosenGame = game;\n }\n this.show();\n }", "function endGame() {\n p.onSetAppState(state => ({ newGame: false, game: { ...state.game, playedGames: 0 } }));\n p.startGame = false;\n clearTimeout(p.tim...
[ "0.70851356", "0.68909043", "0.6762277", "0.67253", "0.6718361", "0.6692424", "0.66861373", "0.66393185", "0.66334397", "0.6619399", "0.66185445", "0.65867317", "0.6582713", "0.6581465", "0.6577046", "0.6559591", "0.65498435", "0.6543714", "0.65356445", "0.6521809", "0.651867...
0.6702275
5
========================================================================== ========================================================================== the entry point into the game
function intro() { inquirer .prompt({ name: "game", type: "confirm", message: "\nHello Constant Reader, I'm Steve King-- can you read my mind?\n" }) .then(function(answer) { if (answer.game === true) { // if player wants start ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "run() {\n let background = new PIXI.extras.TilingSprite(\n PIXI.loader.resources.blocks.textures.background, \n this.app.renderer.width,\n this.app.renderer.height);\n this.app.stage.addChild(background);\n \n this.key = new Keyboard();\n this.sco...
[ "0.77044505", "0.7677399", "0.7580232", "0.74321985", "0.7416174", "0.73828775", "0.73805714", "0.73753285", "0.73356265", "0.7331408", "0.7308246", "0.7253619", "0.72489524", "0.72461236", "0.7220143", "0.7218686", "0.7212138", "0.7172837", "0.71661544", "0.71651435", "0.714...
0.0
-1
helper functions for boeIntersect(), which is what lineCollide() relies upon
function counterClockwise(point1,point2,point3){ var slope_1_2 = (point3.y - point1.y) * (point2.x - point1.x); var slope_1_3 = (point2.y - point1.y) * (point3.x - point1.x); return(slope_1_2 > slope_1_3); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "doLinesIntersect (a, b) {\n for (let i = 1; i < a.length; i++) {\n for (let j = 1; j < b.length; j++) {\n if (b[j]) {\n if (this.doLineSegmentsIntersect(\n a[i - 1].x, a[i - 1].y, a[i].x, a[i].y,\n b[j - 1].x, b[j - 1].y, b[j].x, b[j].y\n )) return true\n ...
[ "0.7050041", "0.6869416", "0.6853131", "0.6845658", "0.68071353", "0.67416304", "0.67416304", "0.6734776", "0.6724701", "0.67073977", "0.6669669", "0.6664413", "0.6659299", "0.661927", "0.6612267", "0.66019684", "0.6589212", "0.6565022", "0.6565022", "0.65169984", "0.65154463...
0.0
-1
deprecated helper functions for the old version of lineCollide()
function xIntersect(line1,line2){ if(line1.b === null){ return line1.anX; } else if(line2.b === null){ return line2.anX; }else{ return ((line2.b - line1.b) / (line1.m - line2.m)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function PatchLine() { }", "function Line() {}", "function Line() {}", "function Line() {}", "function Line() {}", "function Line() {}", "static CalcLineTranslation() {}", "function updateDrawingLineOfAPeer(oldLineObj, newLineObj) {\n oldLineObj.set({\n x2: (newLineObj.x1 < 0) ? newLineObj....
[ "0.6349725", "0.5866969", "0.5866969", "0.5866969", "0.5866969", "0.5866969", "0.5812966", "0.577141", "0.5722335", "0.57199645", "0.566267", "0.5614457", "0.5578166", "0.55574703", "0.5552505", "0.553289", "0.55239475", "0.55184764", "0.5502393", "0.54528326", "0.5450983", ...
0.0
-1
Gets the number of sockets connected param roomId: optional id of room containing sockets param namespace: optional name of namespace containing sockets return res: array of sockets contained by io, namespace or room
function findClientsSocket(roomId, namespace) { var res = [] , ns = io.of(namespace ||"/"); // the default namespace is "/" if (ns) { for (var id in ns.connected) { if(roomId) { var index = ns.connected[id].rooms.indexOf(roomId) ; if(index !== -1) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findClientsSocket(roomId, namespace) {\n var res = []\n // the default namespace is \"/\"\n ,\n ns = io.of(namespace || \"/\");\n\n if (ns) {\n for (var id in ns.connected) {\n if (roomId) {\n var index = ns.connected[id].rooms.indexOf(roomId);\n...
[ "0.7649733", "0.7466686", "0.69182104", "0.65822506", "0.6544532", "0.6397803", "0.61760646", "0.6035128", "0.57899195", "0.56475294", "0.5564372", "0.5510084", "0.54840356", "0.54823565", "0.5461066", "0.5401406", "0.5374888", "0.53579533", "0.53446394", "0.5327289", "0.5283...
0.7678416
0
untracks tag from the stream param tag: tag to be untracked after: tweet stream no longer retrieves tweets related to tag
function unTrack(tag){ if (tracking.tags[tag] == 1){ delete tracking.tags[tag]; client.untrack(tag); } else { tracking.tags[tag]--; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeHashtags(){\n\n // console.log('asdf');\n for(var i=0;i<twitterFalseTags.length;i++)\n {\n if(twitterFalseTags[i].count>1){\n var index=hashtag.indexOf(twitterFalseTags[i].worldTag)\n hashtag.splice(index,1);\n }\n }\n twitterFalseTags=[];\n //con...
[ "0.6232222", "0.620379", "0.6132179", "0.5969885", "0.5709389", "0.5642228", "0.560693", "0.5564663", "0.5546692", "0.55159396", "0.54662305", "0.5464676", "0.5462155", "0.5421789", "0.54018986", "0.5382371", "0.5379105", "0.5378998", "0.5366633", "0.5319173", "0.53153837", ...
0.7877773
0
AddMarkFragments Chop the surface by all the bounding planes of the to be projected polygon.
function AddMarkFragments(points, planes, fragments) { var out = points; for (var i = 0; i < planes.length; i++) { out = ChopPolyBehindPlane(out, planes[i], 0.5); if (!out || out.length === 0) { break; } } // Completely clipped away? if (!out || out.length === 0) { return; } fragments.push(out); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateMarkers(planes){\n //add as many new features as we need to keep object count same as specified\n var maxFeatureSelect = document.getElementById('features');\n var maxFeatureCount = parseInt(maxFeatureSelect[maxFeatureSelect.selectedIndex].value);\n\n var added = false;\n var intial...
[ "0.53818387", "0.5221358", "0.51682216", "0.5069387", "0.5065538", "0.5065538", "0.5057127", "0.50507146", "0.50507146", "0.504199", "0.5021181", "0.50089544", "0.49880207", "0.49880207", "0.49880207", "0.49880207", "0.49880207", "0.49880207", "0.49880207", "0.49880207", "0.4...
0.7820931
0
end of .fa.click function to use in the switch case for the break stages
function breakStage() { timePassed = 0; $("#timeDisplay").html($("#break").html() + ":00"); startTime = $("#break").html() * 60; $("#timerType").html("Break Time"); clearInterval(countdown); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_endClick() {\n const that = this;\n\n //Click Handler\n that._resizeHandler();\n\n if (that.disabled || that.readonly) {\n return;\n }\n\n if (that._isInactiveOn('click')) {\n return;\n }\n\n if (that.clickMode !== 'release' && that.cli...
[ "0.59026873", "0.5797555", "0.57400507", "0.5733856", "0.57091075", "0.57051164", "0.5672219", "0.5644724", "0.5589897", "0.5568624", "0.5563927", "0.5562871", "0.553122", "0.5505042", "0.5502672", "0.5491021", "0.5484805", "0.54753584", "0.547365", "0.54624933", "0.54512185"...
0.0
-1
function to use in the switch case for the work stages
function workStage() { timePassed = 0; $("#timeDisplay").html($("#work").html() + ":00"); startTime = $("#work").html() * 60; $("#timerType").html("Work Time"); clearInterval(countdown); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "work() {}", "work() {\n\n }", "processStages(issue) {\n console.log();\n console.log(`Processing stages for ${issue.html_url}`);\n // card events should be in order chronologically\n let currentStage;\n let currentColumn;\n let doneTime;\n let addedTime;\n ...
[ "0.6296809", "0.62375075", "0.60515153", "0.59610623", "0.5917814", "0.57519376", "0.5677945", "0.5657449", "0.5604692", "0.55919707", "0.55785745", "0.5557021", "0.5548032", "0.5533524", "0.55314195", "0.551119", "0.5509027", "0.5508805", "0.55016446", "0.5482194", "0.547", ...
0.5090404
95
a separate function to use inside of setInterval
function startCountdown() { // grab the time amount from the time dispay and split into min and sec let time = $("#timeDisplay").html(), min = Number(time.split(":")[0]), sec = Number(time.split(":")[1]); // switch case stored in a function to run through the different work/break stages functi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setInterval() {\n esterification, 200\n}", "function setIntervalCustom(fn,timer){\n \n return setTimeout(function(){\n \n if(typeof fn == \"function\"){\n fn();\n setIntervalCustom(fn,timer);\n }\n else{\n ...
[ "0.76400226", "0.68622607", "0.68400097", "0.68389195", "0.68344915", "0.6734736", "0.67263323", "0.6723068", "0.66449606", "0.6625501", "0.65761065", "0.6554648", "0.6537595", "0.6537004", "0.6515634", "0.651462", "0.65113264", "0.65093505", "0.65045655", "0.65038747", "0.65...
0.0
-1
switch case stored in a function to run through the different work/break stages
function switchStage() { switch (stage) { case 2: $(".pomo:nth-child(1)").css("background-color", "green"); breakStage(); countdown = setInterval(startCountdown, 1000); break; case 3: $(".pomo:nth-child(2)").css("background-color", "green"); workStage(); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mainSwitch(){\n\nswitch (action) {\n case \"spotify-this-song\":\n giveMeMusic();\n break;\n case \"concert-this\":\n findConcert();\n break;\n case \"movie-this\":\n entertainMe();\n break;\n case \"do-what-it-says\":\n readRandom();\n break;\n default:\n console.log(\"I don...
[ "0.6566795", "0.65304124", "0.6437869", "0.63491744", "0.63433456", "0.63254863", "0.6211795", "0.6060788", "0.6025811", "0.60253274", "0.6006389", "0.59859097", "0.5976677", "0.59365904", "0.59187144", "0.58966494", "0.58740973", "0.58667", "0.58667", "0.58667", "0.58667", ...
0.569003
45
Process Flow 1. Read API Key and Secret Access Key. If failed to read, show alert and pop navigation. 2. Set API Key and Secret Access Key to Session (post to "/aws/setting"). If failed to post, show alert and pop navigation. 3. Fetch List Data (get from server, like "/aws/xxxs", "/aws/xxxs/:name/xxxs"). If failed to g...
componentDidMount() { var readSettingEmitter = new EventEmitter(); readSettingEmitter.once('ReadSuccessEvent', (keyValues) => { this._fetchData(keyValues); }); readSettingEmitter.once('ReadFailedEvent', (alertTitle, errorMessage) => { this._onBadSettings(alertTitle, errorMessage); }); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async setupAwsEnv() {\n if (_.isEmpty(this.cfg.aws.secretPath)) return;\n\n this.log('Fetching aws vault credentials...');\n const resp = await this.vault.fetchSecret(this.cfg.aws.secretPath);\n\n if (_.isEmpty(resp)) return;\n\n if (this.cfg.aws.setEnvVars) {\n const { respJsonSecretPath, resp...
[ "0.5620353", "0.5618342", "0.54051584", "0.53719026", "0.5358303", "0.51424116", "0.5126155", "0.51223886", "0.51194274", "0.507912", "0.50636864", "0.50633615", "0.49833903", "0.49740937", "0.49200663", "0.49063072", "0.49017814", "0.48927277", "0.48773786", "0.48444334", "0...
0.0
-1
Attempt to rehydrate and init key stacks + est counts states from local storage.
async _rehydrateState() { let initState, initErrState, initEstsState, initCalcdAt, initAllowTypes try { const { [STORAGE_KEYS.ALLOW_TYPES]: allowTypes, [ImportStateManager.ERR_STATE_STORAGE_KEY]: savedErrState, [ImportStateManager.STATE_STORAGE...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rehydrate() {\n // inject initial state into stores\n return _store2.default.set(window.__STATE);\n}", "initialiseStore(state) {\n\t\t\tif(localStorage.getItem(LOCAL_STORAGE_KEY)) {\n\t\t\t\t// Replace the state object with the stored item\n\t\t\t\tthis.replaceState(\n\t\t\t\t\tObject.assign(state, JS...
[ "0.5924775", "0.58567995", "0.58186066", "0.57982904", "0.57660043", "0.5752995", "0.57428145", "0.56563073", "0.5643616", "0.5641844", "0.56273246", "0.5587046", "0.55840623", "0.55764264", "0.5571979", "0.55700547", "0.5561778", "0.55613637", "0.55403954", "0.5533958", "0.5...
0.7214058
0
Forces the persisted estimates state to be "dirtied", meaning next `fetchEsts` attempt will require a complete recalc rather than using the persisted state/cache.
async dirtyEsts() { this.calculatedAt = 0 return await this._persistEsts() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "resetInternalState(nextViewsToMeasure) {\n this.leftToMeasure = new Set();\n const nextNextMeasurements = new Map();\n\n const newViewsToMeasure =\n _differenceWith(_isEqual)(nextViewsToMeasure)(this.props.viewsToMeasure);\n for (let viewToMeasure of newViewsToMeasure) {\n this.leftToMeasure....
[ "0.5721365", "0.57020867", "0.55795634", "0.5299138", "0.5142112", "0.5075582", "0.5062798", "0.50201887", "0.49723387", "0.4950823", "0.49145567", "0.48949406", "0.48852763", "0.48852763", "0.48852763", "0.48852763", "0.48852763", "0.48852763", "0.48852763", "0.48852763", "0...
0.71220917
0
When the name of the challenge is "Create Sorted Array Through Instructions," and the challenge description says to build a sorted array, but the only output is an integer, the first thing that pops into my head is whether a sorted array is really the fastest way to do this. I suspect a binary search tree will be faste...
function Node(val) { this.val = val; this.left = null; this.right = null; this.subCount = 0; this.max = val; this.count = 1; this.height = 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function countingSort(arr) {\n \n var size = Number.MIN_VALUE;\n \n for(var i = 0 ; i < arr.length ; i++){\n \n if(arr[i] > size) {\n size = arr[i];\n }\n }\n \n var result = [size+1];\n for(var i = 0 ; i <= size ; i++) {\n result[i] = 0;\n }\n \...
[ "0.6381998", "0.6338712", "0.62203157", "0.60833955", "0.6017022", "0.6015348", "0.5935928", "0.589619", "0.5879221", "0.5857902", "0.58161086", "0.57984143", "0.5754102", "0.5753504", "0.57519484", "0.57398456", "0.57256454", "0.5723199", "0.5647707", "0.56447893", "0.561744...
0.0
-1
when we restore one revision, we have to remove it from its previous position; saveSnippetData will automatically insert it back at the top of the list again
function deleteRevision(index){ var parsed = JSON.parse(localStorage[LS_REVISIONS_PROP]); parsed.splice(index, 1); localStorage[LS_REVISIONS_PROP] = JSON.stringify(parsed); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function revertChanges() {\n if (typeof db.getItem(savedData) !== 'undefined' && db.getItem(savedData) !== 'undefined' && db.getItem(savedData) !== 'null' && db.getItem(savedData) != null && db.getItem(savedData) !== \"\") {\n mainP.innerHTML = db.getItem(savedData);\n //makeEditable();\n sanitiz...
[ "0.6326026", "0.6234038", "0.6098231", "0.6012061", "0.5968463", "0.5962761", "0.5944198", "0.5921408", "0.58999157", "0.58999157", "0.5892079", "0.5851687", "0.58223075", "0.58200103", "0.57701236", "0.5769354", "0.576479", "0.5730914", "0.5706775", "0.56635165", "0.5655129"...
0.60423523
3
save data not involving snippets
function saveOtherData(msg, callback){ Data.snippets = Data.snippets.toArray(); // refer github issues#4 Data.dataUpdateVariable = !Data.dataUpdateVariable; DB_save(function(){ Data.snippets = Folder.fromArray(Data.snippets); if(typeof msg === "function") msg(); else if(typeof msg ==...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_save_data()\n {\n var listselect = $('option:selected', rcmail.gui_objects.notebooks),\n savedata = {\n title: $.trim($('.notetitle', rcmail.gui_objects.noteviewtitle).val()),\n description: rcmail.editor.get_content().replace(/^\\s*(<p><\\/p>\\n*)?/,...
[ "0.657177", "0.6493271", "0.6486077", "0.63719493", "0.6246854", "0.6234109", "0.62302595", "0.6186891", "0.61602783", "0.6153528", "0.61396915", "0.6122023", "0.6106109", "0.608851", "0.6082677", "0.60783875", "0.6075579", "0.6070047", "0.6046495", "0.6045253", "0.604511", ...
0.6220358
7
returns whether site is blocked by user
function isBlockedSite(domain){ var arr = Data.blockedSites; for(var i = 0, len = arr.length; i < len; i++){ var str = arr[i], regex = new RegExp("^" + escapeRegExp(domain)); if(regex.test(str)) return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _isBlocked() {\r\n var isblock = $.blockUI.IsPageBlocked();\r\n return isblock == null ? false : true;\r\n }", "function isBlockedSite(url){\r\n\t\tvar domain = url.replace(/^(ht|f)tps?:\\/\\/(www\\.)?/, \"\"),\r\n\t\t\tarr = Data.blockedSites, regex;\r\n\r\n\t\tfor(var i = 0, len = arr...
[ "0.7418573", "0.72784436", "0.6632351", "0.6438032", "0.61207783", "0.61066926", "0.60997814", "0.60997814", "0.6076615", "0.6055724", "0.603535", "0.6013439", "0.5963858", "0.5877168", "0.585155", "0.5811213", "0.57772005", "0.5766137", "0.5765049", "0.5709689", "0.5684256",...
0.7010231
2