query
stringlengths
9
14.6k
document
stringlengths
8
5.39M
metadata
dict
negatives
listlengths
0
30
negative_scores
listlengths
0
30
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
Adds a user to the subscribed list
function addToSubscribed(username) { var subscribed = getSubscribedList(); subscribed[username] = true; setSubscribedList(subscribed); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addToSubscribed(username) {\n\tvar subscribed = getSubscribedList();\n\tsubscribed[username] = true;\n\tsetSubscribedList(subscribed);\n}", "function subscribeUser() {\n // TODO 3.4 - subscribe to the push service\n}", "function addUser(user) {\n users.push(user);\n }", "addUser(user) {\r...
[ "0.78859234", "0.70657206", "0.7018671", "0.69746155", "0.68825364", "0.6855112", "0.6763471", "0.6732747", "0.66770333", "0.66599554", "0.6601113", "0.6559365", "0.6544636", "0.65099794", "0.64220667", "0.6360772", "0.6343234", "0.6341698", "0.63031065", "0.6274421", "0.6258...
0.7890606
0
Removes a user from the subscribed list
function removeFromSubscribed(username) { var subscribed = getSubscribedList(); delete subscribed[username]; setSubscribedList(subscribed); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeFromSubscribed(username) {\n\tvar subscribed = getSubscribedList();\n\tdelete subscribed[username];\n\tsetSubscribedList(subscribed);\n}", "removeUser(user) {\n this.active_list = this.active_list.filter((a_user) => a_user.email !== user.email);\n this.setValue(this.active_list);\n ...
[ "0.7838569", "0.7298876", "0.72408825", "0.7071857", "0.70210993", "0.6931442", "0.6864008", "0.68475217", "0.6811697", "0.6749487", "0.6693176", "0.66813934", "0.6677657", "0.6661725", "0.66500086", "0.6634333", "0.6588334", "0.65833825", "0.65432423", "0.6514009", "0.640631...
0.7900235
0
Returns if a user is subscribed
function isSubscribed(username) { return (getSubscribedUsers().length > 0 ? (getSubscribedList()[username] != undefined) : false); /*if (getSubscribedUsers() != []) { return (getSubscribedUsers()[username] != null); } else { return false; }*/ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isSubscribed(username) {\n\treturn getSubscribedList()[username] != undefined;\n}", "function checkUsrSubscription() {\n\tif (checkCookieCor(\"rcsSubscriptions\")){\n\t\tvar rcsSubscriptions = getCookieClient(\"rcsSubscriptions\");\n\t\tvar currentAppId = getCurrentAppId();\n\t\tvar ca = rcsSubscription...
[ "0.7454998", "0.67619586", "0.6680285", "0.6244668", "0.61700064", "0.608942", "0.60729617", "0.60729617", "0.60729617", "0.60729617", "0.60729617", "0.5996502", "0.59519804", "0.59407866", "0.59019715", "0.5829199", "0.57957226", "0.5770711", "0.5768412", "0.57594", "0.57590...
0.75197554
0
Returns all the subscribed users
function getSubscribedUsers() { var users = []; var subscribed = getSubscribedList(); for(var user in subscribed) { users.push(user.toString()); } return users; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSubscribedUsers() {\n\tvar users = [];\n\tvar subscribed = getSubscribedList();\n\tfor(var user in subscribed) {\n\t\tusers.push(user);\n\t}\n\treturn users;\n}", "function getUsers() {\n\t\t\t\tusers.getUser().then(function(result) {\n\t\t\t\t\tvm.subscribers = result;\n\t\t\t\t\tconsole.log(vm.subs...
[ "0.8558829", "0.77910084", "0.7459479", "0.7410047", "0.72870016", "0.7100593", "0.70440596", "0.7011204", "0.6915458", "0.68579316", "0.6821933", "0.6809926", "0.67911804", "0.67673963", "0.6745896", "0.6713226", "0.6699967", "0.6686907", "0.6682372", "0.66639835", "0.661377...
0.8590621
0
Return the child of the given type.
_getChild(cType, optional=false) { let existing = this.props.children.filter(c => c && c.nodeName == cType); if (optional && existing.length == 0) return null; if (existing.length != 1) throw new Error('Missing required child'); return existing[0].children; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getAncestorElementOfType(child, type) {\n if (!child) return null\n var parent = child.parentNode\n if (!parent) return null\n if (parent.nodeName.toUpperCase() == type.toUpperCase()) {\n return parent\n } else {\n return getAncestorElementOfType(parent, type)\n }\n}", "findC...
[ "0.6474659", "0.6338318", "0.6293411", "0.6293411", "0.6293411", "0.6136163", "0.6045762", "0.6004585", "0.59815687", "0.58985883", "0.5872203", "0.57278335", "0.57278335", "0.57053566", "0.56350183", "0.55426925", "0.5491805", "0.54884267", "0.54751253", "0.5436213", "0.5395...
0.7037222
0
This function allows the user to enter items into the weekList in an order that is not the days of the week. It makes sure that the days of the week are always in the correct order. For example, a Monday event will always be placed before a Friday. It does this by reordering the array "todosWeek" so that the ones with ...
function order(todosWeek){ var newTodosWeek = []; for(var i=0; i<todosWeek.length; i++){ if(todosWeek[i].day.toLowerCase() == "monday"){ newTodosWeek.push(todosWeek[i]); } } for(var i=0; i<todosWeek.length; i++){ if(todosWeek[i].day.toLowerCase() == "tuesday"){ newTodosWeek.p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function putTableWeek(){\n var weekList = document.getElementById(\"weekList\");\n weekList.innerHTML= \"\";\n todosWeek = order(todosWeek);\n\n for (var i = 0; i < todosWeek.length; i++){\n var itemNode = document.createTextNode(todosWeek[i].name);\n var newRow = document.createElement('tr');\n var i...
[ "0.6739173", "0.6285314", "0.5933573", "0.5923362", "0.5745538", "0.5556759", "0.55446994", "0.55035615", "0.550029", "0.54747725", "0.5443027", "0.5302091", "0.5302091", "0.5263205", "0.52398413", "0.52398413", "0.52332425", "0.52048934", "0.51935124", "0.5192463", "0.518475...
0.75846833
0
This function takes the information from the prompts and adds them to the weekList table. It connects the test to the table elements and then those elements to the table.
function putTableWeek(){ var weekList = document.getElementById("weekList"); weekList.innerHTML= ""; todosWeek = order(todosWeek); for (var i = 0; i < todosWeek.length; i++){ var itemNode = document.createTextNode(todosWeek[i].name); var newRow = document.createElement('tr'); var itemTd = document....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function populateWeeklyData(responseData, table) {\n var dataArray = responseData.aaData;\n var dayArray = [\"SUN\", \"MON\", \"TUE\", \"WED\", \"THU\", \"FRI\", \"SAT\"];\n var html = \"\";\n var date = new Date();\n var currentDate = new Date().setHours(0, 0, 0, 0);\n $....
[ "0.64760214", "0.6416929", "0.63821816", "0.6194846", "0.5937353", "0.5875131", "0.5873354", "0.58600044", "0.57085425", "0.56773585", "0.5662633", "0.55944943", "0.55940145", "0.55919844", "0.5586774", "0.5578085", "0.5553258", "0.5534249", "0.55295575", "0.55236137", "0.551...
0.684008
0
This function changes the emoji next to the daily list based on how many events the user has entered.
function changeEmojiDay(){ var em = document.getElementById("toDoList").childElementCount; if(em == 0){ document.getElementById("emojiDay").innerHTML = "😀"; }else if(em < 3){ document.getElementById("emojiDay").innerHTML = "🙄"; }else if(em < 5){ document.getElementById("emojiDay").innerHTML = "...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function changeEmojiWeek(){\n var em = document.getElementById(\"weekList\").childElementCount;\n\n if(em == 0){\n document.getElementById(\"emojiWeek\").innerHTML = \"😀\";\n\n }else if(em < 3){\n document.getElementById(\"emojiWeek\").innerHTML = \"🙄\";\n\n }else if(em < 5){\n document.getElementBy...
[ "0.6812298", "0.5997364", "0.5823291", "0.5753122", "0.56376946", "0.5629902", "0.5545801", "0.5539811", "0.55079675", "0.54662895", "0.5430661", "0.5404008", "0.5402122", "0.53626746", "0.5346282", "0.5290454", "0.5288796", "0.52803093", "0.5249757", "0.5219916", "0.52183026...
0.7314224
0
hack to make colliding entities also wrapping CollidingEntity.prototype.__proto__ = WrappingPathEntity.prototype;
function WrappingCollidingEntity(game, px, py, width, height, image, path) { WrappingPathEntity.call(this, game, px, py, width, height, image, path); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "doCollide(other)\n {\n var e = this.getEntity();\n }", "function ColliderHull(sprite, approximate=true) {\n\n // TODO: TEST EXTENSIVELY\n // (this, simple shapes, and some collision_detection functions)\n\n // general\n this.id = Nickel.UTILITY.assign_id();\n this.type = 'ColliderHull';\n\n ...
[ "0.5944789", "0.5538113", "0.5530993", "0.54380834", "0.5376957", "0.53497666", "0.53365564", "0.52813387", "0.52414364", "0.5206484", "0.51840377", "0.5160957", "0.5136279", "0.5136279", "0.51321155", "0.5124596", "0.51131535", "0.5111118", "0.5105493", "0.5078538", "0.50558...
0.64599985
0
tag for player entity to equip explosive missiles
function EquipedExplosiveMissilesTag() { this.timer = 60 * 30; // 30 seconds of explosive missiles }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function equipItem() {\r\n\tfor(var i = 0; i < playerBag.length; i++) {\r\n\t\tif(currItemCode == playerBag[i]) {\r\n\t\t\tcheckEquip();\r\n\t\t\tclosedVBox();\r\n\t\t\tgetArmorBonus();\r\n\t\t\t//getWeaponBonus(); <-- might use for magical weapons\r\n\t\t\tgetWeaponDmgBonus();\r\n\r\n\t\t}\r\n\t}\r\n}", "attack...
[ "0.659853", "0.6548494", "0.64887434", "0.6398067", "0.6336678", "0.6287414", "0.6268257", "0.6197422", "0.61791855", "0.61724037", "0.61646503", "0.61550057", "0.6132064", "0.6118004", "0.61033916", "0.61026376", "0.6098483", "0.60892886", "0.6075811", "0.607127", "0.6044494...
0.7789127
0
tag for director entity to enable darkness
function EnableDarknessTag() {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function darkenize() {\n this.dark_theme_attribute = [\n {'type': 'background', 'value': 'background-color'}, \n {'type': 'text', 'value': 'color'}, \n {'type': 'border', 'value': 'border-bottom-color'}, \n {'type': 'border', 'value': 'border-top-color'}, \n {'type': 'border',...
[ "0.60976076", "0.59889287", "0.5949072", "0.5901147", "0.5885129", "0.5818053", "0.5709211", "0.567759", "0.5614462", "0.5593652", "0.5588042", "0.5587919", "0.5585446", "0.55678743", "0.55674195", "0.54876286", "0.5460158", "0.54162884", "0.5381958", "0.5352109", "0.53426397...
0.78336257
0
tag indicates that entity is source of point light
function PointLightSourceTag() {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function DirectedLightSourceTag() {}", "function goTagPoint(structural) {\n\n if (modeSwitch.isWalkingMode()) {\n\n model.visible = true;\n\n mousePoint = structural.TagGroup.position.clone();\n\n mousePoint.y += modelData.cameraHeight;\n\n const DIST_THRESHHOLD = 0.5;\n\n c...
[ "0.6647438", "0.55020523", "0.5493658", "0.5387527", "0.5367683", "0.53674626", "0.53674626", "0.53674626", "0.53674626", "0.533599", "0.5267187", "0.5253458", "0.5241751", "0.5183761", "0.51821244", "0.5158438", "0.5140461", "0.5129127", "0.5129127", "0.5129127", "0.5129127"...
0.7555328
0
tag indicates that entity is source of directed light
function DirectedLightSourceTag() {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function PointLightSourceTag() {}", "land() {\n this._tag = \"_LANDED_\";\n }", "function TagNeighbour(){\n\nfor(var neighbour:GameObject in neighbour_list ){\n\t//aktuelle Tags löschen\n\tneighbour.GetComponent(SteeringBehavior).tagged = false;\n\t\n\t//Berechnung Abstand\n\tvar sqrdistance : float;...
[ "0.69412863", "0.5650901", "0.55225784", "0.53048146", "0.53048146", "0.53048146", "0.53048146", "0.5273855", "0.5212386", "0.51833105", "0.5152269", "0.5086308", "0.50602126", "0.50363684", "0.5010673", "0.5010673", "0.5010673", "0.5010673", "0.4914215", "0.4913443", "0.4889...
0.71018654
0
Sets mouseIsDown to true
function mousedown(e){ // console.log(e); mouseIsDown = true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mousePressed() {\r\n mouseIsDown = true;\r\n}", "function mouseReleased() {\r\n mouseIsDown = false;\r\n}", "function mouseDown(event) {\r\n this.hasMouseDown = true;\r\n }", "function mouseDown(event) {\n mouseIsDown = true;\n // if (drawHandle === -1) {\n // drawHandle = setInterv...
[ "0.84383583", "0.8239832", "0.817402", "0.8144315", "0.81026965", "0.80034506", "0.7996496", "0.78762704", "0.7857386", "0.7806406", "0.7806406", "0.7776296", "0.7748778", "0.77342165", "0.7712079", "0.77051604", "0.76394457", "0.7590485", "0.7590485", "0.7549142", "0.7462631...
0.8482796
0
Getter for a string description of the tool
function getDescription(){ var str = "Select Tool"; return str; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getDescription(){\n\t\tvar str = \"Draw Tool\";\n\n\t\treturn str;\n\t}", "get help() {\n\t\tlet response = \"\"\n\t\tif (this._description) { \n\t\t\tresponse = this._description; \n\t\t}\n\n\t\tresponse += \" - Usage: \" + this.format;\n\t\tresponse += \" - Ex: \" + this.example;\n\n\t\treturn respons...
[ "0.8132224", "0.6990222", "0.69844496", "0.69348115", "0.68551606", "0.68239576", "0.68147653", "0.6811132", "0.6780676", "0.67002547", "0.66966355", "0.669184", "0.669184", "0.669184", "0.669184", "0.669184", "0.6691525", "0.6658636", "0.6658636", "0.6658636", "0.662582", ...
0.7958952
1
saves polyline displayed on canvas to file
function saveCanvas() { var sor = new SOR(); sor.objName = "model"; sor.vertices = g_points; sor.indexes = []; for (i = 0; i < g_points.length/3; i++) sor.indexes.push(i); console.log(sor.indexes); saveFile(sor); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function saveCanvas() {\r\n var sor = new SOR();\r\n sor.objName = \"model\";\r\n sor.vertices = g_points;\r\n sor.indexes = [];\r\n for (i = 0; i < g_points.length/3; i++)\r\n sor.indexes.push(i);\r\n console.log(sor.indexes);\r\n saveFile(sor);\r\n}", "function saveToImageFile() { \n ...
[ "0.6749545", "0.66821647", "0.6621374", "0.6464646", "0.630816", "0.62912446", "0.62901866", "0.62594736", "0.6257353", "0.62116003", "0.62038296", "0.61365455", "0.6133295", "0.6117103", "0.6082445", "0.60791177", "0.6078965", "0.6061825", "0.60209477", "0.59990364", "0.5980...
0.68467814
0
Is same as getBinPathWithPreferredGopathGoroot, but returns why the returned path was chosen.
function getBinPathWithPreferredGopathGorootWithExplanation(toolName, preferredGopaths, preferredGoroot, alternateTool, useCache = true) { if (alternateTool && path.isAbsolute(alternateTool) && executableFileExists(alternateTool)) { binPathCache[toolName] = alternateTool; return { binPath: alternate...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getBinPath(tool, useCache = true) {\n const r = getBinPathWithExplanation(tool, useCache);\n return r.binPath;\n}", "async _getToolPath () {\r\n const localPath = this.getLocalPath()\r\n if (localPath) {\r\n let local = false\r\n try {\r\n await fs.promises.access(localPath,...
[ "0.66221154", "0.62652856", "0.61806506", "0.609015", "0.5951352", "0.5951352", "0.5820465", "0.57520497", "0.5588587", "0.55733794", "0.5564971", "0.5547625", "0.5541895", "0.54864085", "0.5475404", "0.54210836", "0.54210836", "0.54093444", "0.53789467", "0.5368665", "0.5345...
0.72696555
1
Returns the workspace in the given Gopath to which given directory path belongs to
function getCurrentGoWorkspaceFromGOPATH(gopath, currentFileDirPath) { if (!gopath) { return; } const workspaces = gopath.split(path.delimiter); let currentWorkspace = ''; currentFileDirPath = fixDriveCasingInWindows(currentFileDirPath); // Find current workspace by checking if current f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getWorkspace(id) {\n return workspaces[id];\n}", "getCurrentDirectory(fileName, insertedPath) {\r\n var currentDir = path.parse(fileName).dir || '/';\r\n var workspacePath = vs.workspace.rootPath;\r\n // based on the project root\r\n if (insertedPath.startsWith('/') && works...
[ "0.6630023", "0.6196969", "0.60229176", "0.59149754", "0.5863431", "0.5758239", "0.55930424", "0.55580324", "0.546097", "0.54521596", "0.54288167", "0.53898007", "0.5362876", "0.53620297", "0.5350829", "0.52528226", "0.52331215", "0.5226099", "0.52256614", "0.5139738", "0.512...
0.6727145
1
Returns the tool name from the given path to the tool
function getToolFromToolPath(toolPath) { if (!toolPath) { return; } let tool = path.basename(toolPath); if (process.platform === 'win32' && tool.endsWith('.exe')) { tool = tool.substr(0, tool.length - 4); } return tool; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async _getToolPath () {\r\n const localPath = this.getLocalPath()\r\n if (localPath) {\r\n let local = false\r\n try {\r\n await fs.promises.access(localPath, fs.constants.X_OK)\r\n local = true\r\n } catch (e) { }\r\n if (local) {\r\n return localPath\r\n }\r\n ...
[ "0.6421221", "0.62331235", "0.5916222", "0.5789198", "0.5761704", "0.5744997", "0.56980944", "0.56860745", "0.5658295", "0.5651305", "0.5573759", "0.5573759", "0.5573759", "0.5573759", "0.5560711", "0.5560711", "0.5560711", "0.5560711", "0.5560711", "0.55407095", "0.5532531",...
0.7897769
1
Returns output with relative filepaths expanded using the provided directory
function expandFilePathInOutput(output, cwd) { const lines = output.split('\n'); for (let i = 0; i < lines.length; i++) { const matches = lines[i].match(/\s*(\S+\.go):(\d+):/); if (matches && matches[1] && !path.isAbsolute(matches[1])) { lines[i] = lines[i].replace(matches[1], path.j...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function expandFiles(files, workingDirectory) {\n const promises = [];\n files.forEach((file) => {\n if (\n file.path !== './package.json' && file.path !== './npm-shrinkwrap.json'\n ) {\n promises.push(Promise.resolve(file));\n return;\n }\n findPackageDependencies(workingDirectory, tr...
[ "0.58097434", "0.5466234", "0.5451342", "0.5340713", "0.53112245", "0.5305462", "0.5285015", "0.5280466", "0.52583414", "0.52251935", "0.52202296", "0.520465", "0.51917535", "0.5181152", "0.5129312", "0.51216924", "0.51059884", "0.5078858", "0.5076415", "0.5068634", "0.505619...
0.63476855
1
Overload sendEvent to log
sendEvent(event) { if (!(event instanceof Logger.LogOutputEvent)) { // Don't create an infinite loop... let objectToLog = event; if (event instanceof debugSession_1.OutputEvent && event.body && event.body.data && event.body.data.doNotLogOutput) { delete event....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function logEvent(eventType) {}", "function logEvent(eventName, eventData){\n console.log(\"Event triggered. Event name : \" + eventName + \" , Data : \" + JSON.stringify(eventData));\n}", "log(event, options = {}) {\n Log.trigger(event, Object.assign(options, { id: this.id }), this.element)\n }", "fu...
[ "0.78191835", "0.7198577", "0.7031651", "0.68204254", "0.67577547", "0.67503846", "0.6737022", "0.66618866", "0.66191554", "0.6613257", "0.6609333", "0.65777284", "0.656913", "0.6543858", "0.65072376", "0.6419527", "0.6416103", "0.6390387", "0.6380409", "0.63772064", "0.63441...
0.75693965
1
Overload sendResponse to log
sendResponse(response) { logger.verbose(`To client: ${JSON.stringify(response)}`); super.sendResponse(response); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "log() {\n\n this.respond(undefined, \"log\", undefined, undefined, arguments);\n\n }", "emitResponse(type, message, logMessage) {\n console.log(new Date() + ': ' + (logMessage || message));\n this.socket.emit(type, message);\n }", "static sendResponse(response, status, msgCode, messa...
[ "0.69723195", "0.65268385", "0.6415667", "0.6305773", "0.6166665", "0.6164273", "0.6155963", "0.6145108", "0.60269105", "0.6009394", "0.60020566", "0.5981744", "0.5971362", "0.5951053", "0.5948349", "0.59239376", "0.58950895", "0.5872518", "0.58693624", "0.58461", "0.58460945...
0.74835527
0
Kill a process and its children, returning a promise.
function killProcessTree(p, logger) { if (!logger) { logger = console.log; } if (!p || !p.pid || p.exitCode !== null) { return Promise.resolve(); } return new Promise((resolve) => { kill(p.pid, (err) => { if (err) { logger(`Error killing process ${...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function killProcess(processName){\n\tconst { exec } = require(\"child_process\");\n\texec(\"TASKKILL -F -IM \"+processName, (error, stdout, stderr) => {\n\t\tif (error) {\n\t\t\tconsole.log(`error: ${error.message}`);\n\t\t\treturn;\n\t\t}\n\t\tif (stderr) {\n\t\t\tconsole.log(`stderr: ${stderr}`);\n\t\t\tr...
[ "0.6380717", "0.59989816", "0.59989816", "0.5944879", "0.5909109", "0.58543974", "0.5747218", "0.5687853", "0.5526987", "0.54051894", "0.5342403", "0.53090423", "0.5248249", "0.52467954", "0.5221049", "0.51964384", "0.51934624", "0.5187148", "0.5178225", "0.5120114", "0.51058...
0.7117275
1
Kill a process. READ THIS BEFORE USING THE FUNCTION: TODO: This function is kept for historical reasons and should be removed once its user (gooutline) is replaced. Outlining uses this function and not killProcessTree because of performance issues that were observed in the past. See for more details and background.
function killProcess(p) { if (p && p.pid && p.exitCode === null) { try { p.kill(); } catch (e) { console.log(`Error killing process ${p.pid}: ${e}`); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function killProcess(p) {\n if (processes[p] != null) {\n processes[p].kill();\n }\n else {\n return \"No such process\";\n }\n}", "function killProcessTree(p, logger) {\n if (!logger) {\n logger = console.log;\n }\n if (!p || !p.pid || p.exitCode !== null) {\n re...
[ "0.6084433", "0.6069761", "0.6069761", "0.60684896", "0.6037645", "0.5870857", "0.58115673", "0.5560133", "0.5491891", "0.54802203", "0.54054147", "0.53801936", "0.53506523", "0.5277385", "0.51192284", "0.51152885", "0.5108378", "0.5081138", "0.5076803", "0.50642043", "0.4925...
0.64029104
1
Override this hook to implement custom requests.
customRequest(command, response, args, request) { this.sendErrorResponse(response, 1014, 'unrecognized request', null, ErrorDestination.Telemetry); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onRequest() {\n\n // sets the actually resolved action, as it is also set by notfound\n req.data.action = req.action;\n \n if (req.action != 'notfound') {\n // let soft-coded actions override\n var idempotentAction = req.action +'_'+ req.method.toLowerCase();\n var action ...
[ "0.65709555", "0.64355886", "0.64208734", "0.63524663", "0.63028693", "0.6302743", "0.60692954", "0.60692954", "0.60692954", "0.60692954", "0.60692954", "0.5950632", "0.59330744", "0.5931998", "0.5899525", "0.5877631", "0.5827513", "0.5818691", "0.5781251", "0.57360774", "0.5...
0.65227634
1
Set the logger's minimum level to log in the console, and whether to log to the file. Log messages are queued before this is called the first time, because minLogLevel defaults to Warn.
setup(consoleMinLogLevel, _logFilePath, prependTimestamp = true) { const logFilePath = typeof _logFilePath === 'string' ? _logFilePath : (_logFilePath && this._logFilePathFromInit); if (this._currentLogger) { const options = { consoleMinLogLevel, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setLogLevel(logLevel) {\n if (this.availableLogLevels.indexOf(logLevel) > -1) {\n this.logLevel = logLevel;\n }\n }", "function setLogLevel(level, logFileName, consoleFormatter) {\n \"use strict\";\n logLevel = level;\n defaultLogFileName = logFileName;\n defaultConsoleFormatter = console...
[ "0.60282224", "0.6010931", "0.5758484", "0.5691999", "0.5628511", "0.55186665", "0.5504985", "0.549174", "0.54175615", "0.5351436", "0.5331974", "0.5318983", "0.52964777", "0.522327", "0.5136735", "0.5125477", "0.5093952", "0.5077484", "0.5028144", "0.500429", "0.499458", "...
0.7008897
0
Comparing two different file paths while ignoring any different path separators.
function compareFilePathIgnoreSeparator(firstFilePath, secondFilePath) { const firstSeparator = findPathSeparator(firstFilePath); const secondSeparator = findPathSeparator(secondFilePath); if (firstSeparator === secondSeparator) { return firstFilePath === secondFilePath; } return firstFilePa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pathsEq(p1, p2) {\n var paths = [p1, p2];\n paths = paths.map(function (x) {\n if (x.substring(0, 7) === 'file://') {\n return x.slice(7);\n }\n\n return relPathToAbs(x);\n });\n return paths[0] === paths[1];\n }", "function ...
[ "0.7006499", "0.6405344", "0.6195452", "0.6156366", "0.59962535", "0.59962535", "0.5910117", "0.59099936", "0.59099936", "0.58463037", "0.5728051", "0.5650902", "0.5644273", "0.55813205", "0.5561128", "0.54263544", "0.53955567", "0.5384771", "0.53733534", "0.5355968", "0.5341...
0.82608837
0
normalizeSeparators will prepare the filepath for comparison in mapping from local to debugger path and from debugger path to local path. All separators are replaced with '/', and the drive name is capitalized for windows paths. Exported for testing
function normalizeSeparators(filePath) { // Although the current machine may not be running windows, // the remote machine may be and we need to fix the drive // casing. // This is a workaround for issue in https://github.com/Microsoft/vscode/issues/9448#issuecomment-244804026 if (filePath.indexOf('...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function normalizeSeparators(p) {\n p = p || '';\n // Windows\n if (IS_WINDOWS) {\n // Convert slashes on Windows\n p = p.replace(/\\//g, '\\\\');\n // Remove redundant slashes\n const isUnc = /^\\\\\\\\+[^\\\\]/.test(p); // e.g. \\\\hello\n return (isUnc ? '\\\\' : '') ...
[ "0.7881579", "0.7881579", "0.7881579", "0.7881579", "0.7881579", "0.7881579", "0.7543907", "0.67949915", "0.6335212", "0.6211449", "0.6140121", "0.6121703", "0.607783", "0.6054658", "0.59424406", "0.58921266", "0.5869953", "0.5863291", "0.58369565", "0.58302", "0.5813958", ...
0.80087864
0
Returns the current state of the delve debugger. This method does not block delve and should return immediately.
getDebugState() { return __awaiter(this, void 0, void 0, function* () { // If a program is launched with --continue, the program is running // before we can run attach. So we would need to check the state. // We use NonBlocking so the call would return immediately. ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isDebuggeeRunning() {\n return __awaiter(this, void 0, void 0, function* () {\n try {\n this.debugState = yield this.delve.getDebugState();\n return this.debugState.Running;\n }\n catch (error) {\n this.logDelveError(error, 'Faile...
[ "0.75038993", "0.6757147", "0.6690842", "0.61822164", "0.611165", "0.60635287", "0.60635287", "0.60623056", "0.6039534", "0.60135436", "0.5983057", "0.5983057", "0.5963169", "0.5963169", "0.5963169", "0.5963169", "0.5894852", "0.5887097", "0.5881747", "0.5878764", "0.586282",...
0.78366053
0
Closing a debugging session follows different approaches for launch vs attach debugging. For launch without debugging, we kill the process since the extension started the `go run` process. For launch debugging, since the extension starts the delve process, the extension should close it as well. To gracefully clean up t...
close() { return __awaiter(this, void 0, void 0, function* () { const forceCleanup = () => __awaiter(this, void 0, void 0, function* () { log(`killing debugee (pid: ${this.debugProcess.pid})...`); yield processUtils_1.killProcessTree(this.debugProcess, log); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function kill() {\n\n Object.keys(config).forEach(key => config[key].gaze.close());\n process.exit();\n\n}", "function closeDetachedFirebug()\r\n{\r\n if (!FW.Firebug.isDetached())\r\n return false;\r\n\r\n // Better would be to look according to the window type, but it's not set in firebug.xul\r\...
[ "0.56079155", "0.5497991", "0.547729", "0.5415007", "0.53434044", "0.52995867", "0.5214757", "0.52064294", "0.516431", "0.5124403", "0.5034504", "0.50210106", "0.5010384", "0.5008157", "0.5007739", "0.49940875", "0.4971738", "0.4939825", "0.49006525", "0.4891507", "0.48728648...
0.68554956
0
Given a potential list of paths in potentialPaths array, we will find the path that has the longest suffix matching filePath. For example, if filePath is /usr/local/foo/bar/main.go and potentialPaths are abc/xyz/main.go, bar/main.go then bar/main.go will be the result. NOTE: This function assumes that potentialPaths ar...
findPathWithBestMatchingSuffix(filePath, potentialPaths) { if (!potentialPaths.length) { return; } if (potentialPaths.length === 1) { return potentialPaths[0]; } const filePathSegments = filePath.split(/\/|\\/).reverse(); let bestPathSoFar = potent...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function guessBestFile(componentName, files) {\n\t\tvar minDist = 1e13;\n\t\tvar minDistIndex = -1;\n\n\t\tfiles.sort(function(a, b) {\n\t\t\t// Reverse order by path length\n\t\t\treturn b.length - a.length;\n\t\t});\n\n\t\tfiles.forEach(function(filepath, i) {\n\t\t\tvar filename = path.basename(filepath, '.js')...
[ "0.57186174", "0.5620142", "0.5520855", "0.5501948", "0.54199576", "0.5341415", "0.5283314", "0.5174577", "0.51644886", "0.5110601", "0.49932626", "0.4975165", "0.49744117", "0.49311548", "0.49229297", "0.49125078", "0.49109536", "0.49005854", "0.4892402", "0.48556936", "0.48...
0.8338312
0
Given a local path, try to find matching file in the remote machine using remote sources and remote packages info that we get from Delve. The result would be cached in localToRemotePathMapping.
inferRemotePathFromLocalPath(localPath) { if (this.localToRemotePathMapping.has(localPath)) { return this.localToRemotePathMapping.get(localPath); } const fileName = getBaseName(localPath); const potentialMatchingRemoteFiles = this.remoteSourcesAndPackages.remoteSourceFilesNa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "inferLocalPathFromRemotePath(remotePath) {\n if (this.remoteToLocalPathMapping.has(remotePath)) {\n return this.remoteToLocalPathMapping.get(remotePath);\n }\n const convertedLocalPackageFile = this.inferLocalPathFromRemoteGoPackage(remotePath);\n if (convertedLocalPackageFil...
[ "0.7538208", "0.65707064", "0.64435804", "0.59277695", "0.56827164", "0.5670315", "0.54270947", "0.54106766", "0.53663033", "0.53552556", "0.5335322", "0.53215265", "0.5298025", "0.5298025", "0.5298025", "0.5298025", "0.5298025", "0.5213136", "0.5213136", "0.517126", "0.51653...
0.7932276
0
Given a remote path, try to infer the matching local path. We attempt to find the path in local Go packages as well as workspaceFolder. Cache the result in remoteToLocalPathMapping.
inferLocalPathFromRemotePath(remotePath) { if (this.remoteToLocalPathMapping.has(remotePath)) { return this.remoteToLocalPathMapping.get(remotePath); } const convertedLocalPackageFile = this.inferLocalPathFromRemoteGoPackage(remotePath); if (convertedLocalPackageFile) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "inferRemotePathFromLocalPath(localPath) {\n if (this.localToRemotePathMapping.has(localPath)) {\n return this.localToRemotePathMapping.get(localPath);\n }\n const fileName = getBaseName(localPath);\n const potentialMatchingRemoteFiles = this.remoteSourcesAndPackages.remoteSou...
[ "0.78542835", "0.7670847", "0.76424813", "0.72361857", "0.6659121", "0.5701764", "0.55379444", "0.55379444", "0.54453963", "0.5417784", "0.5195533", "0.5180053", "0.51375794", "0.511818", "0.50181454", "0.49685282", "0.49408484", "0.49408484", "0.49375924", "0.49349368", "0.4...
0.84042376
0
Given a remotePath, check whether the file path exists in $GOPATH. This can be either in $GOPATH/pkg/mod or $GOPATH/src. If so, return that path. remotePath can be something like /usr/local/gopath/src/helloworld/main.go and relativeRemotePath should be helloworld/main.go. In other words, relativeRemotePath is a relativ...
inferLocalPathInGoPathFromRemoteGoPackage(remotePathWithLocalSeparator, relativeRemotePath) { // Scenario 1: The package is inside $GOPATH/pkg/mod. const gopath = (process.env['GOPATH'] || '').split(path.delimiter)[0]; const indexGoModCache = remotePathWithLocalSeparator.indexOf(`${this.localPat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "inferLocalPathInGoRootFromRemoteGoPackage(remotePathWithLocalSeparator, relativeRemotePath) {\n const srcIndex = remotePathWithLocalSeparator.indexOf(`${this.localPathSeparator}src${this.localPathSeparator}`);\n const goroot = this.getGOROOT();\n const localGoRootImportPath = path.join(goroot,...
[ "0.6919476", "0.6779414", "0.6203957", "0.6033087", "0.59763825", "0.5835496", "0.5762555", "0.57515496", "0.5705098", "0.56715935", "0.54773265", "0.54029953", "0.5313825", "0.5308226", "0.52977914", "0.5295716", "0.5276542", "0.5273774", "0.5267486", "0.5259472", "0.5258176...
0.751131
0
evaluateRequest is used both for the traditional expression evaluation ( and for the 'call' command support. If the args.expression starts with the 'call' keyword followed by an expression that looks like a function call, the request is interpreted as a 'call' command request, and otherwise, interpreted as `print` comm...
evaluateRequest(response, args) { log('EvaluateRequest'); // Captures pattern that looks like the expression that starts with `call<space>` // command call. This is supported only with APIv2. const isCallCommand = args.expression.match(/^\s*call\s+\S+/); if (!this.delve.isApiV1 &...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function evaluateViaProtocol(exec_state, expression, additional_context, frame_argument_adder) {\r\n var dcp = exec_state.debugCommandProcessor(\"unspecified_running_state\");\r\n request_json = {\"seq\":17,\"type\":\"request\",\"command\":\"evaluate\", arguments: { \"expression\": expression } };\r\n frame_arg...
[ "0.5948447", "0.5917516", "0.56875277", "0.56295186", "0.54872024", "0.5322888", "0.5193083", "0.5062304", "0.50198287", "0.5017924", "0.50171417", "0.5003272", "0.49496657", "0.4936971", "0.49341372", "0.49040467", "0.48494262", "0.4827758", "0.4806822", "0.4805291", "0.4782...
0.6771287
0
Initializing remote packages and sources. We use event model to prevent race conditions.
initializeRemotePackagesAndSources() { return __awaiter(this, void 0, void 0, function* () { if (this.remoteSourcesAndPackages.initializedRemoteSourceFiles) { return; } if (!this.remoteSourcesAndPackages.initializingRemoteSourceFiles) { try { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "initializeRemotePackagesAndSources(delve) {\n return __awaiter(this, void 0, void 0, function* () {\n this.initializingRemoteSourceFiles = true;\n try {\n // ListPackagesBuildInfo is not available on V1.\n if (!delve.isApiV1 && this.remotePackagesBuildInfo...
[ "0.66504896", "0.6512486", "0.6345889", "0.61604536", "0.6160169", "0.6062817", "0.6056236", "0.60140973", "0.6010168", "0.5977616", "0.5929326", "0.5929326", "0.5897614", "0.5872972", "0.58345467", "0.5805358", "0.57605916", "0.57552516", "0.57323575", "0.5726632", "0.571839...
0.67571545
0
Go might return more than one result while DAP and VS Code do not support such scenario but assume one single result. So, wrap all return variables in one madeup, nameless, invalid variable. This is similar to how scopes are represented. This assumes the vars are the ordered list of return values from a function call.
wrapReturnVars(vars) { // VS Code uses the value property of the DebugVariable // when displaying it. So let's formulate it in a user friendly way // as if they look like a list of multiple values. // Note: we use only convertDebugVariableToProtocolVariable's result, // which mea...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function returnLocals() {\n let local = \"this is a local variable\";\n var localTwo = \"this is also a local variable\";\n return local + localTwo;\n}", "function doSomething_v3() {\n let a = 1;\n let b = 2;\n return ( a \n + b \n );\n}", "function vartest() {\n let variable...
[ "0.62199354", "0.59291637", "0.5760174", "0.56708294", "0.56605476", "0.5624654", "0.55198294", "0.542336", "0.5316539", "0.5307885", "0.5286083", "0.52710986", "0.5267126", "0.52546954", "0.52503085", "0.5246415", "0.52292067", "0.52282614", "0.5224331", "0.52199256", "0.518...
0.704701
0
Returns true if the debuggee is running. The call getDebugState is nonblocking so it should return almost instantaneously. However, if we run into some errors, we will fall back to the internal tracking of the debug state. TODO: If Delve is not in multiclient state, we can simply track the running state with continueRe...
isDebuggeeRunning() { return __awaiter(this, void 0, void 0, function* () { try { this.debugState = yield this.delve.getDebugState(); return this.debugState.Running; } catch (error) { this.logDelveError(error, 'Failed to get sta...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isRunning() {\n return this._process !== null;\n }", "isDebuggerAttached() {\n return RNCrashes.isDebuggerAttached();\n }", "function isDebug() {\n return process.env[\"RUNNER_DEBUG\"] === \"1\";\n }", "isRunning() {\n return this.outEnv.isRunning();\n }", "getDe...
[ "0.63634413", "0.6357018", "0.6229974", "0.622945", "0.60665643", "0.60347843", "0.6020287", "0.6020287", "0.6020287", "0.6020287", "0.6020287", "0.6020287", "0.6020287", "0.6020287", "0.6020287", "0.6020287", "0.6020287", "0.6020287", "0.6020287", "0.6020287", "0.6020287", ...
0.7748104
0
evaluateCallImpl expects args.expression starts with the 'call ' command.
evaluateCallImpl(args) { const callExpr = args.expression.trimLeft().slice(`call `.length); // if args.frameID is 'not specified', expression is evaluated in the global scope, according to DAP. // default to the topmost stack frame of the current goroutine let goroutineId = -1; l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function evaluateCallExpression({ node, environment, evaluate, statementTraversalStack, typescript, logger }) {\n const evaluatedArgs = [];\n for (let i = 0; i < node.arguments.length; i++) {\n evaluatedArgs[i] = evaluate.expression(node.arguments[i], environment, statementTraversalStack);\n }\n ...
[ "0.7078152", "0.6207117", "0.61760664", "0.6095635", "0.60168517", "0.6012981", "0.58828324", "0.58828324", "0.5872219", "0.5824327", "0.578816", "0.5734946", "0.5640631", "0.5631283", "0.5631283", "0.56202304", "0.56011343", "0.55477303", "0.5542097", "0.5482659", "0.5421327...
0.7992914
0
queryGOROOT returns `go env GOROOT`.
function queryGOROOT(cwd, env) { return new Promise((resolve) => { child_process_1.execFile(pathUtils_1.getBinPathWithPreferredGopathGoroot('go', []), ['env', 'GOROOT'], { cwd, env }, (err, stdout, stderr) => { if (err) { return resolve(''); } return resol...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function basePathEnv(){\n let pathObj = path.dev_scripts;\n pkg.env = '_dev';\n if ( env == 'release' ) {\n pathObj = path.scripts;\n pkg.env = '';\n }\n return pathObj;\n}", "gopath (options = {}) {\n let e = this.rawEnvironment(options)\n if (isFalsy(e.GOPATH) || e.GOPATH.tri...
[ "0.634715", "0.58523554", "0.5459562", "0.5388285", "0.53711915", "0.5339139", "0.52741504", "0.5258899", "0.5250107", "0.5174085", "0.51348364", "0.5124482", "0.512265", "0.50904846", "0.50802743", "0.5056093", "0.5056093", "0.5051622", "0.5032633", "0.4963057", "0.49430388"...
0.7627384
0
Adds IDs to all resources in the request, to simulate the request being saved to a database
function addIds(url, req) { req = JSON.parse(req); let current_id = 1; if (req.data instanceof Array) { for (let datum of req.data) { datum.id = current_id++; } } else { req.data.id = current_id++; } if (req.included) { for (let datum of req.included) { datum.id = current_id++; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fillInIds() {\n entityObj.curRcrds = attachTempIds(entityObj.curRcrds); //console.log(\"entityObj.curRcrds = %O\", entityObj.curRcrds)\n }", "updateAssignmentResourceIds() {\n this.assigned.forEach(assignment => {\n assignment.resourceId = this.id;\n });\n }", "function createEx...
[ "0.64413434", "0.6007769", "0.59854245", "0.58391684", "0.57647955", "0.5752391", "0.56569797", "0.55884737", "0.557739", "0.55440605", "0.55219346", "0.549339", "0.5476506", "0.5395161", "0.53840804", "0.53652996", "0.53333277", "0.5312217", "0.5307107", "0.53067684", "0.528...
0.68885463
0
Changes the tasted property of a beer
changeTasted(state, beerId) { state.indexedBeers[beerId].tasted = !state.indexedBeers[beerId].tasted; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "changeBeer(state, beer) {\n state.currentlyShownBeer = beer;\n }", "hunt () {\n this.food += 2;\n }", "function setBeverages(beverages) {\n setItem('beverages', JSON.stringify(beverages));\n}", "function eat(snake, food) {\n\tsnake.belly = food.value;\n\tresetFood();\n}", "plant(berry)...
[ "0.679029", "0.5834302", "0.5721468", "0.56072515", "0.5600985", "0.549271", "0.54889405", "0.5421497", "0.5419953", "0.5408708", "0.5392857", "0.5378696", "0.5355579", "0.5353143", "0.5341476", "0.5337822", "0.53241885", "0.532055", "0.53129673", "0.5293984", "0.52662", "0...
0.7865605
0
Changes the currently shown beer
changeBeer(state, beer) { state.currentlyShownBeer = beer; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "changeTasted(state, beerId) {\n state.indexedBeers[beerId].tasted = !state.indexedBeers[beerId].tasted;\n }", "function edit_current_meal()\n{\n // Toggle edit mode\n is_edit_mode = true;\n\n // Save the current meal before we edit it so we can recover if the user\n // decides to cancel the...
[ "0.62562865", "0.5770465", "0.5735383", "0.5722946", "0.5711549", "0.56968045", "0.5675361", "0.5658133", "0.5634899", "0.5622717", "0.56157744", "0.55806124", "0.55612224", "0.55571663", "0.549879", "0.54873484", "0.5474162", "0.54688114", "0.5467218", "0.54567295", "0.54496...
0.80422944
0
Create the hosts table
function createallhoststable() { var aii_actions = ['boot', 'install', 'reinstall', 'configure']; /** * Icon mapping * @type {{install: string, boot: string, reinstall: string, configure: string}} */ var icon = { 'install': 'glyphicon-save', 'boot': 'glyphicon-hdd', 'r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createTable() {\n var conn = Jdbc.getCloudSqlConnection(dbUrl, user, userPwd);\n conn.createStatement().execute('CREATE TABLE entries ' +\n '(guestName VARCHAR(255), content VARCHAR(255), ' +\n 'entryID INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(entryID));');\n}", "function createTasksTable() ...
[ "0.6829899", "0.59437907", "0.59437907", "0.58490276", "0.57216877", "0.569704", "0.5670297", "0.5647416", "0.56454104", "0.55142224", "0.55049187", "0.54956216", "0.5408293", "0.54078", "0.53680766", "0.53544813", "0.53382456", "0.53132725", "0.52818954", "0.52798766", "0.52...
0.6707013
1
A cursor has a `position` and a `selectionEnd`. Both are zerobased indexes into the document. When nothing is selected, `selectionEnd` is equal to `position`. When there is a selection, `position` is always the side of the selection that would move if you pressed an arrow key.
function Cursor (position, selectionEnd) { this.position = position; this.selectionEnd = selectionEnd; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCursorPosition() {\n var selection = window.getSelection();\n return {\n node: selection.anchorNode,\n offset: selection.anchorOffset\n };\n }", "function cursorIndex() {\r\n var current = selection.createRange(),\r\n diff = current.duplicate();\r\n\r\n di...
[ "0.71892565", "0.7024138", "0.69026583", "0.6634448", "0.66280985", "0.6613139", "0.6581627", "0.6483872", "0.6445604", "0.6445604", "0.6445604", "0.63977474", "0.6388559", "0.6383805", "0.6364699", "0.6330685", "0.6269838", "0.62197", "0.6216669", "0.6198417", "0.6194489", ...
0.7556046
1
Ajoute l'item (itemId) dans la collection du user (userId)
function addItemToCollection(itemId,userId){ const fs = require('fs'); let userList = User.getList(); if(!userList) return false; for(let i = 0; i < userList.length; i++){ if(userList[i].idUser == userId ){ let list = userList[i].itemCollections; list.push(parseInt(itemId)); userList[i].i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "sendItem(userId, name, description, cb) {\n const itemRef = firebase.database().ref(userId);\n const newItem = {\n name,\n description,\n completed: false\n }\n itemRef.push(newItem);\n cb(true)\n }", "function addUserToElement(userID,itemNo) {\n\t\tvar idListLength, i;\n\t\tidList...
[ "0.68648154", "0.682049", "0.67237896", "0.66851395", "0.66169107", "0.6537568", "0.6406142", "0.62882507", "0.62661916", "0.6229941", "0.6229941", "0.62293386", "0.61771953", "0.6135345", "0.61053306", "0.6103072", "0.6081636", "0.60540074", "0.60536015", "0.60519", "0.59972...
0.77867055
0
cue/prompt above each digit (string) (e.g., +3, 2)
function update_prompt(digit) { var s; if (digit >= 0) { s = "+" + digit; } else { s = "&#x2212;" + Math.abs(digit); // minus sign } return s; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function numeralsPrompt() {\n numerals = confirm(\"Should your password include numbers?\");\n if (numerals) {\n possibleChars = possibleChars.concat(numericChars);\n }\n specialsPrompt();\n}", "function scorerPrompt(word) {\n\n let numEntered = -1;\n let newLine = '';\n \n while(!(numEntered === 0 || nu...
[ "0.6853479", "0.6113789", "0.6093274", "0.6084862", "0.5964064", "0.5913957", "0.58954024", "0.5876334", "0.5871003", "0.571146", "0.569684", "0.5695611", "0.5690129", "0.5679038", "0.5676152", "0.5662654", "0.56381804", "0.5614433", "0.56128186", "0.5602825", "0.56019956", ...
0.712633
0
Create database tables if they are missing
function createTablesIfNotExists(cb) { var sql; log.debug('larvitcms: createTablesIfNotExists() - Running'); sql = 'CREATE TABLE IF NOT EXISTS `cms_pages` (`id` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, `published` tinyint(3) unsigned N...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createTables()\n{\n \n if( location.hash.indexOf('DropTables') >= 0 ) {\n\t\t dropAllTables();\n\t\t return;\n\t\t}\n \n\tfilesDB.transaction(\n function (transaction) {\n transaction.executeSql('CREATE TABLE IF NOT EXISTS files(id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, LastMod...
[ "0.7496996", "0.7344475", "0.7270102", "0.7023875", "0.68997264", "0.6842233", "0.6808937", "0.68023777", "0.6795242", "0.67708075", "0.6764138", "0.6732252", "0.67231375", "0.6589378", "0.6577899", "0.65549064", "0.6532346", "0.6484253", "0.6470452", "0.6430406", "0.64212126...
0.75467515
0
toggle a note (switching a note from being 'complete' to 'not yet complete' and viceversa)
function toggle(noteId) { if (confirm('Are you sure?')) { // get all details from the note var tM = { title:$("#title"+noteId).text(), note:$("#note"+noteId).text(), // switch its status completed: ((($("#completed"+noteId).attr("value")) == 0)? 1:0) }; // add the new one to FirebaseDB notesdb.pu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toggleNote() {\n if ($('#playNoteToggle').html()[0] == \"▶\") {\n synth.playFreq(0, res.hertz, organ);\n $('#playNoteToggle').html(\"■ Stop note\");\n }\n else {\n stopNoteIfActive();\n }\n}", "function toggleNotes(con){\n\tif(con){\n\t\tcurNote++;\t\n\t\tcurNote = curNote > music_arr[curMu...
[ "0.6813971", "0.65997493", "0.64956397", "0.6415838", "0.6229093", "0.6193991", "0.6111295", "0.60967374", "0.60864717", "0.60363925", "0.6000693", "0.59624755", "0.591272", "0.5905221", "0.58686984", "0.58506334", "0.58475685", "0.5820008", "0.5792406", "0.576737", "0.576062...
0.69460994
0
Inicializa la instancia Singleton de `GraphicsRenderer` del programa y la asocia al contexto de canvas especificado.
static initInstance(context) { if (!GameLoop.instance) { throw new Error("GameLoop no se ha iniciado todavía. Por favor inicia GameLoop antes de instanciar GraphicsRenderer."); } var ret = new GraphicsRenderer(context); GraphicsRenderer.initSingleton(ret); GameLoop.in...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function add_canvas_renderer(params)\n\t{\n\t\tparams.game_object = self;\n\t\tself.renderer = new Canvas_Renderer(params);\n\t}", "setupRenderer() {\n const settings = this.settings;\n const deviceScale = this.deviceScale;\n\n this.renderer = settings.webGLEnabled\n ? PIXI.autoDetectRenderer(set...
[ "0.7013593", "0.67738885", "0.67188966", "0.6460683", "0.6324144", "0.6167036", "0.61640716", "0.6122492", "0.610795", "0.60764426", "0.606959", "0.6052138", "0.60455865", "0.6039232", "0.60202414", "0.5980484", "0.59735477", "0.597085", "0.5968317", "0.59562856", "0.5952191"...
0.6958049
1
Renderiza todas las entidades al canvas.
render() { this.clearCanvas(); this.sortEntities(); this.updateScrollToFollow(); for (let entity of this.entities) { if (!entity.visible) break; if (entity.shouldBeCulled(this.scrollX, this.scrollY)) continue; entity.ren...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function render () {\r\n ctx.clearRect(0,0,canvas.width,canvas.height);\r\n cenario.fase();\r\n cenario.gera();\r\n player.calculoContagens();\r\n detectaEstado(); \r\n objchao.mostra()\r\n fisica.calculo();\r\n ...
[ "0.6904969", "0.6865865", "0.67368674", "0.6679433", "0.6615997", "0.6537775", "0.6493081", "0.6489393", "0.64767396", "0.6471663", "0.6450729", "0.6437315", "0.6433957", "0.64191127", "0.64127964", "0.64028645", "0.64028645", "0.6395764", "0.63911164", "0.63843215", "0.63768...
0.73479855
0
Devuelve el contexto del canvas en uso por el GraphicsRenderer.
getCanvasContext() { return this.context; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "context() {\n return this._canvas.getContext('2d');\n }", "function prepareContext(canvas) {\n return canvas.getContext(\"2d\");\n}", "getContext() {\n return this.canvas.getContext('2d')\n }", "set canvas (context) {\n\t\tthis._ctx = context\n\t}", "get context () {\n\t\treturn {\n\t\t\tbas...
[ "0.7477329", "0.73322105", "0.7256893", "0.71373975", "0.6865602", "0.6816794", "0.67564327", "0.66718644", "0.6591204", "0.6585486", "0.65627134", "0.65563065", "0.65530217", "0.6544452", "0.6494601", "0.64811844", "0.6479419", "0.6475143", "0.6436494", "0.64193135", "0.6394...
0.7701109
0
activate a script command command: a string of script command callback: a function of callback function
function activateScript(command, callback){ var exec = require('child_process').exec; exec(command, function(error, stdout, stderr) { console.log(stdout) callback(stdout); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setScript(name, command) {\n this.scripts[name] = [command];\n }", "function script(command, callback)\n\t{\n\t\t// run Jmol script\n\t\tJmol.script(_applet, command);\n\n\t\t// call the callback function after script completed\n\t\tif(_.isFunction(callback))\n\t\t{\n\t\t\tcallback();\n\t\t}\n\t}", "...
[ "0.62340415", "0.6021369", "0.5949914", "0.5890416", "0.58207595", "0.58091944", "0.5789137", "0.5749622", "0.57325476", "0.5708375", "0.5691154", "0.5635184", "0.5623383", "0.56143486", "0.5606498", "0.5586167", "0.5556486", "0.5555821", "0.5528595", "0.5512823", "0.5493635"...
0.7332181
0
parse mas output from string to json stdout: string of mas output
function parseMasOutput(stdout){ var masList = stdout.split("\n"); var result = { os: thisOS, softwares: {} } var softwareList = []; masList.forEach((s)=>{ if (s != ""){ var slist = s.split(" "); var id = slist[0]; var name = slist[1]; var old_version = slist[2].split("(")[1]; var new_version ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parse_output(s) {\n var d = {};\n s.trim().split('\\n').forEach(function(line) {\n var split = line.trim().split(/\\s+/);\n d[split[0]] = +split[1];\n });\n return d;\n}", "function parseFileOutput(stdout) {\n const spl = stdout.trim().split(' - ', 2);\n return {\n Package: spl[0],\n V...
[ "0.6063997", "0.5748495", "0.57279104", "0.5678917", "0.56377023", "0.56220067", "0.5596375", "0.5531206", "0.55186486", "0.5506365", "0.55025893", "0.5500432", "0.5456397", "0.54426813", "0.5423139", "0.5309046", "0.5307821", "0.5275008", "0.52709514", "0.5255551", "0.524144...
0.6827391
0
activate python to scrap the latest version of softwares that are install on this computer args: argument to send to the python scraper. The software names localSoftwares_incomplete: the local softwares json(a list of json of local software's info)
function setCompleteInfo(args, localSoftwares_incomplete){ var options = { mode: 'text', args: args }; var returnList = []; PythonShell.run('/localhost/java_interface.py', options, function (err, results) { if (err) throw err; // results is an array consisting of messages collected during execut...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkNewApp (){\n\tif (lastUpdate == undefined){\n\t\tactivateScript(\"system_profiler SPApplicationsDataType\", (stdout)=>{\n\t\t\tvar softwareInfos = stdout.split(\"\\n\\n\");\n\t\t\tvar softwareName;\n\t\t\tvar softwareNames = [];\n\t\t\tvar localSoftwares_incomplete = [];\n\t\t\tsoftwareInfos.forEach(...
[ "0.57569724", "0.5702465", "0.5548475", "0.5438631", "0.5301286", "0.517901", "0.51624525", "0.50609374", "0.50400215", "0.49633798", "0.4925953", "0.48803818", "0.48660097", "0.48157945", "0.47907525", "0.4775548", "0.47709736", "0.47597647", "0.47536904", "0.47444808", "0.4...
0.65962726
0
the monthly(argument)rent: invoke it and assign it to a variable which will represent an apt console log the apt Then create a function that will account for: rent, salary, and a person's name and calculate our bottom line in regards to our rent and salary invoke it, do not forget to pass in actual values for our argum...
function anualRent(monthly){ var anual = monthly * 12; return anual; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function monthly(monthName, income, food, rent) {\n this.monthName = monthName\n this.income = income;\n this.food = food;\n this.rent = rent;\n this.calculateExcess = function() {\n var totalExpenses = this.food + this.rent;\n return this.income - totalExpenses;\n };\n}", "function annSalCal(salary)...
[ "0.69503427", "0.67564166", "0.6522332", "0.6304941", "0.6281188", "0.6248494", "0.6075802", "0.60727656", "0.60245144", "0.5996482", "0.5996112", "0.5984974", "0.5976146", "0.5972329", "0.5926378", "0.59099877", "0.5879461", "0.57970065", "0.57869893", "0.57858443", "0.57752...
0.68996096
1
returns the title to be used in the show_window. if show_window_options has a title, just return that. else if there is a tile in layout, extract it trom there and return that. else make up a title from the data and return that. Thus if you want a window that uses the layout title IN THE PLOT and not in the show_window...
static make_show_window_title(data, show_window_options){ let title if(show_window_options && show_window_options.title) { title = show_window_options.title } else { if(data instanceof Job){ title = "Path of Job." + data.name } else if (data === Job){ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getShowTitle(whichType) {\r var whichShow;\r\r switch (whichType) {\r case \"L3D\":\r for (var i = 1; i <= showTitleComp.numLayers; i++) {\r if (showTitleComp.layer(i).enabled) {\r showTitleLayer = showTitleComp.layer(i);\r }\r }\r whichShow = s...
[ "0.6567575", "0.5938091", "0.59282166", "0.58043784", "0.5678234", "0.5675127", "0.56278384", "0.56157774", "0.5579905", "0.5494665", "0.54731613", "0.54705805", "0.5449685", "0.5449685", "0.5419596", "0.53996897", "0.53873587", "0.5348749", "0.53386974", "0.53198624", "0.530...
0.7485302
0
if there is a title in layout. we should keep it rther than move it to show_window_header. sp return true otherwisde return false. Used by fix_margin to give title space at top of plot
static has_plotly_title(layout){ if(!layout) { return false } //no plotly title to keep else if (!layout.title) { return false } //no plotly title to keep else if ((typeof(layout.title) === "string") || layout.title.text) { //got a plotly title return true //make space for...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function check_page_title_status() {\r\n /*\r\n First we check if the user scroll from top\r\n is the same as the offset from the first\r\n content which in our case is the same as\r\n the window height and then if it's higher\r\n we make the title fixed to the window.\r\n */\r\n if (window_scroll <= windo...
[ "0.6496817", "0.6234066", "0.6229853", "0.61539286", "0.6108834", "0.6095566", "0.59857285", "0.5976962", "0.594884", "0.5945967", "0.59257716", "0.59257716", "0.5921472", "0.5918919", "0.5902938", "0.5874347", "0.5867515", "0.58658934", "0.58562917", "0.5834486", "0.5825417"...
0.7300947
0
arr is an array of job instances or traces
static replace_jobs_with_traces(arr){ let result = [] for(let trace_index = 0; trace_index < arr.length; trace_index++){ let job_maybe = arr[trace_index] if(job_maybe instanceof Job){ let traces = this.job_to_3_traces(job_maybe, trace_index) result.push(tr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "runLoc(array){\n var holder = array;\n var array = [];\n for(var m = 0; m < 75; m++){\n var address = holder[m].addAddress1.replace(/'/g, \"\\-\");\n array.push({ id: holder[m].addID, street: address,\n city: holder[m].addCity, state: holder[m].addState, zip: holder[m].addZip });\n }\n...
[ "0.5490378", "0.5214904", "0.5056443", "0.50335324", "0.503061", "0.50219977", "0.50154924", "0.5012068", "0.49764383", "0.49416158", "0.49185926", "0.49142048", "0.49142048", "0.48933914", "0.48573372", "0.48309442", "0.4818222", "0.48134613", "0.479322", "0.4793042", "0.479...
0.78182566
0
Returns a random point in the regular hexagon at (0,0) with given hex radius on the Z=0 plane.
function randomPointInHexagon(hexRadius) { // the hexagon consists of 6 triangles, construct one of them randomly var startCornerIndex = Math.floor(Math.random() * 6); var A = computeHexagonCorner(hexRadius, ((startCornerIndex + 0) % 6) / 6.0); var B = new three_1.Vector3(0, 0, 0); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function randomPointInHexagonEx(hexRadius, modifier) {\n\t // the hexagon consists of 6 triangles, construct one of them randomly\n\t var startCornerIndex = Math.floor(Math.random() * 6);\n\t var A = hexagonCorners1[startCornerIndex].clone();\n\t var B = new three_1.Vector3(0, 0, 0);\n\...
[ "0.77369714", "0.7106871", "0.68700784", "0.6850338", "0.68248874", "0.67658997", "0.67154765", "0.6697107", "0.6631687", "0.6562975", "0.65576464", "0.63711625", "0.632177", "0.62935597", "0.62887365", "0.62612045", "0.62175846", "0.616575", "0.6149288", "0.61352146", "0.612...
0.82506573
0
Returns a random point in the regular hexagon at (0,0) with given hex radius on the Z=0 plane.
function randomPointInHexagonEx(hexRadius, modifier) { // the hexagon consists of 6 triangles, construct one of them randomly var startCornerIndex = Math.floor(Math.random() * 6); var A = hexagonCorners1[startCornerIndex].clone(); var B = new three_1.Vector3(0, 0, 0); var C ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function randomPointInHexagon(hexRadius) {\n\t // the hexagon consists of 6 triangles, construct one of them randomly\n\t var startCornerIndex = Math.floor(Math.random() * 6);\n\t var A = computeHexagonCorner(hexRadius, ((startCornerIndex + 0) % 6) / 6.0);\n\t var B = new three_1.Vector...
[ "0.8251903", "0.7109049", "0.68712914", "0.6851416", "0.68264395", "0.6767949", "0.6716502", "0.6699218", "0.66332877", "0.6562818", "0.6559671", "0.63727343", "0.6322257", "0.62943166", "0.6289324", "0.6263699", "0.62200266", "0.6167803", "0.61521107", "0.61380184", "0.61271...
0.77373767
1
Transforms mouse coordinates into world space, assuming that the game view spans the entire window.
function mouseToWorld(e, camera) { var mv = new three_1.Vector3((e.clientX / window.innerWidth) * 2 - 1, -(e.clientY / window.innerHeight) * 2 + 1, 0.5); var raycaster = pickingRay(mv, camera); return raycaster.ray.intersectPlane(Z_PLANE); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "screenToWorld(x, y) {\n if (y === undefined) {\n y = x.y;\n x = x.x;\n }\n\n let M = this.ctx.getTransform().invertSelf();\n\n let ret = {\n x: x * M.a + y * M.c + M.e,\n y: x * M.b + y * M.d + M.f,\n };\n\n return ret;\n }", "function onMouseMove( event ) {\n // normali...
[ "0.68500453", "0.6803172", "0.6719048", "0.6637098", "0.66314536", "0.6626734", "0.66155267", "0.66045827", "0.6566897", "0.6556139", "0.6545621", "0.6521542", "0.6519635", "0.6517713", "0.6452828", "0.6425053", "0.64100784", "0.6404245", "0.63807064", "0.6378412", "0.6335828...
0.7037705
0
Generates are square map of the given size centered at (0,0).
function generateMap(size, tile) { return __awaiter(this, void 0, void 0, function () { var grid, withRivers; return __generator(this, function (_a) { grid = new Grid_1.default(size, size).mapQR(function (q, r) { return tile(q, r); }); withRivers = ge...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateMap() {\n for (let x = 0; x < mapSize; x++) {\n map.push([]);\n for (let y = 0; y < mapSize; y++) {\n map[x].push(new Tile(x, y));\n }\n }\n\n generateOutline();\n}", "map(x, y, w, h, sx, sy) {\n let mapArray = this.mapData[0].layers[0].data;\n ...
[ "0.6849984", "0.67031264", "0.6659207", "0.66477066", "0.65620667", "0.6458581", "0.63776296", "0.63734764", "0.63673246", "0.6336352", "0.6292491", "0.62910056", "0.6194038", "0.61170095", "0.6104938", "0.60959226", "0.6034084", "0.60309756", "0.60224444", "0.60128546", "0.6...
0.6717797
1
Computes the water adjecency for the given tile.
function waterAdjacency(grid, tile) { function isWaterTile(q, r) { var t = grid.get(q, r); if (!t) return false; return interfaces_1.isWater(t.height); } return { NE: isWaterTile(tile.q + 1, tile.r - 1), E: isWa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function myTileHeight(i, j){\n\n if(noise(i, j) > 0.86 && noise(i, j) <= 1.0){\n boatPoints.push(i);\n boatPoints.push(j);\n\n for(var k = 0; k < boatPoints.length; k += 2){\n if(i == boatPoints[k] && j == boatPoints[k+1]){\n return 2.2; //returning boat\n }\n }\n }\n\n //scanning f...
[ "0.55600345", "0.54772806", "0.5461696", "0.53427887", "0.525815", "0.5252647", "0.52484035", "0.5208303", "0.5173177", "0.51653177", "0.5115847", "0.50758636", "0.5063571", "0.50496286", "0.5043631", "0.5016966", "0.5000812", "0.49401805", "0.49351367", "0.48990032", "0.4888...
0.64079803
0
console.log(futureTime); functionality for the countdown subtract the future day to current day
function getRemainingTime() { // get current date and time const today = new Date().getTime(); // console.log(today); // future time - current time const t = futureTime - today; // value in minisecond // console.log(t); // 1s = 1000ms // 1m = 60s // 1hr = 60minutes // 1 day = 24 hours // mini...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getRemaindingTime() {\n //Get current time (in ms)\n const today = new Date().getTime();\n //Create variable t, this is the difference between the furtureTime and present time\n const t = futureTime - today;\n\n /* Reference to convert everything to milliseconds\n // 1s = 1000ms\n // 1m = 60s\n //...
[ "0.69403213", "0.6763315", "0.6517797", "0.6390959", "0.6387396", "0.6352359", "0.62969345", "0.62702584", "0.626517", "0.6262874", "0.6246223", "0.6235517", "0.62122834", "0.61306405", "0.6108578", "0.6095299", "0.6073936", "0.6042258", "0.60328233", "0.6017845", "0.60124594...
0.73098713
0
~~~js executeRunner(fn, ctx)(x) ~~~ Calls `fn` with context `ctx` and argument `x` and returns the result as a promise If `fn` is a generator function it is executed as Promise coroutine and the result is returned
function executeRunner (fn, ctx) { return function (x) { try { const res = fn.call(ctx, x) if (res && res.next && res.throw) { return co(res) } else { return Promise.resolve(res) } } catch (e) { return Promise.reject(e) } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "runner(ctx: ExcelContext, callable: Function): Promise<any> {\n this.openWithContext(ctx);\n callable(); // resolve open() promise\n return Promise.resolve(); // Excel.run() must return a promise\n }", "function doRunAsync(fn, ...args) {\n if (fn.length === args.length + 1) { //expects callback\n ...
[ "0.60038143", "0.59934825", "0.56986314", "0.56986314", "0.5533674", "0.55292237", "0.55069923", "0.55069923", "0.550535", "0.5498069", "0.54733425", "0.54678386", "0.54461485", "0.5382028", "0.5363233", "0.533712", "0.53213954", "0.5311325", "0.53079796", "0.52254903", "0.52...
0.84942234
0
node utils\streams a=bundlecss path=assets/css
function cssBundler(_path) { if (_path == "") { throw Error("bundleFilesPath parameter can't be empty!"); } fs.stat(_path, function (err, stats) { if (err && err.errno === 34) { throw Error("Directory doesn't exist"); } }); const bundleFilePath = 'assets/bundle....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bundleCss() {\n return src('./lib/**/*.css')\n .pipe(concat(TIMELINE_CSS))\n .pipe(dest(DIST))\n // TODO: nicer to put minifying css in a separate task?\n .pipe(cleanCSS())\n .pipe(rename(TIMELINE_MIN_CSS))\n .pipe(dest(DIST));\n}", "function css()\n{\n var streams = ...
[ "0.7168084", "0.686034", "0.68447596", "0.6789024", "0.67812425", "0.67616284", "0.67612475", "0.6733677", "0.6629641", "0.6573048", "0.6541961", "0.65301913", "0.6453003", "0.6439721", "0.64236677", "0.64174783", "0.6401438", "0.637979", "0.6378082", "0.6341104", "0.6332717"...
0.7124901
1
This function is used to click on Start Button on Quick CMC page
function ClickStart() { if(Btn_Start.Exists) { Btn_Start.ClickButton() Log.Message("Clicked on Start Button on Quick CMC") return true } else { Log.Message("Button Start doesn't exists") return false } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "clickStart() {\n return this\n .waitForElementVisible('@startBtn', 10000, (res) => {\n if (res.value) {\n this\n .click('@startBtn');\n } else {\n this\n .assert.ok(false, '[FAIL] - Something went wrong when clicking start button');\n }\n },...
[ "0.75942576", "0.7475331", "0.72146475", "0.7156132", "0.6929332", "0.6869524", "0.6864068", "0.6750648", "0.6705303", "0.6599712", "0.6546929", "0.6494356", "0.6426778", "0.6425479", "0.64244336", "0.64084333", "0.63947064", "0.63885367", "0.6387647", "0.63556695", "0.634195...
0.78277147
0
This function is used to launch the Quick CMC Application
function LaunchQuickCMC() { if(TestedApps.QuickCMC.Run()) { Log.Message("Launched Quick CMC Application") if(Btn_Start.Exists) { Log.Message("Quick CMC launched successfully.") return true } else { Log.Message("Start button on Quick CMC doesn't exist") return false ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function start_auto_launch() {\n \n var quarkclientAutoLauncher = new AutoLaunch({\n name: 'QuarkClient',\n // path: '/Applications/QuarkClient.app',\n // path: '\"C:\\\\Users\\\\C9G\\\\AppData\\\\Roaming\\\\uTorrent Web\\\\utweb.exe\" /MINIMIZED',\n path: basepath + '\\\\quarkclient.exe',\n });\n\n...
[ "0.63469034", "0.618939", "0.6141735", "0.6083145", "0.6045512", "0.602574", "0.5992984", "0.5959928", "0.58931106", "0.5738638", "0.5736195", "0.5678923", "0.56508964", "0.56467223", "0.5637462", "0.56295675", "0.56174767", "0.55990076", "0.5544817", "0.5525061", "0.5518819"...
0.76474935
0
This function is used to close the Quick CMC Application
function CloseQuickCMC() { var QuickCMC=Sys.WaitProcess("QuickCMC") if (QuickCMC.Exists) { QuickCMC.Close() Log.Message("Terminated Quick CMC Application") return true } else { Log.Message("Quick CMC Application doesn't exists") return false } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "closeApplication() {\n this._application.stop()\n }", "function quitFunction() {\n self.close();\n}", "function closeApp(){\n\tfor(var i=windows.length-1;i>=0;i--){\n\t\twindows[i].close();\n\t}\n\twindows = [];\n}", "function closeAPP(){\n\tnavigator.app.exitApp();\n}", "close() {\n this.sendA...
[ "0.7170869", "0.69185686", "0.6837349", "0.6717708", "0.66999227", "0.6615582", "0.6565122", "0.65402776", "0.6497298", "0.6467205", "0.6448498", "0.64230704", "0.64032406", "0.63844246", "0.63326913", "0.62803465", "0.6275039", "0.6275039", "0.6238987", "0.6238987", "0.62222...
0.78262365
0
functions //////////////////////////////////////////////////////////////////////////////// create request header utility
function createHeaderForRequest(request) { request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=utf-8'); request.setRequestHeader('username', currentUser.getUsername()); request.setRequestHeader('jid', currentUser.getJid()); request.setRequestHeader('country', 'tw'); request.setRequ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createHeader(ip, url, body) {\n var header = {\n headers: {\n \"Accept\": \"*/*\",\n \"Accept-Encoding\": \"gzip, deflate\",\n \"Accept-Language\": \"de,en-US;q=0.7,en;q=0.3\",\n \"Connection\": \"keep-alive\",\n \"Content-Length\": \"15\",\n \"Content-Type\": \"text/plai...
[ "0.7051796", "0.6888186", "0.67592573", "0.66900516", "0.65616167", "0.6480176", "0.64143145", "0.63894457", "0.6371886", "0.6362114", "0.6345466", "0.63429", "0.63381857", "0.628976", "0.62832", "0.62832", "0.6260095", "0.6260095", "0.623688", "0.62361103", "0.62330616", "...
0.7691755
0
User has joined a channel
function pubUserJoinedChannel(data) { publishToRedisChannel(data, events.USER_JOINED); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function join_channel(message, channel)\n{\n\tlet c = find_channel(channel);\n\tlet role = message.guild.roles.find(r => r.name === c.role);\n\n\tif (role == undefined) {\n\t\treturn 0;\n\t}\n\n\tif (c.optout) {\n\t\tmessage.member.removeRole(role);\n\t} else {\n\t\tif (message.member.roles.has(role)) {\n\t\t\tret...
[ "0.6725041", "0.64734316", "0.6421401", "0.6266777", "0.626412", "0.62439317", "0.6186319", "0.6168738", "0.6086493", "0.6011268", "0.60084504", "0.5935369", "0.58886033", "0.5883919", "0.5870394", "0.5855103", "0.58330905", "0.5811154", "0.5807718", "0.57936084", "0.57772726...
0.71318215
0
User has left a channel
function pubUserLeftChannel(data) { publishToRedisChannel(data, events.USER_LEFT); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function leave_channel(message, channel)\n{\n\tlet c = find_channel(channel);\n\tlet role = message.guild.roles.find(r => r.name === c.role);\n\t//let role = message.member.roles.find(r => r.name === c.role);\n\n\tif (role == undefined) {\n\t\treturn false;\n\t}\n\n\tif (!c.optout) {\n\t\tif (!message.member.roles...
[ "0.6992326", "0.6582939", "0.65824527", "0.6552164", "0.637218", "0.63008827", "0.62472796", "0.6234921", "0.62221324", "0.6167463", "0.6094085", "0.606672", "0.606572", "0.6044484", "0.60251784", "0.5963913", "0.5923137", "0.59086734", "0.58852184", "0.584876", "0.5809046", ...
0.69784737
1
All athletes of specific sport
async getAthletesBySportId(req, res) { const sport = await this.sportService.getSportById(req.params.sportId) const athletes = await this.athleteService.getAthletesById(sport.athletes) res.send(athletes) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSports() {\n hideButtonsAndText();\n let url = INDEX_URL + \"sport=list\";\n fetch(url, {mode: 'cors'})\n .then(checkStatus)\n .then(showSports)\n .catch(printError);\n }", "function Athlete(name, height, sport, quote) {\n this.name = name;\n this.height = height;\n this.s...
[ "0.5781511", "0.5730587", "0.5726709", "0.5573675", "0.5573675", "0.555279", "0.55457044", "0.55457044", "0.5543796", "0.553454", "0.5528013", "0.5525929", "0.5525929", "0.55038685", "0.55038685", "0.55038685", "0.5466368", "0.54117984", "0.5405554", "0.539837", "0.53246844",...
0.72822195
0
Add athlete in sport
async addAthleteToSport(req, res) { await this.sportService.addAthleteToSport(req.params.sportId, req.params.athleteId) res.end() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Athlete(name,age,sport,quote) {\n this.name = name;\n this.age = age;\n this.sport = sport;\n this.quote = quote;\n}", "function Athlete(name,age,sport,quote) {\n this.name = name;\n this.age = age;\n this.sport = sport;\n this.quote = quote;\n}", "function Athlete(name, age, sport, quote) {\n...
[ "0.7011607", "0.7011607", "0.7005608", "0.7005608", "0.699612", "0.6993352", "0.6979002", "0.69753355", "0.6962493", "0.6960786", "0.69458675", "0.69458675", "0.6926002", "0.6926002", "0.6926002", "0.6878878", "0.6591465", "0.65776616", "0.65456074", "0.6533002", "0.65062475"...
0.7023874
0
Remove athlete from sport
async deleteAthleteFromSport(req, res) { await this.sportService.deleteAthleteFromSport(req.params.sportId, req.params.athleteId) res.end() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "deletePacman(){\n this.remove(this.pacman);\n }", "remove(paladinID) {\n const palList = STATE.PaladinList.get();\n const index = palList.findIndex(pID => { return pID === paladinID; });\n if (index !== -1) {\n palList.splice(index, 1);\n ...
[ "0.6503531", "0.64283234", "0.6298808", "0.6101275", "0.6081448", "0.607205", "0.60581017", "0.60577965", "0.6027512", "0.6026368", "0.59647244", "0.5935689", "0.59276474", "0.587377", "0.5795319", "0.5762562", "0.5761332", "0.57385665", "0.57385087", "0.573848", "0.57090384"...
0.6976789
0
account add show block list
async getAccountAddBlockList(params) { let {data} = await xhr.post(`${this.apiUrl}/external/account/addBlockList`,params); return data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "populateBlockList() {\r\n\r\n }", "_addTabUsageBlock() {\n let tabId = 'tab-usage-block';\n let $navTab = $('<li/>').append(\n $('<a/>', {\n text: Translator.trans('open_orchestra_backoffice.shared_block.tab_usage_block'),\n 'data-toggle': 'tab',\n ...
[ "0.6718534", "0.6403188", "0.6321452", "0.62151545", "0.6092261", "0.6087637", "0.5974908", "0.5945982", "0.5910179", "0.5905904", "0.5875379", "0.5842939", "0.5826264", "0.58201015", "0.58142716", "0.58056116", "0.57877636", "0.57799983", "0.57799983", "0.5746867", "0.569750...
0.6973138
0
Recupera los usuarios de forma paginada
function getUsers(req, res) { var identity_user_id = req.user.sub; var pages = req.params.pages; var page = 1; if (req.params.page) { page = req.params.page; } var itemsPerPage = 5; User.find().sort('_id').paginate(page, itemsPerPage, (err, usuariosEncontrados, totalUsuarios) => { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getUsuarios(req,res){\n\tvar identity_usuario_id = req.usuario.sub;\n\tvar page = 1;\n\tif(req.params.page){\n\t\tpage = req.params.page;\n\t}\n\tvar itemsPerPage = 100;\n\n\tUsuario.find().sort('_id').paginate(page,itemsPerPage,(err,usuarios,total)=>{\n\t\tif(err) return res.status(500).send({\n\t\t\tmes...
[ "0.7367444", "0.7080093", "0.70729524", "0.70343417", "0.7032364", "0.70287913", "0.7004892", "0.6987402", "0.6967823", "0.6967823", "0.694175", "0.6892958", "0.68600816", "0.6858053", "0.6810414", "0.6805351", "0.6800181", "0.6796536", "0.6786022", "0.6778617", "0.6756045", ...
0.7294959
1
Problem inputs: array separator optional, conjunction (default is "or") output: a string with elements of array, separated by separator and conjunction before last element Algorithm if 1 element, display "1" else, if 2 elements, display "1 or 2" else, if 3 or more elements, display "1, 2, and 3"
function joinOr(array, separator = ", ", conjunction = "or") { let length = array.length; if (length === 0) { return ""; } if (length === 1) { return `${array[0]}`; } else if (length === 2) { return `${array[0]} ${conjunction} ${array[1]}`; } else { return ( array.slice(0, array.length...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function f_OR_matter(arr){ // helper function to make sure 'or' is before last value in list\n var arrLen = arr.length; // length of array\n var arrStr; \n \n if(arrLen > 1){ // check the length\n var last = arr.pop(arrLen - 1); // hold the last value for a sec\n arrStr = arr.join(', ') +...
[ "0.704516", "0.66414016", "0.63454694", "0.6304078", "0.62168974", "0.6102216", "0.60802686", "0.5933804", "0.58878237", "0.5858712", "0.58237976", "0.58237976", "0.5793303", "0.5781927", "0.57524705", "0.57501155", "0.57501155", "0.57501155", "0.5732146", "0.57228994", "0.57...
0.7726311
0
endregion region Plugin config Plugin configuration. This plugin chains some of the functions in Grid.
static get pluginConfig() { return { chain : ['onElementTouchStart', 'onElementTouchMove', 'onElementTouchEnd', 'onElementMouseDown', 'onElementMouseMove', 'onElementDblClick', 'onElementMouseUp', 'onSubGridCollapse', 'onSubGridExpand', 'render'] }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static get pluginConfig() {\n return {\n chain: [\n 'onElementTouchStart',\n 'onElementTouchMove',\n 'onElementTouchEnd',\n 'onElementMouseDown',\n 'onElementMouseMove',\n 'onElementDblClick',\n 'onElementMouseUp',\n 'onSubGridCollapse',\n 'onS...
[ "0.7626524", "0.7558345", "0.7461228", "0.74143225", "0.7262489", "0.7237645", "0.7214825", "0.7200916", "0.71983093", "0.715304", "0.715304", "0.714171", "0.7138019", "0.7132729", "0.7117595", "0.70754445", "0.7059742", "0.7040538", "0.7040538", "0.70215786", "0.6987086", ...
0.76575565
0
endregion region Events Start moving splitter on touch start.
onElementTouchStart(event) { const target = event.target.closest('.b-grid-splitter'); if (target) { this.startMove(target, event.touches[0].clientX); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onElementTouchStart(event) {\n const target = event.target.closest('.b-grid-splitter');\n\n if (target) {\n this.startMove(target, event.touches[0].clientX);\n }\n }", "onElementTouchStart(event) {\n const me = this,\n target = event.target;\n\n if (target.classList.contains('b-grid-spl...
[ "0.7907884", "0.77702725", "0.6906295", "0.6515632", "0.6452909", "0.64314574", "0.64096177", "0.6388601", "0.6357025", "0.63278365", "0.63125896", "0.63084054", "0.62187076", "0.62186366", "0.6171891", "0.6147018", "0.6144644", "0.61366016", "0.6132722", "0.61294407", "0.612...
0.7930588
0
Returns a motivation phrase, depending if he won or not
getMotivationalPhrase(won) { // Select either winner phrases or looser phrases let phrasesToUse = won ? this.winnerPhrasesToUse : this.looserPhrasesToUse; let phrases = won ? this.winnerPhrases : this.looserPhrases; // Refill the phrases to use in case they got empty if (phrasesToUse.length == 0) p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function message() {\n var insultGiv = insult[Math.floor((Math.random())* insult.length)]\n var choreGiv = chore[Math.floor((Math.random())* chore.length)]\n var commentGiv = comment[Math.floor((Math.random())* comment.length)]\n return `Wake up ${insultGiv}! You have to ${choreGiv} today. Get it done ...
[ "0.6083822", "0.5990781", "0.5900948", "0.5852737", "0.5815863", "0.5775928", "0.5731343", "0.5728941", "0.57278585", "0.57223797", "0.566687", "0.5651147", "0.5612276", "0.5591924", "0.55134237", "0.5510008", "0.55004954", "0.5499236", "0.5495029", "0.54730576", "0.5470595",...
0.67010283
0
Loads a profile rule file, resolving all its includes All the included rule files are expected to be in the directory as the rule file. Cyclic includes (e.g. file A includes file B which includes file C which includes file A) are not supported.
function load(ruleFilePath) { //First get the base rules var baseRuleLocation = fs.readFileSync(config.BASE_RULES, 'UTF-8'); var rules = yamlParser.safeLoad(baseRuleLocation); if (!ruleFilePath) { ruleFilePath = config.DEFAULT_RULES; } var includedRuleProfiles = []; var ruleDirector...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function scanForImportRules(elementImpl, cssRules, baseURL) {\n if (!cssRules) {\n return;\n }\n\n for (let i = 0; i < cssRules.length; ++i) {\n if (cssRules[i].cssRules) {\n // @media rule: keep searching inside it.\n scanForImportRules(elementImpl, cssRules[i].cssRules, baseURL);\n } else i...
[ "0.5283945", "0.49600497", "0.48197126", "0.47896767", "0.47489986", "0.47081366", "0.46597314", "0.46549416", "0.4578242", "0.4567419", "0.4548442", "0.4520355", "0.4494717", "0.44490486", "0.44286442", "0.44152856", "0.44018695", "0.43538857", "0.43462926", "0.43241617", "0...
0.6684488
0
Validates the borkAmount and changes value if it doesn't match app specs.
function borkValidator(borkNum) { if (borkNum > 50) { borkNum = 50; } if (borkNum < 1 || !borkNum ) { borkNum = 1; } return borkNum; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleBorkRequest() {\n $('#js-borker-form').submit( function(event) {\n event.preventDefault();\n // console.log('borker-button firing');\n let borkAmount = $('#js-bork-amount-input').val();\n borkAmount = borkValidator(borkAmount);\n console.log(borkAmount);\n // console.log(borkAmoun...
[ "0.58309096", "0.5771227", "0.56648874", "0.5518206", "0.5458979", "0.5427651", "0.5401453", "0.5385137", "0.53375065", "0.5321137", "0.5320696", "0.53176695", "0.53089035", "0.5297155", "0.5252113", "0.5242148", "0.5230942", "0.5227666", "0.5216278", "0.5200528", "0.5195287"...
0.679218
0
return a promise for finding Flickr photos related to the provided search term. if the search was successful, then the promise will resolve with the relevant photos. otherwise, the promise will resolve with an error.
function searchPhotos(searchTerm) { var url = urlBase.replace("API_KEY", key).replace("TEXT", searchTerm); return $http.get(url); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function photoSearch(term, cb) {\n _500px.api('/photos/search', _.extend(searchParams, {term:term}), function(r) {\n cb(r.error || null, annotatePhotos(r.data.photos,term));\n });\n }", "function getFlickr(searchterm, callback) {\n //build our query using search term\n var query = [\n 'https://api...
[ "0.72729856", "0.69464755", "0.68309164", "0.6647111", "0.6443079", "0.6358312", "0.6344061", "0.6222581", "0.61805487", "0.613165", "0.6085926", "0.60797316", "0.60678554", "0.6055945", "0.60424864", "0.60328066", "0.6008349", "0.60018975", "0.5933566", "0.59259284", "0.5868...
0.7044503
1
Esta es una funcion falsa, no toma en consideracion realmente el GPS del dispositivo sino que se genera de manera aleatoria
function leerGps() { if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(showPosition); } // init window.inc = typeof (inc) == 'undefined' ? 0.00005 : window.inc; window.lat = typeof (lat) == 'undefined' ? 38.695015 : window.lat; window.lng = typeof (lng) == 'undefi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function InicializaGPS1vez()\n {\n\n //dni=Base64.decode( getUrlVars()[\"dni\"] );\n dni=getUrlVars()[\"dni\"] ;\n Placa= getUrlVars()[\"placa\"] ;\n //empresa_madre=Base64.decode( getUrlVars()[\"empresa\"] );\n empresa_madre= getUrlVars()[\"empresa\"] ;\n //a...
[ "0.6794925", "0.64582205", "0.6388285", "0.63840365", "0.63373727", "0.63331497", "0.63165003", "0.6291688", "0.6196153", "0.6195964", "0.61928475", "0.6190546", "0.6166317", "0.61553323", "0.6133454", "0.6058874", "0.6050434", "0.6045556", "0.6036558", "0.5994593", "0.597323...
0.7041705
0
retrieve comments relevent to an answer of a question
function getAnswerComments(req, res) { Comment.find({ refered_question: req.query.ref_question, refered_answer: req.query.ref_answer }).sort({ date_posted: -1 }).exec(function (err, comments) { if (err) { console.log("Error while accessing to the database"); } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function find_comment_reply(id){\n // search in the comment section\n for (let i=0; i<comments.length; i++){\n if(comments[i].id == id){\n return comments[i];\n }\n }\n\n // search in the reply section\n for (let i=0; i<replies.length; i++){\n if(replies[i].id == id){\n return replies[i];\n...
[ "0.61154175", "0.6066425", "0.6014044", "0.59985745", "0.59722704", "0.5900696", "0.58807474", "0.58420366", "0.5839455", "0.5754836", "0.57426673", "0.5727548", "0.57018626", "0.5696141", "0.5685022", "0.56827986", "0.5660035", "0.5643074", "0.56248045", "0.5600001", "0.5593...
0.7786083
0
delete all comments of a answer
function deleteAnswerComments(req, res) { Comment.remove({ refered_answer: req.params.ref_answer }, function (err, comment) { if (err) { res.status(500).send(err); } else { const response = { message: "Comments of a answer successfully deleted", ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "delete() {\n this.comments.forEach(comment => comment.delete());\n this.comments = [];\n $(`#${this.idDOM}`).remove();\n }", "clearComments()\n {\n let diff = this.comments.size - this.config.commentsHistoryLimit;\n\n for (let [id, comment] of this.comments) {\n\n ...
[ "0.7051197", "0.69517165", "0.69367814", "0.692373", "0.6470527", "0.6461517", "0.6377043", "0.6365444", "0.6335182", "0.62232965", "0.62158054", "0.62150955", "0.6195392", "0.6124809", "0.6055719", "0.6049525", "0.6030471", "0.60158974", "0.6007462", "0.5989573", "0.59648484...
0.74927425
0
Setup map events from a google map object to trigger on a given element too, then we just use uievent to catch events from an element
function bindMapEvents(scope, eventsStr, googleObject, element) { angular.forEach(eventsStr.split(' '), function (eventName) { //Prefix all googlemap events with 'map-', so eg 'click' //for the googlemap doesn't interfere with a normal 'click' event var $event = { type: 'map-' + eventName }; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bindMapEvents(scope, eventsStr, googleObject, element) {\n angular.forEach(eventsStr.split(' '), function (eventName) {\n //Prefix all googlemap events with 'map-', so eg 'click' \n //for the googlemap doesn't interfere with a normal 'click' event\n google.maps.even...
[ "0.6469117", "0.64296776", "0.633969", "0.6301158", "0.6237284", "0.62183654", "0.620783", "0.61698145", "0.61607337", "0.6152184", "0.61519545", "0.600085", "0.5974446", "0.5965257", "0.59407324", "0.5918214", "0.59097284", "0.5900807", "0.58836555", "0.5881632", "0.5875617"...
0.65652686
1
Setup map events from a google map object to trigger on a given element too, then we just use uievent to catch events from an element
function bindMapEvents(scope, eventsStr, googleObject, element) { angular.forEach(eventsStr.split(' '), function (eventName) { //Prefix all googlemap events with 'map-', so eg 'click' //for the googlemap doesn't interfere with a normal 'click' event var $event = { type: 'map-' + eventName }; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bindMapEvents(scope, eventsStr, googleObject, element) {\n angular.forEach(eventsStr.split(' '), function (eventName) {\n //Prefix all googlemap events with 'map-', so eg 'click' \n //for the googlemap doesn't interfere with a normal 'click' event\n google.maps.even...
[ "0.6469117", "0.64296776", "0.633969", "0.6301158", "0.6237284", "0.62183654", "0.620783", "0.61698145", "0.61607337", "0.6152184", "0.61519545", "0.600085", "0.5974446", "0.5965257", "0.59407324", "0.5918214", "0.59097284", "0.5900807", "0.58836555", "0.5881632", "0.5875617"...
0.65652686
0
Map overlay directives all work the same. Take map marker for example will $watch 'myMarker' and each time it changes, it will hook up myMarker's events to the directive dom element. Then uievent will be able to catch all of myMarker's events. Super simple.
function mapOverlayDirective(directiveName, events) { app.directive(directiveName, [function () { return { restrict: 'A', link: function (scope, elm, attrs) { scope.$watch(attrs[directiveName], function (newObject) { bindMapEvents(scope, events, newObject, elm); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mapOverlayDirective(directiveName, events) {\n app.directive(directiveName, [function () {\n return {\n restrict: 'A',\n require: '^uiMap',\n link: function (scope, elm, attrs, controller) {\n controller.map.promise.then(fun...
[ "0.7616618", "0.65279627", "0.5940867", "0.5921286", "0.5873852", "0.5857603", "0.58408505", "0.5806656", "0.5806656", "0.5700263", "0.5670841", "0.56313646", "0.56313646", "0.55847925", "0.55577725", "0.5478497", "0.54705054", "0.5468349", "0.54475474", "0.5415819", "0.54066...
0.732283
1
This function searches the images that are embedded in the body of the message and deletes them from external attachments to avoid sending them twice.
removeDuplicates(attachments) { const embeddedImages = this.state.embeddedImgList; embeddedImages.forEach((img) => { // The name of the image is obtained from <img alt= value var imgName = img.match(/alt\s*=\s*"(.+?)"/gm); if (imgName) { var name = imgName[0].split("=")[1]; var...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeReplyImage(reply) {\n let files = []\n\n if(reply && reply.file) {\n files.push(reply.file)\n\n //takes an array of files\n cloud.remove(files)\n }\n}", "function deleteAttachments(attachments) {\n\n attachments.forEach(function(attachment){\n fs.unlink( path.join...
[ "0.6570064", "0.6036882", "0.5963428", "0.59427613", "0.59341776", "0.5879177", "0.58445764", "0.58222693", "0.5759305", "0.5735292", "0.5727337", "0.5716267", "0.56983453", "0.5666283", "0.5651006", "0.5651006", "0.56155103", "0.5593546", "0.5593546", "0.5593546", "0.5593546...
0.69371754
0
Moves an address from the address list under the field matching the fromId to the address field matching the toId.
moveAddress(fromId, toId, address) { // const updatedMessage = { ...this.props.editedMessage }; // // Remove // updatedMessage[fromId].splice(updatedMessage[fromId].indexOf(address), 1); // // Add // updatedMessage[toId] = [...updatedMessage[toId], address]; // this.props.editMessage(updatedMess...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "removeAddress(id, address) {\n if (id === 'to') {\n const to2 = [...this.state.to2];\n to2.splice(to2.indexOf(address), 1);\n const to = to2.join(',');\n this.setState({to2, to});\n // this.props.setMailContacts(to);\n }\n }", "function move...
[ "0.6236052", "0.5868165", "0.5615598", "0.56130415", "0.5558665", "0.51989365", "0.5192617", "0.515489", "0.5129187", "0.50898635", "0.508012", "0.50716215", "0.5062851", "0.5060503", "0.50097424", "0.49929795", "0.49884447", "0.49829915", "0.49620682", "0.48509544", "0.48396...
0.70474684
0
Example: Input: [5,2,6,1] Output: [2,1,1,0] Explanation: To the right of 5 there are 2 smaller elements (2 and 1). To the right of 2 there is only 1 smaller element (1). To the right of 6 there is 1 smaller element (1). To the right of 1 there is 0 smaller element. Iterate th' the array and find the no: elements smalle...
function countSmaller(array){ let newArr = [...array]; newArr.sort(function(x, y) { return x-y; //<=> }) let result =[]; for(let i=0; i<array.length; i++){ let idx = newArr.indexOf(array[i]); result.push(idx); newArr.splice(idx, 1); } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function smaller(arr) {\n const smallerArr = [];\n let count = 0;\n let count2 = 0;\n for (let i=0; i<arr.length; i++) {\n count2++;\n for (let j=count2; j<arr.length; j++) {\n if (arr[i] > arr[j]) {\n count++;\n }\n }\n smallerArr.push(count);\n count = 0;\n }\n return smalle...
[ "0.73866355", "0.7290199", "0.7033054", "0.6948782", "0.67937326", "0.67258024", "0.66967815", "0.6638576", "0.66294426", "0.65667135", "0.6563858", "0.65295476", "0.65016216", "0.6467767", "0.64577264", "0.6452893", "0.64378506", "0.642716", "0.6424955", "0.6421245", "0.6367...
0.7935779
0
FIND ALL TURNIP PRICES
function findTurnips() { return db('turnips as t') .select( 't.id as turnip_id', 'v.id as villager_id', 'v.villager_name', 'v.island_name', 't.morning_price', 't.afternoon_price', 't.created_at' ) .join('villagers as v', 'v.id', 't.villager_id') .orderBy('t.mo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findAllPokemons() {\n \n var request = $http({\n method: \"GET\",\n url: PokethonConstants.hostRemote + \"pokemon?limit=811\",\n });\n\n return( request.then( handleSuccess, handleErro...
[ "0.5455611", "0.53139096", "0.52986896", "0.52664906", "0.52410406", "0.5211188", "0.5196225", "0.5196225", "0.5196225", "0.5196225", "0.5196225", "0.51824725", "0.5166522", "0.5109355", "0.5107738", "0.50881517", "0.50871843", "0.50619984", "0.50465226", "0.50261265", "0.502...
0.55306923
0
DELETE AN EXISTING TURNIP PRICE
function deleteTurnip(id) { return db('turnips') .where({ id }) .del(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function $deletePunch() {\n $(this).closest(\".punch-modifier\").remove();\n return false;\n}", "function rePPOne() {\n deletePayPeriod(1);\n}", "delete(id) {\n return http.delete(`/removePuppy/${id}`);\n \n }", "function removeTopping(id) {\n //console.log('remove the topping whose id is ' + id)...
[ "0.58849275", "0.5724583", "0.5699593", "0.56820536", "0.56689906", "0.56426513", "0.5635865", "0.56207716", "0.5504823", "0.5477525", "0.547592", "0.54625696", "0.5454519", "0.5452737", "0.54092914", "0.54058045", "0.5375227", "0.5369168", "0.5364431", "0.5357945", "0.535794...
0.57905704
1
On submit or skip or close we will close the modal we will send data of company details / survey details to company details ajax request on its response we will call login company details success response we will allow person to login.
loginRequest() { this.$refs.companyDetailsModal.close(); this.submitLogin(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function doFormStuff(modal) {\n var $context = modal,\n $closeButton = $('.modal-button__close', $context),\n $thanksCloseBtn = $('.-close', $context),\n $inputs = $('.modal-input', $context),\n $fullname = $('#fullName', $context),\n $jobtitle = $('#jo...
[ "0.64266896", "0.6412617", "0.63760406", "0.6290311", "0.6277456", "0.6206353", "0.6166479", "0.6156381", "0.61410874", "0.61046463", "0.6081998", "0.60585624", "0.60395265", "0.60241", "0.60224813", "0.59853", "0.59706986", "0.5930271", "0.59087276", "0.59078497", "0.5906551...
0.75248873
0
Logical Order in If Else Statements
function orderMylogic(val) { /*if (val < 10) { return "Less than 10"; } else if (val < 5) { return "Less than 5"; }*/ if (val < 5) { return "Less than 5"; } else if (val < 10) { return "Less than 10"; } else{ return "Greater than or...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function orderMyLogic(val) {\n if (val < 5) {\n return \"Less than 5\";\n }\n else if (val < 10) {\n return \"Less than 10\";\n }\n else {\n return \"Greater than or equal to 10\";\n }\n}", "function orderMyLogic(val) {\n\tif(val < 10) {\n\t\treturn \"less than 10\";\n\t} else if(val < 5) {\n\t\t...
[ "0.6059607", "0.5964309", "0.59473175", "0.5940328", "0.59206134", "0.5878434", "0.5850443", "0.5795759", "0.575137", "0.5716866", "0.5696956", "0.56713885", "0.56461024", "0.5632791", "0.56277937", "0.56277937", "0.5624035", "0.5599908", "0.556327", "0.5556404", "0.5545469",...
0.63782895
0
2. get data from string and send it thowards getProdsToTable
function getProducts() { let stringJSON = document.getElementById('json').value let myObj = JSON.parse(stringJSON) let products = myObj.products getProdsToTable(products) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function processData(allText) {\n restJson = JSON.parse(allText);\n console.log(restJson);\n buildTable(restJson);\n }", "function getTableDataFromHtml() {\n\n }", "function handleData(data, id) {\n if (data) {\n\n var $ = cheerio.load(data);\n var json = {...
[ "0.570232", "0.56509525", "0.54261035", "0.5425151", "0.5419115", "0.54158163", "0.5338726", "0.5338374", "0.53040344", "0.5279342", "0.52760774", "0.5274467", "0.5229289", "0.52224225", "0.5222406", "0.52205074", "0.5215362", "0.5180057", "0.51628584", "0.51603997", "0.51505...
0.5797623
0
Disable or enable a field If status is equal to true, it will disable the specified field If status is equal to false, it will enable the specified field
function disableField(fieldObj,status) { fieldObj = this.ownerDoc.getElementById(fieldObj); var eltTag = fieldObj.tagName; var eltType = fieldObj.type; if (eltTag == "INPUT" && (eltType == "" || eltType == "text" || eltType == "hidden" || eltType == "password")) { fieldO...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toggleField(field, flag){\n\t// toggle field\n\tfield.disabled = flag;\n\t// if (flag == true)\n\t\t// field.style.backgroundColor = 'white';\n}", "function enableDisableField(field, isDisabled) {\r\n if (field != undefined) {\r\n var fieldType=\"\";\r\n var fieldName=\"\";\r\n\r\n ...
[ "0.690811", "0.6773576", "0.6531282", "0.6477409", "0.64388627", "0.63669705", "0.63500315", "0.62717813", "0.62665087", "0.625052", "0.625052", "0.625052", "0.62156665", "0.62003", "0.6184898", "0.61834174", "0.6114363", "0.60803944", "0.6002197", "0.5980787", "0.5980787", ...
0.72180426
0