query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
TODO: check if THREE.examples.SkeletonUtils offers a way to clone (functional) skeleton copies | function _decoupledSkeletonClone(skeleton, container) {
var backup = skeleton.clone();
var old2new = {};
backup.bones = backup.bones.map((x)=>{
var bone = backup[x.name] = x.clone(false);
bone.$parent = (x.parent&&x.parent.name);
bone.$$children = x.children.map((x)=>x.uuid);
... | [
"function flattenSkeleton(skeleton) {\n\n var list = [];\n var walk = function(parentid, node, list) {\n\n var bone = {};\n bone.name = node.sid;\n bone.parent = parentid;\n bone.matrix = node.matrix;\n var data = [ new THREE.Vector3(),new THREE.Quaternion(),new THREE.Vector3() ];\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handles shift home key. | handleShiftHomeKey() {
this.extendToLineStart();
this.checkForCursorVisibility();
} | [
"handleControlShiftHomeKey() {\n let documentStart = undefined;\n if (!isNullOrUndefined(this.owner.documentStart)) {\n documentStart = this.owner.documentStart;\n }\n if (!isNullOrUndefined(documentStart)) {\n this.end.setPositionInternal(documentStart);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handles moving all enemy projectiles to their next position | function moveEnemyProjectiles(modifier, list) {
list.forEach(function (ship) {
//move projectiles
incrementProjectilePosition(ship.cannonShotList, modifier);
//move projectiles
incrementProjectilePosition(ship.missileList, modifier);
});
} | [
"function handleProjectiles(){\n for(let i = 0; i < projectiles.length; i++){\n projectiles[i].update();\n projectiles[i].draw();\n\n for (let j = 0; j < enemies.length; j++){\n if (enemies[j] && projectiles[i] && collision(projectiles[i], enemies[j])){\n enemies[j]... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The function to write the results | function writeResults() {
logger.trace("Starting to write results to file");
// A boolean to indicate if the writing is backed up
var writeOK = true;
// Loop over the rows wa... | [
"function write() {\n var text = JSON.stringify(results, null, 2);\n fs.writeFileSync(out, text);\n}",
"function writeResults() {\n fs.writeFileSync(path.resolve(__dirname, 'results.json'), JSON.stringify(results, null, ' '), 'utf8');\n}",
"function writeResults(name) {\n console.log(\"Writing result... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
String: trim() Write a function firstChar, which returns the first character that is not a space when a string is passed. Example: firstChar(' Jurassic Parks ') should return 'J'. | function firstChar(name) {
let clearName = name.trim();
let fChar = clearName.charAt(0);
return fChar
} | [
"function firstChar(str) {\n return str.trim();\n}",
"function firstChar(name) {\n var trimName = name.trim();\n return trimName.charAt(0);\n}",
"function firstChar(text) {\n // Trim first.\n let x = text.trim();\n // Then use the\n // charAt method.\n return x.charAt(0);\n}",
"function firstChar(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets filters for the given element and store them in a cache for later use | function getFilters(element) {
var id = element.attr('databind-id');
var filters = filtersCache[id];
if(!filters) {
filters = [];
var filterEls = element.children('twx-data-filter');
angular.forEach(filterEls, function (el) {
... | [
"function getFilter(element) {\n while (element !== filtersElement) {\n if (hasClass(element, 'filter')) {\n return element;\n }\n element = element.parentNode;\n }\n return null;\n }",
"function getFilterFromElement(el){\n var filterId = el.data(\"id\"),\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Finds the backend factory registered under the provided name. Returns a function that produces a new backend when called. Returns null if the name is not in the registry. | function findBackendFactory(name) {
return engine_1.ENGINE.findBackendFactory(name);
} | [
"function findBackendFactory(name) {\n return _engine.ENGINE.findBackendFactory(name);\n}",
"function findBackendFactory(name) {\n return ENGINE.findBackendFactory(name);\n}",
"function findBackendFactory(name) {\n return ENGINE.findBackendFactory(name);\n}",
"function findBackendFactory(name) {\n ret... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
PagePara is the value that is shown on client's screen. So need to be changed. Return value of this function is the real zeroIndex index of the desired page. | function getZeroIndexPage(pagePara, totalPagesPara)
{
if (pagePara <= 1 ) {return 0; }
else if (pagePara >= totalPagesPara -1) {return totalPagesPara -1;}
else {return pagePara - 1; }
} | [
"_getPageIndexForPageXYValues (pageX, pageY)\n {\n //get the four edges of the outer element\n const outerOffset = this.viewerState.outerElement.getBoundingClientRect();\n const outerTop = outerOffset.top;\n const outerLeft = outerOffset.left;\n const outerBottom = outerOffset.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
INDIVIDUAL FIELD FUNCTIONS Car year must be a number. Car year must be after 1900. Car year cannot be in the future. Date parking must be in the future. Number of days must be a number. Number of days must be between 1 and 30. CVV must be a threedigit number. | function checkCarYear(){
if(isNaN(carYear.value)){
markInvalid(carYear);
errorMessages.push("car year must be a number")
} else if (carYear.value<1900){ //EVAL RELATIVE TO 1900
markInvalid(carYear)
errorMessages.push("car year must be after 1900")
} else if (currentTime.isBefore(carYear.value)){ /... | [
"validateCarInfo(car)\n {\n //if(!validator.matches(car.make,/(^[A-Z a-z \\s\\d'-]{3,24}$)/))\n if(car.make === undefined || !validator.matches(car.make,/(^[\\p{L} \\s\\d'-]{3,24}$)/ugi))\n return \"Invalid car make !\"; \n if(car.model === undefined || !validator.matches(car.model... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
TODO: Shorten the number of lines in function 'redundantBlock' to 1 line. | function redundantBlock(statement) {
if (statement === true) {
return true;
} else {
return false;
}
} | [
"function redundant(block, t) {\n \"use strict\";\n var b = blocks[block],\n validated = getPath(getHtml(b), t),\n bt,\n h,\n k,\n bcell,\n bchar,\n disp,\n found,\n changed = false;\n if (mode > 0) {\n return false;\n }\n if (vali... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds the missing days before the first event in order to make sure that events align | function addMissingDaysFirstEvent() {
while(facebookData[0].start_time.getTime() != (new Date(membersPerDay[0].key)).getTime()) {
let prevDay = new Date(facebookData[0].start_time);
prevDay.setDate(facebookData[0].start_time.getDate() - 1);
let tempObj = {start_time: prevDay, id: "", attending_count: 0, i... | [
"function addMissingDays() {\n membersPerDay.sort(sortMembersPerDay);\n let length = membersPerDay.length - 1;\n for(let i = 0; i < length; i++) {\n membersPerDay[i].key = new Date(membersPerDay[i].key);\n membersPerDay[i].key.setHours(1);\n let nextDay = new Date(membersPerDay[i].key);\n nextDay.set... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to populate the table & tree selects | function populate_selects() {
d3.json(arborapi+"/projmgr/project/" + project + "/PhyloTree", function (error, trees) {
trees.unshift("Select...");
d3.select("#vis_tree").selectAll("option").remove();
d3.select("#vis_tree").selectAll("option")
.data(trees)
.enter().append("option")
.text(... | [
"function populateTableSelects() {\n // The table select elements\n var tableSelectInputs = $('.table-select-input');\n\n // Add tables to select inputs\n var optionsString = buildTableOptions(tables);\n tableSelectInputs.append(optionsString);\n\n // Add listener to single table select\n $('#s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
insert new image into user selection | static insertImageIntoUserSelection(url) {
var selection = new Selection();
var img = document.createElement('img');
img.src = url;
selection.insert(img);
EditImage.setImage(img);
return img;
} | [
"function _selectImage () {\n if ($current_image) {\n editor.selection.clear();\n var range = editor.doc.createRange();\n range.selectNode($current_image.get(0));\n var selection = editor.selection.get();\n selection.addRange(range);\n }\n }",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
gets or sets the last line number | get lastLineNumber() {
return this.state.lastLineNumber;
} | [
"putbackLine(){\n const cur = this.#cursor;\n cur.pos = cur.putbackPos;\n cur.lineNo = cur.putbackLineNo;\n }",
"function lineIndex() {\n\treturn (index - charsBeforeThisLine);\n}",
"function gotoLine() {\n\teditor.openDialog('<input type=\"text\" value=\"default\">Line number</input>',\n\t\tfunction ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to reset advanced search options | function resetAS() {
$('input[type="range"]').val("");
$("[data-display]").each(
(el) => ($("[data-display]")[el].textContent = "___")
);
$("#dietarySelect").val("None");
$('[type="checkbox"]').each((el) => {
if ($('[type="checkbox"]')[el].checked === true)
$($('[type="checkbox"]... | [
"function _resetSearch() {\n _searchDom.value = '';\n _resetFilter();\n }",
"function resetAllSearchVals(){\n search_term = '';\n page = 1;\n classFilter = 'collection';\n typeFilter = 'All';\n groupFilter = 'All';\n subjectFilter = 'All';\n gcmdFilter='All'... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Ensure two fields are equal. If corresponding value is absent, valid | function validateEqual(field_value, corresponding_value) {
if (corresponding_value === null || typeof corresponding_value === "undefined") {
return true;
}
return field_value === corresponding_value;
} | [
"function ensureFieldHasChanged (obj1, obj2) {\n return isNullsy(obj1) || isNullsy(obj2)\n ? () => false\n : field => obj1[field] !== obj2[field];\n}",
"isEqual(req, schema, one, two) {\n for (const field of schema) {\n const fieldType = self.fieldTypes[field.type];\n if (!fieldTyp... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Iterates through all of our functions, starting the compile to JobDefinition if needed | function compileBatchTasks() {
const allFunctions = this.serverless.service.getAllFunctions();
return BbPromise.each(
allFunctions,
functionName => compileBatchTask.bind(this)(functionName)
);
} | [
"loadJobDefinitions() {\n this.debug('Loading job definitions:');\n const runNow = [];\n\n fs.readdirSync(this.options.jobDefinitionPath).forEach(file => {\n const jobName = path.basename(file, '.js');\n const jobExports = require(path.format({dir: this.options.jobDefinitionPath, base: file}));\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update the task group's run state and execute the provided callback when complete | update (endCallback) {
let shouldremove, shouldwrite;
const items = Object.values (this.taskMap);
for (const task of items) {
const taskitem = task.getTaskItem ();
const mapitem = this.taskRecordMap[task.id];
shouldwrite = false;
if (mapitem == null) {
shouldwrite = true;
}
else {
if ((... | [
"_taskComplete() {\n if (this.tasks.length > 0) {\n this._run(this.tasks.shift());\n }\n }",
"run() {\n this.updateStatus_(JobStatus.RUNNING);\n }",
"_taskComplete() {\n //\n }",
"taskCompleted() {\n if (--this.numTasks === 0) {\n this.onCompletion();\n }\n }",
"executeNextTa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return an array of items owned by character that are equipped | getEquippedItems(){
//If character does not have an inventory property, character does not have any inventory yet. Return empty array
if (!this.props.inventory) {
return [];
}
let items = this.props.inventory;
return items
.filter( eachItem =>{... | [
"getUnequippedItems(){\n\n //If character does not have an inventory property, character does not have any inventory yet. Return empty array\n if (!this.props.inventory) {\n return [];\n }\n\n //return items\n return this.props.inventory\n .filter( eachItem ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
pair off from best fitness to worst, mate members | mateAll() {
let member1, member2;
for(let i = 0; i <= this.populationSize - 2; i += 2) {
member1 = this.members[i];
member2 = this.members[i+1];
this.members = this.members.concat(this._mate(member1, member2));
}
} | [
"best() {\n let best;\n let fit = 0;\n for(let member of this.population) {\n if(member.fitness > fit) {\n best = member;\n fit = member.fitness;\n }\n }\n return best;\n\n }",
"sort_by_fitness() {\n this.members.sort... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
20160829 JDLP Permet d'afficher ou non les attributs configurables en fonction de "configurator_of" 20160917 JDLP : Adaptation pour frappe V 7 Isolation dans une fonction 20161026 JDLP : Modifications majeures pour utiliser un call en pyhton | function ShowHideAttributes(printDebug, frm, cdt, cdn, reload_defaults, refresh_items) {
if (printDebug) console.log(__("ShowHideAttributes*****************************"));
//var configurator_mode = false;
if (locals[cdt][cdn]) {
var row = locals[cdt][cdn];
var template = ""
if (ro... | [
"function SetConfiguratorOf(printDebug, frm, cdt, cdn) {\r\n if (printDebug) console.log(__(\"SetConfiguratorOf*****************************\"));\r\n\t\r\n\tvar soi = locals[cdt][cdn];\r\n\t\r\n //Si un code à été saisit\r\n if (locals[cdt][cdn] && locals[cdt][cdn].template) {\r\n\t\tif (printDebug) consol... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Builds bytes from bitmap data to build buffer using editor wrapper. Allow selected lines to be passed so that highlighted code can be used to find a variable name (this way not always needing to retype) | exportBitmap(selectedLines){
// This is the default, will try to look at selected lines and
// see if var name that can be used. If one can be used, will
// overwrite and not output framebuffer line
var varName = "bitmap";
var foundName = false; // Used to set true so ... | [
"buildHexView() {\n const { lineNumber, maxLines, bytesPerLine, bytesPerGroup, bitsPerGroup, asciiInline } = this;\n const start = lineNumber * bytesPerLine;\n const chunkData = this.editController.render(start, maxLines * bytesPerLine);\n const chunk = chunkData.out;\n const adde... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This method returns only the running replication jobs, it does not include the rescheduled ones. So, if this method is being used to cancel running jobs, it should be called multiple time until it returns no jobs | async getRunningReplicationJobs() {
let docs = [];
let replicator = this.nano.use(REPLICATOR_DB);
let sched = await this.nano.request({ db: SCHEDULER_DB, path: 'jobs' });
for (const sJob of sched.jobs) {
const repJob = await replicator.get(sJob.doc_id);
docs.push... | [
"cleanIdleJobs() {\n logger.debug(\"Jobs.cleanIdleJobs: called\");\n\n const jobsTypesToRemove = [];\n\n const jobsToRestart = Jobs.find(\n {\n status: \"running\",\n type: {\n $nin: jobsTypesToRemove\n }\n },\n {\n fields: {\n _id: 1\n }\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
add additional space between Chinese and English | function fixChineseSpace(str) {
return str.replace(/([^\u4e00-\u9fa5\W])([\u4e00-\u9fa5])/g, '$1 $2');
} | [
"function chineseletter1(){\n $(\".datafinder\").html(\"甸畃\")\n }",
"function nonsenseChinesePhrase() {\n // U0530 - U18B0 all unicode (lots of trains for some reason)\n // var word = getRandomKatakana() + \" \" + getRandomKatakana() + \" \" + getRandomKatakana();\n var word = getRandomChineseCharacter() +... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Writes a single byte from given input, to the current data cell in the memory Attempts to form the data into a single byte | function writeByte(inputByte) {
inputByte = Math.round(inputByte);
if(inputByte >= 0x00) {
if(inputByte <= 0xFF) {
ram[pointerAddress] = inputByte;
}
else {
// Get the 8 least significant bits by bit-wise and of 8 ones
ram[pointerAddress] = 0xFF & inputByte;
}
}
else {
// ... | [
"writeByte(byte) {\n this.ensure(1);\n this.buffer[this.pos++] = byte;\n }",
"writeByte(value) {\n this.reserve(1)\n this.buf[this.offset] = value\n this.offset += 1\n }",
"write_byte(byte) {\n this.ensure(1);\n this.buffer[this.pos++] = byte;\n }",
"writeByte(value){if(!this.__checkIn... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
create bar chart for only negative values | function createNegativeBarChart(targetData) {
//define chart constants
let svg = d3.select(".chart"),
margin = {top: 70, right: 20, bottom: 40, left: 50},
width = 600 - margin.left - margin.right,
height = 300 - margin.top - margin.bottom,
g = svg.append("g").attr("transform", "translate(" + margin.left + ","... | [
"function fixNegative() {\n var pathindex = 0;\n\n if (numseries == 1)\n {\n for (var i = 0; i < numseries; i++)\n {\n for (var j = 0; j < numcol; j++)\n {\n if (series_array[i][j] < 0)\n {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this functions decides the winning color, sends the information to the clients and then after a set period, allows betting again | function betDecider(callback)
{
if(!betting && tickTime == 20)
{
tickTime = 0;
console.log("Started Cycle");
betting = true;
var time = 0;
var winningColor = Math.floor(Math.random() * 15) + 1;
var numOfCycles = winningColor + 30;
//send out the informati... | [
"function winningColors() {\n\t\tif (wins > losses) {\n\t\t\tdocument.getElementById(\"wins\").style.color = \"green\";\n\t\t\tdocument.getElementById(\"wins\").style.fontSize = \"larger\";\n\n\t\t} else if (wins === losses){\n\t\t\tdocument.getElementById(\"wins\").style.color = \"black\";\n\t\t\tdocument.getEleme... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Called when "Save" button in Stop Point frame is clicked | function saveButtonOnClick(ev)
{
let stopPointInfo = getCurrentStopPointInfo();
//console.log("saveButtonOnClick(", ev, "): name ", stopPointInfo.name);
let savedStopPoints = generateStopPointsToSave(stopPointTable, stopPointInfo);
storage.setStopPoints(savedStopPoints);
} | [
"function saveClicked() {\n _save(false);\n }",
"function savedStopPointOnClick(ev, row)\n{\n\tlet info = storage.getStopPoints();\n\tsetCurrentStopPointInfo( { name: \"\", info: info } );\n\tresetSavedStopPointFrame();\n\tresetSearchFrame();\n\tdisplayStopPointInfo(info, true);\n\tstopPointOnClick(ev, ro... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Edit a team record | editTeam (teamId, key, value) {
console.log('editTeam:', teamId, key);
let user = Auth.requireAuthentication();
// Validate the data is complete
check(teamId, String);
check(key, String);
check(value, Match.Any);
// Validate that the current user is an administrator
if (user.is... | [
"function editTeam(teamId) {\n let serial = `teamid=${teamId}&` + $(\"#editTeamForm\").serialize();\n\n \n $.ajax({\n type: \"PUT\",\n url: `/api/teams`,\n data: serial\n })\n .done(function() {\n //alert(\"Edit team successful!\");\n location.reload... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update single wallet transaction record | updateWalletTransaction(idTransaction, payload) {
return this.request.put(`transaction/${idTransaction}`, payload);
} | [
"update(transaction) {\n let amount = transaction.output.amount;\n let from = transaction.input.from;\n console.log('New amount staked ' + amount)\n this.addStake(from, amount);\n }",
"async changeDataTransaction(ctx, \n transactionID, \n cargoOwner,\n loadingPo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Call Web API to get a list of all entries | function entryList() {
$.ajax({
url: '/api/Lent/',
type: 'GET',
dataType: 'json',
success: function (entrys) {
entryListSuccess(entrys);
},
error: function (request, message, error) {
handleException(request, message, error);
}
});
... | [
"getAll() {\n meteredGET(\n '/api/items',\n () => this.dispatchServerAction(kActions.ITEM_GETALL, kStates.LOADING),\n data => this.dispatchServerAction(kActions.ITEM_GETALL, kStates.SYNCED, data),\n err => this.dispatchServerAction(kActions.ITEM_GETALL, kStates.ERRORED, err)\n );\n }",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Responder System: A global, solitary "interaction lock" on a view. If a node becomes the responder, it should convey visual feedback immediately to indicate so, either by highlighting or moving accordingly. To be the responder means, that touches are exclusively important to that responder view, and no other view. Whil... | function setResponderAndExtractTransfer(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
var shouldSetEventType = isStartish(topLevelType) ? eventTypes.startShouldSetResponder : isMoveish(topLevelType) ? eventTypes.moveShouldSetResponder : topLevelType === 'topSelectionChange' ? eventTypes.selectionChangeS... | [
"function setResponderAndExtractTransfer(topLevelType, targetInst, nativeEvent, nativeEventTarget) {\n\t var shouldSetEventType = isStartish(topLevelType) ? eventTypes.startShouldSetResponder : isMoveish(topLevelType) ? eventTypes.moveShouldSetResponder : topLevelType === EventConstants.topLevelTypes.topSelectionC... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Displays the status bar tile | function _displayStatusBarTile() {
if (!_statusBar) {
_displayStatusBarItemOnConsumption = true
return
}
if (_statusBarTile) {
return
}
_statusBarElement = document.createElement("autocomplete-paths-status-bar")
_statusBarElement.innerHTML = "Rebuilding paths cache..."
_statusBarTile = _statu... | [
"function displayStatusBar() {\n push();\n // the bar (BG)\n rectMode(CORNER);\n textSize(32);\n fill(255);\n rect(0, 0, width, height / 20);\n fill(0);\n // info\n textAlign(LEFT, CENTER);\n text(\"@GM\", 48, height / 48);\n textAlign(RIGHT, CENTER);\n time = \"\";\n // convert month into string\n if... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
addHero(package) adds a new hero to the map based on the package settings | function addHero(package){
dungeon._initHero(package);
dungeon._placeHero();
drawMap();
} | [
"function addHero( newHero ) {\n\t\tvar keyLength = countHero( );\n\t\t\n\t\tlet key \t = \"hero\" + (keyLength + 1);\n\t\t_heroes[key] = newHero;\n\t}",
"function AddHero(heroName) {\n if (heroName.toLowerCase() != heroName) {\n heroName = HeroLocalToOfficial(heroName);\n }\n var html = \"\";\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
newID function is used to create random ID, when new account is created | function newID() {
return (Date.now() + ( (Math.random()*100000).toFixed()));
} | [
"function newId() {\n return Math.floor((Math.random() * 900000) + 100000);\n }",
"function createNewId() {\n onIdSubmit(uuidV4());\n }",
"function _getNewID(){\n \n // Rendiamo il nostro id univoco\n var now = new Date().getTime();\n \n return signatur... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Turn the given MailChimp form into an ajax version of it. If resultElement is given, the subscribe result is set as html to that element. | function ajaxMailChimpForm($form, $resultElement) {
// Hijack the submission. We'll submit the form manually.
$form.submit(function (e) {
e.preventDefault();
if (!isValidEmail($form)) {
var error = "A valid email address must be provided."... | [
"function ajaxMailChimpForm($form, $resultElement) {\n\n // Hijack the submission. We'll submit the form manually.\n $form.submit(function(e) {\n e.preventDefault();\n if (!isValidEmail($form)) {\n var error = \"A valid email address must be provided.\";\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
bind datapicker after modal shown | function afterModelShown() {
$('.input-group.date.start').datepicker({
format: 'dd-mm-yyyy',
autoclose: true
}).on('changeDate', function (e) {
compareDate(e.date, $(this));
});
$('.input-group.date.end').datepicker({
format: 'dd-mm-yyyy',
autoclose:... | [
"function BindDatePicker(elem) {\n elem.removeClass('hasDatepicker');\n elem.datepicker({\n format: DEFAULT_DATE_PICKER_FORMAT,\n changeMonth: true,\n changeYear: true,\n endDate: 0,\n maxViewMode: 2,\n defaultDate: new Date(),\n minDate: MIN_PRODUCTION_DATA_DA... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
check if a file is a video | function isVideoFile(file) {
if (file.type.slice(0, 5) === 'video') {
return true
}
return false
} | [
"function isVideo (file) {\n return mediaExtensions.video.includes(getFileExtension(file))\n}",
"function isVideoType() {\n let filename = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n if (!filename) return false;\n return filename.startsWith('data:video/') || VIDEO_EXTENSIONS.incl... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
utilities get the id from the url (substracting the id at the end of it) | function idFromUrl(url) {
var last3 = url.slice(-3);
if (last3[0] === "/") return url.slice(-2)
if (last3[1] === "/") return url.slice(-1);
return last3;
} | [
"function getUrlId() {\n\tlet url = getUrlString();\n\tlet id = url.slice(url.length - 1, url.length);\n\treturn id;\n}",
"function getID(url) {\n // We can use API to fetch the ID by passing Slug as a argument\n var arrayURL = url.split(\"-\");\n var id = arrayURL[arrayURL.length - 1];\n return id;\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initialize the configuration list data table. | function initDataTable(){
$('table#configurations').DataTable({
paging: false,
info: false,
filter: false,
searching: false,
ordering: true,
rowId: 'uid',
"order": [[ 2, "desc" ]],
columns: [
{data: '... | [
"InitList() {\r\n this._data = [];\r\n }",
"initRelatedLists() {\n if ($('table[data-filter-type=\"related-list\"]').length == 0) {\n return\n }\n\n this.relatedListDatatables = {}\n\n $('table[data-filter-type=\"related-list\"]').each((index, el) => {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
format the date that is used to group the results | function formatGroupingDate(dateString)
{
var theDate = new Date(dateString);
var dayOfWeek = getDayOfWeek(theDate.getDay());
var formatted = dayOfWeek+" "+theDate.toLocaleDateString();
return formatted;
} | [
"function dateFormatter() {\n\t\t\t\tfor (var index = 0; index < $scope.selectedCard.comments.length; index++) {\n\t\t\t\t\tvar each = $scope.selectedCard.comments[index];\n\t\t\t\t\teach.date = $filter('date')(each.date, 'dd MMM yyyy');\n\t\t\t\t}\n\t\t\t}",
"function formatDate(date, format) {\n\t\tvar dd = dat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Output of sekeleton documentation for all packages. Usage: rstAllPackages() | function rstAllPackages() {
for (let package of AllPackages.concat(extraPackages)) {
rstConfiguration(package, `/tmp/${package}.rst`);
}
} | [
"function buildDocsList() {\n let ary = allPackages.filter(item => {\n return item != 'basic-component-mixins';\n }).map(item => {\n return {src: 'packages/' + item + '/src/*.js', dest: 'packages/' + item + '/README.md'};\n });\n\n return ary.concat(buildMixinsDocsList());\n}",
"function writeAllPackage... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
changing the images on the sleep function for the pet | function sleepSrc() {
const petPicSrc = sleepPet.attr("src");
console.log(petPicSrc);
switch (petPicSrc) {
case "/assets/images/cat1.png":
sleepPet.attr("src", "/assets/images/cat2.png");
break;
case "/assets/images/dog1.png":
sleepPet.attr("src", "/assets/images/dog2.pn... | [
"function changePic() {\n const petPicSrc = sleepPet.attr(\"src\");\n switch (petPicSrc) {\n case \"/assets/images/cat2.png\":\n sleepPet.attr(\"src\", \"/assets/images/cat1.png\");\n break;\n\n case \"/assets/images/dog2.png\":\n sleepPet.attr(\"src\", \"/assets/images/dog1.png... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get collections block. Used by child view. | getCollectionsBlock() {
if (this.loading || this.error !== '') {
return null;
}
const blocks = this.render();
return blocks !== null && blocks.collections !== null
? blocks.collections
: null;
} | [
"getCollectionsBlock() {\n\t if (this.loading || this.error !== '') {\n\t return null;\n\t }\n\t const blocks = this.render();\n\t return blocks !== null && blocks.collections !== null\n\t ? objects.cloneObject(blocks.collections)\n\t : null;\n\t }",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
When the changeMeasure is clicked | function changeMeasure(measure) {
activeMeasure = measure;
if (!HUCMeta[activeMeasure].style.avg) calcAverage(activeMeasure);
geojson.setStyle(Style);
legend.update();
info.update();
var layer = getLayer(activeRecord.id);
updateData(HUCMeta[activeMeasure]);
if (activeRecord.id) highlight... | [
"function changeMeasure() {\n\t// When change the measure, store the new value and re-color the graphs\n\t// based on the new measure.\n\tmeasure = document.getElementById(\"measure_list\").value;\n\tcolorGraph();\n}",
"function selectMeasure() {\n $(getTextSelector()).hide();\n $(current_measure).h... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Passing the list of countries to this function and getting populated by cardview, byt showing Image and name of the Country | function cardHTML(countries) {
var countryCards = ('<div class="row" style="position: absolute; margin-left: 50px; margin-top: 50px" >');
// Looping every cards of data in it...
countries.forEach(country => {
countryCards += `<div class="column" style="margin-right: 20px">
... | [
"function MostrarCountries(countries, region)\n{\n //recorrer con foreach\n var html = '';\n countries.forEach(value => {\n html += `\n <div class=\"card\"> \n <h5 class=\"card-title\"> ${value.name}</h5> \n <img src=\"${value.flag}\" alt=\"${value.name}\" class... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This is a function for createOrUpdateAnnotation / Creates or updates an individual annotation for the specified report. Annotations are individual findings that have been identified as part of a report, for example, a line of code that represents a vulnerability. These annotations can be attached to a specific file and... | createOrUpdateAnnotation(incomingOptions, cb) {
const Bitbucket = require('./dist');
let apiInstance = new Bitbucket.ReportsApi(); // String | The account // String | The repository // String | The commit the report belongs to // String | Either the uuid or external-id of the report // String | Either the uuid... | [
"createAnnotation (text, increment) {\n const Annotation = Parse.Object.extend(ANNOTATIONS_TABLE)\n let annotation = new Annotation()\n annotation.set('text', text)\n annotation.set('numTrue', 0)\n annotation.set('numFalse', 0)\n return this.updateAnnotation(annotation, increment)\n }",
"create... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
checkRoundWinner Checks for a round winner | function checkRoundWinner() {
var activePlayer = players[activePlayerIndex];
var boardScores = getCurrentBoardRowScores();
var winningScoreValue = activePlayer.scorePoints * 3;
var isWinningCombination = boardScores.indexOf(winningScoreValue) > 0;
if (isWinningCombination) {
activePlayer.winningRounds++;... | [
"determineRoundWinner() {\n if (this.playerRoll === this.computerRoll) {\n this.gameResults.textContent = 'DRAW';\n return;\n }\n // Player logic\n if ((this.playerRoll === 1 && this.computerRoll === 2) || // Rock beats scissors\n (this.playerRoll === 2 && th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
prompt user for 8 digit number, validate that u have gotten 8 numbers reverses digits print output in alert box | function reverse_fun(){
let arr2=[];
let arr1= parseInt(document.getElementById("input").value);
if(arr1<99999999 && arr1>9999999) {
arr2=rev(arr1);
alert("input: "+ arr1 +"\n"+ "output: " + arr2 + "\n");
}
else{
alert("8 digits required");
}
} | [
"function checkRev(){\n var num = parseInt(document.getElementById(\"rev\").value);\n var temp = num;\n var rev = 0;\n while(num > 0)\n {\n var r = num%10;\n rev = rev*10 + r;\n num = Math.floor(num/10);\n }\n if(temp == rev)\n {\n alert(temp + \" is a palindrome\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Eliminar del calendario los fragmentos no guardados | function borrarFragmentosPendientes() {
try {
var fragmentosNoGuardados = $('.fragmentoCalendarioCreado');
for (var i = 0; i < fragmentosNoGuardados.length; i++) {
if ($(fragmentosNoGuardados[i]).attr('id') == null || $(fragmentosNoGuardados[i]).attr('id') == '') {
$(fra... | [
"function clean() {\n calendar.empty();\n }",
"function dibujarFragmento(diaCalendario, minutosInicio, minutosFin, top, alto, id, idConsultorio) {\n var idstr = '';\n if (id != '' && id != null) {\n idstr = 'id=\"' + id + '\"';\n }\n var idConsultorioStr = '';\n if (idConsultorio != ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Register the default module paths for the approom system. This should be called early before an application (or test) is set up, it basically registers the normal modules of the approom system. If you wanted to use the approom framework in a project and SWAP OUT certain modules, you could do that AFTER calling this fun... | function setupDefaultModulePaths() {
if (didSetup) {
// ignoore secondary call
return;
}
// set flag
didSetup = true;
// initialize it with all of the dependencies in the system
// NOTE: Because of circular dependencies, if we use deferred requirement resolution on the jrequire helper, then the order we de... | [
"function loadModules() {\r\n SmartModule.modules.map(module=>{\r\n addModule(module.moduleName, module.moduleFunction, module.moduleInfo);\r\n })\r\n if(SmartModule.moduleExtensions) {\r\n SmartModule.moduleExtensions.map(module=>{\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
a function for the alert box enter a string message of your choice | function alert_box(string)
{
if (confirm(string) == true)
{
restart_game();
}
} | [
"function alert(msg)\r\n{\r\n Host.GUI.alert(msg);\r\n}",
"function alertMsg(msg) { if(msg.length > 0 && msg != \" \") alert(msg); }",
"function customAlert(msg){\n\n// alert user.\n\n alert(msg);\n\n }",
"function alertInvalid(s){\n alert(\"Invalid Input: \" + s);\n}",
"function personalMessage(u... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Opens a window where the user can upload a audiofile | function uploadAudio()
{
if (songID==-1) {
alert("Sangen skal gemmes før du kan uploade en lydfil");
return;
}
if (document.getElementById('audiofile').innerHTML.indexOf('musikteam.dk/musik/') != -1) {
doit = confirm('Dette vil slette den eksisterende fil, er du sikker?');
if (!doit) return;
}
//... | [
"openUploadMuscleImageWindow(){\n // click on inputFileElement in application template (browse window can only be called from application template)\n document.getElementById('inputMediaFileElement').click();\n }",
"openUploadMuscleImageWindow() {\n // click on inputFileElement in application t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns "Header", "Anchor", or "Expander" based on the element's tag | function getElementType(element) {
let elementType = 'Header';
if (element.is('a')) {
elementType = 'Anchor';
}
if (element.is('button')) {
elementType = 'Expander';
}
return elementType;
} | [
"getTagType(tag) {\n let el;\n switch (tag) {\n\n case \"paragraph\":\n el = \"p\";\n break;\n\n case \"header\":\n el = \"h1\";\n break;\n\n case \"order-list\":\n el = \"ol\";\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Pager's keydown event handler. | _keyDownHandler(event) {
const that = this;
if (that.disabled) {
return;
}
if ((that.enableShadowDOM ? (that.shadowRoot.activeElement || document.activeElement) : document.activeElement) === that.$.navigateToInput) {
return;
}
if (that.$.pageSiz... | [
"paginationClick() {\n document.addEventListener('keydown', (e) => {\n if (e.keyCode === 37 && this.state.page > 1) {\n this.prevPage();\n }\n if (e.keyCode === 39 && this.state.players.length === this.state.sizePerPage + 1) {\n this.nextPage();\n }\n })\n }",
"function ke... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Excluding bet from ABB spread | exclude(bet_id) {
this._child.send({
cmd: 'exclude',
data: bet_id
});
} | [
"function betDisabler() {\n if (curBet >= wallet) {\n curBet = wallet;\n $('.bet').attr('disabled',true);\n } else if (curBet >= wallet - 5) {\n $('#bet5').attr('disabled',true);\n } else if (curBet >= wallet - 10) {\n $('#bet10').attr('disabled',true);\n } else if (c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Helper Functions // //////////////////// songIdToFeaturesObj: The actual object input to the Python ML Process A map/object/dictionary where the keys are the song id and the values are the corresponding features for said song, also an object which maps the feature name to its corresponding raw value | function classifyFeatures(songIdToFeaturesObj, response) {
console.log("songIdToFeaturesObj: " + songIdToFeaturesObj);
console.log("KEYS: " +Object.keys(songIdToFeaturesObj));
var featuresArray = [];
featuresArray.push(songIdToFeaturesObj.loudness)
featuresArray.push(songIdToFeaturesObj.artist_hotness)
fe... | [
"function getTrackFeatures(songList) {\n var trackIds = songList.map(function(song) {\n return song.id;\n });\n var tempSongList = songList;\n spotifyApi.getAudioFeaturesForTracks(trackIds)\n .then(function(data) {\n console.log('got audio features');\n songList.map(function(song, index) {\n temp... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
download only files checked by user | function download()
{
var numOfDownloads = 0;
for (var i = 0; i < linksThatAreFiles.length; ++i)
{
// if file is checked
if (document.getElementById('check' + i).checked)
{
numOfDownloads = numOfDownloads + 1;
// call Chrome download function if files exist
chrome.downloads.downl... | [
"function downloadCheckedLinks(url, index) {\n var saveAs = false;\n if (1 === index) {\n saveAs = true;\n }\n var imgurl = url || document.getElementById('filter').value;\n chrome.downloads.download({\n url: imgurl,\n method: \"GET\",\n saveAs : saveAs,\n conflictAction: \"overwrite\"\n }, fun... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
msg: string type: string duration: boolean | number NOTE: if the duration is false, the toast will be shown forever | function show(msg, type, time) {
var toast = angular.element("#toast_cont");
var content = angular.element("#toast_content");
var duration = time || 5000;
if ((toast.attr('class') == null) || toast.attr('class').indexOf('visible') < 0) {
... | [
"function show(msg, type, duration) {\n var toast = angular.element(\"#notif_cont\");\n var content = angular.element(\"#notif_content\");\n\n if((toast.attr('class') == null) || toast.attr('class').indexOf('visible') < 0) {\n content.html(msg);\n if(type!=null) {\n removeAttr(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Assemble arguments for a provider rule. On top of a regular Angular component rule, the provider rule gets called with the $get function as its 3rd argument. | function assembleProviderArguments(thisGuy) {
return [thisGuy.callExpression, thisGuy, Object.assign({}, thisGuy, { fn: findProviderGet(thisGuy) })];
} | [
"provide(_name, _opts, _fn) {\n return this.addHook('before', parseParams(arguments))\n }",
"constructor() {\n this.providerSet = [];\n\n [\n 'asFactory',\n 'asInstance',\n 'asValue',\n 'cached',\n 'fromContainer'... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
open the cleaned link in an incognito window | function openIncog() {
var input = document.getElementById('input').value;
var link = cleanLink(input);
chrome.windows.create({'url': link, 'incognito': true});
} | [
"function open_insta() {\n window.open('https://www.instagram.com/doringoofficial/', '_blank');\n}",
"function openLink() {\n window.open(link_placeholder);\n return false;\n }",
"function openNormal() {\n var input = document.getElementById('input').value;\n var link = cleanLink(input... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
BlockSensor([String] id) BlockSensor object to contain JMRI block suffixed `id` (e.g. "188", without JMRI_SENSOR_OBJID_PREFIX). | function BlockSensor(id)
{
this.id=id;
this.getAsServerObject=getAsServerSensorObject;
// Make sure title element matches the object ID
//addElementTitle(id, id);
/*if(console != undefined)
{
console.log("Created turnout: " + id);
console.warn("Krikey: a warning: " +... | [
"async getBlockById(blockId) {\n throw new Error(\"Subclass must implement\");\n }",
"function Block(id, x, y, w, h){\r\n\t\tthis.ID = id; // id of the block\r\n\t\tthis.PosX = x; // position x of block\r\n\t\tthis.PosY = y; // position y of block\r\n\t\tthis.Width = w; // block width\r\n\t\tthis.Height = h; ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Helper function that updates the Blocked Shots numbers and graph | function updateBlockedShots()
{
totalBlock = T1.blockedShots + T2.blockedShots;
var t1_bar = Math.floor((T1.blockedShots / totalBlock) * 100);
var t2_bar = 100 - t1_bar;
document.querySelector(".t1-block-shot-num").innerHTML = "<b>" + T1.blockedShots + "</b>";
document.querySelector(".t2-block-sho... | [
"_updateBlockedCounts() {\r\n\t\tthis.blockLinks.each((index) => {\r\n\t\t\tconst currCount = $($(this.blockLinks[index]).children()[0]);\r\n\t\t\tconst currReason = $($(this.blockLinks[index]).children()[1]).html();\r\n\t\t\tcurrCount.html(this.numBlocked[currReason]);\r\n\t\t});\r\n\t}",
"function updateOccupie... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
4.0 Function: Confirm lowercase get password lower choice | function getPasswordLower() {
var userLower = window.confirm("Should the password contain lowercase letters? (Click \"OK\" for Yes, and \"Cancel\" for No).");
console.log(userLower);
passwordLower = userLower;
} | [
"function lowercaseChar() {\n var lc = confirm(\"Would you like a Lowercase letter in your password\");\n isUserSeletedLowerCase = lc;\n return lc;\n}",
"function lowercasePrompt() {\n lowercase = confirm(\"Should your password include lowercase letters?\");\n if (lowercase) {\n possibleChars = possibleCh... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
As the function name implies..it sums the value of object by their keys | function sumObjectsByKey(...objs) {
return objs.reduce((a, b) => {
for (let k in b) {
if (b.hasOwnProperty(k)){
a[k] = (a[k] || 0) + b[k];
}
}
return a;
}, {});
} | [
"function valueSum(obj) {\n return Object.keys(obj).reduce(function(a, b) {\n a += obj[b]; return a;\n }, 0)\n}",
"function sumOfObjects(data, key){\n\tlet total = 0;\n\t$.each(data, function(i, item){\n\t\ttotal += accessValueByKey(data[i], key);\n\t});\n\treturn total;\n}",
"function sum(object) {\n let... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Selectable object provides interaction between Selection and DataTable. | function Selectable(oDTSettings, options) {
this.options = $.extend({}, defaults, options);
this.oTable = oDTSettings.oInstance;
// Add oSelection object to current datatable instance.
this.oSelection = new Selection(this);
this.oDTSettings = oDTSettin... | [
"function Selectable(selection) {\n // jQuery selection for items to control\n this.$selection = $(selection);\n this.limit = undefined;\n }",
"selectTable() {\n if (!this.owner.enableSelection) {\n return;\n }\n this.selectTableInternal();\n }",
"set s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns whether talent is inactive or not | function isTalentInactive(talentId, talentDetails, talentsSpent, talentsSpentDetails) {
var talent = talentDetails[talentId];
// inactive if pre-requisite talent not maxed
var preReqFulfilled = true;
if (talent.requires) {
var maxRank = talentDetails[talent.requires].maxRank;
var curRank = ... | [
"function isInactive(talentId) {\n return talentHelper.isTalentInactive(talentId, scope.talentDetails, scope.talentsSpent, scope.talentsSpentDetails);\n }",
"get inactive () {\n\t\treturn this._inactive;\n\t}",
"booleanActivities(){\n this.becameUnhealthy = false;\n if (this.health <= ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add a task above / below cursor. Unfortunately these options do not exist in agenda mode, so in that case, instead it is added to the current section. | function addAbove() {
addAboveTask(getCursor());
} | [
"insertTask( task ) {\n this.tasks.unshift(task);\n task.owner = this;\n }",
"addCustomTask(options) {\n this.tasks.push({\n name: options.name,\n command: options.command,\n openMode: options.openMode,\n openIn: options.openIn,\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Indicates whether or not we're using a ccxt exchange | isCcxt()
{
return false;
} | [
"isTelecomMode() {\n return RNVoxeetConferencekit.isTelecomMode();\n }",
"function shouldTagRequest(enableExternalReferralProgram, exchange) {\n return enableExternalReferralProgram && exchange === 'ftx';\n}",
"get hasTLS() {\n return \"encrypted\" in this._socket;\n }",
"get hasTLS() {\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Share local variables with the template. They will overwrite the globals | share(data) {
lodash_merge_1.default(this.locals, data);
return this;
} | [
"function templateLocals() {\n return CONFIG;\n}",
"function initTemplateVars() {\n if (body.dataset.type && body.dataset.type === 'plugin') {\n loadFileContent('jira_ticket.tpl', (text) => {\n JIRA_TICKET_TEMPLATE = text\n })\n loadFileContent('gitlab_merge_request.tpl', (te... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
check overall logic of the statement made by user for data feed 1 | function checkLogic_thingful_data_feed_number() {
numThingfulDataFeed = document.getElementById("numbering_thingful_data_feed").value;
if (numThingfulDataFeed == "") { //if no number input in number box
$('#check_logic_status_thingful_data_feed_number').show();
$('#check_logic_status_thingful_data_feed_number'... | [
"async function checkDataFeeds() {\n\tconsole.error('------------>>>>')\n\t// ** update data feeds ** //\n\tcurve_aas_to_estimate.length = 0\n\tlet affected_aas = []\n\tlet oracle_obj_keys = Object.keys(oracles);\n\tfor await (let oracle_obj_key of oracle_obj_keys) {\n\t\tlet oracle = oracles[oracle_obj_key].oracle... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks if a PouchDB object is "remote" or not. This is designed to optin to certain optimizations, such as avoiding checks for "dependentDbs" and other things that we know only apply to local databases. In general, "remote" should be true for the http adapter, and for thirdparty adapters with similar expensive boundari... | function isRemote$1(db) {
if (typeof db._remote === 'boolean') {
return db._remote;
}
/* istanbul ignore next */
if (typeof db.type === 'function') {
guardedConsole$1('warn',
'db.type() is deprecated and will be removed in ' +
'a future version of PouchDB');
return db.type() ===... | [
"function isRemote(db) {\n\t if (typeof db._remote === 'boolean') {\n\t return db._remote;\n\t }\n\t /* istanbul ignore next */\n\t if (typeof db.type === 'function') {\n\t guardedConsole('warn',\n\t 'db.type() is deprecated and will be removed in ' +\n\t 'a future version of PouchDB');\n\t r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Builds the TransactionReceipt according to: ++++++ | Field | Offset | Size | Encoding | Notes | ++++++ | execution_result | 36 | 4 | enum | 0x1 indicates success | | event length | 40 | 4 | uint32 | | | event data | 44 | variable | bytes | | ++++++ | static buildTransactionReceipt(transaction, event, options = {}) {
const eventBuffer = ASBProof.buildEventData(event, options);
const argument_array_length = 12;
return Buffer.concat([
Buffer.alloc(36),
Bytes.padToDword(Bytes.numberToBuffer(transaction.executionResult, UINT16_SIZE)),
Bytes... | [
"getTransactionReceipt(hash) {\n return this.send('eth_getTransactionReceipt', hash).then(_ => !_ ? null : ({\n ..._,\n contractAddress: _.contractAddress && toChecksumAddress(_.contractAddress),\n from: _.from && toChecksumAddress(_.from)\n }))\n }",
"async getTr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
API Request for commission | requestForCommissionAPI() {
if (this.state.text.trim().length > 0) {
this.setState({ spinnerVisible: true })
var reqestParam = {};
reqestParam.user_id = Utility.user.user_id + ''
reqestParam.artist_id = this.state.artist.artist_id + ''
reqestParam.desc... | [
"pledge(_from, _to, _quantity, _cycle, _code='eosio.token', _symbol='EOS', _permission='active') {\n var _asset = _quantity + ' ' + _symbol;\n var _agreement = this._build_agreement(_from, _to, _asset, _code, _cycle);\n return {\n actions: [{\n account: this.config.code.recurringpay,\n n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Main function called by menu item click. Goal: 1) Read column "Email Sent?" and find all rows w/out 'Y' or 'Yes' 2) For each row, get data from columns in getEmailColumnLetters() 3) Send email to RIPS email account | function sendUsers() {
var sheet = SpreadsheetApp.getActiveSheet();
var dataRange = sheet.getDataRange();
// Fetch values & backgrounds in data range (note: gets 2D array)
var data = dataRange.getValues();
// get array of row numbers that have staff info that will be sent in email
var rowIndexArray = getR... | [
"function sendEmails(row,ss,i,signature,examineeEmailColumn, examinerEmailColumn){\n\n var subject = \"RSP \"+row.exam+\" Exam\"; // The subject Line\n var date = Utilities.formatDate(new Date(row.date), 'America/New_York', 'MM/dd/yyyy');\n\n //Message for Examinee\n var examineeEmail = `<p>Your <b>${row.exam} ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
mock string data ten days later | function mockStringData(now,coefficient){
let timeStamps = [] // timeStamps
let values = [] // values
for (let i = 0; i < counts; i++) {
const t = now.add(1, 'second')
const ts = t.unix() + 8 * 3600 // timeStamp
timeStamps.push(ts)
if (t.second() >= 20 && t.second() <= ... | [
"function createStringTests() {\r\n\r\n return crash.test.unit('String Tests', {\r\n\r\n testTrim: function () {\r\n var result = \" \\n\\t\\u00a0trimmed \\n\\t\\u00a0\".trim();\r\n this.assert(result === \"trimmed\", \"trim()#1 failed \\\"\" + result + \"\\\"\");\r\n resu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return the iterable if already an array or use Array.from to create one | function _toArray(iterable) {
if (!iterable)
return [];
if (Array.isArray(iterable))
return iterable;
return Array.from(iterable);
} | [
"function $A(iterable) {\n\tif(!iterable) return [];\n\tif('toArray' in Object(iterable)) return iterable.toArray();\n\tvar length = iterable.length || 0, results = new Array(length);\n\twhile(length--) results[ length ] = iterable[ length ];\n\treturn results;\n}",
"function $A(iterable)\n{\n\tif (!iterable) ret... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
first I will check if the count is 0 if it is the string will retuen as an empty string other wise it return the string and the function will preform on that string and the count will be decrease by 1 until it reaches 0; / Q5 ============================================================================= / using closures... | function makePizza(crust, size , slices){
var pizza = {};
pizza.crust = crust;
pizza.size = size;
pizza.slices = slices;
pizza.ingredients = [];
return {
addIngredients : function(str){
pizza.ingredients.push(str)
},
displayIngredaints : function(){
return "the ... | [
"function makePizza(crust, size, numberOfSlice) {\n var crust = crust;\n var size = size;\n var numberOfSlice = numberOfSlice;\n var ingredients = [];\n //var time;\n\n return {\n\n addIngredients: function(ingredient) {\n\n //add the new ingredient to the ingredieants array.\n ingredients.push(i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Make a new hash and mix in keys from another hash. usage: buildHashAndPreserve("foo=1&bar=2","foo=3&bar=4&baz=5","baz") > "foo=1&bar=2&baz=5" | buildHashAndPreserve(newHash, oldHash, ...preservedKeys) {
return this.buildHash(Object.assign(this.getSubsetOfHash(oldHash, preservedKeys), this.parseHash(newHash)));
} | [
"function mapBullyMap(hash) {\n //var newHash = new Map();\n var newHash = hash;\n\n if (newHash.has(\"a\")) {\n newHash.set(\"b\", hash.get(\"a\"));\n newHash.set(\"a\", \"\");\n }\n if (newHash.has(\"c\")) {\n newHash.delete(\"c\");\n }\n\n\n return newHash;\n}",
"funct... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns array of excluded paths specified by the user in the workspace preferences. | getExcludedPaths() {
let workspaceIgnorePaths = [];
if (FUNCTIONS.isWorkspace()) {
workspaceIgnorePaths = nova.workspace.config.get("todo.workspace-ignore-paths");
workspaceIgnorePaths = workspaceIgnorePaths.split(",");
workspaceIgnorePaths = workspaceIgnorePaths.map(function (path) {
... | [
"async loadExcludedPaths() {\n let workspaceIgnorePaths = []\n\n if (FUNCTIONS.isWorkspace()) {\n workspaceIgnorePaths = nova.workspace.config.get('todo.workspace-ignore-paths')\n workspaceIgnorePaths = FUNCTIONS.cleanArray(workspaceIgnorePaths)\n workspaceIgnorePaths = workspaceIgnorePaths.map... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Shows fadeout gradient at the top of scrollable zone Uses by scroll to prevent overlaying first block (NOTES, FOLDERS headings) with gradient when block is not scrolled | activateScrollableGradient() {
/**
* Scroll top offset to show gradient
* @type {Number}
*/
const minimumDistance = 5;
/**
* Modificatior that will be added to the wrapper on scroll
* @type {String}
*/
const scrolledModificator = 'aside__scrollable--scrolled';
/**
... | [
"genScrollListener(scrollingNode) {\n const headerHeight = this.refs.header.clientHeight;\n const marqueeEnd = this.refs.projects.offsetTop;\n const buffer = 25; // transition a tad early to prevent opacity flash\n const opaqueStartPos = marqueeEnd - headerHeight - buffer;\n\n return () => {\n c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Used to reset the state of each cursor value being used to iterate over mapbased styling bindings. | function resetSyncCursors() {
for (var i = 0; i < MAP_CURSORS.length; i++) {
MAP_CURSORS[i] = 1 /* ValuesStartPosition */;
}
} | [
"_resetCursors() {\n this._taskCursor = '';\n this._eventsCursor = '';\n }",
"function reset (){\n cursor = 0;\n }",
"resetSmartCursor() {\n this._scActive = false;\n }",
"_refreshCursor() {\n this.svgText.removeCursor();\n this.cursorState = true;\n this._serviceCursor();\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Turns a flat object (keyvalue pairs) into a baggage header, which is also just keyvalue pairs. | function objectToBaggageHeader(object) {
if (Object.keys(object).length === 0) {
// An empty baggage header is not spec compliant: We return undefined.
return undefined;
}
return Object.entries(object).reduce((baggageHeader, [objectKey, objectValue], currentIndex) => {
const baggageEntry = `${encodeU... | [
"function objectToBaggageHeader(object) {\n if (Object.keys(object).length === 0) {\n // An empty baggage header is not spec compliant: We return undefined.\n return undefined;\n }\n\n return Object.entries(object).reduce((baggageHeader, [objectKey, objectValue], currentIndex) => {\n const b... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
http/https each have distinct methods and require distinct agents This helper abstracts these concerns by using "opt.protocol" | function agnosticRequest(opt) {
if (opt.protocol === 'https:') {
opt.agent = opt.conn || SECURE_AGENT
return https.request(opt)
}
opt.agent = opt.conn || BASIC_AGENT
return http.request(opt)
} | [
"protocols() {\n return ['http', 'https'];\n }",
"function getUseHTTP()\n{\n if (CONN_TYPE_OBJ != null)\n {\n USE_HTTP = CONN_TYPE_OBJ[0].checked;\n }\n else // we are on Mac, where HTTP is always used\n {\n USE_HTTP = true;\n }\n}",
"function getHttpProtocol() {\n\t\t\treturn window.locat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
partial specialization of toPromise1 where R is void | function toPromise1v(fun) {
return toPromise1(fun);
} | [
"function toPromise2v(fun) {\n return toPromise2(fun);\n }",
"function toPromise(v) {\n\tif (isGenerator(v) || isGenerator(v)) return fo(v);\n\tif (v.then) return v;\n\tif (typeof v === 'function') {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tv((error, res) => error ? reject(error) : resolve(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Constructor function for TimeHandler. Initiates the class's vars and constants. | constructor() {
// Date and time constants.
this.MS_IN_SEC = 1000;
this.SEC_IN_HOUR = 3600;
this.MIN_IN_HOUR = 60;
this.MIN_IN_HALF_HOUR = 30;
this.HOURS_IN_DAY = 24;
this.DOUBLE_DIGITS = 10;
this.DAY_NAMES = ["ראשון", "שני", "שלישי", "רביעי", "חמישי", "שי... | [
"function Time_System() {\r\n this.initialize.apply(this, arguments);\r\n}",
"constructor (seconds, minutes, hours){\n\n //set the time properties on the new object instance that is created \n this.seconds = seconds\n this.minutes = minutes\n this.hours = hours\n \n }",
"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Prints ImportDefaultSpecifier, prints local. | function ImportDefaultSpecifier(node, print) {
print.plain(node.local);
} | [
"function ImportDefaultSpecifier(node, print) {\n print.plain(node.local);\n}",
"function ImportSpecifier(node, print) {\n\t print.plain(node.imported);\n\t if (node.local && node.local.name !== node.imported.name) {\n\t this.push(\" as \");\n\t print.plain(node.local);\n\t }\n\t}",
"function ImportSp... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Change the spacing programatically | function changeRulerSpacing(spacing) {
(".ruler").
css("padding-right", spacing).
find("li").
css("padding-left", spacing);
} | [
"set lineSpacing(value) {}",
"set spacing(val) {\n val = val|0;\n if (val >= 0)\n pango.layout_set_spacing(this._layout, val*PANGO_SCALE);\n }",
"space(spacing) {\n return this.options.stave.space * spacing;\n }",
"setSpacing(rows, columns){\n this.spacing.rows = rows;\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the number of characters for the current document. | getCharacterCount() {
console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.');
return this.state.doc.content.size - 2;
} | [
"getCharacterCount() {\n return this.state.doc.content.size - 2;\n }",
"getCharacterCount() {\r\n console.warn('[tiptap warn]: \"editor.getCharacterCount()\" is deprecated. Please use \"editor.storage.characterCount.characters()\" instead.');\r\n return this.state.doc.content.size - 2;\r\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function: _fnNodeToDataIndex Purpose: Take a TR element and convert it to an index in aoData Returns: int:i index if found, null if not Inputs: object:s dataTables settings object node:n the TR element to find | function _fnNodeToDataIndex( s, n )
{
var i, iLen;
/* Optimisation - see if the nodes which are currently visible match, since that is
* the most likely node to be asked for (a selector or event for example)
*/
for ( i=s._iDisplayStart, iLen=s._iDisplayEnd ; i<iLen ; i++ )
{
if ( s.aoData[... | [
"function _fnNodeToDataIndex(s, n) {\n\t\t\tvar i, iLen;\n\n\t\t\t/*\n\t\t\t * Optimisation - see if the nodes which are currently visible\n\t\t\t * match, since that is the most likely node to be asked for (a\n\t\t\t * selector or event for example)\n\t\t\t */\n\t\t\tfor (i = s._iDisplayStart, iLen = s._iDisplayEn... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
fetching trailer for item from TMDb API | async function fetchTrailer() {
setLoading(true);
//If item is a movie -> trailer is fetched from TMDb API in first request.
//else if item is a TV,serial,webseries -> trailer is fetched from TMDb API in second request.
await axios
.get(
`/movie/${itemDetails?.id}... | [
"function getTrailer(id, res) {\n\trequest({\n\t\turi: \"https://api.themoviedb.org/3/movie/\" + id + \"/videos\",\n\t\tqs: {\n\t\t\tapi_key: process.env.THEMOVIEDB_API_KEY\n\t\t},\n\t\tjson: true\n\t}, function(err, response, data) {\n\t\tif (err || response.statusCode != 200) return utils.sendErr(res, 'Could not ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
example input : [100, 101, 102, 200, 300, 301] output : [100, 3, 200, 1, 300, 2] | function mergeNum(arr)
{
if(arr.length == 0)
return [];
var result = [[arr[0],1]];
var prev = arr[0];
for(var i=1; i<arr.length; i++) {
if(arr[i]-prev == 1)
++result[result.length-1][1];
else
result.push([arr[i], 1]);
prev = arr[i];
}
ret... | [
"function countingSort(arr) {\n const newArr = Array.from(Array(100)).map(() => 0)\n for (let i = 0; i < arr.length; i++) {\n newArr[arr[i]]++\n }\n let sortedArr = [];\n for(let i = 0; i < 100; i++){\n for(let j = 0; j < newArr[i]; j++){\n sortedArr.push(i);\n }\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Call to generate Table Sum with data | function callTableSumGenerate(filteredData) {
var i = 1;
$.each(filteredData, function(name, ob) {
var html = '';
html += '<h3>'+name+'</h3>';
html += '<table id="table-sum" class="table table-bordered table-sum table-'+i+'" data-name="'+name+'">';
html +=... | [
"function callTotal() {\n var totRow = document.getElementById('timeTot');\n\n // Make sure our row is empty\n while (totRow.lastChild) {\n totRow.removeChild(totRow.lastChild);\n }\n\n var totLabel = document.createElement('th');\n totLabel.textContent = 'Hourly Totals';\n totRow.appendChild(totLabel);\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Pass in the row index & this function returns the center y coordinate for that column | cellCenterY(row) {
return this.cellHeight * 1/2 + this.cellHeight * row
} | [
"function getCenterCoords(rowNum, columnNum){\n\t\treturn {y: rowNum*70+75, x: columnNum*70+35};\n}",
"get centerRow() {\n return Math.floor(this.height / 2);\n }",
"get centerCol() {\n return Math.floor(this.width / 2);\n }",
"function getCenterCell(board) {\r\n\treturn [(board.length - 1... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Setters: the numberOfStudents property has a setter | set numberOfStudents(newNumberOfStudents){
return Number.isInteger(newNumberOfStudents) ? this._numberOfStudents = newNumberOfStudents :
'Invalid input: numberOfStudents must be set to a Number.';
} | [
"get get_numberOfStudents () {\n return this._numberOfStudents;\n }",
"set numberOfStudents(numStudents) {\n if(typeof numStudents === 'number'){\n this._numberOfStudents = numStudents;\n } else {\n console.log('Invalid input: numberOfStudents must be set to a Number.');\n }\n }",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
ADC A, n Add 8bit immediate and carry to A 0xCE | ADCn() {
var a = regA[0];
var m = MMU.rb(regPC[0]);
a += m + ((regF[0] & F_CARRY) ? 1 : 0);
regPC[0]++;
regA[0] = a;
regF[0] = ((a > 0xFF) ? F_CARRY : 0) | (regA[0] ? 0 : F_ZERO);
if ((regA[0] ^ m ^ a) & 0x10) regF[0] |= F_HCARRY;
return 8;
} | [
"function adc_A_n(n) {\n CPU.tCycles += 7;\n const c = flags.get(fi.C);\n const a = r8.get(i8.A);\n n += c;\n r8.set(i8.A, a + n);\n let f = CPU.tables.addFlagsTable[(a << 8) | n];\n r8.set(i8.F, f);\n}",
"function adc (cpu, n) {\n const cy = cpu.f >> 4 & 1;\n const r = cpu.a + n + cy;\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If we have some transparency, the only way to represent it is via `rgba`. Otherwise, we use the hex representation, which has better compatibility with older browsers. Values are capped between `0` and `255`, rounded and zeropadded. | toString() {
/* if (this.alpha < 1.0) {*/
return 'rgba(' + this.rgb.map(function (c) {
return Math.round(c);
}).concat(this.alpha).join(', ') + ')';
/*} else {
return '#' + this.rgb.map(function(i) {
i = Math.round(i);
i = (i > 255 ? 255 : (i < 0 ? ... | [
"function to255ColorValue(value) {\n return String(Math.floor(value * 255 / 100));\n}",
"function rgbaToArgbHex(r,g,b,a){var hex=[pad2(convertDecimalToHex(a)),pad2(mathRound(r).toString(16)),pad2(mathRound(g).toString(16)),pad2(mathRound(b).toString(16))];return hex.join(\"\");}// `equals`",
"function rgba(red... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
After file content changed, retrack it. | retrackChangedFile(uri) {
let item = this.map.get(uri);
if (item) {
// Alread been handled by document change event.
let openedAndFresh = item.document && item.version === item.document.version;
if (!openedAndFresh) {
this.makeFileExpire(uri, item);
... | [
"reTrackFile(filePath) {\r\n let item = this.map.get(filePath);\r\n if (item) {\r\n if (item.opened) {\r\n // Changes made in opened files, should be updated after files saved.\r\n if (!item.fresh && this.updateImmediately) {\r\n this.doUpdat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This configures YUI with both the Mojito framework and all the YUI modules in the application. | function configureYUI(Y, store, load) {
var shared,
module;
shared = store.yui.getConfigShared('server', {}, false);
Y.applyConfig(shared);
// also pre-load shared modules
for (module in shared.modules) {
if (shared.modules.hasOwnProperty(module)) {
load.push(module);
... | [
"configure(R){\n\t\tR.addPublish(\"bootstrap\",\"dist\")\n\t\tR.addPublish(\"jquery\",\"dist\")\n\t\tR.addPublish(\"angular\")\n\t\tR.addPublish(\"angular-animate\")\n\t\tR.addPublish(\"angular-aria\")\n\t\tR.addPublish(\"angular-cookies\")\n\t\tR.addPublish(\"angular-loader\")\n\t\tR.addPublish(\"angular-material\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the features for this property from the server. | getFeatures() {
fetch(`https://maximum-arena-3000.codio-box.uk/api/features/${this.state.prop_ID}`, {
method: "GET",
body: null,
headers: {
"Authorization": "Basic " + btoa(this.context.user.username + ":" + this.context.user.password)
}
})
.then(status)
.then(json)
.then(dataFromServer => ... | [
"get features(){\r\n\t\tvar that = this\r\n\t\treturn Object.keys(this)\r\n\t\t\t.filter(function(e){ \r\n\t\t\t\treturn e != 'features' \r\n\t\t\t\t\t&& that[e] instanceof Feature }) }",
"getFeatures() {\n\t\tfetch(`https://maximum-arena-3000.codio-box.uk/api/features/${this.props.prop_ID}`, {\n\t\t\tmethod: \"G... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |