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
initiate the game with some introduction text
function beginGame(game_ID, players) { var txts1 = [ "ACCESSING SYSTEM...", "HELLO [NAME] HOW ARE YOU", "WOULD Y@U *! L?K3 T0 *£..$..", "...¤¤¤..@..?...*#..!........." ]; var txts2 = [ " ", "!!! ...WARNING... !!!", "A HOSTILE ENTITY IS TRYING TO ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function introduction (game) {\n out(GAME_INTRODUCTION);\n scenes_tick(game);\n look(game);\n update_statusbar(game);\n}", "function C005_GymClass_Intro_Run() {\n\t\n\t// Paints the background\n\tDrawImage(CurrentChapter + \"/\" + CurrentScreen + \"/Background.jpg\", 0, 0);\n\tDrawPlayerTransition();\n\n\t//...
[ "0.7729682", "0.7574439", "0.7556389", "0.7393537", "0.73116285", "0.7283043", "0.71869636", "0.71119535", "0.7075189", "0.7064663", "0.70578194", "0.6993665", "0.69585156", "0.6957443", "0.69497776", "0.69461256", "0.69443285", "0.69400823", "0.6929269", "0.6928318", "0.6928...
0.0
-1
generate a random unique id for each game
function generateGameID(saveNewGame) { var newGameID = ""; var existingGameID = ""; var duplicates = true; Game.find(function(err, gamesfound) { if(err) { console.error(err); return null; } // ensure the game id does not exist in the db alr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateId() {\n\treturn Math.random() * 999999;\n}", "function generateID() {\r\n return Math.floor(Math.random() * 100000000);\r\n}", "function genID() {\n return (+new Date() + Math.floor(Math.random() * 999999)).toString(36);\n}", "function generateID() {\n return Math.floor(Math.random()...
[ "0.821158", "0.8200816", "0.81211716", "0.80823606", "0.8063689", "0.80398244", "0.8039145", "0.8024361", "0.80029684", "0.7985072", "0.79755396", "0.7974222", "0.7952002", "0.7952002", "0.7952002", "0.7948512", "0.79355925", "0.7925717", "0.79210687", "0.79158324", "0.790760...
0.0
-1
returns the player based on the ID
function getPlayer(player_ID, foundPlayer) { Player.find({'playerID': player_ID}, function(err, playerfound) { if(err) console.error(err); playerfound = playerfound[0]; foundPlayer(playerfound); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findPlayer(id) {\n var player;\n var result = $.grep(players, function(item) {\n return item._id == id;\n });\n if (result.length == 1) {\n player = result[0];\n }\n return player;\n }", "function playerById(id) {\n\tvar i;\n\tfor (i = 0...
[ "0.85341674", "0.8307689", "0.82971215", "0.8229657", "0.8092259", "0.8091935", "0.80686235", "0.80247504", "0.80247504", "0.80216396", "0.80011976", "0.80006266", "0.79903597", "0.79867655", "0.79867655", "0.7900372", "0.7808206", "0.7727999", "0.7709711", "0.7678013", "0.76...
0.7277378
29
if the player enters the command HELP outputs an array of text help instructions
function commandHelp(player_ID, executeCommand) { getPlayer(player_ID, function(playerfound) { let currentRoom = playerfound.room; let output = ['Here is a list of commands:', '----------------------', '| - - - command - - -| - - function - - |', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function help() {\n\tvar commandsArray = ['Help: List of available commands', '>help', '>about', '>contact', '>ping', '>time', '>clear', '>say'];\n\tfor (var i = 0; i < commandsArray.length; i++) {\n\t\tvar out = '<span>' + commandsArray[i] + '</span><br/>'\n\t\tOutput(out);\n\t}\n}", "function help() {\n\tvar c...
[ "0.8331571", "0.81621987", "0.7692364", "0.752256", "0.7520537", "0.74953717", "0.74953717", "0.74818176", "0.7463791", "0.7395625", "0.7340713", "0.73323286", "0.7309701", "0.729556", "0.7288285", "0.7288059", "0.7267721", "0.7247687", "0.72140205", "0.7210171", "0.7201761",...
0.0
-1
if the player enters the command GOTO
function commandGoto(game_ID, player_ID, parameter, executeCommand) { getPlayer(player_ID, function(playerfound) { var currentPlayer = playerfound; var currentRoom = currentPlayer.room; var newRoom = null; var roomToGo = parameter.toLowerCase(); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "jump() {\n\t\t// \n\t}", "function userTouchedContinue() {\n TileSum.game.state.start('Play');\n }", "go() {\n if (game.pause===true) {\n game.message = '';\n game.pause=false;\n game.generateEntities(false,true);\n game.autoMove();\n console.log('Game Status: ', gam...
[ "0.65422165", "0.6307678", "0.6229932", "0.62173903", "0.6110338", "0.5957146", "0.58858484", "0.58774614", "0.5875076", "0.584217", "0.58387196", "0.5835961", "0.58274984", "0.58265024", "0.58205336", "0.57772803", "0.57387537", "0.57221156", "0.56999695", "0.56862694", "0.5...
0.56238174
26
if the player enters the command LIST
function commandList(game_ID, player_ID, executeCommand) { getPlayer(player_ID, function(playerfound) { var currentPlayer = playerfound; var currentRoom = currentPlayer.room; var folders = []; var items = []; if(currentRoom == "/root/users/admin/cloud") { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "enterList_if(ctx) {\n\t}", "function video_chat_lobby()\n{\n\ttrace(\"video_chat_lobby()\");\n\tif ( $('#room-list').length ) {\n\t\tchat_room_list();\n\t}\n}", "function checkList(){\n\n\n\n}", "function listOptions(){\n let msg = \n`'q' or 'quit' exit the app\n'help' '?' or 'list' display available script...
[ "0.6310657", "0.6184701", "0.6003998", "0.5883592", "0.5855878", "0.58499706", "0.5846292", "0.5846292", "0.58232415", "0.5752916", "0.56765145", "0.5667428", "0.5656054", "0.56545323", "0.5630354", "0.55969584", "0.5582601", "0.5566575", "0.5534941", "0.5531951", "0.55262357...
0.5496751
23
if a player enters the command OPEN
function commandOpen(game_ID, player_ID, parameter, executeCommand) { getPlayer(player_ID, function(playerfound) { var currentPlayer = playerfound; var currentRoom = currentPlayer.room; var file = null; if(currentRoom == "/root/users/admin/cloud") { Cloud.f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onOpen() {\n this.sendPacket({\n op: Constants.OPCodes.DISPATCH,\n d: {\n server_id: this.voiceConnection.channel.guild.id,\n user_id: this.client.user.id,\n token: this.voiceConnection.authentication.token,\n session_id: this.voiceConnection.authentication.sessionID,\n ...
[ "0.63416505", "0.626903", "0.62628955", "0.6251449", "0.6141463", "0.60351443", "0.5936138", "0.5887451", "0.58764553", "0.5876015", "0.586056", "0.5827418", "0.580879", "0.5806332", "0.577368", "0.57591", "0.5739467", "0.57374024", "0.57241887", "0.5679674", "0.5677445", "...
0.0
-1
console.log("The Hello World Code!".replaceBetween(4, 9, "Hi")); edit the given file by exchanging the username and password
function editFile(file, currentPlayer) { let fs = require('fs'); // read the given file fs.readFile('./public/files/' + file, 'utf-8', function(err, data){ if (err) throw err; // change username and password to correct values let username = currentPlayer.opponent; le...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "stringReplace(username) \n{\n var input =\"Hello <<username>> , how are you?\";\n var output = input.replace(/<<username>>/g,username); \n console.log(output+\" : Replace string using Regex \")\n\n var output1=\"\";\n while(username.length<3 || !isNaN(username)) {\n var read = require('readli...
[ "0.62037545", "0.53616905", "0.52396667", "0.50990146", "0.5084172", "0.49879867", "0.498514", "0.48903754", "0.48853266", "0.4776267", "0.47360915", "0.47262654", "0.47111598", "0.47035947", "0.46851814", "0.46804005", "0.46784398", "0.46781746", "0.46480966", "0.464793", "0...
0.66550815
0
if the player enters the command SHOW
function commandShow(game_ID, player_ID, parameter, executeCommand) { getPlayer(player_ID, function(playerfound) { let currentPlayer = playerfound; let currentRoom = currentPlayer.room; var output; // if the player stands in the admin folder if(currentRoom == "/root/us...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function show() {\n Onyx.set(ONYXKEYS.IS_CHAT_SWITCHER_ACTIVE, true);\n}", "function show() {\n\t\tif (self.shown && self.valid) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (!self.shown) {\n\t\t\t$(\"#\" + self.targetDivId).append(\"<div id='\" + self.targetDivId + \"-video'></div><p>Press the TAB key to pause/play...
[ "0.62580127", "0.61857796", "0.61606866", "0.6134515", "0.6127856", "0.61219954", "0.6091818", "0.596918", "0.59690094", "0.5949557", "0.5934529", "0.5898142", "0.5892443", "0.58857393", "0.5884956", "0.5881502", "0.58754617", "0.58293945", "0.58037513", "0.5799376", "0.57992...
0.55785173
43
if the player enters the command KILL SYSTEM
function commandKillcode(game_ID, player_ID, parameter, executeCommand) { getPlayer(player_ID, function(playerfound) { let currentRoom = playerfound.room; let output = null; if(currentRoom == "/root") { if(parameter == "SYSTEM") { output = "SYSTEM SHUTDOWN"; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "kill()\n {\n // Say some shit u died whataver\n\n }", "kill() {\r\n clearInterval(this.marketChecker);\r\n clearInterval(this.spin);\r\n throw new error(\"Killed script\");\r\n }", "function unlock(_word) {\n\n\n if (player.inventory.includes('key')) {\n currentState.locked = false\n...
[ "0.63820946", "0.6276242", "0.6207397", "0.61224204", "0.6101286", "0.6062093", "0.6054462", "0.6012674", "0.5998262", "0.59848994", "0.59321314", "0.5906972", "0.5881292", "0.5878454", "0.5876686", "0.5808292", "0.579453", "0.5757914", "0.5732763", "0.5726679", "0.5725017", ...
0.6593383
0
arrow function returns expression provided after
speak () { this.clickHandler() return `${super.speak()} Meow, I am a ${this.species}` }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "operator(ctx, expr) {\n const ast = expr.ast, fn = ctx.functions;\n return _ => interpret(ast, fn, _);\n }", "ArrowFunctionExpression(path) {}", "function createAdder(arg) {\n return arg1 => arg + arg1;\n}", "arrow() {\n const RickAndMorty = 'Rick and Morty';\n return () => RickAndMor...
[ "0.6622033", "0.661406", "0.659269", "0.6370205", "0.62305", "0.6176875", "0.6139968", "0.61093456", "0.6104766", "0.60463506", "0.5998106", "0.59761685", "0.59663945", "0.5950608", "0.5947862", "0.5909767", "0.5909767", "0.58714384", "0.58372635", "0.583663", "0.582215", "...
0.0
-1
Core Game Objects Category object
function Category(name, color, i, idName) { this.idName = idName; this.name = name; this.color = color; this.index = i; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Category() {\n}", "function JAFTING_Category() { this.initialize(...arguments); }", "function getCategory(c){\n return getCategoryObject(c.definition); \n}", "function categories() {\n // assign categories object to a variable\n var categories = memory.categories;\n ...
[ "0.69561833", "0.6500427", "0.6318129", "0.6287976", "0.61936593", "0.6173432", "0.6072899", "0.6072899", "0.6072899", "0.6072899", "0.59907544", "0.5961028", "0.592927", "0.5913261", "0.58879286", "0.586033", "0.5824812", "0.57867956", "0.57675856", "0.5720246", "0.56740785"...
0.51968944
65
Called from set.js input idName of category, return categoryObject
function getCategoryObject(str) { var ans = GAME.categories.filter(function(elem,index){ return GAME.categories[index].idName == str;}); return ans[0]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCategoryById(id) {\n return categoryHandler.GetCategoryById(id);\n }", "function getCategoryById(id) {\n return categoryHandler.GetCategoryById(id);\n }", "function Category(data) {\n \n if (!data) {\n throw 'Invalid data for Category';\n }\n \n this.id = data.Id;\n...
[ "0.7133862", "0.7028709", "0.6821646", "0.68209726", "0.6767014", "0.66952807", "0.66586894", "0.6623354", "0.662332", "0.6611755", "0.65931004", "0.6570522", "0.6565288", "0.6561871", "0.65399015", "0.63914365", "0.6352031", "0.63439333", "0.62868655", "0.62743294", "0.62497...
0.68961877
2
Init, called from gamepage.html
function init() { //simplest: //console.log('oh hai'+"*D4EL means different for each level"); //show some stuff //$(DOC.$term).text("YEAGAD").show(); //$(DOC.$term).text("YEAGAD").show(); //store DOC cats in array // DOC.cats = [DOC.leftCategory, DOC.rightCategory]; //set up category objects from data-gi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init() {\n\t// Page elements that we need to change\n\tG.currTitleEl = document.getElementById('current-title');\n\tG.currImageEl = document.getElementById('current-image');\n\tG.currTextEl = document.getElementById('current-text');\n\tG.currChoicesEl = document.getElementById('current-choices-ul');\n\tG....
[ "0.82908905", "0.80855167", "0.751233", "0.7502015", "0.7414541", "0.73173475", "0.7294887", "0.72913325", "0.7287606", "0.7226449", "0.7215182", "0.7199746", "0.71942455", "0.71606374", "0.7135241", "0.712718", "0.71227485", "0.7108507", "0.70857525", "0.70821816", "0.707464...
0.0
-1
GAME.CURRENTCARD = GAME.cards[GAME.cardIndex] newTurn(); Hardcoding instruction cards and pushing them to instructions queue
function makeInstructions() { //Instructions var iCard = new instructionCard("Play with arrow keys.", "Click right arrow ▶ to continue", '◀ Choose other set', 'Continue ▶', function() { window.location.href = 'file:///Users/katkat/Desktop/wordblox/intro.html'; }, function() { GAME.cardIndex = 1; showN...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nextTurn(){\n\tchangeDiscard();\n\tplayerTurnIs();\n}", "startTurn() {\n this.pendingChip = new Chip({ player: this.currentPlayer });\n if (this.currentPlayer.getNextMove) {\n this.currentPlayer.getNextMove({ game: this }).then((nextMove) => {\n this.emit('async-player:get-next-move', ...
[ "0.6758173", "0.6682267", "0.65662813", "0.6477723", "0.6466616", "0.6450955", "0.6428587", "0.63845813", "0.6378942", "0.6366129", "0.6360752", "0.6340222", "0.63327026", "0.6312915", "0.6308446", "0.62915593", "0.62736756", "0.62729466", "0.6263955", "0.62605745", "0.62547"...
0.61643153
30
Currently unused For testing
function setOC(num) { if (num == null) { console.warn("num is undef"); debugger; } GAME.CURRENTCARD.opposingCategory = GAME.categories[parseInt(num)]; if (GAME.CURRENTCARD.opposingCategory == null) { console.warn("OC is undef"); debugger; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private public function m246() {}", "private internal function m248() {}", "transient private protected internal function m182() {}", "protected internal function m252() {}", "transient protected internal function m189() {}", "transient private internal function m185() {}", "transient final protected i...
[ "0.7565139", "0.73252213", "0.7004986", "0.6909444", "0.6869249", "0.68572855", "0.66727984", "0.6605374", "0.6559156", "0.65579224", "0.65304786", "0.6465962", "0.6424722", "0.63877916", "0.6340827", "0.63363713", "0.63183725", "0.6266548", "0.62280357", "0.6132488", "0.6131...
0.0
-1
docCat is the doc object category chosen otherDocCat is the doc object category not chosen chosenCat is the category object chosen, corresponds with docCat
function checkCategory(docCat, otherDocCat, chosenCat) { //can add as parameter: "notChosenCat" console.log("in checkCategory"); //debugger; if (chosenCat && GAME.CURRENTCARD.category.name == chosenCat.name) { //header feedback //$("#feedback").text("☺ Correct!").show(); //show final term (i.e. "el ma...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getDocCategories() {\n if (utils.isEmptyObj(masterData.getMasterData())) {\n var request = masterData.fetchMasterData();\n $q.all([request]).then(function (values) {\n self.documentCategories = values[0].documents_cat;\n self.d...
[ "0.62367296", "0.5558625", "0.55453634", "0.5480499", "0.54052097", "0.5352896", "0.53428745", "0.5273854", "0.52588946", "0.52482474", "0.5226446", "0.5161925", "0.51475996", "0.51373917", "0.5136128", "0.51303643", "0.51238", "0.51128054", "0.5107202", "0.510177", "0.501708...
0.6275349
0
if arrow key pressed
function checkKey(e) { if (GAME.mode == "instructions") { e = e || window.event; // left arrow if (e.keyCode == '37') { //left category function; instructions[GAME.cardIndex].leftFunc(); } //right arrow else if (e.keyCode == '39') { //right category function instruction...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function keyDownhandler(event) {\n if ( event.keyCode == 39 ) {\n //NOTE keyCode MUST!!! have Capitcal C in key C ode\n //keycode 39 = right arrow button\n rightPressed = true;\n } else if ( event.keyCode == 37 ){\n //keycode 37 = left arrow button\n leftPressed = true;\n }\n}", "function keyDo...
[ "0.7627929", "0.7613116", "0.75792825", "0.7455572", "0.7442013", "0.74310863", "0.73398274", "0.73385423", "0.7260651", "0.725683", "0.7211316", "0.7207666", "0.7206557", "0.7205824", "0.717909", "0.7159126", "0.71503764", "0.71503764", "0.71432734", "0.7136447", "0.7114272"...
0.0
-1
! Get all playlist
async function playlistIndex(req, res, next) { try { const playlist = await Playlist.find().populate('users').populate('user') res.status(200).json(playlist) } catch (err) { next(err) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "all(){\n const playlists = this.repository.load();\n return playlists.map(playlist => new Playlist(playlist.name, playlist.songs));\n }", "function getPlaylist() {\n\treturn playlist;\n}", "function getPlaylist() {\n\treturn playlist;\n}", "function getAllTracks() {\n // TODO: Retur...
[ "0.81852", "0.7510527", "0.7510527", "0.7462374", "0.7383023", "0.7202821", "0.7182557", "0.7167615", "0.7121504", "0.7111514", "0.7035671", "0.701547", "0.6936919", "0.6874141", "0.686161", "0.6809825", "0.67979085", "0.67469066", "0.67429394", "0.67006695", "0.6695995", "...
0.63256234
49
! Get a Users Playlists
async function getUsersPlaylist(req, res, next) { try { req.body.user = req.currentUser const userplaylist = await Playlist.find({ user: req.body.user._id, }).populate('songs') return res.status(200).send(userplaylist) } catch (e) { next(e) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async getPlaylists() {\n try {\n let playlists = await spotifyWebApi.getUserPlaylists();\n this.setState({\n playlists: playlists,\n loading: false,\n selectedPlaylist: {\n id: playlists.items[0].id, \n }\n ...
[ "0.7729634", "0.7642737", "0.7618179", "0.750534", "0.74863684", "0.73074925", "0.73030305", "0.7225763", "0.71034527", "0.7084997", "0.70780045", "0.707389", "0.7035268", "0.6934694", "0.6895438", "0.6835713", "0.6753882", "0.6726697", "0.67081803", "0.6700946", "0.66518295"...
0.6576692
22
! get a particular playlist
async function playlist(req, res, next) { try { const { playlistId } = req.params const playlist = await Playlist.findById(playlistId) .populate('songs') .populate('users') .populate('user') if (!playlist) { throw new NotFound(`Playlist with id: ${playlistId} does not exist.`) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getPlaylist() {\n\treturn playlist;\n}", "function getPlaylist() {\n\treturn playlist;\n}", "function getPlaylist() {\n\t\treturn pls.id;\n\t}", "playlist() {\n return Playlists.findOne(playlistId);\n }", "viewFriendsSongsInPlaylist(playlist_id){\n this.getPlaylist(playlist_id)\n }...
[ "0.8247424", "0.8247424", "0.7987782", "0.77777123", "0.75570565", "0.75111103", "0.75104743", "0.74973184", "0.7381728", "0.736393", "0.7302014", "0.7225632", "0.7215504", "0.7215188", "0.71851844", "0.7123066", "0.7065336", "0.70500124", "0.6993191", "0.69881153", "0.696861...
0.6571977
36
! Get all songs from playlist
async function songs(req, res, next) { try { const { playlistId } = req.params const playlist = await Playlist.findById(playlistId).populate('songs') if (!playlist) { throw new NotFound(`Playlist with id: ${playlistId} does not exist.`) } res.status(200).json(playlist.songs) } catch (err) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "all(){\n const playlists = this.repository.load();\n return playlists.map(playlist => new Playlist(playlist.name, playlist.songs));\n }", "function getSongList(){\n\t\t\tSongSheetAPI.index(\n\t\t\t\tfunction success(data){\n\t\t\t\t\tconsole.log('success', data);\n\t\t\t\t\t$scope.songSheets = data;\n...
[ "0.78318757", "0.7406652", "0.7400498", "0.7354724", "0.7221659", "0.7216712", "0.71547866", "0.714415", "0.7100625", "0.7099683", "0.7091057", "0.7070224", "0.7070224", "0.7065635", "0.70155627", "0.6933792", "0.6918889", "0.6836246", "0.6812394", "0.67817247", "0.677996", ...
0.685145
17
! Create a playlist
async function add(req, res, next) { try { req.body.user = req.currentUser req.body.users = req.currentUser const playlist = await Playlist.create(req.body) await playlist.save() const user = await User.findById(req.currentUser._id) user.playlists.push(playlist) const savedUser = await use...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createPlaylist() {\n\t\t// create request\n\t\tvar request = {};\n\t\trequest[\"artistPool\"] = artistPool;\n\t\t\n\t\tvar requestBuilder = new SpotifyRequestBuilder();\n\t\trequestBuilder.postRequest(common.generatePlaylistURL, onCreatePlaylist, JSON.stringify(request));\n\t}", "function createPlaylist...
[ "0.8496287", "0.79689324", "0.78499043", "0.7636809", "0.7602199", "0.7497411", "0.7393057", "0.72285223", "0.7168682", "0.7143466", "0.7082736", "0.70825046", "0.70363915", "0.6951491", "0.693889", "0.6926295", "0.687626", "0.687626", "0.6835355", "0.67928886", "0.67730933",...
0.0
-1
! Edit an playlist
async function edit(req, res, next) { try { const { playlistId } = req.params const playlist = await Playlist.findById(playlistId) if (!playlist) { throw new NotFound(`Playlist with id: ${playlistId} does not exist.`) } if (!playlist.public && !playlist.users.includes(req.currentUser._id)) {...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setPlaylist(p) {\n\tplaylist = p;\n}", "function setPlaylist(p) {\n\tplaylist = p;\n}", "function changePlaylist() {\n\t\t// clear track specific data\n\t\t$(\"#trackName\").empty();\n\t\t$(\"#trackRating\").val(\"(Rate track)\");\n\t\n\t\tvar playlistIndex = $(\"#playlist\").val();\n\t\tif (playlistI...
[ "0.72387946", "0.72387946", "0.71672624", "0.71059185", "0.7048705", "0.69723386", "0.6793613", "0.65327156", "0.64126205", "0.63669467", "0.6366396", "0.6308043", "0.6300009", "0.6291067", "0.6290152", "0.62217593", "0.61737186", "0.6169132", "0.61675686", "0.6126235", "0.61...
0.67938304
6
! Delete a playlist
async function remove(req, res, next) { try { const { playlistId } = req.params const playlist = await Playlist.findById(playlistId) if (!playlist.public && !playlist.users.includes(req.currentUser._id)) { throw new NotAuthorized() } await Playlist.deleteOne({ _id: playlist._id }) res.se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deletePlaylist(value) {\n var index;\n for (i = 1; i < user_playlists.length; i++) {\n if(user_playlists[i].name == value) {\n index = i;\n };\n };\n user_playlists.splice(index, 1);\n showLocalPlaylists()\n}", "function removeFromPlaylist(playlist, artistName){\n delete playlist[artist...
[ "0.730405", "0.7262527", "0.72271025", "0.7222468", "0.721535", "0.70198643", "0.70174205", "0.6970261", "0.69445425", "0.6927156", "0.6892451", "0.67835784", "0.66737837", "0.6604392", "0.654236", "0.64380807", "0.6422916", "0.63487345", "0.6336617", "0.6295552", "0.62832344...
0.6419524
17
! Add a song to a playlist
async function addSong(req, res, next) { console.log('Adding song to playlist') try { const { playlistId, songId } = req.params req.body.user = req.currentUser console.log('request params: ', req.params) const playlist = await Playlist.findById(playlistId) // console.log('Playlist User', typeof ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addSongToPlaylist (e) {\n if (this.props.canAddDirectly) {\n this.props.addSong(this.props.activePlaylistID, this.props.trackInfo.uri);\n } else {\n this.props.addSongToDB(this.props.session.connected_session.data.joinCode, this.props.trackInfo, this.props.userId);\n }\n ...
[ "0.7873342", "0.7677184", "0.7629552", "0.76132697", "0.7579313", "0.74951136", "0.73436534", "0.73266304", "0.7267012", "0.72642636", "0.72255635", "0.71655977", "0.7118015", "0.7117786", "0.71171945", "0.70826054", "0.70504457", "0.70440406", "0.70247734", "0.70065856", "0....
0.64850163
59
! Remove a song from a playlist
async function removeSong(req, res, next) { try { const { playlistId, songId } = req.params const playlist = await Playlist.findById(playlistId).populate('songs') if (!playlist) { throw new NotFound(`Playlist with id: ${playlistId} does not exist.`) } if (!playlist.public && !playlist.users....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeFromPlaylist(playlist, artistName)\n{\n delete playlist[artistName]\n}", "function removeFromPlaylist(playlist, artistName){\n delete playlist[artistName];\n}", "function removeFromPlaylist(playlist, artistName) {\n// delete playlist.artist;\n delete playlist[artistName];\n return\n}", "f...
[ "0.81049955", "0.81025904", "0.79697376", "0.791647", "0.77599853", "0.7546924", "0.74673355", "0.74498385", "0.72700375", "0.7218919", "0.7213729", "0.7039262", "0.702661", "0.7024118", "0.7022187", "0.6930981", "0.69285554", "0.68981445", "0.68799055", "0.68553925", "0.6783...
0.72030795
11
NOTE: This is currently pretty much hardcoded to GCS we'll need to make this pluginable at some stage
function publishContent(currentDirectory, statyckConfig, callback) { if (!(typeof currentDirectory === 'string')) { throw new TypeError("Value of argument \"currentDirectory\" violates contract.\n\nExpected:\nstring\n\nGot:\n" + _inspect(currentDirectory)); } if (!(statyckConfig instanceof Object))...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function main(\n bucketName = 'my-bucket',\n contents = 'these are my file contents',\n destFileName = 'file.txt',\n generationMatchPrecondition = 0\n) {\n // [START storage_upload_without_authentication]\n /**\n * TODO(developer): Uncomment the following lines before running the sample.\n */\n // The I...
[ "0.59337705", "0.59263813", "0.5902599", "0.57244325", "0.5717236", "0.57163745", "0.5605475", "0.5575883", "0.5423533", "0.5423533", "0.5423533", "0.5423533", "0.5423533", "0.539048", "0.53614956", "0.53597564", "0.53062487", "0.52984977", "0.52737", "0.5270933", "0.5263212"...
0.0
-1
Main/Setup function, initialize stuff...
async function main() { image = await loadImage('./Apollo11HP-128539876.jpg'); imageData = await readImageData(image); new p5((p_) => { p = p_; p.setup = setup; }, elements.container); // Settings gui.add(settings, 'omega', 0, 1).step(0.01).onFinishChange(drawThrottled); gui.add(settings, 'phase...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _setup () {\n }", "function setup() {}", "setup() {}", "setup() {}", "setup() {}", "function main() {\r\n initFlags();\r\n fixMarkup();\r\n changeLayout();\r\n initConfiguration();\r\n}", "initialise () {}", "function _main() {\n log('> lesslms init...', 'info');\n _...
[ "0.77655905", "0.7694501", "0.7633991", "0.7633991", "0.7633991", "0.74172056", "0.74151796", "0.7229239", "0.71484035", "0.71484035", "0.71484035", "0.71484035", "0.71484035", "0.71484035", "0.71484035", "0.71484035", "0.71484035", "0.71484035", "0.7136952", "0.70935816", "0...
0.0
-1
Listen dragover event for drag&drop
function onDragOver(event) { // Prevent default behavior (Prevent file from being opened) event.preventDefault(); event.dataTransfer.dropEffect = 'copy'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dragOverHandler(ev) {\n // console.log('File(s) in drop zone');\n\n // Prevent default behavior (Prevent file from being opened)\n ev.preventDefault();\n}", "function dragOver(e){\n //we have to prevent the defaullt behavior or drop will not work \n e.preventDefault();\nconsole.log('over');\n\n...
[ "0.769651", "0.76147044", "0.75004053", "0.7474787", "0.74141115", "0.7351664", "0.7288885", "0.728741", "0.7240025", "0.7213235", "0.7125893", "0.7100127", "0.70821434", "0.70630836", "0.70545024", "0.7022991", "0.7002271", "0.699019", "0.69885576", "0.6972374", "0.69563496"...
0.68473554
29
Listen drop event for drag&drop
async function onDrop(event) { // Prevent default behavior (Prevent file from being opened) event.preventDefault(); if (event.dataTransfer.files) { onFilesDroppedOrSelected(event.dataTransfer.files); } else { console.log(`Your browser does not support FileList`); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static dragEvents(){\n //enter drag\n Quas.on(\"dragenter dragstart\", \".drop\", function(e){\n e.preventDefault();\n new Element(this).addCls(\"dragenter\");\n });\n\n //exit drag\n Quas.on(\"dragend dragleave\", \".drop\", function(e){\n e.preventDefault();\n new Element(this)...
[ "0.764663", "0.75064576", "0.73780066", "0.73323184", "0.72952396", "0.7266148", "0.7223049", "0.7125478", "0.7116659", "0.70849293", "0.7083214", "0.70670176", "0.70559156", "0.70256853", "0.7014486", "0.7008006", "0.69967324", "0.6996727", "0.69838995", "0.6945833", "0.6939...
0.7139374
7
Main method for drag & drop or fileinput selection.
async function onFilesDroppedOrSelected(fileList) { const images = []; // Use DataTransferItemList interface to access the file(s) for (let i = 0; i < fileList.length; i++) { // If dropped items aren't files, reject them const file = fileList[i]; if (file.type.split('/')[0] == 'image') { images....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function CdkDragDrop() {}", "function CdkDragDrop() {}", "function mouseDragged(){\r\n inputForMDragging(mouseX, mouseY);\r\n\r\n\r\n}", "function InitDragDrop() {\n document.onmousedown = OnMouseDown;\n document.onmouseup = OnMouseUp;\n}", "function SelectionUtil() {\n}", "function dragAction() {\n ...
[ "0.64888227", "0.64888227", "0.6236188", "0.6157477", "0.6138555", "0.61237496", "0.6038748", "0.60213727", "0.6013821", "0.5990888", "0.5983206", "0.5976383", "0.5976149", "0.5962859", "0.5946961", "0.5946084", "0.5946084", "0.5946084", "0.5946084", "0.59139776", "0.5886861"...
0.0
-1
Bookmark has a search method but it searches all bookmarks, and we want sometimes to search only in a specific folder
function searchBookmarks(bookmarks, title, url) { let id = 0; console.debug(`Looking for bookmark: ${title} | ${url}`); recursiveSearch(bookmarks, title, url); // Save the new id, only if the id isn't set already (which means we've already found the id) function recursiveSearch(bookmarks, title, u...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function search( query ) {\n return new Promise( function( resolve, reject ) {\n chrome.bookmarks.search( query, function( results ) {\n var matchingItem = $.map( results, function( el, i ) {\n var item; // On ne renvoie que les bookmarks et non les folder qui n'ont pas d'url\n ...
[ "0.7174473", "0.7144372", "0.67589307", "0.63361156", "0.60026115", "0.6002369", "0.58503383", "0.5850192", "0.58499193", "0.58217025", "0.58047426", "0.5787057", "0.5689169", "0.5679823", "0.5670408", "0.56509095", "0.56009245", "0.55604416", "0.5556581", "0.55502653", "0.55...
0.6147131
4
Save the new id, only if the id isn't set already (which means we've already found the id)
function recursiveSearch(bookmarks, title, url) { bookmarks.forEach(function (bm) { //console.debug(`bookmark: ${bm.title} (${bm.id})`); if (!id && bm.title == title) { console.debug(`Found bookmark by title: ${title} (id: ${bm.id})`); id = bm.id; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setID(id = false) {\n if (id) {\n // user input ID\n this.id = id + 1;\n return id;\n } else {\n // system generated ID\n const currentID = this.id;\n this.id++;\n return currentID;\n }\n }", "set id(newId) {\n ...
[ "0.6788976", "0.6630375", "0.66057104", "0.6602518", "0.65621465", "0.652492", "0.6514293", "0.64927334", "0.6440393", "0.6436303", "0.6436303", "0.6436303", "0.6436303", "0.6436303", "0.6436303", "0.6436303", "0.640295", "0.63926566", "0.63926566", "0.63828045", "0.63131213"...
0.0
-1
Don't use the tab passes in the listener cb, the groupid is 1 for tabs with pdf
async function onClickSave(info, _tab) { let [tab] = await chrome.tabs.query({ active: true, currentWindow: true }); // Return if not part of group if (tab.groupId < 0) { return; } // Get the group id the current tab is in let tabGroup = await chrome.tabGroups.get(tab.groupId); //...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onTab(cb) {\n\tvar innerPage = $('.inner-page');\n\tinnerPage.keydown(function(e){\n\t\tif (e.keyCode == 9) {\n\t\t\te.preventDefault();\n\t\t\tcb();\n\t\t}\n\t}) ;\n}", "function delegate_to(tab_id)\n {\n menu_tab_id = tab_id;\n browser.browserAction.setPopup({ popup: \"\" });\n ...
[ "0.60052884", "0.5792593", "0.57242966", "0.56535596", "0.5599043", "0.55933475", "0.557134", "0.557134", "0.557134", "0.5533603", "0.55155206", "0.54987967", "0.54798806", "0.5465833", "0.54649013", "0.54603064", "0.54462886", "0.5443687", "0.5432642", "0.54309964", "0.54222...
0.5016745
94
'raised': default styling give button a slightly better look We're going to pass down a prop from the Welcome screen, this callback should be called whenever user presses. 'this.props.onComplete' not any parentheses. This is supposed to be a function right here. We only want to call this at some point in the future (ca...
renderLastSlide(index) { if (index === this.props.data.length - 1) { return ( <View style={{ marginTop: 15 }}> <Button title="Onwards!" raised buttonStyle={styles.buttonStyle} onPress={this.props.onComplete} />...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handleOnClick () {\n this.props.callback()\n }", "renderThank()\n {\n \treturn (\n \t\t<div>\n \t\t<h3 style={{color:myMuiTheme.palette.primary1Color}}>Thanks for filling out our survey! Click the button below to proceed to our main website. </h3><br/>\n <RaisedButton label=\"Main Page\" secondar...
[ "0.5806638", "0.5769376", "0.57244176", "0.5631941", "0.56248766", "0.5567545", "0.5444422", "0.54423654", "0.54245824", "0.5413877", "0.5387529", "0.53782547", "0.5376096", "0.5366528", "0.53556865", "0.53441066", "0.5342579", "0.5336331", "0.5334516", "0.53343713", "0.53257...
0.49627197
87
render each slides of Welcome screen
renderSlides() { // Every single object that's inside of props stack data will create a new view contain the slide text // 'slide' is record object of 'data' in 'map' function, ex: { text: 'Welcome to JobApp' } return this.props.data.map((slide, index) => { return ( <View key={slide...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderWelcomeScreen(){\r\n getTemplateAjax('./templates/welcome.handlebars', function(template) {\r\n welcomeData =\r\n {welcomeTitle: \"Hey. Where do you want to park?\", welcomeMessage: \"Single-origin coffee portland squid tofu 3 wolf moon fixie thundercats single-origi...
[ "0.63974184", "0.61666", "0.5977492", "0.58972645", "0.5822634", "0.57612383", "0.5759071", "0.5750823", "0.57508206", "0.57394934", "0.570845", "0.5707086", "0.5699832", "0.56935453", "0.56266135", "0.56191504", "0.56122166", "0.5607254", "0.55944765", "0.5589179", "0.557475...
0.59890044
2
'pagingEnabled': automatically advance to closest page when user drag halfway
render() { return ( <ScrollView horizontal style={{ flex: 1}} pagingEnabled > {this.renderSlides()} </ScrollView> ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updatePage(){\n let curPage = this.options.paging.offset,\n idxs = this.getFirstLastIndexes();\n\n if (this.options.internal.oldScrollPosition === undefined){\n this.options.internal.oldScrollPosition = 0;\n }\n\n let oldScrollPosition = this.options.internal.oldScrollPosition,\n new...
[ "0.6890989", "0.6751678", "0.664563", "0.6590988", "0.6527942", "0.652545", "0.65144897", "0.64308304", "0.6430493", "0.63952345", "0.6382977", "0.6330999", "0.6318201", "0.6307241", "0.6307241", "0.62920284", "0.62862074", "0.62853485", "0.6269437", "0.6225432", "0.62129825"...
0.0
-1
Returns a jwt token signed by the app secret
function signToken(id) { return jwt.sign({ _id: id }, config.server.session.secret, { expiresIn: config.server.session.expiresIn } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateToken(params = {}) {\n return jwt.sign(params, 'secret', {\n expiresIn: '30d',\n });\n}", "function signJWT () {\n return jwt.sign({ retire: 'fearlessly' }, secret);\n}", "function generateToken(params = {}) {\r\n return jwt.sign(params, authConfig.secret, {\r\n expiresIn: 8640...
[ "0.77316517", "0.766371", "0.75443083", "0.7524454", "0.7481579", "0.74680007", "0.7443508", "0.7406235", "0.7388811", "0.73745656", "0.7321042", "0.72938555", "0.72862524", "0.7280918", "0.7272536", "0.7270543", "0.7265712", "0.7243825", "0.72203034", "0.7209451", "0.7208188...
0.67913646
69
Compare two point objects. If the points are not of the same type, returns false. Otherwise, compares the points based on point type and returns true if all of their attributes are equal.
function comparePoints(point1, point2) { if (point1['point-type'] != point2['point-type']) { return false; } if (point1['point-type'] == 'text') { return point1['point-standout'] == point2['point-standout'] && point1['point-body'] == point2['point-body']; } else ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "compare(otherPoint) {\n if (typeof otherPoint === 'undefined') {\n console.warn('Compare Points: point not defined.');\n return false;\n }\n const a = E.toFixed(this.x) === E.toFixed(otherPoint.x);\n const b = E.toFixed(this.y) === E.toFixed(otherPoint.y);\n const c = E.toFixed(this.z) ===...
[ "0.73032194", "0.6706084", "0.6620259", "0.65700006", "0.6461407", "0.6461407", "0.6461407", "0.6461407", "0.6461407", "0.6461407", "0.6461407", "0.6461407", "0.6461407", "0.64458275", "0.635015", "0.6307292", "0.62162405", "0.6213716", "0.6202452", "0.6202452", "0.61630476",...
0.7397731
0
Challenge: Please fill the fridge array with 5 items of your choice. Challenge 2: You have bought some chicharon. Please remove it from the buyList and add it to the items in fridge. Challenge 3: Write a function that will remove an item from the fridge, and put it in the buyList, on the press of the moveUp button.
function moveUp() { //your code const fromFridge = fridge.pop(); if (fromFridge) { buyList.push(fromFridge); updateDisplay(); } else { return; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function moveDown() {\n //your code\n const fromBuyList = buyList.pop();\n if (fromBuyList) {\n fridge.push(fromBuyList);\n updateDisplay();\n } else {\n return;\n }\n}", "function moveUp(){\n //your code\n\n // if(fridge.length !== 0){\n // buyList.push(fridge[0]);\n // fridge....
[ "0.7375945", "0.7222851", "0.68677896", "0.65775746", "0.63470984", "0.6286866", "0.62413913", "0.6146107", "0.61089677", "0.609384", "0.6055145", "0.6038697", "0.6032609", "0.6022265", "0.6020042", "0.6019261", "0.6009115", "0.5976073", "0.59412724", "0.59295917", "0.5921889...
0.74078137
0
Challenge 4: Write a function that will remove the last item in the buyList, and put it in the fridge.
function moveDown() { //your code const fromBuyList = buyList.pop(); if (fromBuyList) { fridge.push(fromBuyList); updateDisplay(); } else { return; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function moveDown(){\n //your code\n \n if(buyList.length !== 0){\n var data = buyList.pop(data);\n fridge.push(data)\n console.log(buyList);\n console.log(fridge);\n buyListDisplay.innerHTML = buyList\n fridgeListDisplay.innerHTML = fridge\n } else {\n ...
[ "0.69768715", "0.6678475", "0.66551226", "0.66110116", "0.6450994", "0.6339073", "0.6301781", "0.6203413", "0.6164785", "0.6100684", "0.60594", "0.60248816", "0.59949416", "0.5978988", "0.5969556", "0.59448034", "0.59106505", "0.58444715", "0.5789116", "0.5766718", "0.5746339...
0.71033454
0
that the function only takes primitives as arguments. The function should return a function that, when called, will check if it has already computed the result and return that value instead if possible. Example: cacheAdd = myFunction(add); add(1,2) = 3 cacheAdd(1,2) = 3 > executes add function cacheAdd(1,2) = 3 > retur...
function myFunction(fn) { const cache = {}; return (...args) => { const key = args.join(','); if (key in cache) { console.log(`${cache[key]} --> returns from cache`); return cache[key]; } cache[key] = fn(...args); console.log(`${cache[key]} --> ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function memoize(fn){\n const cache={}\n return function(...args){\n if(cache[args]) return cache[args]\n \n const result = fn.apply(this,args)\n cache[args]=result\n \n return result\n }\n }", "function cacheFn(fn) {\n var cache={}\n return function(arg){\n if (cach...
[ "0.6663477", "0.6653556", "0.66089326", "0.6598487", "0.6592491", "0.65876186", "0.6572419", "0.65713215", "0.65421563", "0.651429", "0.6508785", "0.64846545", "0.64741707", "0.6466675", "0.64562154", "0.64161205", "0.64159185", "0.6398185", "0.6330992", "0.6330615", "0.63067...
0.68270266
0
a and b are javascript Date objects
function absDateDiffInDays(a, b) { // Discard the time and time-zone information. var utc1 = Date.UTC(a.getFullYear(), a.getMonth(), a.getDate()); var utc2 = Date.UTC(b.getFullYear(), b.getMonth(), b.getDate()); return Math.abs(Math.floor((utc2 - utc1) / _MS_PER_DAY)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sortDates(a, b){\n\treturn a.getTime() - b.getTime();\n}", "compareDate(a, b) {\n if (a.startDate < b.startDate) return -1\n if (a.startDate > b.startDate) return 1\n else return 0\n }", "function compareDates(a, b) {\n var aDate = a.date;\n var bDate = b....
[ "0.6679217", "0.6675048", "0.6673722", "0.64996946", "0.6491238", "0.64875215", "0.64517695", "0.6440893", "0.63916445", "0.63916445", "0.6371553", "0.636811", "0.6336262", "0.6336262", "0.63048345", "0.63048345", "0.62954015", "0.62926555", "0.62893444", "0.62878215", "0.627...
0.0
-1
console.log(sumRec([1, 2, 3, 4, 5]))
function exp1(base, n) { return n === 0 ? 1 : (base * exp1(base, n - 1)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sumRec(arr) {\n if (arr.length === 0) {\n return 0;\n }\n let num = arr.pop();\n return (num + sumRec(arr));\n}", "function sumRec(arr) {\n if (arr.length === 0) {\n return 0;\n } else {\n return arr[0] + sumRec(arr.slice(1));\n }\n}", "function sumRec(arr) {\n if (!ar...
[ "0.78357565", "0.7548966", "0.7379709", "0.7125858", "0.7030771", "0.6997942", "0.69947743", "0.6906726", "0.68929064", "0.6864391", "0.6862752", "0.6844838", "0.6842339", "0.6802809", "0.67849255", "0.67817044", "0.6756732", "0.6752692", "0.67502666", "0.6745069", "0.6711542...
0.0
-1
console.log(exp1(3, 2)); console.log(exp1(3, 3)); console.log(exp1(2, 3));
function exp2(base, n) { if (n === 0) { return 1 }; if ( n % 2 === 0 ) { let r = exp2(base, n / 2); return r * r; } else { let r = (exp2(base, (n - 1) / 2)); return base * (r * r); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function exp(args){\n return Math.exp(args);\n}", "function power(base1,exp1) {\n if (exp1 === 0){\n return 1\n }\n return base1 * power(base1, exp1-1)\n}", "function executeExponential(x, y) {\r\n if (x != NaN && y != NaN) {\r\n let result = \"\";\r\n let rollingResult = 1;\r\n fo...
[ "0.75251865", "0.69320565", "0.6508477", "0.65082073", "0.64467233", "0.644237", "0.64352137", "0.6420615", "0.6409875", "0.6405006", "0.6380284", "0.6370053", "0.6297289", "0.6287081", "0.62302244", "0.62291497", "0.62272763", "0.62026834", "0.6195902", "0.61886585", "0.6182...
0.59965193
33
console.log(exp2(3, 2)); console.log(exp2(3, 3)); console.log(exp2(2, 3));
function fibonacci(n) { if (n === 1) { return [1] }; if (n === 2) { return [1, 1] }; let seq = fibonacci(n - 1) seq.push(seq[seq.length - 1] + seq[seq.length - 2]) return seq; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function exp(args){\n return Math.exp(args);\n}", "function calculateExponent(num, exp) {\n\tconsole.log(Math.pow(num, exp));\n}", "function exp2(base, n) {\n if (n === 0) { return 1 };\n \n if ( n % 2 === 0 ) {\n let r = exp2(base, n / 2);\n return r * r;\n } else {\n let r = (exp2(base, (n - ...
[ "0.78075117", "0.67616314", "0.66752636", "0.66433984", "0.6614532", "0.65487653", "0.6541627", "0.6509946", "0.6506188", "0.6499359", "0.64813286", "0.6444647", "0.6428656", "0.64080244", "0.6404586", "0.63999236", "0.6363756", "0.63568246", "0.63391805", "0.6336464", "0.630...
0.0
-1
console.log(bsearch([1, 2, 3, 4, 5], 4)) console.log(bsearch([1, 2, 3, 4, 5], 6)) console.log(bsearch([1, 2, 3, 4, 5], 2))
function mergesort(arr) { if (arr.length <= 1) return arr; let mid = Math.floor(arr.length / 2); let left = arr.slice(0, mid); let right = arr.slice(mid); let sortedLeft = mergesort(left); let sortedRight = mergesort(right); return merge(sortedLeft, sortedRight); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bSearch(arr, val) {\n let start = 0;\n let end = arr.length - 1;\n\n while (start < end) {\n const mid = Math.floor((end - start) / 2) + start;\n if (arr[mid] === val) {\n return mid;\n }\n if (arr[mid] < val) {\n start = mid + 1;\n } else {\n end = mid - 1;\n }\n }\n\...
[ "0.7907474", "0.7720652", "0.7702471", "0.76804096", "0.76533616", "0.7593267", "0.7464498", "0.74288505", "0.73829436", "0.72080445", "0.72036237", "0.7185125", "0.71798307", "0.71623886", "0.7039488", "0.7008269", "0.6988772", "0.69638926", "0.69556665", "0.69336563", "0.69...
0.0
-1
console.log(mergesort([5, 2, 1, 6, 5, 4]))
function subsets(array) { if (array.length === 0) { return [[]]; } const first = array[0]; const withoutFirst = subsets(array.slice(1)); const withFirst = withoutFirst.map(sub => [first].concat(sub)); return withoutFirst.concat(withFirst); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mergeSort(arr) {\n\n}", "function mergeSort(array) {\n\n}", "function merge_sort(array) {\r\n return merge_aux(array, 0, array.length - 1);\r\n}", "function mergeSort(arr) {\n\tif (arr.length <= 1) return arr;\n\n\tlet mid = Math.floor(arr.length / 2);\n\tlet left = mergeSort(arr.slice(0, mid));\...
[ "0.7887811", "0.78599733", "0.7670436", "0.7489469", "0.7483916", "0.73698163", "0.73154885", "0.7314436", "0.73112303", "0.72838956", "0.72726995", "0.7258133", "0.72579366", "0.7239169", "0.72365785", "0.72273886", "0.7225877", "0.7216468", "0.72042763", "0.72042763", "0.72...
0.0
-1
Complete the digitSum function below.
function superDigit(n, k) { if (n.length == 1 && k == 1) { return parseInt(n); } let sum = 0; for (let i = 0; i < n.length; i++) { sum += parseInt(n[i]) * k; } return superDigit(sum.toString(), 1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sumAllDigits(numberList) {\n if (!Array.isArray(numberList) || numberList.length === 0) return 0;\n let sum = 0;\n // numberList.forEach((x) => {\n // for (let index = 0; index < x.toString().length; index++) {\n // sum += +x.toString()[index];\n // }\n // });\n return numberList.reduce((a...
[ "0.702406", "0.6883595", "0.67919976", "0.66406155", "0.6639472", "0.65274787", "0.6510125", "0.6458426", "0.6386224", "0.6359574", "0.63417566", "0.63101995", "0.6310179", "0.63088745", "0.63049054", "0.6295773", "0.62824184", "0.6263402", "0.6259214", "0.6241843", "0.621152...
0.5825914
73
if user has input a start time, then use the user input to display, otherwise, display "Start Time"
renderStartTime() { if(this.state.startTime === "") { return("Start Time*"); } else { return(this.state.startTime.toString()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startTime() {\r\n var delta = Date.now() - start_time; // in milliseconds\r\n time.seconds = Math.floor((delta % (1000 * 60)) / 1000);\r\n time.minutes = Math.floor((delta % (1000 * 60 * 60)) / (1000 * 60));\r\n time.hours = Math.floor((delta % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));\r\n\r...
[ "0.72733974", "0.67191815", "0.6596169", "0.65809697", "0.6580765", "0.65429753", "0.65032536", "0.6488679", "0.64264697", "0.64244735", "0.64218986", "0.6412044", "0.63770914", "0.63741523", "0.6348156", "0.6334134", "0.63304025", "0.632782", "0.6320008", "0.62985444", "0.62...
0.6762123
1
if user has input a end time, then use the user input to display, otherwise, display "end Time"
renderEndTime() { if(this.state.endTime === "") { return("End Time*"); } else { return(this.state.endTime.toString()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function elementSelectedEndTime(){\r\n\tvar choice, throwAwayDate, hour, minute,timeDate;\r\n\tchoice = document.form.endTime.value;\r\n\tif (!(choice == \"\")) throwAwayDate = \"12/12/2000 \";\r\n\t//Date portion of Date object is not used, only the hours and minutes are used. Date object parses time fairly well....
[ "0.667933", "0.6667509", "0.6523096", "0.6487509", "0.6477516", "0.64736855", "0.64731383", "0.6409878", "0.6348529", "0.6298164", "0.6287669", "0.62502676", "0.62301624", "0.61882377", "0.6176649", "0.6166275", "0.6158592", "0.61551034", "0.6151506", "0.61425334", "0.6142533...
0.64368427
7
Append transformations to modelView
function multMatrix(m) { modelView = mult(modelView, m); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function transformFunction(model) {\n\t// Need to convert the model to a JSON object\n\tvar transform = model.toJSON();\n\ttransform.title = '' + transform.titulo;\n\ttransform.subtitle = \"Puesto: \" + transform.imagen + \" Salario: \" + transform.cuerpo;\n\treturn transform;\n}", "calculateModelView() {\n t...
[ "0.66571635", "0.635604", "0.6310226", "0.6130369", "0.6126833", "0.6086492", "0.6048927", "0.59227204", "0.58230454", "0.57894844", "0.5758964", "0.5709075", "0.5709075", "0.5579622", "0.55339485", "0.55339485", "0.55339485", "0.55339485", "0.5532243", "0.5532243", "0.553224...
0.0
-1
key: sourceName + sourceUnit
async sGetTxt ({ sourceName, sourceUnit }) { const key = `${sourceName}|||${sourceUnit}` let value = await txtController.getTxt(key) if (!value) { value = { key, sourceName, sourceUnit, name: sourceName.split('(')[0].trim(), unit: sourceUnit, ratio: 1, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "keyForSourceFile(srcDir, relativeFilename, options) {\n let absolutePath = path.join(srcDir, relativeFilename);\n let hash = this.hashForFile(absolutePath);\n return relativeFilename + \"@\" + hash.digest(\"hex\");\n }", "_generateSourceMap(baseDir, code, units){\n const sections = [];\n for (let...
[ "0.60280675", "0.566911", "0.5557074", "0.545335", "0.54494727", "0.5419924", "0.5396565", "0.53360385", "0.5331258", "0.52896374", "0.52795964", "0.5269703", "0.52488506", "0.5195081", "0.518896", "0.5184284", "0.51729786", "0.51406914", "0.5090437", "0.50810796", "0.5012169...
0.48730025
32
Pushes email to DB and also validates the customer input.
function subscribe(event) { event.preventDefault(); if ($email.val() === "") { $('#errorModal').modal({ show: true, }); $('#error').text("Please Enter An E-mail 😐"); } else { var emails = { email: $email.val(), }; $.post("/api/emails",...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function postsValidatedEmail() {\r\n if ($(\"#email\").val().length === 0) {\r\n //sets the background\r\n sendState(on, \"email\");\r\n\r\n //adds the data to the array\r\n addDataAllErrors(allErrorMess[0]);\r\n } else if (!validateEmail($(\"#email\").val())) {\r\n //sets the backgr...
[ "0.6261569", "0.6227997", "0.61971116", "0.60470176", "0.60024", "0.5932843", "0.5869347", "0.58640057", "0.5853498", "0.5839002", "0.58258295", "0.58194643", "0.58033925", "0.5773742", "0.5772486", "0.57627356", "0.5728164", "0.572404", "0.56651497", "0.5661379", "0.5659271"...
0.0
-1
panelstatus=true is sidepanel is open
function openpanel() { let topcell=document.getElementById("topcell"); let new_margin="350px"; panelstatus=true; sidepanel.style.width="300px"; sidepanel.style.paddingRight="10px"; container.style.marginLeft=new_margin; para.style.marginLeft=new_margin; topcell.style.marginLeft=new_margin; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sidePanel() {\n var x = document.getElementById(\"panelOpen\");\n if (x.style.display === \"none\") {\n x.style.display = \"block\";\n } else {\n x.style.display = \"none\";\n }\n}", "get isOpen() {\n return this._panel &&\n (this._panel.state == \"open\" || this._pane...
[ "0.7835428", "0.7289974", "0.7199308", "0.7139997", "0.7120259", "0.69672173", "0.66165495", "0.6614521", "0.65449375", "0.6543017", "0.65412164", "0.6526333", "0.6411253", "0.6396312", "0.6361279", "0.63382506", "0.6336879", "0.6313034", "0.63080853", "0.62811947", "0.626931...
0.60071975
32
This method will be invoked when the user enters the user's height
height(e) { this.setState({ height: e.nativeEvent.text }, function () { this.bmi(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getHeight(v) {\n self = v;\n self.prompt({\n type: 'input',\n name: 'height',\n default: false,\n message: 'Max height? ',\n },\n function(result){\n if (result.height)\n height = result.height;\n doResize(self);\n });\n}", "function validate_height() {\n\tvar heigh...
[ "0.69649816", "0.68736035", "0.68286514", "0.6766266", "0.66395575", "0.6597417", "0.6586647", "0.65657324", "0.6492461", "0.64117503", "0.63757414", "0.6331665", "0.6331053", "0.63237756", "0.63001287", "0.6211713", "0.61835086", "0.61806315", "0.61775804", "0.61756057", "0....
0.6197897
16
This method will be invoked when the user enters the user's weight
weight(e) { this.setState({ weight: e.nativeEvent.text }, function () { this.bmi(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleWeight(e) {\n e.preventDefault();\n dispatch(orderByWeight(e.target.value));\n setPagActual(1);\n }", "handleLetsGo(event) {\n event.preventDefault();\n const weight = this.element.value;\n if (this.state.accept) {\n //alert(\"start analysis your bmi ,wait...
[ "0.6976837", "0.6957045", "0.68216354", "0.6758603", "0.67144966", "0.67116195", "0.6620056", "0.65649325", "0.6563489", "0.65626895", "0.65352225", "0.65047073", "0.6482548", "0.6471021", "0.6451936", "0.6391041", "0.6355199", "0.6308896", "0.61773646", "0.61657387", "0.6101...
0.6698073
6
This method will be invoked to calculate the BMI
bmi(height, weight) { if (height > 0 && weight > 0) { var bmi = 10000 * (weight / ((height) * (height))); bmi = Math.round(bmi * 100) / 100 this.setState({ bmi: bmi }) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calculateBMI() {\n var weight = userInfo[\"weight\"];\n var height = userInfo[\"height\"];\n var BMI = weight / Math.pow(height, 2);\n return BMI;\n}", "calculeBMI() {\n this.BMI = this.WeightKg / Math.pow(this.convertHeightToMeters(this.HeightCm), 2);\n }", "function calculateBM...
[ "0.8692557", "0.8671378", "0.82417744", "0.8227532", "0.82113725", "0.80049515", "0.7958297", "0.7917055", "0.7903408", "0.7867024", "0.7863569", "0.7852842", "0.7776798", "0.7669113", "0.7634484", "0.7546499", "0.7507121", "0.74953115", "0.7487137", "0.748536", "0.74080545",...
0.78630936
11
This method will be invoked when the user enters his/her name
handleFullNameChange(event) { let processedData = event.nativeEvent.text; this.setState({ name: processedData }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateName() { changeTextField(name, nameLabel, isValidName()) }", "function updateName(event) {\r\n setUsername(event.target.value);\r\n }", "function tellName(name) {\n console.log('You have entered: ' + name);\n}", "function username(user_name){\n\tif( user_name === \"\" ){ \n\t\tuse...
[ "0.74174935", "0.7250252", "0.7209219", "0.7139617", "0.71203375", "0.70737875", "0.70715994", "0.7069905", "0.7017755", "0.6987538", "0.6976898", "0.69501346", "0.69161755", "0.69114155", "0.69069356", "0.68964934", "0.68955547", "0.6879597", "0.68628234", "0.68170005", "0.6...
0.0
-1
This method will be invoked when the user enters his/her doctor's id
handleDocIDChange(event) { let processedData = event.nativeEvent.text; this.setState({ doctor: processedData }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function doctorWasChanged(e) {\n console.log(e.target.value);\n set_selectedDocterId(e.target.value);\n }", "function goToAssessment(changerecordid) {\n boolAssessed = true;\n populateRecord(changerecordid);\n}", "function getIdFromInput() {\r\n\t\tlet id = document.getElementById(\"dateGet\").val...
[ "0.7060893", "0.5625815", "0.5618982", "0.5578958", "0.5578911", "0.5560217", "0.5503399", "0.550325", "0.5499633", "0.54661685", "0.54436845", "0.5436915", "0.54277563", "0.5353894", "0.5350977", "0.5335725", "0.53324103", "0.5323441", "0.5316069", "0.5312465", "0.52975184",...
0.5386754
13
This method will be invoked when the user enters the user's height
handleHeightChange(event) { let processedData = event.nativeEvent.text; this.setState({ height: processedData }) this.bmi(processedData, this.state.weight); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getHeight(v) {\n self = v;\n self.prompt({\n type: 'input',\n name: 'height',\n default: false,\n message: 'Max height? ',\n },\n function(result){\n if (result.height)\n height = result.height;\n doResize(self);\n });\n}", "function validate_height() {\n\tvar heigh...
[ "0.69657505", "0.6873752", "0.68288296", "0.6765178", "0.66402763", "0.65976703", "0.65873045", "0.6566793", "0.64935434", "0.6410726", "0.63767767", "0.6331607", "0.63315344", "0.6300445", "0.62113273", "0.619939", "0.61823785", "0.6180856", "0.6178543", "0.6177369", "0.6149...
0.63257915
13
This method will be invoked when the user enters the user's weight
handleWeighttChange(event) { let processedData = event.nativeEvent.text; this.setState({ weight: processedData }) this.bmi(this.state.height, processedData); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleWeight(e) {\n e.preventDefault();\n dispatch(orderByWeight(e.target.value));\n setPagActual(1);\n }", "handleLetsGo(event) {\n event.preventDefault();\n const weight = this.element.value;\n if (this.state.accept) {\n //alert(\"start analysis your bmi ,wait...
[ "0.69764465", "0.6958283", "0.6819909", "0.6757519", "0.67143446", "0.6710743", "0.66977143", "0.66195256", "0.6563841", "0.6562616", "0.65339017", "0.650378", "0.64817566", "0.64703846", "0.6451078", "0.6391222", "0.6355331", "0.6309383", "0.61765015", "0.6166209", "0.610204...
0.65627146
9
This is used to submit the user's details to the server
submitUserDataToTheServer() { Keyboard.dismiss() this.setState({visible:true}) let that = this axios.post("/signUp", { email: this.props.userData.email, password: this.props.userData.password, patientId: this.props.userData.id, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function userInformationSend() {\n let data = {\n email: document.getElementById('email').value,\n phoneNumber: document.getElementById('phoneNumber').value,\n bio: document.getElementById('bio').value\n }\n /* Use Fetch API */\n fetch(`/admin/mypage/${userId}/submit`, {\n m...
[ "0.707641", "0.70558834", "0.69420993", "0.6927481", "0.6854565", "0.6768359", "0.67116916", "0.66895527", "0.6684485", "0.6659695", "0.65590906", "0.65555555", "0.65481216", "0.653912", "0.6536494", "0.65220237", "0.64642054", "0.64473015", "0.6443442", "0.6438073", "0.64317...
0.0
-1
This is invoked to set the Firebase Storage URI of the image
setImageURI(result){ if (!result.cancelled) { this.setState({ base64: result.base64.replace(/(?:\r\n|\r|\n)/g, '') }) this.setState({ image: result.uri }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "uploadImage(e, method) {\n let imageObj = {};\n\n\n if (method === \"firebase\") {\n\n // // ===========FIREBASE=================\n let currentImageName = \"firebase-image-\" + Date.now();\n\n let uploadImage = storage.ref(`images/${currentImageName}`).put(e.target.fi...
[ "0.6930999", "0.66453564", "0.65653354", "0.65113467", "0.6494439", "0.64326835", "0.6365292", "0.63399875", "0.63270897", "0.6274557", "0.620569", "0.61372507", "0.6120579", "0.6118924", "0.61176103", "0.6092282", "0.60861295", "0.6057386", "0.603521", "0.60290104", "0.60062...
0.5769155
42
private functions called when closing the function edit popup
function AddFunctionOnClose(radWin) { var refresh = false; if (radWin != null && typeof (radWin.IsDirty) == 'boolean') { refresh = radWin.IsDirty; } else { // if for some reason we dont get a rad window then assume we should refresh refresh = true; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cancelEdit(){\n //close edit box\n closeEditBox();\n}", "function editCancelFunc(){\n setEdit(null);\n }", "function pageEditClose() {\n return PageService.pageEditClose();\n }", "function closePriviousEdit() {\n if (openedEditForm) {\n openedEditForm.valu...
[ "0.74142206", "0.7197586", "0.69760484", "0.69574535", "0.6905619", "0.68475544", "0.67945045", "0.6736883", "0.66694677", "0.6661249", "0.6629173", "0.66277254", "0.65984076", "0.6548648", "0.6526721", "0.6526353", "0.65108955", "0.6509066", "0.6504956", "0.65037054", "0.650...
0.0
-1
called when closing the function display popup
function DisplayFunctionOnClose(radWin) { var refresh = false; if (radWin != null && typeof (radWin.IsDirty) == 'boolean') { refresh = radWin.IsDirty; } else { // if for some reason we dont get a rad window then assume we should refresh refresh = true;...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static popup_close() {\n const context = Utils.popup_context.pop();\n if (typeof AGGrid !== 'undefined')\n AGGrid.popGridContext();\n Utils.popEnterContext();\n $('#' + context.id).hide();\n Utils.globalEnterHandler(context.globalEnterHandler);\n Utils.popup_zin...
[ "0.796916", "0.78591967", "0.78101265", "0.74291205", "0.74081683", "0.72970194", "0.7294586", "0.72763556", "0.72682285", "0.7247461", "0.7233407", "0.7229911", "0.7227244", "0.720264", "0.720264", "0.7195839", "0.71790797", "0.716668", "0.7161987", "0.71552444", "0.71318", ...
0.0
-1
disable the add/remove registration/itinerary hyperlinks in the program listing permanently disables them, the page must postback in order for them to be restored
function DisableRegisterFunctionHyperLinks() { jQuery("." + registerFunctionHyperlinkMarkerClass).removeAttr("href").css("color", "#bebebe"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function DisableDataEntryPage()\n{ \n var preventDisableAttr = 'preventModifyDisable';\n\n $(\"input\").not(\"[\" + preventDisableAttr + \"=true]\").each(function() {\n $(this).attr(\"disabled\", \"disabled\");\n });\n\n $(\"select\").not(\"[\" + preventDisableAttr + \"=true]\").each(function() {\n $(th...
[ "0.7131124", "0.6503595", "0.63933545", "0.63676035", "0.632956", "0.62893784", "0.6275987", "0.6263074", "0.62627476", "0.62507725", "0.6219726", "0.6200648", "0.61180675", "0.6100978", "0.60971737", "0.6054644", "0.6044146", "0.6030859", "0.5998932", "0.597162", "0.59482604...
0.6523637
1
Primed effect, ready to invoke
function Aff(tag, _1, _2, _3) { this.tag = tag; this._1 = _1; this._2 = _2; this._3 = _3; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function runEffect() {\n var effectArray = [\"blind\", \"clip\", \"drop\", \"explode\", \"fold\", \"puff\"];\n var effectNumber = Math.floor(Math.random() * 6) + 1;\n effectNumber--;\n effect = effectArray[effectNumber];\n $(\"#gamerules\").effect(effect, 750);\n $(\"#star...
[ "0.6503705", "0.63226336", "0.6289637", "0.62135917", "0.6164148", "0.6048795", "0.60197866", "0.6010513", "0.59172696", "0.59116167", "0.5897953", "0.5859561", "0.58467215", "0.57882816", "0.5788027", "0.5788027", "0.5788027", "0.57869935", "0.5724118", "0.5718581", "0.57078...
0.0
-1
The entire fiber has completed.
function Fiber(util, supervisor, aff) { // Monotonically increasing tick, increased on each asynchronous turn. var runTick = 0; // The current branch of the state machine. var status = SUSPENDED; // The current point of interest for the state machine branch. var step = aff; /...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function complete() {\n\tconsole.log('Completed');\n}", "finishProcessing() {\n this.busy = false;\n this.successful = true;\n }", "complete() {}", "finish() {\n this.done = true;\n }", "function complete() {\n\t\t\tcallbackCount++;\n\t\t\tif(callbackCount >= 1) {\n\t\t\t\t//console.lo...
[ "0.6859057", "0.6632369", "0.6494636", "0.63940823", "0.6317801", "0.6276546", "0.626198", "0.6189001", "0.61740786", "0.615315", "0.6152703", "0.6152703", "0.6152703", "0.6152703", "0.6145352", "0.61139035", "0.60773313", "0.6077231", "0.6074972", "0.6058745", "0.60489327", ...
0.0
-1
Each invocation of `run` requires a tick. When an asynchronous effect is resolved, we must check that the local tick coincides with the fiber tick before resuming. This prevents multiple async continuations from accidentally resuming the same fiber. A common example may be invoking the provided callback in `makeAff` mo...
function run(localRunTick) { var tmp, result, attempt; while (true) { tmp = null; result = null; attempt = null; switch (status) { case STEP_BIND: status = CONTINUE; try { step = bhead(step); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static deferredRun(...args) {\n var reactive, cb;\n if (args.length == 2) {\n reactive = args[0];\n cb = args[1];\n } else {\n reactive = this._internal[0];\n cb = args[0];\n }\n // Once executed the first time, call the callback\n var autorun = 0;\n var computation = Tesse...
[ "0.6128974", "0.58031833", "0.58031833", "0.58031833", "0.58031833", "0.57707703", "0.57707703", "0.57490844", "0.57490844", "0.5741124", "0.5722254", "0.5722254", "0.5708513", "0.54968584", "0.5473654", "0.5473654", "0.54087937", "0.54087937", "0.5328791", "0.53110456", "0.5...
0.53848475
20
Walks a tree, invoking all the cancelers. Returns the table of pending cancellation fibers.
function kill(error, par, cb) { var step = par; var head = null; var tail = null; var count = 0; var kills = {}; var tmp, kid; loop: while (true) { tmp = null; switch (step.tag) { case FORKED: if (step._3 === EMPTY) {...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cancel(error, cb) {\n interrupt = util.left(error);\n var innerKills;\n\n for (var kid in kills) {\n if (kills.hasOwnProperty(kid)) {\n innerKills = kills[kid];\n\n for (kid in innerKills) {\n if (innerKills.hasOwnProperty(kid)) {\n ...
[ "0.48802206", "0.4814092", "0.4814092", "0.4814092", "0.4814092", "0.4814092", "0.4814092", "0.47828734", "0.47828734", "0.44948825", "0.4485283", "0.44197616", "0.43601492", "0.4337563", "0.430427", "0.42914742", "0.42650235", "0.42486465", "0.42313492", "0.42152625", "0.421...
0.40950757
38
When a fiber resolves, we need to bubble back up the tree with the result, computing the applicative nodes.
function join(result, head, tail) { var fail, step, lhs, rhs, tmp, kid; if (util.isLeft(result)) { fail = result; step = null; } else { step = result; fail = null; } loop: while (true) { lhs = null; rhs = null; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function run() {\n var status = CONTINUE;\n var step = par;\n var head = null;\n var tail = null;\n var tmp, fid;\n\n loop: while (true) {\n tmp = null;\n fid = null;\n\n switch (status) {\n case CONTINUE:\n switch (step.tag) {\n cas...
[ "0.635805", "0.635805", "0.6323152", "0.6305275", "0.6305275", "0.6305275", "0.6305275", "0.6305275", "0.6305275", "0.61049896", "0.61049896", "0.61034787", "0.61016244", "0.6070817", "0.60692793", "0.6054034", "0.6044368", "0.60350144", "0.60350144", "0.60350144", "0.6034226...
0.0
-1
Walks the applicative tree, substituting nonapplicative nodes with `FORKED` nodes. In this tree, all applicative nodes use the `_3` slot as a mutable slot for memoization. In an unresolved state, the `_3` slot is `EMPTY`. In the cases of `ALT` and `APPLY`, we always walk the left side first, because both operations are...
function run() { var status = CONTINUE; var step = par; var head = null; var tail = null; var tmp, fid; loop: while (true) { tmp = null; fid = null; switch (status) { case CONTINUE: switch (step.tag) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reduceLeftmostOutermost(exp) {\n if (exp[0] === \"var\") {\n return [false, exp];\n } else if (exp[0] === \"lam\") {\n var [reduceHappened, reducedBody] = reduceLeftmostOutermost(exp[2]);\n return [reduceHappened, [exp[0], exp[1], reducedBody]];\n } else {\n // app\n ...
[ "0.5131394", "0.5002274", "0.47398615", "0.47051564", "0.46100226", "0.46100226", "0.46100226", "0.46100226", "0.46100226", "0.46100226", "0.46007454", "0.46007454", "0.4547759", "0.4469237", "0.44272396", "0.43940535", "0.4392496", "0.43687135", "0.43284127", "0.4323733", "0...
0.407574
88
Cancels the entire tree. If there are already subtrees being canceled, we need to first cancel those joins. We will then add fresh joins for all pending branches including those that were in the process of being canceled.
function cancel(error, cb) { interrupt = util.left(error); var innerKills; for (var kid in kills) { if (kills.hasOwnProperty(kid)) { innerKills = kills[kid]; for (kid in innerKills) { if (innerKills.hasOwnProperty(kid)) { innerKills...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function repoAbortTransactions(repo, path) {\n var affectedPath = treeGetPath(repoGetAncestorTransactionNode(repo, path));\n var transactionNode = treeSubTree(repo.transactionQueueTree_, path);\n treeForEachAncestor(transactionNode, function (node) {\n repoAbortTransactionsOnNode(repo, node);\n ...
[ "0.5689018", "0.54323924", "0.54191774", "0.524527", "0.5235297", "0.52264637", "0.5205375", "0.5180614", "0.5159359", "0.5159359", "0.5123126", "0.5114417", "0.5081385", "0.5081385", "0.5081385", "0.5081385", "0.5081385", "0.5081385", "0.5081385", "0.5081385", "0.5081385", ...
0.5037751
28
This class defines a complete listener for a parse tree produced by XMLParser.
function XMLParserListener() { antlr4.tree.ParseTreeListener.call(this); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sectealListener() {\n\tantlr4.tree.ParseTreeListener.call(this);\n\treturn this;\n}", "function RListener() {\n\tantlr4.tree.ParseTreeListener.call(this);\n\treturn this;\n}", "function statListener() {\n\tantlr4.tree.ParseTreeListener.call(this);\n\treturn this;\n}", "function SHRDataElementParserL...
[ "0.63614464", "0.6252038", "0.6239024", "0.60875773", "0.6012387", "0.59997827", "0.5942085", "0.58709735", "0.5836972", "0.5836972", "0.5836972", "0.5836972", "0.5836972", "0.5836972", "0.5830943", "0.5778998", "0.575439", "0.5744269", "0.57429546", "0.5710543", "0.57002974"...
0.7505715
0
opt.check : check window top or window bottom? opt.class : class to toggle opt.onCross : function that is called on crossing target opt.offset : limit offset from el.offset().top
function UmScrollCheck(el, opt){ var win = $(window); var t = this; t.check = ( opt ) ? (opt.check || 'top' ) : 'top'; t.class = ( opt ) ? ( opt.class || 'shown' ) : 'shown'; t.onCross = ( opt ) ? ( opt.onCross || function(){} ) : function(){}; t.offset = ( opt ) ? ( opt.offset || 0 ) : 0; var target = el.offs...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkOffset() {\n\n if ($(\"#head\").offset().top > 77) {\n \t$(\"#head\").removeClass(\"tall\");\n $(\"#head\").addClass(\"collapsed\");\n\n\n \n } \n else if($(\"#head\").offset().top < 20) {\n \t$(\"#head\").addClass(\"tall\");\n $...
[ "0.6633101", "0.6298274", "0.6096338", "0.6056699", "0.5963251", "0.58548504", "0.584619", "0.57902753", "0.57876086", "0.578115", "0.57399976", "0.5671648", "0.56478286", "0.5591243", "0.5589629", "0.5555272", "0.55435866", "0.5536853", "0.55211794", "0.5492056", "0.5452469"...
0.7553396
0
load button ////////////////////////////////////////////////////////////load button ////////////////////////////////////////////////////////////load button ////////////////////////////////////////////////////////////load button ////////////////////////////////////////////////////////////load button ////////////////////...
function load_element_button() { console.log("recup Element") const waitingWrapper = document.querySelector("#waiting-wrapper") const questionAndRepWrapper = document.querySelector("#questionAndRepButton-wrapper") const buttonP = document.querySelector("#buttonP") const buttonN = document.query...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadButtons() {\n\tgetNumbers();\n getOperators();\n getExecuteOperationButton();\n\tgetClearButton();\n\tgetclearEverythingButton();\n\tgetRemoveLastButton();\n\tgetOpenParenthesesButton();\n\tgetCloseParenthesesButton();\n\tgetSquareButton();\n\tgetSquareRootButton();\n\tgetAnsButton();\n}", "fu...
[ "0.7654803", "0.70536375", "0.6884704", "0.6774222", "0.67694557", "0.67213917", "0.66893005", "0.66649187", "0.66617477", "0.66394806", "0.66117877", "0.6543771", "0.6483038", "0.6476322", "0.6473654", "0.6468095", "0.6465105", "0.64308304", "0.64095616", "0.639694", "0.6384...
0.0
-1
load slide ////////////////////////////////////////////////////////////load slide ////////////////////////////////////////////////////////////load slide ////////////////////////////////////////////////////////////load slide ////////////////////////////////////////////////////////////load slide /////////////////////////...
function load_element_slide() { console.log("recup Element") const waitingWrapper = document.querySelector("#waiting-wrapper") const questionAndRepWrapper = document.querySelector("#questionAndRepSlide-wrapper") const pPreviewRep1 = document.querySelector("#previewRep1 p") const previewRep1 =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadSlide(){\r\n\r\n\t\t\tif(_loading == 0)\r\n\t\t\t\tcheckWidthI = setInterval(checkWidth, 100);\r\n\r\n\t\t\tvar $slide = $slides.eq(_loading);\r\n\r\n\t\t\tif($slide.hasClass('zetaTextBox')){\r\n\r\n\t\t\t\tcontinueLoading($slide);\r\n\r\n\t\t\t}else if($slide.hasClass('zetaVideoBox')){\r\n\r\n\t\t\t\...
[ "0.7590229", "0.7177713", "0.69401866", "0.6809949", "0.67655057", "0.6640759", "0.66163397", "0.65466505", "0.65345395", "0.65345395", "0.64812076", "0.64728177", "0.6463014", "0.6385578", "0.6375247", "0.6343311", "0.6331319", "0.6299977", "0.62960774", "0.6276519", "0.6274...
0.0
-1
Define an async test based on a generator function
function asyncTest(generator) { return () => Task.spawn(generator).then(null, ok.bind(null, false)).then(finish); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function It(testName, generatorFn) {\n it(testName, function(done) {\n Promise.coroutine(generatorFn)(done);\n })\n}", "async function test() {}", "async runTest() {}", "function Test_Test() {\n return __awaiter(this, void 0, void 0, function () {\n var a, b;\n return __generato...
[ "0.74793214", "0.7470799", "0.7167396", "0.686909", "0.6646867", "0.6463009", "0.6463009", "0.6422385", "0.63445276", "0.63445276", "0.63445276", "0.6327872", "0.6322496", "0.62177676", "0.620974", "0.61521703", "0.6121818", "0.6117581", "0.61064905", "0.60528594", "0.6047833...
0.8032856
1
Wait for the layoutviewupdated event
function waitForUpdate(inspector) { return inspector.once("layoutview-updated"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_onLayoutModified() {\n void this._layoutDebouncer.invoke();\n }", "firstLayoutCompleted() {\n if (!this.hideBlurryPlaceholder_()) {\n this.togglePlaceholder(false);\n }\n }", "setNeedsLayout() {\n\t\tif(this._layoutTimerId == null) {\n\t\t \tthis._layoutTimerId = setTimeout( () => {\n\t\...
[ "0.67233354", "0.65272635", "0.6435272", "0.634359", "0.6277275", "0.6096522", "0.60790145", "0.60026866", "0.5986481", "0.5981656", "0.5981656", "0.596828", "0.5964057", "0.59005827", "0.5887196", "0.58841723", "0.58275425", "0.57844794", "0.5735373", "0.56895703", "0.568533...
0.7367081
0
Created and maintained by Natalie Orsi at
function CursorObj(x, y) { this.pos = createVector(x, y); this.yvel = 1; this.xvel = 1; var speed_limit = 2.5; this.sl_sq = speed_limit * speed_limit; this.y_acc = 0; this.x_acc = 0; this.sensitivity = 1; this.up = function() { new_speed = this.yvel - this.y_acc - this.sensitivity; //Check if...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private public function m246() {}", "private internal function m248() {}", "protected internal function m252() {}", "transient private protected internal function m182() {}", "transient protected internal function m189() {}", "transient private internal function m185() {}", "transient final protected i...
[ "0.64787865", "0.6409103", "0.6325799", "0.62070125", "0.6174635", "0.6155929", "0.60045713", "0.5754971", "0.5736103", "0.5711076", "0.5698348", "0.56910825", "0.5681116", "0.56491894", "0.558562", "0.5577594", "0.55676657", "0.5567567", "0.5535617", "0.54461586", "0.5442664...
0.0
-1
Should return [[5,3,4,6,7,8,9,1,2], [6,7,2,1,9,5,3,4,8], [1,9,8,3,4,2,5,6,7], [8,5,9,7,6,1,4,2,3], [4,2,6,8,5,3,7,9,1], [7,1,3,9,2,4,8,5,6], [9,6,1,5,3,7,2,8,4], [2,8,7,4,1,9,6,3,5], [3,4,5,2,8,6,1,7,9]]
function sudoku (puzzle) { loopRows // check 1-9 >> 9 of these loopColumns // check 1-9 >> 9 of these loop3x3Squares // check 1-9 >> theres 9 of these }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function test() {\n var arr = [];\n arr[0] = [1, 2, 3, 4, 5];\n arr[1] = [1, 2, 3, 4, 5];\n arr[2] = [1, 2, 3, 4, 5];\n arr[3] = [1, 2, 3, 4, 5];\n arr[4] = [1, 2, 3, 4, 5];\n arr[5] = [1, 2, 3, 4, 5];\n arr[6] = [1, 2, 3, 4, 5];\n arr[7] = [1, 2, 3, 4, 5];\n arr[8] = [1, 2, 3, 4, 5];\n arr[9] = [1, 2, ...
[ "0.63921815", "0.61343616", "0.5943706", "0.5927323", "0.59197205", "0.5893557", "0.5875029", "0.5855673", "0.58033496", "0.57939804", "0.5763032", "0.57157457", "0.5675868", "0.5664415", "0.5655421", "0.56474704", "0.56410486", "0.56101435", "0.5598707", "0.5590937", "0.5586...
0.0
-1
Close when someone clicks on the "x" symbol inside the overlay
function closeNav() { document.getElementById("myNav").style.left = "-100vw"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "close(){Overlay.overlayStack.closeOverlay(this.overlayElement);}", "close() {\n this.overlayManager.close(this.overlayName);\n }", "function onBackdropClick() {\n close();\n }", "function overlayClick() {\n\toverlay.onclick = function() {\n\t\tcloseOverlay();\n\t}\n}", "function closeOv...
[ "0.73394465", "0.7004397", "0.6806166", "0.67815644", "0.6752815", "0.6725072", "0.6631751", "0.65811694", "0.6576064", "0.65751594", "0.6536907", "0.6497751", "0.6468628", "0.64231944", "0.64206433", "0.64097744", "0.6408323", "0.6369231", "0.63564783", "0.63530755", "0.6350...
0.0
-1
fn for creating the grid
function createGrid(n) { for (var i = 0; i < n; i++) { for (var j = 0; j < n; j++) { $('.container').append('<div class="square"></div>'); } } //set dimensions $('.square').css('height', 960 / n + 'px'); $('.square').css('width', 960 / n + ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeGrid() {\n\n\n}", "function createGrid(width, height) {\n\n}", "createGrids () {\n }", "function createGrid(){\n for (let i=0; i<gridSize; i++) {\n const div = document.createElement('div');\n grid.appendChild(div);\n // Push elements to previously empty cells array\n cel...
[ "0.8553344", "0.85037625", "0.84827507", "0.7795531", "0.7753312", "0.7719408", "0.7676123", "0.7655384", "0.7632385", "0.7601156", "0.75957614", "0.75624585", "0.755135", "0.7548448", "0.7548448", "0.7548448", "0.7548448", "0.7543822", "0.750867", "0.75029343", "0.74987143",...
0.0
-1
remove square divs and create new grid
function reset(n) { $('.container > div').remove(); createGrid(n); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clearGrid(){\n $('.wrapper > div').remove();\n var num = 10\n userGridSize(num);\n changeSquareColor();\n}", "function removeGridChilds() {\n while (sketchContainer.firstChild) {\n sketchContainer.removeChild(sketchContainer.lastChild);\n }\n}", "function removegrid(size) {\n for (le...
[ "0.7590309", "0.74371094", "0.74180007", "0.7365515", "0.72825736", "0.72205514", "0.71836823", "0.7170739", "0.712996", "0.7052991", "0.69689775", "0.6905739", "0.6900515", "0.6884381", "0.6874816", "0.68734795", "0.6867835", "0.68676376", "0.681842", "0.67905647", "0.678880...
0.6410736
49
This function should run as soon as the page loads and update the correct student info
function populateStudentInfo({ name, grade, advisor, major, graduationYear, imageUrl }) { updateStudentName(name) updateStudentGradeLevel(grade) updateStudentAdvisor(advisor) updateMajor(major) updateStudentGraduationYear(graduationYear) updateStudentImage(imageUrl) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initializeStudentInfo() {\n\tgetCurrentUser();\n\t// ID of tag to locate in the users xml file\n\tvar s_info = [\"GPA\",\"FirstName\", \"LastName\", \"ID\", \"completed\", \"inprogress\"];\n\t// ID of the element on the home.html page\n\tvar docID = [\"doc_GPA\",\"doc_User\", \"doc_completed\", \"doc_inpr...
[ "0.7215168", "0.7091297", "0.6969349", "0.69543827", "0.67484105", "0.67038155", "0.6700938", "0.6674522", "0.6628502", "0.6607442", "0.65169543", "0.64986193", "0.6491455", "0.64621973", "0.63995254", "0.6356958", "0.6336452", "0.6296728", "0.6288344", "0.6282596", "0.616305...
0.7036851
2
This function should add a headers row to the report card table
function addReportCardHeaders() { // update the code here reportCardTable.innerHTML += ` <div class='table-header'> <h4>Number</h4> <h4>Code</h4> <h4>Name</h4> <h4>Semester</h4> <h4>Credit</h4> <h4>Letter</h4> </div> ` }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addHeader(){\n\t\t\tself.$thead.find('tr').append('<th></th>');\n\t\t}", "function header() {\n let tableHeadingRow = document.createElement('tr');\n table.append(tableHeadingRow);\n let tableHeading = document.createElement('th');\n tableHeadingRow.append(tableHeading);\n\n for (let i = 0; i<hours...
[ "0.7606329", "0.75395876", "0.7487819", "0.7471443", "0.7423536", "0.7405259", "0.7358278", "0.7349613", "0.73194534", "0.7310479", "0.7306039", "0.7292724", "0.72924787", "0.72870964", "0.72755975", "0.72714156", "0.7246142", "0.7214798", "0.7202979", "0.7186978", "0.7173806...
0.7874147
0
This is the primary function used to update the report card when the semester changes. It should call the other functions responsible for creating the necessary HTML
function updateReportCard() { updateDropdownLabel() reportCardTable.innerHTML = `` // add your code here addReportCardHeaders(); let i = 1; studentData[semester].forEach(element => { addCourseRowToReportCard(element,i); i++; }); // addCourseRowToReportCard(studentData[semester][0],1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateSemester(clicked) {\n // code goes here\n semester = clicked.innerHTML\n}", "function renderReport(doc) {\n\n // ----------------------------------------------\n let br = document.createElement('br');\n let hr = document.createElement('hr');\n let page = document.createElement('span'...
[ "0.61812705", "0.59588534", "0.5927778", "0.58503544", "0.58467627", "0.57469565", "0.57300836", "0.56618935", "0.56255484", "0.5616136", "0.5588741", "0.558832", "0.5569769", "0.55316454", "0.55129427", "0.5502673", "0.5480918", "0.54475623", "0.5426156", "0.54257214", "0.54...
0.7594558
0
This function should toggle the dropdown. If the dropdown classList contains the "closed" class, it should remove it. If the dropdown classList doesn't contain the "closed" class, it should add it.
function toggleDropdown() { // code goes here if (dropdown.classList.contains("closed")) { dropdown.classList.remove("closed") } else { dropdown.classList.add("closed") } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onToggleDropdown() {\n\t\tif(this.containerDropdownElement.className.indexOf(\"show\") == -1) {\n\t\t\tthis.containerDropdownElement.className += \" show\";\n\t\t} else {\n\t\t\tthis.containerDropdownElement.className = this.containerDropdownElement.className.replace(\" show\", \"\");\n\t\t}\n\t}", "function tog...
[ "0.7360963", "0.71902317", "0.7141633", "0.6889421", "0.6874615", "0.6871357", "0.6867251", "0.6841624", "0.6817448", "0.6785155", "0.6721586", "0.66707164", "0.6576731", "0.6567761", "0.65598416", "0.6558041", "0.6556466", "0.6540552", "0.6536351", "0.6530308", "0.6529978", ...
0.81567013
0
This function should update the inner html of the dropdown label to be the current value stored in the `semester` variable.
function updateDropdownLabel() { // code goes here semesterDropLabel.innerHTML = semester }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateSemester(clicked) {\n // code goes here\n semester = clicked.innerHTML\n}", "function setDropdownContent(grade){\n\t\n\tvar na = \"<option value=\\\"NA\\\"> --- </option>\";\n var ip = \"<option value=\\\"inprog\\\"> In Progress </option>\";\n var a = \"<option value=\\\"A\\\"> A </option>\";\...
[ "0.67516583", "0.61929536", "0.59685767", "0.5928976", "0.59149027", "0.5909841", "0.5872012", "0.5815998", "0.5799512", "0.57136524", "0.5690627", "0.5636865", "0.56295305", "0.5615603", "0.5601714", "0.55992687", "0.5591593", "0.5589546", "0.55879563", "0.5584531", "0.55707...
0.8385103
0
This function should updates the `semester` variable.
function updateSemester(clicked) { // code goes here semester = clicked.innerHTML }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setSemester(aSemester) {\n this.semester = aSemester;\n }", "getSemester() {\n return this.semester;\n }", "function Semester(newData) {\n\t\tnewData = newData || {};\n\t\t$super.call(this, newData, list, listName);\n\t\tthis.parent = $super.prototype;\n\n\t\t// Initialize the attributes of the new Sem...
[ "0.7819215", "0.70136034", "0.66827303", "0.6220493", "0.60968655", "0.58557254", "0.5674647", "0.56447023", "0.56235313", "0.5608952", "0.5540696", "0.5537522", "0.5533451", "0.55311793", "0.55180824", "0.55178875", "0.5502149", "0.549927", "0.5376453", "0.53597075", "0.5338...
0.6688955
2
a quick check to see if this origin can connect for now, we're taking 'em all!
function originIsBanned(origin) { //! TBD // we *may* want a black-list IP table for people who bomb us or otherwise mis-use... return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function originIsAllowed(origin) {\n\t//debido a que no se restringen clientes, no se realiza ningun tratamiento\n\treturn true;\n}", "function isConnect() {\n return !needWait;\n }", "function originIsAllowed(origin) {\n return true;\n if(origin === 'http://dbwebb.se' || origin === 'http://localhost') {...
[ "0.7028714", "0.6715859", "0.6619467", "0.6592037", "0.6585695", "0.64976555", "0.648955", "0.63038194", "0.62987506", "0.6252887", "0.6227315", "0.6227315", "0.6170909", "0.6166181", "0.6154557", "0.61509705", "0.6117818", "0.6117778", "0.60295653", "0.60195005", "0.6016532"...
0.0
-1
placeholder for session cleanup
function endSession(inSessionID) { console.log("ending session"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sessionCleanup() {\n\n\t}", "function onSessionEnded(sessionEndedRequest, session) {\r\n \r\n\r\n // Add any cleanup logic here\r\n}", "function destroy() {\n devlog.channel('iscSessionStorageHelper').debug( 'iscSessionStorageHelper.destroy');\n $window.sessionStorage.removeItem('loginRe...
[ "0.87085104", "0.73043585", "0.7226283", "0.6695622", "0.6687954", "0.6638293", "0.6618317", "0.6607023", "0.65912706", "0.65897495", "0.65670425", "0.6545758", "0.6545758", "0.6545758", "0.6545758", "0.6545758", "0.6545758", "0.65450233", "0.65431976", "0.65061045", "0.64944...
0.0
-1
every 5 seconds remove demo user from
function getRandom(arr) { const idx = Math.floor(Math.random() * arr.length); return arr[idx] }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "clearUser(){\n this.dettachListeners(); \n this.user = null;\n }", "function deleteUser() {\n playersRef.child(thisIsPlayerNumberX).remove();\n // disableGamePlay();\n}", "static removeUser() {\n localStorage.removeItem('userInfo');\n }", "deleteUser() {\n this.de...
[ "0.648261", "0.64512676", "0.641475", "0.6414479", "0.63990223", "0.6346476", "0.63454485", "0.6311817", "0.63083476", "0.63046426", "0.6293877", "0.6245016", "0.62371314", "0.6235561", "0.6197562", "0.6196626", "0.6191151", "0.6175656", "0.61708385", "0.6150998", "0.61486644...
0.0
-1
if less < 5 people in q, add someone
function addToQueue() { if (people.length < 5) { people.enqueue(getRandom(randomPeople)) petsService.enqueue('dogs', getRandom(store.dogs)) petsService.enqueue('cats', getRandom(store.cats)) console.log(petsService.get()) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getTopFive(users, user, limit){\n\n // ----------------------- Step 1 --------------------------//\n var counterArray = [];\n\n // for every user, and every possible forbidden id\n var i;\n var j;\n var flag = false;\n\n for(i = 0; i < users.length; i++) {\n\n if(user.googlename != users[i].goog...
[ "0.597787", "0.57473415", "0.5282591", "0.52489483", "0.5223449", "0.5209946", "0.52049685", "0.51731074", "0.51531446", "0.51516247", "0.50568515", "0.50505996", "0.5031463", "0.5000281", "0.49800718", "0.497607", "0.49655685", "0.49582952", "0.4954068", "0.4947687", "0.4941...
0.58925647
1
Adds 0 when value is <10
function checkTime(i) { if (i < 10) { i = "0" + i; } return i; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addZero(value) {\n if (value < 10) {\n return value = '0' + value;\n } else {\n return value;\n }\n }", "function addzero(i){\n if(i<10){\n i=\"0\"+i;\n}\nreturn i;\n}", "addToValue10(val){\n return val + 10;\n }", "function addTen(value) {\n\treturn value + 10;\n}", "function...
[ "0.74883896", "0.69815964", "0.6892145", "0.6848094", "0.6824816", "0.6799067", "0.679249", "0.6740773", "0.6713084", "0.6698843", "0.66845745", "0.6658378", "0.6633371", "0.6633371", "0.6628248", "0.6608697", "0.6606653", "0.66034716", "0.6554212", "0.6554212", "0.6554212", ...
0.0
-1
add hillshading to 'outdoors' map style
addHillShading() { this.addLayerStyle(this.hillshade, this.hillshade.index); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hurrLegendStyle(feature) {\r\n if (feature.get('Hurricane') < 10) {\r\n return new ol.style.Style({\r\n image: new ol.style.Circle({\r\n radius: 5,\r\n fill: new ol.style.Fill({\r\n color: '#fef0d9' // yellow \r\n ...
[ "0.6446102", "0.6318324", "0.5976814", "0.58865374", "0.58139014", "0.578251", "0.5725646", "0.5659158", "0.5650597", "0.5650597", "0.5650597", "0.55795115", "0.55690634", "0.5568911", "0.54990286", "0.54790443", "0.54388386", "0.5400335", "0.5386327", "0.5383769", "0.5380575...
0.7535632
1
AJAX POST reuqest to get news
function getNews(startWith, newsPerPage, lang, callback) { var xhr = new XMLHttpRequest(); var body = 'start=' + startWith + '&perPage=' + newsPerPage + '&lang=' + lang; xhr.open("POST", '/get_news.php', true); xhr.setRequestHeader('Content-Type', 'application/x-www-form-...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sendnews() {\n console.info(\"Avvio del processo d'invio notizie.\");\n\n // imposta tipo di notizia per la servlet\n var formtype = \"news\"\n\n // recupera i contenuti dei campi per titolo e corpo notizia\n var newstitle = encode_utf8($(\"#newstitle\").val());\n//\talert(\"Titolo notizia:...
[ "0.6957251", "0.6804377", "0.6586956", "0.6585765", "0.655429", "0.6373717", "0.63655", "0.63572353", "0.63223904", "0.6260317", "0.6258732", "0.621557", "0.6198414", "0.6197101", "0.6193509", "0.6169285", "0.6100322", "0.6094796", "0.6023054", "0.6022231", "0.6006042", "0....
0.6562662
4
Markup for one single news item
function createOneNewsItemMarkup(news) { // determine language if(window.location.pathname.search(/ru/) !== -1) { //console.log(lang); return '<li class="news__list-item">' + '<a href="'+ news.news_code +'/">' + '<div class="news__list-item-to...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showNewsInfo(news) {\n const newsContainer = document.querySelector(\"#news\")\n const newsInfo = `\n <a href =${news[0].url} class='news1'>${news[0].title, news[0].description}</a>\n <a href =${news[1].url} class='news2'>${news[1].title, news[1].description}</a>\n <a href =${news[2].url} c...
[ "0.6701376", "0.6414517", "0.6276932", "0.6184199", "0.615131", "0.61452675", "0.6124586", "0.6119642", "0.60793144", "0.5966407", "0.5944778", "0.5904068", "0.58890134", "0.588806", "0.58861256", "0.5882913", "0.58765125", "0.58367985", "0.58307964", "0.5804032", "0.5778944"...
0.7270428
0