query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
get tasks info from json & create rows for left table | function generateLeftTable() {
//request.open('GET', 'tasks.json');
$.getJSON('tasks.json', function(data) {
var output = '';
$.each(data, function(key, val) {
output += '<tr data-toggle="tooltip" data-placement="bottom" title="' + val.detail + '">';
output += '<td>'+ val.ID +'</td>';
output += '<... | [
"function addToDOM(response) {\n $('#viewTasks').empty();\n for (const taskObj of response) {\n // Make a jQuery object of a table row and add the task values to that row.\n const appendStr = '<tr></tr>';\n const jQueryObj = $(appendStr);\n let appendRowStr = '';\n // Loop over every task in the ta... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the source associated with ndata.notification if it is set. If the existing or requested source is associated with a tray icon and passed in pid matches a pid of an existing source, the title match is ignored to enable representing a tray icon and notifications from the same application with a single source. If... | _getSource(title, pid, ndata, sender) {
if (!pid && !(ndata && ndata.notification))
return null;
// We use notification's source for the notifications we still have
// around that are getting replaced because we don't keep sources
// for transient notifications in this._sour... | [
"getSource(day) {\n return this.sources[day] ? this.sources[day] : false;\n }",
"function refreshNotificationSource() {\n sendWithPromise('getNotificationSource').then(onGetNotificationSource);\n}",
"async getInitialNotification () {\n if (!isIos()) {\n return this._notifications.getInitialNo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if an element matches set of properties. Note: this checks custom properties, and it does not ensure that any children are equivalent. | matches(element, props) {
for (var key in props) {
if (key === 'children') {
continue;
}
if (element[key] !== props[key]) {
return false;
}
}
return true;
} | [
"matches(node, props) {\n return Element$1.isElement(node) && Element$1.isElementProps(props) && Element$1.matches(node, props) || Text.isText(node) && Text.isTextProps(props) && Text.matches(node, props);\n }",
"matches(text, props) {\n for (var key in props) {\n if (key === 'text') {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
`mergeAndPrefix` is used to merge styles and autoprefix them. It has has been deprecated and should no longer be used. | function mergeAndPrefix() {
process.env.NODE_ENV !== "production" ? (0, _warning2.default)(false, 'Use of mergeAndPrefix() has been deprecated. ' + 'Please use mergeStyles() for merging styles, and then prepareStyles() for prefixing and ensuring direction.') : undefined;
return _autoPrefix2.default.all(mergeStyles.... | [
"function prefix_css(css_data) {\n log('Prefixing the CSS');\n return q.resolve(processor.process(css_data).css);\n}",
"function mergeStorybook(_a) {\n var mode = _a.mode, config = _a.config, userConfig = _a.userConfig;\n var _b, _c, _d;\n var newConfig = webpack_merge_1.default(config, {\n plug... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given an array of mentions, computes the start and end point of the context excerpt, and then collapses any overlapping excerpts. | function collapseMentions(mentions) {
var sentenceRe = /([!?.)]+)\s+/g, // sentence splitting requires NLP
i,
n = mentions.length,
d0,
d1;
// First compute the excerpt contexts.
for (i = 0; i < n; ++i) {
d0 = mentions[i];
d0.start = excerptStart(d0);
d0.end = excerptEnd(d0);
... | [
"decorations(node, decorations) {\n var leaves = [_objectSpread$5({}, node)];\n\n for (var dec of decorations) {\n var rest = _objectWithoutProperties(dec, [\"anchor\", \"focus\"]);\n\n var [start, end] = Range.edges(dec);\n var next = [];\n var o = 0;\n\n for (var leaf ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Publish a story to the user's friend's wall | function publishStoryFriend() {
randNum = Math.floor ( Math.random() * friendIDs.length );
var friendID = friendIDs[randNum];
console.log('Opening a dialog for friendID: ', friendID);
FB.ui({
method: 'feed',
to: friendID,
name: 'I\'m using the Hackbook web app',
caption: 'Hackbook for Mo... | [
"function publishStory() {\n FB.ui({\n method: 'feed',\n name: 'Test',\n caption: 'Restaurant',\n description: 'Tasty restaurant',\n link: 'http://apps.facebook.com/mobile-start/',\n picture: 'http://www.facebookmobileweb.com/hackbook/img/facebook_icon_large.png',\n actions: [{ name: 'Get Star... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function that tests each row of a matrix to see if it should be attempted to be simplified JS is ok with the let simplify = false; on each run of the outer loop | simplifyMat(){
for(let i = 0; i < this.nRows; i++){
let simplify = false;
for(let j = 0; j < this.nColumns; j++){
if(this.matrix[i][j] != 0){
simplify = true;
}
}
if(simplify){
this.simplifyRow... | [
"function rowsChecker(puzzle){\n for(let i=0;i<9;i++){\n if(repeatsChecker(getRow(puzzle,i))===false){\n return false\n }\n }\n return true\n}",
"function isSolvable (puzzleArray, rows, cols) {\n let product = 1\n for (let i = 1, l = rows * cols - 1; i <= l; i++) {\n for (let j = i + 1, m = l +... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Load all tasks, the matrix area (blue boxes) and assign them to the different boxes in the matrix | function loadTasksMatrix() {
loadAllTasks();
loadMatrixArea();
assignTaskToBox();
} | [
"function assignTaskToBox() {\n let urgency;\n let importance;\n for (i = 0; i < allTasks.length; i++) {\n if (allTasks[i].urgency == null ) urgency = checkUrgency(i);\n else urgency = allTasks[i].urgency;\n\n importance = allTasks[i].importance;\n if (urgency == \"High\" && imp... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Opens the specified URL, evaluates the page, then outputs the result of the userdefined test to the console (which is in turn read as an output buffer via Node). | function load() {
page.open(url, function() {
var test_passed = page.evaluate(evaluatePage, first_load, cache);
if (test_passed) {
console.log('pass');
// phantom.exit();
}
else {
console.log('fail');
setTimeout(load, REFRESH_DELAY);
... | [
"function testPage(page, options) {\n return function (callback) {\n var start = Date.now();\n var req = request\n .get(page)\n .use(setCommonHeaders)\n .buffer(true)\n .end(function(err, res) {\n var elapsed = Date.now() - start;\n if (err) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns an array of current images on the DOM, formatted to just the extension | function getCurrentImages () {
return Array.from(document.getElementsByClassName('img')).map(function(target){
return getImgExtension(target);
});
} | [
"getImagesTags() {\n return [...this._currentDom.getElementsByTagName(\"img\")];\n }",
"function getImages() {\n var result = [];\n \n var items = document.getElementsByTagName('img');\n\n for(let i = 0 ; i < items.length ; i++) {\n result.push(items[i].src);\n }\n \n return result... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
generates a log for this script at src/assets/branding.log | function writeLog(brand) {
let log = `content automatically generated by the script './branding/set_brand.js'
BRAND ........... ${brand}
RESOURCES ....... branding/brands/${brand}/resources => resources
ASSETS .......... branding/brands/${brand}/assets => src/assets
SERVERCONFIG .... branding/common/config/server.... | [
"function logVersion() {\n logger.info(`skyux-cli: ${getVersion()}`);\n}",
"getLogDownload() {\r\n this.awsConnect.getLog().download();\r\n }",
"function logText(text) {\n\tif(config.dev_log) {\n\t\tvar currentTime = new Date();\n\t\tvar currentDay = ensureNumberStringLength(currentTime.getDate(), 2)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
retrieve locally stored token | function getToken() {
return localStorage.getItem('token');
} | [
"function getToken() {\n\treturn localStorage.getItem('token')\n}",
"function getStoredToken() {\n return authVault.getToken();\n }",
"getByToken(){\n return http.get(\"/Employee/token/\" + localStorage.getItem('login').toString().split(\"Bearer \")[1]);\n }",
"function getToken() {\n oldToke... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reads an arbitrary unsigned int from a buffer. | function readUInt(buffer) {
var length = buffer.length;
var result = 0;
var lossy = false; // Note: See above in re bit manipulation.
if (length < 7) {
// Common case which can't possibly be lossy (see above).
for (var i = length - 1; i >= 0; i--) {
result = result * 0x100 + buffer[i];
}
} ... | [
"function UInt8toUInt32(value) {\n return (new DataView(value.buffer)).getUint32();\n}",
"function decode_int(v) {\n return bigEndianToInt(v);\n }",
"function bufferToBigInt(buf) {\n return BigInt('0x' + bufferToHex(buf))\n}",
"function intToBuffer(integer){var hex=intToHex(integer);return Buffe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks if a message is NSFW For now, this means a message containing 'NSFW' in the body | function isNsfw(text) {
return text.toLowerCase().indexOf("nsfw") != -1;
} | [
"get hasBody() {\n return (this.headers.get(\"transfer-encoding\") !== null ||\n !!parseInt(this.headers.get(\"content-length\") || \"\"));\n }",
"isMessage(this_frame) {\n return (this_frame.headers !== null && reallyDefined(this_frame.headers['message-id']));\n }",
"functi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Whether the document changed in this update. | get docChanged() {
return !this.changes.empty
} | [
"function isModified() {\n\tif (is_modified)\n\t\tif (!confirm('Data on this page has been modified.\\nIf you proceed, changes wont\\'t be saved.\\nProceed anyway?'))\n\t\t\treturn false;\n\treturn true;\n}",
"function isDirty(){\n return this.__isDirty__;\n}",
"get isCompleteUpdate() {\n // XXX: Bug 514040... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Convert all math expressions inside markdown to images. | function processMath(text, { mathInlineDelimiters, mathBlockDelimiters, mathRenderingOnlineService }) {
let line = text.replace(/\\\$/g, "#slash_dollarsign#");
const inline = mathInlineDelimiters;
const block = mathBlockDelimiters;
const inlineBegin = "(?:" +
inline
.map((x) => x[0])... | [
"function buildMathML(tree, texExpression, options) {\n const expression = buildExpression$1(tree, options); // Wrap up the expression in an mrow so it is presented in the semantics\n // tag correctly, unless it's a single <mrow> or <mtable>.\n\n let wrapper;\n\n if (expression.length === 1 && e... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
killback Stops the user from going back to the page by buttons or shortcuts. | function killBack() {
// Works if we backed up to get here
try {
history.forward();
} catch (e) {
return;
}
// Every 500 ms, try again. The only
// guaranteed method for Opera, Firefox,
// and Safari, which don't always call
// onLoad but *do* resume any timers when
// returning ... | [
"function cancel() {\n history.goBack();\n }",
"function goBack(){\n if(screen.current == screen.combat) showMain();\n else if(screen.current == screen.input) setMain(createCombatTable(), screen.combat);\n}",
"backButtonClicked(){\n // get back to the previous page on the app-main navigator... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
viewRange type: all | left | top w: the fixed width of header h: the fixed height of header tx: moving distance on xaxis ty: moving distance on yaxis | function renderFixedHeaders(type, viewRange, w, h, tx, ty) {
const { draw, data } = this;
const sumHeight = viewRange.h; // rows.sumHeight(viewRange.sri, viewRange.eri + 1);
const sumWidth = viewRange.w; // cols.sumWidth(viewRange.sci, viewRange.eci + 1);
const nty = ty + h;
const ntx = tx + w;
draw.save()... | [
"get viewRange() {\n return this._viewDrawWidth / this.pixelsWidthPerUnitTime;\n }",
"setRanges() {\r\n\t\tthis.ranges.x = d3.scaleTime()\r\n\t\t\t.range([0, this.dimensions.width - this.margins.x]);\r\n\r\n\t\tthis.ranges.y = d3.scaleLinear()\r\n\t\t\t.range([this.dimensions.height - (2 * this.margins.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Changes font weight of if an area of study is present ===================================================================== | function checkAreasofStudy() {
if( $('#header-site-id h2 strong').length) {
$('#header-site-id').addClass('change-font-weight')
}
} | [
"function _editTextFontWeight ( /*[Object] event*/ e ) {\n\t\te.preventDefault();\n\t\tvar activeObject = cnv.getActiveObject();\n\t\tif ( this.checked ) {\n\t\t\tactiveObject && activeObject.set({fontWeight: 'bold'});\n\t\t\teditTextCheckboxActivate.call(editTextFontWeight);\n\t\t}\n\t\telse {\n\t\t\tactiveObject ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to show Message This function takes the parameter event, validation, massageId, element If the validation has the value "true", the message in the index.html isn't displayed and the borders of the textfilds stay normal If the validation has the value "false", the message in the index.html is displayed and if i... | function showMessage(event, validation, messageId, element) {
if (validation) {
messageId.style.display = "none";
if (element != null) {
element.style.borderColor = "rgb(111, 157, 220)";
element.style.borderWidth = "2px";
}
} else {
messageId.style.display = "";
if (element != null) ... | [
"function showValidationError(element, msg) {\n const spanID = element.id+'Span';\n const spanNode = document.getElementById(spanID);\n spanNode.innerHTML = msg;\n}",
"function ValidateViewCheck()\n\t{\n\t\t//Set short message with the error code\t\n\t\tvar ShortMessage=ErChkLstSht002;\n\t\t//set long me... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Coding Exercise 37 Multiple Args Exercise Define a function "isSnakeEyes" which accepts 2 numbers as inputs, representing two dice. If both of the numbers are 1, print "Snake Eyes!" otherwise print, "Not Snake Eyes!" define isSnakeEyes below: | function isSnakeEyes(num1, num2) {
if ((num1 === 1) && (num2 === 1)) {
console.log("Snake Eyes!");
}
else {
console.log("Not Snake Eyes!");
}
} | [
"function rollDice(player) { \r\n var die1=rollSingleDice(); \r\n // console.log(\"Die 1: \" + die1);\r\n var die2=rollSingleDice(); \r\n // console.log(\"Die 2: \" + die2);\r\n // var score=die1+die2; \r\n player.addToScore(die1 + die2);\r\n // console.log(\"Score: \" + player.getScore());\r\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
config: config.containerName Name of docker container to run config.dockerImage Name of docker image to run config.sharedDir Absolute path to host path to bind mount to /shared config.dryRun Return a list of steps instead of executing them Throws errors | function ensureUp(config) {
// Ensure that the shared directory is an absolute path.
config.sharedDir = makeAbsolute(config.sharedDir);
// Get the operations that would need to happen.
var ops = opsForUp(config);
var steps = {
dirStatus: [],
todo: [],
done: []
};
/... | [
"async function run() {\n const commands = [addRepo, installPlugins, deploy]\n\n try {\n await status(\"pending\");\n\n process.env.XDG_DATA_HOME = \"/root/.helm/\"\n process.env.XDG_CACHE_HOME = \"/root/.helm/\"\n process.env.XDG_CONFIG_HOME = \"/root/.helm/\"\n \n // Setup necessary files.\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a unique id for each tab content element | _getTabContentId(i) {
return `mat-tab-content-${this._groupId}-${i}`;
} | [
"_assignTabIds () {\n this.tabs.forEach(tab => {\n Component.setAttributeIfNotSpecified(tab, this.tabAttribute, Component.generateUniqueId())\n Component.setAttributeIfNotSpecified(tab, 'id', Component.generateUniqueId())\n })\n }",
"function setTabNumbers(tabContainer){\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function: afficheFmtKML Shows the result in KML format. | function afficheFmtKML() {
var geocoder= viewer.getVariable('geocoder');
geocoder.resultsElement.value= geocoder.outputResultKML;
} | [
"function displayKml(doc){ var numberOfPolys = doc[0].gpolygons.length; var numberOfPolys1= doc[1].gpolygons.length; var numberOfPolys2= doc[2].gpolygons.length; for(var i = 0; i < numberOfPolys; i++) { doc[0].gpolygons[i].setMap(null); } for(var i = 0; i < numberOfPolys1; i++) { doc[1].gpolygons[i].setMap(null); }... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns a random spawn position on the game map | function generateSpawnPosition() {
let x = Math.floor(Math.random() * (bounds.xSpan - 10)) - (Math.abs(bounds.xMin) - 5);
let z = Math.floor(Math.random() * (bounds.zSpan - 10)) - (Math.abs(bounds.zMin) - 5);
let y = 5;
return new three.Vector3(x, y, z);
} | [
"function getSpawnCoords() {\n\tx = Math.round((Math.random()*(width-3*gridSize)+gridSize)/gridSize)*gridSize;\n\ty = Math.round((Math.random()*(height-3*gridSize)+gridSize)/gridSize)*gridSize;\n\treturn [x, y];\n}",
"function pickSpawnTile() {\n var tilePicked = false;\n var cx;\n var cy;\n while (!tilePicke... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Export all of the graphics images into a folder in your Documents folder /BIP/InDesign Source File/images folder | function exportGraphicFiles()
{
var graphics = docData.selectedDocument.allGraphics;
$.writeln("exportResolution Default: " + app.pngExportPreferences.exportResolution);
app.pngExportPreferences.pngQuality = PNGQualityEnum.MAXIMUM; // set MAXIMUM Resolution
app.pngExportPreferences.exportResolution = scriptSett... | [
"function exportImages() {\n let frontImage = frontCanvas.toDataURL({format: 'jpeg'});\n let backImage = backCanvas.toDataURL({format: 'jpeg'});\n\n clearGuides();\n\n console.log('Exporting canvases as images...');\n\n // return front and back images\n return(\n {\n 'front' : fr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initialize all events for Tabbed Content | eventsInit() {
// Force a focus event to fire based on a click event for browsers which don't trigger focusin
// from a 'click' by default (eg: Safari desktop)
events.delegate(this.element, '.tabbed-content__trigger', 'click', (e) => {
e.preventDefault();
// Find the clicked link element (since... | [
"function addListenersToDivsAndTabs() {\n addContentListener(\"home-tab\", homeContentGenerator());\n addContentListener(\"about-tab\", aboutContentGenerator());\n addContentListener(\"contact-tab\", contactContentGenerator());\n }",
"init () {\n this._initSelectors()\n this._initE... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
In the claim requests section of the validators hub, the frontend should search for policies that claimRequestCount.length > 0. Then Place buttons Approve and decline on the div section of that policy. | async function inspectClaimRequest(decision) {
//Submit the claim request for inspection by the validators.
//hashuranceABI = ;
//hashuranceAddress = ;
hashurancecontract = await new window.web3.eth.Contract(hashuranceABI, hashuranceAddress);
response = await hashurancecontract.methods.prepForClaimI... | [
"navigateToEligibility(event) {\n console.log('NAVIGATING TO ELIGIBILITY')\n if (this.Design != 'Mid-Term') {\n\n console.log('Advisor Licenses has called');\n\n this.currentStep = '3';\n console.log('Current step ' + this.currentStep)\n\n try {\n\n console.log('Role__c ' + this.ac... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns the directory where the temporary backups are stored | function tempDir()
{
//global config;
return (config.GENERAL.TEMP_DIRECTORY);
} | [
"function freshDir() {\n tmpenv.tmpdir = tmp.in(tmproot);\n return tmpenv.tmpdir;\n}",
"getCacheDir() {\n const cache_dir = path.join(config.get('datadir'), config.get('deployer.cache_path'));\n return cache_dir;\n }",
"function getCurrentDirectory() {\r\n\treturn File.GetAbsolutePathName(\".... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Render attendance option dropdown | renderSelect() {
const options = {
0: 'Present',
1: 'Unexcused Absent',
2: 'Excused Absent',
3: 'Unexcused Late',
4: 'Excused Late'
}
const optionsAbbrev = {
0: 'Present',
1: 'UA',
2: 'EA',
3: 'UL',
4: 'EL'
}
const optionsColor = {
... | [
"function renderDepartment(data) {\n let x='<option value=\"\" disabled selected label=\"Select The Department that the book belongs to:\"></option>';\n data.forEach(item => {\n x+=\"<option value=\"+item.id+\">\"+item.name+\"</option>\" ;\n });\n department.innerHTML = x ;\n}",
"functio... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
checks for win by using the winning combos array defined in the beginning of this file. if the winning combos array returns true for any part of it, it then returns true using .some() .some() tests whether at least one element in the array passes the test implemented by the provided function. it then grabs every combin... | function checkWin(currentClass) {
return winningCombos.some((combination) => {
return combination.every((index) => {
return allCells[index].classList.contains(currentClass);
});
});
} | [
"function checkRowForWin() {\n var i, totalCount = 1;\n var leftSideComplete = false;\n var rightSideComplete = false;\n var cells = [];\n var row, col;\n \n for(i = 1; i < _config.col; i++){\n \n if (_config.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
creates instructions popup and pauses timer | function instructions(){
var popupdiv = document.createElement("div");
popupdiv.innerHTML = "<div id='cover' onclick='closepopup(this)'></div>" +
"<div id='instructions'>" +
"<div id='close' style='margin-right:-5px; margin-top:-5px;' \n\
onclick='closepopup(this)'>" +
"<img src='images/close.png' o... | [
"function initialiseTimePopup(element){\n\telement.innerHTML += '<label>Time picker</label>';\n}",
"function popUpCorretorStart() {\n var popUpExibida = $( '#hfSessao' ).val();\n \n if( ( popUpExibida == \"False\" || popUpExibida == \"0\" ) && timerPopUp === null ) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Basket functions. Save the basket object to a cookie. | function saveBasket(objBasket) {
var str = JSON.stringify(objBasket);
setCookie(cookieName, str);
} | [
"function getBasket() {\n var str = getCookie(cookieName);\n return str ? JSON.parse(str) : {};\n }",
"function savePizzaState() {\n console.log(\"Saving pizza state\");\n Cookies.set(\"version\", CURRENT_VERSION, { expires: 365, path: '/' });\n Cookies.set(\"pizza\", document.getElementById... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns the index of the given object in the given objects array, 1 if not contained only needed for cyclic logic | function getIndex(objects, obj) {
var i;
for (i = 0; i < objects.length; i++) {
if (objects[i] === obj) {
return i;
}
}
return -1;
} | [
"function instanceArrayPosition(instance) {\n for (var i = 0; i < objects.length; i++) {\n if (objects[i] == instance) {\n return i;\n }\n }\n return -1;\n}",
"function arrayContains(arr, obj){\n \tfor (var i=0; i < arr.length; i++){\n \t\tif (arr[i] == obj){\n \t\t\treturn i;\n \t\t}\n \t}\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calendar for Jan 2014.................................................................................................. | function Jan2014()
{
var date = new Date();
var day = date.getDate();
var month = date.getMonth();
var year = date.getFullYear()+1;
var months = new Array('January','February','March','April','May','June','July','August','September','October','November','December');
var mnth = new Array('Jan','Feb','Mar... | [
"function May2014()\n{ \n var date = new Date();\n var day = date.getDate();\n var month = date.getMonth();\n var year = date.getFullYear()+1;\n \n var months = new Array('January','February','March','April','May','June','July','August','September','October','November','December');\n var mnth = new Array('Ja... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Toggles a submenu for races under the compendium and stashes a dataset in them to use for a fetch | function toggleRaceCompendium(submenu){
submenu.hidden == true ? submenu.hidden = false : submenu.hidden = true;
const raceSubMenuOptions = submenu.querySelectorAll(".item")
let counter = 1
while(counter <= 9){
raceSubMenuOptions.forEach(function(raceItem){
raceItem.dataset.raceId = counter
rac... | [
"function CreateSubmenu() {\n //console.log(\"=== CreateSubmenu == \");\n //console.log(\"loc.Add_subject \", loc.Add_subject);\n //console.log(\"permit_dict \", permit_dict);\n //console.log(\"permit_dict.permit_calc_results \", permit_dict.permit_calc_results);\n\n const el_sub... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
added for the con27 event to count the number of results over time. Will need further thought if I continue with it in particular, how to avoid hard coding the db name | function recordDbCount(dbName) {
//let db = client.db(dbName)
let db = hashDataBases[dbName];
if (db) {
db.collection('result').count({}, function(error, numOfDocs) {
let doc = {type:'colCount',date:new Date(),resultCount:numOfDocs}
db.collection("snapshot").insertOne(doc,... | [
"static async countColleges(){\n const result=await pool.query('SELECT COUNT(collegecode) AS count FROM college');\n return result[0].count;\n }",
"async count(dbuser = this.dbuser) { //section for message logging\r\n\t\ttry {\r\n\t\t\tdbuser.messages.count++;\r\n\t\t\tdbuser.setData();\r\n\t\t} ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Builds the HTML Table out of myList. | function buildHtmlTable(myList, selector) {
let columns = addAllColumnHeaders(myList, selector);
for (let i = 0; i < myList.length; i++) {
let row$ = $('<tr/>');
for (let colIndex = 0; colIndex < columns.length; colIndex++) {
let cellValue = myList[i][columns[colIndex]];
... | [
"function buildHtmlTable() {\n\tvar columns = addAllColumnHeaders(myList);\n\n\tfor ( var i = 0; i < myList.length; i++) {\n\t\tvar row$ = $('<tr/>');\n\t\tfor ( var colIndex = 0; colIndex < columns.length; colIndex++) {\n\t\t\tvar cellValue = myList[i][columns[colIndex]];\n\n\t\t\tif (cellValue == null) {\n\t\t\t\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given a binary tree, print its nodes in preorder | function printPreorder(node) {
if (node == null)
return;
/* first print data of node */
// document.write(node.key + " ");
preorder = preorder + node.key + " "
/* then recur on left sutree */
printPreorder(node.left);
/* now recur on right subtree */
printPreorder(node.right);
} | [
"function preorder(root){\n if(root===null) return;\n root.draw();\n preorder(root.lchild);\n preorder(root.rchild);\n}",
"function printInorder(node) {\n\t\tif (node == null)\n\t\t\treturn;\n\n\t\t/* first recur on left child */\n\t\tprintInorder(node.left);\n\n\t\t/* then print the data of node */\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function. We are off to a good start, but this function doesn't seem to handle everything properly. Add in the proper checks to return NaN for anything that isn't an actual number, except treat null like 0. Note: This min function need not handle more than two arguments. | function min(a, b){
if (a === null) a = 0;
if (b === null) b = 0;
if (isNaN(a) || isNaN(b)) return NaN;
return a < b ? a : b;
} | [
"min() {\n const values = this.$checkAndCleanValues(this.values, \"min\");\n let smallestValue = values[0];\n for (let i = 0; i < values.length; i++) {\n smallestValue = smallestValue < values[i] ? smallestValue : values[i];\n }\n return smallestValue;\n }",
"function getLowestNumber(x, y, z)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function handles the response of the call that informs installation has been selected for the installable product | handleUpdateInstallationResponse(response) {
cartEventBus.$emit('cart-update');
this.$refs.spinner.hideSpinner();
this.$emit('add-installation-success');
} | [
"callInstallDetails() {\n const requestConfig = {};\n this.manageShoppingCartService.installationDetails(requestConfig, this.handleInstallationDetailsResponse, this.handleInstallationDetailsError, this.installDetails.code);\n this.$refs.spinner.showSpinner();\n }",
"handleGetPackageDetails (resp... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Called whenever the user releases his fingers and the touch gesture has completed. This will set the new position and if the user used a 'flick' gesture give the scrolloffset particle a velocity and momentum into a certain direction. | function _touchEnd(event) {
// Remove touch
var primaryTouch = this._scroll.activeTouches.length ? this._scroll.activeTouches[0] : undefined;
for (var i = 0; i < event.changedTouches.length; i++) {
var changedTouch = event.changedTouches[i];
for (var j = 0; j < thi... | [
"updateVelocity(newVelocity) {\r\n this.v = newVelocity;\r\n }",
"move() {\n // Derive mouse vertical direction.\n let touchYPosition = touches.length > 0 ? touches[touches.length - 1].y : this.position.y;\n let touchYDirection = touchYPosition - this.position.y;\n\n if (Math.abs(touchYDirec... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets foreign key meta data | function setForeignKeys(target, foreignKeys) {
Reflect.defineMetadata(FOREIGN_KEYS_KEY, foreignKeys, target);
} | [
"function addForeignKey(target, relatedClassGetter, attrName) {\n var foreignKeys = getForeignKeys(target);\n if (!foreignKeys) {\n foreignKeys = [];\n setForeignKeys(target, foreignKeys);\n }\n foreignKeys.push({\n relatedClassGetter: relatedClassGetter,\n foreignKey: attrNa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Stars (boolean star) the genotype with matching contig, position, reference alternates, and sample_name optimistically locally, and then requests that the API star it serverside. If it fails, the starring is rolled back. | function starGenotype(star, record) {
var data = {
starred: star,
contig: record.contig,
position: record.position,
reference: record.reference,
alternates: record.alternates,
sampleName: record.sample_name
},
url = '/api/runs/' + record.vcf_id + '/genotypes';
se... | [
"function setLocalStarAndNotify(star, record) {\n var recordConditions = _.pick(\n record, 'contig', 'position', 'reference', 'alternates', 'sample_name');\n record = _.findWhere(records, recordConditions);\n record['annotations:starred'] = star;\n notifyChange();\n }",
"genotype(sample: string)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the vector projection of onto other_vector. | projection(other_vector) {} | [
"multiply(otherVector) {\n return new Vector4(this.x * otherVector.x, this.y * otherVector.y, this.z * otherVector.z, this.w * otherVector.w);\n }",
"function computeProjection(v1, v2) {\n return dot(v1, v2);\n}",
"subtract(otherVector) {\n return new Vector4(this.x - otherVector.x, th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Private method for displaying no data message. | function displayNoData(data, msg) {
var hasData = data && data.length && data.filter(function(series) {
return !series.disabled && Array.isArray(series.values) && series.values.length;
}).length;
var x = (containerWidth - margin.left - margin.right) / 2 + margin.left;
var y = (... | [
"function showNoData(tableData, divEle, colspanNo) {\n tableData += '<td align=\"center\" colspan=\"' + colspanNo + '\"> No data to display </td>';\n tableData += '</tbody></table>';\n $('#' + divEle).html(tableData);\n }",
"function displayNoResults() {\n\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
TAB PLUGIN DEFINITION ===================== | function Plugin(option){return this.each(function(){var $this=$(this);var data=$this.data('bs.tab');if(!data)$this.data('bs.tab',data=new Tab(this));if(typeof option=='string')data[option]();});} | [
"function displaySettingsBackgroundTabs() {\r\n var $tabButton = $(\".settings-background-tab-button[data-settings-tabid=\" + getSettingsBackgroundTabId() + \"]\");\r\n $tabButton.tab('show');\r\n addSelectedTxt();\r\n blinkActiveSortType();\r\n}",
"function createTabCtrl(meta) {\n \n }",
"scrol... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given an object with the following properties, create a show slot component to be used in a schedule/table&row display: "showName":"The Cloutlet", "showGenre": "HipHop", "djName": "Evan Maun", "showImageURL": " "showPageURL": " Returns an array of arrays, represented like [day of the week][show component], where the da... | createShowSlotComponents() {
let showSlots = [];
for (var day in this.state.data) {
let curDay = [];
curDay.push(this.createLabelSlot(day));
for (let i = 0; i < this.state.data[day].length; i++) {
curDay.push(<ScheduleShowSlot {...this.state.data[day][i]}/>)
}
showSlots.pus... | [
"function displayShow(show) {\n\tconst showElem = elementWithClass(\"article\", \"show\");\n\tconst dateElem = elementWithClass(\"span\", \"show__date\");\n\tdateElem.textContent = getLongDate(show.date);\n\tconst venueElem = elementWithClass(\"span\", \"show__venue\");\n\tvenueElem.textContent = show.venue;\n\tcon... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
reset hidden value field | function promptengine_resetValueField (
form,
valueID)
{
valueField = form[valueID];
valueField.value = "";
} | [
"function reset_form_input_reward_tensor(){\n document.getElementById(\"reward_tensor\").value=\"\"\n}",
"function resetInputField(field) {\n field.value=\"\";\n}",
"function testcaseResetForm(){\n $('.field-testcase-id').val('');\n $('.field-testcase-name').val('');\n $('.field-testcase-action')... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return a handler that finishes with an error on a bad ACK message. | function _getAckHandler(cleanupObj) {
return (fields) => {
if (fields.type === 0) {
cleanupObj.finish();
} else {
let err = Error('MISSION_ACK returned CMD ID ' + fields.type);
cleanupObj.finish(err);
}
};
} | [
"_initErrorHandler() {\n\t\tthis.app.use(async (ctx, next) => {\n\t\t\ttry {\n\t\t\t\tif (ctx.status === 403) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tawait next();\n\n\t\t\t\tif (ctx.status === 404) {\n\t\t\t\t\tctx.status = 404;\n\t\t\t\t\tctx.body = SevenBoom.notFound('Page not found', ctx.request.path, 'not-f... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Flush both queues and run the jobs. | function flush () {
flushing = true
run(queue)
run(userQueue)
reset()
} | [
"start() {\n this.notify.debug('Start all queues');\n this.started = true;\n for (let queue of this.queues)\n queue.start();\n }",
"async purgeQueues() {\n this.notify.debug('Clear all queues');\n const promises = this.queues.map(queue => queue.purgeQueue());\n await Promise.all(promises);... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Call this now because of the order functions are declared. This method clears the form fields. | function clear_form(){
$(form_fields.all).val('');
} | [
"function clearForm() {\n form.reset();\n }",
"function clearOrderForm(){\n $(\"#oi3PriceId\").val(\"\");\n $(\"#oi3SP\").val(\"\");\n $(\"#oi3Price\").html(\"\");\n $(\"#oi3Qty\").val(\"1\");\n $(\"#oi3Cus\").html(\"\");\n $(\"#oi3Remark\").val(\"\");\n $(\"#oi3Total\").html(\"\");... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Desmos Helper Functions returns the corresponding index for a given id of an expression | function getExprIndex(id) {
let exprs = Calc.getState().expressions.list;
return exprs.findIndex((elem) => {
return elem.id === id;
});
} | [
"getIndex(id, data){\n for(let i=0; i<data.length; i++){\n if(id === data[i].id){\n return i;\n }\n }\n console.log(\"No match found\");\n return 0;\n }",
"indexOfId(id) {\n var Model = this.constructor.classes().model;\n var index = 0;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates property accessors for registered properties and ensures any superclasses are also finalized. | static _finalize() {
if (this.hasOwnProperty('_finalized') && this._finalized) {
return;
}
// finalize any superclasses
const superCtor = Object.getPrototypeOf(this);
if (typeof superCtor._finalize === 'function') {
superCtor._finalize();
}
... | [
"static finalize() {\n if (this.hasOwnProperty(finalized)) {\n return false;\n }\n this[finalized] = true;\n // finalize any superclasses\n const superCtor = Object.getPrototypeOf(this);\n superCtor.finalize();\n this.elementProperties = new Map(superCtor.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
adding Constraints Constraint: only x/o/empty in each cell | function onlyOneValueInACell(){
for(var i = 1; i<= 9; i++){
var constraint = Logic.exactlyOne(cells[i].x, cells[i].o, cells[i].empty);
bp.addConstraint(constraint);
}
} | [
"function createConstraint()\n\t\t{\n\t\t\tconstraint.css({\n\t\t\t\tleft : -(map.width()) + viewport.width(),\n\t\t\t\ttop : -(map.height()) + viewport.height(),\n\t\t\t\twidth : 2 * map.width() - viewport.width(),\n\t\t\t\theight : 2 * map.height() - viewport.height()\n\t\t\t});\n\t\t\t// Check if map is currentl... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Convert a multipolygon to a GeoJSON string, with a custom type of CLCircularRegion for use with iOS. | function multipolygonToJSON(featureVector){
// OSM/Google etc units are meters, so convert to degrees
var center = featureVector.geometry.getCentroid().transform(mercator, geographic);
var radius = Math.abs(featureVector.geometry.bounds.getWidth()/2);
var jsonString = '{"type":"Feature"... | [
"function generateJSONStringFromPolyLine(polyLine){\n\t\tvar shape = [];\n\n\t\tpolyLine.getGeometry().eachLatLngAlt(function (lat, lng, alt, idx) {\n\t\t\tvar tempShape = [];\n\t\t\ttempShape.push(parseFloat(parseFloat(lat).toFixed(6)));\n\t\t\ttempShape.push(parseFloat(parseFloat(lng).toFixed(6)));\n\t\t\tshape[s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A special array is a nonempty array with integers or nested arrays While computing the product sum, you should multiply the sum of the array with the depth it is at. | function productSum(array, depth = 1) {
let total = 0
for (const e of array) {
if (Array.isArray(e)) total += productSum(e, depth + 1)
else total += e
}
return total * depth
} | [
"function productOfArray(arr) {\n //initialize tracker variable\n let tracker = 1;\n\n //main recursive function\n function recursiveReal(arr) {\n //updates the value of tracker by multiplying tracker by the first element of the updated array\n tracker *= arr[0];\n //base (stopping ) condition\n if ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initialise ODE and solve it with JXG.Math.Numerics.rungeKutta() | function ode() {
// evaluation interval
var tspan = [0, 250];
// Number of steps. 1000 should be enough
var N = 1001;
// Right hand side of the ODE dx/dt = f(t, x)
var f = function(t, x) {
var K = couplage.Value();
var omega1 = ... | [
"function RungeKutta() {\n xRungeKutta.length = 0;\n yRungeKutta.length = 0;\n yRungeKuttaErrorGlobal.length = 0;\n yRungeKutta.push(+y0);\n for (let i = x0; i <= X; i+=h) {\n xRungeKutta.push(+i);\n }\n for (let i = 1; i < xRungeKutta.length; i++) {\n var k1 = equation(+xImproved... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds a set amount of degrees to the rotation of the moon | function addDegrees(moon, degreeIncrement){
var newAngle = moon.data('angle') + degreeIncrement;
moon.data('angle', newAngle);
return moonCoords(newAngle);
} | [
"setRotations() {\n this.r3a1_exitDoor.angle = 270;\n }",
"function incAngle(increment) {\n setAngle(Math.min(Math.max(angle + increment, config.angle_min), config.angle_max), true);\n }",
"rotation(value) {\n if (typeof value !== 'number' || isNaN(Number(value)) || !Number.isFinit... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Exit a parse tree produced by KotlinParserprefixUnaryExpression. | exitPrefixUnaryExpression(ctx) {
} | [
"exitPrefixUnaryOperation(ctx) {\n\t}",
"exitPostfixUnaryExpression(ctx) {\n\t}",
"enterPrefixUnaryExpression(ctx) {\n\t}",
"exitPostfixUnaryOperation(ctx) {\n\t}",
"enterPostfixUnaryExpression(ctx) {\n\t}",
"enterPrefixUnaryOperation(ctx) {\n\t}",
"enterPostfixUnaryOperation(ctx) {\n\t}",
"exitPrepro... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handles the colour change control | function controlChangeHandler () {
setColours(this.value);
} | [
"function update_color_choosen_indicator(){\n r = red_slider.value;\n g = green_slider.value;\n b = blue_slider.value;\n choosen_color_indicator.style.backgroundColor = toRGB(r,g,b); \n}",
"function changeColor(event) {\n event.target.style.backgroundColor = paintBrush;\n\n}",
"function colourChan... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function responsible for the initial alerts and prompts. | function initialPrompts() {
userChoice = window.alert(
"Before generating your password, you must select some criteria for your password. Click ok to follow on to the next set of instructions."
);
userChoice = window.alert(
"In the upcoming pop-up, type what set of criteria you may want for your... | [
"function initPrompt() {\n inquirer.prompt([{\n type: \"list\",\n message: \"Make a Selection:\",\n name: \"choice\",\n choices: [\n \"View All Departments?\",\n \"View All Roles?\",\n \"View all Employees\",\n \"View Employees by Manager\",\n \"View Employees by Department\",\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Converts tile XY coordinates into a QuadKey at a specified level of detail. Tile X coordinate. Tile Y coordinate. Level of detail, from 1 (lowest detail) to 23 (highest detail). A string containing the QuadKey. | function TileXYToQuadKey( tileX, tileY, levelOfDetail)
{
var quadKey = "";
for ( var i = levelOfDetail; i > 0; i--)
{
var digit = '0';
var mask = 1 << (i - 1);
if ((tileX & mask) != 0)
{
digit++;
}
if ((tileY & mask) != 0)
{
digit++;
digit++;
}
quadKey += digit;
}
retu... | [
"function QuadKeyToTileXY( quadKey)\n\t{\n\t\tvar tileX = 0, tileY = 0;\n\t\tvar levelOfDetail = quadKey.length();\n\t\tfor (var i = levelOfDetail; i > 0; i--)\n\t\t{\n\t\t\tvar mask = 1 << (i - 1);\n\t\t\tswitch (quadKey[levelOfDetail - i])\n\t\t\t{\n\t\t\t\tcase '0':\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase '1':\n\t\t\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
called to initialize the charts. fetches data from Server and calls drawCharts | function initCharts() {
xmlHttpReq('GET', '/storages_data', '', function(responseText) {
var response = JSON.parse(responseText);
if (response.success) {
drawCharts(response.data);
} else {
snackbar(response.message);
}
});
} | [
"init() {\n const series = this.chartData.series;\n const seriesKeys = Object.keys(series);\n\n for (let ix = 0, ixLen = seriesKeys.length; ix < ixLen; ix++) {\n this.addSeries(seriesKeys[ix], series[seriesKeys[ix]]);\n }\n\n if (this.chartData.data.length) {\n this.createChartDataSet();\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Funcao para exibir alert com opcoes de OK ou Cancelar quando o parametro 'campo' for vazio Esta funcao eh usada na pagina consultarFormaPagamento para garantir que o usuario queira mesmo buscar todos os registros | function confirmarBuscarTodos(campo, op) {
submeter(op);
/*if ((trim(campo.value) == '') || (campo.value == null)) {
if (op == 1) {
alert("Selecione um tipo para ser pesquisado!");
return false;
}
if(confirm("Tem certeza que deseja pesquisar todos os registros?\n... | [
"formNotOK() {\n alert(\"verifiez les champs en rouge\");\n }",
"function confirmacionCargaIO(){\n\tif(!document.forms[\"cargaIOForm\"][\"activoActualizar\"].checked && \n\t\t\t!document.forms[\"cargaIOForm\"][\"activoEliminar\"].checked &&\n\t\t\t!document.forms[\"cargaIOForm\"][\"pasivoActualizar\"].checked... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Load Google Maps and ReportAllUsa scripts, in order. | function loadScripts() {
var googleMapsJS = "https://maps.googleapis.com/maps/api/js?key=" + GOOGLE_MAPS_API_KEY;
console.log("Starting load of: " + googleMapsJS)
$.getScript(googleMapsJS, function() {
console.log("googleMapsJS Script loaded successfully")
... | [
"function loadScripts() {\n loadPageHeader();\n getPages();\n getStyles();\n getScripts();\n addEventListeners();\n}",
"onMapsReady(){\n\n }",
"function loadPriorityScripts(){\r\n executeFunctions([loadGeneralStuff,loadCommandLoader,loadSettingsLoader,loadBigPlaylist]);\r\n}",
"ChangeScriptMap() {\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Renders the title of an appointment to the calendar cell | function dayWithAppointment (title, day) {
let itemClass = `.item${day}`
let cell = document.querySelector(itemClass)
// Doesn't allow appointment title to render twice inside calendar cell
if (cell.hasAttribute('data-content')) {
return
}
const titleEl = document.createElement('span')
titleEl.te... | [
"function setColumnTitle(title){\r\n\treturn \t '<span class=\"endPointDiv endPointLeft\">•</span>'+ title +'<span class=\"endPointDiv endPointRight\">•</span>';\t\r\n}",
"function setupTitle() {\n var alarmRichlist = document.getElementById(\"alarm-richlist\");\n var reminders = alarmRichlist.c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Construct Data from GSX Data | function constructData(data){
const constructedData=[];
data.map(function(i){
constructedData.push({
'Item_Number': i.gsx$itemnumber.$t,
'Product_Name': i.gsx$productname.$t
});
});
return constructedData;
} | [
"function prepareData(){\n testData = toDataFormat(Array.from(testData));\n trainData = toDataFormat(Array.from(tData));\n}",
"function parsetransData(d){\n \n return{\n geoid_2: +d.geoid_2,\n geography: d.geo_display,\n total_population: +d.HC01_EST_VC01,\n age_group: [\n {'16... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the outlet for the current node. | _getNodeOutlet() {
const outlets = this.nodeOutlet;
// Note that since we use `descendants: true` on the query, we have to ensure
// that we don't pick up the outlet of a child node by accident.
return outlets && outlets.find(outlet => !outlet._node || outlet._node === this);
} | [
"node() {\n return this.frame().node;\n }",
"function SBParticipant_getNode()\n{\n return this.node;\n}",
"getOutputPortItemForConnection()\n {\n return this._outputPortItem;\n }",
"function ServerBehavior_getSelectedNode()\n{\n return this.selectedNode;\n}",
"function getTargetNode(event... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
14 Using Filter Create a function called positiveRowsOnly that accept an array of array of numbers(matrix) and return only the rows in the matrix that have all positive integers var numbers= [[ 1, 10, 100 ], [ 2, 20, 200 ],[ 3, 30, 300 ]]; Ex: positiveRowsOnly(numbers) => [ 3, 30, 300 ] | function positiveRowsOnly(arr){
return arr.filter(a=>{
for(i=0;i<a.length;i++){
if(a[i]>0){
continue;
}
return;
};
return a;
}
);
} | [
"function positiveMatrix(input) {\n return input.every((arr) => Array.isArray(arr) && arr.every((subelement) => subelement > 0))\n}",
"function positives(arr) {\n return filter(arr, function(elem) {\n return elem > 0;\n });\n}",
"function getFullRows (grid) {\n let rowList = [];\n\n for (let i = 0; ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
[3] For d=2 Construct Tile objects of the tiling (projected on the cutting plane) from directions: an n times d matrix whose columns are the orthogonal projections of base vectors tiles_info: provides by dual2 tiles_info are used as Tile id as [id2key(t),pos] (for findNeighbors and decoration) | function draw2(directions,tiles_info){
var tiles = [];
for(let tile of tiles_info){
let bounds = [];
for(let a of [[0,0],[0,1],[1,1],[1,0]]){
let q = JSON.parse(JSON.stringify(tile[1]));
q[tile[0][0]] = q[tile[0][0]]+a[0];
q[tile[0][1]] = q[tile[0][1]]+a[1];
let coord = vector_mult_m... | [
"function createTiles() {\n\n\tvar html = '<table id=\"tiles\" class=\"front\">';\n\thtml += '<tr><th><div> </div></th>';\n\n\tfor (var h = 0; h < hours.length; h++) {\n\t\thtml += '<th class=\"head' + h + '\">' + hours[h] + '</th>';\n\t}\n\n\thtml += '</tr>';\n\n\tfor (var d = 0; d < days.length; d++) {\n\t\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This is a function for postV3ProjectsIdMergeRequestSubscribableIdSubscription | postV3ProjectsIdMergeRequestSubscribableIdSubscription(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_to... | [
"postV3ProjectsIdMergeRequestsSubscribableIdSubscription(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'];\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Lista todos os eventos do dentista selecionado retorna os eventos para o calendario | function listaEventosDentista() {
var requestData = {
usuarioClinica: vm.usuarioClinica,
dataInicio: moment(vm.viewDate).startOf(vm.calendarView).valueOf(),
dataFim: moment(vm.viewDate).endOf(vm.calendarView).valueOf()
}
return getEven... | [
"function collectAllEvents() {\n // A set for all calendar events displayed on the UI.\n // Each element in this set is a Json string. \n allEventJson = new Set(); \n \n const eventList = document.getElementById('new-event-list');\n \n // Looks at each event card and scrapes the event's name and \n // start ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
TIMESLIDER PLUGIN DEFINITION ============================ | function Plugin(options, timecell) {
return this.each(function () {
var _this = $(this);
var data = _this.data('timeslider');
if (!data) {
_this.data('timeslider', new TimeSlider(_this, options));
} else {
if (typeof options == 'str... | [
"function MapLayers_Time_CreateSlider() {\n\nMapLayers.Time.\nToolbar = new MapLayers.Time._TimeBar();\n\n}",
"function OnTimeSliderClick()\n{\n\t\n\tnDomain = DVD.CurrentDomain;\n\tif (nDomain == 2 || nDomain == 3) \n\t\treturn;\n\n\tlTitle = DVD.CurrentTitle;\n\ttimeStr = GetTimeSliderBstr();\n\n\tDVD.PlayAtTim... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
ptr > ptr (array) | function h$derefPtrA(ptr, ptr_off) {
return ptr.arr[ptr_off][0];
} | [
"function pointerInc(){\r\n pointer++;\r\n if(pointer === arr.length){\r\n arr.push(0);\r\n }\r\n \r\n}",
"function pointerDec(){\r\n pointer = pointer - 1;\r\n if(pointer < 0){\r\n alert(\"Pointer exceeds Array-Limits (<0)\")\r\n }\r\n}",
"function toU8Array(ptr, length) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
getValueAtIndex params: chart the c3.js chart object, index 0, 1, or 2 for the left, center, or right bar respectively Returns the current bar's value i.e. in this case, ratio of upvotes to downvotes | function getValueAtIndex(chart, index) {
return chart.data()[0].values[index].value;
} | [
"function getBarSVGAtIndex(index) {\n return $(\"path.c3-bar\")[index];\n }",
"function reloadChart(index, shouldUpvote, newNScore) {\n if(shouldUpvote) {\n options.upvotes[index]++;\n } else {\n options.downvotes[index]++;\n }\n\n nScore = newNScore;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
end MakeLabels object generator function / lite Updates the labels widget highlight to match the currently selected index, lite. | function lite(Obj, lite)
{
console.log("TODO: fired LabelLite log");
//return all styles to normal on all the labels
var allLabels =
d3.selectAll("#" + Obj.labels.id).selectAll(".descLabel");
//TODO what I need is a better way to know which collection
//of labels to turn off. Doing it by class seems lame.
allL... | [
"function updateSelectedLabels() {\n\t\t\t\n\t\t\t var selectedLabels = vis.selectAll('text.selectedLabel').data(selectedNodeData);\n\t\t\t \n\t\t\t selectedLabels.enter().append('svg:text')\n\t\t\t \t.attr('class', 'selectedLabel')\n\t\t\t \t.attr('dx', function(d) {\n\t\t\t \tif (arcs.centroid(d... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Remove a delta from a point. This is essentially the steps of applyPointDelta in reverse | function removePointDelta(point, translate, scale, originPoint, boxScale) {
point -= translate;
point = scalePoint(point, 1 / scale, originPoint);
if (boxScale !== undefined) {
point = scalePoint(point, 1 / boxScale, originPoint);
}
return point;
} | [
"function removePoint(){\n \t if(currentPt != null){\n \t\t map.removeLayer(currentPt);\n \t\t currentPt = null;\n \t\t recenterMap();\n \t\t resetCurrentLoc();\n \t }\n }",
"remove(point) {\n if (this.divided) {\n // If there are children then perform the removal on... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
hide show table detail content | function toggleDetailTable() {
$('.extend-data').hide();
$('.luft-extend-table').click(function (e) {
$(this).parent().next().slideToggle(200);
$(this).parent().parent().toggleClass('data-expended');
e.preventDefault();
});
$('.extend-data').slideUp(20... | [
"function makeDetailsVisible() {\n setDetailView(\"show-details\");\n setBlurry(\"blurred-out\");\n }",
"function hideWatchlistTable() {\n $(\"#watch-table-header\").hide();\n $(\"#watchlist-caption\").hide();\n }",
"function actionCollapseAll() {\n $('tr[name=action_entry_referer_header]').hid... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This is a function that returns true 80% of the time We're using it to simulate a request to the distributor being successful this often | function restockSuccess() {
return (Math.random() > .2);
} | [
"function AcceptRequest(requestID) {\n try {\n var bRequest = GetBorrowingRequest(requestID);\n var lRequest = GetLentingRequest(requestID);\n\n // Them vao lich su\n bookshelf.ThemSachVaoLichSuMuon(lRequest.id_user_muon, bRequest.id_user_cho_muon, bRequest.id_sach, bRequest.ngay_muon... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set up a |signalingstatechange| event handler. This will detect when the signaling connection is closed. NOTE: This will actually move to the new RTCPeerConnectionState enum returned in the property RTCPeerConnection.connectionState when browsers catch up with the latest version of the specification! | function handleSignalingStateChangeEvent(event) {
log("*** WebRTC signaling state changed to: " + myPeerConnection.signalingState);
if (myPeerConnection.signalingState === "closed") {
closeVideoCall();
}
} | [
"function handlepairingstatechanged (event) {\n // read variables from the event\n let ev = JSON.parse(event.data);\n let evData = ev.data; // the data from the argon event: \"connecting\" or \"connected\"\n let evDeviceId = ev.coreid; // the device id\n let evTimestamp = Date.parse(ev.published_at);... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Contains all the DFS Algorithm functionality and logics | function dfsAlgorithm() {
const startingPointNode = setDFSAlgorithm(eventStates)
// Set timer to 1s for Animation Frames (in seconds)
runDFSAlgorithm(startingPointNode, eventStates, 1)
visitedNodesAnimation(eventStates, "DFS")
// paintVisitedNodes(eventStates, 1) //Timer set to 1second for Anim... | [
"DFSUtil(vert, visited, stack = []) {\n\n visited[vert] = true;\n \n console.log(vert);\n \n const neighbours = this.AdjList.get(vert);\n \n for (let i in neighbours) {\n\n const neighbour = neighbours[i];\n\n if (!visited[neighbour])\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this method creates more enemies and updates the wave timer | function createNextWave () {
createEnemies();
waveTimer = game.time.now + 5000;
} | [
"generateEnemies() {\n // Run the spawn timer\n this.timer++;\n if (this.enemies.length == 0) {\n this.timer += 2;\n } else if (this.enemies.length == 1) {\n this.timer += 1;\n }\n\n if (\n this.timer >= this.spawnDelay &&\n this.enemies.length < MAX_ENEMIES.value\n ) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Compute the full set of decorations for matches in the given view's viewport. You'll want to call this when initializing your plugin. | createDeco(view) {
let build = new RangeSetBuilder(),
add = build.add.bind(build)
for (let { from, to } of matchRanges(view, this.maxLength))
iterMatches(view.state.doc, this.regexp, from, to, (from, m) =>
this.addMatch(m, view, from, add)
)
return build... | [
"repaintViews() {\n\n for (let viewport of this.viewports) {\n if (viewport.isVisible()) {\n viewport.repaint()\n }\n }\n\n if (typeof this.track.paintAxis === 'function') {\n this.paintAxis()\n }\n\n this.repaintSampleInfo()\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Writes a littleendian 64bit signed int into a buffer. | function writeInt64(value, buffer) {
if (value < MIN_EXACT_INT64 || value > MAX_EXACT_INT64) {
throw new Error("Value out of range.");
}
if (value < 0) {
value += BIT_64;
}
writeUInt64(value, buffer);
} | [
"function encode_int(v) {\n if (!(v instanceof BigInteger) ||\n v.compareTo(BigInteger.ZERO) < 0 ||\n v.compareTo(LARGEST_NUM_PLUS_ONE) >= 0) {\n throw new Error(\"BigInteger invalid or out of range\");\n }\n return intToBigEndian(v);\n }",
"functio... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Make HTTP request for URL and run checks | async function checkURL(check, context, ignoreRedirects, globalHeaders) {
if (!check || !check.url) throw "Check is missing URL!"
if (!check.statuses) check.statuses = [200]
if (check.disabled) {
context.log(`### Skipping: ${check.url}`)
return
}
context.log(`### Checking: ${check.url}`)
... | [
"function urlCheckAlive(data){\n \n var url = data['url'],\n params = data['params'],\n timeOut = data['timeout'] || null,\n caseId = data['caseid'],\n rType = data['type'] || 'GET',\n crossDomain = data['crossDomain'] || null;\n \n var checkDeferred = $simjq.Deferred(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A semantic predicate failed during validation. Validation of predicates occurs when normally parsing the alternative just like matching a token. Disambiguating predicate evaluation occurs when we test a predicate during prediction. | function FailedPredicateException(recognizer, predicate, message) {
RecognitionException.call(this, {message:this.formatMessage(predicate,message || null), recognizer:recognizer,
input:recognizer.getInputStream(), ctx:recognizer._ctx});
var s = recognizer._interp.atn.states[recognizer.stat... | [
"function verify (predicate, defaultMessage) {\n\t return function () {\n\t var message\n\t if (predicate.apply(null, arguments) === false) {\n\t message = arguments[arguments.length - 1]\n\t throw new Error(low.unemptyString(message) ? message : defaultMessage)\n\t }\n\t }\n\t}",
"function P... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Utility function to identify frame type | function frameType(frame) {
var frameClass = frame.attr("class");
if (frameClass.indexOf("readyFrame") != -1)
return "readyFrame";
else if (frameClass.indexOf("ackRRFrame") != -1)
return "ackRRFrame";
else if (frameClass.indexOf("ackREJFrame") != -1)
return "ackREJFrame";
els... | [
"function winActiveViewType() {\n\n var body = $('iframe#canvas_frame', parent.document).contents().find('div.nH.q0CeU.z');\n\n if (body.is(\"*\")) {\n return 'tl';\n } else {\n return 'na';\n }\n\n }",
"getNextPacketType(){\n\t\tif(this.buffer.length < 4)return null;\n\t\treturn this.buff... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
chart factory make routine | function gras_chart_factory_make(registry, args)
{
//create containers
var chart_box = $('<table />').attr({class:'chart_container'});
var tr = $('<tr />');
var td = $('<td />');
tr.append(td);
//call into the factory
try
{
var chart = new registry.chart_factories[args.chart_typ... | [
"function createChart(element_selector, params)\n{\n title_position = 0;\n // Анализируем входные параметры\n //--------------------------------------------------------------------------\n // 1. Формируем параметры запросов\n requestParams.instrument_id = params.histo.instrument_id;\n requestParam... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Constructs a new instance of HttpClientConfiguration with the specified flags. The default values will be used for any flags that are missing or undefined. If overrideFlags is specified, it takes precedence over flags. | function HttpClientConfiguration(flags, overrideFlags) {
this.flags = {};
this.initializeFlags();
this._mergeFlags(flags);
if (overrideFlags) {
this._mergeFlags(overrideFlags);
}
} | [
"function getCommandDefaults(flags) {\n const f = flags;\n Object.entries(f).forEach(([key]) => {\n f[key] = (0, default_flag_args_1.getDefaultValue)(key) || flags[key];\n });\n // this will return a bunch of flags that don't have values\n // and wont know which are required or not\n return... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Replace an existing control. | setControl(index, control) {
if (this.controls[index])
this.controls[index]._registerOnCollectionChange(() => { });
this.controls.splice(index, 1);
if (control) {
this.controls.splice(index, 0, control);
this._registerControl(control);
}
this.u... | [
"replacePanel(replacePanelHref: Href, newPanel: PanelType) {\n const clonedCaseView = this.clone();\n\n clonedCaseView.panelCollection.replace(replacePanelHref, newPanel);\n\n return clonedCaseView;\n }",
"addEmptyControl() {\n let control = FdEditformControl.create({\n caption: `${this.get(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to view all the data using JOIN | function viewAll(){
connection.query("select employee.id, first_name, last_name, title, department.name, salary from employee inner join role on employee.id = role.id inner join department on department.id = role.id",
(err, data) =>{
if (err) throw err;
console.table(data)
... | [
"function displayAll() {\n connection.query(\"SELECT e.id, e.first_name, e.last_name, r.title, r.salary, d.name, m.first_name AS ? , m.last_name AS ? FROM employee e JOIN role r ON e.role_id = r.id JOIN department d ON r.department_id = d.id LEFT JOIN employee m on e.manager_id = m.id;\", [\"manager_first_name... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get index of the last comma | function getIndexComma() {
for (let i = d.length - 1; i >= 0; i--) {
if (d.substring(i, i + 1) === ',') {
return i
}
}
return 0
} | [
"function last(){\n\tvar isi = \"saya beajar di rumah beajar\";\n\tconsole.log(isi.lastIndexOf(\"beajar\",5)); //nilai angka berfungsi sebagai startnya di index\n}",
"insertComma( idx ) {\n\n if( this.state.coaches === null ||\n typeof this.state.coaches === \"undefined\" ) {\n return... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
the best corner is one with 3 options of winning (row, column, diagonal) | function findBestCorner() {
} | [
"function makeBestMove() {\n\t\t\t// look for winning move\n\t\t\t//then findBestCorner();\n\t}",
"function findCorner() {\n\t\tvar availTiles = emptyTiles(board);\n\t\t\n\t\tvar corner = availTiles.filter(tile => tile == 0 || tile == 2 || tile == 6 || tile == 8);\n\n\t\treturn corner;\n\t}",
"function findBest... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Clears the highlighted node, if there is one. If a node is not highlighted, this is a noop. | clearHighlight () {
this._vizceral.setHighlightedNode(undefined);
} | [
"clearSelection() {\n let treeSelection = this.treeSelection; // potentially magic getter\n if (!treeSelection) {\n return;\n }\n treeSelection.clearSelection();\n this.messageDisplay.clearDisplay();\n this._updateContextDisplay();\n }",
"function clearSingleSelection() {\n if (current_... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
processChange Hack to cover the calendar. Currently, the calendars act as two individual start/end datePickers. We need to ignore that fact, and add our own evaluation to decide whether or not we looking at the start/end dateRange | function processChange(value) {
//console.log("Calendar clicked");
//If we are working with the start input
if(cntrl.getStartCal()) {
cntrl.setSelectedStartDate(value);
}
//If we are working with the end input
... | [
"function changeDate(after, before) {\n if (before !== after) {\n if (before) {\n var _before = $filter('rangeDate')(before);\n dataService.save($scope.xpns, _before);\n }\n if (after) {\n $scope.range = $filter('rangeDate')(after)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
================================== Detect credit card type by file name | function get_credit_card_type(fid){
var file = DriveApp.getFileById(fid);
var filename = file.getName();
if(filename.startsWith('Export')){
return 'Isracard';
}
else if(filename.startsWith('Transactions')){
return 'Visa';
}
else if(filename.startsWith('transaction')){
return '... | [
"function getCardType ( num )\n{\n var cctype = \"\";\n\n // Check for Visa\n if ( num.substring ( 0, 1 ) == '4' )\n {\n\tif ( ( num.length == '13' ) || ( num.length == '16' ) )\n\t return \"visa\";\n }\n\n // Check for Mastercard\n if ( ( num.substring ( 0, 2 ) >= '51') && ( num.substring (... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Remove cold inputStreams which are already nested in some higher order stream | function removeDuplicateInputs(inputStreams, outputStreams) {
return inputStreams.filter(function (inputStream) {
return !inputStreams.concat(outputStreams).some(function (otherStream) {
return otherStream.messages.some(function (msg) {
var passes = isNestedStreamData(msg) &&
inputStream.c... | [
"function addGhostInnerInputs(inputStreams) {\n for (var i = 0; i < inputStreams.length; i++) {\n var inputStream = inputStreams[i];\n for (var j = 0; j < inputStream.messages.length; j++) {\n var message = inputStream.messages[j];\n if (isNestedStreamData(message) && typeof message.isGhost !== 'bo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Do processes after writing the shim. | function writeShimPost(target, opts) {
// Only chmoding shims as of now.
// Some other processes may be appended.
return chmodShim(target, opts);
} | [
"writeBundle() {\n this._stopExecution();\n this._startExecution();\n }",
"async function buildShims() {\n // Install a package.json file in BUILD_DIR to tell node.js that the\n // .js files therein are ESM not CJS, so we can import the\n // entrypoints to enumerate their exported names.\n const TMP_PA... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This Map is just a wrapper around regular javascript object. It uses the fact that all javascript objects are essentially associative arrays, leveraging it to map keys to values. Any object can act as a Key. The logic to generate the string representation of the object must be provided in the Map constructor. | function ObjectMap(stringify){
if(typeof stringify == 'function')
/**
* Method to find unique string keys for objects.
*/
this.__stringify__ = stringify;
else throw new Error("Please specify a valid function to find string representation of the objects");
/**
* A plain old javascript object, to... | [
"function Map() {\n this.keys = OrderedSet.create();\n this.values = {};\n}",
"function Map() {\n _classCallCheck(this, Map);\n\n this[map] = {};\n this[zoom] = 16;\n this[init]();\n }",
"function asMap(obj) {\n return Object.assign(new Map(), obj);\n}",
"function objectToMap(o) {\n if ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |