query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Methods Gets the current active page item in the toc | function getActivePage() {
return document.querySelector('li[data-active-page="true"]');
} | [
"function getCurrentSection() {\r\n\t\tconst currentSectionPos = content.slick( \"slickCurrentSlide\" );\r\n\t\treturn sections.eq( currentSectionPos );\r\n\t}",
"function getActivePage() {\n return $.mobile.pageContainer.pagecontainer('getActivePage');\n}",
"function getActiveItem()/*:Component*/ {\n com... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
metodo post mediante el cual se publica un documento de task en la BDD | async function postTask(req, res){
let task = new Task()
task.project = req.body.project
task.name = req.body.name
task.nickname = req.body.nickname
task.date = req.body.date //mmm mejor que la pasen ellos, porque el año pasado creaba horas random
task.description = req.body.description
ta... | [
"function save_task(doc, db, cb) {\n //store new data to our mLab DB\n db\n .collection('Tasks')\n .insertOne(doc, function (err, res) {\n if (err) return cb(err);\n\n console.log(`Successfully saved ${doc.description} task!`);\n\n cb(null);\n });\n}",
"static async apiCreatePostit(req, ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
When setting css, check for element and apply new values / eslintdisablenextline accessorpairs | set css(val) {
if (this.vueMeta) {
if (this.isVueMeta23) {
this.applyVueMeta23();
}
return;
}
this.checkOrCreateStyleElement() && (this.styleEl.innerHTML = val);
} | [
"_setCss(propertyName) {\n if (isPresent(get(this, propertyName))) {\n this.element.style[propertyName] = get(this, propertyName);\n }\n }",
"_updateContentStyle() {\r\n\t\tconst style = game.settings.get('narrator-tools', 'TextCSS');\r\n\t\tif (style) {\r\n\t\t\tconst opacity = this.elements.content[... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
spawn a process to run a command | _spawnProcess (command, args, onstdout, onstderr) {
return new Promise((resolve, reject) => {
let shell = Spawn(command, args);
shell.on('close', (code) => {
resolve(code);
});
shell.stdout.on('data', (data) => {
if (onstdout) {
let d = data.toString();
i... | [
"function spawn(cmd, args) {\n return function(callback) {\n grunt.util.spawn({\n cmd: cmd,\n args: args\n }, function(err, res, code) {\n callback(err || code, res);\n });\n };\n }",
"function spawnInteractiveCommand(c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Invoked when a user focuses on the "API Query URI" textarea. | handleApiUriFocus() {
gaAll('send', 'event', 'query api uri', 'focus');
} | [
"function CLC_SR_SpeakFocus_EventAnnouncer(event){ \r\n if (!CLC_SR_Query_SpeakEvents()){\r\n return true;\r\n }\r\n //Announce the URL bar when focused\r\n if (event.target.id==\"urlbar\"){\r\n CLC_SR_SpeakEventBuffer = event.target.value;\r\n CLC_SR_SpeakEventBuffer = CLC_SR_MSG0010 + CL... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
`_readInTopContext` reads a token when in the top context | _readInTopContext(token) {
switch (token.type) {
// If an EOF token arrives in the top context, signal that we're done
case 'eof':
if (this._graph !== null) return this._error('Unclosed graph', token);
delete this._prefixes._;
return this._callback(null, null, this._prefixes);
... | [
"function readToken(data, input, token, stack, group) {\n var state = 0, groupMask = 1 << group, dialect = stack.cx.dialect;\n scan: for (var pos = token.start;;) {\n if ((groupMask & data[state]) == 0)\n break;\n var accEnd = data[state + 1];\n // Check whether thi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get daily meals for the specified date from the user history endpoint | fetchDailyMeals(date) {
AsyncStorage.getItem('userToken').then((token) => {
console.log(`Basic ${btoa(`${token}:`)}`)
fetch(`http://${API_PATH}/api/users/history/fetch_user_history_daily`, {
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'appl... | [
"function getMeals(date) {\n const requestURL = `api/planner?date=${date}`;\n let response = fetch(requestURL, {'method': 'GET'});\n return;\n}",
"async function getAllNotesDate(date) {\n const startDate = moment(date).format(\"YYYY-MM-DD\");\n // sets startDate with date passed into function\n const endDat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get current tic data from exchange | async function fetchTic(exchange, ticker) {
try {
let market = { exchange: ticker.exchange };
var tic = await exchange.fetchTicker(ticker.symbol);
return { ...market, ...tic };
} catch (e) {
console.error(e);
return ticker;
}
} | [
"function fetchData() {\n client.subscribe(\"/fx/prices\", function (data) { //subscribing for updates\n rawData.push(JSON.parse(data.body)); //storing retrived data\n });\n}",
"function getExchange(id) {\n return fetch(`${url}/exchanges/${id}`)\n .then((res) => res.json())... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Load all notes from db | loadNotesFromDB (context) {
return db.notes.orderBy('dateModified').reverse().toArray().then((notes) => {
console.log(`${notes.length} notes loaded from db`)
return context.commit({
type: 'setNotes',
options: notes
})
})
} | [
"async getNotes() {\n\t\ttry {\n\t\t\tconst notes = await readFileAsync(\"db/db.json\", \"utf8\");\n\t\t\treturn JSON.parse(notes);\n\t\t} catch (err) {\n\t\t\tthrow err;\n\t\t}\n\t}",
"static async getAll(lessonId) {\n const result = await db.query(\n `SELECT * FROM notes WHERE lesson_id = $1`,... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
define the get() function so that we can retrieve data stored in a hash table. This function must, again, hash the key so that it can determine where the data is stored, and then retrieve the data from its position in the table. | get(key) {
return this.table[this.hash[key]];
} | [
"get(key) {\n let index = this._hash(key);\n if (this.keyMap[index]) {\n for (let i = 0; i < this.keyMap[index].length; i++) {\n if (this.keyMap[index][i][0] === key) {\n return this.keyMap[index][i][1];\n }\n }\n }\n return undefined;\n }",
"function get(key) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Visit a parse tree produced by PlSqlParsercreate_view. | visitCreate_view(ctx) {
return this.visitChildren(ctx);
} | [
"visitObject_view_clause(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitAlter_view(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitCreate_materialized_view(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitCreate_materialized_view_log(ctx) {\n\t return this.visitChildren(ctx);\n\t}"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function adds a new blank discount object to our promotion. It will automatically trigger a rendering of the view which leads to a new card that appears within our discounts area. | onAddDiscount() {
const promotionDiscountRepository = this.repositoryFactory.create(
this.discounts.entity,
this.discounts.source
);
const newDiscount = promotionDiscountRepository.create(Shopware.Context.api);
newDiscount.promotionId = thi... | [
"calcDiscount() {\n if (this.discount != 0 || this.discount != null) {\n this.discPrice = (1 - this.discount / 100) * this.totalPrice;\n }\n }",
"applyDiscount(discount) {\n this.discount = discount;\n this.beveragePrice *= (1 - discount);\n }",
"calDiscount(){\n this._discou... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
handles submitting the user input order for the current customer. | function submitOrder(inputOrder) {
// validate if the user input matches the current customer answer.
let orderPassed = validateOrder(inputOrder, customers[customerIdx].id);
// if user input passes, load in next customer.
if (orderPassed) {
dispatch(setMes... | [
"function submit() {\n var order = Order.get(request.httpParameterMap.order_id.stringValue);\n var orderPlacementStatus;\n if (order.object && request.httpParameterMap.order_token.stringValue === order.getOrderToken()) {\n orderPlacementStatus = Order.submit(order.object);\n if (!orderPlacementStatus.error... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check each of the enemies on the screen to see if any of them them have fallen off the bottom of the screen if so, then kill the enemy and the player | function checkEnemiesOutOfBounds()
{
livingEnemies.length=0;
enemies.forEachAlive(function(bad){
livingEnemies.push(bad);
});
for(var i = 0; i < livingEnemies.length; i++)
{
if(livingEnemies[i].body.y > game.world.height)
{
livingEnemies[i].kill();
killPlayer();
... | [
"checkEnemyRemoval() {\n for (let enemyIndex = 0; enemyIndex < this.enemies.length; enemyIndex++) {\n let removeEnemy = false;\n const enemyToCheck = this.enemies[enemyIndex];\n if (enemyToCheck.pos.x <= -this.level.tileWidth && enemyToCheck.movement.x < 0) removeEnemy = true... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return the deciphering key stored in anchor part of the URL | function pageKey() {
var key = window.location.hash.substring(1); // Get key
// Some stupid web 2.0 services and redirectors add data AFTER the anchor
// (such as &utm_source=...).
// We will strip any additional data.
// First, strip everything after the equal sign (=) which signals end of
// base64 string.
i... | [
"function getUrlEntry(key)\r\n{\r\n\tvar search=location.search.slice(1);\r\n\t//alert(search);\r\n\tvar my_id=search.split(\"&\");\r\n\t//alert(my_id);\r\n\ttry {\r\n\t\tfor(var i=0;i<my_id.length;i++)\r\n\t\t{\r\n\t\t\tvar ar=my_id[i].split(\"=\");\r\n\t\t\tif(ar[0]==key)\r\n\t\t\t{\r\n\t\t\t\treturn ar[1];\r\n\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check to see if any of the strings in the array is longer than 10 characters. | function longWord (input) {
return input.some(x => x.length > 10);
} | [
"function stringsLongerThan(arr, arg) { \n return arr.filter(function(string) {\n return (string.length > arg);\n });\n}",
"overflown() {\n let _this = this;\n\n return this.result.split('\\n').some((line) => {\n return line.length > _this.config['max-len'];\n });\n }",
"fun... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Take a list of nested tokens (token.content may contain an array of tokens) and flatten it so content is always a string and type the type of the leaf | function flattenTokens(tokens) {
var flatList = [];
tokens.forEach(function (token) {
var type = token.type,
content = token.content;
if (Array.isArray(content)) {
flatList.push.apply(flatList, flattenTokens(content));
} else {
flatList.push({
type: type,
content: co... | [
"function expressionToTree(exp) {\n \"use strict\";\n\n // get rid of spaces on the front of the expression\n var i = 0;\n\n while (1) {\n if (exp[i] === \"(\") {\n // we're dealing with a list\n break;\n } else if (exp[i] === \" \") {\n //do nothing\n } else {\n if (-1 !== exp.sear... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
ADDING ADMIN SUCCESS RESPONSE FUNCTION | function add_admin_success_response_function(response)
{
show_notification("msg_holder", "success", "Success:", "Admin added successfully");
fade_out_loader_and_fade_in_form("loader", "form");
$('#form')[0].reset();
} | [
"function update_success_response_function(response)\n {\n show_notification(\"msg_holder\", \"success\", \"Success:\", \"Admin updated successfully\");\n fade_out_loader_and_fade_in_form(\"loader\", \"updateform\"); \n }",
"function add_admin_error_response_function(errorThrown)\n {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function returns n random samples | function getNRandomSamples(n) {
let xs = [];
let ys = [];
for (let iter = 0; iter < n; iter++) {
let x, y;
[x, y] = getRandomSample();
xs.push(x);
ys.push(y);
}
return [xs, ys];
} | [
"function giveMeRandom(n) {\n let array = [];\n for (let x = 0; x < n; x++) {\n array.push(Math.floor(Math.random() * 10));\n }\n return array;\n}",
"function generateRandomConfig(n) {\n var object = {};\n var listOfNonUsed = [];\n\n for (var i = 0; i < n; i++) {\n listOfNonUsed.push(i);\n }\n\n fo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
SORT ENTITYMAP IN THE ORDER OF IDS AND APPEND NULL FOR IDS HAVING NO ENTITY | function sortEntities( ids, entityMap ) {
try {
var entities = [];
ids.forEach( ( id ) => {
//IF ID IS STRING THEN TAKE NAME_ID ELSE ID_ID NOTE: DATASTORE SPECIFIC
if( typeof id === 'string' ) {
if( entityMap[ 'NAME_' + id ] ) {
entities.push( entityMap[ 'NAME_' + i... | [
"function sortHouses(houses){\n let map = new Map();\n for (let house of houses){\n if (map.has(house.communityId)){\n map.get(house.communityId).push(house);\n }else{\n map.set(house.communityId, [house]);\n }\n }\n\n return map;\n}",
"function sort_all_entity_tables() {\n\tsort_entity_tab... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
solicitud detalle >actualizar tipo combustible | function tipo_gas_e(opcion,id_ruta,id_depto,id_solicitud){
$.ajax({
url: "../../operativo/models/solicitud_upgalones.php",
type:"POST",
dataType:'html',
data:{opcion:opcion,id_ruta:id_ruta,id_depto:id_depto,id_solicitud:id_solicitud},
success: function... | [
"function actualizarVentanaMesero(){\n\tswitch(navegarMesero){\n\t\tcase 1: //Se en cuentra en la ventana 1\n\t\t\tnavegar(1);\n\t\tbreak;\n\t\tcase 3:\n\t\t\tnavegar(3);\n\t\tbreak;\n\t}\n}",
"function actualizar_gal_a(gal,id_ruta,id_depto,id_solicitud,restante,resto,motivo){\n \n\n var actual=resto - ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieves a context at the level specified and saves it as the global, contextViewData. Will get the next level up if level is not specified. This is used to save contexts of parent views so they can be bound in embedded views, or in conjunction with reference() to bind a ref from a parent view. | function nextContext(level) {
if (level === void 0) { level = 1; }
return nextContextImpl(level);
} | [
"new_isolated_subcontext() {\n this.check_overflow();\n\n const subcontext = Context.build({\n resource_limits: this.resource_limits,\n static_environments: this.static_environments,\n registers: new Dry.StaticRegisters(this.registers)\n });\n\n subcontext.base_scope_depth = this.base_sco... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
push film in favoriteFilms | pushFilmInFavoriteFilms(state, film) {
state.favoriteFilms.push({
id: film.id,
title: film.title,
poster: film.poster_path,
});
} | [
"function favouriteDidAdded(event, fave) {\n // Nothing to do if there is zero comics.\n if (!vm.comics.length) return;\n var model = _.find(vm.comics, {id: fave.id});\n if (model) model.favourite = fave;\n $log.debug('Fave added:', fave);\n }",
"remov... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
find checked radio button and check if it matches the correct county, change score or quit game as appropriate | function makeGuess() {
let radioButtons = Array.from(document.getElementsByName("counties"));
radioButtons.forEach((radio) => {
if (radio.checked) {
props.setDepth(-1);
if (radio.value === props.county) {
props.quit();
alert("Correct!");
return;
} else... | [
"function checkAnswer() {\n if (roundQuestions[currentQuestion].correct === selectedAnswer) {\n setCurrentScore(currentScore + 1)\n }\n setSubmitted(true);\n }",
"function counties() {\n if (props.depth !== 1) {\n return null;\n }\n return (\n <div id={'guessRadio'}>\n <di... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
fn: [runmonadcontinuation] in file: stdlib.ky, line: 2260 Execute the computation cont in the cont monad and return its result. | function run_DASH_monad_DASH_continuation(cont) {
return cont(identity);
} | [
"enterOrdinaryCompilation(ctx) {\n\t}",
"function runSyncCallbackRTE(cmsg, callback) {\n\n\tvar fentry = funcRegistry[cmsg[\"actname\"]];\n var rmsg = cmsg; // copy the incoming message to form the reply\n rmsg.opt = machtype;\n\n\tif (fentry === undefined) {\n\t\t// send an REXEC-NAK message: {R... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
add the main panel of keynapse application | function addKnPanel(){
var zIndex = getMaxZIndex() + 10;
var panel = $("<div kn-panel class=kn-panel></div>");
panel.css("z-index", zIndex);
panel.click(function(){
stopKeynapse();
})
$("body").append(panel);
} | [
"function prepareApplication(){\n\taddKnPanel();\n\tvar keynapse = window.keynapse;\n\tkeynapse.listener = new window.keypress.Listener();\n\tregisterStartKeys(keynapse);\n}",
"function ShowDemoWindow(parent, init)\n{\n var window = two.ui.window(parent, 'ImGui Demo', two.WindowState.Default | two.WindowState.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add new garden: (puppiesapi) | function addGarden(req, res, next) {
db.none(`INSERT INTO gardens (name, zipcode, user_id)
VALUES ($/name/, $/zipcode/, $/user_id/)
;`, req.body)
.then(() => {
next();
})
} | [
"function addNewVoter() {\n if (!$scope.voter.name || !$scope.voter.email) {\n notify.alert(\"Campo Obrigatório\");\n } else {\n var r = $resource('/app/voter');\n r.save($scope.voter, function (response) {\n notify.successOnSave();\n $sco... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
check and return the cache if (matches version or hasn't expired) | async checkCache(newState) {
const now = newState.now();
// fetch the data from the cache
const cache = await this.all();
if (!cache) {
return { cache: undefined, stale: true }
}
// version has been upgraded or changed
// TODO: define this behaviour more clearly.
if (newState.vers... | [
"async _cachingFetch(url) {\n // super-hacky cache clearing without opening devtools like a sucker.\n if (/NUKECACHE/.test(url)) {\n this.cache = null;\n await caches.delete(this.cacheName);\n this.cache = await caches.open(this.cacheName);\n }\n\n let matchResp;\n if (this.cache) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
chrome.runtime.connectNative() does not fail immediately when the requested native messaging host does not exist. So the only way to determine that a native host exists, is to wait some time and check that onDisconnect event was not raised. | function tryCreateNativeMessagingPort(hostName) {
return new Promise(function (resolve, reject) {
var nativeMessagingPort = chrome.runtime.connectNative(hostName);
nativeMessagingPort.onDisconnect.addListener(reject);
setTimeout(function() {
... | [
"function waitForPing() {\n function pingListener(evt) {\n if (evt.data.source === 'mobx-devtools-content-script' && evt.data.payload === 'backend:ping') {\n (0, _debugConnection2.default)('[contentScript -> BACKEND]', evt);\n var contentScriptId = evt.data.contentScriptId;\n\n window.removeEvent... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
reseting the level back to level 1, clearing the gamePattern[], that enables the pressing of "a" button. | function restartGame() {
level = 1;
gamePattern = [];
} | [
"function resetMain(){\n\tfor (var i = 0; i < leveldata.length; i++){\n\t\tleveldata[i].posX = leveldata[i].resetX;\n\t\tleveldata[i].spawned = false;\n\t\tleveldata[i].despawned = false;\n\t\tleveldata[i].removed = false;\n\t}\n\t\n\tscore = 0;\n\tspeed = 0;\n\teggsSaved = 0;\n\tcurrentGameState = gameStates[2];\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Atom class (numbers and bound variables) | function Atom(n) {
this.type = "atom";
this.name = n;
} | [
"function Atom( arg , locale = null , isTmp = false ) {\n\tif ( arg && typeof arg === 'object' ) {\n\t\tthis.assign( arg ) ;\n\t}\n\telse if ( typeof arg === 'string' ) {\n\t\tthis.k = arg ;\n\t}\n\telse if ( typeof arg === 'number' ) {\n\t\tthis.n = arg ;\n\t}\n\telse if ( typeof arg === 'boolean' ) {\n\t\tthis.b ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Parse the yarn 'resolved' entry into its component url and sha1. | function parseResolved(entry) {
const resolved = entry.resolved;
if (resolved) {
const tokens = resolved.split("#");
entry.url = tokens[0];
entry.sha1 = tokens[1];
}
} | [
"function getResolvedURI(url) {\n var chromeURI = getChromeURI(url);\n var resolvedURI = Components.classes[\"@mozilla.org/chrome/chrome-registry;1\"].\n getService(Components.interfaces.nsIChromeRegistry).\n convertChromeURL(chromeURI);\n\n try {\n resolvedURI = resolved... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create and return a reminder setter button instance. | renderSetterButton() {
const button = this._buttonRenderer(true);
button.classList.add('set-reminder', 'pulse');
return button;
} | [
"function createBtnRestart() {\n var btnRestart = document.createElement('button');\n btnRestart.setAttribute('class','btn btn-primary');\n btnRestart.style.height = '50px';\n btnRestart.setAttribute('id','btnRestart');\n btnRestart.innerText = 'Restart';\n btnRestart.style.fontSize = '26px';\n btnRestart.st... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
`advanceFrame` is called by `setInterval` to dislay the next frame in the sequence based on the `frameRate`. When frame sequence reaches the end, it will either stop it or loop it. | function advanceFrame() {
//Advance the frame if `frameCounter` is less than
//the state's total frames
if (frameCounter < numberOfFrames) {
//Advance the frame
sprite.gotoAndStop(sprite.currentFrame + 1);
//Update the frame counter
frameCounter += 1;
} else {
//If we've r... | [
"function _nextFrame() {\n \n // Increment (or decrement) the frame counter based on animation direction\n _frame += _direction;\n\n // Test if requested frame lies outside specified array of frames\n if (_frames.length > 1 && (_frame >= _frames.length -1 || _frame < 0)) {\n \n // Varies depending on desi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Clear the examples in one label | function clearLabel(label) {
knnClassifier.clearLabel(label);
updateCounts();
} | [
"function clear() {\n\tdocument.getElementById('meaning').innerHTML = '';\n\tdocument.getElementById('graph').innerHTML = '';\n\tdocument.getElementById('celebs').innerHTML = '';\n\tdocument.getElementById('errors').innerHTML = '';\n\tdocument.getElementById('resultsarea').style.display = 'none';\n\tdocument.getEle... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Visit a parse tree produced by PlSqlParsercolumn_based_update_set_clause. | visitColumn_based_update_set_clause(ctx) {
return this.visitChildren(ctx);
} | [
"visitUpdate_set_clause(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitUpdate_statement(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitFor_update_clause(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitMerge_update_clause(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitM... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determine whether the given properties match those of a `DurationProperty` | function CfnRoute_DurationPropertyValidator(properties) {
if (!cdk.canInspect(properties)) {
return cdk.VALIDATION_SUCCESS;
}
const errors = new cdk.ValidationResults();
if (typeof properties !== 'object') {
errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + J... | [
"function CfnVirtualNode_DurationPropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected an object, bu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
HIDE a single row if it has a Hide Until column entry with a date after current date | function setHideUntilRowVisibility( rowID, hideUntilVal){
sheet = SpreadsheetApp.getActive().getSheetByName(CONFIG_SHEET_TODO);
// check if date is > now
var dtmHideUntil = new Date(hideUntilVal);
var dtmNow = new Date();
Logger.log("rowID: " + rowID );
if( dtmNow... | [
"showRecent() {\n const lastUpdate = this.props.course.updates.last_update;\n if (!lastUpdate) { return false; }\n return moment.utc(lastUpdate.end_time).add(7, 'days').isAfter(moment());\n }",
"isElementShowing(e) {\n return this.props.time >= e.start_time &&\n this.props.time <= e.e... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Windshaft uses snake_case for column parameters | function _columnToSnakeCase(column) {
return {
aggregate_function: column.aggregateFunction,
aggregated_column: column.aggregatedColumn
};
} | [
"getOwnerToGoodCase(name) {\n if (_.includes(this.oracleReservedWords, name.toUpperCase())) {\n //The name is reserved, we return in normal case\n return name;\n } else {\n //The name is not reserved, we return in uppercase\n return name.toUpperCase();\n }\n }",
"function SysFmtChang... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
removes statistics from the language span | function removeStat()
{
var selspan = document.getElementById('lang_span');
if (selspan.childNodes[2])
{
selspan.removeChild(selspan.childNodes[2]);
}
} | [
"function _cleanSentences() {\n // look for empty tone_categories and set tone_categories to 0 values\n _rankedSentences.forEach(function(item) {\n if (item.tone_categories.length === 0)\n item.tone_categories = TONE_CATEGORIES_RESET.slice(0);\n });\n }",
"function clear() {\n\tdocument.getE... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
base pop at maxZ, used for respec | function calcBasePopMaintain(){
var eff = game.generatorUpgrades["Efficiency"].upgrades;
var fuelCapacity = 3 + game.generatorUpgrades["Capacity"].baseIncrease * game.generatorUpgrades["Capacity"].upgrades;
var supMax = 0.2 + 0.02 * game.generatorUpgrades["Supply"].upgrades;
var OCEff = 1 - game.generat... | [
"function calcBasePop(useMaxFuel){\n //fuel and tauntimps\n var eff = game.generatorUpgrades[\"Efficiency\"].upgrades;\n var fuelCapacity = 3 + game.generatorUpgrades[\"Capacity\"].baseIncrease * game.generatorUpgrades[\"Capacity\"].upgrades;\n var supMax = 0.2 + 0.02 * game.generatorUpgrades[\"Supply\"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get voice file path `t`: voice type | ship id? `e`: voice id? | function n(t, e) {
var i = parseInt(t, 10);
if (1 == isNaN(i)) {
if ("tutorial" != t) {
var n = parseInt(e, 10);
e = u.MathUtil.zeroPadding(n, 3)
}
return a.default.settings.path_root + "resources/voice/" + t + "/" + e + ".mp3"
... | [
"function getFilePath(journey_id, saveDate){\n\treturn journey_id + '_' + saveDate + '.wav';\n}",
"function o(t, e) {\n var i = parseInt(t, 10);\n if (1 == isNaN(i)) return \"1\";\n var n = parseInt(e, 10);\n // t = 3 -> ship voice\n return l.VersionUtil.get(3, i, n)\n }",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Call isAnySelected() function and show alert message if false and show confirm dialog if true | function checkSelectedDeleteItems()
{
if (!isAnySelected()) {
alert('You have to select at least 1 item to delete !');
return false;
}
else
return confirm('Are you sure you want to delete these item ?');
} | [
"function anySelected(act) {\n if (YAHOO.alpine.current.selected <= 0){\n panelAlert('No messages selected to ' + act + '.<p>Select one or more messages by checking the box on the line of each desired message.');\n return false;\n }\n\n return true;\n}",
"function check_employee()\n{\n\tvar obj ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Easy Scroll The page scrolls to the given element under hpnavbar. | function scrollToElement(element) {
$('html, body').animate({
scrollTop: $(element).offset().top - $('#hp-navbar').innerHeight() + 1
}, 500);
} | [
"scrollPageToTop() {\n this.$.headerPanelMain.scrollToTop(true);\n }",
"function jumpToElementByName(name) {\n var theElement = jq(\"[name='\" + escapeName(name) + \"']\");\n if (theElement.length != 0) {\n if (!usePortalForContext() || jQuery(\"#fancybox-frame\", parent.document).length) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
evaluatoion of user answer | function evaluate(userAnswer)
{
let correctAnswer = QUIZQUESTIONS[start].correct;
if (userAnswer == correctAnswer)
{
return true;
}
else
{
return false;
}
} | [
"function getRightAnswers() {\n}",
"function evalDoubleInput() {\n // Check validity of both input strings\n if (!funcObj.validInput(evalInputFirstStr)) {\n alert(\"First input '\" + evalInputFirstStr + \"' is not valid for this function\")\n return\n }\n if (!funcObj.validInput(evalInputSec... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get a jQuery Element as HTML | function outerHtml ($el) {
var $tmp = $('<div></div>');
$tmp.append($el);
return $tmp.html();
} | [
"function jQueryToString(jq) {\n return $(document.createElement(\"div\")).append(jq).html();\n }",
"get html() {\n return (this._htmlElement || this._element).innerHTML;\n }",
"get html() {\n return this.element.innerHTML;\n }",
"function getElement(el) {\r\n if (type... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Used in decomposeArray to create a column of repeating elements. | function makeColOfRepeatingElements(context, body, offset, elem) {
const col = [];
for (const row of body) {
const cell = makeSpan(decompose(context, elem));
cell.depth = row.depth;
cell.height = row.height;
col.push(cell);
col.push(row.pos - offset);
}
return mak... | [
"repeat (x) {\n\n const notes = this.notes;\n let res = [];\n\n for (let i = 0; i < x; i++) {\n res = res.concat(this.notes.map(a => ({...a})));\n }\n\n this.notes = res;\n return this;\n }",
"function buyFruit(array) {\n return array.map(subArray => {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Whenever an aspect is changed, update the array. | function aspectChange(e) {
//Get the index from the id, which is of format 'aspect.1'
let ind= this.id.substring( this.id.indexOf('.')+1 );
aAspects[ind] = this.value;
} | [
"updateSampleDataArray () {\n\n // Update the state with the new array.\n this.setState({\n sampleFrequencyDataArray: this.updateSampleFrequencyDataArray(),\n sampleTimeDataArray: this.updateSampleTimeDataArray(),\n });\n\n // Recurse when available.\n reques... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a list, collecting its (possibly blank) items and triples associated with those items | function createList(objects) {
var list = blank(), head = list, listItems = [], listTriples, triples = [];
objects.forEach(function (o) { listItems.push(o.entity); appendAllTo(triples, o.triples); });
// Build an RDF list out of the items
for (var i = 0, j = 0, l = listItems.length, listTriples = Array... | [
"_addList(list) {\n let head = rdf.nil;\n\n const prefix = \"list\" + (++this.counters.lists) + \"_\";\n\n for (let i = list.length - 1 ; i >= 0 ; --i) {\n let node = N3.DataFactory.blankNode(prefix + (i + 1));\n //this._addQuad(node, rdf.type, rdf.List);\n this... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function returns the average of the marks | average(marks) {} | [
"function calcAverage (tips) {\n var sum = 0;\n for (var i = 0; i < tips.length; i++) {\n sum += tips[i];\n }\n return sum / tips.length;\n}",
"function calcAverage(tips){\n var sum = 0\n for(var i = 0; i < tips.length; i++){\n sum = sum + tips[i]\n }\n return s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
MINUS DAYS FROM DATE | function minusDays(date, days){
let result = new Date(date);
result.setTime(result.getTime() - days * 86400000);
return result;
} | [
"function substractDays(date, days){\n var newDate = copyDate(date);\n newDate.setTime(newDate.getTime() - days * 24 * 60 * 60 * 1000);\n return newDate;\n}",
"function getDays(date1, date2) {\n console.log(date1)\n\treturn date1 - date2\n}",
"function deletePastVacationDays(){\n\tvar l = U.profiles... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ This method will calculate the status of the goal passed in based on the assessments / which have been passed in. | calcGoalStatus(goal, assessments) {
logger.info("Get goal status", goal.id);
let goalStatus = "Open";
if (assessments.length > 0) {
logger.info("Assessment Exists, checking goal", assessments);
for (let t = 0; t < assessments.length; t++) {
if (Date.parse(goal.startDate) <= Date.parse(a... | [
"UPDATE_OPP_ATHLETE_STATISTICS(state) {\n let result = [];\n\n for (let athlete in state.oppRoster) {\n result.push(\n {\n name: state.oppRoster[athlete].name,\n number: state.oppRoster[athlete].number,\n points:0,\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
resetNewModel Resets state.newModel to the default value defined in blog/constants.js | resetNewModel ({ commit }) {
commit('newModel')
} | [
"reset() {\r\n\t\tthis.changeState(this.initial);\r\n\t}",
"function resetForm() {\n setInputs(initial);\n }",
"function removeModelClasses() {\n modelClasses = null;\n}",
"resetAll () {\n this.data = this.defaults\n }",
"function reload(newModelUrl, newModelOptions, suppressEvents) {\n // S... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Save methods ////////// POST: add a new hero to the server | addHero(hero) {
return this.http.post(this.heroesUrl, hero, this.httpOptions).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["tap"])((newHero) => this.log(`added hero w/ id=${newHero.id}`)), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["catchError"])(this.handleError('addHero')));
} | [
"updateHero(hero) {\n return this.http.put(this.heroesUrl, hero, this.httpOptions).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__[\"tap\"])(_ => this.log(`updated hero id=${hero.id}`)), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__[\"catchError\"])(this.handleError('updateHero')));\n }",
"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get patron group list and create a nameid map. Triggers user data processing even if patron groups could not be processed. | function getPatronGroups(callback) {
let patronGroupRequest = createRequest('GET', '/groups', 'application/json');
let req = http.get(patronGroupRequest, function (response) {
let groupResult = '';
response.on('data', (chunk) => {
groupResult += chunk;
});
response.on('end', () => {
try... | [
"function build_groups_array(data) {\n var results = new Array();\n \n // Map from CRID to group index.\n var crids_map = {};\n \n var group_title = \"\";\n var group_synopsis = \"\";\n for (var i = 0, len = data.events.length; i < len; i++) {\n var event = data.events[i];\n\n // C... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return binary value of masterkey | function getMasterKey(card) {
var masterkey;
if (card.masterkey !==undefined) {
masterkey = window.atob(card.masterkey);
} else {
masterkey = "" + getRandomBytes(256);
card.masterkey = window.btoa(masterkey);
icDebug("card.masterkey: " + card.masterkey);
storeCard(card);
masterkey = window... | [
"function getClientKey() {\n\n }",
"function pubKeyHash2bitAdd(k){\r\n var b = new Bitcoin.Address(hex2bytes(k));\r\n return b.toString();\r\n}",
"function generateBackupKey() {\n return randomInt(0, 10000000000).toString();\n}",
"encodeKey(key) {\n return `${key.hostname}+${key.rrtype}`\n }",
"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a new suggestion | function createSuggestion(req, res, next) {
var suggestionData = req.body;
var user = req.user;
suggestionService.createSuggestion(suggestionData, user)
.then(suggestion => res.send(suggestion))
.catch(err => next(err));
} | [
"function newSuggestion(topicID) {\n console.log('New Suggestion function triggered with: ' + topicID);\n\n window.open(\"../html/suggestion.html?\" + topicID);\n}",
"function TagSuggest() {}",
"function changeSuggest() {\r\n var suggest = \"\";\r\n if(listIndex == -1) {\r\n suggest = curPatter... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
serve the friends queue (just 1) | function serveFriendsQueue() {
if (network.friendsQueue.length > 0) {
var id = network.friendsQueue.shift();
authenticator.cb.__call('friends_ids', {'user_id':id},
function (reply) {
console.log('giving to '+id+', friends:');
console.log(reply.ids);
// give the user his friends
network.users[id].setF... | [
"function serveUsersQueue() {\n\tif (network.usersQueue.length > 0) {\n\t\tvar batch = []\n\t\tfor (var i=0; i < 100 && network.usersQueue.length > 0; i++) {\n\t\t\tbatch.push(network.usersQueue.shift());\n\t\t}\n\t\tauthenticator.cb.__call('users_lookup', {'user_id':batch.join(',')},\n\t\tfunction (reply) {\n\t\t\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function sets the current node in the TreeView | function setTreeViewCurrentNode(treeView, nodeId) {
var allNodes = [];
function traverse(nodes) {
for (var i = 0, len = nodes.length; i < len; i++) {
if (nodes[i].nodes.length > 0) {
traverse(nodes[i].nodes);
}
... | [
"setCurrentNode(node) {\n this.currentNode = node;\n }",
"function setSelectedNode(node) {\n selected_node = node;\n var selectedNodeLabel = d3.select('#edit-pane');\n // update selected node label\n selectedNodeLabel.html(selected_node ? '<strong>' + selected_node.lbl + ': ' + sel... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function will check for valid input by the user. If the input is not valid, an error message will appear and the input form that was not valid will turn red to indicate it needs to be fixed. Once it has confirmed valid input, the function will take the paramters entered by the user to generate a multiplication tab... | function generate_mult_table() {
// cast values entered by users into numbers to ensure proper result when doing comparisions.
// https://www.w3schools.com/js/js_comparisons.asps
var minHoriz = Number(document.getElementById('minHoriz').value);
var maxHoriz = Number(document.getElementById('maxHoriz').v... | [
"function generateHtmlTableValidation(body_id, data, calc_data) {\n\n init_val = 2\n\n for (var i = init_val; i < data.length; i++) {\n\n var result = \"<tr>\";\n for(var j = 0; j < data[i].length; j++){\n // THE SIZE OF INPUT DATA IS LESS THAN THE TOTAL VALIDATION DATA\n if(i < calc_data.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
It should log "It's almost 9 in the morning" | function time(){
var hour = 8;
var minute = 50;
var period = "am";
console.log("It's almost 9 in the morning")
} | [
"function timeInWords(hour, minute) {\n var dict = {\n 00: \" o' clock \",\n 1: \"one minute past \",\n 59: \"one minute to \",\n 45: \"quarter to \",\n 30: \" minutes to \",\n 30: \" minutes past \"\n\n\n }\n let words = [\n \"zero\",\n \"one\",\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Callback associated with control::removetrackfromqueue. This method just updates the currently displayed error message. Consider merging into a generic error callback. | function onRemoveTrack(data) {
if ("Error" in data) {
onError(data.Error);
} else {
clearError();
}
} | [
"onMessageRemovalFailed() {\n this._nextViewIndexAfterDelete = null;\n FolderDisplayListenerManager._fireListeners(\"onMessagesRemovalFailed\", [\n this,\n ]);\n }",
"function clearCueError(e) {\n domCache['cuePoint'].classList.remove('error');\n domCache['timestamp'].classList.remove('er... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Toggles the checked state of the slidetoggle. | toggle() {
this.checked = !this.checked;
this._onChange(this.checked);
} | [
"toggle() {\n if (this.isChecked()) {\n this.unCheck();\n\n } else {\n this.check()\n }\n }",
"'click .toggle-checked'() {\n\t\tlet checked = {\n\t\t\ttaskId: \tthis._id,\n\t\t\tsetChecked: !this.checked,\n\t\t};\n\t\tMeteor.call('tasks.setChecked', checked, (error, r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Mark a service dependency as optional. | function optional(serviceIdentifier) {
return function (target, key, index) {
if (arguments.length !== 3) {
throw new Error('@optional-decorator can only be used to decorate a parameter');
}
storeServiceDependency(serviceIdentifier, target, index, true);
};
} | [
"function markRequiredIfNeeded(doclet){\n var memberof = doclet.memberof;\n // only check doclets that belong to an olxTypeName\n if (!memberof || olxTypeNames.indexOf(memberof) == -1) {\n return doclet;\n }\n\n var types = doclet.type.names;\n var isRequiredParam = true;\n\n // iterate over all types tha... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return visible options + unselected options | _unselectedOptions() {
return this._optionsDiv.get().querySelectorAll('div.multi-select__option:not(.multi-select__option--selected):not(.multi-select__option--hidden)');
} | [
"getSelectedValues() {\n return this._options.filter(option => option.selected).map(option => option.value);\n }",
"getSelectedElements() {\n return this.getSelectableElements().filter(item => item.selected);\n }",
"function getCheckedOptions() {\n curChecked = [];\n\n curChecked.push(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
constructs the player and 4 directional nubs for collision detection. | construct_player() {
this.player = new Player(this);
this.player.x = 832;
this.player.y = 608;
this.nubs = this.add.group();
this.left_nub = this.physics.add.sprite(this.player.x - 17, this.player.y).setBodySize(3, 3);
this.nubs.add(this.left_nub);
this.right_nub ... | [
"construct_player() {\n this.player = new Player(this);\n this.player.x = 352;\n this.player.y = 256;\n this.nubs = this.add.group();\n this.left_nub = this.physics.add.sprite(this.player.x - 17, this.player.y).setBodySize(3, 3);\n this.nubs.add(this.left_nub);\n thi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Register a click handler on an input element. | function registerClickHandler(tag) {
/* If the input element has an input class name, we have already added the event listener. */
if (tag && !tag.className.includes(inputClass)) {
tag.addEventListener("mousedown", registerLongPauseHandler);
}
} | [
"add_click(func) {\n this.add_event(\"click\", func);\n }",
"function bind(element, event, handler) {\n // Convert a string element to its DOM equivalent\n if (typeof element == \"string\") {\n element = $(element)[0];\n }\n\n if (element) {\n element.addEventListener(event, handle... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Looks up an entry in the cache. The buffered changes will first be checked, and if no buffered change applies, this will forward to `RemoteDocumentCache.getEntry()`. | getEntry(t, e) {
this.assertNotApplied();
const n = this.changes.get(e);
return void 0 !== n ? Ks.resolve(n.document) : this.getFromCache(t, e);
} | [
"function updateCache() {\n request('https://hypno.nimja.com/app', function (error, response, body) {\n if (error) {\n console.log(error);\n }\n var data = JSON.parse(body);\n if (data) {\n cache = data;\n parseCacheForSearchAndLookup();\n }\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Move the diagram coordinates to simulate a scroll based on the x and y step sizes supplied | function scrollStep(x, y) {
if (x !== 0) {
const originX = parseFloat(Data.Svg.Node.style.left);
const deltaX = window.innerHeight * x;
const left = originX - deltaX;
Data.Svg.Node.style.left = left.toFixed(0) + 'px';
}
if (y !== 0) {
const originY = parseFloat(Data.Svg.Node.style.top);
co... | [
"function scrollDown(){\n startY -= 15;\n createSVGOutput();\n}",
"function scrollUp(){\n startY += 15;\n createSVGOutput();\n}",
"function slidecoords(xbeg, ybeg, xend, yend, steps, rate) {\n\tif (blnNS && (dblVer >= 5)) {\n\t\tthis.x = Math.round(xbeg+((xend-xbeg)*(this.i/steps)));\n\t\tthis.css.l... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The AWS::ApiGateway::BasePathMapping resource creates a base path that clients who call your Amazon API Gateway API must use in the invocation URL. Documentation: | function BasePathMapping(props) {
return __assign({ Type: 'AWS::ApiGateway::BasePathMapping' }, props);
} | [
"function buildBasePath(type) {\n return API_BASE_URL + ( URL_PATHS[type] || '' );\n }",
"baseURL () {\n return config.api.baseUrl;\n }",
"static get baseRoute () {\n throw new Error('Not implemented')\n }",
"function setApiBaseUri(baseUri) {\n apiBaseUri = baseUri;\n }",
"functi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the text style runs of a cell. If the color is red, delete the run. Then repack the content and add to the cell. | function deleteRedValues() {
// Gets the active sheet
var sheet = SpreadsheetApp.getActiveSheet();
var activeCell = sheet.getActiveCell();
var newContentArray = [];
var colorRed = "#ff0000";
// Gets the rich text information from the cell
var richText = activeCell.getRichTextValue(); // Referenc... | [
"_clearCellContent(cell) {\n cell._content.innerHTML = '';\n // Whenever a Lit-based renderer is used, it assigns a Lit part to the node it was rendered into.\n // When clearing the rendered content, this part needs to be manually disposed of.\n // Otherwise, using a Lit-based renderer on the sa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to hide add product modal box | function hide_add_product()
{
//hide the modal box
$('.overlay').hide();
$('#product_picker').hide();
onBackKeyDown();
//Redraw the screen
redraw_order_list();
} | [
"function closeProductDetail() {\n const productDetailDiv = document.querySelector('#product-detail');\n productDetailDiv.innerHTML = '';\n productDetailDiv.style.display = \"none\";\n}",
"function showNoProductsScreen() {\n\t$(\"section.jsContainer #js-table\").css(\"display\", \"none\");\n\t$(\"section... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
validatePage_NoStatus ================ Method to validate the page no of search screen having no status column. Parameters Parameters Return value (true/false) | function validatePage_NoStatus(objPageNo) {
// do processing to go to desired page
var lstrPageNo = objPageNo.value;
//Check mandatory input
if (!mandatoryCheck(objPageNo)) {
return false;
}
//If not valid number
if (!isInteger(lstrPageNo)) {
//showError("FE0... | [
"function validatePageNo(objPageNo) {\n // No data to go\n if (!checkNoDataToSave_('DataTable')) {\n return false;\n }\n // do processing to go to desired page\n var lstrPageNo = objPageNo.value;\n //Check mandatory input\n if (!mandatoryCheck(objPageNo)) {\n retur... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
creates a random list of coordinates for Random pattern | function createRandom() {
let randomCoords = [];
for (let i = 0; i < getRandomInt(100, 500); i++) {
randomCoords.push([getRandomInt(width), getRandomInt(height)]);
}
return randomCoords;
} | [
"function generatePoints() {\n points = [];\n for (var x = 0; x < width; x = x + width/20) {\n for (var y = 0; y < height; y = y + height/20) {\n var px = x + Math.random() * width/20;\n var py = y + Math.random() * height/20;\n var p = {\n x: px,\n originX: px,\n y: py,\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given parsed chunks from a real formatting string, generates an array of unit strings (like "day") that indicate in which regard two dates must be similar in order to share range formatting text. The `chunks` can be nested (because of "maybe" chunks), however, the returned array will be flat. | function buildSameUnits(chunks) {
var units = [];
var i;
var chunk;
var tokenInfo;
for (i = 0; i < chunks.length; i++) {
chunk = chunks[i];
if (chunk.token) {
tokenInfo = largeTokenMap[chunk.token.charAt(0)];
units.push(tokenInfo ? tokenInfo.unit : 'second'); ... | [
"function getMomentStrs(str) {\n let result = []\n //1. split by line breaker into note segments, each segments containing notes to be played at the same moment\n let _arr = str.split(/\\n/)\n // console.log(_arr)\n if (_arr) {\n \n _arr.forEach((d, i) => {\n if (d !== null &... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If a track other than the selected button is pressed, stop it and play the new one Called each time a music button is pressed | musicToggle(musicToBePlayed, trackNumberToBePlayed, nameOfSong) {
if ((this.state.currentTrack !== 0) && (this.state.currentTrack !== trackNumberToBePlayed)) {
// Music on and next track is a different track, turn off old, turn on next
Arabella.stop();
Christalline.stop();
Bella.stop();
... | [
"function stopMusic() {\n music_audio.play();\n}",
"function togglePlaying(){\n if (!song.isPlaying()){\n song.loop();\n song.setVolume(1);\n button.html(\"pause\");\n } else{\n song.pause();\n button.html(\"play\");\n }\n}",
"function musicSelect() {\r\n console.log('Play', this.value);\r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Applies gulp and additonal config to project | _applyCustomConfig() {
this._backupSPFXConfig();
// Copy custom gulp file to
this.fs.copy(
this.templatePath('gulpfile.js'),
this.destinationPath('gulpfile.js')
);
// Add configuration for static assets.
this.fs.copy(
this.templatePa... | [
"cb(config) {\n //you have access to the gulp config here for\n //any extra customization after merging => don't forget to return config\n return merge(config, serverConfig);\n }",
"function run() {\n\n // check if we need to watch\n if(GLOBAL.isWatching) {\n /*\n * watch-less task\n */\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This is a function for putV3ProjectsId | putV3ProjectsId(incomingOptions, cb) {
const Gitlab = require('./dist');
let defaultClient = Gitlab.ApiClient.instance;
// Configure API key authorization: private_token_header
let private_token_header = defaultClient.authentications['private_token_header'];
private_token_header.apiKey = 'YOUR API KEY';
// ... | [
"putV3ProjectsIdServicesIrker(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create an `Animated` node if none exists or the given value has an incompatible type. Do nothing if `value` is undefined. The newest `Animated` node is returned. | _updateNode(value) {
let node = Object(_react_spring_animated__WEBPACK_IMPORTED_MODULE_4__["getAnimated"])(this);
if (!_react_spring_shared__WEBPACK_IMPORTED_MODULE_1__["is"].und(value)) {
const nodeType = this._getNodeType(value);
if (!node || node.constructor !== nodeType) {
Object(_reac... | [
"function createTooltipForAnimatedNode(animatedNode, value, current) {\n var tooltipContent = \"Value: \" + value + \"<br>\"\n + \"x_coord: \" + animatedNode.cx + \"<br>\" \n + \"y_coord: \" + animatedNode.cy; \n\n $('circle.animated').tipsy({ \n gravity: 'w', \n html: tru... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
request for wifi scan results | scanResults() {
return this.sendCmd(WPA_CMD.scanResult);
} | [
"function scan() {\n if (scanning)\n return;\n\n // stop auto-scanning if wifi disabled or the app is hidden\n if (!gWifiManager.enabled || document.mozHidden) {\n scanning = false;\n return;\n }\n scanning = true;\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Instantiates a post process render effect. A post process can be used to apply a shader to a texture after it is rendered. | function PostProcessRenderEffect(engine,name,getPostProcesses,singleInstance){this._name=name;this._singleInstance=singleInstance||true;this._getPostProcesses=getPostProcesses;this._cameras={};this._indicesForCamera={};this._postProcesses={};} | [
"function Postprocessing()\n{\n\t/**\n\t * List of render passes.\n\t */\n\tthis.passes = [];\n\n\t/**\n\t * X resolution of the postprocessing pipeline.\n\t */\n\tthis.width = 1;\n\n\t/**\n\t * Y resolution of the postprocessing pipeline.\n\t */\n\tthis.height = 1;\n\n\t/**\n\t * Input buffer passed to the render ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
remove selected values from multivalue prompt | function promptengine_removeValue(
form,
promptID)
{
var lbox = form[promptID + "ListBox"];
var changed = false;
var lastSelected = -1;
for ( var idx = 0; idx < lbox.options.length; )
{
if ( lbox.options[idx].selected )
{
lbox.options[idx] = null;
... | [
"function promptengine_removeAllValues(\r\n form,\r\n promptID)\r\n{\r\n var lbox = form[promptID + \"ListBox\"];\r\n\r\n var changed = false;\r\n\r\n if (lbox.options.length > 0)\r\n changed = true;\r\n\r\n for ( var idx = 0; idx < lbox.options.length; )\r\n {\r\n lbox.options[id... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function changeDefault function getRangeObject Get an object compatible with the W3C Range interface. Input: selectionObject a Selection or TextRange object | function getRangeObject(selectionObject)
{
if (selectionObject.getRangeAt)
return selectionObject.getRangeAt(0);
else
{ // Safari 1.3
let range = document.createRange();
range.setStart(selectionObject.anchorNode,selectionObject.anchorOffset);
range.setEnd(selectionObjec... | [
"getSelectedRange() {\n let range;\n if (!Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"isNullOrUndefined\"])(this.startValue) && !Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"isNullOrUndefined\"])(this.endValue)) {\n range = (Math.round(Math.abs((this.removeTimeV... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
readonly attribute AUTF8String endTimeZoneId; | get endTimeZoneId()
{
return this._endTimeZoneId;
} | [
"get endTimeZoneName()\n\t{\n\t\treturn this._endTimeZoneName;\n\t}",
"get timeZone()\n\t{\n\t\treturn this._timeZone;\n\t}",
"get end() {\n return this.endMarker;\n }",
"get startTimeZoneId()\n\t{\n\t\treturn this._startTimeZoneId;\n\t}",
"get zoneType() {\n return this.getStringAttribute(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Draws the running goal chart | function drawRunningChart() {
//Check that the remaining hours are above zero
var remainder = runningLimit - (progress + 15000);
if (remainder <= 0) {
remainder = 0;
}
var data = google.visualization.arrayToDataTable([['Status', 'Distance'], ['Complete', progress + 15000], ['Incomplete', remainder]]);
... | [
"display() {\n this.draw(this.points.length);\n }",
"function drawGoal(x, y, size, alpha){\r\n\tvar blue = color(\"blue\");\r\n\tblue.setAlpha(alpha);\r\n\r\n\tfill(blue);\r\n circle(x+size/2, y+size/2, size*5/6);\r\n erase();\r\n circle(x+size/2, y+size/2, size*7/12);\r\n noErase();\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
generate standard message (data, id, type, to) | function asMessage( data, id, type, to ) {
const message = { time: Date.now(), id: id, data: data }
if (type) message.type = type
if (to != undefined) message.to = to
return message
} | [
"function QR__generateMessage(data) {\n\tvar encoded = [];\n\t\n\t/* first encode all data segments, and append them to the message */\n\tfor (var i = 0; i < data.length; i++) {\n\t\tQR__Encode[data[i].mode](encoded, data[i].data, this);\n\t}\n\t\n\t/* make sure we didn't end up with a message that's too long */\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
positionTip function If tipFollowMouse set false, so trackMouse function not being used, get position of mouseover event. Calculations use mouseover event position, offset amounts and tooltip width to position tooltip within window. | function positionTip(evt) {
if (!tipFollowMouse) {
mouseX = (ns4||ns5)? evt.pageX: window.event.clientX + document.documentElement.scrollLeft;
mouseY = (ns4||ns5)? evt.pageY: window.event.clientY + document.documentElement.scrollTop;
}
// tooltip width and height
var tpWd = (ns4)? tooltip.width: (ie4||ie5... | [
"function tooltipXposition(d){\n\t\t\treturn x(d)+leftOffset(\"stage_wrapper\")+\"px\";\n\t\t}",
"function _setTooltipPosition() {\n // eslint-disable-next-line no-new\n new PopperJs($element, _tooltip, {\n placement: lumx.position || 'top',\n modifiers: {\n arro... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Looks for a view with a given view block id inside a provided LContainer. Removes views that need to be deleted in the process. | function scanForView(lContainer, tContainerNode, startIdx, viewBlockId) {
var views = lContainer[VIEWS];
for (var i = startIdx; i < views.length; i++) {
var viewAtPositionId = views[i][TVIEW].id;
if (viewAtPositionId === viewBlockId) {
return views[i];
}
else if (view... | [
"function foldableContainer(view, lineBlock) {\n // Look backwards through line blocks until we find a foldable region that\n // intersects with the line\n for (let line = lineBlock; ; ) {\n let foldableRegion = foldable(view.state, line.from, line.to)\n if (foldableRegion && foldableRe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
' Name : handle_bp_cart_hist ' Return type : None ' Input Parameter(s) : req, startTime, apiName ' Purpose : Creating a class to handle the BP_CART_HIST API error with following members ' History Header : Version Date Developer Name ' Added By : 1.0 28th Apr,2012 Ravi Raj ' | function handle_bp_cart_hist(req, startTime, apiName) {
this.req = req; this.startTime = startTime; this.apiName = apiName;
} | [
"function handle_bp_hist(req, startTime, apiName) {\n this.req = req; this.startTime = startTime; this.apiName = apiName;\n}",
"function handle_bp_scheduled_payment_hist(req, startTime, apiName) {\n this.req = req; this.startTime = startTime; this.apiName = apiName;\n}",
"function handle_bp_ca... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Override the base drawDataLabels method by pie specific functionality | function drawDataLabels() {
var series = this, data = series.data, chart = series.chart, options = series.options.dataLabels || {}, connectorPadding = options.connectorPadding, plotWidth = chart.plotWidth, plotHeight = chart.plotHeight, plotLeft = chart.plotLeft, maxWidth = Math.round(chart.chartWidth / 3), ser... | [
"function drawDataLabels() {\n var series = this, data = series.data, chart = series.chart, options = series.options.dataLabels || {}, connectorPadding = options.connectorPadding, plotWidth = chart.plotWidth, plotHeight = chart.plotHeight, plotLeft = chart.plotLeft, maxWidth = Math.round(chart.chartWidth / 3... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function for conducting outer join of 2 tables. | function outerjoin ( arr1, arr2 ){
var key1 = arr1[0], key2 = arr2[0], v1 = arr1[1], v2 = arr2[1];
var my_map = new Map(), my_map2 = new Map();
// store date as key, corresponding price as value into Map structure;
var len1 = key1.length, len2 = key2.length, maxlen = Math.max(len1, len2);
for (var i = 0; i <... | [
"visitOuter_join_type(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"function tableExpression2( machine )\n {\n rhs = machine.popToken();\n machine.checkToken(\"join\");\n machine.checkToken(\"inner\");\n lhs = machine.popToken();\n machine.pushToken( new joinExpression( \"inner... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Using a delegated event handler to bind to future elements after ajax / Map tab click | function maptab_click() {
//get secondary img path from data attribute
var data = $(".inner_container").find("img").attr("data-id");
//get primary (UK) img from src
var src = $(".inner_container").find("img").attr("data");
//map tab event listener
//Test which button was pressed
if($(this).text() === "UK") {
/... | [
"function handleClickOnMap() {\n $(\"#map_container\").click(function() {\n startMapMode();\n });\n }",
"function addLoadMoreFlixelContentButtonHandler() {\r\n $(\"#load-more-flixel-content\").on(\"click\", loadMoreFlixelContentButtonHandler);\r\n}",
"handleMapClick(event){\n\t\tthis.mapPage.setM... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
create a new instance of the NutritionApi object with the path to the JSON file containing the API key for the government API | constructor(secretsFile) {
let fileContents = fs.readFileSync(secretsFile);
let secrets = JSON.parse(fileContents);
// set up the URL for making requests
let apiKey = secrets.nutrition_api_key;
this.urlRoot = 'https://api.nal.usda.gov/ndb/search/?format=json&api_key=' + apiKey;
... | [
"async createApiKey (obj, args, context) {\n try {\n return {\n key: await WIKI.models.apiKeys.createNewKey(args),\n responseResult: graphHelper.generateSuccess('API Key created successfully')\n }\n } catch (err) {\n return graphHelper.generateError(err)\n }\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Decrement fields in internal data by dotprop key and optional amount | decrement(key, amt = 1) {
// TODO: Support decrementing multiple using an object
// Get current value of prop selected by dot-prop key
const currValue = DotProp.get(this.__data, key);
// Set value of prop selected by dot-prop key to be minus the increment amount (default 1)
DotProp.set(this.__data,... | [
"function decrementCount(key) {\n if (counts[key] < 2) {\n delete counts[key];\n } else {\n counts[key] -= 1;\n }\n }",
"unset(key = null) {\n // If only argument is an Array, iterate it as array of keys to remove\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Helper function getTwitterResults, wrapped around return Promise | function getTwitterResults(articleCount) {
return new Promise(function (resolve, reject) {
textapi.entities({ url: content.articles[articleCount].url}, function async(error, response) {
if (error === null) {
const foundKeyWords = response.entities[... | [
"function parseTwitterResult(data){\n\tvar result = {\n\t\tworker: data.direct_message.sender.id_str,\n\t\tdata: data.direct_message.text,\n\t\ttag: null,\n\t\tvalid: false\n\t};\n\n\tfunction isTaskTag(tag) { return /^[a-zA-Z]{4}$/i.test(tag)}\n\tvar taskTag = \"\";\n\tvar hasTag = false;\n\n\tfor (var i = 0; i < ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
| | EVENT HANDLER FUNCTIONS | | These functions handle the events that we bound to each element and | prepare for a function to be called. For example, if a click is on a song | that doens't equal the index of the active song, it sets the active song | to be what is needed and then play is called. These kind of act | l... | function privatePlayPauseClickHandle(){
/*
If there are multiple play/pause buttons on the screen,
you can have them assigned to an individual song.
With the amplitude-song-index attribute, you can assign
the play buttons a song to play out of the songs array.
*/
var playing_song_index = this.getAtt... | [
"function playbackEvents () {\n\n\t\tvar play = document.getElementById('play');\n\t\tvar overlayPlay = document.getElementById('overlay-play');\n\t\tvar pause = document.getElementById('pause');\n\t\tvar overlayPause = document.getElementById('overlay-pause');\n\t\tvar previous = document.getElementById('previous'... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
given an absolute URI, calculate the relative URI | function relativeURI(uri, base) {
// reduce base and uri strings to just their difference string
var baseParts = base.split('/');
baseParts.pop();
base = baseParts.join('/') + '/';
i = 0;
while (base.substr(i, 1) == uri.substr(i, 1))
i++;
while (base.substr(i, 1) != '/')
i--... | [
"function getRelativeConverter(pageUrl) {\n return (src) => {\n const isAbsoluteUrl = /^(\\/\\/|\\w+:\\/\\/)/.exec(src);\n if (isAbsoluteUrl) {\n return src;\n } else {\n const parsed = url.parse(pageUrl);\n const base = path.basename(parsed.pathname);\n return parsed.protocol + '//' +... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Draw touch inputs to canvas and assign x and y to cells[] | function drawTouch(e) {
if (dragging) {
for (let i = 0; i < e.touches.length; i++) {
if (pos.x && pos.y) {
canvasMove(pos.x, pos.y);
setPositionTouch(e);
cells[pos.x][pos.y] = true;
clear = false;
... | [
"handleStart(e) {\r\n // Je touche le canvas, je dessine :\r\n this.painting = true;\r\n // Coordonnées du touch :\r\n var touches = e.changedTouches;\r\n for(var i=0; i<touches.length; i++){\r\n this.canvas[0].touchX = (touches[i].pageX - this.canvas[0].offsetLeft);\r\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
PROCESS STDOUT HANDLER To be bound to a spawned process' data event. Handles storing stdout message lines, sending lines to IPC listeners, and the following streamlink events (in the form of stdout messages): "no stream found", "stream ended" > Close stream instance. "invalid quality" > Choose the next closest quality ... | async function onProcMsg(msg) {
msg = msg.toString()
// log the stdout line
this.logLine(msg)
/*
* STREAMLINK EVENTS
*/
// Handle Streamlink Events: No stream found, stream ended
REGEX_NO_STREAM_FOUND.lastIndex = 0
REGEX_NO_CHANNEL.lastIndex = 0
REGEX_STREAM_ENDED.lastInde... | [
"setupIpcFallback(child) {\r\n var emitter = new EventEmitter();\r\n\r\n /*for debugging:\r\n child.stdout.on('data', function(data) {\r\n console.log('stdout: ' + data);\r\n });\r\n */\r\n\r\n //parse incoming message and emit as \"regular\" events\r\n ch... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Extend the chart getAxes method to also get the color axis. | function onChartAfterGetAxes() {
var _this = this;
var options = this.options;
this.colorAxis = [];
if (options.colorAxis) {
options.colorAxis = splat(options.colorAxis);
options.colorAxis.forEach(function (axisOptions, i) {
axisOptions.index = i;
... | [
"getAxes() {\n return [];\n }",
"function getAxes() {\n\t\tvar xAxisOptions = options.xAxis || {},\n\t\t\tyAxisOptions = options.yAxis || {},\n\t\t\toptionsArray,\n\t\t\taxis;\n\n\t\t// make sure the options are arrays and add some members\n\t\txAxisOptions = splat(xAxisOptions);\n\t\teach(xAxisOptions,... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |