query stringlengths 9 14.6k | document stringlengths 8 5.39M | metadata dict | negatives listlengths 0 30 | negative_scores listlengths 0 30 | document_score stringlengths 5 10 | document_rank stringclasses 2
values |
|---|---|---|---|---|---|---|
get the URL for the "loading" page to be used as iframe src while loading the Dropbox. | function loadingURL() {
return settings.assetHost + '/external/zenbox/v2.1/loading.html';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getLoaderUrl() {\n const { organizationId, pageId } = config;\n const base = config.isHipaaOrg ? \"https://platformhipaa.cloud.coveo.com\" : \"https://platform.cloud.coveo.com\";\n return `${base}/rest/organizations/${organizationId}/pages/${pageId}/inappwidget/loader`;\n}",
"getIntendedURL () ... | [
"0.65660435",
"0.64362466",
"0.5959933",
"0.5924222",
"0.5852324",
"0.5830142",
"0.5762758",
"0.57375526",
"0.56045496",
"0.5561437",
"0.5489505",
"0.54825187",
"0.54799646",
"0.5433734",
"0.5430651",
"0.54007477",
"0.54004174",
"0.5393575",
"0.53686607",
"0.5362531",
"0.5358... | 0.7258426 | 0 |
upgrade the speed of delivery | upgrade() {
if (money >= this.priceUpgrade && this.unlock) {
this.lightYellow();
money -= this.priceUpgrade;
this.speedOfDelivery = this.getNewSPeed(this.speedOfDelivery);
this.worker.postMessage(this.speedOfDelivery)
ingredientChart[this.ingredient].... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"set SpeedUS(newSpeed){\n this.speed = newSpeed * 1.6\n }",
"set speedUS(speed) {\n this.speed = speed *= 1.6;\n }",
"function updateSpeed () {\n var progress = (100 * torrent.progress).toFixed(1)\n console.log(progress)\n // '<b>Peers:</b> ' + torrent.... | [
"0.66828936",
"0.650004",
"0.64734894",
"0.6295966",
"0.62505984",
"0.622006",
"0.6208842",
"0.6206819",
"0.61661446",
"0.6165942",
"0.61629826",
"0.61595154",
"0.61470354",
"0.61392653",
"0.6130278",
"0.61277586",
"0.6106612",
"0.60987014",
"0.6097191",
"0.60749364",
"0.6043... | 0.69945633 | 0 |
average speed of all unlocked reserve | averageSpeed() {
var speedAverage = 0;
var nbUnlockedReserve = 0;
for (var reserve of foodList) {
if (reserve.unlock) {
nbUnlockedReserve++;
speedAverage += reserve.speedOfDelivery;
}
}
return this.roundValue(speedAverage / ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"averagePrice() {\n var priceAverage = 0;\n var nbUnlockedReserve = 0;\n for (var reserve of foodList) {\n if (reserve.unlock) {\n nbUnlockedReserve++;\n priceAverage += reserve.priceUpgrade;\n }\n }\n return this.roundValue(pric... | [
"0.6770601",
"0.63206214",
"0.5751441",
"0.57342494",
"0.5631219",
"0.56048125",
"0.55834824",
"0.5582153",
"0.55590516",
"0.5521785",
"0.5505836",
"0.5505342",
"0.54733264",
"0.5462948",
"0.54256374",
"0.5421072",
"0.5416692",
"0.53994256",
"0.5390854",
"0.5390568",
"0.53862... | 0.78668076 | 0 |
average price of all unlocked reserve | averagePrice() {
var priceAverage = 0;
var nbUnlockedReserve = 0;
for (var reserve of foodList) {
if (reserve.unlock) {
nbUnlockedReserve++;
priceAverage += reserve.priceUpgrade;
}
}
return this.roundValue(priceAverage / nbU... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"averageSpeed() {\n var speedAverage = 0;\n var nbUnlockedReserve = 0;\n for (var reserve of foodList) {\n if (reserve.unlock) {\n nbUnlockedReserve++;\n speedAverage += reserve.speedOfDelivery;\n }\n }\n return this.roundValue(s... | [
"0.7009207",
"0.6802831",
"0.6528656",
"0.6482315",
"0.64441395",
"0.6419299",
"0.63171864",
"0.6309896",
"0.6304184",
"0.62432075",
"0.62410724",
"0.6213201",
"0.6169113",
"0.61664844",
"0.61397547",
"0.6133566",
"0.6125896",
"0.6108614",
"0.6095981",
"0.6030787",
"0.6016122... | 0.8463523 | 0 |
UI enhancement to dismiss the Elements modal when the user clicks outside of the modal and in the window. | function dismissElementsModalOnWindowClick(event) {
var modal = document.querySelector(".ElementsModal--modal");
if (
event.target === modal &&
modal.classList[1] === "ElementsModal--show-modal"
) {
toggleElementsModalVisibility();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function outsideClick(e) {\r\n if (e.target == modal) {\r\n modal.style.display = \"none\";\r\n }\r\n}",
"function outsideClick(e) {\n if (e.target == modal) {\n modal.style.display = \"none\";\n }\n}",
"function outsideClick(e) {\n if (e.target == modal) {\n modal.style.display = \"none\";\n }\... | [
"0.7739281",
"0.7709359",
"0.7709359",
"0.7709359",
"0.7709359",
"0.7692178",
"0.7680806",
"0.767722",
"0.767722",
"0.767722",
"0.767722",
"0.767722",
"0.767722",
"0.7663674",
"0.7656451",
"0.7636982",
"0.7629511",
"0.76252306",
"0.7602001",
"0.75960267",
"0.75871193",
"0.7... | 0.78201985 | 0 |
a poem class, no input params as of yet | function Poem() {
// a poem has a dictionary to query for words
this.dict = new Dictionary('brscript.txt');
// and an array to store things in temporarily
this.poem = [];
var self = this;
// when our dictionary has loaded all its words
this.dict.on('dictLoaded', function() {
self.emit('ready');
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"constructor(phrase, point){\r\n this.phrase = phrase;\r\n this.point = point;\r\n }",
"function Pact() {}",
"function Pessoa(nome, sobrenome) {\n this.nome = nome;\n this.sobrenome = sobrenome;\n}",
"function BookProto(title, awesome){\n this.title = title;\n this.awesome = aweso... | [
"0.6197458",
"0.60396737",
"0.5884632",
"0.581888",
"0.5762291",
"0.570981",
"0.56753",
"0.56683004",
"0.5658723",
"0.5658572",
"0.56345683",
"0.56335205",
"0.56335205",
"0.56335205",
"0.5625298",
"0.5613763",
"0.5596756",
"0.5595917",
"0.558306",
"0.558306",
"0.558306",
"0... | 0.62724316 | 0 |
Loads the Babel standalone library | async loadBabel(options = {}) {
const { runtime } = this
const { assetLoader } = runtime
if (this.loading) {
return new Promise(resolve => {
setTimeout(resolve, 20)
}).then(() => this.loadBabel())
}
if (window.Babel) {
this.ready = true
this.emit('ready', window.Bab... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Babel(config) {\n this.config = config;\n}",
"get _parallelBabel() {\n if (this.portableConfig.isParallelSafe) {\n return {\n requireFile: __filename,\n buildUsing: 'rehydrate',\n params: this.portableConfig.portable,\n };\n ... | [
"0.7090452",
"0.6223538",
"0.5940874",
"0.586632",
"0.5842965",
"0.57144344",
"0.5548846",
"0.55444837",
"0.55444837",
"0.5431258",
"0.53469723",
"0.5326572",
"0.5315413",
"0.5293458",
"0.52748847",
"0.5249645",
"0.52049714",
"0.51667213",
"0.5139053",
"0.51232827",
"0.510996... | 0.7735155 | 0 |
Reads the employees from a csv file and sets the employees variable. | function setEmployees() {
let csvData = readCsv(EMPLOYEE_FILE);
for(var i = 0; i < csvData.length; i++) {
employees.push({
id: csvData[i][0],
firstName: csvData[i][1],
lastName: csvData[i][2],
email: csvData[i][3],
hourlyWage: Number(csvData[i][4])
});
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function readFromCsvAndPopulateStaffSchema() {\n\tvar readStream = fs.createReadStream('../staff.csv');\n\tvar parser = csv.parse({columns:true});\n\n\tparser.on('readable', function() {\n\t\twhile (record = parser.read()) {\n\t\t\t// var split_name = record.name.split(\" \");\n\t\t\t// if (split_name.length == 2)... | [
"0.61388",
"0.6109641",
"0.5440017",
"0.53262705",
"0.531733",
"0.5293275",
"0.5209568",
"0.5193002",
"0.5163278",
"0.51000947",
"0.50778556",
"0.5051982",
"0.5017763",
"0.5005807",
"0.49946272",
"0.4964282",
"0.4963351",
"0.49368",
"0.4917712",
"0.4909844",
"0.48907244",
"... | 0.82427824 | 0 |
Writes the employees variable into the csv file. | function writeEmployees() {
let csvData = [];
for(let i = 0; i < employees.length; i++) {
let employee = employees[i];
let row = [
employee.id,
employee.firstName,
employee.lastName,
employee.email,
String(employee.hourlyWage)
];
csvData.push(row);
}
writeCsv(EMPLOYEE_FILE, csvData);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setEmployees() {\n\tlet csvData = readCsv(EMPLOYEE_FILE);\n\tfor(var i = 0; i < csvData.length; i++) {\n\t\temployees.push({\n\t\t\tid: csvData[i][0],\n\t\t\tfirstName: csvData[i][1],\n\t\t\tlastName: csvData[i][2],\n\t\t\temail: csvData[i][3],\n\t\t\thourlyWage: Number(csvData[i][4])\n\t\t});\n\t}\n}",
... | [
"0.6533477",
"0.6351464",
"0.6213126",
"0.6196487",
"0.61778516",
"0.6038391",
"0.57554775",
"0.5705484",
"0.5679781",
"0.5675083",
"0.5674872",
"0.56515294",
"0.56094223",
"0.55181044",
"0.5517091",
"0.54814583",
"0.54790294",
"0.5466736",
"0.5448518",
"0.54376006",
"0.54109... | 0.87644213 | 0 |
Shows the main menu and performs the action selected by the user. | function showMainMenu() {
console.log('---------------------------------------');
for(let i = 0; i < MAIN_MENU.length; i++) {
console.log(`${MAIN_MENU[i].text}`);
}
let selectedAction = prompt.questionInt(">>> ");
if(selectedAction > MAIN_MENU.length || selectedAction <= 0) {
console.log("\nInput not valid. P... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function mainMenu() {\n inquirer.prompt({\n name: \"action\",\n type: \"list\",\n message: \"Select an action to perform: \",\n choices: menuSelections\n })\n .then(function(answer) { // menu branch table \n switch (answer.action) {\n case m... | [
"0.73682797",
"0.71567684",
"0.6716586",
"0.6614407",
"0.6611907",
"0.6605272",
"0.65373707",
"0.6526098",
"0.65228325",
"0.65181464",
"0.65119946",
"0.65093666",
"0.64727575",
"0.64674264",
"0.64627934",
"0.64532",
"0.642728",
"0.6413099",
"0.63943297",
"0.6383278",
"0.63789... | 0.7396062 | 0 |
Asks for an employee id and allows the editing of that employee. | function editEmployee() {
outputEmployeeDetails();
let selectedEmployee = prompt.questionInt('Employee ID: ');
let employee = employees.find(emp => Number(emp.id) == selectedEmployee);
if(employee != undefined) {
console.log('------------------------------------');
console.log('Press enter to keep current valu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function editEmployee(id) {\n\t$.get(\"/EmployeeList/\" + id, function (data) {\n\t\t$('#idEmployee').val(data.id);\n\t\t$('#name').val(data.name);\n\t\t$('#job').val(getJobCode(data.job));\n\t});\n\t$('#action').val('Actualitzar');\n\t$('#formType').html('Actualizar');\n}",
"canEdit(id) {}",
"function edit(id... | [
"0.7749797",
"0.6743606",
"0.6677951",
"0.6673287",
"0.6648888",
"0.65658367",
"0.65467286",
"0.6511729",
"0.6338376",
"0.6334257",
"0.6270088",
"0.62324846",
"0.62293255",
"0.6196376",
"0.6161916",
"0.6160511",
"0.613893",
"0.6131841",
"0.6127872",
"0.6127872",
"0.6127872",
... | 0.76465845 | 1 |
Asks for the first name, last name, email and hourly wage for a new employee, saving the data to the employees variable. | function addEmployee() {
let id = findNewEmployeeId();
let firstName = prompt.question("First Name: ");
let lastName = prompt.question("Last Name: ");
let email = prompt.questionEMail("Email: ");
let hourlyWage = prompt.questionInt("Hourly Wage: ");
employees.push({
id,
firstName,
lastName,
email,
hour... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function submitNewEmployee() {\n createNewEmployee();\n clearInputFields();\n appendEmloyeeArray();\n calculateTotalSalary();\n}",
"function setEmployees() {\n\tlet csvData = readCsv(EMPLOYEE_FILE);\n\tfor(var i = 0; i < csvData.length; i++) {\n\t\temployees.push({\n\t\t\tid: csvData[i][0],\n\t\t\tfi... | [
"0.70700675",
"0.68909585",
"0.68107915",
"0.67175716",
"0.6676222",
"0.6637184",
"0.6545055",
"0.6515495",
"0.64712745",
"0.64204776",
"0.6387482",
"0.6385797",
"0.63852835",
"0.63647324",
"0.6344634",
"0.6342207",
"0.6334425",
"0.63334304",
"0.63319343",
"0.62406933",
"0.62... | 0.7337414 | 0 |
Asks for an employee id and then removes that employee from the employees variable. | function removeEmployee() {
console.log('--------------------------------------------');
outputEmployeeDetails();
let selectedEmployee = prompt.questionInt('\nEmployee ID: ');
let employee = employees.find(emp => Number(emp.id) == selectedEmployee);
if(employee == undefined) {
console.log('Employee ID invalid. ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function removeEmployee() {\n inquirer.prompt([\n { name: \"id\", message: \"What is the employee's id number?\", type: \"input\" }\n ]).then((answer) => {\n connection.query(`DELETE FROM employee WHERE ?`,\n {\n id: answer.id\n },\n (err) => {\n ... | [
"0.83639777",
"0.79515076",
"0.78371066",
"0.78334564",
"0.7747903",
"0.77362865",
"0.7709219",
"0.76958114",
"0.76894057",
"0.7684224",
"0.74126005",
"0.7367422",
"0.7268901",
"0.7211148",
"0.72015595",
"0.7141625",
"0.7065506",
"0.694101",
"0.68871045",
"0.67735505",
"0.675... | 0.8668633 | 0 |
Parse daytime to string. Ex: [8, 30] > '8:30' | function time2string( /**Array */ daytime) {
assert(isNumber(daytime[0]) && isNumber(daytime[1]), 'Invalid arguments in time2string()');
return daytime[0] + ':' + (daytime[1] < 10 ? '0' : '') + daytime[1];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function parseDayAndTime(dayAndTime) {\n var elts = dayAndTime.split(\"\");\n\n var days = {\n \"M\": \"Monday\",\n \"T\": \"Tuesday\",\n \"W\": \"Wednesday\",\n \"R\": \"Thursday\",\n \"F\": \"Friday\",\n \"S\": \"Saturday/Sunday\"\n }\n\n var times = {\n ... | [
"0.67433816",
"0.66326666",
"0.6593559",
"0.6425339",
"0.6388786",
"0.63450277",
"0.627646",
"0.6241814",
"0.6241814",
"0.61966914",
"0.61966914",
"0.61905503",
"0.60105634",
"0.60105634",
"0.6005081",
"0.6002989",
"0.5988781",
"0.5972605",
"0.5918019",
"0.5908384",
"0.587989... | 0.74631965 | 0 |
Disable dragging for element | function disableDraggingFor(element) {
// this works for FireFox and WebKit in future according to http://help.dottoro.com/lhqsqbtn.php
element.draggable = false;
// this works for older web layout engines
element.onmousedown = function(event) {
event.preventDefault();
return false;
};
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function noDragStart() {\n return false;\n}",
"function noDragStart() {\n return false;\n}",
"notPressed(x, y) {\n this.dragging = false\n }",
"function makeUndraggable(element) {\n element.container.draggable = false;\n element.container.ondragstart = undefined;\n }",
"function no... | [
"0.77933097",
"0.77933097",
"0.7654686",
"0.76443285",
"0.7552134",
"0.7437528",
"0.7425605",
"0.7346991",
"0.7251787",
"0.7208822",
"0.7201996",
"0.7145409",
"0.70214605",
"0.7003063",
"0.70027035",
"0.6988617",
"0.6980014",
"0.6939412",
"0.6930716",
"0.69276816",
"0.6923424... | 0.8763229 | 0 |
Draw the calendar (once). | function drawCalendar() {
try {
paper = new Raphael("calendar_canvas", '100%', '100%');
} catch(e) {
if(console) {
console.log(e);
}
}
drawCalendarBackground();
disableDraggingFor(document.getElementById('calendar_canvas'));
$(document.body).addEvent("dragstart", function() {
return false;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"init() {\n document.getElementById(this.calendarId).innerHTML += '<div id=\"loading\">' + this.loadingText + '</div>';\n var t = this;\n t.drawHours();\n t.drawWeekdays();\n t.drawDates();\n t.addNavigationListeners(); \n t.drawReservations();\n t.redrawC... | [
"0.71955496",
"0.70713305",
"0.7017036",
"0.68672836",
"0.6840271",
"0.6832336",
"0.6719701",
"0.6679412",
"0.6580672",
"0.64909595",
"0.64786917",
"0.6460753",
"0.6451954",
"0.6424762",
"0.6388877",
"0.6315354",
"0.6273391",
"0.6270469",
"0.6266505",
"0.6210532",
"0.61417776... | 0.73711884 | 0 |
Set the creep's new target. | function setNewTarget(creep) {
var modified_extension;
var extensionTarget = creep.pos.findClosestByRange(FIND_STRUCTURES, {filter: str => (str.structureType == STRUCTURE_EXTENSION) && (str.energy < str.energyCapacity)});
if (typeof extensionTarget == "undefined") {
creep.memory.target = creep.p... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setTarget(target) {\n this.target = target;\n }",
"setTowerTarget(tower, target) {\n if (target !== undefined) {\n return super.setTowerTarget(tower, target)\n }\n if (tower.target && tower.target.id && this.enemies.byId[tower.target.id]) {\n return tower.setTarget(this.enemies.byId[tower.... | [
"0.689435",
"0.6622014",
"0.66070825",
"0.6514949",
"0.6512465",
"0.6355385",
"0.6221557",
"0.6211309",
"0.6153178",
"0.60638857",
"0.6062399",
"0.5959567",
"0.59303045",
"0.59299266",
"0.57968056",
"0.5790191",
"0.57532614",
"0.5665332",
"0.5622372",
"0.5524426",
"0.54695344... | 0.7246137 | 0 |
Max sum in the array | function maxSum() {
const array = [4, 6, -3, 5, -2, 1];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function maxSum(arr) {\n let cur_max = arr[0];\n let max_so_far = arr[0];\n for (let i in arr) {\n cur_max = Math.max(arr[i], curr_max + arr[i]);\n max_so_far = Math.max(max_so_far, cur_max);\n }\n return max_so_far;\n}",
"function alternativeMaxSum(arr) {\n arr.sort((a, b) => a - ... | [
"0.79587615",
"0.7882176",
"0.7668545",
"0.76643306",
"0.75575155",
"0.75424725",
"0.7474357",
"0.7403314",
"0.74032277",
"0.74018055",
"0.73536205",
"0.73458606",
"0.733912",
"0.7329903",
"0.7329903",
"0.7328786",
"0.73031586",
"0.72859037",
"0.72772527",
"0.7266382",
"0.723... | 0.85247463 | 0 |
function that logs the data into the call log in the spreadsheet | function logData(sheet, date, caller, duration, callNotes, resolutionNotes, callBack, callBackDate) {
sheet.insertRowBefore(20);
sheet.getRange("A20").setValue(date);
sheet.getRange("B20").setValue(caller);
sheet.getRange("C20").setValue(duration);
sheet.getRange("D20:H20").setValue(callNotes);
sheet.getRan... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function logger(log){\n return;\n \n // - try fetching the sheet by name\n var sheetObject = SpreadsheetApp.getActive().getSheetByName(\"DebugLog\");\n \n // - if has no sheet\n if (sheetObject == null) {\n sheetObject = SpreadsheetApp.getActive().insertSheet(\"DebugLog\");\n \n }\n \n // - append ... | [
"0.72204787",
"0.68887705",
"0.68877",
"0.6812282",
"0.6735156",
"0.6717823",
"0.6593695",
"0.6367291",
"0.6214419",
"0.6134424",
"0.6076461",
"0.6064715",
"0.60631096",
"0.6005006",
"0.5929494",
"0.59234893",
"0.5921967",
"0.5914048",
"0.5904103",
"0.5901238",
"0.5886574",
... | 0.7828464 | 0 |
function that populates cell B13 with the value 'yes' when run | function onClickYes() {
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
// update information in cell B13 to yes
sheet.getRange("B13").setValue('yes');
// allow the use of the calendar
sheet.getRange("B14").setBackground(null);
sheet.getRange("B14").setValue("select date");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function myFunction() {\n var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(\"Respuestas\");\n var value = sheet.getRange(sheet.getLastRow(), 14).getValue();\n if(value == 'Agua residual tratamiento/Wastewater treatment'){\n sheet.setActiveRange(sheet.getRange(sheet.getLastRow(), 21)).setValue... | [
"0.61702704",
"0.6025758",
"0.5920587",
"0.5845759",
"0.58204854",
"0.56389046",
"0.56085354",
"0.5607097",
"0.5601381",
"0.5581333",
"0.5527495",
"0.5473366",
"0.54724765",
"0.546809",
"0.546809",
"0.5445533",
"0.54019916",
"0.5391472",
"0.5373581",
"0.5357853",
"0.5357853",... | 0.65627474 | 0 |
function that populates cell B13 with the value 'no' when run | function onClickNo() {
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
// update information in cell B13 to no
sheet.getRange("B13").setValue('no');
// dissallow the use of the calendar
sheet.getRange("B14").setBackground('Grey');
sheet.getRange("B14").setValue("call back not selec... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onClickYes() {\n var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();\n \n // update information in cell B13 to yes\n sheet.getRange(\"B13\").setValue('yes');\n \n // allow the use of the calendar\n sheet.getRange(\"B14\").setBackground(null);\n sheet.getRange(\"B14\").setValue(\"se... | [
"0.57166207",
"0.5679675",
"0.5603662",
"0.5462435",
"0.54386437",
"0.5420212",
"0.54011106",
"0.5342055",
"0.5327353",
"0.52852154",
"0.5267119",
"0.5162464",
"0.51609695",
"0.51129305",
"0.5100007",
"0.5098904",
"0.5054318",
"0.5043797",
"0.50423676",
"0.50339776",
"0.50118... | 0.6403364 | 0 |
Adds a reset to the master timeline. | _addReset() {
const tl = this.timeline;
tl.set(this._bgRect.node, { drawSVG: '0%', 'fill-opacity': 0 });
tl.set(this.$.label, { scaleX: 0, color: 'transparent', clipPath: '' });
tl.call(this.$.tweet._addReset, undefined, this.$.tweet);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"reset() {\n this.timeline.reset.apply(this.timeline, arguments);\n return this;\n }",
"reset () {\n this.timeline.reset.apply( this.timeline, arguments );\n return this;\n }",
"function reset() {}",
"function reset(){}",
"function reset() {\n setTime(30);\n setIsActive(false);\n }",
... | [
"0.66486454",
"0.6633295",
"0.6024589",
"0.60026294",
"0.5880154",
"0.5847417",
"0.5847417",
"0.5847417",
"0.5801165",
"0.57822704",
"0.57219064",
"0.5699668",
"0.56572104",
"0.56514484",
"0.5631687",
"0.5610092",
"0.5610092",
"0.5605673",
"0.5584712",
"0.5561084",
"0.556005"... | 0.6861819 | 0 |
Creates an exit animation timeline. | _createExitAnim() {
const tl = new TimelineLite();
tl.add('exit');
tl.to(this._bgRect.node, 0.5, {
'fill-opacity': 0,
ease: Sine.easeOut
}, 'exit');
tl.to(this._bgRect.node, 1.5, {
drawSVG: '0%',
ease: Power2.easeIn
}, 'exit... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function animateOut() {\n return timeline([\n {\n track: 'modal',\n to: {opacity: 0, scale: 0.9, y: '3rem'},\n from: {opacity: 1, scale: 1, y: '0rem'},\n duration: 200,\n ease: easing.easeOut,\n },\n '-100',\n {\n track: 'scrim',\n from: {opacity: 1},\n to: {opa... | [
"0.6962266",
"0.62466145",
"0.59754485",
"0.5598517",
"0.5597063",
"0.55704826",
"0.55560315",
"0.5485349",
"0.54176",
"0.53704435",
"0.53160816",
"0.52903587",
"0.52854323",
"0.5249321",
"0.52222747",
"0.5191636",
"0.51915854",
"0.518022",
"0.51678205",
"0.51488996",
"0.5147... | 0.7942597 | 0 |
clear the radius,volume and canvas | function onClear() {
document.getElementById("radius").value = "";
document.querySelector(".volume").innerHTML = "Calculates the Volume...";
ctx.beginPath();
ctx.clearRect(0, 0, 300, 300);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"clear() { this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height); }",
"function clearCanvas() {\n\t}",
"clearCircle(center, radius) {\n this.ctx.save();\n this.ctx.globalCompositeOperation = 'destination-out';\n this.ctx.beginPath();\n this.ctx.arc(center.x,... | [
"0.7122396",
"0.71146774",
"0.7110031",
"0.7080268",
"0.7079772",
"0.7057169",
"0.70450073",
"0.7028832",
"0.7014813",
"0.7013211",
"0.7011248",
"0.6997983",
"0.69823134",
"0.6964222",
"0.69482076",
"0.6881215",
"0.68727416",
"0.6865544",
"0.6849",
"0.68155205",
"0.6813576",
... | 0.80103886 | 0 |
Get the information of a specific show | static async getShowInfo(showNumber){
const showResponse = await fetch(`http://api.tvmaze.com/shows/${showNumber}`);
const showData = await showResponse.json();
return showData;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async getShowDetails ( { commit, state }, id )\n\t{\n\t\tcommit( 'SET_SHOW_ID', id )\t\t\t\t\n\t\tconst res = await tvShowsServices.getRequestDetails(\n\t\t\t'/shows/' + state.showId )\t\t\n\t\tif ( res.data )\n\t\t{\t\t\t\n\t\t\tcommit( 'SET_IS_VALID_ID', true )\n\t\t\tcommit( 'SET_SHOW_DETAILS', res.data );\n\t\... | [
"0.7307014",
"0.68623537",
"0.66413784",
"0.6525289",
"0.6523838",
"0.64646757",
"0.64368844",
"0.64368844",
"0.64368844",
"0.64368844",
"0.64368844",
"0.64368844",
"0.6422969",
"0.640647",
"0.640647",
"0.6397187",
"0.63463986",
"0.63048315",
"0.6285951",
"0.62838846",
"0.626... | 0.7142503 | 1 |
Call to update the tank by checking movement, collision and firing | update(){
// Rotate the tank if it currently has a rotation speed
this.rotate();
if(this.moving){
this.move();
// Check collision
let collision = checkCollisions(this);
if(collision.colliding){
// Revert move
this.move(-1);
// Alert the user of a coll... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function update() {\r\n\t// if(input.isDown())\r\n\t// update the frame count\r\n\tframes++;\r\n\t\r\n\t// update tank position depending on pressed keys\r\n\tif (input.isDown(37)) { // Left\r\n\t\ttank.x -= 4;\r\n\t}\r\n\tif (input.isDown(39)) { // Right\r\n\t\ttank.x += 4;\r\n\t}\r\n\tif(input1.isDown(65)) { //L... | [
"0.6939964",
"0.67906034",
"0.6733706",
"0.671663",
"0.67082286",
"0.67050236",
"0.66832983",
"0.66646653",
"0.66596305",
"0.6654068",
"0.66005886",
"0.658824",
"0.6572592",
"0.65694284",
"0.654105",
"0.6527926",
"0.652132",
"0.6518753",
"0.64736015",
"0.6466151",
"0.6450213"... | 0.8118924 | 0 |
Call to rotate the tank with its turningSpeed | rotate(){
this.angle += this.turningSpeed;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function changeRotationDirection() {\n rotationSpeed = -rotationSpeed;\n}",
"function Update () {\n\t//Rotiert um die Rotation Speed in Echtzeit\n\ttransform.Rotate (0.0f, rotateSpeed*Time.deltaTime, 0.0f);\n}",
"function TurtleTurn(angle) {\n turtle.a += angle; // svg uses anti-clockwise but we want cl... | [
"0.7271589",
"0.6997725",
"0.6936559",
"0.68122375",
"0.67627",
"0.6705555",
"0.6684365",
"0.6598149",
"0.65428036",
"0.65403044",
"0.6530011",
"0.6495075",
"0.64848685",
"0.64549565",
"0.6419079",
"0.64176047",
"0.6405081",
"0.6396024",
"0.6388298",
"0.63851595",
"0.63731545... | 0.77516055 | 0 |
Call to respawn tank | respawn(){
// Vibrate the user's phone to indicate its death
vibrateUser(this.id, 500);
// Calculate a new spawnpoint and assign it
let newspawn = newSpawnpoint();
this.x = newspawn.x;
this.y = newspawn.y;
this.angle = newspawn.angle;
// Reset everything else
this.moving = false;
t... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"respawn() {\n this.state = new CreatureState(this, this.gameEngine, this.getDefaultMaxHealth());\n this.position.x = this.spawnX;\n this.position.y = this.spawnY;\n this.velocity.x = 0;\n this.velocity.y = 0;\n }",
"function handelDeath( yes ) {\n if( yes ) { //respawn from nearest cam... | [
"0.6211061",
"0.5837684",
"0.57725304",
"0.56855625",
"0.5656597",
"0.56466365",
"0.5628008",
"0.55790925",
"0.5516154",
"0.5509695",
"0.5494012",
"0.54748064",
"0.5469703",
"0.5468253",
"0.54681754",
"0.5455974",
"0.54552823",
"0.54552823",
"0.5448233",
"0.54419255",
"0.5435... | 0.7293473 | 0 |
Call to fire a projectile | fire(){
// Calculate the origin of the projectile based on the tank's pipe
let px = this.x + (this.w / 2) + (cos(-this.angle) * 10) + 4;
let py = this.y + (this.h / 2) + (sin(-this.angle) * 15);
// Spawn a projectile
this.projectiles.push(new Projectile(px, py, this.angle, this));
this.firingCoo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"fireProjectile () {\n this.gameObjectsGroup.projectilesGroup.spawn(this.sprite.x, this.sprite.y, this.sprite.angle);\n }",
"fire(x, y, scene, pointer) {\n // displays the projectile\n this.body.reset(x, y)\n this.setActive(true)\n this.setVisible(true)\n \n thi... | [
"0.77957875",
"0.7091245",
"0.69315416",
"0.6596553",
"0.6539098",
"0.6496126",
"0.64751554",
"0.6463797",
"0.6458848",
"0.6417896",
"0.6364606",
"0.6340049",
"0.63023305",
"0.6282061",
"0.6262579",
"0.62603843",
"0.6177524",
"0.61766654",
"0.61766654",
"0.6165898",
"0.614755... | 0.7781981 | 1 |
Adicionar un servicio qu presta | function adicionarServicio(apl) {
if (regServPresta.getForm().isValid()) {
regServPresta.getForm().submit({
url: 'insertarservicio',
waitMsg: perfil.etiquetas.lbMsgEsperaRegServ,
params: {idsistema: arbolServ.getSelectionModel().getSelectedNod... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"addServicio(){\n\t\t\tif(this.get('addNewServicio')) {\n\t\t\t\tthis.set('addNewServicio', false)\n\t\t\t} else {\n\t\t\t\tthis.set('addNewServicio', true)\n\t\t\t}\n\t\t}",
"registerService(service) {\n this.services.push(service);\n }",
"function addTempService(faceId, serviceId) {\n ... | [
"0.70349646",
"0.6497937",
"0.6412341",
"0.63957417",
"0.61807615",
"0.6089338",
"0.6018023",
"0.59645915",
"0.5893071",
"0.5889909",
"0.58460647",
"0.5816108",
"0.5773784",
"0.57416844",
"0.5737744",
"0.572951",
"0.5710991",
"0.57005084",
"0.5670962",
"0.56590587",
"0.562705... | 0.67210513 | 1 |
Eliminar un servicio qu presta | function eliminarServicio() {
mostrarMensaje(2, perfil.etiquetas.lbMsgDeseaEliminar, elimina);
function elimina(btnPresionado) {
if (btnPresionado == 'ok') {
Ext.Ajax.request({
url: 'eliminarservicio',
method: 'POST',
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function eliminarServicioLocalStorage(servicio){\n let serviciosLS;\n // obtenemos el arreglo de servicios\n serviciosLS = obtenerServiciosLocalStorage();\n // iteramos comparando el ID del servicio con los del LS\n serviciosLS.forEach(function(servicioLS, index){\n if(servicioLS.id === servi... | [
"0.71138006",
"0.70236236",
"0.6882087",
"0.68239105",
"0.6820071",
"0.6728283",
"0.67099303",
"0.6703508",
"0.66938317",
"0.6648827",
"0.66248053",
"0.66029334",
"0.6571089",
"0.654071",
"0.6510583",
"0.6456987",
"0.64400053",
"0.6411762",
"0.64049745",
"0.6401741",
"0.63896... | 0.7070905 | 1 |
infinite slider only works with 3+ slides, so if less than 3 we need to duplicate | function duplicateSlides(slider, slides) {
if(slides.length < 3) {
// Duplicate slider content
slider.append(slider.html());
// Re count slides
var slidesRecount = jQuery('.slider .slider__slide');
// Recursive function until more than 3 slides
duplicateSlides(slider, slidesRecount);
} else ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function slide_carousel() {\n var site_width = jQuery(window).width(),\n site_height = jQuery(window).height(),\n sliderList = jQuery('.pm_gallery.effect_slide'),\n slide_item = jQuery(sliderList).find('li');\n slide_item.width(site_width - 80);\n var increment = jQuery(sliderList).children().out... | [
"0.7095931",
"0.69714695",
"0.68233114",
"0.6769172",
"0.6725968",
"0.6718358",
"0.6696815",
"0.6696815",
"0.6674874",
"0.6654848",
"0.6640396",
"0.6624667",
"0.6620997",
"0.6581502",
"0.6560405",
"0.65543944",
"0.65497243",
"0.65387833",
"0.65345144",
"0.6532842",
"0.6522504... | 0.7266895 | 0 |
Construct an instance of Tri2DInfo, you can either pass null to a, b and c and the instance will be allocated "clear", or give actual triangle info and the center/radius will be computed | function Tri2DInfo(a, b, c) {
if (a === null && b === null && c === null) {
this.a = BABYLON.Vector2.Zero();
this.b = BABYLON.Vector2.Zero();
this.c = BABYLON.Vector2.Zero();
this.center = BABYLON.Vector2.Zero();
this.radius = 0... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Triangle(base, lato1, lato2){\n\tthis.base = base;\n\tthis.lato1 = lato1;\n\tthis.lato2 = lato2;\n}",
"function Triangle(cateto1,cateto2,ipotenusa){\n\tthis.cateto1 = cateto1;\n\tthis.cateto2 = cateto2;\n\tthis.ipotenusa = ipotenusa;\n}",
"constructor(a, b, c, color, normalA, normalB, normalC) {\n\n ... | [
"0.6091806",
"0.59719497",
"0.593979",
"0.58621716",
"0.56427634",
"0.55245465",
"0.5521736",
"0.548732",
"0.548732",
"0.548732",
"0.54677004",
"0.54653597",
"0.5454679",
"0.5436464",
"0.5375392",
"0.536829",
"0.53450286",
"0.53385115",
"0.5336885",
"0.53142023",
"0.5300683",... | 0.8638009 | 0 |
Create a new instance of the FontTexture class | function FontTexture(name, font, scene, maxCharCount, samplingMode, superSample, signedDistanceField) {
if (maxCharCount === void 0) { maxCharCount = 200; }
if (samplingMode === void 0) { samplingMode = BABYLON.Texture.TRILINEAR_SAMPLINGMODE; }
if (superSample === void 0) { superSamp... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function FontTexture(name, font, scene, maxCharCount, samplingMode, superSample, signedDistanceField) {\n if (maxCharCount === void 0) { maxCharCount = 200; }\n if (samplingMode === void 0) { samplingMode = BABYLON.Texture.TRILINEAR_SAMPLINGMODE; }\n if (superSample === void 0) { s... | [
"0.7482161",
"0.73678553",
"0.7165617",
"0.7147427",
"0.6987609",
"0.6833418",
"0.67857116",
"0.6765549",
"0.6721022",
"0.66958845",
"0.66625774",
"0.66583985",
"0.6651396",
"0.66148245",
"0.65469986",
"0.6533586",
"0.65244186",
"0.64643025",
"0.6458663",
"0.6425966",
"0.6403... | 0.75199157 | 0 |
Construct a WireFrameGroup2D object | function WireFrameGroup2D(id, defaultColor) {
if (id === void 0) { id = null; }
if (defaultColor === void 0) { defaultColor = null; }
this._id = (id == null) ? BABYLON.Tools.RandomId() : id;
this._uid = BABYLON.Tools.RandomId();
this._defaultColor = (defaultCo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function WireFrame2D(wireFrameGroups, settings) {\n var _this = this;\n if (!settings) {\n settings = {};\n }\n _this = _super.call(this, settings) || this;\n _this._wireFrameGroups = new BABYLON.StringDictionary();\n for (var _i = 0,... | [
"0.74495625",
"0.6265473",
"0.5944891",
"0.5894844",
"0.5858623",
"0.5729615",
"0.5725358",
"0.5231564",
"0.5230764",
"0.52303684",
"0.52231187",
"0.52165115",
"0.5191939",
"0.5152477",
"0.51376414",
"0.50719154",
"0.50400424",
"0.5020096",
"0.49820948",
"0.49797887",
"0.4975... | 0.7377141 | 1 |
Create an 2D Lines Shape primitive. The defined lines may be opened or closed (see below) | function Lines2D(points, settings) {
var _this = this;
if (!settings) {
settings = {};
}
_this = _super.call(this, settings) || this;
_this._fillVB = null;
_this._fillIB = null;
_this._borderVB = null;
_this.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"createLines() {\n stroke(this.stroke);\n strokeWeight(this.strokeWeight);\n fill(this.color);\n ellipse(this.head_x, this.head_y, 50);\n ellipse(this.eye_x, this.eye_y, 15);\n line(this.x, this.y, this.head_x, this.head_y);\n\n }",
"function Lines(){}",
"function cr... | [
"0.701058",
"0.6726683",
"0.66893303",
"0.6530985",
"0.649167",
"0.649167",
"0.649167",
"0.6411638",
"0.638956",
"0.6389251",
"0.6370789",
"0.6341706",
"0.63241094",
"0.63241094",
"0.62645364",
"0.6252093",
"0.6245384",
"0.6244473",
"0.6229703",
"0.614161",
"0.61414486",
"0... | 0.6948523 | 1 |
Create a new 2D WorldSpace Rendering Canvas, it is a 2D rectangle that has a size (width/height) and a world transformation information to place it in the world space. This kind of canvas can't have its Primitives directly drawn in the Viewport, they need to be cached in a bitmap at some point, as a consequence the DON... | function WorldSpaceCanvas2D(scene, size, settings) {
var _this = this;
BABYLON.Prim2DBase._isCanvasInit = true;
var s = settings;
s.isScreenSpace = false;
if (settings.unitScaleFactor != null) {
s.size = size.multiplyByFloats(settings.unitScale... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"createCanvas() {\n const canvas = this.bGMap.createCanvas(this.id);\n\n /**\n * @type {Object} _webgl - WebGL object. Init webgl properties\n * @property {WebGLRenderingContext} _webgl.gl - The WebGLRenderingContext to be used.\n * @property {WebGLProgram} _webgl.program - ... | [
"0.6654555",
"0.6387135",
"0.62271255",
"0.62271255",
"0.60870016",
"0.6048239",
"0.59847337",
"0.5925782",
"0.57963586",
"0.57728875",
"0.5759807",
"0.57407415",
"0.57108516",
"0.5636972",
"0.56345516",
"0.5631851",
"0.5630428",
"0.5618284",
"0.5602033",
"0.55960655",
"0.559... | 0.76380646 | 0 |
Create a new 2D ScreenSpace Rendering Canvas, it is a 2D rectangle that has a size (width/height) and a position relative to the bottom/left corner of the screen. ScreenSpace Canvas will be drawn in the Viewport as a 2D Layer lying to the top of the 3D Scene. Typically used for traditional UI. All caching strategies wi... | function ScreenSpaceCanvas2D(scene, settings) {
var _this = this;
BABYLON.Prim2DBase._isCanvasInit = true;
_this = _super.call(this, scene, settings) || this;
return _this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function WorldSpaceCanvas2D(scene, size, settings) {\n var _this = this;\n BABYLON.Prim2DBase._isCanvasInit = true;\n var s = settings;\n s.isScreenSpace = false;\n if (settings.unitScaleFactor != null) {\n s.size = size.multiplyByFloats(setting... | [
"0.6580784",
"0.63275576",
"0.6192251",
"0.61601263",
"0.6120177",
"0.6085641",
"0.6079565",
"0.60681146",
"0.6064712",
"0.60522974",
"0.6024036",
"0.5948543",
"0.59427124",
"0.59239095",
"0.5892803",
"0.5880003",
"0.5843403",
"0.5839106",
"0.5814356",
"0.57947123",
"0.579258... | 0.7532558 | 0 |
Traverse tree and make visible only needed meshes | function makeVisibleMeshes(object, checker) {
if (object && object.traverse) {
object.traverse((obj) => {
if (obj instanceof THREE.Mesh) {
obj.visible = checker(obj);
}
});
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function makeVisible(mesh){\r\n var children = mesh.getChildMeshes();\r\n mesh.isVisible = true;\r\n for (var i = 0, len = children.length; i < len; i++) {\r\n children[i].isVisible = true;\r\n }\r\n }",
"function makeVisible(mesh){\r\n var children = mesh.getChil... | [
"0.650075",
"0.650075",
"0.650075",
"0.60602695",
"0.6041239",
"0.5966542",
"0.5869482",
"0.5647776",
"0.5621197",
"0.5609314",
"0.55820805",
"0.5558085",
"0.5527385",
"0.55081284",
"0.54752636",
"0.5460541",
"0.5450856",
"0.5432929",
"0.5417923",
"0.54133844",
"0.54021364",
... | 0.6588245 | 0 |
...................................fetching data from timezones.allTimeZones................................... | function all_city_data() {
var all_city = timezones.allTimeZones()
process.send(all_city)
process.exit()
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getTimezone () {\n let opts = { \n 'pageSize': 1000,\n 'pageNumber': 1\n };\n\n telephonyProvidersEdgeApi.getTelephonyProvidersEdgesTimezones(opts)\n .then((data) => {\n let timezone = data.entities;\n timezone.forEach(addTimezoneToSelect);\n })\n .catch((err) => {\n console.log('There wa... | [
"0.74123484",
"0.6824664",
"0.65279114",
"0.6332223",
"0.6302334",
"0.6249967",
"0.6223362",
"0.6193533",
"0.60745037",
"0.602877",
"0.595395",
"0.5923163",
"0.5923163",
"0.5823316",
"0.57803667",
"0.5766893",
"0.5738937",
"0.56979984",
"0.56973153",
"0.56712854",
"0.56580997... | 0.6850194 | 1 |
...................................fetching data from timezones.timeForOneCity................................... | function get_city_data(city) {
var city_data = timezones.timeForOneCity(city)
process.send(city_data)
process.exit()
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function lookupTimezones(cityN) {\n /*\n var myUrl;\n switch (cityN) {\n\n //If its london----------------------------------------------------------------\n case 'London':\n myUrl= 'http://api.timezonedb.com/v2/get-time-zone?key=BGC297R9GDMR&format=json&by=zone&zone=Europe/London';\n ... | [
"0.70274866",
"0.69701564",
"0.6771241",
"0.6597231",
"0.61396354",
"0.5962474",
"0.590981",
"0.5865134",
"0.5855035",
"0.5828331",
"0.5785521",
"0.57737494",
"0.57648915",
"0.5760151",
"0.5753902",
"0.5735601",
"0.570362",
"0.56397593",
"0.56142706",
"0.55930305",
"0.5577887... | 0.70345205 | 0 |
.......................fetching data from timezones.allTimeZones and nextNhoursWeather............................ | function next_weather_data(ctdn, hrs) {
var all_city = timezones.allTimeZones()
var hours = timezones.nextNhoursWeather(ctdn, hrs, all_city)
process.send(hours)
process.exit()
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getTimezone () {\n let opts = { \n 'pageSize': 1000,\n 'pageNumber': 1\n };\n\n telephonyProvidersEdgeApi.getTelephonyProvidersEdgesTimezones(opts)\n .then((data) => {\n let timezone = data.entities;\n timezone.forEach(addTimezoneToSelect);\n })\n .catch((err) => {\n console.log('There wa... | [
"0.6899908",
"0.6882605",
"0.6534397",
"0.63125616",
"0.6287536",
"0.61826557",
"0.61163193",
"0.60600704",
"0.6045612",
"0.60342085",
"0.6034115",
"0.6025975",
"0.6017806",
"0.60151064",
"0.5990498",
"0.598306",
"0.5975896",
"0.5961549",
"0.5955626",
"0.59231037",
"0.5912302... | 0.689791 | 1 |
ProcessState is responsible for keeping process related state. Certain probes are regularly updating the state. | function ProcessState(agent) {
this.agent = agent;
this.bytesRead = 0;
this.bytesWritten = 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"process() {\r\n //stateAttributes must have been set by call to computeScalarStates\r\n this.attributes = this.state.devState.stateAttributes.split(\",\");\r\n this.savedAttributes = this.getLocalAttribute(\"savedAttributes\");\r\n if (!this.savedAttributes) this.savedAttributes = [];\r\n if (!this.... | [
"0.59684765",
"0.580765",
"0.57068855",
"0.5695865",
"0.56459796",
"0.5558699",
"0.5558699",
"0.5558699",
"0.55393535",
"0.54576117",
"0.5454095",
"0.54407346",
"0.54221845",
"0.54221845",
"0.5394893",
"0.5385489",
"0.53741056",
"0.5362265",
"0.5334524",
"0.53296536",
"0.5325... | 0.73499566 | 0 |
Get the component with specified class and base name | getComponent(klass, baseName) {
const component = _.find(this.components, (c) => {
return (c instanceof klass) && c.baseName == baseName;
})
return component;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getComponent(name){\n\t\tfor(let component of this.components){\n\t\t\tif(component.constructor.name == name)\n\t\t\t\treturn component;\n\t\t}\n\t\t//If we didn't find it, search any children we have\n\t\tfor(let child of this.children){\n\t\t\tlet component = child.getComponent(name);\n\t\t\tif(component) return... | [
"0.71207714",
"0.67850626",
"0.66684514",
"0.6628898",
"0.63930124",
"0.6344684",
"0.6259778",
"0.6195836",
"0.6188117",
"0.61708695",
"0.5992314",
"0.5922367",
"0.59094685",
"0.58856493",
"0.5830801",
"0.5730385",
"0.566933",
"0.5600672",
"0.55656266",
"0.55656266",
"0.55656... | 0.8546157 | 0 |
eg: The Stanton measure of [1, 4, 3, 2, 1, 2, 3, 2] is 3 because 1 occurs 2 times in the array and 2 occurs 3 times. Write a function stantonMeasure/StantonMeasure which takes an integer array and returns its Stanton measure. / function: stantonMeasure input: integer array output: stanton measure of the array | function stantonMeasure(arr){
var number = 0;
var answer = 0;
for (var i = 0; i < arr.length; i++){
if(arr[i] === 1 ){
number ++;
}
}
for(var j = 0; j < arr.length; j++){
if(arr[j] === number){
answer ++;
}
}
return answer;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function stantonMeasure(arr) {\n let n = arr.filter(a=>a===1).length;\n return arr.filter(a=>a===n).length;\n}",
"function stantonMeasure(arr) {\n return arr.filter(a=>a===arr.filter(a=>a===1).length).length;\n}",
"function stanDeviate(arr){\n var meanOfOrg = (arr.reduce(function(l,r){return l+r;}))/arr.... | [
"0.7704051",
"0.7616463",
"0.6020489",
"0.59281343",
"0.5906624",
"0.5889507",
"0.58173496",
"0.5742107",
"0.56053865",
"0.55331486",
"0.5498617",
"0.5455393",
"0.5447202",
"0.5439379",
"0.5439379",
"0.54257333",
"0.5414083",
"0.5384884",
"0.538185",
"0.5375504",
"0.5375504",... | 0.7958783 | 0 |
still working on it.... dont worry about this one... remove the polling intervals on a given i2cQueue | function clearPolls(i2cQueue) {
console.log('in clear polls for bus: '+i2cQueue.getBusNumber());
console.log('current active interval ids: ', Object.keys(_pollIds));
for (var intervalId in _pollIds) {
if (_pollIds[intervalId] === i2cQueue.getBusNumber()) {
console.log('clear hit');
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"clearOutQueue() {\n if (this.queue == null) {\n clearInterval(this.intervalHandler);\n } else if (this.queue.expectedAt < Date.now()) {\n let temp = this.queue;\n this.queue = temp.next;\n temp.next = null;\n this.count--;\n }\n }",
"_clean () {\n const queues = Object.value... | [
"0.67017174",
"0.66170037",
"0.6446916",
"0.64462495",
"0.62762064",
"0.61542034",
"0.6102532",
"0.6098445",
"0.6083377",
"0.60793847",
"0.60670954",
"0.60625",
"0.60625",
"0.60625",
"0.60625",
"0.6040644",
"0.5960726",
"0.5915781",
"0.5913964",
"0.5913964",
"0.5913964",
"0... | 0.76895285 | 0 |
Controller for toBuyList operations | function ToBuyController(ShoppingListsService) {
var toBuy = this;
toBuy.getToBuyList = function functionName() {
return ShoppingListsService.getToBuyList();
};
toBuy.setItemBought = function(index) {
ShoppingListsService.setItemBought(index);
};
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getPurchasesListingAction(params) {\n const action = {\n type: ApiConstants.API_GET_PURCHASES_LISTING_LOAD,\n params,\n };\n return action;\n}",
"function listTransactions() {\n // Render the template\n ISML.renderTemplate('transactions/list');\n}",
"function listAction(request, respons... | [
"0.6141911",
"0.61204714",
"0.61053926",
"0.6006504",
"0.59730804",
"0.59261787",
"0.58732516",
"0.57969713",
"0.5719631",
"0.5681086",
"0.56512636",
"0.56393844",
"0.56391513",
"0.5628379",
"0.56281585",
"0.5579075",
"0.553555",
"0.55200267",
"0.55018234",
"0.5471585",
"0.54... | 0.73389655 | 0 |
Controller for AlreadyboughtList operations | function AlreadyBoughtController(ShoppingListsService) {
var albou = this;
albou.getAlreadyList = function functionName() {
return ShoppingListsService.getAlreadyList();
};
albou.isEmptyList = function() {
return ShoppingListsService.getAlreadyList().length == 0;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function listAction(request, response) {\n model.getAll(request.userId).then(\n bookings => {\n if(bookings.length < 1){\n response.status(200).json({message:\"keine Buchungen vorhanden\"});\n }\n else{\n response.status(200).json(bookings);\n }\n },\n error => respons... | [
"0.6517936",
"0.64162314",
"0.64162314",
"0.6340543",
"0.6236118",
"0.6077065",
"0.5945623",
"0.5909195",
"0.5903696",
"0.5901167",
"0.5857137",
"0.5841116",
"0.5811142",
"0.5801406",
"0.57809806",
"0.5772753",
"0.5748415",
"0.57297343",
"0.57218754",
"0.5716855",
"0.57157224... | 0.697672 | 0 |
Get the minutes the user enters in the input field | function getMinutes(event) {
// Prevent the page to update when the mins are submitted
event.preventDefault();
// console.log(this.minutes.value);
// Save the input value in a variable
const mins = this.minutes.value;
// Change mins to seconds and use the input value in the function to set the timer
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function minutes () {\n let minute=parseInt(prompt(\"enter number of minutes\"));\n let second=minute*60;\n console.log(second);\n}",
"function calculateMinutes(minutes){\n var minutesFromMinutes = minutes.split(\"min\")\n return minutesFromMinutes[0]\n }",
"sanitizeMinutes(e) {\n let mi... | [
"0.73578656",
"0.7203445",
"0.7075389",
"0.68035567",
"0.676812",
"0.6687088",
"0.6676536",
"0.6676415",
"0.6477413",
"0.642947",
"0.6423358",
"0.63419926",
"0.6311858",
"0.62572855",
"0.6233581",
"0.62334466",
"0.62266695",
"0.62047195",
"0.62047195",
"0.6181648",
"0.6180695... | 0.8170429 | 0 |
Adds a message to the message registry. | function addMessageToRegistry(messageId) {
var found = false
for (var i = 0; i < messageRegistry.length; i++) {
if (messageRegistry[i] === messageId) {
found = true
break
}
}
if (!found) {
messageRegistry.push(messageId)
buildAndShowMessageBar(messageId, "messagebar_register")
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addMessage(message) {\n self.messages.push(message);\n }",
"function addMessage(message) {\n var text = message.content ? message.content.code.trim() : '';\n if (!text) {\n return;\n }\n\n message.content.code = text;\n _messages.push(message);\n\n // If there is no message al... | [
"0.7756207",
"0.7193801",
"0.6656581",
"0.66377217",
"0.6581155",
"0.65675676",
"0.655871",
"0.6511005",
"0.64611125",
"0.6458658",
"0.6329502",
"0.61966276",
"0.61813605",
"0.6132389",
"0.6129137",
"0.61154133",
"0.60857195",
"0.6002693",
"0.60007447",
"0.59915364",
"0.59797... | 0.7424487 | 1 |
Checks if the message registry is empty. | function isMessageRegistryEmpty() {
if ((messageRegistry.length === 1 && messageRegistry[0] === "WRN_INPUT_PASSWORD") || messageRegistry.length === 0) {
return true
} else {
return false
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isEmpty() {\n\t\treturn messages.length == 0;\n \t}",
"function checkIsEmpty() {\n if (this.isEmpty()) this.set_msg_empty();\n}",
"function isEmpty() {\n return _.isEmpty(modelSubscribersByType);\n }",
"function isEmpty() {\n return Object.keys(this.value()).length === 0;\n}",
"func... | [
"0.7520145",
"0.73215955",
"0.6601768",
"0.6558132",
"0.6558132",
"0.64924145",
"0.6420497",
"0.63648695",
"0.63263255",
"0.6317788",
"0.6309287",
"0.6307014",
"0.6270835",
"0.6270835",
"0.6260009",
"0.6255162",
"0.6254462",
"0.62402946",
"0.6236229",
"0.6236229",
"0.6206832"... | 0.83277506 | 0 |
====================================================================================// ================================== MAIN FUNCTIONS ==================================// ====================================================================================// Determines the register container style for responsiveness. | function determineContainerStyle() {
if ($(window).height() < "555") {
if ($("#register_container").hasClass("container_free")) {
$("#register_container").removeClass("container_free")
}
$("#register_container").addClass("container_fitting")
} else if ($(window).height() >= "555" && $(window).height() ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_builContainerStyle() {\n const { position } = this.props;\n // Depending on the chosen position we use a margin of 32 pixels from the\n // corresponding side.\n return {\n ...NotificationContainer.STYLE.container,\n bottom: position.indexOf('bottom') !== -1 && 32,... | [
"0.62551",
"0.5942364",
"0.5837674",
"0.5763219",
"0.5734829",
"0.56915724",
"0.56620973",
"0.5639743",
"0.5591183",
"0.5495324",
"0.5495324",
"0.5495324",
"0.5495324",
"0.54875153",
"0.5480891",
"0.54311204",
"0.5409652",
"0.536091",
"0.5356015",
"0.5344911",
"0.53382206",
... | 0.70130396 | 0 |
The paths config to use when compiling your react app for development or production. | paths(paths, env) {
// if (env === 'production') {
// const dirName = __dirname.replace('/src/Client', '');
// paths.appBuild = `${dirName}/public/dist`;
// }
return paths;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"bindPaths() {\n Object.entries(this.resolvePaths()).forEach(([key, value]) => {\n const name = this.stringHelper.singular(key);\n this.app.configurePaths({\n [name]: value\n });\n });\n Object.entries(this.resolveSourcePaths()).forEach(([key, value]) => {\n const name = this.str... | [
"0.63037205",
"0.6021101",
"0.5852944",
"0.58106655",
"0.5761457",
"0.5705637",
"0.5623962",
"0.56005895",
"0.5573901",
"0.55706507",
"0.55180603",
"0.5483755",
"0.5449212",
"0.5429339",
"0.54280347",
"0.54251844",
"0.54243994",
"0.5409194",
"0.53941864",
"0.53737104",
"0.535... | 0.8001737 | 0 |
Variabes var recipeJson; init | function init() {
'use strict';
//recipeJson = localStorage.getItem('recipeJson');
loadRecipe();
} // end init | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createRecipeObject() {\n let addRecipeDataObj = {\n title: $addRecipeTitle.val(),\n recipeDescription: $addRecipeText.val(),\n // TODO need to find the google service that will turn pic file uploads to urls\n file: $addRecipeFile.val(),\n personName: $addRecipeName.val(),\n ... | [
"0.6471491",
"0.608637",
"0.606799",
"0.6017638",
"0.6016969",
"0.597",
"0.59593177",
"0.5933476",
"0.5918051",
"0.5867398",
"0.58452666",
"0.5821816",
"0.5797253",
"0.5783352",
"0.5777188",
"0.577637",
"0.57761616",
"0.57750916",
"0.5719448",
"0.5701435",
"0.5696114",
"0.5... | 0.705978 | 0 |
on load it will try to get details, if there is a loggedin user | function loadDetails() {
return API.getUserDetails()
.done(function (data) {
userData = data;
renderUser(data)
})
.fail(function (err) {
/// message("Something went wrong");
if (err.status == 302) {
window.location = err.getResponseHeader('FORCE_REDIRECT');
return;
};
})
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"load() {\r\n this.userIdService.invokeWithUserId((userId) => {\r\n if (userId !== OCC_USER_ID_ANONYMOUS) {\r\n this.store.dispatch(new LoadUserDetails(userId));\r\n }\r\n });\r\n }",
"function loadCurrentUser() {\n UserService.GetCurrentUser().then... | [
"0.7307482",
"0.71317965",
"0.68721694",
"0.686145",
"0.67589873",
"0.6721293",
"0.6711474",
"0.67027605",
"0.66994476",
"0.66971534",
"0.66786444",
"0.66509473",
"0.65928626",
"0.65892994",
"0.6564492",
"0.6554724",
"0.6554724",
"0.65513384",
"0.65355587",
"0.6531277",
"0.65... | 0.72173035 | 1 |
Insert data into 'real_estate' table | insertRealEstate(data, callback){
this.executeMySQL("INSERT INTO real_estates(real_estate_name, real_estate_price, real_estate_area, real_estate_date, real_estate_url, district_id) VALUES ?", [data]).then(function(success){
callback(true);
}).catch(function(err){
console.log(err)... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sendStatesDataToDB(result) {\n let stmt = \"UPDATE states SET covid_death = ?, covid_count = ?, trajectory_hospitalize = ?, \" +\n \" trajectory_test = ? WHERE state_ab = ?;\";\n var query = \"\";\n var data = [];\n \n result.forEach(function(singleState) {\n query +... | [
"0.55630094",
"0.5552992",
"0.54735714",
"0.54402804",
"0.53643495",
"0.5342236",
"0.52883154",
"0.5274545",
"0.5263654",
"0.5248683",
"0.5242633",
"0.52060825",
"0.520223",
"0.5177058",
"0.51674086",
"0.51644",
"0.515226",
"0.5142226",
"0.51367766",
"0.51305705",
"0.5125357"... | 0.6507925 | 0 |
Mark this game object for destroy | destroy(){
this.markedDestroy = true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function destroy(){}",
"destroy() {\n this.reset(false);\n this.options.onDestroy(this);\n }",
"destroy() {\n this.spriteObject.destroy();\n }",
"function destroy(){\n\t\t// TODO\n\t}",
"destroy(){}",
"destroy(){}",
"function destroy () {\n\t\t// TODO\n\t}",
"willDestroy() {}",... | [
"0.74294096",
"0.7390618",
"0.7362749",
"0.7221283",
"0.7209021",
"0.7209021",
"0.71896374",
"0.71837884",
"0.7167157",
"0.7167157",
"0.70875853",
"0.7081102",
"0.7054614",
"0.700984",
"0.697873",
"0.69145703",
"0.6902593",
"0.6902515",
"0.6838855",
"0.6828801",
"0.68215644",... | 0.79606366 | 0 |
Get a game object by name | getGameObject(name){
for(let child of this.children){
if(child.name == name) return child;
let foundChild = child.getGameObject(name);
if(foundChild) return foundChild;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function FindGameObjectWithName (name) {\n for (var i = 0; i < _gameobjects.length; i++) {\n if (_gameobjects[i].name === name) return _gameobjects[i];\n }\n return false;\n}",
"getGameObject(name) {\n for (let child of this.children) {\n if (child.name == name) return child;\n ... | [
"0.75299186",
"0.7209909",
"0.70038813",
"0.69633025",
"0.69596165",
"0.6847257",
"0.6847257",
"0.6847257",
"0.6847257",
"0.67339563",
"0.6711304",
"0.6648906",
"0.6419546",
"0.6400634",
"0.6370408",
"0.6357262",
"0.61927474",
"0.6180662",
"0.61068773",
"0.6088772",
"0.606543... | 0.72688115 | 1 |
Find a component by name | getComponent(name){
for(let component of this.components){
if(component.constructor.name == name)
return component;
}
//If we didn't find it, search any children we have
for(let child of this.children){
let component = child.getComponent(name);
if(component) return component;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getComponentByName(name) {\n var i,\n component = that.cp;\n\n if (name.indexOf(\".\") > -1) {\n name = name.split(\".\");\n for (i = 0; i < name.length; i++) {\n if (!component) {\n break;\n }\n ... | [
"0.7262049",
"0.70103645",
"0.6993525",
"0.69635135",
"0.6887969",
"0.6740571",
"0.65638405",
"0.64327854",
"0.6159689",
"0.60296863",
"0.59928286",
"0.59233046",
"0.58793825",
"0.5870629",
"0.58386356",
"0.5819555",
"0.5813072",
"0.5809756",
"0.57970345",
"0.5755373",
"0.575... | 0.77876216 | 0 |
pretty = external move object | function make_pretty(ugly_move) {
var move = clone(ugly_move);
move.san = move_to_san(move, false);
move.to = algebraic(move.to);
move.from = algebraic(move.from);
var flags = '';
for (var flag in BITS) {
if (BITS[flag] & move.flags) {
flags ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function make_pretty(ugly_move) {\n var move = clone(ugly_move);\n move.san = move_to_san(move, false);\n move.to = algebraic(move.to);\n move.from = algebraic(move.from);\n\n var flags = '';\n\n for (var flag in BITS) {\n if (BITS[flag] & move.flags) {\n flags += FLAGS[flag];\n ... | [
"0.7024698",
"0.7024698",
"0.6777846",
"0.61500937",
"0.61427796",
"0.6053221",
"0.6041881",
"0.59004897",
"0.57987034",
"0.56136435",
"0.56041354",
"0.5601243",
"0.5585633",
"0.5507589",
"0.55063355",
"0.5502591",
"0.5474692",
"0.5418301",
"0.5346111",
"0.529343",
"0.5279197... | 0.70291734 | 0 |
Prepend a space if necessary | function prepend_space(sb) {
if ( (!sb.isEmpty()) && (sb.lastChar() != " ")) {
sb.append(" ");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function insertSpaces(value) {\n if (!value) {\n return value;\n }\n return value.replace(/[-_]/g, ' ').trim();\n}",
"function qwerty_addSpaceText() {\n\tqwerty_appendText(\" \");\n}",
"function qwerty_addSpaceText() {\n\tqwerty_appendText(\" \");\n}",
"function addSpaces(str) {\n\treturn ' '... | [
"0.73188084",
"0.68877447",
"0.68877447",
"0.6698276",
"0.6696459",
"0.66911507",
"0.6681704",
"0.6498426",
"0.6424722",
"0.6421804",
"0.6398122",
"0.63795674",
"0.6379474",
"0.6350345",
"0.6342515",
"0.6340782",
"0.6340782",
"0.6340782",
"0.6340782",
"0.6340782",
"0.6340782"... | 0.7799992 | 1 |
Returns the moves, ensures that the pgn string is read. | function getMoves() {
if (typeof that.moves != 'undefined') {
return that.moves;
} else {
load_pgn();
return that.moves;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ParseMove (move, plyCount)\n {\n var ii, ll;\n var toRowMarker = -1;\n\n /*\n * Reset the global move variables.\n */\n castleRook = -1;\n mvIsCastling = 0;\n mvIsPromotion = 0;\n mvCapture = 0;\n mvFromCol = -1;\n mvFromRow = -1;\n mvToCol =... | [
"0.6612982",
"0.64753175",
"0.6350077",
"0.63373125",
"0.62834054",
"0.62319785",
"0.61688286",
"0.6059208",
"0.59429204",
"0.5895692",
"0.5820942",
"0.57854456",
"0.57703507",
"0.56876326",
"0.568096",
"0.5670227",
"0.5662928",
"0.5649098",
"0.5602697",
"0.5568647",
"0.55497... | 0.71292406 | 1 |
Returns the headers. Ensures that pgn is already read. | function getHeaders() {
if (typeof that.headers != 'undefined') {
return that.headers;
} else {
load_pgn();
return that.headers;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async _getHeaders() {\n const authToken = await this.authService.getToken();\n return this._headers(authToken.access_token);\n }",
"get hdr() {}",
"getHeaderObject() {\n\n // create headers object\n const headers = {};\n\n for (const [header, value] of this._headers.entrie... | [
"0.7068289",
"0.69782346",
"0.6828954",
"0.6769882",
"0.66751254",
"0.65916806",
"0.6525979",
"0.65228117",
"0.65208364",
"0.65208364",
"0.64754516",
"0.6385975",
"0.6358754",
"0.63203096",
"0.63199353",
"0.6299253",
"0.627801",
"0.627801",
"0.62346566",
"0.6233533",
"0.61658... | 0.8435786 | 1 |
Unmark all marked moves, mark the next one. | function unmarkMark(next) {
var moveASpan = function (i) {
return document.querySelector('#' + movesId + i + '> a');
};
removeClass(document.querySelector('#' + movesId + " a.yellow"), 'yellow');
addClass(moveASpan(next), 'yellow');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function unmarkMark(next) {\n var moveASpan = function(i) {\n return $('#' + movesId + i + \"> a\");\n };\n\n $(\"div#\" + movesId + \" a.yellow\").removeClass('yellow');\n moveASpan(next).addClass('yellow');\n }",
"function unmarker() {\n unmark = 1;\n\t\... | [
"0.7276184",
"0.70077974",
"0.621034",
"0.5962253",
"0.59163034",
"0.5886681",
"0.5820942",
"0.5696865",
"0.5696865",
"0.5696865",
"0.5696865",
"0.5681608",
"0.5657213",
"0.56473386",
"0.5647259",
"0.5630975",
"0.5583178",
"0.55461985",
"0.5543661",
"0.55393153",
"0.5510641",... | 0.73989147 | 0 |
Fills the comment field depending on which and if a comment is filled for that move. | function fillComment(moveNumber) {
let myMove = that.mypgn.getMove(moveNumber);
if (!~myMove) return;
if (myMove.commentAfter) {
document.querySelector('#' + boardId + " input.afterComment").checked = true;
document.querySelector('#' + boardId + " text... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function fillComment(moveNumber) {\n var myMove = that.mypgn.getMove(moveNumber);\n if (myMove.commentAfter) {\n $(\"#\" + boardId + \" input.afterComment\").prop('checked', true);\n $(\"#\" + boardId + \" textarea.comment\").val(myMove.commentAfter);\n ... | [
"0.7499994",
"0.5694943",
"0.5510648",
"0.54800504",
"0.5427797",
"0.53654367",
"0.53386295",
"0.5328364",
"0.5323308",
"0.5311304",
"0.5233553",
"0.5231824",
"0.5215882",
"0.51919067",
"0.5184448",
"0.51829976",
"0.5178719",
"0.5162215",
"0.51332146",
"0.51237863",
"0.510251... | 0.7550228 | 0 |
1. Write a function named `giveCompliment` | function giveCompliment(name){
/*- It takes 1 argument: your name
- Inside the function create an array with 10 strings. Each string should be a compliment, like `"great"`, `"awesome"`
- Write logic that randomly selects a compliment
- Return a string: "You are [COMPLIMENT], [YOUR_NAME]!*/
let compliment=["gr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function giveCompliment(myName) { // It takes 1 argument\n // create an array with 10 strings\n const complimentList = [\"great\", \"amazing\", \"awesome\", \"perfect\", \"handsome\",\n \"marvelous\", \"extraordinary\", \"wonderful\", \"talented\", \"clever\"];\n // Write logic that randomly selects a compli... | [
"0.6683876",
"0.667681",
"0.59986377",
"0.57679355",
"0.57417107",
"0.5566981",
"0.5564886",
"0.55515885",
"0.5532021",
"0.5457313",
"0.5451016",
"0.5433085",
"0.5433085",
"0.5433085",
"0.5433085",
"0.5403409",
"0.5395066",
"0.53683805",
"0.5354695",
"0.5313772",
"0.5306471",... | 0.699392 | 0 |
logic for handling updating of currNum & screen | function updateCurrNum(value) {
if (currNum.init) {
currNum = value;
currNum.init = false;
//need to fix logic for preventing leading zeros
} else if (currNum != '0') {
currNum += value;
}
updateScreen(currNum);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateScreen(x,y){\n if (!numSwitch){\n screenDown.innerHTML=num1\n }\n else{\n screenDown.innerHTML=num2\n }\n switch(x){\n case 0:\n screenUp.innerHTML= `${num1} ${y}`\n break\n\n case 1:\n screenUp.innerHTML+= num2;\n sc... | [
"0.67669946",
"0.6752814",
"0.6493039",
"0.6459563",
"0.6381617",
"0.6258436",
"0.6240207",
"0.6129744",
"0.61290735",
"0.6069174",
"0.6040527",
"0.601121",
"0.60052913",
"0.59985465",
"0.59736466",
"0.59180576",
"0.5906777",
"0.58814734",
"0.5862437",
"0.58563673",
"0.585357... | 0.75199705 | 0 |
Keys that should be rejected by the server | function getBadServerKeys(tbl, key, allowPartial) {
const badKeys = [
{},
{
nosuchfield: 1
},
//Invalid extra field: currently disabled since currently proxy
//allows extra fields, will reenable with next protocol version.
//Object.assign({}, key, { nosuch... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getAllowedKeys(keys) {\n return keys.filter((key) => {\n return blacklist.indexOf(key) === -1;\n });\n}",
"keysToIgnoreWhenCheckingContentEquality() {\n return [];\n }",
"function warnOnInvalidKey(child, knownKeys) {\n\t {\n\t if (typeof child !== 'object' || child === null) {\n\t ... | [
"0.6038159",
"0.5908205",
"0.5719545",
"0.57131755",
"0.5693765",
"0.56937134",
"0.5668548",
"0.5668548",
"0.56413615",
"0.56413615",
"0.56413615",
"0.56413615",
"0.56307864",
"0.56307864",
"0.56307864",
"0.56307864",
"0.56307864",
"0.56307864",
"0.56307864",
"0.56307864",
"0... | 0.62804693 | 0 |
La funcion lk1 trabaja con el contenido filtrado: | function lk1(){
const dr_estilo = document.querySelectorAll('#tabla_resultado .select_filtr');//Capturando contenido filtrado
const estilo5 = function (){
this.style.color = "#00acc1";
}
const estilo6 = function (){
this.style.color = "#fff";
}
const buscar = function (){
$('#contenidoFiltrado').html('<div ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"filtrarSugerencias(resultados, busqueda) {\n const filtro = resultados.filter( filtro => filtro.calle.indexOf(busqueda) !== -1 );\n\n // Iniciar el mapa\n this.inicializarMapa();\n\n // Mostrar pines del Filtro\n this.mostrarMapa(filtro);\n }",
"function filtrerin... | [
"0.53175664",
"0.5276723",
"0.5275403",
"0.5263181",
"0.52149326",
"0.51560205",
"0.50838006",
"0.5055052",
"0.5018888",
"0.49820137",
"0.4980397",
"0.4967882",
"0.49524117",
"0.4933793",
"0.49156064",
"0.4887934",
"0.48847938",
"0.48847714",
"0.48772037",
"0.48622492",
"0.48... | 0.59630454 | 0 |
Funcion que activa los elementos del reproductor: | function activa_repro(){
//Activamos los elementos necesatios para utilizar el reproductor:
document.getElementById('art').style.display = 'block';
$('#Album_datos').attr("class", "col s3 m4 l3 hide-on-small-only");
$('#Controles_music').attr("class", "col s12 m8 l7");
slider.removeAttribute('disabled... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ActivarElemento (idElemento) {\r\n\r\n}",
"function activar(copia, seccion, padre, a){\n\tvar btn_menos = copia.getElement(\".menos\");\n\tbtn_menos.addEvent('click', function(){\n\t\tbtnMenos.call(padre, seccion, a);\n\t});\n\t\n\treconteo('#'+seccion+' .registro', a);\n}",
"function activarBtnAddPr... | [
"0.690029",
"0.61898553",
"0.61261797",
"0.59702396",
"0.5862063",
"0.5852063",
"0.58015305",
"0.5800982",
"0.57443315",
"0.5733752",
"0.57215196",
"0.5704066",
"0.56894505",
"0.5677984",
"0.5652153",
"0.564887",
"0.56395686",
"0.563247",
"0.5621341",
"0.5611243",
"0.5600414"... | 0.69290006 | 0 |
Funcion para animar el texto de los datos del album: | function anima_datos(){
var titulo_song = $('#title').text();
var artista_song = $('#artist').text();
var afecta_titulo = document.getElementById('title');
var afecta_artista = document.getElementById('artist');
if (titulo_song.length > 23) {
afecta_titulo.innerHTML = '<MARQUEE SCROLLDELAY =300>'+titulo_song+'</... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function animarTexto1(){\n //incremento la posicion en 1 y extraigo el texto a mostrar en este momento.\n pos = pos + 1;\n var textoActual = texto.substring(0,pos);\n //capturo el div donde se pone el texto\n var t = document.getElementById(miDiv);\n t.textContent = textoActual;\n //controla la canti... | [
"0.62413317",
"0.6238365",
"0.6200398",
"0.6193867",
"0.6043208",
"0.59675694",
"0.5925094",
"0.5878785",
"0.580754",
"0.5806127",
"0.5804636",
"0.5775848",
"0.57653916",
"0.57418805",
"0.5720484",
"0.5665257",
"0.5664565",
"0.5657824",
"0.5645497",
"0.5637493",
"0.56206185",... | 0.6569618 | 0 |
Check that password length is at least 6 | function validatePassword(password) {
if (password.length < 6) {
return false;
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isAcceptablePassword(password) {\r\n \r\n if (password.length <= 6) {\r\n return false;\r\n } else return true;\r\n\r\n}",
"function validPassword(password) {\n\treturn password.length >= 8;\n}",
"function checkPasswordLength(inPassword) {\n\treturn (inPassword.val().length >= 5);\n}",
... | [
"0.8590005",
"0.8349175",
"0.82887477",
"0.82519",
"0.82242614",
"0.81997997",
"0.8102767",
"0.8091865",
"0.808067",
"0.80691314",
"0.80527306",
"0.79939777",
"0.794299",
"0.78595775",
"0.7837629",
"0.78310204",
"0.7763244",
"0.77145284",
"0.7706954",
"0.77009344",
"0.7665965... | 0.83508205 | 1 |
Check that date is valid (DDMMYYYY) and not in the past | function validateDate(date) {
const tokens = date.split('-');
if (tokens.length != 3) {
return false;
}
const rightDate = tokens[1] + '-' + tokens[0] + '-' + tokens[2];
// Check if date is valid
let newDate;
const timestamp = Date.parse(rightDate);
if (isNaN(timestamp) == false)... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function dateValidation(date) {\n const isValid = moment(date).isValid();\n if(!isValid) return false;\n const now = moment();\n return moment(date).isBefore(now) ? true : false;\n}",
"dateIsValid () {\n const dateValid = new Date(this.date).getDate() <= new Date().getDate();\n return dateValid... | [
"0.7739628",
"0.7701293",
"0.7650413",
"0.75839156",
"0.7496991",
"0.7480844",
"0.7463756",
"0.7398433",
"0.7341339",
"0.73073363",
"0.7287363",
"0.72549695",
"0.71467984",
"0.7136404",
"0.7128665",
"0.71243703",
"0.7121864",
"0.71130705",
"0.71064436",
"0.7106069",
"0.705740... | 0.7891535 | 0 |
Check that amount is between 0 and 10000000 | function validateAmount(amount) {
if (amount <= 0 || amount >= 10000000) {
return false;
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkAmount(amount) {\n return $.isNumeric(amount) && amount > 0;\n }",
"function checkBet (o, n, min, max) { \n if ( o.val() > max || o.val() < min ) {\n o.addClass( \"ui-state-error\" );\n updateTips( \"You can only bet with numeric money. Your betting power also cannot exceed the... | [
"0.7171745",
"0.6975108",
"0.6910955",
"0.6841685",
"0.67219603",
"0.6685663",
"0.6643425",
"0.6517834",
"0.65042984",
"0.6486624",
"0.64831585",
"0.64624715",
"0.64463305",
"0.6444857",
"0.64258564",
"0.63437414",
"0.63131064",
"0.62995416",
"0.62850255",
"0.627199",
"0.6264... | 0.8287717 | 0 |
Returns a promise that resolves to a token with the given length | function createToken(length) {
return crypto.randomBytesAsync(length || CRYPTO_LENGTH);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"generateToken(length) {\n return (Math.random().toString(36)+'00000000000000000').slice(2, length + 2);\n }",
"function getToken(length) {\n var randomChars =\n 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'\n var result = ''\n for (var i = 0; i < length; i++) {\n result += ran... | [
"0.6873612",
"0.6640775",
"0.6544259",
"0.65362805",
"0.5980785",
"0.59255826",
"0.5916106",
"0.5823246",
"0.58219045",
"0.5796859",
"0.57472825",
"0.5737772",
"0.5723951",
"0.5617778",
"0.5592842",
"0.55838364",
"0.5582977",
"0.5581094",
"0.555345",
"0.55344516",
"0.5500022"... | 0.738494 | 0 |
Return a promise that resolves to the user queried by the email. | function getUser(email) {
console.log(db.getUser(email));
return db.getUser(email).then(result => {
console.log(result);
const user = result;
if (!user) return Promise.reject('User not found');
return Promise.resolve(user);
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getUserByEmail(email) {\n console.assert(email);\n // TODO(madadam): Query userStore by email.\n // For now, iterate through all users in the UserStore (via Database).\n let filter = {\n type: 'User',\n };\n let queryProcessor = this.database.getQueryProcessor(Database.NAMESPACE.SYSTEM);\n ... | [
"0.78970975",
"0.7563983",
"0.7544342",
"0.74932665",
"0.7492347",
"0.7429438",
"0.73304814",
"0.7302694",
"0.72959113",
"0.7287492",
"0.72796553",
"0.727723",
"0.7248472",
"0.720081",
"0.7168404",
"0.7153857",
"0.7133821",
"0.7044105",
"0.70056367",
"0.6975707",
"0.69435453"... | 0.76007026 | 1 |
Using jQuery create click event handler for Button that replaces content of a paragraph 4 with a number 42 | function m09task03() {
$("button").click(function () {
$("#last").text("42");
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function myButtonWasClicked() {\n // Select the tag with id=\"updateMe\" and set its inner content\n $(\"#updateMe\").text(\"The text is updated!\");\n}",
"function replaceWText(){\n $('#randPara').append('Replaced!');\n}",
"function updateButton(value) {\n abc.find('.awesome-button-text').html... | [
"0.63807905",
"0.6179586",
"0.5974979",
"0.5891762",
"0.58906406",
"0.5810711",
"0.577352",
"0.5769662",
"0.5749224",
"0.57415116",
"0.5726678",
"0.5722828",
"0.5721746",
"0.56887496",
"0.56713176",
"0.566008",
"0.5649568",
"0.56260514",
"0.5592905",
"0.55723524",
"0.5560094"... | 0.6262017 | 1 |
watch for data changing NOT DROPPED SORT AND DICT (filtring and sorting dictionaries remains untouched) is using for pagging, recalculate max pages, and for sorting determine type of fields Generally, it is creating new data_base from tdata by filtring | function onchange_tdata()
{
scope.init_data(); //create copy of data to data_base
//for new data_base (filtred acc to current filt_state)
if (scope.call_from_directive['filterAll'])scope.call_from_di... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onchange_data_base(new_val,old_val)\r\n {\r\n //make sorting of dataSet\r\n //!!!important to control only oncly raising this function\r\n //because maybe inifine loop, every resorting m... | [
"0.6572519",
"0.61168236",
"0.5740207",
"0.5713793",
"0.5610316",
"0.5535869",
"0.5535869",
"0.54664016",
"0.5378671",
"0.5364187",
"0.5316887",
"0.52674896",
"0.5262467",
"0.5257892",
"0.52319837",
"0.5230105",
"0.5219458",
"0.52030426",
"0.5201582",
"0.5164825",
"0.51489365... | 0.70884395 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.