query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Displays position of the rover after apply a command. | function displayPosition() {
console.log("Rover Current Position: [" + myRover.position[0] + ", " + myRover.position[1] + "]");
} | [
"display() {\n this.draw(this.points.length);\n }",
"function displayGoal() {\n // Make the message disappear when a game over happens\n if (state === \"GAMEOVER\") {\n return;\n }\n push();\n // Setting the aesthetics\n fill(255);\n textFont(neoFont);\n textSize(64);\n textAlign(CENTER, CEN... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Opens the windowview that contains location information that Javascript can display | function openLocationInfo(){
var myWindow=window.open("","","width=1000,height=300");
myWindow.document.write("Site is hoasted on: " + location.host + "("+ location.hostname + ":" + (location.port ? location.port : "?") + ")<br>");
myWindow.document.write("Site URL: "+ location.href + "<br>");
myWindow.document.wri... | [
"function detailsClick(ipaddr)\n{\n window.open(\"details.html?ipaddr=\"+ipaddr, '_blank').focus();\n}",
"openInfoWindow() {\n myMap.closeTempInfoWindow();\n PermMarker.permInfoWindow.open(this);\n }",
"function showInfoWindow() {\n var marker = this;\n hotels.getDetails({placeId: marker.placeRe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Callback function for the WorkOrderService/Create API call. | function workOrderCreateCallback(response) {
// If the response is good, inform the user of successful work order creation.
// Send the new Work Order Sid to the addComment function.
// If the response is bad, inform the user of failure.
} | [
"function workOrderCreate() {\n // Define the data object and include the needed parameters.\n // Make the Create API call and assign a callback function.\n}",
"createOrder(orderOptions) {\n const params = _.merge(orderOptions, this.getAuthParams());\n\n return this.getRequestPromise('orders.c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
update row from core_tickData_ query | async update(params) {
try {
const updateCore_tickData = `UPDATE core_tickData_${params.feed} set symbol='${params.symbol}'
, date='${params.date}' ,price=${params.price}, volume=${params.volume}
WHERE id=${params.id} AND ca='${params.ca}' IF EXISTS`;
return awai... | [
"function updateQuantity () {\n connection.query(\"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: newStockNum\n },\n {\n item_id: itemSelected\n }\n ], function (err, results) {\n if (err) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
helper function for sorting details based on type (person or movie) | async sortDetails(detailsObj) {
const type = this.props.match.params.type;
if (type === 'person') {
const movies = await this.getDetailResults(detailsObj.films);
return {
name: detailsObj.name,
birthYear: detailsObj.birth_year,
gender: detailsObj.gender,
eyeColor: d... | [
"function typeComparator(auto1, auto2)\n{\n /************************************************************************************\n * orderType *\n * This function takes an automobile object as a parameter and then checks the type *\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Lights up the winning path from start to end. Today, the winning path is the same color as the regular path when it is being explored. But it can be changed. | function lightUpWinningPath(node) {
console.log("WINNING PATH FOUND");
curr = node;
while (curr) {
curr.fillType = 3;
curr = curr.parent;
}
startPathFinding = false;
} | [
"function create_rainbow() {\r\n player_pos(player_current_pos_x, player_current_pos_y).classList.remove('path')\r\n player_pos(player_current_pos_x, player_current_pos_y).classList.remove('start')\r\n player_pos(player_current_pos_x, player_current_pos_y).classList.add('path_rainbow')\r\n}",
"function a... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Save scores using xhr | function xhr_save_score() {
var saveable_scores = [];
var game_id = scorecard.data("game_id");
scorecard.find("tbody td").each(function(i, el) {
var el = $(el);
// Grab values for this cell
var player_id = el.data("player_id");
var coursehole_id ... | [
"async function addNewScore(e) {\n e.preventDefault();\n const response = await fetch(\"/scoreboard\", {\n method: \"POST\",\n headers: { \"content-type\": \"application/json\" },\n body: JSON.stringify(gatherInputData()),\n });\n const data = await response.json();\n console.log(data);\n getAllScore... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Helper function for validateField(). Checks if the key pressed is valid | function isKeyPressedValid(e) {
return (e.keyCode == 8 || e.keyCode == 46) || // backspace and delete keys
(e.keyCode > 47 && e.keyCode < 58) || // number keys
(e.keyCode == 32) || // spacebar & return key(s)
(e.keyCode > 64 && e.keyCode < 91) || ... | [
"function validateKey() {\n if ($(this).val()) {\n if ($(this).val().match(/^[A-Za-z0-9]*$/)) return hideError($(this).parent().children(\".error\"));\n else return validationError($(this).parent().children(\".error\"), i18n.KEY_VALIDATION_MESSAGE)\n }\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add Imojie To The Canvas By Adding A New Line To "gMene Array" | function imojieClick(emojie) {
gMeme.lines.push({
txt: `${emojie}`,
size: 20,
align: 'left',
color: 'red',
x: 250,
y: 300
}, )
gMeme.selectedLineIdx = gMeme.lines.length - 1
drawImgText(elImgText)
} | [
"function addSmileys(type, bbcodeBarId){\r\n // reset smilies\r\n if($(bbcodeBarId + \" .smiley_box_cont\").get(0)) {$(bbcodeBarId + \" .smiley_box_cont\").get(0).innerHTML='';}\r\n // add smilies\r\n for(var e in smileyArray[type]){\r\n if(smileyArray[type].hasOwnProperty(e)) {\r\n $(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
It will return the public key to the client by reading the pem file from the keystore asynchronously The public key is generated by the Node server when it starts for the first time and the key is stored as a pem file. | function getPublicKey(req, res) {
var key_path = './server/keystore/key/public_key.pem';
return g_fs.readFileAsync(key_path, "ascii")
.then(function (content) {
return res.send(content);
})
.catch(function (exception) {
console.log("err... | [
"async _publicKeyFromCertificate (crtPath) {\n let output = '';\n await this.opensslCommand(\n ['x509', '-noout', '-in', crtPath, '-pubkey', '-outform', 'pem'],\n (o => { output += o; })\n );\n return output;\n }",
"async function getKeystore () {\n logger.log('verbose', 'Importing private... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a new document type declaration. `qualifiedName` qualified name of the document type to be created `publicId` public identifier of the external subset `systemId` system identifier of the external subset | createDocumentType(qualifiedName, publicId, systemId) {
throw new Error("This DOM method is not implemented.");
} | [
"create({\n name = \"New document\", width = 1000, height = 1000, layers = [], selections = {}\n } = {}) {\n if ( !layers.length ) {\n layers = [ LayerFactory.create({ width, height }) ];\n }\n return {\n id: `doc_${( ++UID_COUNTER )}`,\n layers,\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
While the scrape process is in motion, I take the first entry of the babesQ, open it in a new tab, and send the scrape request there. | function scrapePage(babesQ) {
console.log('Scrape page function loaded!', babesQ);
var url = babesQ[0];
chrome.tabs.create({
url: url,
active: true
}, function(){
sendScrapeRequest(url);
});
} | [
"function doOpenTool_newTab(url)\n{\n var br = getBrowser();\n br.selectedTab = br.addTab(url);\n}",
"function scrapeSingleCategoryPage(inputUrl, page){\n incrementRequests();\n\n var categoryPage = inputUrl + \"&p=\" + page;\n request(categoryPage, function (err, resp, body) {\n if (err)\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
generate a secure random coupon code for box type `boxType` | async function generateCouponCode(boxType) {
let couponCode = "";
for(let j = 0; j < 16; j++) {
couponCode += String.fromCharCode(await secureRandomInRange(65, 90));
}
couponCode += "_" + BOX_TYPES[boxType].replace(/\s/, "_");
return couponCode;
} | [
"function generate_discount_code() {\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\n for (var i = 0; i < 10; i++)\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n\n return \"#\" + text;\n}",
"generateCode() {\n retu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
load and display grades in a bootstrap list group | function displayGrades(grades) {
//console.log(grades);
const items = grades.map(grade => {
return `<a href="#" class="list-group-item list-group-item-action" onclick="updateStudentsGradesView(${grade.grade_id})">${grade.grade}</a>`;
});
// Add an All grades link at the start
items.unshift(
`<a href=... | [
"function HeliumGrades() {\n \"use strict\";\n\n this.ajax_calls = [];\n this.course_groups = null;\n this.courses_for_course_group = null;\n this.categories_for_course = null;\n this.grade_points_for_course_group = null;\n\n /*******************************************\n * Functions\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Remove stock and update chart | removeStock(stockSymbol) {
// for best user experience, immediately remove stock from stoock table,
// and update chart
const stockElement = document.querySelector('.stock[data-symbol="' + `${stockSymbol.toLowerCase()}` + '"]');
this.removeStockFromStockTable(stockElement);
this... | [
"removeStockFromChart(symbol) {\n for (let i = 0, n = this.stockChart.series.length; i < n; i++) {\n const series = this.stockChart.series[i];\n if (series.name === symbol) {\n this.stockChart.series[i].remove();\n return;\n }\n }\n }",... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create either an HTTP or HTTPS server based on environment. | function createServer (app) {
const protocol = getProtocol()
if (protocol === 'http:') {
logger.debug('creating http server')
return require('http').createServer(app)
} else {
if (process.env.SP_KEY_FILE && process.env.SP_CERT_FILE) {
// read the certificate authority file(s) if provided
c... | [
"static createForCurrentEnvironment(baseUrl, useHttps) {\n if (HttpClient.supportsXmlHttp()) {\n return new XmlHttpClient_1.XmlHttpClient(baseUrl, useHttps);\n } else {\n return new NodeHttpClient_1.NodeHttpClient(baseUrl, useHttps);\n }\n }",
"makeServer() {\n thi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Transform a single step into a sentence (in present tense). | function applyTemplate(step) {
// TODO: allow for variation within the templates.
let sentence = "";
let tokens = step.split(" ");
if (tokens.length == 2) {
// Length 2: simple swap of subject and verb
let verb = applyVerbTense("PRESENT", tokens[0]);
sentence += "The " + tokens[1] + " " + verb;
}... | [
"function step1a(token) {\n\tif(token.match(/(ss|i)es$/))\n\t\treturn token.replace(/(ss|i)es$/, '$1');\n\n\tif(token.substr(-1) == 's' && token.substr(-2, 1) != 's' && token.length > 3)\n\t\treturn token.replace(/s?$/, '');\n\n\treturn token;\n}",
"function getStepContent(step) {\r\n switch (step) {\r\n c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Verifies if the calendar widget has been placed in the page and if it is an inline calendar perform the initialization of the calendar widget. | function checkCalendarwidget() {
var inlineCalendarViewElement=document.getElementsByName("calendar_inline");
// Verify if the inline view is
if(inlineCalendarViewElement)
{
for(var i=0;i<inlineCalendarViewElement.length;i++)
{
var id=... | [
"function initCal() {\n const cal = document.querySelector('#calendar');\n const datepicker = new Datepicker(cal, {\n autohide: true\n });\n \n cal.addEventListener('changeDate', updatePlaykit);\n}",
"function initializePage() {\n\t\t$calendar.datepicker(\"setDate\", \"-1d\");\n\t\tvar dateObj = $calendar... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the number of documents to skip at the start of the result. | offset(count) {
if (typeof(count) == "number") Object.defineProperty(this, "skip", {value: count, configurable: true});
return this;
} | [
"function skipTenAuthors() {\n return new Promise((resolve, reject)=>{\n let skip = 10;\n getBooks();\n function getBooks(books = []) {\n Promise.resolve(books)\n .then((books)=>{\n return Author.find({}).skip(skip).limit(3)\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Only keep the useful roles | function cleanRoles(roles) {
var res = [];
roles.forEach(function (item) {
if (item === 'standard' || item === 'guest' || item === 'admin') {
res.push(item);
}
});
return res;
} | [
"function seperateRole(){\n\n}",
"static get noRole() { return NO_ROLE; }",
"function processRoleConditionRemoval(oldRole) {\n return relationshipHelper.getConditionalAndDirectGrants(oldRole, 'members', 'role').directGrants;\n }",
"function manageRoles(cmd){\n try{\n\t//console.log(cmd.message.chan... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Visit a parse tree produced by PlSqlParsersimple_case_when_part. | visitSimple_case_when_part(ctx) {
return this.visitChildren(ctx);
} | [
"visitSearched_case_when_part(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitSimple_case_statement(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitCase_statement(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitCase_else_part(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"vis... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initializes a new instance of `XMLElement` `parent` the parent node `name` element name `attributes` an object containing name/value pairs of attributes | constructor(parent, name, attributes) {
var child, j, len, ref;
super(parent);
if (name == null) {
throw new Error("Missing element name. " + this.debugInfo());
}
this.name = this.stringify.name(name);
this.type = NodeType.Element;
this.attribs = {};
... | [
"function Model(obj) {\n var parent = arguments[1] === undefined ? null : arguments[1];\n\n _classCallCheck(this, Model);\n\n // cloning\n if (obj instanceof Model) {\n var clone = obj;\n this.attributeDefinitions = clone.attributeDefinitions;\n this.elem... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
When this effect represents acquisition of a resource (for example, opening a file, launching a thread, etc.), `bracket` can be used to ensure the acquisition is not interrupted and the resource is always released. The function does two things: 1. Ensures this effect, which acquires the resource, will not be interrupte... | function bracket_(acquire, use, release, __trace) {
return (0, _bracketExit.bracketExit_)(acquire, use, release, __trace);
} | [
"function bracket(use, release, __trace) {\n return acquire => bracket_(acquire, use, release, __trace);\n}",
"release() {\n /* This is executed inside of a try-catch because if the connection was released, throws an error. */\n try {\n this.connection.release();\n } catch (err) {... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Helpers shorthand for getting root compiler | function getRoot (compiler) {
while (compiler.parentCompiler) {
compiler = compiler.parentCompiler
}
return compiler
} | [
"function getRoot(cwd, filename, smap) {\n var relativePath = path.relative(cwd, filename);\n\n var segments = relativePath.split('node_modules');\n\n var sourceRoot = smap.getProperty('sourceRoot') || '/source/' + relativePath;\n\n if (segments.length <= 1) {\n return sourceRoot;\n } else {\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return duration from the task name | function duration_from_task_dictionary(item) {
item_name = item.content
item_has_time = item_name.indexOf("|") != -1 && item_name.indexOf("[") != -1 && item_name.indexOf("]") != -1
if (item_has_time) {
var duration = parseInt(item_name.substring(item_name.lastIndexOf("|") + 1, item_name.lastIndexOf(... | [
"function getCustomTaskTime(taskName) {\n var res = taskName.match(/\\(([0-9]+)\\)/);\n if (res === null) return \"\";\n\n return res[1];\n }",
"static calculateDuration (duration) {\n let seconds = duration * 15\n let days = Math.floor(seconds / (3600 * 24))\n seconds -= days * 3600 * ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given a string, return a new string where "not " has been added to the front. However, if the string already begins with "not", return the string unchanged. ! | function notString(str) {
if (str.length >= 3 && str.startsWith("not")) {
return str;
}
else {
return "not " + str;
}
} | [
"function amazingEdabit(str) {\n\treturn !str.includes('edabit') ? str.replace('amazing', 'not amazing') : str;\n}",
"function stirvify(string) {\n // let newString = string.slice(0,7) === \"Strive\"? string: \"Strive \"+ string\n\n return string.startsWith(\"Strive\") ? string : \"Strive\" + string;\n}",
"fu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initializes the commands which act as shortcuts to the available fighting game configuration, to make it easier for players to start a game. | initializeCommands() {
for (const filename of glob(kCommandDirectory, '.*fights[\\\\/][^\\\\/]*\.json$')) {
const configuration = JSON.parse(readFile(kCommandDirectory + filename));
const settings = new Map();
for (const [ identifier, value ] of Object.entries(configuration.... | [
"function loadBotCommands(){\r\n var emptyFunc = function (){};\r\n\r\n commands.set('modCommands',\"$autoclean\",emptyFunc);\r\n commands.set('modCommands',\"$addRandom \",emptyFunc);\r\n commands.set('modCommands',\"$addToUserBlacklist \",emptyFunc);\r\n commands.set('modCommands',\"$addToVideo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds the missing defaults to the provided props object. This function mutates the props object. Taken from `ReactCompositeComponent.mountComponent`. | function fillDefaultProps(props, defaultProps) {
for (var propName in defaultProps) {
if (typeof props[propName] === 'undefined') {
props[propName] = defaultProps[propName];
}
}
} | [
"function filterDefaultProps(props, defaultProps) {\n let [, resultProps] = (0, _tools.extractInObject)(defaultProps, Object.keys(props));\n return resultProps;\n}",
"function filterDefaultProps(props, defaultProps) {\n let [, resultProps] = extractInObject(defaultProps, Object.keys(props));\n return resultPr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
INPUT: ["Here", "is", "the", "first", "sentence", "And", "finally", "the", "third", "sentence"] HINTS: Create a map, Loop through the elements of the array of words Update the map Sort the map by value in descending order let sorted = Array.from(map).sort((a, b) => b[1] a[1]); Finally, print the result in format as the... | function main(wordArray){
let map = new Map();
wordList = [];
for(let string of wordArray){
let counter = 1;
if(map.has(string)){
let wordCount = map.get(string);
map.set(string, wordCount + 1);
}else{
map.set(string, counter);
}
... | [
"function sort(wordFreqs) {\n var listOfWordFreqs = Object.keys(wordFreqs).map(function(key) {\n return [key, wordFreqs[key]];\n });\n\n listOfWordFreqs.sort(function(word1, word2) {\n return word2[1] - word1[1];\n });\n\n \n return listOfWordFreqs;\n}",
"function sortText(wordList... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Apply node hover to graph | applyNodeHover(enable, nodes, links){
// unhover all
let opacity = enable ? (this.graph.config.activeNodeId ? 0.4 : 0.3) : 1;
this.nodes.selectAll(".contents").transition().duration(400 * this.animDurationFactor).style("opacity",opacity);
this.linksGroup.selectAll(".link").style("opacity",opacity * 0.5);
if... | [
"function highlightNode(d) {\n d3.select(\"#node_\" + d.idx)\n .transition().duration(100)\n .attr(\"r\",sizes[d.idx]*r*1.3)\n .style(\"stroke\",d3.rgb(0,0,0));\n}",
"onMouseEnter() {\n\t\tthis.props.hoverAction('true');\n\t}",
"function hover(zipList, treemapFilters, zip) {\n d3.selectAll(\"path... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the version of a dependency being used by a given project | _getDependencyVersion(dependencyName, tempProjectName) {
const tempProjectDependencyKey = this._getTempProjectKey(tempProjectName);
const packageDescription = this._getPackageDescription(tempProjectDependencyKey);
if (!packageDescription) {
return undefined;
}
if (!pa... | [
"getTopLevelDependencyVersion(dependencyName) {\n return BaseShrinkwrapFile_1.BaseShrinkwrapFile.tryGetValue(this._shrinkwrapJson.dependencies, dependencyName);\n }",
"tryEnsureDependencyVersion(dependencyName, tempProjectName, versionRange) {\n // PNPM doesn't have the same advantage of NPM, whe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
serializeResourceProperties walks the props object passed in, awaiting all interior promises besides those for `id` and `urn`, creating a reasonable POJO object that can be remoted over to registerResource. | function serializeResourceProperties(label, props, opts) {
return __awaiter(this, void 0, void 0, function* () {
return serializeFilteredProperties(label, props, (key) => key !== "id" && key !== "urn", opts);
});
} | [
"function serializeProperty(ctx, prop, dependentResources, opts) {\n return __awaiter(this, void 0, void 0, function* () {\n // IMPORTANT:\n // IMPORTANT: Keep this in sync with serializePropertiesSync in invoke.ts\n // IMPORTANT:\n if (prop === undefined ||\n prop === null... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the topic matching the specified name, approximately. If no matching topic is found, returns undefined. | function findTopic(name) {
for (var i = 0, n = data.topics.length, t; i < n; ++i) {
if ((t = data.topics[i]).name === name || new RegExp("^" + (t = data.topics[i]).re.source + "$", "i").test(name)) {
return t;
}
}
} | [
"function add_topic() {\n\tvar name = prompt(\"Please Enter Topic Name\");\n\tif (name !== \"\" && name !== \" \" && name !== null) {\n\t\ttopics.search(\"subject='\" + cho_subject + \"' and name='\" + name + \"' and class_id='\" + _class + \"'\", \"COUNT(*) as tot\", function(results) {\n\t\t\tif (parseInt(results... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Navigate to notebooks page. | redirect() {
Radio.request('utils/Url', 'navigate', {
trigger : false,
url : '/notebooks',
includeProfile : true,
});
} | [
"function goToPage(pageNr){\r\n\r\n}",
"function navigateTo() {\n let viewName = $(this).attr('data-target');\n showView(viewName)\n }",
"navigateToWebPage() {\n this[NavigationMixin.Navigate]({\n \"type\": \"standard__webPage\",\n \"attributes\": {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Hapi manages the request lifecycle through an internal eventbus; the standard Honeycomb `async_tracker` loses the context. Here we wrap the central router to ensure all handlers and their decomposed extension points pull in the right trace/span context. | function instrumentRoute(original) {
return function(routeOptions) {
// Hapi exposes six extension points:
// [onRequest, onPreAuth, onCredentials, onPostAuth, onPreHandler, onPostHandler, onPreResponse].
// Each can be configured on a route-by-route basis. Each handler is independently
... | [
"route() {\n return (request, response) => {\n Promise.all([bodyParser(request)]) \n .then(() => {\n logger.log(logger.INFO, `Router rec'd: ${request.method} ${request.url.pathname}`);\n // the line below retrieves the ROUTE callback using the request method and pathname\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Bottom Sheet controller for the avatar actions | function UserSheetController($mdBottomSheet) {
this.user = selectedUser;
this.items = [
{ name: 'Phone' , icon: 'phone' , icon_url: 'assets/svg/phone.svg' },
{ name: 'Twitter' , icon: 'twitter' , icon_url: 'assets/svg/twitter.svg' },
{ name: 'Google+' ... | [
"function coveragesController() {\n\n }",
"displayAvatar( message ){\n let allowedImageFileTypes = [ '.png', '.jpeg', '.jpg', '.gif' ];\n let accountWithAvatar;\n\n for( let account of this.accounts ){\n if( account.usernick === message.usernick ){\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get Microsoft builtin entities | static getMicrosoftBuiltinEntities() {
return [
'Number',
'Ordinal',
'Percentage',
'Age',
'Currency',
'Dimension',
'Temperature',
'DateTime',
'PhoneNumber',
'IpAddress',
// Disable booleans to handle it ourselves
// 'Boolean',
'Email',
... | [
"getAllEntities() {\n let queryParameters = {};\n let headerParams = this.defaultHeaders;\n let isFile = false;\n let formParams = {};\n return this.execute('GET', '/api/user/v1/role/get-all', queryParameters, headerParams, formParams, isFile, false, undefined);\n }",
"functi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Task2 1)Extract the selected fields/information from the given query. | function getSelectedQuery(query) {
var selectedfield = query.split('from')[0].split(' ')[1].trim();
console.log(selectedfield);
} | [
"function getGroupbyField(query) {\n var field = query.split('group by')[1].trim();\n // var filed = query.split('group by')[1].split('order by')[0].trim();\n console.log(field);\n}",
"function getFilterPart(query) {\n var filterpart = query.split('order by')[0].split('group by')[0].split('where')[1]... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
to count days left for weekly competition | daysLeft() {
let today = new Date();
let days = 7 - ((today.getDay() + 6) % 7);
return days;
} | [
"function totalDayWorked(numOfDays,dailyWage){\n if(dailyWage>0) return numOfDays+1;\n return numOfDays;\n}",
"function calcTotalDayAgain() {\n var eventCount = $this.find('.everyday .event-single').length;\n $this.find('.total-bar b').text(eventCount);\n $this.find(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
console.log(capIt('this is a string')); Function rangeRover(arr) The function will take an array of two numbers and return the sum of those two numbers AND all numbers between them. The lowest number will not always come first. For example rangeRover([1, 4]) should return 10, i.e.(1 + 2 + 3 + 4), rangeRover([4, 1]) sho... | function rangeRover(arr){
var a = arr[0];
var b = arr[1];
var reorganized = [];
var sum = 0;
if (a < b){
reorganized.push(a);
reorganized.push(b);
} else {
reorganized.push(b);
reorganized.push(a);
}
for (i = reorganized[0]; i <= reorganized[1]; i++){
... | [
"function rangeInArray(arr, num1=0, num2=arr[arr.length-1]){\n if (num2 > arr.length-1) num2 = arr.length-1;\n var sum = 0;\n for (var i=num1; i <= num2; i++){\n sum += arr[i]; \n }\n return sum;\n}",
"function sumRange(num1, num2) {\n let sum = num1 + num2;\n if (sum >= 50 && 80 >= sum) return 65;\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given a bindings function or object, create and return a new object that contains binding valueaccessors functions. This is used by ko.applyBindingsToNode. | function makeBindingAccessors(bindings, context, node) {
if (typeof bindings === 'function') {
return makeAccessorsFromFunction(bindings.bind(null, context, node));
} else {
return ko.utils.objectMap(bindings, makeValueAccessor);
}
} | [
"function addBindingProperty(e)\n {\n if(!e.binding)\n {\n e.binding = ko.dataFor(e.target);\n }\n\n return e;\n }",
"function Binding(value){\r\n\t\tthis.value= value;\r\n\t\tif(value){\r\n\t\t\tvalue._binding = this;\r\n\t\t}\r\n\t}",
"function keyhandlerBindingFac... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
checks if battle is over (via battleOver state) if user wins, sends PATCH request with updated scores array and updates users state updates battleOver, loggedInUser, and winner state | componentDidUpdate() {
let winner
let loser
if (this.state.battleOver === true && this.state.currentPlayerCat.power > this.state.currentAICat.power) {
winner = this.state.currentPlayerCat
loser = this.state.currentAICat
let score = (winner.power - loser.power) * 100
fetch(`https://eve... | [
"rally(winner) {\n if (1 <= this.game_over) {\n if (this.game_over < 2) {\n this.msg = txt_GameOver;\n this.game_over++;\n }\n } else if (winner == txt_Random) {\n if (this.servingTeam() == this.winningTeam()) {\n this.serve... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Considered static for navigation. | get NavigationStatic() {} | [
"getNavigation() {\n errors.throwNotImplemented(\"getting navigation (dequeue options)\");\n }",
"navigateConObject() {\n this[NavigationMixin.Navigate]({\n \"type\": \"standard__objectPage\",\n \"attributes\": {\n \"objectApiName\": \"Contact\",\n \"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Load point measurement time series. Expects two data sets: the measurements and the station list. Measurement should contain: stat, time, var. Station list should contain: stat, x, y, z. The function creates an object organized by time stamp. Each time stamp contains data for all stations. | function loadPointTimeSeries(measurements, locations, callback) {
// Read and transform measurements
var stats = new Set();
d3.tsv(measurements, function(d) {
stats.add(d.stat);
d.var = parseFloat(d.var);
d.t = new Date(d.time);
d.time = d.t.valueOf();
return d;
}, functio... | [
"function getSensorData(timePeriod) {\n // start new AJAX request\n const xhr = new XMLHttpRequest();\n xhr.open('GET', `/particle/data/${timePeriod}`, true);\n xhr.onload = function(){\n if(this.status === 200) {\n // Data successfully retreived. Parse then format.\n let da... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get survey files saved in DB to show in boxes | function getSurveys() {
$.ajax({
url: "http://localhost:8080/sendJson.php",
success: function (data) {
var arr = data.split('"');
var fileArr = []; //file array
for (let i = 1; i < arr.length; i += 2) {
fileArr.push(arr[i]);
}
... | [
"function pollFiles(url){\n var submissionId = url.split(\"/\").pop();\n\n $.ajax({\n url: '/submissions/'+ submissionId + '/files',\n type: 'GET',\n dataType: 'html',\n success: function(data, textStatus, jqXHR){\n if(data){\n $('#submission-files').html(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
stuff to shuffle movie array | function shuffleMovie(array) {
for (var i = array.length - 1; i > 0; i--) {
var j = Math.floor(Math.random() * (i + 1));
var temp = array[i];
array[i] = array[j];
array[j] = temp;
}
} | [
"function shuffleCards(array){\r\n\tfor (var i = 0; i < array.length; i++) {\r\n\t\tlet randomIndex = Math.floor(Math.random()*array.length);\r\n\t\tlet temp = array[i];\r\n\t\tarray[i] = array[randomIndex];\r\n\t\tarray[randomIndex] = temp;\r\n\t}\r\n}",
"function shuffle(){\n\t\n\t\tif(position == 0){ \n\t\t\tr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
called right after object instantiation to set the display value and bind click events | run() {
this.setDisplayValue();
this.bindClickHandlers();
} | [
"function reinitializeAppropriateDisplay() {\n updateEventVars(getNow());\n displayOnPage();\n }",
"function initDisplayClasses ()\n {\n\tshowByClass('type_occs');\n\tshowByClass('taxon_reso');\n\tshowByClass('advanced');\n\t\n\thideByClass('taxon_mods');\n\thideByClass('mult_cc3');\n\thideByC... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Takes a model space point and determines whether or not that point is inside or outside of the geometry. | isInside(modelSpacePoint) {
// jshint unused:vars
return false;
} | [
"function isInBounds(point) {\n\t\tif (point >= bounds.sw && point <= bounds.nw) {\n\t\t\tconsole.log(\"point in bounds\");\n\t\t}\n\t}",
"function isPointInView(p) {\n for (var i = 0; i < view_plane_normals.length; i++)\n if (dot([p.x-camera_location.x, \n\t\t\t\t\t p.y-camera_location.y, \n\t\t\t\t\t\t p.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
polyvecCompress lossily compresses and serializes a vector of polynomials. | function polyvecCompress(a, paramsK) {
a = polyvecCSubQ(a, paramsK);
var rr = 0;
var r = new Array(paramsPolyvecCompressedBytesK768);
var t = new Array(4);
for (var i = 0; i < paramsK; i++) {
for (var j = 0; j < paramsN / 4; j++) {
for (var k = 0; k < 4; k++) {
... | [
"function polyCompress(a, paramsK) {\r\n var t = new Array(8);\r\n a = polyCSubQ(a);\r\n var rr = 0;\r\n var r = new Array(paramsPolyCompressedBytesK768);\r\n for (var i = 0; i < paramsN / 8; i++) {\r\n for (var j = 0; j < 8; j++) {\r\n t[j] = byte(((a[8 * i + j] << 4) + paramsQ / 2... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the current super class (reverse inheritance) position depth for a directive. For example we have two directives: Child and Other (but Child is a subclass of Parent) // increment parentInstance>hostBindings() (depth = 1) // decrement childInstance>hostBindings() (depth = 0) otherInstance>hostBindings() (depth = 0 b... | function adjustActiveDirectiveSuperClassDepthPosition(delta) {
activeDirectiveSuperClassDepthPosition += delta;
// we keep track of the height value so that when the next directive is visited
// then Angular knows to generate a new directive id value which has taken into
// account how many sub-class di... | [
"get depth() {\n let d = 0;\n for (let p = this.parent; p; p = p.parent)\n d++;\n return d;\n }",
"setDepths() {\n this.r3a1_char_north.setDepth(50);\n this.r3a1_char_south.setDepth(50);\n this.r3a1_char_west.setDepth(50);\n this.r3a1_char_east.setDepth(50)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Build a Jira Ticket Status query from form values. Return the query URL. | async function buildJql() {
var project, status, inStatusFor;
project = document.getElementById("project").value;
status = document.getElementById("statusSelect").value;
inStatusFor = document.getElementById("daysPast").value
return STATUS_URL.replace(/\{project\}/, project).replace(/\{status\}/g, status).rep... | [
"function generateURLQuery()\n{\n var url=window.default_query + \"&xml=1&order_by=log_id\";\n if (window.last_log_id != -1)\n\turl += \"&log_id_op=>&log_id=\"+window.last_log_id;\n else\n\turl += \"&date_from=\"+window.start_date+\"&date_from_unit=gregorian\";\n\n if(window.user_id)\n\turl += \"&user_i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this will return a string of best match definition for a keyword | function getOneBestDefinition(arrayBestDefinitions, word){
var bestDef = arrayBestDefinitions.find(function(o){ return o.label == word; });
if (bestDef != null)
return bestDef.definition
else return 'Not found';
} | [
"function findsynonym(keyword, thesynonyms, cutoff){\n if(isUndefined(thesynonyms)){thesynonyms = synonyms;}\n if(isUndefined(cutoff)){cutoff = 0;}\n keyword = keyword.toLowerCase();\n var ret = \"\", parentID = -1, childID = -1, wordfound = \"\";\n for(var synonymparentindex = 0; synonymparentindex<... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
======================================================================== Process all histories just notifying ONCE per author ======================================================================== | function process_histories(issue, cb) {
if (! issue.changelog) return cb();
if (! issue.changelog.histories) return cb();
let authors = [];
function send(err) {
if (err) return cb(err);
if (authors.length == 0) return cb();
it(authors, cb, (author, cb3) => {
notify(issue, au... | [
"processEntries() {\n let previousMinute = new Date();\n // One minute ago.\n previousMinute = previousMinute.setMinutes(previousMinute.getMinutes() - 1);\n\n // Keep only \"new\" log entries (less than 1 minute)\n this.logEntries = reduce(this.logEntries, (list, entry) => {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This dispatches intents that target a specific player | static dispatchSecondaryIntent(squeezeserver, players, intent, session, lastname, callback) {
var intentName = intent.name;
// Get the name of the player to look-up from the intent slot if present
var name = ((typeof intent.slots !== "undefined") &&
(typeof intent.slots.Pl... | [
"function addModalPlayerActions() {\r\n var modalPlayers = Array.from(document.getElementsByClassName('modal-player-sprite-container'));\r\n modalPlayers.forEach(modalPlayer => {\r\n modalPlayer.addEventListener(\"click\", () => {\r\n changePlayer(modalPlayer);\r\n });\r\n });\r\n}... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
ensure that the popup image size matches the bg image size which is set to 'cover' | function resizeBlur() {
var aspectRatio = 1.5;
var width = $('#bg').outerWidth();
var height = $('#bg').outerHeight();
if (width/height >= aspectRatio) {
$('#popup-bg').css('background-size', width + 'px auto');
} else {
$('#popup-bg').css('background-size... | [
"function heri_popupCover(elm) {\n var newPic = heri_coverSize($(elm).attr('src'), 'l');\n $('div.popup-covers img.popup-cover').attr('src', newPic);\n $.facebox({div: '#comic-gn-popup'});\n}",
"function PopUp_Load_Complete() {\n _popUpInner.removeClass(\"loading\");\n var _... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Copyright 2017 Google Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS I... | function validateExactNumberOfArgs(functionName, args, numberOfArgs) {
if (args.length !== numberOfArgs) {
throw new __WEBPACK_IMPORTED_MODULE_1__error__["b" /* FirestoreError */](__WEBPACK_IMPORTED_MODULE_1__error__["a" /* Code */].INVALID_ARGUMENT, "Function " + functionName + "() requires " +
... | [
"function args_count(){\n return arguments.length;\n}",
"static checkCallbackFnOrThrow(callbackFn){if(!callbackFn){throw new ArgumentException('`callbackFn` is a required parameter, you cannot capture results without it.');}}",
"legalArguments(args, params) {\n doCheck(\n args.length === params.length,... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Draw the frequency domain visualisation. | function drawFrequencyDomainVisualisation(context) {
/* Typed Array - Uint8Array, can contain only Unsigned 8-bit integers. Have values between 0 and 255 */
var freqDomain = new Uint8Array(analyser.frequencyBinCount);
/* Copies the current time domain data for this sample / batch into the passed unsigned byte array *... | [
"function renderChart() {\n requestAnimationFrame(renderChart);\n\n analyser.getByteFrequencyData(frequencyData);\n\n if(colorToggle == 1){\n //Transition the hexagon colors\n svg.selectAll(\".hexagon\")\n .style(\"fill\", function (d,i) { return colorScaleRainbow(colorInte... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
datagrid_cleanup_before_form_submission() Called before form submission to remove filter form rows that are unused. This reduces the size of the URL by not including query parameters for filters that are empty. | function datagrid_cleanup_before_form_submission() {
$('.datagrid .filters tr').each(function(idx, row) {
var $row = $(row);
var $operator = $row.find('.operator select');
if ($operator.length && $operator.val() === '') {
$row.remove();
}
});
return true;
} | [
"function resetFilters() {\n refinedTable = tableData;\n dataTable(tableData);\n}",
"function clearFilterPanel() {\n \"use strict\";\n // Clear Search term\n $(\".filterSearchText\").val(\"\");\n\n // Clear Clients\n $(\".refinerClient .refinerRowLink:last a\").click();\n $(\".refinerClien... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns the name of the bmi category for a given bmi | function getBmiCategory ( bmi )
{
if ( bmi < 15 )
{
return "Very severely underweight";
}
else if ( bmi < 16 )
{
return "Severely underweight";
}
else if ( bmi < 18.5 )
{
return "Underweight";
}
else if ( bmi < 25 )
{
return "Normal (healthy we... | [
"calculateBMICategory(bmiValue) {\n let bmiCategory = \"\";\n if (bmiValue < 16) {\n bmiCategory = \"SEVERELY UNDERWEIGHT\";\n } else if (bmiValue >= 16 && bmiValue < 18.5) {\n bmiCategory = \"UNDERWEIGHT\";\n } else if (bmiValue >= 18.5 && bmiValue < 25) {\n bmiCategory = \"NORMAL\";\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Convert a tile X number to a pixel X coordinate. | tileXToPixelX(tileX) {
return tileX * this.TileSize;
} | [
"pixelXToTileX(pixelX, zoom) {\n return Math.min(Math.max(pixelX / this.TileSize, 0), Math.pow(2, zoom) - 1);\n }",
"function TileXYToPixelXY( tileXY )\n\t{\n\t\treturn [ tileXY[0] * 256, tileXY[1] * 256 ];\n\t}",
"function PixelXYToTileXY( pixelXY )\n\t{\n\t\treturn [ pixelXY[0] / 256, pixelXY[1] / ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the notification response's actionIdentifier: cf. | getActionIdentifier() {
return this._actionIdentifier;
} | [
"parseSlackActionInfo () {\n\t\tconst payload = this.request.body.payload;\n\n\t\tlet actionPayload;\n\t\tlet actionOrCallbackId =\n\t\t\tpayload.actions &&\n\t\t\tpayload.actions[0] &&\n\t\t\tpayload.actions[0].action_id;\n\t\tif (!actionOrCallbackId) {\n\t\t\tactionOrCallbackId = payload.view && payload.view.priv... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
console.log(a(),b(),c()) Parallel: outputing all the promises once | async function parallel() {
const promises = [a(), b(), c()];
const [output1, output2, output3] = await Promise.all(promises);
return `parallel is done: ${output1} ${output2} ${output3}`
} | [
"function multiPrint(a, b, c) {\n console.log(a)\n console.log(b)\n console.log(c)\n}",
"function parallel() {\r\n console.log('parallel');\r\n\r\n var todos = [ q.nfcall(thing.doStuff, false), q.nfcall(thing.doMoreStuff, false) ];\r\n q.all(todos)\r\n .then(function () {\r\n console.log('DONE bot... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
IMPORTANT: Because the update function's contents vary in functionality and depend on each other, the separate functions must be divided in sequences. 1. Update all game clocks 2. Check for all collisions 3. Insert or delete entities 4. Update physics 5. Update user inputs 7. Update text & counters | function update() {
// ================================
// ==== Update all game clocks ====
// ================================
update_timer();
// ==============================
// ==== Check for collisions ====
// ==============================
game.physics.arcade.collide(clams, platforms... | [
"function update() {\n\tchangeSpeed(game_object);\n\tchangeLivesOfPlayer(game_object);\n\thackPlayerScore(game_object);\n}",
"__update() {\n this.__gameObjects.update();\n this.getCurrentEvents().flush();\n }",
"update() {\n let frameStart = (performance || Date).now();\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Clears console restrictions drawing and asset details panels. Trigger on clear action console. | function clearConsole() {
// reset drawing title
abEamTcController.setDrawingPanelTitle(getMessage('noFlSelected'));
// clear drawing content
abEamTcController.clearDrawing();
// clear asset details
abEamTcController.clearAssetDetailRestriction(true);
} | [
"clearAllObject() {\r\n this.m_drawToolList.length = 0;\r\n this.clearTechToolMousePos();\r\n }",
"function clearUI() {\n clearProjectFields();\n clearTestingFields();\n clearIssueFields();\n}",
"function removeAllToolOverlays() {\n\t$('#notepad-body').find('.tools-disp').removeClass('... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Event listener for HTTPS server "error" event. | function onHttpsError(error) {
if (error.syscall !== 'listen') {
throw error;
}
var bind = typeof port === 'string'
? 'Pipe ' + port
: 'Port ' + port;
//Handle specific listen errors with friendly messages
switch (error.code) {
case 'EACCES':
logger.error(bind + ' requires ... | [
"function badCertListener() {\n}",
"function onSSLListening() {\n let addr = ssl_server.address();\n let bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('SSL Listening on ' + bind);\n}",
"function onHttpsListening() {\r\n var addr = httpsServer.address();\r\n var b... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks if user visited the site first time. | isNewUserCheck() {
let userCookie = this.helper.getCookieInfo('userName');
// If cookie exists, it means that user visited site earlier.
if (userCookie.cookieExists) {
this.userCookie = userCookie.value;
}
return !userCookie.cookieExists;
} | [
"function gadgetFirstRun(){\r\n \r\n var profileStates = prefs.getArray('profiles');\r\n if(!profileStates || profileStates=='') return true;\r\n else return fa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
when user clicks on display area, automatically sanitize date input | function handleClick(){
sanitizeDateInput();
sanitizeDepDateInput();
} | [
"function onClickDate(ob) {\n\tvar info = checkTime(parseInt(ob.innerHTML)) + \" - \" + checkTime((parseInt(MONTH) + 1)) + \" - \" + YEAR;\n\tdocument.getElementById(\"birthday\").value = info;\n\tdocument.getElementById(\"main\").style.display = \"none\";\n}",
"function _autoFormattingDate(target){\n\t$(target).... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if the browser scrollbar was clicked | function clickedScrollbar(evt) {
return document.documentElement.clientWidth <= evt.clientX || document.documentElement.clientHeight <= evt.clientY;
} | [
"checkScrollButton() {\n this.scrollTopButton.current.classList.toggle('hidden', window.scrollY < 300);\n }",
"function __scrollHandler__() {\n\t\tvar topMostDlg = __findTopMostDialog__();\n\t\tif (topMostDlg) {\n\t\t\ttopMostDlg._handleScroll();\n\t\t}\n\t}",
"function scrollbar(){\n\n if (ifTouchDe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Mark all cached sections as inactive | function setAllSectionsToInactive () {
this.sections.forEach((section) => {
section.classList.remove('active-section');
});
} | [
"function _disableSection() {\n\n for (var a in __disableSection) {\n if (__disableSection[a]) {\n var id = '#' + a;\n $(id).remove();\n $('.menu-icon').find('a[href=\"'+id+'\"]').parent().remove();\n }\n }\n\n }",
"finalize() {\n for (const tile of this._cache.values()) {... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Chapter 4 Julia Player Remove Outfit | function C004_ArtClass_Julia_PlayerRemoveOutfit() {
PlayerClothes("Underwear");
if (C004_ArtClass_Julia_IsGagged) OveridenIntroText = "(She nods and you remove your outfit.)";
} | [
"function removeHobby(hobby) {\n hobbyOutput.removeChild(hobby);\n}",
"function RemoveUpgrade(){\n\tplayer.upgraded = false;\n\tplayer.sprite =Sprite(currentActivePlayer);\n}",
"function removeGame() {\n\t//todo: add formal message telling client other player disconnected\n\tsocket.emit('delete game', gameI... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Display MidFielder Position Select Option only | function displayMid(){
let fwdSelect = document.getElementById('positionSelectFwd');
fwdSelect.style.display = "none";
let midSelect = document.getElementById('positionSelectMid');
midSelect.style.display = "inline-block";
let defSelect = document.getElementById('positionSelectDef');
defSelect.s... | [
"function displayDef(){\n let fwdSelect = document.getElementById('positionSelectFwd');\n fwdSelect.style.display = \"none\";\n let midSelect = document.getElementById('positionSelectMid');\n midSelect.style.display = \"none\";\n let defSelect = document.getElementById('positionSelectDef');\n defS... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Builds a priority queue with part candidate positions for a specific image in the batch. For this we find all local maxima in the score maps with score values above a threshold. We create a single priority queue across all parts. | function buildPartWithScoreQueue(scoreThreshold, localMaximumRadius, scores) {
var _a = scores.shape, height = _a[0], width = _a[1], numKeypoints = _a[2];
var queue = new max_heap_1.MaxHeap(height * width * numKeypoints, function (_a) {
var score = _a.score;
return score;
});
for (var he... | [
"function PQueueInit() {\n\treturn new buckets.PriorityQueue();\n}",
"function build_score_map ( parameters ) {\n\t\t\n\t\tvar i, l,\n\t\t\tscoreBase = _Puzzle.scores.base,\n\t\t\tscoreMap,\n\t\t\tscoreInfo,\n\t\t\trewards;\n\t\t\n\t\t// handle parameters\n\t\t\n\t\tparameters = parameters || {};\n\t\t\n\t\tscore... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Constructs a random tile at a given position | static randomTileAt(i, j) {
var randomColor = Math.floor((Math.random() * colorsCount) + 1);
return new Tile(i, j, randomColor);
} | [
"randomInitTile() {\n let randX = this.getRandomInt()\n let randY = this.getRandomInt()\n while (this.isOccupied(randX, randY)) {\n randX = this.getRandomInt();\n randY = this.getRandomInt();\n }\n this.board[randY][randX] = 2;\n this.append(randX, ran... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Longest Nonrepeating Substring Solution =================================== | function longestNonRepeatingSubString(string) {
// default case: if all chars in string are the same, len = 1
let subStr = "";
let subStrLen = 1;
// loop over string
for (let i = 0; i < string.length; i++) {
// take the currCharacter and assign for use as first char in test subStr
let firstChar = str... | [
"function non_repeat_substring(str) {\n let windowStart = 0;\n let maxLength = 0;\n let charIndexMap = {};\n\n // try to extend the range [windowStart, windowEnd]\n for (let windowEnd = 0; windowEnd < str.length; windowEnd++) {\n const rightChar = str[windowEnd];\n // if the map already contains the 'rig... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Show wrapper block if hidden. | showWrapper() {
if (this.wrapper.offsetWidth === 0 && this.wrapper.offsetHeight === 0) {
this.wrapper.style.display = 'block'
}
} | [
"show() {\n\t\tthis.element.style.visibility = '';\n\t}",
"constructor(visible) {\n if (visible == false) {\n this.hide();\n } else {\n this.show();\n }\n }",
"function _toggleVisibility() {\n\n\t\tvisible = !visible;\n\n\t\tif (true === visible) {\n\t\t\tpanel.show... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
For browserbased histories, we combine the state and key into an object | function getHistoryState(location, index) {
return {
usr: location.state,
key: location.key,
idx: index
};
} | [
"get historyStateRawValues() {\n var ret = {};\n historyStatePropertyKeys.forEach(function (key) {\n ret[key] = _get(key);\n });\n return ret;\n }",
"getState(name, key, delmiter = '$') {\n if (typeof key !== 'undefined') {\n return this.state[name + delmiter + key]... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
match_pattern() function is used to determine if a play has matched a pattern, by looping over every position played and sending the pattern, state, player and x & y positions to the match_pattern_at() function, which determines whether a match has occured | function match_pattern(state, pattern, player) {
for (var mpidx1 = 0; mpidx1 < state.length; mpidx1++) {
for (var mpidx2 = 0; mpidx2 < state[mpidx1].length; mpidx2++) {
var matches = match_pattern_at(state, pattern, player, mpidx1, mpidx2);
if (matches) {
return true;
}
... | [
"function match_pattern_at(state, pattern, player, x, y) {\n if (x >= 0 && x < state.length) {\n if (y >= 0 && y < state[x].length) {\n var element = pattern[0];\n if (element[0] == 'p') {\n if (state[x][y] !== player) {\n return false;\n }\n } else if (elem... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Private Draws list of layers and viewports into the picking buffer Note: does not sample the buffer, that has to be done by the caller | _drawPickingBuffer({
layers,
layerFilter,
views,
viewports,
onViewportActive,
pickingFBO,
deviceRect: {
x,
y,
width,
height
},
effects,
pass = 'picking',
pickZ
}) {
const gl = this.gl;
this.pickZ = pickZ; // Track encoded layer indices
c... | [
"_drawAndSample({\n layers,\n views,\n viewports,\n onViewportActive,\n deviceRect,\n effects,\n pass\n }, pickZ = false) {\n const pickingFBO = pickZ ? this.depthFBO : this.pickingFBO;\n const {\n decodePickingColor\n } = this.pickLayersPass.render({\n layers,\n layerF... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function shows the saved power lines from the database | function showSavedPowerLines(){
ajaxRequest("showPowerLines", {}, showPowerLinesCallBack, {});
} | [
"function showPowerLinesCallBack(data, options){\n\tvar powerLineList = data.split(\"*\");\n\tvar powerLines=[];\n\tfor (var i=0; i<powerLineList.length-1; i++) {\n\t\tvar powerLine = powerLineList[i].split(\"!\");\n\t\tvar location = powerLine[0];\n\t\tvar color=powerLine[1];\n\t\tvar powerLineId=powerLine[2].trim... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a function that calls the original function and tries to make the return value available to the page. | function wrapFunction(fun, contentGlobal) {
return function () {
let result = fun.apply(this, arguments);
if (typeof result === 'object') {
if (('then' in result) && (typeof result.then === 'function')) {
// fun returned a promise.
return createPromiseInPage((resolve, reject) => result.t... | [
"function returnNewFunctionOf(functionToBeCopied, thisValue) {\n const copy = function(functionToBeCopied, thisValue) {\n return thisValue\n }\n return copy\n}",
"function super_fn() {\n if (!oldFn) {\n return\n }\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
GeoRef mask Get the list of available start years by datbase mask | function generateStartYears(selectedDatabaseMask) {
var stringYear = $("input[name='stringYear']");
if (typeof stringYear == 'undefined') {
console.warn("stringYear value could not be set!");
return;
}
var sy = calStartYear(selectedDatabaseMask, stringYear.val())... | [
"function generateEndYears(selectedDatabaseMask) {\n var stringYear = $(\"input[name='stringYear']\");\n if (typeof stringYear == 'undefined') {\n console.warn(\"stringYear value could not be set!\");\n return;\n }\n\n var sy = calStartYear(selectedDatabaseMask, str... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Takes an array of group members and returns all the ones that are groups | function getMembersOfTypeGroup(Members){
return Members.filter(Member => {return Member.indexOf("OU=Group") !== -1});
} | [
"function getGroupNames(){\n var ret = [];\n for (var i = 0; i < this.groups.length; i++) {\n ret.push(this.groups[i].name);\n }\n return ret;\n}",
"function group(arr) {\n let result = [];\n while(arr.length) {\n result.push(arr.filter(item => {return item === arr[0]}));\n arr = arr.filter(item =>... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
se crea el model, con DOM | function crearModel(e) {
var div=document.createElement('div');
div.setAttribute('align', 'center');
div.classList.add('grande');
var close=document.createElement('button');
close.innerHTML='X';
close.classList.add('close');
close.onclick=function() {
e.parentNode.removeChild(e.parentNode.lastChild);
... | [
"function drawModel(model) {\n clearCanvas();\n vm.currentModel = JSON.parse(model);\n var environment = JSON.parse(vm.currentModel.value);\n // Draw first the nodes\n $.each(environment.nodes, function(index, node) {\n element = createElement(node.elementId, node);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if selector is not a string or not an object with "every" option. | function isNotValidSelector(selector) {
return !_.isString(selector) && !(_.isObject(selector) && _.isString(selector.every));
} | [
"function isValidSelector( selector ) {\n\t\ttry { $( selector ) } catch ( error ) { return false };\n\t\treturn true;\n\t}",
"function test_valid_selector(selector, serializedSelector) {\n if (arguments.length < 2)\n serializedSelector = selector;\n\n const stringifiedSelector = JSON.stringify(selec... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
hide the confidence inputs | function disableConfidence( id ) {
$(id).find("select.confidence").each( function(i) {
if(i != 0) { $(this).addClass("vis-hide") };
});
} | [
"function hideViz() {\n viz.hide();\n}",
"function hideOutput(notebook) {\n if (!notebook.model || !notebook.activeCell) {\n return;\n }\n const state = Private.getState(notebook);\n notebook.widgets.forEach(cell => {\n if (notebook.isSelectedOrActive(cell) && ce... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function: SetPreset Set preset for VertexDirt. Presets are for batch change common VertexDirt parameters. | function SetPreset (v : VDPRESET) {
switch (v) {
case VDPRESET.AMBIENTOCCLUSION :
invertNormals = false;
skyMode = CameraClearFlags.SolidColor;
occluderShader = VDSHADER.AMBIENTOCCLUSION;
break;
}
} | [
"function selectPreset() {\n var preset = presets.get(presetsBox.value);\n if (preset) {\n if (preset['band']) {;\n var newBand = Bands[settings.region][preset['band']];\n if (newBand) {\n selectBand(newBand);\n }\n } else if (preset['mode']) {\n setMode(preset['... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
close modal by click on backdrop | function backdropClickHandler(event) {
if (event.target === event.currentTarget) {
closeModalHandler();
};
} | [
"close() {\n this.showModal = false;\n\n this.onClose();\n }",
"function closeModal() {\r\n modal.style.display = 'none';\r\n }",
"function modalClose ( event ) {\n if (modalOpen && ( !event.keyCode || event.keyCode === 27 ) ) {\n mOverlay.setAttribute('a... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
take the previous state's formula and add the next formula to the series. | updateHistory(formula) {
this.setState(prevState => ({
history: [...prevState.history, formula]
}))
} | [
"function calculateStackState(firstS, nextS, sInx, sOff) {\n if (!statesLen) {\n actualStackX.stackState[0] = firstS;\n statesLen = actualStackX.stackState.length;\n }\n else {\n for (sInx; sInx < statesLen; sInx++) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This is the master function that creates all the plotly traces. Takes an array of arrays and returns the data array of traces and the layout variable | function createTracesAndLayout(arr, title, jitter='all'){
// Iterate through the formatted array [[name_of_trace, expression_data]...]
// and create the response plotly objects, returning [plotly data object, plotly layout object]
var data = Array();
for(x=0;x<arr.length;x++){
// plotly violin t... | [
"function setTraces(){\n\n trace1 = {\n x: w,\n y: dampl, \n name: 'Displacement',\n type: 'scatter',\n mode: \"lines\",\n marker: {color: cDisp}\n };\n trace2 = {\n x: w, \n y: vampl, \n name: 'Velocity',\n type: 'scatter',\n mode: 'lines',\n marker: {color: cVel}\n };\n t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
==Execute An Action== execute the 'i' action of the botAction list. set the botAction.currentAutor draw a new post if the action contain some text. set up the 'answer' if needed. execute the action function. return FALSE if action is the last. | function doAction(i) {
var a = botAction.next[i];
botAction.currentAutor = botAction.lastAutor;
if (a.autor && botAction.currentAutor != a.autor)
botAction.currentAutor = a.autor
if(a.text)
drawNewPost(botAction.currentAutor,a.text);
if(a.answer)
answer = a.answer;
if (a.fn)
a.fn(... | [
"function fireAction(act) {\r\n\tinputState(false);\r\n\tbotAction.next = getAction(act);\r\n\tprocessAllActions();\r\n}",
"function processAllActions() {\r\n\t\r\n\tshowWriting();\r\n\t\r\n\tvar time = 500;\r\n\tvar na = botAction.next;\r\n\t\t\r\n\tvar fn = function(v,end){\r\n\t\treturn function(){\r\n\t\t\thi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function checks all addons for updates | function checkAllUpdates (installedAddonsDict) {
Object.keys(installedAddonsDict).forEach(function (key) {
checkUpdate(installedAddonsDict[key]).then(checkedStatus => {
recordAddonStatus(key, checkedStatus)
})
})
} | [
"function checkForUpdates(mpu) {\n // update button state to ‘Checking for updates…’\n mpu.button.instances.current = mpu.button.instances.checkingForUpdates;\n // request remote package information\n requestRemotePackage(mpu, function () {\n // try to convert server response into package info object\n mp... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the my task sort ui state variable from the ReactiveDict | getTaskSort() {
return Template.instance().uiState.get("taskSort");
} | [
"getAssnSort() {\n return Template.instance().uiState.get(\"assnSort\");\n }",
"get sorted() {\n let uncomplete = [];\n let complete = [];\n\n for (let task in this.state.tasks) {\n if(this.state.tasks[task]) {\n if (this.state.tasks[task].completed) {\n complete.pu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Flush matching cache entries | function flushCacheMatches(match) {
if (angular.isDefined(resourceCache)) {
var keys = resourceCache.keys();
for (var i = 0; i < keys.length; i++) {
if (keys[i].indexOf(match) > -1) {
resourceCache.remove(keys[i]);
... | [
"flush () {\n this.cacheStore = {}\n }",
"function flush(prefix) {\r\n prefix = (prefix || \"\");\r\n \r\n Object.keys(waiters).forEach(function(waiter) {\r\n if (waiter.indexOf(prefix) == 0) {\r\n needFlush.push(waiter);\r\n }\r\n });\r\n // delete all not locked keys ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Parse parameter names, skips empty lines and lines with coments. returns object where fields == param names: result. == rowNumber rowNumber is absoulute, starting from 1. | function getParameters(sheet){
var topLeftRow = paramSheetStructure.parameters.row;
var topLeftCol = paramSheetStructure.parameters.col;
var rowCount = sheet.getLastRow() - topLeftRow + 1;
// get column with parameter names. actually get 2D-range with colCount = 1
var parameterNames = sheet.getRange(topLeftRo... | [
"function readParameters(parametersBlock) {\n if (_.isUndefined(parametersBlock)) {\n return [];\n }\n\n let defaults = {\n required: true,\n type: 'path',\n }\n\n let parameters = [];\n\n for (let name of Object.keys(parametersBlock)) {\n let values = parametersBlock[n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates status property of selected reservation and returns the entire updated object | function updateStatus(reservation_id, status) {
return db(tableName)
.where({ reservation_id })
.update({ status }, "*")
.then((rows) => rows[0]);
} | [
"async function updateStatus(req, res, next) {\n const { reservation_id } = req.params;\n const { status } = req.body.data;\n const reservation = await service.updateStatus(reservation_id, status);\n\n res.status(200).json({ data: { status: reservation[0] }});\n}",
"async function updateStatus(req, res) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
fn: [pushnsp] in file: stdlib.ky, line: 2564 | function push_DASH_nsp(nsp) {
let GS__38 = Array.prototype.slice.call(arguments, 1);
let info = getIndex(GS__38, 0);
return _STAR_ns_DASH_cache_STAR_.unshift(hash_DASH_map("id", nsp, "meta", info));
} | [
"push(msg) {\r\n this._msgStack.push(msg)\r\n }",
"function PushID(id) { bind.PushID(id); }",
"function generateStaticPUSH(memoryAddress) {\n const fileName = getFileName();\n /*\n */\n return `\n@${fileName}.${memoryAddress}\nD=M\n@SP\nA=M\nM=D\n@SP\nM=M+1\n`;\n}",
"function pop_DASH_nsp() {\n retur... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create the allergy component style object | function AllergyComponentWFStyle() {
this.initByNamespace("wf_al");
} | [
"function createStyleSheet() {\n \n //Create stylesheet\n var stylesheet = Banana.Report.newStyleSheet();\n \n //Set page layout\n var pageStyle = stylesheet.addStyle(\"@page\");\n\n //Set the margins\n pageStyle.setAttribute(\"margin\", \"10mm 5mm 10mm 5mm\");\n pageStyle.setAttribute(\"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set content into component's container and emits the contentdone event. | function setContent(content) {
if (content.nodeType !== undefined) {
that._content.innerHTML = '';
that._content.appendChild(content);
} else {
that._content.innerHTML = content;
}
that._options.cache = true;
... | [
"function editorNewContent(content, container, activity)\n{\n editorDirty = true;\n activity.contents.push(content);\n addContentElement(content, container, activity);\n}",
"contentChanged(prev, next) {\n if (this.proxy instanceof HTMLOptionElement) {\n this.proxy.textContent = this.tex... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
I check, if the item i matches filters, i.e. if it's properties and their values are the same as the ones given in filters. | function checkItemAgainstFilters( item, filters ) {
console.log( "resistanceMatrixDirective: check if item %o matches filters %o", item, filters );
// For this type of item (bacteria or antibiotic) no filters were chosen, i.e. filter object has no properties:
// There's nothing to hide, just return true
... | [
"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"
]
]
}
} |
13Marzo2019 Retorna arreglo de recordatorios Argumentos: ninguno Retorna atributo reminderArray | getReminderArray(){
return _reminderArray.get(this);
} | [
"function handleReadRoutineReminderInfo() {\n\n // Payload base\n var localBasePayload = fbBasePayload;\n var senderID = getSenderID();\n var reminderURL = routine;\n return admin.database().ref('pazienti/' + senderID + '/promemoria/routine/').once('value').then((snapshot) => {\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |