query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
END OF FUNCTIONS FOR GENERATE STATISTIC / LIST OF FUNCTIONS FOR HELPER Validate color if random color is requested | function validateColor(val) {
if (val === 'random') {
return getRandomColor();
} else {
return val;
}
} | [
"function randomColor(){\n\tlet selectedColor = content[Math.floor(Math.random()*(content.length-1))];\n\tlet line = selectedColor.split(',');\n\tlet hexCode = line[1].trim();\n\t// console.log(hexCode);\n\tlet red = hexCode.slice(1,3);\n\tlet green = hexCode.slice(3,5);\n\tlet blue = hexCode.slice(5);\n\n\t// cons... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
END deleteTask / Empties table body then loops through array from GET request if completed is marked as FALSE,it appends an unchecked box and a delete button to DOM if completed it marked TRUE, it appends a checked box and a delete buttons to DOM | function renderTasks(arrayOfTasks) {
$('#taskTable').empty();
arrayOfTasks.forEach(task => {
if (task.completed == false) {
$('#taskTable').append(`
<tr class="tableRow" data-id="${task.id}">
<td class="taskDataCell">
<div class="pretty p-icon... | [
"function deleteTask(){\n // get indx of tasks\n let mainTaskIndx = tasksIndxOf(delTask['colName'], delTask['taskId']);\n // del item\n tasks.splice(mainTaskIndx, 1);\n // close modal\n closeModal();\n // update board\n updateBoard();\n // update backend\n updateTasksBackend();\n}",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
adjusts the term numbers to be in order | function adjustTermNumbers()
{
// retrieve all delete buttons
const deleteTermButtons = document.getElementsByClassName('button-delete');
// iterate over all of the delete buttons
for (let i = 0; i < deleteTermButtons.length; i++)
{
// change the inner text to match the ordering of the butt... | [
"function updateNumbering(){\n var counter = 1;\n var sortedIDs = $('#sortable_rf').sortable('toArray');\n for(var i = 0; i<sortedIDs.length; i++){\n var question = sortedIDs[i];\n if(question != \"newquestion\" && question != \"newlayout\" && question != \"\") {\n var title = $(\"#\"+question).find(\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
In state E: If the current value is 0: Write the value 1. Move one slot to the right. Continue with state C. If the current value is 1: Write the value 1. Move one slot to the left. Continue with state F. | function E() {
if (tape[index] !== 1) {
tape[index] = 1;
index += 1;
return C;
} else {
index -= 1;
return F;
}
} | [
"function F() {\n if (tape[index] !== 1) {\n tape[index] = 1;\n index -= 1;\n return E;\n } else {\n index += 1;\n return A;\n }\n}",
"function D() {\n if (tape[index] !== 1) {\n index -= 1;\n return B;\n } else {\n tape[index] = 0;\n i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Takes in game and returns what the index is of the current player in players | function currentPlayerListIndex(gamestate){
var out = undefined;
gamestate.players.every(function(p,i) {
if(p.id == gamestate.currentPlayerID) {
out = i;
return false;
}
return true;
});
retur... | [
"getUserIndex(){\n var i;\n\n // For each user, check if UUID matches id in the usersPlaying array\n for (i = 0; i < this.props.usersPlaying.length; i++) {\n if(this.props.usersPlaying[i] == this.props.pubnubDemo.getUUID()) {\n return i;\n break;\n }\n }\n return -1;\n }",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method 2 .inrange() .inRange() takes three arguments: a number, a start value, and an end value .inRange() checks to see if the provided number falls within the range specified by the start and end values If the provided number is smaller than the start value, .inRange() will return false If the provided number is larg... | inRange(num, start, end) {
/* Initial version */
/*
// Check if parameter values are provided.
if (num === undefined) {return 'Provide a number'};
if (start === undefined &&
end === undefined ) {return 'Provide atleast one range'};
var lStart;
var lEnd;
var temp;
... | [
"inRange (number, start, end) {\n if (end === undefined) {\n end = start\n start = 0\n }\n if (start > end) {\n let temp = end\n end = start\n start = temp\n }\n let isInRange = (number >= start && number < end)\n return isInRange\n }",
"inRangeIdea (num, start, end) {\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to add an svg blur to the polygons that show up when the clusters are hovered over | function addSVGBlurToPolygons(basemap) {
// must add a polygon to the map for the overlay layer to be created,
// so add a random one to the north pole somewhere out of view
var someLineIntheNorthPole = [[-126.562500,84.802474],[-122.343750,84.802474]];
var polygon = L.polygon(someLineIntheNorthPole).addTo(base... | [
"function applyBlur()\n\t\t\t\t{ TweenMax.set($('.main-img'), {webkitFilter:'blur('+ blurElement.a + 'px)'}); }",
"function changeBoundingBoxProperty(on)\n{\n\tfor (var i = 0; i<labels.length; i++) {\n\t\tlabels[i].material.transparent = on;\n\t}\n}",
"function blurImage(img){\n return imageMapXY(img, blurPixe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function subtracts TShirt for W_W&F by 1 | function countTshirtWwfMinus() {
if(instantObj.noOfTshirtWWF > 0) {
instantObj.noOfTshirtWWF = instantObj.noOfTshirtWWF - 1;
countTotalBill();
}
} | [
"function countShirtWwfMinus() {\n\t\t\tif(instantObj.noOfShirtWWF > 0) {\n\t\t\t\tinstantObj.noOfShirtWWF = instantObj.noOfShirtWWF - 1;\n\t\t\t\tcountTotalBill();\n\t\t\t}\n\t\t}",
"function countTshirtWwiMinus() {\n\t\t\tif(instantObj.noOfTshirtWWI > 0) {\n\t\t\t\tinstantObj.noOfTshirtWWI = instantObj.noOfTshi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Protein Translation // /////////////////////// Lets write a program that will translate RNA sequences into proteins. RNA can be broken into three nucleotide sequences called codons, and then translated to a polypeptide like so: RNA: "AUGUUUUCU" => translates to Codons: "AUG", "UUU", "UCU" => which become a polypeptide ... | function translate(codonString = '') {
const TO_AMINO_ACID = {
AUG: 'Methionine',
UUU: 'Phenylalanine',
UUC: 'Phenylalanine',
UUA: 'Leucine',
UUG: 'Leucine',
UCU: 'Serine',
UCC: 'Serine',
UCA: 'Serine',
UCG: 'Serine',
UAU: 'Tyrosine',
UAC: 'Tyrosine',
UGU: 'Cysteine',
... | [
"function Phrase(options) {\r\n\r\n\tthis.lire = function () {\r\n\t\treturn this.corps;\r\n\t};\r\n\r\n\tthis.__assembler = function (texte) {\r\n\t\tvar resultat = texte.join(\" \");\r\n\t\tvar point = probaSwitch(Grimoire.recupererListe(\"PF\"), this.PROBA_POINT_FINAL);\r\n\t\tresultat = resultat.replace(/ \\,/g... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Changes the place holder text depending on what the user wants to search by | function updatePlaceholderText() {
$('#searchOptions').val() == "City" ? $('#searchText').attr('placeholder', 'Search by town or city')
: $('#searchOptions').val() == "Name" ? $('#searchText').attr('placeholder', 'Search by first or last name')
: $('#searchText').attr('placeholder', ... | [
"function handleSearch(){\n var term = element( RandME.ui.search_textfield ).value;\n if(term.length){\n requestRandomGif( term, true);\n }\n}",
"function search() {\n\t\tvar searchVal = searchText.getValue();\n\n\t\tsources.genFood.searchBar({\n\t\t\targuments: [searchVal],\n\t\t\tonSuccess: function(event... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Render each note in the given patch, by looping through the sections and rendering either `note` or `note.notes` in the case of a subsection | async function renderPatchNotes (patch, ctx) {
// Run the notes through the markdown rendering pipeline
for (const key in patch.sections) {
await Promise.all(patch.sections[key].map(async (noteOrHeading, index) => {
patch.sections[key][index] = typeof noteOrHeading === 'string'
? await renderConte... | [
"function renderNotes(){\n $('#new-note-btn').show();\n $(\"#new-note-hr\").show();\n $(\"#note-index-container\").css('height', '');\n clearNotesDisplay(\"notes\");\n raw_notes.forEach(function(note){\n $(\".note-index\").append('<div class=\"note-tile btn btn-block transition-quick\" data-id... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tiddler functions Display several tiddlers from a list of space separated titles | function displayTiddlers(src,titles,state,highlightText,highlightCaseSensitive,animate,slowly)
{
var tiddlerNames = titles.readBracketedList();
for(var t = tiddlerNames.length-1;t>=0;t--)
displayTiddler(src,tiddlerNames[t],state,highlightText,highlightCaseSensitive,animate,slowly);
} | [
"function displayTiddler(src,title,state,highlightText,highlightCaseSensitive,animate,slowly)\n{\n\tvar place = document.getElementById(\"tiddlerDisplay\");\n\tvar after = findContainingTiddler(src); // Which tiddler this one will be positioned after\n\tvar before;\n\tif(after == null)\n\t\tbefore = place.firstChil... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
An Observable that contains a map of the query parameters available to all routes. The map supports retrieving single and multiple values from the query parameter. | get queryParamMap() {
if (!this._queryParamMap) {
this._queryParamMap =
this.queryParams.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])((p) => convertToParamMap(p)));
}
return this._queryParamMap;
} | [
"function allParams( req ) {\n var params = req.params.all();\n return _.merge( req.query, params );\n}",
"static get QUERY_PARAMS_PROPS() {\n return Constants.QUERY_PARAMS_PROPS;\n }",
"function useQuery () {\n return new URLSearchParams(useLocation().search)\n}",
"function locationQuery(params) {... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a query builder with initial `and` set | static and(...args) { return this.__query().and(...args); } | [
"and(...rules) {\n // Check if there is just one array\n if( isArray(rules[0]) )\n rules = rules[0];\n\n // Add the rules\n return this.addRules('and', rules);\n }",
"addFilterToQuery(filter) {\n const query = {};\n if (filter.mode === 'exactly' && !filter.value) {\n que... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function : showpopup parameter : msg_id, process_name, top_value what does this function do : Open the long detail version of a message by calling GetFullDetailMessage | function showpopup(msg_id, process_name, top_value) {
GetFullDetailMessage(msg_id, process_name);
} | [
"function show_message(page, process_name) {\n // Save info of the opened tab\n msg_or_job = 'Msg';\n ProcessMsgUpdate(page, process_name, true);\n}",
"function thisopenEntityMiniPopupWin(pk) {\r\n if (pk == 0) {\r\n alert(getMessage(\"cs.entity.information.error.notRecorded\"));\r\n ret... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
sound for each box | function correctSound() {
for (var i = 0; i < box.length; i++) {
this.addEventListener('click', playSound(sound2));
}
} | [
"_bounceSound() {\n if (this._targetPlanet.name === \"blueBig\") {\n Assets.sounds.bounceL.play();\n } else if (this._targetPlanet.name === \"redBig\") {\n Assets.sounds.bounceR.play();\n }\n }",
"function animateAndSound(arg) {\n $(arg).fadeOut(150).fadeIn(150);\n soundIndex = slices.indexO... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
check the type of nearest entity | function checkNearestEntity() {
nearEntity = bot.nearestEntity();
// Sheep
if (nearEntity.entityType === 91 && !visitedEntities.includes(nearEntity.id)) {
targetEntity = nearEntity;
bot.chat('Maybe I can shear this sheep...');
intervalAction = setInterval(bot.agentAction, 1 * 1000,... | [
"closestObject( type, x )\n {\n let index = 0, dist = 10 ** 6, objX = undefined;\n\n // find the closest building to guard\n for( index = 0;index < this.objects.length;index++ )\n {\n let o = this.objects[ index ];\n\n const d = Math.abs( o.p.x - x );\n\n if( ( o.oType == type ) && ( d <... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Process keywords. Returns nodes. | function processKeywords() {
var nodes = []
var lastIndex
var keyword
var node
var submatch
if (!top.keywords) {
return addText(modeBuffer, nodes)
}
lastIndex = 0
top.lexemesRe.lastIndex = 0
keyword = top.lexemesRe.exec(modeBuffer)
while (keyword) {
addText(m... | [
"function keywordReducer(keywords, result) {\n Object.keys(result.keywords_result || {}).forEach(k => {\n keywords[k] = keywords[k] || [];\n keywords[k].push(...result.keywords_result[k]);\n });\n return keywords;\n}",
"function getKeywords (place) {\n let labels = `<div class=\"labels\">`;\n let keywo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the current tab scroll position | _getTabScrollPosition() {
if (this.asset.outlet && this.asset.outlet.nativeElement)
return this.asset.outlet.nativeElement.scrollTop;
return 0;
} | [
"function icinga_get_scroll_position() {\n\n\tvar scroll_pos;\n\n\t//most browsers\n\tif (typeof window.pageYOffset != 'undefined') {\n\t\tscroll_pos = window.pageYOffset;\n\t}\n\t//IE6\n\telse if (typeof document.documentElement.scrollTop != 'undefined') {\n\t\tscroll_pos = document.documentElement.scrollTop;\n\t}... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Size of canvas with icon and text | function canvasSize({
textStyle = 0,
size = 300,
primaryText = "",
secondaryText = "",
displaySize = false,
}) {
let scale = size / 300;
let scaledWidth = 890;
let scal... | [
"_setCanvasSize () {\n const p = this._props,\n style = this._canvas.style;\n\n style.display = 'block';\n style.width = '100%';\n style.height = '100%';\n style.left = '0px';\n style.top = '0px';\n }",
"function getWidthIcon(x,y,s){\n\treturn \"M\"+(x-s/2)+\" \"+y+\",L\"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add MRSS transform file to generic distribution provider action. | static addMrssTransform(id, xslData){
let kparams = {};
kparams.id = id;
kparams.xslData = xslData;
return new kaltura.RequestBuilder('contentdistribution_genericdistributionprovideraction', 'addMrssTransform', kparams);
} | [
"static addMrssTransformFromFile(id, xslFile){\n\t\tlet kparams = {};\n\t\tkparams.id = id;\n\t\tlet kfiles = {};\n\t\tkfiles.xslFile = xslFile;\n\t\treturn new kaltura.RequestBuilder('contentdistribution_genericdistributionprovideraction', 'addMrssTransformFromFile', kparams, kfiles);\n\t}",
"static addMrssValid... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Enter a parse tree produced by Java9ParserswitchLabel. | enterSwitchLabel(ctx) {
} | [
"function evaluator() {\n state.seg = segments['intro']; // starting from intro\n var block_ix = 0;\n\n // use global state to synchronize\n var handlers = {\n text : function(text) {\n var $text = $('<p></p>').appendTo($main);\n var timeoutid;\n var line_ix = 0;\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Switch to the transaction's subcategory | switchSubcategory($event, transaction) {
this.switchTo($event, "categories.category", transaction.subcategory.id, transaction);
} | [
"switchCategory($event, transaction) {\n\t\tthis.switchTo($event, \"categories.category\", transaction.category.id, transaction);\n\t}",
"function selectCategory(event)\n{\n var category = jQuery(this).attr('ref');\n if (null != categoryTreeCash[category])\n {\n _updateSubCategoryPad(category, cat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Toggles the tube line subscription icon state | toggleSubscriptionIcon_() {
if (Object.keys(findLineSubscription(this.line_)).length) {
this.subIconEl_.classList.add(cssClass.HIDDEN);
this.unsSubIconEl_.classList.remove(cssClass.HIDDEN);
this.subIconWrapper_.setAttribute("type", "unsubscribe");
} else {
this.subIconEl_.classList.remov... | [
"function showSubscribeButton() {\n subscriptionButton.onclick = subscribe;\n subscriptionButton.textContent = 'Click to Subscribe';\n subscriptionButton.removeAttribute('disabled');\n subscriptionCard.style.display = \"inline-block\";\n}",
"startToggle() {\n this.thumb && this.thumb.startToggle();\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to select and assign the correct manager to the aforementioned employee | function modifyMgrMgrSel(empl) {
const employee = empl;
db.query(
"SELECT id, first_name, last_name FROM employee",
function (err, res) {
inquirer
.prompt([
{
type: "list",
message: "And who will be their new leader?",
name: "modifyMgrChangedM",
... | [
"function findManagerFor(employee, employeesArr) {\n let manager = employee.managerId;\n if (!manager) {\n return null;\n } else {\n for (let i = 0; i < employeesArr.length; i++) {\n if (manager === employeesArr[i].id) {\n return employeesArr[i];\n }\n }\n }\n}",
"function showEmploy... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Remove contacts which have expired (never been claimed) | function deleteExpiredContacts(cb) {
console.log('INFO: delete expired contacts');
var stream = Contact.find({'expires': true}).stream();
stream.on('data', function(contact) {
if (contact.isExpired()) {
contact.remove();
}
});
stream.on('close', function() {
cb();
});
} | [
"function deleteExpiredProfiles(cb) {\n console.log('INFO: delete expired profiles');\n var stream = Profile.find({'expires': true}).stream();\n\n stream.on('data', function(profile) {\n if (profile.isExpired()) {\n profile.remove();\n }\n });\n\n stream.on('close', function() {\n cb();\n });\n}... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get a description for transaction, with a mention to virtual card emitter if necessary | transactionDescription(transaction) {
const targetCollective = getTransactionReceiver(transaction);
const transactionDescription = (
<LinkToCollective collective={targetCollective}>
{transaction.description || targetCollective.name || targetCollective.slug}
</LinkToCollective>
);
re... | [
"getTransactionInfo(transaction) {\n return new Promise(async (resolve, reject) => {\n try {\n const res = await fetch(this.explorerUrl + \"/api/tx/\" + transaction);\n const data = await res.text();\n \n resolve(data);\n }catc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get information about all IPv6 routes | async function getRouteInfo6()
{
let key;
let routes = [];
return Promise.resolve()
.then(() => addIfIndexes())
.then(() => fsp.readFile("/proc/net/ipv6_route"))
.then((content) => content.toString().split("\n"))
.then(
(lines) =>
{
lines.forEach(
... | [
"async getIpv6RouteTable()\n {\n return getRouteInfo6();\n }",
"async getIpv6RouteNumber()\n {\n return Promise.resolve()\n .then(() => getRouteInfo6())\n .then(routeInfo => routeInfo.length);\n }",
"async getIpv6AddrTable()\n {\n const addressInfo = await getAddressInfo();\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
PagEPagEPagEPagEPagEPagEPagEPagEPagEPagE TooLTooLTooLTooLTooLTooLTooLTooLTooLTooL /basicbasicbasicbasicbasicbasic menutoshow_lang:Function | function menutoshowlang(){
} | [
"function importance_lang(text) {\n return lang(\"importance:\"+text);\n}",
"function helloWorld(language) {\r\n if (language === 'fr') {\r\n return 'Bonjour tout le monde';\r\n }\r\n else if (language === 'es') {\r\n return 'Hola, Mundo';\r\n }\r\n else (language === '') {\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Name : handlePastDate() Parameters : currentDate object. Processes : Return Value: None. | function handlePastDate() {
var departureDate = document.getElementById("departureDate"); // Gets and stores departureDate input.
var returnDate = document.getElementById("returnDate"); // Gets and stores returnDate input.
var summaryDepartureDate = document.getElementById("summaryDepartureDate"); // Gets... | [
"function departureDateHandler() {\n\thandlePastDate();\t\t\t\t\t\t// Ensures that a past date is handled.\n\tdateInverter();\t\t\t\t\t\t\t// Inverts dates if necessary.\n}",
"function returnDateHandler() {\n\thandlePastDate();\t\t\t\t\t\t\t\t\t\t\t\t// Handle past dates if needed.\n\tdateInverter();\t\t\t\t\t\t\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The first element in the array that matches the given regular expression. | function firstMatch(array,regex) {
return array.filter(RegExp.prototype.test.bind(regex))[0];
} | [
"function matchInArray(re, arr) {\n let match;\n // input check\n if (!re || !(re instanceof RegExp) ||\n !arr || !(arr instanceof Array)) {\n return false;\n }\n for (let i = 0; i < arr.length; ++i) {\n match = re.exec(arr[i]);\n if (match) {\n return match;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
IF any passenger.isHealthy = false, return true else false | shouldQuarantine() {
if (this.passengers.find(passenger =>
passenger.isHealthy === false )) {
return true
} else {
return false
}
} | [
"_potIsGood() {\n return this.players\n .map((player) => {\n return (\n player.activeBetValue === -2 ||\n player.chipValue === 0 ||\n player.activeBetValue === this.activeBetValue\n );\n })\n .every(Boolean);\n }",
"function isAlive(Obj) {\n\t// if my ch... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given a new custom model, go over all of the textures, and see if any match any of the model's textures. Matches are replaced with the matched textures. | function tryToInjectCustomTextures(modelTest) {
let model = modelTest.resource;
let parser = modelTest.parser;
for (let textureTest of eachTextureTest()) {
for (let i = 0, l = model.textures.length; i < l; i++) {
const texture = model.textures[i];
texture.whenLoaded().then(() => {
if (!t... | [
"function tryToLoadCustomTexture(textureTest) {\n for (let modelTest of eachModelTest()) {\n const model = modelTest.resource;\n\n for (let i = 0, l = model.textures.length; i < l; i++) {\n const modelTexture = model.textures[i];\n\n // If the texture failed to load, check if it matches the name.\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get information on the different menus and render index page | function allMenusHtml(req, res) {
menus.getAllMenus()
.then((results) => res.render('pages/index', results))
.catch(err => {
console.log('error in allMenusHtml: ', err);
res.send('There was an error, sorry!')
});
} | [
"static async index (req, res) {\n const connector = await Connector.findOne({ _id: req.params.connectorId, isActive: true })\n if (!connector) {\n throw new NotFoundError('Connector')\n }\n const existingMenus = await PersistentMenu.find({ connector_id: connector._id })\n\n return renderOk(res,... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
[1.4 Screens functions : Settings] | function displaySettings() {
// Hide other menus
addClass($('#main_menu #shortcuts'), 'hide');
addClass($('#main_menu #story'), 'hide');
addClass($('#main_menu #spellbook'), 'hide');
addClass($('#main_menu #stats'), 'hide');
// Show settings screen
removeClass($('#main_menu #settings'), 'hide');
... | [
"function loadSettings() {\n mainMenu.style.display = \"none\";\n settings.style.display = \"block\";\n}",
"function createSettings() {\n\t\tvar dialog = new Window (\"dialog\", \"Settings\");\n\t\t\n\t\t// filename\n\t\tvar fileNameGroup = dialog.add (\"group\");\n\t\tfileNameGroup.orientation = \"row\";\n\t\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Plot a block based on its grid position; grid dimensions is 5x4; (0,0) for top left and (4,3) for bottom right | function plot_block(n, m, x_pos, y_pos) {
// Local position
block = cube.translate(t_x.scale(m).translate(t_y.scale(n)))
// Global position
block = block.translate(new Vector([x_pos, -y_pos, 0]))
block.plot()
} | [
"function drawBlocks() {\n var i, j;\n var color;\n for (i = 0; i < width/BLOCK_SIZE; i++) {\n for (j = 0; j < height/BLOCK_SIZE; j++) {\n color = colorGrid[i][j];\n context.fillStyle = color;\n context.fillRect(i*BLOCK_SIZE, j*BLOCK_SIZE,... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Merges the CDN config provided with the current CDN config | function mapCdnConfig(currentConfig, config) {
if (!config)
return currentConfig;
var validatedConfig = getValidatedCdnConfig(config);
return __assign({}, currentConfig, validatedConfig);
} | [
"static merge (config) {\n currentConfig = assign({}, currentConfig, config);\n }",
"function applyConfig() {\n if (config !== undefined) {\n for (var key in config) {\n plugin[key] = config[key];\n }\n }\n }",
"cb(config) {\n //you have access to the gulp config here for\n //a... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
determine + apply offset so poses are spatially centered note that left and right are reversed in poseNet data, keeping same here | function centerPoses(whichPose) {
let newPose = [];
calcCenter(poses[whichPose]);
centers.push(torsoBox);
newPose = JSON.parse(JSON.stringify(poses[whichPose][0]));
for (i = 0; i < newPose.pose.keypoints.length; i++) {
newPose.pose.keypoints[i].position.x += torsoBox.offsets.x;
newPose.pose.keypoints... | [
"function calcCenter(whichPose) {\n let leftBound;\n let rightBound;\n let topBound;\n let bottomBound;\n\n let sLeft = whichPose[0].pose.keypoints[5].position;\n let hLeft = whichPose[0].pose.keypoints[11].position;\n let sRight = whichPose[0].pose.keypoints[6].position;\n let hRight = whichPose[0].pose.ke... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
setup the msg area for either compose mode or display mode | function setMsgArea(composeMode, addrPrompt, otherAddr, msgId, ref, msgDesc, date, sendButtonText) {
//always display...
const msgPromptArea = document.getElementById('msgPromptArea');
msgPromptArea.value = addrPrompt;
const msgAddrArea = document.getElementById('msgAddrArea');
msgAddrArea.disabled ... | [
"function update_display_msg(msg) {\n\tupdate_Display(msg, 0);\n}",
"_setPaneStates(aLegalStates, aVisibleStates) {\n // The display box hosts both the thread pane and account central.\n let displayBoxLegal = aLegalStates.thread || aLegalStates.accountCentral;\n\n let layout = Services.prefs.getIntPref(\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Try to get entry point info from the given path. | function getEntryPointInfo(pkgPath, entryPoint) {
var packageJsonPath = path.resolve(entryPoint, 'package.json');
if (!fs.existsSync(packageJsonPath)) {
return null;
}
var entryPointPackageJson = loadEntryPointPackage(packageJsonPath);
if (!entryPointPackageJson) {
... | [
"getEntryPointWithDeps(entryPointPath) {\n const entryPoints = this.findOrLoadEntryPoints();\n if (!entryPoints.has(entryPointPath)) {\n return null;\n }\n const entryPointWithDeps = entryPoints.get(entryPointPath);\n if (!entryPointWithDeps.entryPoint.compiledByAngular... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Uncheckes HTML elements by value. All the elements having a value contained in the 'elementValues' list will be unchecked by the function. | function uncheckElementsByValues(elementValues) {
// Uncheck elements one by one
for(var i = 0; i < elementValues.length; i++) {
changeElementPropertyByValue(elementValues[i], "checked", false);
}
} | [
"function checkElementsByValues(elementValues) {\n // Check elements one by one\n for(var i = 0; i < elementValues.length; i++) {\n changeElementPropertyByValue(elementValues[i], \"checked\", true);\n }\n}",
"function disableElementsByValues(elementValues) {\n // Disable elements one by one\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Ensure rangy.rangePrototype and rangy.selectionPrototype are available immediately | function RangePrototype() {} | [
"function getRangeObject(selectionObject)\n{\n if (selectionObject.getRangeAt)\n return selectionObject.getRangeAt(0);\n else\n { // Safari 1.3\n let range = document.createRange();\n range.setStart(selectionObject.anchorNode,selectionObject.anchorOffset);\n range.setEnd(s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Internal loading of the zip files Will be executed when jQuery is ready | function _preloadZip () {
if (!_URLsToLoad.length) return; // If no zip file to download, that's it, we're done
var getZipFile = function(url){ // Called for each URL that was passed
function removeURL() { // Called to remove a URL from the array (when unzipped done, or error... | [
"function unzipFiles(event) {\n $('#upload-spin').html(\"<img style='opacity:1.0' width='25' height='25' \" +\n \"src='./resources/success.png'/>\");\n showSpinner(\"unzip-spin\");\n //make an Ajax request to unzip any uploaded zip files\n var request = $.ajax({\n url : PHP_SCRIPT,\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Opens the Marking Menu onto the current position of the mouse Will be rendered from within the React render method | addMarkingMenu() {
const { popupInfo } = this.state;
if (this.state.markingMenu.curClick) {
// console.log("add marking menu")
return (
<div ref="markingmenu">
<MarkingMenu
x={this.state.markingMenu.xPos}
... | [
"mouseOut() {\n this.setState({\n markingMenu: { ...this.state.markingMenu, mouseOver: false }\n });\n }",
"open() {\n document.querySelector(\".spell-page\").style.display = \"block\";\n }",
"function menuHighlightClick() {\n Data.Edit.Mode = EditModes.Highlight... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function that clear the film and tv | function clear() {
$(".films").html("");
$(".tv-shows").html("");
} | [
"function clearAll() {\r\n hidePlayer();\r\n clearDiv(\"recordView\");\r\n clearDiv(\"annotations\");\r\n clearDiv(\"kwSearch\");\r\n clearDiv(\"keyWord\");\r\n processAjax (\"Introduction.php\", \"columnLeft\");\r\n}",
"function clearMovieBox() {\n container.innerText = '';\n}",
"function hideSearchFi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Past tensify a word | function pastTensifyWord({ word }) {
let pastTense = toIkForm(word); // get the word's ik form
const suffixWithTe = [...'sftktchp'.split('')];
// If the last letter in the verb en form (before "en") is included
// in SoFTKeTCHup (ok this is a bit bullshit just imagine
// "ch" is also a letter lol) then add... | [
"function placeTonePerWord(orig_toneNumberPinYin){\n\tvar toneNumberPinYin = orig_toneNumberPinYin.replace(/u:/g, \"ü\");\n\tvar toneIndex = toneNumberPinYin.charAt(toneNumberPinYin.length -1);\n\tif (isNaN(toneIndex) == true)\n\t{\n\t\tconsole.log('toneIndex not a number:' + toneIndex);\n\t\treturn(orig_toneNumber... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adapted from Generate Password reset token | static generatePasswordResetToken() {
return new Promise((resolve, reject) => {
crypto.randomBytes(20, (err, buffer) => {
if (err) {
reject(err);
} else {
resolve(buffer.toString('hex'));
}
});
});
} | [
"async function resetToken(cpf) {\n //generates reset password crypto token\n const token = crypto.randomBytes(30).toString('hex');\n\n //sets reset token expiration\n let now = new Date();\n now.setHours(now.getHours() + 1);\n now = now.toISOString();\n\n //updates user\n await fields(\n 'users',\n '... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
member function to find lowest value in 24 hours from data and display with truncation | MinValue(dataKey, data) {
if (data.length == 0)
{
return "0";
}
else
{
var chartValues=[];
// data.
var count=data.length;
for(var i=0;i<count;i++)
{
var temp=data[i];
... | [
"function calculateLowestTemp() {\n var lowTemp = 1111111111111;\n for (var l = 0; l < $scope.data2.length; l++) {\n if ($scope.data2[l].y < lowTemp) {\n lowTemp = $scope.data2[l].y;\n }\n }\n return lowTemp.toFixed(2);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the Editor DOM Element | get editorDomElement() {
return this._$input;
} | [
"get element() {\n return this.dom;\n }",
"function getEditorCanvas(editor) {\n return getFirstSubElementByClass(editor, \"MinMineEditor-canvas\");\n }",
"function getElement(type) {\n switch(type) {\n case 'textarea':\n return '<textarea></textarea>';\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update the Cart total based on what items are in the cart , as well as the delivery method and if a coupon is added | function updateCartTotal() {
var cartItemContainer = $('.cart-items')[0];
var cartRows = cartItemContainer.getElementsByClassName('cart-row');
var total = 0;
for (var i = 0; i < cartRows.length; i++) {
var cartRow = cartRows[i];
var priceElement = cartRow.getElementsByClassName('cart-pri... | [
"function updateCartQuantity() {\n let sum = null;\n for (let i = 0; i < order.length; i++) {\n sum += order[i].quantity;\n }\n cartCount = sum;\n $('#cartCount')\n .text(cartCount);\n orderSubTotal();\n }",
"function updateCartItems(){\n\tvar totalItems = 0;\n\tvar productTotal =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
move all cameras to the specified time and show point clouds at the specified time | function moveCamerasToTime(time, dir){
if (!dir) {
dir = 1;
}
while (fullCamList.indexOf(time)<0 && time>fullCamList[0] && time<fullCamList[fullCamList.length-1]){
time = time + dir;
}
shaderMaterial.uniforms.timestamp_center.value = time;
var selectCam = [];
selectCam[currPersCam.name[0]] = {
nearestCam... | [
"function moveAll() {\n moveClouds();\n \n // check is screen needs to move - move if necesary\n checkScreenBoundaries();\n \n // move all objects\n for(var i = 0; i < objects.length; i++){\n objects[i].move();\n }\n}",
"updatePlayerCamera() {\n this.scene.updateGameCamer... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds notes, hosts, and cves to new vulnerablity | function addExistingContentToVenerability(vulnerabilityId) {
newNotes.forEach(function (note) {
Meteor.call('addVulnerabilityNote', projectId, vulnerabilityId, note.title, note.content);
});
newHostList.forEach(function (host) {
Meteor.call('addHostToVulnerability', proje... | [
"function removeVulnerabilities() {\n console.log('Removing Vulns');\n vulnerabilities.forEach(function (vulnerability) {\n Meteor.call('removeVulnerability', projectId, vulnerability._id);\n });\n }",
"function linkifyCVE(str) {\n const regexp = /(CVE-\\d{4}\\-\\d{4,})/gi;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
buffer the likers by retrieving associated video refs | function bufferLikers(){
var temp = new Array();
for(var i = 0; i< that.likers.length; i++){
if(that.likers[i].refs === undefined){
that.likers[i].refs = null;
temp.push(that.likers[i].FbId);
//R.request('getVideoRefs',{FromFbId:that.likers[i].FbId,Type:"findWhoLikedMe"});
}
}
if(temp... | [
"function bufferMyLikes(){\r\n\t\tvar temp = new Array();\r\n\t\tfor(var i = 0; i< that.myLikes.length; i++){\r\n\t\t\tif(that.myLikes[i].refs === undefined){\r\n\t\t\t\tthat.myLikes[i].refs = null;\r\n\t\t\t\t//R.request('getVideoRefs',{FromFbId:that.myLikes[i].FbId,Type:\"findWhoILike\"});\r\n\t\t\t\ttemp.push(th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get managers by group | retrievingManagersByGroup (organization, serviceName, groupName, count = 10, offset = 0) {
return this.services
.OvhHttp
.get("/sws/exchange/{organization}/{exchange}/groups/{mailinglist}/managers", {
rootPath: "2api",
clearCache: true,... | [
"function getCaseManagers() {\n var getCaseManagersPromise = studentService.getStudents({\n include: ['case_manager.*']\n });\n getCaseManagersPromise.then(function success(data) {\n var caseStudents = _.reject(data.students, function(student) {\n return stu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
bind class function is used to control the active status of menu button | function bindClassCtrl ( itemID ) {
$('.floor').find('.active').removeClass('active');
$(itemID).addClass('active');
} | [
"function activateMenuElement(name){$(options.menu).forEach(function(menu){if(options.menu&&menu!=null){removeClass($(ACTIVE_SEL,menu),ACTIVE);addClass($('[data-menuanchor=\"'+name+'\"]',menu),ACTIVE);}});}",
"function changeActiveMenuItemOnScroll() {\r\n\t\tvar scrollPos = $(document).scrollTop();\r\n\t\t$('.hea... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add new activity function Input: User ID, activity information Output: Returns user ID that added a new activity | async function addNewActivity(userID, activity) {
// Error check
let cleanUser = checkStr(userID);
let userObj;
try {
userObj = ObjectId(cleanUser);
} catch (e) {
throw e;
}
const userCollection = await Users;
const userList = await userCollection.findOne({ _id: userObj });
if (userList.length... | [
"function activityAddClicked() {\n\tvar addedActivity = document.getElementById(\"newactivity\").value;\n\t\n\tif (addedActivity==\"\") {\n\t\talert(\"Can't add an empty activity.\");\n\t} else {\n\t\tdoesActivityExist(addedActivity,function(result) {\n\t\t\tif (result) {\n\t\t\t\talert(\"This activity already exis... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Controls the search's bar behaviour query(String) students(Filtered Array of students). | function searchControl(query, students) {
//if no input provided to search for students return the main page.
if (query.length == 0) {
showPage(data, 1);
addPagination(data);
return;
}
//if the input provided did not match any filtered students.
else if (students.length == 0) {
//clean the cu... | [
"function searchStudent() {\t\r\n\t//convert all the input name to lowercase and remove the whitespace from the beginning and ending\r\n var searchTerm = $('#search').val().toLowerCase().trim();\r\n\r\n var SearchingResults = students.filter(function(i) {\r\n\t\tvar studentName = $(this).find('h3').text()... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
insert dash() between oddnumbers | function insertDash(num){
const array = [];
for (let i = 0; i < num.length; i++) {
if ((num[i] % 2 === 0) && num[i + 1] % 2 === 0) {
array.push(num[i] + '-' );
} else {
array.push(num[i]);
}
}
return array.join('');
} | [
"function dash_in_even(number) {\n console.log(\"even numbers separated by dashes\");\n}",
"function dashatize(num) {\n const str = num\n .toString()\n .split(\"\")\n .map((val) => (val % 2 ? `-${val}-` : val))\n .join(\"\");\n let result = \"\";\n for (let i = 0; i < str.length; i++) {\n if (s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calculates which seats to show based on active filters | function applyFilter()
{
var parameters = {};
for(var i in self.selectedList) {
var filter = self.selectedList[i];
if (filter.length > 0) {
parameters[i] = [];
}
for(var j in filter){
parameters[i].push(parseInt(filter[j... | [
"apply_filters() {\n return this.data\n .filter(d => this.selected_towns[d.town])\n .filter(d => this.selected_categories[d.object_category])\n .filter(d => d.date_full >= this.selected_start && d.date_full <= this.selected_end);\n }",
"function updateFilter()\r\n\t{\r\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a function unique(arr) that should return an array with unique items of arr. | function unique(arr) {
return Array.from(new Set(arr));
} | [
"function uniqueArr(arr) {\n\treturn [...new Set(arr.filter(x => x > 0))];\n}",
"function UNIQUE(array) {\n return array.reduce(function (p, c) {\n if (p.indexOf(c) < 0) p.push(c);\n return p;\n }, []);\n}",
"function unique(A) {\n if (A instanceof NdArray) {\n A = A.toArray();\n }\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The next function can be called two ways : 1 when we click or drag the master volume widget. In that case the val parameter is passed. 2 without parameters, this is the case when we jump to another place in the song or when a new song is loaded. We need to keep the same volume as before | function setMasterVolume(val) {
if(currentSong !== undefined) {
// If we are here, then we need to reset the mute all button
document.querySelector("#bsound").innerHTML = '<span class="glyphicon glyphicon-volume-up"></span>';
var fraction;
// set its volume to the current va... | [
"function runPrevKeyDownEvent() {\n /*\n Check to see if the current playlist has been set\n or null and set the previous song.\n */\n if (config.active_playlist == \"\" || config.active_playlist == null) {\n AudioNavigation.setPrevious();\n } else {\n AudioNavigation.setPreviousPlay... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Called when the user presses the annoate taxonomy button. | function annotateTaxonomy() {
$('#taxonomy-info-alert').removeClass("hidden");
queryTaxonIds(serverVars.ncbiList, serverVars.uniprotList, serverVars.ncbiMapping, serverVars.uniprotMapping);
} | [
"function onClickVocabularyImg() {\n\t// Set flag\n\t$('#scenario_vocabulary').val('vocabulary');\n\n\tonOffAreaScenarioVocabulary(CLIENT.ONVOCABULARY);\n}",
"function select_annotation(evt) {\n select_button(evt.target);\n }",
"function suggestionClickListener() {\n $('li.tax-suggestion').... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the notes for the program, as set by the user. | setNotes(notes) {
if (notes !== this.notes) {
this.notes = notes;
this.onNotes.dispatch(notes);
}
} | [
"function setABCNote(note, duration = \"\"){\n\tmusicalElements += note + duration + \" \";\n}",
"function editNote(){\n\t\n\tvar moment = require('alloy/moment');\n\t\n\tvar note= myNotes.get(idNote);\n\tnote.set({\n\t\t\"noteTitle\": $.noteTitle.value,\n\t\t\"noteDescription\": $.noteDescription.value,\n\t\t\"d... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Enable links according to settings saved in storage // Due to not being allowed to create html elements or use innerHTML in extensions elements display style is set to none when hidden | function enableLinks() {
var show = document.getElementsByClassName("show");
let match = false;
for (const link of show) {
match = false;
enabledLinks.forEach(enabled => {
if (link.id == enabled) {
match = true;
link.style.display = 'block';
} else if (!match) {
link.st... | [
"function GetLinkList() {\n function setCurrentChoice(result) {\n enabledLinks = result.enabledLinks || ['asta','itsl','webm','mat','thes','incy','lynd','arbs','skri','finn','libg','offi','perl','tlk','hans','hosk','ask','star'];\n enableLinks();\n }\n chrome.storage.sync.get(['enabledLinks'], function (re... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
=================================================================================================================== Solution : use this function to avoid timeout error when request jira info with change log. New Sequence with change log.... makeSnapshot_InitiativeListfromJira > makeSnapshot_InitiativeDetailInfofromJira... | async function makeSnapshot_InitiativeListfromJira(querymode, filterID)
{
let today = start = moment().locale('ko');
//today = moment(today).add(9, 'Hour');
var snapshot = 0;
snapshot = today.format();
snapshot = snapshot.split('+');
snapshot = snapshot[0].replace(':', '-');
snapshot = snapshot.replace('... | [
"async function makeSnapshot_InitiativeInfofromJira(querymode, filterID)\n{\n let today = start = moment().locale('ko');\n //today = moment(today).add(9, 'Hour');\n var snapshot = 0; \n snapshot = today.format();\n snapshot = snapshot.split('+');\n snapshot = snapshot[0].replace(':', '-');\n snapshot = snaps... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fonction callBack appele en retour du module initApplication param1 err objet , si present throw error param2 objet a fusionner avec l'objet global Apllication Appele le module server en lui passant la valeur du port | function startAppli (err,oApplication){
if(err){
console.log(err.message);
}
else{
// Merge Application object with oApplication
var oTemp = Object.assign(Application,oApplication);
Application = oTemp;
logger.log("Application : ", util.ins... | [
"function app_init() {\r\n global = lib('globals');\r\n server = lib('server');\r\n app = lib('application');\r\n sys = app.sys = lib('system');\r\n req = app.req = lib('request');\r\n res = app.res = lib('response');\r\n req.router = lib('router');\r\n app.model = lib('model');\r\n app.util = lib('util');... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this function is to check clan is enabled or not if enabled then call function 'accessSpreadsheet2' | async function accessSpreadsheet(msg, clan_name) {
await doc.useServiceAccountAuth({
client_email: creds.client_email,
private_key: creds.private_key,
});
await doc.loadInfo();
console.log(doc.title);
const sheet = doc.sheetsByIndex[0];
const rows = await sheet.getRows({});
var sheetarr = [];
... | [
"function board_check_sheet_accessLevel(sheetID,cbfunction) {\n\t//console.log(\"board_check_sheet_accessLevel start\");\n\n\tgapi.client.sheets.spreadsheets.get({\n\t\tspreadsheetId: sheetID,\n\t\tincludeGridData: false,\n\t\tranges: \"A1\",\n\t\tfields:\"sheets\"\n\t}).then(function(response) {\n\t\tif (response.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
nextColor could be completely random, if desired | function nextColor() {
c = colors[ count % color.length]
count = count + 1
return c
} | [
"function rndColor() {\n var iRed = Math.floor((Math.random() * 255) + 1);\n var iGreen = Math.floor((Math.random() * 255) + 1);\n var iBlue = Math.floor((Math.random() * 255) + 1);\n\n $(\"#red\").slider(\"value\", iRed);\n $(\"#green\").slider(\"value\", iGre... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Make sure the given regexp has a $ at its end and, if `start` is true, a ^ at its start. | function ensureAnchor(expr, start) {
var _a;
let { source } = expr;
let addStart = start && source[0] != "^", addEnd = source[source.length - 1] != "$";
if (!addStart && !addEnd)
return expr;
return new RegExp(`${addStart ? "^" : ""}(?:${source})${addEnd ? "$" : ""}`, (_a = expr.flags) !== n... | [
"function ensureAnchor(expr, start) {\n var _a\n let { source } = expr\n let addStart = start && source[0] != '^',\n addEnd = source[source.length - 1] != '$'\n if (!addStart && !addEnd) return expr\n return new RegExp(\n `${addStart ? '^' : ''}(?:${source})${addEnd ? '$' : ''... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A prepositional phrase is going to declare in what direction, how far, and by what unit or some combination thereof. Some prepositions also declare targets. | function PrepositionalPhrase(preposition) {
this.preposition = preposition;
this.active = true;
this.amount = undefined;
this.unit = undefined;
this.targets = [];
} | [
"function Phrase(options) {\r\n\r\n\tthis.lire = function () {\r\n\t\treturn this.corps;\r\n\t};\r\n\r\n\tthis.__assembler = function (texte) {\r\n\t\tvar resultat = texte.join(\" \");\r\n\t\tvar point = probaSwitch(Grimoire.recupererListe(\"PF\"), this.PROBA_POINT_FINAL);\r\n\t\tresultat = resultat.replace(/ \\,/g... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Call to hide Spinner | hideSpinner() {
this.spinnerVisible = false;
} | [
"function showSpinner() {\n $(options.selectors.placesContent).addClass('hidden');\n $(options.selectors.spinner).removeClass('hidden');\n }",
"loadSpinner(display){\n document.querySelector(\".contenido-spinner\").style.display = display;\n document.querySelector(\"#resultado\").style.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
delete areas specified by id | async removeAreas() {
const areas = this.ctx.request.body;
let del = true;
for (const area of areas.areas) {
if (!await this.service.areas.delete({ id: area.id })) {
del = false;
}
}
if (!del) {
... | [
"deleteRegionById(id) {\r\n const region = this.lookupRegionByID(id);\r\n if (region != null) {\r\n this.deleteRegion(region);\r\n }\r\n if (this.callbacks.onManipulationEnd !== null) {\r\n this.callbacks.onManipulationEnd();\r\n }\r\n }",
"function gui_... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if provided coordinates are inside polygon defined by this Path | contains(x, y) {
return inside([x, y], this.polygon);
} | [
"function insideAnyPolygon(point, vs) { \r\n if(typeof vs == 'string'){\r\n\t vs = JSON.parse(vs);\t \r\n }\r\n if(typeof point == 'string'){\r\n\t point = JSON.parse(point);\t \r\n }\r\n var isInside = false; \r\n var isArray = Array.isArray(vs);\r\n var lengthArray = 0;\r\n if(isArray){\r\n \tl... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to pull updates from github repo | function updatePull(scan_id){
var gitPullCommand = 'git pull';
console.log("Pulling updates from Github ...");
exec(gitPullCommand,function (error, stdout, stderr){
updatePullCallback(scan_id, error, stdout, stderr);
});
} | [
"function checkForUpdates(){\n return new Promise((resolve, reject) => {\n console.log(\"Checking for updates on the trijam git..\");\n shell.exec('git pull', (code,stderr,stdout) => {\n if (stdout) {\n console.log(code); \n shell.exec('npm i', (code,stderr,... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Recursively checks whether an object has any undefined values inside. | function hasUndefined(obj) {
if (obj === undefined) {
return true;
}
if (obj) {
if (Array.isArray(obj)) {
for (var i = 0, len = obj.length; i < len; i++) {
if (hasUndefined(obj[i])) {
return true;
}
... | [
"function isEmpty(obj) {\n\treturn Object.entries(obj).length === 0 && obj.constructor === Object\n}",
"static _validateNoUndefinedMembers(jsonObject, keyPath) {\n if (!jsonObject) {\n return;\n }\n if (typeof jsonObject === 'object') {\n for (const key of Object.keys(js... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the number of usages of the given name in the given node. | function countVariableUsages(node, name) {
var numUsages = 0;
decaffeinate_parser_1.traverse(node, function (child) {
if (child instanceof nodes_1.Identifier && child.data === name) {
numUsages += 1;
}
});
return numUsages;
} | [
"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}",
"function addToUsedCount( dict, name ){\n\tif(! dict[ name ] ){\n\t\tdict[ name ] = 1;\n\t} else {\n\t\tdict... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Exit a parse tree produced by Java9ParserpostfixExpression. | exitPostfixExpression(ctx) {
} | [
"exitPostfixUnaryExpression(ctx) {\n\t}",
"exitPostIncrementExpression_lf_postfixExpression(ctx) {\n\t}",
"exitPostfixUnaryOperation(ctx) {\n\t}",
"exitPostDecrementExpression_lf_postfixExpression(ctx) {\n\t}",
"exitPostDecrementExpression(ctx) {\n\t}",
"enterPostfixUnaryExpression(ctx) {\n\t}",
"exitPr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to calculate distinct authors count | findDistinctCount(filteredsearchQuotesList) {
const unique = [
...new Set(filteredsearchQuotesList.map(quote => quote.quoteAuthor))
];
return unique.length;
} | [
"function countTopAuthors() {\n var data = library.authors;\n model.data.top_authors =\n data\n .map(function (x, i) {\n return { id: i, data: x };\n })\n .sort(f... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FUNCTION NAME : connSanInit AUTHOR : Clarice Salanda DATE : March 15, 2014 MODIFIED BY : REVISION DATE : REVISION : DESCRIPTION : initializes data in table PARAMETERS : RETURN : | function connSanInit(){
var connStat='';
var connSanityStat='';
if(globalInfoType == "JSON"){
var devices = getDevicesNodeJSON();
}else{
var devices =devicesArr;
}
for(var i = 0; i < devices.length; i++){
connStat+="<tr>";
connStat+="<td>"+devices[i].HostName+"</td>";
connStat+="<td>"... | [
"function linkSanInit(){\n\tvar linkStat='';\n\tvar linkSanityStat='';\n\tif(globalInfoType == \"JSON\"){\n var devices = getDevicesNodeJSON();\n }else{\n var devices =devicesArr;\n }\n\tfor(var i = 0; i < devices.length; i++){\n\t\tlinkStat+=\"<tr>\";\n\t\tlinkStat+=\"<td>\"+devices[i].HostNam... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get collector on remote nodeconsole | function getRemoteCollector (name, host) {
var col=host + "-" + name;
if (!remoteList) remoteList = [];
if (!remoteList[col]) {
var RC = require('../class/RemoteCollector');
remoteList[col] = new RC(name, host);
}
return remoteList[col];
} | [
"function collectstorm(){\n var URL = 'http://138.197.175.19:3000/stats_dfs';\n\n request.get(URL, function(err, resp, body){\n if(!err && resp.statusCode == 200){\n //convert data to json\n var data = JSON.parse(body);\n stormdata.push(data);\n }\n })\n //... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function for previous button animation, takes the id of previous view and current view as parameters | function previous(previous_view_id, current_view_id) {
//Hiding the current view
$(current_view_id).hide();
//Making the previous view appear with a animation
$(previous_view_id).slideUpShow();
} | [
"function onPrevButtonClick() {\n\t\tgotoPrevSlide()\n\t}",
"function previousClicked() {\n if (currentFeed && currentItemIndex > 0) {\n currentItemIndex--;\n displayCurrentItem();\n }\n }",
"goToPreviousSlide() {\n this._goToSlide(this.previousSlideIndex, false, fa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Every tenth time the trees are grown, invoke the trim method. Pass one value to the method for the pear tree, and a larger value to the method on the oak tree. | function trimTrees (pearAmount, oakAmount) {
PearTree.trim(pearAmount);
OakTree.trim(oakAmount);
} | [
"prune(callback) {\n if (_.isArray(this.contents)) {\n const length = this.contents.length;\n\n if ((this.type === \"REPEAT\" && length > 0) || (this.type === \"REPEAT1\" && length > 1)) {\n // Any subtree may be removed\n for (let i = 0; i < length; i++) {\n const tree = _.clone... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Applies all filters to a data item (an encounter). Returns true if the item passes all the filters. Suitable for invocation in Array.filter() In adition, it passes filtered encounters to each filter, so it could update its lists of options | static filter(encounter, only_obj) {
// Apply all filters and check if the encounter passes them
var passed = filterRegistry.every(f => f.applyFilter(encounter));
// Additional loop for encounters that passed the filters
// They are used to update option lists, so that they contain only... | [
"passesFilter(item) {\n //Fetch filter\n let filter = this.props.filter;\n if (filter.rarity === \"0\" || filter.rarity === item.rarity) { //Check if it passes rarity\n if (filter.type === \"0\" || filter.type === item.type) { //Check if item passes type-check\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Webmercator coordinate range (Earth's circumference) | function projectToWebMercator(latLng) {
let lat = latLng.lat * DEG2RAD;
let lng = latLng.lng * DEG2RAD;
let x = lng * EARTH_RADIUS;
let y = Math.log(Math.tan(lat / 2 + Math.PI / 4)) * EARTH_RADIUS;
return { x, y };
} | [
"function getMiddleLocation() {\n return { i: HORIZONTALRADIUS, j: VERTICALRADIUS }\n}",
"function getWebMercatorBoundingBoxFromXYZ (x, y, zoom) {\n const tilesPerSide = tilesPerSideWithZoom(zoom)\n const tileSize = tileSizeWithTilesPerSide(tilesPerSide)\n let minLon = (-1 * WEB_MERCATOR_HALF_WORLD_WIDTH) +... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Format date ddMMyyyy to dd/MM/yyyy | function formatDateddMMyyyy(d){
return d.substr(0,2) + '/' + d.substr(2,2) + '/' + d.substr(4,4) ;
} | [
"dateformat(date) { return \"\"; }",
"function format_day_string (val, format) {\r\n\tvar d = new Date(val);\r\n\tformat = format.replace('yyyy', d.getFullYear());\r\n\tformat = format.replace('MM', d.getMonth() + 1);\r\n\tformat = format.replace('dd', d.getDate());\r\n\treturn format;\r\n}",
"function formatDa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
helper function for shortestPathTo() if after doing bfs(), visitedBfs is still false, this means no edge to that vertex | function hasPathTo(v) {
return this.visitedBfs[v];
} | [
"function bfs(v) {\n var queue = [];\n if (this.adj[v] === undefined) { \n console.log(v + \" is not part of this graph\");\n return false;\n }\n this.visitedBfs[v] = true;\n queue.push(v);\n while (queue.length > 0) {\n var w = queue.shift();\n console.log(\"visited... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
System related calls Get the system (server) time See: ``` api.getSystemTime() ``` Returns promise yielding UTC timestamp (date) of server | getSystemTime () {
return this._apiRequest('/system/utc_timestamp', 'GET',
undefined, (res) => { return new Date(res.utc_timestamp * 1000) })
} | [
"async getSysUpTime()\n {\n return ((new Date()).getTime() - this.cache.startTime.getTime()) / 10;\n }",
"timestamp() {\n return this._d.get(\"time\");\n }",
"updateSystemTime(event) {\n\t\t// console.log(event);\n\t\tthis.stateSpace.systemTime = event.executionTime;\n\t}",
"function getTimeSta... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Helper function to seed the database with sample jobs | function seedJobs() {
return findJobs({}).then(function(collection) {
if (collection.length === 0) {
return Promise.map(jobs, function(job) {
return createJob(job);
});
}
});
} | [
"function seed() {\n process.env.ENVIRONMENT = 'test';\n const test = require('./config/db');\n const db = require('./db');\n\n return shared.importDB(test, sql_file).then(() => {\n // various deleting commands\n const seed = require('./seed') || [];\n // various seeding commands\n return Promise.al... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Emitted when an editor is created. Creating a diff editor might cause this listener to be invoked with the two editors. | function onDidCreateEditor(listener) {
return standaloneServices_js_1.StaticServices.codeEditorService.get().onCodeEditorAdd(function (editor) {
listener(editor);
});
} | [
"listenEditorToggle() {\n const editorToggleEl = h.getEditorToggleLink();\n editorToggleEl.addEventListener('click', function () {\n editor.toggle();\n event.preventDefault();\n }, false);\n }",
"handleEditorInit( editor ) {\n this.editor = editor;\n\n this.se... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Event handler registration. If disconnect is true, it'll return a function that unregisters the handler. | function connect(node, type, handler, disconnect) {
if (typeof node.addEventListener == "function") {
node.addEventListener(type, handler, false);
if (disconnect) return function() {node.removeEventListener(type, handler, false);};
} else {
var wrapHandler = function(event) {handler(event || w... | [
"_registerEvent () {}",
"function registerBlockAndReloadHandlers() {\n // Unregister the handlers before re-registering them\n unRegisterBlockAndReloadHandlers();\n\n // It seems to me that there are 3 approaches here:\n // (Option A)\n // 1) Register 1 listener with 1 URL that intercepts all URLs.\n // ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
set attributes for a canvas line set rand = false to limit amount of random colors used | function getLineAttributes(rand = true) {
let colors = ["#8093F1", "#F9DC5C", "#EA526F", "#70F8BA", "#1B98E0", ];
let lineWidth = 10;
let lineCap = "round";
let strokeStyle = colors[Math.floor(Math.random()*5)];
if(rand == true) {
strokeStyle = `rgba(${Math.random()... | [
"function randomColour() {\r\n pattern.push(colours[Math.floor(Math.random() * 4)]);\r\n animations(pattern);\r\n levelAndScoreCount();\r\n\r\n}",
"function randomizeAreaX(line, col, lines, cols) {\r\n //\r\n const colEnd = Math.min(col + cols, COLUMNS)\r\n const randomByte = () => Math.floor(Math.ran... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the verbose history for the current game | getHistory () {
return this.game.history({ verbose: true })
} | [
"function showHistory() {\n\n\t}",
"getHistory () {\n return this._historyStore.list();\n }",
"getHistory(){\n\t\treturn this.history;\n\t}",
"async history (channel) {\n\t\tconst response = await this.pubnub.history(\n\t\t\t{ channel: channel }\n\t\t);\n\t\tif (!response || !(response.messages inst... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
stripDomainName removes the domain name from a fully qualified hostname (if it exists). | function stripDomainName(fqdn) {
var name = "";
var pos = fqdn.indexOf(".");
if (pos != -1) {
name = fqdn.substring(0, fqdn.indexOf("."));
} else {
name = fqdn;
}
return name;
} | [
"checkDomainName()\n\t{\n\t\tthis.idDomainName.value =\n\t\t\tType.isString(this.idDomainName.value)\n\t\t\t\t? this.idDomainName.value.trim()\n\t\t\t\t: this.idDomainName.value\n\t\t;\n\t\tconst domainRe = RegExp('^[a-z0-9-]+\\.' + (this.tld) + '$');\n\n\t\tif (this.idDomainName.value === '')\n\t\t{\n\t\t\tthis.he... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
replace the img element by the applet specified in code | function invokejava(img)
{
var par = img.parentNode;
var p = document.createElement('div');
p.innerHTML = '<applet code="' + img.alt
+ '" width="' + img.width + '" height="' + img.height + '"></applet>';
par.replaceChild(p, img);
} | [
"function imageSwitch() {\n tmp = $(this).attr('src');\n $(this).attr('src', $(this).attr('alt_src'));\n $(this).attr('alt_src', tmp);\n }",
"function setPaperImg(){\n decision = \"paper\";\n document.getElementById('meImg').src = PAPERIMGPATH;\n}",
"function addGraphicsToLayout()\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function cardFlip if nothing inside the div and that the amount of memory cards turned is less than two The card can be flipped if no cards already flipped or that there is only one card flipped set the card as flipped and save them in the memory else if one card is flipped set the card as flipped and save them in the ... | function cardFlip(card, val) {
// nothing inside of div and cards in memory less then 2
if (card.innerHTML == '' && cardsStorage.length < 2) {
moveCounter(); // increase counter for 1
// flips card to front and shows it's letter
card.style.background = '#ffffff';
card.innerHTML = v... | [
"function flip() {\r\n if (stopFlip) return;\r\n //add the flip style to a clicked card\r\n this.classList.add(\"flip\");\r\n moveCount();\r\n pickedCards.push(this);\r\n // card 1 selected\r\n if (cardSelected === false) {\r\n cardSelected = true;\r\n cardOne = this;\r\n return;\r\n //card 2 sel... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
End of exitDock() Exit with Escape key | exitWithEscape() {
addEventListener("keyup", ({ key }) =>
key === "Escape" ? this.exitDock() : null
);
} | [
"closeOnEscape() {\n this.main.addEventListener(\"keydown\", e => {\n if (e.key == \"Escape\" && !e.ctrlKey && !e.shiftKey && !e.altKey) {\n this.close();\n }\n });\n this.main.focus();\n return this;\n }",
"function handleEscKeyboardPress() {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add updated theme count. | function addThemeCount() {
let themeJsonUrl = "https://theme-park.dev/themes.json"
return fetch(themeJsonUrl)
.then(response => {
return response.json();
}).then(json => {
document.getElementById("themeCount").innerHTML = `
theme.park contains ${Object.keys(json.applications).length} them... | [
"function setWordCount(wc) {\n wordCount = wc;\n document\n .querySelectorAll(\"#word-count > span\")\n .forEach((e) => (e.style.borderBottom = \"\"));\n document.querySelector(`#wc-${wordCount}`).style.borderBottom = \"2px solid\";\n\n // Change state\n vscode.setState({ ...extensionState,... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return the Julian Day of the most recent sunset starting from the given day at the given location on earth in degrees | function findRecentSunset(jd, latitude, longitude) {
var julianday = jd;
var time = calcSunsetUTC(julianday, latitude, longitude);
while(!isNumber(time)) {
julianday -= 1.0;
time = calcSunsetUTC(julianday, latitude, longitude);
}
return julianday;
} | [
"function findRecentSunrise(jd, latitude, longitude) {\n var julianday = jd;\n var time = calcSunriseUTC(julianday, latitude, longitude);\n while(!isNumber(time)) {\n julianday -= 1.0;\n time = calcSunriseUTC(julianday, latitude, longitude);\n }\n return julianday;\n}",
"function find... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
should parse big file | function parseBigFile() {
console.log("parse big file");
fs.readFile(__dirname + '/data/Song_List_by_Artist-NEW.rtf', 'utf8', function (err, data) {
if (err) {
console.log('error: ' + err);
}
let rtfParser = new RTFParser(data, standardIgnoreList);
rtfParser.parse(function (result) {
as... | [
"function readHugeFiles(dirName, processOnFileLine, onError) {\n\tfs.readdir(dirName, function(err, fileNames) {\n\t\tif(err) {\n\t\t\tonError(err)\n\t\t\treturn\n\t\t}\n\n\t\t//Now we have all fileNames....\n\t\tfileNames.forEach(function(fileName) {\n\t\t\tvar filePath = path.join(dirName, fileName)\n\n\t\t\tvar ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets disabled state for each option to current group disabled state. | updateOptionsDisabledState() {
this.options.forEach((option) => option.setDisabledByGroupState(this.disabled));
} | [
"onDisabled() {\n this.updateInvalid();\n }",
"set disabled(value) {\n const isDisabled = Boolean(value);\n if (this._disabled == isDisabled)\n return;\n this._disabled = isDisabled;\n this._safelySetAttribute('disabled', isDisabled);\n this.setAttribute('aria-disabled', ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |