query
stringlengths
9
34k
document
stringlengths
8
5.39M
negatives
listlengths
19
20
metadata
dict
How much space will be inbetween lines of text.
get lineSpacing() {}
[ "function textHeight(display){if(display.cachedTextHeight!=null){return display.cachedTextHeight;}if(measureText==null){measureText=elt(\"pre\",null,\"CodeMirror-line-like\");// Measure a bunch of lines, for browsers that compute\n// fractional heights.\nfor(var i=0;i<49;++i){measureText.appendChild(document.create...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
set the color (likelihood) to the attack strategy
function setColor(id, likelihood) { if (likelihood == 5) { removeClass('btn-default') $('#' + id).addClass('btn-danger') } else if (likelihood == 4) { removeClass('btn-default') $('#' + id).addClass('btn-mediumHigh') } else if (like...
[ "function _colorAttack(anime, _wkTask, params, stage, args) {\n switch (stage) {\n case ABeamer.TS_INIT:\n var attack = params.attack;\n var propName = params.prop || 'color';\n var cycles = ABeamer.ExprOrNumToNum(params.cycles, 1, args);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get value of the head of the heap
getHead() { return this.maxheap[1] }
[ "findMinimum() {\n return this.isEmpty() ? undefined : this.heap[0];\n }", "top() {\n\t\tif (this.head == null) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn this.head.value\n\t}", "_get(idx) {\n return this._heap[idx].value;\n }", "front() {\n if(!self.head) {\n var headValue = self.he...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function to display Terms & Condition in SWAL
function terms() { Swal.fire('Terms & Condition','content here','success'); }
[ "function getText() {\r\n\tvar indicators = ot_assessment.getIndicatorValues()\r\n \tvar inv = ot_assessment.getInventory()\r\n \t\r\n\tvar c_truthValues = inv.get(\"c_truthValues\")\r\n\tvar s_truthValues = inv.get(\"s_truthValues\")\r\n\tvar c_fault1 = parseInt(inv.get(\"c_fault1\"))\r\n\tvar s_fault1 = parseInt(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
return true iff given hints (current hints) are correct
function examineHintsAndCode() { const realHints = getHints(); let fullInHints = 0; let halfInHints = 0; let fullInRealHints = 0; let halfInRealHints = 0; for (let i = 0; i < currentHints.length; i++) { if (currentHints[i] === "half") halfInHints++; if (currentHints[i] === "ful...
[ "function hasHint (hints) {\n\tfor (var i in hints) {\n\t\tif (hints[i]) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "verifyHint(hint, i1, i2) {\n if (typeof i2 === \"undefined\") {\n // This is a hint from a disproof. It has only one ingredient.\n // Check that the ingredient contains gi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Mark a node in the graph.
function markIt(node, modeljsav) { node.addClass("visited"); modeljsav.umsg("Add node " + node.value() + " to the MST"); node.highlight(); }
[ "function markIt(node) {\n node.addClass(\"visited\");\n jsav.umsg(\"Add node \" + node.value() + \" to the MST\");\n node.highlight();\n jsav.step();\n }", "function markIt(node, modeljsav) {\n node.addClass(\"visited\");\n node.addedStep = modelStep; //The step this node was added\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
image view mode function full or fit
function ImageViewMode(theMode){ $toolbar.data("imageViewMode", theMode); //store new mode FullScreenBackground($bgimg); //scale bg image //re-style button if(theMode=="full"){ $toolbar.html("<span class='lightgrey'>IMAGE VIEW MODE &rsaquo;</span> FULL"); } else if(theMode=="fit") { $toolbar.html("<sp...
[ "renderFullSizeImg() {\n this.rewrapPlaceholder();\n this.transitioning = true;\n this.initFullSizeImg();\n this.setFullSizeImgTempCss();\n this.setFullSizeImgSrc();\n this.addFullSizeImgToDom();\n this.initTransition();\n }", "function toggleFullImage() {\n setFullImage(!fullImage);\n }...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Apply shake (if the item is 1)
applyShake(c) { if (this.shakeApplied) { c.setShake(this.waitTimer, (-this.item) | 0); this.shakeApplied = false; } }
[ "function shakeEffect($card) {\n\tresetAnimations($card);\n\t$card.addClass('shake');\n}", "function shake(fruit) {\r\n var makefruitfall = (accelerometer1 || 0) + (accelerometer2 || 0) + (accelerometer3 || 0) + (accelerometer4 || 0);\r\n \r\n if (makefruitfall > 0.30) { //change this value later!!!\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function that divides two numbers and returns the result
function div(num1, num2) { return num1 / num2; }
[ "function divive (num1,num2) {\n var results = num1 / num2\n\n return results\n}", "function divison(num1, num2) {\n var divisonTotal = num1 / num2;\n return divisonTotal;\n}", "function divison(num1, num2) {\n // var divisonTotal = num1 / num2;\n // return divisonTotal;...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get CUSTOMER DETAILS Table
function getCustomerDetailsTable() { var result; result = { table: { widths: [61, '*', 51, '*'], body: [ [{ text: 'CUSTOMER DETAILS', style: 'tableHeader', colSpan: 4, border: [false, ...
[ "function getCustomerDetailsTable() {\n var result;\n result = {\n table: {\n widths: [70, '*', 70, '*'],\n body: [\n [{\n text: 'CUSTOMER DETAILS',\n style: 'tableHeader',\n colSpan: 4,\n b...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
============================================================================= Logic Evaluator ============================================================================= Design the logic evaluator: A tool for reading boolean logic for if statements and loops from RMMV templates. Creating the wrapper object the user w...
function LogicEvaluator() {}
[ "function getLogic(){ \n workspacePlayground.updateToolbox(\"<category name='%{BKY_CATLOGIC}' colour='%{BKY_LOGIC_HUE}'><block type='controls_if'></block> <block type='logic_compare'></block> <block type='logic_operation'></block> <block type='logic_negate'></block> <block type='logic_boolean'...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the table widget from given cursor point
getTableWidget(cursorPoint) { let widget = undefined; let currentPage = this.owner.viewer.currentPage; if (!isNullOrUndefined(currentPage)) { for (let i = 0; i < currentPage.bodyWidgets.length; i++) { let bodyWidget = currentPage.bodyWidgets[i]; widget...
[ "getTableCellWidget(cursorPoint) {\n let widget = undefined;\n let currentPage = this.owner.viewer.currentPage;\n if (!isNullOrUndefined(currentPage)) {\n for (let i = 0; i < currentPage.bodyWidgets.length; i++) {\n let bodyWidget = currentPage.bodyWidgets[i];\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Window_Credits The window for exiting game credits.
function Window_CreditsBack() { this.initialize.apply(this, arguments); }
[ "function Window_Credits() {\n this.initialize.apply(this, arguments);\n}", "function drawCredits() {\n\t\tdocument.removeEventListener('keyup', quitMenuEnter);\n\t\tmainMenu.showCredits();\n\t\tmenuRequestID = win.requestAnimationFrame(drawCredits);\n\t\tdocument.addEventListener('keyup', menuBackEnter, false...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the row state to Unchaged
AcceptChanges() { this.State = tp.DataRowState.Unchanged; }
[ "removeRow(state) {\n if (this._rows.length > 0 &&\n this._rows[this._rows.length - 1].state === state) {\n this._rows = this._rows.slice(0, -1);\n }\n }", "deactivateRow() {\n const idx = this.activatedRow()[0].row;\n if (idx >= 0) {\n this.toggleRowActivation(id...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Randomly assigns imgs based on the view and the model of the drop > essentially we need the data from the model in order to determine whether a drop is dangerous or not
function assignImg(drop_m, drop_v, img_num){ if (drop_m.type === true){ drop_v.css('background-image', 'url("https://dl.dropboxusercontent.com/u/57018847/dropb.png")'); } else { drop_v.css('background-image', drop_m.randImageSrc(img_num)); } }
[ "function randomBackdrop()\n{\n bDrop = floor(random(1, 11));\n if (bDrop === 1) {\n image(bArid1, 0, 0, width, height);\n }\n else if (bDrop === 2) {\n image(bArid2, 0, 0, width, height);\n }\n else if (bDrop === 3) {\n image(bArid3, 0, 0, width, height);\n }\n else if (bDrop === 4) {\n image(b...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
see if item was dropped over the delete area compare pointer coordinates with area position
async __handleDeleteDrop(event) { const {data, target} = event.detail; const {x, y} = data; const {top, right, bottom, left} = this.$.deleteArea.getBoundingClientRect(); const measurements = {top, right, bottom, left, x, y}; if (dropIsOverDeleteArea(mea...
[ "function check_dropped_element() {\r\n\t\t\r\n\t\t$('.tg-item-inner [data-item-area]').removeClass('tg-area-filled')\r\n\t\t\t.each(function() {\r\n\t\t\tvar $area = $(this),\r\n\t\t\t\t$elems = $area.find('div:not(.tg-item-clear):not(.ui-sortable-helper)');\r\n\t\t\tif ($elems.length > 0) {\r\n\t\t\t\t$elems.eac...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
If `validateOnFocusIn` or `validateOnFocusOut` is true, validation should run only on that event. Otherwise, validation should run on every change.
function _shouldValidateAllChanges(props) { return !(props.validateOnFocusIn || props.validateOnFocusOut); }
[ "_onFocusOut () {\n let isDirty = this.get ('isDirty');\n let autoValidate = this.get ('autoValidate');\n\n if (isDirty && autoValidate) {\n this.doValidate ();\n }\n }", "onEmployeeBlur() {\n\t\tthis.validate(['employee']);\n\t}", "function doOnFieldsFocus() {\r\n\t\t\tvar $wrapper = $(this)....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
parseAST traverses the abstract syntax tree and creates a prototype object representing all the queried fields nested as they are in the query. The prototype object is used as (1) a model guiding the construction of responses from cache (2) a record of which fields were not present in cache and therefore need to be que...
parseAST(AST) { // initialize prototype as empty object const prototype = {}; let isQuellable = true; let operationType; // initialiaze arguments as null let protoArgs = null; //{ country: { id: '2' } } // initialize stack to keep track of depth first parsing const stack = []; ...
[ "parseAST(AST) {\n const queryRoot = AST.definitions[0];\n // initialize prototype as empty object\n const prototype = {};\n let isQuellable = true;\n /**\n * visit is a utility provided in the graphql-JS library. It performs a\n * depth-first traversal of the abstract syntax tree, invoking a...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Load all tasks of current period
loadCurrentTasks() { const params = {}; params[this.$store.state.filter] = true; switch (this.$route.params.period) { case 'week': params.task_week = moment().week().toString(); break; case 'today': params.task_date = moment().startOf('day').format(); ...
[ "function loadTasks() {\n API.getTasks()\n .then(res => \n setTasks(res.data)\n )\n .catch(err => console.log(err));\n }", "function loadTasks() {\n // calls the service list method\n let searching = service.list();\n\n Promise.all([searching]).then(function (respons...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Drops the given object onto the unit's current tile
function dropObject(unitIn,objInArray){ for(var i in objInArray){ unitIn.currentTile.objOcc.push(objInArray[i]); setCurrentTile(objInArray[i],unitIn.currentTile); objInArray[i].objIsHeld = false; if(unitIn.currentTile === CivMind.resourceDropOff){ CivMind.woodGatArray.push(objInArray[i]); woodArray.splic...
[ "unstageUnit(){\n this.image.parent.removeChild(this.image);\n this.healthBar.parent.removeChild(this.healthBar);\n }", "drop(object) {\n object.giveCards(this.cards);\n this.cards = [];\n }", "drop(props, monitor) {\n const piece = monitor.getItem();\n\n props.dispatcher({\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
hide save to memory section
function hideSaveToMemorySection() { for (var i = 0; i < saveToMemory.length; i++) { saveToMemory[i].style.display = "none"; } }
[ "function showSaveToMemorySection() {\n for (var i = 0; i < saveToMemory.length; i++) {\n saveToMemory[i].style.display = \"block\";\n }\n}", "hide() {\r\n this.info = false;\r\n }", "showMemory()\n {\n if(this.memory != 0){\n this.dis(this.memory);\n } \n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test whether the given node's content could be appended to this node. If that node is empty, this will only return true if there is at least one node type that can appear in both nodes (to avoid merging completely incompatible nodes).
canAppend(other) { if (other.content.size) return this.canReplace(this.childCount, this.childCount, other.content); else return this.type.compatibleContent(other.type); }
[ "function mergeable(node) {\n var start;\n var end;\n\n if (node.type !== 'text' || !node.position) {\n return true\n }\n\n start = node.position.start;\n end = node.position.end;\n\n // Only merge nodes which occupy the same size as their `value`.\n return (\n start.line !== end.l...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the navigation Url
getNavigationUrl(endPath, external) { if (external) { return this.externalNavigations[endPath]; } else if (this.isB2B()) { return this.getB2BBaseURL() + this.navigations[endPath]; } return this.getB2CBaseURL() + this.navigations[endPath]; }
[ "function getUrl(){\n\t\treturn document.navigation.href;\t\t\t\t\t\t\t\t\t//RETURNING CURRENT TAB URL\n\t}", "getUrl() {\r\n var _a;\r\n const routerLink = (_a = this.routerLink) !== null && _a !== void 0 ? _a : this.routerLinkWithHref;\r\n return routerLink\r\n ? this.router.seri...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Computes entropy of a list
function entropy(vals) { var uniqVals = _.uniq(vals); var probs = uniqVals.map(function(x) { return prob(x, vals) }); var logVals = probs.map(function(p) { return -p * log2(p) }); return logVals.reduce(function(a, b) { return a + b }, 0); }
[ "function entropy(obj){\n return -Iterator.values(obj)\n .map(p=>p*Math.log2(p))\n .sum()\n}", "function entropy(vals) {\n var uniqueVals = _.unique(vals);\n var probs = uniqueVals.map(function(x) {\n return prob(x, vals)\n });\n\n var logVals = probs.map(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
It builds this.selectedVariables from the serialized string this.selectedVariablesText
async selectedVariablesTextObserver() { if (this.selectedVariablesText) { this.selectedVariablesFormatted = this.selectedVariablesText; const variables = this.selectedVariablesFormatted.split(";"); // reset selectedVariables this.selectedVariables = Object.assign...
[ "selectedVariablesSerializer() {\n // console.log(\"selectedVariableObserver\", this.selectedVariables);\n const selected = [];\n this.selectedVariablesFormatted = \"\";\n for (const [variableSetId, variables] of Object.entries(this.selectedVariables)) {\n // avoid adding empt...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function that returns lookup results by script
function returnLookupResultByScript(fieldName, value) { var returnField; if (parent.jQuery('iframe[id*=easyXDM_]').length > 0) { // portal and content on same domain returnField = top.jQuery('iframe[id*=easyXDM_]').contents().find('#iframeportlet').contents().find('[name="' + escapeName(fieldNam...
[ "function doLookup (term, key, parameters) {\n var provider = providers[key];\n\n //var isFirstResult = true;\n\n //get the results\n return provider.search(term, parameters);\n}", "function returnLookupResultByScript(fieldName, value) {\n var returnField;\n if (parent.jQuery('iframe[id*=easyXDM_]').len...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Draws a energy1 bar at the bottom
function drawHealthBar(){ push(); rectMode(CORNER); //background rectangle of health bar fill(64,43,112); rect(0,height-50,width/1 + 10,30); //The health bar fill(153, 153, 255); healthBar = map(harryHealth,0,harryMaxHealth, 0, width); rect(0, height-50,healthBar,30); //Text showing the Energy level...
[ "function energyBar() {\n let energySize;\n energySize = map(alienPlayer.health, 0, alienPlayer.maxHealth, 0, 300);\n push();\n fill(255, 0, 0);\n rect(10, 10, 300, 25);\n\n fill(0, 255, 0);\n rect(10, 10, energySize, 25);\n pop()\n}", "updateEnergyBar () {\n this.energyBar.fillColor = colorMix(0x0000F...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Register all the different commands. See comments for examples
function registerCommands() { // $ bot service <cmd> serviceCommands(); // $ bot logs <cmd> logsCommands(); // $ bot queue <cmd> queueCommands(); // $ bot repos <cmd> repoCommands(); // $ bot run reponame/botname{.js?} runCommands(); // $ bots console consoleCommands(); // Parse the argv list ...
[ "function registerCommands() {\r\n createEcho();\r\n createCalc();\r\n createMap();\r\n createHelp();\r\n createClear();\r\n createBlank();\r\n createPrint();\r\n createLs();\r\n createCd();\r\n createOpen();\r\n}", "function registerCommands() {\n COMMANDS.forEach(command => (\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Launched when enter is pressed in the input bar
function inputEnter(event) { if(event.which == 13 || event.keyCode == 13){ run(); } }
[ "onKeyPressInput(e) {\n\t\tif (e.key === 'Enter') this.executeButton();\n\t}", "enterPressed(event) {\r\n var code = event.keyCode || event.which;\r\n if (code === 13) { //13 is the enter keycode\r\n this.checkInput()\r\n }\r\n\r\n }", "function inputPressEnter(e) {\n \n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This route posts a single scheme to database
async function postOne(mfscheme) { try { let schemes var _id = new mongoose.Types.ObjectId(); schemes = await mfschemesModel.create({ scode: mfscheme.scode, sname: mfscheme.sname, amccode: mfscheme.amccode }); var parseResult = helpers.parseOutput(errflag, schemes); ...
[ "function add(scheme) {\n return db('schemes')\n .insert(scheme)\n .then(ids => {\n return findById(ids[0]) // returns posted new scheme\n })\n}", "post(uri, action) {\n\n this.route('POST', uri, action);\n }", "async function postOne(mfscheme)\r\n{\r\n\t\r\n\t\r\n\ttry\r\n\t{\r\n\t\tle...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Intention is to implement a LRU. For now this cleanup 80% of random entries when the maxSize is reached! When a entry is cleaned up, onRemoveFn is called with key and value of entry being removed from Cache.
function LruCache(maxSize, lowWaterMark, onRemoveFn) { this.entryDict = {}; this.put = function(key, value) { this.reduceIfNeeded(); this.entryDict[key] = value; }; this.get = function(key) { if (!(key in this.entryDict)) return undefined; return this.entryDict...
[ "evict_() {\n if (this.size_ <= this.capacity_) {\n return;\n }\n\n dev().warn(TAG, 'Trimming LRU cache');\n const cache = this.cache_;\n let oldest = this.access_ + 1;\n let oldestKey;\n for (const key in cache) {\n const {access} = cache[key];\n if (access < oldest) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Run a certain number of CPU instructions and schedule another tick.
tick() { for (let i = 0; i < this.clocksPerTick && this.started; i++) { this.step(); } // We might have stopped in the step() routine (e.g., with scheduled event). if (this.started) { this.scheduleNextTick(); } }
[ "function sched(cb, ticks) {\n function fn() {\n if (--ticks)\n setImmediate(fn);\n else\n cb();\n }\n setImmediate(fn);\n}", "function singleStep() {\n _CPU.cycle();\n}", "function runAll (num){\n}", "function tick() {\n for (var i = 0; i < this.tickEvents.length; i++) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
store chunk in db
function storeChunk(chunk) { self.voxelDb.store(settings.worldId, chunk, function afterStore(err) { if (err) console.error('chunk store error', err.stack) }) }
[ "function insertChunk(remainingData, indx) {\n var fullsplit = remainingData.length > CHUNK_SIZE;\n console.log(remainingData);\n var uploadingChunk = remainingData.slice(0, fullsplit ? CHUNK_SIZE : remainingData.length);\n client.query('IN...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the users away message.
set awayMessage (value) { this._awayMessage = value /** * @event IrcUser#awayMessage */ this.emit('awayMessage') }
[ "get awayMessage () {\n return this._awayMessage\n }", "function putUserToAutoAway() {\n changeUserStatus(USER_STATUS_AWAY, AUTO_AWAY_CUSTOM_MESSAGE);\n top.cairo.autoAway.isUserOnAutoAway = true;\n}", "set isAway (value) {\n this._isAway = value\n /**\n * @event IrcUser#isAway\n */\n thi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Make current dialog above the rest by switching their zindexes
function makeDialogAbove(event) { const wrappers = document.querySelectorAll(wrappersSelector); const activeWrapper = event.target.closest(wrappersSelector); // if we clicked on non-related element if (!activeWrapper) { return false; } // list of all z-indexes of wrappers let indexes = []; // colle...
[ "function makeDialogAbove(event) {\n const wrappers = document.querySelectorAll(wrappersSelector);\n const activeWrapper = event.target.closest(wrappersSelector);\n // if we clicked on non-related element\n if (!activeWrapper) {\n return false;\n }\n\n // list of all z-indexes of wrappers\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Updates userLastSeenAt of all Feedbacks to the current date
static async markAllAsRead() { const Op = Sequelize.Op; return await Feedback.update( { userLastSeenAt: new Date() }, { where: { id: { [Op.not]: null } } } ); }
[ "updateLastReadAnnouncementsTimestamp() {\n axios.put('/user/last-read-announcements-at').then(() => {\n Bus.$emit('updateUser');\n });\n }", "updateLastReadAnnouncementsTimestamp() {\n axios.put('/user/last-read-announcements-at')\n .then(() =...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get current frame based on time and rate.
function get_frame(time, rate) { // time, modulo 1000 var tm = time % 1000; return FRAMES.find(function(row) { return in_range(tm, row.t) && in_range(rate, row.p); }) || FRAMES[0]; }
[ "get frameRate() {}", "get frame() {\n if (this.video.current) {\n return Math.round(this.video.current.currentTime * this.props.fps);\n }\n\n return 0;\n }", "set frameRate(value) {}", "function updateFrameRate(currentRate) {\n frameRate(currentRate);\n}", "static getF...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Invoke callback on completion of any task matching taskId, or immediately if no such task exists
onTaskEnd (taskId, callback) { const task = this.taskMap[taskId]; if (task == null) { setImmediate (callback); return; } const onEvent = () => { if (task.isEnded || (this.taskMap[task.id] === undefined)) { callback (); return; } this.statusEventEmitter.once (task.id, onEvent); }; this...
[ "_taskComplete() {\n if (this.tasks.length > 0) {\n this._run(this.tasks.shift());\n }\n }", "taskCompleted() {\n if (--this.numTasks === 0) {\n this.onCompletion();\n }\n }", "function done() {\n // Every time a task is done we're going to increment this counter\n tasks_done++;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sorts a collection of item paths.
_sortPathCollection(collection) { collection.sort(function (a, b) { const aSplit = a.split('.'), bSplit = b.split('.'), maxLength = Math.max(aSplit.length, bSplit.length); for (let i = 0; i < maxLength; i++) { const aCurrent = parseFloat(a...
[ "_sort(nodes, prop = \"path\") {\n nodes.sort((a, b) => {\n return a[prop].localeCompare(b[prop]);\n });\n }", "function sort(items, state) {\n const copy = toArray(items);\n const reverse = state.direction === 'descending' ? 1 : -1;\n if (state.key === 'last_modified') {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
setDepths Sets the depth of each object on the screen.
setDepths() { this.room2_floor.setDepth(0); this.room2_character_north.setDepth(50); this.room2_character_east.setDepth(50); this.room2_character_south.setDepth(50); this.room2_character_west.setDepth(50); this.room2_E_KeyImg.setDepth(49); this.room2_activity1A.se...
[ "setDepths() {\n this.floor3.setDepth(0);\n this.character_north.setDepth(50);\n this.character_east.setDepth(50);\n this.character_south.setDepth(50);\n this.character_west.setDepth(50);\n this.E_KeyImg.setDepth(49);\n this.activity1A.setDepth(100);\n this.ac...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Extracts text content from the wiki article
function extractWikiText(searchTerm, msg) { getWikiLink(searchTerm).then((url, multiple) => { exileBot.sendMessage(msg.chat.id, url); request.get(url, function(err,res,body){ if(err){ exileBot.sendMessage(msg.chat.id, "I'm sorry, but something went wrong when fetching your item. Try again, mayb...
[ "async extractText () {\n\t\tlet text = '';\n\t\tif (typeof this.html === 'string') {\n\t\t\ttext = this.textFromHtml(this.html);\n\t\t}\n\t\telse if (typeof this.text === 'string') {\n\t\t\ttext = this.text;\n\t\t}\n\t\tif (text) {\n\t\t\ttext = this.extractReply(text);\n\t\t}\n\t\tthis.text = text;\n\t}", "func...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Generates builtin values and types
function createBuiltIns() { currentScope.addLiteral(new Symbol({ type: SymbolTypes.BooleanLiteral, value: 'true', data: { type: 'bool' } })); currentScope.addLiteral(new Symbol({ type: SymbolTypes.BooleanLiteral, value: 'false', data: { type: 'bool' } })); }
[ "function initBuiltinVariables() {\n var result = {\n \"CONFIG\": {\n type: VariableTypeEnum.RESTRICTED_STRING_LIST,\n valueRange: initConfigVariableRange(),\n value: initConfigVariableValue(),\n canBeEmpty: true,\n platform: undefined,\n t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Revives (redraws) the single player screen This must be called after initSinglePlayerScreen() has been called This method does not create new Text Objects, but rather "revives" the Text objects by calling Phaser's revive() method on them
function showSinglePlayerStatScreen(){ //only run if we're on the multiplayer screen if(statScreen.ShowAll){ console.log("reviveSinglePlayerStatScreen"); hideMultiPlayerStatScreen(); statScreen.ShowAll = false; statScreen.SinglePlayer.CharacterName.revive(); var HEALTH_BAR_X = GAME_WIDTH + 10; ...
[ "function redraw(){\n\tscreenManager[screenManager.length - 1].update();\n}", "function redoScene() {\n drawBox(guiParams.mode);\n TW.render();\n}", "static refreshScreen() {\n Game.force_frame = true;\n }", "function remove_Start_Screen(){\r\n\t\t removeButton(gameButton);\r\n\t\t removeB...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
funcao para gerar tela de resposta com lista de todos os pedidos em aberto
async function telaRespostaListaTodosOsPedidosAbertos() { await aguardeCarregamento(true) let json = await requisicaoGET(`orders`, { headers: { Authorization: `Bearer ${buscarSessionUser().token}` } }), codigoHTML = ``; await aguardeCarregamento(false) codigoHTML += `<table class="table table-dark...
[ "async obtenerPedidos(req,res){\n\n try{\n //Busco los ID de todos los pedidos.\n let listaIdsPedido = await querysAdmin.findIdsPedidos();\n\n let arrayIds = [];\n //Guardo en un array solo los numeros de los pedidos.\n for(let i = 0; i < listaIdsPedido....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Call the world bank api to get the data for women in ministerial positions
function femMinistries(){ console.log('calling the function femMinistries'); $.ajax({ url: 'http://api.worldbank.org/v2/en/countries/WLD/indicators/SG.GEN.MNST.ZS?&MRV=1&format=json', type: 'GET', failure: function(err){ return alert ("Could not get the Data"); }, success: fu...
[ "function getData() {\n fetch(worldsAPI)\n .then(results => results.json())\n .then(results =>\n results.map(result => createWorlds(result))\n )\n} // getData end", "function getOWMData() {\n fetch(\n 'https://api.openweathermap.org/data/2.5/weather?q=Stuttgart,DE&APPID=5f867317a42e45aad8ac2fd5f92dde...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
FormCtrl() The todoform controller (input box).
function FormCtrl(todo, todoList) { var vm = this; /** * submit() * On submit of the input box. */ vm.submit = function() { // Take the form data, put it as an object var formData = { "text": vm.form.taskName, "priority": "low" }; // A...
[ "function FormController() {\n\t}", "function todoController(){\n\tvar todoCtrl = this\n\ttodoCtrl.list = [\"something\"]\n}", "function MCTForm() {\n return {\n // Only show at the element level\n restrict: \"E\",\n\n // Load the forms template\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Funcion que mete todas las edades de los integrantes en un array
function obtenerEdadesIntegrantes() { const $integrantes = document.querySelectorAll('.integrantes input'); const edades = []; for ( let z = 0; z < $integrantes.length; z++) { if ($integrantes[z].value === '') { continue } edades.push(Number($integrantes[z].value)); ...
[ "function obtenerEdadesYMedias(datosJugador) {\r\n\t\tvar edadesMedias = new Array(); \r\n\t\tvar mediasEdad = new Array(); \r\n\t\tvar mediasEdadSuperior = new Array();\r\n\t\t\r\n\t\t// Obtenemos las edades y la media real.\r\n\t\tvar edad = parseInt(datosJugador[\"edad\"]);\r\n\t\tvar edadSemanas = parseInt(dato...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
getLabels: send a request to server to have labels of the app and set labels state with them
getLabels() { axios.get(APP_URL + '/app/' + this.props.item.id_app + '/labels', { headers: { Authorization: 'Bearer ' + localStorage.getItem('token') } }) .then(response => response.data) .then(items => { if (items !== null)...
[ "function getLabelsFromServer() {\n axios.get('/api/labels')\n .then(({ data: allLabelObjects }) => {\n console.log(allLabelObjects);\n filterTickets(null, inputValueState)\n .then(result => {\n setlabelObjectList(allLabelObjects);\n })\n .catch(err => { c...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check if the tracking has been inited or not
_isTrackingInited() { return document.querySelector("script#s-front-gtm") !== null; }
[ "_initTracking() {\n var t, e, a, o;\n if (!this.isLegalAgree()) {\n !ar.is(\"production\") && !br() && console.log(\"<yellow>[SFront]</yellow> You have a <magenta>google tag manager (gtm)</magenta> setted but the <cyan>legal terms</cyan> are not agreed. Tracking <red>disabled</red>.\");\n return;\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Name: hidePanel Desc: Closes a panel. Params: theInstance the unique id of the panel to hide (i.e. 70r_screen, 'panel_')
function hidePanel(theInstance) { if (!document.getElementById) { return null; } document.getElementById("panel" + "_" + theInstance).style.visibility = "hidden"; }
[ "function hidePanel(theInstance) { \n if (!document.getElementById) {\n return null;\n }\n\n document.getElementById(\"panel\" + \"_\" + theInstance).style.visibility = \"hidden\";\n \n // Start Override: if we are hiding the imageViewer and it was displayed Inline, resizePanels\n if (theInstance == \"imag...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Show the new document folder entity dialog.
function showNewDocumentFolderEntityDialog(sourceNode, targetNode, position) { ensureFieldIds().then(function () { var targetNodeItem = getParentTargetNode(targetNode, position), options = { title: 'New Document Folder', ...
[ "function openCreateFolderDialog(){\r\n\t\t\r\n\t\tvar objDialog = jQuery(\"#uc_dialog_create_folder\");\r\n\t\tif(objDialog.length == 0)\r\n\t\t\tthrow new Error(\"The create folder dialog must be here\");\r\n\t\t\r\n\t\t//init fields\r\n\t\tjQuery(\"#uc_dialog_create_folder_name\").val(\"\");\r\n\t\t\r\n\t\t//oep...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Options used to construct an `HttpParams` instance.
function HttpParamsOptions() {}
[ "function HttpParamsOptions(){}", "function HttpParamsOptions() { }", "newParams() {\n return new _angular_common_http__WEBPACK_IMPORTED_MODULE_0__[\"HttpParams\"]({\n encoder: PARAMETER_CODEC\n });\n }", "function CreateRequestConfiguration(options){\n let params = opti...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A class that defines how a paddle behaves, including the ability to specify the input keys to move it up and down ///FIXED ERROR 5 (ACCORDING TO CONSOLE): Miss '//' before the comments///// Paddle constructor Sets the properties with the provided arguments or defaults ///END ERROR 5///// ///FIXED ERROR 7( ACCORDING TO ...
function Paddle(x,y,w,h,speed,downKey,upKey) { /////END FIXED ERROR 7///// this.x = x; this.y = y; /////FIXED ERROR 22: Mistype 'this.vx'///// this.vx = 0; /////END FIXED ERROR 22///// /////FIXED ERROR 21: Mistype 'this.vy'///// this.vy = 0; /////END FIXED ERROR 21///// this.w = w; this.h = h; ...
[ "function Paddle(x,y,w,h,speed,downKey,upKey) { /// FIXED the typo for the word paddle\n this.x = x;\n this.y = y;\n this.vx = 0; ///// FIXED typo vx\n this.yv = 0; ///// FIXED typo vy\n this.w = w;\n this.h = h;\n this.speed = speed; //// FIXED typo extra e\n this.downKey = downKey;\n this.upKey = upKe...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Reset the scroll position to the top left of the report.
function resetScroll() { var viewer = $find(viewerID); // Check the isLoading client-side property before using the reportAreaScrollPosition property. // Otherwise an exception will be thrown. if (!viewer.get_isLoading()) { viewer.set_reportAreaScrollPosition(new Sys.UI.Point(0,0)); } }
[ "function resetScroll() {\r\n // Set the element to it original positioning.\r\n setUnfixed();\r\n\r\n // Reset the last offset used to determine if the page has moved\r\n // horizontally.\r\n lastOffsetLeft = -1;\r\n\r\n // Capture the offset top of...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Store parsed tokens from redirect url
storeTokensFromRedirect() { var _this9 = this; return _asyncToGenerator(function* () { var { tokens } = yield _this9.token.parseFromUrl(); _this9.tokenManager.setTokens(tokens); })(); }
[ "async storeTokensFromRedirect() {\n const {\n tokens\n } = await this.token.parseFromUrl();\n this.tokenManager.setTokens(tokens);\n }", "storeTokensFromRedirect() {\n return __awaiter(this, void 0, void 0, function* () {\n const { tokens } = yield this.token.parseFromUrl();\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Given the idAge and idName tables, perform an outer join on the id.
_joinTables(idAge, idName) { let result = idAge.map(idA => { return {id: idA.id, age: idA.age, firstName: '', lastName: ''}; }); _.forEach(idName, idN => { let row = _.find(result, r => r.id === idN.id); if(row) { row.firstName = idN.firstName; row.lastName = idN.lastNam...
[ "leftJoin(tableName, aliasName, whereFunc, params) {\r\n var table = this._tableObj[tableName];\r\n this.db = Pdb.Query.tableJoin(this.db, \"left-join\", table, aliasName, whereFunc, params, this._tableObj);\r\n return this;\r\n }", "function usersLeftJoin(tableName){\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The fadeOut time of the amplitude envelope.
get fadeOut() { return this._fadeOut; }
[ "static fadeOut({ duration }) {\n const steps = 30;\n const interval = duration / steps;\n const stepSize = 1 / steps;\n let step = 0;\n\n Timer.setInterval('fadeout', () => {\n if (step >= 1) {\n Timer.clearInterval('fadeout');\n SoundPlayer.setVolume(MAX_VOLUME);\n TunePla...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Convenient function to create Motion objects
function motion(m) { var move = normalizeMotion(m); require(typeof move !== 'undefined', "Unknown motion " + repr(m)); return new Motion(move); }
[ "function createMotionComponent(_a) {\n var preloadedFeatures = _a.preloadedFeatures, createVisualElement = _a.createVisualElement, useRender = _a.useRender, useVisualState = _a.useVisualState, Component = _a.Component;\n preloadedFeatures && loadFeatures(preloadedFeatures);\n function MotionComponent(prop...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Verify email with token
verifyEmail(token) { if (token) { Accounts.verifyEmail(token, (err) => { if (err) this.setState({ success: false, errorMessage: err.reason, }); else this.setState({ success: true, ...
[ "async verifyToken(token, email) {\n\t\tconst { apiPath } = this.props;\n\n\t\tconsole.log('fetching...');\n\n\t\t// Pass the token and email to /verify API route\n\t\tconst res = await fetch(`${apiPath}/verify`, {\n\t\t\tmethod: 'POST',\n\t\t\theaders: {\n\t\t\t\t'Content-Type': 'application/json',\n\t\t\t},\n\t\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Random item or number from the matriz, only the number available
function randomNumberInArray(matriz) { return (matriz[Math.floor(Math.random() * matriz.length)]); }
[ "sample(){\n return this.cells[Math.floor(Math.random()*this.size)] ;\n }", "function randItem(selectedArray) {\n return selectedArray[Math.floor(Math.random()*selectedArray.length)];\n}", "randomise() {\r\n for(var mY = 0; mY < this.sizeY; mY++) {\r\n for(var mX = 0; mX < this.sizeX; mX++) {...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
READ Ler Aluno GET
async function lerAluno() { idAluno = document.querySelector("#numero").value; response = await fetch(bd + idAluno).then(response => { feedback(response.status, response.statusText); if (response.ok) { return response.json(); } else { return new Aluno(0, "", "", ...
[ "function getAngelData(path, cb) {\n var url;\n if (path !== null) {\n url = \"https://api.angel.co/1/\" + path;\n }\n\n https.get(url, function(res) {\n var body = '';\n res.on('data', function(chunk) {\n body += chunk;\n });\n\n res.on('end', function() {\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add to do list draggable
function addTodoListDraggableProperty() { $("#todo-container").draggable({ handle: "#todo-header", containment: "#background-borders", scroll: false, delay:0, start: function(event, ui) { //console.info("TODO draggable", event); }, stop: function(event, ui) { ...
[ "function tasksDraggable() {\n $(\".todo-item\").draggable({\n handle: '.draggable-action',\n connectToSortable: '.todo-list',\n revert: 'invalid',\n scroll: true,\n zIndex: 2500,\n scope: 'tasks',\n });\n}", "function fieldListDraggable($o){\n\t\t\t$o.draggable({\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Delete Invoice Line Item
deleteInvoiceLineItem(invoiceLineItemId){ deleteINVL({invlId: invoiceLineItemId}) .then(() => { this.dispatchEvent( new ShowToastEvent({ title: 'Success', message: 'Invoice Line Item Deleted successfully', variant: '...
[ "function removeItem() {\n const invoice = new Invoice();\n\n invoice.addInvoiceLine(new InvoiceLine(1, 10.21, 1, 'Orange'))\n .addInvoiceLine(new InvoiceLine(2, 10.99, 5, 'Banana'))\n .removeInvoiceLine(1);\n\n console.log('Remove Item: $' + invoice.getTotal().toFixed(2));\n}", "func...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds an "id" attribute to each slide containing the slide number. This enables hash fragment navigation (e.g.
addNumberToSlides(){ for(let i=0; i<this.list.length; i++){ this.list[i].id = `${i + 1}`; } }
[ "function idGenerator() {\n $(\".slides__img\").each(function(index, el) {\n $(this).attr(\"id\", \"slide_\" + index);\n });\n $(\".dots__single\").each(function(index, el) {\n $(this).attr(\"id\", \"dot_\" + index);\n });\n }", "function numberSlides(){\n let slides = document.querySelect...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
endregion Window_SumEvoFusSummon region Window_SumEvoFusSummonOutput The window for displaying the description of the selected item. This window shows the Image and Name of the Class being summoned, and the Cost of the Summon.
function Window_SumEvoFusSummonOutput() { this.initialize.apply(this, arguments); }
[ "function showTotalDamage() {\n const heroDamage = selectedHero.damage;\n const itemDamage = selectedItem.damage;\n let totalDamage = heroDamage + itemDamage;\n \n const damageHeading = document.querySelector('#damage');\n\n damageHeading.textContent = `${selectedHero.name}'s total damage with ${s...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Soal No. 3 Fungsi buatKalimat / Buatlah sebuah fungsi bernama buatKalimat(), yang akan memproses seluruh parameter yang diinput menjadi satu kalimat berikut: "Nama saya [Name], umur saya [Age] tahun, alamat saya di [Address], dan saya punya hobby yaitu [hobby]!" CONTOH: var name = "Agus"; var age = 30; var address = "J...
function buatKalimat(nama, umur, alamat, hobi) { // Code kamu mulai dari sini var kalimat = "Nama saya " + nama + ", Umur " + umur + " Bertempat tinggal di " + alamat + ", hobi saya " + hobi; // Tampilkan dengan cara document.getElementById("jawaban3").innerHTML seperti di CONTOH. ...
[ "function teriak() {\n // Tulis Code mulai di sini\n document.getElementById(\"jawaban1\").innerHTML = \"Aku Teriak\"\n // Tampilkan dengan cara document.getElementById(\"jawaban1\").innerHTML seperti di CONTOH.\n }", "function potongAwalanMe(kata){\n\tvar _2hurufAwal = kat...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
create_udim_tile(u, v, size, 'kayy')
function udim_to_artboard(udim, size) { u = (udim-1001) % max_col; v = Math.floor((udim-1001) / max_col) create_udim_tile(u, v, size, udim) }
[ "function PixelTile(cnv){\n\n\tvar w=this.width=cnv.width;\n\tvar h=this.height=cnv.height;\n\n\t//this.webcolorData16=d16||(new Uint16Array(new ArrayBuffer(w*h*2)))\n\t\n\tthis.image=new Canvas(w,h);\n\tthis.ctx=this.image.getContext(\"2d\");\n\tthis.ctx.drawImage(cnv,0,0);\n\tthis.imageData=this.ctx.createImageDa...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Retrieves the background check info for the specified user
async getBackgroundInfo(req, res) { const { applicationId } = req.query; const userId = req.user._id; try { const matchedBackgroundCheck = await BackgroundCheck.findOne({ applicationId, userId, }); if (!matchedBackgroundCheck) { return res.status(404).send({ ...
[ "async getServiceUserBackground({ request, response }) {\n try {\n const client = request.client;\n const data = await serviceUserBackgroundService.getUserBackground(\n client.id,\n );\n return util.sendSuccessResponse(response, {\n success: true,\n ...message.SUCCESS,\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Wraps a React component in a HotKeysIgnored component, which passes down the callbacks and options necessary for React Hotkeys to work as a single prop value, hotkeys. These must be unwrapped and applied to a DOMmountable element within the wrapped component (e.g. div, span, input, etc) in order for the key events to b...
function withIgnoreKeys(Component) { var hotKeysIgnoreOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { only: [], except: [] }; return (0, _withHotKeysIgnoreOverride.default)(Component, hotKeysIgnoreOptions, 'ignoreEvent'); }
[ "function withIgnoreKeys(Component) {\n\t var hotKeysIgnoreOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {\n\t only: [],\n\t except: []\n\t };\n\t return (0, _withHotKeysIgnoreOverride.default)(Component, hotKeysIgnoreOptions, 'ignoreEvent');\n\t}", "function KeyboardAcces...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
OperationType : one of query mutation subscription
parseOperationType() { const operationToken = this.expectToken(TokenKind.NAME); switch (operationToken.value) { case 'query': return OperationTypeNode.QUERY; case 'mutation': return OperationTypeNode.MUTATION; case 'subscription': return OperationTypeNode.SUBSCRIPTIO...
[ "parseOperationType() {\n const operationToken = this.expectToken(_tokenKind.TokenKind.NAME);\n switch (operationToken.value) {\n case 'query':\n return _ast.OperationTypeNode.QUERY;\n case 'mutation':\n return _ast.OperationTypeNode.MUTATION;\n case 'subscription':\n retur...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds a way point to the connection
addWayPoint(event, isManhatten) { let connectiontargettoadd; let point = MouseTool.getEventPosition(event); let isPointOnComponent = this.__isPointOnComponent(point); let isPointOnConnection = this.__isPointOnConnection(point); let target = ConnectionTool.getTarget(point); ...
[ "function writeConnection() {\n\t\tif (this.points != null) {\n\t\t\tvar line = document.createElement(\"v:polyline\");\n\t\t\tline.setAttribute(\"id\", this.id);\n\t\t\tline.setAttribute(\"points\", this.points);\n\t\t\tvar elem = document.getElementById(MAP).appendChild(line);\n\t\t\telem.style.pixelTop = 0;\n\t\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Insert a block break at the current selection. If the selection is currently expanded, it will be deleted first.
insertBreak(editor) { editor.insertBreak(); }
[ "insertSectionBreak() {\n let selection = this.viewer.selection;\n if (isNullOrUndefined(selection) || this.owner.isReadOnlyMode || selection.start.paragraph.isInHeaderFooter) {\n return;\n }\n this.initHistory('SectionBreak');\n if (!selection.isEmpty) {\n s...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Render on update Parma data: data , id : parent_id key in the loop must match the dom element id
function update_render( data, id) { $.each(data, function(key, value){ if(typeof(value) == 'object' ) update_render(value, id); $('#'+id).find('#'+key).html(data[key]); }); }
[ "function updateProjectId() {\n\n if (data.projects.length == 0)\n return;\n\n const domprojectitems = document.querySelectorAll('.projects_item_wrapper');\n\n for (let i = 0; i < data.projects.length; i++) {\n data.projects[i].id = i;\n domprojectitems[i].setAt...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
move to new file
function moveToNewFile(message) { console.log(message); }
[ "function move() {\n var filePath;\n filePath = path.resolve(__dirname + '../../../audio/' + file.name); \n console.log('resolution', filePath);\n console.log(file.path, 'to', filePath);\n \n fs.readFile(file.path, function(err, data) {\n if(err) throw err;\n fs.writeFile(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
write a function to get the color of the selected genres from the array and use it in the parallel coordinate
function getColor(genres) { var g=''; genres.forEach((item, i) => { if(selectedGenres.includes(item)) g=item; }); return genresFill[g]; }
[ "function genRed()\r\n{\r\n red.x = coordinate[cArray[0]][0];\r\n red.y = coordinate[cArray[0]][1];\r\n}", "function displayColor(array) {\n\n}", "get selectionColor() {}", "SetColorArray() {}", "function colorPos() {\r\n for (c = 1; c < color.length; c++) {\r\n // console.log(c + \" choice is \" ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Indicates the versionId of the downloaded blob version.
get versionId() { return this.originalResponse.versionId; }
[ "get versionId() {\n return this.getStringAttribute('version_id');\n }", "get versionId() {\n\t\treturn this.__versionId;\n\t}", "get versionId() {\n // Report the RTV.\n // TODO: Make this a more readable string.\n return this.opts.version;\n }", "setLastVersionId(version) { }", "get ve...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Parse abbreviation definitions, i.e. `[abbr]: description`
function parseAbbr(str, parserInline, options, env) { var state, labelEnd, pos, max, label, title; if (str.charCodeAt(0) !== 0x2A/* * */) { return -1; } if (str.charCodeAt(1) !== 0x5B/* [ */) { return -1; } if (str.indexOf(']:') === -1) { return -1; } state = new StateInline(str, parserInline, options, env...
[ "function parseAbbr(str, parserInline, options, env) {\n\t var state, labelEnd, pos, max, label, title;\n\n\t if (str.charCodeAt(0) !== 0x2A/* * */) { return -1; }\n\t if (str.charCodeAt(1) !== 0x5B/* [ */) { return -1; }\n\n\t if (str.indexOf(']:') === -1) { return -1; }\n\n\t state = new StateInline(str, par...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
5 Passing undefined vs other falsy values Even if the first argument is explicitly set to undefined(though not null or other falsy values), the value of the num argument is still the default
function test(num = 1){ console.log(typeof num); }
[ "function test(num = 1) {\n console.log(typeof num);\n }", "function defaultIfUndefined(val, def) {\n return typeof val === 'undefined' ? def : val;\n }", "function defaultFor(arg, val) {\n return typeof arg !== 'undefined' ? arg : val;\n}", "function foo(x = 3){\n console.log(x);\n}",...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Factory : make a function that will return a Promise wrapping the execution of the listener Allow to trigger the application only when needed + promisify the execution of this listener
makeApplier(details, listener) { return () => new Promise((resolve, reject) => { try { listener(details, resolve); } catch (err) { reject(err); } }); }
[ "spawnListener() {\n if (this.listener) throw new Error(\"EventEmitter is already started\");\n\n // Add events here, from the store here\n const self = this;\n this.listener = new PuppeteerEventListener({\n url: self.path,\n events: self.eventsMap,\n resolve: self.resolve\n })\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Builds message to send off to the API module for POST/PUT
buildMessageObject() { let id = document.querySelector("#entryId").value let userId = document.querySelector("#userMessageId").value userId = parseInt(userId) let messageObject = { "userId": userId, "message": document.querySelector("#message__Field").value, ...
[ "function set_message(url, method, params) {\n\t\tvar message = {\n\t\t\taction: url,\n\t\t\tmethod: (method=='GET') ? method : 'POST',\n\t\t\tparameters: (params!=null) ? OAuth.decodeForm(params) : []\n\t\t};\n\t\tmessage.parameters.push(['oauth_consumer_key', cfg.oauth_consumer_key]);\n\t\tmessage.parameters.push...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
parseParametedRoute looking for ":" parts in path for dynamic routes matching
parseParametedRoute(url) { var nBread = url.split('/'); var matched = {}; for (var i = 0; i < this.routes.length; i++) { var route = this.routes[i]; var routePath = route.path; var rBread = routePath.split('/'); if (rBread.length !== nBread.length)...
[ "static parseRoute(routeUrl) {\n\t\tlet piecesArr = [];\n\t\trouteUrl.split('/').forEach(piece => {\n\t\t\tpiece = piece.trim();\n\t\t\tif (piece[0] === ':') {\n\t\t\t\tpiecesArr.push({ type: 'parameter', name: piece.substr(1) });\n\t\t\t} else if (piece.length > 0) {\n\t\t\t\tpiecesArr.push({ type: 'text', value: ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Resets the game to its initial value, shuffles the cards and clears the local storage
function resetGame() { localStorage.setItem('Game.State', null); document.querySelector('.moves').textContent = "0"; if (cardDeck) { cardDeck.clear(); } cardDeck = new CarDeck(); cardDeck.shuffle(); bindClickEvent(); cardDeck.cards.forEach(card => { card.c...
[ "function resetGame() {\n cardShuffle();\n resetBoard();\n cardsInPlay = [];\n cardInPlayId = -1;\n}", "function resetGame() {\n\tresetClockAndTime();\n\tresetMoves();\n\tresetStars();\n\tshuffleDeck();\n\tresetCards();\n\tmatched = 0;\n\ttoggledCards = [];\n}", "function resetGame() {\n hideButton('reset-...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
JRObject Encapsulates an object w/ type adaptor for the ruby 'json' library
function JRObject (type, value, ignore_properties){ this.type = type; this.value = value; this.ignore_properties = (typeof(ignore_properties) != 'undefined') ? ignore_properties : ["toJSON"]; this.toJSON = function(){ var data = {}; for(p in this.value) if($.inArray...
[ "function JSONType() {}", "function JSON_ () {\n var self = this\n\n self.klass = JSON_;\n self.klass.super_.apply(self, arguments);\n\n self.engine = JSON;\n self.binary = false;\n}", "function json_to_object(jsonobj) {\n jsobject=JSON.parse(jsonobj); \n}", "function JsObject(value) {\n this.prope...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Imagine you are working on an application that provides movie streaming facility to customers in flights. Users on longer flights like to start a second movie right when their first one ends, but they complain that the plane usually lands before they can see the ending. So you're building a feature for choosing two mov...
function movies (flight_time, movie_lenghts){ let firstMovie, secondMovie = 0; let movieMap = new Map(); for(let i=0; i<movie_lenghts.length; i++){ firstMovie = movie_lenghts[i] // 210 secondMovie = flight_time - firstMovie //300 - 210 = 90 if(movieMap.has(secondMovie)) {...
[ "function canTwoMoviesFillFlight(movieLengths, flightLength) {\n\n // Determine if two movie runtimes add up to the flight length\n let seenMovieLengths = new Set();\n for (let i=0; i<movieLengths.length; i++){\n let firstMovie = movieLengths[i];\n let secondMovieLength = flightLength - firstMovie;\n if...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Only for reffrence ,what parameter want to pass as a constructor to load autocomplete dropdowen
function AutoCompleteConstructorParam() { //angular js current scope //Mandatory //DataType=Object Scope = "", //unique if of the control //Mandatory //DataType=string ControlId = "", //data source model name(array list) //Mandatory //DataType=string Dat...
[ "function setAutoComplete(){\n auto_comp = {\n serviceUrl:base_url+\"/admin/inventory/get_inventory_items_autocomplete\",\n /*lookup: function (query, done) {\n var result = {\n suggestions: lookUpValues\n };\n\n done(result);\n },*/\n\n\n onSelect: function (sugge...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add Text at cursor position inside a text area
insertAtCursor(textArea, myValue) { //IE support if (document.selection) { textArea.focus(); let sel = document.selection.createRange(); sel.text = myValue; } //MOZILLA and others else if (textArea.selectionStart || textArea.selectionStart == '0') { var startPos = textArea.sele...
[ "function insertAtCursor(textarea, text) {\r\n\r\n var startPos = textarea.selectionStart;\r\n\r\n var endPos = textarea.selectionEnd;\r\n\r\n textarea.value = textarea.value.substring(0, startPos) + \r\n\r\n text + \r\n\r\n textarea.value.substring(endPos, textarea.value.length);\r\n\r\n}", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
initialise draggable on markers.
function initDraggable() { // @hc with additional code from @kongondo var $wrappers = $('div.image_marker_main_wrapper'); $wrappers.each(function () { var $parent = $(this); var $fieldContainer = $parent.find('div.fieldContainer'); var $containment = $fieldContainer.find('img.marker_base_image'...
[ "initDraggable() {\n this.pieceEl.draggable({\n start: this.onStart.bind(this),\n //@ts-ignore\n stack: \".\" + this.puzzle.options.classes.piece,\n //@ts-ignore\n containment: this.puzzle.wrapperEl,\n //@ts-ignore\n /*snap:\".\"+th...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Plot using given selection (usually a single object, but allow for array)
function plot(sel) { sel.each(_plot); }
[ "function selection(){\n var dropDownMenu = d3.select(\"#selDataset\") \n var input = dropDownMenu.node().value;\n buildPlot(input)\n}", "chosen_plot() {\n this.createPlot();\n }", "function plotFunctions() {\n var valueSelect = d3.select(\"#selDataset\").node().value;\n panelPlot(valueS...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create localization service and register all bundles.
init_() { this.localizationService_ = getLocalizationService(this.storyAutoAdsEl_); const enXaPseudoLocaleBundle = createPseudoLocale( LocalizedStringsEn, (s) => `[${s} one two]` ); this.localizationService_.registerLocalizedStringBundles({ 'default': LocalizedStringsEn, 'ar': ...
[ "function buildLocalizationBundles() {\n var deferred = promises.defer();\n\n _this.context.i18n.buildBundles(_this, function(err, result) {\n if (err) {\n deferred.reject(err);\n } else {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Updater for the max => maxlength attr
set max(value) { Helper.UpdateInputAttribute(this, 'maxlength', value); }
[ "set max(value){Helper.UpdateInputAttribute(this,\"maxlength\",value)}", "textInputFieldLimits() {\n onKeyUp('limit', (event) => {\n var $target = data('counter'),\n limit = attr('maxlength'),\n count = event.value().length;\n\n $target.setValue(Math.max(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds soundtrack in user's collection
async addSoundtrackToDB(ctx, soundtrack) { if(ctx.getters.getSoundtracksId == '') { let docRef = await db.collection(auth.currentUser.uid); let data = { 0: soundtrack, soundtracks: true } docRef.add(data); } else { let docRef = await db.collection(...
[ "addSound () {\n if (window.sounds) {\n document.body.appendChild(this.sound);\n }\n }", "addTrack(track){\r\n this.tracks.push(track);\r\n \r\n }", "addSound(req, res) {\n if (req.session.user && req.cookies.user_sid) {\n const user = req.session.user;\n const sound = req.body;\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get X values for dataset (calculated by taking Y value and dividing it by total sum of all y values) add X and Y values to new array, which will be used to create graphs
function populateDataset(sum, array) { xArray = []; for (i = 0; i < array.length; i++) { xVal = array[i] / sum; xArray.push(xVal); } coordinates = [{ xCoordinates: xArray, yCoordinates: array }]; //console.log("coordinates object (y coordinates array):...
[ "transformData(dataset) {\r\n const totals = dataset[0].map((data, i) => {\r\n return dataset.reduce((memo, curr) => {\r\n return memo + curr[i].y;\r\n }, 0);\r\n });\r\n return dataset.map((data) => {\r\n return data.map((datum, i) => {\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
set the appropriate level number to the holder
function setLevelNumber(levelNumber){ if(levelNumber < 10){ level_number.html("0" + levelNumber); } }
[ "setlevel(){\n var midx = Math.floor(Map_Size / 2);\n var midy = midx;\n var dist = Room.getdistance(midx, midy, this.x, this.y);\n /**Room level */\n this.level = Math.ceil(dist) + 1;\n }", "function addLevel(){\r\n\tlevel + 1;\r\n\t}", "function resetLevel() {\n cu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Toggle button for enabling and disabling background mode
backgroundModeToggle() { /* If already enabled, disable, change button HTML, notify user */ if (cordova.plugins.backgroundMode.isEnabled()) { cordova.plugins.backgroundMode.disable(); bgButton.innerHTML = "Enable Background Mode"; let toast = Toast.create({ message: "Background Mode Dis...
[ "function bgMode() {\r\n if (bgModeButtonState == \"off\") {\r\n darkMode();\r\n } else if (bgModeButtonState == \"on\") {\r\n lightMode();\r\n }\r\n}", "function backgroundToggle(){\n if( $(\"#disable\").text() === \"Enable background color\"){\n backgroundEnabled = true;\n randBackground();\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function that checks the player's condition It checks if the player has fallen through the stage, his health and his life count
function checkPlayerCondition() { if (player.health < 1) { player.lives--; player.initCheckpoint(); } if (player.y > 1350) { Sounds.yell.play(); player.lives--; player.grounded = true; player.airborne = false; player.jumping = false; player.velY = 0; player.health = 3; if...
[ "function isAlive(activePlayer) {\n if (activePlayer.health > 0) {\n return true;\n }\n return false ;\n}", "checkHealthAndFood() {\n\n\n if (this.currPlayerHealth <= 0 || this.playerFood <= 0) {\n this.gameOver();\n }\n\n if (this.currPlayerHealth <= 25) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function for calculate Count and Price
function calculateCountPrice(element, count, price, singlePrice, num) { var priceElement = element.parentNode.parentNode.children[2].children[0]; var countElement = element.parentNode.children[1]; count = count + num; price = price + singlePrice; countElement.value = count; priceElement.innerHTML = price; }
[ "function calcularPrecioTotal (){\n let precioTotal = 0;\n for (properly of carrito){\n precioTotal += properly.price * properly.count;\n }\n precioTotal = precioTotal > discountLimit ? aplicaDescuentoCarrito(precioTotal) : precioTotal ;\n return precioTotal;\n}", "totlPrice() {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
PLACE A BUY ORDER
function placeBuyOrder (p) { }
[ "async function placeOrder({ price, side, size, productId = \"LTC-USD\" }) {\n let order = await client.rest.order.placeOrder({\n // price,\n size,\n product_id: productId,\n side,\n type: \"market\",\n });\n\n let secondsWaited = 0;\n\n while (!order.settled && secondsWaited < 10) {\n order =...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Determine whether the given properties match those of a `RelevanceProperty`
function CfnIndex_RelevancePropertyValidator(properties) { if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } const errors = new cdk.ValidationResults(); if (typeof properties !== 'object') { errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + ...
[ "function CfnRule_MatchPropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected an object, but received...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Query to find similar users based on a given IP address and serial number. Most of the logic is contained within the query, but some postprocessing is done in JavaScript.
async whois(ip, serial) { const numericIp = ip2long(ip); const classC = [ ip2long(ip.replace(/^(\d+)\.(\d+)\.(\d+)\.(\d+)$/, '$1.$2.$3.0')), ip2long(ip.replace(/^(\d+)\.(\d+)\.(\d+)\.(\d+)$/, '$1.$2.$3.255')), ]; const classB = [ ip2long(ip.replace(/^...
[ "function getUserByCustnumber (custnumber, callback) {\n var sql =\n `SELECT \n autoid,\n custnumber,\n altnum,\n momcustnum,\n title,\n firstname,\n lastname,\n company,\n address1,\n address2,\n city,\n LTRIM(RTRIM(state)) AS ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
3.1.2.1 OrdinaryHasOwnMetadata(MetadataKey, O, P)
function OrdinaryHasOwnMetadata(MetadataKey, O, P) { var metadataMap = GetOrCreateMetadataMap(O, P, /*Create*/ false); if (IsUndefined(metadataMap)) return false; return ToBoolean(metadataMap.has(MetadataKey)); }
[ "function OrdinaryHasOwnMetadata(MetadataKey, O, P) {\n var metadataMap = GetOrCreateMetadataMap(O, P, /*Create*/\n false);\n if (IsUndefined(metadataMap)) return false;\n return ToBoolean(metadataMap.has(MetadataKey));\n }", "function OrdinaryHasOwnMetadata(MetadataKey, O, P) {\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }