query
stringlengths
9
14.6k
document
stringlengths
8
5.39M
metadata
dict
negatives
listlengths
0
30
negative_scores
listlengths
0
30
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
Start vite dev server for renderer process and listen 8080 port
async function startRenderer() { const config = require('./vite.config') config.mode = process.env.NODE_ENV const server = await createServer(config) return server.listen(8080) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function serve() {\n var server = gls.static('dist/', PORT);\n //server.start();\n var promise = server.start();\n //optionally handle the server process exiting\n promise.then(function(result) {\n console.log('server started')\n openBrowser()\n });\n}", "function startDevServer() {\n const WDS = ...
[ "0.701416", "0.69747293", "0.69281375", "0.68925023", "0.688169", "0.68699306", "0.679291", "0.6773371", "0.6754351", "0.66907144", "0.66890603", "0.66735595", "0.66524833", "0.6627862", "0.6602436", "0.6586357", "0.6577838", "0.6572657", "0.65565866", "0.65326816", "0.653101...
0.8543942
0
Check if an indicator is cached
function isCached(id){ return localStorage.getIndicator(id) .then(function(ind){ return true; }) .catch(function(e){ return false; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function is_cached(src) {\n\t\tvar image = new Image();\n\t\timage.src = src;\n\n\t\treturn image.complete;\n\t}", "function isCached() {\n return cachedTempDir;\n}", "function isCached() {\n return cachedTempDir;\n}", "function isCached() {\n return cachedTempDir;\n}", "async function checkCache(name){...
[ "0.7019786", "0.6608519", "0.6608519", "0.6608519", "0.6585758", "0.6568469", "0.6515391", "0.6465127", "0.63590467", "0.62836045", "0.62731296", "0.6269538", "0.62580884", "0.6241572", "0.62071425", "0.61876726", "0.6187443", "0.6108511", "0.6106068", "0.6070985", "0.6066866...
0.7660126
0
Format a dictionary of attributes into a string suitable for inserting into the start tag of an element. Be smart about escaping embedded quotes in the attribute values.
function formatAttributes(attributes) { var att_value; var apos_pos, quot_pos; var use_quote, escape, quote_to_escape; var att_str; var re; var result = ''; for (var att in attributes) { att_value = attributes[att]; // Find first quote marks if any apos_pos = att_value.indexOf(APOS); quot_po...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function make_attributes (attr) {\n\t\tvar attr_str = '';\n\t\tfor (var k in attr) {\n\t\t\tif (k && attr[k] != null) attr_str += ' '+ k +'='+ '\"'+ attr[k] +'\"';\n\t\t}\n\t\treturn attr_str;\n\t}", "function escape_attr(m)\n{\n if (!m)\n return m;\n\n var n = \"\";\n for (var i = 0; i < m.length; i++) {\...
[ "0.7031504", "0.67702466", "0.65883857", "0.65159017", "0.6294277", "0.624055", "0.624055", "0.62129885", "0.61424726", "0.6096642", "0.60604084", "0.6001591", "0.59961283", "0.59961283", "0.59961283", "0.59961283", "0.5995194", "0.5995194", "0.5995194", "0.5991757", "0.59747...
0.72701484
0
fetch all cards of the connected user
function fetch_cards() { const GET_CARDS_URL="http://127.0.0.1:8090/card/mycards"; let context = { method: 'GET' }; fetch(GET_CARDS_URL,context) .then(reponse => reponse.json().then(body => cardList_callback(body))) .catch(error => err...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static async getAllCards() {\n const cards = await db.query(`SELECT * FROM cards`);\n return cards.rows;\n }", "getAllCards() {\n axios\n .get(`/api/cards/${this.props.profile.user.user_id}`)\n .then(response => {\n console.log(\"getAllCards:\", response.data);\n this.setState({...
[ "0.75979465", "0.7022955", "0.69321144", "0.69000345", "0.6767171", "0.6729365", "0.66816086", "0.6564358", "0.6505704", "0.6432673", "0.64325243", "0.63485515", "0.6314568", "0.6243429", "0.6226808", "0.62117565", "0.61683863", "0.6143215", "0.61301666", "0.6122668", "0.6106...
0.7039234
1
Class representing the TTS and media status for the current question
function CurrentStatus() { this.speaking = false; this.question = { id: undefined, spoken: false, }; this.feedback = { id: undefined, spoken: false, }; this.story = { id: undefined, spoken: false, }; this.media = { url: undefined, type: undefined, shown: false, }; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getPlaybackState() {\n if (this.video.hasEnded) return \"ended\";\n if (this.video.isPlaying) return \"playing\";\n return \"paused\";\n }", "function TriviaQuestion (question,ans1,ans2,ans3,ans4,correctAns,ansInfo,ansImg) {\n this.question = question;\n this.ans1 = ans1;\n this....
[ "0.53723633", "0.53073335", "0.52330935", "0.5221729", "0.5215621", "0.5202122", "0.519446", "0.5182002", "0.5179422", "0.515094", "0.5108335", "0.5054162", "0.5050323", "0.50498754", "0.50482184", "0.5037968", "0.5033397", "0.5027047", "0.5006027", "0.49899352", "0.4978721",...
0.69286174
0
Start the game loading the quiz and the first questtion and its answers when a menu item is clicked.
function startGame() { $('#menu').hide('slow'); var selectedQs; var german; switch (chosenQuiz) { case 'cogsci.tsv': if (quizzes.cogsci.length < NQUESTIONS) { quizzes.cogsci = JSON.parse(JSON.stringify(storedQuizzes.cogsci)); } german = false; selectedQs = selectQuestions(qui...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gamestart() {\n\t\tshowquestions();\n\t}", "function initiateQuiz() {\n startQuiz();\n renderFirstQuestion();\n answerChoice();\n renderNextQuestion();\n}", "function startGame() {\n clearBox();\n kickOff();\n loadQuestion(currentQuest);\n}", "function startQuiz() {\n hideEle...
[ "0.7604914", "0.73902917", "0.72970086", "0.72220004", "0.72198915", "0.72044724", "0.7175509", "0.7130173", "0.7078114", "0.68968105", "0.6896622", "0.68926424", "0.68760383", "0.68746567", "0.68696624", "0.6854649", "0.6825492", "0.6816585", "0.6801844", "0.6795834", "0.678...
0.7617488
0
Set a timeout for telling a joke and recursively call the function when the timeout is over until the current question is answered.
function checkTime() { setTimeout(function() { if (!game.quiz[game.p].answered && !cStatus.feedback.spoken && !game.german && !cStatus.speaking) { tellJoke(); // checkTime(); } }, LIMIT); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function waitBeforeGoingNextAutomatically() {\n setTimeout(goToNextQuestion, 1000 * 5);\n}", "function theDelay() {\n theQuestion++;\n questionChecker();\n setTimeout(questionGenerator, 3000);\n }", "function answer1timeout(){\n \tunanswered++;\n \t$('#playerscore').show();\n...
[ "0.60676956", "0.59743816", "0.59369993", "0.5846238", "0.583759", "0.5832949", "0.5828129", "0.5785448", "0.57808816", "0.5754303", "0.57542527", "0.5734039", "0.5729379", "0.5705878", "0.5697272", "0.56938785", "0.5685762", "0.5682881", "0.5671708", "0.566958", "0.566896", ...
0.6522548
0
Tell a random joke from the list.
function tellJoke() { var joke = randomPick(jokes); if (typeof joke == 'undefined') { // If there are no jokes left jokes = JOKES.slice(); // Copy again the array elements by value joke = randomPick(jokes); // Pick a joke } speakOut(joke); // Make Pepper tell the chosen joke }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function randomJoke() {\n const rand = Math.floor(Math.random() * 2) + 1;\n if (rand === 1) {\n chuckJoke();\n } else if (rand === 2) {\n yoMamaJoke();\n }\n}", "function randomJoke() {\n const rand = Math.floor(Math.random() * 2) + 1;\n if (rand === 1) {\n chuckJoke();\n } else if (ran...
[ "0.74295336", "0.7321219", "0.71321267", "0.6841161", "0.6832636", "0.67451507", "0.6561754", "0.6532579", "0.63610786", "0.6292686", "0.6267841", "0.6199375", "0.6191913", "0.61894447", "0.6182789", "0.6152235", "0.61449164", "0.6125862", "0.61154103", "0.6107903", "0.607453...
0.8170993
0
Hide quiz game and go to the main menu.
function goToMenu() { stopTTS(); cStatus = undefined; cStatus = new CurrentStatus(); $('#quiz').hide('slow'); $('#game').hide('slow'); $('#menu').show('slow'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function returnQuizApp()\n\t{\n document.getElementById(\"helpScreen\").style.display=\"none\";\n document.getElementById(\"quizScreen\").style.display=\"inline\";\n }", "function startQuiz() {\n homePage.style.display = \"none\";\n quizEl.style.display = \"block\";\n questionStat.style...
[ "0.68529034", "0.68514043", "0.67989147", "0.67514026", "0.66719127", "0.66694605", "0.6623677", "0.66191256", "0.65963924", "0.65926975", "0.65704006", "0.65521", "0.65180284", "0.6509055", "0.6501074", "0.6490607", "0.64898723", "0.6486376", "0.6469205", "0.646235", "0.6455...
0.73844284
0
Subscribe the event "ALTextToSpeech/Status" to the function "talkingStatus", so that every time Pepper's TTS status changes, the function is called.
function subscribeTalkingStatus() { try { services.memory.then(function(memory) { memory.subscriber('ALTextToSpeech/Status').then(function(evt) { evt.signal.connect(talkingStatus); }); }); } catch (err) { console.log(err.message); // Print the error on a JS console } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onSpeechStart(e) {\n \n }", "_subscribeToNativeStatusUpdateEvents() {\n if (this._loaded) {\n this._subscriptions.push(\n this._eventEmitter.addListener(\n 'didUpdatePlaybackStatus',\n this._internalStatusUpdateCallback\n )\n );\n }\n }", "function startList...
[ "0.63265234", "0.619378", "0.6137849", "0.6008374", "0.5859288", "0.5849607", "0.58377004", "0.5796717", "0.5785421", "0.57834095", "0.5747641", "0.57080513", "0.5659164", "0.5631743", "0.55994475", "0.5572419", "0.55146456", "0.5511842", "0.549607", "0.54938585", "0.54845953...
0.80658275
0
Tell the story related to the current question if any.
function tellStory() { var pause = '\\pau=0\\'; if (game.p == game.quiz.length - 1) pause = '\\pau=2500\\'; if (game.quiz[game.p].story != '') speakOut(game.quiz[game.p].story + pause); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function askQuestion(storyObj) {\n if (storyObj.q === undefined) {\n console.log(chalk.bgYellowBright(storyObj));\n rl.close();\n } else {\n rl.question(chalk.magenta(storyObj.q), (answer) => {\n //check if the user has given us an answer we can understand\n if (sto...
[ "0.6347816", "0.6196188", "0.61815447", "0.60150176", "0.5971771", "0.58582544", "0.58570963", "0.58437043", "0.58342814", "0.5822548", "0.57650113", "0.5751398", "0.5743613", "0.5743613", "0.5743613", "0.57069415", "0.5701469", "0.5681424", "0.5677689", "0.56757396", "0.5664...
0.6884193
0
Stop a video or hide an image depending what media is displayed.
function hideMedia() { if (cStatus.media.type == 'video') { services.tablet.then(function(tablet) { tablet.stopVideo(); }); } else { services.tablet.then(function(tablet) { tablet.hideImage(); }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function stopMedia(destiny){\n var panel = getSlideOrSection(destiny);\n\n //stopping HTML5 media elements\n panel.find('video, audio').each(function(){\n var element = $(this).get(0);\n\n if( !element.hasAttribute('data-keepplaying') && typeof element...
[ "0.7396428", "0.7396428", "0.73849976", "0.73849976", "0.73849976", "0.7365595", "0.7359637", "0.7359637", "0.7359637", "0.7356272", "0.73548406", "0.73548406", "0.73431927", "0.73404527", "0.73229945", "0.7316904", "0.7199507", "0.71792364", "0.7147137", "0.71212643", "0.711...
0.8044729
0
Set the language of the TTS.
function setLanguage() { services.tts.then(function(tts) { if (game.german) tts.setLanguage('German'); else tts.setLanguage('English'); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_setLanguage(language) {\n strings.setLanguage(global.lang[language].shortform)\n global.languageSelected = global.lang[language].shortform\n Alert.alert(strings.changeLanguage, strings.getString(global.lang[language].longform))\n }", "function set_language(lang) {\r\n\r\n if (_lang_code in _lan...
[ "0.7113616", "0.6891599", "0.67593384", "0.65814054", "0.64757186", "0.64540064", "0.6146124", "0.6134874", "0.6082499", "0.60791683", "0.6067266", "0.60637397", "0.60563815", "0.6047979", "0.60470545", "0.6037364", "0.60310626", "0.59911174", "0.59735817", "0.5969181", "0.59...
0.8018011
0
Set the TTS parameters.
function setLangParams() { services.tts.then(function(tts) { if (game.german) { tts.setParameter('pitchShift', TTSPARAMS.pitchShift); tts.setParameter('speed', TTSPARAMS.speed); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async setRtpEncodingParameters(params) {\n if (this._closed)\n throw new InvalidStateError('closed');\n else if (typeof params !== 'object')\n throw new TypeError('invalid params');\n await this.safeEmitAsPromise('@setrtpencodingparameters', params);\n }", "init({ tt...
[ "0.60229075", "0.56287575", "0.53362983", "0.51242286", "0.5122908", "0.5092292", "0.50778574", "0.50765073", "0.50708586", "0.503114", "0.50004864", "0.4999245", "0.4932639", "0.4922342", "0.4919904", "0.48959467", "0.4878752", "0.48672625", "0.48582527", "0.48525804", "0.48...
0.66820335
0
Subscribe the NAOqi signal ALTabletService.videoFinished into videoEnded function.
function subscribeVideoFinished() { services.tablet.then(function(tablet) { tablet.videoFinished.connect(videoEnded); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function videoEnded() {\n // services.tablet.then(function(tablet) {\n // tablet.stopVideo();\n // });\n // if (cStatus.media.type == 'video' && !cStatus.story.spoken) {\n // displayMedia(videoURL);\n // }\n}", "onEnd() {\n console.log('finished playing video');\n this.props.removeVideo(this.prop...
[ "0.75583684", "0.6723147", "0.66520554", "0.65050805", "0.6378587", "0.634569", "0.62747717", "0.6196278", "0.6158478", "0.60964745", "0.6025972", "0.5994288", "0.58253896", "0.5725915", "0.5676911", "0.56635857", "0.56391335", "0.56372774", "0.5623361", "0.56159127", "0.5601...
0.83869654
0
Return the radius for a circle according to analyser.maxValue and analyser.maxRadius
static getCircleRadius(value, maxValue, maxRadius){ const radius = (maxRadius / 2 ) * Math.sqrt(value/maxValue) return radius }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "calculateRadius() {\r\n let radius = 50;\r\n if (this.progressWidth || this.backgroundWidth) {\r\n const maxVal = (this.progressWidth > this.backgroundWidth) ? this.progressWidth : this.backgroundWidth;\r\n radius = radius - (maxVal / 2);\r\n }\r\n else {\r\n ...
[ "0.73571163", "0.73420095", "0.7237496", "0.71851367", "0.7164535", "0.7126228", "0.7087988", "0.70729244", "0.70657", "0.70455587", "0.7012275", "0.69435215", "0.6903633", "0.6887034", "0.68860584", "0.6884939", "0.68442076", "0.6819855", "0.6782824", "0.67716134", "0.676808...
0.7917364
0
Update positioning for x,y titles, legend and footnote
function updateXYtitlesPosition(width, height, file_name, d3graph_container) { var delta = getResolution() < 1400 ? 15 : 0; d3graph_container.select('.x-title') .attr('transform', 'translate(' + ((width / 2) - 10) + ', 60)'); var x = (file_name === 'IP') ? -70 : -40; d3graph_container.select('....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function repositionTooltip() {\n\t\t\ttipController.resetPosition(element);\n\t\t}", "function setLabelPositions(){\n labelPosition = {\n x: margin.top + height + (3 * margin.bottom / 4),\n y: margin.left / 4\n }; \n}", "function positionCB() {\n var bb;\n var innerThickness = thickP...
[ "0.65935993", "0.6457549", "0.63767105", "0.6188271", "0.61732686", "0.6133809", "0.611025", "0.6082203", "0.6080506", "0.60720545", "0.6054876", "0.6049888", "0.6048831", "0.5967987", "0.5956289", "0.5926871", "0.5917154", "0.5854545", "0.5839471", "0.5814921", "0.57909715",...
0.6637458
0
Prevent double click on chart since it messes with legend design. > turn off stateChange and then turn it back on again as soon as possible
function preventDblClickLegend(chart) { chart.legend.dispatch.on('legendDblclick', function (e) { chart.legend.updateState(false); setTimeout(function () { chart.legend.updateState(true); }, 1); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onLegendItemClick(event) {\n\t\thideDisplayedPoints(this);\n\t}", "function toggleSelection(event) {\n const wasShown = !isShown\n updateHiddenTraces(label, wasShown)\n\n const legendEntry = {\n label, numPoints, numLabels, wasShown, iconColor,\n hasCorrelations\n }\n log('click...
[ "0.6609796", "0.6599617", "0.6574615", "0.6528188", "0.6421454", "0.63372695", "0.6332938", "0.62916356", "0.62212706", "0.6114115", "0.60771894", "0.6063352", "0.6049264", "0.59855527", "0.59809524", "0.5970641", "0.59637874", "0.5955867", "0.5940678", "0.5904516", "0.590419...
0.78053087
0
Convert default circle legend items to rectangles.
function circlesToRectangles(d3graph_container) { d3graph_container.selectAll('.nv-series').each(function (d) { var group = d3.select(this), circle = group.select('circle'), color = circle.style('fill'); circle.remove(); var symbol = group.append('path') ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createSVGLegendDiscrete(legend) {\n const MARGIN_LEFT = 5;\n const MARGIN_TOP = 5;\n const LEGEND_ITEM_HEIGHT = 30;\n const LEGEND_ITEM_BORDER = 'rgb(119,119,119);';\n const LEGEND_ITEM_WIDTH = '3px';\n const FONT_COLOR = 'black';\n const FONT_SIZE = '18px';\n const FONT_FAMILY = 'Arial';\n const...
[ "0.6004016", "0.5852893", "0.58236617", "0.5646038", "0.5589379", "0.5467192", "0.5382768", "0.5376477", "0.53620064", "0.53467727", "0.5318055", "0.53112626", "0.52656645", "0.52330726", "0.5226251", "0.5210885", "0.52095395", "0.51770353", "0.5159051", "0.51447076", "0.5120...
0.67880684
0
Method to bind view to Menu Provider It will be called from command helper.ts
bindView(menuTreeView) { this.view = menuTreeView; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function MenuProvider(e){function n(){}return e(\"$mdMenu\").setDefaults({methods:[\"placement\"],options:n})}", "showMenu() {\n this._game = null;\n this.stopRefresh();\n this._view.renderMenu();\n this._view.bindStartGame(this.startGame.bind(this));\n this._view.bindShowScore...
[ "0.65490586", "0.62433267", "0.6035926", "0.6033419", "0.5939307", "0.5928994", "0.5838098", "0.57882875", "0.5786135", "0.5778566", "0.57730156", "0.5771576", "0.57536334", "0.574425", "0.5720144", "0.571598", "0.5705232", "0.569051", "0.5675688", "0.5646575", "0.5595648", ...
0.72363013
0
HANDLE RANDOMME.API Pictures Response Will get back 5 if an argument is not provided
function sendRandomPhotosResponse(response) { return response.data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getImages(){\n const randomPage = Math.floor(Math.random() * (10) + 1)\n axios.get(`https://picsum.photos/v2/list?page=${randomPage}&limit=100`)\n .then(function(response) {\n pickRandomImage(response.data)\n console.log(response.data);\n })\n ...
[ "0.66924524", "0.6372864", "0.63696975", "0.626149", "0.6245869", "0.62422013", "0.6230683", "0.6190928", "0.6190041", "0.6063634", "0.606084", "0.6059988", "0.6058571", "0.60570323", "0.60292363", "0.6024178", "0.60220563", "0.60153884", "0.59541374", "0.59442717", "0.592168...
0.73400235
0
This function call will select a random memes url from the array of all the bulkImageUrls.example which contained an already made memes.
function getRandomMemes() { const randomMemesUrl = []; bulkImageUrls.map((imageUrl) => { randomMemesUrl.push(imageUrl.example); }); // console.log(randomMemesUrl); const randomNumber = Math.floor(Math.random() * randomMemesUrl.length); return randomMemesUrl[randomNumber]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getUrl() {\n // debugger;\n return urls[Math.floor(Math.random() * urls.length)];\n }", "function getRandomImage() {\n\treturn CAGE_URLS[Math.floor(Math.random() * CAGE_URLS.length)];\n}", "function getRandomPic() {\n\tlet imgId = Math.floor(Math.random() * pictureList.length);\n\t...
[ "0.64274126", "0.6393535", "0.6327639", "0.63157797", "0.6211733", "0.6171145", "0.6168306", "0.61554694", "0.6106515", "0.6104354", "0.6028181", "0.59998256", "0.5992133", "0.5974564", "0.5947096", "0.5936181", "0.59322137", "0.5915201", "0.5890623", "0.58881485", "0.5885768...
0.8491679
0
this function handles the change of the random meme by triggering the getRandomMemes function on a button click.
function handleRandomMemeChange() { setRandomMemes(getRandomMemes()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startRandom() {\n $(\"#random-button\").on(\"click\", function () {\n\n computerGuess = Math.floor(Math.random() * (120 - 19) + 19);\n })}", "function selectMeme()\n{\n\tvar r = Math.floor( Math.random() * memesLength );\n\tvar it = 0;\n\t//Si el numero aleatorio ya esta selecci...
[ "0.69509315", "0.6771618", "0.6664749", "0.660754", "0.6576658", "0.65747255", "0.6570431", "0.64447564", "0.6338619", "0.6275384", "0.6258835", "0.6254554", "0.6212983", "0.6181043", "0.6179327", "0.6159283", "0.61498106", "0.6147525", "0.614417", "0.613964", "0.61391956", ...
0.8517258
0
but also modify the this value of the functions passed through while ensuring arguments are properly passed. We ask you to write the following functions: justInvoke(fn): The function simply invokes the function passed through to it. It also returns the return value of the passed through function.
function justInvoke(fn){ return fn() }//justInvoke
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function justInvoke(fn) {\n return fn();\n}", "fnInvoke(fn, ...args) {\n if (fn == null || !isFunc(fn)) {\n return null;\n }\n\n try {\n return fn.call(this, ...args);\n }\n catch (e) {\n this.__notify(EV.SUPPRESSED_ERROR, e);\n return null;\n }\n }", "function helloFunc...
[ "0.7449523", "0.6186866", "0.6154175", "0.6083316", "0.5901787", "0.5901787", "0.5901787", "0.5901787", "0.5900431", "0.5900431", "0.58503807", "0.58468455", "0.58468455", "0.5802334", "0.5802334", "0.5802334", "0.5802334", "0.5802334", "0.5802334", "0.5802334", "0.5802334", ...
0.7646799
0
Merges max heaps a and b into merged
function mergeHeaps(arr, a, b , n , m) { for (var i = 0; i < n; i++) { arr[i] = a[i]; } for (var i = 0; i < m; i++) { arr[n + i] = b[i]; } n = n + m; // Builds a max heap of given arr[0..n-1] for (var i = parseInt(n / 2 - 1); i >= 0; i--) { maxHeapify(arr, n, i); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function merge(a, b){\n var arr = [];\n while (a.length && b.length) {\n if (a[0] < b[0]) {\n arr.push(a.shift());\n } else {\n arr.push(b.shift());\n }\n }\n while (a.length) {\n arr.push(a.shift());\n }\n while (b.length) {\n arr.push(b.shift());\n }\n return arr;\n}", "functio...
[ "0.6320703", "0.6313762", "0.6257994", "0.61354274", "0.60125804", "0.60091907", "0.5982346", "0.5981023", "0.59642863", "0.5960598", "0.5907412", "0.58548385", "0.5801697", "0.5781994", "0.57655853", "0.5741749", "0.5726326", "0.5706045", "0.5653034", "0.56386715", "0.560818...
0.76503056
0
Running Python Script Tagger from here
function generateTags(text){ var tags; var options = { args: [text] }; PythonShell.run('taggers/tagger.py', options,function (err, results) { if (err) { } tags = results; }); return tags; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Tagged() {\r\n}", "function generateTags(sourcefile,source) {\n\n sourcelines = source.split(/\\r?\\n/); //access text of a line from source file by index \n\n try {\n // var result = parse(source,{loc:true});\n var result = parse(source,{\n sourceType: moduleParseMode ? 'module'...
[ "0.59096324", "0.57833874", "0.55304307", "0.54664123", "0.534699", "0.5342193", "0.5311355", "0.5287165", "0.52511674", "0.52308846", "0.52276736", "0.52185965", "0.52185965", "0.52002734", "0.5160542", "0.51503795", "0.5130722", "0.51240575", "0.511299", "0.51032364", "0.50...
0.6431091
0
delete the storage of Algebrite. print the result to the id
function delete_storage(){ simact.Algebrite.run("clearall"); filloutputarea(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteIt(){\n \tupdateDB(\"delete\", pageElements.alertText.dataset.id);\n }", "function deleteAlgolia(idx){\n\tidx.map(function(_file){\n\t\talgolia.deleteObject(new Buffer(_file).toString('base64'), function(err) {\n\t\t\tif (!err) {\n\t\t\t\tconsole.log(_file + ' deleted');\n\t\t\t}\n\t\t});\n\t});...
[ "0.6262157", "0.6238914", "0.61299413", "0.6085721", "0.6067934", "0.6053488", "0.60226464", "0.6016588", "0.60124797", "0.5989895", "0.59592605", "0.5941798", "0.5935059", "0.59280205", "0.59192353", "0.59126973", "0.5910859", "0.5910859", "0.5909231", "0.5903241", "0.589838...
0.78686875
0
Return the user, along with all the blog posts it has authored, and all the comments it has created.
getFullUserById(db, id) { let userNotFound = false; let user; let blogPosts = []; let comments = []; return usersService.getUserById(db, id) .then((result) => { if (!result) { userNotFound = true; return; } user = result; }) .then(() => ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "user(post) {\n return post.getUser();\n }", "posts(user) {\n return user.getPosts();\n }", "async function getUser() {\n const options = {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n 'Authorization': `bearer ${TokenService.getAuthToken()}`\n ...
[ "0.67777646", "0.64278543", "0.63162667", "0.6307957", "0.6160034", "0.6114174", "0.59904915", "0.5937375", "0.5897522", "0.58861357", "0.5885673", "0.58286196", "0.57779837", "0.57596", "0.57544696", "0.5751709", "0.570747", "0.56707114", "0.56025535", "0.5601421", "0.558636...
0.6572387
1
Licenses colorizer (based on category)
function colors(licenses) { for (const [license, value] of Object.entries(licenses)) { const [permissions, conditions] = [value.permissions, value.conditions].map(properties => properties.map(({key}) => key)) switch (true) { //Other licenses case (license === "other"): { value.color = "#8b...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function CategoryColors (styles) {\n this.updateColors(styles);\n}", "function CategoryColors (styles) {\n this.updateColors(styles);\n}", "function getColor(d) {\n let category = 0;\n if(typeof(d.data.cat) != \"undefined\") {\n category = parseInt(d.data.cat);\n }\n\n // if($(\"#modal-hea...
[ "0.6154283", "0.6154283", "0.61500883", "0.60926855", "0.595062", "0.5948564", "0.59417427", "0.591182", "0.5871727", "0.58266574", "0.58253783", "0.5800886", "0.57723147", "0.5725386", "0.5725386", "0.569029", "0.56834894", "0.56746", "0.5666115", "0.5640604", "0.56401217", ...
0.62381554
0
Ejercicio 3: Pedir al usuario un numero entre 10 y 100 Imprimir todos los numeros pares que existen entre 1 y ese numero
function ejercicio2(){ let numero3=prompt("Ingresa un número entre 10 y 100") if (numero3>9 && numero3<101 ){ if (numero3==10) console.log("Debe ingresar un número mayor a 10 para que tenga pares") else{ console.log(`Número ingresado: ${numero3}`) for (let x=1...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cantidad_pares_arreglo() {\n\tvar pares = new Number();\n\tvar i = new Number();\n\tvar cantidad = new Number();\n\tvar cantidadpares = new Number();\n\tvar cantidadimpares = new Number();\n\ti = 0;\n\tdocument.write(\"Digite el limete del arreglo: \",'<BR/>');\n\tcantidad = Number(prompt());\n\tvar pares...
[ "0.65435624", "0.63114715", "0.6297286", "0.628036", "0.6133405", "0.59914625", "0.5949554", "0.5936819", "0.5922836", "0.59088206", "0.5889335", "0.58095664", "0.5754358", "0.57521075", "0.5732059", "0.57276887", "0.5717069", "0.5708877", "0.57030547", "0.56828433", "0.56792...
0.6679017
0
Ejercicio 6; Imprimir en consola la suma de los multiplos de 3 y 5 contenidos entre el 1 y 100 > 233168
function ejercicio5(){ let multiplo3=0, multiplo5=0, suma=0 for (let x=1; x<101;x++){ multiplo3=x%3 multiplo5=x%5 if(multiplo3==0 || multiplo5==0){ suma+=x } } console.log(`El resultado de la suma de los multiplos de 3 y 5 es: ${suma}`) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sumMults(n) {\n let mult = [],\n sum = 0,\n max = Math.floor(n / 3),\n i = 1;\n\n for (i; i <= max; i++) {\n if (i * 3 < n) {\n if (!mult.includes(i * 3)) {\n mult.push(i * 3);\n sum += i * 3;\n }\n }\n if (i * 5 < n) {\n if (!mult.includes(i * 5)) {\n ...
[ "0.7279682", "0.72050416", "0.6970193", "0.6959439", "0.6811552", "0.67831415", "0.6775361", "0.6772205", "0.6769416", "0.6749515", "0.6737607", "0.67333543", "0.6731642", "0.6708974", "0.67066187", "0.67038375", "0.66924924", "0.6685105", "0.66627055", "0.6649109", "0.661805...
0.75902253
0
Ejercicio 7: Deducir: input: Hola como estas output: holaComoEstas input: hello Koders output: helloKoders
function ejercicio6(){ let cadenaEntrada=prompt("Ingrese una cadena de texto").toLowerCase() let textoFinal=convertirLetras(cadenaEntrada) console.log(`El texto inicial fue: ${cadenaEntrada}`) console.log(`El texto resultante es: ${textoFinal}`) function convertirLetras(entradaDatos){ let ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function option7(input, output) {\n console.log(\"option7\");\n var words = input.value.toLowerCase().split(' ');\n for (var i = 0; i < words.length; i++) {\n words[i] = words[i].substring(0).slice(0, 2) + words[i].charAt(2).toUpperCase() + words[i].substring(3);\n }\n output.value = words.joi...
[ "0.6192976", "0.6008274", "0.5992494", "0.59884596", "0.59753215", "0.59654385", "0.5938928", "0.5937196", "0.5908095", "0.5885885", "0.58853936", "0.58755994", "0.5854146", "0.5825384", "0.5803472", "0.57934326", "0.5777963", "0.57764983", "0.5772661", "0.5771904", "0.576660...
0.65324265
0
Double Vision Given an array (similar to saying 'takes in an array'), create a function that returns a new array where each value in the original array has been doubled. Calling double([1,2,3]) should return [2,4,6] without changing the original array.
function doubleVision(arr) { var double = []; for (var i = 0; i < arr.length; i++) { arr[i] = arr[i] * 2; double.push(arr[i]); } return double }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function double(array) {\n var returnArray;\n for (index = 0; index < a.length; ++index) {\n returnArray[0] = array[0]*2;\n }\n return returnArray;\n}", "function doubleVision(array) {\n var newDoubleArray = [];\n\n for (var num in array) {\n newDoubleArray[num] = array[num] * 2;\n }\n\n ...
[ "0.7893158", "0.78154624", "0.7743724", "0.77136457", "0.7705491", "0.76315886", "0.759152", "0.75741065", "0.7547963", "0.7537071", "0.75138044", "0.75011396", "0.74932903", "0.74250627", "0.7406369", "0.7333215", "0.72987854", "0.72727054", "0.7234913", "0.72078687", "0.717...
0.81620574
0
Show the next part of the snowman.
showNext() { if (this.visibleIndex === (this.parts.length - 1)) { return; } this.parts[++this.visibleIndex].setVisible(true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showNext() {\n\t\tif (this.container.width() > 0) {\n\t\t\tthis.nextImage();\n\t\t\tthis.showCurrent();\n\t\t}\n\t\tthis.run();\n\t}", "function next() {\n slide(false, true);\n }", "function drawNext(){\n prepareNextPiece();\n\n if(matrixNext.type === 'L' || matrixNext.type === 'I'){...
[ "0.7352828", "0.68666667", "0.6669103", "0.6625835", "0.660322", "0.660194", "0.6592347", "0.657368", "0.6570975", "0.6533792", "0.6507174", "0.6502428", "0.64771414", "0.6430194", "0.6384766", "0.6381955", "0.63514525", "0.63445354", "0.6341417", "0.6328133", "0.63132405", ...
0.71289
1
Reset all snowman parts to invisible(false).
reset() { this.parts.forEach((part) => part.setVisible(false)); this.visibleIndex = -1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function unScareGhosts() {\r\n // It just changes the isScared to false again:\r\n ghosts.forEach(ghost => ghost.isScared = false)\r\n}", "function unScareGhosts() {\n ghosts.forEach(ghost => ghost.isScared = false)\n}", "function unScareGhosts() {\n ghosts.forEach(ghost => ghost.isScared = false)\...
[ "0.6974458", "0.69449997", "0.69449997", "0.69038194", "0.68442124", "0.67823875", "0.6755403", "0.6575431", "0.65169525", "0.63817036", "0.63564336", "0.6270324", "0.6260877", "0.6222389", "0.620758", "0.62013054", "0.61500067", "0.6132827", "0.61325425", "0.61323565", "0.61...
0.7188878
0
User Receives Message Methods// Method called whenver there is a new recieved message This message comes from the AJAX request sent to API.AI This method tells which type of message is to be sent Splits between the button messages, multi messages and single message
function newRecievedMessage(messageText) { // Variable storing the message with the "" removed var removedQuotes = messageText.replace(/[""]/g,""); // Determining options type selectOne = removedQuotes.startsWith("single"); selectLang = removedQuotes.startsWith("lang"); selectOption = removedQuotes.startsWith(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function receivedMessage(event) {\n var senderID = event.sender.id;\n var recipientID = event.recipient.id;\n var timeOfMessage = event.timestamp;\n var message = event.message;\n\n console.log(\"Received message for user %d and page %d at %d with message:\", \n senderID, recipientID, timeOfMessage);\n co...
[ "0.7287952", "0.70188534", "0.6971014", "0.6963778", "0.6901635", "0.68316644", "0.6785575", "0.6758268", "0.67534745", "0.67306185", "0.6713507", "0.66923517", "0.6627372", "0.6593656", "0.6582627", "0.65778875", "0.6569267", "0.65518486", "0.6541229", "0.6532661", "0.652644...
0.7305073
0
Method called whenever an <ar tag is found The responses for this type of message will be buttons This method parses out the time delays, message text and button responses Then creates a new message with the time delay and creates buttons for the responses
function buttonResponse(message) { // Stores the matches in the message, which match the regex var matches; // Used to store the new HTML div which will be the button var $input; // send the message to the multi message method to split it up, message will be sent here multiMessage(message); // Regex used t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function multiMessage(message)\n{\n\n\t// Stores the matches in the message, which match the regex\n\tvar matches;\n\n\t// List of message objects, each message will have a text and time delay\n\tvar listOfMessages = [];\n\t\n\t// Regex used to find time delay and text of each message\n\tvar regex = /\\<br(?:\\s+?...
[ "0.58794135", "0.56474006", "0.56310666", "0.5507853", "0.5419264", "0.53872216", "0.5367484", "0.5332565", "0.5293769", "0.5286919", "0.5268677", "0.52562803", "0.52354693", "0.522471", "0.52237225", "0.5221485", "0.5204378", "0.5195269", "0.5192682", "0.5171641", "0.5166220...
0.71883553
0
TODO: Create a function that returns the license section of README If there is no license, return an empty string
function LicenseSection(license) { const licenseURL = LicenseLink(license); console.log('licenseURL', licenseURL); const licenseSectionText = `Licensed under [${license}](${licenseURL}).`; return licenseSectionText; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderLicenseSection(license) {\n if (!license) return '';\n else if (license === 'MIT License') {\n return 'This project is covered under the MIT License. For more information, please click the link below.';\n } else if (license === 'GNU GPLv3') {\n return 'This project is covered under the GNU ...
[ "0.7592587", "0.75429654", "0.75330704", "0.7532757", "0.75178236", "0.74742657", "0.74656355", "0.7464355", "0.74303514", "0.7427769", "0.7395764", "0.73721796", "0.7368628", "0.73596185", "0.7350753", "0.73486924", "0.7347283", "0.73469776", "0.73424506", "0.7339198", "0.73...
0.7603397
0
console.log(random1); task5: funcition filterRange, that takes 3 params array, minValue and maxValue, and returns a new array of elements within that range;
function filterRange(arr, minValue, maxValue) { var newArr = []; for(var index = 0; index < arr.length; index++) { if(arr[index] >= minValue && arr[index] <= maxValue) { newArr.push(arr[index]); } } return newArr; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function filterRange(){\n return function(arr, a, b){\n return arr.filter(function(value){\n return value >= a && value <= b;\n });\n }\n }", "function filterBetween(array, min, max) {\n\n}", "function filterRange(arr, a, b) {\n const newArr = arr.filter(i...
[ "0.7660736", "0.7656042", "0.746982", "0.7401056", "0.7380314", "0.73743165", "0.70605487", "0.7051847", "0.6975903", "0.6961544", "0.6831667", "0.68291265", "0.68184745", "0.67837584", "0.67463034", "0.67219687", "0.67021865", "0.66929734", "0.66569823", "0.6644748", "0.6542...
0.785197
0
Multiplayer Game Setup Functions // / Player 1 Self Place Ship Function
function selfSetupP1() { // Ship Orientation Player 1 // $(".player").addClass("horz").removeClass("player").text("Horizontal"); $(".random").addClass("vert").removeClass("random").text("Vertical"); // Create Player 1 Fleet // player1Fleet = new Fleet("Player 1"); player1Fleet.initShips(); placeShipP1(player1Fle...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function selfSetupP2() {\n\t// Ship Orientation Player 2 //\n\t$(\".player\").addClass(\"horz\").removeClass(\"player\").text(\"Horizontal\");\n\t$(\".random\").addClass(\"vert\").removeClass(\"random\").text(\"Vertical\");\n\t// Create Player 2 Fleet //\n\tplayer2Fleet = new Fleet(\"Player 2\");\n\tplayer2Fleet.i...
[ "0.75246793", "0.72286034", "0.71585757", "0.70262957", "0.69372296", "0.68861294", "0.68252534", "0.67245954", "0.67200285", "0.6715069", "0.6681917", "0.66382927", "0.65465206", "0.6529653", "0.64795524", "0.6462708", "0.6426285", "0.64241546", "0.6396305", "0.638068", "0.6...
0.7591466
0
Player 1 Fleet Created
function createSinglePlayerFleet() { // Player 1 Random Ship Placement // player1Fleet = new Fleet("Player 1"); player1Fleet.initShips(); randomSetupMulti(player1Fleet); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createPlayer2Fleet() {\n\t// Player 2 Random Ship Placement //\n\tplayer2Fleet = new Fleet(\"Player 2\");\n\tplayer2Fleet.initShips();\n\trandomSetupMultiP2(player2Fleet);\n}", "function launchFleet(planetA, planetB, player)\n{\n // TODO: This function launches a fleet from planet A to planet B,\n // ...
[ "0.7114708", "0.6476045", "0.6422922", "0.61466974", "0.611422", "0.60812116", "0.6005457", "0.600409", "0.5998428", "0.5989385", "0.5985507", "0.5977321", "0.5955884", "0.5921533", "0.587328", "0.5848592", "0.5847814", "0.5828663", "0.58276296", "0.5820501", "0.5785505", "...
0.78312695
0
Player 2 Fleet Created
function createPlayer2Fleet() { // Player 2 Random Ship Placement // player2Fleet = new Fleet("Player 2"); player2Fleet.initShips(); randomSetupMultiP2(player2Fleet); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createSinglePlayerFleet() {\n\t// Player 1 Random Ship Placement //\n\tplayer1Fleet = new Fleet(\"Player 1\");\n\tplayer1Fleet.initShips();\n\trandomSetupMulti(player1Fleet);\n}", "function selfSetupP2() {\n\t// Ship Orientation Player 2 //\n\t$(\".player\").addClass(\"horz\").removeClass(\"player\").te...
[ "0.75658834", "0.7003743", "0.6711365", "0.6484855", "0.62752587", "0.6267966", "0.62546915", "0.60532546", "0.6048093", "0.6025454", "0.5943979", "0.5932158", "0.5926502", "0.58575004", "0.5841573", "0.5826806", "0.5808352", "0.57925564", "0.57890546", "0.5784794", "0.577332...
0.82612115
0
Ship Self Placement, Maniopulation & Highlights Player 1
function placeShipP1(ship, fleet) { var orientation = "horz"; // Player 1 Vertical Ship Button // $(".vert").off("click").on("click", function() { orientation = "vert"; }); // Player 1 Horizontal Ship Button // $(".horz").off("click").on("click", function() { orientation = "horz"; }); // Player 1 Ship Track...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function placeShipP2(ship, fleet) {\n\tvar orientation = \"horz\";\n\t// Player 2 Vertical Ship Button //\n\t$(\".vert\").off(\"click\").on(\"click\", function() {\n\t\torientation = \"vert\";\n\t});\n\t// Player 2 Horizontal Ship Button //\n\t$(\".horz\").off(\"click\").on(\"click\", function() {\n\t\torientation...
[ "0.6970417", "0.6917836", "0.68803525", "0.6832772", "0.6705181", "0.6608899", "0.6596276", "0.6558415", "0.6551374", "0.6526309", "0.64696133", "0.64493495", "0.6405331", "0.6384967", "0.6332479", "0.6328988", "0.6305518", "0.62752634", "0.6213662", "0.6194665", "0.6190361",...
0.725939
0
Horizontal Ship Placement Player 1
function displayShipHorz1(location, ship, point, fleet) { var endPoint = location + ship.length - 2; // Ship Turned Horizontal Player 1 // if (!(endPoint % 10 >= 0 && endPoint % 10 < ship.length - 1)) { for (var i = location; i < (location + ship.length); i++) { $(".bottom2 ." + i).addClass("highlight"); } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function placeShipP1(ship, fleet) {\n\tvar orientation = \"horz\";\n\t// Player 1 Vertical Ship Button //\n\t$(\".vert\").off(\"click\").on(\"click\", function() {\n\t\torientation = \"vert\";\n\t});\n\t// Player 1 Horizontal Ship Button //\n\t$(\".horz\").off(\"click\").on(\"click\", function() {\n\t\torientation...
[ "0.76880276", "0.712809", "0.68742645", "0.6803666", "0.66865087", "0.66862506", "0.65711194", "0.65611225", "0.641433", "0.6329932", "0.62987053", "0.627488", "0.62657005", "0.6261131", "0.6196185", "0.618526", "0.6156471", "0.61424845", "0.6132489", "0.6129491", "0.6129064"...
0.7134025
1
Ship Self Placement, Maniopulation & Highlights Player 2
function placeShipP2(ship, fleet) { var orientation = "horz"; // Player 2 Vertical Ship Button // $(".vert").off("click").on("click", function() { orientation = "vert"; }); // Player 2 Horizontal Ship Button // $(".horz").off("click").on("click", function() { orientation = "horz"; }); // Player 2 Ship Track...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function placeShipP1(ship, fleet) {\n\tvar orientation = \"horz\";\n\t// Player 1 Vertical Ship Button //\n\t$(\".vert\").off(\"click\").on(\"click\", function() {\n\t\torientation = \"vert\";\n\t});\n\t// Player 1 Horizontal Ship Button //\n\t$(\".horz\").off(\"click\").on(\"click\", function() {\n\t\torientation...
[ "0.7154685", "0.71281916", "0.7033258", "0.6911491", "0.66832227", "0.6657219", "0.66525364", "0.65521324", "0.6517267", "0.65128255", "0.64803886", "0.6477896", "0.6472694", "0.64218366", "0.63976103", "0.6352918", "0.63498455", "0.63379717", "0.6297894", "0.6287089", "0.628...
0.7276569
0
Vertical Ship Placement Player 2
function displayShipVert2(location, ship, point, fleet) { var endPoint = (ship.length * 10) - 10; var inc = 0; // Ship Turned Vertical Player 2 // if (location + endPoint <= 100) { for (var i = location; i < (location + ship.length); i++) { $(".bottom3 ." + (location + inc)).addClass("highlight"); inc = in...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function placeShipP2(ship, fleet) {\n\tvar orientation = \"horz\";\n\t// Player 2 Vertical Ship Button //\n\t$(\".vert\").off(\"click\").on(\"click\", function() {\n\t\torientation = \"vert\";\n\t});\n\t// Player 2 Horizontal Ship Button //\n\t$(\".horz\").off(\"click\").on(\"click\", function() {\n\t\torientation...
[ "0.75731796", "0.69820404", "0.69641715", "0.6850663", "0.6693443", "0.6622901", "0.627731", "0.6270651", "0.62092", "0.6122137", "0.61088485", "0.6050477", "0.605", "0.59968615", "0.59892005", "0.596592", "0.5964164", "0.5936296", "0.5933052", "0.5921303", "0.5906213", "0....
0.738087
1
Do Ship Sections Overlap for Player 2
function checkOverlap(location, length, orientation, genFleet) { var loc = location; // Player 2 Overlap Horizontal Check // if (orientation == "horz") { var end = location + length; for (; location < end; location++) { for (var i = 0; i < genFleet.currentShip; i++) { if (genFleet.ships[i].location...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function placeShipP2(ship, fleet) {\n\tvar orientation = \"horz\";\n\t// Player 2 Vertical Ship Button //\n\t$(\".vert\").off(\"click\").on(\"click\", function() {\n\t\torientation = \"vert\";\n\t});\n\t// Player 2 Horizontal Ship Button //\n\t$(\".horz\").off(\"click\").on(\"click\", function() {\n\t\torientation...
[ "0.6462443", "0.63395983", "0.63260585", "0.627221", "0.6270971", "0.62594616", "0.62006456", "0.6166697", "0.6116993", "0.61003864", "0.6084013", "0.60827464", "0.6068405", "0.5997024", "0.5968923", "0.5952721", "0.59251934", "0.5903931", "0.5861454", "0.5843915", "0.5814270...
0.654595
0
Hides universal analytics sheets.
function hideUASheets() { showOrHideSheets('ua', 'hide'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hideTrends() {\n hideSheetsOfType(CONFIG.DEFAULT.TREND_NAME);\n showMessage('Use the \"Show Trend sheets\" function in the Trend menu to make them visible again.','Trend sheets are hidden');\n }", "function mydoc_off()\n{\n\n\tcheck_advert_status();\n\tcheck_sidepanel_hieght();\n show('map');\...
[ "0.66321695", "0.64221996", "0.6404963", "0.6319539", "0.6312051", "0.6277685", "0.62462664", "0.6166014", "0.6125198", "0.6105652", "0.60650337", "0.60535836", "0.603588", "0.60293", "0.6000434", "0.599896", "0.59916216", "0.5965546", "0.59543544", "0.5953314", "0.5937536", ...
0.7559084
0
Shows universal analytics sheets.
function showUASheets() { showOrHideSheets('ua', 'show'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _showAggregateAnalitycs(client){\r\n\r\n\t\t\twindow.location.hash = '';\r\n\r\n\t\t\tif(Page.mediaspots.length == 0){\r\n\t\t\t\t$div.hide();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t_mediaspot = null;\r\n\r\n \t\t$('[href=\"#tab-analytics\"]').tab('show')\r\n\t\t\t$div.find('.mediaspot-tabs').hide();...
[ "0.6174665", "0.583261", "0.5826473", "0.58256143", "0.58018434", "0.5682509", "0.5667678", "0.5654555", "0.56351644", "0.5625042", "0.5601739", "0.55707514", "0.5549213", "0.55247855", "0.5501183", "0.5432454", "0.5427546", "0.5425012", "0.5409847", "0.5404779", "0.53915524"...
0.7078932
0
Generate Initiative For Monsters
function rollInitiative(x){ // Roll a d20 for initiative var initiativeRoll = Math.floor(Math.random()*20)+1; // add monsters dex bonus if (x === 1){initiativeRoll-=5} else if (x > 2 && x < 4){initiativeRoll-=4} else if (x > 3 && x < 6){initiativeRoll-=3} else if (x > 5 && x < 8){initiativeR...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createCompleteOrcCharacter()\n{\n getOrcAge();\n getOrcBuild();\n getOrcAppearance();\n getOrcBackground();\n getOrcPersonality();\n}", "function GenerateCharacter() {\n\tNameGenerator();\n\tAssignPersonality();\n\tAssignBuild();\n\tAbiltyScores();\n\tAssignRace();\n\tRacialAttributes(OPC...
[ "0.60325533", "0.59403056", "0.5794361", "0.5744385", "0.5587689", "0.5584476", "0.55732507", "0.54659593", "0.5438578", "0.5434088", "0.53833294", "0.5376604", "0.536201", "0.5313586", "0.5299003", "0.5292304", "0.5269063", "0.5222424", "0.5221337", "0.5219134", "0.5199283",...
0.60253155
1
this object implements an AJAX system that is linked to a serverside PHP script that does the actual indexing searchPath: the path to the Walden Search PHP file submitButton: the ID of the button / element that you want to be clicked to perform a search textField: the textfield form control that will contain the term t...
function AJAXSearch ( searchPath, submitButton, textField ) { // ************************************************* // this function sets up the XMLHttpRequest object and sends off the search query this.executeSearch = function ( ) { // first we need to retrieve the search phrase from the textField that wa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleSubmit() {\n //Take the search term string entered by the user in the input field, add it to the baseUrl, make a fetch request to that new url, and append the results of what we searched for to the DOM in the correct element, wrapped in li tags\n}", "function searchClick(){\r\n\t//get searchbox v...
[ "0.6750368", "0.654455", "0.6393856", "0.63884056", "0.6382316", "0.63434964", "0.62722474", "0.6271457", "0.62564754", "0.62509805", "0.6250616", "0.6248621", "0.62406", "0.6221869", "0.619289", "0.6192129", "0.619172", "0.6189272", "0.6155213", "0.6155162", "0.6147391", "...
0.7468945
0
Using a ForLoop We separate the sentence into an array using .split(). We use the variable maxLength to hold the maximum length encountered at each point of iterationn using the forloop.
function longestWord(text) { let wordArray = text.split(" "); let maxLength = 0; let result = ""; for (let i = 0; i < wordArray.length; i++) { if (wordArray[i].length > maxLength) { //We Check for length of wordArray[i] to see if its greater than maxLength maxLength = wordWarray[i].length; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function longestWord(text) {\n let sentence = text.split(' ');\n let maxLength = 0;\n for(let i = 0; i < sentence.length; i++) {\n if(sentence[i].length > maxLength){\n maxLength = sentence[i].length;\n }\n }\n return maxLength;\n}", "function longestWord(sentence) {\n//De...
[ "0.7069576", "0.67989343", "0.67146754", "0.6678782", "0.66263795", "0.6609628", "0.6585727", "0.6579796", "0.65330416", "0.6483619", "0.646998", "0.64560276", "0.6456", "0.6433639", "0.6426856", "0.642517", "0.6398427", "0.63949734", "0.63422906", "0.63374907", "0.63273096",...
0.68596214
1
Computes the decimal coefficient and exponent of the specified number x with significant digits p, where x is positive and p is in [1, 21] or undefined. For example, formatDecimal(1.23) returns ["123", 0].
function formatDecimal(x, p) { if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf("e")) < 0) return null; // NaN, ±Infinity var i, coefficient = x.slice(0, i); // The string returned by toExponential either has the form \d\.\d+e[-+]\d+ // (e.g., 1.2e+3) or the form \de[-+]\d+...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function formatDecimal(x, p) {\n if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf(\"e\")) < 0) return null; // NaN, ±Infinity\n var i, coefficient = x.slice(0, i);\n\n // The string returned by toExponential either has the form \\d\\.\\d+e[-+]\\d+\n // (e.g., 1.2e+3) or the form \\...
[ "0.8266672", "0.8266672", "0.8266672", "0.8266672", "0.8266672", "0.8266672", "0.8266672", "0.8244212", "0.82371384", "0.82371384", "0.82371384", "0.82371384", "0.82371384", "0.82327974", "0.82327974", "0.82327974", "0.8218843", "0.82159245", "0.82159245", "0.82159245", "0.81...
0.8266879
1
fonction de construction du hoover
build() { // instanciation de la classe Hoover this.hoover = new Hoover(); // création de l'élement DOM hoover var p = document.createElement("p"); p.innerHTML = this.hoover.card; var y = this.hoover.y; var x = this.hoover.x; // initialisation du hoove...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructur() {}", "function _construct()\n\t\t{;\n\t\t}", "__previnit(){}", "function _beeswarm () {} // constructor ???", "function construct() { }", "function Ha(){}", "function hobbitPrototype(){}", "consructor() {\n }", "constructor() {\r\n // ohne Inhalt\r\n }", "ob...
[ "0.6999362", "0.6793919", "0.650115", "0.6426643", "0.6283991", "0.6199888", "0.6172366", "0.6139514", "0.60929084", "0.6077291", "0.60698926", "0.6068671", "0.60428846", "0.6040293", "0.60372114", "0.6035221", "0.60224223", "0.59907186", "0.5986546", "0.59817135", "0.5972832...
0.6847632
1
findMultiples() finds all of the numbers in a range given that are divisible by a specified 'divisor'
findMultiples(divisor, bottom, top) { let multiples = []; let start = this.findStart(divisor,bottom,top); if(start === 0){ return multiples; // For occurrences when a lowest multiple does not exist in the range } while(start < top) { multiples.push(start); start = start + divisor; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function divisibleBy(numbers, divisor) {\n\t// iterate using filter\n\t// if the element is divisble by divisor\n\t// return element\n\treturn numbers.filter((element) => element % divisor === 0);\n}", "function divisibleByAll(min, max) {\n let range = _.range(min, max + 1);\n let i = max;\n let f...
[ "0.73734367", "0.73255193", "0.7278889", "0.7183726", "0.712006", "0.7092964", "0.70923483", "0.70777434", "0.70733154", "0.7071552", "0.7023403", "0.7008683", "0.69969606", "0.69567525", "0.69217", "0.6884318", "0.68444467", "0.67981356", "0.67975116", "0.67818815", "0.67774...
0.77653575
0
findStart() finds the lowest number in the range that is divisible by 'divisor'
findStart(divisor, bottom, top) { while(bottom < top) { if(bottom % divisor === 0) { return bottom; } bottom++; } return 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function smallestMultiple(maxDivisor) {\n\tvar outerIndex, innerIndex;\n\n\tfor (outerIndex = maxDivisor; 1; outerIndex ++) {\n\t\tfor (innerIndex = 2; innerIndex <= maxDivisor; innerIndex++) {\n\t\t\tif (outerIndex % innerIndex) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif (innerIndex === maxDivisor) {\n\t\t\t\treturn ...
[ "0.70508784", "0.70399773", "0.6678697", "0.66707087", "0.6595124", "0.6518617", "0.6447712", "0.6379915", "0.62789816", "0.62761945", "0.62409127", "0.617339", "0.6074213", "0.6047315", "0.6047315", "0.6047315", "0.6047315", "0.6030096", "0.6018037", "0.6007285", "0.60029435...
0.8086528
0
Given a list of institutions, create units of html for each of them
function buildList(institutions) { var html = createInstitutions(institutions) $('#institutions').html(html) addInstitutionsToInput() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createInstitutions(institutions) {\n var labelContent = 'Select your institution'\n if(institutions.length > 1) {\n labelContent = 'Select all available institutions you wish to file for. You may select more than one.'\n }\n var html = '<label>' + labelContent + '</label><ul class=\"usa-u...
[ "0.72069293", "0.6349859", "0.61823624", "0.59507126", "0.5916917", "0.5898743", "0.5871004", "0.5827955", "0.5822944", "0.582021", "0.5771328", "0.57287073", "0.5698224", "0.56747377", "0.56543535", "0.5652541", "0.56430584", "0.5632759", "0.56189394", "0.56008124", "0.55583...
0.6784467
1
Given a list of institutions, return an html list of description lists for each
function createInstitutions(institutions) { var labelContent = 'Select your institution' if(institutions.length > 1) { labelContent = 'Select all available institutions you wish to file for. You may select more than one.' } var html = '<label>' + labelContent + '</label><ul class="usa-unstyled-lis...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function buildList(institutions) {\n var html = createInstitutions(institutions)\n $('#institutions').html(html)\n\n addInstitutionsToInput()\n }", "function buildList(institutions) {\n $('#institutions')\n .empty()\n .append(\n makeInstitutionsLabel(institutions),\n makeInst...
[ "0.7374588", "0.6948255", "0.6273085", "0.58711994", "0.58675987", "0.5803817", "0.5790024", "0.5755369", "0.5490046", "0.5455753", "0.54342246", "0.5431533", "0.5401701", "0.5391542", "0.5379735", "0.53673065", "0.5363787", "0.5319336", "0.5316154", "0.530703", "0.53060955",...
0.7022636
1
Get checked institutions' values and add them to a hidden input field to be submitted
function addInstitutionsToInput() { var listOfInstitutions = [] // add to the user.attributes.institutions input $('.institutionsCheck').each(function(index) { if ($(this).prop('checked')) { listOfInstitutions.push($(this).val()) } }) $('#user\\.attributes\\.institutions').val(li...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function storeRadioButtonValuesInHiddenInputFields() {\n var radiobuttons = $(element).find('input[type=\\'radio\\']').get();\n $.each(radiobuttons, function() {\n if(this.checked) {\n $('#' + this.name).val(this.value);\n }\n });\n }", "functi...
[ "0.61095285", "0.6090735", "0.6078184", "0.58202803", "0.56773216", "0.56459594", "0.5605573", "0.556329", "0.55389774", "0.55162513", "0.5509551", "0.5485792", "0.54702747", "0.5464636", "0.5402548", "0.53724545", "0.5350749", "0.53332573", "0.5311332", "0.530965", "0.528486...
0.7819139
1
build email links from values provided at build time
function getEmailLink() { return ( '<a href="mailto:' + HMDA.supportEmailTo + '?subject=' + HMDA.supportEmailSubject + '">' + HMDA.supportEmailTo + '</a>' ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _value() {\r\n let link = 'mailto:';\r\n link += _recipients.join(',');\r\n\r\n // adds & to the end of the link if the last char is neither & or ?\r\n function addAmp() {\r\n if(link.slice(-1) !== '&' && link.slice(-1) !== '?') link += '&';\r\n };\r\n\r\n ...
[ "0.6922842", "0.64741343", "0.6447707", "0.62262815", "0.60171634", "0.60068125", "0.59929913", "0.59928316", "0.59914863", "0.5985411", "0.58408844", "0.58389586", "0.5818945", "0.5817876", "0.58038306", "0.5779783", "0.57494694", "0.5731984", "0.57247", "0.57183033", "0.568...
0.65556294
1
Make a debounced version of the getInstitutions API call, passing in the desired delay
function makeDebouncer(delay) { var timeout return function(domain) { clearTimeout(timeout) timeout = setTimeout(function() { getInstitutions(domain) }, delay) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function debounced(delay, fn) { \n let timerID\n return function (...args) {\n if (timerID) {\n clearTimeout(timerID);\n }\n timerID = setTimeout (() => {\n fn(...args);\n timerID = null;\n }, delay);\n }\n}", "function SetDelay() {\r\n setTimeout(function(){CreateBadgeReqLin...
[ "0.60194135", "0.59624666", "0.58218974", "0.5660804", "0.5660804", "0.565695", "0.5635576", "0.55551493", "0.5532333", "0.5524659", "0.5524659", "0.5512949", "0.54657435", "0.54631877", "0.5436934", "0.5421376", "0.53939945", "0.5388062", "0.53839934", "0.5330858", "0.531829...
0.8026098
1
remove default value from motherboard size list (make the list appear empty, requiring a selection)
function removeSelectDefault() { "use strict"; sizeSelector.selectedIndex = -1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "removeSize() {\n this.size = 0;\n }", "function toggleSize(){\n var elem = document.getElementsByClassName('board')[0];\n while (elem.firstChild) {\n elem.removeChild(elem.firstChild);\n }\n if(board_size === 3){\n board_size = 4;\n } else if(board_size === 4){\n board_size = 6;\n } el...
[ "0.6311775", "0.62064135", "0.61442184", "0.6050925", "0.60338223", "0.59446496", "0.5700172", "0.56788206", "0.5674735", "0.5622604", "0.5614586", "0.5599771", "0.5589732", "0.55606014", "0.5551341", "0.5549753", "0.55473083", "0.55359226", "0.553576", "0.55243194", "0.55098...
0.65437937
0
remove fallback placeholder text
function zeroPlaceholder() { "use strict"; messageBox.style.color = "black"; if (messageBox.value === messageBox.placeholder) { messageBox.value = ""; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function disablePlaceholder() {\n\n placeholder.style.display = 'none';\n }", "function zeroPlaceholder() {\n\tvar instrBox = document.getElementById(\"instructions\");\n\tinstrBox.style.color = \"black\";\n\tif (instrBox.value === instrBox.placeholder) {\n\t\tinstrBox.value = \"\";\n\t}\n}", "get pl...
[ "0.7513372", "0.7067202", "0.70459074", "0.69005394", "0.6837593", "0.67883444", "0.67656165", "0.67064893", "0.67064893", "0.669535", "0.6684742", "0.66010827", "0.65662384", "0.6545569", "0.65399903", "0.65365976", "0.65286934", "0.64582014", "0.6433294", "0.64039356", "0.6...
0.7146047
1
This middleware validates a user upon creation of said user and spits out errors if req.body is missing OR if the name of the user is missing/blank
function validateUser(req, res, next) { console.log("This is req.body in validateUser(): ", req.body); if (!req.body) { res.status(400).json({ error: "Missing user data" }); } else if (!req.body.name || req.body.name === "") { res.status(400).json({ error: "Missing required name field" }); } else { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validateUser(req, res, next) {\n if (JSON.stringify(req.body) === \"{}\") { // check if body is valid\n res.status(400).json({ message: 'missing user data' })\n } else if (!req.body.name) { // checks if name in body is valid\n res.status(400).json({ message: 'missing required name field' })\n } e...
[ "0.8355065", "0.80950534", "0.80111474", "0.7616867", "0.75119644", "0.7179874", "0.7165587", "0.7011602", "0.6923572", "0.68941855", "0.6844737", "0.68061775", "0.67825687", "0.6729002", "0.6668385", "0.6667087", "0.6659832", "0.6654253", "0.6628051", "0.66275966", "0.660673...
0.81290644
1
This middleware validates a post upon creation of said post and spits out errors if req.body is missing OR if the content of the post is missing/blank
function validatePost(req, res, next) { console.log("This is req.body in validatePost(): ", req.body); if (!req.body) { res.status(400).json({ error: "Missing post data" }); } else if (!req.body.text || req.body.text === "") { res.status(400).json({ error: "Missing required text field" }); } else { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validatePost(req, res, next) {\n // we want to check the body is defined and not an empty object\n // otherwise respond with status 400 and a useful message\n\n // is defined AND not empty(keys exist) \n if(req.body && Object.keys(req.body).length){\n // #### All good, go to next middleware\n...
[ "0.7820097", "0.6892975", "0.6843534", "0.6733324", "0.6654073", "0.65497637", "0.65215564", "0.6416502", "0.63524324", "0.62954307", "0.62566763", "0.62264216", "0.61911666", "0.61846834", "0.6183377", "0.6178622", "0.6178424", "0.617741", "0.6153874", "0.6076186", "0.605627...
0.78490055
0
=== Creating a singly linked list ===// Write a function main. Within the function, using the linked list class above, create a linked list with the name SLL and add the following items to your linked list: Apollo, Boomer, Helo, Husker, Starbuck.
function main() { let SLL = new LinkedList(); SLL.insertFirst("Apollo"); SLL.insertLast("Boomer"); SLL.insertLast("Helo"); SLL.insertLast("Husker"); SLL.insertLast("BoomeStarbuckr"); // console.log(SLL); SLL.insertLast("Tauhida"); // Add Tauhida to the list. SLL.remove("Husker"); // Remove Hus...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function main() {\n const SLL = new LinkedList();\n \n //create a linked list with the name SLL and add the following items to your linked list: Apollo, Boomer, Helo, Husker, Starbuck.\n SLL.insertFirst(\"Husker\");\n SLL.insertFirst(\"Helo\");\n SLL.insertFirst(\"Boomer\");\n SLL.insertFirst(\"...
[ "0.824403", "0.7292709", "0.6937377", "0.6828328", "0.6793429", "0.6733151", "0.6716305", "0.6693949", "0.6671104", "0.6664982", "0.66499054", "0.66399986", "0.6610371", "0.65496904", "0.6485028", "0.6483509", "0.64541036", "0.639823", "0.63969815", "0.63969815", "0.6381754",...
0.743595
1
=== 3rd from the end ===// Write an algorithm to find the 3rd element from the end of a linked list. Note You may be tempted to add a length property to your linked list class. The length property is not a typical property of linked list, therefore dont make any modification to the linked list class that is provided to...
function thirdToLast(LL) { if (LL.head === null) { console.log("List is empty :("); return; } let currNode = LL.head; while (currNode.next.next.next !== null) { currNode = currNode.next; } console.log(currNode.value + " is the 3rd from the end!"); return currNode.value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function thirdFromEnd(ll) {\n let third = ll.head; // set the variable for the third\n let currNode = ll.head.next.next.next;//set currNode equalt o the third position of the linked list\n while (currNode !== null) {//while currNode is not equal to null\n third = third.next;//set the third to next\n currN...
[ "0.785149", "0.74482304", "0.68930775", "0.67810035", "0.67622936", "0.6757351", "0.67476314", "0.66147286", "0.6606335", "0.6605538", "0.65994", "0.6581592", "0.65779006", "0.6553472", "0.6502062", "0.6433065", "0.64268243", "0.63957965", "0.63421863", "0.62934816", "0.62850...
0.75400335
1
=== Middle of a list ===// Write an algorithm to find the middle element of a linked list. Note You may be tempted to add a length property to your linked list class. The length property is not a typical property of linked list, therefore don't make any modification to the linked list class that is provided to you. Als...
function middleOfList(list) { if (list.head === null) { console.log("List is empty"); return; } let currNode = list.head; let counter = 0; while (currNode !== null) { currNode = currNode.next; counter++; } let middle = Math.ceil(counter / 2); counter = 0; currNode = list.head; whil...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function middleElement(SLL) {\n let middle = size(SLL);\n let currNode = SLL.head;\n let inc = 0;\n if (middle % 2) {\n middle = (middle / 2);\n }\n else {\n middle = ((middle + 1) / 2);\n }\n while(inc <= middle-1) {\n currNode = currNode.next;\n inc++;\n }\n return currNode;\n}", "functio...
[ "0.83803964", "0.8273415", "0.800806", "0.78016275", "0.7505232", "0.7177451", "0.6912611", "0.68251824", "0.6727352", "0.67096573", "0.6655054", "0.66060764", "0.65676296", "0.6476871", "0.64307404", "0.64044565", "0.6347185", "0.63456947", "0.6225988", "0.61507994", "0.6117...
0.83858997
0
creates a new astroid every second.
function createAstroids() { let currentInterval = setInterval(() => { const radius = Math.random() * 10 + 5; let rightY = Math.random() * canvas.height; let rightX = canvas.width; let leftY = Math.random() * canvas.height; let leftX = 0; const angle = Math.atan2(leftY - rightY, l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "init() {\n return setInterval(() => {\n // Update loop for room\n // Not using at the moment, arbitrary interval time\n }, 1000); \n }", "function loop() {\n //between 5 and 10 minutes)\n let rand = Math.round(Math.random() * (12000000 - 600000)) + 600000;\n setTimeout((...
[ "0.6015444", "0.5961712", "0.58480805", "0.57194084", "0.56944877", "0.55646586", "0.55162936", "0.5489092", "0.54793036", "0.5428221", "0.54097944", "0.5395102", "0.5393814", "0.53728473", "0.53722644", "0.53722644", "0.5364844", "0.53616256", "0.53573215", "0.5349045", "0.5...
0.6614359
0
select the type of the active cell
function selectCellType(type) { cy.get('select').filter('[aria-label="Cell type"]').select(type) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get selectedCell() {\n return this.table.find('td.cell.selected');\n }", "function isActive(cell) {\n return cell[2];\n }", "function selectCell(colNum) {\r\n var cell = getLegalMoves(colNum); // object\r\n if (cell[0] !== undefined) {\r\n cell[0].addClass(`...
[ "0.61620724", "0.60389805", "0.6019388", "0.59750795", "0.59547424", "0.59520656", "0.59054303", "0.5904688", "0.589426", "0.57764447", "0.5774017", "0.5772612", "0.5760646", "0.573978", "0.5730061", "0.57132864", "0.5694518", "0.56907296", "0.567384", "0.5668331", "0.5659324...
0.73662066
0
add new cell, set type and content
function addCell(type, content) { cy.get('[title="Insert a cell below"]').click() // focus on last cell (might not be the one that was inserted) cy.get('.jp-Notebook-cell').last().find('textarea').last().focus() cy.focused().should('have.prop', 'nodeName', 'TEXTAREA') cy.focused(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addCell(content, whichRow, whichKind, array){\r\n\tvar cell = document.createElement(whichKind);\r\n\tcell.innerHTML = content;\r\n\twhichRow.appendChild(cell);\r\n\tarray.push(cell);\r\n\tcell.id = \"newCell\" + (array.length - 4);\r\n}", "function addCell(row, text) {\r\n\tvar newCell = row.insertCell...
[ "0.7105564", "0.7073285", "0.70015997", "0.6845106", "0.67954767", "0.6756223", "0.67219543", "0.66797936", "0.66575694", "0.6525518", "0.64445144", "0.6392376", "0.63844645", "0.6350715", "0.63445437", "0.6286344", "0.62440884", "0.6212774", "0.61959314", "0.61912453", "0.61...
0.77983177
0
converts a date object into the correct format to convert the object to JSON
function dateToJson(date) { var day = date.getDate(); if (day < 10){ day = "0" + day; } var month = date.getMonth()+1; if (month < 10){ month = "0" + month; } var year = date.getFullYear(); var hours = date.getHours(); if (hours < 10){ hours = "0" + hours; } var minutes = date.getMinutes(); if (minute...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function serializeDate(date) {\n if( typeof( date ) == \"object\" ) {\n return date.toJSON();\n } else {\n return date;\n }\n }", "convertToDateStrings(obj) {\n\n if(!ParserHelper.isContainer(obj)) {\n ...
[ "0.74573976", "0.731931", "0.72622746", "0.7218201", "0.7218201", "0.7218201", "0.7218201", "0.7218201", "0.7218201", "0.7218201", "0.7218201", "0.7218201", "0.7217359", "0.71652657", "0.70939636", "0.707036", "0.70458025", "0.6937232", "0.6772907", "0.6772621", "0.66705793",...
0.7386685
1
stores feeds and returns feedIds (array)
function storeFeeds(db, feeds, groupId) { var rs = null; try { var countFeeds=0; for (countFeeds=0; countFeeds<feeds.length; ++countFeeds) { var feed = feeds[countFeeds]; rs = db.execute('select feedId from feed where title = ? and url = ? and type = ? and groupId = ?', [feed.title, feed.url, feed.type, gr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function queueGetIds(callback) {\n return this.mredis.lrange(\"feed.ids:\" + this.name, 0, -1, callback);\n}", "constructor(feeds) {\n this.id2Value = {};\n this.id2Mask = {};\n this.name2Id = {};\n if (feeds instanceof FeedDict) {\n for (const id in feeds.id2Value) {\n ...
[ "0.65413123", "0.6295538", "0.6032819", "0.59622604", "0.58984745", "0.5801603", "0.5795067", "0.5790914", "0.5644599", "0.5636728", "0.56273586", "0.55667686", "0.55667686", "0.5556253", "0.5539782", "0.5539718", "0.54874176", "0.54807025", "0.5469818", "0.5443585", "0.54383...
0.7181506
0
Returns true if vehicle was able to find next route.
function handleRouteFinding() { if (!self._nextRoute) { self._nextRoute = findNextRoute(); } if (self._currentNode) { takeNextRoute(); } return self._nextRoute !== null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_distanceToNext()\r\n {\r\n return this._navPath.distanceToWaypoint(this._position, this._waypointIdx);\r\n }", "function isNext(flags) {\n return (flags & FLAGS.NEXT) === FLAGS.NEXT;\n }", "isDestination() {\n var arrival = this.active.find(descender => {\n if (descender.hasArri...
[ "0.62436724", "0.6156117", "0.6094827", "0.59901196", "0.5934462", "0.5933313", "0.59168524", "0.5887028", "0.5871795", "0.5846982", "0.58330625", "0.5830527", "0.57707024", "0.57219875", "0.57165843", "0.57150215", "0.5678575", "0.5652219", "0.56488883", "0.56488883", "0.564...
0.7295112
0
Empties the results box
function emptyResultBox() { while (resultBox.hasChildNodes()) { resultBox.removeChild(resultBox.lastChild); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clearResults() {\n\t$('.results').text('');\n}", "function clearResults()\r\n{\r\n\t// Stop any existing search.\r\n\tsearchControl.cancelSearch();\r\n\t\r\n\t// Clear the results.\r\n\tresults = new Array();\r\n\tresultProgress = new Array();\r\n\tresultCounter = 0;\r\n\twriteDiv('results', null, \"\")...
[ "0.81489015", "0.8144722", "0.80997163", "0.79875827", "0.7859308", "0.7777832", "0.77707577", "0.7678676", "0.76433325", "0.76417124", "0.7631265", "0.76287585", "0.76222515", "0.7614008", "0.7611124", "0.7569057", "0.7510673", "0.7509952", "0.7474856", "0.74647975", "0.7438...
0.8192753
0
Callback function for fetching & decoding the next instruction
function fetchInstruction() { // Check Interrupts if(_ppu.nmiTrigger) { _ppu.nmiTrigger = false; return _nmi_dispatch(); } let opcode = readByte(registers.pc++); if(funcmap[opcode] === undefined) throw `Encountered unknown opcode $${opcode.toString(16).padStart(2, '0')} at ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function STEP () {\n\t// Fetch\n\tvar icode = MEMORY[PC.toInt()] >> 4;\n\tvar ilen = INSTRUCTION_LEN[icode];\n\tvar instr = MEMORY.slice(PC.toInt(), PC.add(ilen).toInt());\n\n\tPC = PC.add(ilen);\n\n\t// Decode\n\tvar args = DECODE(instr);\n\n\t// Execute + Memory + Write Back ???\n\ttry {\n\t\tINSTR[icode].call(a...
[ "0.67271906", "0.6195299", "0.6131044", "0.5918267", "0.59085464", "0.58667856", "0.5828197", "0.5799684", "0.5797968", "0.57702804", "0.57535183", "0.5688303", "0.56669897", "0.56669897", "0.56642514", "0.563699", "0.5634798", "0.56296444", "0.56224215", "0.56166625", "0.557...
0.6705182
1
Convert LO 4 bits of hash code into 12 gradient directions.
grad(hash, x, y, z) { let h = hash & 15, u = h < 8 ? x : y, v = h < 4 ? y : h == 12 || h == 14 ? x : z; return ((h&1) == 0 ? u : -u) + ((h&2) == 0 ? v : -v); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function h_ni(i) { return (i+6*600)%6;} //normalise an hex index number to the range 0-5", "function adler32(data){var a=1;var b=0;for(var i=0;i<data.length;i++){a=(a+data.charCodeAt(i))%MOD;b=(b+a)%MOD;}return a|b<<16;}", "function grad1(hash, x) {\n let h = hash & 15;\n let grad = 1.0 + (h & 7); // Gradien...
[ "0.62320143", "0.5982967", "0.5909151", "0.5865558", "0.58302164", "0.58126676", "0.5744182", "0.5692412", "0.56785935", "0.56774294", "0.56774294", "0.56774294", "0.56774294", "0.56774294", "0.56774294", "0.56774294", "0.56752014", "0.55989325", "0.55989325", "0.55989325", "...
0.67029405
0
Attribute, subclass of TextNode because of the nice implementation
function Attribute() { /* an attribute node */ this._setProtected('nodeType', 2); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function htmlAttribute(node,name,value) {\r\n\t\tthis.node = node;\r\n\t\tthis.name = name;\r\n\t\tthis.value = value;\r\n\t}", "function JSXAttribute(node, print) {\n\t print.plain(node.name);\n\t if (node.value) {\n\t this.push(\"=\");\n\t print.plain(node.value);\n\t }\n\t}", "function JSXAttribute...
[ "0.67911476", "0.6584116", "0.6584116", "0.6508213", "0.64291066", "0.64291066", "0.63943", "0.63873124", "0.63873124", "0.63873124", "0.6277225", "0.6247486", "0.6247486", "0.6180199", "0.61613595", "0.6085005", "0.60818875", "0.6051387", "0.60370594", "0.59934497", "0.59606...
0.6737694
1
Get user text list block.
function getUserTextListBlock(userConnectionList) { var userBlock = []; $.each(userConnectionList, function(index, value) { userBlock.push('<li><a target="_blank" href="' + value.profileUrl + '" class="Icon"> ' + value.displayName + ' </a><span>' + value.activityTitle + '</span></li>'); }); return user...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getBlockByUserCreated(userId) {\n return db('lists as l')\n // .join('twitter_users as tu', 'tu.twitter_id', \"l.twitter_id\")\n .where('l.twitter_id', userId)\n .where('is_block_list', true)\n}", "function show_list(user){\n let usrList = document.getElementsByClassName(\"user-list\")[0];\...
[ "0.6102773", "0.5627555", "0.5581975", "0.5351343", "0.533089", "0.53292364", "0.5282882", "0.5280251", "0.5279128", "0.52656996", "0.52488434", "0.5239658", "0.5234343", "0.52200437", "0.5196614", "0.5124868", "0.5119098", "0.5084111", "0.5078908", "0.505986", "0.5059565", ...
0.7440912
0
a helper function to facilitate testing creates a network with hidden nodes and uses it a little bit
function createUsedNetwork() { const network = new Network(10, 20); // add some nodes that will (or not) be dropped out const new_nodes = Array(10).fill({}).map(() => new Node()); network.addNodes(new_nodes); // connect the nodes randomly new_nodes.forEach(node => { const input_node_index...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function test_network() {\n const inputs = [\n 7, // dealer total\n 5 // player total\n ];\n\n const outputs = [\n 0, // stand\n 1, // hit\n ];\n\n const input_layer = create_layer(inputs.length);\n // const hidden_layers = create_hidden_layers(3, 2);\n const hidden_layers = [\n create_layer...
[ "0.68255436", "0.6503116", "0.6479398", "0.6458089", "0.6296011", "0.6296011", "0.6296011", "0.6296011", "0.6296011", "0.6259989", "0.6232212", "0.6180905", "0.61692417", "0.60880613", "0.6000191", "0.5967272", "0.59201336", "0.5917037", "0.58180046", "0.5794998", "0.57708", ...
0.7333356
0
Generates a schedule end datetime based on the start and frequency
function generateScheduleEnd({ frequency, start, timezone }) { const { unit: frequencyUnit, value: frequencyValue } = frequency; const isFrequencyLessThanWeek = (0, _fp.includes)(frequencyUnit, [_scheduling.Unit.Millisecond, _scheduling.Unit.Second, _scheduling.Unit.Minute, _scheduling.Unit.Hour, _s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async generateBigInningSchedule(dateString) {\n try {\n this.debuglog('generateBigInningSchedule')\n\n let utc_start_string = '01:00'\n let utc_end_string = '03:30'\n let add_date = 1\n // Different Sunday schedule\n let weekday_index = new Date(dateString + ' 00:00:00').getDay()\n...
[ "0.6036266", "0.59974235", "0.59454364", "0.58294225", "0.55168474", "0.538917", "0.5357615", "0.534584", "0.52473533", "0.51903725", "0.5177005", "0.5168741", "0.51602966", "0.51315", "0.5130495", "0.5128244", "0.512696", "0.51168126", "0.5116669", "0.51094127", "0.50912476"...
0.8032288
0
YQL Checking of URL
function checkUrl(url) { url = url.trim(); $.getJSON("http://query.yahooapis.com/v1/public/yql?"+ "q=select%20*%20from%20html%20where%20url%3D%22"+ encodeURIComponent(url)+ "%22&format=xml'&callback=?", function(data){ if(data.results[0]){ alert('Url exi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkQRequired(url) {\n\tvar l1 = document.createElement(\"a\");\n\tl1.href = url;\n\tvar result = 0;\n\tif (QRequired[l1.hostname] == undefined) {result = 1;}\n\tl1.remove();\n\treturn result;\n}", "function hasQuery(url) {\n return (url.indexOf(\"?\") === -1);\n }", "function checkURL(req, res, ...
[ "0.66867256", "0.64278644", "0.6423645", "0.6416443", "0.6327278", "0.6289349", "0.6210711", "0.6199101", "0.6127561", "0.60951096", "0.60423386", "0.603502", "0.6000459", "0.59811896", "0.597408", "0.59631747", "0.59469426", "0.5942308", "0.5927271", "0.58970654", "0.5894825...
0.7163725
0
tags: semTypeDetector input: column col output: string semType
detectFit(col) { if (DG.Detector.sampleCategories(col, (s) => { return s.includes('series') && s.includes('points') && s.includes('fitFunction'); }, 1)) { col.semType = FIT_SEM_TYPE; return col.semType; } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "detectNucleotides(col) {\n if (col.type === DG.TYPE.STRING && this.isNucleotideColumn(col)){\n col.semType = 'dna_nucleotide';\n return col.semType;\n }\n return null;\n }", "detectXMLCurveChart(col) {\n if (DG.Detector.sampleCategories(col, (s) => s.startsWith('<...
[ "0.6480753", "0.557206", "0.54500633", "0.5355116", "0.5121018", "0.5096542", "0.508714", "0.501352", "0.49453118", "0.49140322", "0.49058706", "0.4883849", "0.47801876", "0.4579956", "0.45422554", "0.4536046", "0.4531503", "0.45311514", "0.4524228", "0.4523244", "0.4509595",...
0.6484008
0
fonction d'envoi des parametres en cas de changement vers le cgi
function send_CONV_param( param, value) { var xhr = new XMLHttpRequest(), query = param + "=" + this.value, type = "application/x-www-form-urlencoded"; xhr.open("POST", "WebPost"); xhr.setRequestHeader("Content-Type", type); xhr.send(query); if ( param.search(/Cfg/)!= -1 )...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function GetCgiParameters() {\n let url = window.location.search.substring(1);\n let output = {};\n let settings = url.split('&');\n for (let i=0; i<settings.length; i++) {\n let pair = settings[i].split('=');\n pair[0] = decodeURIComponent(pair[0]);\n pair[1] = decodeURIComponent(pair[1]);\...
[ "0.57041836", "0.5587669", "0.5544731", "0.5495405", "0.5478519", "0.54489964", "0.5437632", "0.539319", "0.53505844", "0.53374815", "0.5331794", "0.53175116", "0.52933675", "0.5283951", "0.52746296", "0.5239425", "0.5215301", "0.5199234", "0.51960665", "0.519571", "0.5191955...
0.5871632
0
Javascript Classes Class TabList Constructor
function TabList (id, trigger_fct, init_tabs) { this.id = id; this.trigger_fct = trigger_fct; this.tc = new Array; // Tab Collection this.selected = null; // Selected tab for (var init_tab in init_tabs) { this.Add(init_tab, init_tabs[init_tab]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Tabs (el) {\r\n this.el = el;\r\n\r\n var props = {\r\n ul : el.getElementsByTagName('ul')[0],\r\n tabs : [] // collection\r\n };\r\n\r\n var tabContent = el.getElementsByClassName('tab-content'),\r\n tabs = props.ul.getElementsByTagName('li');\r\n\r\n for(var i = 0; i<ta...
[ "0.7266433", "0.697286", "0.68462414", "0.67418057", "0.67117167", "0.6643651", "0.65963036", "0.6586699", "0.6586585", "0.65695685", "0.65057516", "0.64861256", "0.6474372", "0.6465549", "0.6453347", "0.64283496", "0.62596416", "0.6239637", "0.62248266", "0.61727774", "0.615...
0.7203976
1
function to validate messageSignature
function validateSignature(message, address, signature) { try { return bitcoinMessage.verify(message, address, signature); } catch (e) { return e.message; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function verifySignature(msg, signature, pub_key) {\n //return curve.sign.detached.verify(str2buf(msg, 'ascii'), str2buf(signature, 'base64'), pub_key);\n return curve.sign.detached.verify(msg, str2buf(signature, 'base64'), pub_key);\n}", "function validateSignature(encodedHeader, encodedPayload, signature...
[ "0.7724773", "0.7299583", "0.7104038", "0.7052314", "0.7045781", "0.69628555", "0.6898504", "0.6715641", "0.65729576", "0.6527599", "0.651646", "0.6510021", "0.64891016", "0.63890314", "0.6382382", "0.6376868", "0.63474", "0.63427", "0.6342192", "0.6329361", "0.6265335", "0...
0.7315788
1
analyzes text in test.txt for key words
function keysearch(){ retext() .use(keywords) .process(vfile.readSync('test.txt'), function (err, file) { if (err) throw err; console.log('Keywords:'); file.data.keywords.forEach(function (keyword) { console.log(nlcstToString(keyword.matches[0].node)); }); console.log(); console.lo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function processText(text, testChar){\n // Convert the string to lowercase.\n text = text.toLowerCase();\n text += \" \";\n\n var start = 0;\n var end = 0;\n var words = {};\n var word;\n\n // Walk through the string until a non-alphabetical character is reached,\n // and record the word...
[ "0.670905", "0.66946673", "0.64382315", "0.6223189", "0.61424595", "0.6024412", "0.5941425", "0.59063387", "0.5880747", "0.58773226", "0.5857434", "0.5817356", "0.5768614", "0.5730555", "0.5720928", "0.570365", "0.56992406", "0.5695013", "0.5687317", "0.5685113", "0.56813776"...
0.7051575
0
VirtualDOM maintains a tree of text nodes and selectors, can publish onetoone to true DOM, and watches both sides for changes / it doesn't copy IDs, it doesn't remember css styles, it doesn't create script/style/iframe tags, you can't make input[type=password], etc
function VirtualDOM(node, faux, whitelist) { this.node = node || document.createElement('div'); this.faux = faux || { _: [] }; // the root faux does not care about a selector this.whitelist = whitelist || { }; // such as { div: [ 'data-checked' ] } this.mo = new MutationObserver((m) => { this.mutationListener(m); }...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "bindToDom() {\n document\n .querySelectorAll(\"[s-text]\")\n .forEach(x => this.syncNode(x, x.attributes[\"s-text\"].value));\n }", "function DOMImplementation() {}", "function DOMImplementation() {}", "function DOMImplementation() {}", "function DOMImplementation() {}", "function updateDOM...
[ "0.6158943", "0.59752333", "0.59752333", "0.59752333", "0.59752333", "0.58831084", "0.58409035", "0.58409035", "0.58009505", "0.5789985", "0.57583493", "0.57482666", "0.56730694", "0.5670788", "0.5656973", "0.5651357", "0.5633917", "0.5609739", "0.55968875", "0.55895305", "0....
0.625052
0
This function, retrieves from the site, the games for the coming 6 days (including the provided date in the argument. This is I guess somehow, what the site prefetches or something.)
async function getGameIDsAtDate(date) { let currDate = new Date(date); let stopDate = new Date(currDate); stopDate.setUTCDate(stopDate.getUTCDate() + 1); date = dateStringify(date); console.log(`Games at date: ${date}`); let gamesDateURL = `https://www.nhl.com/scores/${da...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getGamesFromDate(date) {\n const games = getGamesWithScores();\n const gamesOnDate = [];\n\n for (let game of games) {\n if (game.date === date) {\n gamesOnDate.push(game);\n }\n }\n\n return gamesOnDate;\n}", "getGames () {\n let schedule = this.year + `${View.SPACE()}` + this.title ...
[ "0.6679594", "0.6392032", "0.6274476", "0.6223475", "0.6126302", "0.6091332", "0.6082714", "0.5990635", "0.59766454", "0.5905775", "0.5852499", "0.5844002", "0.58243054", "0.58214587", "0.58046114", "0.57859", "0.577246", "0.5742701", "0.57426983", "0.5719633", "0.57104874", ...
0.7093381
0
Send one todo to the server
function sendTodo(todoitem){ $.post("/saveTodo", todoitem, function (response) { console.log("Todo send"); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sendToDo() {\n console.log('To Do Array, just before new todo sending', toDoArray);\n createToDo();\n pushToArray(createToDo);\n toastSuccessAlert('Aufgabe', 'hinzugefügt');\n setDB(toDoArray, false, true);\n printToDos(toDoArray);\n}", "addTodo () {\n const start = Action.mstime();\n const ...
[ "0.7105851", "0.68911475", "0.6578841", "0.6429902", "0.6402455", "0.63802993", "0.63415575", "0.6328792", "0.6292684", "0.62869537", "0.62673104", "0.6219538", "0.62048787", "0.62046194", "0.6191189", "0.6161544", "0.6131342", "0.6129388", "0.61158454", "0.61074394", "0.6102...
0.73746884
0
Remove todo from server
function removeTodo(todoitem){ $.post("/deleteTodo", todoitem, function (response) { console.log("Todo to remove send"); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeTodo(todo) {\n const clickedId = todo.data('id');\n const deleteUrl = `${api}${clickedId}`;\n $.ajax({\n type: \"DELETE\",\n url: deleteUrl\n }).then(() => {\n todo.remove();\n }).catch((err) => {\n console.log(err);\n })\n }", "handleRemove(todo) {\n\t\t// p...
[ "0.7642246", "0.7614344", "0.7487724", "0.7470247", "0.74156225", "0.72902507", "0.7222403", "0.72185785", "0.7205344", "0.7200383", "0.71718436", "0.715213", "0.7141194", "0.70845246", "0.7047377", "0.7003903", "0.69928676", "0.6985631", "0.6961009", "0.6943362", "0.6933001"...
0.76774704
0
function scatterPlot: json: the json data width: width of the SVG height: height of the SVG id: id of the SVG parentDiv: id ot the div containing the SVG in order to append it inside Description: Draw a scatterPlot: an oragne circle == "on" state, a blue one is "off"
function scatterPlot(json, width, height, id, parentDiv){ console.log(json); json = scatterPlotSample(json, width); // If there already is a svg in the parentDiv, remove it d3.select(parentDiv).selectAll("svg").remove(); // Variables to define the margins of the svg var margin = {top: 80, right: 150...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "drawPlot(){\n\n // Insert HTML elements\n\n d3.select(\".dataviz-element\").remove(); // remove old element\n d3.select(\".viz-header\").remove(); // remove old header\n const container = d3.select(\".dataviz-elements\");\n const header = container.append(\"div\")\n .a...
[ "0.66088027", "0.6521904", "0.6487034", "0.63729346", "0.63326395", "0.6268261", "0.6233599", "0.61332256", "0.6108771", "0.60835046", "0.60799783", "0.6078891", "0.60649437", "0.6062967", "0.60461897", "0.60386944", "0.6034176", "0.6026966", "0.6017341", "0.6010576", "0.6004...
0.68234366
0
function scatterPlotSample: jsonOriginal: the json file threshold: the number of maximum values to keep Description: This function samples the data in order to keep at maximum 'threshold' values per sensor
function scatterPlotSample(jsonOriginal, threshold){ var json = JSON.parse(JSON.stringify(jsonOriginal)); var toReturnArray=[]; var toReturn={}; for(var i=0; i<json.length; ++i){ toReturn['objectId']= json[i].objectId; toReturn['unit'] = json[i].unit; // If there are more va...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function plotData(newData) {\n //import the data ()\n d3.json(\"samples.json\").then((data) => {\n //console.log to verify file was read\n //console.log(data);\n\n //Retrieve id and slice for the top 10 and reverse the array to work with plotly \n var results = data.samples.filter...
[ "0.6127946", "0.61188495", "0.6112781", "0.6087392", "0.60683733", "0.5985465", "0.5954274", "0.59496665", "0.59208566", "0.59134525", "0.59098613", "0.58963966", "0.5881977", "0.5870818", "0.58671504", "0.58374095", "0.581692", "0.58157855", "0.58097994", "0.5797355", "0.579...
0.8527792
0
Setups Axios to monitor XHR errors. Initiates and listen to socket. fetches User's list from backend to populate.
componentDidMount() { this.setupSocketListeners(); this.fetchUsers(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "loadUsersFromServer() {\n axios\n .get(\"http://localhost:9002/api/fullNames\")\n .then(res => {\n this.setState({\n users: res.data\n });\n })\n .catch(err => {\n console.log(err); this.props.history.push('/error')\n });\n }", "async componentDidMount...
[ "0.6403927", "0.62990016", "0.6295173", "0.62329197", "0.6204157", "0.6024301", "0.6009226", "0.59934336", "0.5921436", "0.58997846", "0.58808076", "0.5878117", "0.5864499", "0.583767", "0.58292395", "0.58220094", "0.5783999", "0.57827705", "0.5770553", "0.576028", "0.5753552...
0.6478475
0
Shows error if client gets disconnected.
onClientDisconnected() { NotificationManager.error( "Connection Lost from server please check your connection.", "Error!" ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleClientClose(state, e) {\n console.error('Lost connection to phoenix server')\n state.conn.hasError.set(true)\n countdownToClientReconnect(state, 10000, 'Lost connection with the backend. Has the phoenix server been closed? Retrying $TIME')\n}", "function onError(error) {\n connectingElement....
[ "0.6849443", "0.6815845", "0.66977715", "0.6649328", "0.66084564", "0.66067505", "0.6585719", "0.6572624", "0.65525186", "0.6508206", "0.6508206", "0.6505039", "0.6494943", "0.6494943", "0.64796734", "0.6453025", "0.6429313", "0.6429313", "0.6429313", "0.6429313", "0.6399948"...
0.7153645
0
Toggles views from 'ChatList' to 'ChatBox' only on Phone
toggleViews() { this.setState({ showChatBox: !this.state.showChatBox, showChatList: !this.state.showChatList, }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toggle_chat(el) {\n wrapper = $(el).parents().eq(2)\n btm_pnl = $(el).parents().eq(2).children().first()\n wrapper.css(\"visibility\", \"hidden\")\n btm_pnl.css(\"visibility\", \"visible\")\n\n for (var i = chatwrap_to_idnum(wrapper) + 1; i <= num_open_chats; i++) {\n\tidnum_to_chatwrap(i).css(\"left...
[ "0.66344035", "0.6581186", "0.65489894", "0.6449376", "0.6395589", "0.6372063", "0.6372063", "0.6282698", "0.6240384", "0.6153804", "0.61183465", "0.61183465", "0.60267335", "0.5990231", "0.59721065", "0.5966618", "0.59341055", "0.5901618", "0.58516145", "0.5845423", "0.58400...
0.7457476
0
Map over this.state.images and render a FriendCard component for each image object
render() { return ( <Wrapper> <h1>Score: {this.state.score}</h1> <Title>Pick a Face</Title> {this.state.images.map(image => ( <FriendCard shuffleImage={this.setImageState} id={image.id} key={image.id} image={image.image} ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "render() {\n return (\n <Wrapper>\n <Title>Memory Game</Title>\n {this.state.friends.map(friend => (\n <FriendCard id={friend.id} image={friend.image} />\n ))}\n </Wrapper>\n );\n }", "function FriendsContainer(props) {\n let friendContainer;\n // let speciesL...
[ "0.7641088", "0.75415325", "0.73474574", "0.727064", "0.7255949", "0.71512765", "0.70827615", "0.70592815", "0.7020853", "0.6981772", "0.6977954", "0.69661385", "0.696012", "0.6839392", "0.683493", "0.68329054", "0.6830877", "0.6829901", "0.6828338", "0.6800853", "0.67936796"...
0.79394305
0
GET [route contact] /contact
contact(req, res) { res.render("contact"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Get() {\n return {\n method: 'GET',\n path: '/contact',\n config: {\n description: 'Get contacts',\n notes: 'Returns the Contacts meeting the provided parameters. In case there are no search parameters, all Contacts will be returned',\n ...
[ "0.67483556", "0.6645858", "0.662509", "0.64512974", "0.641518", "0.63350785", "0.6332379", "0.63053846", "0.6285084", "0.62346566", "0.6175759", "0.6166005", "0.61288625", "0.6105659", "0.60826993", "0.599417", "0.5963724", "0.59478295", "0.5922416", "0.5854342", "0.5847178"...
0.71638703
0
Methods Chart.js global options
function chartOptions() { // Options var options = { defaults: { global: { responsive: true, maintainAspectRatio: false, defaultColor: (mode == 'dark') ? colors.gray[700] : colors.gray[600], defaultFontColor: (mode == 'dark') ? colors.gray[700] : colors.gray[600], defaultFontFamily:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "options () {\n return Object.assign({}, defaultConfig, this.chartOptions)\n }", "function chartOps() {\n const mainChartOpts = {\n tooltips: {\n enabled: false,\n custom: CustomTooltips,\n intersect: true,\n mode: 'index',\n position: 'nearest',\n callbac...
[ "0.7523252", "0.7197551", "0.7022689", "0.6965597", "0.6947962", "0.69356304", "0.69356304", "0.689718", "0.67373645", "0.66180134", "0.6443784", "0.61871564", "0.61748314", "0.6119696", "0.60890424", "0.60890424", "0.60827416", "0.608056", "0.6072419", "0.6070712", "0.606870...
0.7925842
0
Posts the simple notification.
function postNotification() { var notification, notificationDict; try { // Sets notification dictionary. notificationDict = { content: "Hello Tizen!", iconPath: "../icon.png", }; // Creates notification object. ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function PostNotification (aSender, aName: String) { PostNotification(aSender, aName, null); }", "addNewNotification(note) {\n const notification = {\n type: \"postNotification\",\n content: note\n };\n this.socket.send(JSON.stringify(notification));\n }", "function sendNotification() {\n ...
[ "0.7419604", "0.6596819", "0.6583803", "0.65456957", "0.6278402", "0.6232861", "0.61748844", "0.6170653", "0.6169017", "0.6156008", "0.6147939", "0.61341524", "0.6109992", "0.60685337", "0.60676783", "0.60644305", "0.60532", "0.6038986", "0.6032404", "0.6011401", "0.5987506",...
0.7589868
0