query
stringlengths
9
34k
document
stringlengths
8
5.39M
negatives
listlengths
19
20
metadata
dict
\ Function:jDPBuildDisks Build Date:2006080 Written by:Richard Campbell Inputs:oXD XML DOM containing variables and partition specification Outputs: Description: Using the answer files created in jDPValidateAndBuildAF function and the directories defineded in the partition specification partition, format, and create di...
function jDPBuildDisks(oXD) { var oFS = new ActiveXObject("Scripting.FileSystemObject"); var fdAnswerFiles; var strDiskFormatSFName, strDiskPartAF; var aoDisksInfo; var oXNListPartSpec, oXNListDirectories, oXNode; var strOSBuildNum = jHelpGetOSBuildNum(); //SET FILENAME...
[ "function jDPValidateAndBuildAF(oXD)\r\n {\r\n var oFS = new ActiveXObject(\"Scripting.FileSystemObject\");\r\n\r\n var strTempDPFileName; \r\n\r\n var aoDisksInfo;\r\n\r\n var oXNListPartSpec, oXNodeSize, oXNodeLetter;\r\n var iSize, iLargestDriveSize, lTotalSize, lTotalSpecSize, iSizeUndefinedPart...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sends a message to background to start tracking time
function startTrackingTime() { if (isTrackingTime) return; // if we're already tracking time then do nothing isTrackingTime = true; // chrome.runtime.sendMessage({action: 'startTrackingTime'}, function(response) {}); trackingTimePort.postMessage({action: 'START_TRACKING_TIME'}); // console.log('start tracking...
[ "function trackTime() {\n // TODO functionality to track time\n MonitorController.messsageFinished();\n}", "function startTimer() {\n\tchrome.runtime.sendMessage({\n\t\t\"command\": \"startTimer\"\n\t}, function(response) {\n\t\tconsole.log(response.message);\n\t});\n}", "function start() {\n new CronJob(\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
new Server() creates a new ws server and starts listening for new connections Events: listening(), close(), error(err), connection(conn) secure is a boolean that indicates if it should use tls options is an object to be passed to net.createServer() or tls.createServer() callback is a function that will be added as "con...
function Server(secure, options, callback) { var that = this if (typeof options == "function") { callback = options options = undefined } var onConnection = function (socket) { var conn = new Connection(socket, that, function () { that.connections.push(conn) conn.removeListener("error", nop) that...
[ "function Server(options){\n this.options = mixin({\n debug: false, // Boolean: Show debug information.\n version: \"auto\", // String: Value must be either: draft75, draft76, auto\n origin: \"*\", // String, Array: A match for a valid connection origin\n subprotocol:...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
createInitialGrid: populates two cells on the grid with 2's
createInitialGrid() { let gridArray = []; for(let row = 0; row < this.gridData.getSize(); row++){ for(let col = 0; col < this.gridData.getSize(); col++){ let cell = new Cell(row, col); gridArray.push(cell); } } this._setInitialValu...
[ "function initGrid() {\n columns = Math.ceil( canvas.width / (gridCellSize+gridCellOutlineSize) );\n rows = Math.ceil( (canvas.height-textHeight) / (gridCellSize+gridCellOutlineSize) );\n for(var x=0; x<columns; x++) {\n\t grid[x] = [];\n\t for(var y=0; y<rows; y++) {\n\t\t grid[x][y] = new gridCell(x,y);\n\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
define callback function for clicking on tile
function click_tile_callback(tile_info){ console.log('tile callback'); console.log('clicking on ' + tile_info.row + ' row and ' + tile_info.col + ' col with value ' + String(tile_info.value)) }
[ "function tileClicked(event) {\n\tselectTile(event.target);\n}", "function tile_tap(event) { root.tile_tap(event.currentTarget.id) }", "function tileClick() {\n\tmoveOneTile(this);\n}", "function clickTile() {\n let tileId = this.getAttribute(\"data-id\");\n let image = this.getAttribute(\"src\");\n let ti...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the dbxrefs object Used to map CURIE resolvable Web URLs
setDBXrefs(dbxrefs) { this.dbxrefs = dbxrefs; }
[ "getDBXrefs() {\n return this.dbxrefs;\n }", "function DbRef( ref, id ) {\n this._bsontype = 'DbRef';\n this.$ref = ref;\n this.$id = id;\n}", "function initRefs() {\n this.$refs = {};\n\n let refs = this.$rawRefData;\n if (typeof refs === 'function') {\n refs = refs();\n }...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
initialize the base attributes of pagination : pageLimit :max num of items per page itemsCount :total number of movies to be divided over pages pageNeighbours : num of page numbers beside current page (right & left) totaPages : number of pages for all movies finally , set current page to 1 as state
constructor(props) { super(props); const { itemsCount = null, pageLimit = 10, pageNeighbours = 0 } = props; this.pageLimit = typeof pageLimit === "number" ? pageLimit : 10; this.itemsCount = typeof itemsCount === "number" ? itemsCount : 0; // pageNeighbours can be: 0, 1 or 2 this.pageNeighbours ...
[ "function initPagination() {\n ctrl.page = {\n number: ctrl.page.number || 0,\n size: 10\n };\n }", "initPagination() {\n\t\tthis.paginationPage = 1;\n\t\tthis.$rootScope.paginationPage = this.paginationPage;\n\t\tthis.paginationStep = 6;\n\t\tthis.pagina...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Displaying full Html msg after clicking on Html button
function showHtmlMsg() { msg.innerText = '' disableButton() message.style.display = 'none' innerMsg.style.display = 'block' // var htmlmsg = document.createElement('p') msg.innerText = "HTML stands for Hyper Text Markup Language. HTML describes the structure of a Web page." innerMsg.a...
[ "function messageButtonClicked(e)\n{\n\tif (!e) e = window.event; \n\tvar obj = e.srcElement;\n\tif(!obj) obj = e.target;\n\n\tif (!obj.id) return;\n\n\tvar msgDiv = document.getElementById(obj.id + 'Div');\n\t\n\tif (obj.value == 'show Logs') // currently hidden, we have to show\n\t{\n\t\tmsgDiv.style.display = ''...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
PERSIAN_TO_JD Determine Julian day from Persian date
function p2j(year, month, day) { var epbase, epyear; epbase = year - (year >= 0 ? 474 : 473); epyear = 474 + mod(epbase, 2820); return day + (month <= 7 ? (month - 1) * 31 : (month - 1) * 30 + 6) + $floor((epyear * 682 - 110) / 2816) + (epyear - 1) * 365 + $floor(epbase / 2820) * 1029983 + (PE - 1); } // JD_TO...
[ "static persianToJulian(year, month, day) {\n const epbase = year - ((year >= 0) ? 474 : 473);\n const epyear = 474 + mod(epbase, 2820);\n\n return day\n + ((month <= 7)\n ? ((month - 1) * 31)\n : (((month - 1) * 30) + 6)\n )\n + Math.floor(((epyear * 682) - 110) / 2816)\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the definition expression on the lot layer to reflect the selecction of the user This is activated, only when station is updated in the dropdown list (not priority)
function setLotMunicipalOnlyExpression(newValue) { if (newValue === 'None') { compensationLayer.definitionExpression = null; treeCuttingLayer.definitionExpression = null; conservationLayer.definitionExpression = null; } else { compensationLayer.definitionExpression = "CP = '" + newValue + "'"; treeCuttingLayer.defini...
[ "function setMunicipalExpression() {\nvar municipal = municipalSelect.options[municipalSelect.selectedIndex].value;\n\nif (municipal == 'None') {\nlotLayer.definitionExpression = null;\nstructureLayer.definitionExpression = null;\npriorityLayer.definitionExpression = null;\n\n} else {\nlotLayer.definitionExpression...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Parse DNS Header (given the IP payload)
function parseDNSHeader(view) { //message ID is the first Byte var headers = { messageID: view.getUint16(0, false) }; //flags are the 3rd-4th bytes var flags = view.getUint16(2, false); headers.qr = (flags & 0x8000) >>> 15; headers.opcode = (flags & 0x7800) >>> 11; headers.aa = (flags & 0x400)...
[ "static parse(name_addr_header){name_addr_header=Grammar.parse(name_addr_header,'Name_Addr_Header');if(name_addr_header!==-1){return name_addr_header;}else{return undefined;}}", "function nameAddrHeaderParse(nameAddrHeader) {\n var parsedNameAddrHeader = Grammar.parse(nameAddrHeader, \"Name_Addr_Header\");...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the parameters that will be sent to the php script msgNo, username, msg
function getParams(msg) { return "msgNo=" + g.msgNo + "&username=" + g.chatName + "&msg=" + msg; }
[ "function getParameters() {\n ScriptBase.GetParameters(['custscript_consol_inv_parentid']);\n ScriptBase.GetParameters(['custscript_consol_inv_sender']);\n ScriptBase.GetParameters(['custscript_consol_inv_recips']);\n ScriptBase.GetParameters(['custscript_consol_inv_logourl']);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function for updating the shipping cost
function updateShipping(shipping, free) { // retrieve the subtotal text and strip the $ sign from it. let subTotal = $('#subtotal').text().split('$')[1]; let shippingCost = 0; // call the getFrames function to retrieve the frames value. ...
[ "updateTotalToPay() {\n this.totalToPay = this.subtotal + this.deliveryCost;\n }", "function updateDeliveryCost(product, delivery) {\n\n const deliveryCostInput = document.getElementById(product + '-cost');\n let deliveryCost = deliveryCostInput.innerText;\n if (delivery) {\n deliveryCost = 0;...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Draw a triangular hiring event on the timeline
function drawHiringEvent() { drawHiringRect(); //NOT DONE }
[ "function drawTrail() {\n background(R,G,B);\n p1.updateHistory(mouseX, mouseY);\n p1.display();\n fill(0);\n stroke(0);\n textSize(14);\n text(\"Click once to change color randomly.\", 10, 25);\n text(\"Click twice to change color to black and white.\", 10, 43);\n}", "function storyLine(){\n\t \n\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Q4 Write a function called `greaterThan` that takes two parameters and returns `true` if the second parameter is greater than the first. Otherwise the function should return `false`.
function greaterThan(par1, par2) { if (par2 > par1) { true; } else { false; } }
[ "function greaterThan (a, b) {\n if (b > a) {\n return (true);\n} else{\n return (false);\n}\n}", "function greaterThan(param1,param2) {\n return param2>param1;\n}", "function greaterThan(a, b) {\n if (b > a) {\n return true\n }\n return false\n}", "function greaterThan(a,b) \n{\n if (b > a) \n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Generates a function to bind the "common" element events to an event handler.
__bindCommonEvents(lead) { const chart = this; return function(sel) { EV.INTERACTION_EVENTS.forEach((ev) => sel.on(ev, (d, i, nodes) => chart.__elemEvent(ev, `${lead}:${ev}`, d, i, nodes))); }; }
[ "function bindEventToAll(nodeList, eventHandler){\n nodeList.forEach(function(element, index){\n element.onclick = eventHandler;\n });\n}", "function bindEvents() {}", "function initEventHandlers(){\n eventHandlers.forEach( bindHandlersForElement );\n\n function bindHandlersForElement( nodeSelector, hand...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
returns nodes of current graph
function getNodes() { return d3.selectAll('g .node'); }
[ "function getNodes() {\n\t\treturn nodes;\n\t}", "nodes() {\n var n, results;\n n = this;\n results = [];\n while (!(n = n.next()).isEmpty()) {\n results.push(n.node);\n }\n return results;\n }", "getNodes() {\n return d3.selectAll(\".\"+this.model....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
We don't have a config, so either we use raw args to try to commit or if debug is enabled then we do a strict check for a config file.
function withoutConfig(rawGitArgs, environment) { if(environment.debug === true) { console.error('COMMITIZEN DEBUG: No git-cz friendly config was detected. I looked for .czrc, .cz.json, or czConfig in package.json.'); } else { var vanillaGitArgs = ["commit"].concat(rawGitArgs); var child = child_proces...
[ "function validateConfigSpecified() {\n if (!configName) {\n logger.error('You must specify a --config flag');\n process.exit(0);\n } else if (!config.configExists(configName)) {\n logger.error(`The config [${configName}] does not exist in your config file.`);\n process.exit(0);\n }\n}", "function ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
API test for 'EnumDHCP', Enumerate DHCP entries
function Test_EnumDHCP() { return __awaiter(this, void 0, void 0, function () { var in_rpc_enum_dhcp, out_rpc_enum_dhcp; return __generator(this, function (_a) { switch (_a.label) { case 0: console.log("Begin: Test_EnumDHCP"); in_rp...
[ "function Test_EnumEthernet() {\n return __awaiter(this, void 0, void 0, function () {\n var out_rpc_enum_eth;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n console.log(\"Begin: Test_EnumEthernet\");\n re...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Commit the client list to the stage
SET_CLIENTS( state, clients ) { state.clients = clients }
[ "function saveComplete() {\n createClientJoblist();\n }", "function commitBlockList() {\n var uri = submitUri + \"&comp=blocklist\";\n var requestBody = getCommitRequestBody();\n\n $.ajax({\n url: uri,\n type: \"PUT\",\n headers: { \"x-ms-blob-conten...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
checkForClickedTiles // Function: // Uses mouse position to detect which // tile was selected // Return value: // //
checkForClickedTiles(xoffset, yoffset) { var adjusted_mouse_position = {x: xoffset, y: yoffset}; var bFoundObject = false; for (var i = 0; i < this.component_list.length; i++) { var elem = this.component_list[i]; if (elem instanceof Entity) { ...
[ "function mouseClicked() {\n\n buttonSystem()\n\n if (pantalla === 6 && contadorOn === true) {\n checkSelected(tilesN1)\n }\n\n if (pantalla === 4 && contadorOn === true) {\n checkSelected(tilesN2)\n }\n\n if (pantalla === 8 && contadorOn === true) {\n checkSelected(tilesN3)\n }\n}", "function ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a copy of the meshes at the level index.
function getMeshes(index) { var send = []; //Copy of meshes to send for(var i = 0; i < levels[index].meshes.length; i++) { send.push(levels[index].meshes[i].get()); } return send; }
[ "clone() {\n var verts_length = this.verts.length;\n var faces_length = this.faces.length;\n var verts_array = [];\n var faces_array = [];\n for (var i = 0; i < verts_length; i++) {\n var result = [];\n result.push(add(vec4(1, 1, 1, 1), this.verts[i].pos));\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
An Item instance maps some properties of an text item from PDFJS
function Item(item) { if (item) { var str = item.str, width = item.width, fontName = item.fontName; var _item$transform = slicedToArray(item.transform, 6), height = _item$transform[3], left = _item$transform[4], bottom = _item$transform[5]; this.fontName = fontNam...
[ "static mapItem(item) {\n const map = {\n contents: item.contents.S,\n hmac: (item.hmac.B ? item.hmac.B.toString() : item.hmac.S),\n key: item.key.S,\n digest: item.digest.S\n };\n \n return map;\n }", "injectItem(item) {\n this._item =...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
returns a random pastel color
function randomColor(){ var hue = Math.floor(Math.random() * 360); var l = Math.random() * 15 + 70; var pastel = 'hsl(' + hue + ', 100%, ' + l + '%)'; return pastel; }
[ "function getRandomPastelColor() {\n return (\n \"hsl(\" +\n 360 * Math.random() +\n \",\" +\n (25 + 70 * Math.random()) +\n \"%,\" +\n (85 + 10 * Math.random()) +\n \"%)\"\n );\n}", "function randomColor(){\n let red = Math.floor(Math.random()*64 + 192);\n let blue = Math.floor(Math.rand...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function to test Arduino connection and launch watering program
function arduinoReady(err) { if (err) { console.log(err); return; } console.log('Firmware: ' + board.firmware.name + '-' + board.firmware.version.major + '.' + board.firmware.version.minor); /* * Setting up pins */ board.pinMode(ledPinL, board.MODES.OUTPUT); board.pinMo...
[ "function ardCon(){\n console.log(\"Connected to the Arduino. LISTEN UP\");\n}", "function main() {\n board.reset();\n board.bootSounds();\n //board.motorCheck();\n board.openDamper();\n monitorTemperature();\n \n events.on(\"start-alarm\", alarm);\n}", "function connectToArduino(arduinoCom) {\n /...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
set account's children in accountInfo to list of all descendants
function storeChildrenIds(node, accountInfo) { // compile list of children ids (all levels deep, all descendants) function getChildrenIds(node) { var childrenIds = [node.id]; function traverse(currentNode) { currentNode.children.forEach(function(child) { childrenIds.push(ch...
[ "async function getAllAccounts(account) {\n let subAccounts = await canvas.get(`/api/v1/accounts/${account.id}/sub_accounts`);\n // if there are subaccounts in the just-fetched account, then recurse again throught its subaccounts\n if (subAccounts.length > 0) {\n // send the accounts...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Rotates grid by 90 degrees.
function rotateGrid() { grid.style.transform = 'rotate('+ angle +'deg)'; angle += 90; }
[ "function rotateGrid(axisToRotate) {\n axes.rotation[axisToRotate] += 0.01;\n}", "function rotateClockwise() {\n\tif (area.height != area.width) {\n\t\talert(\"This function only supports square grids at this moment.\");\n\n\t\tif (area.tool == 10)\n\t\t\ttoggleTool(10);\n\n\t\treturn;\n\t}\n\n\tvar copy = _.c...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks to see if the navigator.userAgent contains "silk" in the string and returns true or false.
function getIsKindle( ua ) { if( /\bsilk\b/.test(ua) ) { return true; } return false; }
[ "function IsInUserAgent(str){\n\t\tif (StringIsNullOrWhiteSpace(str)) return false;\n\t\tvar regEx = new RegExp(\"(\" + str + \")\", 'i');\n\t\treturn regEx.test(navigator.userAgent);\n\t}", "function isSKU(str) {return /^\\w+$/i.test(str)||str==\"\";}", "function testUserAgent(substr) {\n\treturn navigator.use...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Queries Datastore for available interview times and renders them on the page.
function loadInterviews() { const searchResultsDiv = document.getElementById('search-results'); searchResultsDiv.removeAttribute('hidden'); const role = selectedRole(); let servlet = ''; if (role === 'Interviewee') { servlet = 'load-interviews'; } else if (role === 'Shadow') { servlet = 'shadow-load...
[ "function overview() {\n var eventsDB = Db.shared.get('events');\n \n // getting the times, starting by most recent time\n var times = Object.keys(eventsDB);\n times.reverse();\n \n // and render for each day the time\n Dom.div(function () {\n Dom.style({\n textAlign: 'center',\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
| rand:float returns random float | | min:number minimum value | max:number maximum value | ease:function easing function to apply to the random value | | Get a random float between two values, | with the option of easing bias.
static rand(min, max, ease) { if(max === undefined) { max = min; min = 0; } let random = Math.random(); if(ease) { random = ease(Math.random(), 0, 1, 1); } return random * (max - min) + min; }
[ "function randFloat(min, max) {\n return Math.random() * (max - min) + min;\n}", "function randomFloatBetween(minValue,maxValue)\n{\n return parseFloat(Math.min(minValue + (Math.random() * (maxValue - minValue)),maxValue));\n}", "function getRandomFloat(min, max) {\n return (Math.random() * (max - min)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Move. Need to get create and delete to work Then you can use that those commands for this.
function move(from, to) { }
[ "move() {\n this.emit('before-move', this)\n return move(`node_modules/${this.name}`, `node_modules/${this.name}.moved`)\n .then(res => {\n this.emit('after-move', this, res)\n return this\n })\n .catch(() => this)\n }", "static move(options) {\n FileSystem._wrapExceptio...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add the flash message to response locals
function addFlashMessagesToLocals(req, res, next) { res.locals.error = req.flash("error"); res.locals.success = req.flash("success"); res.locals.info = req.flash("info"); next(); }
[ "function flashMessages(req, res, next) {\n var flashMessages = {\n info: req.flash('info'),\n success: req.flash('success'),\n warning: req.flash('warning'),\n error: req.flash('error')\n };\n res.locals.messages = _['any'](flashMessages, function (msgs) {\n return msgs....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Remove the context at the root of the stack
_exitContext() { this._stack.pop(); }
[ "popContext() {\n this._stack.pop();\n }", "function exitCtx() {\n ctxStack.pop();\n }", "function pop(){\t\n\tcontext.restore();\n}", "static popDefaultContext() {\n\t\tDEFAULT_CONTEXT_.pop();\n\t}", "clearCurrentTrace() {\n if (this.contextManager.active) {\n this.context...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Resets the turtle's position to the origin and its orientation to the Y axis Clears the state stack
clear() { this.state = new TurtleState(new THREE.Vector3(0,0,0), new THREE.Vector3(0,1,0)); stateStack = []; }
[ "function reset(){\n turtle['ctr_x'] = 125;\n turtle['ctr_y'] = 130;\n turtle['x'] = 100;\n turtle['y'] = 100;\n visited = [];\n dr = 0;\n eggs = [];\n draw();\n }", "function resetTurtle...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Whether need to call `convertEC4CompatibleStyle`.
function isEC4CompatibleStyle(style, elType, hasOwnTextContentOption, hasOwnTextConfig) { // Since echarts5, `RectText` is separated from its host element and style.text // does not exist any more. The compat work brings some extra burden on performance. // So we provide: // `legacy: true` f...
[ "function isEC4CompatibleStyle(style, elType, hasOwnTextContentOption, hasOwnTextConfig) {\n // Since echarts5, `RectText` is separated from its host element and style.text\n // does not exist any more. The compat work brings some extra burden on performance.\n // So we provide:\n // `legacy: true` force make c...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Calclate the difference between d and now, express as "n units ago"
function ago( d ) { var diff = ( ( new Date() ).getTime() - d.getTime() )/1000; function pluralize( value, unit ) { return value + " " + unit + ( value > 1 ? "s" : "") + " ago"; } if ( diff < 60 ) { return pluralize( round( diff ), "second" ); } diff /= 60; i...
[ "function delta() {\n // get date right now\n var now = Date.now();\n //get time passed by subtracting offset from now(we get from below this.start function) \n var timePassed = now - offset;\n // added this so that the next time the function is run it starts at correct spot\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a manifest of all static assets to be served via router.static
getStaticAssetManifest() { return RouteGroup_1.staticAssetManifest; }
[ "function getAssets () {\n var jsFiles = fs.readdirSync(path.join(paths.appBuild, 'static/js'))\n .filter(file => path.extname(file) === '.js')\n .map(file => path.join('static/js/', file))\n\n var cssFiles = fs.readdirSync(path.join(paths.appBuild, 'static/css'))\n .filter(file => path.extname(file) ===...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the cursor to the last task, if any exists.
function setCursorToLastTask(shouldScroll) { const tasks = getTasks(); if (tasks.length > 0) { setCursor(tasks[tasks.length - 1], shouldScroll); } }
[ "function backtrack() {\n cursor = savedCursor;\n}", "_resetCursors() {\n this._taskCursor = '';\n this._eventsCursor = '';\n }", "function setCursorToFirstTask(shouldScroll) {\n const tasks = getTasks();\n if (tasks.length > 0) {\n setCursor(tasks[0], shouldScroll);\n }\n }", "function...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Derives a shared secret from the given secret key and public key.
function deriveSharedKey (keypair, pubkey) { const secretX = keypair .derive(secp256k1.keyFromPublic(pubkey).getPublic()) .toArray('be') // From NIST.SP.800-56Ar2 section 5.8.1: return hmacSha256([0, 0, 0, 1, ...secretX], utf8.parse('dataKey')) }
[ "shared_secret(public_key) {\n const shared_secret = sodium.crypto_scalarmult(this.sec_curve, public_key.pub_curve);\n ArrayUtil.assert_is_not_zeros(shared_secret);\n return shared_secret;\n }", "function sharedKey(nSecret, publicKey, p) {\n p = p || P_NIST;\n\n var rawS = bignum(publicK...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
can hide if I my parent is an object
canHide() { return this.parent ? true : false; }
[ "function showHideParent()\n{\n if (F.OBJECT_LEVEL.read() == '1' || F.OBJECT_LEVEL.read() == '')\n {\n F.OBJECT_PARENT.makeNotRequired().hide();\n }\n else\n {\n F.OBJECT_PARENT.makeRequired().show();\n }\n}", "function hide(obj) {\n var theObj = getObject(obj);\n if (theObj) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
onSelectionChanged Handler for the MeetingList onSelectionChanged callback. Adds special handling when the selection is "changed" to the current selection to reload all metric datasets.
onSelectionChanged(meeting) { const currentSelectedMeeting = this.props.selectedMeeting; this.props.onSelectionChanged(meeting); if (meeting === currentSelectedMeeting) { this.props.loadMetricDatasets(); } }
[ "selectableMetricsChanged_() {\n // By default show the first available metric series.\n this.selectedMetrics_ = this.metrics.slice(0, 1);\n }", "function FGDepartList_SelectionChanged(sender, args) {\n SetDepartSelectedData();\n}", "itemSelectionChanged() {\n this.selectionHelper.setItemSelect...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Load the color select with PureWeb known colors note that the color names need to be camelcased because this is the format the service application expects them in
function initializeColorSelect() { var camelCase = function(name) { name = '_' + name; return name.toLowerCase().replace(/_(.)/g, function(match, group) { return group.toUpperCase(); }); }; var colorSelect = document.getElementById('color'); for (var color in purewe...
[ "function init_inpt_formulario_cargar_categoria_color() {\n var selectColor = mdc.select.MDCSelect.attachTo(document.querySelector('#slc-color'));\n\n selectColor.listen('MDCSelect:change', () => {\n var indexOfChild = selectColor.foundation_.selectedIndex_ + 1;\n var liSelected = $(\"#slc-color...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
generates province's checkbox inputs and date inputs for filtering the timelapse chart
function generateFilterInputs() { //get filters info from local storage const filters = getFilters(); const inputsContainer = d3.select("#provinces-picker-div-container"); columnNames.forEach(function(n, i) { inputsContainer .append("input") .attr("type", "checkbox") .attr("id", "p...
[ "checkboxFilterSelection() {\n const housingTypeSelection = $('[name=\"housing_type\"]').map(() => [this.checked]);\n this.HousingTypeFilter.setFilter(\n housingTypeSelection[0], // Family\n housingTypeSelection[1], // Senior\n housingTypeSelection[2], // Student (Not Used {default: false})\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sort Functions Filters the provided list of subsets to include only those of length >0. If no list of subsets is provided the global list is used.
function getFilteredSubSets(subSetsToFilter){if(!subSetsToFilter){subSetsToFilter=subSets;}if(!UpSetState.hideEmpties){return subSetsToFilter.slice(0);}var filteredSubSets=[];for(var i=0;i<subSetsToFilter.length;i++){if(subSetsToFilter[i].items.length>0){filteredSubSets.push(subSetsToFilter[i]);}}return filteredSubSets...
[ "function getFilteredSubSets(subSetsToFilter) {\n if (!subSetsToFilter) {\n subSetsToFilter = subSets;\n }\n if (!UpSetState.hideEmpties) {\n return subSetsToFilter.slice(0);\n }\n var filteredSubSets = []\n for (var i = 0; i < subSetsToFilter.length; i++) {\n if (subSetsToFil...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Switchs the status of all bricks to on.
function resetBricks () { for (var c = 0; c < store.state.brickColumnCount; c++) { for (var r = 0; r < store.state.brickRowCount; r++) { store.state.bricks[c][r].status = 1; } } }
[ "function showAllBricks() {\n bricks.forEach((c) => {\n c.forEach((br) => (br.visible = true));\n });\n}", "function turn_all_lights_on()\n{\n\tfor (row = 0; row < switchboard_rows; row++)\n\t{\n\t\tfor (column = 0; column < switchboard_columns; column++)\n\t\t{\n\t\t\tvar element_name = \"#circle_\" + colum...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
home page animations for large screen devices
function large_screen_home_anims() { var last_visited = sessionStorage.getItem("last_page"); sessionStorage.setItem("last_page", "home"); if (!last_visited) { $('#nav_bar').animate({width: '100%'}, 500); $('#nav_list').animate({opacity: '1'}, 2500); //high duration to offset 0 to 1 speed $('#portfolio_ma...
[ "function homePageAnimations() {\n\t\tconst fadeInUp = document.querySelectorAll('.fadeinup span');\n\t\tTweenMax.staggerFrom(fadeInUp, .4, {opacity:0, ease:Power2.easeIn, delay:.2}, .1);\n\t\tTweenMax.from(scrollText, .4, {opacity:0, ease:Power2.easeIn, delay:.6});\n\n\t\tconst fernLeaves = document.querySelectorA...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Allows you to hoist methods, except those in an exclusion set from a source object into a destination object.
function hoistMethods( // tslint:disable-next-line:no-any destination, // tslint:disable-next-line:no-any source, exclusions) { if (exclusions === void 0) { exclusions = REACT_LIFECYCLE_EXCLUSIONS; } var hoisted = []; var _loop_1 = function (methodName) { if (typeof source[methodName] === '...
[ "function hoistMethods(destination, source, exclusions) {\n\t if (exclusions === void 0) { exclusions = REACT_LIFECYCLE_EXCLUSIONS; }\n\t var hoisted = [];\n\t var _loop_1 = function (methodName) {\n\t if (typeof source[methodName] === 'function' &&\n\t destination[methodName] === undefin...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Converts a size string to a number which is size in bytes, eg. string = "123 MB", "5.5GB", etc. Returns null or the size in bytes
function convertByteSizeString(s) { if (s === undefined || s === null) return null; var ary = s.match(/^\s*([\d\.,]+)\s*(\w+)?\s*$/); if (!ary) return null; var amountStr = ary[1].replace(/,/g, ""); var sizePrefix = (ary[2] === undefined ? "B" : ary[2]).toUpperCase(); var mult; if (sizePrefix === "B") mul...
[ "function parseSize(size) {\n\tvar m = size.toLowerCase().match(/^(\\d+)\\s*(k|m|g)b?$/);\n\tif (!m) return log('Invalid size: ' + size);\n\tvar n = Number(m[1])\n\t\t, unit = m[2];\n\tswitch (unit) {\n\t\tcase 'k': return n;\n\t\tcase 'm': return n * 1024;\n\t\tcase 'g': return n * 1024 * 1024;\n\t}\n}", "functi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates DOM elements from a string representation buildDom
function buildDom(htmlString) { //tempDiv lo creamos para tener un elemento HTML (div) sobre el que transformar //nuestro string (htmlString) a formato HTML usando innerHTML //los strings que contengan el HTML deven tener UN SOLO ELEMENTO PADRE const tempDiv = document.createElement("div"); tempDiv.innerHTML ...
[ "function buildDom(htmlString) {\n const div = document.createElement(\"div\");\n div.innerHTML = htmlString;\n return div.children[0];\n}", "function stringToDom (string) {\n const template = document.createElement('template');\n template.innerHTML = string.trim();\n return template.content.firstChil...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
row click set data to update or delete
function rowClick(index){ $("#host").val($("#host_"+index).text()); $("#outageStart").val($("#outageStart_"+index).text()); $("#outageEnd").val($("#outageEnd_"+index).text()) $("#port").val($("#port_"+index).text()); $("#id").val($("#id_"+index).val()) $('#save').attr("disabled", true); $('#update'...
[ "function createUpdateClick(row, json) {\n\trow.onclick = function (event) {\n\t\tupdateRender(json, event);\n\t};\n}", "function abreModalEditarOferta(row, data) {\n $(row).children('td').eq(0).click(function(event) {\n $('#editar-nome').val(data.descricao);\n $('#editar-status').val(data.status);\n $(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The function renderTooltip applies tooltip with the given text. Args: text: text for tooltip to show
function renderTooltip(text) { return <Tooltip delay={{ show: 250, hide: 400 }}>{text}</Tooltip>; }
[ "renderTooltip(text) {\n\t\treturn <Tooltip id=\"button-tooltip\">{text}</Tooltip>;\n\t}", "renderTooltip(text) {\n return (\n <Tooltip id=\"button-tooltip\">\n {text}\n </Tooltip>\n );\n }", "function displayTooltip(text) {\n // Create a tooltip div ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
find artboard with name
function getArtboardWithName(name) { var artboards = jsArray([doc artboards]); for(var i = 0; i < artboards.length; i++) { var artboard = artboards[i]; //we check for the “changelog” substring so we can attach the page name in the changelog artboard name artboardName = [artboard name].substring(0,9); ...
[ "function findArtboardByName(name) {\n var artboards = activeDocument.artboards;\n\n var length = artboards.length;\n for (var i = 0; i < length; i++) {\n var artboard = artboards[i];\n if (artboard.name == name) {\n $.writeln(\"Found artboard with name \" + name);\n\n r...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Untag all the notes and delete tag
static async untagAll(tagId) { const noteTags = await NoteTag.modelSelectAll('SELECT id FROM note_tags WHERE tag_id = ?', [tagId]); for (let i = 0; i < noteTags.length; i++) { await NoteTag.delete(noteTags[i].id); } await Tag.delete(tagId); }
[ "static async untagAll(tagId, options = null) {\n\t\tif (!options) options = {};\n\t\tif (!('deleteChildren' in options)) options.deleteChildren = true;\n\n\t\tconst tag = await Tag.load(tagId);\n\t\tif (!tag) return; // noop\n\n\t\tif (options.deleteChildren) {\n\t\t\tconst childrenTagIds = await Tag.childrenTagId...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Prepare RET entity to be sent to db, reformatting dates and inserting retailerid also
function createNewRET(entity, retailerid) { let retailer = new Retailer(); retailer.setRetailerid(entity.retailerid); retailer.setDefaultContentPage1(entity.defaultContentPage1); retailer.setDefaultContentPage2(entity.defaultContentPage2); retailer.setDefaultContentPage3(entity.defaultCo...
[ "function prepareEntity(entity) {\n entity.releaseDate = entity.releaseDate ? new Date(entity.releaseDate) : new Date();\n entity.duration = Number(entity.duration);\n entity.duration = isNaN(entity.duration) ? 10 : entity.duration;\n }", "transformRecord(csvRow) {\n if ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Object to represent coverage file and it's DA/BRDA records
function coverageFile(filename) { this.filename = filename; this.DARecords = [] this.BRDARecords = [] }
[ "function processFile(data, lcov) {\n\tvar lines = data.split('\\n'),\n\t\tcurrentFileName = '',\n\t\tcurrentCoverageFile = null;\n\n\tfor(var i = 0, l = lines.length; i < l; i++) {\n\t\tvar line = lines[i];\n\t\tif(line === 'end_of_record' || line === '') {\n\t\t\tcurrentFileName = '';\n\t\t\tcurrentCoverageFile =...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Removes a suffix of len characters and returns the string
function removeSuffix (str, len) { return str.substr(0, str.length - len) }
[ "function truncate(str, len, suffix) {\n if (suffix === undefined) {\n suffix = '...';\n }\n len -= suffix.length;\n var trunc = str;\n if (trunc.length > len) {\n trunc = trunc.substr(0, len);\n var r = /[^\\s]/;\n if (r.test(str.charAt(len))) {\n trunc = trimR...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
processNotifications Grabs a batch of notifications from the queue NB. The rate limit for calling Notify is 3,000 per minute
async function processNotifications() { const NOTIFICATIONS_BATCH_SIZE = 1000; const services = await getDocument(db.doc('settings/services')); if (services.notifications && services.notifications.isProcessing === true) { const delayBeforeSendMinutes = services.notifications.delayInMinutes || 5; ...
[ "async processNotifications() {\n const events = this.notificationQueue;\n if (events == null)\n return;\n for await (const { type, binding, context, observers } of events) {\n // The loop will happen asynchronously upon events\n try {\n // The ex...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
toggleFontSize(fontSize) toggles the font size based on the arg fontSize called by the toolbar
toggleFontSize(fontSize) { const newEditorState = styles.fontSize.toggle(this.state.editorState, fontSize); return this.onChange(newEditorState); }
[ "function changeTxtSize(fontSize) {\n headerEl.style.fontSize = fontSize;\n // Set the selected font in local storage\n localStorage.setItem(\"font-size\", fontSize);\n}", "function editorSetFontSize(fontSize) {\n\teditor.getWrapperElement().style.fontSize = fontSize + \"pt\";\n\t$(\"#view-fontsize-display\")....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
It takes in a sports activity, suburb name and the url of the php server file and searches for the facilities 1 postcode next to the given suburb. Display on map.
function searchActivityAtSuburbNearby(allData, urlStr) { clearTemporaryDataReturnedFromServer(); $.ajax({ url: urlStr, type: "POST", data: allData, success: function (locData) { // Pop the location data on map if (locData === "") { // if data is empty, show feedback t...
[ "function searchBySuburbAndActivityFromServer(allData, urlStr) {\n clearTemporaryDataReturnedFromServer();\n $.ajax({\n url: urlStr,\n type: \"POST\",\n data: allData,\n success: function (locData) { // Pop the location data on map\n // if data is empty, show feedback to the ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Turn on/off debugging for this query
debug(debug) { this.debugQueries = debug; return this; }
[ "enableDebug() {\n\t\tthis._debugEnabled = true;\n\t}", "disableDebug() {\n\t\tthis._debugEnabled = false;\n\t}", "function off_debug() {\r\n debug_on = false;\r\n}", "function debugInitFuncResultTracing()\r\n{\r\n debugTracingFuncResult = true;\r\n\r\n if(globalDebugTracingLog === undefined)\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Parse filename and output all events. Using CLI this is enabled with `dumpevents`. Mostly useful for debugging.
dumpEvents(filename) { const config = this.getConfigFor(filename); const resolved = config.resolve(); const source = resolved.transformFilename(filename); const engine = new Engine(resolved, Parser); return engine.dumpEvents(source); }
[ "dumpEvents(filename) {\n const config = this.getConfigFor(filename);\n const source = config.transformFilename(filename);\n const engine = new engine_1.Engine(config, parser_1.Parser);\n return engine.dumpEvents(source);\n }", "start() {\n readdir(this.options.path, (error, ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the current brightness
getBrightness() { return this.brightness; }
[ "get ledBrightness() {\n\t\treturn this.property('ledBrightness');\n\t}", "getBrightness() {\n // http://www.w3.org/TR/AERT#color-contrast\n const rgb = this.toRgb();\n return ((rgb.r * 299) + (rgb.g * 587) + (rgb.b * 114)) / 1000;\n }", "getBrightness() {\n // http://www.w3.org/T...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns true if the tile at x,y is either a water tile or out of bounds
isWaterOrOutOfBounds(col, row) { return this.isWater(col, row) || this.maze_.map.getTile(row, col) === undefined; }
[ "function isWater(x, y) {\n return Maze.map[y] !== undefined && Maze.map[y][x] === SquareType.WALL;\n}", "function isWaterOrOutOfBounds(x, y) {\n return Maze.map[y] === undefined || Maze.map[y][x] === undefined || Maze.map[y][x] === SquareType.WALL;\n}", "static hasWaterTiles() {\n // Check if mid cent...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Displays the list of tiers for the specified task.
function displayTiers(taskId) { jagg.post("/site/blocks/subscription-task/ajax/subscription-task.jag", { action: "getSubscriptionTiers", taskId: taskId }, function (json) { if (!json.error) { var tiers = json.tiers; var tiersList =...
[ "function displayTasks() {\n // Loop through all tasks in the local array\n for (let task of tasks) {\n // Call helper function to add to UI\n addTaskToDisplay(task);\n }\n}", "displayTasks() {\n switch (this.display) {\n case \"all\":\n this.showAll();\n break;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates an instance of cache store manager service.
function CacheStoreManagerService(encryptionService, config, inMemory) { this.encryptionService = encryptionService; this.config = config; this.inMemory = inMemory; this.factory = null; this.factory = new CacheFactory(); }
[ "function createCacheManager() {\n return {\n provide: cache_constants_1.CACHE_MANAGER,\n useFactory: (options) => {\n const cacheManager = load_package_util_1.loadPackage('cache-manager', 'CacheModule', () => __webpack_require__(44865));\n const memoryCache = cacheManager.cac...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get a row at a height
function getRow(height,list){ //console.log("getting row at height - " + height) var rv = [] for(var i = 0; i < list.length; i++){ var cur = list[i]; // console.log("element posY for " + cur.text) // console.log(cur.posY) if(parseInt(cur.posY) >= height && parseInt(cur.posY) ...
[ "function row(y) {\n return y * TILE_HEIGHT - OFFSET;\n}", "get rowHeight() { return this._rowHeight; }", "function yForRow(row: number, height: number=style.READ_HEIGHT, spacing: number=style.READ_SPACING): number {\n return (row * (height + spacing));\n}", "rowHeight({ index }) {\n\t\tlet rh = this.rowHei...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Utility function to parse an oldstyle tiddler DIV in a .tid file. It looks like this: The text of the tiddler (without the expected HTML encoding). Note that the field attributes are HTML encoded, but that the body of the tag is not encoded. When these tiddler DIVs are encountered within a TiddlyWiki HTML file then the...
function parseTiddlerDiv(text /* [,fields] */) { // Slot together the default results var result = {}; if(arguments.length > 1) { for(var f=1; f<arguments.length; f++) { var fields = arguments[f]; for(var t in fields) { result[t] = fields[t]; } } } // Parse the DIV body var startRegExp = /^\s*<...
[ "parseText(encodedStr) {\n var dom = this.textParser.parseFromString('<!doctype html><body>' + encodedStr, 'text/html')\n var decodedString = dom.body.textContent\n var dom2 = this.textParser.parseFromString('<!doctype html><body>' + decodedString, 'text/html')\n var decodedString2 = dom...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Process all of the currently active timeouts and remove guests whose timeouts have expired.
function updateTimeouts() { const timeouts = getSortedTimeouts(); if (timeouts.length == 0) { printTimeouts(discordClient, timeoutChannelId); return; } let i = 0; // Mitigate a race condition with the cron job. The cron job throws an error // if the wake time is in the past, so remove people one min...
[ "function purge_timed_out_funcs() {\n\n\tvar timeout_ms = 30 * 1000;\n\n\tvar now = new Date().getTime();\n\n\tObject.keys(instr_cmd_queue).forEach( function(key) {\n\t\tvar queue = instr_cmd_queue[key];\n\t\tfor ( var iqueue=0; iqueue < queue.length; ) {\n\t\t\tif ((now - queue[iqueue].time_queued) > timeout_ms) {...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Tautology = results all true
function isTautology(results){ for (var i= 0; i < results.length; i++) if (results[i] == 0) return false; return true; }
[ "function isFormulaTautology()\r\n{\r\n //assuming truth table already generated\r\n var isTaut = true;\r\n \r\n var numAssn = truthTable.length;\r\n \r\n numCounterEx = 0;\r\n \r\n var value;\r\n //evaluate every assignment (row)\r\n for(i=0; i<numAssn; i++)\r\n {\r\n cleanu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a grant type schema
getGrantSchema(grantHandler) { if (!this.grantSchemas[grantHandler.name]) { const schema = grantHandler.getSchema(); console.info("Compiling json schema for grant Handler"); this.grantSchemas[grantHandler.name] = this.ajv.compile(schema); } return this.grantSchemas[grantHandler.name]; }
[ "function GrantType() {}", "get GrantType () {\n return 'implicit'\n }", "getSchemaType() {\n return this.spec.schemaTypeName;\n }", "get schemaType() {\n const _schema = _namespaces.get(this);\n let _schemaData = null;\n [\"openapi\", \"swagger\"].forEach((type) => {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
show edit comment button and input field
function showEditComment(commentId){ if(document.getElementById("editCommentP" + commentId).style.display == "none"){ document.getElementById("editCommentP" + commentId).style.display = "block" document.getElementById("showEditCommentBtn" + commentId).innerHTML = "Cancel" } else { document.getElementById("...
[ "function editComment(comment) {\r\n // copy comment information to form\r\n formName.value = comment.name;\r\n formComment.value = comment.comment;\r\n\r\n // disable add button\r\n addButton.disabled = true;\r\n\r\n // clear all events update button events\r\n clearUpdateButtonEvents();\r\n\r...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
endregion region AICC via Http API
function AICCViaHttpAPI(launchData) { //#region Vars var launchUrl, aiccUrl, sessionId, inited = false, hasChanged = false, responseCache = {}, stringGroupReg = /Core_Lesson|Comments/ig, aiccModel; this.Model = null, that = this; var HACPCommands = { Ge...
[ "getICSdata(urltouse=\"\") {\n\n let targeturl = ( urltouse == \"\") ? this.icsurl : urltouse;\n console.log(\"getting ics from url:\" + targeturl);\n\n return new Promise((resolve,reject) => {\n return request.get(targeturl, function (error, response, body) {\n if (!e...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
When the state of the weapon select changes, this function inserts the stats in the appropiate dom elements The calls to the functions to generate the image name and to insert it in the page are also done from within this function
function showWeaponALL(index,target){ let arma_actual =orderStats[index]; let nombreArma = Object.entries(arma_actual)[89]; let nombreImg = Object.entries(arma_actual)[89][1]; nombreImg = nombreImg.split(" "); let atts = nombreImg[nombreImg.length -1 ]; let ending = nombreImg[nombreImg.leng...
[ "function changeWeaponBattle() {\r\n \r\n // First div with selected weapon\r\n var bigWeap = $( \"<div style='display:block; width:222px; height: 65px; overflow:hidden;' ></div>\" );\r\n bigWeap.css({ \"margin\" : \"-5px 0px 10px 20px\" });\r\n \r\n var imgWeap = $( \"<img...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
========================================================================= cmdUndo For now the only exposed function on the server is to undo. This section of the code may be expanded to add redo() or other command system functions over time. ========================================================================
function cmdUndo(rawResponseCallback = null) { ajax = ajaxObj(); ajax.onreadystatechange = function() { if (this.readyState == 4) { if (rawResponseCallback != null) { rawResponseCallback(this.status, this.responseText) } pimAuthCheck(this.status) // redirects on auth failure ...
[ "undo() {\r\n if (this.commandStack.length == 0)\r\n return;\r\n var command = this.commandStack.pop();\r\n command.undo();\r\n this.redoStack.push(command);\r\n }", "function undo()\n{\n\tif(undo_data.can == true)\n\t{\n\t\tlooper.overdubui.message('set', 0);\n\t\tlooper.pokeloop.me...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A private helper method to group the fields and create collapsible sections
function _addFieldGroups() { var dialog = $('#perc-folder-props-dialog'); var fieldGroups = [ { groupName : "perc-folder-general-properties-container", groupLabel : I18N.message("perc.ui.folder.properties.dialog@General")}, { groupName : "perc-user...
[ "function _addFieldGroups() {\n var dialog = $('#perc-edit-section-dialog');\n var fieldGroups = [\n { groupName : \"perc-section-general-container\", groupLabel : \"Section\"},\n { groupName : \"perc-section-users-container\", groupLabel : \"Users...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Validate that two objects don't both have the same tag fields
function checkForDuplicateTags(obj1, obj2) { if (!(obj1[SOURCE_TAG] === undefined || obj2[SOURCE_TAG] === undefined)) throw new Error("Cannot have Account X-Address and SourceTag"); if (!(obj1[DEST_TAG] === undefined || obj2[DEST_TAG] === undefined)) throw new Error("Cannot have Destination X-Ad...
[ "function hasSameTagAndId (a, b) { \n\n var hasId = toString.call(a[1]) === '[object Object]' && toString.call(b[1]) === '[object Object]' && a[1].id && b[1].id;\n\n return a[0] === b[0] && (!hasId || (hasId && a[1].id === b[1].id));\n}", "function ensureFieldHasChanged (obj1, obj2) {\n return isNullsy(obj...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Resizes a single cell
_resizeCell(cell, dimensions) { d3.select(cell) .attr('height', dimensions) .attr('width', dimensions); }
[ "function setBiggerCellSize() {\n cellSize = 50;\n clearBoard();\n prepareBoard();\n}", "function resizeMe(){\r\n// We're conducting a test to see what happens if we do everything with vw, vh, vmin, based on viewport size so for now (10/28/16)\r\n// we're going to comment out the call to setCellFontSize ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
less than 8 means that a tip of the pane can be seen by user
function clear_lowerpane_position() { move('#lower-pane').y(+((($(window).height())/8)*tip)).end(); }
[ "function tip15(){\n\t$.tip.setValue(15);\n}", "function tip12(){\n\t$.tip.setValue(12);\n}", "function tip10(){\n\t$.tip.setValue(10);\n}", "function sizeDetailPane() {\n}", "function mouseOverGUI() {\n if (mouseY > window.height - 220 && mouseX < 970 && showHints) {\n return true;\n }\n if...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Update the teams and matches
async function updatesTeamsMatches(req, updated){ await db.updateMany(Team, {"first._id":req.session.curr_user._id}, {$set:{"first":updated}}); await db.updateMany(Team, {"second._id":req.session.curr_user._id}, {$set:{"second":updated}}); await db.updateMany(Team, {"third._id":req.session.curr_user._id}, {$set:{...
[ "function updateTeams(match) {\n for (var i = 0; i < matches.length; i++) {\n if (matches[i][\"match\"] == match) {\n var row = matches[i][\"row\"]\n }\n }\n request(\"PUT\", \"/update_teams\", function () { }, {\n match: match,\n b1: row.children[1].innerHTML,\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Method syncs fieldsets and properties in current config with fieldsets and properties from ./configtemplate.json If some fieldset or property is missing in current config, it will be inserted into current config to the right position. Other properties will not be changed
syncConfigFileWithTemplate() { const { config } = this; const configTemplate = require(configTemplateFilePath); configTemplate.forEach((fieldSet, fieldSetIndex) => { const fieldSetId = fieldSet.id; // Find this fieldset in current config const configFieldSet = config.filter(configFieldSet => configFiel...
[ "function populateConfigFields() {\n if (vm.selectedGenericConfigTable === undefined ||\n vm.selectedGenericConfigTable.GenericConfigTableKey === undefined ||\n vm.selectedGenericConfigTable.GenericConfigTableKey === null) return;\n\n vm.GenericValueFields = {}; /...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Determine whether the given properties match those of a `IotEventsProperty`
function CfnAlarmModel_IotEventsPropertyValidator(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:...
[ "shouldUpdate(changedProperties) {\n changedProperties.forEach((oldValue, propName) => {\n console.log(`${propName} changed. oldValue: ${oldValue}`);\n });\n return changedProperties.has('prop1');\n }", "function CfnDetectorModel_EventPropertyValidator(properties) {\n if (!cdk.canInspect(propert...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[1][multicast] MessagePump.post([instance, ...], "hello") [2][unicast ] MessagePump.post(instance, "hello") [3][broadcast] MessagePump.post(null, "hello") MessagePump.post send a message asynchronously
function uumsgpost(address, // @param Array/Mix: address or guid // [instance, ...] is multicast // instance is unicast // null is broadcast message, // @param String: message ...
[ "broadcast(instanceID, event, data) {\n let payload = {\n data,\n event,\n };\n process.send({\n data: {\n instanceID,\n payload,\n },\n event: 'core.broadcast',\n });\n return Promise.resolve([])...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check if a number/square pair is correct when compared to the solution
function checkIfCorrect(square) { // Assign the solution based on the difficulty setting chosen let solution; if (id("easy-diff").checked) { solution = easy[1]; } else if (id("medium-diff").checked) { solution = medium[1]; } else if (id("hard-diff").checked) { solution = hard[1]; } else { so...
[ "function checkSquares(){\n\n\tfor(let i = 0; i < 9; i++){\n\t\tlet sq = []\n\t\tfor(let j = 0; j < 3; j++){\n\t\t\tfor(let k = 0; k < 3; k++){\n\n\t\t\t\tlet superRow = Math.floor(i / 3)\n\t\t\t\tlet superCol = Math.floor(i % 9) % 3\n\t\t\t\tlet id = (superRow * 27) + (j * 9) + (superCol * 3) + k\n\t\t\t\tlet n = ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
does partial the work of: demodulateSliced bitMangleSliced unmangle's bytes this is only written for a single mode
function airpacketUnmangle(sliced_out) { let res = []; for(let i = 0; i < sliced_out.length; i++) { let j = transformWords128(i); // converts the index of word we are looking at let val = bitMangleSliced(sliced_out[j]); // changes bits within individual word res.push(val); // console.log(bitMangleS...
[ "handleDemodData(iFloat,iShort,asComplex) {\n // if( this.printSlicer ) {\n // console.log('enter demodData ' + iShort.length + ' ' + asComplex.length);\n // }\n\n // this is \n // output of reverse mover, named reverse_mover in AirPacket.cpp\n let moverOut = [];\n\n for( let i = 0; i < iShor...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
accepts one argument and updates a DumDumGirl class instance's instrument property
updateInstrument(newInstrument){ this.instrument = newInstrument; }
[ "setInstrument (instrument) {\n this._instrument = instrument\n }", "function Instrument(name, pack, conductor) {\n // Default to Sine Oscillator\n if (! name) {\n name = 'sine';\n }\n if (! pack) {\n pack = 'oscillators';\n }\n\n if (typeof conductor.packs.instrument[pack] ===...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
number.innerHTML = (currentSlider + 1); / fucntion change slider, dots, number
function changeSlider(index) { sliderItems[currentSlider].classList.remove('active'); sliderItems[index].classList.add('active'); dots[currentSlider].classList.remove('active'); dots[index].classList.add('active'); currentSlider = index;// điều kiện này có thể thay thế cho currentSlider++; numb...
[ "function updateNum() {\n nLectura.textContent = Number(nSlider.value);\n n = nSlider.value;\n}", "function showSliderValue(x)\n{\n document.getElementById('slider-value').innerHTML=x;\n}", "function displayNumberCurrentSlide() {\n \tindexOfSlide.innerHTML = `Slide number ${myPresentation.getCurrentSl...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
! vuebreadcrumbs v1.2.0 (c) 2018 Sam Turrell Released under the MIT License.
function r(t,e){function n(e){return parseFloat(t.version)<2&&(e=Object.keys(e).filter((function(t){return!isNaN(t)})).map((function(t){return e[t]}))),e}Object.defineProperty(t.prototype,"$breadcrumbs",{get:function(){var e=[],r=n(this.$route.matched);return r.forEach((function(n){var r=parseFloat(t.version)<2?n.handl...
[ "function i(t,e){function n(e){return parseFloat(t.version)<2&&(e=Object.keys(e).filter(function(t){return!isNaN(t)}).map(function(t){return e[t]})),e}Object.defineProperty(t.prototype,\"$breadcrumbs\",{get:function(){var e=[],i=n(this.$route.matched);return i.forEach(function(n){var i=parseFloat(t.version)<2?n.han...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Edit a journal entry
function editJournalEntry(name, location, notes, key) { document.querySelector('.edit').addEventListener('click', function(){ trailCard.style.display = "block"; updateButton.style.display = "inline-block"; saveButton.style.display = "none"; trailName.value = name; trailLocation.value = location; trailNo...
[ "function editJournal()\n{\n var currentEntry = getEntry();\n currentEntry = currentEntry.split(\"|\");\n\n currentEntry[1] = saveEdit(currentEntry[1].split(\"<br>\"), \"editR\");\n currentEntry[2] = saveEdit(currentEntry[2].split(\"<br>\"), \"editA\");\n currentEntry[3] = saveEdit(currentEntry[3].split(\"<br>...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
END / OFFERS, ADS, PROMO .. etc ORDER FUNCTIONS BLOCK / insert elements from array2 into array1 per each n elements
function insertAdOffers(array1,array2,n){var temp=array1.slice();array2.forEach(function(v,i){return temp.splice((i+1)*n+i,0,v);});return temp;}
[ "function mergeIntoArrayOne(arr1, m, arr2, n) {\n let currentIdx = m + n - 1;\n let idx1 = m - 1;\n let idx2 = n - 1;\n \n while (idx2 >= 0) { // if idx2 is done, the rest of arr1 is sorted\n const num1 = arr1[idx1];\n const num2 = arr2[idx2];\n\n if (num1 > num2) {\n arr1[currentIdx] = num1;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check the update operation to ensure it has atomic operators.
function checkForAtomicOperators(update) { if (Array.isArray(update)) { return update.reduce((err, u) => err || checkForAtomicOperators(u), null); } const keys = Object.keys(update); // same errors as the server would give for update doc lacking atomic operators if (keys.length === 0) { return toErr...
[ "function checkForAtomicOperators(update) {\n const keys = Object.keys(update);\n\n // same errors as the server would give for update doc lacking atomic operators\n if (keys.length === 0) {\n return toError('The update operation document must contain at least one atomic operator.');\n }\n\n if (keys[0][0] ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
API test for 'DelL3If', Delete a virtual interface on virtual L3 switch
function Test_DelL3If() { return __awaiter(this, void 0, void 0, function () { var in_rpc_l3if, out_rpc_l3if; return __generator(this, function (_a) { switch (_a.label) { case 0: console.log("Begin: Test_DelL3If"); in_rpc_l3if = new...
[ "function Test_DelL3Switch() {\n return __awaiter(this, void 0, void 0, function () {\n var in_rpc_l3sw, out_rpc_l3sw;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n console.log(\"Begin: Test_DelL3Switch\");\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
| _readRegisters:void () | | Read the registers via I2C.
_readRegisters(addressToRead, bytesToRead, callback){ this.queue.place( () => { this.i2c.transfer( new Buffer([addressToRead]), bytesToRead, (err, data) => { this.queue.next(); if( callback ){ callback(err, data); } }) }); }
[ "function read16 (reg) {\n this.i2c.writeTo( this.i2cAddress, reg );\n var array = this.i2c.readFrom( this.i2cAddress, 2 );\n console.log(array);\n return (array[0] << 8)| array[1];\n}", "function read8 (reg) {\n this.i2c.writeTo( this.i2cAddress, reg);\n return this.i2c.readFrom( this.i2cAddres...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
streamStdin :: Program > Stream
function streamStdin(program) { return process.stdin; }
[ "constructor(stream) {\n this.stream = stream ? stream : process.stdin\n }", "function readStdin() {\n var data = '';\n readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n }).on('line', (input) => {\n data += input;\n }).on('close', () => {\n com...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the Map layer code name from the check box id in the key symbols control
function getLayerCode(layerCtrlId) { var layerCode = layerCtrlId.slice(layerCtrlId.lastIndexOf("$") + 1); // slices the control name with '$' as identifier and gets the last element return layerCode; }
[ "function getLayerName(id) {\n var layerReference = new ActionReference();\n layerReference.putProperty(charIDToTypeID(\"Prpr\"), charIDToTypeID(\"Nm \"));\n layerReference.putIdentifier(charIDToTypeID(\"Lyr \"), id);\n var descriptor = executeActionGet(layerReference);\n return descriptor.getString...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Setting up the server middleware
setupAppMiddleware() { // small security protections by adjusting request headers this.app.use(helmet()); // adding the request's client ip this.app.use(requestIp.mw()); if(Config.isDev) { // Log requests in the console in dev mode this.app.use(morgan('dev')); } else { // Compress responses in ...
[ "function setupServer() {\n\n app.use(morgan('dev')); // log every request to the console\n app.use(bodyParser.urlencoded({ // parse application/x-www-form-urlencoded\n extended: false\n }));\n app.use(bodyParser.json()); // parse application/json\n app.use(cookieParser());\n app.use(session(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
stats surface and modifiers
function _createStats() { this.statsSurface = new Surface({ size: [undefined, undefined], content: " \ <table id='stats_table'> \ <tr class='even'> \ ...
[ "function initStats() {\n\t\t_stats = new Stats();\n\t\t_stats.domElement.style.position = \"absolute\";\n\t\t_stats.domElement.style.top = \"8px\";\n\t\t_stats.domElement.style.zIndex = 100;\n\t\tdocument.getElementById(\"container\").appendChild(_stats.domElement);\n\t}", "function addStatsObject() {\n stats...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Remove a previously registered meta item.
removeMeta(key, name) { let meta = get(this, 'meta.'+key); if(meta) { set(meta, name); } }
[ "function wpsc_remove_custom_meta(caller, meta_id) {\n\tvar post_data = {\n\t\taction : 'remove_product_meta',\n\t\t'meta_id' : meta_id,\n\t\tnonce : jQuery(caller).data('nonce')\n\t};\n\n\tvar response_handler = function(response) {\n\t\tif (! response.is_successful) {\n\t\t\talert(response.error.messages.j...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks the file tracker for updates If the date (NOT TIME) of any entry was from a different day than current, Repopulate the file tracker to show only today's files
function checkFileTrackerUpToDate() { let currentDate = getDate(); let keys = Object.keys(roomsFileTracker); keys.forEach(function(key) { console.log("Key: " + key); let sample = roomsFileTracker[key].date; if((typeof(date) !== 'undefined') && (currentDate !== sample)) { ...
[ "function date_checker() {\n // If date is new, added to date_tracker array\n date_only = DateTime.substr(0, 10);\n if (!date_tracker.includes(date_only)) {\n date_tracker.push(date_only);\n\n // Completes auto_transfers before CSV i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function solver zindex problem in corner cell where fix row and column at the same time, set corner cells zindex 1 more then other fixed cells
function setCorner() { var table = $(settings.table); if (settings.head) { if (settings.left > 0) { var tr = table.find("thead tr"); tr.each(function (k, row) { solverLeftColspan(row, functi...
[ "function setZIndexValue() {\r\r\n var elements = $(\".element:not([sharedstimulusdiv='true'],[sharedstimulus='true'])\") /*$(\".element\")*/ ,\r\r\n id, ele;\r\r\n for (var index = 0; index < elements.length; index++) {\r\r\n ele = elements.eq(index);\r\r\n if (ele.parents(\"div.divbox[i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
reset question number and shots to be taken
function resetQuiz() { shots = 5; questionNum = 0; trackCorrect = 0; $('.shots').text(0); $('.questionNum').text(0); }
[ "function resetQuestionIndex() {\n questionIndex = 0;\n}", "function reset() {\n\t\t// go to next question\n\t\tgame.qIndex++; \n\n\t\tif (game.qIndex < game.qArray.length) {\n\t\t\t//remove classes for styling answers\n\t\t\t$(\".answerArea\").find(\".correct\").toggleClass(\"correct\");\n\t\t\t$(\".answerAre...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }