query
stringlengths
9
34k
document
stringlengths
8
5.39M
negatives
listlengths
19
20
metadata
dict
SEND LINK Function to send quiz link email using SendGrid
function sendQuizLinkEmail(req, res, next, msg) { sgMail.send(msg) .then(() => { res.status(200).redirect('/quiz_soft/dashboard'); }) .catch((error) => { console.error(error) res.status(500).redirect('/quiz_soft/dashboard'); }); }
[ "function emailLinks(formTitle,publishedLink,editorLink,reponsesLink) {\n\n var htmlBody = \n 'Here are the links for the new Form:<br><br>' +\n 'Published Form URL: ' + publishedLink + '<br><br>' +\n 'Form Editor URL: ' + editorLink + '<br><br>' +\n 'Responses Sheet URL: ' ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Are the right sides of the pin and base aligned?
_isRightAligned(align) { const [pinAlign, baseAlign] = align.split(' '); return pinAlign[1] === 'r' && pinAlign[1] === baseAlign[1]; }
[ "_isBottomAligned(align) {\n const [pinAlign, baseAlign] = align.split(' ');\n return pinAlign[0] === 'b' && pinAlign[0] === baseAlign[0];\n }", "align() {\n this.pos = (this.pos + 7) & ~7;\n }", "function right(x) { currentAlignment = alignRight }", "function isTileBoundary(p, size) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
GRAPH THE SYMBOL TABLE
function graphSymbolTable(list, element, traduction, msg){ if(traduction){ document.querySelector(element).innerHTML = ''; } if(list.length > 0){ const table = constructSymbolTable(element, traduction, msg); const tbody = document.creat...
[ "renderSymbols(linkedList) {\n var currentNode;\n for(currentNode = linkedList.head; currentNode != null; currentNode = currentNode.next) {\n this.renderSymbol(currentNode);\n }\n }", "function SymbolTable(){\n // this tbl is list of list of SymEntry\n this.tbl=null;\n}", "renderSymbols(linke...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
a Simple bar width animation with no Jquery
function jswidth(animationLength) { var animateWidth = 0; var findBar = document.getElementById("bar-id"); var findBarLable = document.getElementById("bar-lable-id"); function frame() { animateWidth++ findBarLable.innerHTML = animateWidth + '%'; findBar.style.width = animateWidt...
[ "function startBar() {\n if (i == 0) {\n i = 1;\n width = 0;\n var id = setInterval(tick, 10);\n\n // 1 tick function of progress bar 1 tick = 100ms and\n function tick() {\n if (width >= 100 ) {\n clearInterval(id);\n i = 0;\n checkEndGame();\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
In the player on WebGL?
set WebGLPlayer(value) {}
[ "get WebGLPlayer() {}", "updateWebGL() {}", "function startWebGLSession() {\n OnSession(false);\n}", "function initWebGL() {\n try { \n gl = canvas.getContext('webgl') || canvas.getContext('experimental-webgl'); \n } catch(e) {\n }\n \n if (gl) {\n WIDTH = canvas.clientWidth.to...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Duplicate table headers for each tabel row.
_duplicateHeaders() { this.tableRows.forEach((row) => { const data = Array.from(row.getElementsByTagName('td')); data.forEach((td, dataIndex) => { const clonedHeader = this.tableHeaders[dataIndex].cloneNode(true); clonedHeader.setAttribute('scope', 'row'); clonedHeader.setAttribute('role', 'rowheade...
[ "function recloneHeaderAndFooter(){\n if (!wrap || !elem) {\n return;\n }\n\n var sourceTableElems = wrap.querySelectorAll('table.shadowed thead, table.shadowed tfoot');\n var destinationTableElems = elem.querySelectorAll('thead, tfoot')...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Assign random colors to each of the color divs
function randomColors(){ colorDivs.forEach((div, index) =>{ const hexText = div.children[0]; const randColor= generateHex(); console.log(div.children[0]); div.style.backgroundColor= randColor; hexText.innerText=randColor; //Check for Contrast checkTextContra...
[ "function generateColor() {\n var shuffleColor = shuffle(colorArr)\n for (var i = 0; i < shuffleColor.length; i++) {\n $colorPanel.append('<div class=\"box ' + shuffleColor[i] + '\"></div>')\n }\n }", "function initRandomColor() {\n\tfor (var i = 0; i < 16; i++) {\n\t\tvar hue = board.hues[Math.rou...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Usage : tryToJoinGame(sockId) For : sockId is the client socket connected to the server After : returns true if the socket has joined the game
function tryToJoinGame(sockId) { return GameLobby.tryJoinGame(sockId); }
[ "joinGame(gameId){\n\t\t//2 steps: step one: check if possible, step two: join.\n\t\tconsole.log(\"checkit\");\n\t\t\n\t\tvar url = \"http://lode.ameije.com/QuoridorMultiPlayer/quoridorPlayRemote.php?action=\"+\"poll\"+\"&gameId=\"+gameId;// No question mark needed\n\t\tthis.callPhpWithAjax(url,this.joinGameFeedbac...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Determines the next question's context based on current context and intent.
function getNextQuestionCtx(agent) { const prevQuestion = getPreviousQuestionCtx(agent); if (prevQuestion === Q2) { if (agent.intent === YES_INTENT) { const for_self = agent.context.get('labels').parameters['labels'].includes(ME); if (for_self) { return Q5; } else { retur...
[ "function getPreviousQuestionCtx(agent) {\n // Question contexts are named: \"q{ID}...\". Only one should ever be active.\n const context_names = Object.keys(agent.context.contexts);\n const question_contexts = context_names.filter(ctx => ctx.match(/\\bq\\d+/));\n if (question_contexts.length !== 1) {\n thro...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Represents a Player who onws a collection of Comptuer Games.
function Player(name, age, games) { this._name = name; this._age = age; this._games = _.isArray(games) ? games.slice() : []; }
[ "get players () {\n return this._players;\n }", "function ComputerPlayer(symbol, game) {\n Player.call(this, symbol, game);\n this.ai = true;\n}", "get players() {\n return this._players;\n }", "function Player (playerArray) {\n this.name = playerArray[0];\n this.index = playerArray[1];\n t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Inject a set of variables into the given template.
async function injectIntoTemplate(templatePath, injections) { let template = await readFile(templatePath, 'utf8'); injections.forEach(({ target, value }) => { template = template.replace(`__${target}__`, value); }); await writeFile(templatePath, template); }
[ "function populate_template(template, values)\n {\n for (var key in values) {\n template = replace_macro(template, key, values[key]);\n }\n\n return template;\n }", "function injectIntoTemplate(templatePath, injections) {\n return __awaiter(this, void 0, void 0, function* ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
upload the data to firebase
function uploadData(){ getReadingSpeed(); var r = localStorage.getItem('ReadingSpeed'); var p = localStorage.getItem('Password'); var e = localStorage.getItem('Email'); var m = localStorage.getItem('Major'); var u = localStorage.getItem('UserName'); var l = localStorage.getItem('LastName'); var ...
[ "function uploadData(url, file, text, predictions)\n{\n console.log(url);console.log(text);console.log(predictions);\n var str=predictions[0].className;\n for(var i=1;i<predictions.length;i++)\n str=str+\", \"+ predictions[i].className;\n var d = new Date();\n var m=d.getMonth()+1;\n d = d.getDate()+\"-\"+m+...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Get Projected Player Game Stats by Date (w/ Injuries, DFS Salaries) / / The date of the game(s). Examples: 2015JUL31, 2015SEP01.
getProjectedPlayerGameStatsByDatePromise(date){ var parameters = {}; parameters['date']=date; return this.GetPromise('/v3/nba/projections/{format}/PlayerGameProjectionStatsByDate/{date}', parameters); }
[ "getProjectedPlayerGameStatsByDatePromise(date){\n var parameters = {};\n parameters['date']=date;\n return this.GetPromise('/v3/nhl/projections/{format}/PlayerGameProjectionStatsByDate/{date}', parameters);\n }", "getProjectedPlayerGameStatsByDatePromise(date){\n var parameters = {...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get a quaternion that is the multiplicative inverse of the current quaternion.
invert () { var fMagnitude = this._w * this._w + this._x * this._x + this._y * this._y + this._z * this._z; var fInv_Magnitude = 1.0 / fMagnitude; return new Quaternion (this._w * fInv_Magnitude,-this._x * fInv_Magnitude,-this._y * fInv_Magnitude,-this._z * fInv_Magnitude); }
[ "get inverse() {\n let [a, b, c, d] = this.coeffs;\n return new MobiusTransform([\n d, b.neg,\n c.neg, a\n ]);\n }", "inverse()\n {\n return new RationalNumber(this.denominator, this.numerator);\n }", "get quaternion() {\n return new Quaternion({ sca...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
=================================================================== from vm/interpreter/visitor/FunctionOwnershipVisitor.java =================================================================== Needed early: Visitor Needed late: Pair ArcObject
function FunctionOwnershipVisitor() { }
[ "forEach(func){\n for(var o = this; o instanceof Pair; o=o.cdr){\n func(o.car);\n }\n return o;\n }", "function Arc3ptsObject(_construction, _name, _P1, _P2, _P3) {\n var M = new VirtualPointObject(0, 0);\n var M = new CenterObject(_construction, \"_Center\", this);\n _construction.add(M);...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns tweets of the specified user written at most at maxTimeOldDate
function getTweets(userScreenName, maxTimeOldDate){ var tweets = new Array(); var maxId = undefined; var tweetsForRequest = 200; tweets = requestTweets(userScreenName, maxId, tweetsForRequest); if(tweets.length == 0){ return tweets; } while(true){ var dateLastTweet = new Date(tweets[tweets.length-1].created...
[ "function getTweetsByUserFromTime(user, maxTimeOld){\n\t// Holds twitter username of the user\n\tvar screen_name = undefined;\n\t// Indicates the date of the oldest tweet to consider\n\tvar maxTimeOldDate = new Date(maxTimeOld);\n\tvar findUserTwitterUrl = \"http://api.twitter.com/1.1/users/show.json\";\n\tvar quer...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get REDIS hash fields
getHashFields(key) { // const startAt = Date.now(); return this.client.hgetall(key).then((data) => { // this.log(`Hash fields ${key} retrieved in ${parseInt(Date.now() - startAt)}ms`); return data; }); }
[ "getHashField(key, field) {\n // const startAt = Date.now();\n return this.client.hget(key, field).then((data) => {\n // this.log(`Hash field ${key} retrieved in ${parseInt(Date.now() - startAt)}ms`);\n return data;\n });\n }", "static get hashedFields() {\n retu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
set skier assetName to "SKIER_DEAD"
killSkier(skier) { skier.direction = Constants.SKIER_DIRECTIONS.DIED; skier.y = this.y; skier.x = this.x; skier.assetName = Constants.SKIER_DIED; }
[ "updateAsset() {\n switch(this.state) {\n case Constants.SKIER_STATE.CRASHED:\n this.assetName = Constants.SKIER_CRASH;\n break;\n case Constants.SKIER_STATE.JUMPING:\n this.assetName = Constants.SKIER_JUMPING_ASSET[this.jumpMovement];\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
returns life expectency for the selected country for cuurent year
function getLifeExpOfSelectedCountry(filtered_dataset){ var life_exp = '' filtered_dataset.map((data,i)=>{ if(data.Country == currentCountry.Country){ life_exp = Math.round(data.LifeExp,2) return } }) return life_exp }
[ "calculateLifeExpectancy() {\n let userLifeExpectancy;\n switch(this.country) {\n case countries.USA :\n userLifeExpectancy = 79.3;\n break;\n case countries.China :\n userLifeExpectancy = 76.1;\n break;\n case countries.Japan :\n userLifeExpectancy = 83.7;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Binds & expressions are lists to do a "bulk set" at initialization time
constructor (outer = null, binds=[], exprs=[]) { this.outer = outer; this.data = {}; this.keys = []; for (var i = 0; i < binds.length; i++) { this.setSymbol(binds[i], exprs[i]); } }
[ "function localizeBinds(sa) {\n let s = Kit.auto(sa)\n const forseBind = s.opts.markBindValue === false || s.opts.defunct\n const rootDecls = s.first.value.savedDecls\n const bindVars = new Set()\n if (s.opts.optBindAssign !== false) {\n for(const i of s) {\n switch(i.type) {\n case Tag.Assignment...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set a message if pokemon is caught or not.
function getCatchMessage(catchMessage) { let catchMessageTag = document.createElement('h2'); let refreshPage = document.querySelector('.refresh-btn'); let goToPokedex = document.querySelector('.go-to-pokedex-btn'); let goToPokedexLink = document.querySelector('.pokedex-link'); i...
[ "function onTryCatchWildPokemon(message) {\n var playerId = message.playerId,\n pokemonInstanceId = message.PokemonInstanceId;\n\n var _this = this;\n gameManager.wildPokemonManager.onTryCatchWildPokemon(playerId, pokemonInstnaceId, function(response) {\n this.emit(\"tryCatchWildPokemonResult\", response...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function: _getStoreListSuccessCallback getting current location web service success callback parameters: response> response from server
function _getStoreListSuccessCallback(response) { Ti.API.info('response.data.store_list.length =' + response.data.store_list.length); if (response.data.store_list.length != 0) { if (($.searchField.value).length != 0) { googleAnalyticsStoreSearch($.searchField.getValue()); } ...
[ "function UpdateLocationListsCallback(context, result) {\n if (result[0] == \"\") {\n PopulateLocationLists(result);\n }\n else {\n UpdateDebugInfo(this, \"UpdateLocationListCallback: \" + result[0]);\n }\n //select the new item\n var numOptions = $('#locationList option').length;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a QueryList and stores it in LView's collection of active queries (LQueries).
function createQueryListInLView( // TODO: "read" should be an AbstractType (FW-486) lView, predicate, descend, read, isStatic, nodeIndex) { ngDevMode && assertPreviousIsParent(getIsParent()); var queryList = new QueryList(); var queries = lView[QUERIES] || (lView[QUERIES] = new LQueries_(null, null, null, n...
[ "constructor() {\n this.queryList = [];\n this.registeredQueries = [];\n return this;\n }", "function LQueries(){}", "function LQueries() {}", "function LQueries() { }", "function getOrCreateCurrentQueries(QueryType) {\n var lView = getLView();\n var currentQueries = lView[QUER...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return true if there are any errors displayed This is not the same as if the form is currently valid
hasVisibleErrors() { return Object.keys(this.store.errors).length > 0; }
[ "function getFormIsValid() {\n return interactedWith && !getFieldErrorsString()\n }", "function formHasErrors()\n{\n\tvar errorFlag = false;\n\n\t// Check require input\n\tvar requiredFields = [\"username\", \"password\"];\n\n\tfor (var i = 0; i < requiredFields.length; i++) {\n\t\tvar inputField = document.g...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Emits a socket io call to add a student to a TA's queue
function add_queue(id){ socket.emit('add_student', {"net_id":id.id}); }
[ "function remove_queue(id){\n socket.emit('remove_student', {\"net_id\":id.id});\n}", "emitToStudents(title, message) {\n this.studentSockets.forEach( (studentS) => {\n // console.log(`Emitting: ${title} to student ${studentId}`)\n studentS.emit(title, message);\n });\n }...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Called to initiate HaploView Job
function getHaploview() { Ext.Ajax.request({ url: pageInfo.basePath+"/asyncJob/createnewjob", method: 'POST', success: function(result, request) { RunHaploViewer(result, GLOBAL.DefaultCohortInfo.SampleIdList, GLOBAL.CurrentGenes); }, failure: function(result, request) { Ext.Msg.alert('状态', '无...
[ "function RunHaploViewer(result, SampleIdList, genes)\n{\n\t//Get the job information returned from the web service call that created the job.\n\tvar jobNameInfo = Ext.util.JSON.decode(result.responseText);\t\t\t\t\t \n\tvar jobName = jobNameInfo.jobName;\n\n\tgenePatternReplacement();\n\t/*//Show the window that d...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
insertAt(idx, val): add node w/val before idx.
insertAt(idx, val) { if (idx > this.length || idx < 0) { throw new Error("Invalid index."); } if(idx === 0) return this.unshift(val); if(idx === this.length) return this.push(val); let previous = this._get(idx - 1); let newNode = new Node(val); newNode.next =previous.next; previ...
[ "insertAt(idx, val) {\n if (idx < 0 || idx > this.length) {\n throw new Error(\"Invalid index\");\n }\n if (idx === 0) {\n this.unshift(val);\n }\n if (idx === this.length) {\n this.push(val);\n }\n\n let newNode = new Node(val);\n // TODO\n }", "insertAt(idx, val) {\n\t\tl...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Next fonts will be set to null if they fail to load.
function loadFail() { nextFonts = null; }
[ "function cacheNextFonts() {\n saveNextFontNames();\n loadFonts();\n }", "function loadFonts() {\n var list = document.fonts.values();\n var item = list.next();\n while (! item.done) {\n item.value.load();\n item = list.next();\n }\n }", "loadFonts() {...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the deaths to fulfill the corresponding intent.
function death(agent) { console.log('death: agent.parameters = ' + JSON.stringify(agent.parameters)); // Currently we only support country-wide metrics, but you can extend // this webhook to use other location parameters if you want. // See the comment in queryCovid19dataset function. var country = agent.para...
[ "getDeathEnviroMessage(tribute){\n return tribute.getName() + \" has died from nature.\"\n }", "function _processDeath() {\n const animals = this.$.model.animals;\n for (let animalId of animals) {\n let anm = animalProxy.get(animalId);\n if (anm.deathTrigger || !anm.isFed()) \n anm.die();\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function responsible for set the _turn value
set turn(value) { this._turn = value; }
[ "setTurn(turn) {\n this.turn = turn;\n }", "setTurnTime() {\n this.turnTime = this.settingsTurnTime*1000;\n }", "function change_turn(){\r\n\r\n if(turn == 1){\r\n turn = 2;\r\n }\r\n else{\r\n turn = 1;\r\n }\r\n\r\n}", "setTurning() {\n this.turning = Constants...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
subir un archivo referenciado a un tramite en proceso
function subirArchivo( archivo ) { openModalLoader(); var key = vm.saveKeyUpload; // referencia al lugar donde guardaremos el archivo var refStorage = storageService.ref(key).child(archivo.name); // Comienza la tarea de upload var uploadTask = refStorage.put(archivo); uploadTa...
[ "function solucionarReferenciasArchivos() {\n\n //solo se ejecuta si la vista es de arbol\n if (_tipo_vista == \"tree\") {\n var res = \"\";\n $(\"a[href^='javascript:mostrarDialogoOpcionesArchivo']\").each(function () {\n\n var attributo_todo = $(this).attr(\"href\");\n va...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check for and warn on the following error conditions with a form component: A value prop is provided (indicated it's being used as controlled) without a change handler, and the component is not readonly Both the value and defaultValue props are provided The component is attempting to switch between controlled and uncon...
function warnControlledUsage(params) { if (true) { var componentId = params.componentId, componentName = params.componentName, defaultValueProp = params.defaultValueProp, props = params.props, oldProps = params.oldProps, onChangeProp = params.onChangeProp, readOnlyProp = params.readOnlyProp, valueProp = par...
[ "function warnControlledUsage(params) {\n if (true) {\n var componentId = params.componentId, componentName = params.componentName, defaultValueProp = params.defaultValueProp, props = params.props, oldProps = params.oldProps, onChangeProp = params.onChangeProp, readOnlyProp = params.readOnlyProp, valuePro...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Update Business Base info ,can't update img_url ,address etc properties.
function updateBizBaseInfo(req, res , next){ var params=req.params; bizdao.updateBizBaseInfo(req.params , function(error,result){ if(error){ logger.error(' updateBizBaseInfo ' + error.message); throw sysError.InternalError(error.message,sysMsg.SYS_INTERNAL_ERROR_MSG); }...
[ "function updateBusinessImage () {\n var filesSelected = document.getElementById (\"chooseImg\").files;\n var srcData;\n if (filesSelected.length > 0) {\n var fileToLoad = filesSelected [0];\n var fileReader = new FileReader ();\n fileReader.onload = function (fileLoadedEvent) {\n src...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Appends a script element at the end of the with the content of code, after transforming it.
function run(transformFn, script) { var scriptEl = document.createElement('script'); scriptEl.text = transformCode(transformFn, script); headEl.appendChild(scriptEl); }
[ "function appendToScript(code){\n var script = document.createElement('script');\n script.setAttribute('class', 'aceCode');\n try {\n script.appendChild(document.createTextNode(code));\n document.body.appendChild(script);\n } catch (e) {\n script.text = code;\n docume...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set a task string (used if you need to lock a task)
function setTask(creep, task) { creep.memory.lockedTask = task; }
[ "function setTask(iTask, iWhen, target, options, iVillageId) {\r\n\t\t_log(3, \"-> setTask()\");\r\n\r\n//\tif (iTask==5){\r\n//\t\tvar iVillageId = target;\r\n//\t}else{\r\n//\t\tvar iVillageId = getActiveVillage();\r\n//\t}\r\n\r\n\tif (iTask==5){\r\n\t\tiVillageId = target;\r\n\t} else if (!iVillageId) {\r\n\t\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Note: We are injecting the Router so it gets created eagerly...
function RouterModule(guard,router){}
[ "init() {\n this.router.get(this.path, this.process);\n }", "routerReady() { }", "registerRouter() {\n this.application.container.singleton('Adonis/Core/Route', () => {\n return this.application.container.resolveBinding('Adonis/Core/Server').router;\n });\n }", "construct...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the current width of each column to its style.width property
_freezeColumnWidth() { this._forEachRowCell(this._containerHead, 0, (cell, columnIndex) => { const width = cell.width; // get current numeric width cell.width = width; // set width to style.width this._columns[columnIndex].width = cell.width; // fetch real width again and sto...
[ "setColumnWidths() {\n let css = '';\n let colsWithoutWidth = 0;\n\n let styleSheet = null;\n\n if (this.shadowRoot.adoptedStyleSheets) {\n styleSheet = this.shadowRoot.adoptedStyleSheets[0];\n } else if (this.shadowRoot.styleSheets) {\n styleSheet = this.shadowRoot.styleSheets[0];\n }\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Read a varint encoded integer.
varint() { this.throw_if_less_than(1); let val = this.buffer[this.pos]; this.pos += 1; if (val <= 250) { return val; } // u16 if (val == 251) { return this.full_u16(); } // u32 if (val == 252) { retur...
[ "function readVarInt(buffer) {\n const val = readVarUInt(buffer);\n return (val & 1) ? (val + 1) / -2 : val / 2;\n}", "read_varint32() {\n var result = 0, shift = 0, b;\n do {\n b = this.input[this.pos++];\n result += (b & 0x7f) << shift;\n shift += 7;\n } while (b >= 0x80);\n if ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Called when the Pokemon Name/ID filter changes.
function OnPokemonNameIDChanged(filter) { filterNameID = filter; OnFilterCriteriaChanged(); }
[ "onNameFilterUpdated() {\n }", "function filterPokemon() {\n pokemonSearchInputField.addEventListener('input', function () {\n const userInput = event.target.value\n const filteredPokemon = allPokemonData.filter(function (pokemon) {\n return pokemon.name.includes(userInput)\n })\n p...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns delta between "Entered" and "Now" for the given category. Category can be one of "Negative" or "Suicidal".
calculateDeltas(category) { // Memoize! if (this.deltas[category]) { return this.deltas[category]; } const deltas = this.deltas[category] = []; const enter_index = this.getEnteredIndex(category); const now_index = this.getNowIndex(category); Object.entries(this.data).forEach( ([e...
[ "function getLevelArgsForCategory(context) {\n //category look uses a slight different levels \n //than continuous one. Init it from level store.\n var CatLevelStore = initCatLevelStore(context.timeBodyCtx);\n\n var result = [];\n // If range is empty, return the default\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
========== // EVENTS // ========== // Called when media status changes.
onMediaStatusUpdated(handler) { return EventEmitter.addListener(Native.MEDIA_STATUS_UPDATED, handler); }
[ "function onMediaStatusUpdate(isAlive) {\n\tif (!isAlive) {\n\t\tcurrentMediaTime = 0;\n\t}\n\t//updates html to media changes\n\t// else {\n\t\t// if (currentMediaSession.playerState == 'PLAYING') {\n\t\t\t// if (progress)\n\t\t// }\n\t// }\n}", "function onMediaStatusChange() {\n\t \tvar status = argumen...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns true if the average amplitude is above threshold across the whole snapshot Smaller FFT sizes will have a similar averaging effect
function thresholdSustained(waveData, threshold) { let total = 0; for (var i = 0; i < waveData.length; i++) { // Use Math.abs to swap negatives into positive total += Math.abs(waveData[i]); } const avg = total / waveData.length; // For debugging it can be useful to see computed average values // co...
[ "function thresholdPeak(waveData, threshold) {\n let max = Number.MIN_SAFE_INTEGER;\n for (var i = 0; i < waveData.length; i++) {\n // Need to use Math.abs to swap negatives into positive\n if (Math.abs(waveData[i]) > threshold) return true;\n max = Math.max(max, Math.abs(waveData[i]));\n\n }\n // For ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Converts a DataFrame or Series to CSV.
to_csv(options) { return toCSV(this, options); }
[ "converToCSV() {\n const lines = [];\n const numCols = this._findLongestLength();\n\n for (const row of this.rows) {\n let line = \"\";\n for (let i = 0; i < numCols; i++) {\n if (row.children[i] !== undefined) {\n line += TableCSVExporter...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
fetches the corresponding quantity value stored in the JSON
async function getItemQuantity(itemName) { //TODO: ADD IN URL LATER AND SHOULD HAVE + '/' + UID const res = await fetch('url'); if (res.ok) { //json will be a list of all the items, which will have quantity when grabbing item let json = await res.json(); console.log(json); if...
[ "get quantity() {\n if (this._observation.findingResult.value instanceof Quantity) {\n return {\n number: this._observation.findingResult.value.number.decimal,\n unit: this._observation.findingResult.value.units.coding.code.value,\n };\n } else {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
FUNCTION: addSimpleWhere DESCRIPTION: ARGUMENTS: RETURNS:
function SBRecordsetPHP_addSimpleWhere(sqlObj, columnName, operatorType, parameterName) { switch (operatorType) { case "=": case ">": case "<": case ">=": case "<=": case "<>": sqlObj.whereClause = dwscripts.encodeSQLColumnRef("" ,columnName) + " " + operatorType + ...
[ "_addWhere(type, a, op, b, nArgs) {\n var node;\n var where = this._where;\n var aIsArray = false;\n\n // Accept 1, 2 or 3 arguments.\n if (nArgs >= 2) {\n if (typeof a === \"string\")\n a = COL(a);\n if (nArgs === 2)\n node = BINARY_OP(a, \"=\", op);\n else\n node...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
create array to manage the weighted frequencies of the different game object types
createGameObjectFreqArray() { this.objectFreqArray = []; for (let key in this.objectFreq) { if (this.objectFreq.hasOwnProperty(key)) { let count = this.objectFreq[key][0]; for (let n = 0; n < count; n++) { this.objectFreqArray.push(this.objectFreq[key][1]); } } } }
[ "createWeightedArray()\n\t{\n\t\tvar side = 1; // Represents each side of a die\n\t\tvar i = 0;\n\t\tthis.weightedArr = [];\n\t\t\n\t\twhile (i < this.probabilities.length)\n\t\t{\n\t\t\tvar countDown = this.probabilities[i];\n\t\t\twhile (countDown > 0)\n\t\t\t{\n\t\t\t\tthis.weightedArr.push(side);\n\t\t\t\tcount...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get lang index by attribute id
function getAttributesLangIndex(attribute) { var l = $(attribute.container).data("langind"); if (l === undefined) { return false; } var ind = parseInt(l); if (isNaN(ind)) { return false; } return ind; }
[ "function lang_code(id) {\n return id_key(id);\n}", "function getTextIndex(field,lang) {\n\n var result;\n \n $.each(texts[lang],function(index,value) {\n\n if($(field).attr(\"id\") in texts[lang][index]){\n result = index;\n }\n\n });\n\n if(result == null){\n cons...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Determine if valid join type is selected
function joinValid() { if ( angular.isDefined(vm.joinType) && vm.joinType !== null && (vm.joinType === JOIN.INNER || vm.joinType === JOIN.LEFT_OUTER || vm.joinType === JOIN.RIGHT_OUTER || vm.joinType === JOIN.FULL_OUTER) ) { return true; } ...
[ "_joinType(val) {\n if (arguments.length === 1) {\n this._joinFlag = val;\n return this;\n }\n const ret = this._joinFlag || 'inner';\n this._joinFlag = 'inner';\n return ret;\n }", "get joinType() {\r\n if (this.isLeave) {\r\n return undefined;\r\n }\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Write the JSON string "yes" to stdout.
function printYes() { process.stdout.write(JSON.stringify("yes")); }
[ "function printNo() {\n process.stdout.write(JSON.stringify(\"no\"));\n}", "function json(obj) {\n if(program && program.json) process.stdout.write(JSON.stringify(obj));\n }", "function printJSON(obj) {\n if (output_fd === 1) {\n process.stdout.write(JSON.stringify(obj, 2, 2));\n return;\n }\n const...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets or Sets the after spacing for selected paragraphs.
set afterSpacing(value) { if (value === this.afterSpacingIn) { return; } this.afterSpacingIn = value; this.notifyPropertyChanged('afterSpacing'); }
[ "get lineSpacing() {}", "set lineSpacing(value) {}", "function FixWordParagraphSpacing() { }", "get textAfter() {\n return this.textAfterPos(this.pos);\n }", "function SingleSpaceParagraphs() { }", "get textAfter() {\n return this.textAfterPos(this.pos);\n }", "serializeParagraphSp...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Renders the AWS CloudFormation properties of an `AWS::WAFv2::WebACL.Body` resource
function cfnWebACLBodyPropertyToCloudFormation(properties) { if (!cdk.canInspect(properties)) { return properties; } CfnWebACL_BodyPropertyValidator(properties).assertSuccess(); return { OversizeHandling: cdk.stringToCloudFormation(properties.oversizeHandling), }; }
[ "function cfnWebACLJsonBodyPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnWebACL_JsonBodyPropertyValidator(properties).assertSuccess();\n return {\n InvalidFallbackBehavior: cdk.stringToCloudFormation(properties.invalidFallbackBeha...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Action creator for setting focused contact.
function focusContact(index) { return function(dispatch, getState) { var state = getState(); var contact = state.outlook.pages[state.outlook.page][index]; // If it's a CRM contact update initials if (state.outlook.contactView === model_2.Contac...
[ "function edit_selected_contact(aController, aFunction) {\n windowHelper.plan_for_modal_dialog(\"Mail:abcard\", aFunction);\n aController.click(\n aController.window.document.getElementById(\"button-editcard\")\n );\n windowHelper.wait_for_modal_dialog(\"Mail:abcard\");\n}", "function editContact() {\n va...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks to make sure all events have been rendered and that the calendar has internal info on all the events.
function checkAllEvents() { expect(currentCalendar.getEvents().length).toEqual(3) expect($('.fc-event').length).toEqual(3) }
[ "function checkAllEvents() {\r\n\t\texpect($('#cal').fullCalendar('clientEvents').length).toEqual(3);\r\n\t\texpect($('.fc-event').length).toEqual(3);\r\n\t}", "function checkAllEvents() {\n expect(currentCalendar.getEvents().length).toEqual(3)\n expect(getEventEls().length).toEqual(3)\n }", "renderEvent...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Getting the length of the userinput
function inputLength() { return userInput.value.length; }
[ "function inputLength(){\n return textInput.value.length;\n}", "function userLengthFunc(){\n userLength = prompt(\"Please enter password length, password needs to be from 8 to 128 characters long:\");\n userLength = parseInt(userLength);\n return userLength\n }", "function getPasswordLength() {\n return...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Recursively process states until there are none left... This is used for constructing the parsers DFA.
function processStates(parserDescription, states, current_position) { if(typeof current_position === "undefined") { current_position = 0; } if(current_position >= states.length) { return states; } // Loop over the symbols we care about in this state and push new states // onto the DFA accordingly var impor...
[ "function expand (unexpanded) {\n acceptState = false // reset for this expansion\n var expandedChoices = {} // dictionary of possible next terminals, + their stateStacks\n while (unexpanded.length !== 0) {\n var stateStack = unexpanded.pop()\n if (stateStack.length === 0) { // if tru...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Deletes from saved stops and removes parent element to remove the row from the page.
remove(el) { const key = el.target.getAttribute("data-key"); Storage.removeSavedStops(key); el.target.parentNode.remove(); const stops = Storage.getSavedStops(); if(Object.keys(stops).length === 0) { this.renderNoStops(); } }
[ "function deleteStop() {\n var index = tripObj.features[(currentStop - 1)];\n tripObj.features.splice(index, 1);\n storeLocal();\n messages('stop-delete'); \n $('.location:nth-child(' + currentStop + ')').remove();\n}", "function removeDelete () {\n $(this).parent().remove();\n }",...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Given side, finds king and return square in front of king
function findKingFront(side, state){ var sideadd = {S:-1,G:1} var kingFront = 00 var whereking = 00 var k = side + "K" var j = side + "J" for (i in state){ if (state[i] == k || state[i] == j){ whereking = i } } var x = parseInt(whereking.charAt(1)) var y = parseInt(whereking.charAt(2)) ...
[ "function checkKing(side) {\n\t//Get side-specific info\n\tlet row = undefined;\n\tif (side == SIDE_RED) row = boardState[boardState.length-1]; else row = boardState[0];\n\tlet man = side == SIDE_RED ? REDM : WHITEM;\n\tlet king = side == SIDE_RED ? REDK : WHITEK;\n\t\n\tfor (let i in row) {\n\t\tif (row[i] == man)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Disabling Email Pop up
function disablePopup(){ if(popupStatus==1){ $("#backgroundPopup").fadeOut("slow"); $("#popupEmail").fadeOut("slow"); popupStatus = 0; } }
[ "function __hide_email(){\n\tok=true;\n\tif (this.form_emails.length!=0){\n\t\tok = confirm(LOCALE_DESTROY_EMAILS);\n\t}\n\tif (ok){\n\t\tthis.form_emails = new Array();\n\t\tthis.form_url=\"\";\n//\t\tdocument.all.list_of_emails.innerHTML=\"\";\n\t\tLIBERTAS_GENERAL_printToId(\"list_of_emails\",\"\");\n\t\tLIBERTA...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Determine if the file is a HL7 file (returns true/false). This expects that the file extension is .hl7, or the first line contains a MSH segment (or FHS of BHS segment for batch files).
function IsHL7File(editor) { if (editor) { if (editor.document.languageId == "hl7") { console.log("HL7 file extension detected"); return true; } firstLine = editor.document.lineAt(0).text; var hl7HeaderRegex = /(^MSH\|)|(^FHS\|)|(^BHS\|)/i if (hl7Heade...
[ "function isCFFFile(file) {\n const header = file.peekBytes(4);\n if (/* major version, [1, 255] */ header[0] >= 1 &&\n /* minor version, [0, 255]; header[1] */\n /* header size, [0, 255]; header[2] */\n /* offset(0) size, [1, 4] */ (header[3] >= 1 && header[3] <= 4)) {\n return true...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
removeVowels its accept a string convert the string to lowercase and split it each character into an array so we can filter it inside the callback we can check to see if that characeter we are add is inside of the vowels string using indexOf if it's not we would add it to the filter array finally we will joint this arr...
function removeVowels(str) { var vowels = "aeiou"; return str.toLowerCase().split('').filter(function(val) { return vowels.indexOf(val) === -1; }).join(''); }
[ "function removeVowels(str) {}", "function removeVowels(string) {\n const vowels = \"aeiou\";\n return string\n .toLowerCase()\n .split(\"\")\n .filter(function(val) {\n return vowels.indexOf(val) === -1;\n })\n .join(\"\");\n}", "function removeVowels(str) {\n\n const vowels = 'aeiou';\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
=====================================================================\ void stopCode() \=====================================================================
function stopCode() { // Remove listeners webglCanvas.onclick = null; window.onkeydown = null; // Stop rendering and clear canvas. if (anim_id && renderer) { cancelAnimationFrame(anim_id); renderer.setClearColor(0x000000); renderer.clear(); renderer.dispose(); scene = new THREE.Scene(); } }
[ "function stopCode () {\n app.sandbox.stop()\n}", "stop() {\n\t\tthis.playground.erase();\n\t}", "stop() {\n\n this.editor.setOption('readOnly', false);\n\n this.shouldStop = true;\n if (this.currentRejectPromise !== undefined) {\n this.currentRejectPromise('Interrupted execution');\n }\n i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
loads/creates the amplifiers page dynamically via a call to the generateProductPage() in the generateProducts.js file in the ./js/ directory
function loadAmplifiersPage(){ loadNavbar(); generateProductPage("amplifier"); }
[ "function loadGuitarsPage(){\n\tloadNavbar();\n\tgenerateProductPage(\"guitar\");\n}", "function _handleProductPage() {\n var productId = scopeWindow.location.pathname.split('/').pop();\n _parseProduct(productId, document.querySelector('article.product'));\n }", "function loadProductPage() {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Procedure/Functie: aanmaken_grid_layout() Beschrijving: 'Deze functie maakt de grid layout aan zoals deze is gedefinieerd in de grid datastructuur'
function aanmaken_grid_layout() { var nummer = 0; var kolom__struct = ''; var grid__struct = ''; for (rij = 0; rij < grid_struct__obj.aantal_rijen; rij++) { kolom__struct = ''; for (kolom = 0; kolom < grid_struct__obj.aantal_kolommen; kolom++) { n...
[ "function gridLayout() {\n \n //set grid width so that it occupies the total available area\n var availableW = window.innerWidth - side - rightMargin;\n var availableH = window.innerHeight - 2*mainHeaderH;\n mainProjectGridContainer.style.width = (availableW).toString().concat(\"p...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Query all orders from Parse
function all_orders_query() { var query = new Parse.Query(Order); query.equalTo("user", user); query.descending("createdAt"); return query; }
[ "getOrders() {\n return new Promise((resolve, reject) => {\n this.db.orders.find().exec((err, orders) => {\n if (err) {\n reject(err);\n return;\n }\n\n resolve(orders);\n });\n });\n }", "static getAllOrder() {\n const sql = `SELECT a.no, a.\"id\" as...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
padZeros() Used to generate the appropriate number of zeroes for a bound ProfileID. number parameter is the number to be padded. if number = 1 padZeros() would return 0001 (so profileID could be p0001) if number = 10 padZeros() would return 0010 (so profileID could be p0010)
function padZeros(number) { var result; if (number < 10) result = '000' + number; else if (number < 100) result = '00' + number; else if (number < 1000) result = '0' + number; return result; }
[ "function pad(number) \n{ \n\tif(number < 10 && String(number).substr(0,1) == '0')\n\t{\n\t\treturn number;\n\t}\n \n\treturn (number < 10 ? '0' : '') + number\n \n}", "function padWithZeros(number,length) {\n\t var str = \"\" + number;\n\t while( str.length < length ) str = '0' + str;\n\t return str;\n}", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
TODO: this function is not called anywhere, decide weather we need it. / Save Policy
function savePolicy(policy_uid, data, callback, err_call){ requestService.updateData([prefix, policy_uid], data, callback, err_call) }
[ "savePolicy(policy) {\n return this._saveAttribute('policy', policy);\n }", "async savePolicy(model) {\n throw new Error('not implemented');\n }", "async save(closeOnSave) {\n const policyStr = this._codeMirror.getValue().strip();\n let policy;\n\n try {\n pol...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates products from scratch
function createProductsFromScratch() { for (let i = 0; i < productNames.length; i++) { const productName = productNames[i]; new Picture(productName, './img/' + productName + '.jpg'); } }
[ "function createNewProducts(){\n new Product('R2D2 bag', 'bag.jpg');\n new Product('Banana Slicer', 'banana.jpg');\n new Product('Bathroom Multitasker', 'bathroom.jpg');\n new Product('Toeless Rainboots', 'boots.jpg');\n new Product('Breakfast Oven', 'breakfast.jpg');\n new Product('Meatball Bubblegum', 'bubb...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get Url Id Parameter From Url
function GetUrlIdParameterFromUrl(url) { // If url is null or empty if (url == undefined || url == "") { return ""; } // try for youtube var youtubeRegex = /(\?v=|\/\d\/|\/embed\/|\/v\/|\.be\/)([a-zA-Z0-9\-\_]+)/; var result = url.mat...
[ "function getIdFromUrl() {\n var url_string = window.location.href;\n var url = new URL(url_string);\n return url.searchParams.get(\"id\");\n}", "function getUrlId() {\n\tlet url = getUrlString();\n\tlet id = url.slice(url.length - 1, url.length);\n\treturn id;\n}", "function extractIdFromUrl( url ) {\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Import a previously registered identifier for a message or other descriptor. Uses the symbol table to look for the type, adds an import statement if necessary and automatically finds a free name if the identifier would clash in this file. If you have multiple representations for a descriptor in your generated code, use...
type(source, descriptor, kind = 'default', isTypeOnly = false) { const symbolReg = this.symbols.get(descriptor, kind); // symbol in this file? if (symbolReg.file === source) { return symbolReg.name; } // symbol not in file // add an import statement co...
[ "function varToImport(dec, kind) {\n let m;\n if ((m = matchRequire(dec))) {\n if (m.id.type === 'ObjectPattern') {\n return patternToNamedImport(m);\n }\n else if (m.id.type === 'Identifier') {\n return identifierToDefaultImport(m);\n }\n }\n else if ((m = matchRequireWithProperty(dec))) ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function drag flag This function does some work before dragging starts i.e. closes folders and sets the drag flag
function drag_flag(){ drag_manager.drag_flag=true; for(c=0;c<open_folders.length;c++){ if(document.getElementById(open_folders[c].id).open){ if(document.getElementById(open_folders[c].id).highlight){ folder_open_close(open_folders[c]); } } } folder_positions_find(); }
[ "function file_drag_start(){\n\n\tdrag_flag();\n\n}", "dragStart() {\n this.draggingNonFile = true;\n }", "function win_drag_start(ftWin){draggingShape = true;}", "function dragReset(){\r\n\tdragapproved=false;\r\n\tdragvert=false;\r\n\tdragmoving=false;\r\n}", "dragEnd() {\n th...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Mouse click data query inputs the geometry of the data query feature, and matches to it.
function mouseclickQueryTask(url, geometry) { var queryTask = new QueryTask({ url: url }); var params = new Query({ geometry: geometry, returnGeometry: true, outFields: ["own_name", "parcel_id", "state_par_", "pli_code", "custom_size", "av_nsd", "t...
[ "function selectFeatureFromGrid(event) {\n querySupport.where = \"station_id = '\"+event.rows[0].id+\"'\";\n // When resolved, returns features and graphics that satisfy the query.\n queryTask.execute(querySupport).then(function(results){\n\n app.mapView.graphics.removeAll();\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Split: Returns a zerobased, onedimensional array containing a specified number of substrings Parameters: Expression = String expression containing substrings and delimiters. If expression is a zerolength string(""), Split returns an empty array, that is, an array with no elements and no data. Delimiter = String charact...
function Split(Expression, Delimiter){ var temp = Expression; var a, b = 0; var array = new Array(); if (Delimiter.length == 0){ array[0] = Expression; return (array); } if (Expression.length == ''){ array[0] = Expression; return (array); } Delimiter = Delimiter.charAt(0); for (var...
[ "function Split(Expression, Delimiter)\r\n{\r\n\tvar temp = Expression;\r\n\tvar a, b = 0;\r\n\tvar array = new Array();\r\n\r\n\tif (Delimiter.length == 0)\r\n\t{\r\n\t\tarray[0] = Expression;\r\n\t\treturn (array);\r\n\t}\r\n\r\n\tif (Expression.length == '')\r\n\t{\r\n\t\tarray[0] = Expression;\r\n\t\treturn (ar...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add a new room (only supports rooms of type battle)
function addRoom(id, type) { if(ROOMS[id]) return ROOMS[id]; if(type == "battle") { ROOMS[id] = new BattleRoom(id, send); return ROOMS[id]; } else { logger.error("Unkown room type: " + type); } }
[ "addRoom(){\n\t\tvar newRoom = new Room(this);\n\t\tthis.rooms.push(newRoom);\n\t}", "function addRoom(id, type) {\n\tif(type == \"battle\") {\n\t\tROOMS[id] = new BattleRoom(id, send);\n\t\treturn ROOMS[id];\n\t} else {\n\t\tlogger.error(\"Unkown room type: \" + type);\n\t}\n}", "function addRoom() {\n /*\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets up the effects.
_setUpEffects () { this._tearDownEffects(); this.effects.forEach((effectName) => { let effectDef; if ((effectDef = this._scrollEffects[effectName])) { this._effects.push(this._boundEffect(effectDef, this.effectsConfig[effectName])); } }); this._effects.forEach((effectDef)...
[ "function setupSoundsAndEffects() {\n\t\tsetupLeapSounds();\n\t\tsetupBeat();\n\t\tsetupKeyboardSounds();\n\t}", "createEffects() {\n config.effects.forEach(effect => {\n this.makeEffect(effect.name, effect.params);\n })\n }", "function effectsUtils()\n{\n}", "function initEffects() {\n var key;...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Infer output format by considering file name and (optional) input format
function inferOutputFormat(file, inputFormat) { var ext = getFileExtension(file).toLowerCase(), format = null; if (ext == 'shp') { format = 'shapefile'; } else if (ext == 'dbf') { format = 'dbf'; } else if (ext == 'svg') { format = 'svg'; } else if (/json$/.test(ext)) { ...
[ "function convertTo(filePath, inFormat, outFormat) {\n const dirname = path.dirname(filePath) + '/';\n const newFileName = path.basename(filePath, inFormat) + outFormat;\n\n if (fs.stat(filePath), (err, stats) => {\n \tif (err) {\n \t\tthrow err;\n \t} \n\n \tif (!stats.isFile()) {\n \t\tthrow new Error('Re...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function Edit Enrollment Data
function edit_enrollment(eThis) { var trIndex=eThis.parents('tr').find('td:eq(0)').text(); $('body').append(popup); $(".popup").load("form/"+form[menuId], function(responseTxt, statusTxt, xhr) { if (statusTxt == "success") var tr = eThis.parents('tr'); ind...
[ "function editAdmit() {\n dataService.get('admission', {'PATKEYID':$scope.patient.KEYID}).then(function(data){\n var admitArr = data.data;\n var currentAdmit = admitArr.slice(-1).pop();\n $scope.currentAdmitKEYID = currentAdmit.KEYID;\n\n //update admit object\n var updateAdmit = {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Resets all pieces and tiles on the board
reset() { for (let i = 0; i < this.tiles.length; i++) { this.tiles[i].unsetPiece(); } for (let i = 0; i < this.whitePieces.length; i++) { this.whitePieces[i].unsetTile(); this.whitePieces[i].animation = null; this.blackPieces[i].unsetTile(); this.blackPieces[i].animation = null; } }
[ "function resetBoard() {\n resetSolveBtn();\n setBoard(preset);\n drawTiles();\n}", "cleanBoard() {\n this.pieces = []\n\n this.tiles.forEach(row => {\n row.forEach(tile => {\n tile.clearPieces()\n })\n })\n }", "function resetBoard() {\n // res...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check if a value passes a `Struct`.
function is(value, struct) { const result = validate(value, struct); return !result[0]; }
[ "function sc_isStruct(o) {\n return (o instanceof sc_Struct);\n}", "function isStruct (type) {\n return !!type.__isStructType__ || test.test(type)\n}", "function validateStruct(json, struct, strict=false) /*boolean*/ {\n // struct can be the typeof of the object.\n if (typeof struct === 'string') {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Import an existing Route given attributes
static fromRouteAttributes(scope, id, attrs) { try { jsiiDeprecationWarnings.aws_cdk_lib_aws_appmesh_RouteAttributes(attrs); } catch (error) { if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") { Error.captureStackTrace(error, this.fr...
[ "addRoutes(){\n $.each(this._routes, (index, element) => {\n this._app.get(element.path, () => {\n import(element.options.ref).then(newModule => {\n new newModule.default;\n });\n })\n });\n }", "function Route() {}", "constructor(routes){\n this.routes=routes;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
squares a number x x or Math.pow(x,2)
function square( x ) { return Math.pow( x, 2 ); }
[ "function square(num) {\n\treturn (Math.pow(num, 2));\n}", "function squared(x) {\r\n y = (x * x)\r\n return y\r\n}", "function squared(value) {\n return Math.pow(value, 2);\n }", "function squaredNumber(num) {\n return num * num;\n}", "function square(num) {\n return multiply(num, num);\n}", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
FUNCTION TO CHECK IF USERS ARE FRIENDS
function areUsersFriends(userId) { const $ASYNC = false; const $URL = `${$HEROKU_URL}/api/v1/friendShip/friends/user/${userId}`; const $VERB = 'GET'; const $DATATYPE = 'json'; let areFriends = false; $.ajax({ async: $ASYNC, type: $VERB, url: $URL, dataType: $DATA...
[ "function areFriends(user1, user2){\n var user = Meteor.users.findOne({\n $and: [\n {\n _id: user1\n },\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Calls the onIdChange callbacks with the new FID value, and broadcasts the change to other tabs.
function fidChanged(appConfig, fid) { var key = getKey(appConfig); callFidChangeCallbacks(key, fid); broadcastFidChange(key, fid); }
[ "function fidChanged(appConfig, fid) {\n var key = getKey(appConfig);\n callFidChangeCallbacks(key, fid);\n broadcastFidChange(key, fid);\n }", "function fidChanged(appConfig, fid) {\n var key = getKey(appConfig);\n callFidChangeCallbacks(key, fid);\n broadcast...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Schemas create a schema for each component
function createComponentSchemas() { for (let x in folders) { output.components.schemas[folders[x]] = { description: "", type: "object", properties: {} } let component = config.components[folders[x]] // for every key in the components for that folder for (let y in component) { ...
[ "createSchema() {\n this.entities.forEach((entity) => {\n this.registerSchema(entity);\n });\n }", "function generateSchemas() {\n const { makeExecutableSchema } = graphqlTools,\n schemas = getSchemas(),\n resolvers = getResolvers(),\n { Task, TaskList, Note, User, JWTVerific...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
console.log(CrossCheck_operatingStatus_dateOfCeased ("ceased","")); console.log(CrossCheck_operatingStatus_dateOfCeased ("","21/11/2014"));
function CrossCheck_operatingStatus_dateOfCeased (input1,input2){ var result = new Object(); var error; var input1; var input2; var test = { "Ceased Operation ": input1, "date of Ceased" : input2 }; result.flgname = []; result.flgflag = []; result.flgvalue = []; result.flgmsg = []; r...
[ "function CrossCheck_operatingStatus_dateOfCeased (input1,ceased_op_date){\n\tvar result = new Object();\n\tvar error;\t\n\tresult.flgname = [];\n\tresult.flgs = [];\n\tresult.flgvalue = [];\n\tresult.flgmsg = [];\n\tresult.pass = true;\t\n\tif ((presence_check(input1) || presence_check(ceased_op_date)) ){\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
getModuleCssLocation :: String > String
function getModuleCssLocation (module) { try { if (isTachyonsModule(module)) { return 'node_modules/' + module + '/' + require('./node_modules/' + module + '/package.json').style } else if (isNormalizeModule(module)) { return 'node_modules/' + module + '/' + module } else { console.error...
[ "function getCSSPath() {\r\n return getAssetsPath() + config.build.cssPath;\r\n}", "function traceCss(modulePath) {\n return builder.trace(modulePath)\n .then((trace) => {\n return Object.keys(builder.loader.loads)\n .map((key) => builder.loader.loads[key].address)\n .filter((address) => !...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function delete user checked sms
function sms_smsDelete() { cancelLogoutTimer(); g_sms_checkedList = "<phone>"; var beChecked = $("#sms_table :checkbox:gt(0):checked"); beChecked.each( function() { var tempPhone = this.value; tempPhone = tempPhone.replace(/<br\/>/g, ""); g_sms_checkedList += tempPhone+";"...
[ "function sms_smsDelete() {\n cancelLogoutTimer();\n g_sms_checkedList = \"\";// be checked\n var beChecked = $(\"#sms_table :checkbox:gt(0):checked\");\n beChecked.each( function() {\n g_sms_checkedList+=\"<Index>\"+this.value+\"</Index>\";\n });\n var xmlstr = object2xml(\"request\",\"<In...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Resets this cipher to its initial state.
reset() { // Reset data buffer super.reset.call(this); // Perform concrete-cipher logic this._doReset(); }
[ "reset() {\r\n this.changeState(this._initialState);\r\n }", "reset() {\n // Reset data buffer\n super.reset.call(this);\n\n // Perform concrete-cipher logic\n this._doReset();\n }", "reset() {\r\n this.state = this._initial;\r\n }", "reset() {\r\n this.changeState(this...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
given a number, return whether or not the num is 10
function isTen(num) { return num === 10 ? true : false; }
[ "function isTen(num) {\n return num === 10;\n}", "function isTen(num){\n if(typeof num === 'number' && num === 10){\n return true;\n }else{\n return false;\n }\n}", "function equalsTen(num) {\n return ( num === 10 );\n}", "function equalsTen(num) {\n return num === 10;\n}", "func...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Fetch all restaurants. Returns a promise which resolves to an array.
fetchRestaurants() { return this._updateFromService() .then(() => this.db) .then(db => { const store = this._getStore(db, 'restaurants', false); const request = store.openCursor(); return this._cursorToArray(request); }); }
[ "getAllRestaurants() {\n return get(\n this.supportsOffline,\n getRestaurants,\n arrayCacheService(\n async (dbService, storename) => {\n const store = getStore(storename)(dbService);\n return store.getAll();\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
reformat (TARGETSTRING, STRING, INTEGER, STRING, INTEGER ... ) Handy function for arbitrarily inserting formatting characters or delimiters of various kinds within TARGETSTRING. reformat takes one named argument, a string s, and any number of other arguments. The other arguments must be integers or strings. These other...
function reformat (s) { var arg; var sPos = 0; var resultString = ""; for (var i = 1; i < reformat.arguments.length; i++) { arg = reformat.arguments[i]; if (i % 2 == 1) resultString += arg; else { resultString += s.substring(sPos, sPos + arg); sPos +...
[ "function reformat(s)\r\n{\r\n\tvar arg;\r\n\tvar sPos = 0;\r\n\tvar resultString = \"\";\r\n\r\n\tfor (var i = 1; i < reformat.arguments.length; i++) {\r\n\t\targ = reformat.arguments[i];\r\n\t\tif (i % 2 == 1) resultString += arg;\r\n\t\telse {\r\n\t\t\tresultString += s.substring(sPos, sPos + arg);\r\n\t\t\tsPos...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function to generate pipes
generatePipe() { if (this.pipeArray.length < 1) { this.pipeArray.push(new Pipe(this.ctx)); } else if (this.pipeArray.length === 1) { if (this.pipeArray[0].pipePosition.x < PIPE_WIDTH / 2.5) { this.pipeArray.push(new Pipe(this.ctx)); } } }
[ "createPipes() {\n this.pipeSets.push(this.createPipeSet(0))\n this.pipeSets.push(this.createPipeSet(1))\n }", "loop(count) {\n // save basePipe reference to avoid returned pipe calling itself\n const basePipe = this.pipe;\n return {\n pipe(...parsers) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function: dateShortenByYear(millis,yearExtendedBy) Handles the US/UK date shortened by given year. Parameters: millis timestamp milliseconds
function dateShortenByYear(millis,yearExtendedBy){ var dateTime = new Date(millis); var year = dateTime.getFullYear(); var month = dateTime.getMonth() + 1; var day = dateTime.getDate(); var dateString; year = year - yearExtendedBy; if(clientDateFormat == 'dd/mm/yyyy') { dateString = (da...
[ "function fixYear(date) {\n \n if (date.getFullYear()<1970) date.setFullYear(date.getFullYear() + 100);\n \n return date;\n \n}", "function updateYear(yr){\n\tif(yr < 2500){\n\t \t\tyr = 2500-yr;\n\t \t\tyr = yr + \" BCE\";\n\t \t}else if( yr => 2500 && yr <= 4519){\n\t \t\tyr = yr-2500;\n\t \t\tyr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Process someone completing a task
function processComplete(req, plus, oauth2Client, res) { gplus.getDatabaseUserWithPermission(pool, plus, oauth2Client, "can_remove=1", function(err, gp_user, db_user) { if (err != null) { res.send(err.message, err.code) } else { console.log("Whitelisted:" + gp_user.displayName + ", " + gp_user.id)...
[ "function tasksComplete() {}", "_taskComplete() {\n //\n }", "taskCompleted() {\n if (--this.numTasks === 0) {\n this.onCompletion();\n }\n }", "function handleTaskCompleted () {\n if (!errored) {\n if (event.tasks.valid.length) {\n require('./repor...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Functions indexes all torrents Sets indexedTorrents
function indexTorrents(){ var row1, row2, tid, thisTorrent; for(i=1;i<torrentTable.rows.length;i+=2){ thisTorrent = new Array(); thisTorrent["row1"] = row1 = torrentTable.rows[i]; thisTorrent["row2"] = row2 = torrentTable.rows[i+1]; thisTorrent["seed"] = parseInt(stripHTML(row1.cells[7].innerHTML)...
[ "function indexTorrents(){\n\tvar row1, row2, tid, thisTorrent;\t\n\n\t// Loop through all table rows. Skip the headRow and use steps of 2\n\tfor(i=1;i<torrentTable.rows.length;i+=2){ \t\t\n\n\t\t// Read all data from the table rows and add them to a array\n\t\tthisTorrent = new Array();\n\t\tthisTorrent[\"row1\"] ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Calculates the effect of an activity (A) on target character (C) from source character (S)
function ActivityEffect(S, C, A) { // Calculates the next progress factor var Factor = (PreferenceGetActivityFactor(C, A.Name, (C.ID == 0)) * 5) - 10; // Check how much the character likes the activity, from -10 to +10 Factor = Factor + (PreferenceGetZoneFactor(C, C.FocusGroup.Name) * 5) - 10; // The zone used also...
[ "function ActivityEffect(S, C, A, Z) {\n\n\t// Converts from activity name to the activity object\n\tif (typeof A === \"string\") A = AssetGetActivity(C.AssetFamily, A);\n\tif ((A == null) || (typeof A === \"string\")) return;\n\n\t// Calculates the next progress factor\n\tvar Factor = (PreferenceGetActivityFactor(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function: initCounter Initializes the scrolling counter using the value currently displayed in the element. Parameters: $this the counter container e jQuery Event object See Also:
function initCounter($this, e){ $this.find('.digit').each(function(){ var $display = $(this); var $digit = $display.find('span'); $digit.html([0,1,2,3,4,5,6,7,8,9,0].reverse().join('<br/>')) $digit.css({ top: '-' + (parseInt($display.height()) * ...
[ "function initCountNbr () {\n\n\t\tvar hasCounters = $('#counters').hasClass('count-wrapper');\n\n\t\tif (hasCounters) {\n\n\t\t\tvar waypoint = new Waypoint({\n\t\t\t element: document.getElementById('counters'),\n\t\t\t handler: function() {\n\n\t\t\t \tvar options = {\n\t\t\t\t\t\tuseEasing : true,\n\t\t\t\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
launches project on local machine
function localMachine(path, projecttype, buildtype, buildarchs) { Log('Deploying to local machine ...'); makeAppStoreUtils(path); uninstallApp(path); installApp(path, projecttype, buildtype, buildarchs); var command = "powershell -ExecutionPolicy RemoteSigned \". " + WINDOWS_STORE_UTILS + "; Start-...
[ "function startProjectSetup() {\n\t// set save path value\n\tvar proj_name = $(\"#setup_name\").val();\n\tvar proj_path = nwPATH.resolve(nwPROC.cwd(),'PROJECTS');\n\t// change default path\n\t$(\".pj_path > span\").html(proj_path);\n\t$(\"#setup_path\").nwworkingdir = proj_path;\n\t// show project setup window\n\t$...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
muda o valor final do prato
function mudarValorFinalPromocao() { let id_prato = $("#promocaoIdPrato").val(); let valor = $("#promocaoValor").val(); if (id_prato && valor) { let valorFinal = calcularValorFinal(id_prato, valor); $("#promocaoValorFinal").val(valorFinal); console.table(valo...
[ "calcularPrecioFinal() {\n let precioFinal = 0;\n precioFinal = this.calcularPrecioBase() + this.totalizadorAdicionales() - this.totalizadorDescuentos();\n return precioFinal;\n }", "borrar() {\n this.valorActual = this.valorActual.toString().slice(0,-1);\n this.imprimirV...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
determine the mean of the three scores passed to it and returns the letter associated with that grade GRADE LIST 90 'F' D Use integers for basic math operations A SET scoreLetterGradeRef = gradeList^ SET letterGrade = '' SET mean = (score1 + score2 + score3) / 3 SET switch or if/else to determine the range of the numbe...
function getGrade(score1, score2, score3) { let letterGrade = ''; const mean = (score1 + score2 + score3) / 3; if (mean >= 90 && mean <= 100) { letterGrade = 'A'; } else if (mean >= 80 && mean < 90) { letterGrade = 'B'; } else if (mean >= 70 && mean < 80) { letterGrade = 'C'; } else if (mean >=...
[ "function letterGrade(average) {\n if(average < 60) {\n return \"F\";\n }\n else if(average < 70) {\n return \"D\";\n\n }\n else if(average < 80) {\n return \"C\";\n\n }\n else if(average < 90) {\n return \"B\";\n\n }\n return \"A\";\n}", "function getGra...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check app state and if is needed, restore state from background script
function checkCurrenState() { // console.log("App Current State:" + appCurrentState); if (appCurrentState == undefined) { clearData(); } if (appCurrentState == appStateEnum.signing || appCurrentState == appStateEnum.downloadFile || appCurrentState == ...
[ "function checkRadarAppAutoStart()\n{\n var url = getLocalStorageItem(\"radarapp\");\n\n if (url!==\"false\" && url!==false && url!=null && app.radar_app_auto_start)\n startRadarApplication();\n}", "handleAppStateChange(nextAppState) {\n\n // If the app went to 'active' from 'background', refresh ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }