query
stringlengths
9
34k
document
stringlengths
8
5.39M
negatives
listlengths
19
20
metadata
dict
Syncs the lootbox to people in nearby cells. Used mainly for dropboxes to make them appear.
sync_nearby () { loot.CallRemoteCell('loot/sync/basic', this.cell.x, this.cell.y, JSON.stringify(this.get_basic_sync_data())); }
[ "function setup(safeidbox){\n\n//shuffle the temp array w/ shuffle algorithm\ndo {\n\tshuffle(temparray);\n\n\t//create empty 2d array to be used to store game data\n\tboxarray = new Array(boxsidedimension);\n\tfor (i=0;i < boxarray.length; i++) {\n\t\tboxarray[i] = Array(boxsidedimension);\n\t}\n\n\tgameover = fal...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Destroys the Systems table schema. Arguments: callback = function(err) : err is an error if one occurred
function deleteSchema(callback) { console.log("Deleting table " + tableName + "..."); var params = { TableName: tableName }; db.deleteTable(params, function(err, data) { if (err) return callback(err); else checkIfTableNotExists(); }); function checkIfTableNotExists() { ...
[ "function createSchema(callback) {\n console.log(\"Creating table \" + tableName + \"...\");\n var params = {\n AttributeDefinitions: [{\n AttributeName: 'SystemId',\n AttributeType: 'S'\n }],\n KeySchema: [{\n AttributeName: 'SystemId',\n KeyTy...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
load offers dynamically from database and add them to the offerContainer in index.php search and filterparameters not implemented in prototype but later they will be getted also in this function and send them with the dataattribute of ajaxfunction to the backend
function offerLoading(){ //get html-Elements var loadingOffers = $('#loadingOffers'); var offerContainer = $('#offerContainer'); //clear offerContainer offerContainer.empty(); //show loadingOffers-ProgressBar loadingOffers.css('display', ''); $.ajax({ url: '../php/getOffers.ph...
[ "function loadEquipmentsByFilter( )\n{\n\tvar orgUnitId = document.getElementById('selectedOrgunitID').value;\n\tvar equipmentType = document.getElementById('equipmentType');\n\tvar equipmentTypeId = equipmentType.options[ equipmentType.selectedIndex ].value;\n\tvar searchText = document.getElementById('searchText'...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
======================================================================== 4. checkPrivateStationAndLaunch Check if the connected COS server is => R418 FixPack 3. Else fall back finding local station or any other available station. Check to see if there is a private station running in the local machine. > !toolate = the ...
function checkPrivateStationAndLaunch(adviseLaunchInfo){ // Verify if this setup can support a Secure Station. // Else fall back to finding other stations var secStationEligible = false; try { if ((adviseLaunchInfo['cosMetaData']['major'] > 6) || (adviseLaunchInfo['cosMetaData']['major'] === 6 && (adviseL...
[ "function getMyStations(params){\n \n var def = jQuery.Deferred();\n\n var noStations = function(){\n var msg = adviseLaunchInfo.translator.translate('LAUNCH_NO_STATIONS') + '<br/>' +\n adviseLaunchInfo.translator.translate('LAUNCH_CHECK_ALLOWED_USER') + '<br/>' +\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Initialize Google visualization API.
function init_() { /** @type {Object|undefined} */ var goog = window['google']; /** @type {Object|undefined} */ var gviz = goog && goog['visualization']; if (!gviz) { /** @type {string} */ var src = JSAPI_URL + '?autoload=' + encodeURIComponent(JSON.stringify(JSAPI_MODULES)); (...
[ "function BaseChart() {\n\n /**\n * Google API URL.\n * @type {!string}\n * @const\n * @see <a href=\"https://developers.google.com/loader/#intro\">Google API</a>\n */\n var JSAPI_URL = 'https://www.google.com/jsapi';\n var JSAPI_VIS_URL = 'https://www.google.com/uds/api/visualization/';\n\n /**\n *...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
rearranges the cells in the tbody to match the structure. Use's the tbody's structure if none provided
function rearrange (tbody, structure) { if (structure == null) { structure = tbody.structure; } var rows = tbody.rows; for (var i = 0; i < rows.length; i++) { var cells = rows[i].cells; for (var j = 0; j < cells.length; j++) { cells[j].innerHTML = structure[...
[ "function sortTable(el, rev, headrows, footrows) {\n\n // Search up to find the containing TD or TH\n var tdEl = el;\n while (tdEl != null &&\n tdEl.tagName.toUpperCase() != \"TD\" &&\n tdEl.tagName.toUpperCase() != \"TH\") {\n tdEl = tdEl.parentNode;\n }\n if (tdEl == null...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
setup route for login
loginRoute (app) { app.post('/' + this.Config.loginPage, this.processLogin); }
[ "configureRoute(app) {\n const storeIssuer = (req, res, next) => {\n const host = req.headers['x-forwarded-host'] || req.headers.host;\n res.locals.issuer = `${req.protocol}://${host}/auth/${this.loginName}`;\n next();\n };\n // configure username/password route\n var v = this.verify.bind...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Ajout Offre de stage
ajoutOffreDeStage(nouvelleOffreStage) { return this.http.post(this.offresStagesUrl, nouvelleOffreStage, httpOptions); }
[ "static async add(ctx) {\n const context = ctx.flash.formdata || {}; // failed validation? fill in previous values\n await ctx.render('teams-add', context);\n }", "function editorNewMission() {\n editorDirty = true;\n let mission = {\n name: \"Nuova missione\",\n color: \"#EEE...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Done Right to add the string passed as a second param to each of the arr items
function addStr(arr, str) { let newStr = [] for(const item of arr){ { newStr.push(item + " " + str) } } return newStr }
[ "function truncateNames(arr, originalList, strAdded){\n originalList.forEach(function(item, i){\n\n var myStr = item;\n if(myStr != null){\n myStr = myStr.substring(0, myStr.indexOf(\" \"))+strAdded;\n } \n arr.push(myStr);\n } );\n\n }", "function addParamArray(params, ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
TermTail > Factor TermTail | / Factor TermTail | null
function TermTail() { var node = new Node('TermTail'); p.child.push(node); p = node; if (word == '*' || word == '/') { p.operator = word; word = nextWord(); if (!Factor()) { return false; } else { p = node; ...
[ "function Term() {\n var node = new Node('Term');\n p.child.push(node);\n p = node;\n if (!Factor()) {\n return false;\n } else {\n p = node;\n return TermTail();\n }\n }", "_readRDFStarTail(token) {\n if (token.type !== '>>') return...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get Ids for a given object type, is specified in customObjects
function customObjectIds(objType) { customObjectsExported[objType] = true; if (!currentExport.hasOwnProperty("customObjects")) return []; for (var obj of currentExport.customObjects) { if (obj.objectType == objType) { return obj.objectIds; } } return []; }
[ "function getAccountIds (accountsByType) { /* function logic */ }", "async function _extract_company_id_objects (companies){\n if (companies.length == 0 || typeof companies === 'undefined' || companies === null || !Array.isArray(companies)){\n throw new VError(`companies parameter not usable`);\n }\n\n let...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get a single dct coefficient block
function getDctCoefficientBlock(pixelBlock, sizeLimit) { var coefficientBlock = new Array(64); // loop over coefficient block for (var l = 0; l < 8; l++) { for (var k = 0; k < 8; k++) { coefficientBlock[l * 8 + k] = 0; // calculate coefficient, loop over pixelBlock for (var n = 0; n < 8; n++) { ...
[ "function getPixelBlock(coefficientBlock) {\n\tvar pixelBlock = new Array(64);\n\n\t// loop over pixelBlock\n\tfor (var n = 0; n < 8; n++) {\n\t\tfor (var m = 0; m < 8; m++) {\n\t\t\tpixelBlock[n * 8 + m] = 0;\n\t\t\t\n\t\t\t// loop over coefficient block, calculate pixel value\n\t\t\tfor (var l = 0; l < 8; l++) {\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Cart ID Defaults to 1 since there is only 1 cart
static get cartId() { return 1; }
[ "function selectCart(req, res) {\n\tDB.Cart.findOne({_id: req.params.id})\n\t.populate('items')\n\t.exec((err, fCart) => {\n\t\tres.json(fCart);\n\t});\n}//end of selectCart()", "function loadCart(cartId) {\n return { type: 'NOTHING' };\n /* * /\n //Disabled due to malfunction.\n return dispatch => ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Below method is used to generate the Hierarchical Deterministic (HD) Segregated Witness (SegWit) bitcoin address
async function genSegWitAddr() { const mnemonics = mnemonic.generateMnemonic(); //generates string const seed = await bip39.mnemonicToSeed(mnemonics); const root = hdkey.fromMasterSeed(seed); const masterPrivateKey = root.privateKey.toString('hex'); const masterPublicKey = root.publicKey.toString('hex'); ...
[ "async buildSudtCells() {\n let senderInputSUDTSum = new models_1.Amount('0');\n let senderInputCKBSum = new models_1.Amount('0');\n let minSenderOccupiedCKBSum = new models_1.Amount('0');\n const receiverAmount = new models_1.Amount('142');\n const receiverOutputCell = new models...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
TODO dodelat rucni aktualizaci kosiku v headeru a prepoctu cen / calls controller method with mapping "/restaurace/removeItem", gets output, if valid JSON, executes function, which reaload some page fragments
function removeCartDishItem(data){ $.getJSON("/restaurace/removeItem", data, function(dish){ actualizeCalculationsAfterItemRemoved(dish); }); }
[ "function removeCustomCartDishItem(data){\n $.getJSON(\"/restaurace/removeCustomItem\", data, function(dish){\n actualizeCalculationsAfterItemRemoved(dish);\n });\n }", "function removeFromBasket() {\n var id = jQuery(this).attr('data-item'); // Eg. 'x47'.\n basket....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a image element and sets the image path, waits for a load or error event and returns the resolved promise or error
function createImage(imgPath) { return new Promise(function (resolve, reject) { const image = document.createElement("img"); image.src = imgPath; // Listen for successful load image.addEventListener("load", function () { imgContainer.append(image); resolve(image); }); // Listen f...
[ "load()\r\n {\r\n this.image = loadImage(this.imagePath);\r\n }", "load() {\n return new Promise((function(resolve, reject) {\n let img = null;\n /* Determine the image to use */\n if (this.emote) {\n /* Effect wants an emote used */\n img = this._host.twitchEmote(this...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function to get google talk frame that we are working with
function getGTalk() { // Find gtalk var iframes = document.evaluate( "//iframe", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); for(var i=0; i<iframes.snapshotLength; i++) { var iframe = iframes.snapshotItem(i); if (iframe.id.indexOf('gtalk')==0) { ...
[ "async getFrame(page, name) {\n return await this.getEvalFrame(page.mainFrame(), { frame: name });\n }", "function getConferenceUrl(number) {\n\n // Handle the HTTP request to get the conference mapping\n function onResponse(res) {\n if (res.code === 200) {\n let result = JSON.parse(re...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
erase city/state reducer as the component unmounts so that billing address form could reuse the same
componentWillUnmount() { this.props.fnEraseCityStateData(); }
[ "componentWillUnmount(){\n this.props.getProviderErase();\n }", "componentWillUnmount() {\n const { form } = this.props\n if (form) delete form.fields[this.id]\n }", "function clearCityStorage() {\n window.localStorage.clear();\n location.reload();\n}", "removeCustomer() {\n this.s...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Ends the document and converts string
end(options) { return this.document().end(options); }
[ "async cleanUpDocString() {\n const removeStreams = /stream(.*?)endstream/gs\n const removeComments = /%(.[^(PDF)][^%EOF]*?)\\n/g\n const removeMultiSpace = /[^\\S\\n\\r]{2,}/g\n const addNewLine = /(%%EOF)/gms\n\n return this.docString = this.docString\n .replace(addNewLine, '%%EOF\\n')\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function sends a generic HTTP POST request to my local test server
sendPOSTRequest(json_payload) { const options = { hostname: 'localhost', port: 8080, path: '/', method: 'POST', }; const clientPOSTReq = http.request(options, function(res) { console.log(`STATUS CODE: ${res.statusCode}`); res.on('data', function(data) { proc...
[ "function makePost(endpointPath, postData, done) {\n var options = {\n hostname: 'localhost',\n port: 3000,\n path: endpointPath,\n method: 'POST',\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n 'Content-Length': postData.length\n }\n };\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get Generic SAML Identity Provider
getIdentityprovidersGeneric() { return this.apiClient.callApi( '/api/v2/identityproviders/generic', 'GET', { }, { }, { }, { }, null, ['PureCloud OAuth'], ['application/json'], ['application/json'] ); }
[ "getIdentityprovidersOkta() { \n\n\t\treturn this.apiClient.callApi(\n\t\t\t'/api/v2/identityproviders/okta', \n\t\t\t'GET', \n\t\t\t{ },\n\t\t\t{ },\n\t\t\t{ },\n\t\t\t{ },\n\t\t\tnull, \n\t\t\t['PureCloud OAuth'], \n\t\t\t['application/json'],\n\t\t\t['application/json']\n\t\t);\n\t}", "getIdentityproviders...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
attr, ="sd", a="amit's", a="sd"b="saf", ab cd=""
function validateAttributeString(attrStr,options){//console.log("start:"+attrStr+":end"); //if(attrStr.trim().length === 0) return true; //empty string var matches=util.getAllMatches(attrStr,validAttrStrRegxp);var attrNames={};for(var i=0;i<matches.length;i++){if(matches[i][1].length===0){//nospace before attribute nam...
[ "function filter_attributes(str) {\n var comments = /\\/\\*.*?\\*\\//g;\n return str.replace(/\\s*[a-z-]+\\s*=\\s*'[^']*'/gi, function (m) {\n return m.replace(comments, '');\n }).replace(/\\s*[a-z-]+\\s*=\\s*\"[^\"]*\"/gi, function (m) {\n return m.replace(comments, '');\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets up the logic for maintaining the roving tabindex. `skipPredicate` determines if key manager should avoid putting a given list item in the tab index. Allow disabled list items to receive focus to align with WAI ARIA recommendation. Normally WAI ARIA's instructions are to exclude disabled items from the tab order, b...
_setupRovingTabindex() { this._keyManager = new FocusKeyManager(this._items) .withHomeAndEnd() .withTypeAhead() .withWrap() .skipPredicate(() => this.disabled); // Set the initial focus. this._resetActiveOption(); // Move the tabindex to th...
[ "enableTab(startingPoint) {\n const menuLinks = Array.from(\n startingPoint.querySelectorAll(\n 'button, [href], input, select, textarea, [tabindex]'\n )\n ).filter(elem => window.getComputedStyle(elem).display !== 'none');\n menuLinks.forEach(link => {\n link.setAttribute('tabindex',...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Determines if a day is "today".
function isToday(day, _, props) { // User can change the "today" date from props, thus we cannot rely to the // date now. The today props defaults to `new Date()` anyway... return isSameDay(day, props.today); }
[ "static today() {\n return NepaliDate.fromgregorian(new Date());\n }", "function isLastUpdateToday() {\n if (localStorage.getItem('catalogLastUpdate') === null) {\n return false;\n } else if (new Date().getDate() !== new Date(localStorage.getItem('catalogLastUpdate')).getDate()) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Unzips the Zipfile containing the GTFS files and writes them to disk
function unzip() { return new Promise((resolve, reject) => { if (!fs.existsSync(path.join(__dirname, '/../tmp/gtfs/trips.txt'))) { const zip = new StreamZip({ file: path.join(__dirname, '/../tmp/gtfs.zip'), storeEntries: true }); // Handle ...
[ "function extractZip(zipFile, callback){\n var fileName = path.parse(zipFile).name;\n var targetName = fileName + \"_\" + getTimestamp();\n var targetPath = path.join(__dirname, './shape_files');\n\n var filePath = path.join(__dirname, './shape_files/'+targetName);\n \n extract(zipFile, {dir: filePath}, funct...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Compare function for sorting participants by Group (ascending order)
function compareGroups(participant1, participant2) { if (participant1.group.number < participant2.group.number) { return 1; } if (participant1.group.number > participant2.group.number) { return -1; } return 0; }
[ "function _sortGroups(first, second) {\n var firstGroup = CockpitHelper.hashedGroupList[first];\n var secondGroup = CockpitHelper.hashedGroupList[second];\n return firstGroup.position - secondGroup.position;\n }", "function sortedGroupNames(callback) {\n chrome.storage.local.get(\"group...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Resets tower class to default
function towerClassReset() { $('.towerOption').attr('class', 'tower') $('#rays').children().attr('id', 'invisible') }
[ "function reset() {\n defaultRenderers_ = {};\n decoratorFunctions_ = {};\n}", "_onResetDefaults(event) {\n event.preventDefault();\n game.settings.set(\"core\", DrawingsLayer.DEFAULT_CONFIG_SETTING, {});\n this.object.data = canvas.drawings._getNewDrawingData({});\n this.render();\n }", "res...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Chapter 101 RopeGroup set actor to Heather
function C101_KinbakuClub_RopeGroup_LoadHeather() { ActorLoad("Heather", "ClubRoom1"); }
[ "addActor(scene, name, actor) {\n //console.log(`\\n@@@ narrative.addActor ${name} actor=${actor}:`);\n //console.dir(actor);\n //console.log(`addActor: et = ${devclock.getElapsedTime()}`);\n if (scene && actor && name && name.length > 0) {\n if (cast[name]) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Parse a JSON reply from Gerrit and return a Promise. All Gerrit JSON replies start with )]}'\n. The function validates this and return a rejected Promise if this is not the case.
function parseJSON(reply) { var header = reply.substring(0, 5); if (header === ")]}'\n") { return Promise.resolve(JSON.parse(reply.substring(5))); } return Promise.reject(new browser.FetchError( 'Unexpected reply from Gerrit server: ' + header + '...', false)); }
[ "parseReplyText(line) {\r\n const isSupported = this.hasExtension('ENHANCEDSTATUSCODES');\r\n if (isSupported) {\r\n return line.substr(4).split(/[\\s](.+)?/, 2)[1];\r\n }\r\n else {\r\n return line.substr(4);\r\n }\r\n }", "function pullGVizJSON(gQueryR...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
when player score equals randomNum, wins go up by 1; if I go over, the losses go up by 1
function winOrLose() { if (playerScore === randomNum) { winsCounter++; $("#wins").html(" " + winsCounter); startGame(); } else if (playerScore > randomNum) { lossCounter++; $("#losses").html(" " + lossCounter); startGame(); } }
[ "function checkScore(){\n\n if (counter == targetNumber) {\n gameOver=true;\n wins++;\n $(\"#wins\").html(wins);\n \trestart();\n\t\t\talert(\"You Win!\");\n }\n\n\t\tif (counter > targetNumber) {\n losses++;\n $(\"#losses\").html(losses...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The "terminateproduct' workflow call "onEnvTerminationFailure" in case of any errors
async function updateEnvOnTerminationFailure({ requestContext, container, status, error, envId, record }) { const payload = { requestContext, container, status, error, envId, record }; const environmentScService = await container.find('environmentScService'); const existingEnvRecord = await environmentScService....
[ "async function updateEnvOnProvisioningFailure({\n requestContext,\n container,\n resolvedVars,\n status,\n error,\n outputs,\n provisionedProductId,\n}) {\n const payload = { requestContext, container, resolvedVars, status, error, outputs, provisionedProductId };\n const environmentScService = await conta...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
for don't skip keyevent, send pageSubStatus to html5 agent, the osd hide by html5_agent control
function sendPageSubStatus(pageSubStatus) { try { var tvJspObj = getTvJspService(); if (tvJspObj && tvJspObj.utility) { tvJspObj.utility.notifyHtmlUIStatus('{"PageID":"HTML5_UI_PAGE_CHANNEL_ZAPPER", "Status":"Show", "PageSubStatus":"' + pageSubStatus + '"}'); } }catch(err) {console.log(e...
[ "function enterPageNum(evt) {\n evt=evt||window.event;\n if ((Codex.hudup)||(Codex.mode)||(Codex.cxthelp)) {\n fdjtUI.cancel(evt);\n Codex.setMode(false);\n return;}\n fdjtUI.cancel(evt);\n if (Codex.hudup) {Codex.setMode(false); return;}\n Codex.t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Parse the contents of a pok file into a cht object.
function parsePokFile(fileContents) { let cheats = [] let currentCheatName = '' let currentCodes = [] for (let line of fileContents.split('\n')) { switch (line[0]) { case 'N': // New code name currentCheatName = line.substring(1) break case 'M': // Multi-line code currentCodes.push(line) bre...
[ "function processPokFile(inputFile) {\n\tlet contents = fs.readFileSync(inputFile, 'utf8')\n\tlet basename = path.basename(inputFile, '.pok')\n\tlet destination = path.join(destinationDirectory, sanitizeFilename(basename + '.cht'))\n\tlet cheats = parsePokFile(contents)\n\tlet chtContents = pokToCht(cheats)\n\tif (...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Called while the output grid is being edited. The tab title is 'contenteditable'. When the user edits the title in place, this method is called. This can be called by multiple events (onclick, oninput, onblur as indicated by eventid)
function changeTabTitle(obj, htmlId, dim, tab, edit, eventid) { var gridId = getGridIdOfHtmlId(htmlId); var gridObj = CurFuncObj.allGrids[gridId]; var iO = getIndObjOfHtmlId(htmlId); var curtab = gridObj.dimSelectTabs[dim]; gridObj.dimSelectTabs[dim] = tab; if (gridObj.dimHasTitl...
[ "function editableTitle(){\n var postTitle = document.getElementById('postTitle');\n var titleText = postTitle.innerText;\n if(titleText.startsWith(\"UPDATED: \"))\n titleText = titleText.replace(\"UPDATED: \",\"\");\n postTitle.innerHTML = titleText;\n postTitle.contentEditable = \"true\";\n postTitle...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
sets cookie to remember contents of list
function setCookie(){ var items = document.getElementsByClassName("list-group-item"); var itemText = new Array(); for (var i = 0; i < items.length; i++){ itemText[i] = items[i].id; } document.cookie = "items=" + itemText.join("|"); }
[ "function saveListLinksToCookie() {\n var linkListJson = getShortenLinkListJson();\n if(linkListJson != \"\") {\n setCookie(\"ResultsList\", linkListJson, 30);\n }\n}", "function getCookie(){\r\n\t// get items cookie\r\n\tvar items = \"\";\r\n\tvar name = \"items=\";\r\n\tvar ca = document.cookie.split(';')...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Enter a parse tree produced by KotlinParserdoWhileExpression.
enterDoWhileExpression(ctx) { }
[ "enterWhileExpression(ctx) {\n\t}", "enterWhileStatementNoShortIf(ctx) {\n\t}", "function Do() {\t\n \t\t\tdebugMsg(\"ProgramParser : Do\");\n \t\t\t\n \t\t\tlexer.next();\n \t\t\tvar code=CodeBlock();\n \t\t\t\n \t\t\tcheck(\"while\");\n \t\t\t\n \t\t\tcheck(\"(\");\n \t\t\t\n \t\t\tvar expr=Expr();\n \t\t\tch...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Determines my connected conversation
function searchMyActiveConversation() { console.info('Search my active conversation'); // Keys in list let keys = Object.keys(conversationList); console.log('Keys in list object : ', keys ); // Default conversation is empty let thisConversation = {}; // Iterate to find my 'connected' con...
[ "function isMyUserConnected(conversation) {\r\n let isConnected = false;\r\n // Participant : \"id\", \"address\", \"startTime\", \"connectedTime\", \"endTime\", \"state\": \"disconnected\", \r\n\t// \"direction\": \"disconnectType\", \"held\", \"user\", \"queue\", \"attributes\",\"recordingState\": \...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
draws a palette with the given array of colors
function drawPalette(colors){ drawCanvas(1,colors.length, document.getElementById("palette")); for (var i = 0; i < colors.length; i++){ changePoint (colors[i], document.getElementById("palette_r0c" + i), "black"); document.getElementById("palette_r0c" + i).setAttribute("class", "...
[ "function setupColorMap() {\n var c3=colorbrewer.Dark2[8];\n var c1=colorbrewer.Set1[8];\n var c2=colorbrewer.Paired[8];\n colorMap.push('#1347AE'); // the default blue\n for( var i=0; i<8; i++) {\n colorMap.push(c1[i]);\n }\n for( var i=0; i<8; i++) {\n colorMap.push(c2[i]);\n }\n for( var i=0; i<8;...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set Special Damage Resistance returns String
SetSpecialDamageResistance(num) { return ["Negates one level", "Negates two levels", "Negates three levels", "Complete immunity"][num-1]; }
[ "takeDamage() {\n return `${this.name} took damage.`;\n }", "receiveDamage(damage) { \n this.health = this.health - damage;\n if(this.health > 0){ \n return `${this.name} has received ${damage} points of damage`;\n } else { \n return `${this.name} has died in a...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return a oneside relation proxy. If there are multiple foreign keys that make this relation ambiguous, the attribute key of the one to use must be specified in the options object. The destination reference can be a model class or collection name.
oneRelation(destinationReference, options={}) { return this._relationalSet.resolveRelationProxy( OneSideRelationProxy, destinationReference, options ); }
[ "manyRelation(destinationReference, options={}) {\n return this._relationalSet.resolveRelationProxy(\n ManySideRelationProxy, destinationReference, options\n );\n }", "function resolveHasOneMetadata(relationMeta) {\n if (!type_resolver_1.isTypeResolver(relationMeta.target)) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Bind change events for top filling
function topFillingElementsChangeEvents(){ //1. Top Filling radio button change event $topFillingRadio.on('ifChecked', function(){ var topFillingRadioVal = $(this).val(); if(topFillingRadioVal == 'true'){ $topFillingDetailsDiv.show(); }else{ $topFillingDetailsDiv.hide(); } }); //2. Top type...
[ "function areaChange() {\n area = document.getElementById(areaName + \"-select\").value;\n updateColorAxis();\n chart.series[0].setData(get_data());\n }", "on_change(ev){\r\n\t\tthis.val = this.get_value();\r\n\t\t// hack to get around change events not bubbling through the shadow dom\r\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Visit a parse tree produced by PlSqlParserreturn_rows_clause.
visitReturn_rows_clause(ctx) { return this.visitChildren(ctx); }
[ "visitPipe_row_statement(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "visitReturn_statement(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "visitFor_each_row(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "visitReturn_stmt(ctx) {\r\n console.log(\"visitReturn_stmt\");\r\n if (ctx....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Fire the call for given data and delete from indexedDb
function fireAndDelete(key, value) { var values = [], headers = { 'Content-Type': 'application/vnd.kafka.binary.v1+json', 'Content-Encoding': 'gzip', }; value && _.each(value,(val)=>{ values.push({'value':val}); }); let url = urlMap.instrument; !_.isEmpty(values) && _.gzipJson(...
[ "deleteRecord() {}", "function deleteData(datalibrary, doc) {\n for (var i = 0; i < doc.length; i++) {\n datalibrary.findByIdAndDelete(doc[i]._id, function (err) {\n if (err) {\n console.log(err);\n }\n })\n };\n}", "deleteAddressData(address) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
pushes underscores to hiddenWordArray function
function makeUnderscore() { for (var i = 0; i < computerWord.length; i++) { compWordArray.push("_"); } }
[ "function underscore() {\n for (var i = 0; i < randomWord.length; i++) {\n currentWord.push(\"_\");\n }\n return currentWord;\n}", "function setUp() {\n wordGen();\n document.getElementById(\"currentWordLength\").textContent = randomWord.length;\n for (var i = 0; i < randomWord.length; i+...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
indicatorFn is a function that is 0 where two curves intersect, and indicatorSamples is a series of samples of this function. For two y vs x curves, the indicator function is just the difference between the two curves. For intersecting a y vs x curve with an x vs y curve, e.g. y = f(x) and x = g(y), a suitable indicato...
function findIntersections(indicatorSamples, fn1, indicatorFn) { var zeros = findZeros(indicatorSamples, indicatorFn); var i, elen, zlen; // Find tangent intersections. var extrema = findExtrema(indicatorSamples, indicatorFn); for (i = 0, elen = extrema.x.length; i < elen; i++)...
[ "function lazyIntersection(fn1, fn2) {\n \n return function (param) {\n \n return fn1(param) && fn2(param);\n }; \n }", "function applyFunction(x1, x2, f){\n var data = [];\n for (var i = 0, x; i <= 100; ++i) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Each person's availability will be an array of twoelement arrays. Each twoelement array's first element represents the start time of a time slot, and the second array element represents the end time of that time slot. The input variable duration is a positive integer that represents the duration of a meeting in seconds...
function timePlanner(a, b, duration) { let aCount = 0; let bCount = 0; while (aCount < a.length && bCount < b.length) { const start = Math.max(a[aCount][0], b[bCount][0]); const end = Math.min(a[aCount][1], b[bCount][1]); if (start + duration <= end) { return [start, start + du...
[ "function meetingRooms(arr) {\n //GOAL is to find overlaping elements\n //1. sort the meeting by starting time\n arr.sort((a, b) => a[0] - b[0]);\n\n //2. need to keep track of our end times\n //assign the end interval to be the first end interval(1st el from arr)\n //while looping it might change\n\n let en...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Utility function for filtering players
function filter(players, fn) { let arr = []; for (var i in players) { if (fn(players[i])) { arr.push(players[i]); } } return arr; }
[ "function filterByPlayer() {\n const nameFilterValue = getById('filter-bar').value;\n if (nameFilterValue) {\n fetch(`${server}?action=filter&name=${nameFilterValue}`, {\n headers: {\n 'Accept': 'application/json'\n },\n mode: \"no-cors\"\n })\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function for when I'm not hungry, YET.
function CallMeIfNotHungry() { var msg = "No, not right now."; el.textContent = msg; }
[ "function hungry(hunger){\n \nreturn hunger <= 5 ? 'Grab a snack': 'Sit down and eat a meal';\n}", "function CallMeIfHungry() {\n var msg = \"Yes, I'm starving!\";\n el.textContent = msg;\n }", "isWeakerThan(hand) {\n // ˅\n return this.judgeGame(hand) === -1;\n // ˄\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
add input value in li
function AddValueinLi() { li.append(document.createTextNode(input.value)); }
[ "function setup_input (input_field) {\n var name = input_field.attr('name');\n var values_input = $('<input type=\"hidden\" class=\"ub-values\" name=\"' + name\n + '\" id=\"ub-values-' + name + '\" />');\n\n var ul_box = $('<ul id=\"ub-drop-'+name+'\" class=\"ub-input...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Retrieves Gregoriancalendar eras for the given locale.
function getLocaleEraNames(locale, width) { var data = Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵfindLocaleData"])(locale); var erasData = data[_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵLocaleDataIndex"].Eras]; return getLastDefinedValue(erasData, width); }
[ "function getLocale () {\n return locale\n}", "function getCalendarList() {\n var p = new promise.Promise();\n\n console.log('Requested calendar list');\n\n gapi.client.calendar.calendarList.list().execute(function(x) {\n if(x.hasOwnProperty('code')) {\n alert('Google says their backen...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
fin de funcion MensajeExito muestra mensaje de error
function MensajeError(sMensaje) { MostrarMensaje("error", sMensaje); }
[ "function errorMessage(msg) {\n// console.log(msg);\n}", "function mensajeVacio(){\n return \"Campos obligatorios\";\n }", "function incrementoError()\n\t{\n\t\tif(presente === false)\n\t\t{\n\t\t\tmasUnError();//Instanciar la función que aumenta los fallos acumulados.\n\t\t}\n\t}", "function erro(msg)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Object holding Comment data github A `GitHub` object item The GitHub object the comment is meant for, eg. a `Gist` data The information held by the Comment, see
function Comment(github, item, data) { this.github = github; this.item = item; this.data = data; }
[ "function github_post(comment) {\n if(GITHUB_TOKEN == false){\n return;\n }\n\n var GitHubApi = require('github');\n\n var github = new GitHubApi({\n timeout: 5000\n });\n\n // user token\n // @Todo: Otherways of authenticating\n github.authenticate({\n type: 'token',\n token: GITHUB_TOKEN\n })...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
look through all events and delete anything with a matching scope
purgeScope(scope) { if (!scope) return for (const [ evtName, evtMap ] of this.listeners) { if (evtMap.size) { let remaining = evtMap.size for (const [ key, value ] of evtMap) { if (value.scope === scope) { evtMap.delete(key) remaining-- } ...
[ "deleteItemsEventsEtc() {\n let items_buffer = getReferencesOfType('AGItem');\n items_buffer.forEach(function (buffer) {\n deleteItem(buffer);\n });\n let conditions_buffer = getReferencesOfType('AGCondition');\n conditions_buffer.forEach(function (buffer) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Rank of the card, represented by its shorthand.
get rank(): string { if (!this.cachedRank) { this.cachedRank = Config.cardRanks[this.id % Config.cardRanks.length]; } return this.cachedRank; }
[ "function getRankingFromIntent(intent) {\n\n var rankingSlot = intent.slots.Ranking;\n\n if (!rankingSlot || !rankingSlot.value) {\n return 0;\n } else {\n\n return rankingSlot.value;\n }\n}", "function getValueOfRank(rank) {\n let value = ranks[rank.toLowerCase()];\n if (value) {\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
tensor: openvino.Tensor dimHints?: number[] (NCHW)
_getTensorData(tensor, dimHints) { const offset = tensor.offset; const size = tensor.size; const ctor = this._getConstructorFromType(tensor.type.dataType); const length = size / ctor.BYTES_PER_ELEMENT; const nchwdata = new ctor(this._weights, offset, length); if (typeof dimHints !== 'undefined' ...
[ "getNodeInitilizer(node, dimHints) {\n // Each Const node has only one initializer\n const tensor = node._initializers[0].arguments[0].initializer;\n return this._getTensorData(tensor, dimHints);\n }", "_createIndexMap() {\n if (this.poolIndexMap) {\n return;\n }\n\n let [inputRows, inputC...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create plus_questions of level four, including 3 numbers A, B, Sum (A + B = Sum). In level four, A = B. So there is only numberA.
function createPlusLevelFour() { var numberA; var numberB; var numberSum = 100; //initialize numberSum,and make it bigger than 10. if( answercount <= totalAnswerCount/2 ){ if( level%2 == 1 ){ numberA = Math.floor(Math.random() * 5) + 1; numberB = numberA; ...
[ "function createPlusLevelSix() {\n var rangeAB = range(1, 11);\n var numberA = rangeAB[Math.floor(Math.random() * rangeAB.length)];\n var numberB = rangeAB[Math.floor(Math.random() * rangeAB.length)];\n\n var numberSum = numberA + numberB;\n \n var plusEquation = [numberA, numberB, numberSum];\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Transfer Ownership to "ToAddress".
function transferOwnership(res,ToAddress,FromAddress,PrivateKey){ web3.eth.defaultAccount = FromAddress; var count = web3.eth.getTransactionCount(web3.eth.defaultAccount); var data = contract.transferOwnership.getData(ToAddress); var gasPrice = web3.eth.gasPrice; var gasLimit = 300000; v...
[ "function EtherTransfer(res,ToAddress,NoEther,FromAddress,PrivateKey){\n\n var count = web3.eth.getTransactionCount(FromAddress);\n var gasPrice = web3.eth.gasPrice;\n var gasLimit = 21000;\n\n var rawTransaction = {\n \"from\": FromAddress,\n \"nonce\": web3.toHex(count),\n \"gasPr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Update placeholder image in results panel
swapPlaceholderImg(src) { this.$results.find('.results-overview-image img').attr('src', src).attr('alt', 'screenshot for ' + this.websiteUrl); }
[ "function updateImageReader() {\r\n var newImageUrl = document.getElementById('image-search').value;\r\n\r\n clearImageSelection();\r\n\r\n if (mode == READ_MODE) {\r\n refreshAnnotations(newImageUrl, document.getElementById('textUrl').value);\r\n } else {\r\n document.getElementById('imag...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the offset from the start of the viewport to the start of the rendered data (in pixels).
getOffsetToRenderedContentStart() { return this._renderedContentOffsetNeedsRewrite ? null : this._renderedContentOffset; }
[ "function getScrollOffset() {\n return {\n x: main.scrollLeft,\n y: main.scrollTop };\n\n}", "get tileOffset() {}", "function pixelOffset(){\n if(xoffset*cellSize < pixeloffx){\n pixeloffx = 0\n }\n if(yoffset*cellSize < pixeloffy){\n pixeloffy = 0\n }\n while(pixeloffx > 0){...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
`removeQuads` removes multiple quads from the store
removeQuads(quads) { for (let i = 0; i < quads.length; i++) this.removeQuad(quads[i]); }
[ "addQuads(quads) {\n for (let i = 0; i < quads.length; i++) this.addQuad(quads[i]);\n }", "RemoveSelectedQfromAll(sel){\n while(sel.length>0){\n var x=sel.pop();\n if(this.questypes.indexOf(x)!==-1)\n this.questypes.splice(this.questypes.indexOf(x),1);\n }\n }", "deleteMultiple() {}", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function to return sum of hh:mm time
function timeConvert(times){ let hours = 0; let minutes = 0; times.forEach(function(i){ var timeSplit = i.split(':'); let newHr = Number(timeSplit[0]); hours += newHr; let newMin = Number(timeSplit[1]); minutes += newMin; }); let minuteOfHour = Math.floor(minutes / 60); let minutesLeft =...
[ "function pmAdd(hour)\n{\n //hour will be startHour or endHour, in string format\n hour = parseInt(hour);\n //check that it isn't 12pm, otherwise add 12\n if (hour != 12)\n {\n hour = (hour + 12) % 24;\n }\n return hour;\n}", "function getTotalTime() {\n var totalTime = 0;\n var ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Initializes a new instance of the PixelRendr class.
function PixelRendr(settings) { if (!settings) { throw new Error("No settings given to PixelRendr."); } if (!settings.paletteDefault) { throw new Error("No paletteDefault given to PixelRendr."); } this.paletteDefault = settings....
[ "constructor(x,y,w,h,r,g,b,)\n {\n this.x = x;\n this.y = y;\n this.w = w;\n this.h = h;\n this.r = r;\n this.g = g;\n this.b = b;\n }", "function SLTReelSprite() {\n this.initialize.apply(this, arguments);\n}", "function initRuler() {\n getRulerC...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Funcion para guardar en la tabla vehiculos
function GuardarVehiculo() { console.log(id_propiedad); var tipo_vehiculo = $('#tipo_vehiculo').val(); var año_vehiculo = $('#año').val(); var valor_vehiculo = $('#valor_vehiculo').val(); if(tipo_vehiculo != null) { if(año_vehiculo != null) { if(valor_v...
[ "function llenar_tabla_vistas_observaciones() {\n $(\"#modal_vista_observaciones\").show()\n $(\"#tabla_vistas_observaciones tr\").remove()\n\n var cuestionario, pregunta, indice_cues, indice_preg = 1;\n $.each(datos_mostrar, function (index, item) {\n //*********aqui se va a ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
if on user profile When viewing a user's profile we must be able to refresh the users tweets
function viewUserTweets(userStr){ userProfile = true; resetUserTweets(userStr); // clears all tweets var UserTweets = _.filter(streams.home,function(tweet){ if (tweet.user == userStr){ generateTweet(tweet); // generates tweet with tweet object } ...
[ "function twitterUpdate() {\n\t\t// Twitter読み込み\n\t\tif(twitter_id){\n//\t\t\tgetTwitterSearch();\n\t\t}\n\t\t// 逆ジオコーディング\n\t\tif(userExist){\n\t\t\tgeocoder.getLocations(nowPoint, geocoding);\n\t\t}\n\t\treloadId = setTimeout(twitterUpdate, twitterReloadTime);\n\t}", "function updateTweet ({ id, user, element }...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
loop through Array or array for feedback and then obtain one single array
function gatherFeedback(arr) { let newArray = []; for (let i = 0; i < arr.length; i++) { if (arr[i].length > 0) { for (let k = 0; k < arr[i].length; k++) { if (arr[i][k].viewed === false) { newArray.push(arr[i][k]); } } } } return newArray; }
[ "function processResults(programResults) {\n let resultsArray = []\n for (let result of programResults) {\n let roundedDistance = roundDistance(result.distance)\n let message = messageCreator(result, roundedDistance)\n resultsArray.push(message)\n }\n // console.log(resultsArray)\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns next face or null
get nextFace() { var next = new Face(this.wrapper.nextElementSibling, this.cube); return (next.wrapper ? next : null); }
[ "get prevFace() {\n var prev = new Face(this.wrapper.previousElementSibling, this.cube);\n return (prev.wrapper ? prev : null);\n }", "FindIndexOfFace(color){\n let faceIndex = -1;\n this.faces.forEach((face, index) => {\n if (face.color == color){\n faceIndex = inde...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set bit change the ith bit of number to 1
function setBit(number,i) { return number | (1 << i); }
[ "function toggleThirdBit(num) {\n\t// 100\n\t// 100\n\t// 1\n\treturn (num ^ 4).toString(2)\n}", "function setThirdBit(num) {\n\treturn (num | 4).toString(2)\n}", "function is0thSet(value) {\n return (value & 0b01);\n}", "function leftCircularShift(num,bits){\nnum = num.toString(2);\nnum = parseInt(num.subst...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
6. write a function that takes an array as its first parameter, a searchValue as its second parameter and a replaceValue as the third parameter. The function returns a new array where only the searchValue has been overwritten by the replaceValue.
function overwriteSearchValue(array, searchValue, replaceValue){ for (let arrayIndex = 0; arrayIndex <= array.length; arrayIndex++){ if (array[arrayIndex] === searchValue){ let r = array.indexOf(searchValue); array.splice(r, 1, replaceValue); let array = newArray; return newArray; ...
[ "function replace(arr, target, source) {\n\t return arr.map(function (v) {\n\t return v === target ? source : v;\n\t });\n\t}", "function replaceArray(original, replacement, av)\n {\n\tfor (var i = 0; i < original.size(); i++)\n\t{\n\t\toriginal.value(i, replacement.value(i));\n\t\tif (replacement.isHighlig...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
FUNCTION NAME : saveNewManualDeviceInfo AUTHOR : Krisfen G. Ducao DATE : March 18, 2014 MODIFIED BY : REVISION DATE : REVISION : DESCRIPTION : PARAMETERS :
function saveNewManualDeviceInfo(){ var url = getURL('ConfigEditor','JSON'); var action = "savenewdevice"; var str= GlobalNewDevice[0] var query = JSON.stringify(str) $.ajax({ url: url, data : { "action":action, "query":query, }, dataType: 'html', method: 'POST', proccessData: false, async:fals...
[ "function setDeviceInformation(devPath,model,src,manufac,ostyp,prdfmly,ipadd,prot,hostnme,devtype){\n//\tvar devtype = getDeviceType(model);\n\tif(manufac){\n\t\tvar manu = manufac;\n\t}else{\n\t\tvar manu = getManufacturer(model);\n\t}\n\tvar myPortDev = [];\n\tif(globalInfoType == \"JSON\"){\n\t\tsetDevicesInform...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Marks all the multiples of current prime numbers between the range of start and end as nonprime
function sieveForPrimes(start, end) { for (const prime of primes) { if (prime === 2) { continue; } // Find the next multiple of the prime in the given range var factor = Math.ceil(start / prime); // To start from odd multiples only if (factor % 2 === 0) { ...
[ "function markAsMultiples(A, from, to, prime) {\n /**\n Start from the smallest multiple present in the range\n **/\n const quo = Math.ceil((from+1)/prime);\n for(let i = quo * prime; i <= to; i += prime) {\n A[i-from] = false;\n }\n}", "function findPrimes(max_num){\n\t//Allocate an array for the numb...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
this will fill the contact details to the edit contact modal form Address_Id: "45" Background_Info: "" Company: "BizKeeper" Contact_First: "Tanushree" Contact_Last: "Patra" Contact_Middle: null Contact_Title: "Mrs." Date_of_Initial_Contact: "20191201"
function fill_edit_contact_form(contact) { // console.log(contact); // set the values to modal form // for edit contact modal var zip = contact.address_zip == 0 ? '' : contact.address_zip; $('#frm_edit_contact').find('input[name="edit_contact_id"]').val(contact.id); $('#frm_edit_contact').find('...
[ "function editContact(contactId) {\n $.get(\"/contacts/getContactDetails/\"+contactId, function(response) {\n response = JSON.parse(response);\n\n if (response.status === 200) {\n let contact = response.data[0];\n\n // Sets data in corresponding form field\n $('#contact_id').val(contact.contac...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Utility function that disposes a given dependencyTracking entry
function computedDisposeDependencyCallback(id, entryToDispose) { if (entryToDispose !== null && entryToDispose.dispose) { entryToDispose.dispose(); } }
[ "function dispose() {\n\n if (mainViz === null) {\n alertOrConsole(\"No Viz has been rendered, so I can't dispose anything\");\n return;\n } else {\n mainViz.dispose();\n }\n}", "function closeDepartment() {\n\tconsole.log(chalk.underline.red(\"\\nClose Department function under deve...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a URL from worker source that can be used to create `Worker` instances Packages (and then caches) the result of `webworkify` as an "Object URL"
function getWorkerURL(workerSource) { Object(_utils_assert__WEBPACK_IMPORTED_MODULE_0__["default"])(typeof workerSource === 'string', 'worker source'); // url(./worker.js) // This pattern is used to differentiate worker urls from worker source code // Load from url is needed for testing, when using Webpack & w...
[ "function WebWorkerSource(worker){\n this._worker = worker;\n}", "function createWorker(worker) {\n\t if (typeof worker === 'string') {\n\t return new Worker(worker);\n\t }\n\t else {\n\t var blob = new Blob(['self.onmessage = ', worker.toString()], { type: 'text/javascript' });\n\t ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns true if data is an async iterable object
function isAsyncIterable(data) { return data && data[Symbol.asyncIterator]; }
[ "isStreamingData(data){\n var isStreaming = false;\n var currTime = Math.floor(new Date().getTime());\n if(data && data.length && data.hasOwnProperty('latestTime') && data.latestTime > currTime - 30000){\n isStreaming = true;\n }\n return isStreaming;\n }", "function is_array(obj){\n retur...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Special method to be called on completion of ask the audience. NOT a listener. This should merely populate the answer buckets and then go back to the reveal hot seat choice screen. This method should be called at least after some time after showHostStartAskTheAudience is called. This is to make the experience not so ja...
finishAskTheAudience() { this.serverState.askTheAudience.populateAllAnswerBuckets(); this.playSoundEffect(Audio.Sources.ASK_THE_AUDIENCE_END); // Update game is called first to make sure ask the audience end audio cue plays. this._updateGame(); this.showHostRevealHotSeatChoice(); }
[ "_SurveyQuestionLoop() {\n if (this.survey_run_status == SURVEY_SKIPPING) {\n return Scheduler.Event.NEXT;\n }\n\n let continueRoutine = true;\n switch (this.trialStage) {\n // Haven't asked question, render current input\n case 0:\n this.question.setAutoDraw(true);\n this.c...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
checks if the given rect collides with it
collide(rect) { return (this.left < rect.right && this.right > rect.left && this.top < rect.bottom && this.bottom > rect.top); }
[ "collide(other) {\n // Don't collide if inactive\n if (!this.active || !other.active) {\n return false;\n }\n\n // Standard rectangular overlap check\n if (this.x + this.width > other.x && this.x < other.x + other.width) {\n if (this.y + this.height > other.y && this.y < other.y + other.hei...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
To play different footstep sound on last level
function playFootstepSound() { if ($gameMap.mapId() !== 10) { //Not last map AudioManager.playSe(SE_WALKSTEP); } else { AudioManager.playSe(SE_WALKSTEPHEAVY); } }
[ "function playNextLevelSound()\n{\n\tvar random = getRandomInteger(0,(nextLevelSounds.length - 1));\n\tplaySoundIfSoundIsOn(nextLevelSounds[random]);\n}", "function mixedShot() {\n playSound(\"audioMixedShot\");\n }", "pauseMusic() {\n var musicLevel = Math.floor((this.currentLevel + 1) / 2)\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set a maximum reportable time. If a maximum is set and the timer is ended after the specified amount of time, the value is not reported.
withMaximum(maximum) { max = maximum; return timer; }
[ "function changeDefaultTimeOut() {\n let user = db.ref('users/' + userId);\n\n const newDefaultTime = app.getArgument('newDefaultTime');\n\n if (newDefaultTime && (newDefaultTime * 60) > 0) {\n let minutes = parseInt(newDefaultTime) * 60;\n let promise = user.set({userId: ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The formfield appearance style.
get appearance() { return this._appearance; }
[ "function appearanceBehavior(value, styles) {\n return new _microsoft_fast_foundation__WEBPACK_IMPORTED_MODULE_0__.PropertyStyleSheetBehavior(\"appearance\", value, styles);\n}", "setCustomAppearance(app) {\n //TODO\n }", "function AllergyComponentWFStyle() {\n\tthis.initByNamespace(\"wf_al\");\n}"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Multiplies a matrix B by a vector a, c = a B
function vectorMultiplyMatrix(a, B) { //var A_x = 1; var A_y = a.length; var B_x = B.length; var B_y = B[0].length; if (B_x != A_y) { alert("Matrix inner dimensions must agree"); return; } var v = new Array(B_y); for (var j = 0; j < B_y; j++) { v[j] = 0; } for (var i = 0; i < A_y; i++) { var B...
[ "function matrix_mult(x, A_inv, b) {\n x[0] = A_inv[0][0] * b[0] + A_inv[0][1] * b[1];\n x[1] = A_inv[1][0] * b[0] + A_inv[1][1] * b[1];\n}", "function sparseMatrixMultiplyVector(B,a) {\n\t\n\tvar k = a.length; \n\tvar m = B.length;\n\tvar n = B[0].length; // n=m\n\t\n\tif (k != m) {\n\t\talert(\"Inner dimensio...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns an Adaptor implementation for a given tendermint version. Throws when version is not supported.
function adaptorForVersion(version) { if (version.startsWith("0.33.") || version.startsWith("0.34.") || hashes.v0_34.includes(version)) { return v0_33_1.v0_33; } else { throw new Error(`Unsupported tendermint version: ${version}`); } }
[ "setAdapter(adapter) {\n switch (adapter) {\n case \"electronIPC\":\n electronIPCAdapter(this);\n break;\n case \"websql\":\n webSQLAdapter(this);\n break;\n case \"dummy\":\n dummyAdapter(this);\n break;\n default:\n throw(new Error(errorAdapt...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
we only want to call this function(setLocalStorage()) when a change happens in income,expense,....
function setLocalStorage() {//we want to save income,expense,... data to local storage window.localStorage.setItem("income",income); window.localStorage.setItem("expense",expense); window.localStorage.setItem("incomeList",JSON.stringify(incomeList));//this is a list of array and localStorage only accepts st...
[ "function updateLocalStorage() {\n\tlocalStorage.setItem('transactions', JSON.stringify(transactions));\n}", "function stateSaveCallback(settings, data) {\n var stado = $('#tablaConsultaBecariosInternos').DataTable().state();\n localStorage.setItem('tablaConsultaBecariosInternos' + window.lo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
cart column wrapper class and functions
function cartColumn(opts) { var options = opts || {}; return simpleCart.extend({ attr : "", label : "", view : "attr", text : "", className : "", hide : false }, options); }
[ "function buildCartTable() {\r\n let table = document.getElementById('itemCart');\r\n let tbodyRef = table.getElementsByTagName('tbody')[0];\r\n for (let i = 0; i < this.itemsInCart.length; i++) {\r\n let row = tbodyRef.insertRow(0);\r\n let removeButtonContainer = document.createElement('but...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Similar to the above, but for select options. itemsSelectors is a hash of option values pointing to item selectors. On change all of the items selectors for the other options get disabled, then the items selector for the selected option (if any) gets enabled. Great for enabling a text field when "Other" is chosen from ...
function aSelectEnables(selectSelector, itemsSelectors, hideItemsSelectors) { $(selectSelector).data('aSelectEnablesItemsSelectors', itemsSelectors); $(selectSelector).data('aSelectEnablesHideItemsSelectors', hideItemsSelectors); $(selectSelector).change(function() { update(this); }); function update(sel...
[ "function setSelectorFields() {\n // Clear existing selectors\n removeChildren(visualSelector);\n removeChildren(propertySelector);\n\n let propertyOpts = propertyOptions();\n propertyOpts.forEach(function (element) {\n var optK = document.createElement(\"option\")\n optK.value = elemen...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
accumulates JSON objects in array until 10k before they are sent
function accumData(postData) { documents.push(postData) if(documents.length == 10000){ // send array of JSON objects to solr server console.log('sending') sendData(documents) documents = [] } }
[ "function getTotalObjects(cb) {\n var xhr = new XMLHttpRequest();\n var apiAll = apiMetObject.substring(0, apiMetObject.length - 1);\n xhr.open(\"GET\", apiAll);\n xhr.send();\n xhr.onreadystatechange = function () {\n if (this.readyState == 4 && this.status == 200) {\n cb(JSON.parse(this.responseText)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Called when the tripDS is loaded for the edit form
function tripDSEditOnLoad() { var form = TripEditForm.getForm(); form.setValues(tripDS.getAt(0).data); if (tripMode != "Create") { form.findField('eventsField').setValue(buildStringFromArray(tripDS.getAt(0).data.events, "id", ',')); form.findField('contractsFieldTrip').setValue(buildStringFr...
[ "function tripDSOnLoad() {\n var form = TripViewForm.getForm();\n form.setValues(tripDS.getAt(0).data);\n form.findField('eventsDisplayField').setValue(buildStringFromArray(tripDS.getAt(0).data.events, \"name\", \"<br/>\"));\n form.findField('contractsDisplayFieldTrip').setValue(buildStringFromArray(tri...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
button press handler to change game states
function stateChangeButtonPress(button) { switch (button.name) { case 'To Title Screen': game.state.start('titleScreen'); break; case 'To Main Game': game.state.start('mainGame'); break; case 'To Game Over': ...
[ "function mousePressed() {\n if (state === `title`) {\n state = `game`;\n } else if (state === `game`) {\n checkCircleClick();\n }\n}", "switchState(state){\n\t\tthis.currentState = state;\n\t\tswitch(state){\n\t\tcase configNamespace.STATE_MACHINE.START:\n\t\t\tthis.drawStartPage();\n\t\t\tthis.longInfo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get levels of a particular art pack
function getLevels() { const id = { id: $stateParams.artpackId }; return artAPIService.artpacklevel.get(id).$promise.then((data) => { ctrl.levels = data.level_set; // console.log('data: ', data); }); }
[ "function levels(stat) {\n\treturn parseInt(document.getElementById(stat + \"_levels\").value);\n}", "function getAllLevels() {\n return [\n [\n new __WEBPACK_IMPORTED_MODULE_2__bubbles_bubbleThree_js__[\"a\" /* default */](canvas.width/2 + 100, canvas.height - 130, 0),\n new __WEBPACK_IMPORTED_MODU...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function for setting focus on failed form element
function focusMouseOnErrorElement(fieldname){ //[ catchFirstError_element ] This would save after catching the first error element if( catchFirstError_element === undefined){ catchFirstError_element = fieldname; //We select form element by it's name attribute value $('[name="'+catchFirstError_ele...
[ "function setFocus(id) {\n validation = false;\n id_to_focus = id;\n window.setTimeout(setTimerFocus, 100);\n}", "add_focus() {\n this.element.focus();\n }", "function returnFocus() {\n if( focused )\n focused.focus();\n }", "function initFormFie...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
toggleCamera Toggles between orthographic and perspective cameras.
toggleCamera() { this.controls.enable = false; if (this.camera === this.orthoCamera) { this.camera = this.perspCamera; this.controls = this.perspControls; } else { this.camera = this.orthoCamera; this.controls = this.orthoControls; } this.controls.enable = true; this....
[ "changeActiveCamera() {\n if (this.interface.cameras) {\n let interfaceCam = this.interface.cameras[ACTIVE_CAMERA];\n let defOrtho = this.graph.views.orthos[interfaceCam];\n let defPerspective = this.graph.views.perspectives[interfaceCam];\n if (this.camera.id != interfaceCam && !this.cameraA...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function called to read a selected file.
readSelectedFile() { var fileReader = new FileReader(); var objFile = document.getElementById("fileInput").files[0]; if (!objFile) { alert("OBJ file not set!"); return; } fileReader.readAsText(objFile); fileReader.onloadend = function()...
[ "function fileSelected(file) {\n\tif (file.type == \"text\" && file.subtype == \"plain\") {\n\t\tgetData(file.data);\n\t} else {\n\t\tcreateP(\"I need a text file.\");\n\t}\n}", "function handleFileSelect(evt) {\n console.log(\"Handling file selection\");\n files = evt.target.files;\n fileCount = files.length;...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Visit a parse tree produced by PlSqlParsernon_dml_trigger.
visitNon_dml_trigger(ctx) { return this.visitChildren(ctx); }
[ "visitSimple_dml_trigger(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "visitNon_dml_event(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "visitData_manipulation_language_statements(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "function SqlParserListener() {\n\tantlr4.tree.ParseTreeListener.cal...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Callback function to render copied schedules
function _createCopySchedules(data) { var info = JSON.parse(data); $("body").css("cursor", "default"); copyConflictSchedules = info["schedules"]; // Display conflicts if any and remove them from list of schedules to be // rendered if user does not want to add them. var availabilities = i...
[ "function renderCopiedSchedules() {\r\n // Create fullcalendar events corresponding to schedules\r\n if (displaySettings[\"unique_row_per_employee\"]) {\r\n var events = _copySchedulesToUniqueRowEvents(copyConflictSchedules);\r\n } else {\r\n var events = _schedulesToEvents(copyConflictSchedules)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
if (isSubset(arr1, arr2, arr1L, arr2L)) console.log('arr2[] is ' + 'subset of arr1[]') else console.log('arr2[] is ' + 'not a subset of arr1')
function isSubset(arr1, arr2, arr1L, arr2L) { // define i & j before looping through the arrays // this is needed to check if the loop was not broken let i = 0 let j = 0 // loop through the first array for (i = 0; i < arr2L; i++) { //loop through the second array with a nested loop ...
[ "function isSubset(arr1, arr2) {\n\treturn arr1.every(x => arr2.includes(x));\n}", "function isSubset(array1, array2){\n\tfor (var j = 1 ; j < array2.length ; j++){\n\tfor (var i =0 ; i < array1.length ; i++){\n\t\tif(array2[0] === array1[i] && array2[j] === array1[i+1] && array1.length > array2.length){\n\t\t}\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Devuelve el idMesero que inicio Sesion
function getIdMesero(){ return idMeseroGlobal; }
[ "function siguienteMes(){\n if (numeroMes !== 11){\n numeroMes++;\n }else{\n numeroMes=0;\n anioCorriente++;\n }\n\n setearFechaNueva();\n}", "function setIdCajero(numCajero){\n\tidCajeroGlobal = numCajero;\n}", "function setIdPedido(numPedido){\n\tidPedidoGlobal = numPedido;\n}...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
15.5 xuserdefined 15.5.1 xuserdefined decoder
function XUserDefinedDecoder(options) { var fatal = options.fatal; /** * @param {Stream} stream The stream of bytes being decoded. * @param {number} bite The next byte read from the stream. * @return {?(number|!Array.<number>)} The next code point(s) * decoded, or null if not enoug...
[ "function XujWkuOtln(){return 23;/* 8XgmrnS5LNc N3cy1ZZJnp KKnuOfTy5R cok5w4ZqJPR wmU5fTECT6YP tgygYCJHjel jjus73ik7bs EKvYjA1KUcQ lY1Mzz3kCFhW fG4w2bXeaCcJ wMj7h9VWXO4G FVLCBU6QrJs c2fMIOMmfdQ1 BgRiRKLrefr 0nc2AVNRmqnc zH40fcPoRHN3 CaYY04g7JJ NNawz8jdT1 h2c37sUsdQS9 oWtmrdf0jm 8Wa9iKs7omq8 26fzQtVQvbPk T828DN3T3Y1...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Retrieves the form values and saves into the 'studentInfo' object
function saveStudentInfo() { alert("Reached"); // Get the form element which contains all the data var studentForm = document.getElementById('studentForm'); // Save the data into the 'studentInfo' object studentInfo.firstName = studentForm.elements["firstName"].value; alert(firstName); studentInfo.lastName =...
[ "function populateFormData(data) {\n console.log('populateFormData called');\n\n $('#student_id').val(data.student_id);\n $('#student_name').val(data.student_name);\n $('#course').val(data.course);\n $('#grade').val(data.grade);\n}", "function formFieldPopulation(){\n\t\tvar detailsObject = JSON.parse(localS...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
path_part computed: true, optional: false, required: false
get pathPart() { return this.getStringAttribute('path_part'); }
[ "function field(obj, pathString) {\n if (!obj || typeof pathString !== 'string') return '';\n function fn(obj, path) {\n var prop = path.shift();\n if (!(prop in obj) || obj[prop] == null) return '';\n if (path.length) {\n return fn(obj[prop], path);\n }\n return String(obj[prop]);\n }\n ret...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get help execute Smart Home Phrase
function getHelp(intent, session, callback) { var cardTitle = "Execute Smart Home Help"; var phraseSlot = intent.slots.MoreHelp; var sessionAttributes = {}; var shouldEndSession = false; var speechOutput = ""; var phraseval = null; if (phraseSlot) phraseval = phraseSlot.value;...
[ "function ksfHelp(){}", "function printHelp() {\n var spathToDocumentation = process.argv[1].split(PATH.sep), shelp;\n\n spathToDocumentation.pop();\n spathToDocumentation.push(PATH.sep + 'documentation.txt');\n shelp = FS.readFileSync(spathToDocumentation.join(PATH.sep),\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Progression 6: Sort chocolates based on count in each color. Return array of colors
function sortChocolateBasedOnCount(chocolates) { var chocolatesCount = {}; var sortArray = []; // Count chocolates and store count with color name in object chocolatesCount for (i = 0; i < chocolates.length; i++) { if (chocolatesCount[chocolates[i]] == undefined) { chocolatesCount[c...
[ "function get_colors(triangles){\n\tconst probs = [0.5,0.2,0.1,0.1,0.1];\n\tvar color_assignments = [];\n\tvar used_colors,new_probs;\n\tfor(var i=0;i<triangles.length;i++){\n\t\tused_colors = []\n\t\tfor(var j=0;j<color_assignments.length;j++){\n\t\t\tif(is_neighbor(triangles[i], triangles[j])){\n\t\t\t\tused_colo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }