query
stringlengths
9
14.6k
document
stringlengths
8
5.39M
metadata
dict
negatives
listlengths
0
30
negative_scores
listlengths
0
30
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
List the Lambda versions for each Lambda
function listLambdaVersion(functionName, functionAliases, nextMarker){ var params = { Marker: nextMarker, FunctionName: functionName }; lambda.listVersionsByFunction(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else { //Compare each version wit...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async listFunctions() {\n const funcs = await this.getFunctions();\n const funcsVersions = await this.getFunctionVersions(funcs);\n this.displayFunctions(funcsVersions);\n }", "async getLambda() {\n return [];\n }", "function listVersions() {\n return github.releases()\n .then...
[ "0.6259536", "0.61980844", "0.6190831", "0.59095687", "0.5791276", "0.5563618", "0.5556869", "0.5358779", "0.51889306", "0.51058125", "0.5097453", "0.5054723", "0.49863943", "0.49857306", "0.4970484", "0.4935012", "0.49088824", "0.48747206", "0.487213", "0.48679668", "0.48640...
0.6880332
0
Delete the Lambda versions not in use
function deleteLambdaVersion(functionName, functionVersion){ console.log("DELETE version " + functionVersion + " from " + functionName) var params = { FunctionName: functionName, Qualifier: functionVersion }; lambda.deleteFunction(params, function(err, data) { if (err) console.log(err, err.stack); //...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteVersion() {}", "flushOldVersions() {\n for (let key of Object.keys(this.ls)) {\n if (this._reg.test(key)) {\n try {\n if (version === JSON.parse(this.ls.getItem(key)).version) {\n continue;\n }\n } catch (e) {\n // we couldn't verify the ...
[ "0.6974176", "0.61566824", "0.6146665", "0.59245527", "0.5799267", "0.57676184", "0.56511945", "0.5493543", "0.54893607", "0.54794014", "0.54182607", "0.53936154", "0.5375008", "0.5371373", "0.5357652", "0.5320811", "0.530917", "0.5300805", "0.52874374", "0.5280161", "0.52741...
0.6666523
1
Returns true/false depending on whether row and column identify a valid square on the board.
isValidLocation(row, col) { return (row >= 0 && col >= 0 && row < this.boardSize && col < this.boardSize && row == Math.round(row) && col == Math.round(col)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isValid(board, row, col) {\n let num = board[row][col];\n // check if row / column / block already has current number\n return !(\n boardHasNumberInSection(board, num, {\n rowStart: 0, rowEnd: 9, rowInc: 1,\n colStart: col, colEnd: col + 1, col...
[ "0.79455656", "0.79141545", "0.77994317", "0.77289325", "0.7727034", "0.7725688", "0.77035475", "0.76612914", "0.7661045", "0.7557659", "0.74593717", "0.74243295", "0.74095166", "0.7392038", "0.73904604", "0.7376368", "0.73699623", "0.7369783", "0.73658466", "0.7365323", "0.7...
0.807186
0
Returns true/false depending on whether the square at [row,col] is empty (does not contain a candy).
isEmptyLocation(row, col) { Util.assertNumeric(row, "row must be a number"); Util.assertNumeric(col, "col must be a number"); if (this.getCandyAt(row, col)) { return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_isEmpty(row, col) {\n\t\t\t// Check if out of bounds.\n\t\t\tif (row < 0 || row >= this.size || col < 0 || col >= this.size) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn this.tiles[row][col].isEmpty();\n\t\t}", "isEmpty(row, col) {\n\t\tthis._board.requireValidPosition(row, col);\n\t\treturn this._board.is...
[ "0.8088179", "0.7774138", "0.76111454", "0.76083636", "0.75612915", "0.75589377", "0.7533156", "0.7506266", "0.75039744", "0.74416745", "0.73778385", "0.73768085", "0.7368341", "0.7321205", "0.7314784", "0.7307688", "0.725854", "0.7238149", "0.72317", "0.71334296", "0.7108074...
0.78783005
1
Perform an a valid move automatically on the board. Flips the appropriate candies, but does not crush the candies.
doAutoMove() { var move = rules.getRandomValidMove(); var toCandy = board.getCandyInDirection(move.candy, move.direction); this.flipCandies(move.candy, toCandy); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function move()\n{\t\t\t\t\t\n\tsetFocus();\t\n\tchessBoard.position(tabStrGameState[indCoupCourant], false);\n}", "function takeBlindMove(turn) {\n let available = game.currentState.emptyCells();\n let randomCell = available[Math.floor(Math.random() * available.length)];\n let action = new ...
[ "0.64238614", "0.6377201", "0.63405675", "0.6336193", "0.6318578", "0.6274337", "0.62671316", "0.62329125", "0.62327725", "0.623277", "0.6218943", "0.6218727", "0.6217808", "0.6203884", "0.61815614", "0.61790735", "0.6174652", "0.61736816", "0.61736757", "0.61670864", "0.6155...
0.76266617
0
Get the candy found on the square at [row,column], or null if the square is empty.Requires row,column < size.
getCandyAt(row, col) { Util.assertNumeric(row, "row must be a number"); Util.assertNumeric(col, "col must be a number"); if (this.isValidLocation(row, col)) { return this.square[row][col]; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSquareByLocation(colNum, rowNum) {\n return $(\".col\" + colNum + \".row\" + rowNum);\n}", "getCell(col, row) {\n if (row < 0 || row >= this.rows)\n return null;\n else if (col < 0 || col >= this.columns)\n return null;\n else\n return this.cells...
[ "0.62359387", "0.6184114", "0.6175245", "0.6123083", "0.610542", "0.6058767", "0.60443765", "0.603924", "0.6010606", "0.60077703", "0.5989983", "0.59748656", "0.5962407", "0.5943247", "0.5934591", "0.59270936", "0.5899443", "0.5899443", "0.5894915", "0.58771783", "0.5860813",...
0.7576285
0
Get location of candy (row and column) if it's found on this board, or null if not found.
getLocationOf(candy) { return {row:candy.row, col:candy.col}; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getCandyAt(row, col) {\n\t\tUtil.assertNumeric(row, \"row must be a number\");\n\t\tUtil.assertNumeric(col, \"col must be a number\");\n\n\t\tif (this.isValidLocation(row, col)) {\n\t\t\treturn this.square[row][col];\n\t\t}\n\t}", "function findSpotForCol(x) {\n for (let y = 0; y < HEIGHT; y++) {\n if ...
[ "0.7181517", "0.70573443", "0.6980026", "0.6979156", "0.6865156", "0.6846217", "0.6838704", "0.6773765", "0.6770204", "0.6762263", "0.6762263", "0.67396206", "0.67058897", "0.6696813", "0.669083", "0.6688117", "0.66652536", "0.65965515", "0.65956354", "0.6555674", "0.6469135"...
0.70973366
1
Get a list of all candies on the board, in no particular order.
getAllCandies() { var results = []; for (var r in this.square) { for (var c in this.square[r]) { if (this.square[r][c]) { results.push(this.square[r][c]); } } } return results; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getBoard() {\n\tvar tiles = $.map($(\".square\").not(\":hidden\"), function(d) { \n\t\tvar position = d.id.split(\"_\").map(function(s) { return parseInt(s); });\n\t\tvar state = d.classList[1];\n\t\treturn {\n\t\t\tflag: state == \"bombflagged\",\n\t\t\tvalue: (state.indexOf(\"open\") > -1) ? parseInt(st...
[ "0.57290334", "0.5725408", "0.5655168", "0.5641549", "0.5617386", "0.5587847", "0.5584682", "0.5556051", "0.5517494", "0.5484677", "0.547534", "0.5456199", "0.5454713", "0.5454069", "0.5394132", "0.5357756", "0.53432643", "0.53392303", "0.5338208", "0.5335698", "0.53326255", ...
0.6549639
0
Add a new candy to the board.Requires candies to be not currently on the board, and (row,col) must designate a valid empty square. The optional spawnRow, spawnCol indicate where the candy was "spawned" the moment before it moved to row, col. This location, which may be off the board, is added to the 'add' event and can...
add(candy, row, col, spawnRow, spawnCol) { if (this.isEmptyLocation(row, col)) { var detail = { candy: candy, toRow: row, toCol: col, fromRow: spawnRow, fromCol: spawnCol }; candy.row = row; candy.col = col; this.square[row][col] = candy; this.dispatchEvent(new CustomEvent("ad...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addCandy(color, row, col, spawnRow, spawnCol) {\n\t\tvar candy = new Candy(color, this.candyCounter++);\n\t\tthis.add(candy, row, col, spawnRow, spawnCol);\n\t}", "addRandomCandy(row, col, spawnRow, spawnCol) {\n\t\tvar random_color = Math.floor(Math.random() * Candy.colors.length);\n\t\tvar candy = new Candy(Ca...
[ "0.8139475", "0.7757262", "0.5607568", "0.552316", "0.5335398", "0.5317791", "0.53142965", "0.53097785", "0.527896", "0.5244871", "0.5210693", "0.519723", "0.5196941", "0.51709205", "0.5165095", "0.5112039", "0.5105849", "0.5074478", "0.5068699", "0.5028981", "0.50239027", ...
0.860333
0
Move a candy from its current square to another square. Requires candy to be already found on this board, and (toRow,toCol) must denote a valid empty square.
moveTo(candy, toRow, toCol) { if (this.isEmptyLocation(toRow, toCol)) { var detail = { candy:candy, toRow:toRow, toCol:toCol, fromRow:candy.row, fromCol:candy.col}; delete this.square[candy.row][candy.col]; this.square[toRow][toCol] = candy; candy.row = toRow; candy.col = toCol; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Move(clicked_square, square_size) {\n // We need to locate movable tiles based on where the empty spot is,\n // We can only move the four surrounding squares\n var movable = false;\n \n // Swap x/y between the clicked square and the currently empty square\n var oldx = $(...
[ "0.5981898", "0.58629555", "0.5812707", "0.5707169", "0.5683156", "0.5642566", "0.55876577", "0.5584122", "0.5555347", "0.55287933", "0.5527659", "0.5525504", "0.55178505", "0.5507041", "0.5483763", "0.5467684", "0.54435194", "0.5428728", "0.5404092", "0.53951246", "0.5393086...
0.7587454
0
Remove a candy from this board. Requires candy to be found on this board.
remove(candy) { var detail = { candy: candy, fromRow: candy.row, fromCol: candy.col }; delete this.square[candy.row][candy.col]; candy.row = candy.col = null; this.dispatchEvent(new CustomEvent("remove", {detail})); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeBall(x, y) {\n for (let i = 0; i < coins.length; i += 1) {\n const ball = coins[i];\n if (ball.x === x && ball.y === y) {\n coins.splice(i, 1);\n }\n }\n }", "removeRook(_x, _y) {\n this.board[_x][_y] = 1;\n this.rooks ...
[ "0.59976876", "0.59889615", "0.57367635", "0.5637785", "0.55686635", "0.5471293", "0.5436822", "0.5254755", "0.5209222", "0.51775", "0.5163925", "0.51441485", "0.51177055", "0.5097674", "0.50801456", "0.506387", "0.5062591", "0.505966", "0.50564927", "0.5054773", "0.5053746",...
0.7553492
0
Remove a candy at a given location from this board. Requires candy to be found on this board.
removeAt(row, col) { if (this.isEmptyLocation(row, col)) { console.log("removeAt found no candy at " + r + "," + c); } else { this.remove(this.square[row][col]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "remove(candy) {\n\t\tvar detail = {\n\t\t\tcandy: candy,\n\t\t\tfromRow: candy.row,\n\t\t\tfromCol: candy.col\n\t\t};\n\t\tdelete this.square[candy.row][candy.col];\n\t\tcandy.row = candy.col = null;\n\t\tthis.dispatchEvent(new CustomEvent(\"remove\", {detail}));\n\t}", "removeRook(_x, _y) {\n this.board[...
[ "0.7463953", "0.60617113", "0.6029219", "0.5887873", "0.5563303", "0.5558461", "0.5542345", "0.55199", "0.5433455", "0.543028", "0.5321065", "0.5317124", "0.52606267", "0.52222365", "0.52043635", "0.5203102", "0.52021945", "0.5169321", "0.51677954", "0.5156876", "0.51453567",...
0.6963738
1
Utilities / Adds a candy of specified color to row, col.
addCandy(color, row, col, spawnRow, spawnCol) { var candy = new Candy(color, this.candyCounter++); this.add(candy, row, col, spawnRow, spawnCol); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addRandomCandy(row, col, spawnRow, spawnCol) {\n\t\tvar random_color = Math.floor(Math.random() * Candy.colors.length);\n\t\tvar candy = new Candy(Candy.colors[random_color], this.candyCounter++);\n\t\tthis.add(candy, row, col, spawnRow, spawnCol);\n\t}", "function addC() {\n let table = document.getElementBy...
[ "0.7175411", "0.6500436", "0.64477223", "0.6418485", "0.6270369", "0.6211921", "0.61199456", "0.61110026", "0.6095748", "0.60546875", "0.59982693", "0.5995383", "0.5984611", "0.5975677", "0.5963351", "0.59452075", "0.5943589", "0.59051794", "0.5892332", "0.5873582", "0.586379...
0.7929796
0
Adds a candy of random color at row, col.
addRandomCandy(row, col, spawnRow, spawnCol) { var random_color = Math.floor(Math.random() * Candy.colors.length); var candy = new Candy(Candy.colors[random_color], this.candyCounter++); this.add(candy, row, col, spawnRow, spawnCol); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addCandy(color, row, col, spawnRow, spawnCol) {\n\t\tvar candy = new Candy(color, this.candyCounter++);\n\t\tthis.add(candy, row, col, spawnRow, spawnCol);\n\t}", "function changeCol() {\n bgColor = random(255);\n}", "function randoColorSpot() {\n var color = [\"red\", \"blue\", \"yellow\", \"orange\", \"hot...
[ "0.76782525", "0.66228884", "0.64773744", "0.64690316", "0.6451974", "0.6415388", "0.64013994", "0.6394006", "0.6386438", "0.63599473", "0.6357723", "0.6352887", "0.62931126", "0.6289989", "0.62767494", "0.6252889", "0.6229646", "0.62245935", "0.6221948", "0.6217813", "0.6211...
0.8170975
0
Returns the candy immediately in the direction specified by direction ['up', 'down', 'left', 'right'] from the candy passed as fromCandy
getCandyInDirection(fromCandy, direction) { switch (direction) { case "up": { return this.getCandyAt(fromCandy.row-1, fromCandy.col); } case "down": { return this.getCandyAt(fromCandy.row+1, fromCandy.col); } case "left": { return this.getCandyAt(fromCandy.row, fromCandy.col-1); } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function turnAround() {\n if (direction === \"right\") {\n direction = \"left\";\n }\n else if (direction === \"left\") {\n direction = \"right\";\n }\n }", "function chooseDirection() {\n\t\tvar guide = Math.random() * 100;\n\t\t//left\n\t\tif(guide < CONFIG....
[ "0.5354872", "0.5092424", "0.50038296", "0.50015646", "0.49844527", "0.49669948", "0.4941307", "0.48899537", "0.48319206", "0.4820703", "0.47689527", "0.47621828", "0.47547042", "0.47350284", "0.4690419", "0.4682446", "0.4678288", "0.4667255", "0.46646345", "0.46621084", "0.4...
0.80148643
0
Flip candy1 with candy2 in one step, firing two move events. Does not verify the validity of the flip. Does not crush candies produced by flip.
flipCandies(candy1, candy2) { // Swap the two candies simultaneously. var details1 = { candy: candy1, toRow: candy2.row, toCol: candy2.col, fromRow: candy1.row, fromCol: candy1.col }; var details2 = { candy: candy2, toRow: candy1.row, toCol: candy1.col, fromRow: candy2.row, fromCol...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function flipTurn(){\n\tif(player1_turn){\n\t\tinit();\n\t\tplayer1_bars();\n\t\tresetBlank(player1_tiles);\n\t\tdrawBlank(player2_tiles);\n\t\tmoveBlank(0);\n\t\thidePieces(player2_tiles);\n\t\tdrawPieces(player1_tiles);\n\t\tmoveDragme(90);\n\t}else{\n\t\tinit();\n\t\tplayer2_bars();\n\t\tresetBlank(player2_tile...
[ "0.6869041", "0.6441148", "0.6248155", "0.62343186", "0.612963", "0.61132044", "0.6106638", "0.605377", "0.6028538", "0.5959593", "0.59529924", "0.5948385", "0.59027606", "0.5877314", "0.5853495", "0.5844739", "0.5833758", "0.5810484", "0.57754415", "0.57744896", "0.57721484"...
0.83567643
0
Gets the current score
getScore() { return this.score; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getScore() {\n return currentScore;\n}", "function getScore(){\n return score;\n}", "function Game_getScore() {\n\treturn this.score;\n}", "getScore(){\n\t\treturn this.model.scoreCounter;\n\t}", "scorePlay() {\n //Base bonus for making a match\n this.currentScore += this.matchBonus;\n...
[ "0.8804525", "0.79162514", "0.787847", "0.7802062", "0.7728391", "0.75604534", "0.7422314", "0.7395562", "0.73483825", "0.73483825", "0.7281955", "0.7243309", "0.72415376", "0.7153496", "0.7095445", "0.70326996", "0.70293283", "0.69561005", "0.692331", "0.6915015", "0.6896839...
0.81436414
1
Music plays after the user clicks the mouse for the firt time.
function mouseClick() { music.play(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mousePressed() {\n song.play();\n \n}//End function mousePressed", "function mouseClicked() {\n if (song.isPlaying()) {\n song.pause();\n } else {\n song.play();\n }\n}", "function mousePressed() {\n\tif (music.isPlaying()){\n\t\tmusic.stop()\n\t}\n\telse {\n\t\tmusic.play()\n\t}\n}", "...
[ "0.8060012", "0.7875803", "0.7865931", "0.7695894", "0.7533922", "0.7490648", "0.7461777", "0.739223", "0.7310634", "0.72935444", "0.72867846", "0.72808397", "0.7207283", "0.7147715", "0.71328676", "0.70991814", "0.7038251", "0.6998227", "0.6970643", "0.69156027", "0.69120616...
0.83578277
1
Set the Greeting Text. The greeting text data goes in the body. If successful, we'll get a success message in the response.
function setGreetingText(greetingText) { request({ uri: 'https://graph.facebook.com/v2.6/me/thread_settings', qs: { access_token: PAGE_ACCESS_TOKEN }, method: 'POST', json: greetingText }, function (error, response, body) { if (!error && response.statusCode == 200) { console.log(body); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function setGreeting() {\n setIsWaiting(true)\n if (!greeting) return\n if (typeof window.ethereum !== 'undefined') {\n await requestAccount()\n const provider = new ethers.providers.Web3Provider(window.ethereum);\n console.log(provider)\n const signer = provider.getSigner()\n ...
[ "0.63659185", "0.6227396", "0.6090361", "0.60080713", "0.59975", "0.599483", "0.5985", "0.5947462", "0.575645", "0.5740879", "0.56974846", "0.5680484", "0.56264734", "0.5605724", "0.56026787", "0.5590136", "0.55713385", "0.5565633", "0.5524775", "0.5523677", "0.5521935", "0...
0.6948377
0
Set the Getting Started Button. If successful, we'll get a success message in the response.
function setGettingStarted(gettingStarted) { request({ uri: 'https://graph.facebook.com/v2.6/me/thread_settings', qs: { access_token: PAGE_ACCESS_TOKEN }, method: 'POST', json: gettingStarted }, function (error, response, body) { if (!error && response.statusCode == 200) { console.log(bod...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setupGetStartedButton(res) { \n var messageData = config.get_started_payload;\n // Start the request\n request({\n\n url: 'https://graph.facebook.com/v11.0/me/messenger_profile?access_token='+ PAGE_ACCESS_TOKEN,\n method: 'POST',\n headers: {'Content-Type': 'application/json'...
[ "0.66467", "0.62061095", "0.6180932", "0.58902186", "0.5753903", "0.5716824", "0.5715215", "0.5669459", "0.555511", "0.5538164", "0.5530718", "0.5484272", "0.54399854", "0.54195166", "0.540712", "0.5393374", "0.53899664", "0.5384535", "0.53491896", "0.53334934", "0.53334934",...
0.64527375
1
Set the Persistent Menu List. If successful, we'll get a success message in the response.
function setPersistentMenu(menuList) { request({ uri: 'https://graph.facebook.com/v2.6/me/thread_settings', qs: { access_token: PAGE_ACCESS_TOKEN }, method: 'POST', json: menuList }, function (error, response, body) { if (!error && response.statusCode == 200) { console.log(body); } el...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "[types.SET_MENUITEMS] (s, p) { s.menuitems = p }", "function setMenu(menu) {\n }", "setNewItem(){\n\t\tthis.lastSet = (new Date()).getTime();\n\t\tthis.currentItem = this.getRandomMenuItem();\n\t}", "async function getMenuList(restaurantid) {\n let localMenuData = localStorage.getItem(`MenuList...
[ "0.67020965", "0.55273366", "0.5399011", "0.53981483", "0.5372074", "0.5327335", "0.5288709", "0.52842706", "0.5273706", "0.5243661", "0.5215991", "0.52072585", "0.5200622", "0.51837814", "0.5174346", "0.51739055", "0.51691085", "0.51565605", "0.51543474", "0.5136416", "0.513...
0.7003321
0
Delete the Getting Started Button. If successful, we'll get a success message in the response.
function deleteGettingStarted() { request({ uri: 'https://graph.facebook.com/v2.6/me/thread_settings', qs: { access_token: PAGE_ACCESS_TOKEN }, method: 'DELETE', json: deleteReq }, function (error, response, body) { if (!error && response.statusCode == 200) { console.log(body); } else...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteStep() {\n\t// doesn't do anything right now. The delete step button should reference here\n}", "function delete_this_project(){\n var target_url = $('#view_delete_project').data('url');\n $.ajax({url:target_url,\n success:function(json_response){\n if(json_response.result){\n // ...
[ "0.6204625", "0.59989434", "0.58736575", "0.5868026", "0.58028436", "0.58028436", "0.5798818", "0.5798818", "0.5796462", "0.5777884", "0.5764561", "0.57133627", "0.56941134", "0.5603493", "0.5593893", "0.5563653", "0.5548921", "0.5537007", "0.55357933", "0.5533323", "0.550830...
0.697162
0
Pass the normal matrix to the shader program
function uploadNormalMatrixToShader() { mat3.fromMat4(nMatrix,mvMatrix); mat3.transpose(nMatrix,nMatrix); mat3.invert(nMatrix,nMatrix); gl.uniformMatrix3fv(shaderProgram.nMatrixUniform, false, nMatrix); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function uploadNormalMatrixToShader() {\n mat3.fromMat4(nMatrix,mvMatrix);\n mat4.transpose(nMatrix,nMatrix);\n mat4.invert(nMatrix,nMatrix);\n gl.uniformMatrix3fv(shaderProgram.nMatrixUniform, false, nMatrix);\n}", "function uploadNormalMatrixToShader() {\r\n mat3.fromMat4(nMatrix,mvMatrix);\r\n m...
[ "0.8361279", "0.83465433", "0.83465433", "0.83328193", "0.8314973", "0.81957984", "0.8179274", "0.78511095", "0.74973965", "0.70569557", "0.7055282", "0.6955765", "0.6843497", "0.6832944", "0.6794147", "0.6715907", "0.6690528", "0.66499805", "0.66139585", "0.6606365", "0.6585...
0.8374594
0
Pass the view direction vector to the shader program
function uploadViewDirToShader(){ gl.uniform3fv(gl.getUniformLocation(shaderProgram, "viewDir"), viewDir); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function n$V(r,o){o.normalType===i$M.Attribute||o.normalType===i$M.CompressedAttribute?(r.include(o$H,o),r.varyings.add(\"vNormalWorld\",\"vec3\"),r.varyings.add(\"vNormalView\",\"vec3\"),r.vertex.uniforms.add([new o$1h(\"transformNormalGlobalFromModel\",(r=>r.transformNormalGlobalFromModel)),new e$1p(\"transformN...
[ "0.6709737", "0.6684928", "0.658148", "0.6481798", "0.6468462", "0.6368435", "0.63541424", "0.6346644", "0.6233048", "0.62195915", "0.62102586", "0.61919415", "0.61082995", "0.61082995", "0.60750586", "0.60587466", "0.603501", "0.60123366", "0.59918344", "0.59777963", "0.5960...
0.6762487
0
Pass the rotation matrix to the shader program so that reflections work as the teapot spins
function uploadRotateMatrixToShader(rotateMat){ gl.uniformMatrix4fv(gl.getUniformLocation(shaderProgram, "uRotateMat"), false, rotateMat); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function uploadReflectionMatrixToShader() {\n gl.uniformMatrix4fv(shaderProgram.rMatrixUniform, false, rMatrix);\n}", "function sceneRotations()\r\n{\r\n // Model view Matrix with initial rotations, and with rotations from user input\r\n // using the orientation quaternion//\r\n rotMatrix = mat4.crea...
[ "0.70281166", "0.65558356", "0.65482783", "0.6544776", "0.6543398", "0.6468096", "0.64414775", "0.6389726", "0.6322843", "0.63175434", "0.6245889", "0.62431806", "0.6204207", "0.6159361", "0.6155131", "0.61022925", "0.609054", "0.6089918", "0.6061543", "0.6050524", "0.6049487...
0.7186489
0
Pass bool variable to shader program. Shading color is different for the teapot and the skybox, so it is necessary to switch between the settings when shading.
function switchShaders(isSkybox){ gl.uniform1f(gl.getUniformLocation(shaderProgram, "uIsSkybox"), isSkybox); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function shader(passedToggle){\r\n\tconsole.log(\"executing shader\");\r\n\tconsole.log(passedToggle);\r\n\tif(passedToggle){\t\r\n\t\t$(\"html\").append( \"<div id='overlay'></div>\" );\r\n\t\t\r\n\t\t$(\"#overlay\").css({\t\t\t\t\t\t\t\t// specifying CSS properties for the overlay div element\r\n\t\t\t\"position...
[ "0.6761171", "0.64934915", "0.6251879", "0.62083983", "0.6049286", "0.59387845", "0.59225607", "0.58662236", "0.58662236", "0.5851029", "0.5811018", "0.5705174", "0.57038933", "0.56868076", "0.56661564", "0.56539637", "0.5647901", "0.56397223", "0.56376415", "0.56229645", "0....
0.6618382
1
Setup the cubemap texture for the skybox and teapot.
function setupCubeMap() { // Initialize the Cube Map, and set its parameters cubeTexture = gl.createTexture(); gl.bindTexture(gl.TEXTURE_CUBE_MAP, cubeTexture); // Set texture parameters gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, gl.LINEAR); gl.texParameteri...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setupCubeMap() {\n// TODO: Setup Cube Map\n cubeTexture = gl.createTexture();\n gl.bindTexture(gl.TEXTURE_CUBE_MAP,cubeTexture);\n gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texPara...
[ "0.75241697", "0.74879736", "0.7385726", "0.72796583", "0.7278017", "0.7217792", "0.71774733", "0.7116394", "0.7114029", "0.7089566", "0.7011061", "0.69740605", "0.69328684", "0.687583", "0.6871571", "0.6850825", "0.6845056", "0.6692445", "0.6652323", "0.6634482", "0.6627955"...
0.76264167
0
Check if minification by checking if there are both power of 2
function check_minification(value1, value2) { return (value1 & (value1 - 1))==0 && (value2 & (value2 - 1)) ==0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isPowerOf2( number ){\n // write your code HERE!\n}", "_isPowerOfTwo(x: number): boolean {\n return (x & (x - 1)) == 0;\n }", "function isPowerOf2(val){\n return (val & (val-1)) == 0;\n}", "function isPowerOf2 (value) {\n return (value & (value - 1)) == 0;\n}", "function isPowerOfTwo(...
[ "0.63195217", "0.615731", "0.5941318", "0.59240514", "0.58939457", "0.5890717", "0.5843952", "0.5840269", "0.5829208", "0.58173555", "0.57698697", "0.5734539", "0.5694246", "0.56504256", "0.5543405", "0.5510325", "0.5510325", "0.5490719", "0.5488309", "0.5443228", "0.54416883...
0.65057594
0
Helper function to draw() routine to set the vertex positions before drawing the skybox for each frame. Also switches the shader to the skybox settings.
function drawSkybox(){ switchShaders(true); // Draw the cube by binding the array buffer to the cube's vertic // array, setting attributes, and pushing it to GL. gl.bindBuffer(gl.ARRAY_BUFFER, cubeVertexBuffer); gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 3, gl.FLOAT, false, 0, 0); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawSkybox(drawType) {\n gl.useProgram(shaderSkyboxProgram);\n\n switch (drawType) {\n case 'c':\n gl.uniformMatrix4fv(shaderSkyboxProgram.pMatrixUniform, false, pSceneMatrix);\n gl.uniformMatrix4fv(shaderSkyboxProgram.camMatrixUniform, false, camSceneMatrix);\n ...
[ "0.7005331", "0.6271965", "0.6267473", "0.62620896", "0.62521636", "0.6249715", "0.62227875", "0.62014365", "0.61995125", "0.61871177", "0.61516005", "0.61377555", "0.61346984", "0.6087797", "0.6076805", "0.60715723", "0.6068966", "0.60629857", "0.60580975", "0.6046342", "0.6...
0.7018325
0
Function which adds a new rotation around a given axis to the global quaternion
function quatRotation(rotationRate, rotAxis){ // create a new quaternion to apply new rotation var tempQuat = quat.create(); quat.setAxisAngle(tempQuat, rotAxis, rotationRate); quat.normalize(tempQuat, tempQuat); // apply new rotation to global quaternion quat.multiply(globalQuat, te...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rotateAboutAxis(vector, axis, angle) {\n var cos = Math.cos(angle);\n var sin = Math.sin(angle);\n \n var v = vector.clone();\n multScalar(v, cos);\n v.add(multScalar(new pc.Vec3().cross(axis, vector), sin));\n v.add(multScalar(axis, new pc.Vec3().dot(axis, vector) * (1 - cos)));\n ...
[ "0.6745548", "0.6702529", "0.67018133", "0.6602366", "0.656053", "0.64592254", "0.6442912", "0.642125", "0.64142793", "0.6374452", "0.6370923", "0.6363365", "0.6250986", "0.6250878", "0.6185779", "0.61768657", "0.60617864", "0.6060479", "0.6032077", "0.5876141", "0.5782453", ...
0.72738
0
Helper function to draw() routine to set the vertex positions and vertex normals before drawing the teapot for each frame. Also switches the shader to the teapot settings.
function drawTeapot(){ switchShaders(false); uploadViewDirToShader() // Draw the cube by binding the array buffer to the cube's vertic // array, setting attributes, and pushing it to GL. gl.bindBuffer(gl.ARRAY_BUFFER, TPvertex_buffer); gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 3, gl.F...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawTeapot(){\n\tswitchShaders(false);\n\tuploadViewDirToShader()\n\t\n\t// Draw the cube by binding the array buffer to the cube's vertices\n\t// array, setting attributes, and pushing it to GL.\n\tgl.bindBuffer(gl.ARRAY_BUFFER, teapotVertexBuffer);\n\tgl.vertexAttribPointer(shaderProgram.vertexPositionA...
[ "0.70635396", "0.66986746", "0.6698221", "0.66465455", "0.6390824", "0.6319478", "0.6276161", "0.62316453", "0.6217397", "0.62163496", "0.6201382", "0.61858463", "0.61557645", "0.610293", "0.60869557", "0.60790217", "0.60724515", "0.60693747", "0.6051962", "0.604813", "0.6008...
0.71892947
0
Translates given authenticationProviderConfig into ConfigurationEditor compatible flat "configuration" object with key/value pairs. The authenticationProviderConfig may be an object graph but the returned "configuration" will be flat object with key/value pairs.
function toConfiguration(authenticationProviderConfig) { // Authentication provider "type" information is not part of inputs and can be skipped from the configuration const flatObj = flattenObject(authenticationProviderConfig, (_result, _value, key) => key !== 'type'); // MobX form tries to handle nested object ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fromConfiguration(configuration) {\n // MobX form tries to handle nested object notations using dots and and array notations using\n // [] and expects nested field structure\n // Here, the configuration may have been translated to use opaque keys with dots replaced by / and\n // [ replaced by |- and ]...
[ "0.586907", "0.51766664", "0.5170054", "0.51481676", "0.51481676", "0.49612635", "0.49294415", "0.4883765", "0.4795695", "0.476047", "0.4751676", "0.4735348", "0.4734766", "0.46343175", "0.45773083", "0.45529494", "0.4552522", "0.4526935", "0.45181704", "0.4496748", "0.449674...
0.7529076
0
Translates given configuration object containing key/value pairs into authenticationProviderConfig. This function is inverse of toConfiguration function above.
function fromConfiguration(configuration) { // MobX form tries to handle nested object notations using dots and and array notations using // [] and expects nested field structure // Here, the configuration may have been translated to use opaque keys with dots replaced by / and // [ replaced by |- and ] replaced...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toConfiguration(authenticationProviderConfig) {\n // Authentication provider \"type\" information is not part of inputs and can be skipped from the configuration\n const flatObj = flattenObject(authenticationProviderConfig, (_result, _value, key) => key !== 'type');\n\n // MobX form tries to handle nes...
[ "0.7474569", "0.5772333", "0.55288035", "0.5372407", "0.53668976", "0.53668976", "0.5347026", "0.49542361", "0.47696516", "0.47294474", "0.47052115", "0.46691945", "0.46095303", "0.4580113", "0.44294056", "0.44292155", "0.44275692", "0.44252574", "0.44182634", "0.4417372", "0...
0.6446593
1
Get an existing VaultLock resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
static get(name, id, state, opts) { return new VaultLock(name, state, Object.assign(Object.assign({}, opts), { id: id })); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getState(id) {\n return id ? state[id] : state;\n }", "function lockGet (msg, overview) {\n if (typeof msg.payload.index === 'number' && msg.payload.index >= 0) {\n const index = msg.payload.index;\n return overview.doorLockStatusList[index] || { Error: true, message: 'No such loc...
[ "0.550117", "0.5396304", "0.51847005", "0.50448215", "0.5037", "0.5016369", "0.48185873", "0.48172542", "0.48169056", "0.48169056", "0.48012903", "0.47240853", "0.46590313", "0.46431705", "0.4632802", "0.46269482", "0.4605502", "0.4595662", "0.45861593", "0.4549284", "0.45113...
0.7520484
0
Returns true if the given object is an instance of VaultLock. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.
static isInstance(obj) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === VaultLock.__pulumiType; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === VolumeAttachment.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n ...
[ "0.6603669", "0.6489558", "0.641745", "0.6338505", "0.6297231", "0.62786543", "0.62782043", "0.62483454", "0.6245445", "0.6199687", "0.6169071", "0.616652", "0.6159962", "0.61537665", "0.6142981", "0.6129925", "0.6123768", "0.6119545", "0.6107711", "0.60983753", "0.6095805", ...
0.76645136
0
get current browser vendor prefix
function getBrowserPrefix() { for (var i = 0; i < browserPrefixes.length; i++) { if (getHiddenPropertyName(browserPrefixes[i]) in document) { // return vendor prefix return browserPrefixes[i]; } } // no vendor prefix needed return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getBrowserPrefix()\r\n{\r\n for (var i = 0; i < browserPrefixes.length; i++)\r\n {\r\n if (getHiddenPropertyName(browserPrefixes[i]) in document)\r\n {\r\n // return vendor prefix\r\n return browserPrefixes[i];\r\n }\r\n }\r\n\r\n // no vendor prefix ...
[ "0.84119064", "0.78618014", "0.75464904", "0.74628687", "0.73481107", "0.6890935", "0.6825232", "0.6605451", "0.6503293", "0.6503293", "0.65025437", "0.65025437", "0.64820653", "0.6481291", "0.647822", "0.647822", "0.647822", "0.6433895", "0.64291054", "0.6394951", "0.6390002...
0.83318204
1
Principle 2 code example for Implicit Binding
function implicitObj() { greeting: 'Hello', greetMe: function (name) { console.log(`${this.greeting} ${name}`); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function HostBindingDecorator(){}// WARNING: interface has both a type and a value, skipping emit", "function HostBindingDecorator() {} // WARNING: interface has both a type and a value, skipping emit", "function HostBindingDecorator() {} // WARNING: interface has both a type and a value, skipping emit", "fu...
[ "0.5674553", "0.55027276", "0.55027276", "0.5459484", "0.5459484", "0.5459484", "0.5459484", "0.5399578", "0.5399578", "0.53841025", "0.5317024", "0.5281163", "0.5238158", "0.51324147", "0.5131926", "0.5131926", "0.5131926", "0.5131926", "0.5123373", "0.51135397", "0.5112881"...
0.55122733
1
Principle 4 code example for Explicit Binding
function explicitBinding() { console.log(`${this.name}`); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bindingTest(){\n\t//alert(\"main onload\");\n} //end bindingTest", "function Person(obj){\n this.name = obj.name;\n this.age = obj.age;\n this.speak = function(){\n console.log(`My name is ${this.name} and this is an example of New Binding`);\n }\n}", "function HostBindingDecorator(...
[ "0.605826", "0.5874365", "0.5873397", "0.58686876", "0.5865534", "0.5764696", "0.57599443", "0.5720223", "0.5665852", "0.5655911", "0.5655911", "0.55368984", "0.55071265", "0.54894304", "0.54815334", "0.54815334", "0.54815334", "0.54815334", "0.5441843", "0.5436574", "0.54365...
0.61376446
0
Prevent Pull To Refresh IOS
function preventPullToRefresh(element) { var prevent = false; document.querySelector(element).addEventListener('touchstart', function(e){ if (e.touches.length !== 1) { return; } var scrollY = window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop; prevent = (scro...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onPullDownRefresh() {\n }", "onPullDownRefresh() {\n\n }", "refresh() { return false; }", "function preventRefresh(event) {\n event.preventDefault();\n create();\n}", "request_refresh() {\n this.refresh_requested = true;\n }", "function _pullingStopped(change)\n {\n ...
[ "0.6424396", "0.6316192", "0.6280713", "0.6147473", "0.61054075", "0.6089831", "0.6086435", "0.6081385", "0.60404456", "0.6035203", "0.6026218", "0.60196054", "0.5889349", "0.5824745", "0.5824745", "0.5813298", "0.5758526", "0.5736194", "0.57338464", "0.5726298", "0.5696245",...
0.7728761
0
Convert Stringformatted options into Objectformatted ones and store in cache
function createOptions( options ) { var object = optionsCache[ options ] = {}; jQuery.each( options.split( core_rspace ), function( _, flag ) { object[ flag ] = true; }); return object; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createOptions(options) {\n var object = optionsCache[options] = {};\n _each(options.split(/\\s+/), function(flag) {\n object[flag] = true;\n });\n return object;\n }", "function createOptions( options ) {\n var object = optionsCache[ options ] = {};\n _eac...
[ "0.65222496", "0.65128475", "0.6499513", "0.6477262", "0.6477262", "0.6477262", "0.6477262", "0.6477262", "0.6477262", "0.6477262", "0.6477262", "0.6477262", "0.6477262", "0.6477262", "0.6399574", "0.6325133", "0.6315897", "0.62894464", "0.62655115", "0.62655115", "0.6188303"...
0.6599308
1
Returns a function to use in pseudos for input types
function createInputPseudo( type ) { return function( elem ) { var name = elem.nodeName.toLowerCase(); return name === "input" && elem.type === type; }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createInputPseudo( type ) {\r\n\treturn function( elem ) {\r\n\t\tvar name = elem.nodeName.toLowerCase();\r\n\t\treturn name === \"input\" && elem.type === type;\r\n\t};\r\n}", "function createInputPseudo( type ) {\r\n\treturn function( elem ) {\r\n\t\tvar name = elem.nodeName.toLowerCase();\r\n\t\tretu...
[ "0.6375038", "0.6375038", "0.6375038", "0.635112", "0.635112", "0.635112", "0.635112", "0.635112", "0.635112", "0.635112", "0.635112", "0.635112", "0.635112", "0.635112", "0.635112", "0.635112", "0.635112", "0.635112", "0.635112", "0.635112", "0.635112", "0.635112", "0.63...
0.6458701
1
Returns a function to use in pseudos for buttons
function createButtonPseudo( type ) { return function( elem ) { var name = elem.nodeName.toLowerCase(); return (name === "input" || name === "button") && elem.type === type; }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createButtonPseudo( type ) {\r\n\treturn function( elem ) {\r\n\t\tvar name = elem.nodeName.toLowerCase();\r\n\t\treturn (name === \"input\" || name === \"button\") && elem.type === type;\r\n\t};\r\n}", "function createButtonPseudo( type ) {\r\n\treturn function( elem ) {\r\n\t\tvar name = elem.nodeName...
[ "0.64501953", "0.64501953", "0.64501953", "0.64033014", "0.64033014", "0.64033014", "0.64033014", "0.64033014", "0.64033014", "0.64033014", "0.64033014", "0.64033014", "0.64033014", "0.64033014", "0.64033014", "0.64033014", "0.64033014", "0.64033014", "0.64033014", "0.64033014"...
0.6598689
1
Returns a function to use in pseudos for positionals
function createPositionalPseudo( fn ) { return markFunction(function( argument ) { argument = +argument; return markFunction(function( seed, matches ) { var j, matchIndexes = fn( [], seed.length, argument ), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createPositionalPseudo( fn ) {\r\n\treturn markFunction(function( argument ) {\r\n\t\targument = +argument;\r\n\t\treturn markFunction(function( seed, matches ) {\r\n\t\t\tvar j,\r\n\t\t\t\tmatchIndexes = fn( [], seed.length, argument ),\r\n\t\t\t\ti = matchIndexes.length;\r\n\r\n\t\t\t// Match elements f...
[ "0.6069864", "0.6050486", "0.59678197", "0.59678197", "0.59678197", "0.59678197", "0.59678197", "0.59678197", "0.59678197", "0.59678197", "0.59678197", "0.59678197", "0.59678197", "0.59678197", "0.59678197", "0.59678197", "0.59678197", "0.59678197", "0.59678197", "0.59678197", ...
0.60923
1
devolver listado de usuarios paginados // Devolver listado de usuario paginados
function getUsers(req, res) { var identityUserId = req.user.sub; var page = 1; var itemsPerPage = 5; if (req.params.page) { page = req.params.page; } User.find() .sort("_id") .paginate(page, itemsPerPage, (err, users, total) => { if (err) return res.status(500)....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function usuariosPaginados(req,res){\n\tvar desde = req.query.desde || 0;\n\tvar items = req.query.items || 10;\n\tvar orden = req.query.orden || 1; // 1: ascendente -1: descendente\n\tdesde = Number(desde);\n\titems = Number(items);\n\torden =Number(orden);\n\n\tUser.find({},'name email image role')\n\t .skip(d...
[ "0.7943808", "0.72869414", "0.720198", "0.70456564", "0.6985105", "0.6976621", "0.69632363", "0.6813445", "0.68095845", "0.68034524", "0.67780125", "0.6777623", "0.6764089", "0.6750853", "0.6750572", "0.66494304", "0.66330534", "0.66002005", "0.6593186", "0.6576695", "0.65575...
0.73153716
1
vesting_shares is a string with the unit ' VESTS' appended delegateVestingShares only accepts 6 decimal digits, therefore we use toFixed(6) for return
function vests2Steem(vestingShares, dynamicGlobalProperties) { let { total_vesting_fund_steem, total_vesting_shares } = dynamicGlobalProperties let totalVestingFundSteemNumber = unitString2Number(total_vesting_fund_steem) let totalVestingSharesNumber = unitString2Number(total_vesting_shares) let vestingSharesNu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function convertToFloat (savings) {\n var total = \"1059 dollars\";\n var savings=parseFloat(total);\n return savings}", "function VAT(total) {\n return total * 0.15;\n}", "applyVat(vatPercent) {\n if (vatPercent === undefined) {\n throw new Error('applyVat(): argment vatPercent is required')...
[ "0.55543053", "0.5500765", "0.5488738", "0.54819906", "0.53806484", "0.5340008", "0.53271437", "0.53043205", "0.52674013", "0.5258239", "0.51424086", "0.5093964", "0.50726575", "0.50721097", "0.5069474", "0.50691426", "0.50635844", "0.5028996", "0.5020438", "0.5019234", "0.50...
0.70161587
0
function to calculate gravity given mass and distance away
function calculateGravity(m, r) { var ag = m / Math.pow(r, 2); return ag; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "calcGravity(centerOfMass){\r\n for (var i=0; i<this.locations.length; i++){\r\n var gravity = p5.Vector.sub(centerOfMass, this.locations[i]);\r\n gravity.normalize();\r\n gravity.mult(.001);\r\n this.applyForce(gravity);\r\n }\r\n }", "get gravity() {}", "function gravity(k){ \n\n ...
[ "0.77682966", "0.72700286", "0.6852759", "0.6842913", "0.67617583", "0.6723759", "0.6589979", "0.65687984", "0.6567254", "0.6503708", "0.6409871", "0.6319048", "0.62778634", "0.62170255", "0.62170255", "0.6189723", "0.61851364", "0.6166201", "0.61585784", "0.61569506", "0.615...
0.7452501
1
function to calculate distance from rocket and planet
function calculateDistance(planet) { dx = planet.getX() - rocket.getX(); dy = planet.getY() - rocket.getY(); dist = Math.hypot(dx, dy); return dist <= PROXIMITY; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calculateDistance() {}", "function distance(origin, destination) {\r\n\tvar dist = 0;\r\n\tvar originArr = new Array();\r\n\tvar destinationArr = new Array();\r\n\t//Clear the strings\r\n\torigin = origin.replace(\"(\",\"\");\r\n\torigin = origin.replace(\")\",\"\");\r\n\tdestination = destination.repla...
[ "0.6917816", "0.65526813", "0.6501162", "0.6463086", "0.62803227", "0.6256999", "0.62370485", "0.61848605", "0.6080369", "0.6076479", "0.6071803", "0.605841", "0.60269576", "0.600492", "0.59735745", "0.59441584", "0.5909227", "0.5908569", "0.5906861", "0.5886147", "0.5884446"...
0.76053894
0
Assuming all the subscribers share a common DOM parent, we can calculate which percent of the whole size we're taking, and thus restrict the stream size...
percentOfAvailable(aStreamDimension, aTotalDimension, aSubsDimension, aSubsNumber) { // Assumption: All the subscribers have the same size. What we're going to do is to assign a // % of the total pool of pixels available (as sent, not as shown): const totalWidth = aStreamDimension.width * aSubsNumber;...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "percentOfStream(aStreamDimension, aTotalDimension, aSubsDimension, aSubsNumber) {\n const totalWidth = aStreamDimension.width;\n const totalHeight = aStreamDimension.height;\n const percentW = aSubsDimension.width / aTotalDimension.width;\n const percentH = aSubsDimension.height / aTotalDimensi...
[ "0.67329156", "0.6315768", "0.61259747", "0.59573525", "0.5822865", "0.5570765", "0.5566343", "0.5476815", "0.5401654", "0.53995466", "0.5398968", "0.52997136", "0.5286462", "0.5276528", "0.5270522", "0.52598333", "0.523864", "0.5235578", "0.52237505", "0.5219753", "0.5193258...
0.6972102
0
Assign a % of the actual stream size (as sent, not as shown):
percentOfStream(aStreamDimension, aTotalDimension, aSubsDimension, aSubsNumber) { const totalWidth = aStreamDimension.width; const totalHeight = aStreamDimension.height; const percentW = aSubsDimension.width / aTotalDimension.width; const percentH = aSubsDimension.height / aTotalDimension.height...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "size() {\n if (this.writeFull) { return this.cap; }\n return (this.cap + (this.writeCursor - this.readCursor)) % this.cap;\n }", "function toSizeNum(size, total) {\n var s = 0;\n var m;\n SIZE_RE.lastIndex =0;\n if (size.constructor === String && (m=SIZE_RE.exec(size)...
[ "0.6543746", "0.61396813", "0.612362", "0.61173224", "0.61173224", "0.61173224", "0.61173224", "0.61173224", "0.6106831", "0.61050767", "0.6098387", "0.60496616", "0.60038096", "0.59675914", "0.59347916", "0.59132725", "0.5862676", "0.5830852", "0.58143115", "0.5786391", "0.5...
0.687147
0
like percentOfStream but once we're over 70% on any of the dimensions, we just assign the maximum size on both dimensions.
biasedPercent(aStreamDimension, aTotalDimension, aSubsDimension, aSubsNumber) { const totalWidth = aStreamDimension.width; const totalHeight = aStreamDimension.height; let percentW = aSubsDimension.width / aTotalDimension.width; let percentH = aSubsDimension.height / aTotalDimension.height; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "percentOfStream(aStreamDimension, aTotalDimension, aSubsDimension, aSubsNumber) {\n const totalWidth = aStreamDimension.width;\n const totalHeight = aStreamDimension.height;\n const percentW = aSubsDimension.width / aTotalDimension.width;\n const percentH = aSubsDimension.height / aTotalDimensi...
[ "0.705432", "0.6591299", "0.651963", "0.6353074", "0.6334093", "0.605832", "0.59897655", "0.58953947", "0.5783258", "0.56629044", "0.5634601", "0.5634601", "0.5634601", "0.5571218", "0.55333436", "0.5487591", "0.54793376", "0.5476896", "0.5474909", "0.54699606", "0.5451177", ...
0.6861179
1
Fit resolution to subscriber dimensions.
fitToSubscriberDimensions(aStreamDimension, aTotalDimension, aSubsDimension) { if ( ((aSubsDimension.width <= 320) && (aSubsDimension.height <= 240)) || (publisherResolution === '320x240') ) { return { width: 320, height: 240 }; } else if ( (...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_onFitToScreen() {\n var $workingArea = $('.closet-design-editor-scroller'),\n designAreaWidth = $workingArea.width(),\n // 120 = correction of status bar + arrows buttons\n designAreaHeight = $workingArea.height() - 120,\n screenConfig = StateManager.get('screen'...
[ "0.61119676", "0.6038266", "0.59865004", "0.5970638", "0.5948063", "0.59383875", "0.5936738", "0.59366375", "0.5930194", "0.58904207", "0.58473414", "0.5807243", "0.57174915", "0.57086647", "0.5705413", "0.56849843", "0.5653265", "0.5653265", "0.5653265", "0.5653265", "0.5653...
0.7876947
0
request for leader details on the url supplied on successful result, render the board
function getLeaderDetails(url,root){ var xhr = new XMLHttpRequest(); xhr.onload=function(e){ _renderBoard(JSON.parse(e.target.responseText),root); }; xhr.open('GET',url,true); xhr.send(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawLeaderboard() {\n // request\n r = new XMLHttpRequest();\n // location\n r.open(\"GET\", \"https://api.mongolab.com/api/1/databases/newvi/collections/leaderboards?s={%22highscore%22:-1}&l=9&apiKey=yXsXCeqDNLQW5jM2X6kHO9RzosAJ2QWO\", true);\n r.onreadystatechange = fu...
[ "0.6938555", "0.67097574", "0.6583699", "0.6581893", "0.6569039", "0.6458522", "0.6206249", "0.62061113", "0.6105087", "0.6104082", "0.60847974", "0.6024994", "0.60012627", "0.59077173", "0.58921635", "0.5866081", "0.58620256", "0.5846089", "0.57733554", "0.57520586", "0.5750...
0.7680363
0
Creates a list view of tags
function TagsListView() { if (!(this instanceof TagsListView)) { return new TagsListView(); }; this.tags(); View.call(this, template, this.options); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function TagList(tags) {\n this.allTags = tags;\n}", "function TagList(settings) {\n this.settings = $.extend({}, settings);\n this.container = this.settings.container;\n this.categories = $('#category', this.container);\n this.tags = $('#tag', this.container);\n this.metaTags = this.settings.m...
[ "0.6846444", "0.6176203", "0.6153089", "0.59428596", "0.5898452", "0.5884143", "0.5881328", "0.58718336", "0.58638513", "0.584798", "0.5786582", "0.5782511", "0.5767153", "0.5731078", "0.56823605", "0.5680189", "0.5674378", "0.56645447", "0.5559073", "0.5559073", "0.55349237"...
0.8099499
0
get a new word from the word bank
function getNewWord() { var randNum = Math.floor(Math.random() * 6) return gameWord = new Word(hangmanWords[randNum]) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pickWordFrom(wordBank) {\n return wordBank[Math.floor(Math.random() * wordBank.length)];\n}", "function word() {\n return wordBank[Math.floor(Math.random() * wordBank.length)];\n}", "function generateWord() {\n let i = Math.floor(Math.random() * wordBank.length)\n return wordBank[i];\n}", ...
[ "0.6840969", "0.6784165", "0.6741529", "0.67246157", "0.67227167", "0.67159337", "0.67159337", "0.6712507", "0.67090106", "0.67090106", "0.6702846", "0.66392016", "0.66209304", "0.6609766", "0.6608898", "0.6606223", "0.65867496", "0.65855944", "0.6568259", "0.6548086", "0.654...
0.68186605
1
Get the last transaction for purposes of pinging the server
async getLastTransaction () { return knex .select('*') .from("transactions") .orderBy('created_at', 'desc') .limit(1) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "lastblock() {\r\n return this.blockchain[this.blockchain.length - 1];\r\n }", "async getLastBlock() {\n debug('getLastBlock()');\n const lastBlock = await this.chain.getLastRecord();\n return JSON.parse(lastBlock);\n }", "async getLastFundedBlock () {\n const method = await this.getMethod(\n ...
[ "0.6352399", "0.61467", "0.60875726", "0.6051338", "0.60269874", "0.5980858", "0.5957279", "0.59375817", "0.58751374", "0.5864054", "0.5812361", "0.5797003", "0.5745907", "0.5740816", "0.5701039", "0.5700744", "0.5680256", "0.5669427", "0.5652052", "0.5651732", "0.5633937", ...
0.7507137
0
Update the status of the last transaction to paid
async updateTransactionStatus (reference = '') { return knex("transactions") .where({ reference }) .update({ status: 'paid' }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updatePaidStatus(user_id, group_id, paid) {\n return db(\"group_participants\")\n .where({\n user_id: user_id,\n group_id: group_id\n })\n .select(\"paid\")\n .update({ paid: paid });\n}", "_setTxStatus (txId, status) {\n var txMeta = this.getTx(txId)\n txMeta.status = statu...
[ "0.6316328", "0.6151591", "0.61219907", "0.60979855", "0.60556763", "0.60368514", "0.6008812", "0.59269047", "0.5926731", "0.5920643", "0.5838635", "0.5799516", "0.57173675", "0.56883633", "0.5631634", "0.56142384", "0.5596487", "0.55914485", "0.5588914", "0.5564248", "0.5559...
0.6203159
1
Retrieve all the tokens that will activate the computers. Only available once the transactions has been paid
async getComputerTokens(reference) { const response = (await axios.get('https://paynow.now.sh/complock/tokens/' + reference)).data; return response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async getTokens() {\n let ctx = this.ctx;\n\n const keysRule = {\n address: 'string',\n limit: {\n type: 'int',\n required: false,\n allowEmpty: true,\n max: 100,\n min: 0\n },\n pag...
[ "0.64813995", "0.63066477", "0.62346673", "0.6044713", "0.5947723", "0.5865616", "0.5852242", "0.57549226", "0.5740051", "0.56797695", "0.56790864", "0.5598444", "0.559036", "0.5576854", "0.55730647", "0.55031604", "0.54687893", "0.54638803", "0.54526085", "0.5439761", "0.542...
0.6646226
0
A software pattern that you may encounter in the future is a construct called the Observer Pattern. It enables "subscribers" (which are usually functions) to "subscribe" to "notifications" from a "publisher". Any number of subscribers can subscribe. Look at the code below: The call to the `createPublisher` function ret...
function createPublisher() { const subscribers = []; return { subscribe(/* TODO parameter(s) go here */) { // TODO complete this function }, notify(/* TODO parameter(s) go here */) { // TODO complete this function }, }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addpublishersubscriber(object){\r\n\tobject.subscribers = new Array();\r\n\t//functions\r\n\tobject.addsubscriber = function(subobj){\r\n\t\tobject.subscribers.push(subobj);\r\n\t};\r\n\tobject.notify = function(msgobj){\r\n\t\tvar tmparray = new Array();\r\n\t\tvar sub=object.subscribers.pop();\r\n\t\twh...
[ "0.6438224", "0.63716656", "0.6316378", "0.59657395", "0.571378", "0.571378", "0.571378", "0.571378", "0.571378", "0.571378", "0.57092416", "0.54954505", "0.54954505", "0.54954505", "0.5385322", "0.53620183", "0.53593296", "0.5282113", "0.52716243", "0.52696866", "0.52678126"...
0.7002262
0
returns the region whose string is intersected
intersectRegionStrings(mouseCanvasX, mouseCanvasY) { const canvas = this.refs.regionCanvas; const ctx = canvas.getContext('2d'); for (const reg of this._.regionSet) { const w = ctx.measureText(reg.string).width; const pos = reg.stringPosition; if (Utils2D.coordsInRectangle(mouseCanvasX, mo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "intersectRegions(x, y) {\n for (const reg of this._.regionSet) {\n if (reg.type === POLYGON_TYPE ?\n (Utils2D.isPointInPolygonBoundingBox(x, y, reg.points) &&\n Utils2D.isPointInPolygon(x, y, reg.points))\n : Utils2D.coordsInEllipse(x, y, reg.x, reg.y, reg.rx, reg.ry)) {\n ...
[ "0.6198262", "0.60919994", "0.6006762", "0.5964846", "0.59118843", "0.5843272", "0.5771032", "0.5752349", "0.57520247", "0.57335263", "0.5726286", "0.5682123", "0.5665133", "0.56590307", "0.56443214", "0.5633109", "0.5615514", "0.5613416", "0.5605424", "0.5600328", "0.5596359...
0.7834388
0
returns the region whose delete button is intersected
intersectRegionDeleteBtns(mouseCanvasX, mouseCanvasY) { const canvas = this.refs.regionCanvas; for (const reg of this._.regionSet) { const pos = reg.deleteIconPosition; if (Utils2D.coordsInEllipse(mouseCanvasX, mouseCanvasY, pos.x * canvas.width, pos.y * canvas.height, DELETE_ICON_WIDTH * 0....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SelectionRegion() {}", "addDelOverlay(){\r\n var n = this.bracket;\r\n var overlay = new mxCellOverlay(new mxImage(iconpath+'delrect.svg', 24, 24), LANGUAGE_TEXT.bracket.delete[USER_LANGUAGE]);\r\n overlay.getBounds = function(state){ //overrides default bounds\r\n var bo...
[ "0.5842195", "0.57149696", "0.5657423", "0.5614587", "0.5569587", "0.546434", "0.5429451", "0.5402645", "0.5390061", "0.5303192", "0.52978605", "0.5288027", "0.52839214", "0.52839214", "0.5275525", "0.52754307", "0.52720475", "0.5258821", "0.5231507", "0.5227253", "0.5218921"...
0.8018314
0
get region thet intersects the point (x,y), which must be in normalized coordinates
intersectRegions(x, y) { for (const reg of this._.regionSet) { if (reg.type === POLYGON_TYPE ? (Utils2D.isPointInPolygonBoundingBox(x, y, reg.points) && Utils2D.isPointInPolygon(x, y, reg.points)) : Utils2D.coordsInEllipse(x, y, reg.x, reg.y, reg.rx, reg.ry)) { return reg;...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "contains(x, y) {\n return Math.pow(this.x - x, 2) + Math.pow(this.y - y, 2) <= Math.pow(this.r, 2);\n }", "function findIntersectX(r1x1, r1y1, r1x2, r1y2, y) {\r\n if (r1x1 == r1x2) {\r\n return {x: r1x1, y: y};\r\n }\r\n var r1m = (r1y1 - r1y2) / (r1x1 - r1x2);\r\n var r1b = r1y1 ...
[ "0.69423926", "0.6881538", "0.66575396", "0.66575396", "0.66575396", "0.66523075", "0.66180205", "0.65731186", "0.65705484", "0.6562554", "0.6561632", "0.6561632", "0.6561632", "0.65324885", "0.6505088", "0.6477136", "0.647552", "0.64585644", "0.64505595", "0.64411235", "0.64...
0.73985463
0
Load regions over the current image. It is assumed that an image has already been loaded and all previous regions (if any) were removed
loadRegions(regions) { if (!regions) return; // update last JSON screenshot with new input const regionsClone = cloneDeep(regions); this._.regionsJSONScreenshot = regionsClone; const canvas = this.refs.regionCanvas; let rid = 0; for (const region of regionsClone) { const reg = cloneDe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "loadImageAndRegions(source, regions, selectedRegionIds) {\n if (source) {\n let sourcePromise = null;\n if (source.file) sourcePromise = this.loadLocalImage(source.file);\n else if (source.url) sourcePromise = this.loadRemoteImage(source.url);\n if (sourcePromise) {\n sourcePromise\n ...
[ "0.62671965", "0.59007686", "0.5881368", "0.5835654", "0.5770494", "0.5670679", "0.56603676", "0.55868524", "0.5581792", "0.5574822", "0.55660594", "0.5535066", "0.55253434", "0.55075425", "0.54771787", "0.5471995", "0.54585737", "0.5454771", "0.5435446", "0.5434767", "0.5426...
0.69963
0
load image from local file
loadLocalImage(file) { return new Promise((res, rej) => { const url = URL.createObjectURL(file); const img = new Image(); img.onload = () => { this.loadImage(img); URL.revokeObjectURL(url); res(); }; img.onerror = err => rej(err); img.src = url; }); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static load(pathToImage, callback) {\n fs.realpath(pathToImage, function(err, resolvedPath) {\n if (err === null) {\n // file exists\n fs.stat(resolvedPath, function(err, stat) {\n PNG.decode(resolvedPath, function(pixels) {\n let data = {\n image: {\n ...
[ "0.6777326", "0.6677262", "0.65813565", "0.65463406", "0.64849746", "0.64016485", "0.62740105", "0.62679523", "0.6245293", "0.6245293", "0.61986", "0.6172782", "0.6123005", "0.6083091", "0.6070236", "0.6059966", "0.6053147", "0.6051783", "0.60453296", "0.603854", "0.6035235",...
0.70756614
0
load image from a remote url
loadRemoteImage(url) { return new Promise((res, rej) => { const img = new Image(); img.onload = () => { this.loadImage(img); res(); }; img.onerror = err => rej(err); img.src = url; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadImage(url) {\n const image = new Image()\n image.src = url\n return waitForImage(image)\n}", "function getImage(url) {\n \n}", "function loadImage(url) {\n return new Promise((resolve) => {\n const img = new Image();\n img.onload = () => resolve(img);\n ...
[ "0.73925287", "0.6958853", "0.6940387", "0.6857861", "0.68195", "0.67964697", "0.67471755", "0.66419154", "0.6612104", "0.6563874", "0.6558788", "0.65433925", "0.6542631", "0.6534942", "0.65348554", "0.64406216", "0.6433812", "0.6429433", "0.6409986", "0.64015007", "0.6382443...
0.75284356
0
load image from source (file or url) and then load regions and set selected ones
loadImageAndRegions(source, regions, selectedRegionIds) { if (source) { let sourcePromise = null; if (source.file) sourcePromise = this.loadLocalImage(source.file); else if (source.url) sourcePromise = this.loadRemoteImage(source.url); if (sourcePromise) { sourcePromise .th...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadImageAndSelect(url) {\n\t// select as callback/continuation (load may be delayed)\n\tvar select = function(image) {\n\t\t// fake a select action for the image\n\t\tvar rescale = getProperty('rescale', 'fit');\n\t\tvar element = { image: { url: image.url, x: 0, y: 0, width: image.info.width, height: im...
[ "0.6222416", "0.6027014", "0.59899014", "0.58971316", "0.58804697", "0.5857677", "0.58453673", "0.57878643", "0.5749895", "0.57412076", "0.56945264", "0.56558675", "0.5653463", "0.56367743", "0.56318456", "0.5631479", "0.5604489", "0.5595693", "0.5564024", "0.5560809", "0.554...
0.7238339
0
Go to the next step when the next button is clicked
handleNextClick() { const nextStep = this.getNextStep(); if (nextStep) { this.deactivateSteps(); this.activateStep(nextStep); this.activeStepIndex++; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gotoNext() {\n showStep(vm.currentStep + 1);\n }", "next() {\n this.reviewing = false;\n if (this.currentquestion < this.questions.length - 1) {\n this.hideElement(DOM.nextbuttonid);//this.hideElement(DOM.nextbuttonid);\n this.enableElement(DOM.submitbutto...
[ "0.88669866", "0.82147527", "0.8173296", "0.8116534", "0.80735725", "0.79520446", "0.78752154", "0.7834762", "0.7626215", "0.7624085", "0.76221377", "0.7615349", "0.75979877", "0.7581383", "0.7573301", "0.75500625", "0.7513211", "0.7501613", "0.74745107", "0.7443025", "0.7421...
0.840008
1
Submit the data when finish is clicked
handleFinishClick() { const values = this.getFieldValues(); this.submit.emit({ body: values }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function submitData(data) {\n $.post('/kiosk/submit', {data})\n .done(function(returnData) {\n // Success! display the modal.\n addModalRows(returnData);\n $('#SuccessModal').modal();\n\n val_array = [];\n\n // After 5 seconds, close the modal.\n setTimeout(functio...
[ "0.6683943", "0.66358703", "0.66241825", "0.6610965", "0.6593643", "0.65720737", "0.6551426", "0.6542099", "0.65141314", "0.6425273", "0.64170444", "0.64086175", "0.63878804", "0.6312178", "0.6298926", "0.6279284", "0.62322617", "0.62288064", "0.61964333", "0.6195681", "0.619...
0.75831497
0
Allows the result of the submission to be pushed in this wizard. This is used in the submission process to deal with the result of the submission. taghttp will automatically call this method after the web api call if taghttp is used.
submitComplete(response) { /* Collect any server validation errors and map them to the form errors so they show against the correct field */ if (response.status === 400) { const values = this.getFieldValues(); let serverValidationErrors = {}; Object.keys(values).forEa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function finalizeResults() {\n $(\"#SubmitSlack\").removeAttr('disabled');\n $(\"#errorPTag\").removeAttr(\"hidden\").removeClass('uk-alert-danger').addClass('uk-alert-success');\n $(\"#errorP\").html(successString);\n $(\"#parseButton\").attr('disabled', 'disabled');\n\...
[ "0.642948", "0.62433815", "0.6131507", "0.61079574", "0.60701", "0.6046161", "0.603965", "0.5926755", "0.58998525", "0.58710164", "0.58431256", "0.583216", "0.58161", "0.5816054", "0.5812054", "0.5800476", "0.5799954", "0.5786915", "0.57862484", "0.57862484", "0.57607156", ...
0.6498846
0
Gets references to field DOM elements
getFields() { const fields = [].slice.call(this.element.querySelectorAll('tag-edit-field')); const editableLists = [].slice.call(this.element.querySelectorAll('tag-edit-list')); // get any fields in editable lists editableLists.forEach(list => { const listFields = [].slice.ca...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function FieldDiscoveryUtil() {\r\n var lstName = {};\r\n var result = [];\r\n\r\n function traverse(obj) {\r\n var obj = obj || document.getElementsByTagName('body')[0];\r\n\r\n var fieldUtil = FieldUtil.createInstance(obj);\r\n if (fieldUtil != null) {\r\n if (fieldUtil.t...
[ "0.6176302", "0.61011934", "0.59297657", "0.5854264", "0.5854264", "0.5854264", "0.5835925", "0.5799584", "0.57812905", "0.57697046", "0.57697046", "0.5766236", "0.56692463", "0.5659887", "0.5654981", "0.5628717", "0.5588317", "0.5575025", "0.5572815", "0.55499655", "0.554611...
0.67915547
0
Gets the previous step
getPreviousStep() { const steps = this.getSteps(); let previousStep; const currentStep = this.getCurrentStep(); if (currentStep) { if (currentStep.previousStep) { previousStep = this.getStep(currentStep.previousStep); } else { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "previousStep() {\n const editStepIndex = get(this, 'editStepIndex');\n const nextState = editStepIndex > 0 ? editStepIndex - 1 : editStepIndex;\n this.updateStep(nextState);\n }", "function prevStep(){\n setStep(step-1);\n }", "getPrevious() {\r\n return this.prev;\r\n }",...
[ "0.8330392", "0.8212727", "0.79058176", "0.78030634", "0.7783431", "0.7730761", "0.7647974", "0.7632592", "0.7631736", "0.7555045", "0.7459348", "0.74283904", "0.7408468", "0.7383394", "0.7369276", "0.7364295", "0.73373145", "0.73166275", "0.7312782", "0.72977966", "0.7288340...
0.8831003
0
Gets the next step
getNextStep() { const steps = this.getSteps(); let nextStep; const currentStep = this.getCurrentStep(); if (currentStep) { if (currentStep.nextStep) { nextStep = this.getStep(currentStep.nextStep); } else { if (this.acti...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nextStep(){\n setStep(step+1);\n }", "_goNextStep() {\n if (this.nextStep) {\n this.nextStep.start();\n }\n }", "nextStep() {\n const { editStepIndex, editSteps } = getProperties(this, ['editStepIndex', 'editSteps']);\n const nextState = editStepIndex < ...
[ "0.75133866", "0.74688727", "0.7370199", "0.73325413", "0.71934164", "0.71222484", "0.70979804", "0.69947666", "0.69683033", "0.6780082", "0.6741857", "0.6708144", "0.6708144", "0.6685693", "0.6655841", "0.664532", "0.6627576", "0.6614755", "0.6570589", "0.6568793", "0.647526...
0.8270672
0
Gets all the steps in this wizard
getSteps() { const steps = [].slice.call(this.element.querySelectorAll('tag-wizard-step')); return steps; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSteps() {\n return [\n \"Marketplace Integration\",\n \"Shipping Profile\",\n \"Return Settings\",\n \"Import Products\",\n \"Import Customers\",\n ];\n}", "function getSteps() {\n return [\n \"Marketplace Integration\",\n \"Shipping Profile\",\n \"Product Import\",\n \"...
[ "0.6658342", "0.6508855", "0.63925743", "0.63382566", "0.6285693", "0.6241445", "0.6241445", "0.61957777", "0.6143828", "0.6143476", "0.60807353", "0.6074986", "0.5904313", "0.5904313", "0.5904313", "0.5904313", "0.58254045", "0.58245796", "0.56471425", "0.560337", "0.5587655...
0.78013074
0
Gets the current step
getCurrentStep() { const steps = this.getSteps(); let currentStep; if (this.activeStepIndex < steps.length) { currentStep = steps[this.activeStepIndex]; } return currentStep; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCurrentStep ( ) {\n\n\t\t// Check all locations, map them to their stepping point.\n\t\t// Get the step point, then find it in the input list.\n\t\tvar retour = $.map($Locations, function( location, index ){\n\n\t\t\tvar step = $Spectrum.getApplicableStep( location ),\n\t\t\t\tvalue = $Values[index],\n...
[ "0.775988", "0.775988", "0.764097", "0.764097", "0.74804413", "0.7378216", "0.7163069", "0.7081945", "0.700236", "0.69817024", "0.6949802", "0.68746144", "0.67965335", "0.67965335", "0.67965335", "0.67965335", "0.6731172", "0.6731172", "0.6731172", "0.6731172", "0.6731172", ...
0.88811225
0
Deactivates all the steps
deactivateSteps() { const steps = this.getSteps(); steps.forEach(step => { step.style.display = 'none'; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "deactivate() { }", "deactivate() { }", "deactivate() { }", "deactivateAllActions() {\n\t\tthis.actions.forEach( function ( action ) {\n\t\t\taction.stop();\n\t\t} );\n\t}", "function deactivate() {\r\n return exitAll();\r\n}", "function deactivate() {}", "function deactivate() {}", "function deact...
[ "0.6993478", "0.6993478", "0.6993478", "0.6976201", "0.687127", "0.6719648", "0.6719648", "0.6719648", "0.6719648", "0.6719648", "0.6719648", "0.6719648", "0.6719648", "0.6719648", "0.6719648", "0.6719648", "0.6719648", "0.6719648", "0.6719648", "0.6719648", "0.6719648", "0...
0.80499065
0
Sets the height on all the steps
setHeightOnSteps() { if (this.height) { // get the height integer value so that we can calculate what the content container height should be const heightInt = this.height && this.height.indexOf('px') === this.height.length - 2 ? parseInt(this.height.substr(0, this.height....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static set height(value) { this._updateDimen(\"_height\", value); }", "setHeight(height) {\n this.height = height;\n }", "setHeight(height) {\r\n const graphs = this.graphs;\r\n for (let graph of graphs) {\r\n graph.setHeight(height);\r\n }\r\n }", "function adjus...
[ "0.72677886", "0.72236675", "0.7110057", "0.70715886", "0.6945713", "0.68206984", "0.680819", "0.6800524", "0.66501427", "0.6632645", "0.6578837", "0.65737265", "0.6572101", "0.6496576", "0.6472279", "0.6410747", "0.6387093", "0.6384628", "0.63316244", "0.63257957", "0.629903...
0.74443686
0
fetch function to post city input & return category list & zipcodes via flask from the Yelp API
function cityAndOptions() { d3.event.preventDefault(); // converts city input to variable let inputElement = d3.select(".form-control") let inputValue = inputElement.property("value"); // changes main page headline after location is submitted let headline = d3.select('#headline') ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getYelpData(city) {\n const yelpRoot = \"https://api.yelp.com/v3/businesses/search\\n?location=\"\n const proxyurl = \"https://cors-anywhere.herokuapp.com/\";\n const yelpUrl = `${proxyurl}${yelpRoot}${city} + ',co'`\n return fetch(yelpUrl, requestOptions)\n .then(data => data.json()).catch...
[ "0.72094256", "0.6898958", "0.6898756", "0.6677368", "0.6627077", "0.6620927", "0.6468259", "0.6460122", "0.6288266", "0.6251587", "0.6182502", "0.6154731", "0.61333185", "0.6124218", "0.611566", "0.6109358", "0.61029166", "0.6079469", "0.6074352", "0.60505974", "0.6024591", ...
0.69103235
1
PARTE PER API VIMEO OAUTH2// DAL JSON OTTENUTO ESTRAGGO L SRC DEL VIDEO ED CREO UN COMPONENTE IFRAME CON TALE SRC
function onTokenJson(json){ console.log(json); const listvideo=json.data; const video=listvideo[videonumber]; console.log(video); const link=video.link; //ESTRATTO DAL LINK OTTENUTO DAL JSON IL NUMERO CHE IDENTIFICA IL VIDEO// const linkestratto=link.substring(18); //OTTENGO IL LINK DA M...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function getVideoData() {\n let response = await fetch(url);\n\n if (response.ok) {\n // if HTTP-status is 200-299\n // get the response body (the method explained below)\n let json = await response.json();\n console.log(json);\n videos = [];\n\n json.forEach((...
[ "0.61287344", "0.6103896", "0.5989028", "0.5923088", "0.59044003", "0.58491355", "0.5736233", "0.57167965", "0.5661415", "0.5642449", "0.56150275", "0.55985165", "0.5581811", "0.55732495", "0.5537923", "0.5534141", "0.55290115", "0.55257547", "0.55107045", "0.54950005", "0.54...
0.6687871
0
Called when the user searches for a SNP. Gets SNP position from Text input. Calls addtolist, in order to add the SNP to the Visualization List.
function getInputValue() { const inputSNP = document.getElementById('inputSNP').value; addToList(inputSNP); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function spliceAddItem() {\n var index = positionToSplice.value;\n console.log(\"insert at index: \", index);\n\n // TODO(05) in line 73 write: itemArray.splice(index, 0, textToAdd.value);\n\n\n updateDisplay();\n}", "function searchFunction() {\n var searchInput, searchInputCap, ul, li, p, i, msgs;...
[ "0.58652014", "0.5299926", "0.5254431", "0.5140744", "0.5042199", "0.49583867", "0.4914858", "0.48697868", "0.48372892", "0.48324618", "0.48323855", "0.48282972", "0.48213342", "0.4821286", "0.48040667", "0.4797489", "0.47958553", "0.47791633", "0.47504112", "0.47344187", "0....
0.56299657
1
Like expected, resets the List of SNPs.
function resetSNPList() { const ul = document.getElementById("listSNP"); const visualizedSNPs = ul.getElementsByTagName("li"); while (visualizedSNPs.length !== 0) { visualizedSNPs[0].lastChild.click(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "reset() {\r\n this.springBoneGroupList.forEach((springBoneGroup) => {\r\n springBoneGroup.forEach((springBone) => {\r\n springBone.reset();\r\n });\r\n });\r\n }", "reset() {\n FixCollection.removeItems();\n\n this._refer...
[ "0.66861886", "0.6640801", "0.66138774", "0.66082925", "0.65235746", "0.64542085", "0.6447817", "0.64270943", "0.6395031", "0.63888353", "0.63832176", "0.63826305", "0.6358539", "0.63435256", "0.63090646", "0.630791", "0.62908757", "0.62349135", "0.6196313", "0.6183337", "0.6...
0.6718643
0
From the two selected subtrees, find all SNPs that these have in common. For the case of supporting SNPs, it goes to the LCA and takes the snps from there. For the case of the nonsupporting SNPs: It looks in all nodes that lie between the LCA and the leaves. Then shows the ones they have in common.
function commonSNPs() { try { let commonSNP = []; const selectedNodes = tree.getAllSubtreeRootIdsWithFlag("selected"); if (selectedNodes.length < 2) throw "Please select at least two subtrees"; let allNodesInSubtrees = extractNodesInSubtrees(selectedNodes); let text; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lowestCommonAncestors(node1, node2){\n\n var node1Ancestors = [];\n var lcas = [];\n\n function CA1Visit(visited, node){\n if(!visited[node]){\n visited[node] = true;\n node1Ancestors.push(node);\n if (node == node2) {\n lcas.push...
[ "0.58006954", "0.572169", "0.5522707", "0.54900014", "0.54703385", "0.5465452", "0.54606026", "0.5367409", "0.53639936", "0.53504497", "0.5320757", "0.5302204", "0.5281122", "0.52402914", "0.521307", "0.521307", "0.521307", "0.5150957", "0.5148908", "0.5148908", "0.50885713",...
0.77631253
0
Creates bottom part of the modal.
function addBottomModal() { let text = $('<p></p>', { id: "text-in-modal", }); $('#content').append(text); let checktext = $('<span></span>', { id: "checktext", text: "Show only significant results: " }); $('#content').append(checktext); let checkbox = $('<input>', { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createBottomButton(activeCommand) {\n return createButton.call(this, activeCommand, 'bottomButton', command.REVERSE);\n}", "function createModalFooter() {\n let footer = document.createElement(\"div\");\n footer.className = \"modal-footer\";\n let closeButton = document.createElement(\"button\...
[ "0.62583154", "0.6187127", "0.59664786", "0.5944319", "0.5892225", "0.58726996", "0.5829242", "0.5781496", "0.57726765", "0.5767767", "0.5697656", "0.56842595", "0.5673204", "0.5648803", "0.5620413", "0.56117857", "0.5588877", "0.5577212", "0.55696654", "0.55696654", "0.55696...
0.64689547
0
download files from AWS and upload them to user container
function uploadUserFiles(files, output, transcoderOptions) { // console.log('==========================>>>> uploadUserFiles'); log.trace('uploadUserFiles'); return new Promise( (resolve, reject) => { let awsStorage = new app.Storage('aws', transcoderOptions); let userStorage = new app.Storage(output.serv...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async run(params) {\n const startSize = 1024 * 1024 * 500.00000000000001 // 500 MB\n const limitSize = 1024 * 1024 * 1000 // 1 GB\n\n const files = await Files.find({\n status: 'active',\n storage: 'glacier',\n 's3Data.status': 'uploaded',\n 'glacierData.status': 'pending',\n 's3D...
[ "0.6339902", "0.62351996", "0.62159014", "0.62030137", "0.6185751", "0.6038678", "0.594071", "0.5922207", "0.59162843", "0.58959347", "0.58764356", "0.5875732", "0.585118", "0.58462214", "0.5844733", "0.5839589", "0.5803113", "0.579442", "0.5779735", "0.5738412", "0.5703682",...
0.70091087
0
waits for a job to finish
function waitForJob(jobId, transcoder) { // TODO: esto es de aws y tarda 30 segundos en el loop. // se puede hacer uno propio para disminuir el tiempo, // o se puede configurar el webhook del transcoder para enterarse // de cuándo terminó el job. // console.log('==========================>>>> waitForJob'); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "wait(jobId) {\n let job = this.jobs[jobId];\n if (job.executed) {\n delete this.jobs[jobId];\n }\n return job ? job.getPromise() : undefined;\n }", "function complete_job(o_returnJSON, cb){\n\n a_JSON.push(o_returnJSON)\t\t\n\n // Finished\n clearTimeout(timeout...
[ "0.68596613", "0.6418465", "0.6297145", "0.6184754", "0.6091087", "0.60770845", "0.60648954", "0.6000584", "0.59649247", "0.58310056", "0.58234584", "0.5779515", "0.5760199", "0.5752505", "0.5748768", "0.5697579", "0.56803143", "0.56390154", "0.5634933", "0.5575685", "0.55661...
0.7064244
0
gets an available pipeline for transcoding
function getAvailablePipeline(transcoder) { return new Promise( (resolve, reject) => { transcoder.listPipelines( ) .then( (data) => { let pl = data.Pipelines; let len = pl.length; let pid = null; for ( i = 0 ; i < len ; i++ ) { if (pl[i].Status == 'Active') { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getPipelineFlow() {\n\t\treturn this.objectModel.getPipelineFlow();\n\t}", "withPipeline(pipeline) {\n this.data.pipes = pipeline.slice(0);\n return this;\n }", "constructor(pipeline) {\n super(pipeline || getDefaultPipeline());\n }", "constructor(pipeline) {\n super(pipelin...
[ "0.61032516", "0.5799438", "0.577317", "0.577317", "0.577317", "0.5755834", "0.57418627", "0.572377", "0.5559827", "0.5547048", "0.55137676", "0.5486758", "0.5477385", "0.53732336", "0.5310866", "0.5299436", "0.52711064", "0.52694607", "0.5238614", "0.52224237", "0.5217001", ...
0.675413
0
returns an array of presets to be transcoded, according to targets and quality selected
function getPresets(targets, qualities) { // targets Array from targetEnum // qualities Array from qualityEnum // returns Array of presetsEnum (may be empty) let presets = new Set( ); let te = targetEnum; let qe = qualityEnum; let pe = presetsEnum; // first, add video presets targets.forEach( (t) => ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadPresets() {\n\tpresets=[new Float32Array([0.0,0.0,0.0,0.0,0.0])];\n\tprenames=[\"OFF\"];\n\tvar i=1;\n\twhile ((FRAM.read(32*(i-1),1) != 255)&&i<=32) { //read presets from fram\n\t\tprenames[i]=E.toString(FRAM.read(32*(i-1),20));\n\t\tvar temp=FRAM.read(32*(i-1)+20,5);\n\t\tpresets[i]=new Float32Array...
[ "0.6682909", "0.6156373", "0.5918092", "0.57493275", "0.54819155", "0.5370799", "0.533492", "0.5299013", "0.52216053", "0.5169294", "0.5164733", "0.51392424", "0.50906336", "0.5090049", "0.50772023", "0.50640965", "0.5039535", "0.4992018", "0.4930058", "0.49269545", "0.484979...
0.7563443
0
builds an array of playlists according to outputs requested required to create a transcoding job
function buildPlaylists(outputs) { // receives Array of output objects (from presets) to be transcoded // usualy from buildOutputByPreset() pushed to Array // returns Array of Playlists (could be empty if no mpeg-dash or hls detected) let playlists = [ ]; let hlsList = { Name: 'hls/playli...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "possibleOutputs() {\n // Rather than returning a fixed array, let's feed data from our tables. If those tables change, we won't\n // have to modify this to update its output\n\n // This gets more complicated when we add byproducts to our possible outputs. Filtering task is still the same, but ...
[ "0.5629871", "0.5570946", "0.5506657", "0.5478157", "0.53414005", "0.53271896", "0.51436263", "0.51081663", "0.50897604", "0.5083665", "0.508112", "0.5080698", "0.50382155", "0.50324553", "0.49844962", "0.4978102", "0.49747428", "0.49646038", "0.49442232", "0.49230295", "0.49...
0.7682751
0
grabs file from input user storage, and uploads it to AWS (required for transcoding)
function downloadUserFile(input) { // console.log('==========================>>>> downloadUserFile'); log.trace('downloadUserFile'); return new Promise( (resolve, reject) => { // TODO: arreglar esto: // - hay que crear un archivo?? cambiar el nombre (fs/?).. borrar al terminar // - se guarda el archiv...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function uploadAWSFile(fileName, transcoderOptions) {\n // console.log('==========================>>>> uploadAWSFile');\n log.trace('uploadAWSFile');\n return new Promise( (resolve, reject) => {\n let storage = new app.Storage('aws', transcoderOptions);\n if (storage) {\n let arg = {\n contai...
[ "0.7074436", "0.6597327", "0.64255357", "0.63807976", "0.6313038", "0.62899196", "0.62304425", "0.6214233", "0.6164121", "0.6159535", "0.61402875", "0.61396885", "0.61077744", "0.6089534", "0.60869336", "0.6082356", "0.60558313", "0.6039939", "0.60374606", "0.6026663", "0.601...
0.6681307
1
checks for required access on output storage
function checkOutputStorage(out) { // console.log('==========================>>>> checkOutputStorage'); // this is to avoid creating the job and then have no access to output storage log.trace('checkOutputStorage'); // TODO: Storage breaks if service is not configured. it should return null, not break! // TO...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function check() {\n\t\tdl_getspace(dl_filesize, function() {\n\t\t\twindow.requestFileSystem(\n\t\t\t\tdl_storagetype,\n\t\t\t\tdl_filesize,\n\t\t\t\tdl_createtmpfile,\n\t\t\t\terrorHandler('RequestFileSystem')\n\t\t\t);\n\t\t});\n\t}", "function isStorageInfoDefined(storageInfo){\r\n return storageInfo.usage ...
[ "0.58381444", "0.57766724", "0.5740503", "0.5722828", "0.57068217", "0.5565201", "0.5429856", "0.5374896", "0.5374299", "0.5347504", "0.53216493", "0.53165627", "0.53111804", "0.53087914", "0.53032506", "0.52756023", "0.5268448", "0.5264781", "0.5264781", "0.52440447", "0.523...
0.6992879
0
checks for required streaming options
function checkOptions(options) { // console.log('==========================>>>> checkOptions'); log.trace('checkOptions'); // TODO: esta verificación debería salir de las opciones de storage // required input format is verified in job creation let outputServices = ['local', 'gcloud', 'aws']; let inputServic...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static isSmartBufferOptions(options) {\n const castOptions = options;\n return castOptions && (castOptions.encoding !== undefined || castOptions.size !== undefined || castOptions.buff !== undefined);\n }", "function validateOptions(options) {\n if (typeof options !== \"object\" || options ===...
[ "0.64481103", "0.57408273", "0.56716543", "0.55109775", "0.55028707", "0.54388916", "0.53847915", "0.53640944", "0.5348973", "0.527502", "0.5258295", "0.5254488", "0.52280635", "0.52280635", "0.52280635", "0.52280635", "0.52280635", "0.52234584", "0.52089614", "0.5208899", "0...
0.7038467
0
show_tag_detail_of it will decide which imagecontainer will have tagcontainer maidiv imagecontainer imagediv img tagcontainer tagadddiv form formdiv inputdiv submitbuttondiv taglistdiv div tagnamediv tagdeletediv imagecontainer imagediv img imagecontainer imagediv img
render() { var images = this.state.images; var self = this; return ( <div className="container"> {images.map(function(image_obj, index){ return( <div key={index} className="task-wrapper flex-wrapper" onClick={(e) =>...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function viewtag( pic_id )\n {\n // get the tag list with action remove and tag boxes and place it on the image.\n var idPaciente = document.getElementById('NoPaciente').value;\n\t $.post( \"../inicio/taglist.php\" , \"idPaciente=\" + idPaciente, function( data ) {\n\t \t$('#taglist ol').html(dat...
[ "0.6728033", "0.5915975", "0.58278185", "0.57949096", "0.57824534", "0.5780345", "0.577118", "0.5740087", "0.57369584", "0.57297283", "0.57296973", "0.5649853", "0.5579391", "0.55647266", "0.5527626", "0.5522788", "0.5498155", "0.5480802", "0.5470424", "0.5451779", "0.5448339...
0.6051443
1
Get tickets from ServiceNow
function getTickets(recType, count, resolve, reject) { var snowInstance = process.env.SERVICENOW_HOST; var options = { hostname: snowInstance, port: 443, path: '/api/now/table/' + recType + '?sysparm_query=ORDERBYDESCsys_updated_on&sysparm_limit='+count, method: 'get', headers: { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async getTickets (req, res, next) {\n let query = Queries.generateTicketQuery(req);\n try {\n let count = await req.app.services.count.countTickets(query.search);\n let tickets = await req.app.services.tickets.getTickets(query);\n return res.status(200).send({tickets, count});\n } catch (er...
[ "0.69397473", "0.661602", "0.65519243", "0.64485157", "0.6426993", "0.6379149", "0.6307276", "0.630509", "0.6262666", "0.62261784", "0.6217188", "0.62171215", "0.6200699", "0.6108203", "0.6041463", "0.60130495", "0.5986491", "0.59847564", "0.5962706", "0.59262764", "0.592255"...
0.6796599
1
Maps a module id to a source.
map(id, source) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getModuleCodeAndMap(\n module: Module,\n idForPath: IdForPathFn,\n options: $ReadOnly<{\n enableIDInlining: boolean,\n dependencyMapReservedName: ?string,\n globalPrefix: string,\n }>,\n): {|\n moduleCode: string,\n moduleMap: ?BasicSourceMap,\n|}", "function SourceMapper() {\n}", "func...
[ "0.60288316", "0.595368", "0.5932639", "0.57629913", "0.5744595", "0.57188153", "0.56226236", "0.5618106", "0.559788", "0.5514557", "0.54772836", "0.5452614", "0.54522645", "0.5417733", "0.54074895", "0.54003555", "0.5398321", "0.5398321", "0.5331251", "0.5291424", "0.5276208...
0.66485316
1
Instructs the loader to use a specific TemplateLoader instance for loading templates
useTemplateLoader(templateLoader) { this.templateLoader = templateLoader; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor() {\n super();\n\n this.loaderPlugins = Object.create(null);\n this.moduleRegistry = Object.create(null);\n\n this.useTemplateLoader(new TextTemplateLoader());\n this.useTemplateRegistryEntryPlugin();\n }", "function loadTemplates(){\n\n}", "template(templateEn...
[ "0.63577944", "0.59825987", "0.5848377", "0.5838991", "0.5707794", "0.5664868", "0.56422484", "0.56376", "0.56376", "0.56075305", "0.55690235", "0.5563079", "0.55558765", "0.5488527", "0.54640913", "0.53963226", "0.53485703", "0.5342253", "0.53141904", "0.5291953", "0.5285069...
0.8004712
1
Test support methods on Target, such as `hasActor` and `getTrait`.
async function testTarget(client, target) { is( target.hasActor("inspector"), true, "target.hasActor() true when actor exists." ); is( target.hasActor("notreal"), false, "target.hasActor() false when actor does not exist." ); is( target.getTrait("giddyup"), undefined, "tar...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function testable(target) {\n // eslint-disable-next-line\n target.isTestable = true;\n}", "function isTargetable (member) {\n return (member.in_battle && member.can_target && !member.is_dead);\n}", "get target(){ return this.__target; }", "getTarget() { return this.Target; }", "setTarget(target) {\n ...
[ "0.6254885", "0.5923121", "0.57085776", "0.56863743", "0.5669397", "0.56137913", "0.5593846", "0.5577506", "0.5524382", "0.5518457", "0.5509079", "0.5470456", "0.54474217", "0.54091525", "0.54091525", "0.5407535", "0.5378641", "0.5372772", "0.53664976", "0.53118366", "0.53019...
0.78235966
0
Challenge 1: Convert hours to seconds Given a number representing hours, return its equivalent in seconds. In other words, convert hours to seconds. Examples: 2 hours = 7200 seconds, 3.5 hours = 12600 seconds
function convertHoursToSeconds(hrs) { return hrs*3600; // 1 hour = 60 minutes, 1 minute = 60 seconds, so 1 hour = 60*60 = 3600 seconds }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function convertHoursToSeconds(hours) {\n if (hours < 0) return -1;\n // must given the name for const variable\n const SECONDS_PER_HOURS = 3600;\n return hours * SECONDS_PER_HOURS;\n}", "timeToSeconds(t) {\n const pieces = t.split(':').map(_ => parseInt(_));\n const [hours, minutes, seconds] =...
[ "0.8249149", "0.75123507", "0.74170774", "0.7402048", "0.7402048", "0.7292039", "0.7289726", "0.72779727", "0.7263735", "0.71687853", "0.71228397", "0.71227455", "0.7122098", "0.71101874", "0.70754445", "0.70586926", "0.7006931", "0.69479245", "0.6942125", "0.6858598", "0.685...
0.78022385
1
Challenge 4: Video length in seconds From edabit: Given a string in the format "mm:ss", return the number of seconds. For example, if you're given "05:15", return 315. If the "ss" is 60 or more, or if "mm" is less than 00, return false. Note that "mm" could be bigger than 99.
function videoLength(str) { var numArr = str.split(":"); // Split the string by the ":" var minutes = parseInt(numArr[0]); // parseInt("numberString") turns a string into an integer var seconds = parseInt(numArr[1]); if (minutes < 0 || seconds >= 60) { return false; } else { return 6...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "calculateTimeLength(s) {\n var ms = s % 1000;\n s = (s - ms) / 1000;\n var secs = s % 60;\n s = (s - secs) / 60;\n var mins = s % 60;\n return mins + ':' + ( '0' + secs).slice(-2);\n }", "getSecondsInTimer(){\n\t\tlet timer = this.getTimerText();\n\n\t\tif(timer === \...
[ "0.67999625", "0.67596734", "0.6704394", "0.66837066", "0.6682159", "0.6665641", "0.6653121", "0.6634153", "0.66148084", "0.66087645", "0.6568173", "0.6513941", "0.6443012", "0.64384484", "0.6429308", "0.6367809", "0.63523406", "0.630788", "0.63046384", "0.630192", "0.6239157...
0.84980494
0
Pop: Remove and return the topmost node
pop() { if (!this.top) { // If no nodes to remove, exit return null; } var removedNode = this.top; // Grab the topmost node this.top = removedNode.next; // Move top pointer to next node in stack, which is now the new top removedNode.next = null; // Disconnect node fro...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "pop(){\n if(this.size === 0) return undefined;\n\n const poppedNode = this.first;\n\n this.first = this.first.next;\n\n this.size--;\n\n if(this.size === 0){\n this.last = undefined;\n }\n\n return poppedNode;\n }", "pop() {\n const popTop = this.linkedList.deleteTail();\n return...
[ "0.8053796", "0.80225736", "0.7971352", "0.7945299", "0.79433376", "0.78855443", "0.7884701", "0.78745323", "0.7830243", "0.7811757", "0.7792017", "0.77795887", "0.77789426", "0.77676284", "0.7764747", "0.77498", "0.7704264", "0.76888454", "0.76827735", "0.7658057", "0.765679...
0.83797723
0
Top: Return, but do NOT remove, the stack's top value
top() { if (this.top) { // If there is at least one node in the stack return this.top.val; // Return the topmost node's value } else { // No nodes in stack return null; // Arbitrary value to return } // One-line solution with a ternary operator: return this.top ? this.top...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get top () {\n if (this.stack.length === 0)\n throw new Error (\"Stack is empty\");\n return this.stack[0];\n }", "top() {\n return (this.head) ? this.head.val : this.head;\n }", "top() {\n return (this.head) ? this.head.val : this.head;\n }", "function stackPe...
[ "0.79748464", "0.7845147", "0.7845147", "0.78313327", "0.782584", "0.7819038", "0.77539593", "0.77420133", "0.7571821", "0.7556415", "0.7472238", "0.7438091", "0.7363309", "0.7341456", "0.72788763", "0.7260918", "0.7248504", "0.7245901", "0.7239619", "0.7220975", "0.72087663"...
0.83251923
0
Contains: Return whether the given value is found within the stack
contains(val) { var runner = this.top; // Start at top of stack while (runner) { // While there are nodes to look at // console.log("Current value:",runner.val); if (runner.val === val) { // If the current node's value matches the one we're looking for return true...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "contains(val) {\n if(this.isEmpty()) {\n console.log('This two stack queue is empty.');\n return false;\n } else {\n for(let i = this.stack1.length-1; i >=0; i--) {\n if (this.stack1[i] === val) {\n console.log(`Value (${val}) found.`...
[ "0.7835106", "0.71823204", "0.7112989", "0.7061537", "0.69477874", "0.6926839", "0.69156647", "0.6904713", "0.68705183", "0.6866316", "0.68369484", "0.67982876", "0.6787286", "0.67092425", "0.67085004", "0.6682054", "0.66689545", "0.6653641", "0.66399485", "0.65831786", "0.65...
0.82071245
0
Size: Return the number of nodes in the stack
size() { var runner = this.top; // Start at top of stack var numNodes = 0; // Number of nodes found while (runner) { // While there are nodes to look at numNodes++; // Increment count // console.log("Current value in stack:", runner.val); // console.log("Numbe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function size(){\n return _stack.length;\n }", "size() {\n console.log(`There are ${this.count} elements in the stack`);\n return this.count;\n }", "size() {\n // console.log(`${this.count} elements in stack`)\n return this.count\n }", "size() {\n return this.mainStack.size();\...
[ "0.8327735", "0.7912101", "0.7782978", "0.77488697", "0.766442", "0.76180714", "0.7581761", "0.745521", "0.73909783", "0.7369133", "0.72974527", "0.72955644", "0.7290024", "0.726252", "0.72538245", "0.7250002", "0.7250002", "0.7250002", "0.7250002", "0.7250002", "0.7250002", ...
0.86062706
0