query
stringlengths
9
34k
document
stringlengths
8
5.39M
negatives
listlengths
19
20
metadata
dict
The folder where Rush's additional config files are stored. This folder is always a subfolder called "config\rush" inside the common folder. (The "common\config" folder is reserved for configuration files used by other tools.) To avoid confusion or mistakes, Rush will report an error if this this folder contains any un...
get commonRushConfigFolder() { return this._commonRushConfigFolder; }
[ "get commonRushConfigFolder() {\n return this._commonRushConfigFolder;\n }", "static _validateCommonRushConfigFolder(commonRushConfigFolder, packageManager) {\n if (!node_core_library_1.FileSystem.exists(commonRushConfigFolder)) {\n console.log(`Creating folder: ${commonRushConfigFolde...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
promise wrapper over mkdirp
static mkdirp(path){ const mkdirp = require('mkdirp') return new Promise((resolve, reject) => { mkdirp(path, (err, made) => { if (err) reject(err) resolve(made) }) }) }
[ "function mkdirp(path) {\n return new Promise((resolve, reject) => {\n mkdirp_callback(path, err => {\n if (err) reject(err);\n resolve();\n });\n });\n}", "function _makeDirectory(path)\n{\n\tvar deferred = q.defer();\n\n\tfs.mkdir(path,function(e){\n\t\tif(!e || (e && e...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function removes the group with the given id from the svg map object and sets the group class to clickable
function resetGroup(id){ map.remove(map.getElementById(id)); map.group(null, id, {class: 'clickable'}); }
[ "function removeFromMap(id) { \n if (dataSetsList[id].data) { \n dataSetsList[id].data.undraw(); \n delete dataSetsList[id].data; \n } \n \n var item = dojo.byId('item' + id); \n item.className = \"\"; \n item.onclick = function () { \n addToMap(id); \n } \n document.locati...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Saves grid contents as CSV to be opened in Excel; called by button in grid (see Java class Gridhelper, method writeNavButtons).
function saveGridAsExcelCsv(gridId, dispType, fullExport) { showProcessingImgIndicator(); if (fullExport) { isFullyExport = fullExport; } else { isFullyExport = false; } var tbl = getSingleObject(gridId); if (tbl.rows.length > 1) { exportColumnsNames = generateEx...
[ "function Export_Grid_TO_CSV(Grid, colsToShow, colsTitles, ReportTitle, showLabels) {\n var cm = colsToShow; // Columnas\n var cols = colsToShow; // datos\n var select = typeof Grid === 'string' ? ('#' + Grid) : Grid;\n var has_splice = false;\n// var records = $('#' + Grid).getGridParam('records'); ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Filter function for the dropdown menu, so that users can search though the list faster
function filterFunction() { var input, filter, a, i; input = document.getElementById("myInput"); filter = input.value.toUpperCase(); div = document.getElementById("dropDownList"); a = div.getElementsByTagName("li"); for (i = 0; i < a.length; i++) { if (a[i].innerHTML.toUpperCase().indexO...
[ "function filterOptions(event) {\n const searchText = event.target.value.toLowerCase();\n \n options.forEach(option => {\n const value = option.textContent.toLowerCase();\n const display = value.indexOf(searchText) === -1 ? 'none' : 'block';\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
enables toggle selection for clicked tr fires Edit click event only if a tr is selected
function selectData() { preEditBtn.style.pointerEvents = "none"; $(tbody).on("click", "tr", function() { $("tr") .not(this) .removeClass("selected"); $(this).toggleClass("selected"); if ($(this).hasClass("selected")) { preEditBtn.style.pointerEvents = "auto"; } else preEditBtn.style.pointe...
[ "function HandleTblRowClicked(tr_clicked) {\n //console.log(\"=== HandleTblRowClicked\");\n //console.log( \"tr_clicked: \", tr_clicked, typeof tr_clicked);\n\n// --- toggle select clicked row\n t_td_selected_toggle(tr_clicked, false); // select_single = false: multiple selected is possible\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the AdapterFactory instance. This is a singleton class that uses the pcbledriverjs AddOn to get devices.
static getInstance(bleDriver) { if (bleDriver === undefined) bleDriver = _bleDriver; if (!this[_singleton]) this[_singleton] = new AdapterFactory(_singleton, bleDriver); return this[_singleton]; }
[ "function AdapterFactory() {\n }", "static create() {\n switch (adapterConfig) {\n case ADAPTER.MS: // MSAdapter\n return new MSAdapter();\n case ADAPTER.MOCK: // MSAdapter\n return new MOCKAdapter();\n default:\n throw new Error(`cannot create ${adapterConfig} adapter,...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Draws the tiles to the screen
function drawTiles() { for(var y = 0; y < BOARD_HEIGHT; y++) { for(var x = 0; x < BOARD_WIDTH; x++) { let drawX = x * TILE_WIDTH; let drawY = y * TILE_HEIGHT; //Draw the tiles, but not the ones off the screen if(drawX + TILE_WIDTH > -camera.xOffset && drawX < -camera.xOffset + width) ...
[ "draw() {\n for (let i = 0; i < this.height; i++) {\n for (let j = 0; j < this.width; j++) {\n this.tiles[i][j].draw();\n }\n }\n }", "function draw() {\n for (let i=0; i<tiles.length; i++) {\n tiles[i].display();\n }\n}", "draw () {\n this.ctx.clear...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Shorthand callback for pushing to the allIds array
function cb(id) { if (allIds.indexOf(id) === -1) allIds.push(id); }
[ "function makeIdArray() {\n for (let i=0; i<funsListed.length; i++) {\n idList.push(funsListed[i].id);\n }\n return idList;\n }", "function add_to_batch_dispatch(id) \n{ \n in_batch.push(id);\n}", "function populateAllIds(consumer, checkoutProps) {\n if (!checkoutProps.all) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Make markers bounce when clicked!
function toggleBounce(marker) { //Create function to animate markers when clicked marker.setAnimation(google.maps.Animation.BOUNCE); setTimeout(function() { marker.setAnimation(google.maps.Animation.null); }, 500); ...
[ "function functionBounce() {\r\n marker.addListener(\"click\", function () {\r\n self.toggleBounce(this);\r\n });\r\n }", "function toggleBounceMarkerClick(){\n\t\tif (this.getAnimation() === 1){\n\t\t\tthis.setAnimation(null);\n\t\t} else {\n\t\t\tthis....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adding a method to add a movie
add(movie) { this.push(movie); }
[ "movie() { return this.add(new Movie(...arguments)) }", "function addMovieToTheProgram() {\n \n}", "function addMovie(newMovie) {\n movies.push(newMovie);\n}", "function addNewMovie(newMovie){\n\t\tmovies.push(newMovie);\n\t}", "function addMovie (movie) {\n allMovies.push(movie);\n console.log(\"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Displays the 'Save Cover' button
function displaySaveCoverButton() { saveCoverButton.classList.remove('hidden'); }
[ "function saveButton(){\n\tdocument.getElementById('ocShadow').style.backgroundImage = \"url('')\";\n\t\n\thtml2canvas($(\"#ocPic\"), {\n\t\tonrendered: function(canvas) {\n\t\t\tvar dataUri = canvas.toDataURL(\"img/png\");\n\t\t\tvar blob = dataURItoBlob(dataUri);\n\t\t\tvar blobUri = URL.createObjectURL(blob);\n\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
returns true if the call is an inbound call and a final sip response has been sent
get isInboundCallAnswered() { return this.direction === CallDirection.Inbound && this.res.finalResponseSent; }
[ "get isOutboundCallRinging() {\n return this.direction === CallDirection.Outbound && this.req && !this.dlg;\n }", "canDial(call) {\n\t\treturn (call && (this.isTerminalState(call) ||\n\t\t\tcall.callStatus === \"\")) ? true : false\n\t}", "function isincall () // boolean\n{\n if (typeof (webphone_api.plh...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
cluster of all the documents filtered by 'Administrator' role
getAllDocumentsByRoleAdministrator(req, res) { const { page, limit } = req.params; return Document.find({}) .populate('ownerId') .skip((page - 1) * limit) .limit(limit) .sort([['dateCreated', 'descending']]) .then((documents) => { const filtered = documents.filter( ...
[ "listDocsByRole(req, res) {\n const roleUser = req.decoded;\n\n Document.findAndCountAll({\n where: {\n access: 'role',\n userRole: roleUser.title,\n },\n limit: req.query.limit,\n offset: req.query.offset,\n order: [['id', 'ASC']],\n })\n .then((document) => {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Method to randomly place enemy ships in the enemy matrix.
placeEnemyShips ( shipList ) { // local variables let randomRow = 0; let randomCol = 0; let isHorizontal = true; let randomOrientation = 0 ; // Loop the enemy ship list and try to place enemies in the positions. for (let index = 0; index < shipList.length; ...
[ "function getLocation(enemy) {\n var TileLocation = Math.floor(Math.random() * gameTiles.length);\n\n enemy.location.x = gameTiles[TileLocation].x + config.TILE_WIDTH * 0.5;\n enemy.location.y = gameTiles[TileLocation].y + config.TILE_HEIGHT * 0.5;\n gameTiles.splice(TileLocation, 1);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
For each healer in the initial group, a separate index list is created so their FKEYS are accurate
createHealerIndexes() { console.log('Adding Healer Indexes'); for (let index = 0; index < this._group.length; index++) { if(classes.channelClasses.healer.includes(classes.classList[this._group[index].class].toLowerCase())) { console.log('Constructing Index for', this._group[index].first_name); ...
[ "rebuildKeyIndex() {\n gKeyIndex = [];\n gSubkeyIndex = [];\n\n for (let i in gKeyListObj.keyList) {\n let k = gKeyListObj.keyList[i];\n gKeyIndex[k.keyId] = k;\n gKeyIndex[k.fpr] = k;\n gKeyIndex[k.keyId.substr(-8, 8)] = k;\n\n // add subkeys\n for (let j in k.subKeys) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
gets an element from associative array, or goes to default
function get(arr, elt, def) { if (elt in arr) return arr[elt]; else return def; }
[ "function get(ary, i, defaultVal) {\n return i >= 0 && i < ary.length ? ary[i] : defaultVal;\n}", "function lGet(arr, selector, defaultValue){\n\n}", "function get(obj, key, defaultVal){\n var result = obj[key];\n return (typeof result!==\"undefined\")? result : defaultVal;\n}", "function returnSingleD...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
SessionStorage mapIndicateur Transformation stringMap to object
function strMapToObj(strMap){ let obj = Object.create(null); for(let [k,v] of strMap){ obj[k]=v; }; return obj; }
[ "function strMapToObj(strMap) {\n let obj = Object.create(null);\n for (let [k,v] of strMap) {\n obj[k] = v;\n }\n return obj;\n}", "_putInMemoryMap(cacheKey,value){const keyString=serialize(cacheKey);this.privateMap.set(keyString,value);}", "function parseFromSessionStorage(key) {\n return ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add a value to the last row containing a value in a spreadsheet
function ammendLastRow(column, sheet, value){ var myRange = sheet.getRange(sheet.getLastRow(), column); myRange.setValue(value); }
[ "function addLastRow(column, sheet, value){\n var myRange = sheet.getRange(sheet.getLastRow() + 1, column);\n myRange.setValue(value);\n}", "function addLastRowColumn(sheet, value){\n var myRange = sheet.getRange(sheet.getLastRow() + 1, sheet.getLastColumn() + 1);\n myRange.setValue(value);\n}", "function g...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Starts the star rating for individual book rating page.
function setUpStars() { if ($('.single-book-title')) { $(function(){ // Start when document ready $('#star-rating').rating(); // Call the rating plugin }); } }
[ "function setStar(i, rating){\r\n rating = rating/2;\r\n if( rating == null)\r\n rating = 0;\r\n\r\n $(function () {\r\n \r\n $(\"#star\" + i).rateYo({\r\n rating: rating,\r\n readOnly: true,\r\n starWidth: \"20px\"\r\n });\r\n });\r\n\r\n\r\n\r\n }", "functio...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
selectMultiple Select all/no checkboxes in html form
function selectMultiple(noneOrAll, fieldName, fieldValue) { let forms = document.getElementsByTagName('form'); if (!forms || !forms.length) { return; } let elements = forms[0].elements; Array.from(elements).forEach(element => { if (fieldName && fieldValue && element.getAttribute && (!element.get...
[ "function multi_select_all(){\n\tvar samples = this.samples;\n\tvar projects = this.projects;\n\t$('.multi_select').each(function() {\n\t\tif ($.inArray($(this).attr('samplesid'), samples) > -1){\n\t\t\t$(this).prop('checked', true);\n\t\t} else if ($.inArray($(this).attr('projectsid'), projects) > -1){\n\t\t\t$(th...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Register a Model class with this database
async register (Model) { // Ensure Model is Model class assert.instanceOf (Model.prototype, DbModel, "Model must be a DbModel extension"); // Set internal DB class for the Model to be previously constructed internal DB API class Model.__db = this._dbApi; // Tell dbg to prepare for new collection ...
[ "_registerModel(M) {\n // Assert the provided class is a model.\n if (!(M.prototype instanceof Model)) throw new SchemaError(\n `Registered model doesn't inherit for Model`\n );\n\n // Check for schema template and collection name.\n if (!M.collection || !M.schema) {\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Given a period which has a start date and days, the end date is given back
function getEndDate(period) { const date = new Date(period.startingDay); date.setDate(date.getDate() + period.duration); return date; }
[ "function getDays(period, start, end) {\n\treturn\n}", "function periods(start_date, end_date, period, interval) {\n let a = moment.utc(start_date);\n let b = moment.utc(end_date).add(1, \"days\");\n let result = [...Array(b.diff(a, period) + 1).keys()];\n return result.map(i => a.clone().add(interval * (i - ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Support for stale data handling policy. Check to see if we have stale input data and if we do, set the output flag and send output if downstream nodes do not yet know this data is stale.
function handleStaleData(vni, lastInputState, newInputState, outputPort) { // Were we last in a stale state? var lastInputStateLm; var wasStale = false; if (!_.isUndefined(lastInputState)) { wasStale = lastInputState.error || lastInputState.stale; lastInputStateLm = lastInputState.lm; ...
[ "function handleStaleOutput(vni, outputPort, lastInputStateLm) {\n var outputState = vni.outputState();\n outputState.stale = true;\n vni.outputState(outputState);\n handleOutput(outputPort, lastInputStateLm, vni.outputState());\n}", "function inputSetDirty (input) {\n if (inputUnchanged === input.st...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
updates the activeNumber value on screen
function updateScreen() { document.getElementById('screen').innerHTML = activeNumber; }
[ "function updateScreen() {\n $('#screen').html(activeNumber);\n}", "function showActiveUserNumber(number) {\n $(\"#status\").text(number);\n}", "function updateNum() {\n nLectura.textContent = Number(nSlider.value);\n n = nSlider.value;\n}", "function updateCurrNum(value) {\n\t\tif (currNum.init) ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function helps to delete the beginning prompt.
function deletePrompt() { document.getElementById("prompt").innerHTML = ""; }
[ "function resetPrompt() {\n printToCommandLine(prompt + ' ');\n }", "function clear() {\n commandLine.value = '';\n phantomUserInput.innerHTML = '';\n }", "function deleteCharAtPos(){\n if (promptText != ''){\n promptText =\n promptText.sub...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method deletes a message from a channel. When used with a typical user token, may only delete messages posted by that user. When used with an admin user's user token, may delete most messages posted in a workspace. When used with a bot user's token, may delete only messages posted by that bot user. More info here ...
deleteMessage ( channel, //Channel containing the message to be deleted. REQUIRED ts, //Timestamp of the message to be deleted. REQUIRED as_user //Pass true to delete the message as the authed ...
[ "function delete_message(message) {\n admin_bot._api('chat.delete', {\n \"token\": admin_settings.token,\n \"ts\": message.ts,\n \"channel\": message.channel,\n \"as_user\": true\n }).then(function(e) {\n console.log(e);\n });\n}", "function deleteCommandMessage(serverD...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
filter data on UniNameFilter and UOAFilter
function filteredData(ds){ return ds.filter(function(entry){ return (UniNameFilter === null || UniNameFilter === String(entry["VIEW_NAME"])) && (UOAFilter === null || UOAFilter === String(entry["Unit of assessment name"])); // keep if no year filter or year filter set to year being read, }) }
[ "filterBy() {\n let {\n generalData,\n nameFiltered\n } = this.state;\n let data = generalData;\n data = data.filter(x => String(x.name.toUpperCase()).includes(nameFiltered.toUpperCase()));\n this.setState({ourData: data})\n }", "function filterStatU(){\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The status is hardcoded so it always returns 'generating_summary' for a holding response this.status isn't guaranteed to be the current status as it may have changed since the bill run was originally read from the db
get holdingResponse () { return { id: this.id, billRunNumber: this.bill_run_number, region: this.region, status: 'generating_summary', approvedForBilling: this.approved_for_billing, preSroc: this.pre_sroc } }
[ "generateProcessingStatus(){\n if(this.payload.totalDue == '0.00'){\n this.payload.processingStatus = \"complete\";\n }\n }", "status() {\n if (!this.#isFinishedRolling()) {\n return 'OPEN'\n }\n if (this.#needsBonus()) {\n return 'BONUS_NEEDED'\n }\n return 'DONE'\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Search for duplicate CRC32
function duplicate_crc(crc) { print("Searching for duplicate file (via CRC-32)"); var file=new File(attachment_dir + "crc32.lst"); if(!file.open("r")) return(null); var duplicate=false; var str; while(!file.eof && !duplicate) { str=file.readln(); if(str==null) break; if(parseInt(str,16)==crc) dupli...
[ "function crc(buf){return(updateCrc(-1,buf,buf.length)^-1)>>>0;// u32\n}", "function updateCrc(crc,buf,len){for(let n=0;n<len;n++){crc=crc>>>8^crcTable[(crc^buf[n])&255]}return crc}", "function lockCrc(inputStr){\n\n\t\tres = 0xff;\n\t\tinputHex = new Buffer(inputStr,'hex');\n\n\t\t//start from the second byte ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
accounts for IE and else / get stylesheet reference (href) given its filename (in fact the ending portion string of the filename) returns null if not found
function getStyleSheetByHref(fileName) { function endsWith(str, suffix) {return str.indexOf(suffix, str.length - suffix.length);} for (var i = 0; i < document.styleSheets.length; i++) { var sheet = document.styleSheets[i]; if (sheet.href && endsWith(sheet.href, fileName)) return sheet; } ret...
[ "function findStylesheet(url, name) {\n\t\t\tvar match = getStylesheet(url, true);\n\t\t\tif (name && match.length === 0) {\n\t\t\t\tmatch = getStylesheet(name, true);\n\t\t\t}\n\n\t\t\treturn match.length > 0 ? match[0] : false;\n\t\t}", "function xGetStyleSheetFromLink(cl) { return cl.styleSheet ? cl.styleSheet...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
End : 23 Jan 2018 Task : Add text next to Show Detailed View button 106 Page : Global Material page File Location : $BASE_PATH$/image/javascript/jsezrx.js Layout : Mobile
function mobile_materialpage() { /* End : 6 Mei 2017 Task : Hide testing fields from the layout Page : Material page / product page File Location : $BASE_PATH$/image/javascript/js-ezrx.js Layout : Mobile */ console.log('mobi...
[ "function mainpage_elementsExtraJS() {\n // screen (mainpage) extra code\n\n }", "function startScreen_elementsExtraJS() {\n // screen (startScreen) extra code\n\n }", "function startScreen_elementsExtraJS() {\n // screen (startScreen) extra code\n }", "function Products_Entertai...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Clear the rankings sheet, This can be used for testing and clearing errors.
function clearJudging() { var spreadsheet = SpreadsheetApp.getActiveSpreadsheet(); var rankingSheet = spreadsheet.getSheetByName('Rankings'); rankingSheet.getRange(5,6,56,6).clearContent(); rankingSheet.getRange(5,13,56,7).clearContent(); rankingSheet.getRange(5,21,56,7).clearContent(); rankingSheet.getRang...
[ "function clearSortedRankings() {\n var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();\n var middleSheet = spreadsheet.getSheetByName('MiddleRanking');\n var hsSheet = spreadsheet.getSheetByName('HSRanking');\n\n middleSheet.deleteRows(2, 100);\n hsSheet.deleteRows(2, 100);\n}", "function clearRanking(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the before spacing for selected paragraphs.
set beforeSpacing(value) { if (value === this.beforeSpacingIn) { return; } this.beforeSpacingIn = value; this.notifyPropertyChanged('beforeSpacing'); }
[ "moveToParagraphStart() {\n if (this.isForward) {\n this.start.paragraphStartInternal(this, false);\n this.end.setPositionInternal(this.start);\n this.upDownSelectionLength = this.end.location.x;\n }\n else {\n this.end.paragraphStartInternal(this, fa...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function : CompoundGlypg generator / comment : It stores raw, xMin, yMin, xMax, yMax, glyph id, and glyph offset for the corresponding compound glyph.
function CompoundGlyph(raw, xMin, yMin, xMax, yMax) { var data, flags; this.raw = raw; this.xMin = xMin; this.yMin = yMin; this.xMax = xMax; this.yMax = yMax; this.compound = true; this.glyphIDs = []; this.glyphOffsets = []; data = this.raw; while (true) { flags = data....
[ "function CompoundGlyph(raw, xMin, yMin, xMax, yMax) {\n var data, flags;\n this.raw = raw;\n this.xMin = xMin;\n this.yMin = yMin;\n this.xMax = xMax;\n this.yMax = yMax;\n this.compound = true;\n this.glyphIDs = [];\n this.glyphOffsets = [];\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Distributor Lista todos os destribuidores
async list(request, response) { try { const distributors = await distributorsModel.getDistributors() return response.status(200).json(distributors) } catch (error) { return response.status(error.status || 500).json(error.message) } }
[ "listDistributors() {\n const keys = Object.keys(distributors);\n if (keys.length === 0) {\n console.log(\"Sorry, there are no distributors in the system yet.\");\n return 0;\n } else {\n console.log(\"List:\");\n for (let i = 0; i < keys.length; i++) {\n console.log(chalk.green(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Transfer css files from node_modules to dist
function vendorcss() { return src(['./node_modules/font-awesome/css/font-awesome.min.css', './node_modules/bootstrap/dist/css/bootstrap.min.css']) .pipe(rename('vendor.min.css')) .pipe(dest(destination + 'css')); }
[ "function copyDist() {\n return src(paths.dist + \"css/style.css\")\n .pipe(dest(paths.targetCss));\n}", "function copyCSS() {\n log(chalk.red.bold(\"---------------COPY CSS FILES INTO DIST---------------\"));\n return src([\"src/assets/css/*\"])\n .pipe(dest(\"dist/assets/css\"))\n .pipe(browse...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
count the differences between requiredFunctions and functions sets
function matchAndRateFunctions(requiredFunctions, functions) { var differences = 0; if (functions.length == 0) { return FUNCTIONS.ALL.length + 1; } for (var i in requiredFunctions) { if (!functions.find(function (element) { return element.toLowerCase() === requiredFunctions[i].toLowerCase(); })) { diff...
[ "function findNumberOfFunctions(numberOfUnits)\n{\n var num = 0;\n for(var i = numberOfUnits; i > 0; i--)\n {\n\t numberOfUnits--;\n num += numberOfUnits\n }\t \n return num;\n}", "getNumberOfOrderDependencies() {\n let count = 0;\n this.mapPairs.forEach(mapPair => {\n mapPair.afterMa...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Method: createNavigationLinkHTML Creates an HTMLformatted string containing a hyperlink used for navigation within the intranet. The link click event will be handled by the i3 framework, which will navigate to the given path. The path should be the virtual part of the i3 path (i.e. the part following the hash mark). Pa...
@method createNavigationLinkHTML(contents, path) { if (typeof contents != "string") { // Retrieve the HTML for the element. var tempDiv = I3.ui.create("div"); tempDiv.appendChild(contents); contents = tempDiv.innerHTML; } var eventParams = I3.browser.isIE() ? "" : "event"; return...
[ "function createHyperlink (textLink, textString) {\n let hyperlink = document.createElement(\"a\");\n hyperlink.className = \"nav-link\";\n hyperlink.innerText = textString;\n hyperlink.href = textLink;\n return hyperlink;\n}", "function makeContentsMenu() {\n function makeTree(data, classNa...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get all regex pattern matches in target text value.
function getAllMatches(text, pattern) { var match = null; var out = []; if (typeof pattern == "string") { pattern = new RegExp(pattern); } if (pattern.global) { while (match = pattern.exec(text)) { out.push(match); } } ...
[ "function getAllMatches(regex, bodyText) {\n\n var match;\n var result = [];\n\n while ((match = regex.exec(bodyText)) !== null) {\n result = result.concat(match);\n }\n\n if (result.length != 0) {\n return result;\n }\n else {\n retu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
console.log(demo); console.log(sampleIDs); create a function to find the id that has been selected
function ID(sample){ return sample.id == sampleID;}
[ "function dataFilteredsamplesID(samples) {\n return samples.id == dropDown\n }", "function randomlySelectQuestionId( ids ) {\n\t//console.log('the ids in randomlySelectQuestionId' );\n\t\t//console.log(ids);\n\t//console.log('the ids in randomlySelectQuestionId' );\n\t\n var randomIndex = _.random( 0...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check if the specified node is leaf. nodeEl: DOM object, indicate the node to be checked.
function isLeaf(target, nodeEl) { var node = $(nodeEl); var hit = node.children('span.tree-hit'); return hit.length == 0; }
[ "function isLeaf(target, nodeEl){\r\n\t\treturn $(nodeEl).children('span.tree-hit').length == 0;\r\n\t}", "function isLeaf(target, nodeEl){\n\t\tvar node = $(nodeEl);\n\t\tvar hit = node.children('span.tree-hit');\n\t\treturn hit.length == 0;\n\t}", "function isLeafNode(node) {\n return !node.childNodes.filter...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
GILDING UPDATE THE PREVIEW GILDING COLOR WHEN GILDING DROPDOWN CHANGED
function gilding_color() { var $gilding = $("select#gilding_color").val(); $("#album_preview").removeClass("gilding_color_black gilding_color_silver gilding_color_copper -color-"); $("#album_preview").addClass($gilding); }
[ "function updateSelectedOrb() {\n selectedOrb = $(orbBox).children(\".selected\");\n selectedOrb[0].removeAttribute(\"style\");\n selectedOrb[0].style.backgroundColor = options.orbSelectColor;\n }", "function handleStatusDropdownEvent() {\n paintStatusPalette();\n}", "fu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Funcion que elimina los integrantes de la ejecucion pasada del ejercicio
function eliminarIntegrantesAnteriores() { const $integrantes = document.querySelectorAll('.integrantes'); for (let m = 0; m < $integrantes.length; m++ ) { $integrantes[m].remove(); } }
[ "function elimOpc4()\n{\n opcBorr = document.getElementById(\"opc\" + numOpc4 + \"4\");\n opcBorr.remove();\n if(numOpc4 == 3)\n {\n botBorr4 = document.getElementById(\"botRmv4\");\n botBorr4.remove();\n }\n numOpc4 = numOpc4 - 1;\n}", "function EliminarFilaPrescripcion(fila){\n\n $('#fila'+fila).re...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
update seek bar as music plays
function updateSeekBar() { if(!mouseDown) { seekbar.value = audio.currentTime; currentTime.innerHTML = toMinSec(audio.currentTime); } }
[ "function updateSeek() {\n let currentPos = (audio.currentTime / audio.duration) * 100;\n sliders[0].value = currentPos;\n}", "function changeProgressBar() {\n song.currentTime = progressBar.value;\n}", "function ChangeTheTime() {\n audio.currentTime = seekbar.value;\n}", "function seekBarUpdate(audio...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Search Class by Name end Select Member to assign the task
function fnselectMember(){ astrMemberName=fngetElementsByClass('btn_assign_unassign',document,'div'); fnteamStatus(); }
[ "function searchTask(e) {\n\tconst text = e.target.value.toLowerCase();\n\tdocument.querySelectorAll(\".taskEach\").forEach(function (task) {\n\t const item = task.firstChild.textContent;\n\t if (item.toLowerCase().indexOf(text) != -1) {\n\t\t task.style.display = \"block\";\n }\n else {\n\t\t task.style....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
decrease the frequency input
decreaseFreq() { let newFreq = 0; if (this.state.freq > 250) { newFreq = this.state.freq - this.state.freq / 2; } else { newFreq = 250; } this.setState({freq : newFreq}); }
[ "function changeFreq(_osc, _freq){\n _osc.freq(_freq);\n}", "function changeFrequency() {\n if (speed != 0) {\n if (speed < 0 && currentFreq > firstFreq)\n currentFreq = currentFreq / Math.pow(2, 1 / (semitonesPerOctave * semitoneSubdivisions));\n else if (speed > 0 && currentFreq < lastFreq)\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get the total number of dataplanes present
getDataplaneTotalCount ({ commit }) { const getItems = async () => { const entities = await api.getAllDataplanes() const count = entities.items.length commit('SET_TOTAL_DATAPLANE_COUNT', count) } getItems() }
[ "_laneCount() {\n const { lanes, horizontal } = this.props;\n const config = lanes[horizontal ? \"horizontal\" : \"vertical\"];\n const prop = horizontal ? \"offsetHeight\" : \"offsetWidth\";\n const containerWidth = this.domrefs.container.current[prop];\n\n const mqs = compact(\n map(config, (l...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Special Function drawNumberDouble Reads from a JSON array and finds the specific x and y coordinates on a sprite sheet. This particular function displays the Tens place of the number then displays the Ones Arguments: tens = tens place of a number num = ones place of a number
function drawNumberDouble(ten, num){ ctx_count.drawImage(numbers_img, spritesheet.frames[ten].frame.x, spritesheet.frames[ten].frame.y, spritesheet.frames[ten].frame.w, spritesheet.frames[ten].frame.h, 30, 0, spritesheet.frames[ten].sourceSize.w, spritesheet.frames[ten].sourceSize.h); ctx_count.drawImage(...
[ "function drawNumber(i){\n ctx_count.drawImage(numbers_img, spritesheet.frames[i].frame.x,\n spritesheet.frames[i].frame.y,\n spritesheet.frames[i].frame.w,\n spritesheet.frames[i].frame.h, 55, 0,\n spritesheet.frames[i].sourceSize.w,\n spritesheet.frames[i].sourceSize.h);\n}", "function draw_numb...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
While setting the LineItem's targeting data when LineItem's consolidated data gets loaded, this function dynamically display rows of the targeting to the lineItem TargetingTable
function displayTargetsOfLineItem(item){ var valueToPrint = ""; var rowCount = $('#geoTargetsummary tr').length; var rowId= "geoTargetsummary" + rowCount; var level = "--" ; var not = "--"; var operation = "<select id='targetAction_" + rowId + "'><option value='and'>And</option> <option value='or'>Or</opti...
[ "function addTargetsToLineItem(){\r\n\tif (validateAddTargets()) {\r\n\t\tvar valueToPrint = \"\";\r\n\t\tvar selectedElements = [];\r\n\t\tvar level = \"--\";\r\n\t\tvar not= \"--\";\r\n\t\tvar operation = \"--\";\r\n\t\tvar previousRowId = $(\"#geoTargetsummary\" , \"#lineItemTargeting\").find(\"tr:last\").attr(\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the URL of the page referenced by a .notification record given any element inside it. Returns null if not found.
function getNotificationUrl(context) { return $(context).closest('.notification').find('.page_link').attr('href'); }
[ "static async getNotificationUrlToOpen(notification) {\n // Defaults to the URL the service worker was registered\n // TODO: This should be fixed for HTTP sites\n let launchUrl = self.registration.scope;\n // Use the user-provided default URL if one exists\n const { defaultNotific...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Fire a callback whenever an element becomes visible in the viewport
function whenVisible(elem, callback) { elem.__visCheck = debounce(function visCheck() { callIfVisible(elem, callback); }, 100); window.addEventListener('resize', elem.__visCheck, false); window.addEventListener('scroll', elem.__visCheck, false); elem.__visCheck(); ...
[ "function addOnVisibleListener(elementId, callbackFunction) {\n $(elementId).bind('inview', function(event, visible) {\n if(visible == true) {\n callbackFunction();\n }\n });\n}", "function addOnShownOnceListener(elementId, callbackFunction) {\n $(elementId).one('inview', function()...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
(6) baixa em API o SCCD (gravar "Data" e "Destino")
function baixaSCCD(par_id,par_destino,par_filial_app,element) { params ={ id: par_id, destino: par_destino, filial_app: par_filial_app } loadAPI('POST','',api_baixa_sccd,params).then((ret)=>{ sendLog('AVISO',`(009) Registro de Baixa SCCD na API: ID:(${par_id}) >> (${JSON.stri...
[ "getDestinos () {\n return apiClient.get('/destino/all')\n }", "function etapaPesquisaServidor(){\n //..\n }", "async function chegada_filial_destino() {\n let retInitChegada = await initChegada()\n logEventos(cfg,'(BD - CHEGADA NA CIDADE OU FILIAL DE DESTINO) - retInitChegada:',retInitCheg...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Determine whether the given properties match those of a `AlarmRuleProperty`
function CfnAlarmModel_AlarmRulePropertyValidator(properties) { if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } const errors = new cdk.ValidationResults(); if (typeof properties !== 'object') { errors.collect(new cdk.ValidationResult('Expected an object, but received:...
[ "function CfnApplication_AlarmPropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected an object, but r...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Private function for accessing data from array and write in xml file.
function writeXMLFile(xmlFile, inputArray, writeXMLCallback) { try { var rootElement = builder.create("Students"); for(x in inputArray) { var student = rootElement.ele('Student', {'id': inputArray[x].id}); student.ele('name', inputArray[x].fName +" "+ inputArray[x].lName)...
[ "function writeXMLFile(xmlFile, inputArray, writeXMLCallback)\r\n {\r\n var rootElement = builder.create(\"Students\");\r\n for(x in inputArray) {\r\n var student = rootElement.ele('Student',{'id': inputArray[x].id});\r\n student.ele('name', inputArray[x].fName +\" \"+ inputAr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Begins the intervals that prune caches.
startSweepIntervals() { this.sweepCachesInterval = setInterval( this.sweepCaches, 60 * MINUTE_IN_MILLISECONDS, ); this.sweepOldUpdatesInterval = setInterval( this.sweepOldUpdates, PARACORD_SWEEP_INTERVAL, ); }
[ "function startCollectingGarbage() {\n if(config.app.caching_enabled && config.app.gc_timeout) {\n // Set up garbage collection\n $interval(function() {\n cache.gc();\n }, config.app.gc_timeout * 1000);\n }...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Combines to and bcc addresses for sending.
getToAddresses() { let addresses = [this.formConfig.to]; if (this.formConfig.bcc) { addresses.push(this.formConfig.bcc); } return addresses; }
[ "addAddress(id, address) {\n if (address.length > 0) {\n if (id === \"to\") {\n const to2 = [...this.state.to2];\n to2.push(address);\n const to = to2.join(\",\");\n this.setState({ to2, to, attendeeUpdated: true });\n // this.props.setMailContacts(to);\n }\n }\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Normalize a transition hook's argument length. The hook may be: a merged hook (invoker) with the original in .fns a wrapped component method (check ._length) a plain function (.length)
function getHookArgumentsLength(fn){if(isUndef(fn)){return false;}var invokerFns=fn.fns;if(isDef(invokerFns)){// invoker return getHookArgumentsLength(Array.isArray(invokerFns)?invokerFns[0]:invokerFns);}else{return(fn._length||fn.length)>1;}}
[ "function getHookArgumentsLength(fn){\nif(isUndef(fn)){\nreturn false;\n}\nvar invokerFns=fn.fns;\nif(isDef(invokerFns)){\n// invoker\nreturn getHookArgumentsLength(\nArray.isArray(invokerFns)?\ninvokerFns[0]:\ninvokerFns);\n\n}else {\nreturn (fn._length||fn.length)>1;\n}\n}", "function getHookArgumentsLength (fn...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
accepts arguments of data for button pushed/played and it's variable, and passes this data to functions for tone and color change
function fire(x, y) { // sound(buttons[y]); //tone based on object data color(x, buttons[y]); //temporary color change based on object data and target button variable }
[ "function sound(pressed) {\n if (pressed == \"btn-green\") {\n let beep1 = new Audio(\"assets/sounds/beep1.mp3\");\n beep1.play();\n } else if (pressed == \"btn-blue\") {\n let beep2 = new Audio(\"assets/sounds/beep2.mp3\");\n beep2.play();\n } else if (pressed == \"btn-purple\") {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Change the highlighted date.
function changeHighlightedDate($picker, newYear, newMonth, newDay) { /** All letiables are optional. If not provided, default to the current value. */ if (typeof newYear === "undefined" || newYear === null) { newYear = $picker.get("highlight").year; } if (typeof newMonth === "undefined" || newMon...
[ "function changeHighlightedDate($picker, newYear, newMonth, newDay) {\n\n /** All variables are optional. If not provided, default to the current value. */\n if (newYear == null) {\n newYear = $picker.get('highlight').year;\n }\n if (newMonth == null) {\n newMonth = $picker.get('highlight').mo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function that gets the yes list from Firebase
function getYesList() { var userId = firebase.auth().currentUser.uid; var rootRef = firebase.database().ref(); var userRef = rootRef.child('users'); var currYesListRef = userRef.child(userId); currYesListRef.on('value', function(snapshot) { // Stores yes list from Firebase var yesLi...
[ "function getNoList() {\n var userId = firebase.auth().currentUser.uid;\n var rootRef = firebase.database().ref();\n var userRef = rootRef.child('users');\n var currNoListRef = userRef.child(userId);\n \n currNoListRef.on('value', function(snapshot) {\n // Stores no list from Firebase\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
_ESAbstract.IteratorValue / global Type, Get 7.4.4 IteratorValue ( iterResult )
function IteratorValue(iterResult) { // eslint-disable-line no-unused-vars // Assert: Type(iterResult) is Object. if (Type(iterResult) !== 'object') { throw new Error(Object.prototype.toString.call(iterResult) + 'is not an Object.'); } // Return ? Get(iterResult, "value"). return Get(iterResult, "value"); ...
[ "function IteratorValue(iterResult) {\n console.assert(Type(iterResult) === 'object');\n return iterResult.value;\n }", "function IteratorValue(iterResult) {\n assert(Type(iterResult) === 'object');\n return iterResult.value;\n }", "function IteratorValue(iterResult) { // eslint-disable-line no-un...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
CameraPositionState starts at 1 (when project is loaded for the first time) every time the button is clicked, it changes the state of the camera, changing the position
function changeCameraPosition() { if (CameraPositionState == "1") { camera.position.set(0, 3, 0); camera.lookAt(10, 3, 0); CameraPositionState = "2"; } else if (CameraPositionState == "2") { camera.position.set(30, 20...
[ "updateCamera() {\n //this.camera = this.cameras[this.selectView];\n //this.interface.setActiveCamera(this.camera);\n this.gameOrchestrator.cameraAnimationTime = null;\n this.gameOrchestrator.changeCamera(this.cameras[this.selectView]);\n this.gameOrchestrator.state = this.gameOrc...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
! Function: trigger_pass Params: settings (required) e (required) This function gets called when an element passes validation
function trigger_pass(settings, e) { $(e).removeClass(settings.class).parents().find('label[for='+$(e).attr('id')+']').removeClass(settings.class); }
[ "function isValidCheckoutForm($elements){\n $elements[0].on('click',function(){\n $elements[1].trigger('change');\n $elements[2].trigger('change');\n setTimeout(function(){\n if(!$elements[1].parent().hasClass('error') && !$elements[2].parent().parent().hasClass('error'))\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This functions puts the correct data in the dictionary producersId
function putInProducersIds(id, data) { var waitMessage = document.getElementById("waitTest"); if (waitMessage != undefined || waitMessage != null) { waitMessage.remove(); } producersIds[id] = { data: getDataChart(data) } }
[ "encode_initial_producers(){\n this.json.initial_producers = this.json.initial_producers.map( producer => {\n console.log(producer)\n producer.owner_name = generate_account_name( producer.owner_name.replace(/\"/g, ''), producer.index )\n delete producer.index\n return producer\n })...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Reads a directory and emits a 'process' event for each file therein
watch() { fs.readdir(this.watchDir, (err, files) => { if (err) throw err; for (let index in files) { this.emit('process', files[index]); } }); }
[ "function processDirectory() {\n\tfs.readdir(pathToProcess, function(err, files) {\n\t\titeratateFileNHandleFile(err, files);\n\t});\n}", "watch() {\n fs.readdir(this.watchDir, (err, files) => {\n if (err) throw err;\n for (var index in files) {\n this.emit(\"process\", files[index]);\n }...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Converts the user defined shapelist to SAT usable coordinates
function convert_shape_list(shapeList, boundingBox) { var converted_shape_list = []; var converted_shape; for (shape of shapeList) { converted_shape = convert_shape(shape) converted_shape_list.push(converted_shape); } return converted_shape_list }
[ "function xform_shape(xf, shape) {\n\t // de-alias new lines and polies\n\t return [xform_points(xf, shape[0]), dup(shape[1]), dup(shape[2])]\n\t}", "function xform_shape(xf, shape) {\n // de-alias new lines and polies\n return [xform_points(xf, shape[0]), dup(shape[1]), dup(shape[2])]\n}", "function getPol...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
elements const TitleOfBillsPage = 'Bills' actions/functions
function CheckTitleOfBills(cy, TitleOfBillsPage) { cy.get('#app > div > h2 > div').contains(TitleOfBillsPage) }
[ "function makeBillTitle() {\n return \"Your Bill\";\n}", "function getTitleOfBill(callback) {\n var billsWithTitle = [];\n var path = \"bills/?session=42-1&limit=500\";\n makeRequest(path, function(err, bills){\n if(err){\n callback(err);\n }\n else {\n bills = bills.objects;\n bills.f...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Lee el local storage para conocer el mood actual
function currentMood( ){ try{ //Si mood = False está en diurno. //Si mood = True está en nocturno. mood = leerLocalStorage('mood') || false; guardarLocalStorage('mood', mood); } catch (error){ console.log(error) } if(mood){ linkMood.innerHTML = "<span>Modo Diurno</span...
[ "async storeMoodRating() {\n\t\ttry {\n\t\t\tawait AsyncStorage.setItem('mood', JSON.stringify(this.state.rating));\n\t\t\tconsole.log('Mood set in storage.');\n\t\t} catch (err) {\n\t\t\tconsole.log(err);\n\t\t}\n\t}", "readStorage() {\n const storage = JSON.parse(localStorage.getItem('likes'));\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
; public static const WIDGET_HEADER_HIGHLIGHTED:ToolbarSkin =
function WIDGET_HEADER_HIGHLIGHTED$static_(){ToolbarSkin.WIDGET_HEADER_HIGHLIGHTED=( new ToolbarSkin("widget-header-highlighted"));}
[ "function WIDGET_HEADER$static_(){ToolbarSkin.WIDGET_HEADER=( new ToolbarSkin(\"widget-header\"));}", "function HEADER$static_(){ToolbarSkin.HEADER=( new ToolbarSkin(\"header\"));}", "function WINDOW_HEADER$static_(){ToolbarSkin.WINDOW_HEADER=( new ToolbarSkin(\"window-header\"));}", "function DEFAULT$static_...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Registers a named plugin for use with Babel.
function registerPlugin(name, plugin) { if (availablePlugins.hasOwnProperty(name)) { console.warn('A plugin named "' + name + '" is already registered, it will be overridden'); } availablePlugins[name] = plugin; }
[ "function registerPlugin(name, plugin) {\n\t\t if (availablePlugins.hasOwnProperty(name)) {\n\t\t console.warn('A plugin named \"' + name + '\" is already registered, it will be overridden');\n\t\t }\n\t\t availablePlugins[name] = plugin;\n\t\t}", "function registerPlugin(name, plugin) {\n\t if (availableP...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
FIXME Class field not supported in npm package for miniwechat _syncPointerReceiver
onSyncPointerReceive(syncPointerReceiver) { // TODO addListener this._syncPointerReceiver = syncPointerReceiver; }
[ "setReceiver(receiver){\n this.receiver = receiver;\n }", "get sender(){ return this.m_sender; }", "constructor (proto) {\n this.proto = proto;\n }", "constructor () {\n this.listeners = {};\n chrome.runtime.onMessage.addListener((msg, sender, sendResponse) => {\n if (this.listeners.h...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Also certain cells are "off limits" such that the robot cannot step on them. Desin an algorithm to find a path for the robot from the top left to bottom right.
function robotGrid(r, c, grid, path){ let rows = grid.length-1; let cols = grid[0].length-1; if(r === rows && c === cols && grid[r][c] === 0){ console.log(path) return true } if(!grid[r] || grid[r][c] !== 0){ return false } if(robotGrid(r+1,c,grid,path+"Down") || ...
[ "function findPath(MazeObj, CurrCellRC, Steps) { // curr and dest are [row, col]\n// Definitions\nlet Maze, DestCellRC\nlet CurrCell, CurrRow, CurrCol\nlet NextCell, NextRow, NextCol, NextCellRC\nlet Walls, RandWall, WallPick\n\n// Easy References\n Maze = MazeObj.Maze // Maze structure \n DestCellRC=...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the ID of the vehicle in your account with the desired VIN.
getID(callback) { this.log("Logging into Tesla...") tesla.all({token: this.token}, (err, response, body) => { if (err) { this.log("Error logging into Tesla: " + err) return callback(err) } const vehicles = JSON.parse(body).response; for (let vehicle of ...
[ "getRegistrationVoteId() {\n let contract = this.contract;\n return contract.methods.getRegistrationVoteIdByAddress(this.account).call({ from: this.account });\n }", "function getCurrentINR(){\r\n\t\tvar hiddenSec = document.getElementsByTagName(\"body\")[0];\r\n\t\tvar myRe = /6301\\-6\\^INR\\|\\|([0-9]*\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Handles 'auto', 'any', or array config port values Adds a `resolvedPort` property to the webserver If the port has already been resolved it is returned immedietely
async resolvePort() { if (this.resolvedPort) return this.resolvedPort; const { port } = this.config; if (port === 'any' || port === 'auto') { // Find any available port this.resolvedPort = await require('get-port')(); } else if (Array.isArray(port)) { // Find any availa...
[ "static get port() {}", "get externalPort() {}", "static portMapping(publishedPort, targetPort, options) {\n var _c;\n const protocol = (_c = options === null || options === void 0 ? void 0 : options.protocol) !== null && _c !== void 0 ? _c : DockerComposeProtocol.TCP;\n return {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test hole replacement failure, when the hole is an object with a dynamic binding.
function test_fail_hole_dynamic() { var obj = { get x() { return 10; } }; function f1() { bidar.serialize(obj); } assert.throws(f1, /Hole-ful graph, but no hole filter/); }
[ "function test_fail_hole_function() {\n var obj = { a: hole };\n\n function hole() {\n return \"holy!\";\n }\n\n function f1() {\n bidar.serialize(obj);\n }\n assert.throws(f1, /Hole-ful graph, but no hole filter/);\n\n // This is an attempt to replace a would-be hole with itself.\n function f2() {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
action triggered when click on the Confirm button in the modal saves date and location to the disposition model
@action async onConfirm() { const { dispositionsByRole: dispositions } = this.model; this.set('error', null); const allActions = this.get('allActions') || (dispositions.length <= 1); // if user is submitting ONE hearing for ALL actions if (allActions) { const allActionsDispHearingLocation ...
[ "function handleConfirm(){\n updateEcoElement(ecoElement.name, ecoElement.id, ecoElement.category, ecoElement.categorySub, ecoElement.district,\n ecoElement.address, position.lat, position.lng, token, setEcoElement, ecoElement.certificates);\n history.push(\"/loading/map\");\n }", "fun...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get the index of the model from an object
function modelLookup(modelObject){ var modelIdx = -1; for(var i=0; i<$.models.length;i++) if(modelObject == $.models[i].model) modelIdx = i; return modelIdx; }
[ "function getObjectIndex(obj) {\n return $scope.opts.all.indexOf(obj);\n }", "function getIndexOf(obj) {\n\tvar i = 0;\n\tvar found = false;\n\tvar length = this.getLength();\n\twhile (i < length && !found) {\n\t\tif (this.get(i) == obj) {\n\t\t\tfound = true;\n\t\t} else {\n\t\t\ti++;\n\t\t}\n\t}\n\tretu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Explore page fetching first explore artist
async function getExploreArtist1() { let response = await fetch("http://wordpress.oscho.dk//wp-json/wp/v2/posts?_embed&categories=28"); let data = await response.json(); console.log(data) appendExploreArtist1(data); //showLoader(false); }
[ "function getArtist(artistName){\n fetch(`http://localhost:3000/api/v1/artist?q=${artistName}`, {\n method: 'GET',\n headers: {\n 'accept': 'application/json',\n 'content-type': 'application/json',\n }\n })\n .then(response => response.json())\n .then(artists => renderArtist(artists.art...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Save album info and perform some action after saving
function saveAlbumInfo(success, error) { addDefferedFileAction(success, error); //For now do not create album on Facebook //Instead immediately process file doDefferedFileAction('success'); }
[ "save() {\n this.socialShare.saveToPhotoAlbum(this.mainImage).then(() => this.toast(this.translate.instant('other.save-to-album')));\n }", "function saveAlbum(albumId){\r\n\t\t//to persist\r\n\t\tlocalStorage.setItem(\"Albums\" , JSON.stringify(albums));\r\n\r\n\t\t//to change the view\r\n\t\tlocation.h...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Update list of matches
_updateMatches() { let matches = []; let completeList = this.words.concat(this.extraWords); completeList.forEach((word) => { word.matches.forEach((match) => { matches.push({ match, word }); }); ...
[ "setMatches (state, matches) {\n state.matches = { ...matches }\n }", "function updateMatchedWords(){\n if(artistAlreadyAdded(lastMatch) == false){\n $scope.artistMatches.push(lastMatch);\n }\n }", "function updateMatches(){\n checkMatches = 1;\n}", "static updateMatch(match) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Child click listener, emit input event and change active child.
childClick(child) { if (this.activeId !== child.newValue) { this.performAction(); this.activeId = child.newValue; this.performAction(); this.$emit('input', this.activeId); } }
[ "childClick(child) {\n this.activeId = child.value\n }", "onClickItem(event, child) {\n this.$emit('item:click', event, child);\n }", "onChildEdit() {\n if (this._childEdit) {\n this._childEdit.raise();\n }\n }", "bindInputClick () {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
getThreeWordPhraseCounts(args) Get 3word phrase keywords.
function getThreeWordPhraseCounts(args) { var inputwords = args['inputwords']; var inputwordscount = args['inputwordscount']; var skipwords = args['skipwords']; var threewordphrases = {}; for(i = 0; i - 2 < inputwordscount; i++) { var currentword = inputwords[i]; var nextword = inputwords[i + 1]; ...
[ "function getSingleKeywordCounts(args) {\n\t\twords = args['words'];\n\t\twordcount = args['wordcount'];\n\t\tskipwords = args['skipwords'];\n\t\t\n\t\tvar wordcounts = {};\n\t\t\n\t\tfor(i = 0; i < wordcount; i++) {\n\t\t\tvar inputword = words[i];\n\t\t\t\n\t\t\tif(!skipwords[inputword]) {\n\t\t\t\tif(wordcounts[...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
fonction chargez de la gestion de certains boutons : Ajouter au Panier; bouton icone de poubelle.
function gestionBouton(){ let boutonAjouter = document.getElementsByClassName("bouton-achat"); for(let i = 0; boutonAjouter.length > i; i++){ boutonAjouter[i].addEventListener("click", ajoutAuPanierInfo); }; function ajoutAuPanierInfo (event) { let élement = event.target.parentElement.pa...
[ "function gerarBoleto(fatura) {\n \n }", "function boutonSoldat(){\n\tif (caserneConstruite == true){\n\t\tcreationSoldat();\n\t\t}\t\t\n\t\telse {\n\t\t\talert(\"vous n'avez pas construit la caserne\");\n\t\t}\n\t\t\n}", "doBlocage() {\n\t\t// On compte le nombre joueurs qui peuvent construir...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Update the undo/redo enabled status
function updateUndoRedo() { $('#btnUndo').prop('disabled', !undoManager.hasUndo()); $('#btnRedo').prop('disabled', !undoManager.hasRedo()); }
[ "function updateUndoButtons() {\n redoButton.elt.disabled = (actionRedo.length === 0);\n undoButton.elt.disabled = (actionUndo.length === 0);\n}", "function updateUndoButtons() {\n $('.undo-btn').toggleClass('disabled', !undo.canUndo());\n $('.redo-btn').toggleClass('disabled', !undo.canRedo());\n }"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Converts a style property name to a css property name. For example: "WebkitUserSelect" to "webkituserselect"
function convertStylePropertyName(name) { return String(name).replace(/[A-Z]/g, function(c) { return '-' + c.toLowerCase(); }); }
[ "function toStyleProp(prop) {\n\t\t\tif (prop == \"float\") {\n\t\t\t\treturn env.ie ? \"styleFloat\" : \"cssFloat\";\n\t\t\t}\n\t\t\treturn lang.replace(prop, /-(\\w)/g, function(match, p1) {\n\t\t\t\treturn p1.toUpperCase();\n\t\t\t});\n\t\t}", "function convertStylePropertyName(name) {\n return String(name)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Calls the interpetInput function and creates a text response, before passing it to the addChatEntry function.
function composeOutput(input) { let cleanedText = input.toLowerCase().replace(/[^\w\s\d]/gi, ""); var response = interpretInput(cleanedText); addChatEntry (input, response); }
[ "function main() {\r\n var text = readlineSync.question('> ');\r\n\r\n if (text != 'quit') {\r\n // Respond to input.\r\n chatskills.respond(text, function(response) {\r\n console.log(response);\r\n main();\r\n });\r\n }\r\n}", "function handleInput(text) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
end jday / procedure days2mdhms this procedure converts the day of the year, days, to the equivalent month day, hour, minute and second. algorithm : set up array for the number of days per month find leap year use 1900 because 2000 is a leap year loop through a temp value while the value is < the days perform int conve...
function days2mdhms(year, days) // int& mon, int& day, int& hr, int& minute, double& sec // ) { var i, inttemp, dayofyr; var temp; var lmonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; dayofyr = Math.floor(days); /* ----------------- find month and day of month ---...
[ "function days2mdhms(year, days) {\n var lmonth = [31, year % 4 === 0 ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n var dayofyr = Math.floor(days); // ----------------- find month and day of month ----------------\n\n var i = 1;\n var inttemp = 0;\n\n while (dayofyr > inttemp + lmonth[i - 1]...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Object holding the scroll position of something.
function ScrollPosition() {}
[ "function ScrollPosition() { }", "get scrollPosition() {\n return this.scrollComponent.scrollAmount;\n }", "_getScrollPosition () {\n const { horizontal, $scrollElement } = this.options;\n return getElementScroll($scrollElement, horizontal);\n }", "getScrollPosition() {\r\n let scrollableE...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
We currently have no good heuristics for checking whether we want to resume an interrupted stack when pushing to an empty stack. Instead, we need to rely on `_maybeResumeInterruptedStackOnPop` to try healing things retroactively.
_maybeResumeInterruptedStackOnPushEmpty(contextId) { if (this._waitingStacks.has(contextId)) { // resume previous stack this.resumeWaitingStack(contextId); } else { const mysteriousStack = this._interruptedStacksOfUnknownCircumstances.find(stack => stack._stack.includes(contextId)); ...
[ "_maybeResumeInterruptedStackOnPushEmpty(contextId) {\n if (this._waitingStacks.has(contextId)) {\n // resume previous stack\n this.resumeWaitingStackAndPop(contextId);\n return true;\n }\n else {\n const mysteriousStack = this._interruptedStacksOfUnknownCircumstances.find(stack => stac...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
UnSelect an iten at a given index.
unSelectItem (i) { this.toggSel(false, i); }
[ "function unselectRow(index) {\n if (index == undefined || index < 0 || index >= _currentData.length) return;\n\n var pos = $.inArray(index, selectedIndexes());\n if (pos == -1) return;\n\n selectedIndexes().splice(pos, 1);\n }", "function unselect(idx) {\r\n var deselected = sel...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Here i Store the Value of the choice, which would be Computer or Player
function decidePlayerOrComputer() { choiceComputerPlayer = this.value; }
[ "function storePlayerChoice(choice) {\n playerChoice = choice;\n console.log(\"My choice = \" + choice);\n storeComputerChoice();\n}", "function setPlayerChoice(choice) {\n if (choice === 'X') {\n player = 'X';\n machine = 'O';\n } else if (choice === 'O') {\n player = 'O';\n machine = 'X';...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
filter out VNodes without attributes (which are unrankeable), and add `index`/`rank` properties to be used in sorting.
function prepareVNodeForRanking(vnode, index) { vnode.index = index; vnode.rank = rankChild(vnode); return vnode.attributes; }
[ "function sortVisualNodes(options) {\n //sort visible node order\n Object.keys(treeTax.visible_lbr).forEach(function(rank) {\n rank = rank.toLowerCase();\n //console.log(rank.toUpperCase(),treeTax.visible_lbr[rank].length);\n treeTax.visible_lbr[rank].sort(\n (a, b) => +parseFl...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
manually reconstruct a feature values array from unique values and their counts
function reconstructDataset(values) { // normalize array length to 1000, as precision isn't as important as speed here const divisor = state.dataset.attributes.recordCount / 1000; // const divisor = 1; // alternately, use the whole set let arr = []; for (let x = 0; x < values.length; x++) { fo...
[ "function mapFeatureIdsToValues() {\n getVpns().then(function(vpnList) {\n var featureIdToValueMap = {};\n vpnList.forEach(function(vpn) {\n vpn.features.forEach(function(feature) {\n if (MrlUtil.objectContainsKey(featureIdToValueMap, feature.id)) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the deepest depth of the CmdNode.
function getCmdMaxDepth(cmdTree, depth=0) { if (cmdTree.next !== undefined) { let depthArray = [] for (let cmdCurr of cmdTree.next) depthArray.push(getCmdMaxDepth(cmdCurr, depth+1)); return depthArray.reduce((a, b)=>{ return Math.max(a, b); }); } else { ...
[ "function getdepth(node) {\n var match = node.className.match(/dsq-depth-[0-9]+/);\n if (!match) {\n return 0;\n }\n return Number(match[0].replace(/dsq-depth-/, ''));\n }", "function getCmdNode(fullCmd, cmdTree, depth=0, fullCmdList=undefined) {\n if (depth==0) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
////add new membership type in the membership fees section
function addNewMembershipTypeAction(newObject) { return { type: ApiConstants.ADD_NEW_MEMBERSHIP_TYPE, newObject, }; }
[ "regSaveMembershipProductFee(payload) {\n var url = `/api/membershipproduct/fees`;\n return Method.dataPost(url, token, payload);\n }", "function addEligibilityType (user) {\n if (!user.name) {\n user.engageType = 'profile'\n } else {\n user.engageType = 'post'\n }\n\n return user\n}", "functio...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A class that takes a project's test config and provides various utilities for executing its tests.
function TestRunner(config, options) { this._config = config; this._configDeps = null; this._moduleLoaderResourceMap = null; this._testPathDirsRegExp = new RegExp( config.testPathDirs .map(function(dir) { return utils.escapeStrForRegex(dir); }) .join('|') ); this._nodeHasteTes...
[ "function TestUtil() {\n\n this.testSupportContainer = path.join(__dirname, \"../\", \"test/test-support\");\n this.testPreloadContainer = path.join(this.testSupportContainer, \"preload-files\");\n\n this.workingDirectoryPath = \"\"\n this.subDirectoryPath = \"\";\n\n}", "function FrameworkUnitTest() ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
serialize the cell margins
serializeCellMargins(writer, format) { this.serializeMargins(writer, format, 'tcMar'); }
[ "serializeTableMargins(writer, format) {\n this.serializeMargins(writer, format, 'tblCellMar');\n }", "serializeRowMargins(writer, format) {\n writer.writeStartElement(undefined, 'tblPrEx', this.wNamespace);\n this.serializeMargins(writer, format, 'tblCellMar');\n writer.writeEndEle...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Fetch ALL summaries, or the specified by 'count'
fetch_summaries({ commit }, count) { const url_param = count ? `?count=${ count }` : ''; fetch(`/api/all${ url_param }`) .then(resp => resp.json()) .then(resp => { resp.forEach(article => commit('add_article', article)); }); ...
[ "async fetchTopX(count = 5) {\n\t\t\tconst fruit = await Fruit.fetchAll();\n\t\t\treturn orderBy(fruit.map(item => item.serialize()), [item => item.score], ['desc']).slice(0, 5);\n\t\t}", "countAll() {\n let sqlRequest = \"SELECT COUNT(*) AS count FROM book\";\n return this.common.findOne(sqlRequest...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function to report blog Comment
function blogReportComment(report) { var deferred = $q.defer(); $http.post(REST_API_URI + "blog/report/comment", report).then(function (response) { deferred.resolve(response.data); }, function (errorResponse) { console.log("Error Re...
[ "comments(comment) {\n // console.log(`Incoming comment: ${comment.text}`)\n }", "function MTComments() {}", "function cb_comment () {\n cb({\n ev: EVENTS.COMMENT\n ,line_no: line_no+1\n ,comment: comment\n })\n // reset collector var\n comment = \"\"\n }", "function addcommen...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }