query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Busca en la listaCanalesFiltrar un canal con el id buscado; si lo encuentra retorna una lista con el canal; si no lo encuentra retorna una lista vacia | function getCanalConId(id, listaCanalesFiltrar) {
let ret = [];
let indice = 0;
while (indice < listaCanalesFiltrar.length && ret.length === 0){
if(listaCanalesFiltrar[indice].id === id){
ret[0] = listaCanalesFiltrar[indice];
}
indice... | [
"findAllByCanal(req, res){\n Event.getAllByCanal(req.params.canalId, req.params.userId, (err, data) => {\n if (err) {\n if (err.kind === \"not_found\") {\n res.status(404).send({\n message: `Not found event with canalId ${req.params.canalId}... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Step 2: Combind valid consonant clusters in each part. | function combine_consonant_clusters(units)
{
for (i = 0; i < units.length - 1; i += 1) {
if (units[i].info.type === "c") {
/// Is it a valid 3 letter cluster?
///NO... | [
"function clean2dClusters( cluster2d)\r\n{\r\n var cleanClusters =[];\r\n for (var x=0; x < cluster2d.length; x++)\r\n {\r\n var v2array =[];\r\n for (var i=0; i< cluster2d[x].length; i++)\r\n {\r\n var v2 = new THREE.Vector2(cluster2d[x][i][0], cluster2d[x][i][1]);\r\n v2array.push(v2);\r\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
sectionbegin Public methods Focus on exchange amount input. | focusInput(){
this.amountInput.focus();
} | [
"_handleTopRowClick(){\n this.amountInput.focus();\n }",
"function onSelectionChange(){\n if (ui.amountBox.value > 0 && ui.icosBox.selectedIndex != 0 && ui.roundBox.selectedIndex != 0 && ui.currencyBox != 0) {\n onCalculateClick();\n }\n }",
"function getAmount() {\n let amount = getI... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get Dependencies Using pacote, fetch the manifest of packages, and get the version. | async function getDeps(deps) {
return await Promise.all(deps.map(async dep => {
return {
name: dep,
version: (await pacote.manifest(dep)).version
};
}));
} | [
"get manifest(){\n if(fs.existsSync(path.join(this.root, 'package.json'))){\n return JSON.parse(fs.readFileSync(path.join(this.root, 'package.json')))\n }\n }",
"function dependencies() {\n return project.splitDependencies()\n .pipe(project.rejoin());\n}",
"function getPackageInfo(installP... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
delete parameter from wellgroup need to clean all data from TestData (and ProductionData) if no one used this parameter (no more references to this table) and if parameter is not in the library then delete from wfmParameter table | function deleteWellGroupWfmParameter(wellGroupWfmParameterItem) {
return ajaxRequest('DELETE', wellGroupWfmParameterUrl({
wellGroupId: wellGroupWfmParameterItem.wellGroupId,
wfmParameterId: wellGroupWfmParameterItem.WfmParameterId
}));
} | [
"function delete_parameter(p) {\n return (delete p);\n}",
"function getDatabaseParameterDeleteTeam (params, query, body){\r\n\tvar parameters = {\r\n\t\twhere: { team_id: params.id },\r\n\t};\r\n\treturn parameters;\r\n}",
"function deletePowerSource(powerplant)\n{\n var pp = powerplant;\n shifting.power... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
creating bg images chooser | function createBgChooser() {
let bgChooserList = document.createElement('ul');
for (let i = 1; i <= 5; i++) {
let bgElem = document.createElement('li');
bgElem.classList.add('bgChooser');
let bg = document.createElement('img');
let imgSrc = "./assets/backgrounds/bg" + i + ".jpg";... | [
"function generateDefaultShibeImgs() {\n const shibeImg = document.getElementsByClassName(\"img-bk\")\n\n for(let i = 0; i < shibeImg.length; i++) {\n shibeImg[i].style.backgroundImage = `url(${shibeImgs[Math.floor(\n Math.random() * shibeImgs.length)]}\n )`\n }\n}",
"function randomBG(){\n var B... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
`_readDataTypeOrLang` reads an _optional_ datatype or language | _readDataTypeOrLang(token) {
return this._completeObjectLiteral(token, false);
} | [
"function datatypeHandler(format){\n\tvar dt;\n\tif (format == 'json'){\n\t\tdt = 'json';}\n\telse if(format == 'xml'){\n \tdt = 'xml';}\n else{\n \tdt = 'text';\n }\n\treturn dt;\n}",
"async _getFieldInputType(dataType){\n switch(dataType.toLowerCase()) {\n case 'text':\n return FIEL... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Instantiate a new ray helper. As raycast might be hard to debug, the RayHelper can help rendering the different rays in order to better appreciate the issue one might have. | function RayHelper(ray){this.ray=ray;} | [
"pointerToRay(pointer) {\n\n const camera = this.viewer.navigation.getCamera()\n const pointerVector = new THREE.Vector3()\n const rayCaster = new THREE.Raycaster()\n const pointerDir = new THREE.Vector3()\n const domElement = this.viewer.canvas\n\n const rect = domElement.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FIXME: We probably need that the timer signal only goes to the root of the lComponent tree. In that case, the update to the children occurs during the processing of the recursive update algorithm. Override the tick method, so that when we get a tick, we: update the forces on every child, and then call the child's | tick(deltaT) {
var particles = this.children.slice(0);
var current = particles.shift();
var pLen = particles.length;
while (pLen > 0) {
for (var i = 0; i < pLen; i++) {
addForces(current, particles[i]);
}
current = particles.shift();
pLen = particles.length;
}
// We've added ... | [
"function tick() {\n document.querySelector('#clocks').replaceChildren(\n createList(clocksConfig)\n );\n // 3b. Repeat the timer - call for the next click\n setTimeout(tick, 1000);\n}",
"function ticked() {\n \n //print ticked to see when the simulation stops and when its restarted \n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Make request to server to update cartlineItem quantity. | function updateLineItemQty(actionLink, qty) {
if (reportMissingArgs(arguments, ['actionLink', 'quantity'])) {
return;
}
var ajaxModel = new ep.io.defaultAjaxModel({
type: 'PUT',
url: actionLink,
data: "{quantity:" + qty.changeTo + "}",
success: function () {
... | [
"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"
]
]
}
} |
Stores article sheet if used multiple times | function articleSheet(){
if(!articleSheetInstance) articleSheetInstance = sheet("articles")
return articleSheetInstance
} | [
"function updateNearest(article) {\n var title = article.title;\n var storedItem = localStorage.getItem(title);\n console.log(storedItem);\n if (!storedItem) {\n sendArticleToPebble(article, true);\n localStorage.setItem(title, 'true');\n Pebble.showSimpleNotificationOnPebble(title, 'NEW!');\n } else ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Visit a parse tree produced by PlSqlParserstart_part. | visitStart_part(ctx) {
return this.visitChildren(ctx);
} | [
"visitSequence_start_clause(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"parse_start(text,context){\n\t\tfor(const parser of this.start_parsers){\n\t\t\tconst res=parser.call(this,text,context);\n\t\t\tif(res){\n\t\t\t\treturn res;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn null;\n\t}",
"function parse_StatementL... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a storyboard with frames that contain the different steps of the algorithm | storyboard() {
var ratio;
if (this[s_scrollbar] == null) {
console.log("scrollbar == null");
ratio = 0.5;
} else {
ratio = this[s_scrollbar].value;
}
// Create the first frame by hand
... | [
"function getWinningPattern() {\n winningPattern = getHorizontalPattern().concat(getVerticalPattern());\n winningPattern.push(getLeftDiagonalPattern());\n winningPattern.push(getRightDiagonalPattern());\n console.log(winningPattern)\n }",
"function doNextStage() {\r\n\r\n clearTi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Renew a FIO Domain on the FIO blockchain. | renewFioDomain(fioDomain, maxFee, technologyProviderId = null) {
const renewFioDomain = new SignedTransactions.RenewFioDomain(fioDomain, maxFee, this.getTechnologyProviderId(technologyProviderId));
return renewFioDomain.execute(this.privateKey, this.publicKey, this.returnPreparedTrx);
} | [
"renewFioAddress(fioAddress, maxFee, technologyProviderId = null) {\n const renewFioAddress = new SignedTransactions.RenewFioAddress(fioAddress, maxFee, this.getTechnologyProviderId(technologyProviderId));\n return renewFioAddress.execute(this.privateKey, this.publicKey, this.returnPreparedTrx);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this can never work because the deferred is ran at the time it is added to the deferreds array. must use chainDeferredFunctions below | function chainDeferreds(deferreds){
/*return deferreds.reduce(function(previous, current){
return previous.then(current);
}, resolvedPromise());*/
var promise = deferreds[0];
for(var i = 1; i < deferreds.length; i++){
promise = promise.then(deferreds[i]);
}
return deferreds[deferreds.length-1];
} | [
"processDeferred() {\n const tasks = this.deferredTasks.slice(0);\n this.deferredTasks = [];\n\n // If Task is unable to resolve at this point of time it will re-defer itself\n tasks.forEach(args => {\n this.instance.registerTab.apply(this.instance, args);\n });\n }"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates ButtonOptions for the paginator | function paginationOptions(totalPages, currentPage) {
// Numbers have to be within
// currentPage in [1..totalPages]
const totalPagesFixed = Math.ceil(totalPages);
const currentPageFixed = Math.max(1, Math.min(totalPagesFixed, Math.floor(currentPage || 1)));
const buttons = {};
if (!isFinite(tot... | [
"renderPageButtons() {\n const { page, hits, perpage } = this.state;\n const last = Math.ceil(hits / perpage);\n const pages = pagination(page, last);\n const pageButtons = pages.map((pageNo) => {\n if (pageNo === 'First') {\n return <Button color=\"primary\" size=\"sm\" key={pageNo} onClick... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function che carica la domanda di tipo Tre | function tipoTre() {
clearContent();
countTre = 0;
rispostaTre = "";
var myDiv = document.getElementById("divContent");
loadDomanda();
//carica il suggerimento
document.getElementById("apriSuggerimento").innerHTML =
jsonFile.File[indiceSezione].suggerimento[indiceDomanda];
//carica le opzioni
op... | [
"function getDataRiferimento(objData,tipo)\n{\n\tvar dataInput;\n\tvar dataOutput;\n\tvar giorno;\n\tvar mese;\n\tvar anno;\n \n // objData e' una stringa che rappresenta una data\n if (typeof(objData)==\"string\")\n {\n \tdata=getDateFromText(objData);\n }\n // objData e' un campo INPUT\n else if (... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Build the HTML for bookmark folders and items | function bookmarksHtml(bm_node, depth) {
var html = '';
if (bm_node.children) {
html = html + '<li class="group l_' + depth + '';
if (bm_node.title == 'Other Bookmarks') {
html = html + ' other';
}
html = html + '"><ul class="folder"><h3>' + bm_node.title + '</h3... | [
"function buildBookmarks(){\n // Remove all bookmark element\n bookmarksContainer.textContent = '';\n // Build items\n bookmarkUI.forEach((el) => {\n const {name, url} = el;\n const item = document.createElement('div');\n item.classList.add('item');\n const nameEl = document.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The purpose of this function is to calculate all the balances of the accounts belonging to the same group (Gr1) | function calculateGr1Balance(gr, vatClass, grColumn, startDate, endDate) {
var grCodes = getAccountsListForGr(Banana.document.table("VatCodes"), gr, "VatCode", grColumn);
grCodes = grCodes.join("|");
var currentBal = Banana.document.vatCurrentBalance(grCodes, startDate, endDate);
//vatClass decide the value... | [
"function loadBalances() {\n\tfor (var k = 0; k < form.length; k++) {\n\t\tif (form[k][\"gr\"]){\n\t\t\tform[k][\"amount\"] = calculateGr1Balance(form[k][\"gr\"], form[k][\"vatClass\"], param[\"grColumn\"], param[\"startDate\"], param[\"endDate\"]);\n\t\t}\n\t}\n}",
"async getBalances(account) {\n const { opti... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Loads all swipes and sets them to API | function swipeCards() {
API.Swipe.getSwipe()
.then((res) => {
console.log(res);
setSwipes(res.data);
})
.catch((err) => console.log(err));
} | [
"function initActivitySwipe() {\n var transitioningFrom = 1;\n\n window.mySwipe2 = new Swipe(document.getElementById('slider2'), {\n startSlide: 1,\n continuous: false,\n transitionEnd: function(index, elem) {\n\n var swipeNumber = window.mySwipe2.getPos();\n\n if (s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given a list of sense items, produce an array containing span element which represent that element. The color is either `radical`, `kanji` or `vocabulary (for light blue, pink or purple). | function ExtractSenseInformation(list, color) {
var result = [];
$.each(list, function(_, item) {
result.push(
'<span class="highlight-' +
color +
" " +
color +
'-highlight" rel="tooltip" data-original-title="' +
... | [
"function splitHighlightedWords(elementWithBackgroundColor) {\n\n breadcrumb('[PAPER] [EXPORT] Handling highlighted words');\n\n // Get the background color of the element\n var bgColor = $(elementWithBackgroundColor).css(\"background-color\") || \"\";\n $(elementWithBackgroundColor).css(\"background-co... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets up messenger profile API functions | function initialSetup() {
let url = 'messenger_profile';
callRequest(url, api.getStarted, 'Get Started Button');
callRequest(url, api.persistentMenu, 'Persistent Menu');
callRequest(url, api.greeting, 'Greeting');
callRequest(url, api.whitelisted, 'Whitelisted Domain');
} | [
"function LodLiveProfile() {\n\n }",
"function handle_user_get_profile(req, startTime, apiName) {\n this.req = req; this.startTime = startTime; this.apiName = apiName;\n}",
"function handle_user_upd_profile(req, startTime, apiName) {\n this.req = req; this.startTime = startTime; this.apiN... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Used to search from one client to all other clients, returns the matching client | function findClientPair(searchingClient, remoteCode){
console.log("Searching",getClients().length,"client(s) for a matching pair...");
return _.find(getClients(), function(client) {
return (client !== wss && client.readyState === WebSocket.OPEN && searchingClient != client && client.remoteCode === remoteCode)
... | [
"function searchClientByID() {\n hideAllOptions();\n\n //Show the resources loading view\n $scope.loadingResources = true;\n\n //get user input from form\n var clientId = $scope.clientID;\n\n //if they don't chose a client, start over\n if... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If this is a reverse nonoverflow counter point, the new reading must be <= 0 | static validateReverseCounterWithoutOverflowIsNotPositive(pageClientAPI, dict) {
//Reading is not allowed, or reading is optional and empty
if (libThis.evalIgnoreReading(dict)) {
return Promise.resolve(true);
}
//Reverse counter with no overflow value
if (libThis.ev... | [
"static validateContinuousReverseCounterPositiveReading(pageClientAPI, dict) {\n\n //Reading is not allowed, or reading is optional and empty\n if (libThis.evalIgnoreReading(dict)) {\n return Promise.resolve(true);\n }\n\n let error = false;\n //Is reverse counter and d... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns an array of tick angles and labels, given a group. | function groupTicks(d) {
var k = (d.endAngle - d.startAngle) / d.value;
return d3.range(0, d.value, 1000).map(function(v, i) {
return {
angle: v * k + d.startAngle,
label: i % 5 ? null : v / 1000 + "k"
};
});
} | [
"function groupTicks(d) {\n var k = (d.endAngle - d.startAngle) / d.value;\n return d3.range(0, d.value, 100).map(function(v, i) {\n return {\n angle: v * k + d.startAngle,\n label: i % 2.5 ? null : v\n };\n });\n }",
"function getGroupNames(){\n var ret = [];\n for (var i = 0;... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
iterate over all selected objects and figure out if the object is a PathItem if compound path or group then do deeper | function getPaths() {
for (var i = 0; i < sel.length; i++) {
if (sel[i].typename == "GroupItem") {
getPaths(sel[i].pageItems);
} else if (sel[i].typename == "CompoundPathItem") {
getPaths(sel[i].pathItems);
} else if (sel[i].typename == "PathItem") {
paths... | [
"function extractPaths(items, pp_length_limit, paths){ \n for( var i = 0; i < items.length; i++ ){\n if( items[i].locked || items[i].hidden ){\n continue;\n } else if( items[i].typename == \"PathItem\"){\n // ignore guides and clipping paths\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
load the asset loader, which will load all of our required elements in order | function loadAssets() {
//setup a global, ordered list of asset files to load
requiredFiles = [
"src\\util.js","src\\setupKeyListeners.js", //misc functions
"src\\classes\\Enum.js", "src\\classes\\Shape.js", "src\\classes\\MouseFollower.js" //classes
];
//manually load the asset loader
let script = document... | [
"init() {\n\t\tdocument.body.append(this.view);\n\t\tthis.functions.load();\n\t\tthis.Loader.load(async (loader, resources) => {\n\t\t\tlet i = 0;\n\t\t\tfor (const [name, value] of Object.entries(resources)) {\n\t\t\t\tif (loader.rorkeResources[i].options) {\n\t\t\t\t\tconst urls = await this.Loader.splitSpriteshe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
render a template file with context mapping | function render(file, context, options, callback) {
winston.verbose('rendering: ' + file);
options = options || {};
options.cache = options.cache || objCache;
options.cacheKey = file;
options.hoganOptions = options.hoganOptions || {};
getTemplate(file, options, function(err, t) {
callback(err, t ? t.te... | [
"function render_tmpl() {\n\n\tvar cache = {};\n\n\tvar compile_template = function (filename) {\n\t\treturn Q\n\t\t\t.fcall(function () {\n\n\t\t\t\tif (cache[filename]) return cache[filename];\n\n\t\t\t\tplugins.util.log('loading template: ' + filename);\n\t\t\t\treturn Q\n\t\t\t\t\t.nfcall(fs.readFile, filename)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the clear color for the webgl object. | function prepareClearColor() {
let color = scene.clearColor;
gl.clearColor(color.r, color.g, color.b, color.a);
} | [
"static Clear() {\n return new Color4(0, 0, 0, 0);\n }",
"function clearColor(){\n for (var i = 0; i < squares.length; i++) {\n squares[i].bgColor = 'white';\n }\n}",
"clear()\n {\n this.framebuffer.bind();\n this.framebuffer.clear();\n }",
"function resetCanvas() {\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
4.Permite que la funcion retorne el resultado de la division de ambos numeros. | function division(a, b) {
//tu codigo debajo
let resultado = a / b;
return resultado;
} | [
"division(a,b) {\n if( b === 0) {\n return 0;\n } else {\n return a/b;\n }\n }",
"function dividieren(a,b) { \r\n if (b != 0) \r\n {\r\n return a / b;\r\n }\r\n \r\n return \"Teilen durch 0 nicht möglich!\";\r\n \r\n}",
"function DIVIDE() {\n for (var _len6 = ar... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return filtered search results by source | function getfilteredSearchResults(source) {
var oldItems = _searchResults.items;
var newItems = [];
var filterSource = source;
if (!filterSource)
return oldItems;
for (var i = 0; i < oldItems.length; i++) {
var oldItem = oldItems[i];
if (!isAtlasResult(oldItem)
&& filterSource != oldItem.data... | [
"function populateSources() {\n\n\t\t$('#search-filter').hide();\n\n\t\tif (!_searchResults || !_searchResults.items || _searchResults.items.length == 0)\n\t\t\treturn;\n\n\t\tvar items = _searchResults.items;\n\t\tvar sources = [];\n\t\tvar sourceIds = [];\n\t\tfor (var i = 0; i < items.length; i++) {\n\t\t\tvar i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Constructs a new TerminateClientVpnConnectionsResult. | function TerminateClientVpnConnectionsResult() {
_classCallCheck(this, TerminateClientVpnConnectionsResult);
TerminateClientVpnConnectionsResult.initialize(this);
} | [
"function VpnConnectionOptions() {\n _classCallCheck(this, VpnConnectionOptions);\n\n VpnConnectionOptions.initialize(this);\n }",
"function VPNConnection(props) {\n return __assign({ Type: 'AWS::EC2::VPNConnection' }, props);\n }",
"function VPNConnectionRoute(props) {\n ret... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
DELETE to remove all reactions from a thought /api/thoughts/:thoughtId/reactions/:reactionId | removeAllReaction(req, res) {
Thought.findOneAndUpdate(
{ _id: req.params.thoughtId },
{ $pull: { reactions: req.body } },
{ new: true, runValidators: true }
)
.select('-__v')
.then(thoughtData => {
if (!thoughtData) {
... | [
"removeReaction({ params }, res) {\n Thoughts.findOne(\n { _id: params.thoughtId },\n\n )\n .then(dbThoughtsData => {\n dbThoughtsData.reactions.pull(params.reactionId)\n return dbThoughtsData.save();\n })\n\n .then(dbThoughtsData => res.json(dbThoughtsData))\n .catch(er... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
generate the overworld map | function makeOverworld(start_side="", buildRange=[3,7]){
let m = baseOverworld(start_side);
let doorSet = makeBuildings(m,buildRange);
return {'map': m, 'doors': doorSet};
} | [
"function overworldDat(){\n\tthis.overDir = {'north':null, 'south':null,'east':null,'west':null};\t\t//save pointers to other overworlds\n\tthis.houseDat = {};\n\tthis.map = [];\n\tthis.doors = [];\n\tthis.index = -1;\n}",
"function drawMap() {\n map = document.createElement(\"div\");\n var tiles = createTi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to get top crime teams | function getTopCrimeTeams() {
$.get('http://nflarrest.com/api/v1/team', function(data) {
//console.log(data);
// create compare function to sort by arrest_count
function compare(a,b) {
if (a.arrest_count < b.arrest_count) {
return 1;
} else if (a.arrest_count > b.arrest_count) {
... | [
"function getTopCrimePlayers() {\r\n\t\t$.get('http://nflarrest.com/api/v1/player', function(data) {\r\n\t\t\t//console.log(data)\r\n\t\t\t// compare function of array object properties to sort by arrest_count\r\n\t\t\tfunction compare(a,b) {\r\n\t\t\t\tif (a.arrest_count < b.arrest_count) {\r\n\t\t\t\t\treturn 1;\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Convert a Float32Array to an Uint32Array using scalar conversions. | function cvt_ftou_scalar(f32s, u32s) {
assertEq(f32s.length, u32s.length);
for (var i = 0; i < f32s.length; i++) {
u32s[i] = f32s[i];
}
} | [
"function cvt_ftou_simd(f32s, u32s) {\n assertEq(f32s.length, u32s.length);\n for (var i = 0; i < f32s.length; i += 4) {\n SIMD.Uint32x4.store(u32s, i, SIMD.Uint32x4.fromFloat32x4(SIMD.Float32x4.load(f32s, i)));\n }\n}",
"function cvt_utof_simd(u32s, f32s) {\n assertEq(u32s.length, f32s.length)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
' Name : sendResetPasswordRequest ' Return type : None ' Input Parameter(s) : None ' Purpose : Function is used for sending the reset password request to server. ' History Header : Version Date Developer Name ' Added By : 1.0 14th March,2013 Karuna Mishra ' | function sendResetPasswordRequest() {
if (validateInputFieldOfResetArea()) {
/* To show the progress bar */
showProgressBar();
$('#new_pwd').removeClass("error_red_border");
$('#re_new_pwd').removeClass("error_red_border");
/* Used for Disable the button and coming from util... | [
"function passwordReset() {\n app.getForm('requestpassword').clear();\n app.getView({\n ContinueURL: URLUtils.https('Account-PasswordResetForm')\n }).render('account/password/requestpasswordreset');\n}",
"function passwordResetDialog() {\n // @FIXME reimplement using dialogify\n app.getForm(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
TODO : replace it by reactrouter Change the current context view | _changeContextViewPanel(context) {
this.setState({
currentContextView : context
})
} | [
"render() {\n return (\n <Context.Provider value={this.openMenu}>\n <Router>\n <Header/>\n <SideBar menuState={this.state.menuState}/>\n <Container>\n <MainSection/>\n <CocktailRec... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Definition of the 'getGitHubUsers' function to get all informations about the '$userLogin' user... | async function getGitHubUsers($userLogin) {
} | [
"async function fetchGithubUsersInfo ({ data = [], year, accessToken }) {\n if (!data.length) {\n return []\n }\n const logins = data.map((user) => ({\n accessToken,\n login: user.login\n }))\n\n const users = await Promise.resolve(logins).map(fetchGithubUserInfo, {\n concurrency: 5\n })\n return... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
However this code works OK For overidden declared functions, the original declared function is removed and the new function declaration added to the end of the existing function declarations ie. its original place in the list of declared functions is lost | function myFunc1(param) {
console.log('I am the new myFunc - I have replaced the original version even tho I am declared after the call to me in the code. This is because all function declarations are loaded, including overloaded function decs, before any code is executed. I recieved '+param);
} | [
"function restoreFunctionNames(ast) {\n var functionNames = [];\n t.traverse(ast, {\n FunctionNameMetadata: function FunctionNameMetadata(_ref) {\n var node = _ref.node;\n functionNames.push({\n name: node.value,\n index: node.index\n });\n }\n });\n\n if (functionNames.length... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Model cross hair using TRIANGLES; | function CrossHair(points)
{
//The vertices of the Cross Hair
var L = 0.1;
var vertices = [
vec3( L, 10*L, 0),
vec3( -L, 10*L, 0),
vec3( -L, -10*L, 0),
vec3( L, -10*L, 0),
vec3( 10*L, L, 0),
vec3( -10*L, L, 0),
vec3( -10*L, -L, 0),
vec3( 10*L, -L, 0)... | [
"addCrosshairs() {\n if (!this._crossHairs)\n this._crossHairs = new Crosshairs();\n\n let thickness = this._settings.get_int(CROSS_HAIRS_THICKNESS_KEY);\n let color = this._settings.get_string(CROSS_HAIRS_COLOR_KEY);\n let opacity = this._settings.get_double(CROSS_HAIRS_OPACI... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
create a navbar item using the page name | function CreateNavbarItem(name, navbar) {
var navbarItem = document.createElement("A");
navbarItem.setAttribute("id", name);
navbarItem.setAttribute("class", "navbarItem");
navbarItem.setAttribute("href", name + ".html");
navbarItem.innerHTML = name;
navbar.insertBefore(navbarItem, navbar.childNodes[0]);
} | [
"addToNavBar() {\r\n const link = $$(\"<a>\");\r\n link.className = \"nav-item nav-link\";\r\n link.href = \"/money/account/\" + this.model.id;\r\n link.textContent = this.model.name;\r\n $$(\".navbar-nav\").appendChild(link);\r\n }",
"function buildNav(){\n for (const sec... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
unSelectMatchingOptions(select_object,regex) This function Unselects all options that match the regular expression passed in. | function unSelectMatchingOptions(obj,regex) {
selectUnselectMatchingOptions(obj,regex,"unselect",false);
} | [
"function ClearSelectOptions( obj )\n{\n if( obj == undefined || obj == null ) return ;\n try\n {\n for( var i = obj.options.length - 1; i >= 0 ; i -- )\n obj.options.remove(i) ;\n return ;\n }\n catch(err)\n {\n return ;\n }\n}",
"deSelectAll() {\n this.set('isSelecting', false);\n thi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
extract_search_params extracts the parameters from SNS Message this will be extended as new parameters are added. see tests for format! | function extract_search_params (sns_message_raw) {
var msg = JSON.parse(sns_message_raw);
var obj = {
adults: 0,
children: 0,
searchId: msg.context.searchId, // github.com/numo-labs/lambda-search-request-handler/pull/57/
id: msg.context.connectionId,
userId: msg.context.userId
};
if (msg.que... | [
"function extUtils_extractParameters(searchPatterns)\n{\n var parameters = new Object();\n\n //find all the parameters in the current participant,\n for (var i=0; i < searchPatterns.length; i++)\n {\n //check if we have parameters and that a match list was created\n if (searchPatterns[i].paramNames && sea... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update the edited Task whenever the user types inside the task | function updateTask() {
$('#tasks-list').on('keyup', '#taskBox-title', function(){
var title = this.value;
var ref = this.getAttribute('data-ref');
TaskManager.update(ref, title, null);
});
$('#tasks-list').on('keyup', '#taskBox-body', function(){
var body = this.value;
var ref = this.getAttribute('data... | [
"onTaskUpdated(task, updatedData) {\n const tasks = this.tasks.slice();\n const oldTask = tasks.splice(tasks.indexOf(task), 1, Object.assign({}, task, updatedData))[0];\n this.tasksUpdated.next(tasks);\n // Creating an activity log for the updated task\n this.activityService.logActivity(\n this.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
override createEditField to render a custom control for boolean fields | createEditField(options) {
if (options.fieldType === 'boolean') {
// show a custom boolean editor
return <CustomEditBooleanField
container={options.container} fieldName={options.fieldName} />;
}
return super.createEditField(options);
} | [
"_getDefaultBooleanSelectBox(value) {\n const { valueRequired } = this.state;\n const { readOnly } = this.props;\n\n return (\n <Basic.BooleanSelectBox\n ref=\"value\"\n value={value}\n readOnly={readOnly}\n required={valueRequired}\n label={this.i18n('entity.Automat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns an array of objects. Each object contains the product, the number of markets that product is sold in (filtered by state if included), the number of markets accepting each payment type for that product, and the sum of payment type acceptances | function countProducts(data, state) {
let productCounts = []
products.forEach(p => {
let product = {};
product["product"] = p;
let productData = data.filter(d => !!state ? d[p] === "Y" && d["state"] === state : d[p] === "Y" );
product["markets"] = productData.length;
prod... | [
"getReviewCountByProduct(){\n const reviewCountByProduct = {};\n\n reviewStore.reviews.forEach((review) => {\n const {asin} = review;\n\n // Check if reviews includes an asin (product ID) key\n if (!Object.keys(reviewCountByProduct).includes(asin)){\n re... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns true if the fabric8 forge plugin is enabled | function isForgeEnabled() {
// TODO should return true if the service "fabric8-forge" is valid
return true;
} | [
"function isPluginEnabled() {\n return cordova && cordova.plugins && cordova.plugins.permissions;\n }",
"function isEnabled() {\n return tray != undefined;\n}",
"get isSetup() {\n return this.system.hasInstance(this);\n }",
"function isDevMode() {\n let prefBranch = Services.prefs.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
> 8 ////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////// /Write a function called "halfsquareRoot". Given a number, "halfsquareRoot" returns its square root divided by two Starter Code... | function halfsquareRoot(num) {
// code starts here
var guess = num / 2;
var quotient;
var average;
for(i = 0; i < 9; i++){
quotient = num / guess;
average = (quotient + guess) / 2;
guess = average;
}
var squareRoot = quotient;
var doubleSquareRoot = squareRoot / 2;
... | [
"function doubleSquareRootOf(num) {\n // your code here\n var sqrt = Math.sqrt(num);\n return sqrt * 2;\n }",
"function computeSquareRoot(num) {\n var guess = num / 2;\n var num2;\n var average;\n for (i = 0; i < 10; i++) {\n \tnum2 = num / guess;\n \taverage = (num2 + guess) / 2;\n \tnum2 = guess;\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the absolute path to a named .bin script in a manner compatible with | function getBinScript(name) {
// Global install or npm@2 local install, dependencies in local node_modules
let paths = glob.sync(`../node_modules/.bin/${name}`, {cwd: __dirname})
if (paths.length > 0) return path.join(__dirname, paths[0])
// Local npm@3 install, .bin and dependencies are siblings
paths = glob... | [
"function getQbExecutablePath() {\n var path = require( \"path\" );\n var modulePath = path.dirname( module.filename );\n var qbPath = path.resolve( modulePath + \"/../qb/bin/Release/qb.exe\" );\n return qbPath;\n}",
"function dwscripts_getSBFileName()\n{\n var sbName = document.URL;\n var lastSlash... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
update language proficiency by languageProficiencyReferenceKey method | function updateLanguage(personReferenceKey, languageProficiencyReferenceKey) {
$scope.lang.CanRead = ($scope.lang.CanRead == true ? 1 : 0);
$scope.lang.CanWrite = ($scope.lang.CanWrite == true ? 1 : 0);
$scope.lang.CanSpeak = ($scope.lang.CanSpeak == true ? 1 : 0);
$scope.lang.personRefe... | [
"function getLangProfList(personReferenceKey) {\n\n personLanguageProficiencyLogic.getLangProfList(personReferenceKey).then(function (response) {\n\n $scope.languageProficiencyList = response;\n generateUUID();\n\n }, function (err) {\n appLogger.log(err);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
for each active and not absent resource, check its moral. If the moral value is low enough, give it a absence. Recalculate the teamMotivation. | function checkMoral() {
var i, j, k, moral, randomNumber, absent = false, resourceDescriptor, resourceInstance,
listAbsences = Variable.findByName(gm, 'absences'),
absenceInstance, listResources = Variable.findByName(gm, 'resources');
for (i = 0; i < listResources.items.size(); i++) {
... | [
"function calculateTeamMotivation() {\n var i, sumMotivation = 0, activeResources = 0, moral,\n listResources = Variable.findByName(gm, 'resources'), worstMoralValue = 100,\n teamMotivation = Variable.findByName(gm, 'teamMotivation').getInstance(self);\n for (i = 0; i < listResources.ite... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This will load a mustache template with the two given files | function loadTemplate(file, views, mixins){
var baseTemplate;
try{
baseTemplate = loadFile(path.join(ROOT_PATH,"views",file));
if(views == null){
views = {};
}
if(mixins == null){
mixins = {};
}
return mustache.render(baseTemplate, views, m... | [
"function loadTemplates(){\n for(let name of templates.toLoad) loadTemplate(name);\n}",
"function render_tmpl() {\n\n\tvar cache = {};\n\n\tvar compile_template = function (filename) {\n\t\treturn Q\n\t\t\t.fcall(function () {\n\n\t\t\t\tif (cache[filename]) return cache[filename];\n\n\t\t\t\tplugins.util.log(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Custom type guard for Response. Returns true if node is instance of Response. Returns false otherwise. Also returns false for super interfaces of Response. | function isResponse(node) {
return node.kind() == "Response" && node.RAMLVersion() == "RAML10";
} | [
"function instanceOf(obj, base) {\n while (obj !== null) {\n if (obj === base.prototype)\n return true;\n if ((typeof obj) === 'xml') { // Sonderfall mit Selbstbezug\n return (base.prototype === XML.prototype);\n }\n obj = Object.getPrototypeOf(obj);\n }\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
AZ Set Form Language | function AZSetFormLanguage(Options)
{
if (AZIsEmpty(Options) === false)
{
var _$Area = "";
if (Options.hasOwnProperty("$Area") && AZIsEmpty(Options.$Area) === false)
{
_$Area = Options.$Area;
}
var _ObjElements = Options;
if (Options.hasOwnProperty("O... | [
"function setCodeLanguage(lang) {\n selectedLanguageName = lang;\n selectedLanguageCodes = allCodes[lang];\n return;\n }",
"function setLanguage() {\n const queryParams = new URLSearchParams(window.location.search);\n const language = (queryParams.get(\"language\") || localStorage.getItem(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calls node.getString() but makes sure a JS string is returned | function nodeString(node) {
return String(node.getString());
} | [
"toSTRING() {\n switch (this._type) {\n case \"NODE\":\n return this._value.nodeType === 1 ? this._value.outerHTML : this._value.nodeValue;\n case \"STRING\":\n return this._value;\n case \"YNGWIE\":\n console.log(this._value);\n let node = this._value.render();\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get HTML to be writen into the qframe | function getQFrameHtml() {
var jsUrl = qlikServerBaseUrl + qlikServerPrefix + 'resources';
return '<html>'
+ '<head>'
+ '<script src="' + jsUrl + '/assets/external/requirejs/require.js"></script>'
+ '</head>'
+ '<body><p>Isolated iframe to load Qlik.js </... | [
"getHTML() {\n return getHTMLFromFragment(this.state.doc.content, this.schema);\n }",
"function getHtmlContent(){\n \n }",
"function getInnerContent() {\n if (curOpt.url) {\n return '<iframe src=\\'' + curOpt.url + '\\' horizontalscrolling=\\'no\\' verticalscrolling=\\'no\\' width=\\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The 'rawValues' property is a hash of keyvalue pairs of all properties. The underlying values are 'raw' values, i.e., those which have been passed through the beforeSetTransform. | get rawValues() {
var ret = {};
Object.keys(propertyInformation).forEach(function (key) {
ret[key] = _get(key);
});
return ret;
} | [
"get historyStateRawValues() {\n var ret = {};\n historyStatePropertyKeys.forEach(function (key) {\n ret[key] = _get(key);\n });\n return ret;\n }",
"getRawValue() {\n return this.value;\n }",
"persistentValues() {\n var self = this._self || this;\n var names = self... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
3Change all the numbers in the array to be multiplied by two for even indexes. we will use map function ,and we should check if the index is even and typeof the value is number,if it's string we will return the same value. | function numberIndexEven(array){
return map(array,function(value, index){
if((typeof(value)==='number')&& (index%2===0)){
return value*2;
}else{ return value}
})
} | [
"function modifyArray(nums) {\n return nums.map(s=> s%2==0 ? s*2: s*3 )\n\n\n }",
"function evenIndexesMult(arr) {\n\n\tfor (var i = 0; i < arr.length; i++) {\n\t\tif(i % 2 ===0 ){\n\t\t\tarr[i] = arr[i] * 2;\n\t\t}\n\t}\n\n\treturn arr;\n\n\n}",
"function processOddNums (arr) {\n // let finalIndex =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates old color sample and description. | function displayOldColorSample() {
_dom.colorOld[0].innerHTML = _colorOld === null ? "" : _colorOld.toHex();
setSampleColor(_dom.sampleOld, _colorOld === null ? new SmallColorPicker.Color(0x999999) : _colorOld, "old")
} | [
"function displayNewColorSample() {\r\n _dom.colorNew[0].innerHTML = _color.toHex() + \"<br/>\"; // for better text selection, we'll add a line break\r\n setSampleColor(_dom.sampleNew, _color, \"new\");\r\n }",
"function updateColorPreview() {\n\t\tif (ctrColor.colorButton.style.displ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Shows task properties for reading | function ShowTaskProperties(){
ShowTaskPanel(true);
$("#taskPropertiesRead").css("display", "block");
$("#taskPropertiesEdit").css("display", "none");
$("#txtTaskNameRead").html(_curSelectedTask.name);
$("#txtTaskDescriptionRead").html(_curSelectedTask.description);
$("#txtTaskDurationRead").h... | [
"outputTask(task){\r\n console.log(`Task ID: ${task.id} | Text: ${task.text} | Schedule: ${task.schedule} | Label: ${task.label} | Priority: ${task.priority}`);\r\n }",
"function Task (number, taskName, startDate, endDate, progress) {\n\t\tthis.number = number; \n\t\tthis.taskName = taskName; \n\t\tthi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reclaim children that were unreferenced in the desired VTree | function removeOrphanedChildren(children, unmountOnly) {
for (var i = children.length; i--;) {
if (children[i]) {
recollectNodeTree(children[i], unmountOnly);
}
}
} | [
"removeAllChildren() {\n this.__childNodes = [];\n this.repeats = [];\n this.dispatchNodeEvent(new NodeEvent('repeated-fields-all-removed', this.repeats, false));\n }",
"function markUnmodified(root_node) {\n $.each(root_node, function(key, value) {\n // Filter out nodes we don't want ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The StringUtils class provides common string formatting methods used throughout. | function StringUtils() {} | [
"function SysFmtNullOrEmptyToString(){}",
"function SysFmtStringInSet() {}",
"function sc_stringAppend() {\n for (var i = 0; i < arguments.length; i++)\n\targuments[i] = arguments[i].val;\n return new sc_String(\"\".concat.apply(\"\", arguments));\n}",
"function Date2StandardFmt( date_string ) {\n if... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Compresses multiple styles into one style. | function compress2(target, a, b, c) {
if (!canCompress(a)) {
return;
}
if (!canCompress(b)) {
return;
}
if (!canCompress(c)) {
return;
}
// Compress
styles[target] = styles[a] + ' ' + styles[b] + ' ' + styles[c];
delete styles[a];
delete styles[b];
... | [
"function compress(sin, bs, ic,bsort){\nvar sout= '';\nvar comp = 0;\nvar re;\n sout = sin;\n\n bs=(typeof(bs)=='undefined')?false:bs;\n ic=(typeof(ic)=='undefined')?false:ic; \n bsort=(typeof(bsort)=='undefined')?false:bsort;\n \n // I've not a lot of experience with Regular Expressions,\n // Any for a... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
merge firstmiddlelast name into Full name | function getFullName(first, middle, last) {
var fullname = first;
if (middle) {
fullname += " " + middle
}
return fullname + " " + last;
} | [
"function getMiddleName(fullName) {\n fullName = fullName.trim();\n fullName = fullName.split(\" \");\n\n // console.log(fullName)\n if (fullName.length > 2) {\n middleName = fullName[1];\n // middleName = student.fullName.substring(0, 1).toUpperCase() + student.fullName.substring(1).toLowerCase();\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function checks the value of the group blog name input field to see if it's too long | function check_blog_name() {
$blogNameInput = jQuery('#blogname');
blogName = $blogNameInput.val();
// if a group blog already exists a hidden blog name input still exists on the page
// so we'll bail here if that's the case
if ($blogNameInput.attr('type') == 'hidden') { return false; }
// subdomains cannot be ... | [
"function groupNameValid(name) {\n return (typeof name === \"string\" && name.length <= 50 && name.length > 2)\n}",
"static validateShortTextExceedsLength(pageClientAPI, dict) {\n\n //New short text length must be <= global maximum\n let max = libCom.getAppParam(pageClientAPI, 'MEASURINGPOINT', 'Sh... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
lastMove() flips last two card to green and direct the function to gameOver(). | function lastMove(winningCounts){
if (winningCounts == 31) {
document.querySelector('#card'+arrstrNumber[0]).style.animation= "greenCard 0.6s forwards";
document.querySelector('#card'+arrstrNumber[1]).style.animation= "greenCard 0.6s forwards";
winningCounts = winningCounts + 1;
}
gameOver()
} | [
"afterMove() {\r\n if (this.tileNoCheck == this.highestNumber) {\r\n console.log(\"Congragulations!!!!\" + \"\\n\" + \"You have completed the game.\" + \"\\n\" + \"Your Score : \" + this.score);\r\n process.exit();\r\n } else {\r\n let cmpFlg = this.compareBoards();\r\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Resizes a table. mastertableid minheight minimum vertical scroller height minwidth minimum horizontal scroller width slavetableid flag return none Compatibility: IE, NS6 | function i2uiResizeTable(mastertableid, minheight, minwidth, slavetableid, flag)
{
//i2uitrace(0,"ResizeTable = "+mastertableid);
var tableitem = document.getElementById(mastertableid);
var headeritem = document.getElementById(mastertableid+"_header");
var dataitem = document.getElementById(mas... | [
"function i2uiShrinkScrollableTable(tableid)\r\n{\r\n var tableitem = document.getElementById(tableid);\r\n var headeritem = document.getElementById(tableid+\"_header\");\r\n var dataitem = document.getElementById(tableid+\"_data\");\r\n var scrolleritem = document.getElementById(tableid+\"_scrolle... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If the current compilation was a compilation test expecting certain diagnostics, filter out the expected diagnostics, and add new diagnostics (aka errors) for nonmatched diagnostics. | function filterExpected(bazelOpts, diagnostics, formatFn) {
if (formatFn === void 0) { formatFn = uglyFormat; }
if (!bazelOpts.expectedDiagnostics.length)
return diagnostics;
// The regex contains two parts:
// 1. Optional position: '\(5,1\)'
// 2. Required TS error: ... | [
"function gatherDiagnostics(options, bazelOpts, program, disabledTsetseRules) {\n // Install extra diagnostic plugins\n if (!bazelOpts.disableStrictDeps) {\n var ignoredFilesPrefixes = [];\n if (bazelOpts.nodeModulesPrefix) {\n // Under Bazel, we exempt external fi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
From an array of URLs, return the first one (if any) that matches the Wikidata regular expression. | function getWikidataURL(arr) {
let r = new RegExp(regexStr);
for (let url of arr)
if (r.test(url))
return url;
} | [
"function firstMatch(array,regex) {\n return array.filter(RegExp.prototype.test.bind(regex))[0];\n}",
"async function select(urls) {\n if (urls.length < 2) {\n return urls[0];\n }\n\n let oks = urls.map(url => fetch(url, {method: 'HEAD'}).then(res => res.ok));\n\n for (i in urls) {\n try {\n if ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Style used for a radio button. | static get radioButton() {} | [
"static set radioButton(value) {}",
"function skRadioButtonGroup() {\n\tthis._radioButtons = [];\n\t\n\tthis.addRadioButton = function(btn) {\n\t\tbtn._parentGroup = this;\n\t\tthis._radioButtons.push(btn);\n\t}\n\t\n\tthis.onSetSelected = function(selectedBtn) {\n\t\tvar i;\n\t\tfor (i = 0; i < this._radioButton... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calculer le prix HT Total. | function calculHtTotal(prix_ht, quantite)
{
return parseFloat(prix_ht * quantite);
} | [
"function updateTHPP(thpp) {\n thpp.total = Number((thpp.average + thpp.week15 + thpp.week16).toFixed(2));\n return thpp.total;\n}",
"function _totalTaxTable() {\n \ttry {\n \t\tvar total_header \t=\t$('.total-header').text().trim();\n \t\tvar freight_val\t\t=\t0;\n \t\tvar insurance_val\t=\t0;\n \t\tvar ta... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Helper function called within Agora SDK to find dom element created by flutter | function fltFindNativeElement(id) {
//getElementsByTagName('flt-platform-view')[0].shadowRoot.getElementById(t.elementID)
let fltPlatformViews = document.getElementsByTagName('flt-platform-view');
for(var i = 0; i < fltPlatformViews.length; i++)
if (fltPlatformViews[i].shadowRoot.getElementById(id) !== null)
... | [
"async findElement (selector) {\n return new Promise(resolve => {\n this.page.evaluate((selector) => {\n return document.querySelector(selector)\n },\n selector,\n (err, result) => {\n if (!result) {\n return resolve(null)\n }\n resolve(new Element(this.pa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
verifica que sea un caption de medida valido | function isValidMeasureCaption(s){
var reAlphanumerico = /^[a-z_A-Z0-9]*$/;
var x = reAlphanumerico.test(s);
if(!x){
return false;
}
return true;
} | [
"function checkDescription(){\r\n\tif (description.value == null || description.value == \"\"){\r\n\t\temptyFieldsArray.push(\" Description of the problem\");\r\n\t\tborderRed(description);\r\n\t\treturn true;\r\n\t}\r\n\telse{\r\n\t\treturn false;\r\n\t}\r\n}",
"function CCisNew(captions) {\n const currentCC ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
calculates the places a queen can move and return an array with an integer saying the number of queens attacking a given square. a queen attacks the square she is on four times. Takes string of the form "rows cols (space separated array in row major order, with 0 for empty squares, and 1 for squares where a queen is lo... | function calculateMoves(nQueens) {
var moveArray = [];
for(i = 0; i < nQueens.queenArray.length; i++) {
moveArray[i] = 0;
}
var maxDimension = Math.max(nQueens.numRows, nQueens.numCols); // is there more files or ranks?
for(i = 0; i < n... | [
"function placeQueen (row, diagonal, antiDiagonal, queens) { //Rooks can represent which row we're in\n for (let column = 0; column < size; column++) {\n let [diagIndex, antiIndex] = findDiagonal(column, queens);\n \n // Open one new recursive call for each available 0\n if (row[column] === 0... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Show the Adobe Express Install dialog Reference: | function showExpressInstall(regObj) {
isExpressInstallActive = true;
var obj = getElementById(regObj.id);
if (obj) {
if (regObj.altContentId) {
var ac = getElementById(regObj.altContentId);
if (ac) {
storedAltContent = ac;
storedAltContentId = regObj.altContentId;
}
}
else {
sto... | [
"function showSetupDialog() {\n openDialog('/html/setup.html', 500, 660);\n}",
"function onOpen(e) {\n DocumentApp.getUi().createAddonMenu()\n .addItem('Crypt It', 'doCrypt')\n .addItem('DeCrypt It', 'doDecrypt')\n .addToUi();\n}",
"function showLicense(uploadIndex)\n{\n var selected = $('lice... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates the document type declaration `root` the name of the root node `pubID` the public identifier of the external subset `sysID` the system identifier of the external subset | doctype(root, pubID, sysID) {
this.openCurrent();
if (root == null) {
throw new Error("Missing root node name.");
}
if (this.root) {
throw new Error("dtd() must come before the root node.");
}
this.currentNode = new XMLDocType(this, pubID, sysID);
this.currentNo... | [
"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"
]
]
}
} |
returns the selected locale | function getSelectedLocale() {
return _selectedLocale;
} | [
"function getLocale () {\n return locale\n}",
"function getLocale() {\n try {\n if (Services.prefs.getBoolPref(PREF_MATCH_OS_LOCALE))\n return Services.locale.getLocaleComponentForUserAgent();\n }\n catch (e) { }\n\n try {\n let locale = Services.prefs.getComplexValue(PREF_SELECTED_LOCALE,\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
For the Layout attribute value, validate or replace with default fallback value | function validateAttributeValue(className, value, updateFn) {
var origValue = value;
if (!needsInterpolation(value)) {
switch (className.replace(SUFFIXES,"")) {
case 'layout' :
if ( !findIn(value, LAYOUT_OPTIONS) ) {
value = LAYOUT_OPTIONS[0]; // 'row';
}... | [
"function kh_parseDefault() {\n var value = this.result[SETTINGS_KEYS.DEFAULT];\n if (value) {\n currentSettings.defaultLayouts = value;\n }\n kh_loadedSetting(SETTINGS_KEYS.DEFAULT);\n}",
"setDefaultLayout(){\n this.set('layoutName' , LayoutConfig.defaultLayoutFolderName)\n }",
"function resolveLayo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if it is the first connection: look for an existing authenticated user. > If it finds it, it is not the first start, continue to normal process > If it does not find it, add the default user: login = admin; password = password | async is_first_start() {
const fc = await AuthAPI.isFirstConnection();
if (fc) {
logger.info("Première connection au site de production, création de l'utilisateur par défault");
await AuthAPI.createAdmin("admin", "password", "achanger@email.fr");
logger.info("Utilisateur par défault créé, bienvenue !")... | [
"onLoginStart () {\n this.loggingIn = true\n this.loggedIn = false\n }",
"function setupUser(loginScreenName) {\n if (userScreenName == null || userScreenName != loginScreenName)\n {\n userScreenName = loginScreenName;\n localStorage.setItem(\"user-screenname\",use... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Suggest player guess higher or lower | function suggestGuess(){
if(guess<answer){
return " guess higher.";
} else{
return " guess lower.";
}
} | [
"function lowerOrHigher(){\n\tif(gameData.playersGuess > gameData.winningNumber){\n\t\treturn \"Your guess is too high \";\n\t} else if (gameData.playersGuess < gameData.winningNumber){\n\t\treturn \"Your guess is too low \";\n\t}\n}",
"function relativeFeedback(secretNumber, oldGuess, newGuess) {\n var ol... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FUNCTION TO SORT ELEMENTS IN THE GALLERY | function sortBy() {
//DOM ELEMENTS
let divCards = gridGallery.children;
divCards = Array.prototype.slice.call(divCards);
// CHECK VALUE
switch (sortByBtn.value) {
// IF VALUE IS DATE
case "date":
divCards.sort(function(a, b) {
if (a.childNodes[0].date < b.... | [
"function sortResidentialLayout() {\n $('div.inner_wrapper').each(function() {\n // if element's index is odd then sort\n if($(this).index() % 2 !== 0) {\n\n var content_wrapper = $(this).find('div.residential_content');\n var img_wrapper = $(this).find('di... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to fetch all days that have order records within a month. This function will return an array contains a list of month with format dd. Parameters: year: [string] will determine the year. month: [String] will determine the month. async: [boolean] will determine the function will work on sync/async mode. | function fetchExistDays(year, month) {
let deferred = $.Deferred();
$.ajax({
type: CONSTANTS.AJAX.TYPE.POST,
url: "../php/functions/fetch-exist-days.php",
data: {
"year": year,
"month": month
},
dataType: "JSON",
beforeSend: function() {
addSpinner();
},
success: fu... | [
"async function getOrdersByMonth(month) {\n const rows = await db.query(\"select QUANTITY, TOPPING from ORDERS where Month=?\", [month]);\n\n const data = emptyOrRows(rows);\n\n let error = null;\n if (!rows) {\n error = \"Empty data!\"\n }\n\n return {\n error,\n data\n }\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
generate as many inlets as poly instances that you have and target an instance based on the inlet in which a message is received | function indi() {
out = p.newdefault(x1, y4, "outlet");
for(var i = 0; i < instanceNum; i++) {
xPos[i] = x1+i*xSpacing;
ins[i] = p.newdefault(xPos[i], y1, "inlet");
triggers[i] = p.newdefault(xPos[i], y2, "t", "l", "target");
appends[i] = p.newdefault(xPos[i], y3, "append", i+1);
p.connect(ins[... | [
"function initPoses() {\n let num = 0;\n this.joints = {\n // wrist\n Wrist: new _JointObject.JointObject(\"wrist\", num++, this),\n // thumb\n T_Metacarpal: new _JointObject.JointObject(\"thumb-metacarpal\", num++, this),\n T_Proximal: new _JointObject.JointObject(\"thumb-phalanx-pro... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
called to scroll this.itemsListRef to bring this.itemsListRef into view (i.e. to show the highlited item) | scrollToHighlighted () {
if (this.highlightedRef) {
let itemsListRect = this.itemsListRef.getBoundingClientRect();
let highlightedItemRect = this.highlightedRef.getBoundingClientRect();
if (highlightedItemRect.bottom > itemsListRect.bottom || highlightedItemRect.top < itemsListRect.top) {
... | [
"setScrollOffset() {\n const {\n isMainPageSearch,\n itemHeight,\n } = this.props;\n const { offset } = this.state;\n\n // $list is populated via the ref in the render method below\n if (this.$list) {\n this.$list.scrollTop = isMainPageSearch ? 0 : offset * itemHeight;\n }\n }",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Compute the horizontal scroll bar pos based on canvas position and size | function horizontalScrollbarPos() {
var left = offset.x + width * pixelSize;
var right = canvas.width - offset.x;
return [(left / (left + right)) * (canvas.width - 100), canvas.height - 15];
} | [
"function verticalScrollbarPos() {\n\t\tvar top = offset.y + height * pixelSize;\n\t\tvar bottom = canvas.height - offset.y;\n\t\treturn [canvas.width - 15, (top / (top + bottom)) * (canvas.height - 100)];\n\t}",
"_valueXChanged(value) {\n if (this.enableX) {\n this._handle.style.left = (this._canvas.scro... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Show an `:int` as a hexadecimal value.\ The `width` parameter specifies how wide the hex value is where `"0"` is used to align.\ The `usecapitals` parameter (= `True`) determines if captical letters should be used to display the hexadecimal digits.\ The `pre` (=`"0x"`) is an optional prefix for the number (goes between... | function show_hex(i, width, use_capitals, pre) /* (i : int, width : ?int, use-capitals : ?bool, pre : ?string) -> string */ {
var _width_16998 = (width !== undefined) ? width : 1;
var _use_capitals_17002 = (use_capitals !== undefined) ? use_capitals : true;
var _pre_17006 = (pre !== undefined) ? pre : "0x";
va... | [
"function integerToStringOfFixedWidth(number, width) {\n number = number.toString();\n \n if(width <= number.length) {\n return number.slice(number.length - width);\n } else {\n const numZeroes = width - number.length;\n for(let i = 0; i < numZeroes; i++) {\n number = '0'... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
persist follow status on each public post | function persistFollowStats_discover(fid,data,flag,deleteFlag,editFlag,like_c,toggle_post_img,toggle_post_text){
var authorid_unclean = (data.author.id).split("/");
var authorid_clean = authorid_unclean[authorid_unclean.length - 1];
$.ajax({
headers: {Authorization:'Token '+discover_token},
... | [
"trackFollowStatus(){if(this.auth.currentUser){friendlyPix.firebase.registerToFollowStatusUpdate(this.userId,data=>{this.followCheckbox.prop('checked',data.val()!==null);this.followCheckbox.prop('disabled',false);this.followLabel.text(data.val()?'Following':'Follow');friendlyPix.MaterialUtils.refreshSwitchState(thi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
refresh the iframe for a group of CodeMirrors | function refresh_iframe($codemirror) {
$codemirror.each(function() {
var $this = $(this);
$this.get(0).CodeMirror.refresh();
$this.children('iframe').trigger('_resize');
});
} | [
"function updateIFrame(value) {\n iDoc().open();\n iDoc().close();\n iDoc().location.hash = value;\n }",
"reload() {\n this.requestWebsites();\n }",
"function refresh_content() {\n $('.refresh').on('click', function() {\n show_content();\n });\n }",
"funct... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Disable buffered downloads It's an optimization technique that implies a 1frame delay in the downloads when using async transfers; it may or may not be acceptable, depending on what you're trying to do | disableBufferedDownloads()
{
this._useBufferedDownloads = false;
} | [
"function cancelDownloads() {\n const downloadingVideos = requestedVideos.filter(video => video.downloadState === 'downloading')\n\n if (downloadingVideos.length > 0) {\n setCandidateVideos(previousVideos =>\n previousVideos.map(video => video.downloadState === 'downloading' || video.downloadState... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
=========================================================================================== =========================================================================================== FUNCTIONS TO CREATE DOUGHNUT CHART calculates the angle for the middle of a slice | function midAngle(d) { return d.startAngle + (d.endAngle - d.startAngle) / 2; } | [
"@computed\n get sideCenterAngles() {\n const sideSum = this.windowDimensions.width + this.windowDimensions.height;\n const topBottom = this.windowDimensions.width / sideSum * Math.PI;\n const leftRigth = Math.abs(topBottom - Math.PI);\n return { topBottom, leftRigth };\n }",
"pie() {\n for (var ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Swaps the first element of an array with one of given position. | function swapHeadAndPosition(arr, position) {
var first = arr[0];
arr[0] = arr[position % arr.length];
arr[position] = first;
return arr;
} | [
"function swapTowardTheCenter(arr) {\n var temp1 = arr[arr.length-1]\n arr[arr.length-1] = arr[0]\n arr[0] = temp1\n\n var temp3 = arr[arr.length-3]\n arr[arr.length-3] = arr[2]\n arr[2] = temp3\n return arr\n}",
"function arrayMove(array1, index1, array2) {\n array2[array2.length] = array1[... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
BeamColumnConnectionInSteelByCables checkbox event handler | function OnBeamColumnConnectionInSteelByCables_Change( e )
{
try
{
var newMeasuresOfEmergencyValue = Alloy.Globals.replaceCharAt( current_structural_elements_id * 13 + 2 , Alloy.Globals.ShedModeDamages["MEASURES_OF_EMERGENCY"] , $.widgetAppCheckBoxShedModeFormsDamagesMeasuresOfEmergencyBeamColumnCon... | [
"function OnBeamColumnConnectionByPinsAndSteelPlates_Change( e )\r\n{\r\n try\r\n {\r\n var newMeasuresOfEmergencyValue = Alloy.Globals.replaceCharAt( current_structural_elements_id * 13 + 1 , Alloy.Globals.ShedModeDamages[\"MEASURES_OF_EMERGENCY\"] , $.widgetAppCheckBoxShedModeFormsDamagesMeasuresOfEm... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add header in statistics table to group metrics by category format | function summaryTableHeader(header) {
var newRow = header.insertRow(-1);
newRow.className = "tablesorter-no-sort";
var cell = document.createElement('th');
cell.setAttribute("data-sorter", false);
cell.colSpan = 1;
cell.innerHTML = "Requests";
newRow.appendChild(cell);
cell = document.c... | [
"_buildGroupHeader(){\n\t\tthis.element.classList.add(\"tabulator-col-group\");\n\t\tthis.element.setAttribute(\"role\", \"columngroup\");\n\t\tthis.element.setAttribute(\"aria-title\", this.definition.title);\n\n\t\t//asign additional css classes to column header\n\t\tif(this.definition.cssClass){\n\t\t\tvar class... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Utility functions for when the scale changes This is invoked from the HTML range control | function scale_changed() {
var s = document.getElementById("scale_input");
//alert("slider value " + s.value);
var range = s.value / 100; // .25 - 2
g_config.scale_factor = range;
if (g_enableInstrumentation) {
alert("scale_factor " + g_config.scale_factor);
}
updateScaleCSS(g_config.sc... | [
"function _changeImageScale ( values, handle ) {\n\t\tchangeScale.call( this, values, handle );\n\t}",
"function _changeTextScale ( values, handle ) {\n\t\tchangeScale.call( this, values, handle );\n\t}",
"get scale() { return (this.myscale.x + this.myscale.y)/2;}",
"function _scaling ( /*[Object] event*/ e )... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Translate hold notify preferences from the form/scope back into a single user setting value for opac.hold_notify. | function compress_hold_notify() {
var hold_notify_methods = [];
if ($scope.hold_notify_type.phone) {
hold_notify_methods.push('phone');
}
if ($scope.hold_notify_type.email) {
hold_notify_methods.push('email');
}
if ($scope.hold_notify_type.sms) {
... | [
"function saveSettingsAndUpdatePopup(){\n\tvar settings = {};\n settings.on = document.getElementById(\"onoff\").innerText.toLowerCase().includes(\"on\"); // Sorry about this line\n\tsettings.fast_mode = document.getElementById(\"fast_mode\").checked;\n\tsettings.run_at = document.getElementById(\"run_at\").valu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
============================================= Funcion que permite mostrar el btn descargas y ocultar los botones de btn_inspeccion_apk btn_grabadora_apk btn_regresar ============================================== | function mostrarBtnDescargas(){
if( $('#div_btn_descargas').is(":visible") ){ //esta visible
//si esta visible el div
}else{
//si no esta visible el div
$('#div_btn_descargas').show();
$('#btn_iniciar').show();
$('#div_btn_inspeccion_apk').hide();
$('#div_btn_grabadora_apk').hide();
$('#div_btn_regresar... | [
"function click_btn_descargar_grabadora(){\n\t$(\"#btn_descargar_grabadora\").click(function(){\n\t\tdescargarGrabadoraApk();\n \t});\n}",
"function click_btn_descargar_inspeccion(){\n\t$(\"#btn_descargar_inspeccion\").click(function(){\n\t\tdescargarInspeccionMpApk();\n \t});\n}",
"function btnBuchenAusB() {... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check URL for reset password hash | function checkUrlHash() {
var hash = window.location.hash;
// Allow deep linking to recover password form
if (hash === '#recover') {
toggleRecoverPasswordForm();
}
} | [
"function verifyPasswordResetCode(auth, actionCode, continueUrl) {\n auth.verifyPasswordResetCode(actionCode).then(function(email) {\n window.frames['embeddedpage'].contentDocument.getElementById('account').innerText = email;\n }).catch(function(err) {\n alert ('Expired or invalid link, please try again.');... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
gets all the cells from the document and iterates over them in a forEach loop A forEach loop is an array method that executes a custom callback function on each item in an array. to start the game we reset all of the cells in the list of divs to empty. we then remove the event listener click we placed on the cells so t... | function startGame() {
allCells.forEach((cell) => {
cell.classList.remove(xMarker);
cell.classList.remove(oMarker);
cell.removeEventListener("click", handleClick);
cell.addEventListener("click", handleClick, { once: true });
});
} | [
"function onStartGame() {\n origBoard = [0, 1, 2, 3, 4, 5, 6, 7, 8];\n movesmade = [];\n resultContainer.style.visibility = 'hidden';\n startTime = new Date();\n for (let i = 0; i < cells.length; i++) {\n cells[i].innerText = '';\n cells[i].style.removeProperty('background-color');\n cells[i].addEvent... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to get all exchanges and display them on map. Used for the control room map. | function getAllExchanges()
{
deleteMarkers();
if (window.XMLHttpRequest)
{// IE7+, Firefox, Chrome, Opera, Safari
getAllExchanges_xmlhttp = new XMLHttpRequest();
}
else
{// IE6, IE5
getAllExchanges_xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
getAllExchanges_xmlhttp.onreadystatechange=functio... | [
"function getEarthLayers() {\n // Init Iframes required for viewing elements properly in earth on Windows.\n initIframes();\n // Set up the layer list element and add the name as a header.\n var div = document.getElementById('LayerDiv');\n div.style.display = 'block';\n var name = window.location.pathname;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |