query
stringlengths
9
34k
document
stringlengths
8
5.39M
negatives
listlengths
19
20
metadata
dict
show the input fields to allow editing a revenue
function showEditRevenueInputFields(_line, _revenueLine) { console.log('[debug] edit revenue options menu: ' + _line + ' --> ' + _revenueLine); }
[ "function showNewRevenueInputFields(_line) {\n\n $('#revenueDetail-' + _line).append('<tr><td>New</td>'\n + '<td><input type=\"text\" class=\"form-control mr-sm-2\" data-provide=\"datepicker\" aria-label=\"operation date\" id=\"inputNewRevenueDate-' + _line + '\" /></td>'\n + '<td><input type=\"tex...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Clears the currentAuthorization context.
function clearAuthorizationContext(){ setContextURL(baseURL + "clearAuthorizationContext"); }
[ "clearAuthData() {}", "clearCurrentUserId() {\n this.req.logout();\n }", "clearContext(){\n this.context = null;\n this.context = new Map();\n }", "function clearAuthHeaderForAPI() {\n $localStorage.Authorization = undefined;\n delete $http.defaults.headers.common.Authorization;...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
called from the MouseOverIMG to set the body mouseover
function SEDHTMLMenu_BodyMouseOver() { document.body.onmouseover = null; SEDHTMLMenu_OverDIV = null; SEDHTMLMenu_OverIMG = null; setTimeout("closeAllMenus();", 500); }
[ "function body(){\n$(\"#job_mail\").mouseover(function(){\n\tnew Messi.img(\"http://website.informer.com/thumbnails/280x202/d/drap.hr.png\",\n\t\t{\n\t\t\ttitle:'Drap.hr',\n\t\t\tcenter: true\n\t\t});\n});\n}", "e_mouseOver(e)\n\t{\n\n\t}", "function setBodyLinkHoverHandlers() {\n $j('a.bibr[rid]')\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
////////////// ///////// /////////// ////////// Summoner Stats: Ranked //////////// /////////// ///////////// ////////////////////////////// ////////////////////////////////////////////////////////////////////// This function fetches the stats of the summoner by submitting that person's summoner name (ingamename)
function getSummonerStatsRanked(){ }
[ "function getRanked(summoner, callback)\n{\n // Ranked info\n irelia.getRankedStatsBySummonerId(summoner.region, summoner.id, function (err, summonerRankedInfo) {\n if(err) {\n // Play catch\n callback({status: 'error', data: err});\n } else {\n // Play catch\n callback({status: 'success...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
returns unit value in terms of cells on the grid axis is a char; 'x' or 'y' representing the axis
function scaleUnits(val, axis){ if (axis === 'y') { return cells(graphScale.yUnit) * val; } if (axis === 'x') { return cells(graphScale.xUnit) * val; } return 0; //maybe throw error instead }
[ "function letterAt(x, y) {\n return grid[y][x];\n }", "function determineCellTypeDev(row, col)\n{\n if ((row === 0) && (col === 0)) return TOP_LEFT_DEV;\n else if ((row === 0) && (col === (gridWidthDev-1))) return TOP_RIGHT_DEV;\n else if ((row === (grid...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
factory L.transformation(a: Number, b: Number, c: Number, d: Number)
function toTransformation(a, b, c, d) { return new Transformation(a, b, c, d); }
[ "function toTransformation(a,b,c,d){return new Transformation(a,b,c,d);}", "function toTransformation(a, b, c, d) {\r\n\t \treturn new Transformation(a, b, c, d);\r\n\t }", "function toTransformation(a, b, c, d) {\r\n \treturn new Transformation(a, b, c, d);\r\n }", "function toTransformation(a, b, c, d) ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
add c spaces to the left of str
function lpad(c, str) { var res = '' + str; if (res.length < c) { res = Array(c - res.length + 1).join(' ') + res; } return res; }
[ "function str_space(str) {\n var new_str = \"\";\n for (var i = 0; i < str.length; i++) {\n var add = i == str.length - 1 ? \"\" : \"\\u200A\";\n new_str += str[i] + add;\n }\n return new_str;\n}", "function fillSpace(str) {\n let result = \"\";\n for(let i = 0; i < str.length; i++) {\n (str....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Display a label when hovering over the graph on the nearest point, displaying its actual value and key name. The hover label consists of DOM nodes, not canvas. The while label consists of 4 elements: .hovercircle: A hollow circle that hovers over the nearest plot point. It's rim's color is the same as the line's. .hove...
function HoverLabel(chart, options) { this.id = options.id this.chart = chart // HTML elements. this.circle = makeLabel("hover-circle") this.valLabel = makeLabel("hover-label hover-value-label") this.dateLabel = makeLabel("hover-label hover-date-label", chart.tpadding) this.vLine = new HoverLi...
[ "function pieHover(event, pos, obj) {\n if (!obj)\n return;\n percent = parseFloat(obj.series.percent).toFixed(2);\n $(\"#hover\").html('<span>' + obj.series.label + ' - ' + percent + '%</span>');\n }", "function pieHover(event, pos, obj) {\r\n if ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Restart recharging of its units
restartRechargeTimers(){ this._units.forEach((unit) => { unit.restartRechargeTimer(); }); this._rechargedUnitsMap.clear(); }
[ "function Restart() {\n webgazer.clearData();\n ClearCalibration();\n PopUpInstruction();\n}", "restart() {\n // changes instrument on front and back end if that was reason for stop\n let newInstrument = this.filter.state.pendingInstrument\n if (newInstrument !== \"\") {\n this....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Display a 4x4 box to show the next shape Define a blank preview board
function drawPreview() { var previewBoard = new Board(4, 5); var previewTable; var x, y, i, totalShapeBlocks; // Position on the preview board: this shape will always be above the // board and to the middle var xOffset = board.BOARD_WIDTH / 2 - 2; var yOffset = bo...
[ "showNextPiece() {\n strokeWeight(2);\n stroke(\"#000000\");\n fill(\"#ffffff\")\n square(400, 10, 150);\n this.next_piece.preview();\n }", "function __prepPreview (idx) {\n var init = {\n game : this,\n padTop : 0,\n padBottom ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function: eventTimeQualifier purpose: set an indicator to let us know the status of this event for example, if start date is today OR if start date < today but end date is today or later
eventTimeQualifier(calobj,startmomentobj,endmomentobj) { var endDiffinDays, startDiffinDays; var startNoTime = startmomentobj.clone(); var endNoTime = endmomentobj.clone(); try { // no time is considered for this startNoTime.startOf('day'); startDi...
[ "get isFullDayEvent() {\r\n if (!this.eventClass.start.dateTime && !this.eventClass.end.dateTime)\r\n return true;\r\n else return false;\r\n }", "function checkCurrent() {\n var i = 0;\n var currentTime = new Date();\n while (i < $scope.events.length) {\n var ev = $scope...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function basically refreshes/reloads the page in order for the timer to be reset
function resetCountdown() { location.reload() }
[ "function reCharge() {\n stopTimer();\n location.reload();\n}", "function resetPage() {\n setTimeout(function() {\n location.reload(true);\n }, 3000);\n}", "function reload_page() {\n // Reload the page\n location.reload();\n\n // Reload again in an hour\n setTimeout( reload_page, 60*60*1...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Nonsensitive info we'll be putting in the token
token() { return { id: this.id, role: this.role, }; }
[ "function getToken()\n{\n return ''\n}", "function Token() {\n}", "function getToken() {\n if ( props.docMode && props.docMode==='true') {\n return \" - \";\n } else {\n return location.state.token;\n }\n }", "convertToToken() {\n return TokenModel.toJson({\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
returns build Google Maps static map url, according to coordinates passed
function getMapURL (coords) { return [ 'https://maps.googleapis.com/maps/api/staticmap?center=' + coords, 'zoom=4', 'size=600x400', 'scale=2', 'format=jpg', 'maptype=satellite', ['markers=size:mid','color:red','label:A', coords].join('%7C'), 'key=AIzaSyCO5ILMljA8FDnUe72qUgGtQwzkjR3HpIQ' ].jo...
[ "function staticMap(lat, lon) {\n var coords = lat + \",\" + lon;\n return \"https://maps.googleapis.com/maps/api/staticmap?center=\"+\n coords + \"&markers=\" + coords +\n \"&zoom=14&size=400x400&key=AIzaSyAH-KSfz-462dVd84424pUVWa7vO2RgfAs\";\n}", "function generateMapImageLink(locLat, locLng...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
hashAsync() Returns Promise for pswd_hash
function hashAsync(password) { // let sHash = ""; return bcrypt.hash(password, SALT_ROUNDS) .then((hashValue) => { // sHash = hashValue; // console.log("hash: ", hashValue); return hashValue; }); }
[ "function hash(string) {\n return new Promise(function(resolve) {\n resolve(Uint8fromHex(sjcl.codec.hex.fromBits(sjcl.hash.sha256.hash(string))));\n });\n}", "function hashCompareAsync(password, pswd_hash) {\n return bcrypt.compare(password, pswd_hash);\n}", "calculateHash() {\n signale.info(\"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
endregion Fill Fields Cancel OS region Clear Fields Cancel OS
function clearFieldsCancelOs() { setIdServiceOrder(""); setSituation(""); setDateTimeSolicitation(""); setOriginServiceOrder(""); setDestinyServiceOrder(""); setObservationCancellation(""); }
[ "function qct_clearui() {\n $('#qct-fieldset input, #qct-fieldset select').val('');\n }", "function clearAfterCloseEditDialog(){\n\t\t//$(\"#addAccessoryDialog\").find(\"#name\").val(\"\");\n\t\t$(\"#editAccessoryDialog\").find(\"#errorName\").text(\"\");\n\t\t$(\"#editAccessoryDialog\").find(\"#name\").c...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
maybe some time passes and now when a user signs up they need to provide an email, date of birth and city
function signup(username, password, email, dateOfBirth, city) { // TODO: create new user }
[ "function signup({userName, userPassword, userEmail, userCity}) {\n\t//do some logic\n}", "function Surrender() {\r\n\t\t\tSecondAuth.surrender = document.forms[\"Validate\"][\"SurrenderDate\"].value;\r\n\t\t}", "function setBirthdayRequestCallback(data){\n if(data.success) {\n if (dat...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
GFV[] Get Freedom Vector 0x0C
function GFV(state) { var stack = state.stack; var fv = state.fv; if (DEBUG) console.log(state.step, 'GFV[]'); stack.push(fv.x * 0x4000); stack.push(fv.y * 0x4000); }
[ "function GFV(state) {\n\t var stack = state.stack;\n\t var fv = state.fv;\n\n\t if (exports.DEBUG) { console.log(state.step, 'GFV[]'); }\n\n\t stack.push(fv.x * 0x4000);\n\t stack.push(fv.y * 0x4000);\n\t}", "function GFV(state) {\n var stack = state.stack;\n var fv =...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Event that will occur when each sound is loaded
function loadHandler(event) { console.log('sound loaded'); // This is fired for each sound that is registered. //var instance = createjs.Sound.play("sound"); // play using id. Could also use full sourcepath or event.src. //instance.addEventListener("complete", createjs.proxy(this.handleComplete, t...
[ "function onSoundLoaded() {\n loadedSoundsCnt++;\n }", "function handleLoad (e) {\n //This will play each time a sound it preloaded\n createjs.Sound.play(e.src);\n }", "function handleFileLoad (e) {\n //A sounds has bee preloaded\n createjs.Sound.play(e.src);\n \n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Initialize Papi iframe modal class.
static init() { if ($('body').hasClass('papi-iframe-mode')) { return; } $(document).on('click', 'a.papi-iframe-link-open', function(e) { e.preventDefault(); if (typeof window.papi.iframe !== 'undefined') { window.papi.iframe.close(); window.papi.iframe = undefined; ...
[ "function injectIframeModal () {\n // create the modal, save references\n $iframeModal = jQuery(we.config.dom.iframeModalMarkup);\n $iframeModalWrapper = $iframeModal.find(\"[data-role='modal-content-wrapper']\");\n $iframeModalConte...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
sorts games data so the map is arranged in descending order by game name
function sortMapByName(){ let aMap1 = sortedGames.sort(); aMap1.sort( compareTitle ); }
[ "function sortGamesByGameId()\n{\n\tgames.sort(function(a, b) {\n\t\treturn a.gameId - b.gameId;\n\t});\t\n}", "function sortMapByScore(){\n let aMap1 = sortedGames.sort();\n aMap1.sort( compareScore );\n}", "function sortGamesByReleaseOrder() {\r\n khGames.sort(function(a,b) {\r\n // Comparator...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creatures that are spawned as part of an event are in the event this is just a helper to get them
getEncounterCreatures(){ if(this.randomEncounter != null){ return this.randomEncounter.getCreatures(); } }
[ "createEventTrigger() {\n this.event1 = new EventTrigger({\n scene: this,\n x: 1200,\n y: 830,\n key: \"eventTrigger\",\n id: 1,\n });\n this.event1.setVisible(false);\n\n //Interact listener\n this.matterCollision.addOnCollideStart({\n objectA: this.player,\n objec...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
randomly assigns a mine using a random number generator.
function assignMine(){ var rand_num = Math.floor(Math.random() * 20); if(rand_num >= 16) { return true; } else{ return false; } }
[ "generateMonster() {\n this.random = Math.floor((Math.random() * 2) + 1);\n }", "function generateMines() {\n\tfor (let i = 0; i < mineCount; i++) {\n\t\tlet randomMines = Math.floor(Math.random() * safeCells.length);\n\t\tlet mine = safeCells[randomMines];\n\n\t\tgameboard[mine[0]][mine[1]] = 'mine'; //set m...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Usage : updateStateAndReturn() For : nothing After: updates the gameState and returns the updated tile maneger
function updateStateAndReturn() { let deadplayers = 0; /* since players are stored in the GameLobby and in the tiles we can plock them out and update them right away and remove them from the tiles but not from the gamelobby */ for(let player in GameLobby._availablePlayers){ // if player is not a...
[ "function updateToState(gamestate) {\n //update the UI here\n}", "updateGame(tile, eventTile) {\n\t\tif (eventTile === true) {\n\t\t\ttile.toggleflag();\n\t\t} else {\n\t\t\ttile.explore();\n\t\t}\n\t\tthis.setState({ board: this.state.board });\n\t\t// winner\n\t\tif (this.state.board.won()) {\n\t\t\talert('you...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Dispatch a transaction. Will call [`dispatchTransaction`]( when given, and otherwise defaults to applying the transaction to the current state and calling [`updateState`]( with the result. This method is bound to the view instance, so that it can be easily passed around.
dispatch(tr) { let dispatchTransaction = this._props.dispatchTransaction; if (dispatchTransaction) dispatchTransaction.call(this, tr); else this.updateState(this.state.apply(tr)); }
[ "dispatch(tr) {\n let dispatchTransaction = this._props.dispatchTransaction\n if (dispatchTransaction) dispatchTransaction.call(this, tr)\n else this.updateState(this.state.apply(tr))\n }", "dispatchTransaction(transaction) {\n if (this.isCapturingTransaction) {\n if (!this.capturedTransaction) ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
making the new links and the new pileups
function change_links(){ // making the pileup for each country group_length=group_pileups.children.length; cylinder_heights_length=cylinder_heights.length; vS_length=vS.length; max_pileups=0.0; for(var i=0;i<n_pileups_year;i++) max_pileups=Math.max(max_pileups,data_json_w['pileups'][pileups_year...
[ "function findNewLinks() {\n var newLinks = $('a').filter(function () {\n return typeof this.piwikDiscovered == 'undefined' || this.piwikDiscovered === null;\n });\n\n if (!newLinks.length) {\n return;\n }\n\n processLinkDelta = {};\n newLinks.each(pro...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get next rendered block
getNextRenderedBlock(block) { if (isNullOrUndefined(block.nextWidget)) { return block.nextRenderedWidget; } return block.nextWidget; }
[ "function GET_NEXT_BLOCK() {\n GET_NEXT_RECYCLABLE_BLOCK();\n if (RES === NO_BLOCK_FOUND) {\n GET_FREE_BLOCK();\n } else {}\n}", "function fetchNextBlock() {\r\n if(thisSequence.length == 0) {\r\n createSequence();\r\n }\r\n // Next block ID from current sequence\r\n const id = thisSequen...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Ends all sessions in the session pool.
endAllPooledSessions() { if (this.sessions.length) { this.topology.endSessions(this.sessions.map(session => session.id)); this.sessions = []; } }
[ "close() {\n for (let sessionId in this._openSessions) {\n if (this._openSessions.hasOwnProperty(sessionId)) {\n this._openSessions[sessionId].close();\n }\n this._pool.purgeAll();\n }\n }", "function endSession(sessionId) {\r\n for (let pool of sessionPools) {\r\n debug(`Attempti...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
ajax call orig problem_description
function get_orig_prob_descrip ( problem_id ) { //call the model in ajax $.ajax( { type: 'POST', url: $( '#root_path' ).val() + 'admin/get_orig_prob_descrip', data: { problem_id: problem_id }, success: function ( e ) { $( '#text_area_problem_descrp' ).val( e ); }, error: function ( jqXHR, exception )...
[ "function updateProblemTab()\n{\n Ajax.makeRequest(\"manage/pintUI.py/getProblemText\", { name : current_problem },\n function(text) { updateElement(\"problem\", \"<textarea>\" + text.encodeEntities() + \"</textarea>\"); });\n}", "function displayDesc() {\n if( ianGetQueryVariable().includes(\"~ibertola\") )...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets neighbor coords for cells on a toroidal grid. Unlike our 2d plane grid below, we need only one neighbor function for this, since being on a torus means handling the "edges" is a matter of taking the modulus of neighbor coords which would otherwise be "off" the 2d grid. If we really wanted to optimize this, we migh...
function getNeighborCoordsTorus(i, j, rows, cols) { return [ // The three cells in the row above. [mod(i - 1, rows), mod(j - 1, cols)], [mod(i - 1, rows), j], [mod(i - 1, rows), mod(j + 1, cols)], // The two cells in the same row, to the left and right. [i, mod(j - 1, cols)], [i, mod(j + 1...
[ "getNeighbors(i, j) {\n\t\tlet neighbors = 0;\n // This section checks above the cell\n //checks up left\n if (i-1 >= 0 && j-1 >= 0 && this.grid[i-1][j-1] > 0){\n neighbors++;\n }\n //checks up\n if (i-1 >= 0 && this.grid[i-1][j] > 0){\n neighbors++;\n }\n //checks up right\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
handles the completion of the timer and clears the stack
function timerComplete () { currentStack = []; timer = undefined; }
[ "function clear(){\n clearInterval(timer);\n }", "function clear(){\n clearInterval(timer);\n }", "function endTimeout() {\n\t\tclear( id );\n\t}", "function timerExec () {\n console.warn('timer start...');\n $this.data('cnt', 0);\n clearTimer();\n }", "function clearTi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
return player current direction
getCurrentDirection() { return this.current; }
[ "get_direction() {\r\n return this.pman.direction_current;\r\n }", "getDirection(){\n let v = this.getVector();\n let dir = v.direction();\n return dir\n }", "calculateDirection()\n {\n if(this.player.inputManager.getHorizontalInput() > 0)\n {\n this...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Administrative functionality commands, req.query.adminRequest: 'list' > list all matches 'migrate_schema' > convert matches from old schema to new schema 'delete_all' > remove all matches
function handleAdminRequests(req, res) { console.log('Match: Admin: \'' + req.query.adminRequest + '\' request issued'); if ((req.query.adminRequest === 'list') || (req.query.adminRequest === 'migrate_schema')) { var listQuery = Match.find({}); listQuery.sort('-created'); listQuery.populate('owne...
[ "function handleAdminRequests(req, res) {\n console.log('Offering: Admin: \\'' + req.query.adminRequest + '\\' request issued');\n\n if ((req.query.adminRequest === 'list') ||\n (req.query.adminRequest === 'migrate_schema')) {\n var listQuery = Offering.find({});\n listQuery.sort('-created');\n list...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function to dynamically load in trials
function loadTrials(matchList, startLoc) { if (matchList == "") { noUpcomingTrials() noPendingTrials() } else { var matches = matchList.sort(sortByDate("start")) matches var nPending = 0 var pendingMatches = [] var nAccepted = 0 for (index = 0; index < matches.length; i...
[ "function loadTricks() {\n // Clear the previous list\n clearTrickTable();\n // Make an Ajax GET call to the 'tricks' endpoint. Iterate through all\n // JSON objects and render them to the summary table\n $.ajax({\n url: 'tricks'\n }).success(function (data, status) {\n fillTrickTabl...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Is a keycode a contorl character? E.g. up, down, left, right, backspc, return, etc.
function isControlCharacter(keyCode){ // TODO: Make more precise/fast. return ( (keyCode >= keyCodes.left && keyCode <= keyCodes.down) || keyCode == keyCodes.back || keyCode == keyCodes.del || keyCode == keyCodes.end || keyCode == keyCodes....
[ "function isControlChar(keyCode) {\n\tif (keyCode == BACKSPACE || keyCode == TAB || keyCode == CR) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "checkIfLetter(keyCode) {\n if (keyCode < 91 && keyCode > 64) {\n return true\n } else {\n return false;\n }\n }", "checkIfLette...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Global recieve function tries to interpret command, or send to the correct room
function recieve(data) { logger.trace("<< " + data); var roomid = ''; if (data.substr(0,1) === '>') { // First determine if this command is for a room var nlIndex = data.indexOf('\n'); if (nlIndex < 0) return; roomid = util.toRoomid(data.substr(1,nlIndex-1)); data = data.substr(nlIndex+1); } if (data.s...
[ "function recieve(data) {\n\t//logger.trace(\"<< \" + data);\n\n\tvar roomid = '';\n\tif (data.substr(0,1) === '>') { // First determine if this command is for a room\n\t var nlIndex = data.indexOf('\\n');\n\t\tif (nlIndex < 0) return;\n\t\troomid = util.toRoomid(data.substr(1,nlIndex-1));\n\t\tdata = data.subst...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Removes the material with the passed name in the array. Throw's error if there is none.
static deleteMaterial(_name) { if (this.Materials[_name] === undefined) { throw new Error(`Cannot find Material named '${_name}'.`); } else { delete this.Materials[_name]; } }
[ "function removeMaterial(material) {\n if( original.materials[material.id] ) {\n delete original.materials[material.id];\n }\n}", "function removeFromArray(array,name){\n\t\tif(!array){\n\t\t\treturn false;\n\t\t}\n\t\tarray = array.slice();\r\n\t\tif(array.indexOf(name) > -1){\r\n\t\t\tarray.splice(array.in...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the DNS record for a given subdomain, creates a new record if not found
async function getDNSRecordsFromZoneIdAndSubdomain(zoneId, subdomain) { return new Promise((resolve, reject) => { axios.request({ url: '/zones/' + zoneId + '/dns_records', method: 'GET', baseURL: cfBaseEndpoint, headers: { '...
[ "function createCloudFlareDomainRecord(subdomain) {\n return (new Promise((resolve, reject) => {\n fetch(`https://api.cloudflare.com/client/v4/zones/${process.env.ZONE_IDENTIFIER}/dns_records`,\n {\n method: 'POST',\n headers:\n {\n 'X-Auth-Email': process.env.CLOUD_FLARE_...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
removes event listeners for card comparison
function removeListeners() { debug("removeListeners"); cards().forEach(function(card) { card.removeEventListener('click', cardMagic) }) }
[ "function removeClickListenerToCards () {\n \n // for perfomance reasons\n setTimeout( function() {\n stateObj.symbols.s1 = stateObj.symbols.s2 = null;\n\n for( card of cards ) {\n card.removeEventListener('click', clickCard);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Update the song number in the playlist order
function upSongNum(){ mpd.send('currentsong', function(r){ curSongNum=parseInt(mpd.response['Pos']); curTitle= mpd.response['Title']; }); }
[ "function updatePlaylistOrder() {\n\t\tvar order_list = new Array;\n\t\t$.each ($('#playlist > li > .guid'), function(index, value) {\n\t\t\tif ($.trim($(this).text()).length > 0) {\n\t\t\t\torder_list[index] = $.trim($(this).text())\n\t\t\t}\n\t\t});\n\t\t$('.video_list').val(order_list.join(','))\n\t}", "functi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Number Number > [String] Generates a blank maze (filled with walls) given: width of the level in tiles height of the level in tiles expected: an array with row length tilesWide and column length tilesHigh and all values filled with WALL_CHAR
generateBlankMaze(tilesWide, tilesHigh) { return new Array(tilesWide * tilesHigh).fill(WALL_CHAR); }
[ "function createMazeWalls() {\n // Maze wall mapping, assuming matrix\n // 1's are cubes, 0's are empty space\n //20x20\n var map = [\n [0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, ],\n [0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, ],\n [0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0,...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
compose magnet url with trackers
function composeMagnetUrl(magnet, trackers = magnetTrackers) { return `${magnet}&tr=${trackers.join('&tr=')}`; }
[ "function getMagnet(link) {\n\t// Get magnet URL from server\n\t$.ajax({\n\t\turl: server + '/magnet',\n\t\tprocessData: true,\n\t\ttype: \"POST\",\n\t\tasync: true,\n\t\tmimeType: \"application/json\",\n\t\tcache: false,\n\t\tdata: {\"hash\": link},\n\t\tsuccess: function(data, textStatus, jqXHR) {\n\t\t\tconsole....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Q2 Write a function named `avg` that takes 3 parameters and returns the average of those 3 numbers.
function avg(num1, num2, num3) { return (num1 + num2 + num3) / 3; }
[ "function avg(num1, num2, num3) {\n return (num1 + num2 + num3)/3;\n}", "function avg(num1, num2, num3) {\n return (num1 + num2 + num3)/3;\n}", "function avg(num1, num2, num3) {\n return (num1+num2+num3)/3;\n}", "function avg( arg1, arg2, arg3 ){\n return arg1 + arg2 + arg3 / 3;\n}", "function avg(num1...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
(en) marks links to videos (de) markiere Links, die zu Videos fuehren
function markVideoLinks() { var es = document.getElementsByTagName("a"); var video = "www.spiegel.de/video/"; /* (en) walk through the list of links and mark the ones * that lead to videos by making them bold and italic */ /* (de) gehe die Liste der Links durch und markiere diejenigen Links, ...
[ "function linkifyVideosInPublications() {\n const label = ' Video: '\n document.querySelectorAll('.csl-entry').forEach(entry => {\n const entry_text = entry.innerHTML\n if (entry_text.indexOf(label) > -1) {\n let [part_before, part_after] = entry_text.split(label)\n if (part_after.indexOf('https:/...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Show the "edit a todo list" layer.
function showEditTodoList() { hideTodosLayers(); var listId = document.forms.todoForm.listId.value; if (listId != null && listId != "null" && listId != "") { $("editListDiv").style.display="inline"; todo_lists.getTodoList(listId, replyEditTodoList); document.forms.editListForm.name.focus(); tracker('/ajax/s...
[ "function editTodo() {\n // var currentTodo = $(this).data(\"id\");\n var text = $(this).children(\"lable\").text();\n\n $(this).children().hide();\n $(this).children(\"input.edit\").val(text);\n $(this).children(\"input.edit\").show();\n $(this).children(\"input.edit\").focus();\n $(this).clos...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns new currency value by calculating the exchange rate, then dividing by new currency value.
function CalcExchangeRate() { var newCurr = $('#newCurrency').val(); var oldCurr = $('#currCurrency').val(); var exchangeRate = newCurr / oldCurr; return exchangeRate.toFixed(4); }
[ "calculate() {\n const exchangeRate = this.conversionData.exchangeRate;\n this.toCurrencyAmount =\n Math.round((this.amount / exchangeRate) * 1000) / 1000;\n }", "function calculateConvertedCurrency() {\n\tlet fromCurr = currFrom.value;\n\tlet toCurr = currTo.value;\n\t\n\tfetch(`https://api.exchanger...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Calculate an arguments array to pass to a logger function to prepend ": " to the output.
function prefixed_arguments( context, args ) { if ( context ) { if ( args.length == 0 ) { return [ context ]; // just show the module and function name when there are no additional arguments } else if ( typeof args[0] == "string" || args[0] instanceof String ) { ...
[ "function formatLogArguments(args) {\n args = Array.prototype.slice.call(args)\n\n var stackInfo = getStackInfo(1)\n\n if (stackInfo) {\n // get file path relative to project root\n var calleeStr = '(' + stackInfo.relativePath + ':' + stackInfo.line + ')'\n\n if (typeof (args[0]) === '...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Uses diff module to parse given diff string and returns edits for files
function getEditsFromUnifiedDiffStr(diffstr) { const unifiedDiffs = jsDiff.parsePatch(diffstr); const filePatches = parseUniDiffs(unifiedDiffs); return filePatches; }
[ "function parseDiff(diffStr) {\n // split to lines and delete the first four lines and the last '\\n'\n var allLines = diffStr.split('\\n').slice(4, -1);\n // diff info\n var diff = {\n info: {},\n lines: {},\n state: {\n delete: 0,\n add: 0,\n modif...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
svSE validation function (Personnummer or samordningsnummer, persons only) Checks validity of birth date and calls luhnCheck() to validate check (last) digit
function svSeCheck(tin) { // Make copy of TIN and normalize to two-digit year form var tin_copy = tin.slice(0); if (tin.length > 11) { tin_copy = tin_copy.slice(2); } // Extract date of birth var full_year = ''; var month = tin_copy.slice(2, 4); var day = parseInt(tin_copy.slice(4, 6), 10); if (...
[ "function svSeCheck(tin) {\n // Make copy of TIN and normalize to two-digit year form\n var tin_copy = tin.slice(0);\n\n if (tin.length > 11) {\n tin_copy = tin_copy.slice(2);\n } // Extract date of birth\n\n\n var full_year = '';\n var month = tin_copy.slice(2, 4);\n var day = parseInt(tin_copy.slice(4, ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Clears storage for namespace
clear() { this._myStore.clear(); this._ls.setItem(this.namespace, JSON.stringify(this._myStore.toJSON())); }
[ "clear() {\n this.storage.clear();\n }", "function clearMetadataStorage() {\n var store = getStore();\n store.metadataStorage = null;\n}", "function _clearStorage() {\n\t\t\tdelete $localStorage[configuration.storageIdentifier + '-Translate'];\n\t\t\tdelete $localStorage[configuration.storageIdentifie...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
returns true if filePath is accessible (ie its in a folder that is set up in accessibleFolders array)
isAccessibleFolder(filePath) { for (var i = 0; i < this.accessibleFolders.length; i++) { if (filePath.startsWith(this.accessibleFolders[i])) { //check for .. so file cannot back up (security) if (!filePath.includes("..")) { return true; } } } return false; }
[ "access(filePath) {\n const canAccess = fs.access(filePath, (err) => {\n if(err) throw err;\n })\n }", "access(fileUrl) {\r\n let bool = true;\r\n try {\r\n this.fs.accessSync(fileUrl, this.fs.constants.R_OK |\r\n this.fs.constants.W_OK);\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Object Contructor for Bricks, they have the following properties number the number value given in the input rotation the rotation of the Brick "Horizontal" or "Vertical" position the position of the whole brick in relation to the Square "full or "half"
function Brick(number){ this.number = number; this.rotation = ""; this.position = ""; }
[ "createBrick(){\r\n fill(this.brickColor);\r\n rect(this.xPos, this.yPos, 100, 50);\r\n }", "function Brick(args) {\n\t\n\tvar length = args.length\n\tvar isUnified = args.isUnified ? args.isUnified : false\n\tvar isEmpty = args.isEmpty ? args.isEmpty : false\n\t\n\tvar color = args.color\n\tvar bord...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
removes an ID from the specified list and drops it back into the selection list
function removeId(listId) { if( $(listId).hasChildNodes() ) { var selected = $(listId).selectedIndex; if( selected >= 0 ) { var chosen = $(listId).options[selected]; $(listId).removeChild( chosen ); $("idSelection").appendChild( chosen ); } } }
[ "function removeItem(id) {\n\t\tvar index = selectedItems.indexOf(id);\n\t\tif(index >= 0) {\n\t\t\tselectedItems.splice(index,1); \n\t\t}\n\t}", "deleteFromList() {\n list.splice((this.id), 1)\n }", "function removeSelectedOption( listId ) {\n var list = document.getElementById( listId );\n for...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function for adding or removing occupants Using the healthbar analogy, this is either healing or taking damage Occupancy is measured by heads of households, not the number of occupants
addOccupants(nHouses) { if (nHouses > 0 && nHouses > this.VacantHouses) // Adding health but the healthbar is close to max health this._occupiedHouses = this._totalHouses; else if (nHouses < 0 && (this._occupiedHouses + nHouses) < 0) // Removing health but the healthbar is close to 0 health ...
[ "function removeHealth(){\n this.health = this.health - 1;\n}", "function healthAdd() {\n\n\t//remove 10 gold\n\tif (gold - 10 >= 0) {\n\t\tgold -= 10;\n\n\t\t//increase item 0 of buy[] by 1 (hint: item 0 is amount of health bought)\n\t\tbuy.health++;\n\n\t\t//increase player.health by 1\n\t\tplayer.health++;\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Exit a parse tree produced by LUFileParserqnaSection.
exitQnaSection(ctx) { }
[ "exitQnaDefinition(ctx) {\n\t}", "exitQnaAnswerBody(ctx) {\n\t}", "exitSyntaxBracketRa(ctx) {\n\t}", "exitQnaQuestion(ctx) {\n\t}", "exitParse(ctx) {\n\t}", "exitEraDeclaration(ctx) {\n\t}", "exitDataAlignedClause(ctx) {\n\t}", "exitQnaSourceInfo(ctx) {\n\t}", "exitHierarchical_query_clause(ctx) {\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Refresh the y axis domain by calculate the current min and max value.
function refreshYDomain() { //Find out current time range after zoom. let startDate; let endDate; d3.select("#x-axis").selectAll(".tick").each(function (d) { if (!startDate || d < startDate) { startDate = d; } ...
[ "_updateYAxis(yMin, yMax){\n if(yMin >= yMax) return;\n\n this.yMin = yMin;\n this.yMax = yMax;\n this.yRange.domain([yMin, yMax]);\n this.svg.select(\".y.axis\").call(this.yAxis); // update svg\n\n this._recalculateDyValues();\n }", "correctYAxisRange() {\n // if y axis shared, we need ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Toggles insert button if form is valid.
_toggleInsert() { if (this.formValid()) { this.$insert.removeClass('disabled'); } else { this.$insert.addClass('disabled'); } }
[ "function toggleInsertForm(table){\n\tvar obj = ge(table+\"_insertDiv\");\n\tvar display = obj.style.display;\n\tif( display == 'none'){\n\t\tobj.style.display = 'block';\n\t}else{\n\t\tobj.style.display = 'none';\n\t}\n}", "function toggleAddForm() {\n\n setAdding(!adding);\n }", "function toggleInse...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A funtion that hits a post to localhost:3000/register. It passes the credentials to the server
register(credentials){ return Api().post('register', credentials); }
[ "register (credentials) {\n return Api().post('register', credentials)\n }", "function registerUser() {\n logger.log('Register POST !');\n $http\n .post('/api/register', JSON.stringify({'username': $scope.username, 'password': $scope.password}))\n .then(\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks if facebook event is too old or new
function filterOldandNewEvents() { let oldestTicket = new Date(membersPerDay[0].key).getTime(); let newestTicket = new Date(membersPerDay[membersPerDay.length - 1].key).getTime(); facebookData = _.filter(facebookData, (d) => { let date = new Date(d.start_time).getTime(); return !((date < oldestTicket) ||...
[ "function requestTooOld(timestamp) {\n var now = new Date();\n var requestTime = new Date(parseInt(timestamp) * 1000);\n\n return requestTime < new Date(now.getTime() - 900*1000);\n}", "isInThePast(event) {\n const now = new Date();\n if (new Date(event.time).getTime() < now.getTime()) {\n return tr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
! RESET AI IDLE This is the function that runs to reset AI idle
function resetPukiAutoIdleAction(){ resetPukiActionList(); autoAction = false; performing = false; changePukiAction('static'); autoAIStartTime = 0; }
[ "function idleReset() {\r\n\r\n //Reset the timeout\r\n console.log(\"reset\");\r\n clearTimeout(timeout);\r\n\r\n idleBegin();\r\n\r\n}", "function setIdle() {\n clearTimeout(idleTimer);\n stopClock();\n }", "resetIdle()\n {\n //only if not already in idle mode\n if (!this.state.waiting)\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Displays all the tiles and pieces
display() { this.scene.pushMatrix(); var currMaterial = this.scene.pushMaterial(this.material); var currTexture = this.scene.pushTexture(this.texture); currMaterial.setTexture(currTexture); currMaterial.setTextureWrap('REPEAT', 'REPEAT'); currMaterial.apply(); this.scene.gameOrchestrator.logPicking(); ...
[ "function draw() {\n for (let i=0; i<tiles.length; i++) {\n tiles[i].display();\n }\n}", "drawTiles() {\n \n for (var i = 0; i < this.tiles.length; i++) {\n $(\"#board\").append($('<div class=\"tile hidden ' +this.tiles[i].content + '\" id=' + i + '></div>'));\n\t }\n\t \n }", "di...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Tests whether the combination month/year is after this.maxDate, considering just the month and year of this.maxDate
_isYearAndMonthAfterMaxDate(year, month) { if (this.maxDate) { const maxYear = this._dateAdapter.getYear(this.maxDate); const maxMonth = this._dateAdapter.getMonth(this.maxDate); return year > maxYear || (year === maxYear && month > maxMonth); } return false; ...
[ "function checkLastYearBills(patientObject, year, month) {\n for (let i = month-1; i >= 1; i--){\n if ( patientObject.months[year] && patientObject.months[year].has(parseInt(i)) ) return true\n }\n for (let i = parseInt(month) + 1; i<=12; i++){\n if ( patientObject.y...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
TODO FIX X casting costs cards manacost section
function displayManaFromCard(card) { var cardExp = document.getElementById("card-exp"); var cardName = "<em>" + card.name + "</em>"; // colours object to store for both functions var colours = {}; var hasColouredManaCost = false; // get a mana cost string var manaCostString = makeManaCostString(card.mana...
[ "function sortByManaCost(cards) {\n cards.sort(function(a, b) {\n return a.cmc - b.cmc;\n });\n }", "function calculateCost()\r\n{\r\n\tif(portraits.size == \"4-Wallets ($10)\" || portraits.size == \"2-4x6 ($10)\" || portraits.size == \"5x7 ($10)\")\r\n\t{\r\n\t\tcost = 10 * portraits.copies;\r\n\t\td...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Code derived from Sorts the entries of a list of entries by the dateAccessed, Most Recent First.
function sortEntriesMRU(entries){ // Comparison function for sort var date_sort_desc = function (entry1, entry2) { var date1 = Date.parse(entry1.dateAccessed); var date2 = Date.parse(entry2.dateAccessed); if (date1 > date2) return -1; if (date1 < date2) return 1; return 0; }; console.log("sort mru"); en...
[ "function sortEntriesMRU(entries){\n\t// Comparison function for sort\n\tvar date_sort_desc = function (entry1, entry2) {\n\t\tvar date1 = entry1.dateAccessed;\n\t\tvar date2 = entry2.dateAccessed;\n\t\tif (date1 > date2) return -1;\n\t\tif (date1 < date2) return 1;\n\t\treturn 0;\n\t};\n\n\tentries.sort(date_sort_...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
NEXT FUNCTION RETURNS 'true' IF 'access_token_str' IS VALID, 'false' OTHERWISE 'user_email_str' IS THE USER (PRIMARY SUBJECT) OF AN API ENDPOINT 'disable_str' WILL DISABLE THE SECURITY FIX THAT RESOLVED THE ISSUE IN ALLOWING 'VALID'.. ..TOKENS TO BE USED FOR ANOTHER USER TO DISABLE, ENTER A VALUE OF 'd' OR 'D'
function is_token_valid(access_token_str, user_email_str, disable_str) { // IF THE SECURITY FIX HAS NOT BEEN DISABLED if(disable_str !== "d" && disable_str !== "D") { let jwt = require("jsonwebtoken"); let user_data = jwt.decode(access_token_str, {complete:true}); // IF TOKEN HAS BEEN T...
[ "function validateUser(uname,password){\r\n /*\r\n here goes the API call.\r\n But for now the credentials are hardcoded and checked from the global JSON array userlist\r\n */\r\n if(uname == 'akshay@gmail.com' && password == 'system123'){\r\n return true;\r\n }else{\r\n return false...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
convert Object to Array for Zooming Chart
function convertObjectToArray(data) { var arrData = new Array(); $.each(data, function(key, value) { arrData.push(value); }); return arrData; }
[ "function convertToHitObjectArray(objArray, mapData) {\n const convToCircle = (arr, i) => ({\n \"x\": Math.round(arr[0]),\n \"y\": Math.round(arr[1]),\n \"type\": 1,\n \"time\": Math.round(mapData.timestamps[i]),\n \"hitsounds\": 0,\n \"extHitsounds\": \"0:0:0\",\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
1. Index the branch into newIndex. 2. Update the canonical elasticsearch alias for the branch to point at newIndex 3. Delete any old index that we just replaced.
async _reindex(newIndex, branch) { let branchIndex = this.constructor.branchToIndexName(branch); let alias = await this.es.indices.getAlias({ name: branchIndex, ignore: [404] }); if (alias.status === 404) { this.log.info('%s is new, nothing to reindex', branch); } else { this...
[ "function reindex()\n\t\t{\n\t\t\tfor (var name in _indexes)\n\t\t\t\t_indexes[name].rebuild();\n\t\t}", "updateIndices(){\n\t\tObject.keys(this.operatorsByPath).map(path => {\n\t\t\tlet idxType = this.operatorsByPath[path].getDemandedIndex();\n\t\t\tif(idxType) {\n\t\t\t\tthis.operatorsByPath[path].setIndex(this...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function select sub Items Mobile
function selectionMsubItems(subItem, Form, cont_search, nav_mobile) { let items = "#" + subItem + ""; fromUpdateSearch = "#form_search_" + Form; $('.collection-item').css("background-color", "#fff"); $('.collection-item').css("color", "#26a69a"); $(items).css("background-color", "#26a69a"); $(...
[ "function selectionMsubItems(subItem, Form, cont_search, nav_mobile) {\n\n let items = \"#\" + subItem + \"\";\n\n $('.collection-item').css(\"background-color\", \"#fff\");\n $('.collection-item').css(\"color\", \"#26a69a\");\n\n $(items).css(\"background-color\", \"#26a69a\");\n $(items).css(\"colo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
hide add button if it's not current logged in users own profile
function toggleAddButton() { const loggedInUserId = document.querySelector(".logged-in-user-id").innerHTML; const profileId = document.querySelector(".current-profile-id").innerHTML; if (loggedInUserId !== profileId) { document .querySelector(".create-feed-container") //needs to ...
[ "checkToShowAddButton() {\n const hasResult = this.hasQuery && (! this.hasUsers && ! this.hasDepartment);\n\n this.setShowAddButton( hasResult );\n }", "function addPostButtonDisplay(){\n if(userLoggedIn()){\n document.getElementById(\"addPostButton\").style.display = \"bloc...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
update sticky handler this should be automatically called when you update header content
updateStickyHandler(){ let header_large_height = this.header.getLargeHeight(); // original height let threshold = this.header.getStickyThreshold(); this.marker.style["top"] = threshold + 'px'; this.observer = new IntersectionObserver((entries, observer) => { if( entries[0].isIntersecting ){ this.he...
[ "function stickyHandler() {\n if (window.pageYOffset > sticky) {\n header.classList.add(\"sticky\");\n } else {\n header.classList.remove(\"sticky\");\n }\n}", "function headerSticky() {\n if (window.pageYOffset >= sticky) {\n header.addClass(\"header-sticky\");\n } else {\n heade...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
End JSValidatorValidatorConfig class. ========================================================================== JSValidatorMessage is a class that defines a validation failure message that JSValidator can make use of. ==========================================================================
function JSValidatorMessage() { var id = null; var text = null; this.getId = function() { return id; } this.setId = function(inID) { id = inID; } this.getText = function() { return text; } this.setText = function(inText) { text = inText; } this.toString = function() { retur...
[ "function JSValidatorConfig() {\n\n var validators = new Object();\n var messages = new Object();\n var forms = new Object();\n\n this.addValidator = function(inValidatorConfig) {\n validators[inValidatorConfig.getId()] = inValidatorConfig;\n }\n this.getValidators = function() {\n return validators;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
fix placeholder text for IE8
function _initIEPlaceholder(){ if(!Prototype.Browser.IE){ return; } jQuery('[placeholder]').focus(function () { var input = jQuery(this); if (input.val() == input.attr('placeholder')) { input.val(''); input.removeClass('placeholder'); } }).blur(fun...
[ "function iePlaceholderFix() {\n\t$.placeholder.shim()\n}", "function placeholderFix(){\n\n //ie placeholder fix\n $.support.placeholder = ( 'placeholder' in document.createElement('input') );\n\t\n\tif($.support.placeholder){\n\t\t\n\t\t$('.form_label').hide();\n\t}\n\n}", "function fixPlaceholder() {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Addfunction to check message and then call addThing
adding() { // Error handle this.errors = []; if (!this.written) { this.errors.push('Message required.'); } if (this.written.length > 30) { this.errors.push('Message too long! (max 30)'); } // In case no errors if (!this.errors.length) { if (this.wr...
[ "function addBotMessage(message) {\n addMessage(true, message);\n}", "function addMessageHook(fn) {\r\n if (typeof(fn) !== \"function\") {\r\n throw \"addMessageHook expects a function\";\r\n }\r\n _hooks.push(fn);\r\n}", "function addCallback(obj, sender){\n print(\"Got a ADD message from \...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Pseudocode READ drone = '' FOR length of grid FOR length of indexes of grid IF the value of indexes of index of grid is equal to '' COMPUTE drone = index of grid(row) + ', ' + index of index of grid(column) ENDIF ENDFOR ENDFOR IF the value of drone = '' DISPLAY no drone ENDIF DISPLAY drone
function dronePosition (grid) { var drone = ''; for (var i = 0; i < grid.length; i++) { for (var j = 0; j < grid[i].length; j++) { if (grid[i][j] === '*') { drone = i + ', ' + j; } } } if (drone === '') { return 'No drone'; } return drone; }
[ "function displayGrid() {\n for (let y = 0; y < rows; y++) {\n for (let x = 0; x < cols; x++) {\n if (interactingGrid[y][x] === 1) {\n fill(125);\n rect(x * cellSize, y * cellSize, cellSize, cellSize);\n }\n else {\n fill(255);\n rect(x * cellSize, y * cellSize, cellSi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add product To Cart: 1.) create a productObj object from the data attributes in 'productData' variable 2.) Check if the product is already in cart 2.1.) If product is in cart => if in stock => increase count [do not add to cart] flag 1 2.2.) If product is in cart => if not in stock => alert() 3.) If product not in cart...
addToCart(productData) { //1. create a productObj object from the data attributes in 'productData' variable let productObj = this.createProductObj(productData); //2. check if the product is already in cart let productInCart = this.productAlreadyInCart(productObj.productId); ...
[ "addProdToCart(prod) {\n for (let i = 0; i < this.cartItems.length; i++) {\n if (this.cartItems[i].item.id === prod.id) {\n this.cartItems[i].quantity++;\n return;\n }\n }\n this.cartItems.push({\n item: prod,\n quantity: 1\n });\n\n // decrease...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
position in zero indexed tabs array of currently active tab enumerate page elements with role tab or tablist, invoke with $(document).ready(loadTabs) when using on ajax loaded elements subsequent to initial DOMContentLoaded event. each tab must have a role=tab, and an integer tabid, where tabid is 1 indexed one tab on ...
function loadTabs() { tabs = document.querySelectorAll('[role="tab"]'); tabList = document.querySelector('[role="tablist"]'); var activeTab = $('.tabList > .active').get(0); if (typeof activeTab !== 'undefined') { var activeTabId = $(activeTab).attr('tabid'); var activeTabIndex = activeTabId - 1; // tabs arra...
[ "function init_ajax_tabs(e) {\n var context = $(e.target);\n\n context.find('[data-toggle=\"tabajax\"]').tabajax();\n }", "function init_tabs () {\n var tabs = $ ('#tabs');\n tabs.tabs ({\n /*\n * Display a Wordpress spinner.\n *\n * See: https://make.wordpress.org/core...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Takes a string and returns the proper "IRC string". Starts scanning on the "arg"th word. EXAMPLES: IRC_string("PRIVMSG Cyan Hello World",2); returns "Hello" IRC_string("PRIVMSG Cyan :Hello World",2); returns "Hello World" RETURNS: The entire string from the "arg"th word and beyond, if the "arg"th word begins with a ":"...
function IRC_string(str,arg) { var cindex; var sindex; for(sw_counter=0;sw_counter<arg;sw_counter++) { var my_index = str.indexOf(" "); if (my_index == -1) return ""; /* If we can't get to it, then the str is empty. */ str = str.slice(my_index+1); } if (str[0] == ":") return(str.slice(1)); sindex = ...
[ "function IRC_parsecommand(str) {\n\tvar cmd;\n\n\tif (str[0] == \":\")\n\t\tstr = str.slice(str.indexOf(\" \")+1);\n\n\tif (!str)\n\t\treturn 0; // nothing in the string!\n\n\tcmd = str.split(' ');\n\tcmd[0] = cmd[0].toUpperCase();\n\treturn cmd;\n}", "function firstString() {\n var args = [];\n for (var _...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Combines multiple RSS feeds into one
function aggregateFeed(callback) { var promises = RSS_FEEDS.map(parseXML); async.mapSeries(promises, extractFeedItems, function(err, results) { // flatten feed items into single array results = results.reduce(function(a, b) { return a.concat(b); }); var xml = buildXM...
[ "function rssFeeds(feeds) {\n let result = [];\n for (let feed of feeds) {\n result.push({\n id: feeds[0],\n enabled: feeds[1],\n use_feed_title: feeds[2],\n user_selected: feeds[3],\n programmed: feeds[4],\n download_state: feeds[5],\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The main game object. Houses renderer, gamestate, etc.
function Main() { var self = this; this.renderer = new THREE.WebGLRenderer({ antialias: true }); this.controllers = []; this.callback = this.update.bind( this ); this.settings = {}; window.location.href.replace( /[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) { self.settings[key] = value; } ); t...
[ "function main() {\n\n //Get our time delta information which is required if your game requires smooth animation.\n\n var now = Date.now(),\n dt = (now - lastTime) / 1000.0;\n\n /*\n Call our update/render functions, pass along the time delta to our update function\n si...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function to parse, scale and add data from csv file
function readCategoryCSV(options, data, scale, names) { //split csv by lines var allLines = data.split('\n'); //if in YYYY-mm-dd then 0, if YYYY-mm then 1, if in mm/dd/YYYY then 2 var utcFormat = 0; //iterate through each line $.each(allLines, function (lineNo, line) { var items ...
[ "function processData() {\n\t\n\t//Seperate file by line breaks\n var allTextLines = csv.split(/\\r\\n|\\n/);\n \n //Set Key equal to the first row\n var headers = allTextLines[0].split(',');\n\n\t//loop through each line\n\tfor (var i=1; i<allTextLines.length; i++) {\n\t\n\t\t//Seperate line by comma\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
normalize the y axis scale so the label will distribute evenly return true if the friend and follower axis share same scale
function normalize_yaxis(data) { function log_base10(n) { return Math.log(n) / Math.log(10); } var share_axis = false; // friend and follower axis share same scale if their number if close enough if (Math.max(data[0].max, data[1].max) / Math.min(data[0].max, data[1].max) <= 1.75) { data[0].max = dat...
[ "updateYScaleDomain() {\n let vis = this;\n let [min, max] = d3.extent(vis.averages);\n\n // Handle edge cases and when min is greater than 0\n min = min > 0 || !min ? 0 : min;\n max = max ? max : 0;\n\n vis.yScale.domain([min, max]);\n }", "function yScales(data){\n\t\treturn d3.scale.linear()...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function should "return" the posts on the front page of a subreddit as an array of objects. In contrast to the `getSubreddit` function, this one accepts a `sortingMethod` parameter.
function getSortedSubreddit(subreddit, sortingMethod) { // Load reddit.com/r/{subreddit}/{sortingMethod}.json and call back with the array of posts // Check if the sorting method is valid based on the various Reddit sorting methods return requestPromise("https://www.reddit.com/r/" + subreddit + sortingMethod + "....
[ "function getSortedHomepage(sortingMethod, callback) {\n // Load reddit.com/{sortingMethod}.json and call back with the array of posts\n // Check if the sorting method is valid based on the various Reddit sorting methods\n requestAsJson('https://reddit.com/' + sortingMethod + '.json', function(err, res) {\n i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets a neighbor in a particular direction
getNeighbor(direction) { // tslint:disable-next-line:no-unsafe-any return tiled_1.BaseTile.prototype.getNeighbor.call(this, direction); }
[ "getNeighbor(direction) {\n switch (direction) {\n case \"North\":\n return this.tileNorth;\n case \"South\":\n return this.tileSouth;\n case \"East\":\n return this.tileEast;\n case \"West\":\n return thi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
general function for grabbing parameter from a URL
function getParamFromURL( name ) { name = name.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]"); var regexS = "[\?&]"+name+"=([^&#]*)"; var regex = new RegExp( regexS ); var results = regex.exec( window.location.href ); if( results == null ) return ""; else return results[1]; }
[ "function getParam(url, param) { //--- Generic attribute/value query string decoder\n urlArray = url.split(\"?\")\n if (urlArray.length > 1) {\n var queryString = urlArray[1]; \n var hash = queryString.lastIndexOf('#');\n if (hash >= 0) // remove boomark reference\n queryString = queryString.substri...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Subtracts from the bread
function subtractBread(amount) { bread -= amount; drawBread(); }
[ "subtract(num) {\n this.stateChange.splice(this.currIdx+1, 0, -num);\n this.currIdx++;\n this.value -= num;\n }", "moveBrickDown() {\n brick.moveDown(box);\n if(this.detectCollision(this.backDrop, brick)){\n brick.moveDown(-box);\n this.mergeMatrix(this.backDrop, bric...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Registers an event handler for the provided event on the specified class and executes a specified function within this component while passing the trigger element's filtered id
handleOnClassEvent(event = "click",event_trigger_class = null,id_match_str = null,event_function_str = null) { if (event_trigger_class === null) { return; } if (id_match_str === null) { return; } if (event_function_str === null) { return; } let this_component = getRegisteredComponent(this.getUid(...
[ "function addEventToClass(className,trigger,action){\n\tvar elements=document.getElementsByClassName(className);\n\tfor(var i=0; i<elements.length; i++){\n\t\taddEvent(elements[i],trigger,action);\n\t}\t\n}", "function addEventListenerByClass(className, event, fn) {\n\t\t\tvar list = document.getElementsByClassNa...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
build histogram of specified image region
function histogram(img, x1, y1, x2, y2, num_bins) { if( num_bins == undefined ) num_bins = 256; var h = img.h; var w = img.w; var hist = []; for(var i=0;i<num_bins;i++) hist[i] = 0; for(var y=y1;y<y2;y++) { for(var x=x1;x<x2;x++) { var idx = (y *...
[ "getImageHistogramOfArea(xLeft, yTop, width, height) {\n // getImageData:\n //\thttps://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/getImageData\n // returns an ImageData\n //\thttps://developer.mozilla.org/en-US/docs/Web/API/ImageData\n // we use the .data p...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
setting text to show ex: "Updated 10 seconds ago", also setting the clock. When this function runs for the first time, it will call itself every 1 second.
function updateAgo() { $("#agolabel").text("Updated " + getTimeSinceLastRead()); var today = new Date(); var h = today.getHours(); var m = today.getMinutes(); h = checkTime(h); m = checkTime(m); var clockString = h + ":" + m; $("#clock").html(clockString); setTimeout("updateAgo();"...
[ "function timer()\n{\n window.setTimeout(\"timer()\", 1000);\n lastupdate++;\n\n var lastupdateString;\n if (lastupdate < 60) {\n lastupdateString = lastupdate + ' s';\n }\n else {\n lastupdateString = Math.floor(lastupdate / 60) + ' min ' + (lastupdate % 60) + ' s';\n }\n\n $(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Fills the board with jewels
function fillBoard() { var x, y, type; jewels = []; for (x = 0; x < cols; x++) { jewels[x] = []; for (y = 0; y < rows; ++y) { type = randomJewel(); // Ensure that no chains are created on the initial board fill while ((type === getJewel(x - 1, y) && type === getJewel(x ...
[ "function fillBoard() {\n\t\tvar x, y,\n\t\t\tjewelType;\n\t\t\n\t\tjewels = [];\n\t\t\n\t\t// looping thru all the cols\n\t\tfor (x = 0; x < cols; x++) {\n\t\t\tjewels[x] = [];\n\t\t\t// looping thru all the rows\n\t\t\tfor(y = 0; y < rows; y++) {\n\t\t\t\t// picks the random jewel for the [y,x] cell\n\t\t\t\tjewe...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Iterator that allows you to do for (let row of rowManager)
[Symbol.iterator]() { return this.rows[Symbol.iterator](); }
[ "*iterate_rows() {\n const cols = this._cols;\n const rows = this._rows;\n const data = this._data;\n\n for (let row = 0; row < rows; ++row) {\n yield data.subarray(row * cols, (row + 1) * cols);\n }\n }", "iter() {\n const arr = [];\n for (const id o...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Impossible to layer more than 1 heatmap at a time to make sense. Hence, restrict to only 1 at a time
function onlyOneHeatmap(checkbox) { var checkboxes = document.getElementsByName('checkHeatmap') checkboxes.forEach((item) => { if (item !== checkbox && item.checked === true) { //Removes check mark item.checked = false //Runs toggle() to set _layer.enabled to false ...
[ "function hideHeatmaps() {\n for(var i = 0; i < extraHeatmapLayer.length; i++){\n if(map.hasLayer(extraHeatmapLayer[i]))\n map.removeLayer(extraHeatmapLayer[i]);\n }\n}", "function hide_average_heatmaps(layer){\n if (layer == 1){\n svg_dense1_avg.select('g')\n .selectAll(\"rect\")\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a function that proxies to the given method name on the globals console object. The proxy will also detect if the console doesn't exist and will appropriately noop. This allows support for IE9, which doesn't have a console if the developer tools are not open.
function consoleProxy( method ) { return function( ...args ) { if ( console ) { console[ method ]( ...args ); } }; }
[ "function consoleProxy(method) {\n \treturn function () {\n \t\tif (console) {\n \t\t\tconsole[method].apply(console, arguments);\n \t\t}\n \t};\n }", "function consoleProxy(ob){\n // list from http://nodejs.org/api/stdio.html\n var methods = [\"dir\", \"time\", \"timeEnd\", \"trace\", \"assert\"];\n met...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Examples: findMinMoves([1,2,3]) // 2 findMinMoves([7,1]) // 6 findMinMoves([3,3,1]) // 2 findMinMoves([11,2,5]) // 9 findMinMoves([2,11,5]) // 13 findMinMoves([5,2,1,7,2,4,10]) // 21 Time Complexity O(n log n) Space Complexity O(1)
function findMinMoves(nums) { nums = nums.sort((a, b) => a > b); let min = 0; for (let i = 0; i < nums.length / 2; i++) { min += nums[nums.length - i - 1] - nums[i]; } return min; }
[ "function minimumMovement(obstacleLanes) {\n // Write your code here\n let currentLane = 2;\n let prevLane = null;\n let moves = 0;\n for (let obstacle of obstacleLanes) {\n if (obstacle === currentLane) {\n moves++;\n prevLane = currentLane;\n currentLane = null;\n } else {\n if (!cu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Request the GetCapabilities XML from the server to get a list of available features
function GetCapabilities(baseUrl){ // If the select box toggle is pressed, undepress it if (selectBox == true) { var sb = Ext.getCmp('select_box'); sb.toggle(false); } // Get the WFS Capabilities from the server try { Busy(); OpenLayers.Request.GET({ url: baseUrl+'?SERVICE=WFS&version=1.1.0&REQUEST=...
[ "function GetCapabilities(baseUrl){\n\t\n\t// If the select box toggle is pressed, undepress it\n\tif (selectBox == true) {\n\t\tvar sb = Ext.getCmp('select_box');\n\t\tsb.toggle(false);\n\t}\n\t\n\t// Get the WFS Capabilities from the server\n\ttry {\n\t\tBusy();\n\t\tOpenLayers.Request.GET({\n\t\t\turl: baseUrl+'...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Read plugin modfile using the given handler
function readModfile(pluginName, handler) { var modfilePath = path.join(shadowDirectory, pluginName + '.esm'), modfileSource = new parseSource.FileSource(modfilePath), modfileParser = new parseModfile.ModfileParser(modfileSource); modfileParser.parse(handler); modfileSource.close(); }
[ "function mod_load_handler() {\n var file = findEl(\"mod_file_input\")\n file.addEventListener(\"change\", function() {\n mod_vol_read_handler();\n });\n }", "async function handlerForFid(fid) {\n const ext = getFileExtension(fid);\n let handler = fileTypeHandlers[ext];\n c...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Showing the Raw Mapping Table
function showRawMapping() { if(mappingArray.length == 0) { alert("Nothing has been mapped.\nPlease start mapping by connecting the nodes first."); return; } ascendingSort(mappingArray); var cStyle = "border:1px solid red; border-collapse:collapse; padding:8px;"; var inHTML = '<table style="' + cSt...
[ "function MapTable() {\r\n}", "static tableFromMap(map) { return grok_UI_TableFromMap(map); }", "function generateMappingTable() {\n\t\tvar tableRows = \"\",\n\t\t\ttableBody = null;\n\n\t\ttableBody = document.querySelector(\"#mappingTable tbody\");\n\t\tfor(var i =0; i < userAgentArr.length; i++) {\n\t\t\ttab...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sometimes blocks get published unordered so we need to enqueue them before publish to ensure correct order. This adds 3 blocks delay.
enqueueAndPublishBlockAdded(newBlock) { this.blockQueue.push(newBlock) if (this.blockQueue.length > 2) { this.blockQueue = this.blockQueue.sort((a, b) => a.height - b.height) publishBlockAdded(this.network.id, this.blockQueue.shift()) } }
[ "beginNextPublish() {\n const maxMilliseconds = this.batchOptions.maxMilliseconds;\n const timeWaiting = Date.now() - this.currentBatch.created;\n const delay = Math.max(0, maxMilliseconds - timeWaiting);\n this.pending = setTimeout(() => this.publish(), delay);\n }", "function queu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
5th: render budgetItems on table
function renderItems(items) { if (!items) { items = budgetItems; } var tbody = $("#budgetItems tbody"); // clear out previous budget items tbody.empty(); // make table row for each budget item items.forEach(function (item) { var row = `<tr><td>${item.date}</td><td>${item.na...
[ "function itemTable() { }", "function _renderBills() {\n var container= document.getElementById('billTable');\n\t\tvar billArray = bills.map(_composeBill);\n\t\tcontainer.innerHTML = '';\n\t\tbillArray.forEach(function(bill) {\n\n\t\t\t// Highlights the row depending of the type\n\t\t\tvar billType = bill....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
CONSTRUCTOR / A ContextGL representation.
function ContextGL(canvas,options){ options = validateOption(options,DefaultConfig); if(options.version !== WEBGL_1_VERSION && options.version !== WEBGL_2_VERSION){ throw new Error(`Invalid context version ${options.version}.`); } /*------------------------------------------------------...
[ "function getContext() {\n return _gl;\n }", "function createGLContext() {\n var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n opts = Object.assign({}, contextDefaults, opts);\n var _opts = opts,\n canvas = _opts.canvas,\n width = _opts.width,\n heigh...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Fabric Router is a toplevel router that sits between the root container and the Instance Router that injects the following additional route parameters serviceSlug The slug of the selected microservice instanceID The ID of the selected microservice instance of the service with the slug serviceSlug When routes match with...
function FabricRouter({ services }) { return ( <Switch> <Route component={SettingsGrid} exact path="/settings" /> <Route path="/:serviceSlug/:instanceID/" render={({ match: { url, params: { serviceSlug, instanceID } } }) => { const baseURL = url[url.length - 1] === "/" ? url....
[ "registerRouter() {\n this.application.container.singleton('Adonis/Core/Route', () => {\n return this.application.container.resolveBinding('Adonis/Core/Server').router;\n });\n }", "initRouting() {\n const vm = this.vm;\n if (!this.hasRoutingState) return;\n\n if (this.Routing...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }