Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
updates the currentTime div
function updateCurrentTime() { $('#current_time').html(formatTime(getCurrentTime())); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateCurrentTime() {\n elapsedSeconds++;\n $('.current-time').text(getTimeString(elapsedSeconds));\n }", "function updateTime() {\n var nowTime = moment().format('LTS');\n $(\"#currentTime\").html(nowTime);\n}", "function updateClock() {\n\tdocument.getElementById(\"time\").innerHT...
[ "0.81584877", "0.769983", "0.7687978", "0.76541966", "0.7652305", "0.7642832", "0.76030326", "0.75755495", "0.7524246", "0.75111204", "0.74489784", "0.7438156", "0.74332947", "0.7433109", "0.7400165", "0.73962677", "0.7380856", "0.7374665", "0.7363083", "0.73384935", "0.72756...
0.78983414
1
split handler for hover in events on split segements and list
function splitHoverIn(evt) { var id = $(this).prop('id'); id = id.replace('splitItem-', ''); id = id.replace('splitItemDiv-', ''); id = id.replace('splitSegmentItem-', ''); $('#splitItem-' + id).addClass('hover'); $('#splitSegmentItem-' + id).addClass('hover'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function splitHoverOut(evt) {\n var id = $(this).prop('id');\n id = id.replace('splitItem-', '');\n id = id.replace('splitItemDiv-', '');\n id = id.replace('splitSegmentItem-', '');\n\n $('#splitItem-' + id).removeClass('hover');\n $('#splitSegmentItem-' + id).removeClass('hover');\n}", "setSho...
[ "0.69761634", "0.6102542", "0.6068386", "0.6068386", "0.60046405", "0.59980476", "0.5975997", "0.59030133", "0.57930505", "0.5785852", "0.5771492", "0.5761145", "0.5751516", "0.5723944", "0.56981593", "0.56934965", "0.569103", "0.56706506", "0.5670305", "0.5633904", "0.562778...
0.7622045
0
handler for hover out events on split segements and list
function splitHoverOut(evt) { var id = $(this).prop('id'); id = id.replace('splitItem-', ''); id = id.replace('splitItemDiv-', ''); id = id.replace('splitSegmentItem-', ''); $('#splitItem-' + id).removeClass('hover'); $('#splitSegmentItem-' + id).removeClass('hover'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function splitHoverIn(evt) {\n var id = $(this).prop('id');\n id = id.replace('splitItem-', '');\n id = id.replace('splitItemDiv-', '');\n id = id.replace('splitSegmentItem-', '');\n\n $('#splitItem-' + id).addClass('hover');\n $('#splitSegmentItem-' + id).addClass('hover');\n}", "onMouseOut_()...
[ "0.7321176", "0.64159054", "0.63890785", "0.63087773", "0.62385017", "0.62046254", "0.6202698", "0.6108902", "0.60995233", "0.60985976", "0.6089905", "0.6078049", "0.60747147", "0.6044304", "0.6033784", "0.59992296", "0.5947394", "0.5927225", "0.5927225", "0.59102654", "0.590...
0.7597612
0
function executed when play event was thrown
function onPlay(evt) { if (timeout1 == null) { currEvt = evt; timeout1 = window.setTimeout(onTimeout, evt.data.duration); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function endPlay() {\n\n}", "onPlayStateChange() {}", "function play() {\n \n}", "play()\n {\n\n }", "play(){\n\n\n }", "play() {\n\t\tthis.trigger('play', this);\n\t}", "play() {\n\t\tthis.trigger('play', this);\n\t}", "function Play() {}", "Play() {}", "function onGamePlay(EightBitter) ...
[ "0.76172125", "0.74029696", "0.73764765", "0.73378026", "0.7324837", "0.73092407", "0.73092407", "0.7073385", "0.70722157", "0.70416516", "0.698551", "0.692875", "0.6887163", "0.6877705", "0.68339777", "0.68087876", "0.6783341", "0.6780168", "0.67756224", "0.6763177", "0.6755...
0.67181647
23
the timeout function pausing the video again
function onTimeout() { if (!timeoutUsed) { pauseVideo(); var check = function() { endTime = currEvt.data.endTime; if (endTime > getCurrentTime()) { playVideo(); timeout2 = window.setTimeout(check, 10); timeoutUsed = true; } else { clearEvents(); pauseVideo(); if ((timeout3 == null) && (timeout4 == null)) { editor.player.on("play", { duration: 0, endTime: getDuration() }, onPlay); } jumpBackTime = currEvt.data.jumpBackTime; jumpBackTime = ((jumpBackTime == null) || (jumpBackTime == undefined)) ? null : jumpBackTime; if (jumpBackTime != null) { setCurrentTime(jumpBackTime); jumpBackTime = null; } } } check(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function videoPause() {\n video.pause();\n }", "function videoPause() {\n video.pause();\n }", "function pause() {\n paused = true;\n clearTimeout(timeout);\n }", "pause() {\n this.video.pause();\n }", "function _pause()\n {\n cancelAnimationFrame(timeout_handle);\n...
[ "0.76567954", "0.76567954", "0.7426883", "0.72823894", "0.7147945", "0.7115879", "0.7100321", "0.7071351", "0.7021771", "0.6960464", "0.69397086", "0.6872244", "0.6872244", "0.6867334", "0.68225664", "0.6813283", "0.6809177", "0.67841893", "0.67815304", "0.6778185", "0.677807...
0.6796101
17
play/pause play the video
function playVideo() { if (getPlayerPaused()) { editor.player[0].play(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function playPlayer() {\n console.log(\"play\");\n player.internalPlayer.playVideo();\n whenUnPause();\n }", "function togglePlay() {\n video.paused ? video.play() : video.pause();\n}", "function toggleplay() {\n if (video.paused) {\n video.play();\n } else {\n video.pause();\n }\n}", "pl...
[ "0.7994133", "0.7979896", "0.79714286", "0.79132104", "0.79126847", "0.7876656", "0.78223777", "0.78058803", "0.7794952", "0.7678039", "0.7673985", "0.7646283", "0.76155514", "0.7607019", "0.7607019", "0.7579778", "0.75761205", "0.7571025", "0.75569654", "0.755566", "0.750845...
0.7687975
9
plays the current split item from it's beginning
function playCurrentSplitItem() { var splitItem = getCurrentSplitItem(); if (splitItem != null) { pauseVideo(); var duration = (splitItem.clipEnd - splitItem.clipBegin) * 1000; setCurrentTime(splitItem.clipBegin); clearEvents(); editor.player.on("play", { duration: duration, endTime: splitItem.clipEnd }, onPlay); playVideo(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function stepForward(){\n if(index === (playList.length - 1) ){\n index = 0\n }else{\n index++\n }\n box.innerHTML = `Track ${index + 1} - ${playList[index]}${ext}`;\n audio.src = dir + playList[index] + ext;\n audio.pl...
[ "0.6571789", "0.64713156", "0.6469307", "0.6348793", "0.611338", "0.60931295", "0.6075757", "0.6060013", "0.60393137", "0.60245425", "0.6014614", "0.5991558", "0.59887254", "0.59524554", "0.5933211", "0.5931323", "0.5924069", "0.592249", "0.5922396", "0.59212923", "0.588047",...
0.7102445
0
play last 2 seconds of the current segment
function playEnding() { var splitItem = getCurrentSplitItem(); if (splitItem != null) { pauseVideo(); var clipEnd = splitItem.clipEnd; setCurrentTime(clipEnd - 2); clearEvents(); editor.player.on("play", { duration: 2000, endTime: clipEnd }, onPlay); playVideo(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function playOneSegment(videoSrc, inPoint, outPoint) {\n video.src = videoSrc\n video.load\n video.currentTime = inPoint\n video.play()\n video.ontimeupdate = function () {\n stopAtOutPoint()\n }\n counter += 1\n }", "function playBack() {\n setTi...
[ "0.6330583", "0.6316276", "0.6207637", "0.61473566", "0.6133786", "0.60890275", "0.6072445", "0.60640234", "0.6042378", "0.60379004", "0.5992548", "0.5988381", "0.59769315", "0.59691375", "0.5966064", "0.5915822", "0.59122777", "0.5911776", "0.5910597", "0.59100187", "0.59038...
0.6438047
0
play current segment with prePostRoll s pre and prePostRoll s postroll, exclude removed segments
function playWithoutDeleted() { playWithoutDeleted_helper(false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function previousSegment() {\n if (editor.splitData && editor.splitData.splits) {\n var playerPaused = getPlayerPaused();\n if (!playerPaused) {\n pauseVideo();\n }\n var currSplitItem = getCurrentSplitItem();\n var new_id = currSplitItem.id - 1;\n new_id = (...
[ "0.5518453", "0.5355828", "0.53091747", "0.52961946", "0.5143724", "0.49183297", "0.48492965", "0.48300415", "0.4773072", "0.4710266", "0.46952787", "0.46507967", "0.4641206", "0.46408376", "0.4630528", "0.46270755", "0.46068397", "0.45652163", "0.4534271", "0.45284486", "0.4...
0.0
-1
play current segment with prePostRoll s pre and full postroll, exclude removed segments
function playWithoutDeletedFull() { playWithoutDeleted_helper(true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function playWithoutDeleted_helper(full) {\n full = full || false;\n clearEvents2();\n if (editor.splitData && editor.splitData.splits) {\n var splitItem = getCurrentSplitItem();\n\n if (splitItem != null) {\n pauseVideo();\n\n var clipStartFrom = -1;\n var c...
[ "0.5766313", "0.5746724", "0.5595022", "0.5417537", "0.52656126", "0.5077525", "0.5059967", "0.50532365", "0.50049883", "0.5002344", "0.4894684", "0.48554", "0.4810387", "0.47657138", "0.47534618", "0.47334775", "0.4716487", "0.47163123", "0.471399", "0.46825728", "0.46762305...
0.0
-1
play current segment with prePostRoll s pre and prePostRoll s/full postroll, exclude removed segments
function playWithoutDeleted_helper(full) { full = full || false; clearEvents2(); if (editor.splitData && editor.splitData.splits) { var splitItem = getCurrentSplitItem(); if (splitItem != null) { pauseVideo(); var clipStartFrom = -1; var clipStartTo = -1; var segmentStart = splitItem.clipBegin; var segmentEnd = splitItem.clipEnd; var clipEndFrom = -1; var clipEndTo = -1; var hasPrevElem = true; var hasNextElem = true; var duration = getDuration(); // check previous item to be played, get start time if ((splitItem.id - 1) >= 0) { hasPrevElem = true; if ((splitItem.id - 1) >= 0) { var prevSplitItem = editor.splitData.splits[splitItem.id - 1]; while (!prevSplitItem.enabled) { if ((prevSplitItem.id - 1) < 0) { hasPrevElem = false; break; } else { prevSplitItem = editor.splitData.splits[prevSplitItem.id - 1]; } } } else { hasPrevElem = false; } if (hasPrevElem) { clipStartTo = prevSplitItem.clipEnd; clipStartFrom = clipStartTo - prePostRoll; } } if (hasPrevElem) { clipStartFrom = (clipStartFrom < 0) ? 0 : clipStartFrom; } if (full) { if ((splitItem.id + 1) < editor.splitData.splits.length) { hasNextElem = true; var nextSplitItem = editor.splitData.splits[splitItem.id + 1]; while (!nextSplitItem.enabled) { if ((nextSplitItem.id + 1) >= editor.splitData.splits.length) { hasNextElem = false; break; } else { nextSplitItem = editor.splitData.splits[nextSplitItem.id + 1]; } } if (hasNextElem) { clipEndFrom = nextSplitItem.clipBegin; clipEndTo = clipEndFrom + prePostRoll; } } if (hasNextElem) { clipEndTo = (clipEndTo > duration) ? duration : clipEndTo; } } else { clipEndFrom = -1; clipEndTo = -1; var splBP2 = splitItem.clipBegin + prePostRoll; segmentEnd = (splBP2 <= splitItem.clipEnd) ? splBP2 : splitItem.clipEnd; segmentEnd = (segmentEnd > duration) ? duration : segmentEnd; } ocUtils.log("Play Times: " + clipStartFrom + " - " + clipStartTo + " | " + segmentStart + " - " + segmentEnd + " | " + clipEndFrom + " - " + clipEndTo); if (hasPrevElem && ((full && hasNextElem) || !full)) { currSplitItemClickedViaJQ = true; setCurrentTime(clipStartFrom); clearEvents(); editor.player.on("play", { duration: (clipStartTo - clipStartFrom) * 1000, endTime: clipStartTo }, onPlay); playVideo(); timeout3 = window.setTimeout(function() { pauseVideo(); currSplitItemClickedViaJQ = true; setCurrentTime(segmentStart); clearEvents(); editor.player.on("play", { duration: (segmentEnd - segmentStart) * 1000, endTime: segmentEnd }, onPlay); playVideo(); }, (clipStartTo - clipStartFrom) * 1000); if (full) { timeout4 = window.setTimeout(function() { pauseVideo(); if (timeout3 != null) { window.clearTimeout(timeout3); timeout3 = null; } currSplitItemClickedViaJQ = true; setCurrentTime(clipEndFrom); clearEvents(); editor.player.on("play", { duration: (clipEndTo - clipEndFrom) * 1000, endTime: clipEndTo }, onPlay); playVideo(); if (timeout4 != null) { window.clearTimeout(timeout4); timeout4 = null; } }, ((clipStartTo - clipStartFrom) * 1000) + ((segmentEnd - segmentStart) * 1000)); } else { timeout4 = window.setTimeout(function() { pauseVideo(); if (timeout3 != null) { window.clearTimeout(timeout3); timeout3 = null; } currSplitItemClickedViaJQ = true; clearEvents(); if (timeout4 != null) { window.clearTimeout(timeout4); timeout4 = null; } }, ((clipStartTo - clipStartFrom) * 1000) + (segmentEnd * 1000)); } } else if (!hasPrevElem && hasNextElem) { currSplitItemClickedViaJQ = true; setCurrentTime(segmentStart); clearEvents(); editor.player.on("play", { duration: (segmentEnd - segmentStart) * 1000, endTime: segmentEnd }, onPlay); playVideo(); if (full) { timeout3 = window.setTimeout(function() { pauseVideo(); currSplitItemClickedViaJQ = true; setCurrentTime(clipEndFrom); clearEvents(); editor.player.on("play", { duration: (clipEndTo - clipEndFrom) * 1000, endTime: clipEndTo }, onPlay); playVideo(); if (timeout3 != null) { window.clearTimeout(timeout3); timeout3 = null; } }, ((segmentEnd - segmentStart) * 1000)); } else { timeout3 = window.setTimeout(function() { pauseVideo(); currSplitItemClickedViaJQ = true; clearEvents(); if (timeout3 != null) { window.clearTimeout(timeout3); timeout3 = null; } }, (segmentEnd * 1000)); } } else if (hasPrevElem && !hasNextElem) { currSplitItemClickedViaJQ = true; setCurrentTime(clipStartFrom); clearEvents(); editor.player.on("play", { duration: (clipStartTo - clipStartFrom) * 1000, endTime: clipStartTo }, onPlay); playVideo(); timeout3 = window.setTimeout(function() { pauseVideo(); currSplitItemClickedViaJQ = true; setCurrentTime(segmentStart); clearEvents(); editor.player.on("play", { duration: (segmentEnd - segmentStart) * 1000, endTime: segmentEnd }, onPlay); playVideo(); if (timeout3 != null) { window.clearTimeout(timeout3); timeout3 = null; } }, (clipStartTo - clipStartFrom) * 1000); } else if (!hasPrevElem && !hasNextElem) { clearEvents(); editor.player.on("play", { duration: (segmentEnd - segmentStart) * 1000, endTime: segmentEnd }, onPlay); playVideo(); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function previousSegment() {\n if (editor.splitData && editor.splitData.splits) {\n var playerPaused = getPlayerPaused();\n if (!playerPaused) {\n pauseVideo();\n }\n var currSplitItem = getCurrentSplitItem();\n var new_id = currSplitItem.id - 1;\n new_id = (...
[ "0.5564305", "0.5399973", "0.5356345", "0.514701", "0.49325645", "0.49311793", "0.49182078", "0.4847869", "0.48345715", "0.47871506", "0.4709126", "0.47009376", "0.4678099", "0.46700835", "0.46627903", "0.46214515", "0.4574515", "0.45615485", "0.4560828", "0.4557831", "0.4541...
0.5598638
0
jumps jump to beginning of current split item
function jumpToSegment() { if (editor.splitData && editor.splitData.splits) { id = $(this).prop('id'); id = id.replace('splitItem-', ''); id = id.replace('splitItemDiv-', ''); id = id.replace('splitSegmentItem-', ''); setCurrentTime(editor.splitData.splits[id].clipBegin); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "jump(itemIndex = 0){\n this._changeActive_keepPlayState(itemIndex);\n }", "jump(item) { this._.unshift(item); return this; }", "jumpTo(position = 0) {\n this.at = position;\n }", "jumpToBeginning() {\n this.simulateKeyPress_(SAConstants.KeyCode.HOME, {ctrl: true});\n }", "function jumpToF...
[ "0.6972423", "0.6931872", "0.6901941", "0.649786", "0.6410922", "0.63501", "0.6250299", "0.6199222", "0.6168766", "0.61422896", "0.6131393", "0.61113167", "0.61062145", "0.609528", "0.60864264", "0.60864264", "0.60864264", "0.60864264", "0.60864264", "0.60789686", "0.6074162"...
0.6809857
3
jump to next segment
function nextSegment() { if (editor.splitData && editor.splitData.splits) { var playerPaused = getPlayerPaused(); if (!playerPaused) { pauseVideo(); } var currSplitItem = getCurrentSplitItem(); var new_id = currSplitItem.id + 1; new_id = (new_id >= editor.splitData.splits.length) ? 0 : new_id; var idFound = true; if ((new_id < 0) || (new_id >= editor.splitData.splits.length)) { idFound = false; } /* else if (!editor.splitData.splits[new_id].enabled) { idFound = false; new_id = (new_id >= (editor.splitData.splits.length - 1)) ? 0 : new_id; for (var i = new_id + 1; i < editor.splitData.splits.length; ++i) { if (editor.splitData.splits[i].enabled) { new_id = i; idFound = true; break; } } } */ if (!idFound) { for (var i = 0; i < new_id; ++i) { // if (editor.splitData.splits[i].enabled) { new_id = i; idFound = true; break; // } } } if (idFound) { selectSegmentListElement(new_id, !playerPaused); } if (!playerPaused) { playVideo(); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function jumpToSegment() {\n if (editor.splitData && editor.splitData.splits) {\n id = $(this).prop('id');\n id = id.replace('splitItem-', '');\n id = id.replace('splitItemDiv-', '');\n id = id.replace('splitSegmentItem-', '');\n\n setCurrentTime(editor.splitData.splits[id].cl...
[ "0.67715377", "0.67556965", "0.67463887", "0.6522925", "0.6424442", "0.6307948", "0.6302216", "0.62982184", "0.6260498", "0.61768353", "0.61684626", "0.61383116", "0.6107105", "0.60841346", "0.60781264", "0.60467297", "0.6019503", "0.6011848", "0.6007218", "0.5990855", "0.597...
0.63948375
5
jump to previous segment
function previousSegment() { if (editor.splitData && editor.splitData.splits) { var playerPaused = getPlayerPaused(); if (!playerPaused) { pauseVideo(); } var currSplitItem = getCurrentSplitItem(); var new_id = currSplitItem.id - 1; new_id = (new_id < 0) ? (editor.splitData.splits.length - 1) : new_id; var idFound = true; if ((new_id < 0) || (new_id >= editor.splitData.splits.length)) { idFound = false; } /* else if (!editor.splitData.splits[new_id].enabled) { idFound = false; new_id = (new_id <= 0) ? editor.splitData.splits.length : new_id; for (var i = new_id - 1; i >= 0; --i) { if (editor.splitData.splits[i].enabled) { new_id = i; idFound = true; break; } } } */ if (!idFound) { for (var i = editor.splitData.splits.length - 1; i >= 0; --i) { // if (editor.splitData.splits[i].enabled) { new_id = i; idFound = true; break; // } } } if (idFound) { selectSegmentListElement(new_id, !playerPaused); } if (!playerPaused) { playVideo(); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function goToPrevStep(){\n unhighlightArrow(currStepId, numberToString[currStepId]);\n currStepId-=1;\n replaceStep();\n highlightArrow(currStepId, numberToString[currStepId]); \n}", "prevStep() {\n\n if (this.currStep > -1) {\n\n this.goTo(this.currSlide, this.currStep - 1);\n\n }\...
[ "0.77551883", "0.7520117", "0.7301945", "0.7290555", "0.726341", "0.7210053", "0.71909285", "0.71621937", "0.71262074", "0.711226", "0.7082025", "0.7069873", "0.7030981", "0.7025983", "0.69385093", "0.6928093", "0.6881588", "0.68771064", "0.6875682", "0.68724006", "0.68501216...
0.0
-1
other add all shortcuts
function addShortcuts() { $.ajax({ url: ME_JSON, dataType: "json", async: false, success: function(data) { $.each(data.org.properties, function(key, value) { default_config[key] = value; $('#' + key.replace(".", "_")).html(value); }); } }); $.each(default_config, function(key, value) { $('#' + key.replace(".", "_")).html(value); }); // add shortcuts for easier editing shortcut.add(default_config[SPLIT_AT_CURRENT_TIME], splitButtonClick, { disable_in_input: true, }); shortcut.add(default_config[PREVIOUS_FRAME], function() { pauseVideo(); $('.video-prev-frame').click(); }, { disable_in_input: true, }); shortcut.add(default_config[NEXT_FRAME], function() { pauseVideo(); $('.video-next-frame').click(); }, { disable_in_input: true, }); shortcut.add(default_config[PLAY_PAUSE], function() { if (getPlayerPaused()) { playVideo(); } else { pauseVideo(); } }, { disable_in_input: true, }); shortcut.add(default_config[PLAY_CURRENT_SEGMENT], playCurrentSplitItem, { disable_in_input: true, }); shortcut.add(default_config[DELETE_SELECTED_ITEM], splitRemoverClick, { disable_in_input: true, }); shortcut.add(default_config[SELECT_ITEM_AT_CURRENT_TIME], selectCurrentSplitItem, { disable_in_input: true, }); shortcut.add(default_config[SET_CURRENT_TIME_AS_INPOINT], setCurrentTimeAsNewInpoint, { disable_in_input: true, }); shortcut.add(default_config[SET_CURRENT_TIME_AS_OUTPOINT], setCurrentTimeAsNewOutpoint, { disable_in_input: true, }); shortcut.add(default_config[NEXT_MARKER], nextSegment, { disable_in_input: true, }); shortcut.add(default_config[PREVIOUS_MARKER], previousSegment, { disable_in_input: true, }); shortcut.add(default_config[PLAY_ENDING_OF_CURRENT_SEGMENT], playEnding, { disable_in_input: true, }); shortcut.add(default_config[CLEAR_SEGMENT_LIST], clearSegmentList, { disable_in_input: true, }); shortcut.add(default_config[PLAY_CURRENT_PRE_POST], playWithoutDeleted, { disable_in_input: true }); shortcut.add(default_config[PLAY_CURRENT_PRE_POST_FULL], playWithoutDeletedFull, { disable_in_input: true }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addShortcuts() {\n\t\t\t\n\t\t\t// global shortcuts\n\t\t\tvar globalShortcuts = Mousetrap($document[0].body);\n\t\t\tglobalShortcuts.bind(['ctrl+alt+c'], function(){\n\t\t\t\tclear();\n\t\t\t\t$scope.$apply();\n\t\t\t});\n\t\t\t\n\t\t\tglobalShortcuts.bind(['ctrl+alt+k'], clearClipboardItems);\n\n\t\t\tg...
[ "0.69841486", "0.640429", "0.63478136", "0.62649816", "0.62353706", "0.61996704", "0.615741", "0.61306745", "0.6121475", "0.6035658", "0.59772706", "0.5701384", "0.56925005", "0.5683325", "0.5677872", "0.56714946", "0.56605667", "0.56552994", "0.5649782", "0.5630397", "0.5618...
0.6204524
5
init the playbuttons in the editing box
function initPlayButtons() { $('#clearList').button(); $('#clearList').click(function() { clearSegmentList(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initPlayBtn() {\n\tvar phase_intro = '<a href=\"#\" id=\"phase_intro\" class=\"border-radius\">Synopsis</a>';\n\t\n\t$('.tl_ctrl_bar').append(phase_intro);\n\t\n\t$('#phase_intro').click(function() {\n\t\tstopAnimation();\n\t\tloadIntro($(this).attr('data-ref'));\n\t\t$.cookie('phaseIntro',true);\n\t});\n...
[ "0.6722494", "0.66835535", "0.65846854", "0.6552051", "0.65383506", "0.6518687", "0.6467552", "0.6455862", "0.64248395", "0.63270956", "0.63224787", "0.63103634", "0.6309897", "0.62934166", "0.6272553", "0.6233695", "0.6221517", "0.6208214", "0.620332", "0.61538094", "0.60828...
0.65114444
6
parses the initial smil file and adds segments if already available
function parseInitialSMIL() { if (editor.parsedSmil) { ocUtils.log("Smil found. Parsing"); var insertedSplitItem = false; // check whether SMIL has already cutting points if (editor.parsedSmil.par) { editor.splitData.splits = []; editor.parsedSmil.par = ocUtils.ensureArray(editor.parsedSmil.par); var lastEnd = 0; $.each(editor.parsedSmil.par, function(key, value) { value.video = ocUtils.ensureArray(value.video); var clipBegin = (value && value.video[0] && value.video[0].clipBegin) ? (parseFloat(value.video[0].clipBegin) / 1000) : 0; var clipEnd = (value && value.video[0] && value.video[0].clipEnd) ? (parseFloat(value.video[0].clipEnd) / 1000) : getDuration(); if ((clipBegin != undefined) && (clipEnd != undefined)) { if ((key > 0) && (lastEnd != clipBegin)) { ocUtils.log("Inserting a split element (1): (" + lastEnd + " - " + clipBegin + ")"); editor.splitData.splits.push({ clipBegin: parseFloat(lastEnd), clipEnd: parseFloat(clipBegin), enabled: false }); } ocUtils.log("Inserting a split element (2): (" + clipBegin + " - " + clipEnd + ")"); editor.splitData.splits.push({ clipBegin: clipBegin, clipEnd: clipEnd, enabled: true }); lastEnd = clipEnd; } }); for (var i = 0; i < editor.splitData.splits.length; ++i) { if (checkPrevAndNext(i, false).inserted) { i = 0; } } // check last segment var duration = getDuration(); if (editor.splitData.splits.length > 0) { var current = editor.splitData.splits[editor.splitData.splits.length - 1]; if (current.clipEnd != duration) { if ((current.clipEnd < (duration - minSegmentLength)) || (current.clipEnd <= minSegmentLength)) { ocUtils.log("Inserting a last split element (auto): (" + current.clipEnd + " - " + duration + ")"); var newLastItem = { clipBegin: parseFloat(current.clipEnd), clipEnd: duration, enabled: true }; // add the new item to the end editor.splitData.splits.push(newLastItem); insertedLastItem = true; } else { ocUtils.log("Extending the last split element to (auto): (" + current.clipBegin + " - " + duration + ")"); current.clipEnd = duration; } } } else { ocUtils.log("Inserting a split element (auto): (" + 0 + " - " + duration + ")"); var newItem = { clipBegin: 0, clipEnd: duration, enabled: true }; // add the new item editor.splitData.splits.push(newItem); } } ocUtils.log("Done parsing smil."); } else { ocUtils.log("No smil found."); if (editor.splitData && editor.splitData.splits) { var duration = editor.mediapackageParser.duration / 1000; ocUtils.log("Inserting a split element: (" + 0 + " - " + duration + ")"); if (!insertedSplitItem) { editor.splitData.splits.push({ clipBegin: 0, clipEnd: parseFloat(duration), enabled: true }); } } } editor.splitData.splits[0].enabled = !insertedFirstItem; editor.splitData.splits[editor.splitData.splits.length - 1].enabled = !insertedLastItem; window.setTimeout(function() { if (!insertedFirstItem) { if (editor.splitData.splits.length == 1) { $('#splitSegmentItem-0').css('width', '100%'); } $('#splitSegmentItem-0').click(); } else { $('#splitSegmentItem-1').click(); } }, initMS); prepareUI(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onCodePathSegmentStart(segment) {\n const info = {\n uselessContinues: getUselessContinues([], segment.allPrevSegments),\n returned: false\n };\n\n // Stores the info.\n segmentInfoMap.set(segment, info);\n ...
[ "0.53671", "0.5225171", "0.5184004", "0.51376367", "0.4997676", "0.49649376", "0.49582064", "0.49030071", "0.48689047", "0.48493445", "0.48305067", "0.48299035", "0.47819272", "0.4769737", "0.47503036", "0.47479227", "0.4735416", "0.47334087", "0.47054288", "0.47010988", "0.4...
0.65977293
0
when player is ready
function playerReady() { cancelCanplayTimeout(); ocUtils.log("Player ready"); if (!editor.ready) { ocUtils.log("Initializing the editor"); editor.ready = true; $("#cancelButton").css("color", "#FFFFFF"); // create additional data output $('#videoHolder').append('<div id="segmentsWaveform"></div>'); $('#segmentsWaveform').append('<div id="splitSegments"></div>'); $('#segmentsWaveform').append('<div id="imageDiv"><img id="waveformImage" alt="waveform"/></div>'); $('#segmentsWaveform').append('<div id="currentTimeDiv"></div>'); editor.player.bind("timeupdate", function() { positionWaveformAndTimeIndicator(); }); if (workflowInstance.mediapackage && workflowInstance.mediapackage.duration) { // create standard split point editor.splitData.splits.push({ clipBegin: 0, clipEnd: parseFloat(workflowInstance.mediapackage.duration) / 1000, enabled: true }); } editor.smil = null; editor.parsedSmil = null; if (workflowInstance.mediapackage && workflowInstance.mediapackage.metadata && workflowInstance.mediapackage.metadata.catalog) { var presenter_smil = false; var presentation_smil = false; var episode_smil = false; $.each(workflowInstance.mediapackage.metadata.catalog, function(key, value) { // load smil if there is already one if (value.type == SMIL_FLAVOR_PRESENTER) { presenter_smil = true; ocUtils.log("Found presenter smil"); } else if (value.type == SMIL_FLAVOR_PRESENTATION) { presentation_smil = true; ocUtils.log("Found presentation smil"); } else if (value.type == SMIL_FLAVOR_EPISODE) { episode_smil = true; ocUtils.log("Found episode smil"); } }); if (presenter_smil || presentation_smil || episode_smil) { // download smil editor.getSmil(function() { parseInitialSMIL(); }); } } } $("#loadingDisplay").hide(); $("#thePlayer").show(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onPlayerReady(){\n\t\tg_isPlayerReady = true;\n\t\t\n\t}", "function onPlayerReady(e) {\n}", "function onPlayerReady(event) {\r\n playerReady = true;\r\n\r\n }", "function onPlayerReady(event) {\n \n}", "function onPlayerReady(event) {\n console.log(\"Player is ready\");\n }", "functi...
[ "0.88452995", "0.84850425", "0.8466784", "0.8276076", "0.8212175", "0.81919545", "0.81737125", "0.81549764", "0.802907", "0.8003171", "0.77981424", "0.7715783", "0.77065784", "0.766083", "0.76386726", "0.7619629", "0.7523268", "0.74400383", "0.74060965", "0.7345141", "0.73416...
0.0
-1
Returns an object containing a latitude and longitude (in degrees) representing the given city. The latitude and longitude will generally be at a relevant central location within the city (e.g. downtown).
async function fetchLatLngOfCity(city, state) { const apiKey = config.MAP_QUEST_API_KEY; const endpoint = `https://www.mapquestapi.com/geocoding/v1/address?key=${apiKey}&inFormat=kvp&outFormat=json&location=${city}, ${state}&thumbMaps=false`; const response = await fetch(endpoint); const json = await response.json(); // Skip first element in json, which consists of unneeded headers. return json.results[0].locations[0].latLng; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "distanceTo(city) {\n let xDistance = Math.abs(this.x - city.x);\n let yDistance = Math.abs(this.y - city.y);\n let distance = Math.sqrt((xDistance * xDistance) + (yDistance * yDistance));\n\n return distance;\n }", "function distanceFromGrenoble(city) {\n console.log(\"distanceFromGrenoble - implem...
[ "0.6626432", "0.64797866", "0.6473476", "0.64460015", "0.6222453", "0.621869", "0.6212259", "0.6185457", "0.61765385", "0.61601037", "0.60824305", "0.60278165", "0.595868", "0.5958314", "0.59498996", "0.5924764", "0.5908419", "0.58820266", "0.5860566", "0.5833695", "0.5803632...
0.5579104
38
Returns the number of miles in one degree of longitude for a location at the given latitude.
function calculateMilesPerDegreeLng(lat) { const latRadians = degreesToRadians(lat); return Math.cos(latRadians) * MILES_IN_ONE_DEGREE_LAT_AT_EQUATOR; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function metersPerDegree(lat) {\n return EQUATOR_DEGREE_LEN * Math.cos(lat * Math.PI / 180);\n}", "function getMiles (distanceInMeters) {\n return (distanceInMeters*0.000621371192).toFixed(1)\n}", "function milesToLngDegrees(miles, lat) {\n return miles / calculateMilesPerDegreeLng(lat);\n }", "functio...
[ "0.6847206", "0.65184087", "0.6455167", "0.6389776", "0.6337094", "0.6299651", "0.62856066", "0.627952", "0.6212539", "0.6208797", "0.6208797", "0.6180989", "0.61774427", "0.61760384", "0.61760384", "0.61760384", "0.6118838", "0.6102353", "0.6068052", "0.6062848", "0.6039356"...
0.7869492
0
Converts the given number of degrees to radians.
function degreesToRadians(degrees) { return degrees * Math.PI / 180; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function radians(n) {\n return n * (Math.PI / 180);\n }", "function toRadians(num) {\n\treturn num * Math.PI / 180;\n}", "function degreesToRadians(n) {\n return (n * (Math.PI / 180));\n }", "toRadians(number) {\n return number * (Math.PI / 180);\n }", "function degreeToRadians(n){\n ...
[ "0.79313636", "0.7857014", "0.77138245", "0.770211", "0.7645498", "0.7520108", "0.74009407", "0.7353728", "0.72807175", "0.727777", "0.7262223", "0.7211627", "0.71990407", "0.7164016", "0.71582776", "0.7142664", "0.7141968", "0.7134506", "0.7134506", "0.7134506", "0.7134506",...
0.0
-1
Returns an object containing two latLng coordinates representing the southwest and northeast corners of a box encompassing the given center latLng. The box's height is latOffset 2 and the box's length is lngOffset 2.
function calculateLatLngBounds(center, latOffset, lngOffset) { const southwest = new Map(); southwest.lat = center.lat - latOffset; southwest.lng = center.lng - lngOffset; const northeast = new Map(); northeast.lat = center.lat + latOffset; northeast.lng = center.lng + lngOffset; const latLngBounds = new Map(); latLngBounds.southwest = southwest; latLngBounds.northeast = northeast; latLngBounds.center = center; return latLngBounds; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getBoundingRectLocs (center, grid) {\n var jQueryDoc = $(window.document),\n jQH = jQueryDoc.height(),\n jQW = jQueryDoc.width(),\n R = jQH/jQW,\n size = (grid ||.002);\n\n center.latitude = Math.round(center.latitude/(2*siz...
[ "0.63520116", "0.6276804", "0.6075856", "0.58296704", "0.57885945", "0.56999004", "0.56209254", "0.56209254", "0.56144434", "0.56123745", "0.55647916", "0.55561036", "0.55454063", "0.5458264", "0.54568994", "0.54464936", "0.5435856", "0.5434639", "0.54338443", "0.54338443", "...
0.6774823
0
Coverts the given number of miles to the equivalent number of degrees in latitude. Not extremely accurate but sufficient for general use. Works for any location, irrespective of longitude.
function milesToLatDegrees(miles) { const MILES_IN_ONE_DEGREE_LAT_AT_EQUATOR = 69.0; return miles / MILES_IN_ONE_DEGREE_LAT_AT_EQUATOR; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function milesToLngDegrees(miles, lat) {\n return miles / calculateMilesPerDegreeLng(lat);\n }", "function calculateMilesPerDegreeLng(lat) {\n const latRadians = degreesToRadians(lat);\n return Math.cos(latRadians) * MILES_IN_ONE_DEGREE_LAT_AT_EQUATOR;\n }", "function changeToMiles(place) {\n var d...
[ "0.7617932", "0.7335804", "0.7021304", "0.69807136", "0.6794738", "0.6794738", "0.6794738", "0.67732346", "0.6743387", "0.6711142", "0.65130067", "0.6486679", "0.64822316", "0.6458301", "0.6455056", "0.64298683", "0.64157116", "0.6361914", "0.6342802", "0.62975895", "0.617566...
0.7172749
2
Coverts the given number of miles to the equivalent number of degrees in longitude for a location at the given latitude.
function milesToLngDegrees(miles, lat) { return miles / calculateMilesPerDegreeLng(lat); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calculateMilesPerDegreeLng(lat) {\n const latRadians = degreesToRadians(lat);\n return Math.cos(latRadians) * MILES_IN_ONE_DEGREE_LAT_AT_EQUATOR;\n }", "function changeToMiles(place) {\n var distance = place.distance;\n distance = distance / 1609.34;\n var integer = Math.floor(distance);\n va...
[ "0.74812263", "0.66402316", "0.634429", "0.6326366", "0.63260233", "0.6320264", "0.62740016", "0.6254649", "0.62146586", "0.62146586", "0.62146586", "0.6208064", "0.61834604", "0.6154545", "0.6137825", "0.61300874", "0.6105117", "0.6075366", "0.6070963", "0.6065734", "0.60657...
0.73975563
1
This function controls sending data to the server
function startStream() { streamInterval = setInterval(working, msFrequency); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_sendData() {\n\n }", "function startSendingData () {\n // Send data to server once in a while, exponential\n UST.sendDataDelay = 300;\n recurseSend();\n }", "sending () {\n }", "function send(data){\n //\n}", "function send(data) {\n //console.log(data);\n client.sen...
[ "0.80224615", "0.7384835", "0.7307326", "0.7289301", "0.7257176", "0.7103593", "0.7064688", "0.7023547", "0.6934566", "0.69182396", "0.69036555", "0.68701947", "0.6857304", "0.6844087", "0.67807114", "0.6777488", "0.6733027", "0.6686039", "0.6665436", "0.6663014", "0.6662145"...
0.0
-1
pour rendre les liens actifs
function ONCLICK() { const currentLocalisation = location.href; const menuItem = document.querySelectorAll("a"); const menuLength = menuItem.length; for (let i = 0; i < menuLength; i++) { if (menuItem[i].href === currentLocalisation) { menuItem[i].className = "active"; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderFilmList(data) {\n var strHTML = ``;\n var orderNum = 1;\n data.forEach(film => {\n strHTML += `\n <li class=\"animated fadeIn delay-2s\">\n <i class=\"fas fa-film\"></i><span>#${orderNum}</span>\n <p><b>Title: </b>${film.title}</p...
[ "0.6138542", "0.61364466", "0.6128347", "0.60778", "0.6074185", "0.59710544", "0.596588", "0.5951231", "0.59496063", "0.5933554", "0.5933443", "0.58687675", "0.58346635", "0.5832827", "0.5805285", "0.5790154", "0.5780234", "0.57624507", "0.5760708", "0.57531464", "0.5738228",...
0.0
-1
METODO PARA OBTENER LAS TAREAS DE UN USUARIO
function getTareasById(fk_usuario) { return new Promise((resolve, reject) => { db.query('SELECT * FROM s9q90jl9ash7sm2k.tareas WHERE fk_usuario=?', [fk_usuario], (error, result) => { if (error) { return reject(error) } else { resolve(result); console.log(result); } }) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pegaNomeUsuario(numeroUsuario) {\n let nomeUsuario = rs.question(`Digite o nome do usuário ${numeroUsuario}: \\n`)\n return nomeUsuario\n}", "function _inicioSesionUsuario(aUsuario){\n\n var usuarioValido = false.\n tipoUsuario = '';\n\n for (var i = 0; i < usuarios.length; i++)...
[ "0.60926986", "0.6090036", "0.60679436", "0.6060688", "0.60276234", "0.60013336", "0.5981784", "0.5861189", "0.5841094", "0.57762223", "0.5759213", "0.5745449", "0.5727679", "0.57255703", "0.57145685", "0.5711444", "0.56803024", "0.5667314", "0.5661936", "0.56480235", "0.5623...
0.0
-1
METODO PARA BORRAR UNA TAREA
function borrarTarea(pId) { return new Promise((resolve, reject) => { db.query('DELETE FROM s9q90jl9ash7sm2k.tareas WHERE id=?', [pId], (error, result) => { if (error) { return reject(error) } else { resolve(result) } }) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Tarea(nombre, urgencia) {\n this.nombre = nombre;\n this.urgencia = urgencia;\n}", "function Tarea(nombre, urgencia) {\n this.nombre = nombre;\n this.urgencia = urgencia;\n}", "function Tarea(nombre, urgencia){\n this.nombre = nombre;\n this.urgencia = urgencia;\n\n}", "function Tarea(...
[ "0.683295", "0.683295", "0.680449", "0.67723006", "0.6762246", "0.6619391", "0.6147115", "0.60673404", "0.6009856", "0.59871507", "0.5915295", "0.58610404", "0.58585364", "0.58265615", "0.57786196", "0.57592535", "0.57483107", "0.5690091", "0.56763625", "0.5676155", "0.567512...
0.0
-1
Use context to update vars dinamyc / Use the context to redirect after succeded and update var to use in view Method to create users, pass object Users
create(context, user){ context.showAlert = false context.showSuccess = false HTTP.post(USERS, user) .then((resp) => { if (resp.status>= 200 && resp.status <=300){ console.log(resp) var id = resp.data.id // redirect to show user view context.$router.push({ name: 'EmployeesShow', params: { id }}) } }) .catch((err) => { context.showAlert = true context.errMsg = err.response.data console.log(err) if (err.response) { console.log(err.response.data); console.log(err.response); } }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "success(context, response, redirect) {\n context.$set('errors', {});\n\n let { token, user } = response.data;\n\n user.token = token;\n\n localStorage.setItem('user', JSON.stringify(user));\n\n this.authenticated = this.user();\n\n if (redirect) context.$router.go(redirect...
[ "0.6090626", "0.6084171", "0.6072798", "0.5958986", "0.5940384", "0.5925609", "0.5897438", "0.58347684", "0.5813905", "0.5753374", "0.5726536", "0.5712611", "0.5688643", "0.56806326", "0.5665958", "0.566029", "0.5655649", "0.5641744", "0.5632319", "0.5622834", "0.56005514", ...
0.69854975
0
Method to update user, pass context, object Users and user id
update(context, user){ context.showAlert = false context.showSuccess = false HTTP.put(USERS, user) .then((resp) => { if (resp.status>= 200 && resp.status <=300){ var id = resp.data.id context.showAlert = false } context.showSuccess = true context.successMsg = "Users updated successfully" }) .catch((err) => { context.showAlert = true console.log(err) if (err.response) { context.errMsg = err.response.data console.log(err.response.data); console.log(err.response); context.showAlert = true } }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateUser (context, user) {\n context.commit('updateUser', user)\n }", "function updateUserInfo(id, user) {\n}", "updateUser(userId, data) {\n return this.userStore.updateUser(userId, data)\n }", "updateUser(userId, partialUser) {\n const url = this.route\n\t\tconst config = {\n\t\t\tmethod: ...
[ "0.8033117", "0.76418144", "0.7581433", "0.74994916", "0.7426298", "0.73104614", "0.7307136", "0.728519", "0.7258158", "0.72351307", "0.7221518", "0.7221476", "0.72045404", "0.71919835", "0.7190767", "0.71782357", "0.71727574", "0.71509206", "0.7146467", "0.71239436", "0.7111...
0.7173925
16
Method to get user, pass only the context, id will be taken from url
show(context){ HTTP.get(USERS + context.$route.params.id+'/') .then((resp) => { context.user = resp.data }) .catch((err) => { console.log(err) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getUserById(id){\n return this.auth.get(`/user/${id}`,{}).then(({data})=> data);\n }", "getUser(_, { id }) {\n return db.user.findById(id);\n }", "function getUser () {return user;}", "getUser(id){\n //postDB(\"user/Get\", { \"use_id\" : id });\n return { \"name\" : \"steven\"...
[ "0.7421686", "0.74015653", "0.7394445", "0.73807", "0.73711514", "0.726187", "0.726019", "0.7244221", "0.7175981", "0.7137499", "0.7078354", "0.70715475", "0.70313776", "0.70271176", "0.7024868", "0.6983703", "0.69728607", "0.6959466", "0.69514894", "0.6951119", "0.69472104",...
0.6827066
35
Method to display all users, pass only the context
index(context){ HTTP.get(USERS) .then((resp) => { context.users = resp.data console.log(resp.data) }) .catch((err) => { console.log(err) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getallusers() {\n\n\t}", "function showAllUsers() {\r\n getUsers().then(function(result){\r\n users=[];\r\n for(var i=0;i<result.length;i++){\r\n let user = {\r\n id: result[i].ID,\r\n name:result[i].Name,\r\n currentCredit: resu...
[ "0.7185863", "0.71250296", "0.7062023", "0.7016028", "0.6998771", "0.6939878", "0.6880051", "0.684103", "0.6839279", "0.68342394", "0.6828942", "0.6828687", "0.6809471", "0.67914975", "0.6787485", "0.6786206", "0.67813253", "0.6780268", "0.67540145", "0.6743712", "0.6717198",...
0.66302425
24
Method to retrieve user, pass the context and user id, use this method when you need to edit user
retrieve(context, id){ HTTP.get(USERS + id) .then((resp) => { console.log(resp) context.usuario = resp.data.usuario; context.id = resp.data.id; }) .catch((err) => { console.log(err) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async get_user(user_id){\r\n\t\t\r\n\t\t//get user entry\r\n\t\tif(this.UsersInfo.has(user_id))\r\n\t\t\treturn this.UsersInfo.get(user_id)\r\n\t\telse \r\n\t\t\treturn this.load(user_id)\r\n\t}", "function getUserById(id) {\n // TODO: get user by id and set $scope.user to the user object. Angular wil...
[ "0.74389935", "0.71849304", "0.7164879", "0.70756245", "0.70740676", "0.7012805", "0.69251674", "0.688234", "0.68064994", "0.67880654", "0.677974", "0.6770735", "0.67553496", "0.6745734", "0.6650322", "0.6642438", "0.66398567", "0.6637054", "0.66314864", "0.6627845", "0.66239...
0.64289975
53
Function to check Player life status
isAlive() { if (this.hp > 0) { return true; } else { this.state = LOSER; return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkPlayerCondition() {\r\n\r\n\tif (player.health < 1) {\r\n\t\tplayer.lives--;\r\n\t\tplayer.initCheckpoint();\r\n\t}\r\n\r\n\tif (player.y > 1350) {\r\n\t\t\r\n\t\tSounds.yell.play();\r\n\t\tplayer.lives--;\r\n\t\tplayer.grounded = true;\r\n\t\tplayer.airborne = false;\r\n\t\tplayer.jumping = false;\r...
[ "0.6922503", "0.6683822", "0.6682566", "0.65696174", "0.6508086", "0.65034086", "0.64831626", "0.6448334", "0.6387154", "0.6367053", "0.6307061", "0.6301841", "0.6279603", "0.62718964", "0.62294996", "0.6206866", "0.6200254", "0.61880773", "0.61850685", "0.61775184", "0.61773...
0.61601657
22
Function to take damage and check damage level(a.k.a dead or alive?)
takeDamage(damage) { if (this.isPlayerAlive()) { this.hp -= damage; console.log(`${this.name} have ${this.hp} Health Points remaining.`); } else { this.state = LOSER; console.log(`${this.name} is dead :(`); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "action(type, damage) {\n const totalDamage = damage + this.player1.magicStatus();\n console.log(totalDamage + ', ' + this.player1.magicStatus());\n\n if (type === 'Attack') {\n if (this.dojoBoss.returnBossArmour() >= totalDamage) {\n this.dojoBoss.decreaseArmour(totalDamage);\n } else {\n...
[ "0.72023326", "0.72004867", "0.71565896", "0.7151993", "0.707943", "0.70436406", "0.7000108", "0.6978521", "0.6899295", "0.6873306", "0.6868125", "0.68588173", "0.6846649", "0.6844506", "0.6819691", "0.68194765", "0.67859757", "0.6759175", "0.67527014", "0.6705977", "0.670577...
0.74243003
0
Function to inflict damage
dealDamage(victim) { console.log(`${this.name} is attacking ${victim.name} and is inflicting them ${this.dmg} Points.`); if (victim.isPlayerAlive()) { victim.hp -= this.dmg; if(victim <= 0) { victim.state = LOSER; console.log(`${this.name} killed ${victim.name}. ${this.name} won 20 mana points.`); this.winMana(); } return this.dmg; } else { console.log("Player is dead. Can't run attack.") } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "damage() {}", "function ApplyDamage(damage : float) {\n\t//if the player is invincible, do not apply damage\n\tif(this.invincible) {\n\t\treturn;\n\t}\n\t\t\n}", "set damage(damage){this._damage = Utils.protectionError(\"Hero\", \"damage\");}", "static attack(attacker, defender) {\n let a = attacker.attac...
[ "0.7356317", "0.70224667", "0.70133823", "0.6839083", "0.67888325", "0.67204803", "0.66766804", "0.6652065", "0.6529668", "0.650876", "0.65002847", "0.64326906", "0.64096236", "0.64029527", "0.6395782", "0.63202643", "0.6320158", "0.6319817", "0.6283521", "0.62433195", "0.620...
0.0
-1
Reinitiate original mana points for next turn and add 20 mana points to winner
winMana() { this.mana += 20; let playerCategory; if (playerClass === 'Assassin') { if (this.mana >= 20){ this.mana = 20; } } if (playerClass === 'Berzerker') { if (this.mana > 0){ this.mana = 0; } } if (playerClass === 'Fighter') { if (this.mana >= 40){ this.mana = 40; } } if (playerClass === 'Monk') { if (this.mana >= 200){ this.mana = 200; } } if (playerClass === 'Paladin') { if (this.mana > 160){ this.mana = 160; } } return this.mana; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "regenerateMana(amountToRegenerate){\n\n //Determine maximum\n let maxToRegen = this.props.stats_current.mana - this.props.mana_points;\n\n //If trying to regenerate more than maximum, only regen up to maximum\n let appliedAmountToRegenerate = ((amountToRegenerate > maxToRegen) ? maxToRe...
[ "0.6441226", "0.6417184", "0.62204164", "0.61645633", "0.6146238", "0.6139135", "0.61323893", "0.6107404", "0.6054268", "0.6048422", "0.60111725", "0.5959677", "0.59577596", "0.59576505", "0.5947963", "0.5918017", "0.5913302", "0.5899507", "0.5897049", "0.58847034", "0.586284...
0.0
-1
Look for characters still alive during current turn
static findPlayersStillAlive() { return Character.instances.filter((player) => { player.state === "Playing"; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_checkTurnEnd() {\n let p0alive=false, p1alive=false;\n for (let i=0; i<9; i++) {\n p0alive = p0alive || !this.cells[i].isDead;\n p1alive = p1alive || !this.cells[i+9].isDead;\n }\n if (p0alive && p1alive) return (this.turn==20) ? \"draw\" : \"continue\";\n if (!p0alive && !p1alive) return...
[ "0.63246936", "0.6119891", "0.60371554", "0.5934858", "0.5876498", "0.5866204", "0.5864736", "0.58546144", "0.58289", "0.57471704", "0.5743843", "0.5732753", "0.57269746", "0.569844", "0.5692737", "0.5687309", "0.5686708", "0.56828225", "0.5671355", "0.566985", "0.5665262", ...
0.6699116
0
Select player that are still alive for next turn
static selectRandomPlayer() { let newTeamPlayers = Character.instances.filter((player) => { player.state != LOSER; }); return newTeamPlayers.sort(() => Math.random() - 0.5); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nextPlayer()\r\n{\r\n\t// check victory condition first\r\n\tif ( checkVictory() ) return;\r\n\r\n\t// if victory condition not met...\r\n\t// increment the current player id\r\n\tgame.cplayer = (game.cplayer+1)%game.players.length;\r\n\t\r\n\tUI_updateInfo();\r\n\t\t\r\n\t// start next players turn...\r\...
[ "0.65141547", "0.64890766", "0.64845914", "0.6436894", "0.6434149", "0.64063746", "0.6380243", "0.63558877", "0.6295079", "0.62878644", "0.6280197", "0.62646747", "0.6206114", "0.6193372", "0.6191427", "0.61905575", "0.61903226", "0.61745965", "0.61230934", "0.6122073", "0.61...
0.61681527
18
Define the verticies of our quad We'll never change our attribute buffer.
function CreateVertexBuffer(gl, a_vertexLoc) { var data = [ 0, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 0 ]; var buffer = gl.createBuffer(); gl.bindBuffer(gl.ARRAY_BUFFER, buffer); gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(data), gl.STATIC_DRAW); gl.vertexAttribPointer(a_vertexLoc, 2, gl.FLOAT, false, 0, 0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "set Quad(value) {}", "function Quad() { return [-1.0, -1.0, 1.0, -1.0, -1.0, 1.0, 1.0, 1.0] }", "function Quad() { return [-1.0, -1.0, 1.0, -1.0, -1.0, 1.0, 1.0, 1.0] }", "function initQuad() {\n VertexPositionBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, VertexPositionBuffer);\n ...
[ "0.7096406", "0.6933232", "0.6933232", "0.6859379", "0.6772175", "0.6772175", "0.66159856", "0.6610996", "0.655981", "0.6474144", "0.6464176", "0.6403607", "0.6381805", "0.6355871", "0.6343511", "0.62973905", "0.62324405", "0.622852", "0.61815244", "0.6123148", "0.6118742", ...
0.0
-1
Load all of our pictures and dynamically create a "spritesheet"
function CreateTextureSheet() { Game.ImagesLoading = 0; for (var k = 0; k < 10; k++) { LoadImage(k); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadSprites() {\n Loader.add(\"assets/imgs/resize1.png\")\n .add(\"assets/imgs/resize2.png\")\n .add(\"assets/imgs/colorize.png\")\n .add(\"assets/imgs/rotate.png\")\n .add(\"assets/imgs/select.png\")\n .add(\"assets/imgs/win.png\")\n .add(\"assets/imgs/logo.png\")\n .add(\"assets/im...
[ "0.7913093", "0.7898924", "0.7677867", "0.76309574", "0.7600437", "0.7583754", "0.752579", "0.7466247", "0.74287003", "0.74211764", "0.7367024", "0.72622496", "0.7253688", "0.72454304", "0.7243055", "0.72299415", "0.7176738", "0.71087354", "0.7082836", "0.7068529", "0.7059427...
0.73749536
10
computes scores from the current state and updates this.state.gameState.scores
computeRoundScores() { //the only score guaranteed to match the gameState (which may have changed) is the latest one const roundNumber = this.state.gameState.roundNumber; const threshold42 = this.state.gameState.threshold42 || 999; for (var playerNumber in this.state.players) { var game = this.state.gameState[this.props.players[playerNumber].playerName]; var score = getCurrentScore(game.bids, game.takes, game.scores, roundNumber-1); game.scores[roundNumber-1] = score; this.state.players[playerNumber].currentScore = score; this.state.players[playerNumber].isPerfect = countArrayPrefix(game.bids, game.takes, roundNumber) === roundNumber; this.state.players[playerNumber].deny42 = countArrayPrefix(game.bids, game.takes, roundNumber, threshold42) !== roundNumber; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateScores() {\n dealerScore = getScore(dealerCards);\n playerScore = getScore(playerCards);\n}", "updateTotalScore() {\n this.score =\n this.calculatedRedScore +\n this.calculatedYellowScore +\n this.calculatedGreenScore +\n this.calculatedBlueScore -\n this.penaltyScore...
[ "0.7241206", "0.7224311", "0.72017896", "0.718606", "0.7126581", "0.69735664", "0.6927754", "0.690783", "0.6812681", "0.67217547", "0.666672", "0.66367966", "0.663598", "0.66267884", "0.6622281", "0.6618694", "0.66118103", "0.66113436", "0.66086674", "0.66013217", "0.6596887"...
0.7748322
0
Almost the same logic as the bid page. Have each one RecordTrick component per player be responsible for updating the number of tricks they've taken. Once the round ends, do some processing to compute scores, then send it to Firebase.
render() { const gameState = this.state.gameState; const players = this.state.players; const numPlayers = players.length; const dealerNumber = (gameState.roundNumber -1) % numPlayers; let firstLeader = -1; let highestBid = -1; for(let i = 0; i < numPlayers; i++) { const playerNum = (dealerNumber + i + 1) % numPlayers; //if a trick was taken, don't show the first leader anymore if(gameState[players[playerNum].playerName].takes[gameState.roundNumber-1] > 0) { firstLeader = -1; break; } const bid = gameState[players[playerNum].playerName].bids[gameState.roundNumber-1]; if (bid > highestBid) { highestBid = bid; firstLeader = playerNum; } } const takeTrickButtons = players.map((player) => ( <div key={player.playerNumber}> <hr /> <RecordTricks updateTake={this.updateTake.bind(this)} playerName={player.playerName} currentScore={gameState[player.playerName].scores[gameState.roundNumber-2]} currentBid={gameState[player.playerName].bids[gameState.roundNumber-1]} currentTake={gameState[player.playerName].takes[gameState.roundNumber-1]} isFirstLeader={firstLeader === player.playerNumber} isPerfect={player.isPerfect} deny42={player.deny42} roundNumber={gameState.roundNumber} /> </div> )); const totalBids = players.map(p => gameState[p.playerName].bids[gameState.roundNumber-1] || 0).reduce((a,b)=>a+b, 0); const totalTricks = players.map(p => gameState[p.playerName].takes[gameState.roundNumber-1]).reduce((a,b)=>a+b, 0); const roundBalance = totalBids - gameState.roundNumber; const numRounds = getNumberOfRounds(this.props.players.length); const canEndRound = gameState.roundNumber != numRounds && totalTricks === gameState.roundNumber; const canEndGame = gameState.roundNumber == numRounds && totalTricks === gameState.roundNumber; const debugMessage = gameState.isDebug ? "(DEBUG)" : ":"; return ( <div> <div> {roundBalance < 0 && <div className='roundBalance roundBalance-under'>{-roundBalance} under</div>} {roundBalance > 0 && <div className='roundBalance roundBalance-over'>{roundBalance} over</div>} <h2> Round: {gameState.roundNumber} {debugMessage} </h2> <div className="vertDivider"/> {takeTrickButtons} <hr /> <div className="vertDivider"/> { canEndRound && <button onClick={this.endRound.bind(this)}> End Round </button> } { canEndGame && <button onClick={this.endGame.bind(this)}> End Game </button> } <button onClick={this.showGameSummaryModal.bind(this)}> Summary </button> </div> <div className="game-summary-modal"> <GameSummaryModal players = {this.state.players} gameState={this.state.gameState} show={this.state.showGameSummaryModal} onClose={this.hideGameSummaryModal.bind(this)} /> </div> </div> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "increment(event) {\n let minutesBooked = 0;\n let minutesBookedElement = null;\n\n this.minutesBookedTargets.forEach((element) => {\n // storing data on the parent element so that actions and targets could get access to it\n if (element.parentNode.dataset.gameId == event.currentTarget.parentNode...
[ "0.60268193", "0.59536546", "0.5922168", "0.5896906", "0.56913334", "0.5687822", "0.56279933", "0.5603824", "0.5603136", "0.5560007", "0.55497855", "0.55475426", "0.5542796", "0.5521779", "0.55152464", "0.55133986", "0.55011845", "0.5479374", "0.54712886", "0.5469829", "0.545...
0.6856156
0
function remove "?embed=true" parameter from url
function urlWithoutEmbed() { if (window.location.href.includes("?embed=true&")) { return window.location.href.replace("embed=true&", ""); } else if (window.location.href.includes("?embed=true")) { return window.location.href.replace("?embed=true", ""); } if (window.location.href.includes("&embed=true")) { return window.location.href.replace("&embed=true", ""); } return window.location.href }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function maskQueryStringInURL(url) {\n url = url || '';\n return url.replace(/\\?.*?$/, '');\n}", "removeQuery(url) {\n return url ? url.replace(/\\?.*$/, '') : '';\n }", "removeParamFromURL(event) {\n if (this.props.showArticleFinder) { return; }\n const viewer = document.getElementsByClassN...
[ "0.6478938", "0.63223934", "0.6218399", "0.61243033", "0.6056966", "0.6049975", "0.6004344", "0.6001671", "0.5942131", "0.59209603", "0.5764331", "0.5728614", "0.56769824", "0.56652665", "0.566285", "0.56578565", "0.5643513", "0.56309515", "0.56294805", "0.56294805", "0.56287...
0.8691991
0
This lets use use d3.scale.time for a nice time interval scale.
function secondsToRefDate(secs) { return new Date(2012, 0, 1, 0, 0, secs); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function timeFormat(ms) {\r\n\tif (ms > 3600000) {\r\n\t\treturn d3.utcFormat(\"%H:%M:%S\")(new Date(ms));\r\n\t}\r\n\tif (ms > 60000) {\r\n\t\treturn d3.utcFormat(\"%M:%S.%L\")(new Date(ms));\r\n\t}\r\n\treturn d3.utcFormat(\"%S.%L\")(new Date(ms));\r\n}", "function render(data) {\n // different scales depen...
[ "0.6303957", "0.6292558", "0.6014297", "0.5919765", "0.58890843", "0.5887953", "0.58635724", "0.5834182", "0.5834182", "0.58336806", "0.5822177", "0.5762679", "0.56953883", "0.56509095", "0.56509095", "0.56509095", "0.56509095", "0.56509095", "0.56509095", "0.5629078", "0.555...
0.0
-1
(throttling, 1000ms not out yet) when 1000 ms time out... ...outputs 3, intermediate value 2 was ignored
function throttle(func, ms) { let isThrottled = false, savedArgs, savedThis; function wrapper() { if (isThrottled) { // (2) savedArgs = arguments; savedThis = this; return; } func.apply(this, arguments); // (1) isThrottled = true; setTimeout(function() { isThrottled = false; // (3) if (savedArgs) { wrapper.apply(savedThis, savedArgs); savedArgs = savedThis = null; } }, ms); } return wrapper; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function timersweep() {\n let t0, t1 = timerqueueHead, time = Infinity;\n\n while (t1) {\n if (t1.f) {\n t1 = t0 ? t0.n = t1.n : timerqueueHead = t1.n;\n } else {\n if (t1.t < time) {\n time = t1.t;\n }\n t1 = (t0 = t1).n;\n }\n }\n timerqueueTail = t0;\n return time;\n}", ...
[ "0.5584466", "0.5569967", "0.55487597", "0.5526954", "0.55195343", "0.5504583", "0.5464044", "0.5452678", "0.54485244", "0.54454446", "0.54083604", "0.5398492", "0.5378185", "0.53728503", "0.5308329", "0.530411", "0.5303797", "0.5294422", "0.52921295", "0.5291942", "0.5266328...
0.0
-1
returns some "handler object" that has .close() method and emits 'connection' event
function listen (stream_url, options, callback) { if (options && options.constructor===Function) { callback = options; options = undefined; } var u = url.parse(stream_url.toString()); var proto = u.protocol.substr(0, u.protocol.length-1); var adaptor = adaptors[proto]; if (!adaptor) { throw new Error('protocol unknown: '+u.protocol); } return adaptor.listen(u, options, callback); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function closeHandler() {\n eventHandler.emit('startRead');\n}", "function emitClose() {\n socket.emit(\"close\");\n}", "function getCloser(connection)\n\t{\n\t\treturn function(callback)\n\t\t{\n\t\t\tconnection.end(callback);\n\t\t};\n\t}", "function handleClose(){\n\n console.log('[SOCKET] - CLOS...
[ "0.6754185", "0.64962906", "0.64600635", "0.6403356", "0.6273734", "0.61808014", "0.6180456", "0.6160751", "0.6160751", "0.6160751", "0.6158082", "0.6147628", "0.6147628", "0.6147628", "0.6147628", "0.6147628", "0.61403173", "0.61403066", "0.61403066", "0.61289436", "0.610028...
0.0
-1
returns a stream, either immediately or through the callback
function connect (stream_url, options, callback) { if (options && options.constructor===Function) { callback = options; options = undefined; } var u = url.parse(stream_url.toString()); var proto = u.protocol.substr(0, u.protocol.length-1); var adaptor = adaptors[proto]; if (!adaptor) { throw new Error('protocol unknown: '+u.protocol); } return adaptor.connect(u, options, callback); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "createStream () {\n\n }", "getStream(url, callback) {\n var stream;\n if (url.startsWith('http')) {\n return request.get(url).on('response', function(res) {\n if (res.headers['content-type'] === 'audio/mpeg') {\n return callback(res);\n } else {\n self.em...
[ "0.69684416", "0.6697496", "0.649594", "0.64256966", "0.6297833", "0.6272961", "0.6232723", "0.6209701", "0.6203551", "0.6202945", "0.6165016", "0.61540854", "0.6143595", "0.6141776", "0.61142117", "0.6018327", "0.60158896", "0.6010273", "0.6007689", "0.59725046", "0.59573394...
0.0
-1
This is our generic mouse move handler. PaperJS doesn't give us a simple mouse event for each object so we need to map the generic events to our specific object. This handles mouseover and mouseout events.
function onMouseMove(event) { var hitResult = project.hitTest(event.point, rel.hitOptions); if (hitResult && hitResult.item && hitResult.item.rel) { if (rel.currentItem === hitResult.item) { return; } else { if (rel.currentItem) { rel.currentItem.rel.mouseout(); rel.currentItem = null; } rel.currentItem = hitResult.item; rel.currentItem.rel.mouseover(); } } else { /* * This is mouse out */ if (rel.currentItem) { rel.currentItem.rel.mouseout(); rel.currentItem = null; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onElementMouseMove(event) {}", "mouseMoveGeneralHandler () {\n this.raycaster.setFromCamera(this.mouse, this.camera);\n\n // Check if the user mouses over a strand arrow\n this.intersects = this.raycaster.intersectObjects(this.strandArrows);\n\n if (this.intersects.length) {\n this.hoveredStrand...
[ "0.6958642", "0.69252837", "0.6903783", "0.6833184", "0.6817881", "0.68149614", "0.6785755", "0.6744116", "0.6695063", "0.6695063", "0.6685408", "0.66851974", "0.6675137", "0.66101855", "0.6554682", "0.652512", "0.6519885", "0.6519761", "0.6486477", "0.64525104", "0.64495045"...
0.62737924
31
Click events are easier. We just find the item which was under the mour when the button was released and call its click function.
function onMouseUp(event) { var hitResult = project.hitTest(event.point, rel.hitOptions); if (hitResult && hitResult.item && hitResult.item.rel) { hitResult.item.rel.click(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onClick(event) {\n const itemElement = event.target.closest(this.itemSelector);\n\n if (itemElement) {\n this.onItemClick(itemElement, event);\n }\n }", "onClick(event) {\n const itemElement = event.target.closest(this.itemSelector);\n\n if (itemElement) {\n this.onItemClick(itemElement...
[ "0.70126", "0.70126", "0.68131447", "0.68069285", "0.67297256", "0.6706524", "0.66946656", "0.6672447", "0.66382396", "0.6607907", "0.6607907", "0.6582985", "0.6582985", "0.65322304", "0.6490514", "0.64811903", "0.64605725", "0.6445495", "0.6435166", "0.64182645", "0.6387842"...
0.6281986
26
Write a function that accepts a string. The function should capitalize the first letter of each word in the string then return the capitalized string. Examples capitalize('a short sentence') > 'A Short Sentence' capitalize('a lazy fox') > 'A Lazy Fox' capitalize('look, it is working!') > 'Look, It Is Working!'
function capitalize(str) { let result = str[0].toUpperCase(); for (let i = 1; i < str.length; i++) { if (str[i-1] === ' ') { result += str[i].toUpperCase(); } else { result += str[i]; } } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function capitalizeWord(string) {\n \n // Should take a string of one word, and return the word with its first letter capitalized\n return string[0].toUpperCase() + string.substring(1, string.length);\n \n}", "function capitalize(string) {\n if (string.indexOf(\" \") !== -1) {\n var arr =...
[ "0.8286303", "0.8236763", "0.82224137", "0.8193967", "0.8187306", "0.81804687", "0.8171213", "0.81708187", "0.81483495", "0.81393105", "0.8133485", "0.81141996", "0.8113782", "0.8111276", "0.8096858", "0.80950826", "0.80911434", "0.8087885", "0.80708635", "0.80676126", "0.806...
0.0
-1
XXX dead code removal broke this
function canComplete() { return state.accounts.data.email && state.accounts.data.personId; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "protected internal function m252() {}", "private public function m246() {}", "transient private protected internal function m182() {}", "transient protected internal function m189() {}", "transient private internal function m185() {}", "transient final protected i...
[ "0.7560008", "0.7384083", "0.73804635", "0.72823244", "0.7132312", "0.7028051", "0.7015289", "0.67277634", "0.6724852", "0.6717013", "0.6712795", "0.65816325", "0.6543048", "0.6522552", "0.64880705", "0.6472956", "0.639889", "0.628974", "0.62314", "0.6204026", "0.6192816", ...
0.0
-1
Take a potentially misbehaving resolver function and make sure onFulfilled and onRejected are only called once. Makes no guarantees about asynchrony.
function doResolve(fn, self) { var done = false; try { fn(function (value) { if (done) return; done = true; resolve(self, value); }, function (reason) { if (done) return; done = true; reject(self, reason); }); } catch (ex) { if (done) return; done = true; reject(self, ex); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function doResolve(fn, onFulfilled, onRejected) {\n var done = false;\n try {\n fn(function (value) {\n if (done) return;\n done = true;\n onFulfilled(value);\n }, function (reason) {\n if (done) return;\n done = true;\n onRejected(reaso...
[ "0.70784545", "0.7072046", "0.70421326", "0.7040046", "0.7040046", "0.7040046", "0.7032287", "0.7031542", "0.7031542", "0.7031542", "0.7031542", "0.7031542", "0.7014892", "0.6960407", "0.6960407", "0.6960407", "0.6960407", "0.6807936", "0.6281461", "0.6168566", "0.6023019", ...
0.56682354
62
Initializes the fields of this object. This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mixins). Only for internal use.
static initialize(obj, name, photoUrls) { obj['name'] = name; obj['photoUrls'] = photoUrls; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor() {\n super();\n this._init();\n }", "init() {\n this._super(...arguments);\n this._applyDefaults();\n }", "_init() {\n\t\tthis.life.init();\n\t\tthis.render.init();\n\n\t\tthis.emission.init();\n\t\tthis.trail.init(this.node);\n\n\t\tthis.color.init();\n\t}", "function Co...
[ "0.71308", "0.6962521", "0.6813377", "0.67452186", "0.67150044", "0.66416204", "0.6633205", "0.6601199", "0.65798515", "0.65623814", "0.64090466", "0.6405055", "0.63343316", "0.6303729", "0.62963045", "0.62827903", "0.62684494", "0.6239129", "0.62390757", "0.62344384", "0.623...
0.0
-1
function to show list of products
function showProducts(json_url) { if (!json_url) return; // get list of products from the API $.getJSON(json_url, function (data) { // html for listing products readProductsTemplate(data, ""); // chage page title changePageTitle("Read Products"); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function viewProducts() {\n clearConsole();\n connection.query(\"SELECT * FROM products\", function (err, response) {\n if (err) throw err;\n displayInventory(response);\n userOptions();\n })\n}", "function viewProducts(){\n\n\t// Query: Read information from the products list\n\tco...
[ "0.8138618", "0.8052649", "0.7848163", "0.7807099", "0.77878237", "0.77833104", "0.77169317", "0.7664556", "0.76641315", "0.7656294", "0.7620802", "0.7610547", "0.76052195", "0.755264", "0.75510865", "0.752558", "0.7524121", "0.75157976", "0.7497201", "0.742989", "0.7418826",...
0.70844436
54
props title: String title clues: [ Clues clues, ... ]
render() { return ( <div className='clue-holder'> <h3>{this.props.title}</h3> <ol> { this.props.clues.map( (clue, i) => <Clue key={ i } focus={ this.props.clueRow == clue.row && this.props.clueColumn == clue.column && this.props.activeDirection == clue.direction } { ...clue } /> ) } </ol> </div> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function formatClues(clues) {\n\t\t\t\tvar retString = \"\";\n\t\t\t\tfor (var i = 0; i < clues.length; i++) {\n\t\t\t\t\tif (clues[i] !== \"\") {\n\t\t\t\t\t\tretString += \"> \" + clues[i] + \"\\n\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn retString;\n\t\t\t}", "function Title(props) {\n console.log(props);\n...
[ "0.5716944", "0.5708059", "0.5614883", "0.54379416", "0.5418277", "0.5367529", "0.53633493", "0.52741313", "0.52683353", "0.5211896", "0.52099293", "0.5188617", "0.5142402", "0.5134222", "0.5080467", "0.506606", "0.5058827", "0.5051715", "0.50195175", "0.50194335", "0.5015189...
0.49970978
23
increased with the given book price and remove parent
function buttonBuyEvent() { sumAllMoney += Number($(this).text().match(/\d+\.\d+/g)[0]); $('h1:eq(1)').text(`Total Store Profit: ${sumAllMoney} BGN`) $(this).parent().remove() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteItem(obj, category, price) {\n var idx = obj.tabIndex;\n var div = document.getElementById(category);\n var nodes = div.childNodes;\n var itemP = parseFloat(nodes[idx].getAttribute(\"price\")).toFixed(2);\n\n if (itemP > price) {\n nodes[idx].setAttribute(\"price\", itemP - price);\n var ...
[ "0.63764364", "0.62728", "0.6121901", "0.61014324", "0.60415024", "0.60409045", "0.5965791", "0.59542316", "0.57475066", "0.56899923", "0.5689891", "0.56670296", "0.5666331", "0.5660913", "0.5656683", "0.56531686", "0.56417906", "0.5633309", "0.56284803", "0.5608721", "0.5589...
0.509282
98
moved from the new books section to the old books section.
function buttonMoveEvent(e) { let getPrice = $(this).prev().text().match(/\d+\.\d+/g)[0] $(this).prev().text(`Buy it only for ${(getPrice * 0.85).toFixed(2)} BGN`) $oldBooksSection.append($(this).parent()) $(this).remove() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "moveTo(shelf, book) {\n // we update the status of the books\n BooksAPI.update(book, shelf).then(() => {\n this.fetchBooks();\n });\n }", "function move_books_between_lists(old_list, new_list, book_title){\n for (var i = 0; i < old_list.length; i++){\n if (old_list[i][\"book_title\"] == ...
[ "0.607682", "0.6066685", "0.603767", "0.6022925", "0.5861498", "0.58340627", "0.5763548", "0.57497007", "0.57463616", "0.57012933", "0.56788296", "0.5678186", "0.566025", "0.566025", "0.5647908", "0.55991626", "0.55944294", "0.5585154", "0.5569484", "0.5551819", "0.5549817", ...
0.0
-1
Mouseover function to fade chords
function mouseover(d, i) { chord.classed("fade", function(p) { return p.source.index != i && p.target.index != i; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mouseover(d, i) {\n chord.classed('fade', function(p) {\n return p.source.index != i && p.target.index != i;\n });\n }", "function mouseOn() {\n $(this).fadeTo(20,1);\n }", "function mouseover(d, i) {\n chord.transition...
[ "0.735987", "0.7315627", "0.71498156", "0.69519866", "0.6897097", "0.6749533", "0.67389995", "0.65818816", "0.6567849", "0.6518331", "0.6455477", "0.64237785", "0.6420958", "0.64196914", "0.64196914", "0.6408425", "0.6407685", "0.640569", "0.64036644", "0.63735694", "0.637356...
0.728012
2
Clickers & Pass to PV selection and highlight
function group_click(d, i) { // Single Residue var resViewName = 'pickedRes_' + nodes[i].seg + nodes[i].resi pickedRes = window.structure.select({ chain: nodes[i].seg, rnum: nodes[i].resi }) if (viewer.get(resViewName) === null) { viewer.ballsAndSticks(resViewName, pickedRes); d3.select("#group" + i) .classed("highlight", true); } else { // Hide Spheres viewer.rm(resViewName); // Highlight Group d3.select("#group" + i) .classed("highlight", false); } viewer.requestRedraw(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "mouseClick(p) {\n }", "function clickProc(d, textclicked) {\n \n if (CheckSelectionClick()) {\n return;\n } //exit function if it was a panning click, instead of a selection click\n \n \n if (d.expertise_intern) {//zuklappen\n d._expertise_intern = d.expertise_intern;\n ...
[ "0.63947594", "0.6387656", "0.6298107", "0.62438524", "0.62195814", "0.6207204", "0.616908", "0.616908", "0.6158776", "0.6148406", "0.6116233", "0.6107618", "0.6105225", "0.60965323", "0.60965323", "0.60965323", "0.60965323", "0.6081099", "0.60737526", "0.6067152", "0.6057117...
0.0
-1
Transitions TODO Ramp TODO Function to scale raw data Scales each data point to the % of total absolute energy This means both highly favourable and unfavourable values will have similar percentages Sort out between them using color.
function scale_data(mtx) { var _abs_array = mtx.map(function(subArray) { return subArray.map(function(el) { return Math.abs(el) }) }) var _abs_total_ene = d3.sum(_abs_array.map(function(subArray) { return d3.sum(subArray) })) var _scaled_array = mtx.map(function(subArray) { return subArray.map(function(el) { return (Math.abs(el) / _abs_total_ene) }) }) var _flattened_raw_array = [].concat.apply([], mtx) var _flattened_scaled_array = [].concat.apply([], _scaled_array) var _mapping = [] for (var i = 0; i < _flattened_raw_array.length; i++) { _mapping[_flattened_scaled_array[i]] = _flattened_raw_array[i] } return [_scaled_array, _mapping] }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeColorScale(data){\n\n var colorScale=d3.scale.quantile()//use quantile for scale generator\n .range(objectColors[expressed]);//incorporate objectColors array to change depending on variable\n\n//creating equal interval classifcation\n var minmax = [\n d3.min(data, function(d) { re...
[ "0.6359075", "0.61668444", "0.61649287", "0.61486435", "0.61207885", "0.61167806", "0.60648435", "0.6060987", "0.6026693", "0.599695", "0.598829", "0.5969576", "0.5960287", "0.590953", "0.58693135", "0.58676225", "0.5862624", "0.5840806", "0.5821923", "0.5808932", "0.58082294...
0.0
-1
Build color scale from energy values
function get_color_scale(mtx) { var _flattened_array = [].concat.apply([], mtx) var extremes = d3.extent(_flattened_array) var c = d3.scale.linear() .domain([extremes[0], 0, extremes[1]]) // .range(["blue", "white", "red"]) // Flat .range(["#138BFF", "#fff", "#FF0007"]) // Vivid // .range(["#356089", "#fff", "#D1464A"]) // Pastel return c }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_createColorScale() {\n\t\t\treturn new d3.scaleSequential((t) => {\n\t\t\t\t//const saturation = t * 0.2 + 0.4; // 50–60%\n\t\t\t\tconst saturation = 0.7;\n\t\t\t\tconst lightness = (1 - t) * 0.6 + 0.4; // 30–80%\n\t\t\t\t//const lightness = 0.5;\n\t\t\t\t// Hue needs values between 40 and 90\n\t\t\t\tconst hue =...
[ "0.73159134", "0.7102787", "0.70865196", "0.6956765", "0.6922303", "0.69118196", "0.69102824", "0.69102377", "0.69013095", "0.6890672", "0.6846617", "0.6777873", "0.6760269", "0.6717097", "0.6701262", "0.66768765", "0.6581931", "0.6575383", "0.6536377", "0.651751", "0.648503"...
0.6724549
13
Iterate all the elements from json file
function storeData( p_obj ) { var i; this.elements = p_obj.elements; for( i in this.elements ) { addElem.call( this, this.elements[ i ] ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function collectFromElements(json, files) {\n for (let i = 0; i < json.length; i++) {\n let element = json[i];\n traverse(element.content, contentElement => {\n getFilesFromElement(contentElement, files);\n });\n\n getFilesFromElementPreview(element, files);\n }\n}", ...
[ "0.64651614", "0.6391489", "0.606283", "0.5993646", "0.5979594", "0.5844648", "0.57586014", "0.5753392", "0.57514536", "0.5745576", "0.5735031", "0.5718338", "0.5716168", "0.57099473", "0.5670515", "0.56516135", "0.56331366", "0.5625763", "0.56168103", "0.5610128", "0.5606457...
0.0
-1
Adds All elements to the firebase DB
function addElem( p_obj ) { firebase.database().ref( '/elements/' + p_obj[ 'name' ] ).set({ "proton": filterString( p_obj[ 'proton' ] ), "Symbol": filterString( p_obj[ 'Symbol' ] ), "name": filterString( p_obj[ 'name' ] ), "type": filterString( p_obj[ 'type' ] ), "block": filterString( p_obj[ 'block' ] ), "boilingPoint": filterString( p_obj[ 'boilingPoint' ] ), "Electronegativity": filterString( p_obj[ 'Electronegativity' ] ), "Density": filterString( p_obj[ 'Density' ] ), "AtomicMass": filterString( p_obj[ 'AtomicMass' ] ), "IonizationEnergy": filterString( p_obj[ 'IonizationEnergy' ] ), "AtomicRadius": filterString( p_obj[ 'AtomicRadius' ] ), "AtomicRadius_InPicometers": filterString( p_obj[ 'AtomicRadius_InPicometers' ] ), "MeltingPoint": filterString( p_obj[ 'MeltingPoint' ] ), "ElementColor": filterString( p_obj[ 'ElementColor' ] ) }); console.log( 'data is added to firebase.' ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pushData(){\n database.ref('bets/').push({\n Name: betName,\n Friends: addFriends,\n Bet: gameBet,\n Wager: numberOfSlaps,\n dateAdded: firebase.database.ServerValue.TIMESTAMP\n });\n}", "function addToDatabase() {\n if (!hasError) {\n c...
[ "0.7114251", "0.7013014", "0.6804755", "0.6747807", "0.6706552", "0.6679208", "0.6547496", "0.64493847", "0.64470834", "0.6427676", "0.6422186", "0.64172506", "0.64064556", "0.6403986", "0.6401505", "0.6373045", "0.63543284", "0.6346126", "0.6345196", "0.6339694", "0.6335454"...
0.66379184
6
Hides all elements excluding provided className
function hideAll() { let frames = document.getElementsByClassName("frame"); for (let i = 0; i < frames.length; i++) { frames[i].style.display = "none" } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hideByClassName (className) {\n\tvar elements = document.getElementsByClassName(className)\n\tfor (var i = 0; i < elements.length; i++) {\n\t\telements[i].style.display = 'none'\n\t}\n// return document.getElementsByClassName(className).length.style.display = \"none\";\n}", "function hide_elements_wit...
[ "0.7701808", "0.7678816", "0.7587907", "0.7335602", "0.71089745", "0.68852794", "0.67839706", "0.67716134", "0.6757388", "0.67388594", "0.6737931", "0.67102844", "0.6690607", "0.66851383", "0.66607356", "0.66527903", "0.6636133", "0.6628762", "0.662547", "0.6616178", "0.66161...
0.0
-1
Handler for new Kafka messages. Writes all new messages to app.lo
function dataHandler(messageSet) { messageSet.forEach( (m) => { console.log(m.message.value.toString('utf8')) co(fs.appendFile('app.log', m.message.value.toString('utf8') + '\r\n')) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onReceivedMessage(messages) {\n this._storeMessages(messages);\n }", "function onMessageArrived(message) {\n console.log(message);\n console.log(\"database\");\n //this condtion is accept greater than 100\n //if true it will call sendXml function\n //this c...
[ "0.58614504", "0.579827", "0.5792275", "0.5753699", "0.57123816", "0.5588394", "0.55401254", "0.5508094", "0.5482992", "0.5453257", "0.54329616", "0.5431964", "0.54116774", "0.54076606", "0.5376311", "0.5330562", "0.52975893", "0.5276933", "0.52520925", "0.52004814", "0.51854...
0.5258157
18
Async wrapper for co_log
function log(msg) { co(co_log(msg)) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function logCars(cars){\n console.log(cars);\n\n var car = cars.pop();\n\n //the async function logCar() is called\n logCar(car, function(){\n //the logCars() function is used as the callback when logCar() completes\n logCars(cars);\n }); \n}", "async function logRequest($){\n\tlogging.winston.info(ne...
[ "0.6192786", "0.6092507", "0.60654056", "0.598227", "0.59743094", "0.59237766", "0.5912073", "0.5880962", "0.58527684", "0.5819817", "0.5817359", "0.573304", "0.5706651", "0.5705274", "0.567159", "0.5623884", "0.5577558", "0.555967", "0.5557964", "0.55289286", "0.55261874", ...
0.59027123
7
Hide the modal dialog
function hideModal(modal) { $("#flex-overlay").css({ 'display': 'none', opacity: 0 }); if (typeof modal == 'string') modal = $(modal); modal.css({ "display": "none" }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "hide(){\n\t\tthis.modalShadow.hide();\n\t\tthis.modalBody.hide();\n\t}", "function hideModal() {\n vm.modalVisible = false;\n }", "function hideModal() {\n vm.modalVisible = false;\n }", "function hideThisModalDialog(hideDialog) {\n\thideDialog();\n}", "hide(){\n\t\t...
[ "0.80906236", "0.7920762", "0.7920762", "0.78558594", "0.7843421", "0.78368676", "0.7753049", "0.7741022", "0.76053923", "0.7509544", "0.74288785", "0.73939824", "0.7371251", "0.7366744", "0.7360812", "0.7333456", "0.73315054", "0.73315054", "0.7290878", "0.7258829", "0.72254...
0.0
-1
Create function that stores Points to dashboard
function displayPointsDashBoard(data){ const html = ` <ul class="statistics"> <li class="statistics__entry"> <p class="statistics__entry-description" >Current Points</p> <span class="statistics__entry-quantity">${data}</span> </li> </ul>`; const renderPoints = document.getElementById('points') renderPoints.innerHTML = html return html }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addPoint(){\n trackingFB.push({\n latitud:localStorage.getItem(\"latitud\"),\n longitud:localStorage.getItem(\"longitud\")\n })\n }", "function displayPoints(){\n console.log(pointMap);\n console.log(payerPointLog);\n}", "function save_points() {\r\n ...
[ "0.7021911", "0.65076137", "0.6428545", "0.64121526", "0.6320536", "0.6286854", "0.61808246", "0.6122103", "0.6103436", "0.6007058", "0.59909797", "0.5986229", "0.59777665", "0.5960849", "0.5957555", "0.5912277", "0.58642143", "0.5859838", "0.5832224", "0.58268404", "0.581407...
0.5527698
40
create function to display user name
function displayName(user) { const html = `<br><br> <h1>${user.first_name} ${user.last_name}</h1> `; const display = document.getElementById('display-name') display.innerHTML = html return html }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function printName(user){\n console.log(`this user name is ${user.name}`);\n}", "name(userId) {\n if (userId) {\n // find user from user id\n let user = Meteor.users.findOne(userId, {fields: {'username': 1}});\n // return username\n return user ? `@${user.username}`: '';\n }\n }", ...
[ "0.7669555", "0.75255054", "0.7504474", "0.746876", "0.7402384", "0.7401643", "0.7380194", "0.73773277", "0.7375305", "0.7354512", "0.7354015", "0.7319043", "0.7300438", "0.7293123", "0.72905713", "0.72873056", "0.7276611", "0.7259597", "0.72451913", "0.72451913", "0.72451913...
0.75488657
1
Returns a random number between min (inclusive) and max (exclusive)
function getRandomInteger(min, max) { return Math.floor(Math.random() * (max - min) + min); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getRandomIntEx(min, max) {//max not inclusive\r\n return Math.floor(Math.random() * (max - min)) + min;\r\n}", "function getRandomNumber(min, max) {\n return (Math.random() * (+max - +min) + min);\n }", "function randomInclusive(min, max){\r\n\treturn Math.floor(Math.random() * (max - min + 1))...
[ "0.88785905", "0.87791955", "0.87685573", "0.8755253", "0.87487763", "0.8747502", "0.8747502", "0.874279", "0.8741016", "0.8732886", "0.87133825", "0.87099284", "0.8706377", "0.8698992", "0.8696441", "0.86932945", "0.86810774", "0.8680161", "0.8673529", "0.8673529", "0.867303...
0.0
-1
================================================================================================ ========================================== WEBSOCKETS ========================================== ================================================================================================ Creates a new websocket connection to the server.
function createWebSocket() { var old = gSocket; if (old !== null && old.readyState === WebSocket.OPEN) return; useWebSocket(new WebSocket("ws://" + window.location.host + "/ws/")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "createSocket () {\n this.ws = new WebSocket(this.getEndpoint())\n }", "function createWebSocket() {\n var ws = new WebSocket(channelUrl+\"?token=\"+self.token + queryParam);\n ws.onopen = function() {\n // reset the tries back to 1 since we have a new connection opened.\n ...
[ "0.8206566", "0.777753", "0.74776375", "0.7475257", "0.7475257", "0.7475257", "0.7475257", "0.7475257", "0.743022", "0.743022", "0.7280924", "0.72731376", "0.7227185", "0.71977884", "0.7188435", "0.71748084", "0.7173974", "0.71661603", "0.7163815", "0.71573037", "0.7153191", ...
0.8253882
0
Closes the websocket connection.
function closeWebSocket() { var socket = gSocket; if (socket === null) return; socket.close(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function close() {\n\t\tif (mWebSocket) {\n\t\t\tconsole.log('Client socket: Closing');\n\t\t\tmWebSocket.close();\n\t\t}\n\t}", "function _wsClose() {\n _self.connected = false;\n _self.emit('disconnect');\n _clearPingPong();\n if (_retry === true) {\n log.debug(LOG_PREFIX, `Will retry in 3 sec...
[ "0.7789422", "0.75805116", "0.73896027", "0.7157365", "0.7152189", "0.7085369", "0.70610225", "0.70610225", "0.7053792", "0.7053746", "0.7053746", "0.6996932", "0.69938695", "0.69938695", "0.69856805", "0.6980813", "0.6980813", "0.6960279", "0.6940485", "0.6919743", "0.691584...
0.76935095
1
Method to use the given socket as the WebSocket connection to the server.
function useWebSocket(socket) { socket.onopen = handleSocketOpen; socket.onclose = handleSocketClose; socket.onerror = handleSocketError; gSocket = socket; socket.onmessage = handleSocketMessage; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "createSocket () {\n this.ws = new WebSocket(this.getEndpoint())\n }", "function setupSocket(socket) {\n\n socket.onopen = function () {\n connectedToWS = true\n }\n\n socket.onmessage = function (msg) {\n connectionSketch.showServerResponse(msg.data)\n }\n\n socket.onclose = func...
[ "0.7205808", "0.71387035", "0.6904389", "0.6766441", "0.67275095", "0.66992855", "0.66890585", "0.6675163", "0.66636205", "0.66358757", "0.6586775", "0.65610963", "0.65578604", "0.65536785", "0.6551787", "0.65481424", "0.6541749", "0.6508997", "0.64851314", "0.64622676", "0.6...
0.83537537
0
Checks if the websocket is usable.
function isSocketOpen() { var socket = gSocket; return socket !== null && socket.readyState === WebSocket.OPEN; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function websocket_check() {\n return window.WebSocket;\n}", "function isWebSocketSupported() {\n if(typeof isWebSocketSupported.value === 'undefined' || isWebSocketSupported.value === null) {\n isWebSocketSupported.value = ('WebSocket' in window || 'MozWebSocket' in window);\n }\n return isWe...
[ "0.6906933", "0.66632", "0.6447671", "0.64471036", "0.6361029", "0.62265", "0.61406237", "0.61277264", "0.6111207", "0.60787797", "0.602117", "0.6011114", "0.59578496", "0.59545577", "0.5885194", "0.58571494", "0.58475554", "0.5830798", "0.5813095", "0.57853484", "0.5770008",...
0.6845541
1
let classes = useStyles();
render() { return ( <Card className="w-50 p-3" > <CardActionArea> <CardMedia className="h-50" image="./images/pelusa.jpg" title="Contemplative Reptile" /> <CardContent> <Typography gutterBottom variant="h5" component="h2"> Lizard </Typography> <Typography variant="body2" color="textSecondary" component="p"> Lizards are a widespread group of squamate reptiles, with over 6,000 species, ranging across all continents except Antarctica </Typography> </CardContent> </CardActionArea> <CardActions> <Button size="small" color="primary"> Share </Button> <Button size="small" color="primary"> Learn More </Button> </CardActions> </Card> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getClasses() {\n return {\n ...(makeStyles(theme => ({\n sliderContainer: {\n position: \"relative\",\n width: \"100%\",\n height: 12,\n //borderWidth: 1,\n borderWidth: 0,\n borderRadius: 5,\n ...
[ "0.776499", "0.7060539", "0.638782", "0.637961", "0.637961", "0.637961", "0.637961", "0.637961", "0.637961", "0.6220399", "0.5937952", "0.5921431", "0.58936673", "0.5828119", "0.5810863", "0.58007765", "0.57845753", "0.57845753", "0.5783547", "0.5781817", "0.57692534", "0.5...
0.0
-1
CONSTRUCTOR TO ORGANIZE DATA
function Match(win, length, champion, runes, items, kda, totalCreep, creepPerMin) { this.win = win this.length = length this.champion = champion this.runes = runes this.itmes = items this.kda = kda this.totalCreep = totalCreep this.creepPerMin = creepPerMin }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor() {\n super();\n this.data = new Data();\n }", "function Data() {\n this.columns = null;\n this.items = null;\n this.projection = null;\n this.num_rows = 0;\n this.num_cols = 0;\n}", "constructor(data) {\n const dataKeys = Object.keys(data);\n for (let i = 0;...
[ "0.71304065", "0.70943147", "0.70683146", "0.6936727", "0.69228387", "0.6920877", "0.69096595", "0.6859795", "0.679646", "0.6792512", "0.6792512", "0.6786045", "0.678404", "0.67796296", "0.67639303", "0.67569506", "0.6746378", "0.66687274", "0.6657119", "0.6634306", "0.663430...
0.0
-1
returns null or an error if unsuccessful
async function getStatus(config, target) { let cacheKey = target.trim().toUpperCase(); // find cache key let status = null; let uuid, username; if(cache[cacheKey]) { uuid = cache[cacheKey]['uuid']; username = cache[cacheKey]['name']; } if(uuid === undefined || username === undefined) { let data = await requests.fetchData(target); if(data == null && config['follow']) { // don't retry if follow mode return null; } // while rate limit exceeded while(data == null) { // wait 10 seconds await new Promise(resolve => setTimeout(resolve, 10000)); data = await requests.fetchData(target); } uuid = data['id']; username = data['name']; // cache uuid if(config['cache']) { cache[cacheKey] = { 'name': username, 'uuid': uuid }; } } // get hypixel status information status = await requests.fetchStatus(uuid, config['apikey']); if(uuid == null && config['follow']) { return null; } // rate limit exceeded while(status == null) { await new Promise(resolve => setTimeout(resolve, 10000)); // 10 seconds status = await requests.fetchStatus(uuid, config['apikey']); } return { 'session': status['session'], 'name': username }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Failure() {\n return null;\n}", "function nullForFailure(ctx, failure) {\r\n\tctx.failed = true;\r\n\tctx.failures.push(failure);\r\n\treturn null;\r\n}", "if (this.state.error) {\n return null;\n }", "function validate() {\n //always valid\n return null;\n }", "function Success() ...
[ "0.5765271", "0.56466234", "0.563159", "0.55624133", "0.5494315", "0.5424768", "0.5417981", "0.5347017", "0.53146285", "0.53098774", "0.53098774", "0.53098774", "0.53098774", "0.5232575", "0.5213619", "0.51600593", "0.51181406", "0.51121545", "0.5107502", "0.51022875", "0.509...
0.0
-1
Add user to DB
static async store(data) { try { const dob = moment(data.dob).toISOString(); const userData = { first_name: data.first_name, last_name: data.last_name, dob: dob, status: 1, }; const result = await UserModel.create(userData); return { status: 200, data: { message: 'User has been created successfully!', data: result } }; } catch (error) { return ErrorHandler.handleError(error); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addUser() {\n var user = {\n primaryEmail: 'liz@example.com',\n name: {\n givenName: 'Elizabeth',\n familyName: 'Smith'\n },\n // Generate a random password string.\n password: Math.random().toString(36)\n };\n user = AdminDirectory.Users.insert(user);\n Logger.log('User %s cr...
[ "0.80739707", "0.79174674", "0.77811867", "0.7635574", "0.75894004", "0.752532", "0.7488236", "0.74286664", "0.7428632", "0.7394747", "0.73926145", "0.7377662", "0.73639", "0.733781", "0.72928256", "0.72744596", "0.7272744", "0.7270755", "0.7226336", "0.7215022", "0.72028154"...
0.0
-1
Get list of users
static async index() { try { let users = await UserModel.find(); return { status: 200, data: { data: users, message: "Users list found successfully!" } }; } catch (error) { return ErrorHandler.handleError(error); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "users() {\r\n\t\treturn API.get(\"pm\", \"/list-users\");\r\n\t}", "async getUsers() {\n let userResult = await this.request(\"users\");\n return userResult.users;\n }", "async function listUsers() {\r\n let res = await request\r\n .get(reqURL(config.routes.user.list))\r\n .withCredenti...
[ "0.8353867", "0.83229417", "0.8300206", "0.8258981", "0.8253628", "0.8244871", "0.8203518", "0.8172488", "0.816256", "0.80803764", "0.8051225", "0.8040585", "0.80348986", "0.8028877", "0.8005243", "0.793545", "0.7906824", "0.7905672", "0.7902794", "0.784607", "0.78238183", ...
0.0
-1
Toggle children on click.
function click(d) { if(d.name == "GO:0003700"){ r_click(r_root); n_click(d); }else if(d.name == "Groups"){ toggleGroups(); if(expanded == false){ root.children.forEach(collapse); r_click(r_root); } else{ root.children.forEach(expand); r_click(r_root); } update(root); }else { n_click(d); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "toggleChildren() {\n\t\tthis.setState({\n\t\t\tlinksVisible: !this.state.linksVisible\n\t\t});\n\t}", "function toggle_sidebar_sublist()\n{\n $(\".navbar_right_sidebar .sidebar_main_item.expandable\").click(function(){\n var child_container=$(this).find(\".subele_container\");\n if (child_contai...
[ "0.7110301", "0.6869267", "0.6655963", "0.6654497", "0.665069", "0.66472757", "0.66196424", "0.6617967", "0.6611529", "0.6591686", "0.654975", "0.6496521", "0.6458841", "0.64187694", "0.6404308", "0.63751197", "0.6367944", "0.6303494", "0.6300836", "0.6289716", "0.6254156", ...
0.0
-1
Toggle children on click.
function mouseout(d) { d3.select(this).select("text.hover").remove(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "toggleChildren() {\n\t\tthis.setState({\n\t\t\tlinksVisible: !this.state.linksVisible\n\t\t});\n\t}", "function toggle_sidebar_sublist()\n{\n $(\".navbar_right_sidebar .sidebar_main_item.expandable\").click(function(){\n var child_container=$(this).find(\".subele_container\");\n if (child_contai...
[ "0.7110301", "0.6869267", "0.6655963", "0.6654497", "0.665069", "0.66472757", "0.66196424", "0.6617967", "0.6611529", "0.6591686", "0.654975", "0.6496521", "0.6458841", "0.64187694", "0.6404308", "0.63751197", "0.6367944", "0.6303494", "0.6300836", "0.6289716", "0.6254156", ...
0.0
-1
Add string to end of the queue
enqueue(value) { this.storage[value] = value; this.count += 1; return this.storage; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function push(str) { // Push a string onto the buffer.\n bufferText += str;\n update();\n }", "function enqueue(newElement){\n queue.push(newElement);\n }", "enQueue(element){\n return this.items.push(element); //item added to the queue array\n }", "enqueue(item) {\n\t\...
[ "0.68312925", "0.6784135", "0.6606522", "0.653536", "0.6521834", "0.649985", "0.64960444", "0.64949244", "0.64949244", "0.64558774", "0.64558774", "0.6450762", "0.6432036", "0.6432036", "0.6432036", "0.6393708", "0.63744676", "0.6339522", "0.6333109", "0.62464434", "0.6231382...
0.0
-1
Remove string from beginning of queue
dequeue() { if (this.count === 0) { return 0; } var firstIdx = Object.keys(this.storage)[0]; var itemToRemove = this.storage[firstIdx]; delete this.storage[firstIdx]; this.count -= 1; return itemToRemove; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "shiftEmpty() {\n for (i = this.maxLen-1; i > -1; i--) {\n if (this.queueControl[i] == '') {\n this.queueControl.unshift(this.queueControl.splice(i, 1).join())\n break\n }\n }\n }", "function fx_remove_from_queue(fx) {\n var currents = fx.cr;\n if (currents) {\n currents.splice...
[ "0.69845027", "0.6750571", "0.66456306", "0.6536793", "0.64369506", "0.6401552", "0.6386654", "0.62966985", "0.61806023", "0.6177262", "0.6162999", "0.61600024", "0.60904914", "0.6063176", "0.6052558", "0.6034269", "0.60322464", "0.6016975", "0.60016143", "0.5976564", "0.5970...
0.56947553
61
Gets and sends the notifications belonging to a user.
function getNotificationsByUserId(req, res, next){ var userid = req.params.userid; User .findOne({ where:{'google.id':userid} }) .then(function(member){ console.log(userid); Notification .findAll({ where: {memberId: member.id}, order: ['createdAt'] }) .then(function(notifications){ res.send({ notifications: notifications }); }, function(){ next(); }); }, function(){ next() }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async getAllNotificationByUserId() {\n let user = JSON.parse(localStorage.getItem(\"loggedUser\"));\n\n try {\n const response = await HTTP.get(\n `${API_URL}/notifications/${user[0].id_user}`,\n {\n headers\n }\n );\n if (response.status == 200) {\n return...
[ "0.72313565", "0.6730205", "0.6666311", "0.6325411", "0.6268119", "0.62463534", "0.6165363", "0.6141082", "0.6062444", "0.59622496", "0.58929646", "0.5857803", "0.5838891", "0.5835425", "0.58168834", "0.5814554", "0.5812346", "0.57949615", "0.5767521", "0.5765476", "0.5750649...
0.6485289
3
function get all products This function query all products from the database and list as a table
function getAllProducts(){ // define select query var queryProducts = "SELECT * " + "FROM Products "; // execute select query connection.query(queryProducts,function(err, results){ if(err) throw err; // console.log(results); // create a table with column headings, and column width var table = new Table({ head: ['ID', 'NAME','PRICE','QUANTITY'] , colWidths: [5,30,10,10] }); // push query results to the table for(var i=0;i<results.length;i++){ table.push([results[i].item_id,results[i].product_name,results[i].unit_price.toFixed(2),results[i].stock_quantity]); } // print table to the console console.log(table.toString()); // print to additional lines console.log("\n\n"); // call function to get customer orders getOrder(); }); } // end getAllProducts
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function queryAllProducts (){\n\tconnection.query(\"SELECT * FROM products\", function(err, res){\n\t\tfor (var i = 0; i < res.length; i++) {\n\t\t\tconsole.log(\"Id: \" + res[i].id + \" | \" + res[i].productName + \" | \" + \"$\" + res[i].price);\n\t\t}\n\t\tconsole.log(\"-----------------------------------------...
[ "0.81584764", "0.80023783", "0.7999432", "0.78394616", "0.779368", "0.77830845", "0.77350026", "0.76957124", "0.7691928", "0.7649787", "0.75935864", "0.7570771", "0.7545789", "0.753648", "0.75234973", "0.75201446", "0.7510473", "0.74639916", "0.74550515", "0.745131", "0.74459...
0.70941854
64
function prompt to order
function getOrder(){ // This function requests order details from the user, using the npm inquirer package // variable to hold the item id var item_id = 0; // update query to update stock when order is placed var updateQuery = "UPDATE products SET stock_quantity = ?, product_sales =? WHERE item_id = ?"; // variable to hold the unit price var unit_price = 0; // variable to hold the stock quantity var stock_quantity = 0; // variable to hold the no of units that customer is purchasing var noOfUnits = 0; // variable to hold the product sales amount var product_sales = 0; // prompt user to enter an order inquire.prompt([{ type:"input", name :"itemId", message:"Please enter the id of the item to purchase" } ]).then(answer =>{ item_id=answer.itemId; var itemQuery = "SELECT stock_quantity,unit_price, product_sales FROM products WHERE item_id = " + item_id; connection.query(itemQuery,function(err,results){ if(err) throw err; unit_price = results[0].unit_price; stock_quantity = results[0].stock_quantity; product_sales = results[0].product_sales; // if stock not availabel if(stock_quantity === 0 ){ console.log("Insufficient quantity!"); getAllProducts(); } else{ inquire.prompt([{ type:"input", name :"noOfUnits", message:"Please enter the no of units" } ]).then(answer =>{ noOfUnits = parseInt(answer.noOfUnits); if (noOfUnits > stock_quantity){ // if availble stocks less than the amount that the customer wants to buy console.log("Insufficient quantity!"); getAllProducts(); } var totalCost = parseFloat(answer.noOfUnits * unit_price); var newQuantity = stock_quantity - answer.noOfUnits var newSales = product_sales + totalCost; connection.query(updateQuery,[newQuantity,newSales,item_id], (err,results)=>{ if (err) throw err; console.log("\nTotal cost :" + totalCost.toFixed(2)+"\n"); getAllProducts(); }); }); } } ) }); // connection.end(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function question(itemOptions) {\n var itemOrdered = prompt(itemOptions);\n order += itemOrdered + \" \";\n}", "function question(orderQuestion) {\n var answerInput = prompt(orderQuestion);\n order += answerInput + \", \";\n console.log(order);\n}", "function Cconsole() {\r\n INQUIRER.prompt([\r\n {\r...
[ "0.751526", "0.75127506", "0.735097", "0.7202075", "0.71969825", "0.71910644", "0.701997", "0.69608915", "0.69436485", "0.69156176", "0.6912446", "0.68737155", "0.6840584", "0.67887145", "0.6744532", "0.6739522", "0.6735525", "0.67162997", "0.6712071", "0.6681574", "0.6681024...
0.0
-1
Update the pricelist. Called when the server starts and then once every hour
function updatePriceList() { najax("https://api.csgofast.com/price/all", (data) => { try { priceList = JSON.parse(data); console.log("Pricelist Loaded.") } catch(e) { console.log("Pricelist failed to load with error " + e); console.log(data); console.log("Retrying in 5 seconds..."); setTimeout(updatePriceList, 5000); } } ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updatePrices() {\n}", "function priceTicker(){\n\tsetInterval(function(){changePrices(fruitArray)}, 15000);\n}", "function updateChart() {\r\n if (price_list.length > 0) {\r\n for (var i = 0; i < price_list.length; i++) {\r\n console.log(price_list[i][0] + \"++\" + price_list[i][1]);\r\n ...
[ "0.7307868", "0.64702463", "0.6402777", "0.62135404", "0.62065053", "0.6164375", "0.61307764", "0.6121152", "0.6081048", "0.5989167", "0.59852165", "0.5848833", "0.58231443", "0.58098286", "0.58058566", "0.5803177", "0.57836413", "0.5733865", "0.57153267", "0.5691173", "0.569...
0.7446579
0
Return performance numbers from each sorting algorithm
function _prepareBenchmarking(algorithm) { var sort = algorithms[algorithm]; return function sortAndBenchmark(array) { var startTime = _now(); stats.sort = algorithm; stats.runtime = 0; stats.comparisons = 0; stats.swaps = 0; _array = array; sort(_array); _array = []; stats.runtime = _now() - startTime; return stats; }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Sort() {}", "async function TopologicalSort(){}", "StopwatchSearchAndSort(arr) {\n\n //binary search\n\n var start = this.stopwatchmill()\n var temp = this.sortarrayInt(arr)\n var stop = this.stopwatchmill()\n var totaltime1 = stop - start;\n console.log(\"Binary Search take \" + totaltime1 + \"...
[ "0.6610553", "0.6444013", "0.6348624", "0.6324352", "0.6235032", "0.621337", "0.6184936", "0.6184936", "0.6168312", "0.6161041", "0.6141791", "0.61124283", "0.6105669", "0.6096987", "0.60759115", "0.60152805", "0.60152805", "0.5991617", "0.5960712", "0.59602225", "0.5947154",...
0.64459366
1
nS No Space lC Lowercase
function foldersAndFiles(currentAppName, newName) { var nS_CurrentAppName = currentAppName.replace(/\s/g, ''); var nS_NewName = newName.replace(/\s/g, ''); return ['ios/' + nS_CurrentAppName, 'ios/' + nS_CurrentAppName + '.xcodeproj', 'ios/' + nS_NewName + '.xcodeproj/xcshareddata/xcschemes/' + nS_CurrentAppName + '.xcscheme', 'ios/' + nS_CurrentAppName + 'Tests', 'ios/' + nS_NewName + 'Tests/' + nS_CurrentAppName + 'Tests.m', 'ios/' + nS_CurrentAppName + '.xcworkspace', 'ios/' + nS_CurrentAppName + '-Bridging-Header.h']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lcase0(s) {\n return s.replace(/^\\w/, function (match) {\n return match.toLowerCase();\n });\n }", "function lowercase(input) {}", "function sc_string_downcase(s) {\n return s.toLowerCase();\n}", "function whisper(string){ return string.toLowerCase() }", "function sl...
[ "0.7430665", "0.73316675", "0.7200786", "0.7156583", "0.7009906", "0.6955847", "0.6913623", "0.6890696", "0.6860053", "0.6818678", "0.6776555", "0.6776382", "0.67754924", "0.67679024", "0.6752629", "0.6719462", "0.67123914", "0.66751254", "0.6636516", "0.6636516", "0.6619696"...
0.0
-1
Update emitter and return how many particles should be generated this frame.
update(deltaTime, system) { // particles to generate var ret = 0; // first update? do burst if (this.age === 0 && this.options.onSpawnBurst) { ret += randomizerOrValue(this.options.onSpawnBurst); } // update age this.age += deltaTime; // no interval emitting? skip if (!this.options.onInterval) { return ret; } // check if inverval expired this.timeToSpawn -= deltaTime; if (this.timeToSpawn <= 0) { this.timeToSpawn = randomizerOrValue(this.options.interval); ret += randomizerOrValue(this.options.onInterval); } // do detoration if (this.options.detoretingMinTtl && system.ttl < this.options.detoretingMinTtl) { var detorateFactor = system.ttl / this.options.detoretingMinTtl; ret *= detorateFactor; } // return number of particles to generate return ret; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get particleCount() { return this._particles.length; }", "function particleUpdate() {\n console.log(\"particle update\");\n for (var i = 0; i < particles.length; i++) {\n particles[i].updatePosition(0.1);\n particles[i].updateVelocity(0.1);\n particles[i].updateAcceleration();\n }\n...
[ "0.7439256", "0.7022058", "0.68520135", "0.65556526", "0.6116611", "0.60867524", "0.5939136", "0.5939136", "0.58768815", "0.5853858", "0.58373976", "0.58214146", "0.5809813", "0.5725983", "0.57245016", "0.5706586", "0.56491756", "0.5634998", "0.56282353", "0.561305", "0.55981...
0.57880217
13
Method PUT Endpoint /api/updatetask/:taskid
function updateTask (req, res) { const { newIndex } = req.body; const tasks = Task .find({}) .exec((err, tasks) => { return tasks.map(task => { if (task.creator === req.params.uid) { task.orderIndex = newIndex; task.save(); } }); }); res.json({tasks}); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateTask(task) {\n return $http.put(url, task)\n\t\t.then(function successCallback (res){\n\t return res.data;\n\t }, function errorCallback(error) {\n console.log('ERRRRR');\n \tconsole.log(error);\n \t});\n }", "function updateTask(task, id){\n API.updateTask(task, id)\n ...
[ "0.7913674", "0.7887277", "0.7760899", "0.77257484", "0.76326853", "0.7603241", "0.76024693", "0.756114", "0.7524053", "0.7464032", "0.73855394", "0.7315477", "0.73001415", "0.7216512", "0.7185507", "0.71413505", "0.7102072", "0.70453495", "0.70008284", "0.69985676", "0.69094...
0.5803597
77
this is the fractiondigits attribute noinspection JSUnusedLocalSymbols
function theDecimalPlaces(num) { var match = (''+num).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/); if (!match) { return 0; } return Math.max( 0, // Number of digits right of decimal point. (match[1] ? match[1].length : 0) // Adjust for scientific notation. - (match[2] ? +match[2] : 0)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "fractionPeriod() {\n return Geometry_1.Geometry.safeDivideFraction(Math.PI * 2.0, Math.abs(this._radians1 - this._radians0), 1.0);\n }", "function fraction(section) {\n\tthis.numerator = section.numerator;\n\tthis.denominator = section.denominator;\n}", "function fraction(decimal){\n if(!d...
[ "0.67163837", "0.6652015", "0.6647443", "0.6353788", "0.6353788", "0.63366884", "0.63165545", "0.6196444", "0.6166887", "0.61573476", "0.6144105", "0.6087061", "0.6049235", "0.6035746", "0.6035746", "0.60167223", "0.5988215", "0.5985931", "0.59669214", "0.5956704", "0.5902046...
0.0
-1
TODO Accept arbitrary length newValues
insertBefore(value, newValue) { let prev = null; let link = this.head; while (link !== this.tail && link.value !== value) { prev = link; link = link.next; } if (!link || link.value !== value) { throw `No element exists with value: ${value}`; } const newLink = new Link(newValue); newLink.next = link; if (prev) { prev.next = newLink; } if (link === this.head) { this.head = newLink; } this.size++; return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function newValues() {\n\tvalues = [];\n\tfor (var i = 0, t = 14; i < 4; i++) {\n\t\tvalues.push(Math.round(Math.random() * t) + (i + 1));\n\t}\n}", "function setOptionsValues(newValues) {\n for(var key in newValues) {\n options[key] = newValues[key];\n }\n }", "handleNewValues () {...
[ "0.5968423", "0.59483916", "0.5828773", "0.57990915", "0.5651268", "0.55895936", "0.5574767", "0.5463488", "0.54607844", "0.54592985", "0.5452371", "0.54036", "0.54028475", "0.5326634", "0.5278186", "0.5278186", "0.5278186", "0.5278186", "0.5251375", "0.5251375", "0.5234125",...
0.0
-1
TODO Accept arbitrary length newValues
insertAfter(value, newValue) { let link = this.head; while (link !== this.tail && link.value !== value) { // 1 2 3 link = link.next; } if (!link || link.value !== value) { throw `No element exists with value: ${value}`; } const newLink = new Link(newValue); newLink.next = link.next; link.next = newLink; if (link === this.tail) { this.tail === newLink; } this.size++; return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function newValues() {\n\tvalues = [];\n\tfor (var i = 0, t = 14; i < 4; i++) {\n\t\tvalues.push(Math.round(Math.random() * t) + (i + 1));\n\t}\n}", "function setOptionsValues(newValues) {\n for(var key in newValues) {\n options[key] = newValues[key];\n }\n }", "handleNewValues () {...
[ "0.5968423", "0.59483916", "0.5828773", "0.57990915", "0.5651268", "0.55895936", "0.5574767", "0.5463488", "0.54607844", "0.54592985", "0.5452371", "0.54036", "0.54028475", "0.5326634", "0.5278186", "0.5278186", "0.5278186", "0.5278186", "0.5251375", "0.5251375", "0.5234125",...
0.0
-1
This function will reposition search form to the left panel when viewed in screens smaller than 767px and will return to top when viewed higher than 767px
function reposition_searchform() { if(jQuery('.searchform').css('position') == 'relative') { jQuery('.searchform').insertBefore('.leftpanelinner .userlogged'); } else { jQuery('.searchform').insertBefore('.header-right'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reposition_searchform() {\n if (jQuery('.searchform').css('position') == 'relative') {\n jQuery('.searchform').insertBefore('.leftpanelinner .userlogged');\n } else {\n jQuery('.searchform').insertBefore('.header-right');\n }\n }", "function reposition_searc...
[ "0.7524671", "0.74269164", "0.67864704", "0.67860675", "0.6615261", "0.6471397", "0.6462206", "0.645832", "0.6145061", "0.60218513", "0.60014117", "0.5995631", "0.593819", "0.58987504", "0.58893794", "0.5881661", "0.5858104", "0.5800459", "0.57922584", "0.57891536", "0.577539...
0.74744433
1
This function allows top navigation menu to move to left navigation menu when viewed in screens lower than 1024px and will move it back when viewed higher than 1024px
function reposition_topnav() { if(jQuery('.nav-horizontal').length > 0) { // top navigation move to left nav // .nav-horizontal will set position to relative when viewed in screen below 1024 if(jQuery('.nav-horizontal').css('position') == 'relative') { if(jQuery('.leftpanel .nav-bracket').length == 2) { jQuery('.nav-horizontal').insertAfter('.nav-bracket:eq(1)'); } else { // only add to bottom if .nav-horizontal is not yet in the left panel if(jQuery('.leftpanel .nav-horizontal').length == 0) jQuery('.nav-horizontal').appendTo('.leftpanelinner'); } jQuery('.nav-horizontal').css({display: 'block'}) .addClass('nav-pills nav-stacked nav-bracket'); jQuery('.nav-horizontal .children').removeClass('dropdown-menu'); jQuery('.nav-horizontal > li').each(function() { jQuery(this).removeClass('open'); jQuery(this).find('a').removeAttr('class'); jQuery(this).find('a').removeAttr('data-toggle'); }); if(jQuery('.nav-horizontal li:last-child').has('form')) { jQuery('.nav-horizontal li:last-child form').addClass('searchform').appendTo('.topnav'); jQuery('.nav-horizontal li:last-child').hide(); } } else { // move nav only when .nav-horizontal is currently from leftpanel // that is viewed from screen size above 1024 if(jQuery('.leftpanel .nav-horizontal').length > 0) { jQuery('.nav-horizontal').removeClass('nav-pills nav-stacked nav-bracket') .appendTo('.topnav'); jQuery('.nav-horizontal .children').addClass('dropdown-menu').removeAttr('style'); jQuery('.nav-horizontal li:last-child').show(); jQuery('.searchform').removeClass('searchform').appendTo('.nav-horizontal li:last-child .dropdown-menu'); jQuery('.nav-horizontal > li > a').each(function() { jQuery(this).parent().removeClass('nav-active'); if(jQuery(this).parent().find('.dropdown-menu').length > 0) { jQuery(this).attr('class','dropdown-toggle'); jQuery(this).attr('data-toggle','dropdown'); } }); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setMenu() {\n\n\t\tvar w = parseInt($(\"nav\").css(\"width\"), 10);\n\n\t\tif (w < 1200) {\n\n\t\t\tif ($(\"#navigator2\").is(':empty')) {\n\t\t\t\t$(\"#navigator2\").prepend($(\"#IndexNav\"), $(\"#productsNav\"),$(\"#contactNav\"),$(\"#accountNav\"), $(\"#cartNav\"));\n\t\t\t\t$(\"#productsNavUl\").attr(...
[ "0.72082615", "0.7170672", "0.70101947", "0.6955174", "0.694356", "0.68662584", "0.6816386", "0.67965406", "0.6530324", "0.65302855", "0.6519954", "0.6510646", "0.64004153", "0.6387715", "0.63789433", "0.6367431", "0.63571006", "0.63373625", "0.632946", "0.6308267", "0.626707...
0.6939183
5
remove container in window when it's smaller than 992px
function checkWindowSize() { if ($(window).width() < 990) { $("#body").removeClass("container"); } else $("#body").addClass("container") }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addContainer(){\r\n if($(window).width() >= 992){\r\n containerer.addClass('container');\r\n } else if(containerer.hasClass('container') && $(window).width() < 992 ){\r\n containerer.removeClass('container');\r\n }\r\n}", "function resize() {\nif ( $(window).width() > 1370) { ...
[ "0.7315392", "0.6516453", "0.6421531", "0.6309711", "0.62484634", "0.6214436", "0.61990124", "0.61696285", "0.6073995", "0.60730827", "0.60689825", "0.6041196", "0.5968247", "0.59671843", "0.59578604", "0.59534", "0.5925579", "0.5878488", "0.5876563", "0.5855725", "0.5832292"...
0.65226847
1
change navbar, decktitle fontsize and image size according to screen size
function changeToFit() { //fix if (($(window).width() < 559)) { for (i = 0; i < trendingDecks.length; i++) { trendingDecks[i].parentElement.style.height = "134px"; } for (i = 0; i < authorDeck.length; i++) { // the carousel elements authorDeck[i].style.fontSize = "13px"; deckTitle[i].children[0].classList.add("h5"); deckTitle[i].style.maxWidth = "50%"; changeFlowItemToFitSmallWindow(i) } // nav bar removeAbsolutePosition(); userBar.style.width = "100%"; for (i = 0; i < userBar.children.length; i++) { userBar.children[i].style.width = String($(window).width() / 4) + "px"; } } else if (($(window).width() < 700)) { // nav bar spreadNavBar(); removeAbsolutePosition(); for (i = 0; i < trendingDecks.length; i++) { trendingDecks[i].parentElement.style.height = "134px"; } for (i = 0; i < userBar.children.length; i++) { userBar.children[i].style.width = ""; } // carousel for (i = 0; i < authorDeck.length; i++) { spreadCarousel(i); changeFlowItemToFitSmallWindow(i) } } else if ($(window).width() < 977) { for (i = 0; i < trendingDecks.length; i++) { trendingDecks[i].parentElement.style.height = "134px"; } // nav bar spreadNavBar(); userBar.classList.add("position-absolute"); userBar.style.right = "-80px"; // carousel for (i = 0; i < imageFlowCard.length; i++) { spreadCarousel(i); changeFlowItemToFitSmallWindow(i); } } else if ($(window).width() < 1200) { // trending decks for (i = 0; i < trendingDecks.length; i++) { trendingDecks[i].parentElement.style.height = "134px"; } // navbar spreadNavBar(); removeAbsolutePosition(); for (var i = 0; i < imageFlowCard.length; i++) { // carousel spreadCarousel(i); changeFlowItemToFitLargeWindow(i); } } else { // navbar spreadNavBar(); removeAbsolutePosition(); for (i = 0; i < trendingDecks.length; i++) { trendingDecks[i].parentElement.style.height = "166px"; } for (i = 0; i < imageFlowCard.length; i++) { // carousel spreadCarousel(i); changeFlowItemToFitLargeWindow(i); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function changeFontScreen(){\n changeSize(\"#content\", fontSizeStyle, fontSizeArr[zoomedIn]); \n changeSize(\"form\", fontSizeStyle, fontSizeArr[zoomedIn]);\n changeSize(\"h2\", fontSizeStyle, h2FontSizeArr[zoomedIn]);\n changeSize(\"#innerContent h3\", fontSizeStyle, h3FontSizeArr[zoomedIn]);\n ch...
[ "0.64910144", "0.62984633", "0.626563", "0.6264973", "0.6174927", "0.6148891", "0.59855944", "0.59722465", "0.5960034", "0.59187615", "0.58019626", "0.57855666", "0.5762473", "0.5759563", "0.5758983", "0.5747835", "0.57472754", "0.57418513", "0.57347995", "0.57338744", "0.572...
0.5650471
26
change the top carousel items to fit the small window size
function changeFlowItemToFitSmallWindow(i) { deckTitle[i].style.left = "40px"; deckTitle[i].style.maxWidth = "50%"; imageFlowCard[i].style.width = "116px"; imageFlowCard[i].style.height = "140px"; imageFlowCard[i].style.right = "25px"; imageFlowCard[i].style.top = "40px"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setHeightCarousel3() {\n $carousel3.each(function () {\n var $allImages = $(this).find('img');\n var size = $(this).attr('data-size') || 0.8;\n var resultH = wndH * size;\n var maxItemW = Math.min($(this).parent().width(), wndW) * size;\n $allI...
[ "0.6966265", "0.6756647", "0.67326427", "0.67141485", "0.6712271", "0.6708533", "0.6708533", "0.6708533", "0.6639458", "0.6630527", "0.65997916", "0.65371406", "0.644696", "0.6425901", "0.6308349", "0.62622744", "0.62332076", "0.6208643", "0.6110219", "0.6070161", "0.60344255...
0.5920856
24