query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Sends initial Socks v4 handshake request. | sendSocks4InitialHandshake() {
const userId = this._options.proxy.userId || '';
const buff = new smart_buffer_1.SmartBuffer();
buff.writeUInt8(0x04);
buff.writeUInt8(constants_1.SocksCommand[this._options.command]);
buff.writeUInt16BE(this._options.destination.port);
// S... | [
"sendSocks4InitialHandshake() {\n const userId = this.options.proxy.userId || '';\n const buff = new smart_buffer_1.SmartBuffer();\n buff.writeUInt8(0x04);\n buff.writeUInt8(constants_1.SocksCommand[this.options.command]);\n buff.writeUInt16BE(this.options.destination.port);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
setJulian Set Julian date and update all calendars | function setJulian(j)
{
document.julianday.day.value = new Number(j);
calcJulian();
} | [
"function setJulian(j) { juliandayvalue = new Number(j);calcJulian();}",
"function calcJulianCalendar()\n {\n setJulian(julian_to_jd((new Number(document.juliancalendar.year.value)),\n\t\t\t document.juliancalendar.month.selectedIndex + 1,\n\t\t\t (new Number(document.juliancalendar.day.value))));\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
gets the already selected skills from grafts for step seven | function getGraftSkills(type){
var skillString = type + "Skills";
//check step 3 subtype graft skills
var skillList = [];
var subtype = $('#creatureSubTypeDrop').val().trim();
if (subtype != '' && subtype != 'None') {
if (creatureSubType[subtype].hasOwnProperty(skillString)){
skillList = skillList... | [
"function getAdditionalAbilities(){\n //check step 3 subtype graft skills\n var skillList = {};\n var subtype = $('#creatureSubTypeDrop').val().trim();\n if (subtype != '' && subtype != 'None') {\n if (creatureSubType[subtype].hasOwnProperty(\"AdditionalAbilities\")){\n skillList = creatureSubType[subty... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get a full kernel model from the server by kernel id string. | function getKernelModel(id, settings) {
settings = settings || __1.ServerConnection.makeSettings();
var url = coreutils_1.URLExt.join(settings.baseUrl, KERNEL_SERVICE_URL, encodeURIComponent(id));
var request = {
url: url,
method: 'GET',
cache: false
}... | [
"async getKernelModel() {\n const { serverParams, kernelId } = localStorage\n const { url, token } = JSON.parse(serverParams)\n\n const serverSettings = ServerConnection.makeSettings({\n baseUrl: url,\n wsUrl: util.baseToWsUrl(url),\n token: token,\n })\n\n const kernelModel = await Ke... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
`getKeyValueChunks` Split a string into chunks matching `: ` /:: declare function getKeyValueChunks (raw: string): Array | function getKeyValueChunks(raw) {
var chunks = [];
var offset = 0;
var sep = ';';
var hasUnclosedUrl = /url\([^\)]+$/;
var chunk = '';
var nextSplit;
while (offset < raw.length) {
nextSplit = raw.indexOf(sep, offset);
if (nextSplit === -1) {
nextSplit = raw.length;
}
chunk += raw.su... | [
"function getKeyValueChunks(raw) {\n\t\t\t\tvar chunks = [];\n\t\t\t\tvar offset = 0;\n\t\t\t\tvar sep = ';';\n\t\t\t\tvar hasUnclosedUrl = /url\\([^\\)]+$/;\n\t\t\t\tvar chunk = '';\n\t\t\t\tvar nextSplit;\n\t\t\t\twhile (offset < raw.length) {\n\t\t\t\t\tnextSplit = raw.indexOf(sep, offset);\n\t\t\t\t\tif (nextSp... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
select a pokemon with a relevant type. | static getRelevantPokemon(typeArray) { // array of pokemon's relevant types
// Randomly select a TYPE from the array
let randType = typeArray[Math.floor(Math.random() * typeArray.length)]
// Collect an array of pokemon with that TYPE
let arrayTypePokemon= Pokemon.filterPokemonByType(randType)
// Ran... | [
"function getPokemonByType(type){\n if(typeof(type) !== \"string\"){\n return {good:false , error:\"ERROR: Type must be a string\"};\n }\n type = type.toUpperCase();\n return pokemonList.filter(monster => monster.types.includes(type));\n }",
"async function getPokemonByType(type) {\n var ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Temporarily removes code blocks from contents before transforming, transforms, then restores the the blocks. | transformWithoutCodeBlocks_(contents, transformer) {
const codeBlockVars = new Map();
// Replace code blocks with variable references
contents = contents.replace(patterns.newMarkdownCodePattern(), (match) => {
const varRef = `{{ code_${ uuid() } }}`;
codeBlockVars.set(varRef, match);
retu... | [
"function cleanupBlocks(ast) {\n \n esrecurse.visit(ast, {\n BlockStatement: function (node) {\n var cleaned = [];\n for (var i = 0; i < node.body.length; i++) {\n var stmt = node.body[i];\n this.visit(stmt);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Color applied to heading after import to avoid duplication. Updates the main document, importing content from the source files. Uses the above parameters to locate content to be imported. Called from menu option. | function performImport() {
// Gets the folder in Drive associated with this application.
const folder = getFolderByName_(PROJECT_FOLDER_NAME);
// Gets the Google Docs files found in the folder.
const files = getFiles(folder);
// Warns the user if the folder is empty.
const ui = DocumentApp.getUi();
if (... | [
"updateCodeMirrorHeadings() {\n Object.keys(this.headings).forEach((id) => {\n const h1Edit = document.getElementById(`${id}-edit`);\n applyRefStyles(h1Edit, this.codeMirrorSizerRef);\n });\n }",
"function menuCallbackUpdate() {\n \n // Get style property\n var hStyle = g... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return true if `value` is objectlike. A value is objectlike if it's not `null` and has a `typeof` result of "object". | function isObjectLike(value) {
return _typeof$1(value) == 'object' && value !== null;
} | [
"function isObjectLike(value) {\n return _typeof$2(value) == 'object' && value !== null;\n }",
"function isObjectLike(value) {\n return _typeof$3(value) == 'object' && value !== null;\n }",
"function isObjectLike(value) {\n return _typeof(value) == 'object' && value !== null;\n }",
"fu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set content on a travel page during transition | function setTravelContent(page, switchPage) {
setContent(page, switchPage); // Load the HTML with ajax
setTimeout(function() { // Want this to run after the page transition
var $bg1 = $('#bg1');
numDivs = $('.bg').length - 1; // Get # of bgDivs to set body height
$('body').height(String... | [
"function setContent() {\n\n toggleLoader('hide');\n _contentContainer.innerHTML = _contentHolder.innerHTML;\n _contentContainer.classList.remove('is--transitioning');\n window.reInit();\n _contentHolder.remove();\n _isTransitioning = false;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
process data array into form easy for flytable code to process: calculate index and yaxis extents to determine when search has found right record copy forward unchanged metadata attributes for use by comic renderer returns the calculated total height of the comics | function cookData(array, rowPadding) {
var prev = {i: 0, h: 0, y: 0};
var first = array[0];
// discover custom attributes
var attributes = [];
for(key in first) {
if(!(key in prev)) {
attributes.push(key);
}
}
for(var i = 0; i < array.length; i++) {
var item = array[i];
// cop... | [
"function calculateDim(data, dimensions) {\n\t\n\tvar row = 0;\n\tvar x = dimensions[0];\n\tvar y = dimensions[1];\n\tvar fontSize = doc.internal.getFontSize();\n\tvar noOfLines = 0;\n\tvar indexHelper = 0;\n\tvar lengths = [];\n\n\theights = [];\n\tvalue = 0;\n\tSplitIndex = [];\n\n\tfor (var i = 0; i < data.lengt... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Verplaats en animeer robots | function updateRobots() {
for (var i = 0; i < robotData.length; i++) {
// Check for hit
let hit_Check = overlappenNanonautRobot(
nanonautX + nanonaut_Hitbox.x_Offset,
nanonautY + nanonaut_Hitbox.y_Offset,
nanonaut_Hitbox.breedte,
nanonaut_Hitbox.hoogte,
robotData[i].x + robot_Hitbox.x_Offset,
rob... | [
"checkVirus() {\n var {x, y} = this.pos;\n agents.filter(a => a instanceof Virus).forEach(v => {\n if(getDistance(x,v.pos.x,y,v.pos.y) < options.infectionDistance && !this.isInfected) {\n if(Math.random() < options.infectionProbability) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
displayWelcome() Displays Welcome message with image of flower and nifty custom animations. Also shows the 'Charts' dropdown for user to select visualizations. | function displayWelcome() {
$("#welcome").css('opacity', 0).show().animate({ opacity: 1 }, 750, function() {
$("#welcome").animate({ top: "15%" }, 1000, function() {
$("#welcomemessage").fadeIn(function () {
setTimeout(function() {
$("#welcomebutton").fadeIn(function() {
initializeRockAndRollB... | [
"function showWelcome() {\n const demo = action(\"load-demo\", \"demo database\");\n let message = `<p>${messages.invite}<br>or load the ${demo}.</p>`;\n message += `<p>Click the logo anytime to start from scratch.</p>`;\n if (!gister.hasCredentials()) {\n const settings = action(\"visit\", \"set... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add tab scope/DOM node to the cache and configure to autoremove when the scope is destroyed. | function addToCache(cache, item) {
var scope = item.tab;
cache[ scope.$id ] = item;
cache.length = cache.length + 1;
// When the tab is removed, remove its associated material-view Node...
scope.$on("$destroy", function () {
angular.element(ite... | [
"function SetTabStorageVariable() {\n chrome.storage.local.set({'TabsCache': {}});\n }",
"rewriteCache() {\n this.cache = {\n levels: [],\n levelCount: 0,\n rows: [],\n nodeInfo: new WeakMap()\n };\n\n rangeEach(0, this.data.length - 1, (i) => {\n this.cacheNode(this.da... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
tell message to actor by system.eventStream | tell(event, message) {
this.eventStream.emit(event, message);
} | [
"addEvent(e) {\n this.stream.addEvent(e);\n }",
"dispatchMessageEvent(){\n const detail = this.getMessage();\n const event = new CustomEvent('message', {detail});\n this.dispatchEvent(event);\n }",
"emitMessage (event) {\n this.emit('on-message', event)\n }",
"_onStreamEv... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
TODO emit events: entity>children:removeChild | removeChild(childId) {
const idx = this.children.indexOf(childId);
if (idx >= 0) {
this.children.splice(idx, 1);
}
const child = this.getEntity(childId);
if (child.hasComponent(Children)) {
child.children.setParent(undefined);
}
} | [
"removeChild(node)\r\n {\r\n for(i = 0; i < children.length; i++){\r\n if(children[i] == node)\r\n {\r\n children.splice(i, 1)\r\n }\r\n }\r\n node.setParent\r\n }",
"removeChild(child) {\n this.children = this.children.filter(el => { return el.tid != chil... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to determine amount covered and log out for each patient. | function amountCovered(claim){
var paidOutPerClient = '';
var percent = percentageCovered(claim);
//Amount paid out rounded to the nearest dollar amount.
var amount = Math.round(claim.visitCost * (percent / 100));
//Add to the total money paid out. Logged at the end.
totalPayedOut += amount;
paidOutPerClient +=... | [
"function amountCovered(claim) {\n\tvar covered = Math.round(claim.visitCost * coveragePercent(claim));\n\tconsole.log(\"Paid out $\" + covered + \" for \" + claim.patientName);\n\ttotalPayedOut += covered;\n\treturn covered;\n}",
"function percentCovered(patient) {\n\tvar covered = 0;\n\tvar visit = patient.visi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
ask for an image anchor. Provide a uid for the anchor that will be created. Supply the image in an ArrayBuffer, typedArray or ImageData width and height are in meters | createImageAnchor(uid, buffer, width, height, physicalWidthInMeters) {
return new Promise((resolve, reject) => {
if (!this._isInitialized){
reject(new Error('ARKit is not initialized'));
return;
}
let b64 = base64.encode(buffer);
window... | [
"function createImageAnchor(image) {\n var imageAnchor = document.createElement(\"a\");\n imageAnchor.onmouseover = function anonymous() { mousedOnThumbnail(image.id); };\n imageAnchor.appendChild(image);\n return imageAnchor;\n }",
"function getContactPhoto(uid,cb) {\n var con... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Find the max separation between poly1 and poly2 using edge normals from poly1. | function FindMaxSeparation(poly1, xf1, poly2, xf2) {
var count1 = poly1.m_count;
var count2 = poly2.m_count;
var n1s = poly1.m_normals;
var v1s = poly1.m_vertices;
var v2s = poly2.m_vertices;
var xf = Transform.mulT(xf2, xf1);
var bestIndex = 0;
var maxSeparation = -Infinity;
for (va... | [
"function FindMaxSeparation(poly1, xf1, poly2, xf2) {\n var count1 = poly1.m_count;\n var count2 = poly2.m_count;\n var n1s = poly1.m_normals;\n var v1s = poly1.m_vertices;\n var v2s = poly2.m_vertices;\n var xf = Transform.mulTXf(xf2, xf1);\n\n var bestIndex = 0;\n var maxSeparation = -Infinity;\n for (va... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
reset default inputs (name, qty, comments) | function resetInputs() {
$('#qty').val("1");
$("#name").val("");
$("#comments").val("");
} | [
"function resetFields () {\n this.input.value = '';\n this.output.value = '';\n }",
"function resetFields() {\n document.getElementById('add-name').value = '';\n document.getElementById('add-rating').value = '';\n document.getElementById('add-comment').value = '';\n}",
"_clearForm() {\n // Cle... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Init the various properties of the conflictedTaxaObj as needed. | function initConflictedGenus() {
if ( conflictedTaxaObj["conflictedGenus"] === undefined ) { conflictedTaxaObj["conflictedGenus"] = {}; }
if ( conflictedTaxaObj.conflictedGenus[tP.role] === undefined ) { conflictedTaxaObj.conflictedGenus[tP.role] = {}; }
if ( ... | [
"function initTopTaxa() {\n taxaNameMap[1] = 'Animalia';\n taxaNameMap[2] = 'Chiroptera';\n taxaNameMap[3] = 'Plantae';\n taxaNameMap[4] = 'Arthropoda';\n batTaxaRefObj = {\n Animalia: {\n kingdom: \"Animalia\",\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks if the string contains any fullwidth chars. If given value is not a string, then it returns false. | function isFullWidth(value) {
return typeof value === 'string' && validator_lib_isFullWidth__WEBPACK_IMPORTED_MODULE_1___default()(value);
} | [
"function isFullWidth(value) {\n return typeof value === \"string\" && validator.isFullWidth(value);\n}",
"function isFullWidth(value) {\n return typeof value === \"string\" && validator.isFullWidth(value);\n }",
"function isFullWidth(dataValue)\r\n{\r\n\r\n\tif (dataValue == \"\" ) {\r\n\t\treturn... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds an "event" onto the fake xhr object that just calls the samenamed method. This is in case a library adds callbacks for these events. | function _addEventListener(eventName, xhr){
xhr.addEventListener(eventName, function (event) {
var listener = xhr["on" + eventName];
if (listener && typeof listener == "function") {
listener(event);
}
});
} | [
"function AjaxEvent () {}",
"function _addEventListener(eventName, xhr) {\n xhr.addEventListener(eventName, function (event) {\n var listener = xhr[\"on\" + eventName];\n\n if (listener && typeof listener == \"function\") {\n listener.call(event.target, event);\n }\n });\n }",
"func... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function sets the second Y point | setPoint2Y(y) {
return this.point2.setY(y);
} | [
"setY(index, y) {\n this.xy[index * 2 + 1] = y;\n }",
"setY(index, y) {\n this.xy[index * 2 + 1] = y;\n }",
"setPoint1Y(y) {\n\n return this.point1.setY(y);\n }",
"function onSetSecondLineY() {\n setSecondLineY();\n}",
"setY(index, y) {\n this._linePoints[inde... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Do something when dragging stops on agenda div | function myAgendaDragStop(eventObj, divElm, agendaItem) {
//alert("drag stop");
} | [
"function myAgendaDragStop(eventObj,divElm,agendaItem){\n\t\t//alert(\"drag stop\");\n\t}",
"function myAgendaDragStop(eventObj,divElm,agendaItem){\n\talert(\"drag stop\");\n}",
"handleDragEnd() {\n this.stopDragging();\n\n this.isDragging = false;\n }",
"f... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return true if the trusted FQDN matched the certificate common name | function checkAcmActivationCertName(commonName, trustedFqdn) {
commonName = commonName.toLowerCase();
trustedFqdn = trustedFqdn.toLowerCase();
if (commonName.startsWith('*.') && (commonName.length > 2)) { commonName = commonName.substring(2); }
return ((commonName == trustedFqdn) || (tru... | [
"function check_CN(cn, did) {\n\n log.info('verifying CN matches the d3ck ID')\n\n var cmd = 'openssl'\n\n var argz = ['x509', '-noout', '-subject', '-in', d3ck_keystore +'/'+ did + \"/d3ck.crt\"]\n\n cn = d3ck_spawn_sync(cmd, argz)\n\n // subject= /C=AQ/ST=White/L=D3cktown/O=D3ckasaurusRex/CN... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Middleware to check the ownership of campground | function checkCampgroundOwnership(req, res, next) {
if (req.isAuthenticated()) {
Campground.findById(req.params.id, (err, foundCampground) => {
if (err) {
res.redirect("back")
} else {
// if yes, does hes own the campgrounds
if (foundC... | [
"function checkCampOwnership(req,res,next) {\n\t// is user logged in \n\t\tif(req.isAuthenticated()){\n\t\t\t\t\t// true\n\t\t// does the user own campground?\n\t\t\tCampground.findById(req.params.id,function(err,foundCamp){\n\t\n\t\t\tif(err){\n\t\t\t\tconsole.log(\"couldnt find campground\");\n\t\t\t\treq.flash(\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
judging is a pair of brackets valid or not | function isBracketValid(Look) {
try {
var Bracket = new Array();
for (var i = 0; i < Look.length; i++) {
if (Look[i] == "(" || Look[i] == ")") {
Bracket.push(Look[i]);
}
}
if (Bracket.length % 2 != 0) throw "odd Brackets";
var count1 = ... | [
"static validateTagParentheses(s) {\n let open = 0;\n let index = 0;\n for (let j = 0; j < s.length; j++) {\n let i = s[j];\n if (i === \"[\") {\n if (s[index-1]) {\n if (s[index-1] !== \"/\") {\n open++;\n }\n } else {\n open++;\n }\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check the validity of every text input field on the page. Scans all of the text input objects and checks their validity, marking them as appropriate. | function checkAll() {
jQuery("input[type='text']").each(function() {
check(this, this.name);
});
} | [
"function SP_ValidateTextFields() {\n\tvar pageList = new String(mcEditablePages).split(','),\n\t\ttxtVal = '';\n\n\tif (SP_Trim(pageList) !== '') {\n\t\tfor (var i = 0, l = pageList.length; i < l; ++i) {\n\t\t\tvar pageId = +SP_Trim(pageList[i]) + 1;\n\t\t\t\n\t\t\tif (pageId > 2) {\n\t\t\t\tif (pageId < 10) {\n\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
adjust s.no. column data in the table | function adjustSno(tableID) {
var table = document.getElementById(tableID);
var rowCount = table.rows.length;
for(var i=1; i<rowCount; i++) {
table.rows[i].cells[0].innerHTML = i;
}
} | [
"function updateDataCol (tr, col, s) {\n Doc.tmplElement(tr, col).textContent = s\n}",
"function updateNumCol() {\n if (hasNumCol()) {\n i = 1;\n var rowSpan = 0;\n var rowSpanCount = 0;\n\n each(table.rows, function(tr, y) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
start watching beacon signal | watch () {
dbg('watch')
this.delegate = new cordova.plugins.locationManager.Delegate()
cordova.plugins.locationManager.setDelegate(this.delegate)
// Declare regions
let beaconRegion = new cordova.plugins.locationManager.BeaconRegion(this.beacons.identifier, this.beacons.uuid, this.beacons.major, th... | [
"async start(){\r\n // do full scan first so we have state that can change\r\n await this.rescan()\r\n\r\n this.chokidar = chokidar.watch([this.watchPath], {\r\n persistent: true,\r\n ignoreInitial : true,\r\n awaitWriteFinish: {\r\n stabilityThreshold: 2000,\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates an instance of DocumentContext a store for current x, y positions and available width/height. It facilitates column divisions and vertical sync | function DocumentContext(pageSize, pageMargins) {
this.pages = [];
this.pageMargins = pageMargins;
this.x = pageMargins.left;
this.availableWidth = pageSize.width - pageMargins.left - pageMargins.right;
this.availableHeight = 0;
this.page = -1;
this.snapshots = [];
this.endingCell = null;
this.tracker = n... | [
"function DocumentContext(pageSize,pageMargins){this.pages=[];this.pageMargins=pageMargins;this.x=pageMargins.left;this.availableWidth=pageSize.width-pageMargins.left-pageMargins.right;this.availableHeight=0;this.page=-1;this.snapshots=[];this.endingCell=null;this.tracker=new TraversalTracker();this.backgroundLengt... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fetch account data for UI when User switches accounts in wallet User switches networks in wallet User connects wallet initially | async function refreshAccountData() {
// If any current data is displayed when
// the user is switching acounts in the wallet
// immediate hide this data
document.querySelector("#connected").style.display = "none";
document.querySelector("#prepare").style.display = "block";
// Disable button while UI is l... | [
"async function refreshAccountData() {\n\n // If any current data is displayed when\n // the user is switching acounts in the wallet\n // immediate hide this data\n //document.querySelector(\"#connected\").style.display = \"none\";\n //document.querySelector(\"#prepare\").style.display = \"block\";\n //docume... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This is the event handler for the completion of the DOM loading. This creates the Grid within the body element. | function initHexGrid() {
console.log('onDocumentLoad');
window.removeEventListener('load', initHexGrid);
var hexGridContainer = document.getElementById('hex-grid-area');
main.grid = window.hg.controller.createNewHexGrid(hexGridContainer, app.data.postData, false);
app.parameters.initDat... | [
"function social_curator_grid_post_loaded(data, element){}",
"load() {\n $(this.parentPageDom).append(this.render());\n this._bindEvent();\n this._bindResizable();\n }",
"function pageLoaded() {\n\n\t\t// injectSVG(); // inject them SVGs\n\n\t\trowHeight();\n\t\ttoggleShi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Move to next visible property. | NextVisible() {} | [
"function mainMoveToNextProperty(wnd)\n\t{\n\t\tif (incrementCurrentPropertyIndex())\n\t\t{\n\t\t\tmainShowCurrentProperty(wnd);\n\t\t}\n\t\telse\n\t\t{\n\t\t\twnd.location.replace(\"weights.html\"); // --> Finished answering questions.\n\t\t}\n\t}",
"next() {\n if (this.isHide()) return;\n\n const oldSelec... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
New random color variable for next | newNextColor() {
if (this.gameOver) {
return;
}
this.nextBlob1Color = Math.floor(Math.random() * this.puyoVariations) + 1;
this.nextBlob2Color = Math.floor(Math.random() * this.puyoVariations) + 1;
this.state.updateNextBlobs();
} | [
"function randomColor(){\n\n\t\t//Random number generator 0-3\n\t\tvar randomNumber = Math.floor((Math.random() * 4));\n\t\tvar color = colors[randomNumber];\n\t\tsimonSequence.push(color);\n\t}",
"function randomColor() { return Math.floor(Math.random() * 16777215); }",
"function randomize() {\n color1.valu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This is a function for deleteEnvironmentForRepository / Delete an environment | deleteEnvironmentForRepository(incomingOptions, cb) {
const Bitbucket = require('./dist');
let apiInstance = new Bitbucket.DeploymentsApi(); // String | The account // String | The repository // String | The environment UUID.
/*let username = "username_example";*/ /*let repoSlug = "repoSlug_example";*/ /*l... | [
"deleteEnvironment(env) {\n if(['*', 'default', 'gui'].indexOf(env) === -1)\n {\n const INPUT_SETTINGS = global.settings.input;\n if(this.environment === env) INPUT_SETTINGS.I_ENVIRONMENT = this.environment = 'default';\n this.environments.splice(this.environments.indexOf(env), 1);\n this.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the SWFUploader with the given ID | function getUploader(uploaderId)
{
for (var i = 0; i < uploaders.length; i++) {
if (uploaders[i].movieName == uploaderId) {
return uploaders[i];
}
}
return null;
} | [
"function getUploader(uploaderId) {\n for (var i = 0; i < uploaders.length; i++) {\n if (uploaders[i].movieName == uploaderId) {\n return uploaders[i];\n }\n }\n return null ;\n }",
"getById(id) {\r\n return new Drive(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
fills in the tabbed display of metadata for one model | function listMetadata(name){
console.log("in listMetadata");
if (name != null) {
document.getElementById("metadata_holder").style.display = "block";
document.getElementById("type_holder").style.display = "none";
console.log(" model to display is " + name);
getM... | [
"function show_edit_metadata(exp_id) {\n fill_controlled_vocabulary(null);\n fill_run_category_vocabulary(exp_id, null);\n var exp = experiment_metadata[exp_id];\n $.each(metadata_fields, function(index, val) {\n var input_id = val[2];\n var field_value = exp[input_... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
disables / enables the submit button depending on the selected trim. If a valid version is select the submit button is enabled, else not. | function handleSubmitButton() {
var trim = document.getElementById("trim").value;
var submitButton = document.getElementById("submit");
submitButton.disabled = (trim == "");
} | [
"function changeTrim() {\n if ($trimSelect.val() !== \"\") {\n $submitBtn.removeClass(\"disabled\");\n } else {\n $submitBtn.addClass(\"disabled\");\n }\n }",
"function handleSubmitButton(versionName) {\r\n\tvar submitBu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
the four a positions we're interested in |||| .. |||| => possible split positions // total is first times second ..aa bbbb a..a bbbb aa.. O(N^2) due to the case where we have no 'a' and we have to find all possible three groups | function solution(S) {
const a_indexes = findIndexesOfA(S);
if (!a_indexes.length) return [...subsets(S.split(''), 3)].length; // all possible three groups
if (a_indexes.length % 3) return 0; // not possible to split in three groups having same amount of 'a' chars
// now we're sure that it can be splitted in th... | [
"function threeSplit(a) {\n const sum = a.reduce((a, b) => a + b);\n if (sum % 3 !== 0) {\n return 0;\n }\n const third = sum / 3;\n let ways = 0;\n let jStart = 2;\n for (let i = 1; i < a.length - 1; i++) {\n let firstSum = a.slice(0, i).reduce((a, b) => a + b);\n for (le... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
For this example page, stop the Form from being submitted, and update the cal instead | function handleSubmit(e) {
updateCal();
YAHOO.util.Event.preventDefault(e);
} | [
"function handleSubmit(e) {\n updateCal();\n YAHOO.util.Event.preventDefault(e);\n }",
"function submit() {\n api.create_travel_date(props.form);\n // Clear and close the form afterward\n cancel();\n }",
"function watchSubmitUpdateTask() {\n $('#task-form-update').submit(event ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get /lists/points/block block lists in order of points (upvotesdownvotes) | function getBlockByOrder() {
return db('lists')
.select('*')
.where('is_block_list', true)
.where('public', true)
.orderBy('list_points', 'desc')
} | [
"function getBlockByOrder() {\n return db('lists')\n .select('*')\n .where('is_block_list', true)\n .orderByRaw('(list_upvotes - list_downvotes) desc')\n}",
"function getAllByOrder() {\n return db('lists')\n .select('*')\n .where('public', true)\n .orderBy('list_points', 'desc')\n}",
"func... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Vuelve a editar a la direccion original | async restaruarDireccionEntrega() {
addStep('Vuelve a editar a la direccion original');
await super.clickearElemento(await this.botonUpdate);
await super.clickearElemento(this.address);
await super.vaciarCampoYEnviarTexto(await this.address, datos.direccion);
await super.clickea... | [
"function editPath() {\r\n\tif (minigames[8].vars.edit_path) {\r\n\t\tstopEdit();\r\n\t} else {\r\n\t\tminigames[8].vars.edit_path = true;\r\n\t}\r\n}",
"function editFile() {\n\tvar theDOM = dw.getDocumentDOM();\n\t\n\tif (pathControl.value == \"\") {\n\t\treturn;\n\t}\n\t\n\tif (pathControl.value.match(/^\\//gi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Process GROW data to prepare it for graphing, pass data to drawGrowChart function | function processGrowData(data) {
// The order of GROW variables returned is not consistent
// So we need to check if the variable names match
// Before assigning them to their javascript variables
if (data['Data'][0]['VariableCode'] == 'Thingful.Connectors.GROWSensors.air_temperature') {
air_tem... | [
"function processGrowData(data) {\n // The order of GROW variables returned is not consistent,\n // so we need to check if the variable names match\n // before assigning them to their javascript variables.\n if (data['Data'][0]['VariableCode'] == 'Thingful.Connectors.GROWSensors.air_temperature') {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
parsing the DOM for on and action attribute | onEvent() {
const elements = document.querySelectorAll("[on]");
for (let i = 0; i < elements.length; i++) {
const attr = elements[i].getAttribute("on");
const action = elements[i].getAttribute("action");
elements[i].addEventListener(attr, () => {
eval(... | [
"function onAttr( tag ,atr,value=true){\tswitch(value){\r\n\tcase false:return delAttr(tag,atr);break;case true:return tag.getAttribue(atr);break;default:return setAttr(tag,atr,value);break;}\t\r\n}",
"function evaluateAttribute(scope, elem, attrs) {\r\n\t\t//the list is first split into macro group accordingly w... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
isValidRegionPlacement returns true if a value is a valid value for a region | isValidRegionPlacement(row, column, value) {
if (this.getCell(row, column)) {
return false;
} else {
return isValidValue(this.getRegion(row, column), value);
}
} | [
"function isValidRegion(region) {\n return regions.hasOwnProperty(region);\n}",
"function assertValidRegion({region}) {\n return region;\n}",
"isValidRegion(regionName) {\n // use isValidState/ZipCode/County to check if given US geography exists\n return ( this.isValidState(regionName) ||\n this.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Validates that the provided named option equals one of the expected values. | function validateNamedPropertyEquals(functionName, inputName, optionName, input, expected) {
var expectedDescription = [];
for (var _i = 0, expected_1 = expected; _i < expected_1.length; _i++) {
var val = expected_1[_i];
if (val === input) {
return;
}
expectedDes... | [
"function validateNamedPropertyEquals(functionName, inputName, optionName, input, expected) {\n var expectedDescription = [];\n for (var _i = 0, expected_1 = expected; _i < expected_1.length; _i++) {\n var val = expected_1[_i];\n if (val === input) {\n return;\n }\n expe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The (absolute) position directly before the wrapping node at the given level, or, when `depth` is `this.depth + 1`, the original position. | before(depth) {
depth = this.resolveDepth(depth);
if (!depth)
throw new RangeError("There is no position before the top-level node");
return depth == this.depth + 1 ? this.pos : this.path[depth * 3 - 1];
} | [
"after(depth) {\n depth = this.resolveDepth(depth);\n if (!depth)\n throw new RangeError(\"There is no position after the top-level node\");\n return depth == this.depth + 1 ? this.pos : this.path[depth * 3 - 1] + this.path[depth * 3].nodeSize;\n }",
"childBefore(pos) { return this.enter(-1, pos); ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
connct with end points | connectEpochEndPoints()
{
// console.log(this.allEndPoints);
setTimeout( ()=>{
try{
// console.log(this.jsPlumbInstance);
this.state.setupRules && this.state.setupRules.map( (ep,idx)=>{
ep.parent.map( (c,io)=>{
... | [
"get endPoints() {\n return [this.startPoint, this.endPoint];\n }",
"calculateEndpoints(head = this.head, tail = this.tail) {\n const curve = new Curve(head, this.controlPt, tail);\n const incrementsArray = [0.001, 0.005, 0.01, 0.05];\n let increment = incrementsArray.pop();\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Called at the after a model constructor function is run. exitNamespace() will shift the current namespace off of the stack, 'exiting' to the next namespace in the stack | function exitNamespace() {
namespaceStack.shift();
return fw.utils.currentNamespace();
} | [
"exitOracle_namespace(ctx) {\n\t}",
"_exitScope() {\n\t\tthis.scope = this.scope.parent;\n\t}",
"exitNseModelName(ctx) {\n\t}",
"exitNseModel(ctx) {\n\t}",
"exitExplicitSubModel(ctx) {\n\t}",
"exitComplexModel(ctx) {\n\t}",
"exitConstructor_declaration(ctx) {\n\t}",
"exitModelInfoDefinition(ctx) {\n\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add a slider for floating point numbers | addFloat(name, min, max, value, callback, hide = true) {
this.defaultValues[name] = value;
this.elementMap[name] = this.elementCounter;
this.types[name] = "float";
let e = document.getElementById("guiArea");
let line = document.createElement("div");
line.setAttribute("cla... | [
"function makeSlide(t,e){return'<label for=\"'+t+'\" > '+t+': <span id=\"'+t+'-value\">…</span></label> <input type=\"range\" min=\"0\" max=\"'+e+'\" step=\"0.1\" id=\"'+t+'\">'}",
"function showSliderValue() {\n rangeBullet.innerHTML = rangeSlider.value;\n let leftPosition = (window.screen.width - 500) / 2;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Swaps the sortIndex with the next lesserEntry. | function decrementSortIndex(entry){
var d = $.Deferred();
db.transaction(function (tx) {
// fetch sortIndex of the current entry
tx.executeSql('SELECT sortIndex FROM entries WHERE id = ? ', [entry.id], function (tx, entryResults) {
if (!entryResults.... | [
"function incrementSortIndex(entry){\n\n var d = $.Deferred();\n\n db.transaction(function (tx) {\n\n // fetch sortIndex of the current entry\n tx.executeSql('SELECT sortIndex FROM entries WHERE id = ? ', [entry.id], function (tx, entryResults) {\n if (... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Registers one or more userdefined types into xtypejs. | function registerMultipleTypes(customTypes) {
if (typeof customTypes !== 'object') {
return;
}
objKeys(customTypes).forEach(function(customTypeName) {
registerSingleType(customTypeName, customTypes[customTypeName]);
});
} | [
"addTypes(types) {\n for (let name in types) {\n this.addType(name, types[name]);\n }\n }",
"function registerTypes(types, category) {\n\tvar prefix = category ? category + '.' : '';\n\t_.forOwn(types, function(value, key) {\n\t\tvar inh = value.inherit, i;\n\t\tif (inh) {\n\t\t\tfor (... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
shouldComponentUpdate is invoked when ReactChild render is invoked React will invoke this function pretty often, so the implementation has to be fast. | shouldComponentUpdate(){
if(this.props.debug)console.log("Child - shouldComponentUpdate");
return false; // this ensures parent render wont render this component
} | [
"shouldComponentUpdate (nextProps) {\n if (!nextProps.allowUpdateRender) {\n return false\n }\n\n // Prevent redundant renders\n return !equal(this.props, nextProps)\n }",
"shouldComponentUpdate(nextProps) {\n return shallowCompare(this, nextProps);\n }",
"shouldComponentUpdate() {\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Inicializa productos de cada html | function inicializarProd() {
//obtengo el html actual que navego para crear los productos correspondientes
let htmlActual =
document.documentURI.split("/")[document.documentURI.split("/").length - 1];
if (htmlActual == "smartphone.html") {
let productos = document.getElementById("productos");
createPr... | [
"function createProducts() {\n products = [\n new Product('Burrito', 'Safiger Burrito mit zarter Hähnchenbrust und mediterranem Gemüse', 6.00, 'burrito.jpg', 1),\n new Product('Taco', 'Knuspriger Taco mit verschiedenem Gemüse der Saison', 3.90, 'taco.jpg', 1),\n new Product('Quesadilla', 'Ge... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update music option text value | function updateMusicOption() {
var currText = 'Música';
var currValue = (scene.musicOn ? 'ON': 'OFF');
$('#optMusic').attr('value', currText + ' (' + currValue + ')');
} | [
"updateControlText_() {\n const soundOff = this.player_.muted() || this.player_.volume() === 0;\n const text = soundOff ? 'Unmute' : 'Mute';\n if (this.controlText() !== text) {\n this.controlText(text);\n }\n }",
"updateControlText_() {\n const soundOff = this.player_.muted() || this.player_... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a computer ID | function createComputerID () {
return "comp"+(+Date.now());
} | [
"function createID(){\n console.log(\"Creating ID for device...\");\n\n var deviceID = uuidV4();\n console.log(\"ID \" + deviceID + \" created.\");\n\n return deviceID;\n}",
"function createNewId() {\n onIdSubmit(uuidV4());\n }",
"function _createId() {\n return Date.now().toString(32);\n}",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The all important drawing function. Responsible for clearing out old tooltips, generating color interpolators (gray to red + values) (blue to gray for values). Actual lines are created by iterating over the features of the geojson slice specified by the brain view and the slider. paths are created for the visible and i... | drawCanvas() {
//TODO find better version of how to structure so that the margin can be programmatically set
this.ctx.clearRect(0, 0, this.can.width, this.can.height)
this.invisictx.clearRect(0, 0, this.can.width, this.can.height)
// remove previous tooltips
while (this.infoHolde... | [
"draw() {\n // Draw all the previous paths saved to the history array\n if(this.drawHistory) {\n this.drawPreviousEdges();\n }\n\n // Draw bounds\n if(this.showBounds && this.bounds != undefined && this.bounds instanceof Bounds) {\n this.drawBounds();\n }\n\n // Set shape fill \n i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Copies a folder by path to destination path Also works with different site collections. | copyByPath(destUrl, KeepBoth = false) {
return __awaiter(this, void 0, void 0, function* () {
const urlInfo = yield this.getParentInfos();
const uri = new URL(urlInfo.ParentWeb.Url);
yield spPost(Folder(uri.origin, "/_api/SP.MoveCopyUtil.CopyFolderByPath()"), body({
... | [
"function File_CopyFolder(sourceFolder, destinationFolder)\r\n{\r\n var exitResult;\r\n File_CheckFileExists(sourceFolder);\r\n\r\n exitResult = aqFileSystem.CopyFolder(sourceFolder, destinationFolder, false);\r\n if(!exitResult)\r\n CommonReporting.Log_StepError(\"[CommonFiles: File_CopyFolder] Folder <\" +... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
stackDraw(n): Removes the indicated card from the stack and returns it. | function stackDraw(n) {
var card;
if (n >= 0 && n < this.cards.length) {
card = this.cards[n];
this.cards.splice(n, 1);
}
else
card = null;
return card;
} | [
"function discardCard(card) {\n\t\tremoveDrawn(card);\n\t\tdiscard.push(card);\n\t}",
"function drawCard(deck){\n return deck.pop()\n}",
"function discardcard() {\n unbr.discard.unshift((unbr.hand[unbr.selected[0]]));\n unbr.hand.splice(unbr.selected[0], 1);\n $(\".card\").slice(unbr.normselect, unb... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Change the tl_sldr_nav position based upon the day() clicked Content (div class="tl_sldr_box") | function moveSliderBoxDay(index) {
// index needs to be zero-indexed
zeroIndex = index - 1;
//highlightIndex = index - 1;
//add and remove the day CSS class highlight
$('#tl_slider .tl_sldr_box ul li').removeClass('current-day');
//console.log($('.tl_sldr_box ul').find('li[' + highlightIndex + ']'));
... | [
"function _changeDayView(view, day) {\n if (day) {\n //dayview\n switch (view) {\n\n case \"edit_item\":\n $(\".page__background\").css(\"background-color\", \"ghostwhite\");\n $(\".settings-list\").css(\"background-color\", \"ghostwhite\");\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Converte todas as pericias. Primeiro calcula o total de pontos e depois varre as gEntradas de pericia, computando o valor de cada uma e o numero de pontos disponiveis. | function _ConvertePericias() {
for (var i = 0; i < gEntradas.pericias.length; ++i) {
var pericia_personagem = gPersonagem.pericias.lista[gEntradas.pericias[i].chave];
pericia_personagem.pontos = gEntradas.pericias[i].pontos;
pericia_personagem.complemento = 'complemento' in gEntradas.pericias[i] ? gEntrad... | [
"function porcentajes(numeroChicos, numeroChicas) {\n let total = numeroChicos + numeroChicas;\n let porcentajeChicos = (numeroChicos * 100) / total; \n let porcentajeChicas = (numeroChicas * 100) / total;\n console.log (`% de chicos = ${porcentajeChicos.toFixed(2)}`);\n console.log (`% de chicas = ${porcentaj... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
parse pageText for get content of html tag with id = id. | function gval(id, pageText){
var startText = pageText.slice(pageText.indexOf(id));
startText = startText.slice(startText.indexOf(">")+1,startText.indexOf("<"));
return startText.replace(/[^0-9]/g, '');
} | [
"function getInnerHTMLById(id, responseText){\n\tvar tagName = document.getElementById(id).nodeName.toLowerCase();\n var startTagName = \"<\" + tagName;\n\tvar finishTagName = \"</\" + tagName;\n\tvar startPos = responseText.indexOf('>', responseText.indexOf('id=\"' + id + '\"'));\n\tvar startPosTemp = start... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets and highlights a time part. | _getAndHighlightTimePart(matchIndex, regExpIndex, index) {
const that = this;
that._programmaticSelection = true;
if (that.$.input.selectionStart !== matchIndex || that.$.input.selectionEnd !== regExpIndex) {
that.$.input.setSelectionRange(matchIndex, regExpIndex);
}
... | [
"function getHighlightedWords() {\n // get current Time\n const date = new Date();\n var hour = date.getHours();\n var minute = date.getMinutes();\n \n // get fixed time if set in config/params\n if (widget_config.fixedTime != \"\"){\n console.log(\"actual time: \" + hour + \":\" + minute)\n hour = Num... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
reload data according to selected bird load birdDate according to filename | function loadData(file) {
d3.selectAll('.bird-position').remove();
d3.csv(`data/birds/${file}.csv`)
.then(bird => {
let timeSlider = initSlider(bird);
let currentDate = d3.timeFormat('%Y-%m-%d')(timeSlider.value());
drawBird(bird, currentDate);
const playButton = document.qu... | [
"function loadNewBirds() {\n $('.img-holder').css('background', \"\");\n $('.game-bird').css('opacity', '');\n\n birdFactory.getBirds()\n .then(function(birds){\n birds = birds.data;\n $scope.four = getSome(birds, 4);\n $scope.answer = Math.floor(Math.random() *4);\n $scope... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
uses pageblocker div in index.php, liteweight block page from user interaction during transitions to avoid clickhappiness | function pageBlockOn(){
$('#pageBlockerOuter').css({'display': 'block'});
} | [
"function blockPage() {\n console.log(\"Unwanted video! Blocking.\")\n document.documentElement.innerHTML = '';\n document.documentElement.innerHTML = 'This site is blocked';\n document.documentElement.scrollTop = 0;\n}",
"function adBlocker()\r\n{\r\n avtng.settings.adBlocker ^= 1;\r\n updateAVTNGS... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handles updated campus registration | async submitRegistrationChange(event) {
event.preventDefault();
const { changeRegistration } = this.props;
const { id } = this.state;
const newCampusId = parseInt(this.state.campusId);
const prevCampusId = this.state.preValues.campusId;
// If submitted on the default ".... | [
"update(codigo, nome, cidade) {\n try {\n\n let campus = this.get(codigo);\n if (!campus) return false;\n\n campus.nome = nome || campus.nome;\n campus.cidade = cidade || campus.cidade;\n\n db.push(`/campus/${codigo}`, campus, false);\n\n return true;\n\n } catch (error) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
words count in input keywordinput | function countWords(keyword){
return (keyword.replace(/(^\s*)|(\s*$)/gi,"").replace(/[ ]{2,}/gi," ").replace(/\n /,"\n").split(' ').length);
} | [
"function countWords(){\n\tlet textLength = text.value.length;\n\t// create a substring that checks if each new key typed is a space\t\n\tif(text.value.substring((textLength-1), textLength) == \" \")\n\t\tnumWords++;\n}",
"function wordCounter(text) {\n var text = input.value.split(' ');\n var wordCount = 0... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Log requests to console | function logConsole() {
return function (req, res, next) {
console.log('Received request: ' + req.method + ' ' + req.originalUrl);
next();
};
} | [
"function logAllRequests(req, res, next) {\n console.log('\\n' + JSON.stringify({\n path : req.path,\n remoteAddress : req.connection.remoteAddress,\n headers : req.headers,\n body : req.body\n }));\n next();\n}",
"logRequests() {\n this.app.use('/', (req, res, next) => {\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets integration to install | function getIntegrationsToSetup(options) {
var defaultIntegrations = (options.defaultIntegrations && Object(tslib_es6["e" /* __spread */])(options.defaultIntegrations)) || [];
var userIntegrations = options.integrations;
var integrations = [];
if (Array.isArray(userIntegrations)) {
var userInteg... | [
"function getIntegrationsToSetup(options){var defaultIntegrations=options.defaultIntegrations&&Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__spread\"])(options.defaultIntegrations)||[];var userIntegrations=options.integrations;var integrations=[];if(Array.isArray(userIntegrations)){var userIntegrationsNames_1=userI... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Loads a list of datasets, creates Leaflet layers of either L.Knreise.GeoJSON or L.Knreise.MarkerClusterGroup according to config. Can be supplied an initial bbox for filtering and a filter function | function loadDatasets(datasets, bounds, filter, loadedCallback, skipLoadOutside) {
datasets = _.filter(datasets, function (dataset) {
return !dataset.noLoad;
});
var loaded;
if (loadedCallback) {
var featurecollections = [];
var finished = _.after(d... | [
"function LoadData (mapCluster) \r\n{\r\n L.mapbox.featureLayer().loadURL('../example/geojson/stations.geojson').on('ready', function(e) \r\n {\r\n var clusterGroup = new L.MarkerClusterGroup();\r\n e.target.eachLayer(function(layer) \r\n {\r\n clusterGroup.addLayer(layer);\r\n });\r\n mapClus... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
(ie. anything between 0.0.0.0 and 255.255.255.255 is valid). split the string by . length should b 4. Check that each number is a valid number | function validIP(str) {
numbers = str.split(".");
if (numbers.length !== 4) return false;
for (let i = 0; i < numbers.length; i++) {
let number = parseInt(numbers[i]);
if (number < 0 || number > 255) {
return false;
}
}
return true
} | [
"function isValidIP(str) {\n if(str.split('.').length != 4) return false\n var arr = str.replace(/[^0-9]/g, '.').split('.')\n if(arr.length != 4) return false\n for(var i = 0; i < 4; i++){\n if(arr[i] < 0 || arr[i] > 255 || arr[i] == '') return false\n if(arr[i].length > 1 && arr[i][0] == ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
We need a way to get X | getX() {
return this.x;
} | [
"function getX() {\r\n\r\n return x;\r\n\r\n }",
"function getX() {\n return this.x;\n }",
"function getX() {\n\n\t\treturn this.x;\n\t}",
"get x()\n\t{\n\t\tif (this._x != null)\n\t\t\treturn this._x;\n\n\t\t/*\n\t\tif (this.isInput)\n\t\t\treturn this.node.posSmooth.x;\n\n\t\treturn this.no... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
TAB BUTTON ACTION FUNCTIONS copy tabcontent body contents | function copyContents(object) {
// get tab contents
let modalTabContent = object.closest('.modal-tab-content').querySelector('.modal-tab-content-body');
// obtain inner html from element
let content = modalTabContent.innerHTML;
// copy to clipboard
navigator.clipboard.writeText(content);
} | [
"function copyTabs() {\n getCurrentWindowTabs().then((tabs) => {\n let tabList = \"\";\n\n browser.storage.sync.get(\"outputFormat\").then((res) => {\n const outputFormat = res.outputFormat;\n\n for (var tab of tabs) {\n tabList += convertTabToListItem(tab, outputFormat);\n }\n bro... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Derivation of a common shared secret for importing / exporting encrypted credentials depending on input.selectImport | async function getSharedSecret(selectElement) {
const transfer = await sendMessage({ action: 'get-transfer-settings' });
const idx = selectElement.value;
return idx < 0
? getMySecretBlocks(master, false, 'SHARED_SECRET') // long secret derived from master key
: getMySecretBlocks(master, true, tr... | [
"function importSecretKey() { \n let rawPassword = str2ab(password.value); // convert the password entered in the input to an array buffer\n return window.crypto.subtle.importKey(\n \"raw\", //raw\n rawPassword, // array buffer password\n {\n length: DEC.algoLength,\n name: DEC.algoName1\n }... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
executes script /srv/jboss/tools/jbossslotmanager.sh on machineName with passedInArgument as parameter e.g executeSlotManagerScriptServer("vtjbs03.retraite.lan", "getallfreeslots") | function executeSlotManagerScriptServer(machineName, passedInArgument) {
var os = getMachine(machineName);
// e.g. /srv/jboss/tools/jboss-slot-manager.sh
var jbossSlotManagerScript = getJbossSlotManagerScript();
var criteria = new ResourceCriteria();
criteria.addFilterResourceKey(jbossSlotManagerS... | [
"function createSlotManagerScriptServer(machineName) {\n\n var os = getMachine(machineName);\n\n // e.g. /srv/jboss/tools/jboss-slot-manager.sh\n var jbossSlotManagerScript = getJbossSlotManagerScript();\n\n var jbossSlotManagerScriptDirectory = jbossSlotManagerScript.substring(0, jbossSlotManagerScript.lastInd... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Uses the twitch API to see if a given twitch streamer is online. Modifies the "Online" database. INPUT: A document containing information from the "Players" database. OUTPUT: Maintains the "Online" database with twitch streamers that are online playing League. | function processTwitchRequest(data) {
var twitchRequest = https.get(twitchAPI + data.twitchUsername, function(res) {
var twitchData = '';
/* Append the twitch stream data */
res.on('error', function(err) {
handleResponseError(err);
});
res.on('data', function(twitchInfo) {
... | [
"function checkIfOnline(callback) {\n var interval = setInterval(function() {\n client.api({\n url: 'https://api.twitch.tv/kraken/streams/' + auth.username.toLowerCase(),\n method: 'GET',\n headers: {\n 'Accept': 'application/vnd.twit... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates the shelfinfo inside a book. If the shelf value is none, then the book is removed from the app component's state | updateShelf(book, shelf) {
if(shelf.value === 'none') {
const bookIndex = this.state.books.findIndex(bk => bk.id === book.id);
this.state.books.splice(bookIndex, 1);
} else {
book.shelf = shelf;
}
this.setState(this.state);
} | [
"updateShelf(e, book) {\n if (e === 'currentlyReading') {\n book.shelf = \"currentlyReading\";\n this.currentListAddItem(book.id, book);\n } else if (e === 'wantToRead') {\n book.shelf = 'wantToRead';\n this.wantToListAddItem(book.id, book);\n } else if (e === 'read') {\n book.shel... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
toggle delete button from 'delete' to 'revert' for content marked as to be deleted and remove/show other buttons in item | function toggleDeleteRevertButton($container) {
$container.find('.btn-browse-delete-revert, .js-browse__buttons--primary, .js-browse__buttons--secondary').toggle();
} | [
"function toggleDeleteRevertChildren($item) {\n var $childContainer = $item.find('.js-browse__item .page__container'),\n isDeleting = $item.children('.page__container').hasClass('deleted');\n\n if (isDeleting) {\n $childContainer.addClass('deleted');\n } else {\n $childContainer.remove... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds internal labels on the nodes, after an update. | function updateInternalLabels(active) {
graph.element.selectAll('.internal-label').remove()
if (active) {
graph.element
.selectAll('.node--internal')
.append('text')
.attr('class', ' internal-label')
.attr('dy', 20)
... | [
"function updateLabels() {\n\tlabels = []\n\tfor (var i in nodes) {\n\t\tif ('label' in nodes[i]) {\n\t\t\tlabels.push({'id':nodes[i]['id'], 'label':nodes[i]['label']})\n\t\t}\n\t}\n}",
"function addInternalLabels() {\n graph.style.parentLabels = !graph.style.parentLabels\n updateInternalLabels(grap... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Remove a span from an array, returning undefined if no spans are left (we don't store arrays for lines without spans). | function removeMarkedSpan(spans, span) {
for (var r, i = 0; i < spans.length; ++i)
if (spans[i] != span) (r || (r = [])).push(spans[i]);
return r;
} | [
"function removeMarkedSpan(spans, span) { // 5537\n for (var r, i = 0; i < spans.length; ++i) // 5538\n if (spans[i] != span) (r || (r = [])).push(spans[i]); ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A callback function for ``nextMolecule`` and ``getMolecule``. When the server sends back the structure of the next molecule to be rendered, this function is run. It updates ``currentMolecule`` and renders the new molecule. | function updateState() {
[molInchi, molStructure] = JSON.parse(this.responseText);
viewer.loadMoleculeStr(undefined, molStructure);
// Allow new requests to be sent.
buttonsOn = true;
} | [
"function update() {\n makeMolecules();\n}",
"function nextMolecule(username)\n{\n buttonsOn = false;\n\n let nextMolRequest = new XMLHttpRequest();\n nextMolRequest.addEventListener(\"load\", requestListener('nextMolecule'));\n nextMolRequest.addEventListener(\"load\", updateState);\n nextMolRe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Show the images for the dot of index dotNumber | function showContentDot(dotNumber){
var dots = document.getElementsByClassName("h5p-image-gallery-dot");
// start rowindex of images showing
var start = dotNumber*maximumNumberofRows;
// end rowindex of images showing
var end = start+maximumNumberofRows;
// if dots exists - show only content of dot with... | [
"#displayClickableDots() {\n\n const dotControls = this.#controls.querySelector(\".dot-controls\");\n\n // remove any existing dots. needed if pictures gets changed later.\n while(dotControls.firstChild){\n dotControls.removeChild(dotControls.firstChild);\n }\n\n this.#pictures.forEach((pic, ind... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Helper function for movePlayer to animate player sprite while walking. | function walkingAnimation(direction) {
var spriteX = "";
var spriteY1 = "50%";
var spriteY2 = "100%";
direction = (direction) ? direction : playerDirection;
switch (direction) {
case "up":
spriteX = "33.333%";
break;
case "down":
spriteX = "0%";
... | [
"animateMove(){\n\t\tthis._state = \"walking\"\n\t\tthis.currentMoveFkt();\n\t\tthis._animationTimer--;\n\t}",
"animateWallJump()\n {\n if(this.player.stateManager.wallJump.direction == WallDirection.LEFT)\n {\n this.direction = 'left';\n }\n else\n {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Forward instructions to individual components. The manager calls this method to make the panel focus or show a property field or a tab, possibly suggesting a position. The distance that the form in the panel was scrolled since a position was last transmitted can be used to replicate that movement immediately while conv... | function fireShow(content/*:Content*/, tabTitle/*:String*/, property/*:String*/, isFocus/*:Boolean*/, setCurrentProperty/*:Boolean*/, sendState/*:Boolean*/, position/*:Number*/, distance/*:Number*/, scrollOnly/*:Boolean*/)/*:void*/ {
this.externallyControlled$hWxS = true;
this.currentContent$hWxS = content;
... | [
"focus() {\n super.focus();\n // If (this._mathfield) {\n // // Don't call this._mathfield.focus(): it checks the focus state,\n // // but super.focus() just changed it...\n // this._mathfield.keyboardDelegate.focus();\n // this._mathfield.model.announce('li... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
walks a hash and hides all nonmatching languages | function ls_hideAllExcept(lang_element_hash, language) {
for (var n in lang_element_hash) {
if (n == language) {
lang_element_hash[n].style.display = '';
} else {
lang_element_hash[n].style.display = 'none';
}
}
} | [
"function actionDropUnused() {\n const enKeys = [];\n\n const gatherKeys = (value, parentKey = '') => {\n if (typeof value !== 'object' || Array.isArray(value)) {\n return;\n }\n const keys = Object.keys(value);\n keys.forEach(k => {\n const path = `${parentKey ? `${parentKey}.` : ''}${k}`;\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns true if the given object is an instance of Authorizer. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process. | static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Authorizer.__pulumiType;
} | [
"static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === AggregateAuthorization.__pulumiType;\n }",
"static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
he shows Ronny which cup he hides the ball under (b), he then mixes all the cups around by performing multiple twocup switches (arr). Ronny can record the switches but can't work out where the ball is. Write a programme to help him do this. Rules: There will only ever be three cups. Only two cups will be swapped at a t... | function cupAndBalls(b, arr){
let cupWithBall = b;
for (let i = 0; i < arr.length; i++){
if (arr[i][0] === cupWithBall){
cupWithBall = arr[i][1];
}else if (arr[i][1] === cupWithBall){
cupWithBall = arr[i][0];
}
}
return cupWithBall;
} | [
"function cupSwapping(arr) {\r\n let ballPosition = 'B';\r\n for (swap of arr) {\r\n if (swap.includes(ballPosition)) {\r\n ballPosition = swap.replace(ballPosition, '');\r\n }\r\n }\r\n return ballPosition;\r\n}",
"function getSiteswapFromTossArray(tossArr,showHand) {\r\n\r\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get EdmType of all properties from $metadata | function getEdmTypeOfAll(entityTypeObject) {
return getAllColumnProperties("type", entityTypeObject);
} | [
"function getEntityTypeProperties(oSmartControl) {\n\t\t\t\tvar oEntityType = getMetaModelEntityType(oSmartControl);\n\t\t\t\treturn oEntityType.property;\n\t\t\t}",
"function resolveEntityTypes(entity) {\n for (var propertyName in entity) {\n if (propertyName === \"PartitionKey\" || propertyName === \"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Foward calls to define_method on the top object to Object | function top_define_method() {
var args = $slice(arguments);
var block = top_define_method.$$p;
top_define_method.$$p = null;
return Opal.send(_Object, 'define_method', args, block)
} | [
"function bridgeMethods(fromObject, toObject) {\n fromObject.cancel = toObject.cancel.bind(toObject);\n fromObject.getRequest = toObject.getRequest.bind(toObject);\n fromObject.getResponse = toObject.getResponse.bind(toObject);\n fromObject.getError = toObject.getError.bind(toObject);\n}",
"_override(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Bloomberg has requested that the Butler dashboard only be available to their Enterprise admins. This function will return whether a user can access the Butler directory on a board | canShowButlerUI() {
if (this.hasEnterprise()) {
if (
featureFlagClient
.get('workflowers.butler-ent-admin-only-allowlist', [])
.includes(this.get('idEnterprise'))
) {
return (
this.getEnterprise().isAdmin(Auth.me()) ||
(this.get('idOrganization') &... | [
"function isAdmin()\n{\n if (!isLoggedIn())\n {\n return false;\n }\n\n return unstoreObject('user').userRole === 'ADMINISTRATOR';\n}",
"function isAdmin() {\n return (window.location.href.indexOf(\"admin\") !== -1);\n }",
"function isAdmin() {\n try {\n return ADMIN_USERS.indexOf(Meteo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Watcher listeners New file created. | function onNewFile(file) {
console.log("onNewFile() - watch_old: " + this.watchDir +
" process_old: " + this.processedDir);
var watchFile = this.watchDir + '/' + file;
var processedFile = this.processedDir + '/' + file.toLowerCase();
console.log("onNewFile() - watch_new: " + watchFile +
... | [
"function addWatcher (newPath) {\n fileWatcher = chokidar.watch(newPath, {\n persistent: true,\n ignored: /(^|[/\\\\])\\../ //For .DS_Store on MacOS\n });\n // console.log(newPath)\n //Signals to setMovieFolder that a watcher exists\n isWatching = true;\n fileWatcher.on('ready', async () => {\n // Re... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
RANDOM 2D SQUARE ARRAY/MATRIX | function randomSquareMatrix(n) {
let A = new Array(n);
for (let i = 0 ; i < n; i++) {
A[i] = new Array(n);
for (let j = 0; j < n; j++) {
A[i][j] = Math.floor(rng()*10);
}
}
return A;
} | [
"randomize() {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.cols; j++) {\n this.data[i][j] = Math.random() * 2 - 1;\n }\n }\n }",
"static getRandomBool2DArray(x, y)\n {\n let res = new My2DArray(x,y);\n for(let i = 0; i <... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determines the label for the Input insinde the PromptWindow. Property type: string | get promptLabel() {
return this.nativeElement ? this.nativeElement.promptLabel : undefined;
} | [
"set _label(value){Helper$2.UpdateInputAttribute(this,\"label\",value)}",
"function _labelFromInput() {\n return {\n \"category\": htElement.welInputLabel.data('category'),\n \"name\": htElement.welInputLabel.val()\n };\n }",
"set _label(value) {\n H... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
fetch content after click navbar | function fetchContentAfterClickNav(){
navUlList.forEach(navList => {
navList.addEventListener('click', event => {
const navHref = navList.getAttribute('data-a-href');
if(navHref === null) {
return;
}
fetchPageContent(navHref);
addAc... | [
"function getMainNavigationContent() {\n mainNavSrv.getNavigationContents().then(function (result) {\n \n });\n }",
"function navbarListener() {\n const home = document.querySelector('[action=\"/\"]');\n const sportNews = document.querySelector('[actio... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates arr of requestBodies for given section | function requestBodiesSection(section) {
let sectionRequests = [];
// Copy request body object so we can pass new reference
// Aka not change the old object accident
let copyDR = defaultRequest;
let copyDCG = defaultChannelGrouping;
let copyTop10 = top10Articles;
let copySocial = socialNetw... | [
"function jsonSections(sections, block) {\r\n\r\n return sections.map(function(section) {\r\n // Temporary inserting of partial\r\n var partial = section;\r\n if (partial.markup() && partial.markup().toString().match(/^[^\\n]+\\.(html|hbs)$/)) {\r\n partial.file = partial.markup().toString();\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fun??o para validar a pesquisa por faixa de Quadra pesquisa v?lida se os Setores Comeciais forem iguais e o n?mero inicial for menor ou igual ao final | function validaPesquisaFaixaQuadra(){
var form = document.ImovelOutrosCriteriosActionForm;
retorno = true;
if(form.quadraOrigemID.value != form.quadraDestinoID.value){
if(form.setorComercialOrigemCD.value != setorComercialDestinoCD.value){
retorno = false;
alert("Para realizar a pesquisa por faix... | [
"function validaPesquisaFaixaSetor(){\r\n\r\n\tvar form = document.ImovelOutrosCriteriosActionForm;\r\n\t\r\n\tretorno = true;\r\n\t\r\n\tif(form.setorComercialOrigemCD.value != form.setorComercialDestinoCD.value){\r\n\t\tif(form.localidadeOrigemID.value != form.localidadeDestinoID.value){\r\n\t\t\r\n\t\t\talert(\"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
sends the chat message to the server | function sendMessage() {
let message = data.value;
data.value = "";
// tell server to execute 'sendchat' and send along one parameter
socket.emit("sendchat", message);
} | [
"function sendMessage() {\n \t\tvar message = data.value;\n\t\tdata.value = \"\";\n\t\t// tell server to execute 'sendchat' and send along one parameter\n\t\tsocket.emit('sendchat', message);\n\t}",
"function sendMessage() {\n let message = data.value;\n data.value = \"\";\n // tell server to execute 'sendcha... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
GET /team route to retrieve all the teams. | function getTeams(req, res) {
//Query the DB and if no errors, send all the books
const query = Team.find({});
query.exec((err, teams) => {
if (err) res.send(err);
//If no errors, send them back to the client
res.json(teams);
});
} | [
"function teams() {\n\t return $http.get(\n\t\t HygieiaConfig.local ? testTeamsRoute : (buildTeamsRoute))\n\t\t .then(function(response) {\n\t\t\treturn response.data;\n\t\t });\n\t}",
"getAllTeams() {\n return new Promise((resolve, reject) => {\n const options = {\n m... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |