query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Set the pattern that the collection's filter applies when using the `filteredEntities` selector. | setFilter(pattern) {
this.createAndDispatch(EntityOp.SET_FILTER, pattern);
} | [
"setFilter(pattern) {\n this.dispatcher.setFilter(pattern);\n }",
"function setFilters(){}",
"function setFilters() {} // 2166",
"function setFilters() {} ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Inserts the secondary units, which can appear below the fold. | function insertSecondaryUnits() {
var pxBetweenUnits = Config.get( 'insertion.pxBetweenUnits' );
$.each( inventory, function ( index, unit ) {
var tallest = Inventory.tallestAvailable( unit ),
force = ( 0 === index ),
location = findInsertionLocation( {... | [
"function addTwoBegin() {\n positionList[0][0] = 2;\n updateHtmlCss();\n }",
"afterMeasure() {\n e.insertBefore(oldElement, newElement);\n afterInsert();\n }",
"function addToSidebar(elements) {\n let w = window.innerWidth\n let insertAt = \".gt2... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
the animation loop calculates time elapsed since the last loop and only draws if the specified fps interval is achieved | function Animate() {
//stop animating if requested
if (stop_animating) return;
// request another frame
requestAnimationFrame(Animate);
// calc elapsed time since last loop
time.now = performance.now();
time.elapsed = time.now - time.then;
// if enough time has elapsed and all ob... | [
"function update() {\n\n // request another frame\n requestAnimationFrame(update);\n\n // calc elapsed time since last loop\n now = Date.now();\n elapsed = now - then;\n\n // if enough time has elapsed, draw the next frame\n if (elapsed > fpsInterval) {\n // Get ready for next frame by s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
comment for getParamsRandom: p: Math.floor(generateRandomNumber()1000) doing the magic here in generating the random image. basically, p is the page number and ps (as you can see in getParamsSubmit() below) is the number of results on the page. By default, p is 10. according to the api documentation pps needs to be les... | function getParamsRandom() {
const params = {
p: Math.floor((generateRandomNumber()*1000)+1),
key: apiKey,
format: 'json',
s: 'relevance',
toppieces: 'true'
}
console.log(params);
getObjectsRandom(params);
} | [
"function getRandomImageItems() {\n\tvar imgSize = Math.random() < 0.5 ? \"medium\" : \"large\";\n\tvar page = getRandom(1, 50);\n\tvar params = {\n\t\tpage: page,\n\t\tsize: imgSize,\n\t\tsafe: \"medium\"\n\t};\n\n\treturn images.search(\"john cena\", params);\n}",
"async function findRandomScrape() {\r\n // ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add a new userdefined attack. | function addAttack(xmlAddDoc) {
var addContent = new stringBuffer();
var aXml = xmlAddDoc.getElementsByTagName('attack');
var aXmlLen = aXml.length;
var aSelectLen = document.getElementById('xssType').length;
for (var a=0;a<aSelectLen;a++) {
if (document.getElementById('xssType')[a].value == document.getEleme... | [
"function attackerAdd() {\n\n\t//remove 400 gold\n\tif (gold - 400 >= 0) {\n\t\tgold -= 400;\n\n\t\t//increase number of attackers by 1\n\t\tbuy.attack++;\n\n\t\t//update number of attackers in stats\n\n\n\t\t//update shoppe\n\t}\n\tupdateButtons();\n}",
"function playerAttack() {\n\tif (!human.acceptingInput) re... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
1. Make a request to the Numbers API ( to get a fact about your favorite number. (Make sure you get back JSON by including the json query key, specific to this API. Details. | async function numFact() {
let response = await axios.get(`${baseURL}/${favNum}?json`);
console.log(response.data.text);
} | [
"function getNumberFact(cb) {\n\tvar random = Math.floor(Math.random() * numbersUrls.length);\n\n\treturn request('http://numbersapi.com/' + numbersUrls[random], function (err, rsp, body) {\n\t if (!err && rsp.statusCode == 200) {\n\t\t\treturn cb(body);\n\t } else {\n\t\t\treturn cb('Numbers API appears to be un... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns an integer indicating if the service is running or not. The integer represents the internal counter of how many startService calls were done without calling stopService | static async isRunning() {
return await ForegroundServiceModule.isRunning();
} | [
"isRunning() {\n if (this.module != null) {\n return this.module.state === STATE_RUNNING\n } else {\n return false;\n }\n }",
"isRunning() {\n\t\treturn this.running;\n\t}",
"isRunning() {\n return this.is_running;\n }",
"function isSomRunning() {\n r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
11. Make functions called "checkOut" and "checkIn" which accept the ISBN as their only argument. They should increase or decrease the number of checked out copies in the INVENTORY numbers object for the specified book ISBN. You can also, optionally, add a second argument of the number of copies to check out or in at on... | function clickCheckOut() {
$("#checkOut").click(function (event) {
event.preventDefault();
$("input:checkbox:checked").each(function () {
checkOut($(this).val());
renderBooks();
});
});
} | [
"function addCheckOutListeners () {\n for (i=0; i< checkInButtons.length; i++) {\n checkInButtons[i].addEventListener('click', (e) => {\n checkOutBook(e);\n updateDisplay();\n return false;\n })\n }\n}",
"function addCheckInListeners () {\n for (i=0; i< chec... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Transform hours, minutes and seconds to milliseconds and return full milliseconds time | function fullTimeToMilliseconds(hours, minutes, seconds, milliseconds){
hoursInMilli = hours * 3600000;
minutesInMilli = minutes * 60000;
secondsInMilli = seconds * 1000;
return hoursInMilli + minutesInMilli + secondsInMilli + milliseconds;
} | [
"function convertMilliseconds(time_in_milliseconds){\n var time_in_seconds = time_in_milliseconds / 1000;\n var seconds = Math.floor(time_in_seconds % 60);\n var minutes = Math.floor((time_in_seconds / 60) % 60);\n var hours = Math.floor(time_in_seconds / (60 * 60));\n\n return hours + ' hours ' + mi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
private function: make the ai player take a medium move, that is: mix between choosing the optimal and suboptimal minimax decisions | function takeAMediumMove(turn) {
var available = game.currentState.emptyCells();
//enumerate and calculate the score for each available actions to the ai player
var availableActions = available.map(function(pos) {
var action = new AIAction(pos); //create the action object
... | [
"takeANoviceMove() {\n let available = this.game.currentState.emptyCells()\n\n //enumerate and calculate the score for each available actions to the ai player\n let availableActions = available.map(pos => {\n let action = new AIAction(pos) //create the action object\n\n //get next state by applyi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a function truncate (str, maxlength), which checks the length of the string str, and if it exceeds maxlength replaces the end of str with "...", so that its length becomes maxlength. For example: truncate("Hello World!!!",8) == "Hello..." | function truncate(str, maxlength) {
if (str.length >= maxlength) {
str = str.slice(0, maxlength - 3);
return `${str}...`;
}
} | [
"function truncate (str, maxLength, ellipsis) {\n}",
"function truncate(str,maxlength) {\n\tvar a = str;\n\tif (a.length>maxlength) {\n\t\ta = a.slice(0,maxlength-1)+'\\…';\n\t};\n\treturn a;\n}",
"static truncateString(string, maxLength) {\n if (string.length > maxLength) {\n return string.slice(0, max... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates and displays a list of buttons representing contacts in the inventory. | function displayContactNames(contacts) {
$("#list")[0].innerHTML = "";
var button;
for (var i = contacts.length - 1; i >= 0; i--) {
button = document.createElement("button");
button.append(contacts[i].Name);
button.setAttribute("id", contacts[i].Id);
button.setAttribute("type... | [
"function listContacts() {\n index = null;\n let result = '';\n addressBook.forEach((contact) => {\n const row = `<tr>\n <td><button>${contact.name}</button></td>\n <td><button>X</button></td>\n </tr>`;\n result += row;\n });\n table.innerHTML = result;\n const closeButtons = table.queryS... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
various functions used in the domain query tab loads the list of IDs, chosen from the "alphabet" at the top of the form | function chooseIds( sLetter ) {
Element.show( "nlUpdateSpinner" );
$( "domainSearchForm" ).disable();
new Ajax.Updater( "idSelectionWrapper",
queryURI,
{
method: 'get',
parameters: "list=1&browse=" + sLetter,
... | [
"function buildIdLists() {\n\n $A( $(\"have\").options ).each( function( opt ) {\n var i = document.createElement( \"input\" );\n i.type = \"hidden\";\n i.name = \"have\";\n i.value... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Metodo drwaMaps, imprime mapas de google maps en la seccion de sucursales, itera por todos los divs de clase sucursales, obtiene su latitud y longitud para dibujar el mapa. | function drawMaps(){
$('.sucursal.card').each(function(index){
var latitud = $(this).find('input[name="latitud"]').val();
var longitud = $(this).find('input[name="longitud"]').val();
var divMap = '#sucursal-map' + (index+1);
console.log(divMap);
mapa = new GMaps({
div: divMap,
lat: latitud,
lng: lo... | [
"function calculaRecuadro (mapa) {\r\n var bounds = mapa.getBounds();\r\n var coordenadas = new Array ();\r\n //minlat\r\n coordenadas [0] = Math.round(bounds.getSouthWest().lat()*10000) / 10000;\r\n //maxlat\r\n coordenadas [1] = Math.round(bounds.getNorthEast().lat()*10000) / 10000;\r\n //min... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Convert .csv file into an array | function csvToArray(filepath){
const csv = filepath;
// Split rows
let rows = csv.split("\n");
return rows.map(function(row){
// Split columns
return row.split(",");
});
} | [
"function csvToArray(csv) {\n var rows = csv.split(\"\\n\");\n return rows.map(function (row) {\n return row.split(\",\");\n });\n}",
"function csvToArr(csv) {\n\treturn $.csv.toArrays(csv);\n}",
"function parseCsv(CSV_FILE) {\n var questionArr = [];\n fs.createReadStream(CSV_FILE)\n .pipe(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
combine 2d arrays of different sizes | function combine2DArrays_(arrays)
{
// check 2D-arryas are not empty
if (arrays.length === 1 && arrays[0].length === 0) { return arrays[0]; }
// detect max L
var l = 0;
var row = [];
var result = [];
var elt = '';
arrays.forEach(function(arr) { l = Math.max(l, arr[0].length); } );
arrays.forEach... | [
"function combineArr(arr1, arr2) {\n\n}",
"function makeCombinedMatrix(arr1, arr2) {\n let result = [];\n let row;\n\n for (let i = 0; i < arr1.length; i++) {\n row = [];\n for (let j = 0; j < arr2.length; j++) {\n row.push(arr1[i] + arr2[j]);\n }\n result.push(row);\n }\n return result;\n}"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
removes anything between the the character a and b in incstr, basicaly ab | function stripStringRegEx(incstr, a, b) {
var str = incstr;
done = false;
while (done == false) {
if (str.length == 0) {
done = true;
}
var ai = str.indexOf(a);
if (ai == -1) {
done = true
}
else {
var bi = ai + 1;
... | [
"function stripStringRegEx(incstr, a, b) {\n var ea = a.replace(RegExpEscapeSpecial,\"\\\\$1\"),\n eb = b.replace(RegExpEscapeSpecial,\"\\\\$1\"),\n r = new RegExp( ea+'.*?'+eb , 'g');\n return incstr.replace(r,'');\n}",
"function removeFromString(str) {\n var length = str.length,\n resu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Open applications page click handler | function onOpenAppsPageClick(e) {
var url = 'chrome://apps/';
var event = window.event || e;//Firefox
if(event.ctrlKey || e.which == 2)//if(window.event.ctrlKey || e.which == 2)
openUrlInNewTab(url);
else
openUrlInCurrentTab(url);
} | [
"function clicked() {\n // Launch the app.\n tablet.gotoWebScreen(APP_URL);\n }",
"function openApp(){\n $('.open-app').click(function(){\n app_info.forEach(function(app){\n if($('.open-app').attr('name') == app.name){\n window.open(app.short_url , \"_blank\");\n }\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function fills the drop down selectors for the change order interface | function fillDropdowns_CHANGE_ORDER(json) {
console.log(json);
var changeorderStatus = JSON.parse(json['changeorderstatus']);
changeorderStatus = sortChangeOrderStatus(changeorderStatus);
var d = document.createDocumentFragment();
$('#changeOrder').find('#status').empty();
$('#changeOrder').find('#customerC... | [
"function updateOrderSelectors() {\n\tvar row_count = $('table.graphics tbody tr').length;\n\t$('table.graphics select').each(function () {\n\t\tvar select = $(this);\n\t\tvar selected = select.val();\n\t\tselect.empty();\n\t\tfor (var n = 1; n <= row_count; n++) {\n\t\t\tvar option = $('<option value=\"\"></option... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
========================================================= Remove formula ========================================================= parent > children > remove formula clear | function removeFormula(cellObject, myName) {
//formula -> parent -> children remove yourself
let formula = cellObject.formula; // ( A1 + A2 )
let formulaTokens = formula.split(" "); // split on the base of spacing (" ") -> [(,A1,+,A2,)]
for (let i = 0; i < formulaTokens.length; i++) {
let a... | [
"function deleteFormula(cellObject){\n cellObject.formula=\"\";\n for(let i=0 ; i<cellObject.parents.length ; i++){\n let parentName = cellObject.parents[i];\n let {rowId , colId} = getRowIdColId(parentName);\n let parentCellObject = db[rowId][colId];\n let filteredChildrens = pare... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update the text between two positions. | update(text, start, end) {
this.lineOffsets = undefined;
const content = this.getText();
this.setText(content.slice(0, start) + text + content.slice(end));
} | [
"update(text, start, end) {\n const content = this.getText();\n this.setText(content.slice(0, start) + text + content.slice(end));\n }",
"function updatePositionText(x, y) {\n\tdocument.getElementById(\"positionText\").innerHTML = \"\" + x + \", \" + y;\n}",
"function updateText() {\n\n\t// Con... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this function will take 3 arguments month, day and year You should use the Date object to set the value of today. if the birth date is less than one year from the current date it should return : "you are NUMBER_DAYS old" if its more than one year it should return you are NUMBER_YEARS old" Info on Date object: | function tellAge(month,day,year) {
var myDay = new Date();
var yearNow = myDay.getFullYear();
var calYears = yearNow - year;
var endDay = new Date(year,month,day);
var millisecondsPerDay = 1000 * 60 * 60 * 24;
var millisBetween = myDay.getTime() - endDay.getTime();
... | [
"function tellAge (month, day, year){\n var currentDate = new Date();\n var yearsOld = (currentDate.getFullYear() - year);\n var daysOld = month*30 + day;\n if (yearsOld < 1){\n return \"you are \" + daysOld + \" days old\"; \n }else{\n return \"you are \" + yearsOld +\" years old\";\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function for retrieving the DB credentials from secret manager | secretCredentials(secretName) {
return new Promise((resolve, reject) => {
SecretsManager.getSecretValue({ SecretId: secretName }, function (err, data) {
if (err) {
reject(err);
}
else {
resolve(JSON.parse(data.SecretString));
}
});
});
} | [
"function getCredConfig() {\n // [START cloudrun_user_auth_secrets]\n // [START run_user_auth_secrets]\n // CLOUD_SQL_CREDENTIALS_SECRET is the resource ID of the secret, passed in by environment variable.\n // Format: projects/PROJECT_ID/secrets/SECRET_ID/versions/VERSION\n const {CLOUD_SQL_CREDENTIALS_SECRET... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Since tabindex is being set on different elements for accessibility they show a outline when clicked but it really is only needed for those using a keyboard to navigate the page. This hides that outline unless TAB is actually being used, then it enables the outline. | function disableFocusOutlines() {
"use strict";
try {
var tabElements = document.querySelectorAll("*[tabIndex='0'], button, label, select, a"),
i;
for (i = 0; i < tabElements.length; i += 1) {
tabElements[i].style.outline = "none";
}
... | [
"function focusAccessibility() {\n // last event's focusedViaClick\n focusAccessibility.lastFocusedViaClick = false;\n // tags of focusable elements;\n // to avoid a full layout recalc we modify the closest one\n focusAccessibility.ELEMENTS = [\n 'a',\n 'button',\n 'input',\n 'textarea',\n 'labe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns true if a transformer matches given filename. | canTransform(filename) {
const entry = this.findTransformer(filename);
return !!entry;
} | [
"canValidate(filename) {\n /* .html is always supported */\n const extension = path__default[\"default\"].extname(filename).toLowerCase();\n if (extension === \".html\") {\n return true;\n }\n /* test if there is a matching transformer */\n const config = this.ge... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
convert ascii to hex | function ascii_to_hex() {
var outResult = '';
var inValue = input.value;
for (var i = 0; i < inValue.length; i++) {
outResult += inValue.charCodeAt(i).toString(16).toUpperCase();
}
output.value = outResult;
} | [
"function ascii_to_hex(str)\n{\n tempstr = '';\n\t\n for (a = 0; a < str.length; a = a + 1) \n\t{\n tempstr = tempstr + (\"00\" + str[a].toString(16)).substr(-2) + ' ';\n\t\t//(\"00\" + len.toString(16)).substr(-4)\n }\n\t\n return tempstr;\n}",
"function hex_ascii(hex_string){\n\treturn split_... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Uploads specified file to firebase storage and executes custom 'onSuccess' callback | function uploadFile(file, metadata, onSuccess) {
var uploadTask = storageRef.child("sponsor-uploads/" + file.name).put(file, metadata);
// Listen for state changes, errors, and completion of the upload.
uploadTask.on(
firebase.storage.TaskEvent.STATE_CHANGED, // or 'state_changed'
function (snapshot) {
... | [
"function _uploadFile(file){\n var fileName = file.name;\n\n // this is a reference to Firebase storage for uploading images\n var storageRef = firebase.storage().ref('recipeImages/' + fileName);\n\n var uploadTask = storageRef.put(file);\n\n uploadTask.on('state_changed', function(snapshot){\n\n }, func... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Construct a segment bound to a variable, e.g., from a segment like "Len:32/unsignedbig". `specifiers0` is an array. | function variable(name, size, specifiers0) {
var specifiers = set(specifiers0);
var segment = {name: name};
segment.type = type_in(specifiers);
specs(segment, segment.type, specifiers);
segment.size = size_of(segment, segment.type, size, segment.unit);
return segment;
} | [
"function variable(name, size, specifiers0) {\n var specifiers = set(specifiers0);\n var segment = {name: name};\n segment.type = type_in(specifiers);\n specs(segment, segment.type, specifiers);\n segment.size = size_of(segment, segment.type, size, segment.unit);\n if (segment.type == 'string') {\n add_s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Renders the AWS CloudFormation properties of an `AWS::ApplicationInsights::Application.ComponentConfiguration` resource | function cfnApplicationComponentConfigurationPropertyToCloudFormation(properties) {
if (!cdk.canInspect(properties)) {
return properties;
}
CfnApplication_ComponentConfigurationPropertyValidator(properties).assertSuccess();
return {
ConfigurationDetails: cfnApplicationConfigurationDetail... | [
"renderProperties(x) { return ui.divText(`Properties for ${x.name}`); }",
"function renderProperties(setup) {\n // print available exams\n var html = '';\n if (!('localStorage' in window)) {\n html += warning(getMessage('msg_options_change_disabled', 'Changing options is disabled, because your bro... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Draw box with center at (x,y) and text centered inside box | function drawTextInCenteredBox(text, fontColor, fontStyle, boxColor, x, y, width, height, c_ctx) {
if(!c_ctx)
c_ctx = ctx;
c_ctx.save();
c_ctx.fillStyle = boxColor;
c_ctx.fillRect(x-width/2, y-height/2, width, height);
drawText(text, fontColor, fontStyle, x, y, c_ctx);
c_ctx.restore();
} | [
"function drawCenterText(text, x, y, width)\r\n{\r\n var textdim = context.measureText(text);\r\n context.fillText(text, x + (width-textdim.width)/2, y);\r\n}",
"function drawTextBox(c, textArray, xCenter, yCenter, textSize) {\n var numLines = textArray.length;\n if (numLines < 1)\n return;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Executes after temperature conversion Assigns color based off of newly converted temperature | function assignColor(temp, mesurementStyle){
newTempLocation = document.getElementById("convertedTemp");
if(mesurementStyle === "C"){
if(temp > 32){
newTempLocation.style.backgroundColor = "red";
}else if(temp < 0){
newTempLocation.style.backgroundColor = "lightblue";
}else{
newTempLocation.style.back... | [
"function setTempColor (temperature) {\n if (temperature >= 90){\n return \"color:#FF0000\"; //red\n }\n if (temperature >= 80) {\n return \"color:#FF9900\"; //orange\n }\n if (temperature >= 70) {\n return \"color:#... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a formatter function. This function works similarly to Node's `util.format`, but it automatically wraps text at a given width, and prepends a prefix to all lines. | function getFormatter(width, prefix) {
return function () {
var util = require('util');
var message = util.format.apply(util, arguments);
var messageLines = message.split('\n');
var lines = [];
var line = messageLines.shift();
while (line != null) {
if (line.length - prefix.length <= width) {
lines.... | [
"function format(str,width){\t\n str = str + \"\"\n var len = str.length;\n \n if(len > width){\n return str\n }\n \n for(var i = 0; i < width-len; i++){\n str += \" \"\n }\n return str; \n}",
"function fillWidth(text, width, paddingStart) {\n return \" \".repeat(paddin... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get the countries and its current temperature forecast | function getCountries() {
weatherService.getCountryList().then(resolver, rejector);
//if success
function resolver(response) {
vm.countries = response.data;
geteCountryForecast();
}
//if reject
function rejector(res... | [
"function geteCountryForecast() {\n var countriesWithoutForecast = vm.countries.filter(function (item) { return !item.forecast; });\n countriesWithoutForecast.forEach(function (country) {\n weatherService.getForecastForCountry(country.id).then(function (response) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Purpose : used to show a div Parameters : strDivName the div to be shown Return Value : none | function cmShowDiv(strDivName)
{
document.getElementById('div_'+strDivName).style.visibility = 'visible';
} | [
"function displayDiv(divName){\n var divNames = [\"AddDataDiv\", \"FindDocDiv\", \"ReplaceDocDiv\", \"RemoveDocDiv\", \"AdapterIntegrationDiv\", \"ChangePasswordDiv\"];\n for(i=0; i<divNames.length; i++){\n document.getElementById(divNames[i]).style.display = \"none\";\n }\n document.getElementBy... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Internal compiletimeonly representation of a `DragRef`. Used to avoid circular import issues between the `DragRef` and the `DropListRef`. | function DragRefInternal() {} | [
"function DragRefInternal() { }",
"function DropListRefInternal() {}",
"function DropListRefInternal() { }",
"_syncItemsWithRef() {\n this._dropListRef.withItems(this.getSortedItems().map(item => item._dragRef));\n }",
"function useDrag(spec) {\n var item = spec.item, options = spec.options, preview ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Render the review box. This will prepare a reply draft banner, used if the user is replying to any comments on the review. Each comment section will be set up to allow discussion. Returns: RB.ReviewBoxView: This object, for chaining. | render() {
RB.CollapsableBoxView.prototype.render.call(this);
this._reviewView = new RB.ReviewView({
el: this.el,
model: this.model,
reviewRequestEditor: this.options.reviewRequestEditor,
$bannerFloatContainer: this._$box,
$bannerParent: this.... | [
"render() {\n const reviewRequest = this.model.get('parentObject');\n\n RB.CollapsableBoxView.prototype.render.call(this);\n\n // Expand the box if the review is current being linked to\n if (document.URL.indexOf(\"#review\") > -1) {\n const loadReviewID = document.URL.split('... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the string name of a symbol. | function lisp_symbol_name(symbol) {
lisp_assert(lisp_is_instance(symbol, Lisp_Symbol));
return symbol.lisp_name;
} | [
"getFullyQualifiedName(symbol) {\r\n return this.compilerObject.getFullyQualifiedName(symbol.compilerSymbol);\r\n }",
"getName() {\r\n return this.compilerSymbol.getName();\r\n }",
"getSymbol(){\n let s = this.chemFromProperties()[CHEMICAL_PROPERTY_SYMBOL];\n return (s === unde... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to convert Word file to HTML using mammoth library | parseWordDocxFile(files) {
this.setState({ converting: true });
var current = this;
//console.log(files);
var file = files[0];
var reader = new FileReader();
reader.onloadend = function (event) {
var arrayBuffer = reader.result;
mammoth.convertT... | [
"function TML2HTML() {\n \n /* Constants */\n var startww = \"(^|\\\\s|\\\\()\";\n var endww = \"($|(?=[\\\\s\\\\,\\\\.\\\\;\\\\:\\\\!\\\\?\\\\)]))\";\n var PLINGWW =\n new RegExp(startww+\"!([\\\\w*=])\", \"gm\");\n var TWIKIVAR =\n new RegExp(\"^%(<nop(?:result| *\\\\/)?>)?([A-Z0-9_:]+)({.*})?$\", \"\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Resets the state to unvisited for normal nodes, null for other types. | resetState() {
if(this.state) this.state = Node.UNVISITED;
else this.state = null;
} | [
"function resetNodes() {\r\n allNodes.forEach(node => {\r\n node.visited = false;\r\n });\r\n}",
"function resetNodes() {\n let allVisited = document.querySelectorAll('.visited-node')\n let allPath = document.querySelectorAll('.path-node')\n allVisited.forEach((node) => {\n node.classList = 'unv... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
reset the address search box, remove the geocoded address point, and close the popup. | function resetAddressSearch() {
$('.searchbox').val('');
addressPoint.clearLayers();
addressPoint.closePopup();
} | [
"function resetAddressSearch() {\n $(\"#venue_address\").val(\"\");\n addressLayer.clearLayers();\n addressLayer.closePopup();\n }",
"function handleClearSearchAddressMarkers() {\n\t\t\tmap.clearMarkers(map.SEARCH);\n\t\t}",
"function resetSearch() {\n addressinfowindow.close();\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determines if a text field element has input param fieldElement A text field input element object return True if the field contains input; False if nothing entered | function formFieldHasInput(fieldElement){
// Check if the text field has a value
if ( fieldElement.value == null || trim(fieldElement.value) == "" )
{
// Invalid entry
return false;
}
// Valid entry
return true;
} | [
"function formFieldHasInput(fieldElement)\n{\n\tif(fieldElement.value == null || trim(fieldElement.value) == \"\")\n\t{\n\t\treturn false;\n\t}\n\t\n\treturn true;\n}",
"function formFieldHasInput(fieldElement)\n{\t\n\tif(fieldElement.value == null || trim(fieldElement.value) \n\t\t== \"\"){\n\t\treturn false;\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update the total numberf of bots needed | function updateTotalNumberOfBotsNeeded(input) {
EventBridge.emitWebEvent(JSON.stringify({
app: "botinator",
method: "updateTotalNumberOfBotsNeeded",
totalNumberOfBotsNeeded: input.value
}));
totalNumberOfBotsNeeded.innerHTML = "Current Bots: " + input.value;
} | [
"function update() {\r\n stats = JSON.parse(fs.readFileSync('../stats.json'));\r\n stats.guilds.guild_bot_3 = client.guilds.cache.size;\r\n stats.requests.global_requests = stats.requests.global_requests + 1;\r\n stats.requests.request_bot_3 = stats.requests.request_bot_3 + 1;\r\n stats.users.user_bo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
CTDataIndex a class used to hold the requestpromise output. | function CTDataIndex(aDomain) {
/**
* Socrata domain to search
* @type {string}
*/
if (aDomain === undefined) this.domain = ctDomain
else this.domain = ctDomain.replace('data.ct.gov', aDomain);
} | [
"fetchData() {\n fetch(this.config.indexUrl)\n .then((res) => res.json())\n .then((data) => {\n // Populate index with new data\n this.index = this.createIndex();\n\n const currData = data.slice(0, data.length - 1);\n const currHash = data[data.length - 1].hash;\n\n c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Compiles the comment on the table. | comment(comment) {
this.pushQuery(`comment on table ${this.tableName()} is '${comment || ''}'`);
} | [
"comment(_comment) {\n this.pushQuery(`comment on table ${this.tableName()} is '${_comment}';`);\n }",
"enterComment_on_table(ctx) {\n\t}",
"comment(value) {\n if (typeof value !== 'string') {\n throw new TypeError('Table comment must be string');\n }\n this._single.comment = value;\n }",
"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get next paragraph for row | getNextParagraphRow(row) {
if (!isNullOrUndefined(row.nextRenderedWidget)) {
let cell = row.nextRenderedWidget.childWidgets[0];
let block = cell.childWidgets[0];
return this.getFirstParagraphBlock(block);
}
return this.getNextParagraphBlock(row.ownerTable);
... | [
"getNextParagraphCell(cell) {\n if (cell.nextRenderedWidget && cell.nextRenderedWidget instanceof TableCellWidget) {\n //Return first paragraph in cell. \n cell = cell.nextRenderedWidget;\n let block = cell.firstChild;\n if (block) {\n ret... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Playback$playbackstart playback is considered started when PresentingState becomes something else by WAITING for the first time | function _presentingStateChangedForPlaybackStart(e) {
if (e.newValue != PresentingState$WAITING) {
_self.presentingState.removeListener(_presentingStateChangedForPlaybackStart);
_eventSource.fire(Playback$playbackstart);
}
} | [
"function onPlaying() {\n if (element && isStalled() && element.playbackRate === 0) {\n var _event = document.createEvent('Event');\n _event.initEvent('waiting', true, false);\n element.dispatchEvent(_event);\n }\n }",
"function onPlaying() {\n if (element ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
when a user clicks on 'no' they will be taken to a new screen displaying more colors. Here we are dispatching the API_CALL_REQUEST_COLORS and navigating to the ColorPicker screen | showMoreColors() {
this.props.showMoreColorsDispatch();
this.props.navigation.navigate('ColorPicker', {
selectedColor: [200, 94, 150]
});
} | [
"function OnColorPickerOk(oldColor : RGBColor, newColor : RGBColor){\n\tDebug.Log(\"RTColorPicker Ok clicked\");\n}//OnColorPickerOk",
"function colorPickerPannelSet(type) {\n if(type === 'measurements'){\n document.getElementById('color-picker-colors').style.display = 'none'\n document.getElementById(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function below will start storing entry on local storage. The event is numbered 111 because thats how many blocks there are in the event planner. Second part is getting the var from above that is named timeBlock() and adds a string of text blank to store the USER's entry. | function localStorageEntry() {
localStorage.setItem("eventOne", timeBlock1.text());
localStorage.setItem("eventTwo", timeBlock2.text());
localStorage.setItem("eventThree", timeBlock3.text());
localStorage.setItem("eventFour", timeBlock4.text());
localStorage.setItem("eventFive", timeBlock5.text());
... | [
"function renderStoredData(block, eventHour) {\n var event = JSON.parse(localStorage.getItem(timeBlock[eventHour]))\n \n if (!event) {\n return\n }\n block.attr(\"placeholder\", event)\n }",
"function storeBlockText(hour, text) {\n var blockStore = {\n Bl... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Wraps the Framer.Data object with realtime Firebase support | function FirebaseData(config = {}, initialState, ref = "") {
const { database, app } = FirebaseApp(config)
const data = Object(framer__WEBPACK_IMPORTED_MODULE_0__["Data"])(initialState)
let initialized = false
const firebaseEmptyArrayString = "$$firebaseEmptyArray"
// Setter & Getter for values in... | [
"function FirebaseData(config = {}, initialState, ref = \"\") {\n const { database, app } = FirebaseApp(config)\n const data = Object(framer__WEBPACK_IMPORTED_MODULE_0__[\"Data\"])(initialState)\n const firebaseEmptyArrayString = \"$$firebaseEmptyArray\"\n let initialized = false\n\n // Setter & Gett... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns patterns to be expanded relative to (outside) the current directory. | function getPatternsOutsideCurrentDirectory(patterns) {
return patterns.filter(isPatternRelatedToParentDirectory);
} | [
"expandGlobPatterns(context, argv) {\n const nextArgv = [];\n this.debug('Expanding glob patterns');\n argv.forEach((arg) => {\n if (arg.charAt(0) !== '-' && is_glob_1.default(arg)) {\n const paths = fast_glob_1.default\n .sync(arg, {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Inserta en la base de datos via AJAX | function insertarBD(datos) {
//lamado a ajax
//crear
const xhr = new XMLHttpRequest();
//abrir conexion
xhr.open('POST', 'inc/modelos/modelo-contacto.php', true);
//pasar los datos o leer la respuesta
xhr.onload = function() {
if (this.status === 200) {
//leemos la r... | [
"function insertarBD(datos) {\n //llamando a AJAX\n\n //crear el objeto\n const xhr = new XMLHttpRequest;\n //abrir la conexion\n xhr.open('POST', '../inc/modelos/modelo-contactos.php', true);\n\n //pasar los datos\n xhr.onload = function() {\n if (this.status === 200) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function positions the inner row labels. | function setSubRowLabelPosition(mainRowLabelPosData, rowLabelTable, innerRowPosition) {
var expandedRows = mainRowLabelPosData.filter(function (d) { return d.expand })
var xPos = innerRowPosition;
//console.table(expandedRows)
innerPosData = [];
expandedRows.forEach(function (d) {
//filter out the labels ... | [
"function setSubRowLabelPosition(mainRowLabelPosData, rowLabelTable, innerRowWidth){\n var expandedRows = mainRowLabelPosData.filter(function(d) {return d.expand})\n var xPos = innerRowWidth;\n //console.table(expandedRows)\n innerPosData = [];\n expandedRows.forEach(function(d) {\n //filter out the labels ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
external fits_nativeint: t > bool Provides: ml_z_fits_nativeint Requires: ml_z_fits_int | function ml_z_fits_nativeint(z1) {
return ml_z_fits_int(z1);
} | [
"function ml_z_fits_int32(z1) {\n return ml_z_fits_int(z1);\n}",
"function ml_z_fits_int(z1) {\n if(z1 == (z1 | 0)) return 1;\n else return 0;\n}",
"function ml_z_of_nativeint(z1, z2) {\n\n}",
"supportsObjectFit() {\n let testImg = typeof Image === 'undefined' ? {style: {'object-position': 1}} : new... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
My version of gitlistpack roughly 15x faster than the original | async function listpack(stream, onData) {
const reader = new StreamReader(stream);
let PACK = await reader.read(4);
PACK = PACK.toString('utf8');
if (PACK !== 'PACK') {
throw new InternalError(`Invalid PACK header '${PACK}'`)
}
let version = await reader.read(4);
version = version.readUInt32BE(0);
... | [
"async function listpack (stream, onData) {\n let reader = new StreamReader(stream);\n let hash = new Hash();\n let PACK = await reader.read(4);\n hash.update(PACK);\n PACK = PACK.toString('utf8');\n if (PACK !== 'PACK') {\n throw new GitError(E.InternalFail, {\n message: `Invalid PACK header '${PACK}... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get next mediasoup Worker. | function getMediasoupWorker()
{
const worker = mediasoupWorkers[nextMediasoupWorkerIdx];
if (++nextMediasoupWorkerIdx === mediasoupWorkers.length)
nextMediasoupWorkerIdx = 0;
return worker;
} | [
"function getMediasoupWorker() {\n const worker = workers[nextMediasoupWorkerIdx];\n\n if (++nextMediasoupWorkerIdx === workers.length)\n nextMediasoupWorkerIdx = 0;\n\n return worker;\n}",
"async function runMediasoupWorkers()\n{\n\tconst { numWorkers } = config.mediasoup;\n\n\tlogger.info('runni... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
initiates timer to remove matching stories | function starter(){
//t - time in ms
t = setInterval(remove_external_stories, 1000);
//to disable timer and execute script only once at pageload, comment line above and uncomment line below, and vice-versa
//remove_external_stories();
} | [
"removeStory(story) {\n this.stories = this.stories.filter(function(val) {\n return val.storyId !== story.storyId\n });\n }",
"function no_quiz(){\r\n\tremove_stories(); // remove 'm now\r\n\tt = setInterval(remove_stories, 1000); // remove future stories (viz. when clicking the more link)\r\n}",
"f... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
just loop through the songs and console.log them | function consoleLogSongs() {
console.log("consoleLogSongs()");
songs.forEach((song) => {
console.log("Song:", song);
});
} | [
"printArtistSongs() {\n this.songs.forEach((element) => printArtistSongsToConsole(element, this));\n }",
"function consoleLogMusic() {\n console.log(\"consoleLogMusic()\");\n music.forEach((music) => {\n console.log(\"Music:\", music);\n });\n}",
"printPlaylist() {\n this.playlist.forEach... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets values from read type. | function get_values_from_read_type(form_group) {
var inputs_div = form_group.children('div:last');
var read_type = parseInt(inputs_div.find('input:radio:checked').val());
var result = {};
result['type'] = read_type;
if (read_type == 1) {
var single_collapse = form_group.find('.sample_read_type_single_col... | [
"function __getValue () {\n\n var raw_value = __getRawValue();\n\n return typeCast(__type, raw_value);\n\n }",
"read() {\n // Read next tag.\n let [op, arg] = this.readTag();\n let object;\n switch (op) {\n case 0:\n // REF.\n object = this.refs[arg];\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to find the nearest food trucks and log them in an array | function findNearest(lat, lon, amt){
var nearest = [];
var all = [];
var hold = [];
//trying to remove duplicates from the dataset DOESNT WORK YET
for(var i = 0; i < data.length; i++){
for(var j = i+1; j < data.length; j++){
if(data[i].applican... | [
"findNearestFood(){\n var i;\n var j;\n for (i = this.tributes[this.tributeIndex].getRow() - 2; i <= this.tributes[this.tributeIndex].getRow() + 2; i++){\n for (j = this.tributes[this.tributeIndex].getColumn() - 2; j <= this.tributes[this.tributeIndex].getColumn() + 2; j++){\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Find particular score for current user | function findUserScore(req,res) {
var scoreId = req.params.scoreId;
if(scoreId.length <10){
noteModel
.findApiNoteComment(scoreId)
.then(function (score) {
res.json(score);
});
}else{
noteModel
... | [
"function getScore(){\n var params={\n userId : _userId\n }\n var result = _xmlHttpWrapper( _endPoint + _url.getScore, _get , params ,false);\n if(result !== \"error\" && result != undefined){\n result = JSON.parse(result);\n return result;\n }else... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add a listener to data event that will set/change widget's label (14539). | function setupA11yListener( widget ) {
// Note, the function gets executed in a context of widget instance.
function getLabelDefault() {
return this.editor.lang.widget.label.replace( /%1/, this.pathName || this.element.getName() );
}
// Setting a listener on data is enough, there's no need to perform it on ... | [
"onFnaLabelChanged(label) {}",
"function dummyLabelChangeListener ({ annoType, text, color, oldText }) { }",
"function w_label_change(widget_index)\r\n{\r\n\tlet cfg_widget_id = \"cfg_label_\"+widgets[widget_index].id;\r\n\tlet elm = document.getElementById(cfg_widget_id);\r\n\twidgets[widget_index].label = elm... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Will clear all values in the multiple choice creation form. | function clearFormsMC() {
document.getElementById('mcname').value = "";
document.getElementById('choice1').value = "";
document.getElementById('choice2').value = "";
document.getElementById('choice3').value = "";
document.getElementById('choice4').value = "";
document.getElementById('choice5').v... | [
"function resetMultipleChoiceAnswers() {\n var firstMultipleChoice = $(\"#copyableMultipleChoiceAnswer\");\n firstMultipleChoice.find(\".question-multiplechoice-answer-id\").val(\"-1\");\n firstMultipleChoice.find(\".question-multiplechoice-answer\").val(\"\");\n firstMultipleChoice.find(\".question-multiplecho... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets all direct children to the slider and stores them in this.items | cacheItems() {
this.items = getDirectChildren(this.slider);
} | [
"getItems() {\n return this.children;\n }",
"get slides() {\n return this.slider.children;\n }",
"get children() {\n return Array.from(this._el.children || [], n => $(n));\n }",
"get children() {\n return Object.values(this._children);\n }",
"getChildren() {... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the bottom player properties based on id and start song | function bottomPlayerProperties(id){
$('.fa-play').css('display','none');
$('.fa-pause').css('display','block');
$('#img-footer').attr('src',songs[id].image_url);
let str=songs[id].song_name+"<div id='sub-heading'>"+"by "+songs[id].Artist+"</div>";
$('.col-3 h... | [
"function setPlaying(id) {\n database.ref(path + 'songs/' + id + '/playing').set(true);\n database.ref(path + 'songs/' + id + '/nextSong').set(false);\n}",
"function setMainPlayPause(){\n\t\t/*\n\t\t\tDetermines what action we should take based on the\n\t\t\tstate of the song.\n\t\t*/\n\t\tif( config.active_son... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
checks if the course component is only LAB OR TUT OR LEC | function sanitizeCourseComponent(ins){
if (ins === "LAB" || ins === "TUT" || ins === "LEC") {
return true;
}
else {
return false;
}
} | [
"isTech() {\n\t\tlet courses = Educations.findOne(Meteor.user().technical).courses;\n\t\tfor(let i = 0; i < courses.length; i++) {\n\t\t\tif(courses[i] === this.props.course._id) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}",
"function checkValidCourse(crs) {\n const courseNumber = crs.substring(2, 5)\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Deactivate the current element and activate the new one. / \param new_index the index in `sync_elts` of the element to make current / / The function sets `current` to `new_index` (thus making the / element `sync_elts[new_index]` the current element), removes the / class `active` from the previous current element and se... | function activate(new_index)
{
if (new_index < current) {
// Make all items between the new and the old item inactive.
while (current > new_index) {
sync_elts[current].classList.remove("visited");
sync_elts[current].classList.remove("active");
current--;
}
// Find the containing sl... | [
"function switchActiveElement(elements, activateIndex, activeClass, inactiveClass) {\n toArray(elements).forEach(function (el, index) {\n // add active element class\n if (index === (+activateIndex)) {\n\n if (inactiveClass !== \"\") el.classList.remove(inactiveClass);\n if (act... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
the opposite of polToCart, takes in an xyz point and outputs a vector in the form of [theta, phi, radius] | function cartToPol(x, y, z) {
var rad = Math.sqrt((x * x) + (y * y) + (z * z));
var theta = Math.atan2(x, z);
var phi = Math.atan(y / Math.sqrt((z * z) + (x * x)));
return [theta, phi, rad];
} | [
"function sphere_to_cart(azimuth,altitude,radius){\n inc=Math.PI/2-altitude;\n x =radius*Math.sin(inc)*Math.cos(azimuth);\n y=radius*Math.sin(inc)*Math.sin(azimuth);\n z=radius*Math.cos(inc);\n return [x,y,z];\n }",
"function rotate_cartesian(point, axis, rot_angle){\n\t// le... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Converts an RDF triple and graph name to an NQuad string (a single quad). | function _toNQuad(triple, graphName) {
var s = triple.subject;
var p = triple.predicate;
var o = triple.object;
var g = graphName || null;
if('name' in triple && triple.name) {
g = triple.name.value;
}
var quad = '';
// subject is an IRI
if(s.type === 'IRI') {
quad += '<' + s.value + '>';
... | [
"function _toNQuad(triple, graphName, bnode) {\n var s = triple.subject;\n var p = triple.predicate;\n var o = triple.object;\n var g = graphName;\n\n var quad = '';\n\n // subject is an IRI\n if(s.type === 'IRI') {\n quad += '<' + s.value + '>';\n } else if(bnode) {\n // bnode normalization mode\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reset the draftjs editor state | resetEditor() {
// best solution to clear all text/cursor position without issues
// see https://github.com/facebook/draft-js/issues/410
const editorState = this.state.editorState;
const contentState = editorState.getCurrentContent();
const selectionState = editorState.getSelec... | [
"reset() {\n if ('reset' in this.editor) {\n this.editor.reset();\n }\n else {\n this.value = this.defaultValue;\n }\n this.enableHandler();\n this.changed = false;\n }",
"clearActiveEditor() {\n this.activeEditor = void 0;\n }",
"reinitEdit... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Todo: Convert the below to CSS. Should be applied if the viewer is an observer and the amount of bans are > 2 | function moveBans() {
var banScl = 0.8;
var scl = 1;
$('.team-heroes-ban').remove();
var holder = $('<div class="team-heroes-ban team-1"></div>');
var holder2 = $('<div class="team-heroes-ban team-2"></div>');
holder.addClass(teamTurn === 1 ? '' : 'inactive');
holder2.addClass(teamTurn === 2... | [
"function limitWIP() {\n let users = document.querySelectorAll(\".member-vertical\");\n users.forEach((u) => {\n const header = u.querySelector(\".member-header\");\n const title = header.querySelector(\n \".swimlane-member-header .swimlane-header-title\"\n );\n const wip = title.in... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Bump the bower version to match package.json | function version() {
return gulp.src('./bower.json')
.pipe($.bump({version: pkg.version}))
.pipe(gulp.dest('./'));
} | [
"function bump_version(cb) {\n gulp.src('./package.json')\n .pipe(bump({\n type: 'patch'\n }))\n .pipe(gulp.dest('./'));\n console.log('Version Bumped');\n cb();\n}",
"function patchBump() {\n return gulp.src([\n './package.json',\n './bower.json'\n ]).pipe(bump({t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Launches the login modal by changing the display to block | activateModal() {
document.getElementById('logout').style.display = 'none';
document.querySelector('#login-modal').style.display = 'block';
} | [
"function _open_signin_modal () {\n document.querySelector ( \".signin-modal-wrapper\" ).style.display = \"block\";\n}",
"function showLogin() {\n\tstartGoogle();\n\tif (checkanon() == false) {\n\t\t$('#loginModal').openModal()\n\t}\n\treturn;\n}",
"function login() {\n vm.modal.show();\n }",
"function o... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creation of the arrayMap | initArrayMap() {
for (let j = ((this.width - 1) / 2); j >= (-(this.width - 1) / 2); j--) {
for (let i = (-(this.height - 1) / 2); i <= ((this.height - 1) / 2); i++) {
this.arrayMap.push({
coordX: i,
coordY: j,
navigable: true,
player: {
active: false... | [
"function createMap(){return new ts.Map();}",
"mapGenerate() {\n for (let i = 0; i < this.ySize; i++) {\n this.map[i] = [];\n for (let j = 0; j < this.xSize; j++) {\n let mapValue = this.empty;\n this.map[i].push(mapValue);\n }\n }\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the turnover of the card. 0 is facing up, 2 is facing down. | getTurnover() {
return this.turnover;
} | [
"get_game_over() {\n\t\treturn this.state.game_over;\n\t}",
"function onTurnover() {\n /*\n returns a boolean reflecting if the rotor is at a rotor setting which\n will allow it to turn over.\n */\n return this.turnoverCharacters.includes(this.getRotorSetting());\n}",
"function getGameOver() {\r\n r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
convert special characters to html entity | function convert_to_html_entity(value) {
var newStr = "";
var patt=/[a-zA-Z0-9]/
for ( i = 0; i < value.length; i++ ) {
var nextChar = value.charAt(i);
if (patt.test(nextChar))
newStr = newStr + nextChar;
else
newStr = newStr + convertCharToEntity(nextChar);
}
return newStr;
} | [
"function charToEntity(text) {\n if (text.length != 1)\n return text; \n switch (text) {\n case '&': return \"&\";\n case '<': return \"<\";\n case '>': return \">\";\n case '\"': return \""\";\n case \"'\": return \"'\";\n }; \n return te... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
UTILS Since `fetch()` doesn"t "catch" HTTP errors, we need to handle them ourselves TODO: share code with frontend | function handleFetchErrors(response) {
// "clone" so we can still read the original `response` downstream)
return response.clone().text()
.then(bodyTxt => {
if (!response.ok) {
console.error("Fetch response wasn't OK");
throw new Error(`status: "${response.status}", body: "${bodyTxt}"`);
... | [
"async function _errorHandeledFetch(request){\n try { return await fetch(request); } catch (err) {\n return new Response(\"\", { \"status\" : 500 , \"statusText\" : \"offline\" });\n }\n}",
"function handleFetchErrors(response) {\n if (!response.ok) {\n throw Error(response.statusText);\n }\n r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
let coinId = 0; Should I use CMC's ID or rely on creating my own? | function Crypto(name, symbol, id) {
this.name = name;
this.symbol = symbol;
this.id = id;
// coinId++;
} | [
"coinid() {\n this.initCoinData();\n }",
"async \"Filecoin.ID\"() {\n // This is calculated with the below code\n // Hardcoded as there's no reason to recalculate each time\n // mh = require(\"multihashing\")(Buffer.from(\"ganache\"), \"blake2b-256\");\n // (new require(\"peer-... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates the Gold text in the Currencies panel | function drawGold() {goldCountText.innerHTML = numeral(gold).format('0.00a');} | [
"function SetGoldText()\n\t{\n\t\tgoldText.textContent = \"Gold: \" + totalGold;\n\t}",
"function updateMoney() {\n\t\t\tmoneyText.text = money.toString();\n\t\t}",
"displayGold(gold) {\n // Pick gold image based on # of coins\n let stack = \"\";\n switch (true) {\n case gold < 2... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Serialize the row formattings. Table parameter is passed for serializing table format and undefined for serializing row format. | serializeTableFormat(writer, format, table) {
// if (!isNullOrUndefined(table))
// {
// List<Stream> tempDocxProps = new List<Stream>();
// for (int i = 0, cnt = table.DocxTableFormat.NodeArray.length; i < cnt; i++)
// tempDocxProps.Add(table.DocxTableFormat.NodeA... | [
"serializeRowFormat(writer, row) {\n this.serializeRowMargins(writer, row.rowFormat);\n writer.writeStartElement(undefined, 'trPr', this.wNamespace);\n //Serialize Row Height\n if (row.rowFormat.height > 0) {\n writer.writeStartElement(undefined, 'trHeight', this.wNamespace);\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
unwrap old form (we can't have two forms inside in HTML if we want to work properly), so old form will stay alone prepending cover so we can wrap it always back, for example while close button is clicked | function unwrapCoverForm($currentParentLevel, $cover) {
if ($(".old-form").length) return;
var $form = $currentParentLevel.parents('section').find('form').first();
var $oldForm = $form.clone().addClass('old-form');
$oldForm.html('');
$cover.prepend($oldForm);
$form.children('.root').unwrap();
recountFormUnderl... | [
"function wrapCoverForm($cover, $form) {\n\tvar $originalForm = $(\".old-form\").removeClass('old-form');\n\t$cover.find('.root').wrap($originalForm);\n\t$originalForm.remove();\n\t$form.remove();\n\t$('.form-underlay').remove();\n\t$('.form-cover').remove();\n\t$('.generatedForm').remove();\n\t$cover.find('.active... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set ups socket event listeners. Meant to be overriden. | setUpSocketEventListeners() {} | [
"registerListeners() {\n this.socket.on('open', this.openHandler.bind(this));\n this.socket.on('message', this.messageHandler.bind(this));\n this.socket.on('close', this.closeHandler.bind(this));\n this.socket.on('error', this.errorHandler.bind(this));\n this.socket.on('ping', this.pingHandler.bind(t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the number of likes for the given symbol or 0 if no likes were returned. | async getLikes ( symbol, ip=false ) {
const likes = ip
? await this.Likes.find( { symbol, IPs: ip } ).select( { likes: 1, _id: 0 } )
: await this.Likes.find( { symbol } ).select( { likes: 1, _id: 0 } );
return likes[0] !== undefined ? likes[0].likes : 0;
} | [
"get likesCount() {\r\n var _a;\r\n return (_a = this.payload.likes) === null || _a === void 0 ? void 0 : _a.count;\r\n }",
"getTotalLikes() {\n let likeElements = this.query(this.likesQuery);\n let numLikes = 0;\n\n for (let element of likeElements) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set lines of buffer given indeces | setLines(_lines, { start: _start, end: _end, strictIndexing } = {
strictIndexing: true,
}, notify = false) {
// TODO: Error checking
// if (typeof start === 'undefined' || typeof end === 'undefined') {
// }
const indexing = typeof strictIndexing === 'undefined' ? true : stric... | [
"setLines(_lines, { start: _start, end: _end, strictIndexing } = {\n strictIndexing: true,\n }) {\n // TODO: Error checking\n // if (typeof start === 'undefined' || typeof end === 'undefined') {\n // }\n const indexing = typeof strictIndexing === 'undefined' ? true : strictInde... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function for checking vendor already exist Function for checking vendor group name already exist | function check_vendorgroup(str, field_name, id){
var eid = "#"+field_name;
$.ajax({
type : 'POST',
url : ADMINSITEURL + "ajax/check_vendorgroup",
data : { st : str, bid : id },
success : function(response){
if(!response.status){
$(eid).val(str);
$(eid).after("<span class = 'form-error' style ='colo... | [
"function validateVendor(input) {\n var parts = input.split('.');\n if (parts && parts.length > 1)\n return validateVendorParts(parts);\n return false;\n}",
"exists (bus, slot, func) {\n const field = fields.VENDOR_ID;\n const value = readRaw32(bus, slot, func, field.offset);\n cons... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
converts an array of records to text (MarcEdit mrk file format) | function example3() {
marc4js.transform(records, {toFormat: 'text'}, function(err, data) {
console.log(data);
});
} | [
"function array2text(a) {\n var t = '';\n for (i in a) {\n t = t + a[i] + \"\\n\";\n }\n return t.substring(0, t.length-1);\n}",
"function arrToTxt(arr_var,separator) {\n txt_var = arr_var.join(separator);\n return txt_var;}",
"function returnLinesFromArray(arr) {\n var txt = \"\";\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function updates the strength | function updateStrength() {
for (var letter in gameState['usage']) {
var usage = gameState['usage'][letter];
if (usage >= constFactory.USAGE_TIER_0) {
gameState['strength'][letter] = constFactory.STRENGTH_0;
} else if (usage < constFactory.USAGE_TIER_0 &&... | [
"ChangeStrength(int, int, int) {\n\n }",
"function calculateStrength() {\n if (scope.password && scope.password.length) {\n if (scope.calculationMode === 'entropy') {\n // ENTROPY\n\n var goal = parseInt( scope.goal || '96');\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Main helper fxn for printInterleavings that recursively generates all interleavings iStr: used to store all interleavings (or output strings) one by one index: used to pass next available place in iStr The two if statements ensures the interleaving and order. If you look at the first test, notice that the interleavings... | function printInterleavingsRecur(str1, str2, iStr, results, index) {
var str1Length = str1.length,
str2Length = str2.length;
// base case: if all characters of str1 and str2 have been included in output string, then push output string
if (str1Length === 0 && str2Length === 0) {
results.push(iStr.join('... | [
"displayChordOnIntrument(chord) {\n //chord[] is integer array for note index in chord\n let currentString = 0;\n let strings = [16, 21, 26, 31, 35, 40]; //guitar defaults, could take an input for other instruments\n\n for (let i = 0; i < chord.length; i++) {\n currentString = checkStrings(strings,... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
extract PathItems from "s" (Array of PageItems ex. selection), and put them into an Array "pathes". If "pp_length_limit" is specified, this function extracts PathItems which PathPoints length is greater than this number. | function extractPathes(s, pp_length_limit, pathes){
for(var i = 0; i < s.length; i++){
if(s[i].typename == "PathItem"){
if(pp_length_limit
&& s[i].pathPoints.length <= pp_length_limit){
continue;
}
pathes.push(s[i]);
} else if(s[i].typename == "GroupItem"){
// s... | [
"function extractPathes(s, pp_length_limit, pathes){\n for(var i = 0; i < s.length; i++){\n if(s[i].typename == \"PathItem\"){\n //&& !s[i].closed){ // open pathes only\n if(pp_length_limit && s[i].pathPoints.length <= pp_length_limit){\n continue;\n }\n pathes.push(s[i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given a color and direction, filter data based on parameters. | function filterByColorAndDirection(color, dirName) {
const stationsFiltered = STATIONS.map(function (val) {
let newVal = JSON.parse(JSON.stringify(val));
for (let elem of newVal.etd) {
if (elem.estimate[0].color === color && elem.abbreviation === dirName) {
newVal.show = true;
newVal.etd... | [
"function filterColor(filtVal){\n if(filtVal != \"none\"){\n colorFilter.filtVal = filtVal;\n lastFilter = colorFilter.key;\n }\n//If the none option is selected, we turn off the color filter. We also check if it was the most recently accessed filter. If it was, we change the most recently accessed filter t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns index of the current stage of the calibration initiated with method start3DCalibration. | get_3DCalibrationStage() {
this.liveFunc.get_3DCalibrationStage();
return _yocto_api.YAPI_SUCCESS;
} | [
"get_3DCalibrationStageProgress() {\n this.liveFunc.get_3DCalibrationStageProgress();\n return _yocto_api.YAPI_SUCCESS;\n }",
"function getCurrentIndex() {\n console.log(\"slideshow.currentIndex\");\n for ( let i = 0, n = slides.length; i < n; i++ ) {\n if ( slides[i].cla... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sort products by price in ascending order: | function ascendProducts(data){
//returns a sorted array based on comparing elements a and b
data.sort(function(a, b) {
return a.price - b.price;
});
show(data);
} | [
"function sortAllOfTheProductsAscendantlyBasedOnTheNewPrices() {\n\n}",
"function comparePrice(a,b){\n return a.price - b.price; console.log(products.sort(comparePrice));\n }",
"function sortByPrice(a, b) {\n if (a.itemPrice < b.itemPrice)\n return -1;\n if (a.itemPr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set style of table parent | function setParent() {
var parent = $(settings.parent);
var table = $(settings.table);
parent.append(table);
parent
.css({
'overflow-x': 'auto',
'overflow-y': 'auto'
}... | [
"function removeTableStyle(parentTable) {\r\n tinyMCE.DOM.removeClass(parentTable, 'table');\r\n tinyMCE.DOM.removeClass(parentTable, 'table-bordered');\r\n tinyMCE.DOM.removeClass(parentTable, 'table-condensed');\r\n tinyMCE.DOM.removeClass(parentTable, '... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
DO NOT CHANGE ANYTHING UNDER THIS USE THIS OR THE OTHER JOB FUNCTION. DO NOT USE BOTH This function sends a count of the number of emails matched to the chat notification card. This is the job you'll create a trigger for, so it runs every 5 mins or whatever. Just make sure you search queries are appropriately scoped to... | function job_check_gmail_count_only() {
var search_query_array = config_gmail_search_array_();
for (var i = 0; i < search_query_array.length; i++) {
//console.log('searching: ' + search_query_array[i][1]);
var result = countQuery_(search_query_array[i][1]);
if(result > 0) {
p... | [
"function notifyUnread() {\r\n\tif (label == 'Inbox') {\r\n\t\tunread_count = 0;\r\n\t} else {\r\n\t\tvar search_results = label.match(/\\((\\d*)\\)/);\r\n\t\tif (search_results) {\r\n\t\t\tvar new_unread_count = search_results[1];\r\n\t\t\tif (new_unread_count > unread_count) {\r\n\t\t\t\twindow.fluid.showGrowlNot... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Deletes reservation associated with user in the backend Sweet Alert pops up, if Promise true then deletes reservation otherwise if error occurs, error alert pops up or user chooses to not cancel | cancelReservation(todo) {
var self = this;
swal({
title: "Are you sure?",
text: "You are about to cancel your reservation for the parking spot on " + todo.parkingSpot.street_Number + " " + todo.parkingSpot.street_Name + "!",
icon: "warning",
buttons: ["Don't cance... | [
"function deleteReservatie(selectedreservatie) {\n var confirm = $mdDialog.confirm()\n .title('Annuleer reservatie')\n .textContent('Bent u zeker dat u de reservatie wilt annuleren ?')\n .ariaLabel('Confirm deleteReservatie')\n .ok('Annuleer reservatie')\n .cancel... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Desktop view layout that applies to all website pages | function viewDesktop_Master() {
} | [
"function makeDesktopLayout() {\n header.style.height = gameboxPadding + 'px';\n footer.style.height = gameboxPadding + 'px';\n }",
"function mobileSite() {\n session.custom.device = 'mobile';\n app.getView().render('components/changelayout');\n}",
"function deviceLayouts() {\n app.getView... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Loads the given name (or [name, options] pair) from the given table object holding the available presets or plugins. Returns undefined if the preset or plugin is not available; passes through name unmodified if it (or the first element of the pair) is not a string. | function loadBuiltin(builtinTable, name) {
if (isArray(name) && typeof name[0] === 'string') {
if (builtinTable.hasOwnProperty(name[0])) {
return [builtinTable[name[0]]].concat(name.slice(1));
}
return;
} else if (typeof name === 'string') {
return bu... | [
"function loadBuiltin(builtinTable, name) {\n if (isArray(name) && typeof name[0] === \"string\") {\n if (Object.prototype.hasOwnProperty.call(builtinTable, name[0])) {\n return [builtinTable[name[0]]].concat(name.slice(1));\n }\n return;\n } else if (typeof name === \"string\") {\n return builti... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
`ledger balance` output format to allow parsing as a CSV string | static formatBalance () {
return '%(quoted(display_total)),%(quoted(account))\n%/'
} | [
"accountReport() {\n let string = '';\n for (let i = 0; i < this.bankAccounts.length; i++) {\n string += this.bankAccounts[i].toString() + '\\n';\n }\n return string;\n }",
"function formatBalance(balance) {\n var formattedBalance = '--';\n if (balance !== null) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
UnSubscribe event at all paths in mSubscribePaths | function mUnSubscribeAllChatPaths() {
// Utils.log(`${LOG_TAG}: mUnSubscribeAllChatPaths:`);
const chatRef = FirebaseDatabase.getChatRef();
const paths = Object.keys(mSubscribePaths);
for (let i = 0; i < paths.length; i += 1) {
const path = paths[i];
mSubscribePaths[path] = null;
chatR... | [
"function mUnSubScribeChatPath(path) {\n // Utils.log(`${LOG_TAG}: mUnSubScribePath: ${path}`);\n // is subscribe before\n if (!mSubscribePaths[path]) {\n return;\n }\n // un-subscribe\n mSubscribePaths[path] = null;\n const chatRef = FirebaseDatabase.getChatRef();\n chatRef.child(path)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the Transaction Fee Checkbox State (checked / unchecked) | setFee(state) {
document.getElementById(
"en__field_supporter_transaction_fee"
).checked = !!state;
} | [
"setCheck(node, state) {\n node.checkbox.checked = state;\n\n this._update(node);\n }",
"setToscheckbox() {\n\n if (this.props.config.debug==true) { console.log(\"in EmailSignup/setToscheckbox\"); }\n\n if (this.state.toschecked)\n {\n //unchecked\n this.setState(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Proxy handler containing the traps for operations on Array Objects | function ArrayUpdateHandler(entry, manipulator) {
/**
* Keeps a weak map cache of proxies attached to dom nodes so they die along with their attached node.
* @type {WeakMap<Object, any>}
*/
let proxyCache = new WeakMap();
/**
* Keeps a list of all the proxies created so they are not added back to th... | [
"function watchArray (arr) {\r\n augment(arr, ArrayProxy)\r\n linkArrayElements(arr, arr)\r\n}",
"function watchArray (arr) {\n augment(arr, ArrayProxy)\n linkArrayElements(arr, arr)\n}",
"function getPrototypeOfTrap() {\n const handler = {\n getPrototypeOf: target => Array.prototype // eslint-d... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |