query
stringlengths
9
34k
document
stringlengths
8
5.39M
negatives
listlengths
19
20
metadata
dict
Context menu for Model Reference and Schema Mapping, but already with model reference annotations
function createContextMenuForModelReferenceAndSchemaMappingWithModelReferenceAnnotated(cy) { cy.cxtmenu({ selector: '.node-model-reference-and-schema-mapping-with-model-reference-annotated', commands: [ { content: 'Add Model Reference', select: function (...
[ "function createContextMenuForModelReferenceAndSchemaMappingWithLoweringSchemaMappingAndModelReferenceAnnotated(cy) {\n cy.cxtmenu({\n selector: '.node-model-reference-and-schema-mapping-with-lowering-and-model-reference-annotated',\n\n commands: [\n {\n content: 'Add Mode...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Delete canvas from DOM
deleteCanvas() { this.canvas.remove(); }
[ "removeCanvas() {\n const canvas = document.getElementById(Constants.CANVAS_ID);\n document.body.removeChild(canvas);\n }", "function del() {\n\tcanvas = document.getElementById('canvas');\n\tctx = canvas.getContext('2d');\n\tctx.clearRect(0, 0, canvas.width, canvas.height);\n}", "onRemove() {\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets a string preference
function betterdouban_setStringPreference(preference, value) { // If the preference is set if(preference) { var supportsStringInterface = Components.interfaces.nsISupportsString; var string = Components.classes["@mozilla.org/supports-string;1"].createInstance(supportsStringInter...
[ "function rosterprocessor_setStringPreference(preference, value)\n{\n // If the preference is set\n if(preference)\n {\n var supportsStringInterface = Components.interfaces.nsISupportsString;\n var string = Components.classes[\"@mozilla.org/supports-string;1\"].createInstance...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add notifications of autowithdrawn trades
function fixAutoWithdrawnTrade () { if (!unsafeWindow.io) { setTimeout(fixAutoWithdrawnTrade, 100); return; } let pendingTrades = new Collection("pendingTrades"); const hiddenTrades = new Collection("hiddenTrades"); const socketNotif = io.connect( "https://napi.neonmob.com/n...
[ "function _configureAutomaticUpdates() {\n window.addEventListener('message', function ccwidget_utilityTray(evt) {\n if (evt.data.type === 'utilitytrayshow')\n _automaticCheck(evt.data);\n });\n }", "_autoCheckingTrades() {\n if (process.argv.indexOf('debug') != -1 || this._autoCheckingT...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
create a new array loop theArray in reverse order add the item from each loop to the new array return the new array
function reverse(theArray){ const newArray = []; for (let i= theArray.length -1; i>= 0; i--){ newArray.push(theArray [i]); } return newArray; }
[ "function reverseArrayOrder(inputArray){\n // Reverse array order \n var outputArray = new Array();\n for(let i = 0; i < inputArray.length; i++){ \n \n outputArray.push(inputArray[inputArray.length-1-i]);\n }\n return outputArray;\n}", "function reverseArray(array) {\n var reversedArr = [];\n\nfor(let i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Flash AVR LED lights Inputs: t=time in seconds
function FlashLEDs(t) { if (t == flashTime) return; // don't flash twice in the same second var flashNew = (flashNum + 1) % flashPin.length; var cmd = "c."+flashPin[flashNum]+" 1;c."+ flashPin[flashNew]+" 0\n"; for (var i=0; i<2; ++i) { if (avrs[i]) avrs[i].SendCmd(cmd); ...
[ "function flash(led, time) {\r\n if (typeof time !== \"number\") {\r\n time = 500;\r\n }\r\n digitalWrite(led, true);\r\n setTimeout(function () {\r\n digitalWrite(led, false);\r\n }, time);\r\n}", "function flash() {\n digitalWrite(LED1,1);\n setTimeout(function() {\n digitalWrite(LED1,0);\n }...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Wrap the Given Shape in a Mesh
makeMesh(shape) { var geometry = new THREE.ShapeGeometry( shape ) var material = new THREE.MeshPhongMaterial( { color: 0x606066, emissive: 0x407000, shading: THREE.FlatShading, shininess: 0 } ); var mesh = new THREE.Mesh( geometry, material ) return mesh }
[ "generateMesh () {\n // Build the geometry associated with this factory\n let geometry = this.makeObjectGeometry()\n if (geometry === null) { return null }\n geometry.computeBoundingSphere()\n geometry.verticesNeedUpdate = true\n geometry.normalsNeedUpdate = true\n geometry.elementsNeedUpdate =...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A pushable subcomponent for Sidebar.
function SidebarPushable(props) { var className = props.className, children = props.children; var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()('pushable', className); var rest = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__lib__["b" /* getUnhandledProps */])(SidebarPushable, props); ...
[ "function SidebarPushable(props) {\n var className = props.className,\n children = props.children;\n\n\n var classes = (0, _classnames2.default)('pushable', className);\n var rest = (0, _lib.getUnhandledProps)(SidebarPushable, props);\n var ElementType = (0, _lib.getElementType)(SidebarPushable, props);\n\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function fills the dropdowns in the closeoutData div
function fillDropdowns_CLOSEOUT(data) { var json = JSON.parse(data['closeoutstatus']); var d = document.createDocumentFragment(); console.log('CLOSEOUT DATA = ', data); //sorts drop downs by id instead of alphabetical json.sort(function (a, b) { if (a.id < b.id) return -1; else if (a.id > b.id) retur...
[ "function fillDropdowns_CLOSEOUT(data)\n{\n\tvar json = JSON.parse(data[\"closeoutstatus\"]);\n\tvar d = document.createDocumentFragment();\n console.log(\"CLOSEOUT DATA = \", data);\n\tfor (var i = 0; i < json.length; i++)\n\t{\t\n\t\tvar option = document.createElement(\"option\");\n\t\toption.innerHTML=json[i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Start Side Bar functions
function openBar() { $(".dSideBar").width('250px'); $(".container").css({ 'margin-left': '250px' }); console.log('open nav') }
[ "createSideBar() {\n // create the background for the sidebar\n let graphics = this.add.graphics();\n\n graphics.lineStyle(2, 0x121111, 1);\n graphics.fillStyle(0x908C8C, 0.4);\n\n // create a rounded rectangle\n graphics.strokeRoundedRect(1100, 0, 430, 165, 38);\n g...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This is a function for updateRepositoryBuildNumber / Update the next build number that should be assigned to a pipeline. The next build number that will be configured has to be strictly higher than the current latest build number for this repository.
updateRepositoryBuildNumber(incomingOptions, cb) { const Bitbucket = require('./dist'); let apiInstance = new Bitbucket.PipelinesApi(); // String | The account // String | The repository // PipelineBuildNumber | The build number to update. /*let username = "username_example";*/ /*let repoSlug = "repoSlug_e...
[ "function updateBuildNumber(value) {\n exports.command(\"build.updatebuildnumber\", null, value);\n}", "function getNextVersion(version, branchName, buildNumber){\n var nextVersion = semver.major(version) + \".\" + semver.minor(version) + \".\" + semver.patch(version) + \"-\" + branchName + buildNumber;\n if...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Filter a collection of shapes to exclude paths that contain clip/erase arcs and paths that are hidden (e.g. internal boundaries)
function findUndividedClipShapes(clipShapes) { return clipShapes.map(function(shape) { var usableParts = []; forEachShapePart(shape, function(ids) { var pathIsClean = true, pathIsVisible = false; for (var i=0; i<ids.length; i++) { // check if arc was u...
[ "function findUndividedClipShapes(clipShapes) {\nreturn clipShapes.map(function(shape) {\n var usableParts = [];\n MapShaper.forEachPath(shape, function(ids) {\n var pathIsClean = true,\n pathIsVisible = false;\n for (var i=0; i<ids.length; i++) {\n // check if arc was used in fw or rev directio...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
gets the unique words and their count from the keyword array creates a dataArray used by the word cloud
function getCounts() { kwordArr.sort(); let currentWord = null; let cnt = 0; for (var i = 0; i < kwordArr.length; i++) { if (kwordArr[i] !== currentWord) { if (cnt > 0) { let word = { ...
[ "function makeWordcloud(input){\n var wordsArray = input.split(\" \");\n\n// word count to array\n var result = {};\n for (i = 0; i < wordsArray.length; i++) {\n if(wordsArray[i] in result){\n result[wordsArray[i]] += 1;\n }\n else {\n result[wordsArray[i]] = 1;\n }\n }\n drawWordCloud(r...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Reference to the Module Button API, if present
get moduleButtonAPI() { return this.moduleButtonEl ? $(this.moduleButtonEl).data('button') : undefined; }
[ "function EBX_ButtonUtils() {}", "function EBX_ButtonUtils() {\n}", "get moduleButtonEl() {\n return this.moduleButtonContainerEl.querySelector('button');\n }", "button() {\n return this.native.button();\n }", "_getButton (button) {\n if (this._buttons.hasOwnProperty(button)) {\n retur...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a copy of this query creator instance with the given plugin installed.
withPlugin(plugin) { return new QueryCreator({ ...this.#props, executor: this.#props.executor.withPlugin(plugin), }); }
[ "withPlugin(plugin) {\n return new SelectQueryBuilder({\n ...this.#props,\n executor: this.#props.executor.withPlugin(plugin),\n });\n }", "withPlugin(plugin) {\n return new UpdateQueryBuilder({\n ...this.#props,\n executor: this.#props.executor....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
LIBRARY Google Scripts utility functions and constants AdWords / Returns campaign object, or undefined on error
function getCampaign(name) { var camp = undefined; Logger.log("Get campaign '" + name + "'");//Logging to troubleshoot parsing selector error if (name && name.length>0) { var iterator = AdWordsApp.campaigns().withCondition("Name = '" + name + "'").get(); if ( iterator.hasNext() ) camp = iterator.next(); ...
[ "function main() {\n var currentAccount = AdWordsApp.currentAccount();\n var accountName = currentAccount.getName();\n \n Logger.log(\"Account: \" + accountName);\n \n var spreadsheet_url = 'https://docs.google.com/spreadsheets/d/1yCToteUPvD6xwBFX_Xorj09tW5Fav-DCxWllG5EqlhE/edit?usp=sharing';\n var spreads...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Given a string, return true if there are characters repeated, false if there are none. Input: "abcccccccd" Output: true Input: "apple 1231111" Output: true Input: ", .!" Output: true Input: "hi" Output: false
function hasRepeatingChars() { // }
[ "function hasRepeats(str) {\n var regExp = /(\\w)\\1/g;\n return regExp.test(str);\n}", "function hasRepeatingChars(str) {\n let frequencies = {};\n\n for (let char of str) {\n if (!frequencies[char]) frequencies[char] = 1;\n else return true;\n }\n\n return false;\n}", "function hasDuplicateCharact...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Acuerdo 2012 [4] estimado
function acuerdop2012(){ var aump=/*aump_2012||*/[0.15,0.09]; for(var g=0;g<=4;g++){ //Meses posteriores a abril de 2012 for(var m=23;m<tope_mes;m++){ //Recorro categorías for(var c=0;c<bas[g][0].length;c++){ ...
[ "function _diaHoy(opcion)\r\n{\r\n var Hoy= new Array(2);\r\n var fecha=new Date();\r\n Hoy[1]= fecha.getFullYear();\r\n Hoy[0]=(fecha.getDate()<10)? '0'+fecha.getDate(): fecha.getDate();\r\n Hoy[0]+=((fecha.getMonth()+1)<10)? '/0'+(fecha.getMonth()+1):'/'+(fecha.getMonth()+1);\r\n Hoy[0]+= '/'+Hoy[1];\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Update vertical position when filtering, i.e. hiding, nodes.
updateNodesVisibility () { let skipped; for (let i = Object.keys(this.columnCache).length; i--;) { skipped = 0; // Update `y` according to the number of previously skipped nodes. for (let j = 0, len = this.columnNodeOrder[i].length; j < len; j++) { if ( this.columnNodeOrder[...
[ "updatePosition(){\n\t\tlet activeRowCount = 0;\n\t\tlet tableHeight = 0;\n\t\tfor(let i = 0; i < this.table.length; i++){\n\t\t\tif(this.table.children[i].visible){\n\t\t\t\tactiveRowCount += 1;\n\t\t\t\tthis.table.children[i].y = (this.config.rowHeight * activeRowCount) - this.config.rowHeight;\n\t\t\t}\n\t\t}\n\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
MoneyTalks constructor `MoneyTalks` displays the earnings ("money") of players
function MoneyTalks() { /** * ### MoneyTalks.spanCurrency * * The SPAN which holds information on the currency */ this.spanCurrency = null; /** * ### MoneyTalks.spanMoney * * The SPAN which holds information about the money earned ...
[ "function oppPlayer(playerID, money, name, label) {\n this.id = playerID;\n this.bank = money;\n this.name = name;\n this.bet = 0;\n this.total = 0;\n this.label = label;\n this.betting = false;\n}", "function MoneyCard(text, type, amount, isToPlayers) {\n Card.call(this, text, type);\n \n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
construct URL to submit to google API to request time zone applicable in city
function makeURL(lat, lng) { var url = "https://maps.googleapis.com/maps/api/timezone/json?location="+ lat + "," + lng + "&timestamp=1331161200&key=AIzaSyDDzmZaROsHfgXjz6hv4JuBs0eGcvh3HBI"; timezn(url); return url; }
[ "function createURL() {\n let apiKey = 'AIzaSyDTuJCB4eWdnFlpf2_aqwMHI8B4KoDDscI'\n let urlAddress = address.replace(\" \",\"+\");\n let urlCity=city.replace(\" \",\"+\");\n return `https://maps.googleapis.com/maps/api/geocode/json?address=${urlAddress},${urlCity},${state}&key=${apiKey}`\n }",...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function calls the API and receives, the texts for each answer, as well as the users name and company
function getTexts(uuid, key) { const url = 'https://m3q-server.herokuapp.com/'; // const urlDev = 'http://localhost:5000/'; $.ajax({ url: url + "texts?uuid="+ uuid + "&key=" + key, method: "GET", headers: {"Access-Control-Allow-Origin": "*"}, success: function(response) { textsObject = respo...
[ "function getTextCompletionQuestions() {\n \n $.get(\"/api/textcompletionq\", function(data) {\n textcompletionquestions = data;\n textcompletionquestionsoriginal = data;\n \n //loop through questions to get the correct answers\n displayQuestions();\n getCorrectAnswers();\n });...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get's Weather ID property from the API and returns an image based on the property number.
function weatherCheck(id) { switch (id) { case "18": case "28": case "9": return ThunderImage; case "10": case "20": return CloudyNew; case "22": return Drizzle; case "21": case "23": case "24": return RainImage; case "1": case "11": case "19":...
[ "function getPokemonImage(id) {\n var obj;\n id = id + 1;\n $.ajax('http://pokemonapi-silenter.rhcloud.com/sprite/' + id, {\n async: false,\n complete: function(data) {\n obj = JSON.parse(data.responseText);\n }\n });\n return 'http://pokeapi.co' + obj.image;\n}", "async function getSpecificIma...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
every time I get a question correct, it will take me to this function which says you've got the question right and some pictures. This will also have a setTimeout function which will wait about 3 seconds and then move on to the next question. (trying not to add any functions within a function to create a recurison.... ...
function greatJob() { if (nextQuestion == questions.length - 1) { imagesHere = questions[nextQuestion][6]; //I needed to have these variables redefined again inside this function because having this outside in the global did not update the next question in this function. answerText = q...
[ "function nextQuestion(){\n // (re)sets styling on all 3 answer choices\n for(i=1;i<(quizInfo[i].answers.length+1);i++){\n $('#answer-'+i).css(\"border-color\",\"gray\").css(\"color\",'#555').css(\"background-color\",\"rgb(230, 230, 230)\").css(\"opacity\",\"1\");\n };\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
DotMarker A simple marker class using 7x7 dot images Derived from: BdccBlock IconOverlay Constructor DotMarker(point, image, info) point: GLatLng image: url to image info: array of information; first element is tooltip
function DotMarker(point, image, info) { this.point_ = point; this.image_ = image this.info_ = info; }
[ "addImageMarkerByxy(x, y, SpatialReference, imageUrl, title='', details='') {\n let marker = MapLayer.createImageMarker(imageUrl);\n this.addMarkerByxy(x, y, SpatialReference, marker, title, details);\n return marker;\n }", "function pointOverlay( p_icon, p_infoSkin, p_title, p_x, p_y, p_i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Given a line ending with dot, return the import paths of packages that match with the word preceeding the dot
getPackagePathFromLine(line) { const pattern = /(\w+)\.$/g; const wordmatches = pattern.exec(line); if (!wordmatches) { return []; } const [_, pkgNameFromWord] = wordmatches; // Word is isolated. Now check pkgsList for a match return this.getPackageImp...
[ "function getImportPath(line) {\n const importMatch = line.match(IMPORT_LINE);\n return importMatch ? importMatch[1] : null;\n}", "async scanForImportPath() {\n // import * from '...'\n // import abc from '...'\n // import '...'\n let modulePath = this.match(/import\\s+(?:(?:\\w+|\\*...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns true if the text contained within the variable "checkText" contains the word contained within the variable "startWord"
function startsWith(checkText, startWord){ if(checkText.indexOf(startWord) == 0){ return true; } else{ return false; } }
[ "function startsOrEndsWith(checkText, checkWord){\n\t\tif(checkText == undefined || checkText == null || checkWord == undefined ||checkWord == null){ //one or more of the parameters does not contain any data\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif(startsWith(checkText, checkWord) || endsWith(checkText, checkWord)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Builds a 'deck' of the files in the development file. Files are added according to multiplicity speciified in each file. Returns the deck as a list.
function createDeck() { let deck = []; let files = fs.readdirSync("development/"); for (let i = 0; i < files.length; i++) { let curFile = files[i]; // skips hidden files on Mac if (curFile.startsWith(".")) { continue; } let fileName = "development/" + curFile; let info = fs.readFileSync(fileName, '...
[ "function buildDeck() {\n let shape=[\"oval\", \"rectangle\", \"wave\"];\n let color=[\"red\", \"blue\", \"green\"];\n let number=[1, 2, 3];\n let style=[\"hatched\", \"fully colored\", \"outlined\"];\n let deck=[];\n //easy itteration through all the possibilties\n //doesnt look that great but gets the job ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Perform a breadthfirst search over the AST while keeping track of the containing scope until the filter function `key` returns true. The scope is returned.
function findScope(tree, key) { var q = [] , scope , info , node // Queue node for processing. function push(node) { q.push({node: node, scope: scope}) } push(tree) while ((info = q.pop())) { node = info.node scope = info.scope // Stop processing and return the scope if this ...
[ "function breadthFirstSearch(root, targetVal) {\n\n}", "findFirst(key) {\n let node = treeFind(this.root, key);\n let preNode = treePredecessor(node);\n while (preNode !== NIL && preNode.key === key) {\n node = preNode;\n preNode = treePredecessor(preNode);\n }\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Generating dynamic cards for animal cards
function animalCards(nums) { for(let i=0; i<=nums;i++) { let dynamicDiv = createDivAnimal(i) dynamicDiv.style.backgroundImage = `url(${animalImages[i]})`; dynamicDiv.setAttribute('id', i) dynamicDiv.innerHTML = `${animalNames[i]}` animalEl.append(dynamicDiv); } }
[ "function generateCards() {\n dubbleCards.forEach((card) => {\n const image = createCard(card.image, card.type);\n container.appendChild(stringToHTML(image));\n })\n}", "function generateCards() {\n cards = cardTypes.reduce((array, type) => {\n array.push(type, type);\n return arr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
First list must be the list in which we're looking for, list2 must contain the values that we're looking
function getRepeatedValues(list1, list2) { var lookup = {}; var vals = {} vals.repeated = [] vals.notRepeated = [] for ( var j in list2) { lookup[list2[j]] = list2[j]; } for ( var i in list1) { if (typeof lookup[list1[i]] != 'undefined') { vals.repeated.push(list1[i]) } else { vals.notRepeated.push...
[ "function getListDiff ( arg0_list, arg1_list ) {\n var\n first_list = castList( arg0_list, [] ),\n second_list = castList( arg1_list, [] ),\n list_1, list_2;\n\n list_1 = first_list[ vMap._filter_ ](\n function ( data ) {\n return second_list[ __indexOf ]( data ) === __n1;\n }...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
returns the number of bits available for code words
_getCodeWordsBits(version) { const that = this; let versionBits = that._getValuesTable()[version]; let bitsCount = 16 * version * version + 128 * version + 64; if (version > 6) bitsCount -= 36; if (versionBits[2].length) { // alignment patterns bits...
[ "function bnBitCount(){var r=0,x=this.s&this.DM;for(var i=0;i<this.t;++i)r+=cbit(this[i]^x);return r}", "function bnBitCount(){\nvar r=0,x=this.s&this.DM;\nfor(var i=0;i<this.t;++i){r+=cbit(this[i]^x);}\nreturn r;\n}", "function countBits(n) {\n return n === 0 ? 0 : n.toString(2).match(/1/g).length;\n}", "_g...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Clear a specific error when passed. If the index was informed, try to search the error through that index name.
clear(field, index) { let error = this.findErrorBy(index); if (field && error) { delete error[field]; return; } this.errors = {}; }
[ "function clearError() {\n setError('');\n }", "clearError(){this.error=!1;this._errortext=this.__initalErrorText}", "function clearError() {\n return setError('');\n }", "clearError() {\n this.error = false;\n this._errortext = this.__initalErrorText;\n }", "function resetErrMsg(){\n\t\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Reads from the pileup are only partially parsed; parse everything know
function parseReadData (sam_read) { var i, f = sam_read.buffer.split('\t'), read = { name: sam_read.name, flag: sam_read.flag, length: sam_read.l_seq, pos: sam_read.pos - 1, cigar: sam_read.cigarString, cigarOps: sam_read.cigarOps, mapq: pars...
[ "function parse (pgn) {\n const tags = parseTags(pgn)\n const moveData = tokenizeLines(pgn)\n const turns = parseRecursively(moveData)\n let pieces\n if (tags.FEN && tags.SetUp === '1') {\n pieces = toPieces(tags.FEN)\n } else {\n pieces = JSON.parse(defaultPieces)\n }\n const star...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds a click listener on the publisher signin button.
static addClickListenerOnPublisherSignInButton_() { self.document .getElementById(PUBLISHER_SIGN_IN_BUTTON_ID) .addEventListener('click', (e) => { e.preventDefault(); callSwg((swg) => swg.triggerLoginRequest({linkRequested: false})); }); }
[ "static addClickListenerOnPublisherSignInButton_() {\n self.document.getElementById(PUBLISHER_SIGN_IN_BUTTON_ID).addEventListener('click', e => {\n e.preventDefault();\n logEvent({\n analyticsEvent: _api_messages.AnalyticsEvent.ACTION_SHOWCASE_REGWALL_EXISTING_ACCOUNT_CLICK,\n isFromUserA...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Parses the given DOT string into a graph and performs some intialization required for using the rank algorithm.
function parse(str) { var g = dot.parse(str); // The rank algorithm requires that edges have a `minLen` attribute g.eachEdge(function(e, u, v, value) { if (!('minLen' in value)) { value.minLen = 1; } }); return g; }
[ "function convertDotFile(original) {\n\tvar nodeKeys = [];\n\tvar nodeLabels = [];\n\tvar nodePreds = [];\n\tvar linkSrcs = [];\n\tvar linkTars = [];\n\tvar edgeLabels = [];\n\n\tvar lines = original.split(\"\\n\");\n\tfor (var i = 0; i < lines.length; i++) {\n\t\tvar splitLines = lines[i].split(\";\");\n\n\t\tfor ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Figure out which application to work on
get app() { let result; // Explicit command line if (this.appOption) { result = profile_1.toDefaultApp(this.appOption); if (!result) { throw new Error(`'${this.appOption}' is not a valid application id`); } // Environment variable ...
[ "function IdentifyMSApplications() { }", "getActiveApp() {\n const mountedApps = singleSpa.getMountedApps();\n for (let i = 0; i < mountedApps.length; i++) {\n const app = mountedApps[i];\n if (this.apps[app] !== undefined) {\n return this.apps[app];\n }\n }\n }", "function getAp...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Handle user request to display certificate details
function viewCertButtonClick() { gSecHistogram.add(gNsISecTel.WARNING_BAD_CERT_CLICK_VIEW_CERT); if (gCert) viewCertHelper(this, gCert); }
[ "function inspectCert() {\n\n var cert = certificate;\n var html = '<div id=\"certificate-viewer\"><h2>' + msg.yourCertificate + '</h2><table>';\n html += '<tr><th>' + msg.certCanonicalName + '</th><td>' + cert.commonName + '</td></tr>';\n html += '<tr><th>' + msg.certOrganization + '</th><td>' + cert.o...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
(second argument). Return the truncated string with a "..." ending. Note that the three dots at the end add to the string length. If the num is less than or equal to 3, then the length of the three dots is not added to the string length.
function truncate(str, num) { if(num <= 3){ return str.slice(0, num) + "..." } if (str.length < num || str.length === num) { return str; } else if (str.length > num) { return str.slice(0, num - 3) + "..." } }
[ "truncate(str, num) {\n let tail = ''\n if (str.length >= num) {\n tail = '...'\n }\n if (num <= 3) {\n return str\n } else {\n return (str.substring(0, num - 3) + tail)\n }\n }", "truncate(str, num) {\n if (num <= 3) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Public function `null`. Returns true if `data` is null, false otherwise.
function isNull (data) { return data === null; }
[ "function isNull(data) {\n return data === null;\n }", "function isNull(data) {\n return data === null;\n }", "function isNull(data) {\n return data === null;\n}", "function assigned(data) {\n return data !== undefined && data !== null;\n }", "function assigned(data) {\n return data ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Whether the player has a x z intersect with the platform
function intersectPlatform(platform) { var r = ((platform.position.x - c_PlatformSize[0] / 2 <= player.position.x) && (platform.position.x + c_PlatformSize[0] / 2 >= player.position.x) && (platform.position.z - c_PlatformSize[2] / 2 <= player.position.z) && (platform.position.z + c_PlatformSize[2] / 2 >= pl...
[ "function collide (state, x, y, z0, z1) {\n if (z1 === undefined) {\n z1 = z0 + EPS\n }\n\n for (var i = 0; i < state.models.length; i++) {\n if (state.models[i].intersect(x - PW, x + PW, y - PW, y + PW, z0, z1)) return true\n }\n\n return false\n}", "_isPassingThroughPlatformSides(obj, platform) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get paths for data/methods/quest.json journal entries.
function getQuestJournalIconPaths() { const quests = require('../../data/methods/quests.json'); const paths = []; Object.values(quests).reduce((arr, nodeGroup) => ([ ...arr, ...nodeGroup.map(quest => quest.iconPath) ]), []).forEach(iconPath => { const mappedPath = mapIconPath(iconPath); if (p...
[ "static updateQuests() {\n if (!game.user.isGM) return;\n const rootFolder = QuestFolder.get('root');\n let questDirs = {\n active: '_fql_active',\n completed: '_fql_completed',\n failed: '_fql_failed',\n hidden: '_fql_hidden'\n };\n\n for (let key in questDirs) {\n const val...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Load the room list in the left side.
function loadRoomList() { getAllRooms(); getJoinedRooms(); getChatRoomUsers(); }
[ "function list_room_left() {\n jQuery.each(data_room, function(key, value) {\n if (key != 8888 & key != 9999) {\n var tmp = option_room_left;\n if (typeof (value.name) != 'null') {\n tmp = tmp.replace(\"[XX_ROOM_XX]\", value.name);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Modules have a unique scope perphase. We compile each module once at phase 0 and store the compiled module in a map. Then, as we ask for the module in a particular phase, we add that new phasespecific scope to the compiled module and update the map with the module at that specific phase.
getAtPhase(rawPath, phase, cwd) { let rawStxl = arguments.length <= 3 || arguments[3] === undefined ? null : arguments[3]; let path = rawPath === '<<entrypoint>>' ? rawPath : this.context.moduleResolver(rawPath, cwd); let mapKey = `${ path }:${ phase }`; if (!this.compiledModules.has(mapKey)) { ...
[ "getAtPhase(rawPath, phase, cwd, rawStxl = null) {\n let path = rawPath === '<<entrypoint>>' ? rawPath : this.context.moduleResolver(rawPath, cwd);\n let mapKey = `${path}:${phase}`;\n if (!this.compiledModules.has(mapKey)) {\n if (phase === 0) {\n let stxl = rawStxl != null ? rawStxl : this.lo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
convert form data to array of key value, key is inputName, value is input value
getFormDataToKeyValue(form) { let formData = []; for (let i = 0; i < form.elements.length; i++) { let element = form.elements[i]; formData.push(element.name + "=" + element.value); } return formData; }
[ "function form2Array(form_name) {\n var form_array = {};\n $('form :input[name^=\"' + form_name + '[\"]').each(function (id, object) {\n // INPUT name is in the form of \"form_name[value]\", get value only\n form_array[\n $(this)\n .attr('name')\n .substr(\n form_name.length + 1,...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
rent paid by payee to owner
_rentPaid (data) { this.playersData[data.owner].addFunds(data.rent); this.playersData[data.payee].removeFunds(data.rent); }
[ "function PayActors() {\nfor(var i=0; i<rentals.length; i++) {\n Pay(rentals[i]);\n }\n}", "repaymortage() {\n if (this.canrepaymortage()) {\n this.owner.payAmmount((this.pricetopay[0] / 2) * 1.10);\n }\n }", "function pay() {\n const preapprovalKey = paymentMethod.token;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Clones the bookmark element box.
clone() { let span = new BookmarkElementBox(this.bookmarkType); span.name = this.name; span.reference = this.reference; if (this.margin) { span.margin = this.margin.clone(); } span.width = this.width; span.height = this.height; return span; ...
[ "addNewBookmark() {\n this._editor.classList.add(\"visible\");\n this._deleteButton.classList.add(\"hidden\");\n this._editBookmarkID = null;\n this._title.textContent = \"Add New Bookmark\";\n\n this._resetFields();\n }", "function copyCodeDiv(itemCopyBox, whereCopyBox){\n\n whereCopyBox.em...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
FUNCTION TO HANDLE REQUEST TO CREATE A NEW VENDOR
function createNewVendor(req, res) { // RETURN OBJECT STRUCTURE var returnObject = { vendor: null, statusCode: null, message: null }; // RETURN STATUS CODES var VENDOR_CREATED_SUCCESSFULLY_CODE = 1; var SERVER_ERROR_RETURN_CODE = 2; var MISSING_VENDOR_NAME_CODE = 3;...
[ "create (req, res) {\r\n res.json({ message: 'create a new vendor' })\r\n }", "function createVendor () {\n return new Promise(function (resolve, reject) {\n Dialog.create({\n title: 'Create a new Vendor',\n form: {\n name: {\n type: 'textbox',\n label: 'Name',\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Opdracht getDetails moet "Mijn naam is "voornaam" "achternaam" en ik ben "leeftijd" jaar oud" geven. Hier in zet je je eigen gegevens.
function getDetails() { }
[ "function itemDetails(artikelid){\n var index = getItemIndexDBBeverages(artikelid);\n\n var details = {\n name: DB2.spirits[index].namn, // name on item\n details: DB2.spirits[index].namn2, //Details about item\n info: DB2.spirits[index].leverantor, // company, year, what type\n st...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
7) Write a JavaScript program to display the city name if the string begins with "Los" or "New" otherwise return blank. 8) Write a JavaScript program to compute the sum of three elements of a given array of integers of length 3.
function sumOfThree(numbers){ return numbers[0] + numbers[1] + numbers[2]; }
[ "function city (a){\n let str = a.slice(0, 3);\n if (str === \"Los\"){\n return \"Los Ageles\"\n } else if (str === \"New\"){\n return \"New York\"\n } else {\n return \"blank\"\n }\n}", "function displayCity(a){\n if(a.slice(0,3) === 'Los' || a.slice(0,3) === 'New'){\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check whether we know the video dimensions yet, if so, start BRFv4.
function onStreamDimensionsAvailable () { console.log("onStreamDimensionsAvailable"); if (webcam.videoWidth === 0) { setTimeout(onStreamDimensionsAvailable, 100); } else { // Resize the canvas to match the webcam video size. ...
[ "hasFrameSize() {\n return this.frameSize != VideoData.FRAME_SIZE_NOT_READY;\n }", "function isDetectSizeDone()\n{\n\t//check if we are not yet done detecting\n\n\tvar videoDim = getVideoProps();\n\n\tif ((videoDim != null) && (videoDim.length > 0))\n\t{\n\t\tif ((videoDim[0] != null) && (videoDim[1] != null)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
======================================================================== Private Methods: Create a function called by a timer, which requests the registered requests calling the stored callback on receipt. jolokia and jobs are put into the closure
function callJolokia(jolokia,jobs) { return function() { var errorCbs = [], successCbs = [], i, j, len = jobs.length; var requests = []; for (i = 0; i < len; i++) { var job = jobs[...
[ "function callJolokia(jolokia,jobs) {\n return function() {\n var errorCbs = [],\n successCbs = [],\n i, j;\n var requests = [];\n for (i in jobs) {\n if (!jobs.hasOwnProperty(i)) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
make a through stream that is delayed by one tick
function tick () { var stream return stream = through(function (data) { process.nextTick(function () { stream.emit('data', data) }) }, function () { process.nextTick(function () { stream.emit('end', data) }) }) }
[ "function createDelayedStream() {\n //\n // Make a new plain vanilla readable stream\n //\n var delayed_stream = new Stream();\n delayed_stream.readable = true;\n\n //\n // Set an interval to emit every 10ms or so\n //\n var interval = setInterval(function () {\n var current = fixture_send.shift();...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
default interceptor for request
addDefaultRequestInterceptor() { this.axiosInstance.interceptors.request.use((config) => { let need = Object.keys(this.option.auth).length > 0 if (need) { const timestamp = Date.now() let query = {} const array = config.url.split('?') if (array.length > 1) { query = qs.parse(array[1]) ...
[ "addDefaultRequestInterceptor() {\n\t\tthis.axiosInstance.interceptors.request.use((config) => {\n\t\t\tconfig.headers = this.getRequestHeaders()\n\n\t\t\treturn config\n\t\t}, (err) => {\n\t\t\treturn Promise.reject(err);\n\t\t});\n\t}", "applyInterceptorRequest(handler) {\n this.http.interceptors.request.use...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
adds Lists to array of Lists based on activities
function listActivities (activitiesArray, allListsArray, lists){ var activity; var pushMe; for (var i = 0; i < activitiesArray.length; i++) { for (var j = 0; j < allListsArray.length; j++) { activity = activitiesArray[i]; if (activity === allListsArray[j].listName){ pushMe = allListsArray[...
[ "function getActivityList(activities) {\n var activityList = new Array();\n var lowTime = 25;\n var highTime = -1;\n\n for (var j=0; j < activities.length; j++) {\n var activity = activities[j];\n\n var name = activity.getAttribute('name');\n var id = activity.getAttribute('id');\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Given two rotations, e1 and e2, expressed as quaternion rotations, figure out the equivalent single rotation and stuff it into dest. This routine also normalizes the result every RENORMCOUNT times it is called, to keep error from creeping in. NOTE: This routine is written so that q1 or q2 may be the same as dest (or ea...
function add_quats(q1, q2) { var t1 = [], t2 = [], t3 = [], tf = []; var dest = []; t1[0] = q1[0]; t1[1] = q1[1]; t1[2] = q1[2]; t1 = vscale(t1, q2[3]); t2[0] = q2[0]; t2[1] = q2[1]; t2[2] = q2[2]; t2 = vscale(t2, q1[3]); t3 = vcross(q2,q1); tf = vadd...
[ "function delta(a, b) {\n // the quaternion q' = q1^(-1) * q2 can rotate from q1 orientation to the q2 orientation\n return multiply(inverse(a), b);\n}", "slerp(q2, blend) {\n blend = Math.clamp(blend, 0, 1);\n\n // if either input is zero, return the other.\n if (this.lengthSq() === 0)\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
the charset of this folder attribute ACString charset;
get charset() { return true; }
[ "getCharset(contentTypeStr) {\n return EnigmailMime.getParameter(contentTypeStr, \"charset\");\n }", "getCharset() {\n return this.charset;\n }", "function getFullCharset(spec){return spec.charset;}", "getEncoding() {}", "function charset(type) {\n const m = EXTRACT_TYPE_REGEXP.exec(type);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns an object mapping from every known type in the defCache to the most specific supertype whose name is an own property of the candidates object.
function computeSupertypeLookupTable(candidates) { var table = {}; var typeNames = Object.keys(defCache); var typeNameCount = typeNames.length; for (var i = 0; i < typeNameCount; ++i) { var typeName = typeNames[i]; var d = defCache[typeName]; if (d.fin...
[ "function computeSupertypeLookupTable(candidates){var table={};var typeNames=Object.keys(defCache);var typeNameCount=typeNames.length;for(var i=0;i<typeNameCount;++i){var typeName=typeNames[i];var d=defCache[typeName];if(d.finalized!==true){throw new Error(\"\"+typeName);}for(var j=0;j<d.supertypeList.length;++j){v...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
end of LoginButton LoginManager constructor that creates an object that is used to manage the state of the login page.
function LoginManager() { /* Loging Properties */ this._loginBtnId = LoginManagerSettings.loginBtnId; this._loginBtnId_pressedClass = LoginManagerSettings.loginBtn_pressedClass; this._showRememberMe = LoginManagerSettings.showRememberMe; this._rememberMe = false; this._...
[ "function wbLogin(){\n\tthis.submitFrm = _wbLoginSubmitFrm\n\tthis.changePage = _wbLoginChangePage\n\tthis.selectCurrLang = _wbLoginSelectCurrLang\n\tthis.init = _wbLoginInit\n}", "constructor() { \n \n LoginResponse.initialize(this);\n }", "function LoginAPI()\n {\n /* Login API Properties...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
multiple book authors selected
function handleMulti_book_author(selectedMulti) { setselectedMulti_author(selectedMulti) }
[ "function addAuthors(authors){\n $(authors).each(function(index,author){\n var authorOption=\"<option value='\"+author.Name+\"'>\"+author.Name+\"</option>\";\n $(\"#selectAuthors\").append(authorOption);\n });\n }", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Notify the socket that the context menu action failed. This is a generic way of sending an error message for context menu actions.
function sendErrorCM(socket, data, errorMsg){ socket.emit("context_menu_click_result", { key:data.key, // The name of the context menu action. result:false, error:errorMsg // The reason it failed. }); }
[ "function sendError() {\n messageDict = {};\n messageDict[messageKeys.Error] = 1;\n sendAppMessage(messageDict);\n}", "function notifyUserFail() {\r\n var msg = \"\";\r\n msg += \"The software installation has failed.\";\r\n\r\n try {\r\n\tnotify(msg);\r\n } catch (e) {\r\n\terror(\"Unable to notif...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds a list of tags as the datalist for the search bar
function addTagsToDataList(result) { const list = document.getElementById('tag-results'); for (let tag of result) { const tagSelection = document.createElement('OPTION'); tagSelection.text = tag.name; list.appendChild(tagSelection); } }
[ "function InitTags() {\n $(\"#taglist\").children(\".custom-option-tag\").each(function() {\n if ($(this).val() !== \"\") {\n $(\".custom-search-tag-container\").append($(\"<li class=\\\"list-inline-item custom-search-tag\\\">\" +\n \"<span class=\\\"badge badge-p...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Unloads the record from the store. This will cause the record to be destroyed and freed up for garbage collection.
unloadRecord() { if (this.isDestroyed) { return; } this._internalModel.unloadRecord(); }
[ "unloadRecord() {\n if (this.isDestroyed) {\n return;\n }\n this._internalModel.unloadRecord();\n }", "unloadRecord() {\n if (this.isDestroyed) {\n return;\n }\n\n this._internalModel.unloadRecord();\n }", "storeWillUnload () {\n Record.parent.destroy.cal...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Helper: prevents body shift.
function preventBodyShift(add){ if(alertify.defaults.preventBodyShift && document.documentElement.scrollHeight > document.documentElement.clientHeight){ if(add ){//&& openDialogs[openDialogs.length-1].elements.dialog.clientHeight <= document.documentElement.clientHeight){ ...
[ "function preventBodyShift(add){\n if(alertify.defaults.preventBodyShift && document.documentElement.scrollHeight > document.documentElement.clientHeight){\n if(add ){//&& openDialogs[openDialogs.length-1].elements.dialog.clientHeight <= document.documentElement.clientHeight){\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Compare A with Memory Stack Relative Indirect Indexed Y 0xD3
function _cmpASRIndirectY() { this.name = "Compare A with Memory Stack Relative Indirect Indexed Y" this.argCount = 0; this.size = Size.MEMORY_A; this.addrMode = AddressingMode.DIRECT_PAGE_INDEXED_INDIRECT_Y; this.mnemonic = 'CMP' }
[ "function _cmpADPX() {\n\tthis.name = \"Compare A with Memory Stack Relative Indirect Indexed Y\"\n\tthis.argCount = 0;\n\tthis.size = Size.MEMORY_A;\n\tthis.addrMode = AddressingMode.DIRECT_PAGE_INDEXED_X;\n\tthis.mnemonic = 'CMP'\n}", "function _cmpAAbsoluteX() {\n\tthis.name = \"Compare A with Memory Absolute ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Condition builder for number less than or equal to
numLte(key, value) { debug('Number property less than or equal to condition'); debug('key - %s, value - %s', key, value); return new RangeQuery(key).lte(value); }
[ "function lessOrEqual(num) {\n if (num > 5) {\n return \"True\";\n }\n return \"False\";\n}", "numLt(key, value) {\n debug('Number property less than condition');\n debug('key - %s, value - %s', key, value);\n return new RangeQuery(key).lt(value);\n }", "lessThan(number) ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Author: [A.A] Name: _lvMetricsItemInvoked Description: click on list metrics Params: Evt click Return: No one
function _lvMetricsItemInvoked(e) { var currentItem = e.detail; graphInfo.metric = currentItem.itemPromise._value.data.name; graphInfo.graphToSend.graph.measure = currentItem.itemPromise._value.data.id; RightMenu.showRightMenu(Pages.addSerieResumeStep, null); }
[ "function _bindDataMetrics(metrics) {\n WinJS.UI.setOptions(lvMetrics.winControl, {\n itemDataSource: new WinJS.Binding.List(metrics).dataSource,\n oniteminvoked: _lvMetricsItemInvoked\n });\n }", "function onListItemClick(e) {\n\n //scrollToTop(e);\n var\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Doubles your scrolls at a 60% chance, you lose a random amount on fail Cooldown: 60 seconds
function darkQuest() { // Quest ID: 1 if (CDs[1].t < 0 && gold >= CDs[1].price) { gold -= CDs[1].price; let die = Math.floor(Math.random() * 2 + 0.20); let n = scrolls.shares.length if (die == 1) { for (i = 0; i < n; i++) { scrolls.shares.push(0); } } else { n -= Math.floor(Math.random() * n); ...
[ "function scrollThrottler() {\n // ignore scroll events as long as an checkScroll execution is in the queue\n if (!scrollTimeout) {\n scrollTimeout = setTimeout(function() {\n scrollTimeout = null;\n checkScroll();\n // The checkScroll will execute at a rate...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the free variables from the equation inputs and produce sliders for the values of each / one, as well as the special variables for scaling and translation.
function extract_variables() { /// Add a new variable value slider. function add_var_slider(v) { const variable = bindings.get(v); const value_text = new Div(["value"]).add_text(variable.value); // Create the variable value slider itself. const slider = ne...
[ "function bind() {\n var vars = variables();\n\t\t\t\t\t\n\t\t\t\t\t// for perofrmance slider\n\t\t\t\t\t// gets value of slider and updates vars.pfmn, then calls update()\n\t\t\t\t\tvar ps = document.getElementById(vars.segCode + 'PfmnSlider');\n\t\t\t\t\tps.addEventListener('input',function() {\n\t\t\t\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method inquieres with the server if the research area exists.
function researchAreaExistsOnServer(researchAreaCode, ignoreNodes) { var exists = "false"; $j.ajax({ url: getResearchAreaAjaxCall(), type: 'GET', dataType: 'html', data: 'researchAreaCode=' + researchAreaCode + '&deletedRas=' + ignoreNodes ...
[ "function validateResearch () {\n return !!currentLocation || \n config.photos.textOnly && config.photos.text;\n }", "function ejecucionEnPortal(){\n //Se comprueba que se haya informado el Servidor Web Local \n if(puertoSWL != null && puertoSWL != undefined){\n return false;\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
app.get('/api/reviews', findAllReviews); app.post('/api/review/user', createReviewForUser); app.get('/api/review/user', findAllReviewsForUser); same as jose's findAllWebsitesForUser
function findAllReviewsForUser() { var url = "/api/reviews/user"; return $http.get(url) //unwrap response .then(function (response) { // return as embedded response return response.data; }); }
[ "async function index(req, res, next) {\n // find current user with access token\n let user = await findUserByToken(req, next);\n\n // if user is an admin\n if (user.admin === true) {\n // find all reviews\n let reviews = await Review\n .find()\n .sort({ created_at: \"desc\" })\n .catch(err...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Turns `selector` back into a string.
function stringify(selector) { return selector.map(stringifySubselector).join(", "); }
[ "function selectorToString(selector) {\r\n var result = \"\";\r\n if (selector.previous) {\r\n result += selectorToString(selector.previous);\r\n if (selector.combinator === ' ') {\r\n result += selector.combinator;\r\n }\r\n else {\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
5 instead of hardcoding the self.todos array, we write a function that goes to firebase and gets the array for us: we should call the function something like getTodos();
function getTodos(){ var ref = new Firebase("https://todoslist123.firebaseio.com/"); var todos = $firebaseArray(ref); return todos }
[ "function getTodos() {\n db.collection(\"new-todos\").onSnapshot(function (querySnapshot) {\n setTodos(\n querySnapshot.docs.map((doc) => ({\n id: doc.id,\n todo: doc.data().todo,\n is_in_progress: doc.data().is_in_progress,\n priority: doc.data().priority,\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
initialize lessons for teacher page
function initLesson(){ // Opening Lessons Database openDataBaseAndCreateTable('lessons'); }
[ "function initializeLesson() {\n lesson10.init();\n animate();\n}", "function initializeLesson() {\n\tlesson1.init();\n\tanimate();\n}", "function initializeLesson() {\n lesson7.init();\n animate();\n}", "function Lesson () {\r\n this.lessonid = 0;\r\n this.name = \"\";\r\n this.enabled = tru...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Processes HELO. Requires valid hostname as the single argument.
handler_HELO(command, callback) { let parts = command.toString().trim().split(/\s+/); let hostname = parts[1] || ''; if (parts.length !== 2) { this.send(501, 'Error: Syntax: HELO hostname'); return callback(); } this.hostNameAppearsAs = hostname.toLowerC...
[ "helo({hostname=null, timeout=0}={}) {\n if (!hostname) hostname = this._getHostname();\n\n let lines = [];\n let handler = (line) => lines.push(line);\n let command = `HELO ${hostname}\\r\\n`;\n\n return this.write(command, {timeout, handler}).then((code) => {\n if (code.charAt(0) === '2') {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
returns index of available seat or 1 if none are available or if they are a passenger.
function getSeat() { for(var i = 0; i < shuttle.seats.length; i++) { if(shuttle.seats[i] == null) { return i; } } return -1; }
[ "function getNumAvailableSeatsInSofa(seat) {\n var i,\n seatsAvailable = 0;\n\n for (i = 0; i < seat.SeatsInGroup.length; i++) {\n var sofaSeat = getSeat(seat.area.AreaNumber, seat.SeatsInGroup[i].RowIndex, seat.SeatsInGroup[i].ColumnIndex);\n\n if (seatAvailable(seat)) {\n sea...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Interface function for counting number of neurons in layer.
countNeurons() { throw new Error('Unimplemented.'); }
[ "countWithLayers() {\t\n\t\tthis.counter_00++;\n\t}", "function getLayerPredCount (ln) {\n return ln.children.values()\n .map(function (an) {\n return an.predLinks.size();\n })\n .reduce(function (acc, pls) {\n return acc + pls;\n });\n }", "getLayerCount() ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function to all delete items from localstorage and reload page.
function deleteitems(){ localStorage.clear(); location.reload(); }
[ "static deleteAllFromLS() {\n localStorage.removeItem(\"items\");\n }", "function deleteAllTodos() {\n localStorage.removeItem(\"todos\");\n document.location.reload();\n}", "clearAllItems() {\n window.localStorage.clear();\n }", "function delete_all_elements_from_LS(item) {\r\n localStorage.clea...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
===== Helper Functions ===== / Call APIs and Update Countries Info ================================================================= Description: Calls all APIs in input list and updates countriesInfo object with successful returns.
async function callAPIsAndUpdateCountriesInfo(requestsList, type, overwrite = false) { let countriesInfo = countriesInfoFunctions.returnCountriesInfo(); let updateStatus = []; let currentDate = window['currentDate']; for (let i = 0; i < requestsList.length; i++) { let re...
[ "function getCountryApi(){\n const Url=\"https://free.currencyconverterapi.com/api/v6/countries\"\n const query = {}\n $.getJSON(Url, query, loadCountries);\n}", "function fetchCountryData() {\n fetch(BASE_URL + \"all\")\n .then(checkStatus)\n .then(JSON.parse)\n .then(processCountryData)\n .cat...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
TwoLine Bus Elbow Extends mxShape.
function mxShapeElectricalTwoLineBusElbow(bounds, fill, stroke, strokewidth) { mxShape.call(this); this.bounds = bounds; this.fill = fill; this.stroke = stroke; this.strokewidth = (strokewidth != null) ? strokewidth : 1; this.notch = 0; }
[ "function mxShapeElectricalEightLineBusElbow(bounds, fill, stroke, strokewidth)\n{\n\tmxShape.call(this);\n\tthis.bounds = bounds;\n\tthis.fill = fill;\n\tthis.stroke = stroke;\n\tthis.strokewidth = (strokewidth != null) ? strokewidth : 1;\n\tthis.notch = 0;\n}", "function mxShapeElectricalTwoWayContact2(bounds, ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the dom id of the journal page new page message td
function getJournalNewPageId(id) { return "journalNewPage" + id; }
[ "function domIdForMessage(m) {\n return '#msg__' + m.domId();\n }", "function getNewChatPage(jid_id) {\r\n\tvar newChatPage = '<div class=\"dail-detail\" id=\"chat-page-'+jid_id+'\"></div>';\r\n return newChatPage;\r\n}", "function msgsDomIdForConversation(c) {\n return '#msgs__' + c.domId()...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates the `DeviceOrientation` module instance.
function DeviceOrientationModule() { _classCallCheck(this, DeviceOrientationModule); _get(Object.getPrototypeOf(DeviceOrientationModule.prototype), 'constructor', this).call(this, 'deviceorientation'); /** * Raw values coming from the `deviceorientation` event sent by this module. * * @this...
[ "function DeviceOrientationModule() {\n _classCallCheck(this, DeviceOrientationModule);\n\n /**\n * Raw values coming from the `deviceorientation` event sent by this module.\n *\n * @this DeviceOrientationModule\n * @type {number[]}\n * @default [null, null, null]\n */\n var _this =...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Frees a typed array in the module's memory. Must not be accessed anymore afterwards.
function freeArray(ptr) { checkMem(); var buf = U32[ptr >>> 2]; memory_free(buf); memory_free(ptr); }
[ "function cleanup(array) {\n for (let elt of array) {\n Module._free(elt);\n }\n array = [];\n}", "function freeArray(ptr) {\n checkMem();\n var buf = U32[ptr >>> 2];\n memory_free(buf);\n memory_free(ptr);\n }", "free() {\n this._isInitializ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Loops through a doc's sections
function Sections () { let sections = ToC[categoryIndex].docs[docIndex].sections // ... but if the doc is active because performance // and then check to make sure the doc actually has sections in the ToC tree // if so, execute getSections to assemble the doc section list HTML if (active && ...
[ "function getSubSections() {\n for (var i in course.sections){\n var file = \"../chapter/\" + course.sections[i].getId() +\".xml\";\n loadXMLDoc(file,SubSection.build,course.sections[i].getId());\n }\n}", "function getSections() {\n var file = \"../course/course.xml\";\n loadXMLDoc(file,...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Determine whether the given properties match those of a `MetricDefinitionProperty`
function CfnAppMonitor_MetricDefinitionPropertyValidator(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 re...
[ "function CfnAlarm_MetricPropertyValidator(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 receiv...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
SIP callid for the call
get callId() { return this.callInfo.callId; }
[ "function sipCall() {\n\t if($rootScope.stack && !$rootScope.callSession) {\n\n\t // create call session\n\t var thisCallConfig = $rootScope.callConfig;\n\t \n\t //OIR is enabled, hide my number\n\t if($scope.callOptions.enableOIR){\n\t\t \n\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Default sunburst constructor. Takes HTMLElement in document where sunburst should be generated and options opts map that will to override default options if needed
function Sunburst(el, opts){ this.el = el; this.opts = { width: 0, // if not defined, take width from DOM node, where chart is embedded height: 0, // if not defined, take height from DOM node, where chart is embedded padding: [20, 50, 20, 50], // minimu...
[ "constructor(options) {\n super(null);\n this.name = \"#document\";\n this.type = NodeType.Document;\n this.documentURI = null;\n this.domConfig = new XMLDOMConfiguration();\n options || (options = {});\n if (!options.writer) {\n options.writer = new XMLStri...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Fills the queue with tetrominoes from the bag, until it reaches this.queueLength.
fillQueueWithBag() { while (this.queue.length < this.queueLength) { if (this.isBagEmpty()) { this.createNewBag() } let bagTetromino = this.bag.shift() this.queue.push(bagTetromino) } }
[ "fill () {\n // Note:\n // - queue.running(): number of items that are currently running\n // - queue.length(): the number of items that are waiting to be run\n while (this.queue.running() + this.queue.length() < this.concurrency &&\n this.path.peersToQuery.length > 0) {\n this.queue.push...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
find all chords to start recrawling if for those whose contents are empty or invalid
function recrawl() { console.log('start recrawling....'); // find all chords to start re-crawling if for those whose contents are empty or invalid findAllChords().then(function (chords) { console.log("chords.length: " + chords.length); for (var i = 0; i < chords.length; i++) { var c = chords[i]; ...
[ "detectChords(recTrack) {\n let beatLength = 60000 / metronome.getTempo();\n if (recTrack.getNotes().length == 0) return;\n let endOfChord = undefined;\n let tempChord;\n\n recTrack.getNotes().forEach((item, i) => {\n //loops through the notes\n if (endOfChord === undefined) {\n //fi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
this function listens for fireEvents in other components then sends those events to the correct function in this componenent. forexample 'areaSelect' comes from appArea.js then the id is sent to handleNewArea();
connectedCallback(){ registerListener('productSelected', this.handleProductSelected, this); registerListener('areaSelect', this.handleNewArea, this); registerListener('appSelected', this.update, this); }
[ "onAreaMarkerClick(areaID, e) {\n this.props.changeMode(INSPECTOR_MODE_AREA, areaID);\n this.props.changeBrowserTab(\"inspectorBrowser\");\n }", "function doAreaSelection() {\n try {\n di_jq(\"#popup_sel_areas\").hide();\n\n // empty area tab html first\n //di_jq('#area_div').html(\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
default config for a blockquote button
get blockquoteButton() { return { command: "formatBlock", commandVal: "blockquote", label: "Blockquote", icon: "editor:format-quote", shortcutKeys: "ctrl+'", toggles: true, type: "rich-text-editor-button", }; }
[ "get blockquoteButton() {\n return {};\n }", "function blockquoteSelection() {\n this.execCommand('blockquote', false, null);\n }", "function blockquote(h, node) {\n return h(node, 'blockquote', wrap(all(h, node), true));\n}", "function makeQuoteWithCaption(editor) {\n var startStr =\n '\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
returns a string. base path of the assets folder in the build
function getAssetsPath() { return getBuildPath() + config.build.assetsPath; }
[ "function getAssetsPath()\n\t{\n\t\tvar generatorConfigFile = new File(\"~/generator.js\");\n\t\tvar cfgObj = {};\n\t\tvar gao = {};\n\t\tvar baseDirectory = undefined;\n\n\t\tif(generatorConfigFile.exists)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tvar str = JSUI.readFromFile(generatorConfigFile, \"UTF-8\");\n\n\t\t\t\tc...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
if no valid session present, return false if force == false, otherwise create anonymous account and return 0 if successful or false if error; if valid session present, return user type
function u_checklogin(ctx, force, passwordkey, invitecode, invitename, uh) { if (u_sid = u_storage.sid) { api_setsid(u_sid); u_checklogin3(ctx); } else { if (!force) ctx.checkloginresult(ctx, false); else { u_logout(); api_create_u_k(); ctx.cre...
[ "function u_checklogin(ctx, force, passwordkey, invitecode, invitename, uh) {\r\n if (!(u_sid = u_storage.sid)) {\r\n if (!force) ctx.checkloginresult(ctx, false);\r\n else {\r\n u_logout();\r\n\r\n api_create_u_k();\r\n\r\n ctx.createanonuserresult = u_checklogin2;...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Try to require async_hooks
function tryRequireAsyncHooks () { try { return __nccwpck_require__(50852) } catch (e) { return {} } }
[ "function tryRequireAsyncHooks () {\n try {\n return require('async_hooks')\n } catch (e) {\n return {}\n }\n}", "function tryRequireAsyncHooks () {\n try {\n return __nccwpck_require__(852)\n } catch (e) {\n return {}\n }\n}", "_initAsyncHooks() {\n asyncHook.createHook({\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
xml with namespace get rid of all the script elements from end of the page
function clearScriptsFromEnd() { while (document.body.lastChild.nodeName.toLowerCase() == "script") { document.body.removeChild(document.body.lastChild); } }
[ "function stripPage() {\n const elements = document.querySelectorAll('script, link[rel=import]');\n elements.forEach((e) => e.remove());\n }", "function stripPage() {\n const elements = document.querySelectorAll('script, link[rel=import]');\n for (const e of Array.from(elements)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
FUNCTION: SETUP WHEN IMAGE LOAD SUCCESS / FAIL
function LoadSuccess() { // Image: set properties that.Properties($i); // Image: all image loaded SetupAfterAllLoaded(); }
[ "function handleImageLoad() {\n\t\tvar id = this.getAttribute(ID_ATTRIBUTE);\n\t\tvar imageData = imageInstanceData[id];\n\n\t\tif (!imageData) { return; }\n\n\t\t$U.core.util.HtmlHelper.setVisibilityInherit(imageData.image);\n\n\t\tswitch (imageData.type) {\n\t\tcase \"fit\":\n\t\t\tsetImageSize(imageData.image, i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Given a JavaScript 2d Array, this function returns the transposed table. Arguments: data: JavaScript 2d Array Returns a JavaScript 2d Array Example: arrayTranspose([[1,2,3],[4,5,6]]) returns [[1,4],[2,5],[3,6]].
function arrayTranspose(data) { if (data.length == 0 || data[0].length == 0) { return null; } var ret = []; for (var i = 0; i < data[0].length; ++i) { ret.push([]); } for (var i = 0; i < data.length; ++i) { for (var j = 0; j < data[i].length; ++j) { ret[j][i] = data[i][j]; } } r...
[ "function arrayTranspose_(data) {\n if (data.length == 0 || data[0].length == 0) {\n return null;\n }\n \n var ret = [];\n for (var i = 0; i < data[0].length; ++i) {\n ret.push([]);\n }\n \n for (var i = 0; i < data.length; ++i) {\n for (var j = 0; j < data[i].length; ++j) {\n ret[j][i] = data[i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Insert the miniform for pages on number of pages selected by the user
onNumberOfPagesSelected () { this.shadowRoot.getElementById('numberOfPages').addEventListener( 'input', (e) => this.displayMiniPageForm(e.target.value) ); }
[ "displayMiniPageForm (num) {\n\t\tlet count = 0\n\t\tlet miniFormContainer = this.shadowRoot.getElementById('allMyPages');\n\t\tlet navContainer = this.shadowRoot.getElementById('nav-container');\n\t\tlet pagesContainer = this.shadowRoot.getElementById('ghostPages');\n\t\tlet transitionsContainer = this.shadowRoot....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Shows a message explaining how many redirects were imported.
function showImportedMessage(imported, existing) { if (imported == 0 && existing == 0) { $s.showMessage('No redirects existed in the file.'); } if (imported > 0 && existing == 0) { $s.showMessage('Successfully imported ' + imported + ' redirect' + (imported > 1 ? 's.' : '.'), true); } if (imported == 0 ...
[ "_redirectCountdown() {\n const redirectCounter = --this._redirectCounter;\n this._$counter.text(` ${redirectCounter}...`);\n\n if (redirectCounter <= 0) {\n clearInterval(this._interval);\n RB.navigateTo(this._redirectTo);\n }\n }", "function getNumOfRedirecti...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Onetomany relation allows to create type of relation when Entity2 can have multiple instances of Entity1. Entity1 have only one Entity2. Entity1 is an owner of the relationship, and storages Entity2 id on its own side.
function OneToMany(typeFunctionOrTarget, inverseSide, options) { return function (object, propertyName) { if (!options) options = {}; // now try to determine it its lazy relation var isLazy = options && options.lazy === true ? true : false; if (!isLazy && Reflect && Refle...
[ "get manyToOneRelations() {\n return this.relations.filter(relation => relation.relationType === RelationTypes.MANY_TO_ONE);\n }", "function OneToMany(typeFunctionOrTarget, inverseSide, options) {\n return function (object, propertyName) {\n if (!options)\n options = {};\n //...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }