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
generate the old SQBSstyle game summaries. Not currently used.
function oldScoreboardGameSummaries(myGames, roundNo, phase, settings) { var html = ''; for(var i in myGames) { var g = myGames[i]; if((phase == 'all' || g.phases.includes(phase)) && g.round == roundNo) { var linkId = 'R' + roundNo + '-' + g.team1.replace(/\W/g, '') + '-' + g.team2.replace(/\W...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateHeadtoHeadSummaryCard(team1, team2, season) {\n // Generate the Head-to-Head W-L Card, including pie chart & box scores\n \n // Initiative variables\n // For counting wins\n const gameCounts = {};\n gameCounts[team1] = 0;\n gameCounts[team2] = 0;\n gameCounts['scheduled'] =...
[ "0.62076044", "0.5980853", "0.5745682", "0.5656318", "0.5654262", "0.56078094", "0.5573765", "0.5573012", "0.5548701", "0.54660535", "0.5448298", "0.5441698", "0.54374874", "0.5421606", "0.53975606", "0.5395086", "0.5382852", "0.53750736", "0.5364274", "0.5329323", "0.5312149...
0.7413321
0
Event listener for HTTP server "error" event.
function onError(error) { if (error.syscall !== 'listen') { throw error; } var bind = typeof port === 'string' ? 'Pipe ' + port : 'Port ' + port; // handle specific listen errors with friendly messages switch (error.code) { case 'EACCES': console.error(bind + ' requires elevated privil...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function httpOnError(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n\n var bind = typeof port === 'string'\n ? 'Pipe ' + port\n : 'Port ' + port;\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n console.error(bind + '...
[ "0.7118962", "0.70567393", "0.70339364", "0.70246124", "0.6965733", "0.6882446", "0.68554044", "0.68311316", "0.6821094", "0.68109226", "0.6788116", "0.6782291", "0.6781704", "0.67701316", "0.6766919", "0.6750681", "0.6706457", "0.67013055", "0.66602784", "0.66561115", "0.664...
0.0
-1
Event listener for HTTP server "listening" event.
function onListening() { var addr = server.address(); var bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port; debug('Listening on ' + bind); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onListeningHTTP () {\n var addr = server.address()\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port\n debug('HTTP - Listening on ' + bind)\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' +...
[ "0.78543603", "0.7739916", "0.76332736", "0.75365347", "0.7531618", "0.7341063", "0.733379", "0.73028886", "0.7302802", "0.7282679", "0.7272048", "0.72311646", "0.72267777", "0.71615416", "0.71260625", "0.7120054", "0.7105148", "0.70975953", "0.7081919", "0.70732343", "0.7071...
0.0
-1
call back response of server listening on port 3000
function listening(){console.log("listening. . .");}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function listening(){\n console.log(\"server running\"); \n console.log(`running on localhost: ${port}`);\n}", "function listening(){\n console.log(\"server running\"); \n console.log(`running on localhost: ${port}`);\n}", "function listening(){\n console.log(\"server running\");\n consol...
[ "0.72004646", "0.70841783", "0.70644855", "0.70101494", "0.70101494", "0.6989011", "0.6930403", "0.69256634", "0.6878051", "0.6877896", "0.683114", "0.6801366", "0.67967224", "0.6737839", "0.67140347", "0.6705681", "0.6672165", "0.662995", "0.6610982", "0.6608527", "0.6555804...
0.0
-1
Goal is assumed to be valid and is added as is Side Effects: sets goal id
async function addGoal(goal){ const collection = db.collection('goals'); goal._id = await getNextGoalId(); await collection.insertOne(goal) return goal; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addGoal(request, response) {\n const userId = request.params.id;\n const newGoal = {\n id: uuid(),\n date: request.body.dateOnly,\n weight: Number(request.body.weight),\n chest: Number(request.body.chest),\n thigh: Number(request.body.thigh),\n upperArm: Number(request.body.uppe...
[ "0.62820673", "0.6278169", "0.5795982", "0.5660947", "0.56282556", "0.5512897", "0.5478944", "0.5478944", "0.5459455", "0.5337248", "0.53360724", "0.5293659", "0.5239729", "0.52347434", "0.5209248", "0.5206943", "0.5193889", "0.5184413", "0.5179807", "0.5148115", "0.5109186",...
0.6294764
0
False most likely indicates goal id wasn't found
async function updateGoal(id, goal){ const collection = db.collection('goals'); delete goal._id; let result = await collection.replaceOne({_id:id}, goal); console.log(`updated ${result.matchedCount} goal`); success = result.matchedCount == 1? true : false; return success; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async isNotValidGameID(id) {\n if (id === '') {\n return true;\n }\n try {\n let snapshot = await this.db.getRef(`games`).orderByKey().equalTo(id).once('value');\n if (snapshot.val() == null) { // We want to make sure the game doesn't exist yet\n console.log(`Game ID (${id}) is valid...
[ "0.6091448", "0.59060585", "0.5683079", "0.56619173", "0.56453556", "0.5554031", "0.55388045", "0.55377394", "0.5536888", "0.55062056", "0.55017924", "0.5500073", "0.5494697", "0.54846734", "0.54773223", "0.5466602", "0.5466254", "0.5447833", "0.54393363", "0.5437877", "0.543...
0.5735748
2
Function to stop background audio by Id
function stopAudioById(Id) { var a = document.getElementById(Id); a.pause(); a.currentTime = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "stopAudio(){\n const audio = document.querySelector(`section[id=\"${this.currentId}\"] audio`);\n if(audio){\n audio.pause();\n audio.currentTime = 0;\n }\n }", "function stop() {\r\n audio.pause();\r\n}", "function stop() {\n\t\tthis.audio.pause();\n\t}", "stopSound() {\n if (this.so...
[ "0.7850014", "0.7651296", "0.74529773", "0.73438513", "0.7333393", "0.7332037", "0.7314394", "0.7276164", "0.7256611", "0.7210215", "0.72047615", "0.7191473", "0.7179942", "0.7137563", "0.7128245", "0.70321727", "0.70197594", "0.69633263", "0.6961798", "0.69604844", "0.695041...
0.80386525
0
sort by dates just in case
renderChart() { const labels = Object.keys(this.props.data).sort(); const values = labels.map(label => this.props.data[label]); const node = document.getElementById('chart'); this.chart = new Chart(node, { type: 'line', data: { labels: labels, datasets: [ { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SortByDate(array) {\n return _.sortBy(array, function (item) {\n return moment(item.endDate, 'YYYY-MM-DD HH:mm:ss').format('x');\n });\n }", "function sortListsByDate() {\r\n\t\treturn getItems().sort(function(a,b){\r\n \t\t\tre...
[ "0.7859438", "0.7825233", "0.7751028", "0.7750104", "0.77226835", "0.768708", "0.75488585", "0.74750966", "0.74566334", "0.7432803", "0.7320308", "0.72980094", "0.72809523", "0.72739655", "0.72341925", "0.7232712", "0.7215235", "0.7211964", "0.7190627", "0.7172311", "0.715606...
0.0
-1
The client sends the webRTC answer to the board's owner
function onWebRTCAnswer(con, data) { var targetConnection = users[data.board_owner]; sendTo(targetConnection, { type: "webRTCAnswer", answer: data.answer, clientUsername: con.name }); console.log(con.name + " sends webrtc answer to " + data.sender); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onOffer(con, data) {\n console.log(con.name + \" (board's owner) sends webrtc offer to \" + data.client_username + \" (client)\");\n\n var targetConnection = users[data.client_username];//the connection to the board's owner\n\n sendTo(targetConnection, {\n type: \"offer\",\n offer: ...
[ "0.71475875", "0.7109253", "0.69136596", "0.68864846", "0.68420666", "0.68265545", "0.6621144", "0.6556973", "0.6532982", "0.6494306", "0.649336", "0.6490775", "0.64715034", "0.6458756", "0.6452946", "0.6364865", "0.6352188", "0.6339673", "0.63342726", "0.6288773", "0.628397"...
0.7511203
0
Board's owner sends WebRTC offer to the client
function onOffer(con, data) { console.log(con.name + " (board's owner) sends webrtc offer to " + data.client_username + " (client)"); var targetConnection = users[data.client_username];//the connection to the board's owner sendTo(targetConnection, { type: "offer", offer: data.offer, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function webRtcSendOffer(clientName, offerValue) {\r\n\tif (typeof thisPeersName != \"string\") {\r\n\t\tconsole.log(\"Please set peer name before calling this function\");\r\n\t\treturn;\r\n\t}\r\n\t\r\n var xhttp = new XMLHttpRequest();\r\n\txhttp.onreadystatechange = function() {\r\n\t\tif (xhttp.readyState ==...
[ "0.7180027", "0.70465267", "0.687917", "0.6776444", "0.67317426", "0.662693", "0.66249055", "0.6601357", "0.6536005", "0.6519796", "0.6505575", "0.6424512", "0.64086694", "0.6383085", "0.63280374", "0.63270354", "0.6218041", "0.6203831", "0.61948335", "0.61453605", "0.614517"...
0.7861383
0
Handle the board owners' request denying a request to join their board
function onDenyRequestReceived (connection, data) { var sender = data.client_username;//This is the username of the the guest user sending the request to join an existing board var guestUserCon = users[sender]; sendTo(guestUserCon, { type: "requestDenied", board_owner: connection.name }...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleRequestToJoinABoard(con, data) {\n var boardId = data.board_id;\n var username = getBoardOwner(boardId);\n if(username == \"\") {\n //there is no board with the given board id\n //Reply the sender with an error message\n var errMsg = \"There is no board named \" + board...
[ "0.71753776", "0.6140575", "0.60547787", "0.59456205", "0.59230584", "0.5760156", "0.5757053", "0.5699945", "0.56572264", "0.5623427", "0.56220347", "0.5617632", "0.56002194", "0.55647516", "0.5550174", "0.55321854", "0.55248797", "0.5464884", "0.5457604", "0.5425814", "0.542...
0.7841357
0
Client sends request to gain permission to join a board
function handleRequestToJoinABoard(con, data) { var boardId = data.board_id; var username = getBoardOwner(boardId); if(username == "") { //there is no board with the given board id //Reply the sender with an error message var errMsg = "There is no board named " + boardId; sen...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onDenyRequestReceived (connection, data) {\n var sender = data.client_username;//This is the username of the the guest user sending the request to join an existing board\n var guestUserCon = users[sender];\n\n sendTo(guestUserCon, {\n type: \"requestDenied\",\n board_owner: connecti...
[ "0.6595524", "0.6241585", "0.61059517", "0.6024037", "0.60135347", "0.5818689", "0.57454854", "0.57400674", "0.5716668", "0.5653228", "0.5637767", "0.5635165", "0.56062716", "0.55990976", "0.5591823", "0.5586579", "0.5558358", "0.5553661", "0.5538111", "0.5536512", "0.5534779...
0.6839299
0
invoked when receives an request of creating a new board
function handleCreateNewBoard(con, data) { if(boards[data.board_id]) { //if the board id has been used sendTo(con, { type: "createNewBoard", success: false }); } else { //IF the board id has not been used boards[data.board_id] = data.username; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function boardCreate() {\n Board\n .create(vm.newBoardName || 'new board', $scope.project.id)\n .then(function (board) {\n vm.isBoardTitleFormVisible = false;\n vm.newBoardName = '';\n vm.boardList.push(board);\n setBoard(board._id);\n board.active = true;\n })\...
[ "0.77158034", "0.7353903", "0.72720516", "0.72352827", "0.70372456", "0.68997335", "0.6876155", "0.6853348", "0.67846936", "0.67525905", "0.6668824", "0.66521925", "0.66404104", "0.661742", "0.64765817", "0.63314116", "0.6323373", "0.6272283", "0.61902374", "0.6169527", "0.61...
0.77241427
0
Gets the username of the board owner using the given board id
function getBoardOwner(boardId) { if(boards[boardId]) { return boards[boardId]; } else { return ""; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getOwnerName(id) {\n// var db = ScriptDb.getMyDb();\n var db = ParseDb.getMyDb(applicationId, restApiKey, \"bookshelf\");\n \n var user = db.load(id);\n \n if (user != null) {\n return user.name;\n }\n \n return null;\n}", "function getUserName(id){\r\n\tvar i;\r\n\tvar name;\r\n\tfor (i = 0...
[ "0.68949413", "0.67717636", "0.6707087", "0.6638776", "0.646869", "0.6352141", "0.61915654", "0.61563104", "0.60073376", "0.5979562", "0.59685034", "0.5923115", "0.58863866", "0.5878262", "0.58353287", "0.57983434", "0.57366276", "0.5735677", "0.5709449", "0.5637664", "0.5629...
0.787094
0
Using heart beat to detect connection lost
function checkHeartBeat() { for (var username in users) { sendHeartBeatToAnUser(username); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onConnectionLost(responseObject) {\n if (responseObject.errorCode !== 0) {\n console.log(\"onConnectionLost:\", responseObject.errorMessage);\n setTimeout(function() { client.connect() }, 5000);\n }\n }", "function onConnectionLost(responseObject) {\n if (...
[ "0.7181374", "0.71220416", "0.6970917", "0.6872616", "0.68663263", "0.6856717", "0.68285036", "0.6759781", "0.6754774", "0.6721917", "0.67171544", "0.6716985", "0.6716595", "0.6715286", "0.66832507", "0.66832507", "0.66832507", "0.66832507", "0.66832507", "0.66832507", "0.667...
0.0
-1
Remove a user's setting when he/she disconnects from the server.
function removeAnUser(username) { console.log ("remove user: " + username); delete users[username]; //Delete the board if the user is a board's owner delete boards[board_owners[username]]; delete board_owners[username]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function remove()\n{\n // Stop any timers to prevent CPU usage\n\t\n // Remove preferences\n widget.setPreferenceForKey(null, createInstancePreferenceKey('url'));\n widget.setPreferenceForKey(null, createInstancePreferenceKey('username'));\n}", "function resetSettings() {\n let ns = Connec...
[ "0.68965816", "0.64379907", "0.63850844", "0.62527096", "0.6212654", "0.6211599", "0.61886096", "0.61886096", "0.60474175", "0.6024941", "0.6015141", "0.60001755", "0.5977042", "0.5970158", "0.59112304", "0.59093344", "0.5858913", "0.5798627", "0.57565427", "0.57565427", "0.5...
0.0
-1
We need a function which handles requests and send response
function handleRequest (request, response){ gm('./photo.jpg') .resize(500, 500) .blur(7, 3) .stream() .pipe(response); // Sunrise Photoshoot Miami Beach Gold Coast By Mark Wassell // https://flic.kr/p/bEEbav // response.end('It Works!! Path Hit: ' + request.url); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async send(request, response) {}", "function processResponse(){\n //\n }", "async function handle(request, response) {\n console.log('request coming!!');\n let content;\n let paras = parseUrl(request.url);\n if(!Object.keys(paras).includes('tag')){\n //no tag -> page request\n let...
[ "0.7567663", "0.69920015", "0.6973315", "0.683369", "0.67924917", "0.67808473", "0.6760007", "0.6712993", "0.67016184", "0.6679924", "0.6670416", "0.66481024", "0.6599429", "0.65672284", "0.65561575", "0.6537633", "0.6534183", "0.652689", "0.65151167", "0.6510124", "0.6493445...
0.0
-1
gets filtered collection, and forms a new temporary collection
function vektorResultDevices(models){ VektorChooser.resultDevices = new VektorChooser.DeviceCollection(models); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get filterCollection() {\n if (!this._filterCollection) {\n this._filterCollection = new FilterCollection(this.data.filter, {\n filter: this.contributions.filter.filter((filter) => {\n const [key] = Object.keys(filter);\n return has(this.data.filter, key);\n }),\n });\n...
[ "0.6691833", "0.65808064", "0.6462516", "0.64484036", "0.64100736", "0.63927245", "0.63762254", "0.6368256", "0.6213523", "0.6153368", "0.6147919", "0.61259365", "0.61205155", "0.6109743", "0.6106458", "0.60522026", "0.5961046", "0.5961046", "0.59566504", "0.5953989", "0.5944...
0.0
-1
Adding Gardener every X seconds
function addGardener() { stage.insert(new Q.Gardener()); setTimeout(addGardener, (Math.random()*2 + 1) * 1000 ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function game() {\n addRandomSymbolToCard(allCards);\n setInterval(setTime, 1000);\n}", "gainTime() {\n if (this.comboSize % rewardThreshold !== 0) {\n return\n }\n this.timeModifierMs += rewardMs\n this.timeModifierMs += (comboRewardMs * (this.comboSize / rewardThreshold - 1))\n this.e...
[ "0.6347696", "0.6338047", "0.62055594", "0.6141003", "0.61316556", "0.61113465", "0.6110803", "0.6065937", "0.6021626", "0.6019851", "0.59676045", "0.5949328", "0.5906473", "0.5843304", "0.5842541", "0.58397746", "0.58371663", "0.5833121", "0.5831955", "0.5820942", "0.5817311...
0.78160393
0
show history selected apps, maximum 10
function showAppsHistory(){ if(localStorage.getItem("appsHistory")){ var historyContent = "<p>Recent History</p>"; historyContent += "<ul>"; if(localStorage.getItem("appsHistory").indexOf(",") !== -1){ var historyApps = localStorage.getItem("appsHistory").split(","); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateHistory() {\n \n var ottPlatforms = ['netflix', 'hotstar', 'primevideo', 'sonyliv'];\n\tfor(var i=0;i<4;i++){\n\t chrome.history.search({\n\t \t'text': ottPlatforms[i],\n\t \tmaxResults: 10\n\t }, function(historyItems) {\n\t for (var i = 0; i<historyItems.length&&i<10;++i) {\...
[ "0.64744544", "0.61828506", "0.5951463", "0.5892071", "0.5727425", "0.5707615", "0.5695041", "0.5678989", "0.56493443", "0.5620643", "0.5524825", "0.5508839", "0.5503607", "0.54807186", "0.5474199", "0.5462807", "0.54552495", "0.54114354", "0.54023176", "0.5388913", "0.538838...
0.61778116
2
draw a cell (square in 2d) using canvas
function drawSquare(x, y, color) { context.fillStyle = color; context.fillRect(x*SQ, y*SQ, SQ, SQ); context.strokeStyle = "black"; context.strokeRect(x*SQ, y*SQ, SQ, SQ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function paint_cell(x, y)\n {\n ctx.fillStyle = \"white\";\n ctx.fillRect(x*cw, y*cw, cw, cw);\n ctx.strokeStyle = \"blue\";\n ctx.strokeRect(x*cw, y*cw, cw, cw);\n }", "function drawBoard() {\n var height = cellside * sidelength;\n var width = cell...
[ "0.7691565", "0.7577058", "0.75691783", "0.75012726", "0.74208343", "0.7405117", "0.733086", "0.7297465", "0.725425", "0.7232539", "0.7205373", "0.7204837", "0.71961904", "0.71764505", "0.7166565", "0.7130246", "0.7106188", "0.7100594", "0.708092", "0.70330495", "0.703115", ...
0.0
-1
draw the board (2D Array with white spaces)
function drawBoard() { for(let r = 0; r < ROW; r++) { for(let c =0; c < COL; c++) { drawSquare(c, r, board[r][c]); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawBoard() {\r\n board.setAttribute(\"width\", boardSize);\r\n board.setAttribute(\"height\", boardSize);\r\n let isBlack = true;\r\n // fill board with alternating color\r\n for (let i = 0; i < boardSize; i += cellSize) {\r\n for (let j = 0; j < boardSize; j += cellSize) {\r\n if (isBlack) ...
[ "0.79158515", "0.7813762", "0.7655778", "0.7621671", "0.76039165", "0.76035035", "0.7530181", "0.7474227", "0.7451325", "0.7422705", "0.7358004", "0.7344362", "0.7334281", "0.7312356", "0.7311321", "0.7271872", "0.72705245", "0.72478664", "0.7143625", "0.7118884", "0.71084213...
0.7369
10
Send messages to a UDP multicast group.
function sendMessage() { const message = Buffer.from(`Message from process ${process.pid}`); socket.send(message, 0, message.length, PORT, MULTICAST_ADDR, function() { console.info(`Sending message "${message}"`); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function testMulticast() {\n function randomHexString(count) {\n var result = '';\n for (var i = 0; i < count; i++) {\n result += (Math.random() * 16 >> 0).toString(16);\n }\n return result;\n }\n\n var kMulticastAddress = \"237.132.100.133\";\n var kTestMessageLength = 128;\n var kTestMessag...
[ "0.59659314", "0.58379626", "0.5818072", "0.57029635", "0.56579274", "0.5545236", "0.55439574", "0.55289507", "0.5511533", "0.5441435", "0.5437317", "0.54344773", "0.539807", "0.5368046", "0.53154516", "0.531263", "0.5258213", "0.5239694", "0.5234802", "0.5202216", "0.5202015...
0.5558011
5
constructor function 1. they are named with capital letter first 2. they should be executed only with "new" operator
function User(name){ this.name = name; this.isAdmin = false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructur() {}", "function Constructor() {}", "function Constructor() {}", "function Constructor() {}", "function tempCtor() {}", "function Ctor() {}", "function construct() { }", "function _construct()\n\t\t{;\n\t\t}", "function _ctor() {\n\t}", "function TempCtor() {}", "function TempCtor()...
[ "0.7646757", "0.7518828", "0.7518828", "0.7518828", "0.7384764", "0.7328852", "0.73051316", "0.7281926", "0.7228779", "0.7183594", "0.7183594", "0.7183594", "0.7183594", "0.7183594", "0.7183594", "0.7027387", "0.6983075", "0.6983075", "0.6983075", "0.6983075", "0.6983075", ...
0.0
-1
constructor mode test user new.target to check whether the function is called with new
function test(){ console.log(new.target); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Foo() {\n if (!new.target) throw \"Foo() must be called with new\";\n console.log(\"Foo instantiated with new\");\n}", "function Foo() {\nconsole.log(new.target);\n}", "function Person3(name){\n\tif(typeof new.target !== 'undefined'){\n\t\tconsole.log('true');\n\t\tthis.names = name;\n\t}\n\telse {\...
[ "0.757005", "0.68425184", "0.66688603", "0.6593623", "0.6592724", "0.6290559", "0.6253568", "0.617027", "0.6154512", "0.6154512", "0.6154512", "0.61318904", "0.61318904", "0.61318904", "0.61318904", "0.61318904", "0.61318904", "0.6094216", "0.60769993", "0.60757726", "0.60521...
0.62895685
6
called if there is an error loading the spriteSheet (usually due to a 404)
function onError(e) { console.log("ASSETMANAGER ERROR > Error Loading asset"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "loadSpriteSheet(){\n this.spriteSheet = loadImage('assets/sprites.png');\n }", "function buildSpriteSheet() {\n\t// load the image\n\tspriteImage.onload = imgReady;\n\tspriteImage.onerror = imgLoadError;\n\tspriteImage.src = \"img/spritesheet.png\";\n}", "function loadSprite(fileName) {\n assetsStillL...
[ "0.66142815", "0.6517762", "0.62909067", "0.6269997", "0.6206139", "0.61746746", "0.6106481", "0.602508", "0.59890527", "0.5945105", "0.58778626", "0.5835708", "0.58221537", "0.58020043", "0.5799273", "0.5754567", "0.5746038", "0.5739678", "0.5730581", "0.5727266", "0.5717159...
0.5745161
17
Function for displaying gif data.
function renderButtons() { // Delete the content inside the gifs-appear-here div and added tech buttons, prior to adding new ones. $("#gifs-appear-here").empty(); $("#tech-buttons").empty(); // Loop through the array of gifs, then generate buttons for each gifs in the array. topics.forEa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayGifs(response) {\n //for each gif...\n response.data.forEach(function (gif) {\n // create these variables using the still image and gif urls\n stillURL = gif.images.fixed_height_still.url;\n gifURL = gif.images.fixed_height.url;\n rating = g...
[ "0.764537", "0.76208687", "0.7499196", "0.74027723", "0.74003994", "0.7393963", "0.7381092", "0.73475695", "0.73402375", "0.73194396", "0.7303249", "0.7277762", "0.72763807", "0.7242017", "0.72276103", "0.72060287", "0.7198302", "0.71829504", "0.7173088", "0.71726555", "0.717...
0.0
-1
pulls up a list of comands to run
function start() { inquirer .prompt([{ type: "list", name: "menu", message: "What would you like to do?", choices: ["View Products for sale", "View Low Inventory", "Add to Inventory", "Add New Product" ] } ]) .then(function (answ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function runAll() {\r\n\tfor(let bldg in IO.buildings) run(bldg);\r\n}", "async processComboLists() {\n //Async functions need their own try/catch blocks\n try {\n for(let i=0;i<this.combo_lists.length;i++) {\n //Limit the number of combos that can be running at once\n ...
[ "0.60718393", "0.5795079", "0.5675547", "0.56673133", "0.5374161", "0.53300333", "0.5311382", "0.53061646", "0.51601183", "0.51461476", "0.51070017", "0.507569", "0.507332", "0.50478816", "0.5042643", "0.5031126", "0.50172514", "0.5002934", "0.49957857", "0.49871212", "0.4968...
0.0
-1
pulls up all the products with there informations
function viewProducts() { database.query("SELECT * FROM products", function (err, itemData) { if (err) throw err; for (var i = 0; i < itemData.length; i++) { console.log(` ---------------------------------------------------- ID: ${itemData[i].id} | Product: ${itemData[i].product_name} | Price: $${itemDa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getProducts () {\n getRequest('products', onGetProducts);\n }", "function loadProducts(){\n productService.products().then(function(data){\n all_products = data;\n setOptions();\n setupListeners();\n })\n}", "function getProducts() {\n\n\t\t\t// Request products data and...
[ "0.74164724", "0.7354992", "0.73426723", "0.73089314", "0.7219921", "0.7206789", "0.71918136", "0.7163921", "0.71511436", "0.7084259", "0.7045586", "0.7044994", "0.70394444", "0.69982314", "0.69845575", "0.6947248", "0.69396216", "0.6938966", "0.6874509", "0.68705314", "0.685...
0.6661323
51
pulls only the products with low inventory (<5)
function lowInventory() { database.query("SELECT * FROM products WHERE stock_quantity BETWEEN 0 AND 5;", function (err, itemData) { if (err) throw err; for (var i = 0; i < itemData.length; i++) { console.log(` ---------------------------------------------------- ID: ${itemData[i].id} | Product: ${itemDa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lowInventory() {\n\tvar query = \"SELECT * FROM products HAVING stock_quantity < 5\";\n\tconnection.query(query, function(err, res){\n\t\tfor (var i = 0; i < res.length; i++) {\n\t\t\tconsole.log(res[i].item_id + \" | \" + res[i].product_name + \" | \" + res[i].price + \" | \" + res[i].stock_quantity);\n\...
[ "0.7866186", "0.7828168", "0.778617", "0.7724445", "0.7445352", "0.73731124", "0.73281634", "0.72590846", "0.72249067", "0.7205426", "0.7176493", "0.7166942", "0.7161356", "0.71603334", "0.7131425", "0.7102128", "0.7086971", "0.7086686", "0.7066797", "0.70638263", "0.70374227...
0.69625455
29
runs a prompt and uses the answers to add stock to the selected item
function addInventory() { inquirer .prompt([{ name: "itemId", message: "Which item would you like to restock?", default: "3", type: "input", validate: function (idInput) { if (!isNaN(idInput) && idInput >= 0) { return true; } else { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function promptToAddNewStock() {\r\n var questions = [{\r\n type: 'input',\r\n name: 'itemNum',\r\n message: 'Which item # would you stock up?',\r\n validate: validateNumber,\r\n },\r\n {\r\n type: 'input',\r\n name: 'quantity',\r\n...
[ "0.7945775", "0.7845801", "0.76951927", "0.7650502", "0.7628416", "0.75767946", "0.75667113", "0.75437975", "0.75374097", "0.74996376", "0.7485198", "0.7461824", "0.74478155", "0.7444072", "0.7432722", "0.7421676", "0.7415419", "0.7388113", "0.73839444", "0.7379011", "0.73619...
0.7322863
29
runs a prompt and uses the answers to create a new product
function addProduct() { inquirer .prompt([{ name: "product_name", type: "input", messgae: "Name of the product:", validate: function (inputValue) { if (inputValue !== "") { return true; } else { return "Please provide ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function promptNewProduct() {\n\n util.printTitle('Add New Product', 42);\n\n inquirer.prompt([{\n type: 'input',\n name: 'name',\n message: 'Name: '\n },\n {\n type: 'input',\n name: 'dept',\n message: 'Department: '\n },...
[ "0.84784645", "0.8034101", "0.79521775", "0.7950601", "0.7898027", "0.78887135", "0.7883809", "0.78573006", "0.7854113", "0.7802057", "0.77919155", "0.77918494", "0.7770411", "0.77428657", "0.76927567", "0.7681195", "0.76475537", "0.7645606", "0.763511", "0.7634128", "0.76211...
0.7571495
28
get style from textStyle.encodedAttributes
getParagraphStyle () { const { MSAttributedStringFontAttribute, NSColor, NSKern, NSParagraphStyle } = this.textStyle.encodedAttributes const fontAttribute = decodeText(MSAttributedStringFontAttribute) const paragraphStyle = decodeText(NSParagraphStyle) return this._getStyle...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get fontStyle() {}", "get textStyle() {\n if (this.i.o == null) {\n return null;\n }\n return this.i.o.fontString;\n }", "function getStyle (data) {\n let str = Object.prototype.toString.call(data)\n return str.slice(8, -1)\n }", "function getStyle(feature) {\r\n re...
[ "0.72831136", "0.71335477", "0.68325216", "0.67949194", "0.6392266", "0.6293501", "0.62786335", "0.6254863", "0.6254648", "0.6193206", "0.61821955", "0.61630267", "0.6126332", "0.60528326", "0.5975814", "0.59757143", "0.59705293", "0.59583646", "0.5927173", "0.5920476", "0.59...
0.6830146
3
Creates a new Chessboard
function Chessboard(cols, rows) { this.board = new Array(rows); this.blackPieces = new Array(16); this.whitePieces = new Array(16); this.pieceSelected = null; this.turn = WHITE; var color = BLACK_SQUARE_COLOR; // Initialize the board: for(var i = 0; i < rows; i++) { this.board[i] = new Array(cols); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createBoard() {\n var board = {squares:[]};\n\n for (var x = 0; x < 8; x++) {\n for (var y = 0; y < 8; y++) {\n var asquare = square({x:x, y:y});\n if (asquare.position.y === 0 || asquare.position.y === 1 || asquare.position.y === 6 || asquare.position.y === 7) {\n var co...
[ "0.7212648", "0.71656317", "0.7153794", "0.7151224", "0.7057764", "0.7008846", "0.69834214", "0.69750893", "0.69717693", "0.6971306", "0.6954373", "0.69370985", "0.69352275", "0.69169", "0.6895161", "0.68535894", "0.6832879", "0.6791756", "0.6767804", "0.6767192", "0.67341584...
0.6981684
7
Create a new Chessboard Square. The properties of a square are its color, row and column. A square is initialized with a null piece on it.
function ChessSquare(color, row, column) { this.color = color; this.row = row; this.column = column; this.selected = false; // Initialize with a null piece: this.piece = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ChessBoardSquare(column, row, tableCell) {\n\tthis.row = row;\n\tthis.column = column;\n\tthis.hasQueen = false;\n\tthis.tableCell = tableCell;\n\tthis.dominatedBy = 0;\n}", "function Square(){\r\n this.id = squares.length;\r\n this.topLeft = {index:0 , brick:null},\r\n this.topRight = {index:0...
[ "0.75136465", "0.706605", "0.69569474", "0.69145405", "0.68818647", "0.6788119", "0.67421585", "0.66298306", "0.66104054", "0.65945643", "0.65534776", "0.65419793", "0.6521462", "0.6499429", "0.6480104", "0.647905", "0.64701533", "0.6469834", "0.6403212", "0.6400942", "0.6337...
0.8459039
0
Construct A List Of Movies In Short Description Given A List Of IDs
function shortResultsList(ids) { var templateFn = _.template(document.getElementById("short-result-template").innerHTML); var resultTemplate = document.getElementById("movieresults"); _.forEach(ids, function(id) { // Execute Template Function var url = apiURL + '?apikey=' + apiKey + '&i=' + id; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addGenresNamesForAllMovies () {\n this.data.movies.forEach(movie => {\n movie.genres = movie.genre_ids.map((val, i, arr) => {\n let genreName = '';\n\n for (let i = 0; i < this.data.genres.length; i++) {\n if (val === this.data.genres[i].id) {\n genreName = this.data.genre...
[ "0.6057446", "0.5965622", "0.5711906", "0.5690674", "0.5555336", "0.5540141", "0.5497392", "0.54934037", "0.5493301", "0.5485689", "0.5485332", "0.5448569", "0.5441258", "0.54167855", "0.5413007", "0.5408741", "0.5390657", "0.5344705", "0.5343342", "0.5341802", "0.5335961", ...
0.56346136
4
Enrich The Movie With The Given ID
function enrichMovie(id) { var templateFn = _.template(document.getElementById("full-result-template").innerHTML); var resultTemplate = $(".more[data-value='" + id + "']").parent('div.details'); var url = apiURL + '?apikey=' + apiKey + '&i=' + id + '&plot=full'; fetch(url).then(function(response) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async updateFilm(id, title){\n const idFound = movie.findOne({id: id})\n return idFound.update(title)\n }", "update(id, movie) {\n var movieIndex = this.movieList.findIndex(element => {\n return element.id === id;\n });\n if(movieIndex !== -1) {\n ...
[ "0.6980249", "0.69366944", "0.6758396", "0.6665284", "0.6632802", "0.6632232", "0.66184425", "0.65855724", "0.65762615", "0.6568346", "0.65035784", "0.6413094", "0.63959986", "0.6378615", "0.6376555", "0.6369258", "0.6334455", "0.63315886", "0.63205385", "0.6318576", "0.63065...
0.70958304
0
Flush the cache and reset the Apollo store.
resetStore() { logger.warn('Resetting store...'); // Reset store (causes queries to update). // https://github.com/apollostack/apollo-client/blob/6b6e8ded1e0f83cb134d2261a3cf7d2d9416400f/src/ApolloClient.ts this._client.resetStore(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "flush() {\n this.cache.flushAll();\n }", "clearCache() {\n this.options.cache.flushAll();\n }", "static flush() {\n PStore.clearAll();\n }", "function reset() {\n cache.reset();\n AJS.debug('server-users-supplier: Cache reset');\n }", "function reset() {\n ca...
[ "0.74057055", "0.7123125", "0.7028307", "0.68404657", "0.68404657", "0.67872703", "0.67872703", "0.66470605", "0.66470605", "0.6646762", "0.66121405", "0.66121405", "0.6520696", "0.6520696", "0.6520696", "0.648011", "0.6471304", "0.6463159", "0.6460205", "0.64402205", "0.6420...
0.7169043
1
Redux store (for dispatching actions).
get store() { return this._store; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "dispatch(action) {\n this.store.dispatch(action);\n }", "function dispatch(action) {\n console.log('dispatch('+ action.type + ')');\n\n stores.forEach(s => {\n \ts.onAction(action);\n });\n}", "dispatch(action) {\n this.store.dispatch(action);\n return action;\n }", "di...
[ "0.77266276", "0.74990016", "0.73659056", "0.73659056", "0.7357228", "0.70989233", "0.7070354", "0.69956976", "0.69668835", "0.69309163", "0.6906651", "0.688238", "0.6878501", "0.6806433", "0.6795952", "0.6764486", "0.67276657", "0.67185205", "0.6667449", "0.6649732", "0.6644...
0.0
-1
Virtual methods. Returns the Apollo network interface.
get networkInterface() { return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getNetworkInterface(uri) {\n const networkInterface = (0, _reactApollo.createNetworkInterface)({\n uri,\n opts: _config2.default.apolloNetworkOptions\n });\n\n // Attach middleware\n networkInterface.use(_config2.default.apolloMiddleware.map(f => ({ applyMiddleware: f })));\n networkInterface.u...
[ "0.7135067", "0.62845516", "0.6250091", "0.61851656", "0.60684", "0.5905128", "0.5895266", "0.5882898", "0.5882898", "0.5882898", "0.5882898", "0.5882898", "0.58352494", "0.58167326", "0.572674", "0.57233924", "0.56297123", "0.55937845", "0.55082786", "0.5479686", "0.5478192"...
0.7811591
0
Global reducer for reducereducers.
get globalReducer() { return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reducer(){\n\n}", "reducer(res) {\n return res;\n }", "function getAppReducer() {\n return __webpack_require__(/*! ../reducers */ \"./reducers/index.js\"); // eslint-disable-line global-require\n}", "function reduce(reducer, reducible) {\n\t return transformWithSpec(reducer, reducible, _sh...
[ "0.75788635", "0.6732845", "0.66318536", "0.6457712", "0.6457283", "0.6419281", "0.64070916", "0.64069563", "0.63643044", "0.6342788", "0.62739396", "0.61988103", "0.6197136", "0.61108446", "0.6108567", "0.6076411", "0.60657734", "0.5991277", "0.5985123", "0.59579057", "0.589...
0.7685491
0
sets the falling spped
function Start () { GetComponent.<Rigidbody2D>().velocity.y = speed; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "fall(){\n // can only \"fall\" when rising\n if (this.dy < 0){\n this.dy = 0;\n }\n}", "resetSkier () {\n \n this.isJumping =false;\n this.setDirection(this.direction);\n }", "spring () {\n this.springValue.setValue(0.3)\n setTimeout(() => {\n Animated.spri...
[ "0.6360364", "0.60807645", "0.6070363", "0.60092396", "0.5936737", "0.5910111", "0.5897968", "0.58949184", "0.5894888", "0.577505", "0.5738278", "0.56791866", "0.56468046", "0.56229305", "0.55844814", "0.5563466", "0.55607307", "0.5540498", "0.5536739", "0.553092", "0.5498653...
0.0
-1
should destroy the object when it leaves lign of sight
function OnBecomeInvisible() { Destroy(gameObject); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function destroy(){}", "destroy()\n {\n this.#gameObject = null;\n }", "destroy() {\n this.container.removeChild(this.inspiredSprite);\n this.container.removeChild(this.sprite);\n this.container.removeChild(this.halo);\n this.container.removeChild(this.highlight);\n ...
[ "0.74901485", "0.7428618", "0.74241376", "0.74070597", "0.7349529", "0.7349529", "0.73368686", "0.728012", "0.72798586", "0.7191772", "0.7191772", "0.71570396", "0.71570396", "0.7123362", "0.7115172", "0.7094157", "0.7083725", "0.7016721", "0.6981978", "0.6981978", "0.6981978...
0.0
-1
it is possible to just create the taskRepo object in the getInstance method but using a function here makes it clearer what's going on
function createRepo() { taskRepo = new Object(); return taskRepo }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function TaskRepository () {\n\n }", "function init({ projectRepository }) {\n const list = async function list(options) {\n return projectRepository.list(options);\n };\n\n const create = async function create(options) {\n return projectRepository.create(options);\n };\n\n const get = async functi...
[ "0.733383", "0.5948107", "0.5869855", "0.5808749", "0.567729", "0.56612843", "0.56112635", "0.5600791", "0.55647635", "0.5546564", "0.55369186", "0.5521633", "0.5506159", "0.54702216", "0.54555035", "0.543943", "0.5431892", "0.54125714", "0.54040766", "0.5399647", "0.53886634...
0.8238984
0
fonction qui permet de donner la taille la plus grand aux autres panels
function determinePanelSize() { var s = panels.eq(0).height(); for (var i = 0; i < panels.length; i++) { if (s<panels.eq(i).height()){ s = panels.eq(i).height(); } } panels.css({'height':s}); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makePanels() {\n this.makeChart();\n //Arrange and display panels\n new Ext.Viewport({\n layout: 'border',\n rendreTo: Ext.getBody(),\n items: [\n this.makeHeader(),\n this.makeMapPanel(),\n this.makeDataPanel()\n ]\n });\n this.s...
[ "0.6303854", "0.6291331", "0.60818994", "0.60331106", "0.59732413", "0.5957769", "0.59433776", "0.59150106", "0.5903399", "0.58943045", "0.5838852", "0.5796159", "0.57928056", "0.5791214", "0.5745976", "0.57365805", "0.57293", "0.5716828", "0.5675335", "0.5669503", "0.5646978...
0.5358837
63
Could chew CPU if not throttled!
function resizeHandler() { for( let world of worlds ) { let parent_elem = world.renderer.domElement.parentNode; let w = parent_elem.clientWidth; let h = parent_elem.clientHeight; world.Resize( w, h ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_recomputeThrottled() {\n\n if (!this._recomputeRun) {\n this._recompute();\n this._recomputeRun = true;\n }\n\n this._clearRecomputeDebounced();\n }", "function shouldAcceptThrottling() {\n return !options.forcePrefetchRatio || Math.random() > options.forcePrefetchRatio;\n}", "function ...
[ "0.691335", "0.66839665", "0.65912306", "0.6501307", "0.64506304", "0.64091384", "0.6323052", "0.61841506", "0.6112604", "0.6111193", "0.60807854", "0.6065456", "0.60426825", "0.6027305", "0.5990717", "0.59845394", "0.5943793", "0.5943793", "0.5911696", "0.5909356", "0.590886...
0.0
-1
Each pair in primitive_pairs will have form [name, function]
function add_primitives(...primitive_pairs) { for (var i = 0; i < primitive_pairs.length; i++) { PRIMITIVES.push(primitive_pairs[i]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pair(f) {\n return function(pair) {\n return f (pair.fst) (pair.snd);\n };\n }", "function pair(x) {\n return function(y) {\n return [x, y];\n };\n }", "function pair(x) {\n return function(y) {\n return [x, y];\n };\n }", "function Pair$prototype$map(f) {\n re...
[ "0.59501415", "0.55619204", "0.55619204", "0.55407715", "0.54801613", "0.54667425", "0.54667425", "0.5312095", "0.52400565", "0.51821", "0.5166679", "0.50765413", "0.5027816", "0.5023908", "0.49844208", "0.49799588", "0.48994455", "0.48386005", "0.4836176", "0.48359907", "0.4...
0.5966202
0
Get path start point for placing marker
function pathStartPoint(path) { var d = path.attr("d"), dsplitted = d.split(" "); return dsplitted[1]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pathStartPoint(path) {\n var d = path.attr(\"d\"),\n dsplitted = d.split(\" \");\n let posX = dsplitted[0].replace('m', '').replace('M', '');\n let posY = dsplitted[1].replace(/C.*/, \"\");\n return [posX, posY];\n }", "function pathStartPoint(path) {\n var d...
[ "0.76095366", "0.6805072", "0.6765053", "0.65661997", "0.6161602", "0.61341083", "0.6063541", "0.60580134", "0.59690267", "0.5955668", "0.59499264", "0.59344554", "0.5877248", "0.5864725", "0.5819701", "0.5798319", "0.57706255", "0.57528746", "0.5747413", "0.5744603", "0.5694...
0.73232853
1
Screen touched, store the original coordinate
function touchStart(event) { originalCoord.x = (settings.touch_capable) ? event.targetTouches[0].pageX : event.pageX; originalCoord.y = (settings.touch_capable) ? event.targetTouches[0].pageY : event.pageY; finalCoord.x = originalCoord.x; finalCoord.y = originalCoord.y; started = true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function touchStart(event) {\n var touch = event.originalEvent.targetTouches[0];\n originalCoord.x = touch.pageX;\n originalCoord.y = touch.pageY;\n }", "function servostart(e) {\n\tx_finger_bak = e.changedTouches[0].screenX\n\ty_finger_bak = e.changedTouches[0].screenY\n\treturn false\...
[ "0.70565414", "0.67514926", "0.67186695", "0.65858287", "0.6575918", "0.6531952", "0.6516861", "0.63852906", "0.6355234", "0.63459", "0.6317175", "0.62792486", "0.6244817", "0.62415385", "0.6239433", "0.62281585", "0.62248945", "0.62101215", "0.6198575", "0.61981314", "0.6174...
0.60667735
34
Store coordinates as finger is swiping
function touchMove(event) { //event.preventDefault(); event.stopPropagation(); finalCoord.x = (settings.touch_capable) ? event.targetTouches[0].pageX : event.pageX; finalCoord.y = (settings.touch_capable) ? event.targetTouches[0].pageY : event.pageY; window.clearTimeout(settings.hold_timer); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cust_swipeEvent(evnt, swipedirection) {\n //f_log(evnt.clientX+\", \"+evnt.clientY)\n}", "function servostart(e) {\n\tx_finger_bak = e.changedTouches[0].screenX\n\ty_finger_bak = e.changedTouches[0].screenY\n\treturn false\n}", "handleSwipeInput(type, touch) {\n // If infinity mode is enable...
[ "0.6505384", "0.6444388", "0.6437896", "0.6431875", "0.64022213", "0.6244339", "0.6233738", "0.62265754", "0.61965704", "0.61900896", "0.61773527", "0.6114124", "0.6053607", "0.60418713", "0.598095", "0.5978804", "0.59727275", "0.5949688", "0.5932933", "0.592982", "0.59260386...
0.6137176
11
If the event is not supported natively, this handler will be bound to the window resize event to simulate the orientationchange event.
function handler() { // Get the current orientation. var orientation = get_orientation(); if(orientation !== last_orientation) { // The orientation has changed, so trigger the orientationchange event. last_orientation = orientation; win.trigger( "orientationchange" ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handler() {\n // Get the current orientation.\n var orientation = get_orientation();\n if(orientation !== last_orientation) {\n // The orientation has changed, so trigger the orientationchange event.\n last_orientation = or...
[ "0.7251891", "0.7216199", "0.69561166", "0.69253564", "0.6762314", "0.6676715", "0.6655208", "0.6649175", "0.66072506", "0.65641415", "0.6560129", "0.64886653", "0.6469923", "0.6448346", "0.64429057", "0.64369047", "0.64093316", "0.6409122", "0.63554054", "0.63498896", "0.632...
0.69417924
3
Trigger a custom event:
function triggerCustomEvent( obj, eventType, event ) { var originalType = event.type; event.type = eventType; $.event.handle.call( obj, event ); event.type = originalType; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function trigger() {\n GEvent.trigger.apply(this, arguments);\n }", "triggerEvent(e){\n\t\tthis.emit(e.type, e);\n\t}", "trigger(eventName, data = null) {\n if (!eventName) return;\n let e = new CustomEvent(eventName, {detail: data});\n this.dummy.dispatchEvent(e);\n }", "function...
[ "0.75924385", "0.7392156", "0.731808", "0.7051232", "0.6979131", "0.6926319", "0.69248116", "0.69240206", "0.6890708", "0.68490106", "0.68159276", "0.6792621", "0.67759085", "0.6765863", "0.6741408", "0.6731885", "0.6729136", "0.6720517", "0.6708007", "0.6708007", "0.6695983"...
0.6684604
21
function to read csv data
function readCSV(path){ Papa.parse(path, { header: true, download: true, complete: function(data) { console.log(data); // map the data mapCSV(data); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "csvDataReader() {\n // turn this.csvText into a json that has the names of the columns as fields, and each has an array which is the data that follows\n // NOTE each row must either end with a \\r or a \\n\n let lines = this.paneOb.csvText.replace(/\\r?\\n/g, \"---\").split(\"---\")\n l...
[ "0.7564435", "0.7218716", "0.7207489", "0.72043586", "0.7165747", "0.70557016", "0.70532125", "0.6967918", "0.6931578", "0.69278246", "0.6925315", "0.68955696", "0.68776506", "0.6850536", "0.67808", "0.67527103", "0.67394155", "0.6714678", "0.6644682", "0.66386336", "0.662408...
0.73058873
1
Return current body scroll pos
function getScrollPos(){ if (document.documentElement.scrollTop!=0){ return document.documentElement.scrollTop; } else if (document.body.scrollTop!=0){ return document.body.scrollTop; } return 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCurrentScroll() {\n return window.pageYOffset || document.documentElement.scrollTop;\n }", "function get_current_scroll() {\n return document.scrollTop||document.documentElement.scrollTop||document.body.scrollTop;\n}", "function getWindowScrollPos() {\n \t_windowPos = $(window).scrollTop();...
[ "0.76355666", "0.7466188", "0.74612087", "0.73992795", "0.7307416", "0.7160872", "0.71547514", "0.71547514", "0.71517736", "0.71430427", "0.71209854", "0.7109257", "0.7105997", "0.71055055", "0.71055055", "0.71055055", "0.71055055", "0.71055055", "0.7077198", "0.7077198", "0....
0.78550774
0
Function allows for pagination
pageChange(direction){ let new_page = this.state.currentPage if(direction === 'next'){ new_page += 1 this.setState({ currentPage: new_page }) } else if(direction === 'last'){ new_page -= 1 this.setState({ currentPage: new_page }) } setTimeout( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pagination() {\r\n\t\t\t\t$scope.pageSize = $scope.shownoofrec;\r\n\t\t\t\t\r\n\t\t\t\t$scope.currentPage = 0;\r\n\t\t\t\t$scope.totalPages = 0;\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t$scope.nextDisabled = false;\r\n\t\t\t\t$scope.previousDisabled = true;\r\n\t\t\t\t\r\n\t\t\t\tif(self.Filtervehicles.length <...
[ "0.7412964", "0.72385496", "0.7174876", "0.7167234", "0.7166441", "0.7160091", "0.71305865", "0.7103164", "0.7094323", "0.7086138", "0.70491505", "0.704082", "0.70355076", "0.7027247", "0.70174724", "0.69889116", "0.697355", "0.69295764", "0.6923987", "0.6923792", "0.69182587...
0.0
-1
Setting up a new query based on the page change
pageQuery(){ let query = this.state.currentQuery + '&pageNum=' + this.state.currentPage this.getCharities(query) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updatePage() {\n \tcountLinks();\n \tgetDropDowns();\n \tquery();\n }", "function updateQuery() {\n var newUrl = window.location.href;\n // clean out valueless parameters to simplify ensuing matching\n newUrl = newUrl.replace(/(.*[?&])param1(&(.*))?$/, \"$1$3\");\n if (param1 !== default...
[ "0.673173", "0.6419026", "0.6336284", "0.61993414", "0.61858064", "0.6165371", "0.6078017", "0.60704815", "0.60395235", "0.595979", "0.5949341", "0.5938256", "0.5921672", "0.5918198", "0.5910545", "0.5868559", "0.5831434", "0.5806789", "0.5792542", "0.5786613", "0.57855755", ...
0.6164251
6
Changes the view for the user based on what part of the app they wish to visit
changePage (newPage) { let toUpdate = {}; for(let key in this.state.page){ toUpdate[key] = false; } toUpdate[newPage] = true; this.setState({page: toUpdate }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function changeUserView(url, guid, session){\n var data = {};\n if(url === '/dial'){\n data.content = fs.readFileSync(dialContent,\"utf8\").toString();\n data.scripts = dialScripts;\n data.title = \"Dial testing \";\n }\n else if(url === '/wheel'){\n ...
[ "0.6399393", "0.6348322", "0.6291174", "0.62287754", "0.6029674", "0.60186386", "0.59768933", "0.5937655", "0.57944936", "0.5791002", "0.5788412", "0.5781387", "0.57170707", "0.5687907", "0.56822544", "0.5677238", "0.56650126", "0.5629046", "0.5621866", "0.5610559", "0.560010...
0.0
-1
Clears charities off of the index page
clearBoard(){ this.setState({ showBoard: false, charities: false }) console.log(this.state.showBoard) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "clear() {\n this.index.clear();\n }", "function clearList() {\n // read number of displayed characters\n var charactersLength = displayedCharacters.length;\n // remove all displayed characters\n for(var j=0; j < charactersLength; j++) {\n removeCharacterFromList(displayedCharacters[0]);\n ...
[ "0.65313286", "0.6529175", "0.6383574", "0.63703966", "0.62455916", "0.6212528", "0.6174972", "0.6131038", "0.61309576", "0.6129341", "0.60640144", "0.60359955", "0.60154706", "0.60099125", "0.6006055", "0.5975544", "0.5952413", "0.5939473", "0.59361774", "0.59178746", "0.591...
0.0
-1
function to register a new user to the site
createUser(new_user){ fetch("/users", { body: JSON.stringify(new_user), method: "POST", headers: { 'Accept': 'application/json, text/plain, */*', 'Content-Type': 'application/json' } }) .then(createdUser => { return createdUser.json() }) .then(jsonedUser...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function registerUser() {\n addUser()\n }", "function registerNewUser() {\n USER_NAME = buildNewName();\n USER_PWD = buildNewPassword();\n register(USER_NAME, USER_PWD);\n}", "function register() {\n User.register(self.user, handleLogin);\n }", "function registerUser(){\n Cloud.User...
[ "0.83331406", "0.8248498", "0.7904088", "0.7742934", "0.7715611", "0.757377", "0.74885535", "0.74715865", "0.74163413", "0.7406071", "0.7398074", "0.7374356", "0.7360765", "0.7360765", "0.73404056", "0.7324366", "0.7304939", "0.7298688", "0.7295901", "0.7279158", "0.7266996",...
0.0
-1
Admin only function for update crises table
createCrisis(new_crisis){ fetch("/crises", { body: JSON.stringify(new_crisis), method: "POST", headers: { 'Accept': 'application/json, text/plain, */*', 'Content-Type': 'application/json' } }) .then(createdCrisis => { console.log('createdCrisis') console.l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "update(){}", "update(){}", "update(){}", "function getTableUpdate() {\n\n}", "function adminUpdate(data) {\n\t\t\t\n\t\t\t\n\t\t}", "static modifyC(req, res) {\n const { titulo,grupo } = req.body\n return Cuadernos\n .findByPk(req.params.id)\n .then((data) => {\n ...
[ "0.62681407", "0.62681407", "0.62681407", "0.5931524", "0.5901199", "0.58822834", "0.5769472", "0.56957155", "0.56817555", "0.5612802", "0.5604566", "0.55985075", "0.5590548", "0.55566686", "0.55504197", "0.55143446", "0.5504433", "0.5500185", "0.54986244", "0.5498441", "0.54...
0.0
-1
connects to route for removing a like
removeLike(user_id, charity_id){ fetch("/favorites/" + user_id + "/" + charity_id, { method: "DELETE" }) .then(data => { this.changePage('charitiesSearch') }) .catch(error => console.log(error)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async removeLike(likeId) {\n try {\n let result = await this.axiosInstance.delete(`/likes/${likeId}`);\n return result;\n } catch (err) {\n helpMeInstructor(err);\n return err;\n }\n }", "stopLinkRouting() {}", "static async unlike(like) {\n const { username, videoId } = like;\...
[ "0.5831381", "0.5737053", "0.54467756", "0.54453856", "0.54169977", "0.53984034", "0.5369349", "0.535954", "0.53559005", "0.53347903", "0.5309399", "0.5296733", "0.52814937", "0.5275042", "0.5232883", "0.5217641", "0.52008176", "0.5185922", "0.5182336", "0.5177788", "0.517370...
0.5449191
2
removes disliked charity from this.state
disliked(charity_id){ let new_charity_id = parseInt(charity_id, 10); console.log(new_charity_id) const new_loggedUser = this.state.loggedUser new_loggedUser.favorites.map((val, index) =>{ console.log(val['id']) if(val['id'] == new_charity_id){ console.log(val) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeHoverState(){\n\t\t\t\t\n\t\tg_objHandleTip.removeClass(\"ug-button-hover\");\n\t}", "unlike() {\r\n return this.clone(Item, \"unlike\").postCore();\r\n }", "removeNoImage() {\n var newcharacters = this.state.characters.filter(function(character) {\n return character....
[ "0.5976637", "0.5937271", "0.57958966", "0.5762873", "0.5698824", "0.56634164", "0.5639857", "0.5638199", "0.5579017", "0.55537134", "0.5471536", "0.5455142", "0.5443469", "0.54325217", "0.5422968", "0.5418929", "0.54170835", "0.54139036", "0.54015934", "0.5384686", "0.537633...
0.0
-1
adds a liked charity to this.state
liked(charity){ this.render() const new_loggedUser = this.state.loggedUser if(charity.id){ new_loggedUser.favorites.push(charity) } console.log(new_loggedUser) this.setState({ loggedUser: new_loggedUser }) this.changePage('charitiesSearch') }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addLikes() {\n if (propLike?.includes(user.username)) {\n let index = propLike.indexOf(user.username);\n let removeLike = [\n ...propLike.slice(0, index),\n ...propLike.slice(index + 1),\n ];\n setLikeGet(removeLike);\n setPropLike(removeLike);\n setRedLike(\...
[ "0.64431095", "0.6389928", "0.6384073", "0.6193744", "0.6082943", "0.6004743", "0.59330195", "0.593209", "0.5918976", "0.5894932", "0.5865938", "0.5854632", "0.5848063", "0.5814264", "0.57919854", "0.5790937", "0.577904", "0.575214", "0.5730985", "0.5720333", "0.571764", "0...
0.6157391
4
request to the create like route
createLike(new_like){ fetch("/favorites", { body: JSON.stringify(new_like), method: "POST", headers: { 'Accept': 'application/json, text/plain, */*', 'Content-Type': 'application/json' } }) .then(createdLike => { return createdLike.json() }) .catch(error => consol...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "create(req, res) {\n\n\t}", "create(request, response) {\n console.log('insde create', request.body);\n Resttask.create(request.body)\n .then(resttask => response.json(resttask))\n .catch(error => response.json(error));\n }", "async create({ request, response, view }) {}", "initCreateEndpoin...
[ "0.7255012", "0.70754325", "0.7044627", "0.68993825", "0.67524177", "0.6695365", "0.66532475", "0.664422", "0.6541894", "0.6541894", "0.6541894", "0.6541894", "0.6541894", "0.6541894", "0.6541894", "0.6529077", "0.65123415", "0.647319", "0.6469608", "0.63955355", "0.6377695",...
0.0
-1
Function to send a request to the API for charities
getCharities(query) { if(!query.includes('&pageNum=')){ this.setState({ currentQuery: query }) } fetch("/charities/" + query) .then(response =>{ console.log('response') console.log(response) return response.json() }) .then(query_charities => { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function locationCharityAPI(lat, lng) {\n // console.log('AUTO CHARITIY RUNNING')\n // console.log('Lat and Lng is: ' + lat + ', ' + lng)\n\n var API_KEY = \"aca9cc829aaa6b9d9b3fd4f972f5acf0\"; // Andrews Key //\n var queryURL = \"http://data.orghunter.com/v1/charitysearch?user_key=\" + API_KEY + \"&ro...
[ "0.67685175", "0.6724661", "0.6611524", "0.6010944", "0.5943541", "0.5940208", "0.5903179", "0.5847348", "0.5723728", "0.5596164", "0.55873847", "0.5580202", "0.5578444", "0.557018", "0.5565146", "0.55556273", "0.55368686", "0.55364496", "0.55002105", "0.54984844", "0.5496392...
0.54679286
23
Request to the API to set up charity show page
getCharity(query) { query = query.split('') while(query.length < 9){ query.unshift('0') } query = query.join('') this.setState({ currentQuery: query }) fetch("/charities/find/" + query) .then(response => response.json()) .then(query_charity => { this.setSt...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function locationCharityAPI(lat, lng) {\n // console.log('AUTO CHARITIY RUNNING')\n // console.log('Lat and Lng is: ' + lat + ', ' + lng)\n\n var API_KEY = \"aca9cc829aaa6b9d9b3fd4f972f5acf0\"; // Andrews Key //\n var queryURL = \"http://data.orghunter.com/v1/charitysearch?user_key=\" + API_KEY + \"&ro...
[ "0.6207339", "0.6017626", "0.5924108", "0.58149105", "0.57977295", "0.5614771", "0.5590319", "0.5586435", "0.5563864", "0.5545721", "0.55203027", "0.5496017", "0.5473853", "0.54735714", "0.5468063", "0.5458128", "0.5434359", "0.5432083", "0.54201776", "0.5391519", "0.5370707"...
0.52278656
41
Sets user from logIn
setUser(new_user){ if(new_user != null){ new_user["password"] = "Nice Try"; } this.setState({loggedUser: new_user}); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setUser() {\n\tuser = firebase.auth().currentUser;\n\tisSignedIn = true;\n\tcheckIfIt();\n\tcheckIt();\n\tconnectUser();\n\tdisplayScreen();\n}", "function setCurrentUser(user) {\n \n currentUser.userId = user[0];\n currentUser.firstName = user[1];\n currentUser.lastName = user[2];\n curr...
[ "0.72441024", "0.7223284", "0.70890206", "0.708142", "0.70286095", "0.70286095", "0.6995136", "0.69179463", "0.6816669", "0.68023705", "0.67879134", "0.67772466", "0.67739344", "0.6754813", "0.6736261", "0.6659952", "0.66449076", "0.6585696", "0.65629894", "0.65322363", "0.64...
0.0
-1
User find route request
loginUser(new_user){ console.log(new_user) fetch("/users/find/'" + new_user.user_name + "'") .then(response => response.json()) .then(logged_user => { if(new_user.password === logged_user.password){ this.setUser(logged_user); } else { this.setState({ err...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "findRoute(ctx) {\n const url = ctx.request.url();\n const method = ctx.request.method();\n const hostname = ctx.request.hostname();\n /*\n * Profiling `route.match` method\n */\n const matchRoute = ctx.profiler.profile('http:route:match');\n const route = t...
[ "0.7279315", "0.67023396", "0.64789516", "0.64747775", "0.6295089", "0.6251468", "0.62110096", "0.6194343", "0.6155168", "0.61550933", "0.61320907", "0.60676986", "0.60610104", "0.60445964", "0.60391694", "0.60382795", "0.60281676", "0.59865606", "0.5972909", "0.59722114", "0...
0.0
-1
THIS IS THE PROJECT FOR THE WEEKEND
sortedBy(value) { this.setState({ selectedBox: value }) axios.get('/api/recommended').then(res => { this.props.getAllUsers(res.data); }) let filteredUsers = this.props.allUsers.filter((val) => { return val[value] === this.props.user...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nasa_week_date(){\n let d = new Date();\n let d7 = new Date(d - (1000*60*60*24*7));\n }", "function Week7() {\n\treturn (\n\t\t<Section id='wk7' name='Week 7'>\n </Section>\n\t)\n}", "function getPublishDate() {\r var candidateDate = new Date();\r // Add a day until we reach a wednesday or...
[ "0.6242561", "0.6210211", "0.61920506", "0.60474354", "0.6015413", "0.6006952", "0.6004015", "0.6000694", "0.5984613", "0.5914156", "0.5902134", "0.58948", "0.5860551", "0.58602226", "0.5837931", "0.5831331", "0.58286", "0.58244795", "0.578678", "0.576747", "0.5760498", "0....
0.0
-1
vuex v3.1.1 (c) 2019 Evan You
function n(t){var e=Number(t.version.split(".")[0]);if(e>=2)t.mixin({beforeCreate:r});else{var n=t.prototype._init;t.prototype._init=function(t){void 0===t&&(t={}),t.init=t.init?[r].concat(t.init):r,n.call(this,t)}}function r(){var t=this.$options;t.store?this.$store="function"===typeof t.store?t.store():t.store:t.pare...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getFieldVuex() {\n return store.getters.dataField;\n }", "function vuexInit(){var options=this.$options;// store injection\n\tif(options.store){this.$store=options.store;}else if(options.parent&&options.parent.$store){this.$store=options.parent.$store;}}", "function U(He){Le&&(He._devtoolHook=Le,Le.emit('v...
[ "0.7111765", "0.70074075", "0.67470235", "0.6745943", "0.6623475", "0.6623475", "0.6623475", "0.6619513", "0.6594352", "0.6488856", "0.6359365", "0.6353934", "0.6352718", "0.6352718", "0.6352718", "0.6352718", "0.6352718", "0.63413787", "0.63218755", "0.62849313", "0.62817574...
0.0
-1
! vuerouter v3.0.6 (c) 2019 Evan You
function r(t,e){0}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private public function m246() {}", "private internal function m248() {}", "function jj(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"source.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "func...
[ "0.5984846", "0.5852653", "0.5814664", "0.5756701", "0.5726593", "0.5716056", "0.5655512", "0.55688936", "0.5557345", "0.55415744", "0.55216163", "0.55130935", "0.5477552", "0.5443834", "0.54430115", "0.5442166", "0.541533", "0.5398754", "0.5396449", "0.53751725", "0.53751725...
0.0
-1
=> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
function merge(left, right) { if (left[0] < right[0]) { mergeArr.push(left[0]) left.shift() }else { mergeArr.push(right[0]) right.shift() } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function arrayOneThrough10 () {\n let array =[];\n for (i = 0; i <= 10; i++) {\n array.push(i);\n }\n console.log(array);\n}", "function nList(init, end){\n var res = [];\n for (var i = init; i <= end; i++){\n res.push(i);\n }\n return res;\n }", "ra...
[ "0.6592262", "0.6342355", "0.62930936", "0.6291175", "0.6291031", "0.6263029", "0.62490624", "0.62438387", "0.6233363", "0.6167814", "0.6167265", "0.615659", "0.61286134", "0.61129045", "0.6100504", "0.6096793", "0.6094862", "0.6086499", "0.60799867", "0.60639304", "0.6054164...
0.0
-1
Chooses a random number between 0 and 2 Selects the string in that index of the CHOICES array and returns it
function getComputerChoice() { const CHOICES = ["rock", "paper", "scissors"]; const choice = Math.floor(Math.random() * CHOICES.length); return CHOICES[choice]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getChoice(options){\n let i = Math.floor(Math.random() * Math.floor(options.length));\n return options[i];\n }", "function getCOMP_CHOICE() {\n const RANDOM_NUM = Math.floor(Math.random() * 3)\n return CHOICES[RANDOM_NUM]\n}", "function getCompChoice(){\n const compChocies = ['r','p','s'];\n ...
[ "0.7628628", "0.7491051", "0.74642515", "0.745662", "0.7447376", "0.74464816", "0.7423443", "0.7382757", "0.73557293", "0.73206687", "0.7318839", "0.7271693", "0.7248974", "0.7228283", "0.7207607", "0.71828073", "0.7146196", "0.7136099", "0.7099487", "0.70948666", "0.70944166...
0.67329895
68
Calls prompt() to get a player's choice Compares the player's response to the CHOICES array to determine if the choice is valid. Repeats the question until the player chooses a valid response Returns player's choice
function getPlayerChoice() { const CHOICES = ["rock", "paper", "scissors"]; let choice; var isValid = false; // Asks player to type a choice, and converts to lowercase for comparison do { choice = prompt("Rock, paper, or scissors?").toLowerCase(); // Cycles through CHOICES array to check for valid p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ask() {\n inquirer.prompt(questions).then(function(answers) {\n output.push(answers.userSelection);\n if (answers.userSelection == choiceArray[0]) {\n console.log(\"Run Display Twitter\");\n twitterCall();\n } else if (answers.userSelection == choiceArray[1]) {\...
[ "0.7289869", "0.7183248", "0.7096727", "0.70739883", "0.7071073", "0.7022432", "0.6940197", "0.6915858", "0.68888783", "0.6865844", "0.6852463", "0.6830098", "0.68194884", "0.6806965", "0.67953", "0.67712045", "0.6763615", "0.6756948", "0.675261", "0.675156", "0.6723895", "...
0.7455189
0
Self contained round of RPS Compares a player's choice to the computer's choice and returns an outcome
function playRound() { let outcome; let computersChoice = getComputerChoice(); let playersChoice = getPlayerChoice(); // Player Rock comparison if(playersChoice === "rock") { if(computersChoice === "rock") { outcome = "tie"; } else if(computersChoice === "paper") { outcome = "lose";...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function playRPS(playerSelection, computerSelection){\n\n console.log(\"Human Player chooses \")\n console.log(playerSelection)\n console.log(\"Computer chooses \")\n console.log(computerSelection)\n\n if (playerSelection === computerSelection){\n console.log(\"It's a tie!\")\n tie = tie + 1;\n ...
[ "0.8282693", "0.8072506", "0.7990182", "0.7814841", "0.7737226", "0.77085954", "0.7703289", "0.7696689", "0.7692577", "0.76891965", "0.76516", "0.76485807", "0.7648463", "0.764829", "0.7643033", "0.7639487", "0.7635686", "0.7614398", "0.7608144", "0.7577136", "0.7572145", "...
0.7751097
4
Calls alert function based on the round's outcome
function displayOutcome(player, cpu, outcome) { // Player wins if(outcome === "win") { alert("You win, " + player + " beats " + cpu + "!"); } // Player loses if(outcome === "lose") { alert("You lose, " + cpu + " beats " + player + "!"); } // Player ties if(outcome === "tie") { alert("You...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fivePointsAlert(){\r\n if (playerScore == 5){\r\n alert(\"YOU SCORED FIVE POINTS! YOU WIN! Press the Start Over button to try again.\");\r\n } else if (computerScore == 5){\r\n alert(\"COMPUTER SCORED FIVE POINTS! YOU LOSE! Press the Start Over button to try again.\");\r\n }\r\n}", "function ta...
[ "0.66460747", "0.65873045", "0.64056146", "0.6347719", "0.6337483", "0.6317986", "0.6302157", "0.6260045", "0.6251497", "0.62476754", "0.62408847", "0.62317914", "0.6223607", "0.6222261", "0.6221646", "0.619319", "0.61837596", "0.61716795", "0.61516845", "0.61420643", "0.6103...
0.58104694
77
The main game loop. Calls playRound() up to five times, keeping track of the player and cpu's score as well as ties. Stops early if the player or the computer get to 3 (since it's best of 3) Calls getCurrentScore between rounds to show the player the score calls getOutcome at the end of the (up to) 5 rounds
function game() { let playerScore = 0; let computerScore = 0; let ties = 0; const MAX_ROUNDS = 5; for(let i = 0; i < MAX_ROUNDS; i++) { if(!(playerScore === 3 || computerScore === 3)) { let outcome = playRound(); if(outcome === "win") { playerScore++; } else if(outcome === ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function game(){\n\twhile(rounds<5){\n\t\tconst playerSelection = playerPLay();\n\t\tconst computerSelection = computerPlay();\n\t\tconsole.log(playRound(playerSelection, computerSelection));\n\t\tconsole.log(\"Scoreboard: Won: \" + won + \" Lost: \" + lost + \" Drawn: \" + drawn );\n\t\trounds++;\n\t}\n\n}", "f...
[ "0.811452", "0.78376836", "0.7771458", "0.77697104", "0.7722719", "0.76584166", "0.7648496", "0.763489", "0.76323956", "0.7608632", "0.75091714", "0.745271", "0.74167764", "0.74159604", "0.74129105", "0.7403149", "0.73980063", "0.73685485", "0.73285216", "0.73235804", "0.7296...
0.7918662
1
Calls an alert for the current score
function getCurrentScore(player, cpu, ties) { alert("You: " + player + "\nComputer: " + cpu + "\nTies: " + ties); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "saveScore() {\n alert(\"SAVE SCORE\");\n }", "function displayScore(){\n alert(\"Player Score - \" + playerScore + \" -- \" + compScore + \" - Computer Score\" );\n}", "function updateScore(){\n if(score === 5){\n setTimeout(function(){\n return alert(`you win! attempts: ${attempt}`)\n }...
[ "0.73342764", "0.7274051", "0.7223657", "0.7147854", "0.70706165", "0.7063236", "0.70259225", "0.69870955", "0.69781274", "0.69632524", "0.69492024", "0.6948488", "0.693059", "0.69215256", "0.6920392", "0.6906927", "0.6903819", "0.6887766", "0.6879768", "0.6864776", "0.685272...
0.65587616
79
The else statement seems pointless in a 5 point game, but I added it incase MAX_ROUNDS was changed to an even number for some reason.
function getOutcome(player, cpu, ties) { let outcome; // Player wins if (player > cpu) { outcome = "CONGRATULATIONS! You win!"; } // Player loses else if (player < cpu) { outcome = "Sorry! You lose!"; } // Player ties else { outcome = "It was a tie!"; } let score = "\n\n -Final S...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function game()\n {\n \tlet playerScore = 0;\n \tlet computerScore = 0;\n \tlet ties = 0;\n \tconst MAX_ROUNDS = 5;\n\n \tfor(let i = 0; i < MAX_ROUNDS; i++)\n \t{\n \t\tif(!(playerScore === 3 || computerScore === 3))\n \t\t{\n \t\t\tlet outcome = playRound();\n\n\t \t\tif(outcome === \"win\")\n\t \t\t{\n\t \t\t\t...
[ "0.7004964", "0.6814839", "0.6762888", "0.6652483", "0.6601788", "0.657065", "0.65378094", "0.65174234", "0.64456", "0.6419286", "0.6412557", "0.64030653", "0.63875246", "0.6379841", "0.63788396", "0.63382715", "0.6329395", "0.63017344", "0.62618136", "0.6240742", "0.62346095...
0.0
-1
'number' > sumFibs(1000) 1785 > sumFibs(4000000) 4613732 > sumFibs(4) 5 > sumFibs(75024) 60696 > sumFibs(75025) 135721 sumFibs :: Int > Int
function sumFibs(n) { var fibs = [1,1]; while(fibs[fibs.length -1] < n){ fibs = genFib(fibs); } if (fibs[fibs.length -1] > n){ fibs.pop(); } return sum(filterOdds(fibs)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sumFibs(num){\nvar sumArr = [0,1];\n for(var i=1; i <= num; i++){\n \tif(checkFib(i) && i%2 !== 0){\n \t\tsumArr.push(i);\n \t}\n }\n var result = 0;\n for(var a=0; a < sumArr.length; a++){\n \tresult += sumArr[a];\n }\n return result;\n}", "function sumFibs(num) {\n var p...
[ "0.80479705", "0.7759418", "0.77310604", "0.7712333", "0.77105844", "0.7646776", "0.76391786", "0.76357484", "0.76302826", "0.76299995", "0.7572519", "0.75351906", "0.75272167", "0.75166696", "0.7505442", "0.7481138", "0.7480665", "0.7469168", "0.7426736", "0.74127775", "0.74...
0.7341935
23
sum :: [Int] > Int > sum([1,1,2,3,5]) 12
function sum(ns){ if (ns.length > 0){ return ns.pop() + sum(ns); } else { return 0; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sum(list) {\n var s=0;\n for (let i = 0; i < list.length; i++) {\n s = s+list[i];\n }\n return s;\n}", "function sum(nums) {\n return nums.reduce(function(sum, curr) { return sum += curr });\n}", "function sum(numbers) {\n\t//your code is here \n\treturn numbers.reduce((acc,item) =...
[ "0.7539372", "0.7516776", "0.7301102", "0.7299367", "0.72889256", "0.72841054", "0.7278291", "0.72616696", "0.724228", "0.723146", "0.7227906", "0.7223919", "0.71895623", "0.7181071", "0.7136662", "0.71134925", "0.7094889", "0.7090689", "0.70776623", "0.70774734", "0.70754844...
0.0
-1
genFib :: [Int] > [Int] > genFib([1,1,2]) [1,1,2,3]
function genFib(ns){ var num1 = Number(ns[ns.length-1]); var num2 = Number(ns[ns.length-2]); ns.push(num1 + num2); return ns; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateFib(n) {\n var arr = [0, 1];\n\n for (var i = 0; i < n; i++) {\n arr[i] = arr[i - 1] + arr[i - 2]\n }\n return arr;\n\n}", "function generateFib(num) {\n let result = [];\n for (let i = 1; i <= num; i++) {\n\n // we're adding the first item\n // to the result list, app...
[ "0.7796331", "0.77427924", "0.77364016", "0.76583385", "0.76248", "0.69367653", "0.6930057", "0.6915269", "0.68959427", "0.6786181", "0.6753202", "0.67499214", "0.6663897", "0.66468346", "0.6586092", "0.65791553", "0.6551324", "0.6545768", "0.6529644", "0.6507963", "0.6507937...
0.75740373
5
filterOdds :: [Int] > [Int] > filterOdds([1,2,3,4,5]) [1,3,5]
function filterOdds(ns){ function isOdd(val) { return 1 === val%2; } return ns.filter(isOdd); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function filterOdds(numbers) {\n\treturn numbers.filter(num => num%2 != 0)\n}", "function filterOutOdds(){\n var nums =Array.prototype.slice.call(arguments);\n return nums.filter(function(num){\n return num%2===0\n });\n}", "function filterOutOdds(...nums){\n return nums.filter(num => num % ...
[ "0.8488326", "0.825862", "0.8035717", "0.8033203", "0.79535663", "0.7832252", "0.7831452", "0.7828965", "0.78279924", "0.7780102", "0.7772249", "0.7766425", "0.76709205", "0.7666675", "0.7640203", "0.7622683", "0.7619208", "0.7567815", "0.7540998", "0.7493766", "0.74703777", ...
0.7911728
5
returns a list of all deliveries placed in a Neighborhood Neighborhood has deliveries
deliveries() { return store.deliveries.filter( function(delivery) { return delivery.neighborhoodId === this.id; }.bind(this)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "deliveries(){\n const deliveriesInNeighborhood = [];\n for(const delivery of store.deliveries){\n if(delivery.neighborhoodId === this.id){\n deliveriesInNeighborhood.push(delivery)\n }\n }\n return deliveriesInNeighborhood;\n }", "function deliveries()...
[ "0.78983325", "0.6295982", "0.62263685", "0.5987658", "0.59395206", "0.5836306", "0.5747065", "0.5732922", "0.57218486", "0.56589663", "0.5597154", "0.55919886", "0.55889225", "0.55556834", "0.54793453", "0.54724926", "0.54623276", "0.543322", "0.54289806", "0.5410102", "0.53...
0.74722743
1
returns a unique list of meals that have been ordered in a particular neighborhood
meals() { let history = this.customers().map(function(customer) {return customer.meals()}); let newArr = []; let anotherNewArr = newArr.concat.apply(newArr, history); // from https://stackoverflow.com/questions/1960473/get-all-unique-values-in-a-javascript-array-remove-duplicates // var items =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "meals(){\n const neighborhoodMealIds =[];\n this.deliveries().forEach(function(delivery){\n neighborhoodMealIds.push(delivery.mealId)\n });\n let uniqueNeighborhoodMealIds = [...new Set(neighborhoodMealIds)]\n return store.meals.filter(meal => uniqueNeighborhoodMealIds....
[ "0.65197784", "0.6283378", "0.614889", "0.58909595", "0.5862712", "0.5788529", "0.56949884", "0.5673506", "0.5658385", "0.5626357", "0.55409855", "0.55041534", "0.5501388", "0.5433214", "0.54135936", "0.541122", "0.54003584", "0.5392561", "0.53658485", "0.5323286", "0.5320867...
0.5583782
10
returns all meals Customer ordered
meals() { return this.deliveries().map(function(delivery) { return delivery.meal(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "customers() {\n return this.deliveries().map(function(delivery) {\n return delivery.customer();\n });\n }", "customers(){\n const allCustomers = this.deliveries().map(delivery=>delivery.customer());\n return [...new Set(allCustomers)];\n }", "customers(){\n const mealCustome...
[ "0.680861", "0.6515702", "0.6478386", "0.64411247", "0.6421058", "0.6283924", "0.6238516", "0.6227255", "0.60301083", "0.59721446", "0.5971552", "0.5968159", "0.5947994", "0.5876293", "0.5812482", "0.5724242", "0.5722626", "0.5712631", "0.5711007", "0.56777537", "0.5674719", ...
0.5926878
13
returns total amount Customer has spent
totalSpent() { return this.meals().reduce(function(sum, meal) { return sum + meal.price; }, 0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getTotalMoney() {\n return Purchase.find().then(function(purchases) {\n let total = 0;\n for (i=0; i < purchases.length; i++) {\n total += purchases[i].cost;\n }\n return total;\n })\n}", "getTotalCost() {\n return this.transactions.map(t => t.cost).reduce((acc, value) => acc +...
[ "0.7087782", "0.7059148", "0.68442", "0.6828882", "0.6810763", "0.6764946", "0.67248094", "0.66405386", "0.6580548", "0.6538207", "0.64744306", "0.6424724", "0.64193726", "0.6385007", "0.6333123", "0.6331815", "0.6313853", "0.62622124", "0.6252108", "0.62306774", "0.6223654",...
0.6486886
11
Class method, so use keyword > static
static byPrice() { // how to sort in descending order // var points = [40, 100, 1, 5, 25, 10]; // points.sort(function(a, b){return b-a}); return store.meals.sort(function(a, b) {return b.price - a.price}); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static method(){}", "static staticMethod() {\n \t\n \t}", "static staticMethod() {}", "static staticHi(){\n console.log('i am static method');\n \n }", "static staticMethod() {\n return 'I am visible only when invoked as statis method';\n }", "static bar() {\n consol...
[ "0.8614218", "0.83933115", "0.7652662", "0.7092668", "0.6988159", "0.6801313", "0.6781569", "0.6634549", "0.660115", "0.6584443", "0.65559584", "0.6540138", "0.65114504", "0.64654195", "0.64467627", "0.644426", "0.6436438", "0.6417542", "0.6373282", "0.6350721", "0.63120294",...
0.0
-1
Meal has unique customers
customers() { return this.deliveries().map(function(delivery) { return delivery.customer(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "customers(){\n const mealCustomerIds =[];\n this.deliveries().forEach(function(delivery){\n mealCustomerIds.push(delivery.customerId)\n });\n let uniquemealCustomerIds = [...new Set(mealCustomerIds)]\n return store.customers.filter(customer => uniquemealCustomerIds...
[ "0.738728", "0.6825292", "0.6646566", "0.6603268", "0.6588864", "0.63680553", "0.6043555", "0.5965034", "0.5947503", "0.5918448", "0.5907472", "0.58828366", "0.5786296", "0.5704801", "0.5682107", "0.56114656", "0.56063277", "0.55949664", "0.55833393", "0.55470407", "0.5539711...
0.55536884
19
Delivery belongs to a Meal
meal() { return store.meals.find(function(meal) {return meal.id === this.mealId}.bind(this)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "deliveries(){\n return store.deliveries.filter(delivery=>{\n return delivery.mealId === this.id\n })\n }", "deliveries() {\n return store.deliveries.filter(delivery => {\n return delivery.mealId == this.id;\n });\n }", "deliveries(){\n return store.deliveries.filter(de...
[ "0.6442312", "0.6273432", "0.6273367", "0.613461", "0.58831745", "0.56963104", "0.5684974", "0.5646847", "0.56133914", "0.5579648", "0.5572067", "0.55119485", "0.54591686", "0.5450769", "0.5445107", "0.54366636", "0.5222774", "0.52144426", "0.5198755", "0.5189623", "0.5164038...
0.5525559
11
Delivery belongs to a Customer
customer() { return store.customers.find(function(customer) {return customer.id === this.customerId}.bind(this)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "deliveries(){\n return store.deliveries.filter(delivery => {\n return delivery.customerId === this.id\n })\n }", "customers() {\n return this.deliveries().map(function(delivery) {\n return delivery.customer();\n });\n }", "customers() {\n return this.deliveries().map(delivery => {\n ...
[ "0.6350986", "0.6246339", "0.6094732", "0.5732892", "0.5712106", "0.5659955", "0.56577814", "0.5632", "0.56259274", "0.55914074", "0.557524", "0.5507566", "0.55026", "0.5474942", "0.5446934", "0.5394082", "0.53635234", "0.53617376", "0.5330699", "0.53041095", "0.52490956", ...
0.55868506
10
returns Neighborhood that Delivery was placed in
neighborhood() { // const thisId = this.customer().neighborhoodId; // return store.neighborhoods.find(function(neighborhood) {return neighborhood.id === thisId}); // two lines of code above works well, but trying another way return store.neighborhoods.find(function(neighborhood) {return neighborhood.id ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "deliveries(){\n const deliveriesInNeighborhood = [];\n for(const delivery of store.deliveries){\n if(delivery.neighborhoodId === this.id){\n deliveriesInNeighborhood.push(delivery)\n }\n }\n return deliveriesInNeighborhood;\n }", "deliveries() {\n r...
[ "0.6480872", "0.607604", "0.6060482", "0.60545427", "0.5983153", "0.59646875", "0.55459505", "0.549193", "0.5475205", "0.5431882", "0.53924567", "0.5389421", "0.5389048", "0.5384827", "0.53545874", "0.5333972", "0.5281522", "0.5266957", "0.5258755", "0.5255843", "0.5237434", ...
0.5326531
16
revoir les conditions pour le moment ce sont des testes !
function start_game(){ var random = Math.floor(Math.random()*4); computer_round(random); count_turn = count_turn +1; console.log(count_turn); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initConditions() {\r\n\t\tscore = 0;\r\n\t\tcurrentQuestion = 1;\r\n\t\tanswerAllowed = true;\r\n\t}", "function processtad_ai(ct, ttime, gcond, ddate) {\n var rs = [];\n var i = 0;\n var rs2 = '';\n\n var ctcond = Number(condition[gcond][ct].length) - 1;\n while (i <=...
[ "0.6055072", "0.5980232", "0.5882152", "0.58031476", "0.5762592", "0.5705641", "0.5657063", "0.5583989", "0.5520279", "0.5518773", "0.5492745", "0.54563844", "0.5431275", "0.5431275", "0.54227614", "0.53941464", "0.5359849", "0.5339678", "0.5338881", "0.5323848", "0.53192747"...
0.0
-1
Here we break off todos into their own reducer function They only have a SLICE of the state to manage, this is reducer composition
function todos(state = initalTodoState, action) { switch (action.type) { case ADD_TODO: { const { id, text } = action.payload; return { allIds: [...state.allIds, id], byIds: { ...state.byIds, [id]: { text, completed: false } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reducer(todos, action) {\n switch(action.type) {\n case ACTIONS.ADD_TODO:\n return [...todos, newTodo(action.dispatch.name)]\n default:\n return console.log('weee')\n }\n}", "function todoReducer(state = initialState, action) {\n switch(action.type) {\n ...
[ "0.7576864", "0.75530493", "0.7497265", "0.74442154", "0.74233603", "0.74087363", "0.7357857", "0.7260145", "0.7074687", "0.70652056", "0.7002244", "0.6994353", "0.69750917", "0.6929634", "0.6894535", "0.6673308", "0.66169626", "0.6597419", "0.6596114", "0.65941584", "0.65686...
0.7406781
6
Get url parameter by name
function getParameterByName( name, url ) { if ( ! url ) { url = window.location.href; } name = name.replace( /[\[\]]/g, '\\$&' ); var regex = new RegExp( '[?&]' + name + '(=([^&#]*)|&|#|$)' ), results = regex.exec( url ); if ( ! results ) { return null; } if ( ! results[2] ) { return ''; } return ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getURLParameter(url, name) {\n const urlParsed = coreHttp.URLBuilder.parse(url);\n return urlParsed.getQueryParameterValue(name);\n}", "function getURLParameter(url, name) {\n const urlParsed = coreHttp.URLBuilder.parse(url);\n return urlParsed.getQueryParameterValue(name);\n}", "function ...
[ "0.8267224", "0.8267224", "0.82546467", "0.82351273", "0.82162863", "0.8210883", "0.81924", "0.81924", "0.8123633", "0.80971533", "0.80643654", "0.8053557", "0.804888", "0.80419207", "0.80419207", "0.80379355", "0.8022983", "0.8022556", "0.8022556", "0.80212873", "0.8016459",...
0.0
-1
custom object type 2 using the function
function product(){ this.name = "laptop"; this.price = 4500; this.showDetails= function(){ return this.name + ":" + this.price; }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function obj(objec){\nreturn objec;\n}", "function new1(func){\n let obj = Object.create(func.prototype);\n let k = func.call(obj);\n if (typeof k === 'object'){\n return k\n }else {\n return obj;\n }\n}", "function Obj() {}", "function NewObj(){}", "static initialize(obj, type...
[ "0.6747497", "0.61847204", "0.6056446", "0.6043313", "0.6024345", "0.6024345", "0.6024345", "0.5947001", "0.5947001", "0.59020346", "0.5899984", "0.58970106", "0.58857846", "0.58857846", "0.58626604", "0.58510333", "0.5841697", "0.5832957", "0.5809212", "0.5791156", "0.577769...
0.0
-1
custom object type 2 using the constructor
function salesman(name1, age2){ this.name = name1; this.age = age2; this.showDetails=function(){ return this.name + ":" + this.age; }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructur() {}", "static initialize(obj, type) { \n obj['type'] = type;\n }", "static initialize(obj, type) { \n obj['type'] = type;\n }", "static initialize(obj, type) { \n obj['type'] = type;\n }", "static initialize(obj, type, operation, value) { \n obj['type'] = t...
[ "0.70211077", "0.67013484", "0.67013484", "0.67013484", "0.66138905", "0.65393144", "0.6500225", "0.64932156", "0.64461744", "0.6422053", "0.63977426", "0.6354711", "0.6316124", "0.6295543", "0.6286878", "0.6286878", "0.62655073", "0.62488526", "0.62332624", "0.62332624", "0....
0.0
-1
An adaptation of Dorcht's cookie functions.
function setCookie(name, value, expires, path, domain, secure){ if (!expires){ expires = new Date() } document.cookie = name + "=" + escape(value) + ((expires == null) ? "" : "; expires=" + expires.toGMTString()) + ((path == null) ? "" : "; path=" + path) + ((domain == null) ? "" : "; d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Get_Cookie(name){var start=document.cookie.indexOf(name+'=');var len=start+name.length+1;if((!start)&&(name!=document.cookie.substring(0,name.length)))\nreturn null;if(start==-1)\nreturn null;var end=document.cookie.indexOf(';',len);if(end==-1)end=document.cookie.length;if(end==start){return'';}\nreturn u...
[ "0.72995234", "0.72484", "0.72449297", "0.7241809", "0.7172275", "0.7121105", "0.7119578", "0.71097374", "0.70993984", "0.70870894", "0.703829", "0.70015556", "0.70015556", "0.70015556", "0.69827175", "0.69798857", "0.6978424", "0.6963833", "0.6955328", "0.69312507", "0.69256...
0.0
-1
Does a post to the signup route. If successful, we are redirected to the members page Otherwise we log any errors
function checkPasswordMatch() { var password = $("#password-input").val(); var confirmPassword = $("#password-check").val(); if (password !== confirmPassword){ $("#divCheckPasswordMatch").html("Passwords do not match!"); } else{ $("#divCheckPasswordMatch").html("Passwords match."); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function signUpUser(email, password) {\n $.post(\"/api/signup\", {\n email: email,\n password: password\n })\n .then(() => {\n window.location.replace(\"/members\");\n // If there's an error, handle it by throwing up a bootstrap alert\n })\n .catch(handleLoginErr);\n }...
[ "0.7518692", "0.7518692", "0.7305266", "0.73043793", "0.72215337", "0.72159237", "0.72139263", "0.72031415", "0.7155884", "0.70986736", "0.7040945", "0.7024202", "0.70211756", "0.695843", "0.6928146", "0.68986577", "0.6849629", "0.6839352", "0.6835032", "0.6821491", "0.680081...
0.0
-1
use this to allow nested messages, taken from docs:
function flattenMessages() { var nestedMessages = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; return Object.keys(nestedMessages).reduce(function (messages, key) { var value = nestedMessages[key]; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "validateMessage (message) {\n\t\tif (message.message.post && message.message.post.$set) { return; }\n\t\treturn super.validateMessage(message);\n\t}", "function flattenMessages() {\n\t var nestedMessages = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\t var prefix = arguments.length...
[ "0.62195766", "0.6162749", "0.60207057", "0.59962493", "0.589865", "0.58770686", "0.5864992", "0.5760066", "0.57011575", "0.56846255", "0.56491506", "0.5626651", "0.56041217", "0.5580081", "0.5579992", "0.55568117", "0.55486184", "0.55445385", "0.55373454", "0.551657", "0.551...
0.60470897
3