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 |
|---|---|---|---|---|---|---|
Creates positive notification so one color | function createPositiveNotification(message, seconds){
createNotification(message, "positive", seconds);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function notif(cont,clr) {\n var not = $.Notify({\n caption : \"<b>Notifikasi</b>\",\n content : cont,\n timeout : 3000,\n style :{\n background: clr,\n color:'white'\n },\n });\n}",
"function notif(cont,clr) {\n var not = $.Notify({\n capt... | [
"0.63462883",
"0.63462883",
"0.63462883",
"0.61948174",
"0.61391795",
"0.61288995",
"0.6092757",
"0.60248834",
"0.6024829",
"0.5959109",
"0.5909848",
"0.58999896",
"0.5895785",
"0.5849777",
"0.5823613",
"0.580175",
"0.58011824",
"0.5789856",
"0.5752878",
"0.5727604",
"0.56898... | 0.653074 | 0 |
Refresh notifications Subtracts the cycles (1 second a cycle), if 0 hides the notification. | function refreshhNotifications(){
var html = '';
for(var i = 0;i < currentNotifications.length;i++){
var typeClass = "";
var typeText = "";
if(currentNotifications[i].type == "positive"){
typeClass = "positive-notification";
typeText = "dark-text";
}else if(currentNotifications[i].type == "negative"){... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"tick() {\n\n this.setState({\n\n notificationCounter: this.state.notificationCounter + 1\n\n }, function() {\n\n //clear interval and hide notification after 5 seconds\n if(this.state.notificationCounter >= 5) {\n\n this.setState({\n\n ... | [
"0.6300921",
"0.6139031",
"0.5992011",
"0.5931407",
"0.59231925",
"0.5906658",
"0.5904625",
"0.5879954",
"0.58796215",
"0.587756",
"0.58205193",
"0.58111197",
"0.57763374",
"0.57574743",
"0.5755542",
"0.57324946",
"0.57270366",
"0.57130635",
"0.57130635",
"0.569533",
"0.56743... | 0.6903233 | 0 |
Builds the sensors legend in "Get Pollution Data" functionality | function buildLegend(colors, assoColors) {
var elemStr = '<h4><a href="#" id="map-legend-close" class="text-info"><i class="material-icons md-28 align-middle">keyboard_arrow_right</i><span class="align-middle">Sensors</span></a></h4>';
for (var k = 0; k < assoColors.length; k++) {
if (assoColors[k] != ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getHeatMap() {\n\n if(this.activePollutant == null || this.stateDataArray == null || this.stateDataArray.length == 0) return null;\n\n switch(this.activePollutant.toUpperCase()) {\n\n case 'CARBON MONOXIDE' :\n return d3.scaleLinear()\n .domain([0,d3.max(t... | [
"0.5745292",
"0.5634308",
"0.5558363",
"0.5553534",
"0.55511236",
"0.554071",
"0.5536347",
"0.55279154",
"0.55142725",
"0.5497566",
"0.5447114",
"0.54165787",
"0.53889143",
"0.53871435",
"0.53785074",
"0.5354876",
"0.53347164",
"0.533369",
"0.53323025",
"0.53286266",
"0.53257... | 0.564502 | 1 |
steps to calculate the Labor costs by hour worked for a resturant: 1. for each shif sum the total hrs worked and removing non paid hours such as breaktime 2. multiuply the hourly rate by number of hrs in each shift (in variable paidShiftHoursOne,paidShiftHoursTwo...) 3. divide the (variable paidShiftHoursOne,paidShiftH... | function paidPerShift(payRate,paidShiftHours){
return payRate * paidShiftHours;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getLaborTotalForWeek(regular_hours, overtime_hours, total_hours, hourly_wage){\n\n var regular_labor_total = 0;\n var overtime_labor_total = 0;\n var overtime_daily_hours = 0;\n var labor_total = 0;\n\n _.each(regular_hours, function(o){\n regular_labor_total += o.hourly_wage * o.hou... | [
"0.6477972",
"0.61439633",
"0.59403265",
"0.5921918",
"0.5881124",
"0.582288",
"0.5755936",
"0.57068056",
"0.56968844",
"0.5691911",
"0.56522316",
"0.5635742",
"0.56339747",
"0.5587128",
"0.5544851",
"0.5476397",
"0.5467369",
"0.5427505",
"0.54025745",
"0.5375303",
"0.5358002... | 0.64867127 | 0 |
function to get x y cooridantes of each cell | function getCellCoords(c){
let x = (c % 3) * cell;
let y = Math.floor(c / 3) * cell
return {
'x': x,
'y': y,
};
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"cells() {\n var start = typeof this.topLeft === 'function' ? this.topLeft() : this.topLeft,\n end = typeof this.bottomRight === 'function' ? this.bottomRight() : this.bottomRight,\n\tthat = this;\n \n return Array.apply(start, Array(end+1)).map(function (x, y) {\n return y; \n });\n }",
... | [
"0.72819984",
"0.72770953",
"0.7134356",
"0.69603074",
"0.69250566",
"0.68872154",
"0.6864785",
"0.67984325",
"0.6771253",
"0.67456543",
"0.6735844",
"0.67337126",
"0.6728243",
"0.6650279",
"0.66314965",
"0.6610162",
"0.6593443",
"0.6588947",
"0.65888655",
"0.6554302",
"0.654... | 0.77716964 | 0 |
not using http, azureservice wraps azure mobile sercice calls. add to app too to propagate | function ChoresService($http, Azureservice) { //https://github.com/TerryMooreII/angular-azure-mobile-service
var service = {};
service.GetAll = GetAll;
service.GetById = GetById;
service.GetByUsername = GetByUsername;
service.Create = Create;
service.Update = Updat... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getClientCalls() {\n\n }",
"constructor($resource) {\n\n // remote call\n this.remoteImsAPI = $resource('/im', {}, {\n logSaasAnalyticsEvent: { method: 'POST', url: '/im/event' }\n });\n }",
"function RestapiServiceProvider(http) {\n this.http = http;\n this.apiUrl = 'http://81.... | [
"0.5587675",
"0.55613315",
"0.5535442",
"0.5516771",
"0.5395206",
"0.5367554",
"0.53086406",
"0.5307894",
"0.5298501",
"0.5275883",
"0.5243484",
"0.52432203",
"0.52148527",
"0.51995003",
"0.51768595",
"0.51674676",
"0.51623726",
"0.515051",
"0.5095502",
"0.50936663",
"0.50711... | 0.5587592 | 1 |
returns all chores for the username + childname | function GetByUsernameChild(username, childname) {
return Azureservice.query('Chores', {
criteria: {
username: username,
childname: childname
}, orderBy: [{
column: '__createdAt',
direction: 'desc... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function fillChores(childName) {\n\t// if (childName != \"Allie\")\n\tfor (var key in chores) {\n\t\tdict = chores[key]\n\t\tif (dict.child == childName) {\n\t\t\tif (!dict.completed) {\n\t\t\t\tdom.incomplete.appendChild(makeChore(key, false))\n\t\t\t}\n\t\t\telse {\n\t\t\t\tdom.checkoff.appendChild(makeChore(key... | [
"0.6104161",
"0.5989289",
"0.57922363",
"0.5701846",
"0.5295028",
"0.5227344",
"0.52001673",
"0.51947254",
"0.51725894",
"0.5134114",
"0.50725615",
"0.50700766",
"0.5069355",
"0.50639176",
"0.5044351",
"0.5031291",
"0.5015726",
"0.50126654",
"0.4989729",
"0.49486518",
"0.4939... | 0.7243062 | 0 |
Replace imports in code string to specified alias. This does the string replace of specific import line so that other part of code is not affected by this mod | function replaceImports (code: string, imports: Array<Object>) {
let newCode = '';
let startIdx = 0;
imports.forEach((importData) => {
const {start, end, updatedImport} = importData;
newCode = newCode + code.substring(startIdx, start) + updatedImport;
startIdx = end;
});
newCode = newCode + code.s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"claimImportCode(importPath) {\n const result = this.importsToReplace.get(importPath);\n this.importsToReplace.set(importPath, \"\");\n return result || \"\";\n }",
"function translateImportPaths (text, base, file) {\n\ttext = text.replace(/(\\@import\\s+(['\"])(?!https?)([a-zA-Z0-9\\ \\/\\-\\.\\@\\{\\}... | [
"0.6363361",
"0.6103791",
"0.6091928",
"0.59389204",
"0.5858033",
"0.5774414",
"0.5640172",
"0.5539663",
"0.5476801",
"0.542132",
"0.53182656",
"0.5275617",
"0.5236666",
"0.522732",
"0.51994413",
"0.5182681",
"0.513327",
"0.51323915",
"0.51292515",
"0.51152205",
"0.51066875",... | 0.7634359 | 0 |
Extract the import lines from the file which matches the alias | function getImports(filePath: string, code: string, aliasOptions: aliasOptions) {
const {alias, aliasRelativeToRoot, language} = aliasOptions;
const ast = parse(code, {
sourceType: 'module',
plugins: [language, ...babylonPlugins]
});
const imports = [];
function addToImports(node, sourceNode) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getOwnScriptImports() {\n let result = [];\n this.enumerateOwnFiles((file) => {\n if ((0, reflection_1.isBrsFile)(file)) {\n result.push(...file.ownScriptImports);\n }\n else if ((0, reflection_1.isXmlFile)(file)) {\n result.push(...file.... | [
"0.5956957",
"0.5916086",
"0.58257747",
"0.5825266",
"0.5774907",
"0.56931293",
"0.5678441",
"0.56614476",
"0.5593588",
"0.5517172",
"0.54514766",
"0.5378137",
"0.5356314",
"0.5329611",
"0.53012156",
"0.52729326",
"0.52373016",
"0.523729",
"0.5230695",
"0.52288085",
"0.522037... | 0.62148565 | 0 |
Generate order of questions, for randomize | function generateQuestionOrder (){
if(questionOrder.length != 0){
questionOrder == [];
}
for(var g=0; g < numberOfQuestions; g++){
questionOrder.push(g);
}
shuffle(questionOrder);
//Insert challenges
for(var o=0; o<numberOfChallenges; o++){
var challengePosition = Math.ro... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function questionOrder() {\n for (i = 0; i < holdQuestions.length; i++) {\n do {\n let question = Math.floor(Math.random() * holdQuestions.length);\n if (!questionsArray.includes(holdQuestions[question])) {\n questionsArray.push(holdQuestions[question]);\n ... | [
"0.8000042",
"0.78901106",
"0.76547265",
"0.75907373",
"0.7474684",
"0.73587406",
"0.72676295",
"0.72530293",
"0.72472376",
"0.7241127",
"0.722368",
"0.7210789",
"0.71945786",
"0.71614933",
"0.71529603",
"0.70702344",
"0.70684266",
"0.7043659",
"0.7041431",
"0.7009375",
"0.70... | 0.8169838 | 0 |
Allow the user to input a desired travel time, in minutes, and a travel mode, and a location and only show the landmarks that are within that travel time (via that travel mode) of the location | function searchWithinTime() {
// Initialize the distance matrix service
var distanceMatrixService = new google.maps.DistanceMatrixService;
var address = document.getElementById('search-within-time-text').value;
// Check to make sure the place entered is not blank
if (address === '') {
window.alert('You mu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function searchWithinTime() {\n // Initialize the distance matrix service.\n var distanceMatrixService = new google.maps.DistanceMatrixService;\n var address = document.getElementById('search-within-time-text').value;\n // Check to make sure the place entered isn't blank.\n if (address == '') {\n ... | [
"0.6610506",
"0.6438389",
"0.63740855",
"0.63540095",
"0.63179535",
"0.6071785",
"0.6057508",
"0.60257006",
"0.5969484",
"0.5939082",
"0.59119844",
"0.5877828",
"0.58701205",
"0.58567303",
"0.58204955",
"0.5815",
"0.5813967",
"0.567467",
"0.567149",
"0.56538385",
"0.5646144",... | 0.64425015 | 1 |
Go through each of the results from searchWithinTime() and if the distance is less than the value in the picker, show it on the map | function displayMarkersWithinTime(response) {
var maxDuration = document.getElementById('max-duration').value;
var origins = response.originAddresses;
var destinations = response.destinationAddresses;
// Parse through the results, and get the distance and duration of each
// Because there might be multiple or... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function searchWithinTime() {\n // Initialize the distance matrix service.\n var distanceMatrixService = new google.maps.DistanceMatrixService;\n var address = document.getElementById('search-within-time-text').value;\n // Check to make sure the place entered isn't blank.\n if (address == '') {\n ... | [
"0.6945233",
"0.6887019",
"0.68668616",
"0.6848119",
"0.6765267",
"0.66779864",
"0.6506476",
"0.62261486",
"0.6212782",
"0.6089756",
"0.6037859",
"0.5991605",
"0.59836686",
"0.5963301",
"0.5892008",
"0.5889268",
"0.58850366",
"0.5881908",
"0.5877766",
"0.5867054",
"0.5860523"... | 0.6965204 | 0 |
Test Cases: zeroMatrix([[0,1,1],[1,1,1],[1,1,1]]) [1,0,1],[0,0,0],[1,0,1]] | function zeroMatrix(matrix) {
// identify the y and x position of the zero
let y;
let x;
for (let i = 0; i < matrix.length; i++) {
for (let k = 0; k < matrix[i].length; k++) {
if (matrix[i][k] === 0) {
y = i;
x = k;
}
}
}
// reiterate over the array and fill in the zeros... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function zeroMatrix(matrix) {\n const rows = new Array(matrix.length).fill(false);\n const cols = new Array(matrix[0].length).fill(false);\n\n for (var i = 0; i < matrix.length; i++) {\n for (var j = 0; j < matrix[i].length; j++) {\n if (matrix[i][j] === 0) {\n rows[i] = true;\n cols[j] = ... | [
"0.80632716",
"0.8038921",
"0.8031309",
"0.798482",
"0.79506505",
"0.781216",
"0.7799858",
"0.7751721",
"0.7722026",
"0.7693293",
"0.76888037",
"0.766668",
"0.766668",
"0.7625635",
"0.75747603",
"0.72851366",
"0.72483474",
"0.7087548",
"0.70295393",
"0.6934285",
"0.6895615",
... | 0.8121612 | 0 |
Override raycast method to handle vertex shader transformation | raycast(raycaster) {
let {startAngle, endAngle, startRadius, endRadius=startRadius, threeObject} = this
let origGeom = threeObject.geometry
let raycastGeometry = origGeom.clone()
// Modify raycasting geometry to match what the vertex shader would produce
let posAttr = raycastGeometry.attributes.pos... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Raycast() {}",
"calculateVertices()\n {\n if (this._transformID === this.transform._worldID && this._textureID === this._texture._updateID)\n {\n return;\n }\n\n this._transformID = this.transform._worldID;\n this._textureID = this._texture._updateID;\n\n /... | [
"0.69332016",
"0.63549054",
"0.6256013",
"0.62227964",
"0.6219358",
"0.6151546",
"0.6121355",
"0.6099539",
"0.60594815",
"0.604548",
"0.59934795",
"0.59934795",
"0.59860134",
"0.59731144",
"0.5956913",
"0.5952267",
"0.5945865",
"0.59310067",
"0.59199494",
"0.5914359",
"0.5891... | 0.7341749 | 0 |
countChars ////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// compare a string to a letter if the letter exists inside of the string add it to a count edge case: the letter or string may be upper or lower case but still needs... | function countChars(string, letter) {
let evenStr = string.toLowerCase();
let evenLtr = letter.toLowerCase();
let stringCount = 0;
for(let i = 0; i < evenStr.length; i++){
if(evenStr[i] === evenLtr){
stringCount++;
}
}
return stringCount;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function countChar(str,letter){\n\tvar count = 0;\n\tfor(var i = 0; i < str.length; i++){\n\t\tif(str[i] === letter){\n\t\t\tcount++;\n\t\t}\n\t}\n\treturn count;\n}",
"function char_count(str, letter) {\nlet count = 0;\n for (let i = 0; i < str.length; i++) \n {\n if (str.charAt(i) == letter) \n {\n ... | [
"0.77853596",
"0.77238125",
"0.77127296",
"0.7707554",
"0.7703439",
"0.7680665",
"0.76486915",
"0.7609366",
"0.75903463",
"0.7514123",
"0.7511605",
"0.74940956",
"0.7459963",
"0.74180496",
"0.73883414",
"0.73840606",
"0.7368737",
"0.73448163",
"0.73377466",
"0.7285585",
"0.72... | 0.8080108 | 0 |
roll Sphero in a random direction | function move() {
orb.roll(60, Math.floor(Math.random() * 360));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"move() {\n var dirx = Math.random() > 0.5 ? 1 : -1;\n var diry = Math.random() > 0.5 ? 1 : -1;\n var L = int((Math.random() * 20));\n var L2 = int((Math.random() * 20));\n this.endx = this.posx + (L * dirx);\n this.endy = this.posy + (L2 * diry);\n }",
"move() {\r\n this... | [
"0.69347596",
"0.6797261",
"0.6797261",
"0.6724549",
"0.6680387",
"0.6658555",
"0.66532886",
"0.6646366",
"0.6575827",
"0.65439117",
"0.6509223",
"0.6500889",
"0.6393657",
"0.6393657",
"0.63899165",
"0.6384822",
"0.6337113",
"0.63361603",
"0.63284934",
"0.63211524",
"0.631768... | 0.78929275 | 0 |
use compare file live and zip deploy json1 : site json2 : zip var jsonFailed = [] ; // ==> moved to top | function compare2Json2(json1, json2) {
if (json1.length == undefined || json2 == undefined) {
Ext.Msg.alert('JSON ERROR', 'site or zip file not exists');
return;
}
if (json1.length != json2.length) {
Ext.Msg.alert('Error', 'Error JSON jsonSite.length(' + json1.length + ')!=json... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function compare2Json(json1, json2) {\r\n if (json1.length == undefined || json2 == undefined) {\r\n Ext.Msg.alert('JSON ERROR', 'site or zip file not exists');\r\n return;\r\n }\r\n if (json1.length != json2.length) {\r\n Ext.Msg.alert('Error', 'Error JSON jsonSite.length(' + json1.l... | [
"0.7399146",
"0.5790006",
"0.5647152",
"0.56168616",
"0.5571412",
"0.5565438",
"0.55542356",
"0.5484557",
"0.54142797",
"0.5367951",
"0.53662163",
"0.5364928",
"0.53516906",
"0.5303181",
"0.5302486",
"0.52898914",
"0.52543795",
"0.52409214",
"0.5225472",
"0.5203723",
"0.51925... | 0.7435076 | 0 |
check all deploying Site One Row | function checkAllDeployingSiteOneRow(grid, rowIndex) {
if (grid.getStore().getAt(rowIndex).get('checked') == 0) {
if (jsonObjsZipFile == undefined) {
Ext.Msg.alert('Info', 'Zip File have not uploaded yet');
return;
}
// create request to express server
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isDeployable() {\n return deploymentReqs.length == 0;\n }",
"function checkURL(sites) {\n console.log(`🕵️ Checking for updates...`);\n sites.forEach(async (site, index) => {\n await huntForChanges(index);\n\n });\n}",
"function compare_deployments() {\n\n // sets curr to the most recent... | [
"0.61869425",
"0.56939095",
"0.55267155",
"0.5503776",
"0.54392684",
"0.54052985",
"0.5362175",
"0.5338941",
"0.53294826",
"0.5278505",
"0.5274449",
"0.5242666",
"0.5221083",
"0.5196916",
"0.51879275",
"0.51602733",
"0.51542175",
"0.5143989",
"0.5142952",
"0.51393723",
"0.511... | 0.6943193 | 0 |
get all folder Site One Row | function getAllFolderSiteOneRow(grid, rowIndex) {
// create request to express server
var folderPath = grid.getStore().getAt(rowIndex).get('folderPath');
if (folderPath != '') return;
grid.getStore().getAt(rowIndex).set('folderPath', ' '); // start checking
// check url
var siteName = Ex... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getAllFolders() {\n //This knex statement SELECTS all data in folders\n return knex('folders')\n }",
"getAllFolders(knex) {\n return knex\n .select('*')\n .from('folders');\n }",
"async function getRowData({ page, currRow }) {\n await page.waitForSelector('div[role=\"gridcell\"]... | [
"0.6632167",
"0.6234396",
"0.60889596",
"0.60787433",
"0.5905899",
"0.5850617",
"0.58380044",
"0.5741482",
"0.5689193",
"0.56037104",
"0.5569749",
"0.5567698",
"0.55516434",
"0.5545955",
"0.5543765",
"0.55319244",
"0.5520777",
"0.5486731",
"0.54260755",
"0.54260755",
"0.54250... | 0.65478224 | 1 |
get Paste instance of `cm`. if not exists, create one. | function getPaste(cm) {
if (!cm.hmd) cm.hmd = {}
else if (cm.hmd.paste) return cm.hmd.paste
var paste = new Paste(cm)
cm.hmd.paste = paste
return paste
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function pasteEvent() {\n //First, see if this is a real thing\n if (isNormalPaste()) {\n return true;\n }\n //console.log(\"PASTE EVENT\");\n switch (EXT_TYPE) {\n case CHROME_EXT:\n chrome_clipsetup(function() {\n chrome.runtime.sendMessage({\n ... | [
"0.47354227",
"0.4701119",
"0.46800277",
"0.46309173",
"0.45715827",
"0.45107478",
"0.4404818",
"0.4391807",
"0.43895793",
"0.43631342",
"0.43569103",
"0.43522865",
"0.4336841",
"0.43331105",
"0.43281224",
"0.43055344",
"0.428275",
"0.42679116",
"0.42606258",
"0.42327198",
"0... | 0.78323615 | 0 |
Sign the http request. | signHttpRequest(request, forceExcludeBody = false) {
return __awaiter(this, void 0, void 0, function* () {
// Populate missing headers required for signing
let options = {};
if (this.authenticationDetailsProvider.getPassphrase()) {
Object.assign(options, { pas... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_generateSignature(opc) {\n if (this._apiToken) {\n opc.headers.Authorization = `${this._apiToken}`;\n }\n if (this._mustSign) {\n let timestamp = new Date().getTime();\n opc.headers['x-logtrust-apikey'] = this._apiKey;\n opc.headers['x-logtrust-timestamp'] = timestamp;\n const bo... | [
"0.6817542",
"0.65861005",
"0.6549309",
"0.64599687",
"0.643523",
"0.629988",
"0.617487",
"0.617487",
"0.60314804",
"0.60314804",
"0.59647965",
"0.59518796",
"0.5893721",
"0.58692765",
"0.58673435",
"0.5795331",
"0.57907355",
"0.5758332",
"0.5715959",
"0.571203",
"0.56988007"... | 0.7014966 | 0 |
generates table of frequencies for notes see: | function generateFrequencyTable() {
var noteNames = ['A', 'A#', 'B', 'C', 'C#', 'D', 'D#', 'E', 'F', 'F#', 'G', 'G#'];
var root12_2 = 1.059463094359;
var freq_by_note = {};
// fill 4, 5, 6, and 7 octaves
var freq = 440.0; // A4
['4', '5', '6', '7'].forEach(function(octave) {
var f =... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function noteFrequency (note) {\n\t// array of frequencies for note passed\n\tvar noteFrequencyTable = [];\n\t// find base index \n\tvar index = startingIndex(note);\n\t// base freq of notes in HTz\n\t// e, f, f#, g, g#, a, a#, b, c, c#, d, d# \n\tvar base = [20.60,21.83,23.12,24.50,25.96,27.50,29.14,30.87,16.35,1... | [
"0.79028225",
"0.77309763",
"0.7606775",
"0.7122334",
"0.6987922",
"0.6846389",
"0.67645293",
"0.6646695",
"0.61082506",
"0.60694784",
"0.5998086",
"0.5981533",
"0.59606045",
"0.5927107",
"0.58268505",
"0.5777502",
"0.57242715",
"0.5714944",
"0.5660471",
"0.561106",
"0.560292... | 0.8102808 | 0 |
Gets the current user's ID from Firestore. | function getCurrentUser() {
firebase.auth().onAuthStateChanged(function (somebody) {
if (somebody) {
db.collection("Educators")
.doc(somebody.uid)
.get()
.then(function (doc) {
// Extract the current user's ID
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _getUserId() {\n if (!this.userId) {\n this.userId = localStorage.userId;\n if (!this.userId) {\n this.userId = cuid();\n localStorage.userId = this.userId;\n }\n }\n return this.userId;\n }",
"function _getUserId() {... | [
"0.6803066",
"0.6803066",
"0.6798738",
"0.6780337",
"0.6641422",
"0.65982926",
"0.64649343",
"0.64605397",
"0.6449905",
"0.6427983",
"0.64093536",
"0.63666457",
"0.63598996",
"0.63537014",
"0.63528025",
"0.63482714",
"0.6304593",
"0.62893486",
"0.62368935",
"0.6235473",
"0.62... | 0.7157421 | 0 |
Pulls quests from Firestore whose Quest_Approver_IDs match the current educator's ID. This means that the student who submitted the quest is part of this educator's class, making them the designated approver. Pulled quests are ordered from oldest to newest, so that quests that have been queuing for approval longer are ... | function getQuests() {
db.collection("Student_Quests")
.where("Quest_Approver_ID", "==", userID)
.orderBy("Date_Submitted", "asc")
.get()
.then((querySnapshot) => {
querySnapshot.forEach((doc) => {
if (doc.data().Quest_Status === "submitted") {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function pullQuestInfo(id) {\n db.collection(\"Student_Quests\").doc(id)\n .get()\n .then((doc) => {\n questSubmitters = doc.data().Quest_Participants;\n submitterIDs = doc.data().Quest_Participant_IDs;\n questDescription = doc.data().Quest_Description;\n ... | [
"0.6182148",
"0.55688035",
"0.5529289",
"0.54950655",
"0.54423714",
"0.54227716",
"0.53752285",
"0.5345293",
"0.53432566",
"0.52086264",
"0.5047796",
"0.5039875",
"0.5023086",
"0.5021864",
"0.4948079",
"0.49422562",
"0.49307385",
"0.4927561",
"0.49086374",
"0.48910946",
"0.48... | 0.71962494 | 0 |
Pulls information contained in the curren't quest document's fields from Firestore. These fields include the quest submitters' names, their IDs, the quest description, any quest notes written by the submitters, and any links to any images they uploaded to Cloud Storage and attached to this submission. | function pullQuestInfo(id) {
db.collection("Student_Quests").doc(id)
.get()
.then((doc) => {
questSubmitters = doc.data().Quest_Participants;
submitterIDs = doc.data().Quest_Participant_IDs;
questDescription = doc.data().Quest_Description;
questNotes =... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getQuestInfo() {\n db.collection(\"Student_Quests\").doc(questID)\n // Read\n .get()\n .then(function (doc) {\n questTitle = doc.data().Quest_Title;\n questDescription = doc.data().Quest_Description;\n questInstructions = doc.data().Quest_Instructio... | [
"0.70734715",
"0.63864243",
"0.5456931",
"0.5423014",
"0.53516483",
"0.522634",
"0.5198938",
"0.51976347",
"0.51492405",
"0.5079412",
"0.50359374",
"0.50311655",
"0.50301105",
"0.5029036",
"0.5013978",
"0.5012697",
"0.49998367",
"0.4935627",
"0.49262562",
"0.49012175",
"0.489... | 0.7302479 | 0 |
Pulls class IDs/names from Firestore (submitting student docs), and uses those IDs to go into the Classes collection and pull each class' current point total. Class names and point totals are stored as JSON objects in the classList array. | function getClassList() {
console.log(submitterIDs);
for (var i = 0; i < submitterIDs.length; i++) {
db.collection("Students").doc(submitterIDs[i])
.get()
.then(function (doc) {
let className = doc.data().Student_Class;
if (className != null) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getClassDataSync(classId) {\n var classItem = readDocument('classes', classId._id);\n // resolve admins\n classItem.admins = classItem.admins.map((id) => readDocument('users', id));\n // resolve students\n classItem.students = classItem.students.map((id) => readDocument('users', id));\n // resolve l... | [
"0.5865766",
"0.58349705",
"0.5825132",
"0.57764983",
"0.57560456",
"0.5702562",
"0.5633448",
"0.56261426",
"0.5540067",
"0.5479448",
"0.5458507",
"0.54575837",
"0.53559417",
"0.5352357",
"0.534724",
"0.5334962",
"0.53219086",
"0.5317445",
"0.53014016",
"0.5275398",
"0.526617... | 0.71883816 | 0 |
Pulls the point value input by the educator for this quest (in the "Points" field) and the quest that has just been approved's fields in Firestore (Quest_Status, Quest_Points and Date_Processed; the Date_Submitted and Quest_Images fields are removed). | function approveStudentQuest() {
questPoints = document.getElementById("quest-points-input").value;
questPoints = parseInt(questPoints);
console.log(questID);
db.collection("Student_Quests").doc(questID).update({
Quest_Status: "approved",
Quest_Points: questPoints,
Date_Processed... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function fetchPoints() {\n user\n .where(\"uid\", \"==\", uid)\n .get()\n .then((querySnapshot) => {\n querySnapshot.forEach((doc) => {\n // doc.data() is never undefined for query doc snapshots\n console.log(doc.id, \" => \", doc.data());\n userPoints = doc.data... | [
"0.5931889",
"0.5824499",
"0.5709092",
"0.55941045",
"0.5256389",
"0.5205135",
"0.5061886",
"0.50516593",
"0.49929482",
"0.48841217",
"0.47581324",
"0.4754048",
"0.47158962",
"0.4714829",
"0.46826676",
"0.46802273",
"0.46762663",
"0.4555911",
"0.4544949",
"0.4488257",
"0.4483... | 0.610192 | 0 |
Updates the quest that has just been rejected's fields in Firestore (Quest_Status, Quest_Points and Date_Processed; the Date_Submitted and Quest_Images fields are removed). | function rejectStudentQuest() {
db.collection("Student_Quests").doc(questID).update({
Quest_Status: "rejected",
Quest_Points: 0,
Date_Processed: new Date(),
Date_Submitted: firebase.firestore.FieldValue.delete(),
Quest_Images: firebase.firestore.FieldValue.delete()
})
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function approveStudentQuest() {\n questPoints = document.getElementById(\"quest-points-input\").value;\n questPoints = parseInt(questPoints);\n console.log(questID);\n db.collection(\"Student_Quests\").doc(questID).update({\n Quest_Status: \"approved\",\n Quest_Points: questPoints,\n ... | [
"0.64358866",
"0.55282307",
"0.5413986",
"0.53390884",
"0.51701933",
"0.51417613",
"0.5109067",
"0.5064518",
"0.5047725",
"0.5043359",
"0.49887174",
"0.49674636",
"0.49206614",
"0.48902953",
"0.48837155",
"0.4879052",
"0.48388547",
"0.48384354",
"0.48206708",
"0.48023924",
"0... | 0.7438568 | 0 |
Creates an array containing the names of all classes whose point totals need to be updated during this approval. Because multiple submitters may belong to the same class, classNames can contain repeating entries. | function getClassNames() {
let classNames = [];
for (var i = 0; i < classList.length; i++) {
classNames.push(classList[i].name);
}
getPointsToAdd(classNames);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getClassNames() {\n let classNames = ['thread-ListItem'];\n\n return classNames.join(' ');\n }",
"getClasses() {\n let classes = ['indicator-pip'];\n\n if (this.props.final) {\n classes.push('final');\n }\n\n if (this.props.taken) {\n classes.push('taken');\n }\n\n return class... | [
"0.6378132",
"0.63063496",
"0.6282186",
"0.61221373",
"0.61221373",
"0.60828716",
"0.6073091",
"0.6073091",
"0.6048297",
"0.6048297",
"0.60336256",
"0.6002045",
"0.6001661",
"0.6001661",
"0.5900329",
"0.58917844",
"0.58917844",
"0.58917844",
"0.58917844",
"0.58917844",
"0.579... | 0.76432955 | 0 |
Deletes any images written to Cloud Storage as part of this submission. This function chops up the download URLs stored in imageURLs (which were initially stored in the Quest_Images field [in Firestore] of the task being processed) to create a deletion reference. This reference is then used to remove the submitted imag... | function deleteStoredImages() {
let storageRef = storage.ref();
for (var i = 0; i < imageURLs.length; i++)
deleteRef = imageURLs[i].replace("https://firebasestorage.googleapis.com/v0/b/greenquest-"
+ "5f80c.appspot.com/o/images%2Fquests%2F", "");
deleteRef = deleteRef.substr(0, deleteRef... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function deleteUrlImages(urls) {\n // console.log(\"deleteUrlImages: \", urls);\n // for (const index in urls) {\n // const url = urls[index];\n // const bucket = storage.bucket(bucketName);\n // const fullname = url.split(\"/\").pop();\n // const filename = fullname.substr(0, fullname.lastInde... | [
"0.6219239",
"0.61231875",
"0.6106198",
"0.6085388",
"0.6047286",
"0.59426004",
"0.592962",
"0.58316946",
"0.57855874",
"0.5651973",
"0.56514376",
"0.565007",
"0.5636154",
"0.56078166",
"0.5563669",
"0.55102724",
"0.5507827",
"0.5480002",
"0.5470025",
"0.5460192",
"0.54339135... | 0.79671305 | 0 |
Displays a success message to the screen once the function cascade for processing a quest (approving or rejecting) is complete. After this message has been displayed, the page reloads. | function displaySuccessMessage() {
$("#feedback").html("Success! Please wait...");
$("#feedback").css({
color: "green"
});
$("#feedback").show(0);
$("#feedback").fadeOut(1000);
setTimeout(function () {
// Refresh the page (will be redirected if there are no more quests to approve... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function success() {\n\n Modal.success({\n okText:\"Done\",\n title: 'Submit successful!',\n // content: 'View your requests to see your new entry.',\n onOk() {\n doneRedirect();\n }\n });\n }",
"function confirmSubmitEvaluation(){\n\tvar id = ADLoginID;\n\tvar success = fu... | [
"0.67810553",
"0.6694349",
"0.66892713",
"0.66729546",
"0.66637367",
"0.6554297",
"0.65004104",
"0.6475498",
"0.6432545",
"0.6405143",
"0.63702124",
"0.6330878",
"0.62807924",
"0.6279572",
"0.6256555",
"0.62378997",
"0.62148374",
"0.621018",
"0.62070066",
"0.6199649",
"0.6183... | 0.7201666 | 0 |
Creates a new FirebaseConfig object using the given Firebase URL. | function FirebaseConfig(url) {
this.url = url;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function FirebaseConfig(url) {\n this.url = url;\n }",
"function firebaseConfigModule(firebase){\n\n //firebase cfg\n const config = {\n apiKey: \"AIzaSyC0G_puVkQgwqL1wICl4TuQigccVJ2u7xw\",\n authDomain: \"scakapo-2f1c6.firebaseapp.com\",\n databaseURL: \"https://scakapo-2f1c... | [
"0.8168485",
"0.59931433",
"0.57452524",
"0.5602467",
"0.55761135",
"0.555744",
"0.5419042",
"0.5358291",
"0.5152212",
"0.5112758",
"0.5109703",
"0.50556844",
"0.50237465",
"0.50165427",
"0.49737027",
"0.49534246",
"0.49374336",
"0.48140484",
"0.48140484",
"0.4811429",
"0.481... | 0.8108659 | 1 |
Creates a new FirebaseArray using the given FirebaseService. | function FirebaseArray(firebaseService) {
/**
* @type {boolean}
* @private
*/
this._initialized = false;
this._subject = new Rx_2.Subject();
this._service = firebaseService;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getTodos(){\n var ref = new Firebase(\"https://todoslist123.firebaseio.com/\");\n var todos = $firebaseArray(ref);\n return todos\n }",
"function partyService($firebaseArray, firebaseDataService) {\n var parties = null;\n\n var service = {\n Party: ... | [
"0.5754987",
"0.55969155",
"0.55748934",
"0.53660274",
"0.5120946",
"0.5102236",
"0.5058383",
"0.49391195",
"0.49285457",
"0.49268696",
"0.4907773",
"0.4901413",
"0.48975757",
"0.48866323",
"0.48752955",
"0.4837728",
"0.4837728",
"0.4835641",
"0.4797186",
"0.47918162",
"0.477... | 0.7619588 | 0 |
Creates a new FirebaseService using the given Firebase JavaScript API Object. | function FirebaseService(firebase) {
this._firebase = firebase;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createFirebaseNamespace() {\n var apps_ = {};\n var factories = {};\n var appHooks = {};\n // A namespace is a plain JavaScript Object.\n var namespace = {\n // Hack to prevent Babel from modifying the object returned\n // as the firebase namespace.\n '__esModule': true... | [
"0.63466716",
"0.634142",
"0.6033429",
"0.598905",
"0.598905",
"0.5940176",
"0.5940176",
"0.5881586",
"0.5877144",
"0.5810165",
"0.5789278",
"0.5784724",
"0.5784724",
"0.5781408",
"0.5778169",
"0.57726747",
"0.5765772",
"0.57595575",
"0.5756492",
"0.57002157",
"0.5693069",
... | 0.6793954 | 0 |
Initializes a new FirebaseAuthService using the given FirebaseService. | function FirebaseAuthService(firebase) {
this._firebase = firebase;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function FirebaseService(firebase) {\n this._firebase = firebase;\n }",
"constructor() {\n this._authService = new AuthService(); \n }",
"static initialize(handleFirebaseCriticalSyncErrorCallback = () => { }) {\n if (isInitialized)\n throw new Error... | [
"0.7371357",
"0.6507285",
"0.6090614",
"0.5998904",
"0.59717643",
"0.59717643",
"0.5953636",
"0.5942074",
"0.5913234",
"0.5913234",
"0.5903347",
"0.5877401",
"0.587538",
"0.5864512",
"0.58629465",
"0.58594185",
"0.5858208",
"0.5781532",
"0.5735681",
"0.5735681",
"0.5720489",
... | 0.8146348 | 0 |
Bloque de Funciones para Mostrar los Formularios Mostrar Formulario de Alta Persona | function mostrarAltaPersona() {
ocultarFormularios();
formAltaConductor.style.display = "block";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function mostrar(per_id){\n\t$.post(\"../ajax/persona.php?op=mostrar\",{per_id : per_id}, function(data, status)\n\t{\n\t\tdata = JSON.parse(data);\n\t\tmostrarform(true);\n\t\t// $(\"#nombredelinput\") Corresponde al name de los inputs del form\n\n// Impementacion de metodo para listar registros\n\n\t\t$(\"#per_i... | [
"0.6623038",
"0.65201133",
"0.6512037",
"0.65110147",
"0.65080976",
"0.6502709",
"0.6440375",
"0.643682",
"0.64342064",
"0.6393938",
"0.63895464",
"0.6349848",
"0.63491327",
"0.63423485",
"0.6332897",
"0.6327468",
"0.6327453",
"0.63219386",
"0.63047034",
"0.6301595",
"0.63001... | 0.7356604 | 0 |
Mostrar Formulario de Registro Multa | function mostrarRegistroMulta() {
ocultarFormularios();
formRegistroMulta.style.display = "block";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function mostrarImprimirMulta() {\n ocultarFormularios();\n formImprimirMulta.style.display = \"block\";\n}",
"function registrar_esquema_comision(){\n\t\tenviarFormulario(\"#form_esquema_comision_registrar\", 'EsquemaComision/registrar_esquema_comision', '#cuadro2');\n\t}",
"function mostrarFormulario(){\n ... | [
"0.6389304",
"0.6151291",
"0.61450255",
"0.61104155",
"0.6108721",
"0.60909855",
"0.6016289",
"0.59516054",
"0.59307396",
"0.592842",
"0.59283984",
"0.5916629",
"0.59164685",
"0.5914713",
"0.59094656",
"0.5897771",
"0.5896887",
"0.58950424",
"0.58673924",
"0.58671606",
"0.586... | 0.662697 | 0 |
Mostrar Formulario de Pagar Multa | function mostrarPagarMulta() {
ocultarFormularios();
formPagarMulta.style.display = "block";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function bus_OrdenPago()\n{ \n\tdebugger;\n var Filtros = new Object();\n\tFiltros.COD_DOC_PAGO= $(\"#COD_DOC_PAGO\").val();\n Filtros.DOC_PAGO_FECHA= $(\"#DOC_PAGO_FECHA\").val();\n Filtros.NOMB_OFICINA= $(\"#NOMB_OFICINA\").val();\n Filtros.NOM_TIPOPAGO= $(\"#NOM_TIPOPAGO\").val();\n \n\t\n Filt... | [
"0.5866961",
"0.5777196",
"0.57661223",
"0.57104397",
"0.5700534",
"0.56441253",
"0.56192535",
"0.5582666",
"0.55503917",
"0.5546747",
"0.55442154",
"0.5543503",
"0.5533761",
"0.5515418",
"0.5513521",
"0.549514",
"0.549514",
"0.54923713",
"0.54910266",
"0.5471665",
"0.5469649... | 0.7093948 | 0 |
Mostrar Formulario de Imprimir Multa | function mostrarImprimirMulta() {
ocultarFormularios();
formImprimirMulta.style.display = "block";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function multiffprocessing() {\n /*Récupération des données*/\n var titre = document.multifanfictionform.titre.value; //titre de la fanfiction\n var image = document.multifanfictionform.image.value; //image\n var livre = document.multifanfictionform.livre.value; //livre d'inspiration\n var auteur... | [
"0.6055716",
"0.6013151",
"0.59852666",
"0.59588575",
"0.5778195",
"0.570137",
"0.5694055",
"0.56779057",
"0.5617008",
"0.55137223",
"0.54657346",
"0.5449841",
"0.5439421",
"0.54094154",
"0.54079133",
"0.53987145",
"0.5383052",
"0.53560245",
"0.5321824",
"0.53207034",
"0.5308... | 0.7465648 | 0 |
Mostrar Formulario de Listado de Multas por Fechas | function mostrarListadoMultasPorFecha(){
ocultarFormularios();
formListarMultasFecha.style.display = "block";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function multi(){\n let ergebnis = document.getElementById(\"Nummer\").value * 2;\n document.getElementById(\"Ergebnis\").innerHTML = ergebnis;\n}",
"static buildForms() {\r\n const bld = new Immeuble()\r\n let forms = []\r\n forms.push(\r\n bld.Batiment1(),\r\n bld.Porte(),\r\n ... | [
"0.5898017",
"0.5863462",
"0.57419336",
"0.569262",
"0.5633316",
"0.5573123",
"0.555269",
"0.55114996",
"0.5495869",
"0.54951453",
"0.5480718",
"0.54623574",
"0.54314",
"0.54288775",
"0.5409564",
"0.5409251",
"0.53970623",
"0.5392584",
"0.5377175",
"0.5376473",
"0.53535235",
... | 0.6266339 | 0 |
Parses the specified string as a variant of the enum `Shell`. If it fails to match the string, it returns `Shell.Shell` | function parseShell(shell) {
if (shell.includes('powershell')) {
return Shell.PowerShell;
}
if (shell.includes('cmd')) {
return Shell.CMD;
}
return Shell.Shell;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ShellString(str) {\n return str;\n }",
"function getSystemShell(p) {\n if (p === 3 /* Windows */) {\n if (platform.isWindows) {\n return getSystemShellWindows();\n }\n // Don't detect Windows shell when not on Windows\n return pro... | [
"0.53237665",
"0.51195204",
"0.47934747",
"0.47909257",
"0.4767639",
"0.4753244",
"0.47480485",
"0.47166675",
"0.47065464",
"0.46588832",
"0.46013772",
"0.45969212",
"0.45819557",
"0.45668483",
"0.44846818",
"0.44826022",
"0.4467651",
"0.44536597",
"0.44512928",
"0.44277593",
... | 0.76043856 | 0 |
Creates a command to set the environment variable | function getCommandToSetEnvVar(shell, varName, varValue) {
switch (shell) {
case Shell.PowerShell:
return `$ENV:${varName}="${varValue}"`;
case Shell.CMD:
return `set ${varName}=${varValue}`;
case Shell.Shell:
return ` export ${varName}=${varValue}`... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setEnvVar(name, value) {\n // Set variable both as env var and as step variable, which might be re-used in subseqeunt steps. \n process.env[name] = value;\n this.baseLib.setVariable(name, value);\n this.baseLib.debug(`Set variable and the env variable '${name}' to value '${value}'.`);\... | [
"0.5948974",
"0.59244084",
"0.57181674",
"0.5705572",
"0.5705572",
"0.5697054",
"0.5697054",
"0.5697054",
"0.5697054",
"0.5697054",
"0.5629458",
"0.5589265",
"0.55787414",
"0.55787414",
"0.55787414",
"0.55787414",
"0.55787414",
"0.55787414",
"0.5475431",
"0.54573697",
"0.5448... | 0.63421094 | 0 |
Escapes spaces in the specified string in the way appropriate to the specified shell | function escapeSpaces(s, shell) {
if (!s.includes(' ')) {
return s;
}
switch (shell) {
case Shell.PowerShell:
// Unescape
s = s.replace(new RegExp('` ', 'g'), ' ');
// Escape
return s.replace(new RegExp(' ', 'g'), '` ');
case ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function escapeShellArg(s) {\n s = s.replace(/\"/g, '\\\\\"');\n return '\"' + s + '\"';\n}",
"function escapeString$1(str) {\n return str.replace(/([.+*?=^!:${}()[\\]|/\\\\])/g, \"\\\\$1\");\n}",
"function escapeString(str) {\n return str.replace(/([.+*?=^!:${}()[\\]|/\\\\])/g, '\\\\$1');\n}",
"... | [
"0.684918",
"0.62760705",
"0.6206035",
"0.61948127",
"0.61948127",
"0.61948127",
"0.61948127",
"0.61948127",
"0.61948127",
"0.61948127",
"0.61948127",
"0.61948127",
"0.61948127",
"0.61948127",
"0.61948127",
"0.61948127",
"0.6178597",
"0.61772984",
"0.6164074",
"0.6090102",
"0... | 0.811103 | 0 |
Prepares the specified arguments to be passed to the specified shell and constructs the command from the arguments | function getCommandForArgs(shell, args) {
args = args.map(a => escapeSpaces(a, shell));
return args.join(' ');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"constructor (command, ...args) {\n super(command, ...args)\n }",
"constructor (command, ...args) {\n super(command, ...args)\n }",
"function shellCreate(args)\n{ \n if(args[0].indexOf(\"@\") === 0)\n _StdIn.putText(\"@ is a reserved leading character!\");\n else\n krnDiskCreate(a... | [
"0.52053946",
"0.52053946",
"0.5163698",
"0.5105189",
"0.50903296",
"0.50903296",
"0.5060668",
"0.5060668",
"0.5060668",
"0.5060668",
"0.5044509",
"0.5014132",
"0.4993373",
"0.4993373",
"0.4993373",
"0.49817312",
"0.49810392",
"0.4971258",
"0.493296",
"0.49141386",
"0.4914138... | 0.6542918 | 0 |
Creates a command to execute several statements one by one if the previous one is succeed | function getCommandToExecuteStatementsOneByOneIfPreviousIsSucceed(shell, statements) {
if (statements.length === 0) {
return '';
}
if (process.platform === 'win32' && shell === Shell.PowerShell) {
let command = statements[0];
for (let i = 1; i < statements.length; ++i) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"execute() {}",
"execute() {}",
"async execute() {\n let command;\n let i = 0;\n do {\n command = this.commands[i];\n if (command instanceof Loop) {\n if (command.count > 0) {\n if (command.delay != 0) {\n await Typewriter.sleep(command.de... | [
"0.5994197",
"0.5994197",
"0.59680295",
"0.5735224",
"0.56925404",
"0.5589465",
"0.55760586",
"0.55393744",
"0.54520106",
"0.54437536",
"0.54437536",
"0.5440892",
"0.5394558",
"0.5387658",
"0.53776264",
"0.53062576",
"0.5224383",
"0.5220434",
"0.5207731",
"0.5206108",
"0.5190... | 0.68527913 | 0 |
Used to update or create a user entry in the Azure Table | function updateUser(tableSvc, username, amount) {
const userEntry = {
PartitionKey: ENTGEN.String(username),
RowKey: ENTGEN.String('1'),
schreefstock: ENTGEN.Int32(amount),
};
tableSvc.insertOrReplaceEntity(TABLENAME, userEntry, null, (error, result, response) => {
if (!error) {
// Entity u... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"updateUser (context, user) {\n context.commit('updateUser', user)\n }",
"function addUserToTable(username, userType, userId) {\n users.set(userId, {username: username, userType: userType})\n refreshUserTable();\n}",
"static createUser(userid, userEmail, lastname){\n admin.database().ref('user/... | [
"0.638075",
"0.6364256",
"0.63189864",
"0.62745106",
"0.6256338",
"0.6227872",
"0.6207704",
"0.611949",
"0.6116671",
"0.6116172",
"0.608469",
"0.59961635",
"0.59404755",
"0.59273213",
"0.59067625",
"0.58952326",
"0.58849984",
"0.58836716",
"0.5876799",
"0.58534575",
"0.584156... | 0.69913846 | 0 |
EXPLAIN YOUR LOGIC BELOW! (Required) Tidak harus formal pseudocode, tapi bagaimana step by step logikanya Nilai tidak valid (0) jika logic dan code berbeda! / Algoritma: buat fungsi 'passGen' dengan 3 parameter 'fistName', 'email' dan 'age' jika panjang 'firstName' kurang dari 3 maka return 'NAME IS INVALID' buat varia... | function passGen(firstName, email, age) {
// only code here!
if (firstName.length < 3 ){
return 'NAME IS INVALID';
}
var word1 = firstName.slice(0,3);
var word2 = '';
var isKeong = false;
for (var i = 0; i < email.length ; i++){
if (email[i] === '@'){
isKeong = true;
}
if (email[i] !... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createPass(lower, upper, special, number, length){\n \n //Letting it Equal a string//\n let createPass = \"\";\n\n //Determines how many types are checked off\n const typesCount = lower + upper + special + number;\n \n\n // Identfies which arrays are checked\n const typesArr = ... | [
"0.65893716",
"0.65587443",
"0.65121555",
"0.639172",
"0.63889676",
"0.6350912",
"0.6319893",
"0.6270991",
"0.62383604",
"0.62261456",
"0.62251234",
"0.62228495",
"0.6216671",
"0.61792666",
"0.61626554",
"0.61566085",
"0.61559284",
"0.6120526",
"0.6118767",
"0.6112049",
"0.61... | 0.76390713 | 0 |
for Each Sim Update Sim Card Records version 1.1.2 splitting the voucher numbers AS | function forEachVoucherRecord()
{
var voucherArray = new Array();
try
{
//number format : voucherNumber voucherNumber voucherNumber .. the numbers are seperated by new line eventhough it shows as ''.
//hence splitting the numbers by '/n' to get the numbers separately
voucherArray = itemVouchers.sp... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function fnSerUpdateBackSerialinGet(enteredBin)\n{\n\n\tvar filterssertemp1 = new Array();\n\tfilterssertemp1[0] = new nlobjSearchFilter('custrecord_wmsse_ser_status', null, 'is', 'F');\n\tfilterssertemp1[1] = new nlobjSearchFilter('custrecord_wmsse_ser_tasktype', null, 'anyof', 18);//18--XFER\n\tfilterssertemp1[2... | [
"0.58976567",
"0.5829497",
"0.54584557",
"0.52365786",
"0.5218259",
"0.51331156",
"0.5119717",
"0.50802946",
"0.5061981",
"0.5061981",
"0.50515574",
"0.50397605",
"0.50306195",
"0.5026496",
"0.50254756",
"0.50133216",
"0.5009241",
"0.50076175",
"0.49897996",
"0.49797517",
"0.... | 0.70831096 | 0 |
setting each voucher number in a new line version 1.1.2 splitting the voucher numbers AS | function setVoucherNumber(voucherNumber)
{
//cannot put '+' sign at the end of the line, hence using concat (format is : + voucher number + '<br/>' + voucher number + <br/> )
pdfxml = pdfxml.concat(voucherNumber + '<br/>');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function forEachVoucherRecord()\r\n{\r\n\tvar voucherArray = new Array();\r\n\t\r\n\t\r\n\ttry\r\n\t{\r\n\t\t//number format : voucherNumber voucherNumber voucherNumber .. the numbers are seperated by new line eventhough it shows as ''.\r\n\t\t//hence splitting the numbers by '/n' to get the numbers separately\r\n... | [
"0.7746141",
"0.54889876",
"0.5461868",
"0.528648",
"0.5239778",
"0.5213098",
"0.51986116",
"0.51699585",
"0.515731",
"0.5150056",
"0.5132323",
"0.5123661",
"0.5078604",
"0.5054967",
"0.5051576",
"0.50171447",
"0.50153154",
"0.4978176",
"0.4973686",
"0.49564618",
"0.49258605"... | 0.65576935 | 1 |
getInvoiceInformation getting the invoice line fields | function getInvoiceLineFields(lineNumber)
{
try
{
itemName = nlapiEscapeXML(invoiceRecord.getLineItemText('item', 'item', lineNumber));
itemQuantity = nlapiEscapeXML(invoiceRecord.getLineItemValue('item', 'quantity', lineNumber));
itemDescription = nlapiEscapeXML(invoiceRecord.getLineItemValue('item', ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getInvoiceLineDetails()\r\n{\r\n\t\r\n\ttry\r\n\t{\r\n\t\titemObj = new Object();\r\n\t\titemObj.code = splitOutValue(invoiceSplit[16]);\r\n\t\titemObj.disccountCode = itemObj.code; \t// 1.0.6 done because the code will be overridden to the discount item code where the item is a discount line and \r\n\t\... | [
"0.77121025",
"0.6420261",
"0.6175986",
"0.61235815",
"0.57713777",
"0.5474188",
"0.5444761",
"0.5437765",
"0.5401063",
"0.5360377",
"0.53227955",
"0.52412707",
"0.52349037",
"0.52202946",
"0.521872",
"0.5213307",
"0.52100337",
"0.5168131",
"0.5160298",
"0.5138386",
"0.512516... | 0.6968621 | 1 |
I don't remember when I made this but it works Decrease the mining reward by half every 200 blocks I guess | getMinningReward(blockId){
return 10/Math.pow(2,Math.floor((blockId-1)/200))
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function main () {\n async function sendRewards (rewardTokenAddress, totalRewardAmount, trackedTokenAddress, startingBlock, endingBlock) {\n if (endingBlock == null) {\n endingBlock = await ethers.provider.getBlockNumber()\n }\n console.log('startingBlock:', startingBlock)\n console.log('en... | [
"0.6217392",
"0.61441433",
"0.6099156",
"0.6052369",
"0.60142815",
"0.6007919",
"0.6004231",
"0.5985739",
"0.5945736",
"0.59307843",
"0.5922662",
"0.5922307",
"0.5909339",
"0.58873516",
"0.5880338",
"0.58726346",
"0.58541054",
"0.58285797",
"0.5812542",
"0.58114105",
"0.58036... | 0.6955024 | 0 |
Deletes query and dismisses this component | delete() {
this.props.deleteQuery(this.state.query);
this.dismiss();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"destroy() {\n this.unmonitorForChanges();\n this.set('status', this.is(EMPTY) ? NON_EXISTENT : DESTROYED);\n this.get('store').removeQuery(this);\n Query.parent.destroy.call(this);\n }",
"deleteQuery(query) {}",
"cancel() {\n this.end();\n queryManager.cancelQuery(this);\n ... | [
"0.6992858",
"0.64412457",
"0.64326",
"0.6288797",
"0.62401414",
"0.61730283",
"0.60211104",
"0.6014213",
"0.5894387",
"0.5855009",
"0.58408564",
"0.58395916",
"0.5802503",
"0.57977027",
"0.57709676",
"0.5744476",
"0.5744476",
"0.5707302",
"0.5691414",
"0.5676577",
"0.5670972... | 0.77207536 | 0 |
Sets colored underlines under query representing NLP entity | colorEntities() {
var content = document.getElementById("nlpQuery");
if (!content) return;
content.innerHTML = "";
var entityCount = Object.keys(this.state.query.entities).length;
if (entityCount === 0) {
content.innerHTML = this.state.query.text;
} else {
const maxWidth = 28;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function changetextunderline() {\n var currentIndex = findCurrentIndex(tempKey);\n if (mainDiagram.model.nodeDataArray[currentIndex].isUnderline) {\n mainDiagram.model.nodeDataArray[currentIndex].isUnderline = false\n document.getElementById(\"underline\").style.backgroundColor = \"white\"\n ... | [
"0.62435746",
"0.5797687",
"0.56480616",
"0.554107",
"0.5491883",
"0.5485339",
"0.53832483",
"0.53745544",
"0.53657085",
"0.5361096",
"0.5352896",
"0.531366",
"0.5304561",
"0.5302044",
"0.5215458",
"0.52144337",
"0.51794916",
"0.51563376",
"0.51483023",
"0.5117878",
"0.511603... | 0.631992 | 0 |
function takes all inputs and return only those that should be shifted | function gatherInputsToShift(all, curr, prev) {
const firstToShift = curr.dataset.no * 1 < prev.dataset.no * 1 ? curr : prev;
const lastToShift = curr.dataset.no * 1 < prev.dataset.no * 1 ? prev : curr;
const firstIndex = all.findIndex( function (input) {
return input == firstToShift;
});
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function shiftArrayButSkip(a, e) \n{\n let tmp = a[0];\n\n for (let i=0, j = 1; j < a.length && i < a.length; j++, i++)\n {\n \n if (a[j]==e)\n {\n \n tmp = a[a.length-1];\n a[j] = a[i];\n \n //a.pop(... | [
"0.63915324",
"0.62749064",
"0.6274555",
"0.6161049",
"0.60975856",
"0.6066382",
"0.5992766",
"0.5972377",
"0.5927518",
"0.5927464",
"0.5924802",
"0.5922629",
"0.5905802",
"0.58757615",
"0.5861182",
"0.5773087",
"0.57538104",
"0.57428086",
"0.57364935",
"0.5721113",
"0.569564... | 0.7219382 | 0 |
Get the sequence entered from the HTML. | function getSequenceFromUI() {
let seqData = jqueryElements.sequenceData.val();
let seq = '';
if (typeof (seqData) == 'string') {
seq = seqData.trim();
seq = seq.toUpperCase(); //set the sequence to be upper case automatically -- for user convenience
// Remove spaces if exists betwee... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getYerlesenNumber(html) {\n return html.match(/\\>[0-9]{1,3}|(---)?<\\/font></)[1]\n }",
"get sequence() {\n\t\treturn this.__sequence;\n\t}",
"get sequence() {\n\t\treturn this.__sequence;\n\t}",
"function getNoteCode() {\n //var repeatCode = $('#notes',iPage).text();\n var repeatCode = $('#... | [
"0.5616617",
"0.55569494",
"0.55569494",
"0.53738075",
"0.53133017",
"0.52932215",
"0.5281732",
"0.5246778",
"0.52286667",
"0.49837777",
"0.4958282",
"0.49077457",
"0.4906925",
"0.49068564",
"0.4898427",
"0.48979563",
"0.48832834",
"0.48830158",
"0.4857678",
"0.48494583",
"0.... | 0.659355 | 0 |
Moves files to the dist directory | function move()
{
var streams = pathConfig.move.map( function( folder )
{
return gulp.src( getGlob( folder ) )
.pipe( $.changed( folder.dist ) )
.pipe( gulp.dest( folder.dist ) );
} );
return $.mergeStream( streams );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function wipedist(done) {\n\tif (directoryExists(path.join(__dirname, \"/dist/\"))) {\n\t\twipe(path.join(__dirname, '/dist/'), done);\n\t} else {\n\t\tdone();\n\t}\n\n}",
"async function cleanDist() {\n const files = fs.readdirSync(destFolder);\n for (const file of files) {\n await del(path.resolve... | [
"0.7215907",
"0.7126174",
"0.6715883",
"0.6715883",
"0.6651865",
"0.6641988",
"0.66331244",
"0.66331244",
"0.65894336",
"0.6556895",
"0.6551097",
"0.6535499",
"0.6475362",
"0.6462346",
"0.6439189",
"0.63876975",
"0.63876975",
"0.63876975",
"0.63876975",
"0.63876975",
"0.63876... | 0.71919143 | 1 |
Merges SVGs into sprite and moves processed files to the dist directory | function svgSprite()
{
var folders = getFolders( "./src/img/vector/" );
var streams = folders.map( function( folder )
{
return gulp.src( "./src/img/vector/" + folder + "/**/*.svg" )
.pipe( $.svgSprite( taskConfig.svgSprite.svgSprite ) )
.pipe( gulp.dest( "./build/img/vector/... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function compileSprite() {\n build.logger('Building icons sprite', '[Started]', 'Adding SVG sources');\n\n const SVG = new SVGSprite(spriteConfig);\n addIconFiles(SVG);\n SVG.compile(processCompile);\n\n build.logger(\n 'Building icons sprite',\n '[Finished]',\n build.cLog(`Check: ${iconsOutputPath}`... | [
"0.662362",
"0.65888715",
"0.6316706",
"0.6155401",
"0.6152514",
"0.61487615",
"0.5940867",
"0.58366776",
"0.5823346",
"0.5741507",
"0.57273066",
"0.56652135",
"0.56424946",
"0.5591898",
"0.55886585",
"0.5544208",
"0.55431384",
"0.55262333",
"0.55231136",
"0.55165106",
"0.550... | 0.75272053 | 0 |
Clips empty files, AutoPrefixes css, combines media queries, minifes css and moves processed files to the dist directory | function css()
{
var streams = pathConfig.css.map( function( folder )
{
return gulp.src( getGlob( folder ) )
.pipe( $.clipEmptyFiles() )
.pipe( !$.util.env.production && !folder.thirdParty ? $.sass.sync().on( 'error', $.sass.logError ) : $.util.noop() )
.pipe( $.util.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function buildNormalize() {\r\n return src(paths.normalize)\r\n .pipe(cleanCSS())\r\n .pipe(size({ showFiles: true }))\r\n .pipe(dest(paths.prodCSS));\r\n}",
"function cssClean() {\n return gulp\n .src([\"./src/css/*.less\", \"./src/css/*.css\"])\n .pipe(less())\n .pipe(csso())\... | [
"0.7179466",
"0.6776066",
"0.6703189",
"0.6556175",
"0.65425956",
"0.6540485",
"0.6538282",
"0.65328145",
"0.6495512",
"0.64881897",
"0.64841133",
"0.6481614",
"0.64808965",
"0.64808404",
"0.6457158",
"0.6455342",
"0.6437428",
"0.6418598",
"0.63903046",
"0.63646203",
"0.63529... | 0.6805178 | 1 |
generate random symbol from symbolString | function randomSymbol() {
// variable to grab letter from symbolString by running Math.random rounded down multiplied by length of symbolString
var randSymbol = symbolString[Math.floor(Math.random() * symbolString.length)];
return randSymbol;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getRandomSymbol(){\n const symbols = `!@#$%^&*(){}[]=<>/,.`;\n // Returning a random symbol using a random index in the \"symbols\" string\n return symbols[randomIndex(symbols)];\n }",
"function getRandomSymbol(){\n var symbol = \"!@#$%^&*(){}[]=<>/,.|~?\";\n return symbol[Math.floor(Math.ra... | [
"0.8336522",
"0.80959916",
"0.79895353",
"0.79875225",
"0.7945277",
"0.78718126",
"0.7808467",
"0.75693524",
"0.7043993",
"0.63915986",
"0.61966956",
"0.6188956",
"0.6168151",
"0.61663467",
"0.6162784",
"0.61390895",
"0.61056197",
"0.6042039",
"0.6040106",
"0.60395753",
"0.60... | 0.85888773 | 0 |
Given a number of fifths, return the octaves they span | function fOcts (f) { return Math.floor(f * 7 / 12) } | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function layers(n){\n let base\n for (let i = 1; true; i += 2) {\n if (n <= i ** 2) {\n base = i\n break\n }\n }\n return n === 1 ? 1 : Math.ceil(base / 2)\n}",
"function genOctave(oct, start, end) {\n var keys = [];\n for (var i = start; i < end; i++) {\n ... | [
"0.59052783",
"0.56662977",
"0.562939",
"0.5604417",
"0.5600495",
"0.5582637",
"0.5578253",
"0.553076",
"0.5520498",
"0.5519904",
"0.5519109",
"0.5509354",
"0.54882354",
"0.53817534",
"0.5372994",
"0.53675413",
"0.5352184",
"0.53475827",
"0.5345459",
"0.5339863",
"0.5332529",... | 0.61611456 | 0 |
Pass our store instance and the HTML element up to the parent Component | constructor() {
super({
store,
element: document.querySelector('.choices')
})
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"render () {\n\t\t//return JSX, can only return one parent element \n\t\treturn (\n\t\t\t<form className=\"store-selector\" onSubmit={this.goToStore.bind(this)}> {/*this binds the gotoStore method to this(StorePicker component) */}\n\t\t{ /* this is a comment in jsx */}\n\t\t\t\t<h2>Please Enter a Store</h2>\n\n\t\... | [
"0.65333414",
"0.62603366",
"0.62013793",
"0.6191214",
"0.6172862",
"0.61667895",
"0.6060676",
"0.600559",
"0.6003034",
"0.5977345",
"0.5974356",
"0.59717035",
"0.59276783",
"0.5916986",
"0.5884776",
"0.58298403",
"0.5804329",
"0.5795607",
"0.5793867",
"0.5763819",
"0.5760685... | 0.62609035 | 1 |
Find a rank from our cache, based on ID | function getCachedRankFromId(ID, li) {
let name = fullNameFromLi(li);
log('Looking for ' + name + + ' [' + ID + '] in cache...');
let isHosped = isInHosp(li);
let inFed = isFedded(li);
let travelling = isTravelling(li);
if (isHosped || inFed || travelling) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getRankFromId(ID, li) {\n debug('getRankFromId: ID ' + ID + ' classList: ' + li.classList);\n\n if (opt_disabled) {\n log('Script disabled - ignoring.');\n return true;\n }\n\n if (li.classList.contains('filter-hidden') || li.classList.contains('xedx_hidde... | [
"0.6882167",
"0.6525145",
"0.57915145",
"0.57854813",
"0.5780827",
"0.57766885",
"0.572897",
"0.5651852",
"0.55343354",
"0.5448035",
"0.54416317",
"0.54351306",
"0.54109025",
"0.5400086",
"0.5347169",
"0.53348845",
"0.53229666",
"0.53173834",
"0.52993387",
"0.5279725",
"0.527... | 0.8092705 | 0 |
Write out some cache stats | function writeCacheStats() {
let now = new Date().getTime();
let lastAccess = GM_getValue('LastCacheAccess', 0);
let arrayOfKeys = GM_listValues();
log('Cache stats:\nNow: ' + now + '\nLast Access: ' + lastAccess +
'Cache Age: ' + (now - lastAccess)/1000 + ' seconds.\nItem Co... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sendStats() {\n push('stats', {\n hits: hits,\n totalHits: totalHits,\n bytes: bytes,\n totalBytes: totalBytes,\n cost: cost,\n totalCost: totalCost,\n period: STATS_PERIOD,\n uptime: +(new Date) - startTime\n });\n\n hits = 0;\n bytes = ... | [
"0.6212244",
"0.6038747",
"0.59540606",
"0.5870846",
"0.5870846",
"0.5870846",
"0.5870846",
"0.5870846",
"0.5870846",
"0.5870846",
"0.5870846",
"0.5850751",
"0.58500826",
"0.5845552",
"0.58448666",
"0.5829102",
"0.58144915",
"0.58144915",
"0.5808177",
"0.5808177",
"0.5808177"... | 0.8274877 | 0 |
Prefilter just based on icons in the li If filtered, return TRUE | function preFilter(li) {
let ID = idFromLi(li);
let name = fullNameFromLi(li);
log("Pre-filtering " + name + ' [' + ID + ']');
if (opt_hidehosp && isInHosp(li)) {
log('***** preFilter: in hospital! (' + name + + ' [' + ID + '])');
return true;
}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function doFilter() {\n for (var i = 0; i < items.length; i++) {\n // show all\n items[i].classList.remove('thumb--inactive');\n\n // combine filters\n // - only those items will be displayed who satisfy all filter criterias\n var visible = true;\n\n for (var j = 0; j < visibleItem... | [
"0.66968584",
"0.5993452",
"0.5945768",
"0.58124036",
"0.5770372",
"0.5757469",
"0.5749496",
"0.57453656",
"0.57293445",
"0.5727036",
"0.5719836",
"0.56835794",
"0.56629926",
"0.5659953",
"0.56252825",
"0.56234473",
"0.56197816",
"0.56105673",
"0.5604747",
"0.5601569",
"0.555... | 0.64668316 | 1 |
UI related stuff, namely options //////////////////////////////////////////////////////////////////// Build the main UI | function buildUI() {
getSavedOptions();
if (validPointer(document.getElementById('xedx-main-div'))) {
log('UI already installed!');
return;
}
let parentDiv = document.querySelector("#mainContainer > div.content-wrapper > div.userlist-wrapper");
if (!valid... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function buildUI(){\t\n\t\t\n\t\treturn;\n\t\t\n\t}",
"function buildUI() {\n setPageTitle();\n showMessageFormIfViewingSelf();\n fillMap();\n fetchLanguage();\n getInfo();\n// buildLanguageLinks();\n}",
"function buildUI() {\n loadNavigation();\n setPageTitle();\n fetchBlobstoreUrlAndShowMessag... | [
"0.78531134",
"0.7206678",
"0.6952446",
"0.68871677",
"0.6792505",
"0.6782162",
"0.6702228",
"0.659606",
"0.65407026",
"0.65167165",
"0.642239",
"0.6402608",
"0.6399779",
"0.63762975",
"0.6344952",
"0.63009113",
"0.62473",
"0.6199705",
"0.6154661",
"0.61278635",
"0.61218894",... | 0.7617213 | 1 |
Function to display cache contents TBD: Add storage cache | function displayCache() {
debug('displayCache');
// var rank_cache = [{ID: 0, numeric_rank: 0, name: '', state: '', description: ''}];
var output = 'Mem Cached Users:\n\n';
let rc = rank_cache;
for (let i = 0; i < rc.length; i++) {
output += 'Name: "' + rc[i].name + '... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateCache() {\n if (currentCache > caches.length) {\n currentCache = 0;\n }\n currentCache++;\n showCache();\n}",
"function updateStorageUsed() {\n chrome.storage.local.getBytesInUse(\"caches\", function(bytes) {\n document.getElementById(\"storage-used\").innerHTML = bytes;\n });... | [
"0.64438236",
"0.6266873",
"0.62296486",
"0.61985016",
"0.61394614",
"0.61175805",
"0.6086243",
"0.6026549",
"0.60122204",
"0.59800786",
"0.592669",
"0.59044",
"0.58917624",
"0.5891287",
"0.58724123",
"0.58624625",
"0.58506703",
"0.5832471",
"0.5768132",
"0.57678074",
"0.5759... | 0.7028926 | 0 |
Check checkboxes to default. | function setDefaultCheckboxes() {
log('Setting default state of checkboxes.');
$("#xedx-loggingEnabled-opt")[0].checked = GM_getValue("opt_loggingEnabled", opt_loggingEnabled);
$("#xedx-devmode-opt")[0].checked = GM_getValue("opt_devmode", opt_devmode);
$("#xedx-hidefedded-opt")[0].check... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkDefault() {\n\t\tvar $checkBoxes = $(\"#checkboxes input[type='checkbox']\");\n\t\tif (!$checkBoxes.is(\":checked\", false)) {\n\t\t\t$checkBoxes.prop(\"checked\", true);\n\t\t}\n\t}",
"function defaultCheck() {\n\t$(\"#radioWeekly\").prop('checked', true);\n}",
"function setCheckBoxes(defaultChe... | [
"0.84492797",
"0.7080845",
"0.707432",
"0.6979801",
"0.6979801",
"0.6979801",
"0.6937816",
"0.6915292",
"0.69012165",
"0.6897084",
"0.68705165",
"0.6862529",
"0.6862529",
"0.6862529",
"0.6862529",
"0.6862529",
"0.6862529",
"0.6862529",
"0.6862529",
"0.68461716",
"0.68461716",... | 0.8035598 | 1 |
Adds an observer to handle changes from dark mode to light | function addDarkModeObserver() {
var dmObserver = new MutationObserver(function() {loadTableStyles();});
dmObserver.observe($('body')[0], {attributes: true, childList: false, subtree: false});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function toggle_dark_mode(){\n\t\t\tif($('body').attr('dark') === \"true\" || $('html').attr('dark') === \"true\"){\n\t\t\t\t$panel.go_dark('yt');\n\t\t\t}else{\n\t\t\t\t$panel.go_light('yt');\n\t\t\t}\n\n\t\t\tif(!mode_obs_attached){\n\t\t\t\t$utils.create_observer('body', toggle_dark_mode, [true, false, true, fa... | [
"0.71255654",
"0.68806446",
"0.6794733",
"0.6729185",
"0.6699591",
"0.6656264",
"0.64545774",
"0.64544475",
"0.64215595",
"0.64057195",
"0.63618034",
"0.6355128",
"0.6336576",
"0.6328167",
"0.6323373",
"0.63215876",
"0.63175464",
"0.62993044",
"0.62868917",
"0.6217488",
"0.62... | 0.7366766 | 0 |
a function that takes a midi pitch code, and returns the frequency, octave info, and note name | function codeInfo(code) {
let notes = ["C", "Db", "D", "Eb", "E", "F", "Gb", "G", "Ab", "A", "Bb", "B"]
let semitoneRatio = 2 ** (1/12);
let baselineFrequency = 27.5;
let baselineCode = 21; // MIDI code for lowest note on keyboard
let stepsAboveBaseline = code - baselineCode;
let thisOctave =... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function noteFromPitch( frequency ) {\n\t// CORRELATED FREQUENCY NOTENUM CALCULATION===>\n\tvar noteNum = 12 * (Math.log( frequency / 440 )/Math.log(2) );\n\treturn Math.round( noteNum ) + 69;\n}",
"function getFrequency(note, octave) {\n const A4 = 440;\n const a = Math.pow(2, 1/12);\n // const hsDiff ... | [
"0.7185757",
"0.6868364",
"0.6847147",
"0.6714934",
"0.66071606",
"0.6592205",
"0.6469786",
"0.6419578",
"0.6353379",
"0.6317981",
"0.6313409",
"0.6281869",
"0.6281346",
"0.6087719",
"0.6085255",
"0.6011136",
"0.60070187",
"0.60067445",
"0.60048735",
"0.59913933",
"0.5971772"... | 0.80337083 | 0 |
playback Play array of notes: | function playArrayOfNotes(arr){
var arrCopy = arr.slice();
playNoteFromArray(arrCopy);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function playNotes(notes) {\n // save for reference\n previousNotes = notes;\n // iterate through the notes\n for (var i = 0; i < notes.length; i++) {\n // TODO stop the oscillator if note is null\n // TODO keep it going if it's the same\n // TODO set new otherwise\n if (notes[i] &&... | [
"0.69778144",
"0.695523",
"0.6900798",
"0.6893916",
"0.68919927",
"0.6780445",
"0.67656875",
"0.6753379",
"0.6667853",
"0.6664388",
"0.6660501",
"0.662061",
"0.65729266",
"0.65653485",
"0.65537995",
"0.65378773",
"0.6537064",
"0.6516497",
"0.651149",
"0.6493664",
"0.6434819",... | 0.7751243 | 0 |
ensure that we have enough db servers in cluster tests | function ensureServers(options, numServers) {
if (options.cluster && options.dbServers < numServers) {
let localOptions = _.clone(options);
localOptions.dbServers = numServers;
return localOptions;
}
return options;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function executeServerDatabase() {\n try {\n console.log(\"executeServerDatabase\");\n // Fetch the server_configs array (we will handle all the entries in memory)\n const users = await pool.query(\"SELECT * FROM users\");\n const [now, oneWeekAgo] = getTimes();\n \n \n // Go through th... | [
"0.6210295",
"0.6087413",
"0.5747887",
"0.5743892",
"0.5661837",
"0.56351185",
"0.5607325",
"0.5556212",
"0.5534574",
"0.55055994",
"0.5504214",
"0.5486977",
"0.5464979",
"0.54583967",
"0.54581714",
"0.54420197",
"0.53515726",
"0.5310883",
"0.5287744",
"0.5274911",
"0.5260276... | 0.6457071 | 0 |
Controller function for posting files. Collects functionality from file filtering and post. Calls postFiles and filterFilesByExtension. | function controllerPost() {
if ($('#file').val() === '') {
alert('Please choose a folder to upload');
} else {
postFiles(filterFilesByExtension());
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function fileUpload() {\n\tvar files = this.files;\n\tvar sendData = new FormData();\n\tsendData.append('tree', properties.toLink());\n\tsendData.append('types', properties.typesAllowed);\n\tsendData.append('action', 'upload');\n\tif (files.length > 1) {\n\t\tfor (var f = 0; f < files.length; f++) {\n\t\t\tsendDat... | [
"0.65007347",
"0.6485493",
"0.6424356",
"0.6340471",
"0.6238357",
"0.6220152",
"0.62150204",
"0.6198998",
"0.6171676",
"0.60738444",
"0.5988522",
"0.59875035",
"0.5970377",
"0.5933488",
"0.5882529",
"0.5867776",
"0.5849685",
"0.58277494",
"0.5817716",
"0.5770547",
"0.57459795... | 0.67734164 | 0 |
Function for setting folder name in first text field. | function setInner(folderName) {
$("#inner").val(folderName);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function update_folder_tab_title() {\n\t\tif ( ! $associated_group_selector.length ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( $associated_group_selector.val().length ) {\n\t\t\tfolder_tab_name = BP_Docs_Folders.folders_tab_label_groups;\n\t\t} else {\n\t\t\tfolder_tab_name = BP_Docs_Folders.folders_tab_label;\n\t\t}\n\... | [
"0.67452157",
"0.6384451",
"0.6279577",
"0.62289083",
"0.621979",
"0.5949158",
"0.5914943",
"0.5855536",
"0.5816599",
"0.5797123",
"0.5754781",
"0.57225716",
"0.56768453",
"0.56712353",
"0.5655997",
"0.5650484",
"0.5644184",
"0.5622632",
"0.5596201",
"0.5584786",
"0.5531853",... | 0.6569769 | 1 |
create function to render sales hours information in table. | function renderHours() {
var hoursTableRow = document.createElement('tr');
var hourTableEmpty = document.createElement('th');
hourTableEmpty.textContent = '';
hoursTableRow.appendChild(hourTableEmpty);
for(var i = 0; i < hours.length; i++) {
var hoursTableData = document.createElement('th');
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getHoursTable(operatingHours) {\n const hours = document.createElement('table');\n\n for (let key in operatingHours) {\n const row = document.createElement('tr');\n\n const day = document.createElement('td');\n day.innerHTML = key;\n row.appendChild(day);\n\n const time = document.cr... | [
"0.7167302",
"0.70690286",
"0.7025828",
"0.69955534",
"0.6914985",
"0.67763114",
"0.6751364",
"0.6747493",
"0.66930634",
"0.6672395",
"0.6671202",
"0.6644443",
"0.66125727",
"0.6551901",
"0.65203756",
"0.65156156",
"0.6488891",
"0.64779824",
"0.6477124",
"0.6476418",
"0.64533... | 0.8168653 | 0 |
Sendet eine Datei per asynchronem HTTP POST Request an das FileUploadServlet. | function uploadFile(file, successFkt, uploadAction, params, beforeFkt, completeFkt)
{
var formData = new FormData();
formData.append('file', file);
formData.append('action', uploadAction);
for(var key in params)
formData.append(key, params[key]);
$.ajax({
type: "POST",
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function publicUpload(){\n var url = \"http://studenter.miun.se/~aned1602/dt117g/projekt/upload.php\";\n var fd = new FormData();\n fd.append(\"fileToUpload\", document.getElementById('fileToUpload').files[0]);\n var xhttp = new XMLHttpRequest();\n xhttp.open(\"POST\", url, true)... | [
"0.6921991",
"0.67190766",
"0.66220146",
"0.6547684",
"0.6539633",
"0.6534799",
"0.65198547",
"0.64839953",
"0.64813054",
"0.6470067",
"0.6381818",
"0.6365844",
"0.63642347",
"0.63616276",
"0.6356917",
"0.63491637",
"0.6328358",
"0.6317002",
"0.631574",
"0.62959003",
"0.62819... | 0.6857116 | 1 |
Identifies matching elements between slides. You can specify a custom matcher function by using the `autoAnimateMatcher` config option. | getAutoAnimatePairs( fromSlide, toSlide ) {
let pairs = [];
const codeNodes = 'pre';
const textNodes = 'h1, h2, h3, h4, h5, h6, p, li';
const mediaNodes = 'img, video, iframe';
// Explicit matches via data-id
this.findAutoAnimateMatches( pairs, fromSlide, toSlide, '[data-id]', node => {
return node.no... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_handleIntersections() {\n var _a;\n (_a = this.$slides) === null || _a === void 0 ? void 0 : _a.forEach(($slide) => {\n function buildThresholdList() {\n let thresholds = [];\n let numSteps = 10;\n for (let i = 1; i <= numSteps; i++) {\n let ratio = i / numSteps;\n ... | [
"0.558939",
"0.53015524",
"0.5119086",
"0.509506",
"0.5072492",
"0.50560665",
"0.5017299",
"0.49963284",
"0.4957928",
"0.4944436",
"0.48880163",
"0.4876248",
"0.48147517",
"0.48002097",
"0.47960344",
"0.47953066",
"0.4792969",
"0.47912133",
"0.47900647",
"0.47534502",
"0.4713... | 0.6261039 | 0 |
Converts passed Book to JSON and outputs it to passed stream via Console. | function outputBookToStream (book, stream = null) {
// Convert book to JSON.
let json = JSON.stringify(book);
logging.lineSeparator('BOOK TO JSON', 60);
logging.log(json);
// Output JSON to stream.
addValueToStream(json, stream);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function loadBookJson() {\n\t\tvar fs = require(\"fs\")\n\t\t// fs.readFile(JAVA_BOOK_JSON, 'utf8', function(err, content) {\n\t\t// if (err)\n\t\t// return callback(err)\n\t\t// callback(null, content)\n\t\t// })\n\t\tvar contents = JSON.parse(fs.readFileSync(JAVA_BOOK_JSON, 'utf8'));\n\t\tconsole.log(JSON.string... | [
"0.5458578",
"0.5430456",
"0.53791565",
"0.53515303",
"0.53446203",
"0.5319336",
"0.5298161",
"0.522289",
"0.52121025",
"0.5196842",
"0.51793164",
"0.5173099",
"0.51644474",
"0.51612407",
"0.5124929",
"0.51135015",
"0.5098517",
"0.5084752",
"0.50496155",
"0.5033552",
"0.50298... | 0.72401464 | 0 |
Displays rock on the canvas | display() {
super.display();
//Displays rock
push();
noStroke();
fill(this.baseColor.r, this.baseColor.g, this.baseColor.b);
ellipse(this.x, this.y, this.width,this.height);
pop();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"display() {\n // draw our player at their current position with the correct graphic\n image(this.myGraphic, this.xPos, this.yPos);\n }",
"showResult(ctx) {\n\t\tctx.drawImage(ASSET_MANAGER.getAsset(\"./sprites/end game GUI.png\"), 150, 150);\n\t\tctx.font = \"30px Arial\";\n\t\tctx.fillText((\"Score: \" +... | [
"0.68587714",
"0.67780226",
"0.67649037",
"0.6650664",
"0.66486645",
"0.6633568",
"0.66183984",
"0.6543379",
"0.65189004",
"0.6502566",
"0.649939",
"0.6483529",
"0.64759636",
"0.6471425",
"0.6458705",
"0.6406087",
"0.63986737",
"0.6344478",
"0.6343144",
"0.63399595",
"0.63344... | 0.7947728 | 0 |
Move a mower forward. The direction is the actual cardinal. | goForward() {
const actualPosition = this.mower.position.clone();
const nextPosition = this.getNextPositionForward(actualPosition);
if(this.isNextPositionAllowed(nextPosition)) {
this.updatePosition(nextPosition);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"moveForward() {\n this._currentLinearSpeed = this._linearSpeed;\n this._currentAngularSpeed = 0;\n }",
"function moveForward(distance) {\n $._move(distance, distance || 50);\n}",
"moveForward () {\n this.update(this.deltaIndex(1))\n }",
"moveForward () {\n let posAux = Object.ass... | [
"0.7055508",
"0.699441",
"0.68368924",
"0.6829639",
"0.67615545",
"0.6676289",
"0.6582017",
"0.6537342",
"0.6514861",
"0.65035725",
"0.64667577",
"0.6409883",
"0.6367502",
"0.63623655",
"0.63493097",
"0.63184834",
"0.6281061",
"0.6206949",
"0.6159387",
"0.614139",
"0.61148375... | 0.7623349 | 0 |
Change the bid ratio whenever the user value is changed. | function onBidChange(ev) {
var new_bid_input = ev.target;
var idx = new_bid_input.id.substr(14);
var new_bid_array = new_bid_table[idx];
if(!new_bid_input.value.match(/^\d+$/)) {
new_bid_array[0].innerHTML = 'Invalid ammount';
return;
}
showRatio(new_bid_array[0], '', new_bid_input.value, new_bid_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onUpdate({delta})\r\n{\r\n\tupdateBalance(userBalance);\r\n}",
"function Ratio() { // Credit to Sakari Hiltunen for ratio changing\r\n\t\tvar crStam = parseInt(document.getElementById('user_stamina').innerHTML);\r\n\t\tvar crEner = parseInt(document.getElementById('exp_to_next_level').innerHTML);\r\n\t\... | [
"0.65829676",
"0.60326195",
"0.59659046",
"0.59238094",
"0.59226465",
"0.5905534",
"0.5840703",
"0.5816107",
"0.57543015",
"0.5740576",
"0.5692939",
"0.5690978",
"0.56874514",
"0.5682281",
"0.5670746",
"0.5644989",
"0.56434304",
"0.5618655",
"0.55769193",
"0.5567738",
"0.5535... | 0.646253 | 1 |
6) Create a function to create a new string of specified copies (positive number) of a given string. | function string_copies (str, n)
{
if (n < 0)
return false;
else
return str.repeat(n);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createString(str, copy_num) {\n let newStr = str.repeat(copy_num);\n return newStr;\n}",
"function copies(givenString, numOfCopies) {\n let newString = ''\n for (let i = 1; i <= numOfCopies; i++) {\n newString += givenString\n }\n console.log(newString)\n}",
"function copyString(n... | [
"0.7275117",
"0.70550823",
"0.67939943",
"0.6705302",
"0.6401429",
"0.63909864",
"0.6304721",
"0.6285257",
"0.6246431",
"0.6235441",
"0.62280816",
"0.62173814",
"0.61936766",
"0.6182735",
"0.61564934",
"0.61474234",
"0.6136675",
"0.612064",
"0.612064",
"0.612064",
"0.60988694... | 0.75966597 | 0 |
7) Create a function to display the city name if the string begins with "Los" or "New" otherwise return blank. | function city_name(str) {
if (str.length >= 3 && ((str.substring(0, 3) == 'Los') || (str.substring(0, 3) == 'New')))
{
return str;
}
return '';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function city(cityName) {\n if (cityName.charAt(0) == 'L' && cityName.charAt(1) == 'o' && cityName.charAt(2) == 's') {\n console.log(\"Los Angeles\")\n } else if (cityName.charAt(0) == 'N' && cityName.charAt(1) == 'e' && cityName.charAt(2) == 'w') {\n console.log('New York')\n } else {\n ... | [
"0.7624519",
"0.71225893",
"0.6679092",
"0.65116704",
"0.64493173",
"0.626301",
"0.6207877",
"0.61735415",
"0.6121105",
"0.60025686",
"0.59814894",
"0.59471923",
"0.59439397",
"0.5880551",
"0.5879892",
"0.5879173",
"0.5867423",
"0.5866303",
"0.58613324",
"0.5858023",
"0.58573... | 0.8796326 | 0 |
Computes the decimal coefficient and exponent of the specified number x with significant digits p, where x is positive and p is in [1, 21] or undefined. For example, formatDecimal(1.23) returns ["123", 0]. | function formatDecimal(x, p) {
if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf("e")) < 0) return null; // NaN, ±Infinity
var i, coefficient = x.slice(0, i);
// The string returned by toExponential either has the form \d\.\d+e[-+]\d+
// (e.g., 1.2e+3) or the form \de[-+]\d+... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function formatDecimal(x, p) {\n if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf(\"e\")) < 0) return null; // NaN, ±Infinity\n var i, coefficient = x.slice(0, i);\n\n // The string returned by toExponential either has the form \\d\\.\\d+e[-+]\\d+\n // (e.g., 1.2e+3) or the form \\... | [
"0.826754",
"0.826754",
"0.826754",
"0.826754",
"0.826754",
"0.826754",
"0.826754",
"0.8245036",
"0.82380605",
"0.82380605",
"0.82380605",
"0.82380605",
"0.82380605",
"0.82335925",
"0.82335925",
"0.82335925",
"0.8219652",
"0.8216721",
"0.8216721",
"0.8216721",
"0.81838346",
... | 0.8267729 | 0 |
Execution useEffect only once (make it just like componentDidMount) This will not make useEffect rerender at all on updates. It will only execute once when the page loads componentDidMount To do this, pass a second parameter to useEffect, this time an empty array. When using empty array second param, be sure that the u... | function EffectOnlyOnce() {
const [x, setX] = useState(0)
const [y, setY] = useState(0)
const logMousePosition = (e)=>{
// console.log("Mouse Event")
setX(e.clientX)
setY(e.clientY)
}
//To execute only once, just pass an empty array as second param
useEffect(() => {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function EffectHookTwo() {\n const [count, setCount] = useState(0);\n const [time, setTime] = useState(new Date());\n\n const ticks = () => {\n setTime(new Date());\n };\n\n useEffect(() => {\n document.title = `Count ${count} Times`;\n }, [count]);\n\n useEffect(() => {\n let interval = setInterva... | [
"0.67476594",
"0.67028815",
"0.63849723",
"0.6362999",
"0.63380283",
"0.62774193",
"0.6260519",
"0.6233233",
"0.6187762",
"0.6152231",
"0.61115915",
"0.6020776",
"0.595704",
"0.5907347",
"0.5903581",
"0.5893361",
"0.5856721",
"0.5849082",
"0.5846556",
"0.58296406",
"0.5681900... | 0.8096756 | 0 |
Convert the DB user to a JS user | _convert() {
if (this._dbUser === null) {
log.error(`User model: attempt to convert null db object to JS object`);
this._user = { ...JSUser.initialState };
throw new Error(`User model: attempt to convert null db object to JS object`);
}
this._user.id = this._dbUser["id"];
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function jsonifyUser (user) {\n user = JSON.parse(JSON.stringify(user));\n delete user._id;\n delete user.sessionid;\n user.email = user.id + '@' + user.domain;\n return user;\n}",
"_toDatabase(user) {\n return {\n name: user.name,\n age: user.age\n }\n }",
"getJWT()... | [
"0.6421602",
"0.6337171",
"0.62691444",
"0.6111256",
"0.6041514",
"0.59136295",
"0.5870359",
"0.57660717",
"0.57586515",
"0.5738027",
"0.57336885",
"0.5656439",
"0.56478643",
"0.56172836",
"0.559268",
"0.55907094",
"0.5561626",
"0.55384636",
"0.5533264",
"0.55313057",
"0.5521... | 0.6694687 | 0 |
generated list of cars with slots | getCarsInfo(cars, slots) {
const carsInfo = [];
this.slotsInfo = slotsStack(Math.min(slots, 30));
if (cars > slots) {
return carsInfo;
}
for (let index = 0; index < Math.min(cars, 30); index++) {
// const element = array[index];
carsInfo.push({
count: index + 1,
car... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function generateSlots(){\n\t\n\tvar sectionSelect = document.getElementById(\"section\");\n\twhile(sectionSelect.hasChildNodes()){\n\t\tsectionSelect.removeChild(sectionSelect.lastChild);\n\t}\n\t\n\tvar courseSelect = document.getElementById(\"courseNumber\");\n\tvar selCourse = courseSelect.value;\n\tvar catalo... | [
"0.6459952",
"0.64149463",
"0.6258037",
"0.6249683",
"0.6172556",
"0.61580193",
"0.61450434",
"0.60909534",
"0.6047751",
"0.5937777",
"0.5907065",
"0.59021413",
"0.5862809",
"0.5845678",
"0.5812765",
"0.57697403",
"0.5759138",
"0.5750818",
"0.5711163",
"0.564411",
"0.5641758"... | 0.7348515 | 0 |
store the empty slot for use | addEmptySlot(slot) {
this.slotsInfo.push(slot);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get slots() {\n return {};\n }",
"addSlot() {\n ///this.addSlotNumbered([]);\n }",
"slot(slotName) {\n return this.getSlot(slotName, Data.EMPTY_SLOT).value;\n }",
"reset() {\n this.previousSlots_ = [];\n }",
"function empty_slots() {\r\n\treturn character.esize;\r\n}",
"make... | [
"0.64973813",
"0.64771163",
"0.64079905",
"0.638061",
"0.62728226",
"0.6229927",
"0.61634123",
"0.60817146",
"0.60095114",
"0.59766364",
"0.596322",
"0.59230584",
"0.59197354",
"0.5917329",
"0.5836711",
"0.582907",
"0.5793586",
"0.5793586",
"0.5793586",
"0.5793586",
"0.579358... | 0.81981933 | 0 |
Calculates coordinates on spiral, evaluates callback on them and returns its result. | function spiral(i, callback) {
angle = config.spiralResolution * i; // radians -> goes many times around
x = (1 + angle) * Math.cos(angle);
y = (1 + angle) * Math.sin(angle);
return callback ? callback() : null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getSpiralCoordinatesAndSizes() {\n var spiralCoordinatesAndSizes = [];\n var initialR;\n var x;\n var y;\n var tOuter;\n var xOuter;\n var yOuter;\n var size;\n for (t = -25; t < 17.5; t += 0.02) { // used in other versions: t = -18\n // float x = centerX + initialR * (fl... | [
"0.61121553",
"0.5796566",
"0.5637815",
"0.55928075",
"0.5559713",
"0.5502619",
"0.5372648",
"0.5341404",
"0.5218401",
"0.5216598",
"0.5199416",
"0.518665",
"0.51648194",
"0.51625556",
"0.51503086",
"0.51338613",
"0.5074684",
"0.5033105",
"0.5020136",
"0.5018222",
"0.49917096... | 0.6872596 | 0 |
Checks if word placed on x, y would overlap with existing words. Return boolean. | function intersect(word, x, y) {
cloud.appendChild(word);
word.style.left = x - word.offsetWidth/2 + "px";
word.style.top = y - word.offsetHeight/2 + "px";
var currentWord = word.getBoundingClientRect();
cloud.removeChild(word);
for(var i = 0; i < wordsDown.length; i+=1){
var comparisonWord = wordsD... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_isOverlappingExisting(x, y, w, h) {\n if(!this._positions.length) return false;\n let over = false;\n this._positions.forEach((item) => {\n if (!(item.x > x + w ||\n item.x + item.width < x ||\n item.y > y + h ||\n item.y + item.height < y)) over = true;\n });\n\n return o... | [
"0.72589004",
"0.69028753",
"0.69002825",
"0.6893055",
"0.6893055",
"0.687199",
"0.6617291",
"0.6606137",
"0.660116",
"0.6589125",
"0.64918655",
"0.6489385",
"0.6444062",
"0.6444062",
"0.6366211",
"0.6361245",
"0.6354675",
"0.6340787",
"0.6336028",
"0.6232552",
"0.6219301",
... | 0.79230225 | 0 |
Create function to end the quiz, and give user opportunity to try again | function endQuiz() {
// clear page
clearPage();
// replace start button
$("#start-button").append("<button>Click here to try again!</button>");
// show user how they did
quizQuestion.append("<div>Correct Guesses: " + correctGuesses + "</div>");
quizQuestion.app... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function quizEnd() {\n\n //display quiz stats and creates restart button\n $(\"#quiz\").html('<h3 id=\"question\">Behold your statistics:</h3>' + '<p>' + correct + '</p>' + '<p>' + incorrect + '</p>' + '<button type=\"button\" class=\"btn btn-default btn-lg btn-block\" id=\"restart\">Click to be rebo... | [
"0.7806977",
"0.7671451",
"0.7605731",
"0.76013505",
"0.75290364",
"0.74728334",
"0.7413862",
"0.73931503",
"0.73293054",
"0.72687036",
"0.7169377",
"0.7145364",
"0.714217",
"0.71151215",
"0.7101316",
"0.7084825",
"0.7084122",
"0.7070002",
"0.7054337",
"0.7034848",
"0.7017794... | 0.7798555 | 1 |
Increase Font Size by 2px Limit 52=10px | function increaseSize(){
var el = document.getElementById('main');
var style = window.getComputedStyle(el, null).getPropertyValue('font-size');
var fontSize = parseFloat(style);
if(limitFontI <= 5){
var box = document.getElementById('main');
box.style.fontSize = (fontSize+1)+"px";... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setFontSize(px) {\n this.font.size = px;\n this.setFont();\n }",
"function decreaseSize(){\r\n var el = document.getElementById('main');\r\n var style = window.getComputedStyle(el, null).getPropertyValue('font-size');\r\n var fontSize = parseFloat(style); \r\n if(limitFontD <= 5){\r\n e... | [
"0.7548577",
"0.7394007",
"0.7342968",
"0.72333604",
"0.7121761",
"0.70978993",
"0.7076338",
"0.7053694",
"0.7053419",
"0.7033829",
"0.7013455",
"0.7011581",
"0.7000882",
"0.6969706",
"0.69689494",
"0.6954063",
"0.694786",
"0.69429725",
"0.693533",
"0.6905164",
"0.6904697",
... | 0.76606923 | 0 |
Decrease Font Size by 1px Limit 51=5px | function decreaseSize(){
var el = document.getElementById('main');
var style = window.getComputedStyle(el, null).getPropertyValue('font-size');
var fontSize = parseFloat(style);
if(limitFontD <= 5){
el.style.fontSize = (fontSize-1)+"px";
limitFontD++;
if(limitFontI>0){
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function decreaseFontSize() {\n\t\t\t\tlpChatFontSize = (lpChatFontSize == LP_CHAT_FONT_SIZE_MIN) ? LP_CHAT_FONT_SIZE_MIN\n\t\t\t\t\t\t: (lpChatFontSize - 2);\n\t\t\t\tchangeFontSize();\n\t\t\t}",
"function onDecreaseFontSize() {\n decreaseFontSize()\n let elFont = document.querySelector('.font-size-displa... | [
"0.78394127",
"0.7329161",
"0.7236859",
"0.7232473",
"0.7086503",
"0.6992056",
"0.6970447",
"0.6850269",
"0.681098",
"0.67619395",
"0.6677966",
"0.6630646",
"0.6619187",
"0.6613491",
"0.65938103",
"0.6589099",
"0.6587532",
"0.6521409",
"0.65163153",
"0.6504681",
"0.64742947",... | 0.7880635 | 0 |
Helper function to load and configure the spritesheet | function buildSpriteSheet() {
// load the image
spriteImage.onload = imgReady;
spriteImage.onerror = imgLoadError;
spriteImage.src = "img/spritesheet.png";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"loadSpriteSheet(){\n this.spriteSheet = loadImage('assets/sprites.png');\n }",
"function loadSprites() {\n Loader.add(\"assets/imgs/resize1.png\")\n .add(\"assets/imgs/resize2.png\")\n .add(\"assets/imgs/colorize.png\")\n .add(\"assets/imgs/rotate.png\")\n .add(\"assets/imgs/select.png\")\n .... | [
"0.77053326",
"0.7106815",
"0.7065945",
"0.69795185",
"0.6935507",
"0.6896631",
"0.6835922",
"0.6789118",
"0.6746999",
"0.6723271",
"0.6660523",
"0.66394347",
"0.6622639",
"0.66104585",
"0.65924263",
"0.65782964",
"0.65588903",
"0.6547034",
"0.6508481",
"0.6505023",
"0.648801... | 0.7446711 | 1 |
Image load error callback for the sprite sheet | function imgLoadError() {
alert("Unable to load images!");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"handleImageError_() {\n this.state = TileState.ERROR;\n this.unlistenImage_();\n this.image_ = getBlankImage();\n this.changed();\n }",
"handleImageError_() {\n this.state = TileState.ERROR;\n this.unlistenImage_();\n this.image_ = getBlankImage();\n this.changed();\n }",
"function fa... | [
"0.7142238",
"0.7142238",
"0.6932698",
"0.6803376",
"0.6772543",
"0.67393273",
"0.6721956",
"0.6701991",
"0.66896313",
"0.6684954",
"0.66089785",
"0.6603364",
"0.65854776",
"0.657163",
"0.65420854",
"0.65019953",
"0.64840484",
"0.64328384",
"0.6431613",
"0.6431613",
"0.641610... | 0.73162925 | 0 |
'Builds' the game by loading resources and setting up a timer | function buildGame() {
// build a spritesheet up from the image we have loaded
spriteSheet = new SpriteSheet({
images: [spriteImage],
frames: {width: CELL_SIZE, height: CELL_SIZE, count: 12, regX: 1, regY: 1},
animations: {
blank: [9],
empty_cell: [0],
yellow_cell: [1],
red_cell: [2],... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function initGame() {\r\n renderLevels()\r\n gGame = {\r\n isOn: true,\r\n isFirstClick: true,\r\n\r\n }\r\n gBoard = buildBoard();\r\n renderBoard(gBoard);\r\n startTimer()\r\n\r\n}",
"function GameStart() {\n\tGenerateCharacter();\n\tCreateTileGrid();\n\tCreateGraphicsGrid();\n\... | [
"0.66769075",
"0.66664",
"0.6640716",
"0.65915084",
"0.6547936",
"0.6536611",
"0.6536414",
"0.65003467",
"0.64720035",
"0.6458569",
"0.6449483",
"0.64390624",
"0.6431085",
"0.6417288",
"0.640013",
"0.6396732",
"0.63933766",
"0.6363677",
"0.63631845",
"0.63465875",
"0.63405544... | 0.68422186 | 0 |
Helper to dispatch events that will signal the registering of links. | register() {
window.dispatchEvent(
new CustomEvent('routerLinksAdded', {
detail: {
links: [this],
},
}),
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"linksHandler() {\n\t\treplaceLinks(this.content, (href) => {\n\t\t\tthis.emit(EVENTS.CONTENTS.LINK_CLICKED, href);\n\t\t});\n\t}",
"function links_click_event(event) {\n console.log(\"works link\");\n}",
"function registerEvents() {\n}",
"setupLinks() {\n for (let link in this.links) {\n this.link... | [
"0.6393028",
"0.63625443",
"0.62740743",
"0.60581833",
"0.59878975",
"0.59875846",
"0.5842325",
"0.5825559",
"0.57664394",
"0.5751365",
"0.57487524",
"0.5675892",
"0.56690997",
"0.56689376",
"0.56654894",
"0.5648959",
"0.56249654",
"0.5617219",
"0.5596205",
"0.55888593",
"0.5... | 0.7209332 | 0 |
Helper function gets called if the test execution fails | _failed(test, error) {
console.log("Test has failed");
const sessionId = this._getSessionId();
this._updateBuild(sessionId, { 'status': 'failed', 'name': test.title });
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function testFailed(s) {\n runner.testFailed(s);\n}",
"function Test_Failure(test) {\n var results = {\"name\":\"\", \"email\":\"\", \"homezipcode\":\"\", \"workzipcode\":\"\", \t\t\t\t\"leavehome\":\"\",\"leavework\":\"\",\"waittime\":\"\",\"emptyseats\":\"\"};\n var expected = Expected(descr... | [
"0.7031361",
"0.69983834",
"0.6957411",
"0.6889071",
"0.6887802",
"0.6862557",
"0.68032223",
"0.68032223",
"0.6773074",
"0.6728427",
"0.6728427",
"0.6695533",
"0.6695533",
"0.6637961",
"0.6627585",
"0.6590505",
"0.6576527",
"0.6491161",
"0.6472307",
"0.6404464",
"0.63994503",... | 0.7199882 | 0 |
Read all tables from the connected database and generate a ModelFields object for each one containing data on each table's fields. | tables() {
return this.db.raw( "SELECT name FROM sqlite_master WHERE type='table'", [] ).then( ( response ) => {
return response.map( ( value, index, array ) => {
return value[Object.keys( value )[0]];
} );
} ).then( ( tables ) => {
return Promise.all( tables.map( ( table, index, array ) => {
retur... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _eFapsCreateAllImportDataModel() {\n var fileList = eFapsGetAllFiles(\"org/efaps/js/definitions\", true);\n\n importSQLTables(fileList);\n importTypes(fileList);\n}",
"buildSchema() {\n if (!this.dbSchema) return this.schema;\n for (let tablename in this.dbSchema) {\n this.mapDbTableToGra... | [
"0.6314431",
"0.6141832",
"0.58919674",
"0.58735543",
"0.58518136",
"0.56994146",
"0.5687947",
"0.5648021",
"0.5641866",
"0.56401867",
"0.5639884",
"0.5512188",
"0.54956865",
"0.54710585",
"0.5413507",
"0.54103696",
"0.5370843",
"0.53639984",
"0.535202",
"0.53509843",
"0.5332... | 0.6987561 | 0 |
Given a single table name, generate a list of fields for the model associated with that table, based on the table's columns. Returns a Promise object. | fields( table ) {
let getType = ( type ) => {
return type.includes( "char" ) ? "string" :
type.includes( "text" ) ? "string" :
type.includes( "int" ) ? "number" :
type.includes( "real" ) ? "number" :
undefined;
};
let getKey = ( key ) => {
return key == 1 ? "primary" :
undef... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"tables() {\n\t\treturn this.db.raw( \"SELECT name FROM sqlite_master WHERE type='table'\", [] ).then( ( response ) => {\n\t\t\treturn response.map( ( value, index, array ) => {\n\t\t\t\treturn value[Object.keys( value )[0]];\n\t\t\t} );\n\t\t} ).then( ( tables ) => {\n\t\t\treturn Promise.all( tables.map( ( table,... | [
"0.6204013",
"0.5784384",
"0.57633454",
"0.5554747",
"0.5469657",
"0.5367021",
"0.5337232",
"0.5316573",
"0.51446",
"0.51274633",
"0.50299037",
"0.49363592",
"0.4933998",
"0.48672527",
"0.48226967",
"0.48057592",
"0.47696316",
"0.47288442",
"0.4723365",
"0.47212112",
"0.46885... | 0.6239965 | 0 |
Get the HTML of the products webpage and determines if the item is in stock | function checkStock(){
//Get the HTML
request({
method: 'GET',
url: productURL
}, (err, res, body) => {
if (err) return console.error(err);
//Let $ be the html body so cheerio can filter the data jquery style
let $ = cheerio.load(body);
//Pull the data from the html tha... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static async _checkProductsAvailInStock(cart) {\n let invalid = '';\n const tempCart = (typeof cart !== 'object' ? cart.toObject() : cart);\n\n await ItemProductController._addProductsForSingleOrder(tempCart);\n _.each(tempCart.items, (item) => {\n // invalid sku\n if (!item.product) {\n ... | [
"0.6253471",
"0.6202429",
"0.6168863",
"0.6140495",
"0.6112217",
"0.6110759",
"0.6108169",
"0.6072498",
"0.60110813",
"0.60021096",
"0.5968787",
"0.5939369",
"0.5925591",
"0.59033865",
"0.5839338",
"0.5760475",
"0.5748426",
"0.5710436",
"0.5701015",
"0.56977",
"0.56805545",
... | 0.72114474 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.