query
stringlengths
9
34k
document
stringlengths
8
5.39M
negatives
listlengths
19
20
metadata
dict
ZeroMode (optional), uses value of ZeroMode when Value is zero "" use '' when zero "" use blank when zero
function FmtDec(Value, ZeroMode) { var Val = NumRnd(Value, 2); var Str = ""; if (isNaN(Val)) { Val = 0; } Str = FmtNum(Val, 2); if (Str == "0.00" && arguments.length >= 2) { Str = ZeroMode; } return Str; }
[ "function BlankToZero(val) {\n if (val == \"\" || val == null || val == undefined || val == \"null\" || val == \"undefined\") {\n val = 0\n }\n return val\n}", "function GetZeroOnIsNullOrEmpty(value) {\n if (value == \"\" || value == null)\n return 0;\n else {\n return value;\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
infers the color for a given value based on the stops from a ColorVariable
function getColorFromValue(stops, value) { var minStop = stops[0]; var maxStop = stops[stops.length - 1]; var minStopValue = minStop.value; var maxStopValue = maxStop.value; if (value < minStopValue) { return minStop.color; } if (value > maxStopValue) ...
[ "function updateStopValue() {\n // Update stop value for all colors equally\n let eqStop = Math.round(100 / (colorDataArray.length - 1));\n colorDataArray.forEach(function (colorData, index) {\n if (index == (colorDataArray.length - 1)) {\n colorData.stop = 100;\n } else {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set a new selection.
function setSelection(doc, sel, options) { setSelectionNoUndo(doc, sel, options); addSelectionToHistory(doc, doc.sel, doc.cm ? doc.cm.curOp.id : NaN, options); }
[ "function setSelection(doc, sel, options) {\n\t setSelectionNoUndo(doc, sel, options);\n\t addSelectionToHistory(doc, doc.sel, doc.cm ? doc.cm.curOp.id : NaN, options);\n\t }", "function setSelection(doc, sel, options) { // 1258\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Updates this list intance with the supplied properties
update(properties, eTag = "*") { const postBody = jsS(extend({ "__metadata": { "type": "SP.List" }, }, properties)); return this.postCore({ body: postBody, headers: { "IF-Match": eTag, "X-HTTP-Method": "MERGE", ...
[ "function updatePropertyList(mylist) {\n\t$(\".property-list\").empty();\n\tconsole.log(\"remove properties\");\n\tfor(var i = 0; i < mylist.length; i++) {\n\t\tif(i % 3 == 0) {\n\t\t\t$(\".property-list\").append('<div class=\"row1 property-row\"></div>');\n\t\t\tappendProperty(\n\t\t\t\tmylist[i].propertyPictureU...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function gets the top 10 trends from Twitter. Pass in geolocator number.
getTrends(location) { return new Promise((resolve, reject) => { this._client.get(`http://localhost:7890/1.1/trends/place.json?id=${location}&lang=en-gb`, (err, data, response) => { if (!err) { const top10Trends = []; for (let i = 0; i < 10; i++) { top10Trends.push({ tre...
[ "function getTweetsFromTrend(trend) {\n twitter.getSearch({'q': trend ,'count': 100}, error, processTweetsFromTrend);\n}", "function loadTrendingTwitter() {\n\t$.ajax({\n\t\turl: \"/twitter_popular.php\",\n\t\ttype: \"get\",\n\n\t\tsuccess: function (trendingTwitterJSON) {\n\t\t\tdata = JSON.parse(trendingTwitte...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
cleanUpDocument() Main routine for performing clean up when user hits OK. Clean up is done in three passes: Pass 1: Clean up certain items based on the entire HTML document as a string Pass 2: Clean up certain items while traversing the DOM
function cleanUpDocument() { // Set up logging particulars // if ( cbShowLog.checked ) { MM_enableLogging(); MM_clearLog(); } else { MM_disableLogging(); } // Do cleanup in two passes -- the first pass , the second pass // cleans up certain items based on a hierarchy traver...
[ "function cleanDocument() {\n // RASH depends on JQuery, so we can leverage it here as well.\n // We remove all elements with the \"cgen\" class, introduced automatically by RASH.\n $('.cgen').remove();\n $('body header').remove();\n // To do: citations should be reverted as well\n// now revert the r...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function for loading the References page in a modal window.
function showReferencesPage() { createWindowHTML('<div id="refWindowDiv">Loading References...</div>', 'big'); var modalDiv = $('#refWindowDiv'); if ($('.darkMode')[0]) { modalDiv.load('references.html #referencesList', function () { modalDiv.prepend('<h1>References for <em>Design&nbsp...
[ "function openReference(){\n\tutils.OpenPage(\"New Lead\",\"/Input Management/newlead.html\",data.Lead_Id,\"\");\n}", "function addReferenceModalOpen(){\r\n\t$(\"#reference_add\").fadeIn(500);\r\n}", "function showReferences() {\n var texto = referencesScreen();\n document.getElementById('references').innerHT...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Save tasks to local storage
save() { const tasksJson = JSON.stringify(this.tasks); localStorage.setItem('tasks', tasksJson); const currentId = String(this.currentId); localStorage.setItem('currentId', currentId); }
[ "function saveTasks() {\n let str = JSON.stringify(tasks);\n localStorage.setItem(\"tasks\", str);\n}", "async save(tasks) {\n await AsyncStorage.setItem(\"TASKS\", this.toStringWithSeparators(tasks));\n }", "function storeTasks(){\n localStorage.setItem(value, task);\n }", "save() {\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This will hide the quickMenu buttons.
hideQuickMenu() { $(`.${this.quickMenu}`).hide(); }
[ "hideQuickMenu() { $(`#${this.quickMenuId}`).hide(); }", "function hideMenu() {\n\t\tmenu.Hide();\n\t\ttileTouchController.enableInput();\n\t\tcameraMovement.enableInput();\n\t}", "static hideAll() {\n super._hideButtons('homeButtons');\n }", "function hideMenu() {\n startButton.style.visibility = \"hidd...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function to get the recently released products
function recent_products(products){ let res=[]; products.forEach((product, i) => { if(dayDiff(Date.now(), new Date(product.released))<15){ res.push(product); } }); return res; }
[ "function getCurrentProducts() {\n return products;\n}", "function getLastProducts(){\n\t\t\n\t\treturn $http({\n\t\t\tmethod\t: 'GET',\n\t\t\turl \t: API_URL + 'lastProducts',\n\t\t\theaders: {'key': 'dragonteam'},\n\t\t\tcache\t: true\n\t\t});\n\t}", "async getAllBoughtProducts() {\n //TODO\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
scale the annotation boxes and adjust their position accordingly
function resizeAnnotations(scaleFactor) { $('.Annotation').each(function() { $(this).css('top', parseFloat($(this).css('top')) * scaleFactor + 'px') $(this).css('left', parseFloat($(this).css('left')) * scaleFactor + 'px') $(this).css('width', parseFloat($(this).css('width')) * scaleFactor + 'px') $(t...
[ "function setLabelScaling() {\n\n var x = st.canvas.scaleOffsetX,\n\n y = st.canvas.scaleOffsetY;\n\n $(\".node\").css(\"-moz-transform\", \"scale(\" + x +\",\" + y + \")\");\n\n $(\".node\").css(\"-webkit-transform\", \"scale(\" + x +\",\" + y + \")\");\n\n $(\".node\").css(\"-ms-transform\", \"sca...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
check if database has data, if empty show add trail card
function checkDatabaseQuery(snapshot) { if (snapshot.val()) { document.querySelector('.new-trail-card').style.display = "none"; } else { document.querySelector('.new-trail-card').style.display = "block"; console.log('showing') } }
[ "function noRecordCheck() {\n\t\t\tvar viewPort = '.grid-canvas';\n if (data.length === 0) {\n\t\t\t\tif(!grid.getOptions().isHeaderColumnRequired){\n\t\t\t\t\tviewPort = '.slick-viewport';\n\t\t\t\t}\n\t\t\t\t$(viewPort, $(container)).html('<div class=\"noRecord\">' + xenos.i18n.message.no_record_found_...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
returns interval by reading provided text argument. only 1 timer ideally should be present in text. returns null, if text has no timer.
function getIntervalFromTimer(text) { try { if ( text != null && text != "" ) { var timerValue = text.match(/\b\d{1,}:\d{1,}:\d{1,}\b/); // in hh:mm:ss format if ( timerValue == null ) { return null; } timerValue = timerValue[0].split(":"); var retValue = timerValue[0]*60*60*1000 + timerValue[1]*6...
[ "function readTime(text) {\n\tvar total = (text.split(' ')).length;\n\treturn Math.floor(total / 200) || 1;\n}", "function interval(text) {\n\n\ttext = text.replace('minus', '-')\n\ttext = text.replace('zero', '0')\n\ttext = text.replace('plus', '')\n\treturn parseInt(text)\n}", "function calculateReadingTime(t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Method called when component is disposed and removed from DOM
dispose() { // Perfect place to remove eventlisteners etc }
[ "destroy () {\n this.__component.__destroy()\n this.__htmlWatcher.disconnect()\n }", "destroy() {\r\n\t\tthis.parentComponent.removeChild(this.el);\r\n\r\n\t\tthis.cleanThis();\r\n\t}", "disposeInternal() {\n\n if (this.isInDocument) {\n this.exitDocument();\n }\n\n // Disposes of the compo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
ask for arguments: 'name','color','weapon','favoritePizzaType' implement our constructor create an instance of turtles for each of the 4 ninja turtles test this in the console of your choice
function turtle(name,color,weapon,favoritePizzaType){ this.name=name; this.color=color; this.weapon=weapon; this.favoritePizzaType=favoritePizzaType; }
[ "function turtle(name, colour, weapon, favouritePizzaType) {\n this.name = name;\n this.colour = colour;\n this.weapon = weapon;\n this.favouritePizzaType = favouritePizzaType;\n}", "function turtle(name, color, weapon, favPizzaType) {\n this.name = name;\n this.color = color;\n this.weapon = weapon;\n th...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
calculates the direction between two points
function direction(start, end){ var deltaX = end[0]-start[0]; var deltaY = end[1]-start[1]; if(deltaX === 0) return deltaY > 0 ? Math.PI/2 : 3*Math.PI/2; if(deltaY === 0) return deltaX > 0 ? 0 : Math.PI; var atan = Math.atan(deltaY/deltaX); if(atan >= 0){ return deltaY > 0 ? atan : atan + Math.PI; }el...
[ "function point_direction(x1, y1, x2, y2)\n{\n var xdiff = (x2) - x1;\n var ydiff = (y2) - y1;\n\n return (-(Math.atan2(ydiff, xdiff) * 180.0 / Math.PI));\n}", "function pointDirection(p1, p2) {\n return rtd(Math.atan2(p2.y - p1.y, p2.x - p1.x));\n}", "function point_direction(x1, y1, x2, y2)\n{\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
endregion region Handle multiSelect Handles multi selection using the mouse. Called from GridElementEvents on mousedown in a cell and simultaneously pressing a modifier key.
handleMouseMultiSelect(cellData, event) { const me = this, id = cellData.id; function mergeRange(fromId, toId) { const { store, recordCollection } = me, fromIndex = store.indexOf(fromId), toIndex = store.indexOf(toId), startIndex = Math.min(fromIndex, toIndex),...
[ "handleMouseMultiSelect(cellData, event) {\n const me = this,\n id = cellData.id;\n\n function mergeRange(fromId, toId) {\n const {\n store,\n selectedRecordCollection\n } = me,\n fromIndex = store.indexOf(fromId),\n toIndex = store.indexOf(toId),\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Decode the "DD" prefix (IX instructions).
function decodeDD(z80) { const inst = fetchInstruction(z80); const func = decodeMapDD.get(inst); if (func === undefined) { console.log("Unhandled opcode in DD: " + z80_base_1.toHex(inst, 2)); } else { func(z80); } }
[ "function decode(){\n\t// Separate opCode (equivalent to opCode = IR % 100\n\topCode = IR.charAt(1);\n\t// Separate operand\n\toperand = IR.substring(2,4);\n\treturn 0;\n}", "function tinf_decode_symbol(d,t){while(d.bitcount<24){d.tag|=d.source[d.sourceIndex++]<<d.bitcount;d.bitcount+=8;}var sum=0,cur=0,len=0;var...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Large cap: 10B+ Mid cap: 210B Small cap: 0.32B Micro cap: < 0.3B Tabulate stocks by market cap For market cap donut/pie chart
function computeMarketCaps(data) { let large = 0 let medium = 0 let small = 0 let micro = 0 let portfolioDta = data for (var j = 0; j < portfolioDta.length; j++) { let mCap = parseFloat(portfolioDta[j]['marketcap']) let holding = parseFloat(portfol...
[ "function formatCap(marketCap) {\n if (marketCap === null) return '';\n let value, suffix;\n if (marketCap >= 1e12) {\n value = marketCap / 1e12;\n suffix = 'T';\n } else if (marketCap >= 1e9) {\n value = marketCap / 1e9;\n suffix = 'B';\n } else if (marketCap >= 1e6) {\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
transform groupedData into valid functional group rpc objects under the keys modifies the original object
function hashToRpcObject (_, next) { //asynchronously iterate over groupedData flame.async.map(groupedData, function (group, callback) { for (let rpc in group.rpcs) { //hmi_levels and parameters property needs to be an array const data = group.rpcs[rpc]; ...
[ "_convertGroupedData(data) {\n if (util.isPlainObject(data) && (data.$reql_type$ === 'GROUPED_DATA')) {\n let result = [];\n for (let i = 0, ii = data.data.length; i < ii; ++i) {\n result.push({\n group: data.data[i][0],\n reduction: data.data[i][1]\n });\n }\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
trigger a given event on the element. if element is empty, trigger it on the document object.
function trigger (event, element) { (element || document).dispatchEvent(event); }
[ "function eventFire( element, eventType ){\n if ( element.fireEvent ) {\n element.fireEvent( 'on' + eventType );\n }\n else {\n var eventObject = document.createEvent( 'Events' );\n eventObject.initEvent( eventType, true, false );\n element.dispatchEv...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
FUNCTION: dwscripts.isValidServerVarName DESCRIPTION: Returns true if the given variable name is legal ARGUMENTS: theVarName string variable to check RETURNS: boolean
function dwscripts_isValidServerVarName(theVarName) { var retVal = true; // Use the Server Model version if it exists var serverObj = dwscripts.getServerImplObject(); if (serverObj != null && serverObj.isValidServerVarName != null) { retVal = serverObj.isValidServerVarName(theVarName); } else { ...
[ "function isValidServerVarName(theVarName)\n{\n var retVal = true;\n\n var parts = theVarName.split(\".\");\n\n for (var i=0; i < parts.length; i++)\n {\n if (!dwscripts.isValidVarName(parts[i]))\n {\n retVal = false;\n break;\n }\n }\n\n return retVal;\n}", "function checkVarSyntax(var_n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Delay and Duration are in milliseconds Add height transition to existing transitions.
addHeightTransition(parsedTransition, heightTransition) { let transitions = parsedTransition.map(t => { return `${t.name} ${t.duration}ms ${t.timingFunction} ${t.delay}ms` }) this.$el.style.transition = [...transitions, heightTransition].join(',') }
[ "function fAnimateHeight (elem, eHeight) {\n //tMx.to (elem, animTym, {css: {height: eHeight}, ease: easePower});\n tMx.to (elem, animTym, {height: (eHeight + \"px\"), ease: easePower});\n }", "function fAnimateHeight (elem, eHeight) {\n tMx.to (elem, animTym, {css: {height: eHeight}, ease: easePower});...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Go through all of the implementations of type, as well as the interfaces that they implement. If any of those types include the provided field, suggest them, sorted by how often the type is referenced.
function getSuggestedTypeNames(schema, type, fieldName) { if (!(0, _definition.isAbstractType)(type)) { // Must be an Object type, which does not have possible fields. return []; } var suggestedTypes = new Set(); var usageCount = Object.create(null); for (var _i2 = 0, _schema$getPossibleTy2 = schema...
[ "function getSuggestedTypeNames(schema, type, fieldName) {\n if (!(0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_2__.isAbstractType)(type)) {\n // Must be an Object type, which does not have possible fields.\n return [];\n }\n\n var suggestedTypes = new Set();\n var usageCount = Object.create(null);\n\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Given a token converts it into some kind of atom
function read_atom(token) { // First try to see if it is parseable as a number const tryFloat = Number.parseFloat( token ); if (!Number.isNaN( tryFloat )) { return tryFloat; } else { // If it starts with a quote character, its a string if (token[0] === '"') { return t...
[ "function read_atom(token) {\n // First try to see if it is parseable as a number\n const tryFloat = Number.parseFloat( token );\n if (!Number.isNaN( tryFloat )) {\n return tryFloat;\n } else {\n // If it starts with a quote character, its a string\n if (token[0] === '\"') {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Deletes the selected marker
function deleteHelper() { mymap.removeLayer(selected_marker); furnMap.delete(selected_furn.id); }
[ "function deleteCurrentMarker() {\n\tif (!selectedMarker) return;\n\tmap.removeLayer(selectedMarker);\n\tvar idx = markers.indexOf(selectedMarker);\n\tdeselectCurrentMarker();\n\tmarkers.splice(idx,1);\n\tpopulateTagsTable({});\n\tu('#changes').html(markers.length);\n\tclearAutocomplete();\n\tvar markerComponent = ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Is the java type valid? Only verifies if there is more than 1 access modifier (ie can't have public private int)
function isValidJavaType(type) { const ACCESS = ["private", "public", "default", "protected"]; var count = 0; for(var a in ACCESS) { if( type.includes(a) ) count++; } return count < 2; }
[ "function validVisibility(inputVal){\n\treturn ((inputVal == \"PUBLIC\") || (inputVal == \"PRIVATE\") || (inputVal == \"PROTECTED\"));\n\n}", "static isValid(type) {\n return (validTypes.indexOf(type) > -1);\n }", "checkType(type) {\n try {\n return this.types[type.name.toUpperCase()] ? true : false...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Attaches this policy to a role.
attachToRole(role) { try { jsiiDeprecationWarnings.aws_cdk_lib_aws_iam_IRole(role); } catch (error) { if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") { Error.captureStackTrace(error, this.attachToRole); } th...
[ "addToRolePolicy(statement) {\n this.role.addToPolicy(statement);\n }", "addToRolePolicy(statement) {\n if (!this.role) {\n return;\n }\n this.role.addToPrincipalPolicy(statement);\n }", "addToRolePolicy(statement) {\n return this.lambda.addToRolePolicy(statem...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Given an institution id, parses the given data to find the item with the matching ins_id and then sums the smount of POSITIVE transactions
function createInstitutionInData(userData, insId){ //['Checking','Savings','Investments','Loans'] return new Promise(function(resolve, reject) { var accountData = 0; for (var institution = 0; institution < userData.length; institution++) { if(userData[institution].error_code){ ...
[ "function createInstitutionOutData(userData, insId){\n //['Checking','Savings','Investments','Loans']\n return new Promise(function(resolve, reject) {\n var accountData = 0;\n for (var institution = 0; institution < userData.length; institution++) {\n if(userData[institution].error_co...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
USE CSVAPPENDER TO APPEND THE DATA, PUSH TO DB
async function rawDatabasePush(flagVar) { await asyncAppendCSV(flagVar); const fs = require("fs"); const mysql = require("mysql"); const fastcsv = require("fast-csv"); const json2csv = require("json2csv"); let stream = fs.createReadStream("mainData.csv"); let csvData = []; let csvStre...
[ "function append_to_csv(data)\n{\n\tif( settings.csv === false)\n\t{\n\t\treturn;\n\t}\n\n\tdata.unshift(settings.directory);\n\n\t// Runtime in ns -> ms\n\tdata[4] = (data[4] * 1e-6).toFixed(0);\n\n\tlet line = data.join(',') + '\\n';\n\n\tfile_system.appendFileSync(settings.csvfile, line, function(error)\n\t{\n\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Handles click event on record button.
function onRecordBtnClick() { if (recordingLock || document.hidden) { return; } toggleRecording(); setRecording(); }
[ "function handleRecordClick(e) {\n e.preventDefault();\n\n // If there is no source selected, don't do anything\n if (!mediaRecorder) {\n return;\n }\n\n // Change button-colors\n recordBtn.classList.toggle(\"btn-success\");\n recordBtn.classList.toggle(\"btn-danger\");\n\n // Change ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Seed farms to db from public/data/farms.csv
async function seedFarm(buffer) { try{ Farm.insertMany(buffer, (err,docs) => { if (err) console.log('ERROR: '+err) }) }catch (e){ console.log('error: ' + e) } finally { console.log('SEED FARMS'); } }
[ "function seedAirportLocations(filename){\n // Read csv file, parse into an object and then insert values into table JetBlue\n // When parsing, it also generates a random temperature\n let parsed_data = reader.readFile(filename, function(parsed_data){\n parsed_data = addRandomTemperature(parsed_data...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function cleans the _selectedList variable. It's needed when the user loads and old json version
function _cleanSelectedList() { let i = _selectedList.length; while (i--) { if (_selectedList[i].value === 'index') { _selectedList.splice(i, 1); } } }
[ "function cleanSelected() {\r\n cleanSelectedFromArr(numbersArr);\r\n cleanSelectedFromArr(starsArr);\r\n htmlFactory.clearGrids();\r\n refreshResult('numbers');\r\n refreshResult('stars');\r\n copyStatisticsToStorage();\r\n }", "function clearSelection()\n {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Updates the player texts for the game.
updatePlayerTexts() { if (this.player) { this.updateText( 'playerName', { name: this.player.getProp('name') }, { fill: this.player.getProp('hexColor') } ); this.updateText('playerPoints', { amount: this.player.getProp('points') || 0 }); this.updateText('playerKills', ...
[ "updateTexts() {\n super.updateTexts();\n\n this.updatePlayerTexts();\n this.updateTop5Text();\n }", "function updatePlayerNames() {\n $('#section__player-one').text(`Player One: ${playerOneName}`);\n $('#section__player-two').text(`Player Two: ${playerTwoName}`);\n}", "function updatePlayerInfo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check if the genesis block does not exist already in the Blockchain else add.
checkThenAddGenesisBlock() { let self = this; this.levelDBWrapper.getBlocksCount().then((count) => { if(count == 0) { console.log("Adding GENESIS block"); this.addGenesisBlock(); } else { console.log("Genesis block exists. Not addin...
[ "async _addGenesisBlock() {\n let newBlock = new Block('First block in the chain - Genesis block');\n // Genesis block height.\n newBlock.height = 0;\n // UTC timestamp.\n newBlock.time = new Date().getTime().toString().slice(0, -3);\n // Block hash with SHA256 using newBlock and converting to a s...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
API test for 'EnableSecureNAT', Enable SecureNAT function of the hub
function Test_EnableSecureNAT() { return __awaiter(this, void 0, void 0, function () { var in_rpc_hub, out_rpc_hub; return __generator(this, function (_a) { switch (_a.label) { case 0: console.log("Begin: Test_EnableSecureNAT"); in_...
[ "function Test_DisableSecureNAT() {\n return __awaiter(this, void 0, void 0, function () {\n var in_rpc_hub, out_rpc_hub;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n console.log(\"Begin: Test_DisableSecureNAT\");\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A modified updateGlobalLerpValue to take an object which contains compatable object subtypes (lerp/animatable).
function updateObjectLerp( objectToModify ){ // Perform clamping or bouncing of lerp value. if(objectToModify.animationFloat < 0){ // Snap value back to 0, and set reversing value to false. objectToModify.animationReversing = false; objectToModify.animationFloat = 0; } // END - if global lerp is reversin...
[ "interpolateOneObject(prevObj, nextObj, objId, playPercentage) {\n\n // handle step for this object\n let curObj = this.gameEngine.world.objects[objId];\n if (typeof curObj.interpolate === 'function') {\n\n // update positions with interpolation\n this.gameEngine.trace.tra...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Make a relative URL absolute, based on the current location.
function makeAbsolute(url) { if (url.indexOf("http") !== 0) { var base = location.protocol + "//" + location.host; if (url.indexOf("/") === 0) { return base + url; } else { base += location.pathname; var here = base.substr(0, base.lastIndexOf("/")); return here + "/" + url; } ...
[ "function makeAbsolute(url) {\n var protocols = [\"http\", \"https\", \"chrome-extension\"];\n for (var i = 0; i < protocols.length; i++) {\n if (url.indexOf(protocols[i] + \"://\") === 0) {\n return url;\n }\n }\n \n var base = location.protocol + \"//\" + location.host;\n if (url.indexOf(\"/\") =...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
TODO: Add keyReleased() function to randomize values again on key release
function keyReleased() { x = random(0,width); y = random(0,height); speedX = random(-3,3); speedY = random(-3,3); }
[ "function keyReleased() {\n keysArray[key] = false;\n}", "function keyPressed(){\n\tif(keyCode === ENTER){\n\t\tsampler.add(0,random(0,sampleDur1))\n\t\tsampler.add(1,random(0,sampleDur2))\n\t} else if(keyCode === RIGHT_ARROW){\n\t\tsampler.fracBPM(0,random(20,120),0)\n\t\tsampler.fracBPM(1,random(20,120),0)\n\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Flattens the nested structure returned by `splitDeferredRelayQueries`. Right now our internals discard the information about the relationship between the queries that is encoded in the nested structure.
function flattenSplitRelayQueries(splitQueries) { var flattenedQueries = []; var queue = [splitQueries]; while (queue.length) { splitQueries = queue.shift(); var _splitQueries = splitQueries; var required = _splitQueries.required; var deferred = _splitQueries.deferred; if (required) {...
[ "function flattenSplitRelayQueries(splitQueries) {\n var flattenedQueries = [];\n var queue = [splitQueries];\n while (queue.length) {\n splitQueries = queue.shift();\n var _splitQueries = splitQueries,\n required = _splitQueries.required,\n deferred = _splitQueries.deferred;\n\n if (requi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Verify that an element falls (mostly) in its prefered timeslot
async function preferedTimeslot (element, timeslot) { let outsideTimeslot = false const startTime = store.state.lookup.calculatedTimes[element._id]['start'] const endTime = store.state.lookup.calculatedTimes[element._id]['end'] // ToDo sensible margin? const margin = (endTime - startTime) * 0.2 const cleane...
[ "function checktimeslot() {\n\n\t}", "function is_logically_valid_time_slot(ts){\n\tlet duration = ts.end - ts.start;\n\tif(duration<=0){\n\t\treturn false;\n\t}\n\n\tif(ts.start<0){\n\t\treturn false;\n\t}\n\n\tif(ts.end>24){\n\t\treturn false;\n\t}\n\n\treturn true;\n\n}", "function timeCompare () {\n \n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Renders a template to a container. To update a container with new values, reevaluate the template literal and call `render` with the new result.
function render(result, container, templateFactory = defaultTemplateFactory) { const template = templateFactory(result); let instance = container.__templateInstance; // Repeat render, just call update() if (instance !== undefined && instance.template === template && instance....
[ "function render(result, container) {\n var templateFactory = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultTemplateFactory;\n\n var template = templateFactory(result);\n var instance = container.__templateInstance;\n // Repeat render, just call update()\n if (i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Setup listener on widgetdata which will update (remove/add) classes by comparing newly set classes with the old ones.
function setupDataClassesListener( widget ) { // Note: previousClasses and newClasses may be null! // Tip: for ( cl in null ) is correct. var previousClasses = null; widget.on( 'data', function() { var newClasses = this.data.classes, cl; // When setting new classes one need to remember // that he...
[ "onClassChange() {\n for ( let i = 0; i < this.node.pdomClasses.length; i++ ) {\n const dataObject = this.node.pdomClasses[ i ];\n this.setClassToElement( dataObject.className, dataObject.options );\n }\n }", "_updateClass() {\n toggleClass(this.el, 'active', this.isActive);\n toggleClass(t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Makes request to convert DOM into chronoset
function getChronoSet(downloadType) { if (downloadType === void 0) { downloadType = null; } // get time offset timeOffset = document.getElementById("chronovisor-time-offset").value; var timeOffsetFormat = document.getElementById("chronovisor-time-offset-format").value; timeOffset...
[ "putEventsOnDOM(response) {\n response.sort(function (a, b) {\n let dateA = new Date(a.date), dateB = new Date(b.date)\n return dateA - dateB\n })\n const eventsContainer = document.querySelector(\".contentContainer\")\n let eventsHTML = \"\"\n for (let entry...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Organizes the recorded notes into chords
detectChords(recTrack) { let beatLength = 60000 / metronome.getTempo(); if (recTrack.getNotes().length == 0) return; let endOfChord = undefined; let tempChord; recTrack.getNotes().forEach((item, i) => { //loops through the notes if (endOfChord === undefined) { //first iteration ...
[ "splitChords(noteSeq) {\n let chordList = [];\n let chordsStatus = \"custom\";\n // create variable to check whether chords are detected in the midi file provided\n let hasChords = false;\n // check if noteSeq is empty\n if (noteSeq.notes.length === 0) {\n alert(\n \"There are no notes...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
reloadDisplay() Reloads the display from which the function was called from.
function reloadDisplay() { location.reload(true); }
[ "function reloadDisplay(){\r\n //initSVG();\r\n dataHolder.addDisplay(my.that.getPos(), that);\r\n resetVisuals();\r\n my.update();\r\n }", "function refreshDisplay(){\n env.disp.render() ;\n}", "function refreshDisplay(){\n env.disp.render() ;\n env.plot.render() ;\n}", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return a text selection that spans the given positions or, if they aren't text positions, find a text selection near them. `bias` determines whether the method searches forward (default) or backwards (negative number) first. Will fall back to calling [`Selection.near`]( when the document doesn't contain a valid text po...
static between($anchor, $head, bias) { let dPos = $anchor.pos - $head.pos; if (!bias || dPos) bias = dPos >= 0 ? 1 : -1; if (!$head.parent.inlineContent) { let found2 = Selection.findFrom($head, bias, true) || Selection.findFrom($head, -bias, true); if (found2) $head = found2.$head...
[ "static near($pos, bias = 1) {\n return this.findFrom($pos, bias) || this.findFrom($pos, -bias) || new AllSelection($pos.node(0));\n }", "lineAt(pos, bias = 1) {\n let line = this.state.doc.lineAt(pos);\n let { simulateBreak, simulateDoubleBreak } = this.options;\n if (simulateBreak != nu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return the current world object.
getWorld() { return this.world; }
[ "getWorldObject() {\n return this.worldObj;\n }", "GetWorld() {\n return this.m_world;\n }", "function getWorld() {\n\t\t// the main shelf scope has all the interesting stuff\n\t\tvar scope = angular.element('#shelf').scope() || {};\n\t\tif (scope.world && scope.world._...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Represents a grid of segmented numbers. json_init: JSON // initialization values that come from a JSON file update_init: JSON // initialization values that come from updating the field
function SegNumField(json_init, update_init) { GridField.call(this, json_init, update_init); // Set all segmented number attributes this.field_type = 'int'; // has changed, before it was seg_num this.grid_class = 'num_div'; this.type = 'int'; //has changed, before it was string this.data_uri = "numbers"; thi...
[ "function FormNumField(json_init, update_init) {\n\tFormField.call(this, json_init, update_init);\n\t/* Set all segmented number attributes. */\n\tthis.field_type = 'form_num';\n\t\n\t// set the grid class\n\tthis.grid_class = 'num_div';\n\t\n\t// TODO: find out what these values should actually be\n\tthis.type = '...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Releases all the spells that were added by addSpell(), moving each spell sprite to their respective target. The spell first remains at the sprite of the caster (so people can see who is casting the spell), then it travels to it's target. This function clears spellList.
function releaseSpells(){ if(spellList.length > 0){ //Go through all the spells in the spells group // and tween them to their targets var holdOnCaster; var moveToTarget; for(var index = 0; index < spellList.length; index++){ //get the child, starting at the end of the group // a...
[ "function clearSpells() {\n spellInfo.dc = 0;\n spellInfo.atk = 0;\n spellInfo.cantripsNum = 0;\n spellInfo.cantripsList = [];\n spellInfo.slots = 0;\n spellInfo.spellsNum = 0;\n spellInfo.spellList = [];\n}", "function ActionSkill_ClearTargets(affectCursor) {\n\t\t// Loop through All Targets and remove th...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
sb is a SentientBeing object TODO: say hello prints out (console.log's) hello in the language of the speaker, but returns it in the language of the listener (the sb parameter above). use the 'hello' object at the beginning of this exercise to do the translating
function sayHello (sb) { console.log(hello[this.language]); return (hello[sb.language]); }
[ "function sayHello (sb) {\n // TODO: say hello prints out (console.log's) hello in the\n // language of the speaker, but returns it in the language\n // of the listener (the sb parameter above).\n // use the 'hello' object at the beginning of this exercise\n // to do the translating\n\n console.lo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Shows or hides the flyout
function ShowHideFlyout() { System.Gadget.Flyout.show = !System.Gadget.Flyout.show; }
[ "function hideFlyout() {\n}", "function showFlyout() {\n\tif (System.Gadget.Flyout.document) {\n\t\tif (PageElements.language == 'en') {\n\t\t\tSystem.Gadget.Flyout.document.getElementById(\"advisory\").innerText = Aqi.advisory;\n\t\t}\n\t\telse {\n\t\t\t$(System.Gadget.Flyout.document.getElementById(\"advisory\"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a new, private manager with its own event queue and handlers.
function createManager() { return new PrivateManager(); }
[ "function createManager() {\r\n return new PrivateManager();\r\n}", "_createEventsManager() {\n if (!this._eventsManager) {\n this._eventsManager = new DKTools.EventsManager(this);\n }\n }", "_createEventManager() {\n /**\n * @private\n * @readonly\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Marks a restaurant as favored
static favoritesRestaurant(id) { this.updateRestaurantFavoriteStatus(id, 'is_favorite=true'); }
[ "function markAsFavourite() {\n\tlet restaurantId = parseInt(this.dataset.id);\n\n\tfunction putInStore(bool) {\n\t\t// Update local Database\n\t\tdbPromise\n\t\t\t.then(db => {\n\t\t\t\tlet store = db.transaction('restaurants-store', 'readwrite').objectStore('restaurants-store');\n\t\t\t\treturn store.get(restaura...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Disable "commit" button if there aren't staged files to commit
function _toggleCommitButton(files) { var anyStaged = _.any(files, function (file) { return file.status.indexOf(Git.FILE_STATUS.STAGED) !== -1; }); gitPanel.$panel.find(".git-commit").prop("disabled", !anyStaged); }
[ "function disableCommitButton() {\n\t\tcommitEnabled = false;\n\t}", "function pub_checkModFiles() {\n\n\texec('git diff --name-only', function(err, stdout, stderr) {\n\n\t\tif(err) {\n\t\t\tconsole.error('ERROR', err);\n\t\t\treturn process.exit(1);\n\t\t}\n\n\t\tvar filesToStage = stdout.toString().split('\\n')...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check if we have already passed the next vertex, or if we are close enough to the next vertex to look out for the next turn.
function checkDistanceFromNextVertex() { close = false; var d = currentLatLng.distanceFrom(nextVertex); var b = getBearing(currentLatLng, nextVertex); /* If the bearing of the next vertex is more than 90 degrees away from * the bearing we have been travelling in, we must have passed it alr...
[ "function checkDistanceFromNextVertex() {\n\tclose = false;\n\tvar d = currentLatLng.distanceFrom(nextVertex);\n\tvar b = getBearing(currentLatLng, nextVertex);\n\t// check we haven't passed the vertex already\n\tif (getHeadingDelta(bearing, b) > 90) {\n incrementVertex();\n if (driving) {\n\t\t\tchec...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
ffmpeg only supports encoding certain formats, and some of the detected input formats are not the same as the names used for encoding. Therefore we have to map between detected format and encode format See also ffmpeg formats
function mapFormat(requestedFormat) { switch (requestedFormat) { // These two cmds produce identical output, so we assume that encoding "ipod" means encoding m4a // ffmpeg -i example.aac -c copy OutputFile2.m4a // ffmpeg -i example.aac -c copy -f ipod OutputFile.m4a // See also https://github.com/mifi...
[ "_handleCodecChange (video, audio) {\n const mse = this._mse\n const codecList = [{\n type: MSE.VIDEO,\n codecs: video?.codec\n }, {\n type: MSE.AUDIO,\n codecs: audio?.codec\n }]\n\n codecList.filter(item => !!item.codecs).forEach(({type, codecs}) => {\n const sourceBuffer =...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Calculate the value of checked and halfChecked keys. This should be only run in init or props changed.
function calcCheckedKeys(keys, props) { var checkable = props.checkable, children = props.children, checkStrictly = props.checkStrictly; if (!checkable || !keys) { return null; } // Convert keys to object format var keyProps = void 0; if (Array.isArray(keys)) { // [Legacy] Follow the ...
[ "function calcCheckedKeys(keys, props) {\n var checkable = props.checkable,\n children = props.children,\n checkStrictly = props.checkStrictly;\n\n\n if (!checkable || !keys) {\n return null;\n }\n\n // Convert keys to object format\n var keyProps = void 0;\n if (Array.isArray(keys)) {\n // [L...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
simple function to draw all cylinders based on all established line segments vertices are storred in an array of arrays, where the index is the polyline [(x,y),(x,y)],[(x,y),(x,y)] ]
function drawAllCylinders(gl,canvas,a_Position){ // draw all finished cylinder for (var i =0 ; i < oldlines.length ; i++){ previousFace = [] let tempNormalholder = [] if (oldlines[i].length >= 4){ var loop = (((oldlines[i].length/2)-1)*2) for (var j =0; j < loop;j+=2){ ...
[ "function drawAllCylinders(gl,canvas,a_Position){\r\n // draw all finished cylinder \r\n for (var i =0 ; i < oldlines.length ; i++){ \r\n previousFace = []\r\n let tempNormalholder = []\r\n if (oldlines[i].length >= 4){\r\n var loop = (((oldlines[i].length/2)-1)*2)\r\n for (var j =0; j < lo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Makes the user marker look like it has no direction at all.
_userMarkerNoDir() { if(this._directedIcon) { this._userMarker.setIcon(UserDrawer._userIconNoDir()); } }
[ "function drawMarker(){\n // Remove any previous markers\n if (marker !== null){\n marker.setMap(null);\n }\n marker = new google.maps.Marker({\n position: userLocation,\n map: map,\n icon: {\n path: google.maps.SymbolPath.FORWARD_CLOSED_ARROW,\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Verifica que en el horario actual esten inscritas las complementarias para los cursos que los requieran y que esten las magistrales de los cursos complementarios inscritos.
function verificarHorario(){ var probs = []; for(var i=0,j=horarioActual.cursos.length; i<j; i++){ if(horarioActual.cursos[i] != null){ if(horarioActual.cursos[i].numcompl > 0){ var encontro = false; for(var k=horarioActual.cursos[i].indiceEnResultados+1,l=k+horarioActual.cursos[i].numco...
[ "function bateHorario(turmaTentativa, turmaCadastrada) {\n var coincide = false;\n console.log(\"<Comparando>\");\n console.log(turmaTentativa);\n console.log(turmaCadastrada);\n console.log(\"</Comparando>\");\n for(var j = 0; j < turmaCadastrada.diaHora.length; j++){\n var horarioTurmaCadastrada = conver...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
parseJson :: (Any > Boolean) > String > Maybe a . . Takes a predicate and a string that may or may not be valid JSON, and . returns Just the result of applying `JSON.parse` to the string if the . result satisfies the predicate; Nothing otherwise. . . ```javascript . > S.parseJson (S.is ($.Array ($.Integer))) ('[') . No...
function parseJson(pred) { return B (filter (pred)) (B (eitherToMaybe) (encase (JSON.parse))); }
[ "function parseJSON ()\n {\n skipWhiteSpace();\n\n var c = current();\n\n if (c === 123) // '{'\n return parseObject();\n else if (c === 91) // '['\n return parseArray();\n else if (c === 34) // '\"'\n return parseString();\n else if (c =...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
for a list of files already derived from the named directory, iterate through the list, calling cb with the contents of each file, then calling fcb once they're all processed
function eachfile(dirname, files, cb, fcb) { fn = files.shift(); if (fn) { read_file(dirname, fn, function(cbfname, text) { cb(cbfname, text); eachfile(dirname, files, cb, fcb); }); } else if (fcb) fcb(); }
[ "fileIterator(cb) {\n for (const path in this._index) {\n if (this._index.hasOwnProperty(path)) {\n const dir = this._index[path];\n const files = dir.getListing();\n for (const file of files) {\n const item = ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
stripSuffix :: String > String > Maybe String . . Returns Just the portion of the given string (the second argument) left . after removing the given suffix (the first argument) if the string ends . with the suffix; Nothing otherwise. . . See also [`stripPrefix`](stripPrefix). . . ```javascript . > S.stripSuffix ('.md')...
function stripSuffix(suffix) { return function(s) { var idx = s.length - suffix.length; // value may be negative return s.slice (idx) === suffix ? Just (s.slice (0, idx)) : Nothing; }; }
[ "function stripSuffix(str, suffix) {\n var trimmedStr = str.trim();\n if (trimmedStr.endsWith(suffix)) {\n var endIndex = trimmedStr.length - suffix.length\n return trimmedStr.substring(0, endIndex).trim();\n }\n\n return str;\n}", "function trimSuffix(str, suffix) {\n while (str.endsWith(suffix)) {\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the position of the element as a [ x, y ] tuple
getPosition(_id) { const _elem = this._elements[_id]; let [x, y] = [0, 0]; if (this._isSVGElem(_elem)) { const _rect = _elem.getBoundingClientRect(); [x, y] = [_rect.left, _rect.top]; } else if (_elem) { [x, y] = [_elem.offsetLeft, _elem.offsetTop]; } else { console.w...
[ "function getElementPosition(elt)\n{\n var x = 0;\n var y = 0;\n var currentElt = elt;\n while(currentElt)\n {\n x += currentElt.offsetLeft;\n y += currentElt.offsetTop;\n currentElt = currentElt.offsetParent;\n }\n return [x, y]; \n}", "function getPos(svg, elem) {\n var matrix, position;\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Updates page URL with document id, so you may copy page URL from the browser address bar to open it in a separate window or share it with a friend.
function updatePageUrl() { var path = '/' + site.document.id; if (window.location.pathname !== path) { if (history) history.replaceState(null, null, path); else window.location.replace(path); } }
[ "function updatePageURL(pageId, url) {\n pages[pageId].url = url\n browserEvents.emitPageURL(pageId, url)\n }", "updatePage(id, page) {\n let p = DashboardUtils.findDashboardPageById(this.props.dashboard, id);\n p.id = page.id;\n p.name = page.title;\n this.savePages(t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Initialize the Sonos SVG object with the 6 arcs Followed guidance provided here
function initSonos() { var sonos1arc1 = document.getElementById('living-room-sonos-arc-1'); sonos1arc1.setAttribute("d", describeArc(170, 230, 7, 235, 315)); var sonos1arc2 = document.getElementById('living-room-sonos-arc-2'); sonos1arc2.setAttribute("d", describeArc(170, 230, 7, 45, 135)); var sono...
[ "function SVGShape() {}", "function setupRings() {\r\n main_svg = d3.select(\"#main\").append(\"svg\")\r\n .attr(\"id\", \"svg_container\")\r\n .attr(\"width\", size)\r\n .attr(\"height\", size);\r\n d3.select(\"#category-select\").property(\"value\", category);\r\n d3.select(\"#v1\").property(\"value\", va...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function to open Proposed objective modal
function openProposedObjectiveModal(){ $("#obj-modal-type").val('propose'); setObjectiveModalContent('', '', '', getToday(), 0, 2); showObjectiveModal(true); }
[ "function openAddObjectiveModal(){\t\n\t$(\"#obj-modal-type\").val('add');\n\tsetObjectiveModalContent('', '', '', getToday(), 0, 0);\n\tshowObjectiveModal(true);\n}", "openModal(){\n\n }", "function ventanaModal()\n {\n \n }", "function openModal() {\n client.interface.trigger(\"showModal\", {...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
find main attachment will use the first PDF attachment
function findBookPdfAttachment(attachmentItems){ var fileData=false; for (let attachmentItem of attachmentItems ){ console.debug(`>>> Looking at attachment "${attachmentItem.get('title')}"...`); fileData = attachmentItem.apiObj.links.enclosure; // skip all non-pdf attachmen...
[ "findItemForAttachment(aAttachment) {\n for (let i = 0; i < this.itemCount; i++) {\n let item = this.getItemAtIndex(i);\n if (item.attachment == aAttachment) {\n return item;\n }\n }\n return null;\n }", "function findFirstImage(message) {\n let att;\n message...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Logic for say websocket
function sendSay() { const phrase = (new FormData(say_form)).get("phrase"); const websocket = `${ws_protocol}//${window.location.host}/ws/say`; WebSocketConnect(websocket, phrase); }
[ "function doSend(message){websocket.send(message);}", "outws(uuid, type, message) {\n if (global.hasOwnProperty('frostybot'))\n if (global.frostybot.hasOwnProperty('wss'))\n global.frostybot.wss.emit('proxy', logentry)\n }", "function WebsocketProvider() {}", "function ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a Promise that resolves when the router is configured.
ensureConfigured() { return this._configuredPromise; }
[ "function routerFetcher(): Function {\n let router: Object | void = initialRouter();\n\n /**\n * Returns a promise that resolves to the configured router instance.\n */\n return function fetchRouter(): Promise<Object> {\n /**\n * Resolves the configured router instance if it exists.\n * If not, at...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
findModel is a functio to find the object in the ModelStore by the path in url
function findModel(path, model){ if(!path) return model; path = path.split('/'); if(!path[0]){ path.shift(); } var foundObj = model; path.forEach( pathPart => { foundObj = foundObj.children.filter( o => o.name===pathPart )[0]; }); return foundObj; }
[ "static find(modelId) {\n let model;\n collectionModel.findOne({model_id : modelId} , (error, foundModel) => {\n if (foundModel) {\n model = foundModel;\n }\n });\n return model;\n }", "findmodel(name)\n {\n for (var i=0; i<models.length; i++...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Shows a dialog, which provides the possibility to create a node breakpoint.
function showCreateNodeBreakpointForm(definitionId, nodeId, nodeFrame) { var dialog = $('#create-node-breakpoint-dialog.dialog'); var form = $('form#create-node-breakpoint', dialog); // // set the hidden fields // $("input[name=breakpoint-node-id]", form).val(nodeId); $("input...
[ "show (n, elt, refreshOnly) {\n let self = this;\n if (!elt) elt = Object(__WEBPACK_IMPORTED_MODULE_0__utils_js__[\"e\" /* findDomByDataObj */])(n);\n this.constraintEditor.hide();\n this.currNode = n;\n\n let isroot = ! this.currNode.parent;\n // Make node the data obj for the dialog\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the fitness value for the car at index
getFitness(index) { let newFitness = this.population[index].fitness return newFitness; }
[ "getCarFitness(car) {\n if (car.maxDist < 500) {\n car.distance *= 0.1;\n car.maxDist *= 0.1;\n }\n return car.distance + car.maxDist * 3 + car.lifeCount;\n }", "fitness() {\n for (let i = 0; i < this.size; i++) {\n this.vehicles[i].fitness();\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Run a macro benchmark until our error threshold is low or our MACRO_MAX_TIME expires
function macroBenchmark(t, testItem, complete) { update('status-text', "Running Benchmark..."); var samples = [], sum = 0; var resetPromise = t.reset(), result = { name: t.name }, startTime = new Date().getTime(); var tester = function() { update('progress', "" + samples...
[ "function macroBenchmark(t) {\n return new RSVP.Promise(function (resolve) {\n update(\"status-text\", \"Running Benchmark...\");\n\n var samples = [];\n var sum = 0;\n\n var resetPromise = t.reset();\n var result = { name: t.name };\n var startTime = new Date().getTime();\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This is a function for repositoriesWorkspaceRepoSlugPullrequestsPullRequestIdApprovePost / Approve the specified pull request as the authenticated user.
repositoriesWorkspaceRepoSlugPullrequestsPullRequestIdApprovePost( incomingOptions, cb ) { const Bitbucket = require('./dist'); let defaultClient = Bitbucket.ApiClient.instance; // Configure API key authorization: api_key let api_key = defaultClient.authentications['api_key']; api_key.apiK...
[ "async function handleApproval(context) {\n const {github} = context;\n const pr = context.payload.pull_request;\n\n const isPrerelease = getIsPrerelease(pr.title);\n const isMemberOfFusionOrg = await getIsMemberOfOrg(github, 'fusionjs', pr.user.login);\n if(!(isPrerelease && isMemberOfFusionOrg)) re...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
API test for 'ReadLogFile', Read a log file
function Test_ReadLogFile(filename) { return __awaiter(this, void 0, void 0, function () { var in_rpc_read_log_file, out_rpc_read_log_file; return __generator(this, function (_a) { switch (_a.label) { case 0: console.log("Begin: Test_ReadLogFile"); ...
[ "_readLogFile() {\n\t\tvar self = this;\n\t\tvar theLogs = fs.readFileSync(this.logFile, 'utf8').toString().split('##');\n\t\ttheLogs.shift();\n\t\t// Log to the console\n\t\ttheLogs.forEach(function (log) {\n\t\t\tself.atomToPhotoshopView._sendMessageToConsole(log);\n\t\t});\n\t}", "loadLogFile(logFile) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
show the selecte objected data on viewer
function xcustom_showSelectedObjectDataOnViewer(theObject) { if (theObject) { // console.log(theObject); xcustom_resetAndClosePanelSelectedObjectContent(); $('#xcustom-div-prop-grid').html(xcustom_createSelectedObjectPanelContet(theObject)); $('#xcustom-div-error-grid').html(xcu...
[ "function clickedViewData()\n{\n var connObj = dw.databasePalette.getSelectedNode();\n if (connObj && \n ((connObj.objectType==\"Table\")||\n\t(connObj.objectType==\"View\")))\t\n {\n\tvar objname = connObj.name;\n\tvar connname = connObj.parent.parent.name;\n\tobjname = encodeSQLReference(objname, connname);\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
find the Kth node from the end of the Linked List
findKthNodeFromEnd(k) { var llLength = 0; var currentNode = this.head; // get the length of the linked list // Big O = O(n) where n is the length of the linked list while (currentNode) { currentNode = currentNode.next; llLength++; } // if the k is a larger number than the lengt...
[ "kthFromEnd(k) {\n if (!this.head) {return 'No Head';}\n let current = this.head;\n let llCount = 0;\n while(current.next !== null) {\n llCount++;\n current = current.next;\n }\n let count = 0;\n current = this.head;\n while(current.next !== null) {\n if ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Parse file metadata for submission
parseFileMetadata(allFiles) { let SUMMARY_STATS_FILE_TYPE = "SUMMARY_STATS"; let METADATA_FILE_TYPE = "METADATA"; let SUMMARY_STATS_TEMPLATE_FILE_TYPE = "SUMMARY_STATS_TEMPLATE"; let summaryStatsFileMetadata = {}; let metadataFileMetadata = {}; let summaryStatsTemplateFi...
[ "postParse(filename){\n let info = {};\n\n info.year = filename.substring(0,4);\n info.month = filename.substring(5,7);\n info.day = filename.substring(8,10);\n info.ext = filename.split('.')[1];\n info.title = filename.substring(11).split('.')[0];\n\n return info;\n }", "function processFil...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
defining password function which will be validate here passed as a parameted by the caller method if any error find returning an object with defined error and boolen value.
password(password) { if (password === "") { obj.error = "field should not be empty", obj.boolval = true } else if (password.length < 8) { obj.error = "password length should be minimum 8 characters", obj.boolval = true } e...
[ "function checkPassword(user, password){\n\n}", "function isValidPassword(field) {\r\n\r\n // sets initial value of return variable to false\r\n var validPassword = false;\r\n\r\n /*\r\n gets the value of `pw` in the signup form\r\n removes leading and trailing blank spa...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Group series by axis.
function groupSeriesByAxis(ecModel) { var result = []; var axisList = []; ecModel.eachSeriesByType('boxplot', function (seriesModel) { var baseAxis = seriesModel.getBaseAxis(); var idx = indexOf(axisList, baseAxis); if (idx < 0) { idx = axisList.length; ...
[ "function groupSeriesByAxis(ecModel){var result=[],axisList=[];return ecModel.eachSeriesByType(\"boxplot\",function(seriesModel){var baseAxis=seriesModel.getBaseAxis(),idx=zrUtil.indexOf(axisList,baseAxis);0>idx&&(idx=axisList.length,axisList[idx]=baseAxis,result[idx]={axis:baseAxis,seriesModels:[]}),result[idx].se...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
name: _get_editer desc: return editer with index
function _get_editer(index, isNode) { var my_obj; // if index not number, return hot editer if(! _n(index)) { index = _editer_i; } if(isNode) { my_obj = _editer_nodes[index]; } else { my_obj = _editers[index]; } ...
[ "_getIndex() {}", "getAzeriteEssenceIndex() {\n return __awaiter(this, void 0, void 0, function* () {\n return yield this._handleApiCall(`${this.gameBaseUrlPath}/azerite-essence/index`, 'Error fetching azerite essence index.', this.staticNamespace);\n });\n }", "getIteration(){\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function called on level load. Loads the tilemap from the tileset and initializes audio
loadLevel() { this.level.load.tilemap(this.levelName, this.levelPath, null, Phaser.Tilemap.TILED_JSON); this.level.load.image('tiles', this.tileMapImagePath); this.level.game.load.audio('enemy_dying', 'gameSrc/assets/sounds/enemy_dying.ogg'); this.level.game.load.audio('player_hit', 'gam...
[ "loadMap() {\n const mapData = this.getGameData('map');\n this.load.tilemap(mapData.key, null, mapData.data, Tilemap.TILED_JSON);\n }", "function initEmbeddedMap() {\t\n\tinitMap(); \t\t\t\t\t// Initialize and display the map object\n\tapplyBaseMap(); \t\t\t// Apply the base tiles to the map\n\tgrabData();...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Method :: toggleImageLock Desc :: Handles the image locking functionality
toggleImageLock(details, id) { let images = this.state.imageSpecifications; let image = {} images.map(function (data) { if (details._id === data._id) { image = data; } }) let privacyState = image.isPrivate ? false : true; let imageDetails = { id: image._id, privac...
[ "function switchImageHeightLock() {\r\n\r\n\tif(imageHeightLocked) {\r\n\t\t$(\"#image-previewer\").removeAttr(\"height\");\r\n\t\t$(\"#image-previewer\").attr(\"width\", $(\"#image-previewer-holder\").width() + \"px\");\r\n\r\n\t\timageHeightLocked = false;\r\n\r\n\t\t$(\"#size-lock-icon\").removeClass(\"fa-lock f...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Log data from `drone.stdout` to haibu
function onStdout (data) { data = data.toString(); haibu.emit('drone:stdout', 'info', data, meta); if (!responded) { stdout = stdout.concat(data.split('\n').filter(function (line) { return line.length > 0 })); } }
[ "function onStdout (data) {\n haibu.emit('drone:stdout', 'info', data.toString(), meta);\n }", "fetchAndPipeToStdout () {\n this._client.on('data', (data) => {\n if (!data.args) { return }\n if (parseInt(data.args.substr(0, 2), 16) < 31) { return }\n console.log(this._convertHexToASCII(d...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Prints user selected bots by creating DOMelements.
function printSelectedBots() { state.newGameState.selectedBots.forEach(bot => { let botDiv = document.createElement('div'); botDiv.classList.add('botDiv', bot); let img = document.createElement('img'); img.classList.add('botImg'); img.src = './assets/' + bot + '.svg'; ...
[ "function printSelectBotsCon() {\n let allBots = [\"AverageBert\", \"LowBert\", \"RandomBert\", \"HighBert\", \"DumbBert\", \"SmartBert\"];\n allBots.forEach(bot => {\n let botDiv = document.createElement('div');\n botDiv.classList.add(bot, 'botWidth');\n\n let img = document.createElemen...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Internal: Find a go installation using your Atom config. Deliberately undocumented, as this method is discouraged.
configLocator (options = {}) { let goinstallation = atom.config.get('go-config.goinstallation') let stat = this.statishSync(goinstallation) if (isTruthy(stat)) { let d = goinstallation if (stat.isFile()) { d = path.dirname(goinstallation) } return this.findExecutablesInPath(d...
[ "static getFirstInstallation() {\n if (utils_1.getPlatform() === 'darwin')\n return chromeFinder.darwinFast();\n return chromeFinder[utils_1.getPlatform()]()[0];\n }", "function findInstallPath() {\n const user_home = process.env.HOME || process.env.USERPROFILE;\n if (process.platfor...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Renders accessories images after filtering
function renderFilteredAccessories(id) { let div = document.createElement('div'); accessoriesImages.appendChild(div); let img = document.createElement('img'); img.src = accessoriesArr[id].src; div.appendChild(img); let paragraph = document.createElement('p'); paragraph.innerHTML = `${accessoriesArr...
[ "function filterImages(category) {\n document.querySelector('.gallery_container').innerHTML = '';\n\n imgService.getFilteredImages(category).forEach(function(val, index) {\n let img = imgService.buildImage(val, index);\n document.querySelector('.gallery_container').innerHTML += img;\n });\n}", "...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sends an XHR resource
function sendResource(resource) { resource.initiator = "xhr"; BOOMR.responseEnd(resource); }
[ "function sendResource(resource) {\n resource.initiator = \"xhr\";\n\n BOOMR.responseEnd(resource);\n }", "function sendResource(resource) {\n\t\tresource.initiator = \"xhr\";\n\t\tBOOMR.responseEnd(resource);\n\t}", "function sendRequest(method, url, data) {\r\n\r\n var req = new XMLHttpRequest();\r\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Display DDP explanation dialog
function ddpExplainDialog() { initDialog('ddpExplainDialog'); var dialogHtml = $('#ddpExplainDialog').html(); if (dialogHtml.length > 0) { $('#ddpExplainDialog').dialog('open'); } else { $.get(app_path_webroot+'DynamicDataPull/info.php',{ },function(data) { var json_data = jQuery.parseJSON(data); ...
[ "function explainPuzzle(){\n\tlet ed = display.explanationDisplay;\n\ted.innerHTML = deeDum.selected.explanationDisplay();\n}", "function showContraIndicationsExplanationPopup(nExplanationTagID)\n{\n var msg;\n msg = $('#' + nExplanationTagID).text();\n\n $('#administer-modal')\n .html(msg)\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
checkQueryParam() Update query param
updateQueryParam(paramLayer, paramProperty) { // Get the layer name from the URL let queryString = `layer=${paramLayer}`; // Get the property name (if it exists) from the URL if (paramProperty) { queryString += `&property=${paramProperty}`; ...
[ "checkQueryParam() {\r\n let paramLayer = getParameterByName('layer');\r\n let paramProperty = getParameterByName('property');\r\n\r\n if (paramLayer) {\r\n if (paramProperty) {\r\n this.updateLayer(paramLayer, paramProperty);\r\n } e...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Is the sigle request in the idle state.
function isIdle(request) { return request.kind === "idle"; }
[ "function idle(){\n\t\treturn M.status == 'idle';\n\t}", "isIdle() {\n return this._isActiveIdlePeriod(0);\n }", "function isIdle()\r\n\t{\r\n\t\treturn (transmitQueue.length === 0 && pendingQueue.length === 0);\r\n\t}", "get idle ()\n {\n return this.waiting === this.entities.length;\n }", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Renders the AWS CloudFormation properties of an `AWS::WAFv2::RuleGroup.OrStatement` resource
function cfnRuleGroupOrStatementPropertyToCloudFormation(properties) { if (!cdk.canInspect(properties)) { return properties; } CfnRuleGroup_OrStatementPropertyValidator(properties).assertSuccess(); return { Statements: cdk.listMapper(cfnRuleGroupStatementPropertyToCloudFormation)(propert...
[ "function CfnRuleGroup_OrStatementPropertyValidator(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, b...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
record the compan, show notice if its new
function record_company(company) { if (known_companies[company]) return; //if i've seen it before, stop // -- Show the new company Notification -- // if (start_up === false) { console.log('[ui] this is a new company! ' + company); addshow_notification(build_notification(false, 'Detected a new company "...
[ "function record_company(company){\n\tif(known_companies[company]) return;\t\t\t\t\t\t\t\t\t\t//if i've seen it before, stop\n\t\n\t// -- Show the new company Notification -- //\n\tif(start_up === false){\n\t\tconsole.log('[ui] this is a new company! ' + company);\n\t\taddshow_notification(build_notification(false,...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
+++++++++++++++++++++++++++++++++++++++++++END of variable section++++++++++++++++++++++++++++++++ Preload function Loads Assets and initializes game;
function preload() { managers.Assets.init(); //after assets loaded, invoke init function managers.Assets.loader.addEventListener("complete", init); }
[ "function LoadAssets() {\n LoadSpriteSheets();\n LoadSounds();\n}", "function loadAssets() {\n\t\t//== Interfaces ==//{\n\t\ttitleBg.src = \"assets/titleBg.png\";\n\t\t//}\n\t\t\n\t\t//== World ==//{\n\t\tbackground.src = \"assets/Wall720.png\";\n\t\tTERRAIN_TYPES.BASE.img.src = \"assets/TileSandstone100.png\";...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Saves state in data.json so that if app gets restarted we remember what the last mention we saw was and who we've talked to
function saveState() { var state = JSON.stringify({ interactionsHistory: interactionsHistory, lastMentionId: lastMentionId, lastCycleTime: lastCycleTime, engagementHistory: engagementHistory }); fs.writeFile("data.json", state, (err) => { if (err) { return...
[ "function save_state() {\n\tvar json_state = JSON.stringify(state, null, 2);\n\tvar f = new File(\"state.json\", \"write\");\n\tf.writestring(json_state);\n\tf.close();\n}", "save(state) {\n fs.writeFileSync(this.stateFile, JSON.stringify(state), \"utf8\");\n }", "function saveState() {\n print(\"L...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Once all the data is correctly stored under the data object structure, we update what's needed for the user. Important bits are: The conversation list is repainted If we are on the friends page we update the possible new friend requests and friend list If we are creating a conversation we update the friends that can be...
function update() { // we print the name on the left document.body.querySelector(".configurations span").innerHTML = "Welcome, " + data.user.user; if (data.user.role === "admin") { // if the user is admin, we print the Admin zone button const adminDiv = document.body.querySelector(".admin-zone"); if...
[ "function updateChatAndLists(msg) {\n var numberOfTrip = 0, numberOfMyTrip = 0;\n var data = JSON.parse(msg.data);\n\n id(\"myName\").innerHTML = \"\";\n insert(\"myName\", \"<li>\" + data.myName + \"</li>\");\n\n if (data.userMessage != null) {\n insert(\"chat\", data.userMessage);\n }\n\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Try to authenticate using refresh token
function authWithRefreshToken() { if (Alloy.Globals.checkConnection()) { var xhr = Titanium.Network.createHTTPClient(); xhr.onerror = function(e) { Ti.API.error('Bad Sever reAuth =>' + JSON.stringify(e)); indicator.closeIndicator(); refreshTry = 0; isS...
[ "handleRefreshToken() {\n let token;\n try {\n token = jwt.verify(this.request.body.refresh_token, config.jwtSecret);\n } catch (e) {\n return Lib.replyWithError(this.response, \"invalid_token\", 401, e.message);\n }\n\n if (token.auth_error == \"token_expire...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the global theme registry
function setRegistry(registry) { global[GLOBAL_THEME_REGISTRY] = registry; }
[ "function setTheme() {\n\tconst elementList = document.getElementsByTagName(\"*\");\n\tfor (var i = 0; i < elementList.length; i++) {\n\t\tvar elem = elementList[i];\n\t\tavailThemes.forEach(aTheme => elem.classList.remove(aTheme));\n\t\telem.classList.add(currentTheme);\n\t}\n}", "_setTheme() {\n document.doc...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }