Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
THIS CONSTRUCTOR WILL HOLD PLAYER NAME AND TOTAL SCORE VALUES
function Player(name, diceRolls) { this.name = name, this.diceRolls = diceRolls, this.score = 0, this.currentRoll = []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Player(name) {\n this.name = name;\n this.answered = 0;\n this.score = 0;\n this.scoresPerCat = {\n 'literature' : 0,\n 'geography' : 0\n };\n}", "function Player() {\n this.name = name;\n this.score = [];\n this.totalScore = 0;\n this.active = true;\n}", "function Player(playerName) {\...
[ "0.7191128", "0.7153999", "0.71514165", "0.702655", "0.6769251", "0.6741944", "0.6727004", "0.66978776", "0.6611614", "0.66090244", "0.6608156", "0.65541565", "0.65418", "0.65365803", "0.6481511", "0.64683384", "0.6463168", "0.64336693", "0.64278233", "0.6425702", "0.6425702"...
0.6379755
25
render banner(it is not supported on Android yet)
renderBanner() { if (this.state.dataSource.length === 0) return null; return (<View style={{ backgroundColor: 'grey', height: 100, justifyContent: 'center', alignItems: 'center', }}> <Text style={{ fontSize: 20, color: 'white', lineHeight: 100, h...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderBanner() {\n\t$.webviewBanner.addEventListener('load', function() {\n\t\tproxy.appyProxyRule($.webviewBanner); //proxy checks on all resource viewer request\n\t});\n\t$.webviewBanner.addEventListener('load', function(e) {\n\t\t//$.logo.animate({opacity:0, duration:500});\n \t\t//$.webviewBanner.an...
[ "0.7903175", "0.68997765", "0.6873348", "0.68552285", "0.6832827", "0.6729449", "0.6723513", "0.67027396", "0.6695099", "0.6647811", "0.6552249", "0.6549674", "0.65141594", "0.65001464", "0.6427729", "0.6422329", "0.63835424", "0.6290098", "0.6249295", "0.6238502", "0.6199080...
0.74124527
1
TensorFlow requires the loading of the model to be done in an asynchronous function this means it will load in the background and be available to us when it's done
async function loadFaceModel() { model = await blazeface.load(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async Load(){\n await tf.ready();\n this._model = await tf.loadGraphModel(bundleResourceIO(modelJson2, modelWeights2));\n this._prediction = 0;\n console.log(this._model);\n }", "async loadModel() {\n console.log('Loading model...');\n const startTime = performance.now();\n try {\n thi...
[ "0.7891007", "0.7800356", "0.7585631", "0.7581197", "0.75798553", "0.7408917", "0.7333121", "0.72778475", "0.7076484", "0.70716804", "0.7045261", "0.7022004", "0.70126396", "0.70005757", "0.6997224", "0.6943552", "0.69210553", "0.68913585", "0.6832882", "0.6745017", "0.669336...
0.6844843
18
a little utility function that converts positions in the video to the canvas' dimensions
function scalePoint(pt) { let x = map(pt[0], 0,video.width, 0,width); let y = map(pt[1], 0,video.height, 0,height); return createVector(x, y); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function videoProperties() {\n // r = video1.width/video1.height;\n w = video1.width;\n h = video1.height;\n // console.log(w,h);\n}", "function adaptElements() {\n const rect = document.body.getBoundingClientRect();\n const screenWidth = rect.width;\n const screenHeight = rect.h...
[ "0.650719", "0.6454086", "0.6430585", "0.6365269", "0.634956", "0.63369143", "0.63108605", "0.63108605", "0.6204596", "0.62037444", "0.61793965", "0.6157436", "0.61434406", "0.60716456", "0.6061867", "0.6039424", "0.6035905", "0.6035905", "0.6001121", "0.5977444", "0.59286505...
0.0
-1
like loading the model, TensorFlow requires we get the face data using an async function
async function getFace() { // get predictions using the video as // an input source (can also be an image // or canvas!) const predictions = await model.estimateFaces( document.querySelector('video'), false ); // false means we want positions rather than // tensors (ie useful screen locations...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function loadFaceModel() {\n model = await blazeface.load();\n} // loadFaceModel ", "async function loadFaceModel() {\n model = await blazeface.load();\n}", "async function loadPredictions() {\n if(capture.loadedmetadata) {\n predictions = await blazeFaceModel.estimateFaces(capture.elt);\n }\n}", ...
[ "0.79752177", "0.77811134", "0.7403219", "0.72259694", "0.695946", "0.6909172", "0.6796135", "0.6787058", "0.6779298", "0.676606", "0.6727596", "0.6659481", "0.65014756", "0.6450834", "0.6399373", "0.63899994", "0.6373082", "0.63559735", "0.63479024", "0.63380873", "0.6212433...
0.65872985
12
Cancels all storage operations.
cancel() { this.cancelled = true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clearAllStorageTask() {\n localStorage.clear();\n}", "function cancelUpload() {\n vm.uploader.clearQueue();\n }", "function clearStorageInfo() {\n var gettingAllStorageItems = browser.storage.local.get(null);\n gettingAllStorageItems.then((results) => {\n deleteAllUrlTy...
[ "0.604393", "0.5845205", "0.5775657", "0.5752557", "0.5739208", "0.57356167", "0.5667391", "0.5579601", "0.5538826", "0.5538826", "0.5536059", "0.55092454", "0.5505169", "0.5480335", "0.54654866", "0.5464629", "0.5448511", "0.5372544", "0.535617", "0.5340065", "0.5339691", ...
0.0
-1
Can't just use d3.svg.diagonal because one edge is in normal space, the other edge is in radial space. Since we can't just ask d3 to do projection of a single point, do it ourselves the same way d3 would do it.
function projectX(x) { return ((x - 90) / 180 * Math.PI) - (Math.PI/2); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_setDiagonal () {\n this._diagonal = d3.svg.diagonal().projection((d) => {\n return [d.y, d.x];\n });\n }", "function diagonal(d) {\n return \"M\" + d.y + \",\" + d.x\n + \"V\" + d.parent.x\n + \"H\" + d.parent.y;\n}", "function diagonal({startPoint, endPoint, expanseDi...
[ "0.7612418", "0.70641375", "0.6914789", "0.6826047", "0.6694292", "0.6660046", "0.65387475", "0.6529783", "0.65028286", "0.64912474", "0.64679277", "0.64632666", "0.6463108", "0.6463108", "0.645853", "0.6454367", "0.6454367", "0.64419234", "0.6425693", "0.64091325", "0.638688...
0.0
-1
this function gets called when API is ready to use
function onYouTubePlayerAPIReady() { // create the global player from the specific iframe (#video) player = new YT.Player('ytplayer', { events: { // call this function when player is ready to use 'onReady': onPlayerReady } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function apiReady() {\n console.log(\"API is ready\");\n\n}", "function apiLoaded() {\r\n initAPI();\r\n launchRco();\r\n}", "function API(){}", "function API(){}", "constructor(){\n\t\t//console.log('API START');\n\t}", "static ready() { }", "function handleAPILoaded()\n{\n requestSubscription...
[ "0.76871467", "0.75566244", "0.70167536", "0.70167536", "0.6961512", "0.6943877", "0.69414985", "0.69264996", "0.686007", "0.6843503", "0.6829102", "0.67966694", "0.67742366", "0.6757557", "0.6722131", "0.6700144", "0.66496617", "0.6610408", "0.65876925", "0.65754974", "0.656...
0.0
-1
.on('mouseout', () => highlight(5, false)) svg.on('mouseout', () => highlight(5, false)) const selected = false
function highlight(target, activate) { if (!activate) console.log('#######################################') const rings = [ringOne, ringTwo, ringThree, ringFour, ringFive]// .filter((e, idx) => !(idx + 1 === target)) const thisRing = rings.splice(target, 1) if (activate) { rings.forEach((each,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function highlight() {\n d3.select(this).classed('selected', true)\n }", "function unhighlight() {\n d3.select(this).classed('selected', false)\n }", "function mouseOver() {\n d3.select(this).attr('filter', 'url(#geo-highlight)');\n m_group.selectAll('rect,path,cir...
[ "0.76771146", "0.7296871", "0.727713", "0.7172407", "0.716983", "0.71641827", "0.7163616", "0.7091017", "0.69612044", "0.69378006", "0.6931969", "0.69218904", "0.6908635", "0.68888825", "0.68671167", "0.6811898", "0.6757205", "0.6715342", "0.67103577", "0.6706381", "0.6694607...
0.6397515
54
These are here because fs.listDirSync does not seem to exist
function readFileLog() { try { let logText = fs.readFileSync("files.log", "utf-8"); return logText } catch(e) { console.warn('Unable to load files.log', e) } return '' }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "dirs(p) {\n return fs.readdirSync(p).filter(f => fs.statSync(path.join(p, f)).isDirectory())\n }", "listDir(path) {\n return backend.listDir(path);\n }", "function walkSync(dir, filelist) {\n\tfiles \t\t= fs.readdirSync(dir)\n\tfilelist \t= filelist || []\n\n\tfiles.forEach(function(file) {\n\n\t\tif (fs...
[ "0.68653613", "0.6656477", "0.66168797", "0.65708166", "0.6563667", "0.654259", "0.6528405", "0.6483201", "0.6434871", "0.64246845", "0.6418922", "0.6397296", "0.6394857", "0.638258", "0.63417447", "0.6281993", "0.62609357", "0.62339085", "0.6223713", "0.62163997", "0.6187798...
0.0
-1
an animation for megaman's run
function megamanRunLoop(){ if (frameCount % 15 === 0) {// every 15 frames animationFrameCounter += 1; } if (animationFrameCounter >= 4){//resets the counter every 4 cycles animationFrameCounter = 0; } if (megamanDirection === 1){// if facing right //draw the next right-facing image...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "animation() {}", "function runAnimay(){\n ropAnimation();\n headAnimation();\n bodyAnimation();\n larmAnimation();\n rarmAnimation();\n llegAnimation();\n rlegAnimation();\n}", "function anim() {\r\n Loop();\r\n requestAnimFrame(anim);\r\n }", "function Animation (){\n ...
[ "0.7440284", "0.7282378", "0.72699094", "0.713528", "0.71134305", "0.7082767", "0.705892", "0.69908077", "0.6868786", "0.6771917", "0.67678267", "0.66681975", "0.666142", "0.6608725", "0.6590411", "0.657576", "0.6575078", "0.6568604", "0.6568604", "0.6520397", "0.6516988", ...
0.6719501
11
draw the correct sprite of Megaman for the situation
function makeMeAMegaman(){ if (megamanDirection === 1){//checks if facing right if (megamanYSpeed === 0){//checks if moving up or down if (megamanXSpeed === 0){//checks if moving left or right if (shot1Out || shot2Out || shot3Out){//checks if shooting //draws the sprite for megam...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function draw()\n{\n\tdraw_sprite(canvas, mirror, 300, 30);\n\tdraw_sprite(canvas, nam, nam_x, man_y);\n\tif (draw_text) textout_centre(canvas, font, \"you suck\", 400, 60+man_x/5, font_size, makecol(100,0,0));\n\tif (draw_text) textout_centre(canvas, font, \"& are stupid\", 400, 150+man_x/5, font_size, makecol(10...
[ "0.7544907", "0.7069437", "0.6934488", "0.6866068", "0.68576884", "0.68503433", "0.6849183", "0.68463176", "0.6832009", "0.682373", "0.6817536", "0.6799548", "0.6799548", "0.6780959", "0.6778056", "0.6775419", "0.6775419", "0.6738899", "0.67386675", "0.6710657", "0.67055285",...
0.6570105
49
Change the player's direction and speed either right or left
function moveX(){ if (isMovingRight) { megamanXSpeed = (4*xScaler); megamanDirection = 1; } if (isMovingLeft) { megamanXSpeed = (-4*xScaler); megamanDirection = -1 } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "turnRight() {\n this._currentLinearSpeed = 0;\n this._currentAngularSpeed = -this._angularSpeed;\n }", "function moveRight() {\n testplayer.velocityX += 0.5;\n}", "movePlayer(dir, speed) {\n switch (dir) {\n case \"up\":\n this.y -= this.y - speed < 0 ? 0 : speed;\n br...
[ "0.7359343", "0.71061736", "0.706123", "0.7013668", "0.69887376", "0.6932988", "0.69265354", "0.68769133", "0.6839058", "0.6779089", "0.6719581", "0.66793793", "0.66569036", "0.66539824", "0.6652962", "0.66322845", "0.65518725", "0.6550355", "0.65389186", "0.6535167", "0.6528...
0.0
-1
Calls all three shoot functions so I didn't have to write all three out
function shoot(){ shot1(); shot2(); shot3(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function shoot()\r\n\t{ if(shotoffset<timer)\r\n\t\t{switch (stype) {\r\n case 0:\r\n\t\t\t\tmysound.play();\r\n\t\t\t\tproj.changeproj(\"laser\");\r\n proj.laser();\r\n break;\r\n case 1:\r\n\t\t\t\tproj.fireball();\r\n\t\t\t\tproj.changeproj(\"fireball\");\r\n...
[ "0.71810037", "0.7066657", "0.6753062", "0.6692451", "0.64082956", "0.6400789", "0.6391838", "0.63028777", "0.62530315", "0.62274283", "0.61783195", "0.61750305", "0.6152875", "0.6146898", "0.6125404", "0.6109784", "0.60949653", "0.60367095", "0.6017683", "0.6017307", "0.6013...
0.82752955
0
Allows the Speed variables to actually take effect
function moveStep(){ megamanXPos += megamanXSpeed; megamanYPos += megamanYSpeed; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateSpeed (speed) {\n this.speed = speed;\n }", "function inc_speed()\n{\n if(speed == speed_normal)\n speed = speed_fast;\t\n}", "function set_speed(s) {\n\tspeed = s;\n}", "function setSpeed1() {\n speed = 1;\n spaceSave();\n}", "function setSpeed(\r\n speed_)\r\n {\...
[ "0.72142583", "0.7139359", "0.70712626", "0.70640016", "0.7008372", "0.7001605", "0.6996015", "0.6986088", "0.6983532", "0.6968005", "0.6904012", "0.68918943", "0.68906176", "0.6863113", "0.6860076", "0.6849879", "0.6837709", "0.68359464", "0.68106556", "0.67868435", "0.67524...
0.0
-1
Stops the player from going offstage to the left
function touchingLeft(){ if (megamanXPos <= megamanWidth/2){ megamanXSpeed = 0; megamanXPos = megamanWidth/2; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function playerLeft() {\n\tadjustPlayer(0, -1);\n}", "function stopPlayer() {\n if (game.level.player.prevX != game.level.player.x) {\n\n game.level.player.x = game.level.player.prevX;\n }\n if (game.level.player.prevY != game.level.player.y) {\n game.level.player.y = game.level.player.prevY;\n }\n}", ...
[ "0.7337895", "0.7281828", "0.67629707", "0.6697161", "0.66475177", "0.664266", "0.6600158", "0.6586637", "0.65176916", "0.6512992", "0.6477807", "0.6475931", "0.64719117", "0.6454632", "0.6453765", "0.6448245", "0.6441166", "0.64396214", "0.6412421", "0.6406829", "0.6406179",...
0.0
-1
Stops the player from dropping out of the bottom of the screen
function touchingBottom(){ if (megamanYPos >= (height - megamanHeight/2)-(7*yScaler)){ megamanYSpeed = 0; megamanYPos = (height - megamanHeight/2) - (1*yScaler/2); canJump = true } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function offScreen() {\n \n // Check if the y is greater than canvas height\n if (playerRect.y > cHeight) {\n \n // Die\n die();\n }\n \n}", "stopAndStay()\n {\n // this.playerController.onDialogue.onDialogue = true;\n this.body.velocity.x = 0;\n }", "function stop()...
[ "0.741055", "0.6687405", "0.6561843", "0.65436244", "0.6497342", "0.6480393", "0.6452559", "0.6414735", "0.63878137", "0.63705474", "0.6361003", "0.63367426", "0.6326658", "0.63165444", "0.630565", "0.6294779", "0.62783974", "0.6278033", "0.62665606", "0.6259861", "0.62126404...
0.0
-1
TODO severly optimize this mess
function refreshData() { $scope.favorites.forEach(function (ps) { $scope.frontends[ps.id] = ps.getFrontends(); $scope.backends[ps.id] = ps.getBackends(); $scope.connStats[ps.id] = {}; $scope.statuses[ps.id] = {}; $scope.healthCounts[ps.id] = {}; for (k in $scope.frontends[ps.id])...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "private public function m246() {}", "protected internal function m252() {}", "transient private protected internal function m182() {}", "transient protected internal function m189() {}", "static private internal function m121() {}", "transient private internal fun...
[ "0.6521345", "0.61936206", "0.6192993", "0.59725666", "0.5854272", "0.5790716", "0.5783388", "0.5687742", "0.5514777", "0.5481958", "0.544625", "0.54436415", "0.53881335", "0.53743064", "0.53245664", "0.5297533", "0.5284028", "0.51785094", "0.51026005", "0.5086769", "0.503756...
0.0
-1
A watchable collection of properties, similar to Backbone.Model. TODO could probably be replaced with a thirdparty event emitter.
function Watchable() { this._id = uid(constants.UID_LENGTH); this._callbacksByProperty = {}; // We need to associate contexts with callbacks, // but allocating new objects on insert is clunky/expensive, // so use a parallel map, instead. this._contextsByProperty = {}; this._properties = {}; this._numW...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeWatcher(property) {\n return function (val, oldVal) {\n for (var attr in oldVal) {\n if (!Object.prototype.hasOwnProperty.call(val, attr)) {\n this.$delete(this.$data[property], attr);\n }\n }\n\n for (var _attr in val) {\n this.$set(this.$data[property], _attr, val[_at...
[ "0.6582251", "0.6582101", "0.6582101", "0.6582101", "0.6582101", "0.6582101", "0.6582101", "0.6496189", "0.6496189", "0.6496189", "0.6496189", "0.6496189", "0.64170384", "0.6382796", "0.60482234", "0.59963787", "0.597575", "0.5931603", "0.5931219", "0.58664584", "0.5862677", ...
0.7032302
0
This is where we define data members
constructor() { super("MainScene"); // Monster variables this.monsterImage = null; this.hp = 5; this.hpText = null; this.soulsText = null; // Levels in upgrades this.levels = { bolt: 0 } // Status of monster this.alive =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor(data) {\n \n }", "constructor() {\n // Data / properites / state\n // The difference between the properties and regular\n // variables is that the properies are encapsulated variables.\n this.name = null;\n this.age = null;\n }", "get data () {return ...
[ "0.6661943", "0.653917", "0.6460867", "0.644464", "0.6443013", "0.64196825", "0.6353386", "0.6333938", "0.62811655", "0.620899", "0.62073326", "0.620191", "0.61941034", "0.6178186", "0.6173205", "0.6172645", "0.6158025", "0.6149148", "0.61065686", "0.6093818", "0.609265", "...
0.0
-1
Runs before entering the scene, LOAD IMAGES AND SOUND HERE
preload() { // this.load.image('kraken', './assets/kraken.png'); // Loop through monster configuration and load each image for (let i = 0; i < MONSTERS.length; i++) { this.load.image(MONSTERS[i].name, `./assets/${MONSTERS[i].image}`); } this.load.image('bolt', './asse...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function preload(){\n tree = loadImage(\"assets/tree.png\"); \n bgImage = loadImage(\"assets/bgImage.jpg\");\n basket = loadImage(\"assets/Plate.png\");\n apple = loadImage(\"assets/apple.png\");\n reset = loadImage(\"assets/reset.png\");\n startImg = loadImage(\"assets/start...
[ "0.79710066", "0.7890581", "0.7864734", "0.7847974", "0.7819884", "0.7818888", "0.78105664", "0.78055376", "0.780101", "0.780101", "0.778561", "0.7781868", "0.77753365", "0.7764253", "0.774812", "0.77257764", "0.77157956", "0.7698895", "0.76785815", "0.76696897", "0.7655299",...
0.7528183
36
Runs when we first enter this scene
create() { // Load game data this.loadGame(); // Set the starting monster let index = Math.floor(Math.random() * MONSTERS.length); this.setMonster(MONSTERS[index]); // Create hp text this.hpText = this.add.text(225, 700, ""); // Create the souls text ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startup() {\n\tsceneTransition(\"start\");\n}", "function Start(){\n activeScene.traverse(function(child){\n if(child.awake != undefined){\n child.awake();\n }\n });\n\n activeScene.traverse(function(child){\n if(child.start != undefined){\n child.star...
[ "0.7491822", "0.7258842", "0.70959723", "0.708311", "0.7068571", "0.69426966", "0.6913653", "0.68385595", "0.68103015", "0.6773422", "0.676423", "0.6742932", "0.6701676", "0.66655755", "0.66642004", "0.66449726", "0.66404414", "0.66177493", "0.66078645", "0.6601381", "0.65739...
0.0
-1
Destroys all collection commands.
destroy() { for ( const command of this.commands() ) { command.destroy(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "deleteAllWorkflows() {\n\n Workflow.remove({}, function (err) {\n console.log('collection removed')\n });\n\n IJob.remove({}, function (err) {\n console.log('collection removed')\n });\n }", "destroy() {\n this.removeAll();\n this.items = null;\n...
[ "0.6367739", "0.6358392", "0.63509095", "0.63235897", "0.6295313", "0.62612057", "0.62209", "0.62017995", "0.61877275", "0.6130928", "0.61060023", "0.60870725", "0.6077193", "0.60168606", "0.59974504", "0.59814894", "0.595893", "0.5958855", "0.5939976", "0.59051186", "0.58999...
0.744298
0
This sample demonstrates how to Allows you to reimage all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks.
async function virtualMachineScaleSetVMSReimageAllMaximumSetGen() { const credential = new DefaultAzureCredential(); const client = createComputeManagementClient(credential); const subscriptionId = ""; const resourceGroupName = "rgcompute"; const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaa"; const instanceId...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function virtualMachineScaleSetVMSReimageAllMinimumSetGen() {\n const credential = new DefaultAzureCredential();\n const client = createComputeManagementClient(credential);\n const subscriptionId = \"\";\n const resourceGroupName = \"rgcompute\";\n const vmScaleSetName = \"aaaaaaaaaaaaaaaaaaaaaaaaa\";\n...
[ "0.63577384", "0.5731896", "0.56501657", "0.54519105", "0.54502046", "0.5373538", "0.5347287", "0.53188604", "0.5282793", "0.5195995", "0.51859367", "0.5074801", "0.50345486", "0.5024755", "0.5001749", "0.49671263", "0.48729712", "0.482141", "0.48091364", "0.4756304", "0.4755...
0.6269961
1
This sample demonstrates how to Allows you to reimage all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks.
async function virtualMachineScaleSetVMSReimageAllMinimumSetGen() { const credential = new DefaultAzureCredential(); const client = createComputeManagementClient(credential); const subscriptionId = ""; const resourceGroupName = "rgcompute"; const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaa"; const instanceI...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function virtualMachineScaleSetVMSReimageAllMaximumSetGen() {\n const credential = new DefaultAzureCredential();\n const client = createComputeManagementClient(credential);\n const subscriptionId = \"\";\n const resourceGroupName = \"rgcompute\";\n const vmScaleSetName = \"aaaaaaaaaaaaaaaaaaaaaaaa\";\n ...
[ "0.6269961", "0.5731896", "0.56501657", "0.54519105", "0.54502046", "0.5373538", "0.5347287", "0.53188604", "0.5282793", "0.5195995", "0.51859367", "0.5074801", "0.50345486", "0.5024755", "0.5001749", "0.49671263", "0.48729712", "0.482141", "0.48091364", "0.4756304", "0.47558...
0.63577384
0
DISPLAY CONTACTS ARRAY IN THE DOM
function displayContacts(){ section.innerHTML =''; arrayOfContacts.sort(sortArrayOfContacts); for (contactItem of arrayOfContacts){ let contactContainer = createElement(section, 'div', '', 'class', 'contact-container'); let contactLogo = createElement(contactContainer, 'div', '<img src="./person-logo.png">', '...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function display() {\n document.querySelector(\"#contact_list\").innerHTML = \"\";\n addressBook.contacts.forEach((contact, index) => {\n const newEntry = document.createElement(\"div\");\n newEntry.classList.add(\"contact_box\");\n newEntry.innerHTML = `\n <p>Name: ${contact.name}</p>\n <p>Email:...
[ "0.68560946", "0.6460574", "0.64338833", "0.6400146", "0.6277989", "0.6250045", "0.62335575", "0.6217115", "0.6211094", "0.6193103", "0.61799073", "0.61743116", "0.6157498", "0.6150244", "0.6146419", "0.6031107", "0.5999463", "0.59808874", "0.59786004", "0.59758365", "0.59647...
0.6831547
1
Will use Kadane Algorithm. Find the Max_so_far and max_ending . Algorithm to work with positive integer set max_so_far =0; max_ending =0 loop over the array; add array[i] in max_ending. if array is less than zero set max_ending to 0 check max_so_far with max_ending.IF greater update max_so_far
function maxSubarraySum(arr) { let max_ending = 0; let max_so_far = 0; for (let i = 0; i < arr.length; i++) { max_ending = arr[i] + max_ending; if (max_ending < 0) max_ending = 0 else if (max_so_far < max_ending) { max_so_far = max_ending; } } retu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function kadane(array) {\n let maxEnding = array[0];\n let maxSoFar = array[0];\n for (let i = 1; i < array.lenth; i++) {\n const num = array[i];\n maxEnding = Math.max(num, maxEnding + num);\n maxSoFar = Math.max(maxSoFar, maxEnding);\n }\n return maxSoFar;\n}", "function kadanesAlgorithm(array) {...
[ "0.75331455", "0.7270707", "0.7158832", "0.7002033", "0.6983116", "0.6862736", "0.6685345", "0.66497177", "0.66374516", "0.6636671", "0.6539966", "0.64139724", "0.6359608", "0.63533396", "0.63423514", "0.62811536", "0.62809116", "0.62576705", "0.62377393", "0.6236427", "0.623...
0.63349086
15
onClick: Functions for opening and closing the modal
function openModal() { setIsModalOpen((isModalOpen) => !isModalOpen); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handleClick() {\n this.closeModal();\n }", "function openModal() {\n 'use strict';\n\n //manejador de eventos del close\n document.getElementById('closeModal').onclick = closeModal;\n\n //cambio el display a inline-block\n //muestro el div\n document.getElementById('modal').style.disp...
[ "0.74750066", "0.7447912", "0.7377565", "0.73602206", "0.7357183", "0.7256199", "0.71691024", "0.7165928", "0.71600085", "0.71474767", "0.7111943", "0.7108437", "0.7084982", "0.7084982", "0.7084982", "0.70815694", "0.7081172", "0.70503145", "0.7045841", "0.70357174", "0.70342...
0.0
-1
Work around for JavaScripts ||= operator. Only null, undefined, NaN, and false will be construed as falsy.
function oreq () { var truthy = function truthy(v) { return v !== null && v !== undefined && v !== false; }; for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } var val = args.filter(truthy)[0]; return truthy(val) ? val : undef...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isFalsy(input){\n\n}", "function isFalsy(input){\n return 0;\n }", "function isNullOrUndefined(value){return value===null||value===undefined;}", "isAbsent() {\n return \"undefined\" == typeof this.value || null == this.value;\n }", "function isFalsy(v) {\n return !v;...
[ "0.65490127", "0.6521524", "0.637107", "0.61719006", "0.6156149", "0.6097175", "0.6057683", "0.6049324", "0.60151076", "0.6001847", "0.5965626", "0.5964531", "0.59609574", "0.5958571", "0.595745", "0.595745", "0.595745", "0.595745", "0.593711", "0.59348583", "0.59146374", "...
0.5784885
43
d3's enter/update/exit strategy as to be less destructive on the text content.
function textWrap (text) { var getText = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (d) { return d.label; }; var getCount = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : Infinity; var getAnchor = arguments.length > 3 && arguments[3] !== undefined ? arg...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function update(data) {\n\n // data join\n var text = svg.selectAll(text).data(data);\n\n //update\n text.attr(\"class\", \"update\");\n\n //enter\n text.enter().append(\"text\")\n .attr(\"class\", \"enter\")\n .attr(\"x\", function(d, i) { return i * 32 }) // cuz it's a monospaced font\n .att...
[ "0.6955732", "0.69524825", "0.6407582", "0.6396974", "0.60667324", "0.60634804", "0.60632807", "0.5994586", "0.5991995", "0.5938188", "0.5934237", "0.58749026", "0.5852199", "0.578398", "0.57784957", "0.5714381", "0.56976116", "0.56886876", "0.5688207", "0.5681052", "0.568078...
0.0
-1
This isn't used very frequently because it causes problems with event rebinding namely double click events.
function textWrapPX (text) { var width = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Infinity; text.each(function () { var text = d3Selection.select(this), words = text.text().split(/\s+/).reverse(), word, line = [], lineNumber = 0, lineHeight = 1....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onDoubleClick(e) {}", "addHandlers() {\n this.onDoubleClick = this.onDoubleClick.bind(this);\n document.addEventListener(\"dblclick\", this.onDoubleClick);\n }", "cleanMe() {\n this.DOM.el.removeEventListener(\n \"dblclick\",\n this.dblclickHandler.bind(this),\n ...
[ "0.63234276", "0.6308841", "0.61993355", "0.6163352", "0.6138446", "0.6115382", "0.60645044", "0.6056696", "0.60526294", "0.6051818", "0.60433084", "0.60404384", "0.6036144", "0.60286945", "0.6023413", "0.6011384", "0.60091555", "0.59868985", "0.5967515", "0.5927278", "0.5921...
0.0
-1
get specific set of properties in case of recursive
function getProperties(d) { return { innerRadius: arc.innerRadius()(d), outerRadius: arc.outerRadius()(d), startAngle: arc.startAngle()(d), endAngle: arc.endAngle()(d), rotate: rotate(d) || 0 }; } // if context is not a transition just render the centroid and update current
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deep_property(keys){\n return chained(_.map(keys, property));\n }", "FindPropertyRelative() {}", "function deepField(data,propertyPath,propertySearch,propertySearchDepth){var ret=null,i=void 0,copyPropertyPath=void 0,itemValue=void 0,parameter=void 0,newPropertySearchDepth=-1;// Check if the max-s...
[ "0.62558365", "0.60094476", "0.59613156", "0.5958885", "0.5877555", "0.58513457", "0.5815577", "0.5814216", "0.58058673", "0.5788268", "0.5788268", "0.56901723", "0.5648447", "0.56454504", "0.5605467", "0.55993444", "0.5589017", "0.5570578", "0.55243266", "0.55210304", "0.552...
0.0
-1
Work around for JavaScripts ||= operator. Only undefined will be construed as falsy.
function oreqUndefined () { var truthy = function truthy(v) { return v !== undefined; }; for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } var val = args.filter(truthy)[0]; return truthy(val) ? val : undefined; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "set None(value) {}", "set None(value) {}", "set None(value) {}", "set None(value) {}", "isAbsent() {\n return \"undefined\" == typeof this.value || null == this.value;\n }", "function isNullOrUndefined(value){return value===null||value===undefined;}", "isNotDefined(val) {\n return val ==...
[ "0.63901913", "0.63901913", "0.63901913", "0.63901913", "0.6357153", "0.63235366", "0.6259823", "0.6258426", "0.6194728", "0.6143253", "0.6129637", "0.6126794", "0.6126794", "0.6126794", "0.6126794", "0.6103709", "0.609616", "0.6061515", "0.605901", "0.60584635", "0.6057032",...
0.6191738
9
some datum and d3.stack configuration.
function stack () { var $$ = {}; var stack = function stack(datum) { var _this = this; var original = datum; // for simplicity map datum to just array of values arrays datum = datum.map($$.values); // format values to be in the form // [ // {x_1: y_1, x_2: y_2, .. }, // {x_1: y_1, x_2...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setup() {\n\n\t\t\t\t\t// Set up our formatter. If the type of the timeline is numeric, then it's just the\n\t\t\t\t\t// identity. Otherwise it will use the dateService format.\n\t\t\t\t\tformat = null;\n\t\t\t\t\tdimFormat = null;\n\n\t\t\t\t\tif(type !== 'numeric') {\n\t\t\t\t\t\tformat = dateService.fo...
[ "0.6157079", "0.5804101", "0.5769711", "0.5611051", "0.5603785", "0.5603785", "0.5603785", "0.5570215", "0.5549719", "0.54888403", "0.54751056", "0.54616475", "0.54346406", "0.54268366", "0.53840923", "0.53731656", "0.5368771", "0.5358534", "0.53392005", "0.5338312", "0.53153...
0.6476968
0
Padding can either be a constant or an object containing any of the attributes (left, right, top, bottom). cleanPadding returns an object with (left, right, top, bottom) attributes.
function cleanPadding(pad) { var padding = { top: 0, left: 0, right: 0, bottom: 0 }; if (typeof pad === 'number') return { top: pad, left: pad, right: pad, bottom: pad }; ['top', 'bottm', 'right', 'left'].forEach(function (d) { if (pad[d]) paddin...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function unpackPadding(value) {\r\n if (typeof(value) === \"number\")\r\n value = [value];\r\n if (value.length === 1) {\r\n return {top: value[0], right: value[0], bottom: value[0], left: value[0]};\r\n }\r\n if (value.length === 2) {\r\n return {top: value[0], right: value[1], bottom: ...
[ "0.6536797", "0.62730473", "0.62678224", "0.62678224", "0.6217437", "0.6058912", "0.59437704", "0.5893004", "0.5827", "0.5772287", "0.5633726", "0.56332934", "0.5628063", "0.5600264", "0.55456537", "0.55257803", "0.5466142", "0.5457138", "0.53673625", "0.53661567", "0.5342759...
0.8303555
0
size is derived from the bounding client rectangle.
function cleanSize(s, box) { return { width: s && s.width > 0 ? s.width : box.width, height: s && s.height > 0 ? s.height : box.height }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_updateSize() {\n this._size = this._bottomRight.$subtract(this._topLeft).abs();\n this._updateCenter();\n }", "get size() {\n return this._size;\n }", "get size() {\n return this._size;\n }", "get size() {\n\t\treturn wm.get(this).size;\n\t}", "get size...
[ "0.68945634", "0.6876309", "0.6876309", "0.68724614", "0.68190616", "0.68190616", "0.67928714", "0.6742139", "0.6742139", "0.673111", "0.66960436", "0.66807586", "0.6623174", "0.6575646", "0.6553033", "0.655245", "0.6539638", "0.65036005", "0.6462503", "0.64399403", "0.643694...
0.0
-1
Returns the specified object, omit the properties with keys matching those in the specified keys array.
function omit(obj, keys) { var newObj = {}; for (var k in obj) { if (typeof obj[k] !== 'function') { if (keys.indexOf(k) < 0) newObj[k] = obj[k]; } } return newObj; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function omit(obj, var_keys){\n\t var keys = typeof arguments[1] !== 'string'? arguments[1] : slice(arguments, 1),\n\t out = {};\n\n\t for (var property in obj) {\n\t if (obj.hasOwnProperty(property) && !contains(keys, property)) {\n\t out[property] = obj[property...
[ "0.79701793", "0.7901919", "0.7774661", "0.73152554", "0.71871793", "0.71763706", "0.7038685", "0.70269287", "0.70269287", "0.69901973", "0.6966854", "0.6844807", "0.6803469", "0.6724341", "0.67167157", "0.67167157", "0.67167157", "0.67167157", "0.67167157", "0.67167157", "0....
0.7560505
3
TODO: Clean up symbols.
function point () { var $$ = {}; /* Update Function */ var point = function point(context) { var selection = context.selection ? context.selection() : context; // point background var back = selection.selectAll('path.d2b-point-back').data(function (d) { return [d]; }); back.enter().append(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SimpleSymbols(str) { \n}", "function Symbol() {\n}", "function getSymbol() {return symbolField().value}", "function LexSym() {\r\n}", "function _symbolCoerce() {\n return exports.PREFIX.symbol;\n}", "function StackSymbol() {\r\n}", "function IsSymbol(x) {\n\t return typeo...
[ "0.6656493", "0.6490928", "0.64276963", "0.6349418", "0.63095564", "0.6300523", "0.6278791", "0.6248437", "0.62288713", "0.6163492", "0.61289704", "0.6071798", "0.6071798", "0.6071798", "0.6071798", "0.6071798", "0.6071798", "0.6071798", "0.6048619", "0.6043385", "0.60309434"...
0.0
-1
quick implementation of shallow object clone
function clone(obj) { if (null == obj || "object" != _typeof(obj)) return obj; var copy = obj.constructor(); for (var attr in obj) { if (obj.hasOwnProperty(attr)) copy[attr] = obj[attr]; } return copy; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clone(a) {if (!a) return a;var c, b = [Number, String, Boolean];if (b.forEach(function(b) { a instanceof b && (c = b(a)); }), \"undefined\" == typeof c) if (\"[object Array]\" === Object.prototype.toString.call(a)) c = [], a.forEach(function(a, b, d) { c[b] = clone(a); }); else if (\"object\" == typeof a)...
[ "0.7701513", "0.75854355", "0.75341517", "0.7525191", "0.7492998", "0.74679023", "0.74584866", "0.7430221", "0.7430221", "0.7417709", "0.74157697", "0.7411796", "0.7401704", "0.7397044", "0.739391", "0.739391", "0.739391", "0.739391", "0.7389963", "0.73774", "0.7375998", "0...
0.0
-1
custom stacker build out that separates the negative and possitive bars
function buildOut(stackIndex) { var offsets = {}; return function (d, y0, y1, x) { var offset = offsets[x] = offsets[x] || [0, 0]; d.dy = y1 - y0; d.stackIndex = stackIndex; d.base = x; if (d.dy > 0) d.extent = [offset[0], offset[0] += d.dy];else d.extent = [offset[1], offset[1] +=...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createStackedBars() {\n //manipulate chart data\n chart.data.forEach(function(d) {\n //set first y value\n var y0 = 0;\n\n //set series\n d.values = axis.serieNames.map(function(name) {\n //set value objec...
[ "0.64396155", "0.6307472", "0.63055116", "0.6249217", "0.6185869", "0.6009423", "0.596065", "0.5946827", "0.5906084", "0.5845829", "0.5841065", "0.5813765", "0.5795712", "0.5708932", "0.5708932", "0.5663876", "0.56496406", "0.5613805", "0.558556", "0.5580922", "0.55564725", ...
0.5084802
61
propagate expanded state to child tree
function propagateExpanded(data, state) { data.data.expanded = state; data.children.forEach(function (child) { return propagateExpanded(child, state); }); } // Position all bubble indicators to be next to each other.
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onNodeExpand(parentRecord) {\n return this.internalToggleTreeSubRecords(parentRecord, true);\n }", "function expandTree(d) {\n if (d._children) {\n d.children = d._children;\n d._children = null;\n }\n if (d.children) {\n d.children.forEach(expandTree);\n }\n }...
[ "0.70507085", "0.6861082", "0.67355555", "0.6713055", "0.67072433", "0.66875225", "0.6667292", "0.66641784", "0.66470253", "0.6621188", "0.65936595", "0.6560573", "0.6515962", "0.6488815", "0.6457359", "0.6452625", "0.64315546", "0.64315546", "0.641069", "0.6371202", "0.63679...
0.73146534
0
TODO: Clean up plane build workflow plane svg generator
function plane () { var $$ = {}, labelPad = 5; /* Update Function */ var plane = function plane(context) { var selection = context.selection ? context.selection() : context; selection.each(function (d, i) { // get plane props var size = $$.size.call(this, d, i) || { width: 960, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createPlanePath(){\n\tTweenMax.killTweensOf(gameData.targetPlane);\n\t\n\tgameData.targetPlane.path = [];\n\tgameData.targetPlane.runwayNum = -1;\n\tgameData.targetPlane.runwayGuide = -1;\n\tgameData.targetPlane.runwayGuidePlane = -1;\n\tgameData.targetPlane.runwayType = -1;\n\tgameData.targetPlane.pathed...
[ "0.61173856", "0.60713124", "0.60115916", "0.5926913", "0.58404565", "0.5837895", "0.58107156", "0.57993597", "0.5791942", "0.5763231", "0.57160133", "0.5668019", "0.56612456", "0.5652009", "0.562089", "0.56176126", "0.5592188", "0.55811685", "0.55765593", "0.5569247", "0.555...
0.5636622
14
d2b.chartPieAdvanced(chart, datum) configures the input chart and formats a returned datum set
function chartPieAdvanced (chart, datum) { var legendConfig = datum.legend || {}; var tooltipConfig = datum.tooltip || {}; // Chart Config chart.label(function (d) { return d.label; }).value(function (d) { return d.value; }).duration.conditionally(datum.duration).donutRatio.conditionally(datum.donutR...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawpiechart(data){\n condition['otherdata']['data']['pie-chart'] = data;\n var widthp = $(\"#exTab1\").width();\n var heightp = $(\"#exTab1\").height() * 0.9;\n var donut = donutChart()\n .width(widthp)\n .height(heightp)\n .cornerRadius(3) // sets how rounded the corners are on each s...
[ "0.650572", "0.6440688", "0.6337666", "0.6286701", "0.6260747", "0.62485486", "0.61590236", "0.6150748", "0.611256", "0.61059886", "0.61045074", "0.6101963", "0.6074527", "0.6072262", "0.6065228", "0.60649186", "0.6056324", "0.60426575", "0.6036101", "0.5978623", "0.5966198",...
0.8137996
0
d2b.chartPie() returns a d2b pie chart generator
function pie () { var $$ = {}; var chart = function chart(context) { context.call($$.chartFrame); // make sure pie, arc, and legend accessors are defined properly $$.pie.value($$.value).color($$.color).key($$.key); $$.legend.html($$.label).key($$.key).color($$.color); $$.tooltip.color(function (d)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generatePieChart() {\n var pieChartOutline = {\n \t\"header\": {\n \t\t\"title\": {\n \t\t\t\"text\": \"Inheritance\",\n \t\t\t\"fontSize\": 20,\n \t\t\t\"font\": \"Helvetica Neue\",\n // \"font-weight\": \"bold\",\n \t\...
[ "0.7356631", "0.6826236", "0.68146026", "0.6806826", "0.6740251", "0.67265445", "0.66838056", "0.6671698", "0.6628161", "0.6626274", "0.65858716", "0.6585145", "0.65607107", "0.65516293", "0.65346974", "0.65240717", "0.651244", "0.65101594", "0.65070224", "0.6500211", "0.6480...
0.6904924
1
d2b.chartPieAdvanced(chart, datum) configures the input chart and formats a returned datum set
function chartAxisAdvanced (chart, datum) { var legendConfig = datum.legend || {}; var tooltipConfig = datum.tooltip || {}; // Chart Config chart.duration.conditionally(datum.duration).graphColor.proxy(function (graph) { return graph.color || functor(datum.graphColor)(graph); }).groupColor.proxy(function (...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function chartPieAdvanced (chart, datum) {\n var legendConfig = datum.legend || {};\n var tooltipConfig = datum.tooltip || {}; // Chart Config\n\n chart.label(function (d) {\n return d.label;\n }).value(function (d) {\n return d.value;\n }).duration.conditionally(datum.duration).donutRatio.conditionally...
[ "0.81384456", "0.6506996", "0.64415485", "0.63375837", "0.628712", "0.62602276", "0.6248535", "0.61596394", "0.6150044", "0.61122066", "0.6106431", "0.610471", "0.61017525", "0.60752314", "0.6072441", "0.6064886", "0.606487", "0.6057855", "0.6042836", "0.60356295", "0.5979270...
0.58768886
29
d2b.chartSankeyAdvanced(chart, datum) configures the input chart and formats a returned datum set
function chartSunburstAdvanced (chart, datum) { var breadcrumbsConfig = datum.breadcrumbs || {}; var tooltipConfig = datum.tooltip || {}; // Chart Config chart.label(function (d) { return d.label; }).outerRadius.conditionally(datum.outerRadius, function (d, w, h) { return functor(datum.outerRadius)(w, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function chartSankeyAdvanced (chart, datum) {\n var nodeConfig = datum.node || {};\n var linkConfig = datum.link || {};\n var nodeTooltipConfig = nodeConfig.tooltip || {};\n var linkTooltipConfig = linkConfig.tooltip || {}; // Chart Frame Config\n\n chart.chartFrame().chartPadding(0).size.conditionally(datum....
[ "0.7914508", "0.6019504", "0.5684335", "0.5678419", "0.56314117", "0.55600274", "0.5525957", "0.55062747", "0.53730595", "0.53567517", "0.53118056", "0.5215878", "0.5206403", "0.5146702", "0.49486428", "0.49187255", "0.49019969", "0.48520163", "0.4799792", "0.47767627", "0.47...
0.5870423
2
d2b.chartSunburst() returns a d2b sunburst chart generator
function sunburst () { var $$ = {}; // chart updater var chart = function chart(context) { context.call($$.chartFrame); // configure sunburst $$.sunburst.label($$.label).color($$.color); // configure breadcrumbs $$.breadcrumbs.color(function (d) { return $$.color(d.data); }).key(function (d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createSunburst(d) {\n // console.log(\"createsunburst\")\n // console.log(d)\n var clicked_country = ($.grep(data, function(e) { return e.country == d.id; }))[0];\n if (GeoMenu.getDisplayIP() == \"source\") {\n if (clicked_country.attacked_sb_filter == 0) return;\n ...
[ "0.7169241", "0.7070139", "0.6980203", "0.68210655", "0.6753588", "0.67192453", "0.6711887", "0.65405375", "0.6453401", "0.6450347", "0.63915044", "0.6328054", "0.62913704", "0.6154936", "0.60459054", "0.6000354", "0.5977698", "0.5964106", "0.5957873", "0.58713114", "0.583122...
0.80998695
0
d2b.chartSankeyAdvanced(chart, datum) configures the input chart and formats a returned datum set
function chartSankeyAdvanced (chart, datum) { var nodeConfig = datum.node || {}; var linkConfig = datum.link || {}; var nodeTooltipConfig = nodeConfig.tooltip || {}; var linkTooltipConfig = linkConfig.tooltip || {}; // Chart Frame Config chart.chartFrame().chartPadding(0).size.conditionally(datum.size).paddi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sankey(options) {\n //remove legend\n if (options.legend) {\n options.legend.enabled = false;\n } else {\n options.legend = {\n enabled: false\n };\n }\n\n //declare needed variables\n let diagram = eve.initVis(optio...
[ "0.60168135", "0.58712274", "0.5677973", "0.56716675", "0.5629675", "0.5555269", "0.5523318", "0.5501467", "0.5375653", "0.53580517", "0.53174984", "0.5217361", "0.52028257", "0.5148039", "0.49504608", "0.4915883", "0.49055862", "0.48468128", "0.4801813", "0.4771778", "0.4717...
0.7911915
0
Create gradient function to generate the background
function setGradient(x, y, w, h, c1, c2, axis) { noFill(); if (axis == Y_AXIS) { // Top to bottom gradient for (var i = y; i <= y+h; i++) { var inter = map(i, y, y+h, 0, 1); var c = lerpColor(c1, c2, inter); stroke(c); line(x, i, x+w, i); } } else if (axis == X_AXIS) { // L...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createBackgroundGradient() {\n backGrad.addColor(color(0, 6, 65), 0.0)\n backGrad.addColor(color(255, 137, 0), 0.15)\n backGrad.addColor(color(0, 231, 255), 0.35)\n backGrad.addColor(color(0, 231, 255), 0.65)\n backGrad.addColor(color(255, 137, 0), 0.85)\n backGrad.addColor(color(0, 6, 6...
[ "0.83462197", "0.7409247", "0.73909897", "0.72037977", "0.719935", "0.70502985", "0.7016428", "0.6955768", "0.6900131", "0.6869317", "0.6815923", "0.67827314", "0.6765662", "0.67472684", "0.67472684", "0.6714323", "0.6678166", "0.6673402", "0.6667218", "0.6655947", "0.661981"...
0.0
-1
right dummy code for sign in / create account buttons for now, just send us to the home page
async function onLoginClick() { await axios .post('/login', { username, password, }) .then((res) => { console.log(res); if (res.data === 'success') { setIsLoggedIn(true); //redirect us } else { // throw component error setIsLogg...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "signIn() {}", "goToSignupPage() {\n Linking.openURL('https://signup.sbaustralia.com');\n //Actions.signup();\n }", "logInOrSignUp() {\n if (this.state.pageName === 'LOG IN') {\n this.sendFormToLogIn();\n } else {\n this.sendFormToSignUp();\n }\n }", "funct...
[ "0.7206146", "0.700458", "0.69141716", "0.6890164", "0.6765338", "0.6748501", "0.67313075", "0.6673344", "0.66711885", "0.66702884", "0.6637657", "0.6634858", "0.65891385", "0.65889686", "0.6561506", "0.6553984", "0.655116", "0.6548228", "0.6545032", "0.6527838", "0.6517113",...
0.0
-1
Function that rerenders all loaded items
function renderDays() { //Clear items inside the day view svg.remove(gDayView); gDayView = svg.group(gDayViewOuterGroup, {transform: "translate(" + (border + timeWidth) + "," + header + ")"}); //Add day groups for(var deltaDay = 0; deltaDay < numDays; deltaDay++) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadAndRenderItems() {\n pageData().then(render)\n }", "_renderItems() {\n this.views.forEach(function(view) {\n view.remove();\n });\n this.views = [];\n this.$listBody.empty();\n\n this.model.collection.each(item => {\n this._addItem(item, ite...
[ "0.67986476", "0.6699664", "0.6615852", "0.6574962", "0.657087", "0.65315855", "0.65010935", "0.6491061", "0.64848286", "0.6482002", "0.64611316", "0.64497536", "0.6362376", "0.6327531", "0.6299609", "0.6283066", "0.62631214", "0.62631214", "0.62631214", "0.6252462", "0.62511...
0.0
-1
increment counter of current cat
incrementCounter() { model.currentCat.clickCount++; catView.render(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function incrementCounter() {\n setCounter(counter + 1);\n }", "function incrementCounter () {\r\n counter ++;\r\n console.log('counter', counter);\r\n }", "function incrementCounter () {\n counter ++;\n console.log('counter', counter);\n }", "function incrementCounter () {\n counter ++;...
[ "0.7503699", "0.7345569", "0.7288573", "0.7288573", "0.7288573", "0.7228313", "0.70925736", "0.706548", "0.70065653", "0.69146526", "0.6818543", "0.67957944", "0.67927665", "0.67529106", "0.6680894", "0.6665096", "0.66006213", "0.6599449", "0.65961623", "0.6590046", "0.651616...
0.81754786
0
webpackBootstrap install a JSONP callback for chunk loading
function webpackJsonpCallback(data) { /******/ var chunkIds = data[0]; /******/ var moreModules = data[1]; /******/ var executeModules = data[2]; /******/ /******/ // add "moreModules" to the modules object, /******/ // then flag all "chunkIds" as loaded and fire callback /******/ var moduleId, chunkId, i =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/\n/******/ \t\tvar prefetchChunks = data[3] || [];\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/****...
[ "0.77740824", "0.7584461", "0.7549214", "0.7549214", "0.7549214", "0.7549214", "0.7549214", "0.7549214", "0.7549214", "0.7549214", "0.7549214", "0.7549214", "0.7549214", "0.7549214", "0.7549214", "0.7549214", "0.7549214", "0.7549214", "0.7537586", "0.7537586", "0.7522305", ...
0.0
-1
[TODO] IMPLEMENT THIS FUNCTION When the webpage loads, the web browser will call this function. Randomly determine whether to show "male" stars or "female" stars
function display_default() { // YOUR CODE GOES HERE let random_num = Math.floor(Math.random() * 2); // console.log(random_num); let gender_list = stars_dataset[random_num]; // console.log(gender_list); gender_list = Object.entries(gender_list); let count = 0; for(person of gender_lis...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getRandom() {\n\t\tvar affirmations = JSON.parse(sessionStorage.getItem(\"affirmationsList\"));\n\t\t//console.log(affirmations);\n\t\t//console.log(sessinStorage.getItem('affirmationsList'));\n\t\n\t\t//var affirmations = ['Strive For Greatness', 'I feel good today', 'I got this'];\n\t\tvar randomNumber ...
[ "0.64326084", "0.63514584", "0.61058605", "0.60454744", "0.59990394", "0.5956266", "0.5924832", "0.5915524", "0.59034854", "0.5878887", "0.5839647", "0.5820335", "0.58138895", "0.5811657", "0.5793866", "0.5758333", "0.57007384", "0.5688983", "0.56805927", "0.5677619", "0.5676...
0.61947465
2
[TODO] IMPLEMENT THIS FUNCTION When "Show Male Stars" button is clicked, the web browser calls this function.
function show_male_stars() { // YOUR CODE GOES HERE let gender_list = stars_dataset[0]; // console.log(gender_list); gender_list = Object.entries(gender_list); let count = 0; for(person of gender_list){ console.log(person); let new_website_link = person[1][2]; // conso...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showStars() {\n for (var i = 0; i < stars.length; i++) {\n stars[i].style.visibility = \"visible\";\n }\n}", "function ShowStars(numOfStars) {\n // First call hide to remove all stars.\n HideStars(3);\n\n for (let i = 0; i < numOfStars; i++) {\n if (stars[i].childNodes[0].cl...
[ "0.6427028", "0.6302179", "0.6212325", "0.60966176", "0.6011758", "0.59335524", "0.58856595", "0.583888", "0.57534593", "0.57533026", "0.57501286", "0.57474905", "0.57451856", "0.57251704", "0.5724687", "0.5718931", "0.5716753", "0.57164365", "0.57131094", "0.5709762", "0.567...
0.0
-1
[TODO] IMPLEMENT THIS FUNCTION When "Show Female Stars" button is clicked, the web browser calls this function.
function show_female_stars() { // YOUR CODE GOES HERE let gender_list = stars_dataset[1]; // console.log(gender_list); gender_list = Object.entries(gender_list); let count = 0; for(person of gender_list){ console.log(person); let new_website_link = person[1][2]; // con...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showHoodies()\n{\n\t//show all items with theid 'hoodies'\n\tdocument.getElementById('hoodies').style.display = \"block\";\n\t//hide all other items\n\tdocument.getElementById('hats').style.display = \"none\";\n\tdocument.getElementById('accessories').style.display = \"none\";\n\tdocument.getElementById('...
[ "0.61135423", "0.60287493", "0.6011875", "0.59797794", "0.59205663", "0.588739", "0.5863188", "0.5849043", "0.58340615", "0.57609296", "0.57206184", "0.5713234", "0.571147", "0.57046807", "0.5692011", "0.56664234", "0.5629714", "0.56173915", "0.56008077", "0.55959946", "0.559...
0.5892745
5
A method that can be exported for a Google cloud function
handleRequest(req, res) { if (req.method == 'GET') { this.handleGet.bind(this)(req, res); } else if (req.method == 'POST') { this.handlePost.bind(this)(req, res); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function FunctionUtils() {}", "function wrap(scloud) { // scloud will be either sigfox-gcloud or sigfox-aws, depending on platform.\n // Wrap the module into a function so that all we defer loading of dependencies,\n // and ensure that cloud resources are properly disposed. For AWS, wrap() is called after\...
[ "0.56992334", "0.56669635", "0.563155", "0.5631384", "0.55835694", "0.55509186", "0.5542542", "0.5542542", "0.5530218", "0.5501705", "0.5470359", "0.546749", "0.54455376", "0.5445196", "0.5445196", "0.5417876", "0.541777", "0.5392329", "0.5390238", "0.5359892", "0.5323483", ...
0.0
-1
GET /webhook Handles Messenger verification calls
handleGet(req, res) { let mode = req.query['hub.mode']; let token = req.query['hub.verify_token']; let challenge = req.query['hub.challenge']; if (mode && token) { if (mode === 'subscribe' && token === this.verifyToken) { console.log('WEBHOOK_VERIFIED'); res.status(200).send(chall...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "hubVerification () {\n let verifyToken = this.config.chennels.facebook.verify_token\n this.webserver.get(this.config.webhook_uri, function (req, res) {\n\n // This enables subscription to the webhooks\n if (req.query['hub.mode'] === 'subscribe' && req.query['hub.verify_token'] =...
[ "0.71227086", "0.6785086", "0.6689677", "0.6646855", "0.64931685", "0.6257719", "0.6223634", "0.61484313", "0.61315525", "0.612303", "0.5992205", "0.59621644", "0.59520537", "0.59450096", "0.58885235", "0.58504087", "0.5842338", "0.5816744", "0.57896715", "0.57887924", "0.576...
0.6531141
4
POST /webhook Handles webhook events from Messenger
handlePost(req, res) { let body = req.body; console.log("%j", body) if (body.object === 'page') { body.entry.forEach((entry) => { let webhook_event = entry.messaging[0]; let sender_psid = webhook_event.sender.id; let context = { send: this.sendResponse.bind(this, se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handlePostback() {\n console.log(\"---------Llamando a HandlePostBack----------\");\n\n let postback = this.webhookEvent.postback;\n // Check for the special Get Starded with referral\n let payload;\n if (postback.referral && postback.referral.type == \"OPEN_THREAD\") {\n payload = postback.ref...
[ "0.6733758", "0.67128974", "0.6704338", "0.66919035", "0.66257393", "0.6617363", "0.6608591", "0.65292066", "0.65192306", "0.6518987", "0.64770806", "0.6387387", "0.63780314", "0.630806", "0.6301359", "0.6277909", "0.62584174", "0.625701", "0.62519133", "0.6207436", "0.617849...
0.6633543
4
helper fn to remove html if no user found
function clearCurrentUsers() { users.innerHTML = '' }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeUserFromDom( userId ) {\n $(`.user-name-object[data-id=\"${userId}\"]`).remove();\n }", "function UserNameReplace() {\n if(typeof(disableUsernameReplace) != 'undefined' && disableUsernameReplace || wgUserName == null) return;\n $('.insertusername').html(wgUserName); }", "function...
[ "0.64484775", "0.6337074", "0.6238628", "0.61456335", "0.6123205", "0.5944677", "0.59348", "0.59342897", "0.5905889", "0.5883605", "0.5872881", "0.58666945", "0.58369374", "0.58333284", "0.58258796", "0.5820573", "0.5817043", "0.5757", "0.57563764", "0.57524514", "0.5735155",...
0.5965463
5
2. Please write a function that filters out numbers from a list
function filterArray(arr) { return arr.filter(o => typeof o === 'number') }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function filter_list(l) {\n return l.filter(function(item) {\n return typeof(item) === 'number';\n });\n}", "function filter_list(l) {\n return l.filter( function filt(value){return typeof value === \"number\"});\n}", "function filter_list(l) {\n return l.filter(num => typeof num === 'number');\n}", "fun...
[ "0.7634034", "0.7618629", "0.7526126", "0.7485006", "0.74792093", "0.7168717", "0.71598506", "0.70724225", "0.70316184", "0.6961384", "0.6768462", "0.66273654", "0.65900016", "0.65423733", "0.6473864", "0.6423684", "0.64230967", "0.6416669", "0.6353448", "0.6351778", "0.62887...
0.60041595
45
3. Please write a function that shows the usage of closures
function a() { let name = 'Eugene'; return function() { console.log(name) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function seeClosure(x) {\n var x;\n return function(y) {\n return x * y\n }\n}", "function closureTest() {\n const increase = () => {\n let count = 0;\n\n const increment = function() {\n count++;\n console.log(count)\n };\n\n return increment;\n };\n\n const inc = increa...
[ "0.73552185", "0.71103185", "0.7031915", "0.7025442", "0.70011544", "0.69915724", "0.69682497", "0.694731", "0.69029206", "0.6887682", "0.6852081", "0.68193805", "0.6796601", "0.6767197", "0.67565924", "0.6748076", "0.66531795", "0.66442156", "0.6641495", "0.66060823", "0.660...
0.65832794
23
4. Please write a recursive function that flattens an list of items example input [[2, [4, [44,5,6]]], [4,5,6], [[2,4], 4], 5]] example output [2, 4, 44, 5, 6, 4, 5, 6, 2, 4, 4, 5] There is a typo in the condition: the input parameters have an extra closing parenthesis at the very end
function flatten(arr) { let result = []; arr.forEach(o => { if (Array.isArray(o)) result.push(...flatten(o)) else result.push(o) }); return result }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function flattenNestedLists(list) {\n\tvar flatList = [];\n\tvar recursiveFlattener = function(list) {\n\t\tfor (var i = 0; i < list.length; i++) {\n\t\t\tif(typeof list[i] !== 'object'){\n\t\t\t\tflatList.push(list[i])\n\t\t\t} else {\n\t\t\t\trecursiveFlattener(list[i])\n\t\t\t}\n\t\t}\t\n\t}\n\trecursiveFlatten...
[ "0.71944964", "0.6647936", "0.6635879", "0.6572463", "0.65162027", "0.65162027", "0.6492437", "0.64888924", "0.6452555", "0.6452555", "0.64469665", "0.6370627", "0.6357216", "0.63549554", "0.63426185", "0.63391507", "0.63391507", "0.6318763", "0.6318763", "0.63131016", "0.630...
0.0
-1
5. Please write a function that finds all common elements of two arrays(only primitive types as array elements, order doesn't matter) example inputs ['b', 3, 4, 76, 'c'], ['a', 'b', 4, 76, 21, 'e'] example output ['b', 4, 76]
function commonElements(arr1, arr2) { let set1 = [...new Set(arr1)]; let set2 = [...new Set(arr2)]; return [...set1.filter(o => set2.includes(o))] }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function intersectArrays (a, b) {\n var sorteda = a.concat().sort()\n var sortedb = b.concat().sort()\n var common = []\n var ai = 0\n var bi = 0\n\n while (ai < a.length && bi < b.length) {\n if (JSON.stringify(sorteda[ai]) === JSON.stringify(sortedb[bi])) {\n common.push(sorteda[ai])\n ai++\n ...
[ "0.805644", "0.7807232", "0.77484727", "0.7674981", "0.767237", "0.7480489", "0.7341617", "0.7264386", "0.72356313", "0.7168022", "0.7147215", "0.71447515", "0.7120225", "0.7111188", "0.71088535", "0.7081342", "0.7068363", "0.70647794", "0.70420563", "0.7039117", "0.69804883"...
0.8024666
1
6. Please write a function that finds all different elements of two arrays(only primitive types as array elements, order doesn't matter) example inputs ['b', 3, 4, 76, 'c'], ['a', 'b', 4, 76, 21, 'e'] example output ['a', 3, 21, 'c', 'e']
function differentElements(arr1, arr2) { let set1 = [...new Set(arr1)]; let set2 = [...new Set(arr2)]; return [...set1.filter(o => !set2.includes(o)), ...set2.filter(o => !set1.includes(o))] }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function arr_diff(a,b){\r\n\tvar c=[];//clone of a\r\n\tvar d=[];//Anything a does not include\r\n\tvar e=[];//Anything a *does* include\r\n\tfor(var an of a){\r\n\t\tc.push(an);\r\n\t}\r\n\tfor(var bn of b){\r\n\t\tif(c.indexOf(bn)===-1)d.push(bn);\r\n\t\telse e.push(bn);\r\n\t}\r\n\tfor(var en of e){\r\n\t\tc.sp...
[ "0.7569988", "0.7561863", "0.74870867", "0.7444472", "0.7367933", "0.73600906", "0.734383", "0.7285463", "0.7281411", "0.7256076", "0.72481525", "0.7207482", "0.7202947", "0.71699786", "0.71695614", "0.7161085", "0.7146908", "0.7127232", "0.7119722", "0.7118758", "0.7105691",...
0.7477173
3
9. Please write a function that takes two arrays of items and returns an array of tuples made from two input arrays at the same indexes. Excessive items should be dropped. example input [1,2,3], [4,5,6,7] example output [[1,4], [2,5], [3,6]]
function getArrayTuple(arr1, arr2) { let result = []; for(let i = 0; i < arr1.length; i++) { if (arr2[i]) result.push([arr1[i], arr2[i]]) }; return result }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function unite(arr1, arr2, arr3) {\n newArray = [];\n \n for (var i = 0; i < arguments.length; i++) {\n var arrLength = arguments[i];\n \n for (var j = 0; j < arrLength.length; j++) {\n var indexValue = arrLength[j];\n\n ...
[ "0.6742654", "0.6707344", "0.66983324", "0.6402539", "0.63525504", "0.6334549", "0.63226765", "0.63154113", "0.62524617", "0.62342083", "0.6226884", "0.6225304", "0.62082136", "0.61825246", "0.6172171", "0.6158551", "0.6145867", "0.61316925", "0.6115919", "0.6114677", "0.6112...
0.73910004
0
Allows the player to quit
function endgame(){ $('#guess-box').prop('disabled', true) $('span.element').show(); $('#element-list').show(); $('.cell').not('.success').addClass('fail').removeClass('s d p f'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function quitGame() {\n let gameTab = document.querySelector(\"#punto input[name='punto-frame']:checked + .game\");\n if (gameTab) {\n let id = gameTab.dataset.gameid;\n sock.emit(\"punto\", { action: \"remove\", game: id, player: pseudo });\n }\n }", "function quitFunction(){\r\n\tgame.destr...
[ "0.73964465", "0.7374584", "0.7373823", "0.73618066", "0.7325376", "0.7280554", "0.70453393", "0.7017552", "0.69957393", "0.6974564", "0.69743097", "0.6957133", "0.69500536", "0.6946346", "0.6921811", "0.68822247", "0.6858022", "0.68501645", "0.68285245", "0.6737224", "0.6726...
0.0
-1
Restores select box and checkbox state using the preferences stored in chrome.storage.
function restore_options() { chrome.storage.sync.get({ isEnabled: true, language: "jp" }, function(items) { document.getElementById('enabled').checked = items.isEnabled; // Enable for multiple languages // document.getElementById('language').value = items.language; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function restore_options() {\n $('#options-list input[type=\"checkbox\"]').each(function() {\n var obj = {};\n var check = $(this);\n obj[$(this).attr('id')] = 1;\n chrome.storage.sync.get(obj,\n function(item) {\n $(\"#\" + check.attr('id')).prop(\"checked\", item[check.attr('id')]);\n ...
[ "0.81282336", "0.79564077", "0.79525673", "0.795252", "0.7810898", "0.78092647", "0.7784593", "0.7781314", "0.7736731", "0.7690695", "0.76806706", "0.76780784", "0.7668044", "0.7657366", "0.7645378", "0.76452255", "0.76380944", "0.76322347", "0.7630097", "0.76254493", "0.7601...
0.73912925
40
Add html tag generated by KSS to context Source: builder/base/kss_builder_base.js
prepareContext(context) { // Create the HTML to load the optional CSS and JS (if a sub-class hasn't already built it.) if (typeof context.styles === 'undefined') { context.styles = ''; for (let key in this.options.css) { if (this.options.css.hasOwnProperty(key)) { context.styles = context.styles + '...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function genFinalHtml() {\r\n ` </div> \r\n\r\n </body>\r\n </html`;\r\n}", "htmlForSpeed() {\nvar html;\n//-----------\nreturn html = `<!--========================================================-->\n<span class=\"spanSpeed av${this.ix}\" >\nSpeed (log<sub>2</sub> scale):\n${this.htmlForSpeedCtrl()}\n</span...
[ "0.5724023", "0.56869084", "0.55699027", "0.55502474", "0.5519507", "0.5516697", "0.54792225", "0.54532033", "0.5448013", "0.53992647", "0.5397852", "0.53939164", "0.5392995", "0.5367731", "0.5365281", "0.53633326", "0.5338859", "0.5307185", "0.5288855", "0.5280903", "0.52790...
0.5049619
51
Pass global dispatcher to parent class
constructor(dispatcher) { super(dispatcher); // All suggestions this.suggestions = new List(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "dispatcher(){ return this.dispatch.bind(this); }", "initialize(dispatcher) {\n this.dispatcher = dispatcher;\n }", "getDispatcher() { return _dispatch; }", "createDispatcher() {\n return new SimpleEventDispatcher_1.SimpleEventDispatcher();\n }", "createDispatcher() {\n return new SimpleEventDisp...
[ "0.73687726", "0.6735375", "0.66024244", "0.64566314", "0.64566314", "0.63813955", "0.63813955", "0.6330087", "0.6280142", "0.6269787", "0.6269787", "0.6255747", "0.6255747", "0.621638", "0.6106416", "0.61048794", "0.60825825", "0.6073584", "0.6049421", "0.6049421", "0.596274...
0.0
-1
================================ ENEMY METHODS Particle methods
fillParticles() { for (let i = 0; i < this.bloodNumber; i++) { let bloodParticle = new Particle(this) // creates a new particle object bloodParticle.color = '#00ff1050' bloodParticle.vector = HelperFunctions.newVector(HelperFunctions.random(HelperFunctions.random(2, -2), HelperFunctions.random(3, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Particle(x, y, xs, ys) {\n this.x=x;\n this.y=y;\n this.xs=xs;\n this.ys=ys;\n this.life=0;\n}", "function ArenaParticle(position, vector, size, type, lifespan, fadelength, colour)\r\n{\r\n this.position = position;\r\n this.vector = vector;\r\n this.size = size;\r\n this.type = type;\r\n ...
[ "0.7350162", "0.7320697", "0.7311377", "0.73030645", "0.72522444", "0.718424", "0.7174769", "0.7089116", "0.7064039", "0.6967617", "0.69582355", "0.6912687", "0.6912687", "0.68869567", "0.68867445", "0.68655807", "0.6850324", "0.6838259", "0.68254894", "0.68008745", "0.677668...
0.64782715
65
================================ Enemy life manipulation methods (don't look at me)
hit(damage) { this.color = this.hitColor this.life -= damage this.isHit = true this.showParticles() // when this enemy is hit, the particles are shown HelperFunctions.playAudio(this.hitVolume, "https://raw.githubusercontent.com/JoshMatthew/PeewPeew/master/assets/sfx/enemy-hit.mp3") }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Enemy(life, name, level){\n this.life = life;\n this.name = name;\n this.level = level;\n }", "function Enemy(img, x, y, speedX, speedY, width, height, name, life){\n\tthis.img = img;\n\tthis.x = x;\n\tthis.y = y;\n\n\tthis.width = width;\n\tthis.height = height;\n\n\tthis.speedX...
[ "0.7169611", "0.7068307", "0.704113", "0.6865549", "0.6842286", "0.68276566", "0.67665803", "0.6748035", "0.67378896", "0.6731404", "0.672365", "0.66911864", "0.6685371", "0.6685298", "0.6680243", "0.66760635", "0.6662132", "0.6657007", "0.6647795", "0.6620363", "0.6615657", ...
0.0
-1
================================= Enemy shooting mechanism
createBullets() { if (this.bullets.length < 2) { let blt = new Bullet() blt.pos.x = this.pos.x + (this.size.w / 2) // Centers the bullet starting point blt.pos.y = this.pos.y + (this.size.h / 2) // to the players body blt.color = '#00ff00' blt.damage = this.bulletDamage blt.vec...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function iShoot(enemy) {\n\n\t/* Consequences on the enemies */\n\tenemy.classList.remove(\"shooting\");\n\tenemy.classList.remove(\"showing\");\n\tenemy.classList.add(\"dead\");\n\tif([\"level1\", \"level2\"].indexOf(document.querySelector(\".level.current\").id) > -1) {\n\t\tsetTimeout(function() {\n\t\t\tenemyF...
[ "0.7940414", "0.7742898", "0.7586269", "0.7461376", "0.7436399", "0.7407121", "0.7379096", "0.7367146", "0.73402584", "0.73401594", "0.7328567", "0.7210034", "0.7178943", "0.71119064", "0.70761377", "0.7039648", "0.7024233", "0.7023708", "0.7022908", "0.7014386", "0.6961408",...
0.0
-1
================================= Enemy movements methods
isColliding(obj) { // checks if this object is colliding to another enemy // Nothing crazy here, just stoping when this object is near to another Enemy or to the Player let d = HelperFunctions.dist(this.pos, obj) if (obj.constructor.name === 'Player') { if (d < (obj.size.w * 5)) { this.stop() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "move() {\r\n this.y = this.y + Enemy.v;\r\n }", "function moveEnemy(){\n for(var i =0;i<total.length;i++){\n \n var x =player.centerX-total[i].x;\n var y=player.centerY-total[i].y;\n total[i].body.velocity.x=enemySpeed*x/Math.hypot(x,y);\n t...
[ "0.7949287", "0.750375", "0.74555874", "0.73938733", "0.7374831", "0.73198664", "0.72763103", "0.72663075", "0.72312886", "0.7206164", "0.7169357", "0.7161504", "0.7158106", "0.7112298", "0.7070316", "0.70677966", "0.70552045", "0.7011088", "0.6977326", "0.6969832", "0.695580...
0.0
-1
================================= Enemy wants to show to the canvas methods
draw() { ctx.fillStyle = this.color ctx.shadowColor = this.color ctx.shadowBlur = 30 ctx.fillRect(this.pos.x, this.pos.y, this.size.w, this.size.h) if (this.color === this.hitColor) { setTimeout(() => { this.color = this.defaultColor // sets the color of the enemy to normal after 100 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function on_paint()\n{\n var scoped = entity_get_prop(entity_get_local_player(), \"CCSPlayer\", \"m_bIsScoped\");\n\n if (ui_is_menu_open() || !entity_is_alive(entity_get_local_player()) || !entity_get_local_player()) return;\n ui_set_value(\"Visual\", \"SELF\", \"Chams\", \"Configure\", 0);\n ui_set_v...
[ "0.68235356", "0.6690491", "0.6648709", "0.6584394", "0.65481824", "0.6544663", "0.6534544", "0.65326726", "0.652632", "0.65132725", "0.64779186", "0.6449435", "0.6405548", "0.6404821", "0.6397457", "0.63781357", "0.63517183", "0.6338772", "0.63360023", "0.62909704", "0.62842...
0.0
-1
query headset infor connect to headset with control device request authentication and get back auth token create session and get back session id
async querySessionInfo(){ let headsetId="" await this.queryHeadsetId().then((headset)=>{headsetId = headset}) this.headsetId = headsetId let ctResult="" await this.controlDevice(headsetId).then((result)=>{ctResult=result}) this.ctResult = ctResult console.log(ctResult) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async createSessionDeviceAuth() {\n const token = await this.getOAuthToken(false, '', true);\n if (token.error) return { success: false, error: token.error };\n\n return this.createDeviceAuthWithExchange(token);\n }", "initLogin() {\n this.send({\n id: 10000,\n magic: '0x1234',\n meth...
[ "0.59313893", "0.5545121", "0.5490161", "0.548463", "0.548351", "0.5468502", "0.5393488", "0.5372577", "0.5364632", "0.53463197", "0.53116935", "0.5310923", "0.5286094", "0.52653", "0.5240317", "0.52362746", "0.5229376", "0.51886344", "0.5179021", "0.51718724", "0.5169835", ...
0.72482854
0
check if user logined check if app is granted for access query session info to prepare for sub and train
async checkGrantAccessAndQuerySessionInfo(){ let requestAccessResult = "" await this.requestAccess().then((result)=>{requestAccessResult=result}) let accessGranted = JSON.parse(requestAccessResult) console.log(accessGranted) // check if user is logged in CortexUI if ("error" in a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async appMemberRequired(ctx, next) {\n const { service: { mysql } } = ctx;\n const user = ctx.user;\n const appId = ctx.query.appId || ctx.request.body.appId;\n const auth = await checkUserAppAuth(mysql, user, appId);\n if (auth) {\n await next();\n } else {\n ctx.body =...
[ "0.6319734", "0.60723865", "0.60662013", "0.6058011", "0.5986184", "0.594937", "0.59435546", "0.59384054", "0.5899751", "0.5896679", "0.5881312", "0.58414197", "0.58232147", "0.5804681", "0.5804239", "0.5799341", "0.57915074", "0.578564", "0.57835317", "0.57772213", "0.577394...
0.68464273
0
check login and grant access subcribe for stream logout data stream to console or file
sub(streams){ this.socket.on('open',async ()=>{ await this.checkGrantAccessAndQuerySessionInfo() this.subRequest(streams, this.authToken, this.sessionId) this.socket.on('message', (data)=>{ // log stream data to file or console here // console.log(JSON.par...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleLogout(){\n /**\n * Send request to backend\n */\n request.user.logout(function(result) {\n console.log(result);\n if (result === constants.RESPONSE_CODES.SUCCESS) {\n /**\n * Reset on success\n */\n request.user.dataSources = [\n {\n ...
[ "0.60344446", "0.5953086", "0.5834115", "0.579744", "0.5793908", "0.5756586", "0.57494956", "0.5722258", "0.5720049", "0.57183367", "0.5695149", "0.56905746", "0.5687032", "0.5685879", "0.5673187", "0.5671999", "0.567153", "0.564611", "0.56117105", "0.55785114", "0.5554544", ...
0.0
-1
Examples: productOfArray([1,2,3]) // 6 productOfArray([1,2,3,10]) // 60
function productOfArray(arr) { if (!arr.length) return 0; if (arr.length === 1) return arr[0]; return arr.shift() * productOfArray(arr) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function productOfArray(arr) {\n \n}", "function productReduce(array) {\n return array.reduce((total, n) => { return total *= n});\n}", "function product(arr) {\n var sum = 1;\n\n for (var i = 0; i < arr.length; i++) {\n sum *= arr[i];\n }\n\n return sum;\n}", "function arrayMultiply (array1, arra...
[ "0.8510511", "0.810778", "0.7999496", "0.79654825", "0.7950626", "0.7946546", "0.7920028", "0.78029674", "0.77823746", "0.77742845", "0.7758674", "0.771438", "0.77015465", "0.7678203", "0.76639724", "0.7662678", "0.766218", "0.7655506", "0.76421577", "0.764159", "0.7634574", ...
0.7661133
17
var states = [ "_Q(o_o)__________;_________oQ(o_o)", "_Q(o_o)__________;________o_Q(o_o)", "_Q(o_o)__________;_______o__(o_o)Q", "_Q(o_o)__________;______o___(o_o)Q", "_Q(o_o)__________;_____o____(o_o)Q", "_Q(o_o)__________;____o_____(o_o)Q", "_Q(o_o)__________;___o______(o_o)Q", "_Q(o_o)__________;__o_______(o_o)Q", "...
function jumpState() { clearTimeout( t ); window.history.pushState( {},"", states[poop] ); poop++; if( poop > states.length ) { poop = 0; } t = setTimeout( jumpState, 50 ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get stateString() {\n const cornerFaceIndices = [\n [29, 15, 26],\n [9, 8, 20],\n [6, 38, 18],\n [44, 27, 24],\n [17, 35, 51],\n [2, 11, 45],\n [36, 0, 47],\n [33, 42, 53]\n ];\n\n const edgeFaceIndices = [\n [25, 28],\n [23, 12],\n [19, 7],\n [2...
[ "0.65782917", "0.6447642", "0.63007426", "0.6182741", "0.6129424", "0.605387", "0.6051782", "0.6003058", "0.5936127", "0.59264565", "0.5898499", "0.5835456", "0.5835098", "0.58341086", "0.5828514", "0.5805927", "0.5790288", "0.5783536", "0.5723965", "0.57171667", "0.5687595",...
0.0
-1
Principle 1 code example for Window Binding
function sayName(name) { console.log(this); return name; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "listenWindow() {\n this.initDefaultUI();\n this.initFastClick();\n this.setMoblie();\n }", "function Window() {}", "function windowbinding() {\n console.log(this);\n}", "onOpenedWindow() {\n throw new NotImplementedException();\n }", "function windowBind (param) {\n console.log(this);\n...
[ "0.6708435", "0.6286664", "0.62779236", "0.61939377", "0.61888003", "0.60452956", "0.6039229", "0.6009125", "0.5941998", "0.592551", "0.59144175", "0.58645284", "0.58612055", "0.58260834", "0.5783843", "0.5771466", "0.5730992", "0.57171625", "0.5713832", "0.57082963", "0.5684...
0.0
-1
Principle 3 code example for New Binding
function CordialPerson(greeter) { this.greeting = 'Hello '; this.greeter = greeter; this.speak = function() { console.log(this.greeting + this.greeter); console.log(this); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Component_BindingHandler() {}", "function NewBinding(message, name) {\nthis.name = name;\nthis.message = message;\nthis.say = function(){\n return `${this.name} has a message for you: ${this.message}.`\n}\n}", "function BindFactory(){}", "function moduleBinding(name, bindings){\n this.name =...
[ "0.699002", "0.6887107", "0.6785861", "0.6200602", "0.6164078", "0.6139513", "0.61151665", "0.6058092", "0.6038483", "0.60349506", "0.5983222", "0.5926265", "0.58925694", "0.58925694", "0.5874322", "0.5874322", "0.5852459", "0.583611", "0.58191884", "0.57746565", "0.5723564",...
0.0
-1
These standalone emit functions are used to optimize calling of event handlers for fast cases because emit() itself often has a variable number of arguments and can be deoptimized because of that. These functions always have the same number of arguments and thus do not get deoptimized, so the code inside them can execu...
function emitNone(handler, isFn, self) { if (isFn) handler.call(self); else { var len = handler.length; var listeners = arrayClone(handler, len); for (var i = 0; i < len; ++i) listeners[i].call(self); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "emit(...args) {\n this._event_dispatcher.$emit(...args);\n }", "function emitAsync(args){\n\t\tsetTimeout(function(){\n\t\t\temit.apply(evented, args);\n\t\t}, 0);\n\t}", "function emitEvent(fn) {\n if (typeof fn != 'function') return\n\n var args = [].slice.call(arguments, 1)\n return fn.apply(null, ar...
[ "0.65235", "0.6403974", "0.6345485", "0.61957985", "0.60637003", "0.6042838", "0.594693", "0.5924483", "0.5900905", "0.58933216", "0.58767325", "0.5865879", "0.58615524", "0.58575165", "0.58487326", "0.58487326", "0.5823475", "0.5817374", "0.57926786", "0.57926786", "0.579172...
0.5567446
95
About 1.5x faster than the twoarg version of Arraysplice().
function spliceOne(list, index) { for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1) list[i] = list[k]; list.pop(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static fastSplice(arr, startIdx, removeCount) {\n let i, length = arr.length;\n if (startIdx >= length || removeCount === 0) {\n return;\n }\n removeCount = (startIdx + removeCount > length ? length - startIdx : removeCount);\n let len = length - removeCount;\n ...
[ "0.7395812", "0.71519256", "0.7065192", "0.7012039", "0.6878061", "0.6753091", "0.67074555", "0.66961807", "0.66882205", "0.6687342", "0.6681239", "0.6679162", "0.6678183", "0.66775954", "0.66335577", "0.6621636", "0.65752155", "0.6558999", "0.6531689", "0.65295357", "0.64876...
0.0
-1
o = obstacle / empty grid for reference: let grid = [ ["","","","","","","","","",""], ["","","","","","","","","",""], ["","","","","","","","","",""], ["","","","","","","","","",""], ["","","","","","","","","",""], ["","","","","","","","","",""], ["","","","","","","","","",""], ["","","","","","","","","",""], ["...
function turnLeft(rover){ console.log("turnLeft was called!"); switch (rover.direction) { case "N": rover.direction = "W"; break; case "W": rover.direction = "S"; break; case "S": rover.direction = "E"; bre...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function moveForward(rover){\nconsole.log(\"moveForward was called\")\n if(rover.direction == \"N\" && rover.x > 0){\n rover.x--;\n if(board[rover.x][rover.y] != ' '){\n rover.x++;\n console.log(msgObstacle);\n }\n }\n else if(rover.direction == \"S\" && rover.x ...
[ "0.6963983", "0.67645955", "0.6669845", "0.6662406", "0.6625304", "0.6599847", "0.65645707", "0.65414774", "0.65246576", "0.651698", "0.6515055", "0.65009254", "0.649991", "0.64983654", "0.64773345", "0.64557314", "0.6447027", "0.64457744", "0.6377668", "0.6374179", "0.636661...
0.0
-1
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Global p5js event handler callbacks. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Preload sound effects.
function preload() { sound = { hitWall: loadSound("./sounds/hit-wall.wav"), hitPaddle: loadSound("./sounds/hit-paddle.wav"), increasePlayerScore: loadSound("./sounds/increase-score.wav"), }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function preload() {\n main_bgm = loadSound('./libraries/snowy.mp3');\n}", "function preload() {\n // load your sound files here\n}", "function preload(){\n pathImg = loadImage(\"depositphotos_211414398-stock-video-halloween-shortcut-road-forest-scary.jpg\");\n playerImg = loadAnimation(\"boy running 1.png...
[ "0.7548872", "0.7510387", "0.7479507", "0.74120885", "0.7410957", "0.7408598", "0.74025494", "0.7397891", "0.7394721", "0.7394174", "0.7383538", "0.738108", "0.7322589", "0.728542", "0.72745013", "0.72716826", "0.72712344", "0.7263021", "0.7260209", "0.7249382", "0.7243469", ...
0.7187789
30
Setup p5js canvas, reset defaults and initialize global game objects.
function setup() { let canvas = createCanvas(canvasContainer.clientWidth, canvasContainer.clientHeight); canvas.parent("canvas-container"); rectMode(CENTER); ellipseMode(CENTER); noStroke(); // Initialize global game objects. pong = new Pong(); ball = new Ball(); controller = new PaddleController();...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setup() {\n var canvas = createCanvas(640, 530);\n canvas.parent('gameBoard');\n gameReset();\n}", "function setup() {\n createCanvas(windowWidth, windowHeight);\n\n setUpObjects();\n}", "function setup() {\n // Create a p5.js canvas 800px wide and 600px high, and assign it to the global variabl...
[ "0.7494982", "0.7494015", "0.74458843", "0.7444185", "0.73742443", "0.7260837", "0.7212014", "0.7183686", "0.71778125", "0.7171058", "0.7155738", "0.71463495", "0.71336013", "0.71195656", "0.71088415", "0.7104377", "0.70917296", "0.70676666", "0.7048234", "0.70458204", "0.704...
0.7478251
2
Update game state every frame.
function draw() { pong.draw(); if (pong.isStarted) { ball.move(); leftPaddle.move(); rightPaddle.move(); } else { // Show paddles at startup and redraw paddles once a player won/lost actual round. leftPaddle.draw(); rightPaddle.draw(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gameLoop(state) {\n update(state);\n render(state);\n}", "function updateGame() {\n updateGameState();\n updateDirection();\n }", "function gameLoop() {\n stats.begin(); // Begin measuring\n ///updating current state\n currentstate.update();\n stats.end(); // end measuring\n}"...
[ "0.7831888", "0.77852994", "0.75941354", "0.74913806", "0.7467073", "0.74532825", "0.74254423", "0.7417461", "0.7404161", "0.7404161", "0.739999", "0.73863596", "0.73846906", "0.737263", "0.7355897", "0.73056346", "0.7305515", "0.72451353", "0.7219233", "0.7198174", "0.718627...
0.0
-1
Evaluate key events to start new round or pause actual round.
function keyPressed() { if (key === "p" || key === "P") pong.pauseRound(); if (key === " " && !pong.isStarted) pong.newRound(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onKeyPressed(event){\n switch(event.keyCode){\n case 13: /** ENTER */\n this.command.state = this.command.stateFactory.getFinalizeState(this.command);\n this.command.state.onEpsilon();\n break;\n case 27: /** ESCAPE */\n this....
[ "0.62720835", "0.6118839", "0.6095608", "0.5879644", "0.5862333", "0.58400184", "0.58147246", "0.58110917", "0.5810239", "0.5796001", "0.57903945", "0.57752866", "0.57281846", "0.5699284", "0.56905985", "0.5673217", "0.567149", "0.56664556", "0.56618583", "0.5647086", "0.5640...
0.6478147
0
Evaluate touch events to start new round.
function touchStarted() { if (!pong.isStarted) { // Simulate SPACE key to start new round on touch only devices. key = " "; keyPressed(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_onTouchStart(event) {\n if (!this._target.rippleDisabled) {\n // Some browsers fire mouse events after a `touchstart` event. Those synthetic mouse\n // events will launch a second ripple if we don't ignore mouse events for a specific\n // time after a touchstart event.\n ...
[ "0.6607354", "0.6604336", "0.65618753", "0.6418561", "0.6291753", "0.6273105", "0.62408507", "0.62251127", "0.6214954", "0.61929446", "0.61870706", "0.61823034", "0.6170623", "0.6164325", "0.61434406", "0.61362356", "0.61355376", "0.6127851", "0.60994583", "0.60787445", "0.60...
0.6126951
18
Evaluate mouse press events to start new round.
function mouseClicked() { if (!pong.isStarted) { // Simulate SPACE key to start new round when mouse is clicked. key = " "; keyPressed(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mousePressed() {\n if (state === 'title') {\n state = 'simulation'\n newRound()\n }\n else if (state === 'simulation') {\n clicked();\n }\n}", "function mousePressed() {\n startMouseX = mouseX;\n startMouseY = mouseY;\n }", "function startPressPen(event) {\n isDrawning = tru...
[ "0.7180781", "0.66465396", "0.6538", "0.6534544", "0.6379986", "0.63319117", "0.6255356", "0.62539357", "0.62277585", "0.6224589", "0.6192787", "0.6169177", "0.616808", "0.61672217", "0.61625105", "0.61454487", "0.6144268", "0.6143858", "0.6131524", "0.61081535", "0.6096321",...
0.6242352
8
Adjust canvas when user resizes browser window.
function windowResized() { resizeCanvas(canvasContainer.clientWidth, canvasContainer.clientHeight); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resizeCanvas() {\n\t\tcanvas.width = (window.innerWidth) - 150;\n\t\tcanvas.height = (window.innerHeight) - 100;\n\t\tredraw();\n\t}", "function windowResized() {\n resizeCanvas(canvasX, canvasY);\n}", "function resizeCanvas() {\n\t\tcanvas.width = (window.innerWidth) * .67;\n\t\tcanvas.height = (win...
[ "0.8363476", "0.8324325", "0.8319761", "0.8280996", "0.8230904", "0.82028455", "0.8201936", "0.81330585", "0.8131729", "0.8127276", "0.81140465", "0.80992913", "0.80992913", "0.8093293", "0.8089965", "0.8089965", "0.8086454", "0.80795383", "0.807316", "0.8068784", "0.8068784"...
0.8136463
7
module decode cookies jank af
function decode(input) { return JSON.parse(base64.decode(input)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "decode(key) {\n /*\n * Ignore when initial value is not defined or null\n */\n const value = this.cookies[key];\n if (value === null || value === undefined) {\n return null;\n }\n /*\n * Reference to the cache object. Mainly done to avoid typos,...
[ "0.68398696", "0.6718329", "0.6683279", "0.6681707", "0.6668879", "0.6603104", "0.65098995", "0.6481506", "0.6404742", "0.63845843", "0.63700503", "0.6360135", "0.63539416", "0.6341673", "0.63332415", "0.632371", "0.6276515", "0.6275638", "0.6273229", "0.6261088", "0.62367505...
0.0
-1
given a socket object, get session
function getSession(socket) { let session = cookie.parse(socket.request.headers.cookie).session; return(decode(session).SID); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSession(socket)\n{\n ///\n try\n {\n var cookies= socket.request.headers.cookie.split(';');\n }\n catch(error)\n {\n console.log(error);\n console.log(\"User No Cookies At All\");\n return;\n }\n ////\n var i;\n for (i= 0 ; i < cookies.length ;...
[ "0.748575", "0.6790493", "0.6685425", "0.6570597", "0.6207696", "0.618304", "0.6136011", "0.6053758", "0.59377205", "0.5905128", "0.58887136", "0.58726674", "0.580869", "0.57676375", "0.57642573", "0.57597995", "0.57110035", "0.5708142", "0.567523", "0.5670613", "0.56700355",...
0.76884806
0
given a sessionID, get socket ID
function assignSID(req, res, next) { let cookie = req.session.SID; // console.log(req.session); console.log("cookie:" + cookie); if (cookie === undefined) { let id = uuidv4(); req.session.SID = id; console.log("new SID created: " + id) } else { console.log("welcome back, " + cookie); } n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSocketId() {\n const socketId = socket ? socket.id : 'none';\n\n return socketId || 'none';\n}", "function getSessionId(context)\n{\n return context.socket.id;\n}", "function getSession(socket) {\n let session = cookie.parse(socket.request.headers.cookie).session;\n return(decode(session...
[ "0.76666415", "0.7628798", "0.7005556", "0.6461853", "0.64433897", "0.63830376", "0.6307528", "0.60835016", "0.60060674", "0.5983207", "0.59585613", "0.58987194", "0.5889221", "0.5871274", "0.58639187", "0.58578616", "0.5855007", "0.58500075", "0.5805911", "0.57996964", "0.57...
0.0
-1
read the no. of players
getCount(){ var playerCountRef = database.ref('playerCount'); playerCountRef.on("value",(data)=>{ playerCount = data.val(); }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getNumPlayers () {\n return state.numPlayers;\n}", "getNumberOfPlayers() {\n return Object.keys(this.players).length;\n }", "getplayer()\n {\n var noOfPlayer=readline.question('do you want 1 player or 2 player..');\n return noOfPlayer;\n }", "static totalNumPlayers() {\n ...
[ "0.7085911", "0.70409316", "0.6826859", "0.6620825", "0.6591852", "0.6439135", "0.64336073", "0.6395344", "0.6324492", "0.61612535", "0.60868317", "0.6080045", "0.6049863", "0.6047624", "0.5950919", "0.5916342", "0.58964926", "0.5892931", "0.5870399", "0.58238345", "0.5758107...
0.0
-1
update the playerCount in the database
updateCount(count){ database.ref('/').update({ playerCount: count }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateCount(count)\r\n {\r\n database.ref('/').update({\r\n playerCount : count\r\n }); \r\n }", "updateCount(count){\r\n database.ref('/').update({\r\n playerCount: count\r\n })\r\n }", "updateCount(count){\r\n database.ref(\"/\").update({\r\n playerCount:coun...
[ "0.8437826", "0.8367196", "0.82994735", "0.8264322", "0.82408506", "0.8223162", "0.8180773", "0.8151768", "0.8145339", "0.8078205", "0.7937873", "0.69092304", "0.6887599", "0.6775695", "0.6692605", "0.6579421", "0.64987916", "0.64964527", "0.6450732", "0.6429472", "0.64036316...
0.8172228
7
update the name and distance of the player
update(){ //create a new entry in the database called 'players' inside which you'll have all the 4 player's name and distance //Eg. 1st player = player1, 2nd player = player2, 3rd player = player3 var playerIndex = "players/player" + this.index; database.ref(playerIndex).set({ //updating the nam...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "update(){\n var playerIndex = \"players/player\" + this.index;\n database.ref(playerIndex).set({\n name: this.name,\n distance: this.distance\n });\n }", "function updatePlayerInfo() {\n\t\tdocument.getElementById(\"player1name\").innerText = `Name: ${player1.name}`;...
[ "0.7347728", "0.6970277", "0.68436563", "0.6623673", "0.6611835", "0.6605485", "0.6514456", "0.6490016", "0.64381665", "0.6429962", "0.6416578", "0.6394945", "0.63647187", "0.6361686", "0.6358707", "0.63427943", "0.63245076", "0.63076526", "0.62956184", "0.62683535", "0.62404...
0.6803175
3
ENTRIES IN THE DATABASE gameState, playerCount, players function to store all the player's information inside the 'allPlayers' variable > getPlayerInfo()
static getPlayerInfo(){ var playerInfoRef = database.ref('players'); playerInfoRef.on("value",(data)=>{ allPlayers = data.val(); }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lobbyData() {\n\t\t//alert('list of local players: ' + players);\n\t\t\n\t\t//puts all players into json object\n \tvar jObject={};\t\n \tfor(i in players)\n\t {\n\t jObject[i] = players[i];\n\t }\n\t\t//checks web for new players\n\t\tvar gamePlayerData = new globals.xml.gamePlayers(in...
[ "0.6907871", "0.68294823", "0.68133116", "0.656996", "0.65330243", "0.6520568", "0.6464831", "0.64571375", "0.64526767", "0.64255744", "0.6413224", "0.6337869", "0.6313319", "0.6290823", "0.62906367", "0.62812436", "0.6267046", "0.6264068", "0.6262753", "0.6260608", "0.625239...
0.5720663
94
function to get/read the number of cars at the end > getCarsAtEnd()
getCarsAtEnd(){ //to refer to the database and listen to the 'carsAtEnd' to find out the number of cars at end and store it inside the 'this.rank' database.ref('carsAtEnd').on("value", (data)=>{ this.rank = data.val() }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "count()\n\t{\n\t\treturn this.numCards;\n\t}", "function count() {\n /* let cont = 0\n while (cont <= vetores.length) {\n cont += 1\n }\n return cont - 1*/\n let cont = vetores.length\n return cont\n}", "get length() {\n return this.cursor + 1;\n }", "function countCar() {\n re...
[ "0.57279885", "0.5659202", "0.56118375", "0.5607787", "0.5589446", "0.54034084", "0.53730696", "0.5366327", "0.5320949", "0.52970475", "0.52890915", "0.5287917", "0.52854073", "0.52775276", "0.5266696", "0.5257159", "0.5244315", "0.52360666", "0.5218701", "0.5201873", "0.5200...
0.5810703
0