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
Set a git config value
function set(setting, value) { return __awaiter(this, void 0, void 0, function* () { const result = yield cmd_1.cmd.execute(git.info.path, ['config', setting, value]); return result.retc; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setConfig(config) {\n let oldConfig = this.get('config');\n let newConfig = Object.assign(oldConfig, config);\n this.set('config', newConfig);\n }", "function setConfig(prop, val) {\n\tif(prop && val != undefined && oConfig) {\n\t\toConfig[prop] = val;\n\t\tif(oConfig.oInitiativeTrackerData.list[0].id ...
[ "0.6045691", "0.6029179", "0.5974281", "0.59212977", "0.5869543", "0.586343", "0.5834265", "0.58138174", "0.5734845", "0.57335836", "0.57334137", "0.56787086", "0.5584212", "0.55530775", "0.5547503", "0.5525749", "0.5507745", "0.54961365", "0.5492873", "0.546017", "0.545888",...
0.66677713
0
Get a tag reference by name
static fromName(name) { return new TagRef(name); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get tag() {}", "findTag(pack, name) {\n let searched = null;\n pack.forEach(function (tag) {\n if (\n tag.root.getAttribute(\"name\").toLowerCase() == name.toLowerCase() ||\n tag.root.tagName.toLowerCase() == name.toLowerCase() ||\n tag.root.getAttribute(\"ref\").toLowerCase() == ...
[ "0.6826525", "0.66743743", "0.6560386", "0.6527088", "0.62183136", "0.598296", "0.598296", "0.5955968", "0.59210366", "0.58578795", "0.5857268", "0.5839922", "0.581928", "0.5766373", "0.5754015", "0.5728664", "0.5712654", "0.56793237", "0.5660022", "0.56284875", "0.5575385", ...
0.77859485
0
Create a branch reference from a string name
static fromName(name) { return new BranchRef(name); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createGithubCheckoutBranch(name) {\n let nameArray = Array.from(name);\n nameArray = nameArray.filter((character) => {\n const invalidCharacters = [\".\", \"~\", \"^\", \":\", \"-\"];\n switch (character) {\n case invalidCharacters[invalidCharacters.indexOf(character)]:\n break;\n ...
[ "0.7155722", "0.6052351", "0.58033925", "0.5571962", "0.55103153", "0.5456277", "0.5439629", "0.5286397", "0.52806216", "0.52741873", "0.5257741", "0.52315366", "0.522587", "0.5204791", "0.51953864", "0.5190507", "0.5157654", "0.5128526", "0.5110374", "0.507156", "0.49665657"...
0.8365373
0
Parse a list of branches returned by git stdout
static parseListing(output) { return output.replace('\r\n', '\n') .trim() .split('\n') .filter(line => !!line.length) .filter(line => line !== 'no branch') .map(line => line.trim()) .map(line => line.replace(/^\*...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function list_branches(owner,repo)\r\n{\r\n\tvar options = {\r\n\t\turl: urlRoot + \"/repos/\" + owner + \"/\" + repo + \"/branches\",\r\n\t\tmethod: 'GET',\r\n\t\theaders: {\r\n\t\t\t\"User-Agent\": \"EnableIssues\",\r\n\t\t\t\"content-type\": \"application/json\",\r\n\t\t\t\"Authorization\": token\r\n\t\t}\r\n\t...
[ "0.653817", "0.65213305", "0.6443758", "0.6402197", "0.6397254", "0.6263587", "0.5892273", "0.58760774", "0.5868494", "0.57772017", "0.5752208", "0.5630035", "0.56206167", "0.5616627", "0.5590955", "0.55875915", "0.55673665", "0.554181", "0.54070747", "0.5388066", "0.5367736"...
0.74478537
0
Get the name of the branch at a remote
remoteAt(remote) { return BranchRef.fromName(`${remote.name}/${this.name}`); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gitBranch() {\n return exec('git', 'symbolic-ref', '--short', '--quiet', 'HEAD').then(result => result[0].trim()).catch(err => {\n if (err instanceof exec.CommandError && err.status == 1) {\n // detached HEAD, return null to represent an unknown branch\n return null;\n } else {\n thr...
[ "0.68180186", "0.6566959", "0.63654816", "0.630655", "0.62269306", "0.6121622", "0.6085219", "0.60611975", "0.60235554", "0.5944521", "0.57855576", "0.57844615", "0.5775658", "0.57604516", "0.5748319", "0.5739699", "0.5726759", "0.5714292", "0.56350726", "0.5615121", "0.55949...
0.71955806
0
Get a reference to the currently checked out branch
function currentBranch() { return __awaiter(this, void 0, void 0, function* () { const result = yield cmd_1.cmd.executeRequired(git.info.path, ['rev-parse', '--abbrev-ref', 'HEAD']); const name = result.stdout.trim(); if (name === 'HEAD') { // We aren't attach...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCurrentBranch() {\n const HEADBuffer = fs.readFileSync(VCS + path.sep + HEAD).toString()\n const HEADJson = JSON.parse(HEADBuffer)\n return HEADJson.current\n}", "function getRef (branch) {\n\tvar b = branch || 'gh-pages';\n\tvar options = {\n\t\theader: {'Accept': 'application/vnd.github.v3...
[ "0.7427536", "0.719839", "0.71667826", "0.69953287", "0.6982566", "0.67930305", "0.6275394", "0.6013558", "0.6004302", "0.6004302", "0.5995237", "0.59528786", "0.59515554", "0.59131515", "0.5884445", "0.58837813", "0.58695954", "0.5852693", "0.583058", "0.582215", "0.57182425...
0.76680195
0
Pull updates from the given ``remote`` for ``branch``
function pull(remote, branch) { return __awaiter(this, void 0, void 0, function* () { const result = yield cmd_1.cmd.execute(git.info.path, ['pull', remote.name, branch.name]); if (result.retc !== 0) { fail_1.fail.error({ message: 'Failed to pull from remote. See git outp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async fetch(branch = '*') {\n await origin.fetch([\n // Refspecs: by default fetch all\n `refs/heads/${branch}:refs/heads/${branch}`\n ],\n // Fetch options\n { callbacks: { credentials: creds } }\n );\n\n origin.pruneRefs();\n }", "function push(remote, branc...
[ "0.6603176", "0.625354", "0.58448726", "0.57901776", "0.5721635", "0.5704898", "0.541202", "0.5391797", "0.5391582", "0.5343172", "0.52999973", "0.5265663", "0.52490324", "0.51848775", "0.51555085", "0.5144735", "0.51208466", "0.51173", "0.50774795", "0.5070281", "0.5061117",...
0.7972951
0
Push updates to ``remote`` at ``branch``
function push(remote, branch) { return __awaiter(this, void 0, void 0, function* () { const result = yield cmd_1.cmd.execute(git.info.path, ['push', remote.name, branch.name]); if (result.retc !== 0) { fail_1.fail.error({ message: 'Failed to push to re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function push(repositoryPath, remote, localBranch, remoteBranch, options, progressCallback) {\n return __awaiter(this, void 0, void 0, function () {\n var args, opts, title_1, kind_1, result;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n ...
[ "0.6726488", "0.63143796", "0.63090914", "0.58403456", "0.5805901", "0.5760051", "0.5759658", "0.5616335", "0.5616335", "0.5497141", "0.543478", "0.5407473", "0.5325611", "0.52618307", "0.5225847", "0.5184071", "0.5061756", "0.50458777", "0.502094", "0.50112754", "0.49928692"...
0.76704735
0
Detect if the branch "subject" was merged into "base"
function isMerged(subject, base) { return __awaiter(this, void 0, void 0, function* () { const result = yield cmd_1.cmd.executeRequired(git.info.path, ['branch', '--no-color', '--contains', subject.name]); const branches = BranchRef.parseListing(result.stdout); return branche...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getBaseBranch(changed) {\n const defaultBranch = 'master';\n if (!changed) return defaultBranch;\n if (changed === true) return defaultBranch;\n return changed;\n}", "isBranch()\n {\n return this.nativeElement.tagName && this.nativeElement.tagName === \"Branch\";\n }", "function mergeBranch(b...
[ "0.6104086", "0.55389327", "0.5339923", "0.5327037", "0.5180791", "0.51724654", "0.5151229", "0.51401895", "0.5058487", "0.5055276", "0.50473773", "0.50408155", "0.4963268", "0.49599025", "0.495534", "0.49317953", "0.49208173", "0.49208173", "0.49181458", "0.49181458", "0.489...
0.8334374
0
Checkout the given branch
function checkout(branch) { return checkoutRef(branch.name); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "checkout(checkoutBranch, newCheck, branchname, checkoutAll, filename, path) {\n return __awaiter(this, void 0, void 0, function* () {\n try {\n let response = yield httpGitRequest('/git/checkout', 'POST', {\n checkout_branch: checkoutBranch,\n ...
[ "0.744262", "0.6838083", "0.6684732", "0.6589232", "0.6545007", "0.6545007", "0.65415806", "0.644877", "0.63441914", "0.6227652", "0.62202483", "0.6148603", "0.61212075", "0.5969011", "0.5961115", "0.59545666", "0.58515924", "0.58379185", "0.57563347", "0.5727922", "0.5705474...
0.81970334
0
Rebase one branch onto another
function rebase(args) { return cmd_1.cmd.executeRequired(git.info.path, ['rebase', args.onto.name, args.branch.name]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateTree(branch, cb) {\n\t if (branch === currentTree.branch && currentTree.sha) return cb(null, currentTree.sha);\n\t that.getRef(\"heads/\"+branch, function(err, sha) {\n\t currentTree.branch = branch;\n\t currentTree.sha = sha;\n\t cb(err, sha);\n\t });...
[ "0.61527544", "0.60072833", "0.60072833", "0.5602269", "0.559555", "0.5572586", "0.5509318", "0.5397107", "0.53563565", "0.5295397", "0.5268839", "0.5209206", "0.51635206", "0.5155245", "0.5130991", "0.51187545", "0.5117221", "0.5117221", "0.5111221", "0.50393724", "0.5027867...
0.7144647
0
Require that two branches point to the same commit. If given ``true`` for ``offer_pull``, will offer the use the ability to quickly pull from 'origin' onto the ``a`` branch.
function requireEqual(a, b, offer_pull = false) { return __awaiter(this, void 0, void 0, function* () { const aref = yield a.ref(); const bref = yield b.ref(); if (aref !== bref) { fail_1.fail.error({ message: `Branch "${a.name}" has diverg...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async fetch(branch = '*') {\n await origin.fetch([\n // Refspecs: by default fetch all\n `refs/heads/${branch}:refs/heads/${branch}`\n ],\n // Fetch options\n { callbacks: { credentials: creds } }\n );\n\n origin.pruneRefs();\n }", "function mergePullRequest(p...
[ "0.5274585", "0.5094039", "0.5040676", "0.4996927", "0.48275015", "0.47830132", "0.4769742", "0.476059", "0.47439054", "0.47236726", "0.471929", "0.4663261", "0.4631624", "0.46058363", "0.4583556", "0.45824814", "0.45777875", "0.45766923", "0.45489317", "0.45377678", "0.45339...
0.80076635
0
this function grabs all of the expenses from the database via an AJAX call
function getAllExpensesFromDatabase() { ExpensesService.getAllExpensesFromDatabase() .then( function success(response) { // if the call is successful, return the list of expenses vm.expenseEntries = response.data; }, function failur...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getMonthlyExpenses() {\n $.ajax({\n method: 'GET',\n url: '/monthly-expenses',\n }).then(function (response) {\n displayMonthlyExpenses(response);\n });\n}", "function getExpensesData() {\n expValue.innerHTML = null\n tmpExpense = 0\n tmpIncome = 0\n fetch(baseUrl + 'ex...
[ "0.75352305", "0.75022465", "0.69583935", "0.68809533", "0.6855412", "0.68062705", "0.6667115", "0.64447355", "0.63734514", "0.63479817", "0.6281628", "0.6224219", "0.6194833", "0.6163586", "0.6140447", "0.6128287", "0.60735327", "0.60014737", "0.5956708", "0.5947229", "0.594...
0.75868255
0
[modalSwitch Attaches a click event listener to the document and handles the modal show/hide ]
function modalSwitch() { console.log('Page has modals'); document.onclick = function(event) { var trigger = event.target; if ( trigger.hasAttribute('data-modal') ) { console.log('You clicked a modal trigger'); var modalTriggerState = trigger.ge...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleClick() {\n\tmodal = document.getElementById('modal-div');\n\tmodal.style.display = 'block';\n}", "function clickForaModal(e) {\n if (e.target === this)\n toggleModal();\n }", "function windowOnClick(event){\r\n\t\t\tif (event.target == modal){\r\n\t\t\t\ttoggleModal();\r\n\t\t\t}\r\n\t...
[ "0.7026499", "0.6624227", "0.6594865", "0.6583033", "0.6577002", "0.6537384", "0.6505692", "0.64798087", "0.6475016", "0.64712393", "0.6418743", "0.6406383", "0.6403678", "0.64029086", "0.6367968", "0.636181", "0.6310499", "0.6285279", "0.62722707", "0.6245523", "0.62257564",...
0.795178
0
Figure out adjacent tiles (this was fun to code!)
function adjacentTiles(tile) { var abc = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']; var tiles = []; if (tile[0] !== 'a') { tiles.push( abc[abc.indexOf(tile[0]) - 1] + tile[1] ); } if ((tile[0] !== 'a') && (tile[1] !== '8') ) { tiles.push( abc[abc.indexOf(tile[0]) - 1] + (parseInt(tile[1]) + 1) ); } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function countNeighbours(x, y)\n{\n var neighbours = 0;\n \n if (getTile(x-1, y-1) == 1)\n neighbours++;\n if (getTile(x-1, y) == 1)\n neighbours++;\n if (getTile(x-1, y+1) == 1)\n neighbours++;\n if (getTile(x+1, y-1) == 1)\n neighbours++;\n if (getTile(x+1, y) == 1)\n neighbours++;\n if (g...
[ "0.6961801", "0.69198436", "0.6866527", "0.683064", "0.6807087", "0.67835665", "0.6767142", "0.66861373", "0.6670222", "0.6627191", "0.66236466", "0.6622291", "0.661571", "0.661392", "0.6585897", "0.6541266", "0.65388477", "0.6465214", "0.6407561", "0.64037675", "0.6390235", ...
0.76295274
0
White Ellipse Analyzer Machine
function ellipseAnalyzerWhite(soundVolume, posX, posY) { background(0); if (soundFile.currentTime() > 564){ soundFile.jump(0); } //center frame extrapolate noFill(); stroke(255); strokeWeight(0.3*soundVolume*50); rect(windowWidth/2-250, windowHeight/...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setup() {\n createCanvas(640,480);\n background(60, 5, 102);\n noStroke();\n\n //BG decoration\n fill(128, 87, 158);\n ellipse(320,490,680,235);\n\n //arms\n fill(204, 242, 189);\n ellipse(265,490,100,120);\n ellipse(370,490,100,120);\n\n //ears\n //shading\n fill(159, 227, 157);\n ...
[ "0.57724905", "0.57681507", "0.56972134", "0.56855035", "0.56540143", "0.56348085", "0.5623867", "0.5622698", "0.5592935", "0.55878615", "0.55753994", "0.5572499", "0.5534015", "0.551338", "0.55081624", "0.5474663", "0.547095", "0.5450937", "0.5450804", "0.5443085", "0.542731...
0.58628184
0
Function: addSubChild Input: parNodeId, the index ID of the parent node Description: Adds an indented subform as a child to the parent form. The index for the child form is the same as the parent index string plus 'i' and then a number depending on how many other children already exist.
function addSubChild(parNodeId) { // console.log(tree); var child = (document.createElement('div')); var index = 0; var parNode = document.getElementById(parNodeId); if (parNode.hasChildNodes()) { var str = parNode.lastChild.id; index = str.substr( str.length-2,2 ); if (index.charAt(0) == 'i') ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addChildAt(child, index) {\n const numChildren = this._children.length\n\n if (index >= 0 && index <= numChildren) {\n this.setRequiresRedraw()\n\n if (child.parent === this) {\n this.setChildIndex(child, index) // avoids dispatching events\n } else {\n this._children.splice(inde...
[ "0.5396471", "0.5263414", "0.5251656", "0.5143194", "0.5141551", "0.49725324", "0.49705726", "0.49297988", "0.49029616", "0.48402414", "0.48320985", "0.48294672", "0.48195484", "0.48060402", "0.47914153", "0.4774261", "0.4762891", "0.4757119", "0.47541133", "0.4750565", "0.47...
0.5721378
0
Function: condChange Input: nodeId, index ID of the affected input node Description: Toggle the parameter input field.
function condChange(nodeId) { var condNode = document.getElementById('t'+nodeId); if (condNode.type == "hidden") condNode.type = "text"; else condNode.type = "hidden"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function param_change() {\n\tupdate_Loc();\n\tupdate_Map(1);\n\tupdate_Points();\n\tloc_visited[current_loc]++;\n\tupdate_display_msg(0);\n\tbtn_set();\n\tif ((loc_visited[current_loc] > 1) && (current_loc === 5)) {\n\t\tloc_locked[7] = true;\n\t\tbreach_c_Fence();\n\t}\n}", "function onoffParam(event) {\n ch...
[ "0.5733091", "0.5642395", "0.52349514", "0.5132576", "0.509807", "0.5077293", "0.504566", "0.50175095", "0.49820197", "0.49037832", "0.4897282", "0.4849664", "0.48305675", "0.48258284", "0.4825575", "0.4805442", "0.47927606", "0.47875857", "0.47740462", "0.47581628", "0.47490...
0.6668524
0
Function: removeSubChild Input: nodeId, index ID of the affected input node Description: Remove a node from the structure.
function removeSubChild(nodeId) { if (nodeId.charAt(nodeId.length-3) == 'i') var parNode = document.getElementById(nodeId.substr(0,nodeId.length-3)); else var parNode = document.getElementById(nodeId.substr(0,nodeId.length-2)); console.log(parNode); //window.alert(nodeId.substr(0,nodeId.length-2)); parN...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeSub(subid) {\n $('.sub').filter('[data-id=' + subid + ']').parent().remove();\n }", "function removeChild(parent, node) {\n\t if (node.parentNode !== parent) {\n\t throw Error('The node to be removed is not a child of this node: ' + node);\n\t }\n\t if (!removeNode(node)) {\n\t // if ...
[ "0.574581", "0.57377046", "0.57377046", "0.5676042", "0.56065416", "0.5484323", "0.54308516", "0.53465426", "0.5326812", "0.53246737", "0.53046876", "0.52334136", "0.5181697", "0.5173294", "0.51685685", "0.51685685", "0.51685685", "0.51685685", "0.51685685", "0.51685685", "0....
0.6738883
0
Function: hasSubFields Input: nodeId, index ID of the affected input node Description: Returns the number of child nodes a parent has.
function hasSubFields(nodeId) { var node = document.getElementById(nodeId); var numSubFields = 0; var child = node.firstChild; while(child != null) { if (child.nodeName == "DIV") numSubFields++; child = child.nextSibling; } //window.alert(numSubFields); return numSubFields; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function childrenLength(node) {\n var key, child;\n var count = 0;\n for (key in node) {\n if (node.hasOwnProperty(key)) {\n child = node[key];\n if (typeof child === 'object' && child !== null && key != 'parent') {\n count++;\n }\n }\n }\n ...
[ "0.50781626", "0.48792568", "0.48163757", "0.48163757", "0.48163757", "0.48163757", "0.48163757", "0.48163757", "0.48163757", "0.48163757", "0.47853798", "0.47701883", "0.47690183", "0.47684586", "0.47681832", "0.47681832", "0.47681832", "0.47681832", "0.47681832", "0.47681832"...
0.68347317
0
TODO : show a single callback toast for multiple deleted items, and check if it needs to be plural or not
function deleteCallback(items) { angular.forEach(items, function(restangularizedItem) { $log.debug('value to delete', restangularizedItem); restangularizedItem.remove().then(function() { toastService.success({key: 'TOAST_ALERT.ACTION.DELETE_SINGULAR'}); _.remove(thisctrl.itemsL...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onDeleteItems() {\r\n var m = grid.getSelectionModel().getSelections();\r\n if(m.length > 0)\r\n {\r\n\r\n Ext.Msg.confirm(getLocalizationValue('application.javascript.messageCenter.deleteConfirmation.title'), getLocalizationValue('application.javascript.messageCenter.deleteConfirmation.me...
[ "0.65400124", "0.6473628", "0.6468254", "0.6461102", "0.6389268", "0.63377506", "0.6324804", "0.62916327", "0.6256947", "0.62514424", "0.6222531", "0.6220807", "0.6220807", "0.6209863", "0.6162759", "0.6137255", "0.6112983", "0.6100855", "0.60963315", "0.6085004", "0.6075732"...
0.69707936
0
normalize rawname to a valid file name. 1. maximum filename length is 255 ( 2. Common illegal characters as file name ( : " / \ | ? ~ 2. Common reserved filenames: . .. 3. reserved filenames on Windows ( CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, ...
function _normalize(rawname) { var illegalCharExp = /[<>\:"\/\\\|\?\*\~]/g; var reservedExp = /^\.+$/; var reservedWindowExp = /^(con|prn|aux|nul|com[0-9]|lpt[0-9])(\..*)?$/i; var unicodeControlExp = /[\x00-\x1f\x80-\x9f]/g; var replacement = ''; var maxLength = 255; var replac...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sanitizeFilename(name) {\n const illegalRe = /[\\/\\?<>\\\\:\\*\\|\":]/g;\n const controlRe = /[\\x00-\\x1f\\x80-\\x9f]/g;\n const reservedRe = /^\\.+$/;\n const windowsReservedRe = /^(con|prn|aux|nul|com[0-9]|lpt[0-9])(\\..*)?$/i;\n const windowsTrailingRe = /[\\. ]+$/;\n const replacement = \"_\";...
[ "0.7662604", "0.7077583", "0.685071", "0.6731771", "0.669201", "0.6574976", "0.6514367", "0.63693386", "0.63468224", "0.62406266", "0.61866766", "0.61461437", "0.61186916", "0.60958153", "0.6080368", "0.60403043", "0.5997461", "0.5997461", "0.5985418", "0.59623355", "0.595054...
0.8051693
0
generating 5 random petrol pumps on the road
function generateRandomPetrolPumps() { while(petrolPumps.length < 5) { let r = Math.floor(Math.random() * 100) + 1; if(petrolPumps.indexOf(r) === -1) petrolPumps.push(r); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tiraildado(){\n return (Math.round(5 * Math.random()) + 1);\n }", "function randomPunti() {\n var punti = Math.floor(Math.random()*500);\n return punti;\n}", "function createPet(){\n //random does not work unless this is here for some reason?\n var rand = Math.random();\n var ln = possiblePet...
[ "0.72929037", "0.7018156", "0.69648886", "0.6923225", "0.6854002", "0.6831883", "0.6793671", "0.67796224", "0.6761011", "0.6751304", "0.67367846", "0.668882", "0.6677994", "0.66751873", "0.66688275", "0.66653836", "0.6663673", "0.6661826", "0.66516155", "0.6650079", "0.664789...
0.84124655
0
Add the server log file after boot. This is the only time we'll know what tmp path we have.
function onBoot(paths) { let dir = paths.build.tmp(); dir.make(); transports.push(new winston.transports.File({ level: fileLogLevels[app.context], filename: dir.get('server.log'), maxsize: fileMaxSize })); logger.configure({ t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async uploadServerLogs () {\n if (this.manifest.uploadServerStartupLogs) {\n await this.uploadFileToS3({\n filePath: this.manifest.serverLogFile,\n s3Uri: `${this.manifest.s3UploadPath}/${await this.getLogUploadPrefix()}otp-server.log`\n })\n }\n }", "function on_startup() {\n\tcon...
[ "0.6726286", "0.64164215", "0.6097201", "0.59904706", "0.59830934", "0.5946277", "0.59221584", "0.5890934", "0.5887072", "0.57744783", "0.5744453", "0.5716241", "0.5679282", "0.5638465", "0.5625768", "0.55458665", "0.5533593", "0.55148244", "0.54506123", "0.5443272", "0.54144...
0.7024001
0
This function initialises and adds new asteroid objects to the game state
spawnAsteroids() { for (let i = 0; i < this.config.ASTEROID_COUNT; i++) { const roid = new Asteroid(this.config); this.asteroids.push(roid); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setupAsteroids() {\n //set the speed of the asteroid based on the level number\n let speedAsteroid = _level * 0.2 + 1;\n //ensures the asteroid is not positioned within collision radius of the ship at the start of game\n for (let i = 0; i < _numberOfAsteroids + _level; i++) {\n do {\n x = Math...
[ "0.7220797", "0.7164264", "0.6952023", "0.6864626", "0.6823004", "0.68108046", "0.66600806", "0.6611557", "0.65624315", "0.6548328", "0.6543723", "0.6534871", "0.6531943", "0.6458985", "0.6430945", "0.64258826", "0.6396298", "0.6354435", "0.63389915", "0.63125896", "0.6308806...
0.721343
1
Async function to clone repo into tmp dir
async function cloneRepo() { const tmpDir = await tmp.dir(); workingDirectory = tmpDir.path; await process.chdir(`${workingDirectory}`); console.log(`Cloning repo to ${workingDirectory}`); return git.clone(repo); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cloneRepo() {\n console.log(\"Cloning repo...\");\n //deleting old copy then cloning fresh copy\n cmd.get(\n 'rm -rf starter-node-angular && git clone https://github.com/mrdavidwoodard/starter-node-angular.git',\n function(err, data, stderr) {\n console.log(\"cloneRep cal...
[ "0.7248743", "0.7228117", "0.696813", "0.6848873", "0.68424594", "0.6840954", "0.6724446", "0.667079", "0.6484482", "0.63977796", "0.6113705", "0.59461445", "0.58175904", "0.5762933", "0.5663377", "0.56482863", "0.5619499", "0.547144", "0.5467887", "0.53779125", "0.5365217", ...
0.85747015
0
Function to pull latest repo changes
async function pullRepo() { await process.chdir(`${workingDirectory}/${REPONAME}`); console.log(`Pull repo at ${workingDirectory}/${REPONAME}`); return git.pull(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pull_master() {\n console.log(\"Currently dir: \", cwd());\n console.log(\"[Kind repo] pull master\");\n return String(execSync(\"git pull\"));\n}", "function fetchRepo() {\n // Fetch Github API and update Git Element\n const repo_url = \"https://api.github.com/repos/cbedroid/pydatpiff\";\n ...
[ "0.6883023", "0.68239784", "0.6656522", "0.65980816", "0.65652496", "0.6481187", "0.6381263", "0.63301104", "0.6193637", "0.618048", "0.6164088", "0.6153817", "0.61076427", "0.6055844", "0.60495883", "0.6033986", "0.6028257", "0.60118234", "0.5975171", "0.5956324", "0.5942400...
0.68582684
1
React Query: Multiple Queries This app performs a search using a Pokemon ID and then suggests three Pokemon of the same type. This occurs in three steps:
function App() { const [pokemonId, setPokemonId] = useState(1) // 1. Search for a Pokemon ID (using the PokeForm component) const query = usePokemon([ 'pokemon', { endpoint: 'pokemon', id: pokemonId }, ]) // 2. Get the Pokemon type from the first query and perform // another qu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function usePokemon() {\n //1 arg -> Unique key for fetched data\n //2 arg -> Function that'ps gonna grab some data (normally fetch is used and receives an API as an argument)\n //when using fetch, be sure to get a json as a result (investigar promesas en detalle)\n //Loading... state\n //Errors\n //3 arg ->...
[ "0.6759904", "0.6250807", "0.6182164", "0.61739254", "0.60352534", "0.5992052", "0.59673035", "0.5933075", "0.59223133", "0.5921637", "0.5894931", "0.58626497", "0.58547664", "0.5798686", "0.5788211", "0.57823944", "0.5762017", "0.5755252", "0.56743145", "0.56707656", "0.5667...
0.794534
0
Get short URL from the full url location of the uploaded image
function getShortURL(fullUrl) { shortUrl = fullUrl.slice(50); return shortUrl }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function urlShortcode(src, alt) {\n if(alt === undefined) {\n // You bet we throw an error on missing alt (alt=\"\" works okay)\n throw new Error(`Missing \\`alt\\` on myImage from: ${src}`);\n }\n\n let metadata = await Image(src, {\n widths: [300],\n formats: [\"jpeg\"],\n outputDir: './d...
[ "0.67069733", "0.6666987", "0.65163195", "0.64670146", "0.64446", "0.6432245", "0.64268607", "0.6413718", "0.63763297", "0.63479614", "0.63316256", "0.6264705", "0.622364", "0.62131464", "0.61981094", "0.61838406", "0.6182681", "0.6146395", "0.6139749", "0.61364156", "0.61156...
0.69172126
0
find current num and return true if there is a decimal
function hasDecimal(display) { let nextNum = ""; let hasOp = false; for (let i = 0; i < display.length; i++) { if (isOp(display[i]) === true) { nextNum = display.slice(i + 1); hasOp = true; } if (hasOp === false && i === display.length - 1) { nextNum = display.slice(0); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function decimal() {\n // If expression includes an arithematic, continue\n if (displaySpace.includes('-') || displaySpace.includes('*') ||\n displaySpace.includes('/') || displaySpace.includes('+')) {\n // Get the number unit in the last position\n let place = displaySpace.match(/([^\\d.])(?!...
[ "0.74304956", "0.74055374", "0.7396593", "0.7336155", "0.72777545", "0.706679", "0.6925354", "0.6896815", "0.6801983", "0.6794215", "0.66497546", "0.66162", "0.6562691", "0.6511738", "0.6509485", "0.6509485", "0.6509485", "0.6509485", "0.6509485", "0.6509485", "0.6509485", ...
0.7622154
0
using index of p1, find expression in paren, push to num and op arrays, calc answer, refine displayNum
function findPExpression(indexP) { let newNum = ''; let newNumExp = ''; opArray = []; numArray = []; let j = indexP + 1; while (typeArr[j] !== 'p2') { newNumExp += displayNum[j]; j++; } let newTypeArr = typeArr.splice(indexP, newNumExp.length + 2); newTypeArr = newTypeArr.splice(1...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calculateParen() {\r\n findTypeArray(displayNum);\r\n let pIndex = findPIndex(displayNum);\r\n findPExpression(pIndex);\r\n}", "function calculateFormula() {\r\n let newOpArr = [];\r\n let newNumArr = [];\r\n let tempSum = 0;\r\n let lastOp = '';\r\n if (opArray[0] === '+' || opArray[0] === '-')...
[ "0.67129266", "0.637338", "0.6294126", "0.6275908", "0.61445284", "0.6087051", "0.6086934", "0.608139", "0.5998866", "0.5974184", "0.597387", "0.59543705", "0.5935041", "0.59264016", "0.589402", "0.5877235", "0.58615893", "0.5861181", "0.5839713", "0.5834031", "0.582858", "...
0.79209024
0
push string num into numArray as number
function pushToNumArray(num) { if (!num.includes('.')) { numArray.push(parseInt(num)); } else { num = parseFloat(num); num = Math.round(num * 1e4) / 1e4; numArray.push(num); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function numberPush(arr,num){\n arr.push(num)\n return arr\n}", "function toArray(num) {\n\tlet numArr = (num + \"\").split(\"\")\n\tlet final = numArr.map(number => Number(number))\n\treturn final\n}", "function pushNumber() {\n calculation.push(parseFloat(multiDigit, 10));\n multiDigit = \"\";\n}", "fu...
[ "0.7194528", "0.71643764", "0.698485", "0.6952059", "0.6877247", "0.6874911", "0.6800933", "0.67891675", "0.675641", "0.67480665", "0.6745018", "0.6599507", "0.6579436", "0.6573329", "0.6567552", "0.64658237", "0.64131266", "0.6397194", "0.63621044", "0.62682873", "0.6208943"...
0.79899734
0
find if num, op, or paran for expression, push to typeArr
function findTypeArray(display) { typeArr = []; for (let i = 0; i < display.length; i++) { if (isNum(display[i]) === true) { // keep looping until op typeArr.push("n"); } else if (isOp(display[i]) === true) { if ((display[i] === '-' && typeArr[typeArr.length - 1] === 'o') || ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pushNumOpArraysFinal() {\r\n numArray = [];\r\n opArray = [];\r\n //findTypeArray(displayNum);\r\n // calculate\r\n newNum = '';\r\n for (let i = 0; i < typeArr.length; i++) {\r\n // find n, add to num arr, if o add to opArray\r\n if (typeArr[i] === 'n') {\r\n newNum += displayNum[i];\r\n...
[ "0.63231415", "0.60301244", "0.58668363", "0.57708013", "0.57600355", "0.5473931", "0.5473579", "0.5445789", "0.5305899", "0.5228749", "0.5183432", "0.51752603", "0.5154435", "0.51092416", "0.51087517", "0.5098009", "0.5098009", "0.5098009", "0.50961936", "0.5055961", "0.5036...
0.65724725
0
calculates answer using (MD)(AS), needs numArray and opArray, doesn't use displayNum
function calculateFormula() { let newOpArr = []; let newNumArr = []; let tempSum = 0; let lastOp = ''; if (opArray[0] === '+' || opArray[0] === '-') { lastOp = 'AS'; } if (opArray[0] === '*' || opArray[0] === '/') { lastOp = 'MD'; } // * & / first, then + & - // loop through opAr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calculate() {\n // Do a push of the last multiDigit number\n pushNumber();\n\n let total = 0;\n let num1 = 0;\n let num2 = 0;\n let operator = \"\";\n\n // Perform calculations ==========================\n for (let x = 1; x < calculation.length; x += 2) {\n // X at 1 is a special case. Operato...
[ "0.592913", "0.59221965", "0.58196145", "0.576909", "0.5746574", "0.57409406", "0.5734519", "0.5726479", "0.5713218", "0.56946194", "0.5685324", "0.56555796", "0.564332", "0.56048894", "0.55974036", "0.5560782", "0.55187106", "0.55060935", "0.54928243", "0.54921633", "0.54785...
0.67875946
0
first, find types for final displayNum, then push to num or op arrays
function pushNumOpArraysFinal() { numArray = []; opArray = []; //findTypeArray(displayNum); // calculate newNum = ''; for (let i = 0; i < typeArr.length; i++) { // find n, add to num arr, if o add to opArray if (typeArr[i] === 'n') { newNum += displayNum[i]; if (i === typeArr.l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findTypeArray(display) {\r\n typeArr = [];\r\n for (let i = 0; i < display.length; i++) {\r\n if (isNum(display[i]) === true) {\r\n // keep looping until op\r\n typeArr.push(\"n\");\r\n } else if (isOp(display[i]) === true) {\r\n if ((display[i] === '-' && typeArr[typeArr.length - 1...
[ "0.6904162", "0.5691192", "0.5367177", "0.53458554", "0.5311018", "0.53036135", "0.5241037", "0.51832", "0.515277", "0.51221466", "0.51190615", "0.5097992", "0.5081818", "0.5070019", "0.5031892", "0.50198346", "0.49916738", "0.4990133", "0.48825043", "0.48729485", "0.48636898...
0.7665663
0
Returns the total weight of the container.
getWeight() { let sum = 0; for (let i = 0; i < this._items.length; i++) { sum += this._items[i].getWeight() * this._items[i].count; } return sum; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get weights() {\n return this._fields.reduce((prev, curr) => prev + curr.weight, 0);\n }", "function getMaterialTotalWeight() {\n\tvar material_total_weight = getFieldValueById(\"trxtransactiondetails-net_weight\");\n\tif (null != material_total_weight && material_total_weight.length > 0) {\n\t\tswitch(getMa...
[ "0.6983572", "0.66839904", "0.6621312", "0.6533525", "0.6486857", "0.6420264", "0.64018327", "0.6279106", "0.62353235", "0.62353235", "0.62353235", "0.62353235", "0.62353235", "0.62353235", "0.62353235", "0.6226688", "0.6157128", "0.6148368", "0.61437297", "0.61020947", "0.60...
0.78926635
0
Adds an item. Container becomes item's owner.
addItem(item) { if (item.getType() === 'container') { if (this.getOwner() !== item) { this._addItem(item); } else { RG.err('Item', 'addItem', "Added item is container's owner. Impossible."); } } e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "add(item) {\r\n this.items.push(item);\r\n }", "function addItem() {}", "function add(item) {\n\t\trepository.push(item)\n\t}", "addItem(item) {\n this.contentItems.appendChild(this.item.getItem(item));\n }", "addItem(item) {\n this.connectSignals(item.signals);\n for (var i = 0; i < th...
[ "0.75166404", "0.736971", "0.73433495", "0.72305995", "0.7214585", "0.7100455", "0.70503736", "0.69951075", "0.6946969", "0.6920232", "0.6913556", "0.6877272", "0.68413967", "0.68402225", "0.6823675", "0.67743355", "0.6730072", "0.67144173", "0.6699837", "0.6683972", "0.66300...
0.85002726
0
Check by pure obj ref. Returns true if contains item ref.
hasItemRef(item) { const index = this._items.indexOf(item); if (index !== -1) {return true;} return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "hasItem(item) {\n if (this.hasItemRef(item)) {return true;}\n const index = this._getMatchingItemIndex(item);\n return index >= 0;\n }", "hasItem() {\n return !!this._item;\n }", "isthereItem(item) {\r\n return this.items.indexOf(item) >= 0;\r\n }", "contains(item) {\r\n...
[ "0.6766657", "0.66602635", "0.63911945", "0.6387514", "0.6068811", "0.604779", "0.60431904", "0.6011134", "0.6003031", "0.59935933", "0.59922165", "0.59730554", "0.5972202", "0.5959568", "0.5940284", "0.593633", "0.5930575", "0.59262884", "0.58353335", "0.58353335", "0.580016...
0.74782884
0
Tries to remove an item. Returns true on success, false otherwise.
removeItem(item) { if (this.hasItem(item)) { return this._removeItem(item); } this._removedItem = null; return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeFromCollection(collection, item, then) {\n var idx = collection.findIndex(function (i) { return i === item; });\n if (idx >= 0) {\n collection.splice(idx, 1);\n if (then) {\n then(item);\n }\n return true;\n }\n return false;\n}", "async function ...
[ "0.6744059", "0.64363647", "0.64089864", "0.6359014", "0.6357908", "0.6320025", "0.6298755", "0.6296851", "0.6236579", "0.6228805", "0.6178784", "0.6168125", "0.6168125", "0.6164198", "0.6151758", "0.61238974", "0.6121305", "0.6113201", "0.61104953", "0.6087115", "0.6075782",...
0.7424568
0
Returns last removed item if removeItem returned true.
getRemovedItem() {return this._removedItem;}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "remove() {\n\t\tif (this.items.length > 0) {\n\t\t\treturn this.items.pop();\n\t\t}\n\t}", "pop() {\n if (this.count === 0) return undefined;\n const deletedItem = this.items[--this.count];\n console.log(`Removed item ${deletedItem} from the stack`);\n return deletedItem;\n }", "...
[ "0.7649178", "0.73514324", "0.7311761", "0.70881146", "0.6967239", "0.69564044", "0.68956053", "0.6836365", "0.68307614", "0.6813635", "0.67429733", "0.6727765", "0.6716004", "0.6709462", "0.6709462", "0.66911685", "0.6680628", "0.6664896", "0.6634573", "0.6609529", "0.660546...
0.7426606
1
Returns first item or null for empty container.
first() { if (this._items.length > 0) { this._iter = 1; return this._items[0]; } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "first() {\n return this.get().items[0]\n }", "first() {\n let entry = null;\n for (let i = 0; i < this.objects.length && entry == null; i++)\n entry = this.objects[i];\n return entry;\n }", "first() {\n const records = this.select();\n if (records.length...
[ "0.7456537", "0.72089064", "0.7176012", "0.6785375", "0.6701877", "0.6695013", "0.66516113", "0.6646381", "0.66300046", "0.6626072", "0.6595015", "0.65851176", "0.6521118", "0.65121824", "0.6500866", "0.6492348", "0.6472061", "0.6456606", "0.64426816", "0.6431984", "0.6416893...
0.82441425
0
Returns next item from container or null if there are no more items.
next() { if (this._iter < this._items.length) { return this._items[this._iter++]; } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nextItem() {\n\n if (i === arr.length) {\n return null;\n }\n i = i + 1;\n return arr[i];\n\n}", "next() {\n this.indexOfQueue++;\n if (this.indexOfQueue >= this.length() || this.isEmpty()) {\n return null;\n }\n return this.queue[this.indexOfQueue];\n }"...
[ "0.70953465", "0.6739287", "0.6439947", "0.63707566", "0.628943", "0.6257512", "0.6257512", "0.6257512", "0.6257512", "0.6257512", "0.6257512", "0.6257512", "0.6257512", "0.6257512", "0.6257512", "0.6243983", "0.6166474", "0.61629236", "0.61512566", "0.61302924", "0.61302924"...
0.784048
0
returns the objects grid location based on its center point ( of object's center point and the tile's center point don't match, not in that grid tile)
function getBotGridPosition(object, myGameArea) { //console.log("doing stuff"); gridWidth = myGameArea.gridSize.w gridHeight = myGameArea.gridSize.h var centerX = object.x + object.size.w / 2 var centerY = object.y + object.size.h / 2 var tileCenterX = gridWidth / 2; var tileCenterY = grid...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getTopLeft(towers, gridPos){\n \n var x = gridPos[1];\n var y = gridPos[0];\n \n for(var i = 0; i < towers.length; i++){\n \n var tx = towers[i][0];\n var ty = towers[i][1];\n if (x == tx && y == ty){\n return [ty, tx]\n }\n else if(x == ...
[ "0.69100296", "0.6905834", "0.66960794", "0.6625463", "0.6611786", "0.65952146", "0.65952146", "0.6579675", "0.6523151", "0.6446064", "0.63391554", "0.6329082", "0.6271096", "0.62487364", "0.62448376", "0.61942613", "0.61799896", "0.61668926", "0.6153798", "0.6148055", "0.611...
0.71106786
0
Add a number of zeros to the beginning of the value. Padding dictates the total number of digits the results will have. When value is larger than padding, no padding is applied.
function pad(value, padding) { var values = (value + '').split(''); var zeros = padding - values.length; for (var i=0; i<zeros; i++) { values.unshift('0'); } return values.join(''); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pad(value) {\n return String(value).padStart(2, '0');\n }", "function pad_zeros(num, width) {\n zeros = \"0000000000\";\n return (zeros + num).slice(-width);\n}", "function zeroPad (value) {\n let pad = value < 10 ? '0' : ''\n return `${pad}${value}`\n}", "function zeroPad ...
[ "0.7832793", "0.7743723", "0.75760335", "0.75760335", "0.7562761", "0.75460446", "0.7542728", "0.75141114", "0.7482675", "0.74706835", "0.74135697", "0.7386544", "0.7386153", "0.7369348", "0.7340041", "0.7332798", "0.7329994", "0.7329994", "0.7329994", "0.73296124", "0.729540...
0.7940758
0
filter jobs to display based on startDate, endDate, and resourcesRange TODO: optimize search
function filterJobs(options) { var selectedItems = []; var job; var jobsRange = [0, jobs.length-1] for (var i = jobsRange[0]; i <= jobsRange[1]; i++) { job = jobs[i] if (!(job.from > options.endDate || job.to < options.startDate)) { if (job.resourceIndex >= options.resourcesRange[0] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getJobs(isPublic, filter) {\n if (isPublic === undefined) {isPublic = this.data.isPublic;}\n let isSignedOut = !userStore.data.token;\n this.update({loading: true, filter: filter}, () => {\n crn.getJobs((err, res) => {\n for (let app of res.body.availableApps) {app.va...
[ "0.603509", "0.5830843", "0.581168", "0.5730172", "0.5712832", "0.5712499", "0.57058513", "0.5644797", "0.5639863", "0.56086504", "0.54954064", "0.5452448", "0.5437171", "0.5388335", "0.5372102", "0.53649235", "0.5351608", "0.533012", "0.5308287", "0.5283963", "0.5267611", ...
0.7339285
0
Find output DOM associated to the DOM element passed as parameter
function findOutputForSlider(element) { var idVal = element.id; var outputs = document.getElementsByTagName('output'); for (var i = 0; i < outputs.length; i++) { if (outputs[i].htmlFor == idVal) return outputs[i]; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getOutput(){\r\n return document.querySelector(\"#output\").innerText;\r\n}", "function getDomElement() {\n return getElement();\n }", "function $doc(element){\r\n element = document.getElementById(element);\r\n return element;\r\n}", "_getDomFromElement(element) {\n if (element....
[ "0.61560315", "0.6122223", "0.60818845", "0.6005395", "0.59793454", "0.59793454", "0.5923853", "0.59191227", "0.5890755", "0.5887974", "0.5884564", "0.5875876", "0.58544976", "0.5847483", "0.58396333", "0.5819463", "0.58092445", "0.57992095", "0.57939833", "0.57820606", "0.57...
0.68757564
0
Removes a change event listener.
removeChangeListener(listener) { this.removeListener(EVENT_CHANGE, listener); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "removeChangeListener(callback) {\n this.removeListener(CHANGE_EVENT, callback);\n }", "removeChangeListener(cb) {\n this.removeListener(\"change\", cb);\n }", "removeChangeListener (callback) {\n this.removeListener(this._CHANGE_EVENT, callback);\n }", "removeChangeListener (callback) {\n ...
[ "0.827839", "0.819927", "0.81921935", "0.8159387", "0.81347734", "0.81223965", "0.7472372", "0.6794678", "0.6755543", "0.6731022", "0.65880203", "0.657295", "0.6548634", "0.65210783", "0.65210783", "0.65210783", "0.65210783", "0.65210783", "0.6518655", "0.6518655", "0.6518655...
0.8249703
1
Computes an offset such that setting `top` on elemToAlign will put it in vertical alignment with targetAlignment.
function computeOffsetForAlignment(elemToAlign, targetAlignment) { const offsetParentTop = elemToAlign.offsetParent.getBoundingClientRect().top; // Distance between the top of the offset parent and the top of the target alignment return targetAlignment.getBoundingClientRect().top - offsetParentTop; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pageOffsetTop(target) {\n\tvar top = 0;\n\twhile (target) {\n\t\ttop += target.offsetTop;\n\t\ttarget = target.offsetParent;\n\t}\n\treturn top;\n}", "function topPosition(target) {\n\tvar top = 0;\n\tif (target.offsetParent) {\n\t\twhile(1) {\n\t\t\ttop += target.offsetTop;\n\t\t\tif (!target.offsetPar...
[ "0.62766135", "0.6266067", "0.62621516", "0.62621516", "0.62621516", "0.62319434", "0.62319434", "0.62319434", "0.6207171", "0.6196984", "0.6140062", "0.60908574", "0.6030356", "0.6026451", "0.6025348", "0.6010849", "0.6001248", "0.5996118", "0.5995769", "0.5995769", "0.59309...
0.7892916
0
takes in a word and returns the letters styled grey if they are missing
wordColour(word){ let wordArray = word.split(''); return wordArray.map((letter)=>{ if(this.howMany(letter) > 0) { return <div>{letter}</div> } else { return <div className="grey">{letter}</div> } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function refLetterByLetter() {\n if (i < referenceText.length) {\n var res = referenceText.charAt(i);\n // res.style.color = 'red';\n \n return ` ${res}`;\n \n }\n}", "function modifyStyle(word) {\n\n let newWord = '';\n let char;\n let words = word.split(' ');\n\n ...
[ "0.68409574", "0.67005223", "0.6674739", "0.6552813", "0.64797693", "0.635059", "0.63484806", "0.6307072", "0.62692803", "0.62468415", "0.6223668", "0.62129277", "0.6205841", "0.6184982", "0.61615145", "0.6120618", "0.6116941", "0.60643244", "0.6036394", "0.6029756", "0.59772...
0.7271608
0
Using the pop feature to remove items from an array does not work if its under a while conditional and or for loop. This is because the index is constantly changing. I think we can solve this problem if we switch the nonnumber data type to the END of the array and then pop... maybe.
function PopStringsFromArray(arr){ for(var i = arr.length - 1; i > -1; i--){ if(typeof arr[i] !== "number"){ console.log(arr[i]) var tempArrayNumber = arr[arr.length - 1] arr[arr.length - 1] = arr[i] arr[i] = tempArrayNumber console.log(tempAr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removingWithPop() {\n\t\tvar nums = [1,2,3,4,5,9];\n\t\tnums.pop();\n\t\tconsole.log(\"Ya no hay numero 9 en el arreglo: \", nums);\n\t}", "function destructivelyRemoveElementFromEndOfArray(array){\n array.pop();\n return array;\n}", "pop() { // metodo pop ( remover elementos do array)\n retu...
[ "0.7601022", "0.71527225", "0.7149876", "0.70983166", "0.7086771", "0.7086771", "0.70642763", "0.70482415", "0.6982364", "0.6973774", "0.6966433", "0.6965561", "0.69654053", "0.69494194", "0.6902335", "0.6887978", "0.68636847", "0.68629766", "0.6842414", "0.6842119", "0.68414...
0.73108697
1
Opens the gallery for the current place
function handlePlaceGallery(){ Ti.include('ui/iphone/gallery.js'); buildGalleryView(checkinPlaceId, PHOTO_TYPE_PLACE); var galleryWindow = Ti.UI.createWindow({ backgroundColor:'white', //barImage:IMAGE_PATH+'common/bar.png', translucent:false, barColor:UI_COLOR, title:'Gallery' }); //back button & ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "openGallery_() {\n // Build gallery div for the first time\n if (!this.gallery_) {\n this.buildGallery_();\n }\n this.container_.setAttribute('gallery-view', '');\n }", "function openLightbox(e) {\n const gitem = e.currentTarget,\n itemimg = qs(\"img\", gitem),\n itemtext = qs(\".gallery...
[ "0.6711742", "0.65120363", "0.63326746", "0.627638", "0.6226626", "0.6186717", "0.61404544", "0.60508704", "0.6002218", "0.5950679", "0.59285456", "0.5924321", "0.5916404", "0.5912677", "0.5907382", "0.5880788", "0.58661926", "0.5863925", "0.58537644", "0.58155125", "0.581266...
0.6611452
1
Display the photo options
function handlePlaceShowPhotoOptions(){ checkinPlacePhotoDialog.show(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _show_image_data() {\n\t\t\tif (settings.images.length > 0) {\n\t\t\t\t$('#lightbox-image-caption').html(settings.images[settings.active][1]);\n\n\t\t\t\tvar tpm = {\n\t\t\t\t\t'#': settings.active + 1,\n\t\t\t\t\t\"$\": settings.images.length\n\t\t\t\t};\n\n\t\t\t\t$('#lightbox-image-number').html(settin...
[ "0.63168204", "0.6287337", "0.62552685", "0.6218927", "0.6208247", "0.6203104", "0.61295116", "0.6101284", "0.60846746", "0.6081302", "0.6028553", "0.5996772", "0.5985937", "0.5980533", "0.5971451", "0.594122", "0.5908325", "0.5904403", "0.58848065", "0.5884505", "0.5880088",...
0.6623838
0
handle comments button bar
function handlePlaceCommentButton(e){ Ti.API.info('Clicked on the comments bar'); var toggle = e.source.toggle; var button = e.source.button; //get the window instance var targetWindow = null; if(checkinPlaceTargetMode == TARGET_MODE_NEW_WINDOW){ targetWindow = openWindows[openWindows.length - 1]; } else if(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleViewActivityCommentButton(e){\n\tvar toggle = e.source.toggle;\n\tvar button = e.source.button;\n\t\n\tif(toggle){\n\t\topenWindows[openWindows.length - 1].setRightNavButton(null);\n\t\tviewActivityCommentsBackgroundView.animate({top:IPHONE5 ? 417 : 374, duration:500});\n\t\tviewActivityCommentsText...
[ "0.7266039", "0.6907342", "0.686437", "0.6791513", "0.6782591", "0.6726981", "0.67087245", "0.66793025", "0.6674026", "0.66659725", "0.6600293", "0.6584723", "0.6501867", "0.6487447", "0.64396334", "0.6412183", "0.6404167", "0.6395356", "0.63832766", "0.636205", "0.6359664", ...
0.7319849
0
update checkin place UI
function updateCheckinPlace(placeObj, checkins, likes, photos){ Ti.API.info('place_view.js shows '+placeObj.name+' at latitude '+placeObj.latitude+' and longitude '+placeObj.longitude); var distance = null; //distance = calculateCoordinateDistance(placeObj.latitude,placeObj.longitude, placeViewLatitude,placeView...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function changeVisualPlace(index,instance,putIn = true){\n let places = [...qSA('.place')], timeStart = [...qSA('.timeStart')];\n\n let descriptionPlace = qSA('.ownerNamePlace');\n descriptionPlace = [...descriptionPlace];\n\n if(putIn){\n places[index].classList.remove('void');\n places[...
[ "0.6375264", "0.6338534", "0.57870185", "0.56519455", "0.5634292", "0.56339204", "0.5610108", "0.55687326", "0.55644083", "0.5561623", "0.5537149", "0.55289507", "0.55281514", "0.5525939", "0.55050695", "0.5499756", "0.5477805", "0.5464113", "0.5456198", "0.54536", "0.5440205...
0.7204976
0
move the top block from fromArea to toArea if legal
function move(fromArea, toArea) { var $block = $('#' + fromArea).children().first(); var highestBlockInDest = $('#' + toArea).children().first().attr('id'); if (!highestBlockInDest) highestBlockInDest = Infinity; if (+$block.attr('id') < +highestBlockInDest) { $('#' + toArea).prepend( $block ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function MoveDownOrNewOrEnd() {\n let success = TryMove(0, 1)\n\n //success fall, no need to do checks\n if (success) return\n\n \n //freeze active Blocks\n activeBlocks.forEach(x => set_grid(x.x, x.y, x))\n\n //check filled rows\n CheckRows()\n\n //if touch top, end\n if (activeBlock...
[ "0.64719176", "0.63125163", "0.6126854", "0.6060445", "0.5956568", "0.59535605", "0.584557", "0.5785994", "0.5784829", "0.5763021", "0.56761324", "0.5669663", "0.5654911", "0.56537163", "0.5648891", "0.56461024", "0.5611975", "0.56055194", "0.55911154", "0.5576852", "0.557281...
0.7382846
0
calculate total pages, where 1 page = 10 results; count starts from 1
totalPages() { if (this.totalResultsFound > 10) { return Math.round(this.totalResultsFound / 10); } else return 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function howManyPages(results) {\n var pages;\n if(results % 10 == 0){\n pages = results / 10;\n } else {\n pages = Math.floor(results / 10) + 1;\n }\n return pages;\n }", "function getNumberOfPages() {\r\n return Math.ceil(myArr.length / numberPerPa...
[ "0.8011225", "0.72785914", "0.7259833", "0.7117146", "0.70746505", "0.70746505", "0.7031898", "0.7031898", "0.70007306", "0.69785583", "0.69763917", "0.69164836", "0.6903808", "0.6894607", "0.6880441", "0.68569404", "0.6846327", "0.68320763", "0.67742777", "0.6735859", "0.673...
0.824067
0
check if there are more results available for the current search term
hasMoreResults() { return this.remainingPages() > 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadMore(){\n if(search.keyword !== '' && search.keyword !== undefined){\n searchPlanet();\n }\n }", "get done() {\n return this.maxResults ? this.m_results.length >= this.maxResults : false;\n }", "function seeMoreResults() {\n offset = offset + 12;\n value = se...
[ "0.7095397", "0.67228734", "0.654501", "0.6295255", "0.62828934", "0.6246469", "0.6244", "0.62110835", "0.6192532", "0.61695856", "0.61553997", "0.6109511", "0.60381013", "0.6014309", "0.6011077", "0.6003319", "0.6003319", "0.59990716", "0.59337443", "0.5924734", "0.59100413"...
0.7190507
0
when video ends, reset all states
endVideo() { this.setState({ stopProgress: true, currentTime: 0, played: false }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function endVideo() {\r\n myVideo.pause();\r\n console.log(\"Video off successfully\");\r\n}", "function finalise(event) {\n rtc.disconnect();\n video.src = \"\";\n}", "function videoEndHandler0(e) {\n vid.currentTime = 0;\n vid.pause();\n vidPauseBtn.style.visibility = 'hidden';\n vidPlayBtn.style...
[ "0.7354103", "0.7223878", "0.71152514", "0.70588064", "0.69901544", "0.6891497", "0.6875779", "0.67303336", "0.6701876", "0.66918486", "0.6632915", "0.66011953", "0.6579956", "0.6575134", "0.65557355", "0.6550926", "0.65294236", "0.65223753", "0.6509685", "0.6508136", "0.6504...
0.747186
0
repeat video or not when it's finished
repeatVideo(repeat) { this.setState({ repeat: repeat }); this.state.repeat ? (this.refs.vidRef.loop = false) : (this.refs.vidRef.loop = true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function playVideo(){\n (function loop(){\n if (!ci.vid.paused && !ci.vid.end){\n ci.ctx.drawImage(ci.vid, ci.vidX, ci.vidY, ci.vidW, ci.vidH)\n setTimeout(loop, 1000/60)\n }\n })()\n}", "replay(seconds) {\n this.video.replay(seconds);\n }", "replay(seconds) {\n ...
[ "0.68526036", "0.68069065", "0.68069065", "0.6763908", "0.66927487", "0.6604241", "0.65840906", "0.65672666", "0.65574753", "0.6506011", "0.6498189", "0.64300704", "0.64226097", "0.63966954", "0.637621", "0.6363608", "0.6237034", "0.62028414", "0.62017024", "0.6186692", "0.61...
0.71296555
0
Fetch faq models and init view.
function fetchItems() { app.skeleton.faqCollection.fetch({ reset: true, success: function() { app.skeleton.faqCollectionView = app.skeleton.faqCollectionView || new FaqCollectionView({ collection: app.skeleton.faqCollection }); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init(){\n \n api.getItems( bookmarks => {\n bookmarks.forEach( bookmark => store.addItem(bookmark))\n // render page and register event listeners\n modelView.renderSideBar()\n modelView.renderDetail()\n modelView.renderForm()\n modelView.handleEvents()\n })\n \n}", "static async fe...
[ "0.6181234", "0.60146654", "0.58075273", "0.5780712", "0.5615336", "0.5609992", "0.56070906", "0.5549596", "0.5535689", "0.5527947", "0.54876816", "0.5473494", "0.5456408", "0.54426926", "0.54388344", "0.543833", "0.5421351", "0.5351949", "0.5348931", "0.53394866", "0.5326666...
0.72464764
0
View Rendering Renders a view because of a date change, viewtype change, or for the first time. If not given a viewType, keep the current view but render different dates. Accepts an optional scroll state to restore to.
function renderView(viewType, forcedScroll) { ignoreWindowResize++; var needsClearView = currentView && viewType && currentView.type !== viewType; // if viewType is changing, remove the old view's rendering if (needsClearView) { freezeContentHeight(); // prevent a scroll jump when view element is removed ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderView(viewType, explicitScrollState) {\n\t\tignoreWindowResize++;\n\n\t\t// if viewType is changing, remove the old view's rendering\n\t\tif (currentView && viewType && currentView.type !== viewType) {\n\t\t\tfreezeContentHeight(); // prevent a scroll jump when view element is removed\n\t\t\tclearVie...
[ "0.71975684", "0.7177238", "0.71216714", "0.7106514", "0.7106514", "0.5928555", "0.58858037", "0.58858037", "0.58858037", "0.58858037", "0.58524483", "0.58492357", "0.58492357", "0.5813612", "0.56871414", "0.54948527", "0.5438056", "0.5420224", "0.53961766", "0.53295016", "0....
0.7284195
0
Unrenders the current view and reflects this change in the Header. Unregsiters the `currentView`, but does not remove from viewByType hash.
function clearView() { toolbarsManager.proxyCall('deactivateButton', currentView.type); currentView.removeElement(); currentView = t.view = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clearView() {\n\t\theader.deactivateButton(currentView.type);\n\t\tcurrentView.removeElement();\n\t\tcurrentView = t.view = null;\n\t}", "function reinitView() {\n\t\tignoreWindowResize++;\n\t\tfreezeContentHeight();\n\n\t\tvar viewType = currentView.type;\n\t\tvar scrollState = currentView.queryScroll(...
[ "0.72483796", "0.5914739", "0.5910161", "0.59055036", "0.5886828", "0.58078045", "0.57102233", "0.56861883", "0.56783676", "0.56783676", "0.56783676", "0.56783676", "0.56783676", "0.56783676", "0.56783676", "0.5676154", "0.5676154", "0.5676154", "0.5670014", "0.5634175", "0.5...
0.6625194
1
Destroys the view, including the view object. Then, reinstantiates it and renders it. Maintains the same scroll state. TODO: maintain any other usermanipulated state.
function reinitView() { ignoreWindowResize++; freezeContentHeight(); var viewType = currentView.type; var scrollState = currentView.queryScroll(); clearView(); calcSize(); renderView(viewType, scrollState); thawContentHeight(); ignoreWindowResize--; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reinitView() {\n\t\tignoreWindowResize++;\n\t\tfreezeContentHeight();\n\n\t\tvar viewType = currentView.type;\n\t\tvar scrollState = currentView.queryScroll();\n\t\tclearView();\n\t\trenderView(viewType, scrollState);\n\n\t\tunfreezeContentHeight();\n\t\tignoreWindowResize--;\n\t}", "detach() {\n ...
[ "0.7219613", "0.70055115", "0.70055115", "0.70055115", "0.70055115", "0.70055115", "0.6520296", "0.6489738", "0.645756", "0.64423186", "0.63998723", "0.63998723", "0.63998723", "0.6389158", "0.6388967", "0.6388294", "0.6327719", "0.63252276", "0.63086057", "0.6182172", "0.617...
0.7100806
1
can be called repeatedly and Header will rerender
function renderHeader() { header.setToolbarOptions(computeHeaderOptions()); header.render(); if (header.el) { element.prepend(header.el); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderHeader() {\n\t\theader.render();\n\t\tif (header.el) {\n\t\t\telement.prepend(header.el);\n\t\t}\n\t}", "function updateHeaderPanel() {\n katex.render(katex_str(func_data[current_index].katex_func), header_katex_func, {throwOnError: false});\n header_katex_info.innerHTML = func_data[current_...
[ "0.71581805", "0.6960288", "0.6749593", "0.6747897", "0.67436653", "0.6645872", "0.6627307", "0.66048497", "0.65605694", "0.6531338", "0.65201735", "0.64904225", "0.6409418", "0.64052296", "0.6344062", "0.63408405", "0.6290964", "0.6290964", "0.6280527", "0.6265821", "0.61980...
0.71515524
1
Event Normalization Given a raw object with key/value properties, returns an "abstract" Event object. An "abstract" event is an event that, if recurring, will not have been expanded yet. Will return `false` when input is invalid. `source` is optional
function buildEventFromInput(input, source) { var out = {}; var start, end; var allDay; if (t.options.eventDataTransform) { input = t.options.eventDataTransform(input); } if (source && source.eventDataTransform) { input = source.eventDataTransform(input); } // Copy all properties over to the res...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function buildEventFromInput(input, source) {\n\t\tvar out = {};\n\t\tvar start, end;\n\t\tvar allDay;\n\n\t\tif (options.eventDataTransform) {\n\t\t\tinput = options.eventDataTransform(input);\n\t\t}\n\t\tif (source && source.eventDataTransform) {\n\t\t\tinput = source.eventDataTransform(input);\n\t\t}\n\n\t\t// ...
[ "0.67123574", "0.67123574", "0.67123574", "0.67123574", "0.6633553", "0.6633553", "0.6633553", "0.56476575", "0.55471534", "0.5332519", "0.5171368", "0.5171368", "0.50837713", "0.50837713", "0.50837713", "0.50754267", "0.50734663", "0.5036104", "0.49925697", "0.49453974", "0....
0.67135674
1
Display a notification with a call's status.
function callStatusNotification(status, b_number) { callFailedNotification('call-status', clicktodial.getStatusMessage(status, b_number)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateCallStatus(status) {\n if (callStatus.length > 0) {\n callStatus.text(status);\n } else {\n callStatus.textContent = status;\n }\n}", "function show_newcall() {\n startingcalllAlarm();\n currentCall();\n chrome.notifications.create('id', {\n priority: 2,\n ...
[ "0.7235732", "0.64747846", "0.60594046", "0.6050559", "0.59955263", "0.59923667", "0.591578", "0.5914075", "0.5912967", "0.59108055", "0.57658947", "0.5674805", "0.56158876", "0.5588934", "0.5578219", "0.55701226", "0.5567303", "0.55656695", "0.55626804", "0.5557559", "0.5551...
0.7460234
0
I provide access to the FAQ modal window.
function FAQ(){ // Cache DOM references. this.dom = {}; // When creating the detached node for the module, filter // out all the whitspace, text nodes, and comments that // come with the module. this.dom.target = $( faqHtml ).filter( "div.m-faq" ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function openQuestion(evt, question) {\n let i, answer, tablinks;\n answer = document.getElementsByClassName(\"answer\");\n for (i = 0; i < answer.length; i++) {\n answer[i].style.display = \"none\";\n }\n tablinks = document.getElementsByClassName(\"tablinks\");\n for (i = 0; i < tablinks.length; i++) {\...
[ "0.63828284", "0.6373359", "0.6263828", "0.62198484", "0.6142332", "0.6139208", "0.60838366", "0.6082424", "0.6074886", "0.59846956", "0.5966544", "0.5954727", "0.590975", "0.5901401", "0.5893491", "0.58713937", "0.5865558", "0.586227", "0.5859699", "0.583298", "0.5827764", ...
0.66239846
0
Clear any data that was typed into the "Create Game Instance" form so that it is blank the next time it is displayed.
function cleanAndHideCreateGameInstancePanel() { // Select the panel using its 'id' attribute. var panel = $('#createGameInstancePanel'); panel.hide(); // Find all the text fields on the panel and clear their contents. panel.find('input[type=text]').val(''); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reset() {\n\n // Remove previous game data\n clearGameDivs();\n\n // Create Characters for Character Select\n charCreation();\n }", "function resetGame() {\n $('.container').empty();\n // userInput.empty();\n}//end resetGame function", "function inner_clear_form()\n\t\...
[ "0.6986528", "0.6979524", "0.69259846", "0.67931885", "0.67834115", "0.668509", "0.6684872", "0.6666132", "0.66527236", "0.664721", "0.6589352", "0.6543512", "0.6541887", "0.6530162", "0.6501368", "0.6493189", "0.64728594", "0.6462893", "0.6457147", "0.64416945", "0.6439898",...
0.7110459
0
Clears any images in the photo gallery container.
function clearPictures() { let imgs = qsa("#pictures img"); for (let i = 0; i < imgs.length; i++) { imgs[i].parentNode.removeChild(imgs[i]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "clearImages() {\n this.clearCanvases();\n this.clearImage();\n this.photos = 0;\n }", "function clearAllImages(){\n\t$(\"#images\").empty();\n}", "function clearGallery() {\n $('.pure-g').empty();\n}", "clear() {\n this.imageCards = [];\n $('.images-co...
[ "0.8353873", "0.767956", "0.7678389", "0.73950565", "0.7237004", "0.72057855", "0.71756655", "0.71184576", "0.70993173", "0.7045059", "0.70328414", "0.6954382", "0.68737614", "0.68431085", "0.6840057", "0.6807408", "0.6783136", "0.6766101", "0.67535776", "0.6724977", "0.67245...
0.7788614
1
FUNZIONI funziona per eliminare messaggi e far apparire il menu nascosto
function deletMess(){ //al click apri il menu nascosto $(".fa-chevron-down").click(function(){ $(this).next().toggleClass("hide_menu") scrollMessaggio () }) $(".sotto_menu").mouseleave(function(){ $(".sotto_menu").removeClass("hide_menu") }) //cancella un e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeAllMessages() { /// remove existing messeges that being display\n document.getElementById('payee-name-check-req-msg-edit').style.display = \"none\";\n document.getElementById('payee-name-check-char-msg-edit').style.display = \"none\";\n document.getElementById('country-check-req...
[ "0.6837616", "0.6685662", "0.6613023", "0.6502123", "0.64370006", "0.6436713", "0.6364709", "0.63462836", "0.6330324", "0.6313954", "0.62850547", "0.62752134", "0.62656116", "0.6262064", "0.6251368", "0.6245471", "0.622505", "0.62183964", "0.61759156", "0.6175558", "0.6152296...
0.7446078
0
dTake skills from input fields
function takeSkillsFromPage(obj2){ var playerSkill1 = document.getElementById("playerSkill1").value; var playerSkill2 = document.getElementById("playerSkill2").value; var playerSkill3 = document.getElementById("playerSkill3").value; var playerSkill4 = document.getElementById("playerSkill4").value; v...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function processClassSkills(message, args) {\n\t//if too many args\n\tif (args.length > 2) {\n\t\tmessage.channel.send(\"You have provided too many arguments. I am looking for only 2 numbers. E.G. `1 3`\")\n\t\treturn null;\n\t}\n\n\tif (args[0] == args[1]) {\n\t\tmessage.channel.send(\"The arguments you have prov...
[ "0.61478466", "0.6033457", "0.6027176", "0.59839326", "0.59358704", "0.58683187", "0.58392566", "0.57593066", "0.57530683", "0.57454455", "0.57320875", "0.5718878", "0.5676594", "0.5655784", "0.56137484", "0.55712754", "0.55503607", "0.5546116", "0.5528178", "0.55194193", "0....
0.6243523
0
start validation de numero de tele
function validenum(){ var numero = document.getElementById('mobile').value; var er = document.getElementById('erreur4'); if(numero.match(/(?=.*(05|06|07))[0-9]{10,}/)){ text = "votre numero est valid"; er.innerHTML = text; er.style.color = "green"; return true; } else{ text = "votre n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validacionNumero(){\n\tvar inputPhone = document.getElementById(\"registro-input\").value;\n\tvar boton = document.getElementById(\"registro-button\");\n\n\tboton.addEventListener(\"click\", function(){\n\t\tif(inputPhone == 0){\n\t\t\talert(\"No puedes dejar el espacio en blanco\");\n\t\t\treturn false;\...
[ "0.67158705", "0.6578475", "0.656417", "0.6532586", "0.6519813", "0.6487552", "0.64383125", "0.6418403", "0.6342203", "0.63245064", "0.63218", "0.6308781", "0.6305387", "0.6290489", "0.62785757", "0.6276854", "0.6272575", "0.62618494", "0.62324136", "0.6188245", "0.6187525", ...
0.66084826
1
used to get a date with respect to current date: return value = current date + index > increment of current date
function setDate(index){ var current_date = new Date(); var new_date = new Date(); new_date.setDate((current_date.getDate())+index); new_date = new_date.toISOString().slice(0,10); return new_date }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nextDate(){\n date.setDate(date.getDate()+1);\n return thisDate();\n }", "function getDate(index) {\n var date = startTime + ((endTime - startTime) * index) / (100);\n return new Date(date * 1000);\n}", "getDatesList(date,currentDate) {\n const dateList = [];\n for(let i = 0...
[ "0.69925314", "0.6593603", "0.6518018", "0.6430205", "0.6422781", "0.64093256", "0.636639", "0.6355685", "0.6349649", "0.63454896", "0.6239249", "0.6096511", "0.6095574", "0.60439926", "0.60426265", "0.6035785", "0.603223", "0.5980608", "0.59744835", "0.5944579", "0.5898855",...
0.72949266
0
Create a function 'fetchStudentDetailsFromDB' to retrieve the data from the API ' On receiving the response, call the 'addToHTML' function by passing the JSON object containing the student data to 'addToHTML()' function which will dynamically generate the HTML response. As fetch() returns a promise, ensure that you res...
function fetchStudentDetailsFromDB() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function fetchArticle() {\n\n try {\n const response = await fetch(url);\n const details = await response.json();\n\n console.log(details);\n\n createHtml(details);\n \n }\n catch(error) {\n console.log(error);\n }\n \n}", "function add_html(member) {\...
[ "0.68820083", "0.659661", "0.65658385", "0.64202356", "0.64188683", "0.64077306", "0.62907577", "0.6245922", "0.6239474", "0.6142996", "0.6083883", "0.6081661", "0.6062041", "0.60215425", "0.59756297", "0.59589773", "0.59541774", "0.5936867", "0.5914888", "0.58971363", "0.589...
0.6600797
1
when the function is called, make the information table visible; get the information from dict and modify the list content correspondingly
function getDetailsJun(){ var current_td; var items; current_td = document.getElementsByTagName('td'); document.getElementById('intro').style.visibility = 'visible'; items = document.getElementsByTagName('li'); for (var i = 0; i < 3; i++){ current_td[i].innerHTML = Object.values(junInfo)[i]...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showList(stocksList){\n var table = document.getElementById(\"stockList\");\n var companies = JSON.parse(stocksList);\n clearTable();\n \n for(i = 0; i < companies.length; i++){\n \n var row = table.insertRow(-1); \n var cName = companies[i].name;\n var na...
[ "0.63541317", "0.62790567", "0.6259267", "0.6212275", "0.6183442", "0.6158154", "0.6130175", "0.6126005", "0.6117523", "0.61171395", "0.60876584", "0.60750836", "0.60596746", "0.6035819", "0.60320294", "0.6006107", "0.6005494", "0.5967111", "0.5952236", "0.5924812", "0.590995...
0.62813944
1
To Generate File as per type passed as params
function generatingFile(type) { var deferred = $q.defer(); URL = "/generatingFile"; $http.get(URL,{params:{type:type}}).success(function(response) { deferred.resolve(response); }).error(function(er) { deferred.reject(er); }); return deferred.promise; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "generateFile () {\n // determine the type of file\n switch(this.type) {\n case \"Element\":\n this.imageTemplate(this.encodedSVG());\n break;\n case \"Node\":\n this.imageTemplate(this.encodedSVG());\n break;\n case \"StorageElement\":\n this.imageTemplate(this.encodedSVG())...
[ "0.72961473", "0.6195663", "0.6044976", "0.5861239", "0.5763061", "0.5616881", "0.5564794", "0.54268235", "0.53745115", "0.534804", "0.53024054", "0.5278383", "0.52378607", "0.52369905", "0.5236187", "0.5172349", "0.5164439", "0.51231647", "0.5116562", "0.5105076", "0.5094402...
0.6690974
1
5 find pairs of 2 elemnts whose sum is 100 and it should not repeat by reverse. eg[10,90] not repeat [90,10]
function printPairs() { var arr = [10, 20, 90, 80, 30, 70, 60, 50, 50, 9, 11, 89, 40, 91, 4, 5, 22]; var result = []; for (let i = 0; i < arr.length - 1; i++) { for (let j = i + 1; j < arr.length - 1; j++) { if (arr[i] + arr[j] === 100) { result.push([arr[i], arr[j]]); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function search_pair(arr, target_sum, left, triplets) {\n let right = arr.length - 1\n\n while (left < rigth) {\n // sum Y and Z\n const current_sum = arr[left] + arr[right]\n\n // found the triplet\n if (current_sum === target_sum) {\n triplets.push([-target_sum, arr[l...
[ "0.6390551", "0.62109375", "0.62084997", "0.61376375", "0.6136034", "0.61291003", "0.6124311", "0.61217296", "0.6120151", "0.61028475", "0.6101718", "0.607618", "0.60616314", "0.60405236", "0.6027613", "0.6002546", "0.5978224", "0.5978115", "0.5976917", "0.5963202", "0.5954",...
0.68381196
0
Clear the current time
clear () { this._time = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clears() {\n var currentdate = new Date(); \n seconds = currentdate.getSeconds();\n minutes = currentdate.getMinutes();\n hours = currentdate.getHours();\n updates();\n}", "function resetTime() {\n time = 16;\n }", "function chronoReset(){\n\tdocument.getElementById(\"chronotime\").inne...
[ "0.78126854", "0.7485616", "0.71699524", "0.7103617", "0.7045583", "0.7030702", "0.7018995", "0.69192636", "0.6901835", "0.6896832", "0.6870819", "0.67857075", "0.67357564", "0.6698929", "0.669733", "0.669733", "0.6671371", "0.6649221", "0.6642602", "0.6602986", "0.65912867",...
0.77218634
1
returns an instruction_array or null if the queue is empty
newest_instruction_in_queue() { if(this.is_queue_empty()) { return null } else return this.queue[this.queue.length - 1] }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "remove_from_queue(){ //takes off of front of queue, returns the removed instruction\n let done_instruction_array = this.queue.shift()\n if(this.is_queue_empty()) {\n this.unset_queue_blocking_instruction_maybe()\n }\n }", "add_instruction_to_queue(instruction_array){\n c...
[ "0.64491266", "0.6160408", "0.60646296", "0.5989949", "0.59703493", "0.5942219", "0.5722452", "0.5613497", "0.5608949", "0.55875623", "0.55711", "0.5563051", "0.5563051", "0.5555087", "0.5524389", "0.5483298", "0.5470162", "0.5469205", "0.5458997", "0.5456319", "0.54206955", ...
0.7066895
0
called when graphics simulator is done executing the nowrunning instruction. dont set params in here because remove_from_queue is called by empty_instruction_queue which we DON'T want to set_params.
remove_from_queue(){ //takes off of front of queue, returns the removed instruction let done_instruction_array = this.queue.shift() if(this.is_queue_empty()) { this.unset_queue_blocking_instruction_maybe() } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "empty_instruction_queue(){\n while (this.queue.length) { this.remove_from_queue() }\n this.update_show_queue_if_shown()\n }", "function endQueueProcessing() {\n processingQueue = false\n }", "start_running_instruction_if_any(){\n if(this.is_queue_empty()) {\n ...
[ "0.6758245", "0.62414783", "0.6174703", "0.6130924", "0.6089224", "0.6076672", "0.60325336", "0.60054976", "0.60054976", "0.60054976", "0.60054976", "0.60013723", "0.5969761", "0.5969761", "0.5969761", "0.5969761", "0.5969761", "0.5969761", "0.5969761", "0.59197176", "0.59094...
0.6904688
0
just sets j6_plus status and updates
done_with_j6_plus_instruction(joint_number){ let du = this.sim_instance.angles_dexter_units[joint_number - 1] let val_for_show = (this.show_degrees ? Socket.dexter_units_to_degrees(du, joint_number) : du) val_for_show = (Number.isInteger(val_for_show) ? val_for_show : val_for_show.toFixed(3)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updatePowerStatus() {}", "function executeUpdateRegistration() {\n gUpdateFlag = true;\n executeAuthentication();\n}", "update() {\r\n\t\t// do nothing for now\r\n\t}", "_update() {\n\t\t\n\t}", "requestUpdate() { this.hasRequestedUpdate_ = true; }", "function updateEnabled(cb){\n\t//Log\n\tlog(\"C...
[ "0.61883575", "0.5881523", "0.58672786", "0.5820105", "0.57804924", "0.5696082", "0.56620306", "0.5636114", "0.56179124", "0.56105494", "0.55704445", "0.55691266", "0.55372626", "0.55339545", "0.5532817", "0.55309635", "0.5499648", "0.5493666", "0.5483964", "0.54736537", "0.5...
0.59856665
1
top level show called from clicking the "Show Queue" button in Sim header. Simqueue.show_queue_for_default_dexter()
static show_queue_for_default_dexter(){ if(misc_pane_menu_selection !== "Simulate Dexter"){ show_in_misc_pane("Simulate Dexter") //if Simulate Dexter is not shown when queue is shown, we'll get an error } let rob_name = Dexter.default.name let sim_inst = (DexterSim.robot_name...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onQueueShow (stamp) {\n this.getJobState('queue', stamp, false, '')\n }", "showUploadQueue() {\n\t\tthis.listQueueItems(Push.queueDefs.upload);\n\t}", "function show() {\n }", "function show() {\n }", "function viewQueue()\n{\n // makes the queue view visible to the user\n d...
[ "0.7114499", "0.710711", "0.6192588", "0.6148727", "0.6075621", "0.60378695", "0.5974945", "0.59384316", "0.5913099", "0.58798873", "0.5851488", "0.5824033", "0.58063954", "0.5803643", "0.5779939", "0.57532626", "0.57412136", "0.57314694", "0.5729632", "0.57114005", "0.570563...
0.8407123
0
fills in the keys of the mandatory fields
setMandatoryFields (editMap) { const list = []; editMap.forEach(config => { if (!config.mandatory) return; const key = (!config.keys) ? config.key : config.keys.render; list.push(key); }); this.mandatoryFields = list; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateMandatoryDict(mandatory){\n for(var i = 0; i < mandatory.length; i++){\n mandatory_dict[mandatory[i].id] = mandatory[i];\n }\n }", "setRequiredFields(requiredFields){this._requiredFields=collectionToArray(requiredFields);return this;}", "function addRequired() {\n ...
[ "0.6588038", "0.65022045", "0.6290575", "0.61808556", "0.61537474", "0.6078598", "0.6078598", "0.6078598", "0.6078598", "0.6078598", "0.6078598", "0.6078598", "0.6078598", "0.6078598", "0.6078598", "0.6078598", "0.6003834", "0.59733963", "0.5961143", "0.5910556", "0.5888512",...
0.6738364
0
generic stream batcher. this simply batches up $size rows in to a single array and then pushes that array downstream.
function streamFactory( size ){ size = size || 100; return batchify.obj({ batchSize: size, highWaterMark: 2 }, function( batch, _, next ){ this.push( batch ); next(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeBatches(size, batchSize) {\n var output = [];\n var batchStart = 0;\n var batchEnd = null;\n while (batchStart < size) {\n batchEnd = batchStart + batchSize;\n if (batchEnd >= size) {\n batchEnd = size;\n }\n output.push([batchStart, batchEnd]);\n batchStart = batchEnd;\n }\n ...
[ "0.6657095", "0.66284484", "0.66284484", "0.6548551", "0.6466676", "0.6349321", "0.62478524", "0.62112826", "0.6209603", "0.6158805", "0.610576", "0.60949105", "0.60943925", "0.6093844", "0.60873944", "0.60578114", "0.6029129", "0.6024327", "0.60193175", "0.60039186", "0.5957...
0.6795381
0
Transform a table to a jqGrid.
function tableToGrid(selector, options) { jQuery(selector).each(function() { if(this.grid) {return;} //Adedd from Tony Tomov // This is a small "hack" to make the width of the jqGrid 100% jQuery(this).width("99%"); var w = jQuery(this).width(); // Text whether we have single or multi select var inputCheckbox = j...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tableToGrid(selector, options) {\r\njQuery(selector).each(function() {\r\n\tif(this.grid) {return;} //Adedd from Tony Tomov\r\n\t// This is a small \"hack\" to make the width of the jqGrid 100%\r\n\tjQuery(this).width(\"99%\");\r\n\tvar w = jQuery(this).width();\r\n\r\n\t// Text whether we have single or ...
[ "0.7012404", "0.6409427", "0.5845773", "0.5821898", "0.57211614", "0.56507087", "0.56299263", "0.5629422", "0.5617279", "0.5579372", "0.5576518", "0.55723244", "0.55651677", "0.55570126", "0.55213386", "0.5487723", "0.54710686", "0.54673034", "0.5465014", "0.5420462", "0.5375...
0.7027577
1
Returns the note name for a given note index
function getNoteName(noteValue) { var octave = Math.floor((noteValue - 24) / 12); return NOTE_NAMES[noteValue % 12] + octave; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static indexToName(index, natural) {\n\t\tconst candidates = Note.names[index]\n\t\tif (!candidates) {\n\t\t\tthrow new Error(`invalid note index: ${index}`)\n\t\t}\n\n\t\treturn candidates.filter((name) => name[0] === natural)[0]\n\t}", "function getNoteLetter(midiNote){\n var noteIndex = midiNote % 12;\n ...
[ "0.7917899", "0.63854724", "0.6245329", "0.6242037", "0.61859983", "0.6100916", "0.60808146", "0.6051032", "0.601931", "0.5938174", "0.5907468", "0.58620846", "0.5794215", "0.5696062", "0.5662595", "0.5629781", "0.5610605", "0.5609338", "0.5593922", "0.5590675", "0.5563441", ...
0.6857195
1
Creates a google map marker with the map context
createMarker(options = {}) { return this._map.then((map) => { options.map = map; return new google.maps.Marker(options); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeMarker(map){\n marker = new google.maps.Marker({\n //position: latlng,\n map: map,\n title: 'Hello World!'\n });\n //marker.setPosition(latlng)\n\n}", "function createMarker(map, latitude, longitude, city) {\n \n let imageLatLong = {lat: latitude, lng: longitude };\n ...
[ "0.74906594", "0.7410199", "0.7366814", "0.7319365", "0.73053795", "0.72844106", "0.71588296", "0.7148677", "0.71217334", "0.7075989", "0.70700383", "0.7069771", "0.70584404", "0.7057027", "0.7025331", "0.7020577", "0.7020272", "0.7011843", "0.69943684", "0.699245", "0.698207...
0.7468415
1
Creates a google.map.Circle for the current map.
createCircle(options) { return this._map.then((map) => { options.map = map; return new google.maps.Circle(options); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCircle(center,map){\n return new google.maps.Circle({\n center: center,\n radius: 10,\n strokeColor: \"#CC0000\",\n strokeOpacity: 0.8,\n strokeWeight: 2,\n fillColor: \"#CC0000\",\n fill...
[ "0.81773365", "0.75443316", "0.7411742", "0.7385152", "0.7015087", "0.68827444", "0.67572117", "0.6681653", "0.6653984", "0.6628203", "0.6555559", "0.6549461", "0.6538906", "0.6478847", "0.6446389", "0.64231175", "0.64050364", "0.6358154", "0.6349586", "0.6338481", "0.6294068...
0.78921986
1
Returns the native Google Maps Map instance. Be careful when using this instance directly.
getNativeMap() { return this._map; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_getDummyMap() {\n\t\tif (!this.dummy_map) {\n\t\t\tthis.dummy_map = new google.maps.Map(document.createElement('div'));\n\t\t}\n\n\t\treturn this.dummy_map;\n\t}", "function createMap() {\n return new MapCtr();\n }", "function createMap() {\n return new MapCtr();\n }", "f...
[ "0.711669", "0.69735503", "0.69735503", "0.69584477", "0.6833238", "0.68207425", "0.65684295", "0.6442733", "0.6422298", "0.6359032", "0.6357005", "0.6307984", "0.6168022", "0.61291945", "0.61195487", "0.6115885", "0.6100801", "0.6098221", "0.6086832", "0.6066741", "0.6061446...
0.6980061
1
Triggers the given event name on the map instance.
triggerMapEvent(eventName) { return this._map.then((m) => google.maps.event.trigger(m, eventName)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "triggerEvent(eventName, ...args) {\n const handlers = this._eventsHandlersMap.get(eventName);\n if (!handlers) {\n return;\n }\n [...handlers].forEach(handler => handler(...args));\n }", "function trigger(name) {\r\n if (!this._events) return this;\r\n var args = slice.call(arguments, 1);...
[ "0.63945067", "0.63681257", "0.6362953", "0.6190164", "0.61754775", "0.6123573", "0.600392", "0.5929177", "0.59236306", "0.5760856", "0.5725765", "0.56948334", "0.568974", "0.56862336", "0.5677528", "0.5640942", "0.5640942", "0.5628296", "0.5626636", "0.56147057", "0.56147057...
0.69694805
0
Removes the given circle from the map.
removeCircle(circle) { return this._circles.get(circle).then((c) => { c.setMap(null); this._circles.delete(circle); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeCircle() {\n\t// initially no circle around the city is set\n\t// remove circle only if it is set\n\tif(cityCircle != undefined) {\n \tcityCircle.setMap(null);\n }\n}", "function removeAllCircles() {\n mymap.eachLayer(function(layer) {\n if (layer instanceof L.Circle) {\n mymap.remo...
[ "0.83666813", "0.74017775", "0.7400274", "0.71726966", "0.7171725", "0.7168172", "0.7137316", "0.6713574", "0.65820235", "0.65638965", "0.6501193", "0.6392259", "0.62932897", "0.6196938", "0.6118323", "0.6037121", "0.6022643", "0.60173905", "0.60126215", "0.6000385", "0.59264...
0.811549
1
Triggers a resize event on the google map instance. Returns a promise that gets resolved after the event was triggered.
triggerResize() { // Note: When we would trigger the resize event and show the map in the same turn (which is a // common case for triggering a resize event), then the resize event would not // work (to show the map), so we trigger the event in a timeout. return new Promise((resolve) => ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "resize() {\n if (this.map) {\n // saves and restores latitude/longitude because resize can move the center\n const oldLatitude = this.latitude;\n const oldLongitude = this.longitude;\n google.maps.event.trigger(this.map, 'resize');\n this.latitude = oldLatitude; // restore because resiz...
[ "0.667106", "0.6603947", "0.65615755", "0.65577966", "0.64198667", "0.6400376", "0.63814557", "0.636031", "0.63083494", "0.62935793", "0.6282021", "0.61796796", "0.6145225", "0.61031425", "0.60751814", "0.6064817", "0.60448456", "0.6031765", "0.60289127", "0.60162455", "0.600...
0.82502097
0
3. Get MIN EVEN value of array
function getMinEven(array) { if (!array.length) throw new Error('Provided empty array') let minEven = array[0] array.forEach(item => { if (item < minEven && item % 2 == 0) { minEven = item } }) return minEven }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function minValue(arr) {\n\treturn arr.reduce(function(acc,num){\n\t\treturn acc < num ? acc : num;\n\t})\n}", "function smallestValue(arr){\n \n //es6\n return Math.min(...arr);//5 \n}", "function findMinValue(array) {\n\tlet min, i;\n\tmin = array[0];\n\tfor (i = 1; i > array.length; i += 1) {\n\t\t...
[ "0.7406665", "0.7109608", "0.7083076", "0.70695025", "0.70627534", "0.7000943", "0.69931185", "0.6976322", "0.6924387", "0.68966043", "0.68966043", "0.6889982", "0.68812305", "0.6878071", "0.6848461", "0.683674", "0.683674", "0.6802839", "0.6797943", "0.679478", "0.6789151", ...
0.79355985
0
5. Remove items which aren't divisible by 3 from the array
function removeItems(array) { const result = array.filter(item => item % 3 !== 0) return result }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function multiplesOfThree(array) {\n \n return filter(array, function(element) {\n\n return ( (element != 0) && (element % 3 === 0) );\n });\n}", "function getMultiplesOfThree() {\n var A = [10, 5, 13, 18, 51];\n return A.filter(el => el % 3 == 0);\n}", "function tripleAndFilter(arr){\n return a...
[ "0.7775323", "0.72614914", "0.72139454", "0.7163314", "0.71497726", "0.70759374", "0.67783356", "0.67679447", "0.6700542", "0.6684938", "0.66463333", "0.66142875", "0.6547733", "0.6542318", "0.652212", "0.65112615", "0.6477931", "0.6465685", "0.64504147", "0.64424664", "0.643...
0.8290392
0
6. Increase the elements of array 1.5 times
function increaseItems(array) { if (!Array.isArray(array)) throw new Error('Provided not array') let result = array.map(item => item * 1.5) return result }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function looper (array) {\n for(var i = 0; i < array.length; i++) {\n array[i] += 5\n }\n return array;\n }", "function looper(arr) {\n var updatedArray = [];\n for(var i = 0; i < arr.length; i++) {\n updatedArray.push(arr[i] + 5)\n }\n return updatedArray\n}", "function incre...
[ "0.7229358", "0.7117787", "0.7044157", "0.69862646", "0.674801", "0.6689153", "0.6671177", "0.65328795", "0.65059376", "0.6469511", "0.6452801", "0.64058477", "0.63720876", "0.6351762", "0.63450164", "0.6314794", "0.6305137", "0.63014305", "0.62965834", "0.62882876", "0.62448...
0.71259826
1
9. The product of all positive elements of an array.
function productPositive(array) { if (!array.length) return 0 let product = 1; array.forEach(item => product *= item > 0 ? item : 1) return product }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function product(arr) {\n let sumTotal = 1;\n for (i = 0; i < arr.length; ++i) {\n sumTotal *= arr[i]; \n }\n return sumTotal;\n}", "function productOfAllElements(arr) {\n return arr.reduce(function (total,elem,i,arr) {\n return total * elem;\n },1);\n}", "function products(arr) {\n...
[ "0.7660568", "0.7466602", "0.7455205", "0.7447698", "0.7436529", "0.7408783", "0.73617655", "0.7351998", "0.7333431", "0.73228014", "0.73216593", "0.7286549", "0.7283422", "0.7274826", "0.72712415", "0.7269491", "0.7262859", "0.7254569", "0.72440106", "0.7236763", "0.7232814"...
0.8160913
0
12. Check if the element includes in array
function isIncludes(array, element) { let result = false array.forEach((item, i) => { if (array[i] === element) result = true }) return result }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function includes (array, item) {\n}", "function includes(item, array) {\n for (var i = 0; i < array.length; i++) {\n if (array[i] === item) {\n return true;\n }\n }\n return false;\n }", "funct...
[ "0.8010708", "0.78327537", "0.7808507", "0.77462626", "0.7674955", "0.76668906", "0.7641158", "0.75377977", "0.75158525", "0.7457788", "0.74173045", "0.7414381", "0.73883736", "0.7379185", "0.73533446", "0.73185974", "0.7290973", "0.728143", "0.7276161", "0.7257508", "0.72241...
0.7932052
1
14. Calculate the sum of the main diagonal of the matrix
function calcSumDiagonal(matrix) { let sum = 0 matrix.forEach((row, i) => { row.forEach((col, j) => { if (i == j) sum += matrix[i][j] }) }) return sum }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function diagonalSum(matrix) {\n var output = 0;\n for (var i=0; i<matrix.length; i++) {\n output = output + matrix[i][i];\n }\n return output;\n}", "function sumBelowDiagonal(matrix) {\n let sum = 0;\n for (let row = 1; row < matrix.length; row += 1) {\n for (let col = 0; col < row; col += 1...
[ "0.78680956", "0.7491124", "0.7016014", "0.6786585", "0.6486873", "0.64766634", "0.6443567", "0.64127004", "0.63664156", "0.62781507", "0.6275961", "0.6271932", "0.6182406", "0.616532", "0.61458254", "0.6145479", "0.61280876", "0.6105665", "0.6102654", "0.60910976", "0.605829...
0.79564136
0
15. Calculate the sum of the column of the matrix
function calcSumColumn(matrix, col) { if(col >= matrix.length) throw new Error('Matrix has less columns') let sum = 0 matrix.forEach((item) => { sum += item[col] }) return sum }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "columnSum(matrix,col){\n var colSum = 0;\n for (var i=0; i<matrix.length; i++){\n colSum += matrix[i][col].value;\n }\n return colSum\n }", "static sum(m) {\n let result = 0;\n for(let r = 0; r < m.rows; r++)for(let c = 0; c < m.cols; c++)result += m.data[r]...
[ "0.85079795", "0.7439054", "0.6976619", "0.69350255", "0.6795245", "0.6768977", "0.6761371", "0.67121065", "0.67111886", "0.66993004", "0.6678904", "0.6661704", "0.6646015", "0.6631588", "0.6601623", "0.65918237", "0.6566109", "0.65477204", "0.64909834", "0.6473341", "0.64728...
0.7893082
1
22. Find the words which are common between these strings.
function findCommon(string1, string2) { const array1 = string1.split(',') const array2 = string2.split(',') let commonWords = [] array1.forEach(word => { if (array2.includes(word)) commonWords.push(word) }) return commonWords.join(',') }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function commonWord(str1, str2){\n let commonArr = [];\n let arr1 = str1.split(' ');\n let arr2 = str2.split(' ');\n for(let i=0;i<arr1.length;i++){\n for(let j=0;j<arr2.length;j++){\n if(arr1[i] === arr2[j]){\n if(!commonArr.includes(arr1[i])){\n com...
[ "0.75567245", "0.7248219", "0.7028106", "0.69626784", "0.6873602", "0.6869762", "0.6861555", "0.68517244", "0.6753842", "0.6729474", "0.6709277", "0.66832715", "0.6616057", "0.6555006", "0.65413034", "0.64975154", "0.64955217", "0.6483738", "0.64823896", "0.64590335", "0.6444...
0.75819844
0