query
stringlengths
9
34k
document
stringlengths
8
5.39M
negatives
listlengths
19
20
metadata
dict
to be called when a torrent is deleted. If the active torrent page is open, then we close it.
closeDeletedTorrent(state, key) { if(state.activeTorrent === key) { state.activeTorrent = "" } }
[ "close() {\n if(this.added) {\n this.added = false;\n this.getJQueryObject().remove();\n\n // Remove entry from global entries variable\n entries = _.omit(entries, this.id);\n\n GUI.onEntriesChange();\n GUI.updateWindowHeight();\n }\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a function for splitting selfintersecting polygon rings The splitter function receives a single polygon ring represented as an array of arc ids, and returns an array of splitapart rings. Selfintersections in the input ring are assumed to occur at vertices, not along segments. This requires that internal.addInte...
function getSelfIntersectionSplitter(nodes) { var pathIndex = new IdTestIndex(nodes.arcs.size(), true); var filter = function(arcId) { return pathIndex.hasId(~arcId); }; return function(path) { pathIndex.setIds(path); var paths = dividePath(path); pathIndex.clear(); return paths; }; // ...
[ "function processRing(ring, holes, crsProperties) {\n var curveMember = ring.firstElementChild.firstElementChild;\n var segments = curveMember.firstElementChild.children;\n var coordinates = [];\n for (i = 0; i < segments.length; i++) {\n if (segmengts[i].localName === \"LineS...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Use the AWS CloudFormation AWS::KinesisAnalytics::ApplicationReferenceDataSource resource to add a reference data source to an existing Amazon Kinesis Data Analytics application. For more information, see AddApplicationReferenceDataSource in the Amazon Kinesis Data Analytics Developer Guide. Documentation:
function ApplicationReferenceDataSource(props) { return __assign({ Type: 'AWS::KinesisAnalytics::ApplicationReferenceDataSource' }, props); }
[ "function generateDynamicDataRef(sourceName,bindingName,dropObject)\n{\n var retVal = \"\";\n\n var sbObjs = dwscripts.getServerBehaviorsByTitle(sourceName);\n if (sbObjs && sbObjs.length)\n {\n var paramObj = new Object();\n paramObj.bindingName = bindingName;\n retVal = extPart.getInsertString(\"\", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
GET LINE FOR STROKE WIDTH ICON
function getWidthIcon(x,y,s){ return "M"+(x-s/2)+" "+y+",L"+(x+s/2)+" "+y; }
[ "function getLineIcon(x,y,s){\n\tvar result=\"M\"+(x-s/2)+\" \"+(y+s/2)+\",\";\n\tresult=result+\"L\"+(x+s/2)+\" \"+(y-s/2);\n\t\n\treturn result;\n}", "get crosshairsLineWidth() {\n\t\treturn this.nativeElement ? this.nativeElement.crosshairsLineWidth : undefined;\n\t}", "static get centeredGreyMiniLabel() {}"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return an array of jQuery objects for the placeholder content containers of each row. The content containers don't actually contain anything, but their dimensions should match the events that are overlaid on top.
function getRowContentElements() { var i; var rowCnt = getRowCnt(); var rowDivs = []; for (i=0; i<rowCnt; i++) { rowDivs[i] = allDayRow(i) .find('div.fc-day-content > div'); } return rowDivs; }
[ "function getAddedBoxes() {\n var boxes = [];\n\n // Go through each item in the table and add it to the items array.\n // Each item is added as an array with the following format:\n // [ item_name, item_expiration, item_count ]\n $('#boxes_added tr').each(function(index, element) {\n element ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Private Functions ////////////////////////////////////////////////////////////////////////// Function Title: processInitialState Description: Processes user inputs when processArgs is looking for the next user command. Decides which command handler to hand the next user command to. Parameters: None Preconditions: proce...
function processInitialState() { if ('-' === sword.charAt(0) && -1 !== agoodArgs.indexOf(sword)) { sstate = sword; aargsGiven.push(sword); bok = false; i -= 1; //Reprocess the current statement in the next state. } else if (-1 !== aargsGive...
[ "function processArgsState() {\n oresult.bargs = true;\n bok = true;\n sstate = '';\n }", "function processRepoState() {\n //Error if arg value missing for -repo. Error if folder path resolves\n //to root or is invalid. Otherwise, store value and move on to the next\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
adds a subject to the a table
function addSubject(tbody, subject) { let tr = create("tr"); let tds = subjectToArray(subject); createTooltip(subject.timeslot.timeslot, timeSlotText(subject.timeslot), tr); for (let t of tds) { let td = create("td"); appendText(td, t); append(tr, td); } createTooltip(subject.title, teacherText...
[ "function addSubject(){\n\tvar name = document.getElementById(\"form-subject\").value;\n\tdocument.getElementById(\"form-subject\").value = \"\";\n\tif(name.length>1){\n\t\tvar newFile = subjects.add(name);\n\t\tif(newFile!==false){\n\t\t\t// Save an empty collection object into this new subject\n\t\t\tif(storage.u...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
look at the file name to determine if it is a music file
function isMusicFile(filename) { //check all file types to verify if it is a music file for (var j = 0; j < fileTypes.length; j++) { //if we have a match, this file is a music file if (filename.toLowerCase().indexOf(fileTypes[j].toLowerCase()) > -1) return true; } return false; }
[ "function canPlayMp3()\n{\n var a = document.createElement('audio');\n return (a.canPlayType && a.canPlayType('audio/mpeg;').replace(/no/, ''));\n}", "function validateQuizTitle(title){\r\n let dirToRead = `quizzes/${cat}/`, alrdyTaken = false;\r\n\r\n if(title == \"\")...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Removes all listeners and call all onDestroys in a given view.
function cleanUpView(view) { removeListeners(view); executeOnDestroys(view); executePipeOnDestroys(view); }
[ "_destroyObservers() {\n this.observerList.forEach(observer => observer.destroy() );\n this.observerList = [];\n }", "function destroy() {\n parent.removeEventListener(\"mousedown\", onDown);\n document.querySelector(\"body\").removeEventListener(\"mouseup\", onUp);\n parent.removeEventL...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check to see if the current diagram is a real chord. Update text if it is a real chord. Update text if it is not a real chord.
function checkIfChord() { let chordName = chordMap[pressedDownStrings.toString()]; if(chordName) { let ch = chordName.charAt(0); let isVowel = (ch == 'A' || ch == 'E'); ch = (isVowel ? 'n' : ''); document.getElementById('chordText').innerHTML = `This is a${ch} ${chordName}`; } else documen...
[ "function displayChord(el) {\n // first, clear the diagram that involves toggling so we can reuse functions\n clearDiagram();\n\n pressedDownStrings = getByValue(chordMap, el.innerHTML).split(',');\n\n for(let i = 0; i < pressedDownStrings.length; ++i) {\n pressedDownStrings[i] = parseInt(pressedDownStrings[...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Copy a blank handlbar template aka Hello World Web Part content
_writingSampleCode() { this.fs.copy( this.templatePath('sample/src/templates/HelloWorld.hbs'), this.destinationPath('src/webparts/templates/HelloWorld.hbs') ) }
[ "function createWelcomePage(name) {\n var parent = document.querySelector('.content');\n var newSection = document.createElement('section');\n newSection.classList.add('game-explanation');\n newSection.innerHTML = getWelcomePageStructure(name);\n parent.appendChild(newSection);\n}", "function createHomePageT...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Given an expanded object and an optional object to compare to (e.g. its $ref'd form), will call the following functions: callbacks.before lets you modify the initial starting state, must return it callbacks.where lets you select a subset of properties, return a truthy value callbacks.filter called for all selected prop...
function visit(obj,comparison,callbacks) { let state = {identityDetection:true}; let count = 0; if (callbacks.before) state = callbacks.before(obj,'',{}); recurse(obj,state,function(obj,key,state){ let selected = true; if (callbacks.where) { selected = callbacks.where(obj,key...
[ "function prop_resolve(p_tree, obj) {\n\tvar i, l, match,\n\t\tget_element_on_conditions, //sets e_ret to the resolved element (the \"selected\" flag is checked after)\n\t\tp_obj,\n\t\tp_obj_sub,\n\t\te_ret, //the element to return\n\t\tp\n\n\tp = p_tree[0]\n\n\t//checks if the conditions are meet along with the ch...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
fill the grids' value array from binarilazation array
function usePixelFillGrids(){ for(let i = 0; i < pixelVal.length; i++){ for(let j = 0; j < pixelVal[i].length; j++){ let zone = int(j / 2); let x = i; let y = j % 2; instrumentGrids[zone].grid[x][y] = pixelVal[i][j]; } } pixelFillFlag = false; console.log(pixelVal); for(let i =...
[ "function setValueGrid(startRow, startCol, w, h, val) {\n for (var i = startRow; i < startRow + h; i++) {\n for (var j = startCol; j < startCol + w; j++) {\n grid[i][j] = val;\n }\n }\n}", "function newGrid() {\n for (var i = 0; i < gridCol; i++) {\n grid[i] = [];\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
float FontGlobalScale; // = 1.0f // Global scale all fonts
get FontGlobalScale() { return this.native.FontGlobalScale; }
[ "useFontScaling(scale) {\n this.element.value = this.fontSizeScale.indexOf(scale);\n document.documentElement.style.fontSize = scale * this.baseSize + 'px';\n this.update(this.element.value);\n }", "function decreaseFont(){\r\n\tbody = document.getElementById('fontChange');\r\n\tstyle = window.getComput...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Dispatches event which will cause a fetch to cange pinned value
emitPinChange() { const eventName = "site-pin-change"; const eventPayload = { pinned: this.pinned, siteId: this._site }; this._element.dispatchEvent(new CustomEvent(eventName, { detail: eventPayload, bubbles: true })); }
[ "function handleMonitorRequest(pin) \n{\n // save the argument value pin into a variable pin1\n pin1 = pin;\n \n // save state variable that indicates that a pin monitor is requested\n monitorRequested = true;\n}", "dispatchEntryChangedEvent_() {\n const deletedEntries = [];\n const createdEn...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This is a function for deleteV3ProjectsIdMergeRequestsMergeRequestIdAwardEmojiAwardId
deleteV3ProjectsIdMergeRequestsMergeRequestIdAwardEmojiAwardId(incomingOptions, cb) { const Gitlab = require('./dist'); let defaultClient = Gitlab.ApiClient.instance; // Configure API key authorization: private_token_header let private_token_header = defaultClient.authentications['private_token_header']; pr...
[ "deleteV3ProjectsIdMergeRequestsMergeRequestIdNotesNoteIdAwardEmojiAwardId(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['privat...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The calTotalSalary function calculates the all of the employees' salaries and converts it to monthly
function calTotalSalary (employeeArray) { var totMonthSalary = 0; for (var i = 0; i < employeeArray.length; i++){ var empSalary = employeeArray[i].base_salary; // console.log(empSalary, totMonthSalary); totMonthSalary += parseInt(empSalary) / 12; // console.log('totMonthSalary = ', totMonthSalary);...
[ "calculateMonthlySalary() {\n let monthlySalary = this.annualSalary / 12;\n return monthlySalary;\n }", "function salarytoMonthly($payRateVal, weeksPerYear){\n salaryPerMonthUnrounded = $payRateVal / 12;\n salaryPerMonth = salaryPerMonthUnrounded.toFixed(2);\n return salaryPerMonth;\n}", "function sal...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function: doExitMgen Description: Exit from the monster generator Close the bottom window and resolve unsaved changes.
function doExitMgen() { // For now, just close the window $('#monsteredit').slideUp(); }
[ "function doTileExit() {\n\tremoveEventListeners();\n\tif (verboseDebugging){\n\t\tconsole.log(\"in doTileExit debugging\");\n\t\tconsole.log(\"this is good\");\n\t}\n\tmessageDiv.style.display = \"none\";\n\tpasswordDiv.style.display = \"none\";\n\n\t//make sure to return repromptPassword flag to default if change...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
deletes cupcake from api database and from cupcakes array
async function deleteCupcake() { const id = $(".cupcakes").attr("id"); const filtered = cupcakes.filter((cupcake) => cupcake.id == id); const cupcake = filtered[0]; await cupcake.deleteCupcake(); showMessage("Cupcake deleted.") cupcakes = cupcakes.filter((c) => c.id != id) restoreCupc...
[ "function deleteCrop(crop) {\r\n let tableName = crop.name.replace(\" \", \"_\");\r\n let sqlStatement1 = `DELETE FROM crop_has_lab_results WHERE crop_id = ${crop.id}`;\r\n let sqlStatement2 = `DELETE FROM crop WHERE id = ${crop.id}`;\r\n let sqlStatement3 = `DROP TABLE ${tableName}_k_map, ${tableName}_...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add a child to this.
addChild(child) { this._children.append(child); }
[ "add (child) {\n this.contents.push(child);\n child.parent = this;\n }", "function addChild(child) {\n if (typeof child.setHeightChangeCallback != \"undefined\")\n child.setHeightChangeCallback(recalcHeight);\n\n var index = getToggledIndex();\n if (index == -1) {\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
read file system item as fxy.Item
get read_item(){ return this.Item.read }
[ "async function getQItem() {\n const bearer = await helpers.getBearerToken();\n const item = await helpers.getItem(itemUrl, bearer);\n return item;\n}", "async getItem(...selects) {\n const q = this.listItemAllFields;\n const d = await q.select(...selects)();\n if (d[\"odata.null\"]) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
FUNCTION: ServerBehavior.setPriority DESCRIPTION: This function sets the priority value for this server behavior. This number is used to resolve conflicts, when a number of SBs claim the same node. See the deleteIfAlreadyReferenced function. ARGUMENTS: priorityNumber integer a number from 1 to 10, with 1 being the high...
function ServerBehavior_setPriority(priorityNumber) { if (priorityNumber > 0 && priorityNumber <= 10) { this.priority = priorityNumber; } }
[ "function ServerBehavior_getPriority()\n{\n return this.priority;\n}", "async storiesSetStoryPriority (socket, data, reply) {\n\n\t\t// Make sure the client passed in safe values.\n\t\tconst itemId = String(data.itemId);\n\t\tconst breakingNewsMessageText = String(data.messageText);\n\t\tconst isPriority = Boole...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds the appropriate page controls depending on whether or not there are new comments or any comments at all.
function addPageControls() { let $container = document.querySelector('td.subtext') if (!$container) { log('no container found for page controls') return } if (hasNewComments) { addNewCommentControls($container) } else if (commentCount > 1) { addTimeTravelCommentControls(...
[ "function setUpCommentTextBoxControls() {\n\n //Updates the current length of the comment on the max length label. Horizontal area.\n $('#horizontal-comment-expanded-container').on('keyup', 'textarea', function () {\n var textLabel = $('#horizontal-comment-expanded-container label');\n var textB...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Give user warning dialog to choose if they want to remove schedule.
function removeSchedule() { var $clickedEvent = $(".fc-event-clicked"); if ($clickedEvent.length) { // Ensure event to remove has been clicked $removeScheduleBtn.css("display", "none"); $removeBtnConfirmContainer.css("display", "block"); } }
[ "function removeSchedule() {\r\n // Disable the scheduling buttons while talking to the server.\r\n changeScheduleButtons(false);\r\n\r\n // Request the server removes the current schedule.\r\n jQuery.post(ajaxurl, {\r\n action : 'tw-ajax-schedule-remove',\r\n schedule_id : current_schedul...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Continuation to be forced during showHostRevealQuestionVictory.
showHostRevealHotSeatQuestionVictory_Continuation() { this.serverState.setCelebrationBanner({ header: '', text: MONEY_STRINGS[this.serverState.hotSeatQuestionIndex] }); this.serverState.resetHotSeatQuestion(); // If the hot seat player won the million, the next option should be to say goodb...
[ "function onProceedClick() {\n setDisplayValue('q1');\n updateLastViewed('q1');\n showHideElements();\n}", "function deferredShow() {\n clearTimeout(deferred_timeout);\n deferred_timeout = setTimeout(function () {\n show();\n }, 0);\n }", "function nextQuest...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function removed card object from the deck array and passes the value into the handArr of each player, each player is assigned one card at a time in turn so the outer loop is required. HTML for each card object added to the players section on the page, dealers last card is rendered with hidden class
function dealCards(){ for (var j = 0; j < 2; j++){ for (var i = 0; i < thePlayers.length; i++){ var newCardObj = theDeck.shift(); var newCardHTML = "<div class='card'><span>" + newCardObj.rank + "</span><span class='suit symbol_" + newCardObj.suit + "'></span><span>" + newCardObj.rank + "</span></div>" ...
[ "data_PassOutCards() {\n // ----------------------------------\n // hand out cards\n while (this.masterDeck.length != 0) {\n // ----------------------------------\n // append first card of master deck to playerDeck\n // remove the first card of master deck --> repeat\n for (let deck in ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks every checkBufferInterval ms whether all videos have a buffer to continue playing. If not: player pauses automatically starts automatically playing when enough has been buffered
function setBufferChecker() { bufferChecker = window.setInterval(function() { var allBuffered = true; var currTime = getCurrentTime(masterVideoId); for (var i = 0; i < videoIds.length; ++i) { var bufferedTimeRange = getBufferTimeRange(videoIds[i]); ...
[ "fillBuffer_() {\n if (this.sourceUpdater_.updating()) {\n return;\n }\n\n if (!this.syncPoint_) {\n this.syncPoint_ = this.syncController_.getSyncPoint(this.playlist_,\n this.mediaSource_.duration,\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function to set origin. takes in a name of a port as input. selects the port from localList, overwrites global variable, prints result onto web page.
function setOrigin(name) { let port = localList.pickPortFromName(name); origin = port;//overwrite global variable. originHTML(); route.origin = origin; route.wayPoints = []; //remove all way points. route.ship = ""; route.departureDate = ""; route.eta = ""; route.distCalc(); localStorage.setItem("r...
[ "function setMarkers(portList)\n{\n for (let i = 0; i < portList.length; i++)\n {\n let port = portList[i];\n let coord = new mapboxgl.LngLat(port.lng, port.lat);\n if (i == 0) {map.panTo(coord);} //Using the first port to pan to the country of interest.\n\n let marker = new mapboxgl.Marker({\"color\"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Labels are basic custom Overlays to display some text on the map (yes, I'm also surprised this isn't builtin to the Google Maps API).
function Label(point, text, map) { this.point = point; this.text = text; this.div = null; this.setMap(map); }
[ "function addLabel(location) {\n\tvar position = location.geometry.location;\n\t\n\tplaceMarker(map, location.name, position, true);\n}", "label(text, size = -1) {\n //TODO\n }", "function displayMapTitle(){\n date = formatDate(currentDay, 'long');\n mapDisplayName = visibleMap.charAt(0).toUpperCase...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
MARK ADDED: This is a way to remove all event listeners from all buttons. This should be done every time on the first line of displayMessage or displayPassword to avoid eventListeners from accumulating. Somewhat redundant with the new selfremoving functions above.
function removeEventListeners(){ /*console.log("starting arrays for clear"); console.log("remove listeners ok"); console.log(eventListenerMsgBtnOk); console.log("remove listenerscancel"); console.log(eventListenerMsgBtnCancel); console.log("remove listenerspassword ok"); console.log(eventListenerPwdBtnOk); con...
[ "function _removeEvents() {\n BUTTON.removeEventListener('click', open, false);\n MODAL_CLOSE.forEach((item) => item.removeEventListener('click', close, false));\n document.removeEventListener('keydown', _bindKeyPress, false);\n }", "_removeUserInputListeners() {\n if (!this._resumeContextCallbac...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Equivalent to calling `resetFit()` and `fit()`. Useful to call this after the element or the `fitInto` element has been resized, or if any of the positioning properties (e.g. `horizontalAlign, verticalAlign`) is updated. It preserves the scroll position of the sizingTarget.
refit() { const scrollLeft = this.sizingTarget.scrollLeft; const scrollTop = this.sizingTarget.scrollTop; this.resetFit(); this.fit(); this.sizingTarget.scrollLeft = scrollLeft; this.sizingTarget.scrollTop = scrollTop; }
[ "_updateBounds() {\n if (this.autoShrink || this.size === 0) {\n if (this.sections.length) {\n this.bounds.left = Number.MAX_SAFE_INTEGER\n this.bounds.right = Number.MIN_SAFE_INTEGER\n this.bounds.top = Number.MAX_SAFE_INTEGER\n th...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
useful for counting the number of items in composite and noncomposite items
function countNumberOfSubItems(item) { if (defined(item.items)) { return item.items.length; } else { return 1; } }
[ "function num_items(name)\n{\n\tvar item_count = character.items.filter(item => item != null && item.name == name).reduce(function(a,b){ return a + (b[\"q\"] || 1);\n\t}, 0);\n\t\n\treturn item_count;\n}", "getCount(callback) {\n let count = {\n active: 0,\n completed: 0,\n total: 0\n }\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Rotate to default before animation
function defaultRotate() { d3.transition() .duration(1500) .tween("rotate", function() { var r = d3.interpolate(projection.rotate(), [0, 0]); return function(t) { projection.rotate(r(t)); context.clearRect(0, 0, mapWidth, mapHeight); context.beginPath(); ...
[ "startRotation() {\n this._options.rotation.enable = true;\n }", "function faireTourner(){\n var positionInitial = maVoiture.style.transform; \n document.querySelector('.voiture').style.transform = positionInitial + 'rotate(90deg)';\n voitureRotate = !voitureRotate \n }", "handleRotateClick()...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
databaseConnection() is used to connect to Database Input:Nil Output:Connects to the database and returns the connection object
function databaseConnection() { // Given the username and password, // connect to the Database. var connection=mysql.createConnection({ host :'localhost', user :'root', password :'root123', }); return connection; }
[ "function getDatabase() {\n return new Database(config.database.uri);\n}", "function connect(poolConfig) {\n return new Db(pg.Pool(poolConfig));\n}", "connectionString () {\n const { url, protocol = 'mongodb', host, port, database } = this.config\n\n if (url) {\n return url\n }\n\n retu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Constructs a new `FormArray` from the given array of configurations, validators and options.
array(controlsConfig, validatorOrOpts, asyncValidator) { const controls = controlsConfig.map(c => this._createControl(c)); return new FormArray(controls, validatorOrOpts, asyncValidator); }
[ "domainValidationOptions(index) {\n return new AcmCertificateDomainValidationOptions(this, 'domain_validation_options', index);\n }", "static fromArray (as) {\n return new Signal(emit => {\n as.map(apply(emit.next))\n emit.complete()\n })\n }", "registerAttributeValidators() {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function to update particles as it disappear
function updateParticles() { // Updated for( var i = 0; i < particles.length; i++ ) { particles[i].update(); } // Remove dead particles for( var i = particles.length -1; i >= 0; i-- ) { if( particles[i].lifeSpan < 0 ) { particles[i].die(); particles.spl...
[ "function updateParticles() {\n\t\tfor (var p= particles.length-1; p>= 0;p--)\n\t\t{\n\t\t\tparticles[p].moves++;\n\t\t\tparticles[p].x += particles[p].xunits;\n\t\t\tparticles[p].y += particles[p].yunits;\n\t\t\tparticles[p].life--;\n\n\t\t\tif (particles[p].life <= 0 )\n\t\t\t{\n\t\t\t\tparticles.splice(p,1);\n\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Resets source tracking state by first clearing all tracked data, then queries and synchronizes SourceMembers from the associated org. If a toRevision is passed, it will query for all `SourceMembers` with a `RevisionCounter` less than or equal to the provided revision number. When no toRevision is passed, it will query ...
async reset(toRevision) { // Called during a source:tracking:reset this.setServerMaxRevision(0); this.initSourceMembers(); let members; if (toRevision != null) { members = await this.querySourceMembersTo(toRevision); } else { members = awai...
[ "clearSourceSearch() {\n this.sourceQuery = '';\n this.sourceCategoryResults.length = 0;\n }", "async trackSourceMembers(sourceMembers = [], sync = false) {\n let quiet = false;\n if (sourceMembers.length > 100) {\n this.logger.debug(`Upserting ${sourceMembers.length} SourceMembers...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
stageProfileEdits is passed into child components where the value can be edited and saved. It updateds the profileEdits property, which will be saved when you call saveUserProfile()
stageProfileEdits(callback) { callback(this.profileEdits); // //uncomment to see what's being staged when you edit a field // console.log(this.profileEdits); }
[ "function editProfile() {\n var pageMeta;\n var accountPersonalDataAsset;\n var Content = app.getModel('Content');\n\n if (!request.httpParameterMap.invalid.submitted) {\n app.getForm('profile').clear();\n\n app.getForm('profile.customer').copyFrom(customer.profile);\n app.getForm('...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets instance properties regarding sex chromosomes. Currently only supported for mammals. TODO: Support all sexually reproducing taxa XY sexdetermination (mammals): Male: XY < heterogametic Female: XX ZW sexdetermination (birds): Male: ZZ Female: ZW < heterogametic X0 sexdetermination (some insects): Male: X0, i.e. onl...
setSexChromosomes(chrs) { if (this.config.ploidy !== 2 || !this.config.sex) { return; } var ideo = this, sexChrs = {X: 1, Y: 1}, chr, i; ideo.sexChromosomes.list = []; for (i = 0; i < chrs.length; i++) { chr = chrs[i]; if (ideo.config.sex === 'male' && chr in sexChr...
[ "initDrawChromosomes(bandsArray) {\n var ideo = this,\n taxids = ideo.config.taxids,\n ploidy = ideo.config.ploidy,\n taxid,\n chrIndex = 0,\n chrSetNumber = 0,\n bands,\n i, j, chrs, chromosome, chrModel,\n defs, transform;\n\n defs = d3.select(ideo.selector + ' defs')...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
updateStaffGroups once everything is parsed, figure out how to group the staves
updateStaffGroups() { this.systems = []; this.staffGroups.forEach((staffGroup) => { const len = this.smoStaves[staffGroup.start].measures.length; const startSelector = { staff: staffGroup.start, measure: 0 }; const endSelector = { staff: staffGroup.start + (staffGroup.length - 1), meas...
[ "function getGroupInfo(){\n // Snorlax OP\n var groupInfoArray = []; // (Name, ID, Requests)\n // AJAX HERE\n $.ajax({\n url: \"https://hackforums.net/usercp.php?action=usergroups\",\n cache: false,\n success: function(response) {\n if (!$(response).find(\"Groups You Lead...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Category Wise Customer Sale Report
function categorySaleWiseCustomer() { var input = document.getElementById('catId12'), list = document .getElementById('catId_drop12'), i, catId; for (i = 0; i < list.options.length; ++i) { if (list.options[i].value === input.value) { catId = list.options[i].getAttribute('data-value'); } } va...
[ "function CSRSaleWiseCustomer() {\r\n\tvar input = document.getElementById('csrcatId'), list = document\r\n\t\t\t.getElementById('csrcatId_drop'), i, csrcatId;\r\n\tfor (i = 0; i < list.options.length; ++i) {\r\n\t\tif (list.options[i].value === input.value) {\r\n\t\t\tcsrcatId = list.options[i].getAttribute('data-...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Upsert a row. Only supports id constraint errors for now.
async upsert (record: {[string]: any}, client: ?PoolClient): Row { if (!record.id) { return this.insert(record) } return wrapTransactionOptional(this.db, client, async client => { const fields = Object.keys(record) const columns = await this.__safeColumns(fields) const nonIdColumns =...
[ "function upsert(kind, row) {\n if (row.id && ! _.isNumber(row.id)) {\n throw new Error('Id must be number');\n }\n\n var entity = store[kind];\n\n\n if (! entity) {\n console.log('Creating new kind:', kind);\n entity = store[kind] = {nextId: 0, rows: []};\n }\n\n var found = false;\n\n if (! _.isUn...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
helper function for going to correct edit event page url.
function goToeditEventPage(owner,docId){ window.location.href = "/edit-event1.html?owner=" + owner + '&docId=' + docId; }
[ "function editBook(id) {\n window.location.href = window.location.origin + '/book/' + id + '/edit'\n}", "function onEntryAction(evt) {\n if ($(this).hasClass(\"edit\")) {\n zdPage.navigate(\"edit/existing/\" + $(this).data(\"entry-id\"));\n //window.open(\"/\" + zdPage.getLang() + \"/edit/existing/\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Product Object construction with functions to check Attributes, get country attributes and get output
function product(obj){ this.product = obj; this.searchAttr = function (str, subStr){ var escapeWords = ['℮']; var searchValue=_.chain(subStr) .upperCase() .words() .without(_.join(escapeWords,',')) .value...
[ "function CountryObj(country) {\n this.name = country.name;\n this.region = country.region;\n this.subregion = country.subregion;\n this.capital = country.capital;\n this.langauges = country[\"languages\"][0][\"name\"];\n this.population = country.population;\n this.currencies = country.currencies[0][\"symbo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function pushSlot: push the element in Arr2 into the sorted Arr1 in right order (least to greast) arr1 [1,5,6,9] arr2 [4] return [1,4,5,6,9]
function pushSlot(arr1, arr2) { if (arr2[0] <= arr1[0]) { arr1.unshift(arr2[0]); } else if (arr2[0] >= arr1[arr1.length - 1]){ arr1.push(arr2[0]); } else { for (let k = 0; k < arr1.length; k++){ if (arr2[0] <= arr1[k]){ arr1.splice(k, 0, arr2[0]); ...
[ "push(element){\n\t\tthis.size++;\n\t\tthis.q2.push(element);\n\t\twhile(this.q1.length > 0)\n\t\t\tthis.q2.push(this.q1.shift()); // shift is same as dequeue\n\t\t//swap q1 and q2\n\t\tlet q = this.q1;\n\t\tthis.q1 = this.q2;\n\t\tthis.q2 = q;\n\t}", "function move(a1, a2){\n a2.push(a1[a1.length-1]);\n a1...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Transform raw TSV text into array of differential expression gene objects
function parseDeFile(tsvText, isAuthorDe=false) { const deGenes = [] const tsvLines = tsvText.split(newlineRegex) for (let i = 1; i < tsvLines.length; i++) { const tsvLine = tsvLines[i] if (tsvLine === '') {continue} if (!isAuthorDe) { // Each element in this array is DE data for the gene in thi...
[ "function parse_gtfsfile(data) {\n let _data = data.split(\"\\n\");\n let _parsed_result = [];\n _data.forEach(element => {\n _parsed_result.push(element.split(\",\"));\n });\n return _parsed_result;\n}", "function parseTransformArray(model) {\n var first = null;\n var node;\n var p...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Override the specified graph options to fit the requirements of an overview
function prepareOverviewOptions(graphOptions){ var overviewOptions = { series: { shadowSize: 0, lines: { lineWidth: 1 }, points: { // Show points on overview only when linked graph does not show // lines...
[ "graph(options) {\n return this.appendChild(new Graph(options));\n }", "function drawOptions() {\n\t\t\tvar ui = newElement('div', { id: 'adi-opts-view', class: 'adi-hidden' }),\n\t\t\t\thead1 = newElement('span', { class: 'adi-opt-heading' }),\n\t\t\t\thead2 = newElement('span', { class: 'adi-opt-headi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add the epilogue to the Epilogue modal
function addEpilogueEntry(epilogue) { var num = epilogues.length; //index number of the new epilogue epilogues.push(epilogue); var player = epilogue.player; var nameStr = player.first + " " + player.last; if (player.first.length <= 0 || player.last.length <= 0) { nameStr = player.first + player.last; //o...
[ "function doEpilogueModal() {\n if (SENTRY_INITIALIZED) {\n Sentry.addBreadcrumb({\n category: 'ui',\n message: 'Showing epilogue modal.',\n level: 'info'\n });\n }\n\n clearEpilogueList(); //remove any already loaded epilogues\n chosenEpilogue = null; //reset any currently-chosen epilogue\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Read an identifier or keyword token. Will check for reserved words when necessary.
function readWord() { var word = readWord1(); var type = _name; if (!containsEsc && isKeyword(word)) type = keywordTypes[word]; return finishToken(type, word); }
[ "function readToken(data, input, token, stack, group) {\n var state = 0, groupMask = 1 << group, dialect = stack.cx.dialect;\n scan: for (var pos = token.start;;) {\n if ((groupMask & data[state]) == 0)\n break;\n var accEnd = data[state + 1];\n // Check whether thi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Is this an iterator?
function _is_iterator(x) { return (x != null && typeof x.next === "function"); }
[ "getIterator(obj) {\n for (var item = this._head; item; item = item.next) {\n if (item.data === obj) {\n return new Iterator(this, item);\n }\n }\n }", "function any( iterable )\n {\n var res = false;\n \n foreach(function (x)\n {\n if ( x )\n {...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds an item to the list. If there is already an item with same key, the function returns false and doesn't make any changes. Otherwise, it returns true.
add(key, item, toFirstPosition) { if (!_.isString(key)) throw new Error('Parameter "key" must be a string!'); if (key in this.dictionary) return false; this.dictionary[key] = this.linkedList.add(item, toFirstPosition); this.dictionary[key].dictKey = key; return true; }
[ "function addItem(item){\n basket.push(item);\n return true;\n}", "function conditionalPush(list, item) {\n\t//If you're wondering why I chose j here, blame dynamic scope.\n\t//If I had used i instead, getUsers() and conditionalPush would be sharing the same value for i, despite being in separate functions.\n\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Scrape details for shirts and store data in csv file
function scrapeShirtDetails(hrefs){ for (var i = 0; i < hrefs.length; i++) { // loop through all shirt urls found in website entry point var url = WEBSITE_URL+"/"+hrefs[i].href; scrapeIt(url,{ // scrape shirt details shirtData: { li...
[ "function scrapeShirtUrls(){\n var request = scrapeIt(ENTRY_POINT_URL, {\n shirtsHrefs: {\n listItem: \".products li\",\n data: {\n href: {\n selector: \"a\",\n attr: \"href\"\n }\n }\n }\n }).then(({ data, response }) => {\n if (response.statusCode === 200)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
promisify(fn, [receiver]) Convert a function that expects a callback into a function that returns a Promise fn: A nodestyle asynchronus function: A nodestyle asynchronus function is a function which accepts a regular/irregular nodestyle callback function as a final argument A nodestyle callback function is a function e...
function promisify(fn, thisArg) { var thisArgProvided = (arguments.length >= 2); if (typeof fn !== 'function') { throw new TypeError('A function must be provided for promisification'); } function promisifiedAsyncFn() { //expects same ar...
[ "function promisify(f) {\n return function(...args) {\n return new Promise((resolve, reject) => {\n function callback(err, result) {\n if (err) {\n reject(err);\n } else {\n resolve(result);\n }\n }\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
show all roles function
function showAllRoles() { query = 'SELECT * FROM role;'; connection.query(query, (err, results) => { if (err) throw err; console.table(results); // return to main menu askUser(); }); }
[ "getAllEntities() {\n let queryParameters = {};\n let headerParams = this.defaultHeaders;\n let isFile = false;\n let formParams = {};\n return this.execute('GET', '/api/user/v1/role/get-all', queryParameters, headerParams, formParams, isFile, false, undefined);\n }", "async ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Retrieves a `Key` for a token.
static get(token) { return _globalKeyRegistry.get(resolveForwardRef(token)); }
[ "function deriveKey(N, token) {\n // the exact bits of the string \"hash_derive_key\"\n const tagBits = sjcl.codec.hex.toBits(\"686173685f6465726976655f6b6579\");\n const h = new sjcl.misc.hmac(tagBits, sjcl.hash.sha256);\n\n const encodedPoint = sec1EncodePoint(N);\n const tokenBits = sjcl.codec.byt...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Aggregate a chosen data field
function simpleAggregateField(data, aggField, compareField, item){ var total = 0; for (var i = 0; i < data.length; i++) { if (data[i][compareField] == item){ total += data[i][aggField]; } } return total; }//simpleAggregateField
[ "getDataWithFields() {\n for (const prop in this.req.files) {\n for (let i = 0; i < this.req.files[prop].length; i++) {\n this.data.push({\n ...this.filesUploaded.splice(0, this.sizes.length),\n });\n }\n }\n\n return this.groupByFields(\n this.data.map((file) =>\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
getDocumento Retorna el binario de archivo. (Recuerda inicializar correctamente con .files[0] en el constructor)
getDocumento() { return this.binario; }
[ "function getFileObject(filePathOrUrl, cb) {\n getFileBlob(filePathOrUrl, function(blob) { //fn2 //llama a la funcion getFileBlob con el url introducido y una funcion que: \n cb(blobToFile(blob, '' + $$(\"#nuevocodigo\").val() + '.jpg')); //ejecuta nuestro cb (callback) sobre el blob con nombre y...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The |absoluteIconUrl| parameter controls whether to use a relative or absolute url for the test.
function runSuccessTest(absoluteIconUrl, manifest) { var iconPath = "extension/icon.png"; var iconUrl = absoluteIconUrl ? makeAbsoluteUrl(iconPath) : iconPath; installAndCleanUp( {'id': extensionId,'iconUrl': iconUrl, 'manifest': manifest }, function() {}); }
[ "get icon_url() {\n return this.args.icon_url;\n }", "get icon_path() {\n return this.args.icon_path;\n }", "function getIconUrl(entry) {\n\tvar url = entry.iconurl;\n\tif (!url)\n\t\t// unknown - relative to HTML\n\t\treturn \"icons/_blank.png\";\n\t\n\t// Used on this device: \n\t// build ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Handle row left click.
_handleLeftClickRow(event) { if (this.view.allowMultipleSelection) { // Wipe everything if ctrl key not selected. if (!event[this._multipleSelectionKey]) { $(event.currentTarget).addClass('active clickable-row').siblings().removeClass('activ...
[ "_handleRowRightClick(event)\r\n {\r\n if (this.view.contextMenu)\r\n {\r\n Radio.channel('rodan').request(RODAN_EVENTS.REQUEST__CONTEXTMENU_SHOW, {top: event.pageY,\r\n left: event.pageX,\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Recursive sliding menu with plus/minus icons for toggling / Delete numbers in the chapter
function toggle_recursive() { var menu = $(this) if (menu.is('li')) { var ul = menu.children("ul"); var has_ul = (ul.length > 0); if (ul.length > 0) { var link = menu.children("a"); link.css({ "position": "relative", }).before( $('<i class="fa fa-ca...
[ "function showSection(path) {\n path.shift();\n var wrapper = $('.manual .chapter-content .sub-section-wrapper');\n $.each(path, function(i, num) {\n var item = $(wrapper).children('.sub-section-item').get(num);\n $(item).trigger('click');\n wrapper = $(item).next().next();\n })\n}", "function displa...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Rescales the sprites of all visible tiles when zooming and panning.
rescaleTiles() {}
[ "function setSizes() {\n if (!currentMap) return;\n\n const viewMaxWidth = canvasElement.width - dpi(40);\n const viewMaxHeight = canvasElement.height - dpi(40);\n const tileWidth = Math.floor(viewMaxWidth / currentMap.cols);\n const tileHeight = Math.floor(viewMaxHeight / currentMap.rows);\n\n tileSize = Mat...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
TODO: Shield reaction does not work for adding onto another person. Intercept item usages via emoji reactions.
static async onReaction(reaction, user) { // Confirm reaction is shield before processing. if (RAW_EMOJIS.SHIELD !== reaction.emoji.name) return false; // Do not conflict with sacrifice. if (reaction.message.channel.id === CHANNELS.SACRIFICE.id) return false;...
[ "function healingPotionMacro() {\n const speaker = ChatMessage.getSpeaker();\n let actor;\n if (speaker.token) actor = game.actors.tokens[speaker.token];\n if (!actor) actor = game.actors.get(speaker.actor);\n\n if (actor) {\n const currentDamage = parseInt(actor.data.data.characteristics.heal...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Injects fields we need for tracking stats about existing Post Notes
function post_notes_prep_input_trackers() { // we need to track how many Notes we've got jQuery('#post').append('<input type="hidden" name="post_notes_note_count" id="post_notes_note_count" value="'+post_notes_count+'" />'); jQuery('#post').append('<input type="hidden" name="post_notes_max" id="post_notes_max" value...
[ "function eventInfoPrepper(body){\n var event_id = (body.event_id) ? body.event_id : null;\n var user = (body.user_id) ? body.user_id : null;\n var start = (body.start_datetime) ? body.start_datetime : null;\n var end = (body.end_datetime) ? body.end_datetime : start;\n var title = (body.title) ? bod...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Removes an object from the THREE scene
removeObject(object) { this.scene.remove(object); }
[ "function clearScene() {\n var obj;\n for( var i = scene.children.length - 1; i > 3; i--) {\n obj = scene.children[i];\n scene.remove(obj);\n }\n}", "onRemovedFromScene() {\n if (this._pixiObject !== null)\n this._pixiContainer.removeChild(this._pixiObject);\n if (this._threeObject !== null) t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Assigns the global features to the given glyphs
assignGlobalFeatures(glyphs) { for (let glyph of glyphs) { for (let feature in this.globalFeatures) { glyph.features[feature] = true; } } }
[ "get Glyphs() {\r\n const glyphs = new ImVector();\r\n this.native.IterateGlyphs((glyph) => {\r\n glyphs.push(new ImFontGlyph(glyph)); // TODO: wrap native\r\n });\r\n return glyphs;\r\n }", "_addFeatures(features, global) {\n let stageIndex = t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return any constant statements that are shared between all uses of this `EmitScope`.
getConstantStatements() { const importGenerator = new LinkerImportGenerator(this.ngImport); return this.constantPool.statements.map(statement => this.translator.translateStatement(statement, importGenerator)); }
[ "function renderConstantPool(sourceFile, constantPool, imports) {\n var printer = ts.createPrinter();\n return constantPool.statements.map(function (stmt) { return transform_1.translateStatement(stmt, imports); })\n .map(function (stmt) { return printer.printNode(ts.EmitHint.Unspecified, st...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
update helpers Update a given state store (this.state or this.appState), with option to 'cascade' the update across other linked components
_updateStore(stateUpdate, options = {}) { const {cascade, store} = options; if (!this.initialized) { // just update store without patching DOM etc Object.assign(this[store], stateUpdate); } else { // update DOM, router, descendants etc. const updateHash = `$fragment` in stateUpdate &...
[ "update ( data ) {\n this.store.update(data);\n }", "updateSelfAndChildren(stateUpdate, options = {}) {\n if (!this.initialized) {\n return;\n }\n\n const {store, cascade} = options;\n Object.assign(this[store], stateUpdate);\n if (store !== `state` || this.shouldComponentUpdate(null, this...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
redraws cigar lines on genes in case of reference gene changed
function redrawCIGAR() { ranked = false; rank() var json = syntenic_data; if (json.ref) { gene_list_array = [] var core_data = json.member; var max = 0; var keys = []; var ptn_keys = []; for (var k in core_data) keys.push(k); for (var k in js...
[ "drawProcessedAnnots(annots) {\n var chrMargin, chrWidth, layout,\n annotHeight, triangle, circle, r, chrAnnot,\n x1, x2, y1, y2,\n filledAnnots,\n ideo = this;\n\n chrMargin = this.config.chrMargin;\n chrWidth = this.config.chrWidth;\n\n layout = 'tracks';\n if (this.config.annot...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets all values in the provided config map for the specified stack name. LocalWorkspace writes the config to the matching Pulumi..yaml file in Workspace.WorkDir().
setAllConfig(stackName, config) { return __awaiter(this, void 0, void 0, function* () { let args = ["config", "set-all", "--stack", stackName]; for (const [key, value] of Object.entries(config)) { const secretArg = value.secret ? "--secret" : "--plaintext"; ...
[ "async function setGlobalLocalGitConfigs(config) {\n\n\t// Log setting global and local configs\n\tLog.spacer();\n\tLog.info('Setting global and local git configs...');\n\n\t// Set global and local configs\n\tconst { stdout, stderr } = await exec(`git config --global user.name ${config.username}; git config --globa...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Inserts a node into the DOM above the github conversation.
function insertAboveConversation(node) { let threadNode = document.getElementById('discussion_bucket'); threadNode.parentNode.insertBefore(node, threadNode); }
[ "function insertBefore(newNode, referenceNode){\n referenceNode.parentNode.insertBefore(newNode, referenceNode);\n}", "_addMessageNode(messageNode, nextNode = null) {\n if (nextNode) {\n this.container.insertBefore(messageNode, nextNode);\n } else if (this.left > 0) {\n this.container.insertBef...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks if li.show elements equal the length of the active phrase without space to return if wincondition have been met
checkForWin(){ // checking if <li> elements have a class 'hide letter' if (document.querySelectorAll("#phrase li.show").length === game.activePhrase.phrase.replace(/\s/g, "").length) { return true; } else { return false; } }
[ "function checkOperationLength() {\n if (displayEl.textContent.length > 10) {return false;}\n}", "function hideLongLists(btn, lst, showNum) {\n if (showNum < lst.childElementCount) {\n hideElements(btn, lst,showNum);\n }\n}", "function checkLyrics() {\n /* count if any words found */\n var count...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns more accurate results of floatingpoint modulo division E.g.: 0.6 % 0.2 = 0.19999999999999996 modulo(0.6, 0.2) = 0
function modulo(dividend, divisor) { var epsilon = divisor / 10000; var remainder = dividend % divisor; if (Math.abs(remainder - divisor) < epsilon || Math.abs(remainder) < epsilon) { remainder = 0; } return remainder; }
[ "function mod(x, n) {\n return (x % n + n) % n;\n}", "function percentOf(num, num2){\n return (num/num2)*100\n}", "division(a,b) {\n if( b === 0) {\n return 0;\n } else {\n return a/b;\n }\n }", "function divisibleByB(a, b) {\n\treturn a - a % b + b;\n}", "function inv_mod(x,y) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Parses the userdefined entry in options.palette
function parsePalette(palette) { if (typeof palette === 'string') { if (palette.toUpperCase() === 'MATERIAL') { return palettes.MATERIAL; } else if (palette.toUpperCase() === 'W3C') { return palettes.W3C; } else if (palette.toUpperCase() === 'CSS') { return palettes.CSS; } throw ...
[ "get options$palette()\r\n\t{\r\n\t\treturn _.cloneDeep( this._options.palette );\r\n\t}", "function add_to_palette(){\n new_color = $('#color').val();\n box = $('<div>').addClass('color_box');\n $('#palette').prepend(box.css('background-color', new_color));\n $('#color').val('');\n $('#color').focus();\n}",...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Processes a single file using the naming annotation and the naming property in the manifest entry. Determines the name from the file path and naming object and extracts the namespace. Returns the naming object
function nameFile(defaultRoot, fileObj, scriptsDir) { //get the file data and trim leading and trailing line breaks var data = stringTrim(fileObj.data, "\\r?\\n") , naming = annotation.lookup("naming", data) || {} //get the naming annotation, default empty obj // get the namespace root starting with the...
[ "function annotationFilename() {\n let url = location.pathname;\n let basename = url.split(\"\\\\\").pop().split(\"/\").pop().split(\".\")[0];\n\n // decker filenames vs. Mario filenames\n let filename;\n if (basename.endsWith(\"-deck\"))\n filename = basename.substring(0, basename.length - 5) +...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns whether or not the audio is finished playing.
isFinished() { if (this.audio !== null && (typeof (this.audio) !== null) && this.audio !== undefined) { return this.audio.ended; } return null; }
[ "isPlaying() {\n if (this.audio !== null && (typeof (this.audio) !== null) && this.audio !== undefined) {\n if ((this.audio.currentTime === this.audio.duration && this.audio.loop === false) || (this.audio.currentTime === 0) || (this.isFinished())) {\n return false;\n }\n return true;\n }...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the total cost of all transactions.
getTotalCost() { return this.transactions.map(t => t.cost).reduce((acc, value) => acc + value, 0); }
[ "function totalPrice(){\n\t\t\t\tvar totalPrice = 0;\n\t\t\t\tfor (var i in cart){\n\t\t\t\t\ttotalPrice += cart[i].price;\n\t\t\t\t}\n\t\t\t\treturn totalPrice;\n\t\t\t}", "function total() \n{\n // create var to store total\n var total = 0\n \n // check if there are items in the cart:\n if(cart.length > 0)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
CODING CHALLENGE 605 Given an array of numbers, return true if the sum of the array is less than 100; otherwise return false.
function arrayLessThan100(arr) { return arr.reduce((x, i) => x + i) < 100; }
[ "function passOrFail(array) {\n // let pass = false;\n // if (array >= 75) {\n // pass = true;\n // }\n let pass = array.map((x) => x >= 75);\n return pass;\n}", "function greaterThanSum(nums) {\n\tlet a = 0;\n\tfor (let i = 0; i < nums.length; i++) {\n\t\tif (a >= nums[i]) return false;\n\t\ta +=...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the platform ID if it has been specified, false if it wasn't
function getPlatformId(){ return getURLParameter('platform'); }
[ "function isRBMPlatform (currentPlatform) {\n return currentPlatform == HIGH_DIMENSIONAL_DATA[\"rbm\"].platform ? true : false;\n}", "function detectPlatform () {\n var type = os.type();\n var arch = os.arch();\n\n if (type === 'Darwin') {\n return 'osx-64';\n }\n\n if (type === 'Windows_NT') {\n re...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
it handles the pickup instructions open and collapsed
handlepickupInstructions() { this.setState({ pickupInstructionStatus: !this.state.pickupInstructionStatus }); }
[ "function _closeOpenManager() {\n $('#Roadin-step-manager--opener').click(function(e) {\n if($(this).hasClass('ion-ios-arrow-up')) {\n $(this).removeClass('ion-ios-arrow-up');\n $(this).addClass('ion-ios-arrow-down');\n $('.Roadin-step-manager').css({\n 'bottom' : 3...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
gets valid video categories from YouTube
function getCategories(setText){ var request = gapi.client.youtube.videoCategories.list({ part: 'snippet', regionCode: 'US', }); request.execute( function(response){ //if network error, let user know without the option to try loading //new comments, because we have no categories...
[ "getYouTubeCategoryVideos(category) {\n axios.get(`https://www.googleapis.com/youtube/v3/search?part=snippet&regionCode=us&relevanceLanguage=en&type=video&videoEmbeddable=true&videoCategoryId=${category}&key=AIzaSyB_q0TEto5sFJBMzgqPB8uGFkzByakfoJI`)\n .then(response => {\n this.setS...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
event function to handle sidebar screen resizing.
function resizeSideBar(e) { var w = window.innerWidth; var h = window.innerHeight - parseInt(window.getComputedStyle($("ul")).height); var s = (w > h ? h : w); // side bar height $("#Sidebar").style.height = h + "px"; }
[ "_handleResize(e) {\n this.resizeToolbar();\n }", "onResize() {\n App.bus.trigger(TRIGGER_RESIZE, document.documentElement.clientWidth, document.documentElement.clientHeight);\n }", "function handleWindowResize() {\r\n width = window.innerWidth;\r\n}", "function ResizeHandler() {\n setMaxWindo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Visit a parse tree produced by Python3Parservarargslist.
visitVarargslist(ctx) { console.log("visitVarargslist"); // TODO: support *args, **kwargs let length = ctx.getChildCount(); let returnlist = []; let comma = []; let current = -1; if (ctx.STAR() === null && ctx.POWER() === null) { for (var i = 0...
[ "visitTypedargslist(ctx) {\r\n console.log(\"visitTypedargslist\");\r\n // TODO: support *args, **kwargs\r\n let length = ctx.getChildCount();\r\n let returnlist = [];\r\n let comma = [];\r\n let current = -1;\r\n if (ctx.STAR() === null && ctx.POWER() === null) {\r\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks if a net has a probe of given type
function hasProbeType(netId , type){ if (!type) type = DEFAULT_SAMPLE_TYPE; // Do we have the net and a valid probe? if ((!__IndexProbesByNet[netId]) || (!__IndexProbesByType[type])) return []; return _.intersection(__IndexProbesByType[type] , __IndexProbesByNet[netId]); }
[ "_hasDamage(type) {\n if (type === \"weapon\") {return true};\n // if (!this.data.data.causeDamage) {return false};\n if (type === \"power\" && this.data.data.causeDamage === true) {return true};\n return false;\n }", "checkNetwork(network){}", "tracking_block(type) { return this....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Insert the provided nodes after the current one. When inserting nodes after an expression, ensure that the completion record is correct by pushing the current node.
function insertAfter(nodes) { this._assertUnremoved(); nodes = this._verifyNodeList(nodes); if (this.parentPath.isExpressionStatement() || this.parentPath.isLabeledStatement()) { return this.parentPath.insertAfter(nodes); } else if (this.isNodeType("Expression") || this.parentPath.isForStatement() &&...
[ "function insert_elt_after(new_elt, old_elt){\n old_elt.parentNode.insertBefore(new_elt, old_elt.nextSibling);\n}", "function insertAfter(parent, insert, node)\n{\n\tif (insert != null)\n\t{\n\t\tparent.insertBefore( node, insert.nextSibling );\n\t}\n\telse\n\t{\n\t\tparent.insertBefore( node, parent.firstEle...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
validateNumeric makes sure that the user is supplying only positive numbers for their inputs
function validateNumeric(value) { // Value must be a positive number var number = (typeof parseFloat(value)) === 'number'; var positive = parseFloat(value) >= 0; if (number && positive) { return true; } else { return 'Please enter a positive number for the unit price.' } }
[ "validateInputs() {\n\t\tif(isNaN(this.billAmount) || this.billAmount <= 0 || this.totalPerson == 0) return false;\n\t\treturn true;\n\t}", "function isNumber (input) {\n \t\treturn typeof input === \"number\" && !isNaN(input); \n }", "function checkForNumber(min, max, avg) {\n if ((isNaN(min)) || (isNaN(m...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
handleErr is a helper to handle err in cb. If any callback returns an err this function is called. This function deletes the chat from the state so the user is able to start over.
handleErr(err, errCode, msg, bot, Bot) { console.log(err.message); const reply = ` Oops, I did something wrong! Please contact the admin, error code ${errCode}... Don't give up on me though. `; state.deleteChat(msg.chatId, (err) => { if (err) return this.sendMsg(`Yikes, fatal c...
[ "killConnection(err) {\n if (this._isClosed)\n return;\n this._isClosed = true;\n if (this._connectionTimeout != null)\n clearTimeout(this._connectionTimeout);\n if (this.udp != null) {\n // keep the error handler around or we ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Extract variables from an include element
function extractIncludeVariables(includeElement, contextVariables) { const includedVariables = { ...contextVariables }; Object.keys(includeElement.attribs).forEach((attribute) => { if (!attribute.startsWith('var-')) { return; } const variableName = attribute.replace(/^var-/, ''); if (!included...
[ "function extract_include( element ) {\n\tvar inner_text=element.innerText; // 'include virtual=\"included.html\"'\n\treturn( inner_text.replace(\"include virtual=\\\"\",\"\") // 'included.html'\n\t .replace(\"\\\"\",\"\"));\n}", "function getVariables(){\n\t\t// return str.exec...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Funkcija za azuriranje koliko smo sedista izabrali.
function azurirajBrojIzabranihSedista(){ const izabranaSedista = document.querySelectorAll(".red .sediste.izabrano"); // Ove linije koda radim posle svih ovih drugih (Zakljucno sa linijom koda 33. Prvo sam napravio sve, pa sam onda napravio za local storage. // Prvo kopiram izabrana sedista u niz. Onda...
[ "function Zidovi(sirina, boja) {\n//function napravi_zidove(sirina, boja) {\n// ova funkcija ucrtava zidove u igracki prostor i postavlja njihovo polje/parametre. sirina definira\n// sirinu zidova u pikselima, boja je css string koji govori o njihovoj boji. Ako zelis/ne zelis zid na donjem bridu\n// moras u ovoj fu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds the Flipping/Spinning a Coin's (Bitcoin's) Experiment to the Scene (Flipping/Spinning a Coin's (Bitcoin's) Experiment Scene)
function add_flipping_spinning_bitcoin_to_scene() { flipping_spinning_bitcoin_pivot = new THREE.Group(); // Loading manager loadingManager = new THREE.LoadingManager( function() { flipping_spinning_bitcoin_pivot.add(flipping_spinning_bitcoin_collada); } ); // C...
[ "shop() {\n // this sets the current scene to \"shop\"\n this.current = \"shop\";\n \n // this draws the floor\n background(148, 82, 52);\n \n //this draws the shelves\n for (let i = 0; i < 4; i++) {\n this.vShelf(50 + this.pxl * 3 * i, 400);\n }\n \n for (let i = 0; i < 2; i++...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
add details of paid teams to notification email
function paid_teams_notification () { var arrayLength = L_paid_teams.length; if (arrayLength==0) { L_email_html += "<b>No teams updated in database paid</b><br><br>"; } // else output the paid teams info else { for (var i=0; i< arrayLength; i++) { // get team code var team_code = L_paid_teams[i]; ...
[ "function new_teams_notification ()\n{\n\tvar arrayLength = L_new_teams.length;\n\tif (arrayLength==0)\n\t{\n\t\tL_email_html += \"<b>No new teams added to database</b><br><br>\";\n\t}\n\t\n\t// else output the new teams info\n\telse\n\t{\n\t\tfor (var i=0; i<arrayLength; i++) \n\t\t{\n\t\t\t// get team code\n\t\t\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
to put mask on Bill no.
function putMask_BillNo(aField) { var lstrValue = aField.value; var finalString = ''; if(lstrValue.length==8){ // Curtailing Blank spaces from the begining and end of the entered text lstrValue = trimString(lstrValue); lstrValue = lstrValue.toUpperCase(); finalString = lstrValue.substring(0...
[ "draw_with_mask(mask)\n {\n for (let i = 0; i < 4; i++)\n for (let j = 0; j < 4; j++)\n if (mask[i][j] === 0 || this.numbers[i][j] === 0)\n {\n let grid = new FilletRectangle(width / 2 - height / 2 + j * (gap + grid_size) + gap, i * (gap + grid_s...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Identifies the medication being requested. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications.
get medicationReference() { return this.__medicationReference; }
[ "getMedications(patientGuid) {\n return _patients.default.getClinicalData(patientGuid).then(function (aggregate) {\n return aggregate.medications;\n });\n }", "static get __resourceType() {\n\t\treturn 'MedicationRequestDispenseRequest';\n\t}", "editMedication(medicat...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Forwards side a Foreign Key: returns one object. Also works as forwardsOneToOneDescriptor.
function forwardManyToOneDescriptor(fieldName, declaredToModel) { return { get: function get() { var toId = this._fields[fieldName]; if (typeof toId !== 'undefined' && toId !== null) { return declaredToModel.withId(toId); } return undefi...
[ "function resolveHasOneMetadata(relationMeta) {\n if (!type_resolver_1.isTypeResolver(relationMeta.target)) {\n const reason = 'target must be a type resolver';\n throw new errors_1.InvalidRelationError(reason, relationMeta);\n }\n if (relationMeta.keyTo) {\n // The explict cast is nee...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Internal: Compute the resampled measure values for a required position in run
function YDataRun_computeValues(int_pos) { // if there is no data stream, exit immediately if(this._streams.length == 0) { this.invalidValue(int_pos); return; } // search for the earliest stream with useful data for requested measure var nextAvail, st...
[ "function calculateXScaleAndValuesShown() {\n var zoomPointDistanceFromGraphLeftEdge = zoomX - leftMargin;\n var leftPortion = zoomPointDistanceFromGraphLeftEdge / graphWidth;\n var rightPortion = 1 - leftPortion;\n \n var measurementIndex = convertXToMeasurementIndex(zoomX);\n var nrO...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Retrieve the URL to fetch binary. If environment variable SASS_BINARY_URL is set, return that path. Otherwise make path using current release version and binary name.
function getBinaryUrl() { return flags.binaryUrl || package.nodeSassConfig ? package.nodeSassConfig.binaryUrl : null || process.env.SASS_BINARY_URL || ['https://github.com/sass/node-sass/releases/download//v', package.version, '/', sass.binaryName].join(''); }
[ "function asset(url){\n if(url.match(/^(?:https?\\:)\\/\\//)) return url;\n else return 'assets/' + url;\n}", "async resolveAlternativeBinaryPath(platform) {\n const compatiblePlatforms = knownPlatforms.slice(1).filter(p => get_platform_1.mayBeCompatible(p, platform));\n const binariesExist = awai...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sweep the range between d1 and d2 looking for DST transitions. Iterate the range by "by" unit. When a transition is detected, sweep the range between before/after dates by increasingly smaller unit, month then date then hour then minute then finally second.
function sweepRange(d1, d2, by, rule) { var upperBound = d2.getTime(); var d = new Date(); d.setTime(d1.getTime()); var prevD = new Date(); prevD.setTime(d.getTime()); var prevOffset = d1.getTimezoneOffset() * -1; // initialize rule if (!rule) { rule = { clientId: AjxTimezone.AUTO_DETECTED, ...
[ "function DateDiff(dint, thedate1, thedate2, fdow) {\n var vbUseSystemDayOfWeek=0; var vbSunday=1; var vbMonday=2; var vbTuesday=3; var vbWednesday=4; var vbThursday=5; var vbFriday=6; var vbSaturday=7;\n if(!CvDate(thedate1)){ return null; }\n if(!CvDate(thedate2)){ return null; }\n fdow = (isN...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function to select adopters to populate the adopter page. Selects all information from adopters, and LEFT JOINS on dogs to calculate the number of dogs each adopter has adopted using COUNT()
function getAdopters(res, mysql, context, complete) { mysql.pool.query("SELECT Adopters.id, fname, lname, saddress, city, state, zip, phone, COUNT(d.id) as nad FROM Adopters LEFT JOIN Dogs d ON Adopters.id = d.adoptedBy GROUP BY Adopters.id", function (error, results, fields) { if (error...
[ "function getDirectorList(){\n\t\tvar dlc = 0; // director list counter\n\n\t\tfor (var i = 0; i < teamList.length; i++) {if (distinct.indexOf(teamList[i].director) === -1){distinct.push(teamList[i].director);}}\n\n\t\tdistinct.sort(sortDirector);\n\n\t\tfor(x = 0; x < distinct.length; x++) {\n\t\t\tif (distinct[x]...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Initialise les actions pour la popup intersticielle
function initPopupIntersticielle() { var popup = $("#popupIntersticielle"); // Clic sur ignorer popup.find("#ignorePopupIntersticielle").on('click', function() { popup.hide("blind"); }); // Clic sur plus tard popup.find("#laterBtn").on('click', function() { ...
[ "function init_hot_popup() {\n $('.popap.p_type2').find('.close3').unbind('click');\n $('.popap.p_type2').find('.close3').click(function() {\n $(this).parent().removeClass('opened');\n $(this).parent().arcticmodal('close');\n });\n\n //$('.otel_btn').unbind('click')...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Save Report Functions ////////////////////////////////// opens save and save as dialogs
function processSaveReport(){ var ContentFrame = findFrame(getTopWindow(),"metricsReportContent"); if (ContentFrame.validateReport()){ var footerFrame = $bmId('divPageFoot'); pageControl.setWrapColSize(footerFrame.children[0].WrapColSize.value); if(pageControl.getSavedReportName() == "" ...
[ "function save() {\n dialogOut.dialog( \"close\" );\n }", "save() {\n if (this.properties.saveCallback) {\n this.properties.saveCallback();\n } else if (this.properties.localStorageReportKey) {\n if ('localStorage' in window && window['localStorage'] !== null) {\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check if this is a video track.
isVideoTrack() { return this.getType() === MediaType.VIDEO; }
[ "equals(video) {\n if(video && video instanceof Video && video.id === this.id) {\n return true;\n }\n return false;\n }", "static isVideoPlaying(video){return video.currentTime>0&&!video.paused&&video.readyState>2;}", "function isPlaying() {\n return (videoEl.currentTime > 0 && !videoEl.paus...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }