query
stringlengths
9
34k
document
stringlengths
8
5.39M
negatives
listlengths
19
20
metadata
dict
Set the callback to call when funding rate gets to a new high for a symbol
fundingRateChangedCallback(cb) { this.fundingRateChanged = cb; }
[ "function onFundingRateChanged(symbol, oldRate, newRate) {\n if (rateUpdates[symbol] === undefined) {\n rateUpdates[symbol] = 0;\n }\n rateUpdates[symbol] += 1;\n trackRate(symbol, newRate);\n\n // only interested in the rate going up...\n if (oldRate > newRate) {\n return;\n }\n\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Show secret code and end game
function showCode() { //Reset game abortGame(); vm.secretCode = Mastermind.secretCode(); }
[ "function showMenu() {\n console.log(\"1> Encrypt string with PlayFair-Cipher\");\n console.log(\"2> Decrypt string with PlayFair-Cipher\");\n console.log(\"3> End Program\");\n}", "function handleGameCode(gameCode) {\n gameCodeDisplay.innerText = gameCode;\n}", "function handleGameCode(gameCode) {\n\tgameC...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
format `entity` to a string
format(entity, args) { // optimize entities which are simple strings by skipping resultion if (typeof entity === 'string') { return [entity, []]; } // optimize entities with null values and no default traits if (!entity.val && entity.traits && !(entity.traits.some(t => t.def))) { return...
[ "static formatEntity(src, entity) {\n\t\treturn `${src}/${entity}/?$format=json`;\n\t}", "format(entity, args) {\n const result = format(this, args, entity);\n return [result[0].toString(), result[1]];\n }", "formatEntities(entities) {\n return entities.map((entity) => {\n if (A...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Watches for file changes, then runs the `arg` steps.
async function watch([arg, ...moreArgs]) { const funs = steps[arg || 'webpack']; const funsAndArgs = funs.map(fun => [fun, fun == funs[funs.length - 1] ? moreArgs : []]); const watcher = chokidar.watch('.', { ignored: /(node_modules|build\/|\.git)/, persistent: true }); let timerId = 0; const change...
[ "function watchApp() {\n\tfs.watch('.', function(event, filename) {\n\t\t// Ignore files ending in .log or .err\n\t\tif (\n\t\t\tfilename.indexOf('.log', filename.length-4) === -1 &&\n\t\t\tfilename.indexOf('.err', filename.length-4) === -1 &&\n\t\t\tfilename.indexOf('.out', filename.length-4) === -1\n\t\t) {\n\t\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Doctors listing functions setup the doctors listing table with data
function populateDoctorsListing(dataSet) { if (dataTable != null) dataTable.rows().remove().draw(false); dataTable = $("#doctors-table").DataTable( { "aaData": dataSet, "info": false, "columns": [ {"data": "name"}, {"data": "spe...
[ "function grabDoctors(){\n\tremoveTableRows(\"dtable\");\n\tsendAjaxGet(doctorData, displayDoctors);\n}", "function showDoctorCategory() {\n for (let i = 0; i < filteredDoctors.length; i++) {\n DoctorList = createDoctorList(\n filteredDoctors[i].img,\n filteredDoctors[i].title,\n filteredDoctor...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Executes a MySQL query to replace a specified review with new data. Returns a Promise that resolves to true if the review specified by `reviewID` existed and was successfully updated or to false otherwise.
function replaceReviewByID(reviewID, review, mysqlPool) { return new Promise((resolve, reject) => { review = validation.extractValidFields(review, reviewSchema); mysqlPool.query('UPDATE reviews SET ? WHERE id = ?', [ review, reviewID ], function (err, result) { if (err) { reject(err); } el...
[ "function replaceReviewByID(reviewID, review, mysqlPool) {\n return new Promise((resolve, reject) => {\n review = validation.extractValidFields(review, reviewSchema);\n mysqlPool.query('UPDATE reviews SET ? WHERE id = ?', [ review, reviewID ], function (err, result) {\n if (err) {\n console.log(e...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns true if this [[CpNode]] is terminating, i.e. implies a leaf MAT vertex. This is always the case for sharp corners and maximal disks with a single contact point. Note, however, that even in these cases there are two contact points stored (sitting 'on top' of each other) for the maximal disk. It can be seen as a ...
function isTerminating(cpNode) { // return this === this.next.prevOnCircle; return cpNode === cpNode.next.prevOnCircle; }
[ "function isFullyTerminating(cpNode) {\n const otherOnCircle = getCpNodesOnCircle(cpNode.prevOnCircle, true);\n const isFullyTerminating = otherOnCircle.every(cpn => isTerminating(cpn));\n return isFullyTerminating;\n}", "isLeaf()\n {\n return (this.left() === null && this.right() === null);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
preselect snippets from retrieved url
function loadSelectSnippets(snippetsCodes) { var i = 0; $.each(domElements.inputsFormCheck.el, function(k, v) { if ($.inArray(i.toString(), snippetsCodes) !== -1) { $(v).attr('checked', true); } else { $(v).attr('checked', false); } i++; }); }
[ "function recreateSelection() {\n var params = window.location.search.substring(1).split(\"&\");\n var sn, so, en, eo;\n for (var i = 0; i < params.length; i++) {\n var equalIndex = params[i].indexOf(\"=\");\n if (equalIndex == -1) {\n continue;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
An execute function that returns a promise with a test value.
execute() { return __awaiter(this, void 0, void 0, function* () { return { value: 'test_response' }; }); }
[ "function execute(callback, value, deferred) {\n immediate(function() {\n var result;\n try {\n result = callback(value);\n if (result && typeof result.then === func) {\n result.then(deferred.resolve, deferred.reject);\n }\n else {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Tests whether the given URL is a "data:" URL
static isDataURL(url) { return (url.substring(0, 5)) === "data:"; }
[ "function isDataURL(s) {\n return !!s.match(isDataURL.regex);\n}", "isDataUrl(path2) {\n return /^data:([a-z]+\\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\\-._~:@\\/?%\\s<>]*?)$/i.test(path2);\n }", "function isDataURI(value) {\r\n if (!isString...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
callback to handle the response from stripe
function stripeResponseHandler(status, response) { if (response.error) { $('#call_success .call-success').html(response.error.message); popNext("#call_success"); } else { $('#p_prldr').show(); const thisForm = $('.stripe_pay'); //get token id const token = respons...
[ "function handleStripeResponse(status, response) {\n\tconsole.log(JSON.stringify(response));\n if (response.error) {\n $('#makePayment').removeAttr(\"disabled\");\n $(\".paymentErrors\").html(response.error.message);\n } else {\n\t\tvar payForm = $(\"#paymentForm\");\n //get stripe token ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A worker is responsible for performing jobs, one at a time, as quickly as it can pull them off a given queue. When it gets a new job, it calls the performJob function that is given in the constructor. This function is called with the current job and a nodestyle callback argument. Workers keep track of how many jobs the...
function Worker(queue, performJob) { EventEmitter.call(this); if (!isFunction(performJob)) throw new Error('Worker#performJob must be a function'); this.performJob = performJob; if (!(queue instanceof Queue)) queue = new Queue(queue); this.queue = queue; this.failureCount = 0; this.successCoun...
[ "function WorkerJob(id, name){\n this.promise = new (require('../promise.js'))()\n this.config = {\n jobName: name || '',\n jobId: id || void 0\n }\n this.callbacks = []\n this.failCb = void 0\n}", "function WorkingQueue(concurrency) {\n // Parallelization degree, if not mentioned use 64\n // Don...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds a function to the finally chain, which is executed regardless of whether an exception was caught or not (contrast with post hooks which will not execute in the event of an exception
function add_finally_hook(fn, name) { name = name || 'default'; var hooks = get_chain(this.finally_hooks, name); hooks.push(fn); }
[ "finally(fn) {\n this._finally = fn\n }", "function func() {\n try {\n return 1;\n } catch (error) {\n // ...\n } finally {\n console.log('finally');\n }\n}", "function testTryFinally1() {\n try {\n return 123;\n } finally {\n print('finally intercepted, return con...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This tooltip displays which Cloud Foundry instance is serving our request
function initInstanceInfoTooltip() { jQuery('#instance-tooltip').tooltip(); }
[ "showPoolStatus() {\n this.info(`Pool status: ${inspect(this.inspectPool())}`)\n }", "get instanceId() {\n if (this.config.instance.dataCenterInfo.name.toLowerCase() === 'amazon') {\n return this.config.instance.dataCenterInfo.metadata['instance-id'];\n }\n return this.config.instance.hostName;\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
create a chord from a root note string and a major formula list ex: parseChord('D', ['1', 'b3', '5']) for a D minor chord
function parseChord(note, majorFormula, name='') { if (name == '') { name = note + ' Chord' } var root = Note.fromStr(note) var majorNotes = [] majorFormula.forEach(function(s){ majorNotes.push(MajorNote.fromStr(s)) }) majorScale = new MajorScale(majorNotes) chromatic = majorScale.chro...
[ "function generateChord(rootNote, chordType, chordScale) {\n currentChord = [];\n\n doubledNotes = chordScale;\n\n switch (chordType) { \n case \"maj\":\n currentChord.push(rootNote);\n currentChord.push(doubledNotes[doubledNotes.indexOf(rootNote) + majorChordFormula[0]]);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Update director office hours
function updateDirectorsCalendar() { clearTimeout(directorCalendarTimer); directorCalendarTimer = setTimeout(() => { try { let directorHours = {}; Directors.db().each((director) => { directorHours[director.ID] = { director: director, hours: [], html: ``, ...
[ "function alter_hours(member, newhours) {\n if (member && member != dummy_string) {\n set_value(assigned_hours,Number(get_value(assigned_hours))+Number(newhours));\n set_value(total_hours,Number(get_value(total_hours))+Number(newhours));\n }\n else if (member) {\n ;\n }\n else {\n set_value(unassig...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Envia dados do pedido/venda para base de dados
function finalizarVenda({ cliente, venda,vendedor }) { let vendaObj = { valor: venda.total.toString(), cliente_id: cliente.id!=='Sem Cliente'?cliente.id:"1", vendedor_id: vendedor.id.toString(), itensPedido: venda.produtos.map(produto => { return { desconto: produto.desconto?produto.des...
[ "function alterarBD(dados){\n var xhr = new XMLHttpRequest();\n xhr.open(\"PUT\", BASE_URL_SERVICO + \"/oportunidadeProblema\", false);\n xhr.setRequestHeader('Content-Type', 'application/json');\n xhr.send(dados);\n}", "async salva_descarregamento_sqlite_v2({ ID, Unidade, Placa, Dia, Transportadora, ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Renders the AWS CloudFormation properties of an `AWS::Route53RecoveryControl::SafetyRule.GatingRule` resource
function cfnSafetyRuleGatingRulePropertyToCloudFormation(properties) { if (!cdk.canInspect(properties)) { return properties; } CfnSafetyRule_GatingRulePropertyValidator(properties).assertSuccess(); return { GatingControls: cdk.listMapper(cdk.stringToCloudFormation)(properties.gatingContr...
[ "renderProperties(x) { return ui.divText(`Properties for ${x.name}`); }", "function cfnSafetyRulePropsToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnSafetyRulePropsValidator(properties).assertSuccess();\n return {\n ControlPanelArn: cdk....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function for rendering scores of single file
function viewScores(file) { //query database for data on selected file let query = "SELECT * FROM files WHERE file_directory = ? AND file_name = ?"; connection.query(query, [info.directory, file], function(err, res){ if (err) { console.log(err); viewMenu(); } else { //retrieve tags from ...
[ "function scoreRender(){ \n scoreDiv.html(\"You got \" + score + \"/10 correct!\");\n}", "function renderScore() {\n ctx.save();\n\n ctx.font = '25px Exo';\n ctx.textAlign = 'right';\n\n ctx.strokeStyle = '#00f';\n ctx.strokeText('Score: ' + score, canvas.width - 10, 30);\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Walks the dom tree and displays elements in red, Text in blue, ID in green, and Class Name in purple This is a recursive function
function displayNodes(DOC) { NodesAsList += "<ol>"; // Loop through all of the children of the current node for (var i = 0; i < DOC.childNodes.length; i++) { var Node = DOC.childNodes[i]; // If the node is valid then write its data if (No...
[ "function parseClasses()\n{\n const itemsList = document.querySelectorAll(\".content-item\");\n const codesList = document.querySelectorAll(\".content-classes\");\n const htmlList = document.querySelectorAll(\".content-html\");\n for (i = 0; i < itemsList.length; i++)\n {\n codesList[i].innerH...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Binds the click event on the cards and manages the main click logic and state that determines when the game was won
function bindClickEvent() { cardDeck.cards.forEach(card => { card.node.addEventListener("click", (e) => { if (isClosingCard || card.isOpened() || card.isMatched()) { return; } card.open(); if (state.isMatching) { if (state.matchingCard.getValue() === card.g...
[ "function handleCardClick() {\n cardClickBehaviour(this);\n }", "function cardClick() {\n\tif (clickedCards.length === 2 || matchedCards.includes(this.id)) {\n\t\treturn;\n\t}\n\tif(clickedCards.length === 0 || this.id != clickedCards[0].id){\n\n\t\tif(timeTrigger){\n\t\t\ttimerStart();\n\t\t\ttimeTrigger = f...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Unmarks all events on the timeline.
timelineUnmarkEvents() { this.line.setSelection(); }
[ "tableUnmarkEvents() {\n this.table.rows().every(function () {\n const row = this.node();\n $(row).removeClass('markRow');\n });\n }", "unMarkAll() {\r\n\r\n for ( var i = 0; i < this.marked.length; i++) {\r\n this.marked[i].originalColor();\r\n }\r\n\r\n this....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Use wget to do the download as it handles streams
function downloadFileWget (stream_url, callback) { var fileName = getFileName(); // Compose the wget command var wget = 'wget --output-document="' + downloadDir + fileName + '.mp3" ' + stream_url; console.log(wget); // Execute wget using child_process exec function var child = exec( wget, function (err, stdo...
[ "function download_file_wget(file_url) {\n\t // extract the file name\n\t var file_name = url.parse(file_url).pathname.split('/').pop();\n\t // compose the wget command\n\t var wget = 'wget -P ' + DOWNLOAD_DIR + ' ' + file_url;\n\t // excute wget using child_process' exec function\n\n\t var child ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets adj property in neighbours
getAdjProperty(prop) { let array = []; for (i = 0; i < this.neighbours.length; i++) { switch(prop){ case 'visible': case 'v': if (this.neighbours[i].visible === true) { array.push(this.neighbours[i]); } break; case 'empty': case -1: ...
[ "countriesNeighbouring (a) {\n return this.graph.adjacentValues(a.id)\n }", "get neighbors () { // lazy promote neighbors from getter to instance prop.\n const n = this.patches.neighbors(this)\n Object.defineProperty(this, 'neighbors', {value: n, enumerable: true})\n return n\n }", "static get nei...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Model initialization The first time a file is opened, it must be initialized with the document structure. This function will add a collaborative string to our model at the root.
function onFileInitialize(model) { var string = model.createString(); var list = model.createList(); string.setText('Test task'); list.insert(0, string); model.getRoot().set('coll_list', list); }
[ "function onFileInitialize(model) {\n book = setUpAndDisplaymyApp.Book(model);\n console.log(model);\n // /**/ book = model.create('myApp.Book', 1, \"Hello World\")\n model.getRoot().set('mybook', book);\n console.log(\"mybook =\");\n console.log(model.get('mybook'));\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method calls initPuzzle() to return the string of current values present on the game board. It then calls solve() in solver.js to check the validity of the board
function validateBoard() { var puzzleString = initPuzzle(); sudokuSolver.solve(puzzleString, 1); }
[ "solve() {\n\n // Verify that the initial state is a valid board\n if (!this.isValidBoard()) {\n return 'invalid board';\n }\n\n // Keep a stack of our attempts to solve, so we can backtrack as necessary\n const attemptStack = [];\n let attemptCount = 0;\n\n while (!this.isBoardSolved()) {...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
set_active_portal is called by the newly created portal. this is required since the portal and the portal group (this class) could be on different GSs.
function set_active_portal(portal, location, x, y){ var old_location = null; var old_coords = null; var now = getTime(); var old_active = this.active; var old_portal = this.portals[this.active]; if (this.active && this.portals[this.active] && this.portals[this.active].portal){ old_location = this.portals[this...
[ "setActive () {\n\t\tthis._active = true;\n\t\tthis.$element.addClass('screenlayer-active');\n\t}", "_setActive(active) {\r\n this._active = active;\r\n \r\n if (this._active != this._pactive) {\r\n this.isChanged = true;\r\n }\r\n }", "_setActivePool(poolid) {\n\t\tthis.activePool = poolid\n\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set up the page: Initialize global variables, generate the table, set up the sorting function
function setup(pagenumber, state, categories,sort){ g_page=pagenumber; g_state=state; g_categories=categories; g_sort=sort; new_frame(); $('th').click(function (){ //Clicking the table headers sorts the rows sort_table($(this)); }); }
[ "function pageInit() {\n\tAddStyle('https://1048144.app.netsuite.com/core/media/media.nl?id=1988776&c=1048144&h=58352d0b4544df20b40f&_xt=.css', 'head');\n\n\t//JQuery to sort table based on click of header. Attached library \n\tjQuery(document).ready(function() {\n\t\tjQuery(\"#customer\").bind('dynatable:init', f...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Selecting controller based on given URL
get(url) { url = url.trimAll("/"); // Fast Access Controller (full match) let fast_acs_controller = this.router[url]; if (fast_acs_controller != null) return this.app.createComponent(fast_acs_controller, Object.assign({}, this.app.config, {"request": {}})); // Searching ...
[ "function getcurrentController(url) {\n var pathSplit = window.location.href.split(window.location.origin);\n\n if (pathSplit.length < 1)\n return \"\";\n return pathSplit[1].split('/')[1];\n}", "loadControllerFromUrl(fallbackController) {\n const currentController = this.getCurrentControll...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This func() initializes the WebGLBuffer objects param gl: WebGLRenderingContext
function initBuffers(gl) { return { positions: gl.createBuffer(), offsets: gl.createBuffer(), normals: gl.createBuffer(), randomSeeds: gl.createBuffer(), rotationAxes: gl.createBuffer() }; }
[ "function init() {\n\t\tvertexBuffer = gl.createBuffer();\n\t\t//texture coordinates do not change, so we use a static array buffer\n\t\ttexCoordBuffer = setupStaticArrayBuffer(texCoords);\n\t\tnormalBuffer = gl.createBuffer();\n\t}", "function initializeBuffersandShaders(gl)\n{\n // Initialize shaders\n if (!i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the longitude bounds if longitude is a single coordinate
function getLngBoundsForSingleCoordinate(a){var b=a[0]-PADDING<GEO_BOUNDS.LNG_MIN?GEO_BOUNDS.LNG_MIN:a[0]-PADDING,c=a[1]+PADDING>GEO_BOUNDS.LNG_MAX?GEO_BOUNDS.LNG_MAX:a[1]+PADDING;return[b,c]}
[ "function bounds(data) {\n\twindow.console.log('parser.bounds');\n\n\tconst bounds_coords = {\n\t\t'latitude_northmost': null,\n\t\t'latitude_southmost': null,\n\t\t'longitude_westmost': null,\n\t\t'longitude_eastmost': null\n\t};\n\tdata.forEach(function (row, index) {\n\t\tconst latitude = _.get(row, 'coordinates...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Rotate Implement rotateArr(arr, shiftBy) that accepts array and offset. Shift arr's values to the right by that amount. 'Wraparound' any values that shift off array's end to the other side, so that no data is lost. Operate inplace: given ([1,2,3],1), change the array to [3,1,2]. Don't use builtin functions. Second: all...
function rotateArr(arr, shiftBy){   // to rotate to the right once, create temp var that holds the last value, then move all items in the array to the right one index, and then put the temp value at the beginning of the array // handles to the right if(shiftBy > 0){ // loops through rotations for(var i = 0; i < shi...
[ "function rotateArr(arr, shiftBy) {\n const arrayLength = arr.length;\n shiftBy %= arrayLength;\n if (shiftBy >= 0) {\n for (let i = 0; i < shiftBy; i++) {\n const temp = arr[arrayLength - 1];\n for (let i = arrayLength - 1; i > 0; i--) {\n arr[i] = arr[i - 1];\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Manages File Pointer bucket
manageBucketPointer(){ if (fs.existsSync(this.file_bucket_path)) { let data=fs.readFileSync(this.file_bucket_path); this.bucket=JSON.parse(data); this.updateFilePointerBucket(); }else{ this.createFilePointerBucket(); } }
[ "createFilePointerBucket(){\n var total=fs.fstatSync(this.fd).size;\n var iterLeft=this.iterLeft(total,this.indexing_buffer_size);\n var iter=iterLeft[0];\n var left=iterLeft[1];\n var position=0;\n this.filePointerBucketHelper(iter,left,position)\n var json = JSON.s...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Determines if the URL anchor destiny is the starting section (the one using 'active' class before initialization)
function isDestinyTheStartingSection(){ var anchors = window.location.hash.replace('#', '').split('/'); var destinationSection = getSectionByAnchor(decodeURIComponent(anchors[0])); return !destinationSection.length || destinationSection.length && destinationSection.index() ...
[ "function isDestinyTheStartingSection(){\n var anchors = window.location.hash.replace('#', '').split('/');\n var destinationSection = getSectionByAnchor(decodeURIComponent(anchors[0]));\n \n return !destinationSection.length || destinationSection.length && destinationSection.ind...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Moves the slot across the defined plan that intersects the closet, without overlapping the closet's faces
moveSlot() { if (this.raycaster.ray.intersectPlane(this.plane, this.intersection)) { let newPosition = this.intersection.x - this.offset; //Subtracts the offset to the x coordinate of the intersection point let leftFace = this.closet.getClosetFaces().get(FaceOrientationEnum.LEFT).mesh(); let value...
[ "moveFace() {\n let closetSlotsFaces = this.closet.getClosetSlotFaces();\n if (this.raycaster.ray.intersectPlane(this.plane, this.intersection)) {\n let closetLeftFace = this.closet.getClosetFaces().get(FaceOrientationEnum.LEFT).mesh();\n let closetRightFace = this.closet.getClosetFaces().get(FaceOr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Example For a = 97, the output should be mirrorBits(a) = 67. 97 equals to 1100001 in binary, which is 1000011 after mirroring, and that is 67 in base 10. For a = 8, the output should be mirrorBits(a) = 1.
function mirrorBits(a) { let answer = ''; a = a.toString(2).split(''); for(let i = a.length-1; i >= 0; i--) { answer += a[i] } return parseInt(answer, 2) }
[ "function mirrorBits(a) {\n let bin =a.toString(2);\n let arr = [...bin];\n arr.reverse();\n let flipped = arr.join(\"\");\n return parseInt(flipped,2)\n}", "function flippingBits(n) {\n let initialBin = n.toString(2).split(''); //convert initial number to binary\n let inverseBin = Array(32)....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns true if the given object is an instance of OrganizationAdminAccount. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.
static isInstance(obj) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === OrganizationAdminAccount.__pulumiType; }
[ "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === Organization.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n r...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Enables/disables the 'Save changes' button.
function enableSaveButton() { $('#save-changes').attr('disabled', false); }
[ "function enable_save() {\n save_button.prop('disabled', false)\n }", "function enableSave( enable )\n{\n\tif( enable )\n\t{\n\t\tdocument.getElementById('cmd_ple_save').removeAttribute('disabled');\n\t\tdocument.getElementById('cmd_ple_saveAs').removeAttribute('disabled');\n\t}\n\telse\n\t{\n\t\tdocument.get...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Opens a different site window, and in `unload` event handler, test to fetch a keepalive URL that involves in redirect to another URL.
function keepaliveRedirectInUnloadTest(desc, { origin1 = '', origin2 = '', url2 = '', withPreflight = false, shouldPass = true } = {}) { desc = `[keepalive][new window][unload] ${desc}`; promise_test(async (test) => { const targetUrl = `${HTTP_NOTSAMESITE_ORIGIN}/fetch/api/resources/keepalive...
[ "function keepaliveRedirectTest(\n desc, {origin1 = '', origin2 = '', withPreflight = false} = {}) {\n desc = `[keepalive] ${desc}`;\n promise_test(async (test) => {\n const tokenToStash = token();\n const iframe = document.createElement('iframe');\n iframe.src = getKeepAliveAndRedirectIframeUrl(\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
if value is a function, invoke it with args, otherwise return it as object if value is undefined, will return undefined
function resolveValue(value, ...args) { if (typeof value === "function") { return value(...args); } else { return value; } }
[ "tryInvoke(value, ...args) {\n if (value === null) {\n return null;\n }\n else if (value === UNDEF) {\n throw new MonteOptionError('Value not initialized.');\n }\n\n try {\n return isFunc(value) ? value.call(this, ...args) : value;\n }\n catch (e) {\n if (console && console....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Utility functions / Tests is a selector is a String or DOM Node, retunrs the selected Node if it can Returns false otherwise
function _getDOMNode(selector) { let $el = null; if (typeof selector === 'string') { if (document.querySelector(selector) === null) { return false; } $el = document.querySelector(selector); return $el ; } else if (selector instanceof Node) { $el = selector; return $el; } else { ...
[ "isValidSelector() {\n const DOM = document.querySelector(this.selector);\n\n if (DOM) {\n this.DOM = DOM;\n return true;\n }\n\n return false;\n }", "selector(node) {\n return true;\n }", "function check_selector( $el, matches, loose, parent ){\n\n\t\tif(!parent) parent...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
event [1][bind a event] uu.event(node, "click", fn) > node [2][bind multi events] uu.event(node, "click,dblclick", fn) > node [3][bind a capture event] uu.event(node, "mousemove+", fn) > node [4][bind a namespace.event] uu.event(node, "MyNameSpace.click", fn) > node uu.event bind event
function uuevent(node, // @param Node: eventTypeEx, // @param EventTypeExString: some EventTypeEx, "click,click+,..." evaluator, // @param Function/Instance: callback function unbind) { // @param Boolean(= false): true is unbind, false is bind ...
[ "bindEvent() {}", "function bindEvents() {}", "_bindEvents()\n {\n \n }", "bindEvents() {\n\t}", "function uueventfire(node, // @param Node: target node\r\n eventType, // @param String: \"click\", \"custom\"\r\n param) { // @param Mix(= void): para...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
update() update this limb's parts' position, and listen for leg overlaps in a nutshell: each part's rotation is given by a sin() or cos() function which constantly oscillates around an origin angle, from negative max displacement value to positive max displacement value. User alters motion by manipulating origin and ma...
update(){ // --------------------- CALCULATE ROTATION --------------------- // // get this origin and max displacement values for this frame. // currentmotion() allows a slow ramp from one set of values to another // when switching motions. let thisFrame = this.currentMotion(); // get this fra...
[ "updateMotion() {\n this.acc.add(this.force.div(this.genes.mass.val)); // a = f/m\n this.acc.limit(this.genes.maxAcc.val);\n this.vel.add(this.acc);\n this.vel.limit(this.genes.maxVel.val);\n this.pos.add(this.vel);\n }", "update() {\n // The angle is based on a flowfield\n let angle...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Loops through a percent slider list and puts their duplicate in a specified container
function setSummaryPercentSliders(targetContainer, percentSliders) { var percentSlidersDisplay = $("." + percentSliders).clone(); percentSlidersDisplay.css("z-index", "0"); $("#" + targetContainer).append(percentSlidersDisplay); $("." + percentSliders.replace("Display", "")).each(function () { v...
[ "function setSummarySliders(targetContainer, sliderList, sliderColor) {\n for (let i = 0; i < sliderList.length; i++) {\n var slider = $(\"#\" + sliderList[i]).clone();\n $(\"#\" + targetContainer).append(slider);\n\n // Set slider category color\n slider.removeClass();\n slide...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
News /////////////////////////////////////////////////////////////////////////////// Gets News source information from the server
function getSource(){ let xml = new XMLHttpRequest(); xml.onreadystatechange = function(){ //Retrieves news information if(xml.status == 200 && xml.readyState == 4){ source = xml.responseText; getNews(); } // If we don't get any items, inform the user. else...
[ "function getNewsData() {\n var news;\n device.ajax(\n {\n url: 'http://news-feed.mousaz.msproto.net/news?filter=' + filter,\n type: 'GET',\n headers: {\n 'Content-Type': 'application/xml'\n }\n },\n function onSuccess(body, textS...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
toggle the flash/torch of the mobile fun if applicable. Great post about it
toggleMobileTorch() { // sanity check console.assert(this.hasMobileTorch() === true); var stream = arToolkitSource.domElement.srcObject; if( stream instanceof MediaStream === false ){ alert('enabling mobile torch is available only on webcam'); return } if( this._currentTorchStatus === undefined )...
[ "function ToggleFlashlight () {\n turnedOn=!turnedOn;\n if (turnedOn && energy>0) {\n TurnOnAndDrainEnergy();\n } else {\n lightSource.enabled = false;\n }\n }", "function toggleFlash(){\n if($scope.flashOnOff === 'off' && $scope.cameraToggle === true){\n window.plugins...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
End Declare Services >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> // Declare ToBuyShoppingController and pass it our service as an argument. This allows us to use variables and functions from ShoppingListCheckOffService.
function ToBuyShoppingController(ShoppingListCheckOffService) { var buyController = this; //Refer to "this" as buyController. //Get the "To Buy" list from our service //toBuyItems will be set to the value of sendBuyItems in ShoppingListCheckOffService buyController.toBuyItems = ShoppingListCheckOffService.sendBuyI...
[ "function ToBuyController(ShoppingListCheckOffService){\n //variables declaration\n this.products = ShoppingListCheckOffService.getProductListToBuy();\n\n this.buyProduct = function(index){\n ShoppingListCheckOffService.buyProduct(index);\n };\n\n }", "function ToBuyController(ShoppingListCheckO...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Normalize the nonnested version of the query to a standardize nested
function normalize(q) { if (q.groupBy) { var nest_2 = { groupBy: q.groupBy }; if (q.orderBy) { nest_2.orderGroupBy = q.orderBy; } var normalizedQ = { spec: util_1.duplicate(q.spec), nest: [nest_2], }; if (q.choos...
[ "function normalize(input) {\n const rootQueryObject = {};\n const denestedObjects = [];\n\n /*\n * Takes an object, and a parent key. Recursively goes through keys\n * in object, and writes all to denestedObjects array. If result at key is a\n * primitive, write to result. If object, set to result of recu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A widget for displaying curve data.
constructor(app) { this.app = app; this.canvas = E.canvas(null); this.ctx = this.canvas.getContext('2d') this.element = E.div('curve-view-main', E.div('curve-view-css-is-a-butt', this.canvas)); this._minX = 0; this._minY = ...
[ "function CurveDrawData(strokeColor, curveWidth)\r\n{\r\n this.strokeColor = strokeColor;\r\n this.curveWidth = curveWidth;\r\n}", "GetCustomCurve() {}", "get curves() {}", "function Curve() {\n\n\t\tthis.type = 'Curve';\n\n\t\tthis.arcLengthDivisions = 200;\n\n\t}", "function drawValues() {\n\t\t\n\t\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
create our own reducer that wraps the original one and hijacks the reset
function reducer() { var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : resetState; var action = arguments[1]; if (action && action.type === typeToReset) { return resetState; } else { return originalReducer(state, action); } }
[ "function wrapReducer() {\n let lastState = null ;\n let prototype = {\n getRoot: () => store.getState(),\n globalAction: globalAction,\n $$tag: reducer.$$tag,\n } ;\n /**\n * Generate a prototype that contains the selectors and\n * ac...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Kill a process. READ THIS BEFORE USING THE FUNCTION: TODO: This function is kept for historical reasons and should be removed once its user (gooutline) is replaced. Outlining uses this function and not killProcessTree because of performance issues that were observed in the past. See for more details and background.
function killProcess(p) { if (p && p.pid && p.exitCode === null) { try { p.kill(); } catch (e) { console.log(`Error killing process ${p.pid}: ${e}`); } } }
[ "function killProcess(proc, killTree, killTreeSignal) {\n _killProcess(proc, killTree, killTreeSignal).then(() => {}, error => {\n logger.error(`Killing process ${proc.pid} failed`, error);\n });\n}", "function killProcess(pid) {\n ProcessService.killProcess(pid).\n success(function(data){\n }).\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the amount of food generated by the various source base food level (the the land, etc) required farmers + optional farmers other buildings and the like There's 2 categories of produced food weighted food generation that, if over the base food level, if halved unweighted food generation that is not reduced by be...
function calculateFoodGenerated(userState) { var baseFoodLevel = Population.calculateBaseFoodLevel(userState); const foodPerFarmer = Population.calculateFoodPerFarmer(userState); const totalFarmers = Population.calculateNumRequiredFarmers(userState) + userState.population.numOptionalFarmers; // The am...
[ "function generateFood()\n{\n\t//if there isn't enough water, take what there is\n\tif (water < farms)\n\t{\n\t\tfood = food + Math.floor((water * 5) * (1 + (0.05 * advancedfarming)));\n\t\tfoodbonus = foodbonus + Math.floor((water * 5) * (1 + (0.05 * advancedfarming)));\n\t\twatercost = watercost + water;\n\t\twat...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
funcion que agrega las nuevas filas a la tabla
function agregarFilas(productos){ for(var i=0 ; productos[i] ; i++){ var producto = productos[i], nombre = producto.nombreProducto, codigo = producto.codigo, cantidad = producto.cantidadAlmacen, minimo = producto.minimo, idAlmacen = producto.idAlma...
[ "function agregarFilas(estados){\n $('#estado_data').DataTable().clear().draw();\n for(var i=0 ; estados[i] ; i++){\n var estado = estados[i],\n nombre = estado.nombre,\n codigo = estado.codestado,\n estatus = estado.estatus,\n nombre_pais = estado.nombre_pai...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function to apply the decryption to any columns that will contain encrypted data
function columnStringDecryption(stringOfCols){ // Splitting the string of column names into an array var columns = stringOfCols.split(", "); // Looping through all the column names to see if they // are in the list of encrypted columns for(var i=0; i<columns.length; i++){ // Creating a temp...
[ "function decrypt(entity) {\n if (!entity) {\n return entity;\n }\n for (var _i = 0, _a = typeorm_1.getMetadataArgsStorage().columns; _i < _a.length; _i++) {\n var columnMetadata = _a[_i];\n var propertyName = columnMetadata.propertyName, mode = columnMetadata.mode, target = columnMeta...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Manually climb up the stack. NOTE: We are waiting now, and see on the stack: 1. Await (top) 2. async function (top1) > However, next trace will be outside of the function, so we want to skip both.
skipPopPostAwait() { this._executingStack._peekIdx -= 2; }
[ "skipPopPostAwait() {\n this._executingStack._peekIdx -= 1;\n }", "restackTop(){\n\t\tthis.top.forEach((bringToTop) => {\n\t\t\tbringToTop();\n\t\t});\n\t}", "function test_stack_parent() {}", "function suspendFrame(sus, work_fun, dbg_info) {\n sus.k = new StackFrame(work_fun, sus.k, dbg_info);\n}", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function will get all the mapping variables related to contact center upload request section.
function requestSubtypeMapping(uploadRequestParamArr,requestID) { var mapping="",requestMessage,requestButton; mapping = { '{requestMessage}': removeNull(uploadRequestParamArr["requestMessage"]), '{requestButton}':removeNull(uploadRequestParamArr["requestButton"]), '{requestID}':requestID, '{reque...
[ "function loadFileUploadInfo()\n{\n\t//determine the parameter which is the uploaded file\n\tvar paramNames = cocoon.request.getParameterNames();\n\twhile(paramNames.hasMoreElements())\n\t{\n\t\tvar fileParam = paramNames.nextElement();\n\t\t\n\t\tvar fileObject = cocoon.request.get(fileParam);\n \n /...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return the Consts services key according to the envitonment
function getServicesKey() { return /QA/i.test(SUConfigManager.getEnvironment()) ? "ServicesQA" : "Services"; }
[ "getKey() {\n const { ACCOUNT_KEY } = env;\n return ACCOUNT_KEY;\n }", "function getEnvKey(configKey) {\n if (configKey) {\n const upperCaseUnderscoreConfigKey = configKey.toUpperCase().replace(/-/g, '_');\n return \"SSC_PASSWORD_\" + upperCaseUnderscoreConfigKey;\n } else {\n return \"SSC_PASSW...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns true if the frog occupies the same space as an object in lanes 711 (aka a car)
function is_collision() { if (frog.lane > 6 && frog.lane < 12) { var lane = frog.lane - 7; for (car in cars[lane].x) { if (frog.x + frog.w >= cars[lane].x[car] && frog.x <= cars[lane].x[car] + cars[lane].w) { return 1; } } } return 0; }
[ "checkCollision(lightning, jedi) {\n if (lightning.x < jedi.x + jedi.width &&\n lightning.x + lightning.width > jedi.x &&\n lightning.y < jedi.y + jedi.height &&\n lightning.height + lightning.y > jedi.y) {\n return true;\n }\n else {\n ret...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Content to be displayed in heap memory cell in Members Stats Grid
function generateHeapCellHtml(row){ var cellDisplayState = 'display:none;'; if (isMemberRowExpanded[row.diskStoreUUID]) { cellDisplayState = 'display:block;'; } var heapHtml = "NA"; var heapStorageHtml = "NA"; var heapExecutionHtml = "NA"; if(row.memberType.toUpperCase() !== "LOCATOR"){ var heap...
[ "function displayMemory()\n{\n output=\"<table class='memory-table'><tr><th class='left'>Memory</th><th class='right'>Content</th></tr>\\n\";\n if(memory!=undefined){\n for(let i=0;i<memory.length;i++)\n { \n if(memory[i]!=undefined && memory[i]!=0)\n {\n let val=memory[i];\n if(!(val instanceof...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
+ + | Purpose..: Helper for the ListControl object | | Date Author Notice | | 08.04.2004 G.Schulz (SCC) Erstversion | 08.06.2004 G.Schulz (SCC) ListHelp.checkAll added; ListHelp_uncheck renamed | + +
function ListHelp() { }
[ "function ListControl(selName, layerObj, loadFromHTML) \n{\n // properties\n this.selectName = selName;\n \n if (layerObj)\n {\n this.object = dwscripts.findDOMObject(selName, layerObj);\n }\n else\n {\n this.object = dwscripts.findDOMObject(selName);\n }\n\n if (!this.object)\n {\n throw dwscr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Run build given the following skyuxconfig object. Starts server and resolves when ready.
function prepareBuild(config) { function serve(exitCode) { // Save our exitCode for testing spyExitCode = exitCode; // Reset skyuxconfig.json resetConfig(); return server.start({ sslCert, sslKey }, 'unused-root', tmp) .then(port => browser.get(`https://localhost:${port}/dist/`)); } ...
[ "build(next) {\n changeDeployStatus('building');\n\n if (LOCKS.buildStatus !== 'free')\n process.nextTick(next);\n\n return buildStaticSite(next);\n }", "function build() {\n const start = Date.now();\n let fullBuildDir = path.join('/tmp/app', BUILD_DIR);\n console.log('Executing build...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Retune playback quality level for the current player conditions. This will reset the main segment loader and the next segment position to the currentTime. This is good for manual quality changes.
fastQualityChange_(media = this.selectPlaylist()) { if (media === this.mainPlaylistLoader_.media()) { this.logger_('skipping fastQualityChange because new media is same as old'); return; } this.switchMedia_(media, 'fast-quality'); // Reset main segment loader properties and next segment posi...
[ "fastQualityChange_() {\n let media = this.selectPlaylist();\n\n if (media !== this.masterPlaylistLoader_.media()) {\n this.masterPlaylistLoader_.media(media);\n this.mainSegmentLoader_.sourceUpdater_.remove(this.tech_.currentTime() + 5,\n Infinity)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function: sizeRelOr Description: Returns true if the child frame node size is relative and the frameset is either a row or col, but not both.
function sizeRelOr(cNode) { var fsCols = cNode.parentNode.cols; var fsRows = cNode.parentNode.rows; var rtnBool = false; if ((fsCols != null) && (fsRows != null)) { // Exclusive OR rtnBool = false; } else { if (fsCols) { if (getListItem(fsCols, childNodeNum(cNode)) == "*") { rtnBool = tr...
[ "setSize(width, height) {\n let ancestorItem = this._parent;\n if (ancestorItem.isColumn || ancestorItem.isRow || ancestorItem.parent === null) {\n throw new internal_error_1.AssertError('ICSSPRC', 'ComponentContainer cannot have RowColumn Parent');\n }\n else {\n l...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Finishes the dialog close by updating the state of the dialog and disposing the overlay.
_finishDialogClose() { this._state = 2 /* MatDialogState.CLOSED */; this._ref.close(this._result, { focusOrigin: this._closeInteractionType }); this.componentInstance = null; }
[ "_finishDialogClose() {\n this._state = 2 /* CLOSED */;\n this._overlayRef.dispose();\n }", "close() {\n\t\tthis._closeDialog();\n\t\tthis.loading = false;\n\t}", "function closeOverlay() {\r\n\r\n if (activeOverlay) {\r\n\r\n document.getElementById('overlay').style.visibility = 'hid...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Grab a connection, run the query via the MSSQL streaming interface, and pass that through to the stream we've sent back to the client.
_stream(connection, query, /** @type {NodeJS.ReadWriteStream} */ stream) { return new Promise((resolve, reject) => { const request = this._makeRequest(query, (err) => { if (err) { stream.emit('error', err); return reject(err); } resolve(); }); request....
[ "stream (connectionName, tableName, options, outputStream) {\n let cxn = Adapter.connections.get(connectionName)\n let wlsql = new WaterlineSequel(cxn.schema, Adapter.wlSqlOptions)\n\n return new Promise((resolve, reject) => {\n resolve(wlsql.find(tableName, options))\n })\n .then(({ query...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
draw the background, a different ground and the bonus zone for each level
function drawBackground(){ ctx.drawImage(space, 0, 0, canvas.width, canvas.height); switch(levelnum){ case 0: //Free Flight ctx.drawImage(freeflightground, 0,canvas.height-25,canvas.width,25); break; case 1: //Mercury ctx.drawImage(merc...
[ "function drawGround() {\n //ctx.fillStyle = '#FFE699'; //old ground layer\n //ctx.fillRect(0, 375, canvas.width, canvas.height - 375);\n addBackgroundObject('./img/background/06_Ground.png', 0, 320, 0.4); //ground layer\n if (isMovingRight && bg_elem_1_x > LEVEL_WALL_FINISH) {\n bg_elem_1_x = ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get email of store to know who to send to
async function getStoreEmail(dbIn, store) { db = dbIn; myRef = db.collection("store").doc(store.toLowerCase()); let query = await myRef.get(); const email = query._fieldsProto.email.stringValue; return email; }
[ "function getEmail()\n {\n var item = Office.context.mailbox.item.from;\n\n var email = item.emailAddress;\n\n return email;\n }", "function get_author_email() {\r\n\tif (this.author != null) {\r\n\t\treturn this.author.getTarget().email;\r\n\t}\r\n\treturn app.getObjects(\"User\",{user...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the item display value.
_getItemDisplayValue(item, itemLabelPath) { return item && item.hasOwnProperty(itemLabelPath) ? item[itemLabelPath] : item; }
[ "function getDisplayValue(realValue) {\r\n\t\t\t\t\tvar item;\r\n\t\t\t\t\tif ($scope.model.valuelistID) {\r\n\t\t\t\t\t\tfor (var i in $scope.model.valuelistID) {\r\n\t\t\t\t\t\t\titem = $scope.model.valuelistID[i]\r\n\t\t\t\t\t\t\tif (item.realValue == realValue) {\r\n\t\t\t\t\t\t\t\treturn item.displayValue;\r\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Emits a mousedown event with the current coordinate of the mouse
onMouseDown (e) { this.isMouseDown = true; this.emit('mouse-down', {x: e.offsetX, y: e.offsetY}); }
[ "function mouseDownHandler() {\n updateCoordinates(event);\n mouseDown = true;\n console.log(\"mouse down.\");\n }", "mouseDown(event){\n }", "function mouseDown(event) {\n mousePressed = true;\n }", "mouseDown() {\n let action = this.get('onmousedown');\n if (action) {\n action(th...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
extend the aliases list with inferred aliases.
function extendAliases () { Array.prototype.slice.call(arguments).forEach(function (obj) { Object.keys(obj || {}).forEach(function (key) { // short-circuit if we've already added a key // to the aliases array, for example it might // exist in both 'opts.default' and...
[ "function addAliases(aliases) {\n Object.assign(fileAliases, aliases);\n}", "function extendAliases () {\n Array.prototype.slice.call(arguments).forEach(function (obj) {\n Object.keys(obj || {}).forEach(function (key) {\n // short-circuit if we've already added a key\n // to the aliases arr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Resets the state by returning the initialstate
function reset() { return initialState }
[ "reset() {\n \tthis.changeState(this.initial_state);\n }", "reset() {\r\n this.changeState(this.initialState);\r\n }", "reset() {\r\n this.state = this._initial;\r\n }", "reset() {\r\n this.changeState(this._initialState);\r\n }", "reset() {\r\n this.changeState(th...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Cria um input de numero com os atributos passados.
function CriaInputNumerico(numero, id, classe, funcao) { var input = CriaDom('input', id, classe); input.type = 'number'; if (numero) { input.value = numero; } if (funcao) { input.addEventListener('input', funcao, false); } return input; }
[ "function createQuantityInput(){\n var input = document.createElement('input')\n\n input.setAttribute('type', 'number')\n input.setAttribute('value', '0')\n\n return input\n}", "function newNumericInput( className, id, minval, maxval, value ) {\n\tvar num = document.createElement(\"input\");\n\tnum.type = \"n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
convert policy to its base64 representation
function encode(key, policy, next) { var encoding = base64encode(JSON.stringify(policy)).replace('\n',''); next(null, key, policy, encoding); }
[ "Base64Encode() {}", "apply_blob(blob) { return Base64.encode(blob) }", "static toBase64(json) {\n return JsonEncoder.toBuffer(json).toString('base64')\n }", "toBase64() {\n return this._byteString.toBase64();\n }", "function\nenBase64(str)\n{\n\tif (typeof str === \"undefined\") {\n\t\treturn...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
An effect for Object.isExtensible
function IsExtensible(sandbox, target) { if(!(this instanceof IsExtensible)) return new IsExtensible(sandbox, target); else Read.call(this, sandbox, target); }
[ "isExtensible (target) {\n return Object.isExtensible(target)\n }", "function Extensible() {\n // methods installed into this object\n this.$descriptors = {};\n this.$layers = {top: null};\n installLayerClass(this);\n}", "function isInheritable(obj) {\n\t\t\treturn obj && typeof obj === 'object' && !(ob...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Input: tokens tokens list with index pointing to the superscript token to be processed. return: if (logrithm) processed pow combination. else the v_superscript.
function processPow(tokens, v_result) { var v_comma = result_element( "mtext" ,0 , ',' ) ; var v_endBracket = result_element( "mtext" ,0 , ')' ) ; var v_superscript; tokens.index++; if (tokens.list[tokens.index-1] == '^') { v_superscript = v_piece_to_mathml(tokens); v_superscri...
[ "function singleDigitScriptLogPow(tokens, v_subscript)\n{\n if (tokens.index-1 >= 0\n && tokens.list[tokens.index-1] != '}' // multi-digit base is already handled correctly witha {} grouping\n && v_subscript.content.length === 1\n && isNumberStr(v_subscript.content[0])) // token separate let...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
assuming that hour and week day are important for decision, if a criteria contains a field that is a timestamp string (matches tempstamp regex), we extract the hour and week day from it, then put on criterias
function processCriterias (criterias) { var processedCriteria = {} Object.keys(criterias).forEach(function (key) { if ( criterias[key] .match( /\b[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}Z\b/ )) { var timestampDateObj = new Date(criterias[key]) p...
[ "function checkTimeByConditions(conditions, timestamp) {\n if(!conditions) return true;\n\n var resultTime = [];\n var resultWeek = true;\n\n var current = this.options.timeZone? moment(timestamp).tz(this.options.timeZone) : moment(timestamp);\n\n conditions = Array.isArray(conditions)? conditions : [condition...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
replace all instances of an expression with span with classname.
function simpleParse(code, expression, classname) { return code.replace(expression, match => { return spanWrap(classname, match); }) }
[ "function replaceWithClassNameSpan(group){\n\tvar rep = \"$1<span class='\"+group.className+\"'>$2</span>$3\";\n\tgroup.forEach(function(keyword){\n\t\tvar regex = new RegExp(latEsq + \"(\" + keyword + \")\" + latDir,\"gm\");\n\t\ttexto = texto.replace(regex, rep).replace(regex, rep);\n\t});\n}", "function replac...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Tensors: The primary data structure in TensorFlow programs. Tensors are Ndimensional (where N could be very large) data structures, most commonly scalars, vectors, or matrices. The elements of a Tensor can hold integer, floatingpoint, or string values Convert the input data to tensors that we can use for machine learni...
function convertToTensor(data) { return tf.tidy(() => { //step 1: shuffle data //Always shuffle the data. It's important to the final result tf.util.shuffle(data); //2 Convert data to Tensor // Converting to a 2d tensor. Tensor shape: [num_examples, num_features_per_example]. // Here we have:...
[ "function convertToTensor(data) {\n // Wrapping these calculations in a tidy will dispose any \n // intermediate tensors.\n \n return tf.tidy(() => {\n // Step 1. Shuffle the data \n // Here we randomize the order of the examples we will feed to the training algorithm. \n // Shuffling ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
FUNCTION: dwscripts.getParameterTypeFromCode DESCRIPTION: Get parameter type and name from its runtime value. ARGUMENTS: runtimeValue string the runtime code RETURNS: object contains paramType (one of elements returned from dwscripts.getParameterTypeArray) and paramName properties.
function dwscripts_getParameterTypeFromCode(runtimeValue) { var retVal = null; var serverObj = dwscripts.getServerImplObject(); if (serverObj != null && serverObj.getParameterTypeFromCode != null) { retVal = serverObj.getParameterTypeFromCode(runtimeValue); } return retVal; }
[ "function getParameterTypeFromCode(runtimeValue)\n{\n var runtimeVal = runtimeValue;\n\n var outObj = new Object();\n\n var paramType = -1;\n var paramName = runtimeValue;\n\n if (runtimeVal.search(/\\s*url\\.([^\"]*)\\s*/i) != -1)\n {\n paramType = MM.LABEL_CF_Param_Types[0];\n }\n else if (runtimeVal.s...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
create a daisy pattern when mouse is pressed
function draw() { if (mouseIsPressed == true) { //for petals of daisy angle += 5; var value = cos(radians(angle)) * 12.0; for (var a = 0; a < 360; a += 75) { var xoff = cos(radians(a)) * value; var yoff = sin(radians(a)) * value; fill(255,255,51); ellipse(mouseX + xoff, mouseY ...
[ "function draw_Stamp(){\n\tvar tool = this;\n\tthis.started = false;\n\ttool_default = true;\n\tchangeColorStamp();\n\t//var patternImage = new Image;\n\t\n\t//mouse down\n\tthis.mousedown = function(ev){\n\tcontext.moveTo(ev._x, ev._y);\n\ttool.started = true;\n\t\n\t//context.fillStyle= context.createPattern(patt...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Folder fills parent slots in its children.
fillParents () { this.files.forEach((demoFile: DemoFile) => { demoFile.folder = this }) this.folders.forEach((demoFolder: DemoFolder) => { demoFolder.parentFolder = this demoFolder.fillParents() }) }
[ "setParentForItems() {\n this.items.forEach((item) => {\n item.parent = this;\n this.namespace.emit(Message.SET_PARENT, { id: item.id, parent: this.id });\n });\n }", "updateFolder() {\n if (this['folder']) {\n this.options['parent'] = this['folder'];\n }\n }", "setParent(node) {\r\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the active classification from the call stack of the given object.
static in({ object: object, offset: offset }) { return O_Object.getMostRecentActiveInstantiatedClassification({ object: object, offset: offset, }) }
[ "static getActiveClassificationObjectIn({ object: object, offset: offset }) {\n const activeInstantiatedClassification = ActiveClassification.in({\n object : object,\n offset: offset,\n })\n\n if( activeInstantiatedClassification === undefined ) {\n return undef...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Given an RPN arithmetic expression tree t and an array of integers a, replaces the operand placeholders in t, in order, with the values in a, and evaluates the corresponding expression. If any of the intermediate results is negative or noninteger, or if an intermediate term would result in division by 0 or is 'x0' or '...
function treeEval(t, a) { var s = [], i = 0; for (var e of t) { if (e == 'x') { s.push(a[i++]); } else { var y = s.pop(), x = s.pop(), r = -1; switch (e) { case '+': r = x+y; break; case '-': // Omit x-0, since we generate x+0. if (y > 0) { r = x-y; } break; case '*': r = x...
[ "function evalExp(arr) {\n //Base case: When arr is length 1, return the value it contains.\n if(arr.length === 1){\n return Number.parseFloat(arr.pop());\n }\n //Calculate mult. and div. first.\n if (arr.includes('*') || arr.includes('/')){\n for (let i = 0; i < arr.length; i++){\n //Replace '*' a...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
============ Display Functions ================= Initial animation when user enters their location search
function initiatedDisplay(){ $('header').addClass('position-top'); $('.form-section').html(''); $('.options').delay(1000).fadeIn(1000); $('header p, .description-prompt, footer').fadeOut(); $('header h1').html(`<span style="font-size:.7em;">${state.ajax.near}</span><br /><span class="js-search">Sear...
[ "function toggleLocation() {\n \n setTimeout(function() {\n \n if (!$('label.city input').val().length > 0) {\n $('div.location').fadeIn().locate();\n }\n \n }, 800);\n \n }", "function showLocation() {\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Moves the component to the document body.
moveToDocumentBody(componentRef) { this.moveToElement(componentRef, document.querySelector("body")); }
[ "flushBody() {\n while (document.body.firstChild) {\n document.body.removeChild(document.body.firstChild);\n }\n }", "addToBody(){\n document.body.appendChild(this._element)\n }", "function Body() {\n ContentElement.call(this, 'body');\n }", "function clearBody(){\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Convert x to screen basis from gl basis
xToScreenBasis(x) { //return x + this.canvas.centre[0] return (x + this.canvas.centre[0]) / this.smallestScreenEdge() * this.params.sx }
[ "function xPixelToGL(px) {\n\treturn (px / canvas_size) * 2 - 1;\n}", "function screen2model(s_x, s_y) {\n var m_x, m_y;\n var canvas = document.getElementById(\"gl-canvas\");\n var w = canvas.width, h = canvas.height;\n \n m_x = (s_x/w) * 2 - 1;\n m_y = 1 - 2 * (s_y/h);\n \n return [m_x/s...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds the sub gallery to the page and populates it
async function AddSubGallery() { var SubGallerySection = document.createElement("div"); SubGallerySection.setAttribute("id", "sub_gallery"); var Gallery_Header = document.createElement("div"); Gallery_Header.setAttribute("id", "gallery_header"); var GalleryHeaderText = document.createElement("span"); Galle...
[ "function setupGallery() {\n\t\t if($(\".photogallery\").length) {\n\t\t\tvar globaltitle = $(\".photogallery h2\").text();\n\t\t\t$(\".photogallery h2\").css(\"display\", \"none\");\n\t\t\t$('.photogallery ul').wrap(\"<div class=\\\"scroller\\\"/>\");\n\t\t\t$('.photogallery img').attr(\"width\", \"106\");\n\t\t\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Does password match admin credentials
function passwordMatch(password) { return password === admin.password; }
[ "function correctCredentials(username, password){\n return username === \"admin\" && password === \"admin\";\n}", "function checkPassword(password) {\r\n return password === config.server.password;\r\n}", "isCorrectPassword(passwd) {\n return this.password === encrypt(passwd);\n }", "check...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Decays into one electron (and some neutrinos which we ignore)
decay() { let e = new Electron(this.x, this.y, this.z, this.v_x*0.5, this.v_y*0.5, this.v_z*0.5); ParticleTracks.activeParticles.push(e); this.v_x = 0; this.v_y = 0; }
[ "function buySignalDisruptor() {\n\tif (gamestate.money < signaldisruptorCost) return;\n\n\t// Subtract cost from money\n\tgamestate.setMoney(gamestate.money - signaldisruptorCost);\n}", "function sellElectronGenerator(){\n\tvar multiSell = checkMultisell(\"Elementary\");\n\t//Sell one electron generator\n\tif(el...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Starts the game. Hides start screen and sets the phrase.
startGame() { // Hide start screen overlay document.getElementById('overlay').style.display = 'none'; // get a random phrase and set activePhrase property this.activePhrase = this.getRandomPhrase(); this.activePhrase.addPhrasetoDisplay(); }
[ "startGame(){\n\t\tthis.phrase = new Phrase();\t\t\n\t\tthis.phrase.addPhraseToDisplay()\n\t\t\n\t}", "startGame() {\n this.reset();\n this.currentPhrase = new Phrase(this.getRandomPhrase());\n this.currentPhrase.addPhraseToDisplay();\n }", "startGame() {\r\n\t\tdocument.getElementById('...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
we need to sort these guys, you don't want to kill the fittest
sort () { this.Dudes.sort((a, b) => { return b.amIToughEnough(this.fitnessFunction) - a.amIToughEnough(this.fitnessFunction); }); }
[ "sort() {\n // Calculate the fitness of all the solutions.\n // We must do this for all because any could have experienced\n // a mutation that could change its fitness score.\n const fitnessSnapshot = this.solutions.map(solution => this.calculateFitness(solution));\n \n this.solutions.sort((a,b) ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
updates multiple docs/rows, in this case updates ALL listings in this case updates all docs that do not have a property type and gives them type unknown
async function updateAllListingsToHavePropertyType(client) { const result = await client.db("sample_airbnb").collection("listingsAndReviews") .updateMany({ property_type: { $exists: false } }, { $set: { property_type: "Unknown" } }); console.log(`${res...
[ "function addUpdates(batch, data) {\n if (typeof data.update === 'undefined') return;\n\n for (var i = 0; i < data.update.length; i++) {\n var doc = data.update[i];\n var id = castId(doc._id);\n\n delete doc._id;\n\n batch.find({_id: id}).updateOne({$set: do...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function that rechecks the width of the slider, to prevent all bugs
function checkWidth(){ sliderW = 1; //console.log($slides); $slides.each(function(){ sliderW += $(this).outerWidth()+o.slideMargin; }); $empty.width(sliderW); }
[ "function onWidthChange() {\n setupSliderDimensions();\n changeActivePage(activePage, 0);\n }", "function checkSlider(){\n \n if ($(window).width()>499)\n makeSlider();\n else\n removeSlider();\n \n}", "function resizeSlider(){\n // Slide width is being chan...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
TODO to be completed, use the GroupHashCache to persist foundset UUID for rowGroupCols/groupKeys combinations This object is used to keep track of cached foundset depending on rowGroupCol and groupKeys criteria. Any time a foundset is retrieved is persisted in this object. Question: can i use an hash instead of a tree ...
function GroupHashCache() { var rootGroupNode = new GroupNode('root'); // methods this.getCachedFoundset; this.setCachedFoundset; this.clearAll; this.removeCachedFoundset; this.removeCachedFoundsetAtLevel; this.removeChildFoundsets; // TODO rename in foundsetUUID thi...
[ "findMatches() {\n // this.unioned = {};\n // this.setSizes = {};\n // this.matchesObj = {};\n\n // Finds the set representative for the set that this key is a member of.\n const findSet = (key) => {\n let parent = this.unioned[key];\n if (parent == null) {\n return key;\n } els...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Removes a node object from the list. NOTE: A node's ownership does not change unless it is destroyed or node.move() is called. node Node object to remove. The node must belong to the list in order to be removed. returnNode True to return the removed node instead of destroying it, false to destroy it and return only its...
remove(node, returnNode) { let next = this._next, prev = this._prev, data; // Check for errors switch (true) { case node.list !== this: throw new Error("Node does not belong to this list."); return; ...
[ "removeNode(node) {\n if (!node) { return false; }\n \n var next = this._next,\n prev = this._prev,\n nodeNext = node[next],\n nodePrev = node[prev];\n \n // Exit if the node is not connected to other nodes\n if (!nodeNext || !nodePrev) { re...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Clean up transport subscriptions and packet buffer.
cleanup() { this.subs.forEach((subDestroy) => subDestroy()); this.subs.length = 0; this.decoder.destroy(); }
[ "cleanup() {\n debug(\"cleanup\");\n this.subs.forEach((subDestroy) => subDestroy());\n this.subs.length = 0;\n this.decoder.destroy();\n }", "cleanup() {\n\t debug(\"cleanup\");\n\t this.subs.forEach((subDestroy) => subDestroy());\n\t this.subs.length = 0;\n\t ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get the total length of all stringd, words inside a given array
function getStrLengthInArray(arr){ // let len=0; // arr.forEach( (val,idx)=>{ // len += val.length; // } ) // return len; return arr.reduce( (p, v) => p + v.length , 0); }
[ "function wordLengths(arr) {\n\treturn arr.map(item => item.length);\n}", "function wordLengths(arr) {\n return arr.map((word) => {\n return word.length;\n });\n}", "function wordCountFunc(arr) {\n var wordTotal = arr.length\n return wordTotal;\n}", "function wordCount(textArr) {\n return textAr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
End of Edit Category form ///////////////////////////////////////////////// ================= product addition and updation checks ===================================================
function addFrmProductValidat(Mode) { if(Mode == 'Add') { var insertedProducts = parseInt(document.getElementById("numOfInsertedProducts").value); var AllowedProducts = parseInt(document.getElementById("numOfAllowedProducts").value); var displayMessage = ""; if(insertedProducts >= AllowedProduct...
[ "function handleAddProductForm() {\n var product = {\n \"name\": $('#admin-product-name-input').val(),\n \"price\": $('#admin-product-price-input').val(),\n \"description\": $('#admin-product-description-textarea').val(),\n \"image_url\": $('#admin-product-image-input').val(),\n \"amount\": $('#admi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
//////FUNCTION THAT RETURNS A LIST OF PAST BOOKINGS RELATIVE TO THE CURRENT DATE EITHER AUTHORIZED (TRUE) OR ALL(FALSE)
pastBookings(status){ if(status == undefined || status == false){ let pastBooks = this._booking.filter(function(obj){ if(obj.startDate < new Date()){ return obj; } }) return pastBooks; }else if(status == true){ ...
[ "futureBookings(status){\n if(status == undefined || status == false || status!=true){\n let futureBooks = this._booking.filter(function(obj){\n if(obj.startDate > new Date()){\n return obj;\n }\n })\n return futureBooks;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
clears the value of a jquery object
function clearVal(obj) { obj.val(""); }
[ "clearValue() {\n this._value = null;\n }", "function clear(){\n\t\t$(\":input\").val(\"\")\n\t}", "function clear_data(){\r\n\t\t\t$(\"#\"+$data_container).html(\" \");\t\r\n\t\t}", "remove(){\n\t\tthis.JQ.remove();\n\t\tCtlObject.objects[this.id] = undefined;\n\t}", "function clearDateEntry(o) {...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }