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 |
|---|---|---|---|---|---|---|
GQL Auxiliary Auxiliary Types are toplevel types which a type may need or provide. Example: the `File` type, adds a graphql auxiliary type of `FileUpload`, as well as an `uploadFile()` graphql auxiliary type query resolver | getGqlAuxTypes () {
// NOTE: based on Virtual field source code
return this.extendGraphQLTypes
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getGqlAuxTypes () {\n return [\n `\n type ${this.graphQLOutputType} { \\n` + this.options.map(x => `${x}: Boolean\\n`) + `\n }\n `,\n `\n input ${this.graphQLInputType} { \\n` + this.options.map(x => `${x}: Boolean\\n`) + `\n }\n `,\n ]\n }",
"func... | [
"0.57479876",
"0.56134623",
"0.5530713",
"0.54038155",
"0.54038155",
"0.54038155",
"0.53943735",
"0.53022885",
"0.48698062",
"0.47857705",
"0.46843806",
"0.4663923",
"0.46470731",
"0.4591671",
"0.45884958",
"0.4587479",
"0.4583359",
"0.4583359",
"0.4583359",
"0.4583359",
"0.4... | 0.68165994 | 0 |
Utils Make the first letter lowercase | function lowercaseFirstLetter( string )
{
return string.charAt( 0 ).toLowerCase() + string.slice( 1 );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function autoEd_first2lower(str) {\n if (str != \"\") {\n var letter = str.substr(0, 1);\n return letter.toLowerCase() + str.substr(1, str.length);\n } else {\n return \"\";\n }\n}",
"function lowercaseFirstLetter(string) {\n return string.charAt(0).toLowerCase() + string.slice(1);\n}",
"capitalizeFirstL... | [
"0.8176717",
"0.7998934",
"0.79383457",
"0.7803193",
"0.7791103",
"0.776209",
"0.77315116",
"0.77254456",
"0.7614318",
"0.7586862",
"0.7579551",
"0.75447005",
"0.75447005",
"0.7480965",
"0.74749935",
"0.74649864",
"0.7464839",
"0.7460034",
"0.7458524",
"0.74552566",
"0.745396... | 0.81698596 | 1 |
Get Available Metadata category name | function getI18nAvailableMetaData( metaDataCategoryName )
{
switch ( metaDataCategoryName )
{
case "Attributes":
return i18n_available_attributeTypes;
case "Categories":
return i18n_available_categories;
case "CategoryCombos":
return i18n_avai... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getAllDisplayName(category) {\n return category === 'All' ? 'Todos los lugares' : category;\n }",
"function getNameByCatID(which) {\n\n for (var c = 0; c < activityCats.length; c++) {\n if (activityCats[c].CategoryID == which) {\n return activityCats[c].CategoryName;\n }\n }\n\... | [
"0.6641506",
"0.63408",
"0.6297077",
"0.6265883",
"0.62065935",
"0.6196105",
"0.61184925",
"0.6099007",
"0.595835",
"0.59019023",
"0.5901083",
"0.5870822",
"0.58505917",
"0.57931566",
"0.57907814",
"0.5769422",
"0.5760493",
"0.5668226",
"0.5649536",
"0.564202",
"0.5615201",
... | 0.69058996 | 0 |
Get Selected Metadata category name | function getI18nSelectedMetaData( metaDataCategoryName )
{
switch ( metaDataCategoryName )
{
case "Attributes":
return i18n_selected_attributeTypes;
case "Categories":
return i18n_selected_categories;
case "CategoryCombos":
return i18n_selecte... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getNameByCatID(which) {\n\n for (var c = 0; c < activityCats.length; c++) {\n if (activityCats[c].CategoryID == which) {\n return activityCats[c].CategoryName;\n }\n }\n\n}",
"function getCategory(c){\n return getCategoryObject(c.definition); \n}",
"getAllDisplayName(ca... | [
"0.67563087",
"0.63200974",
"0.6201078",
"0.6125414",
"0.6118931",
"0.60827816",
"0.60685444",
"0.6061864",
"0.60226977",
"0.60119593",
"0.5945209",
"0.5925287",
"0.5925287",
"0.5925287",
"0.5925287",
"0.59106845",
"0.5874405",
"0.58327466",
"0.57938963",
"0.57785714",
"0.573... | 0.6896482 | 0 |
gives the size of the list | size_of_list() {
console.log(_size);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function length() {\n\treturn this.listSize;\n}",
"sizeOfList() {\r\n\t\treturn this.size;\r\n\t}",
"sizeOfList() {\n return this.size;\n }",
"sizeOfList() {\n return this.size;\n }",
"function listLength(){\n return list.length;\n}",
"function listLength(){\n\treturn item.length;\... | [
"0.8695826",
"0.84752476",
"0.83383584",
"0.83383584",
"0.82898074",
"0.8269829",
"0.8253811",
"0.8242845",
"0.8219051",
"0.80942154",
"0.8059023",
"0.7940866",
"0.79205084",
"0.7917011",
"0.7885044",
"0.78685224",
"0.784267",
"0.78016657",
"0.77916294",
"0.77663136",
"0.7759... | 0.8478501 | 1 |
roll up function to populate parent level totals of child totals elements | function rollUpAllTotalElementValues(parent) {
//get the year totals inputs
var propInputs = $($(parent).children("div")).children("input[id^=proptot_]");
var actInputs = $($(parent).children("div")).children("input[id^=acttot_]");
$(propInputs).each(function () {
var yrtxt = $(this).prop('id'... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function calcAll() {\n let subTotal = 0;\n [...cart.children].forEach(product => subTotal += updateSubtot(product));\n document.querySelector('h2 > span').innerHTML = subTotal;\n}",
"function calculateGrandTotal() {\n\n var GrandTotal = 0;\n self.selectItems.forEach(function (item) {\n Gr... | [
"0.6730834",
"0.65582645",
"0.6335604",
"0.6282834",
"0.6183901",
"0.6077294",
"0.6017095",
"0.5988555",
"0.59564465",
"0.5952509",
"0.5926248",
"0.5916613",
"0.59117323",
"0.59047127",
"0.5890624",
"0.5878063",
"0.5829999",
"0.5817544",
"0.5814107",
"0.5778484",
"0.5775799",... | 0.6979708 | 0 |
TODO: Write a Person class with an instance variable, age, and a constructor that takes an integer, initialAge, as a parameter. The constructor must assign initialAge to age after confirming the argument passed as initialAge is not negative; if a negative argument is passed as initialAge, the constructor should set age... | function Person(initialAge) {
// Add some more code to run some checks on initialAge
const AGE_YOUNG = 'You are young.';
const AGE_TEENAGER = 'You are a teenager.';
const AGE_OLD = 'You are old.';
const AGE_NOT_VALID = 'Age is not valid, setting age to 0.';
const isValidAge = (age) => age >= 0;
if (!isV... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Person(initialAge){\n\n this.amIOld=function(){\n // Do some computations in here and print out the correct statement to the console\n if(initialAge < 0) {\n console.log('Age is not valid, setting age to 0.');\n initialAge = 0;\n }\n if(initialAge >= 0 && initialAge < 13) console... | [
"0.8731644",
"0.7184634",
"0.7123282",
"0.710111",
"0.70922923",
"0.70758414",
"0.70549446",
"0.69894",
"0.69499123",
"0.69191813",
"0.6918371",
"0.69001544",
"0.688603",
"0.687918",
"0.6848298",
"0.68414354",
"0.68372273",
"0.68239975",
"0.68239975",
"0.68239975",
"0.6823997... | 0.82076544 | 1 |
This function is called in an interval to fetch and compare config. If config is changed from db it restart the bot. | function configReloader() {
that.getConfigFromDb(function configReloader_pullDbConfig(err, new_config) {
//console.log(new_config)
if (check.assigned(new_config)) {
//console.log(new_config);
//console.log(JSON.parse(JSONX.stringify(gc())));
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function reloadConfig() {\n await GetSystemConfig();\n\n if (AppConfig == null) {\n console.log('\\x1b[31m%s\\x1b[0m', '\\nInvalid config file\\n\\n');\n setTimeout(() => {}, 4000);\n return false;\n } else {\n console.log('\\x1b[33m%s\\x1b[0m', 'Configuration File Loaded Successfully');\n }\... | [
"0.67702496",
"0.66707474",
"0.62609524",
"0.59609306",
"0.5956552",
"0.59060335",
"0.5828909",
"0.58063686",
"0.5768812",
"0.5758384",
"0.57379293",
"0.57187456",
"0.57161254",
"0.56735265",
"0.56482285",
"0.56300354",
"0.56232816",
"0.56107175",
"0.56079173",
"0.56015337",
... | 0.686068 | 0 |
Changing a EAN8 code to UPCA and EAN13 based on whats used at: | function convert_ean8_to_upca(upc) {
if(upc.length==7) { upc = upc+validate_ean8(upc,true); }
if(upc.length>8||upc.length<8) { return false; }
if(validate_ean8(upc)==false) { return false; }
upca = "0000"+upc;
return upca; } | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function PCA(meanCent, scale, location) {\n // Flatten the band image data in from 2D to a 1D array\n var arrays = meanCent.toArray();\n print('PCA applying on', meanCent);\n // Calculate the covariance matrix for the bands data of the region\n var covar = arrays.reduceRegion({\n reducer: ee.Reducer.center... | [
"0.6051053",
"0.5604601",
"0.5460746",
"0.53364426",
"0.52998203",
"0.52044743",
"0.5201781",
"0.5197823",
"0.5150413",
"0.5137715",
"0.5133637",
"0.50877124",
"0.50636005",
"0.50408465",
"0.50380975",
"0.50357664",
"0.49758014",
"0.49125353",
"0.4901695",
"0.48738918",
"0.48... | 0.562227 | 1 |
ISMN (International Standard Music Number) | function convert_ismn10_to_ismn13(upc) {
upc = upc.replace(/M/g, "");
upc = upc.replace(/-/g, "");
upc = upc.replace(/\s/g, "");
if(validate_ismn10(upc)==false) { return false; }
if(upc.length>8) { fix_matches = upc.match(/^(\d{8})/); upc = fix_matches[1]; }
ismn13 = "9790"+upc+validate_ean13("9790"+upc,true);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_dec_name()\n{\n\treturn \"NMEA 0183\";\n}",
"function mn_encode(a){for(var b=[],c=mn_words.length,d=0;d<a.length;d+=8){var e=parseInt(a.substr(d,8),16),f=e%c,g=(Math.floor(e/c)+f)%c,h=(Math.floor(Math.floor(e/c)/c)+g)%c;b=b.concat([mn_words[f],mn_words[g],mn_words[h]])}return b.splice(8,4),b.join(\"... | [
"0.570093",
"0.5575862",
"0.5512347",
"0.5510151",
"0.548705",
"0.5471306",
"0.5438395",
"0.54350567",
"0.5383535",
"0.53694546",
"0.53376",
"0.5303583",
"0.5268012",
"0.5265441",
"0.5250442",
"0.52282816",
"0.519185",
"0.5163425",
"0.5135446",
"0.5132929",
"0.51161075",
"0... | 0.6175553 | 0 |
send a transaction list | function sendList(fromUser, txs, txresolve, node) {
return function(scope) {
const password = scope.users[fromUser].password;
const fromAddress = scope.users[fromUser].address;
return new Promise(function(resolve, reject) {
verbose('sendList', {fromUser, txs, txresolve, node});
api.setNode(nod... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sendList() {\n var msg;\n\n msg = represent(m.ctype[\"content-type\"],g.list);\n \n res.writeHead(200, 'OK', m.headers);\n res.end(JSON.stringify(msg,null,2));\n }",
"function tranferToMany(records, coin_type){\n return new Promise((resolve, reject)=>{\n var temp = {};\n ... | [
"0.676701",
"0.67500186",
"0.64069784",
"0.63166946",
"0.62671804",
"0.6234653",
"0.6113255",
"0.6046122",
"0.60331047",
"0.5999143",
"0.5960538",
"0.5941616",
"0.58766544",
"0.5871515",
"0.5865048",
"0.58629096",
"0.58589983",
"0.58361435",
"0.5834568",
"0.5830129",
"0.58298... | 0.675226 | 1 |
upload a list of contracts | function uploadContractList(fromUser, txs, txresolve, node) {
return function(scope) {
const password = scope.users[fromUser].password;
const fromAddress = scope.users[fromUser].address;
return new Promise(function(resolve, reject) {
verbose('uploadList', {fromUser, txs, txresolve, node});
api... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function contract_list(request, response, next) {\n console.log('List of contracts');\n}",
"async function submitBatchTransactions(validators) {\n var pubkeys = [];\n var withdrawal_credentials = [];\n var signatures = [];\n var deposit_data_roots = [];\n for (let i = 0; i < validators.length; i+... | [
"0.5811675",
"0.56289905",
"0.5562365",
"0.55306864",
"0.54994166",
"0.5437879",
"0.5432027",
"0.5432027",
"0.53773797",
"0.5352786",
"0.5334276",
"0.5333993",
"0.5266345",
"0.5258271",
"0.52435833",
"0.5240965",
"0.5235306",
"0.52347195",
"0.52197456",
"0.52187747",
"0.52069... | 0.6251948 | 0 |
Determines the position in the list of posts to insert the new post | function determinePostInsertPosition(date) {
// Declare variable
var insertBeforeElement = null;
// Loop through the current posts to determine if the new post should go before any of them
$('#mainpostlist').children().each(function () {
var postdate = $(this).children('.postdate').html();
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"insert(i, item) {\n }",
"function insertPost(){\n const liveEdit = $.createElement('div');\n const viewPostsWrap = $.querySelector('.view-posts-wrap');\n var date = new Date();\n var currentDate = `${date.getDate()}/${date.getMonth() + 1}/${date.getFullYear()}`;\n liveEdit.setAttribute(\"class\",... | [
"0.6269171",
"0.61666405",
"0.6162764",
"0.5980021",
"0.59713024",
"0.59598017",
"0.5936215",
"0.59151673",
"0.5891646",
"0.5885606",
"0.58548707",
"0.57939976",
"0.57602394",
"0.5745447",
"0.57435054",
"0.5734831",
"0.56947774",
"0.5693763",
"0.5680906",
"0.5673375",
"0.5671... | 0.6920194 | 0 |
Update the date time in the footer of the posts | function updateDateTime() {
// Get the main post list
var posts = $('#mainpostlist');
// Loop through the posts and update the date time
posts.children().each(function () {
var n = formatDate($(this).children('.postdate').html());
$(this).children('.formatteddate').html(n);
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updatePostDateTime() {\n\n // Get the post detail\n var posts = $('#postdetail');\n\n // Update the footer with the updated date time\n var n = formatDate($(posts).children('.postdate').html());\n $(posts).children('.formatteddate').html(n);\n}",
"function preparePostFooter() {\n\n // ... | [
"0.84036154",
"0.7123123",
"0.6372551",
"0.6365317",
"0.6365317",
"0.63519084",
"0.6338702",
"0.629311",
"0.62868965",
"0.6259945",
"0.6259788",
"0.6194092",
"0.6173121",
"0.61286753",
"0.6067258",
"0.60160536",
"0.5975327",
"0.5974146",
"0.59424627",
"0.5875895",
"0.5857728"... | 0.7450156 | 1 |
Prepare the post footer date time | function preparePostFooter() {
// Check to ensure the post detail should be displayed
if ($('#postdetail').length > 0) {
// Update the post date time
updatePostDateTime();
// Set the timer to update the date time in the post footer if not set
if (timeOut == null) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updatePostDateTime() {\n\n // Get the post detail\n var posts = $('#postdetail');\n\n // Update the footer with the updated date time\n var n = formatDate($(posts).children('.postdate').html());\n $(posts).children('.formatteddate').html(n);\n}",
"function updateDateTime() {\n\n // Get... | [
"0.7011131",
"0.5961838",
"0.5779506",
"0.5761002",
"0.55085176",
"0.544572",
"0.54410976",
"0.5422464",
"0.539507",
"0.534975",
"0.53403336",
"0.5283562",
"0.527744",
"0.52707726",
"0.5249234",
"0.5233395",
"0.52255696",
"0.52230066",
"0.5212112",
"0.5165554",
"0.5161555",
... | 0.7440692 | 0 |
Update the post date time | function updatePostDateTime() {
// Get the post detail
var posts = $('#postdetail');
// Update the footer with the updated date time
var n = formatDate($(posts).children('.postdate').html());
$(posts).children('.formatteddate').html(n);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateDateTime() {\n\n // Get the main post list\n var posts = $('#mainpostlist');\n\n // Loop through the posts and update the date time\n posts.children().each(function () {\n var n = formatDate($(this).children('.postdate').html());\n $(this).children('.formatteddate').html(n)... | [
"0.7290616",
"0.633497",
"0.6279587",
"0.6254577",
"0.6254577",
"0.6175972",
"0.6106425",
"0.60506964",
"0.6017913",
"0.6017913",
"0.6001845",
"0.59784406",
"0.59574217",
"0.5946675",
"0.59051055",
"0.5901339",
"0.5863731",
"0.5822922",
"0.5815814",
"0.5804576",
"0.58009744",... | 0.77206004 | 0 |
Creates the row that displays the grand total for the page. | function showGrandTotal() {
var totalTable = $("#app-Running-total");
totalTable.html("");
var totalRow = $("<div />", {
"class": "app-Title-bar ms-bgColor-themeDarker ms-fontColor-themeLighter ms-font-xxl ms-fontWeight-semibold"
});
totalRow.append($("<div />", {
"class": "ap... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function totalsRowCreate(){\n var tfoot= document.getElementsByTagName('tfoot')[0];\n while (tfoot.firstChild){\n tfoot.removeChild(tfoot.firstChild)\n };\n var tr = document.createElement('tr');\n var td = document.createElement('td');\n var txt = document.createTextNode('Totals');\n td.appendChild(txt)... | [
"0.70363575",
"0.6982074",
"0.6886405",
"0.67625076",
"0.66244686",
"0.65004003",
"0.64919794",
"0.64223456",
"0.64070994",
"0.6398068",
"0.63972926",
"0.6391407",
"0.63792926",
"0.6322115",
"0.6316131",
"0.63075125",
"0.61193746",
"0.6117442",
"0.611438",
"0.6090373",
"0.604... | 0.74569684 | 0 |
Set the appropriate css classes based on the direction selected by calling the addAndRemoveStyles() function. The slide direction is set by the user when they click a direction button. Valid values are top, left, and right. | function setOverlayDirectionStyles(slideDirection) {
if(slideDirection === "top") {
addAndRemoveStyles(slideDirection, ["left","right"]);
} else if(slideDirection === "left") {
addAndRemoveStyles(slideDirection, ["top","right"]);
} else if(slideDirection === "right") {
addAndRemoveSty... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addAndRemoveStyles(slideDirection, directionArr) {\n let currentClass = menu.className; \n \n // Check to see if current css class and user selected slide\n // direction are the same. If not, remove the current css class\n // and set it to the slide direction css class selected by the user... | [
"0.7161403",
"0.6432645",
"0.63924",
"0.62993544",
"0.5879627",
"0.5853353",
"0.5853324",
"0.5844552",
"0.58420897",
"0.58218193",
"0.5761617",
"0.57367915",
"0.57367915",
"0.5718929",
"0.5707245",
"0.56993973",
"0.56978035",
"0.5692735",
"0.5692587",
"0.5691288",
"0.5687661"... | 0.7246631 | 0 |
Pulling parent's context into scope | bind(context) {
this.$parent = context;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get context() {\n return this.object\n }",
"get context() {\n\t\treturn this.__context;\n\t}",
"get context() {\n\t\treturn this.__context;\n\t}",
"get context() {\n\t\treturn this.__context;\n\t}",
"get context () {\n\t\treturn this._context;\n\t}",
"get context () {\n\t\treturn this._context;\n... | [
"0.6366589",
"0.62816584",
"0.62816584",
"0.62816584",
"0.6274228",
"0.6274228",
"0.6274228",
"0.62327796",
"0.62327796",
"0.62327796",
"0.6194523",
"0.6138513",
"0.6138513",
"0.61057395",
"0.6102619",
"0.6098353",
"0.6086841",
"0.60657555",
"0.60452914",
"0.60378945",
"0.603... | 0.67717785 | 0 |
Price calculation for Standard mastering Content is appended, based on users choice of 'priority' & 'vinyl' services. Variables containing Booleans are used to identify user input. | function checkSelector(vinyl, priority) {
if (vinyl == true && priority == true) {
$("#standard-master-calc").html("");
$("#standard-master-calc").append("<h2 class='text-box-style' id=\"standard-mastering-calc\" >You mastering is estimated to cost: \xA3".concat(price + 30, ". This price is per track, w... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function cakeFlavorPrice() { //lahat na dito para madetermine nya anong shape siya na belong. 1 function is recommended\n if(document.getElementById('flavor1').checked) { \n //orange\n }\n\n if(document.getElementById('flavor2').checked) {\n //choco\n }\n\n if(document.getElementById('... | [
"0.63605934",
"0.62458134",
"0.6239806",
"0.60987365",
"0.6060605",
"0.5952842",
"0.5932155",
"0.5851786",
"0.5817627",
"0.57824475",
"0.57821053",
"0.57784736",
"0.5770636",
"0.57244927",
"0.57155395",
"0.570572",
"0.5701984",
"0.56885564",
"0.56730723",
"0.5665708",
"0.5620... | 0.72949386 | 0 |
Look up a listener by querying listeners for query's listener arn and then resolve its load balancer for the security group information. | async getListenerByArn(elbv2, query) {
var _a, _b;
const listenerArn = query.listenerArn;
const listenerResults = await elbv2.describeListeners({ ListenerArns: [listenerArn] }).promise();
const listeners = ((_a = listenerResults.Listeners) !== null && _a !== void 0 ? _a : []);
if... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async findMatchingListener(elbv2, loadBalancers, query) {\n var _a;\n const loadBalancersByArn = indexLoadBalancersByArn(loadBalancers);\n const loadBalancerArns = Object.keys(loadBalancersByArn);\n const matches = Array();\n for await (const listener of describeListenersByLoadBa... | [
"0.70591193",
"0.6699718",
"0.5325493",
"0.50166535",
"0.49650356",
"0.49294382",
"0.48315668",
"0.47574353",
"0.4600504",
"0.45487928",
"0.44730714",
"0.44698656",
"0.44698536",
"0.44407028",
"0.44155765",
"0.44063386",
"0.43919387",
"0.43919387",
"0.4369796",
"0.4367523",
"... | 0.7392927 | 0 |
Look up a listener by starting from load balancers, filtering out unmatching load balancers, and then by querying the listeners of each load balancer and filtering out unmatching listeners. | async getListenerByFilteringLoadBalancers(elbv2, args) {
// Find matching load balancers
const loadBalancers = await findLoadBalancers(elbv2, args);
if (loadBalancers.length === 0) {
throw new Error(`No associated load balancers found for load balancer listener query ${JSON.stringify... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async findMatchingListener(elbv2, loadBalancers, query) {\n var _a;\n const loadBalancersByArn = indexLoadBalancersByArn(loadBalancers);\n const loadBalancerArns = Object.keys(loadBalancersByArn);\n const matches = Array();\n for await (const listener of describeListenersByLoadBa... | [
"0.79703295",
"0.7155298",
"0.5845712",
"0.57938546",
"0.5734139",
"0.56724095",
"0.5455329",
"0.54493445",
"0.54257363",
"0.54257363",
"0.53725564",
"0.5351204",
"0.53498757",
"0.5336534",
"0.5336534",
"0.5336534",
"0.5336534",
"0.5336534",
"0.5334476",
"0.5334476",
"0.53344... | 0.79456395 | 1 |
Finds the matching listener from the list of load balancers. This will error unless there is exactly one match so that the user is prompted to provide more specific criteria rather than us providing a nondeterministic result. | async findMatchingListener(elbv2, loadBalancers, query) {
var _a;
const loadBalancersByArn = indexLoadBalancersByArn(loadBalancers);
const loadBalancerArns = Object.keys(loadBalancersByArn);
const matches = Array();
for await (const listener of describeListenersByLoadBalancerArn(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async getListenerByFilteringLoadBalancers(elbv2, args) {\n // Find matching load balancers\n const loadBalancers = await findLoadBalancers(elbv2, args);\n if (loadBalancers.length === 0) {\n throw new Error(`No associated load balancers found for load balancer listener query ${JSON.... | [
"0.7578842",
"0.65466976",
"0.5799502",
"0.55432004",
"0.54118985",
"0.53031975",
"0.5187126",
"0.5033796",
"0.4993833",
"0.4993833",
"0.49791518",
"0.49791518",
"0.49681178",
"0.49645",
"0.49509713",
"0.49466926",
"0.49455732",
"0.49378312",
"0.49370676",
"0.49324238",
"0.49... | 0.8127513 | 0 |
Find load balancers by the given filter args. | async function findLoadBalancers(elbv2, args) {
// List load balancers
let loadBalancers = await describeLoadBalancers(elbv2, {
LoadBalancerArns: args.loadBalancerArn ? [args.loadBalancerArn] : undefined,
});
// Filter by load balancer type
loadBalancers = loadBalancers.filter(lb => lb.Type ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async getListenerByFilteringLoadBalancers(elbv2, args) {\n // Find matching load balancers\n const loadBalancers = await findLoadBalancers(elbv2, args);\n if (loadBalancers.length === 0) {\n throw new Error(`No associated load balancers found for load balancer listener query ${JSON.... | [
"0.73762476",
"0.6356878",
"0.57221276",
"0.53575283",
"0.53575283",
"0.53393245",
"0.53304785",
"0.52700186",
"0.5249113",
"0.48639277",
"0.47455448",
"0.45500955",
"0.44673935",
"0.4451219",
"0.43281797",
"0.42996106",
"0.42964345",
"0.42936096",
"0.42873165",
"0.4276812",
... | 0.7750172 | 0 |
Helper to paginate over describeLoadBalancers | async function describeLoadBalancers(elbv2, request) {
var _a;
const loadBalancers = Array();
let page;
do {
page = await elbv2.describeLoadBalancers({
...request,
Marker: page === null || page === void 0 ? void 0 : page.NextMarker,
}).promise();
loadBalan... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function findLoadBalancers(elbv2, args) {\n // List load balancers\n let loadBalancers = await describeLoadBalancers(elbv2, {\n LoadBalancerArns: args.loadBalancerArn ? [args.loadBalancerArn] : undefined,\n });\n // Filter by load balancer type\n loadBalancers = loadBalancers.filter(lb ... | [
"0.6671167",
"0.6562367",
"0.6099261",
"0.6091582",
"0.59216255",
"0.59216255",
"0.5288596",
"0.52235335",
"0.51661295",
"0.5139526",
"0.5121915",
"0.50825065",
"0.5034677",
"0.50194824",
"0.50193083",
"0.49885944",
"0.49683845",
"0.49551636",
"0.4897674",
"0.48934725",
"0.48... | 0.75537217 | 0 |
Describes the tags of each load balancer and returns the load balancers that match the given tags. | async function filterLoadBalancersByTags(elbv2, loadBalancers, loadBalancerTags) {
const loadBalancersByArn = indexLoadBalancersByArn(loadBalancers);
const loadBalancerArns = Object.keys(loadBalancersByArn);
const matchingLoadBalancers = Array();
// Consume the items of async generator.
for await (c... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function findLoadBalancers(elbv2, args) {\n // List load balancers\n let loadBalancers = await describeLoadBalancers(elbv2, {\n LoadBalancerArns: args.loadBalancerArn ? [args.loadBalancerArn] : undefined,\n });\n // Filter by load balancer type\n loadBalancers = loadBalancers.filter(lb ... | [
"0.6689788",
"0.6253623",
"0.5794453",
"0.5673975",
"0.56450033",
"0.53765297",
"0.5157804",
"0.51165015",
"0.50886333",
"0.50886333",
"0.5004743",
"0.49890295",
"0.49812004",
"0.496338",
"0.49362963",
"0.48552987",
"0.48169762",
"0.4805989",
"0.47954834",
"0.47913572",
"0.47... | 0.7415433 | 0 |
Determines if the given TagDescription matches the required tags. | function tagsMatch(tagDescription, requiredTags) {
var _a;
const tagsByName = {};
for (const tag of (_a = tagDescription.Tags) !== null && _a !== void 0 ? _a : []) {
tagsByName[tag.Key] = tag.Value;
}
for (const tag of requiredTags) {
if (tagsByName[tag.key] !== tag.value) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function matchesFilter(name, description, tags) {\n var keywords, i;\n\n if ($scope.filter.tag && !hasTag($scope.filter.tag, tags)) {\n return false;\n }\n\n if ($scope.filter.keyword) {\n keywords = $scope.filter.keyword.split(/\\s+/);\n for (i = 0; i < keywords.length; i+... | [
"0.69994324",
"0.68842256",
"0.68373173",
"0.6704961",
"0.64596635",
"0.62137705",
"0.618109",
"0.6126151",
"0.59884757",
"0.5982223",
"0.57759446",
"0.57630956",
"0.5649355",
"0.55791557",
"0.5517495",
"0.5517495",
"0.5516076",
"0.5484152",
"0.54485625",
"0.544544",
"0.54028... | 0.8601712 | 0 |
Determines if a listener matches the query filters. | function listenerMatchesQueryFilter(listener, args) {
if (args.listenerPort && listener.Port !== args.listenerPort) {
// No match.
return false;
}
if (args.listenerProtocol && listener.Protocol !== args.listenerProtocol) {
// No match.
return false;
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"matchesFilter(filter) {\n let typeMatches = true;\n if (filter.type) {\n // Internal events are always shown\n typeMatches = this.messageType.slug === filter.type || this.messageType.internal;\n }\n\n let stateMatches = true;\n if (filter.state && !this.messageType.internal) {\n if ('... | [
"0.65851545",
"0.63810873",
"0.5925994",
"0.5740633",
"0.57172525",
"0.56964344",
"0.55918896",
"0.5515413",
"0.5402296",
"0.5396454",
"0.53721285",
"0.5360615",
"0.5360536",
"0.53297234",
"0.530371",
"0.5261016",
"0.5244395",
"0.51386243",
"0.513002",
"0.5104955",
"0.5097632... | 0.77321374 | 0 |
Returns a record of load balancers indexed by their arns | function indexLoadBalancersByArn(loadBalancers) {
const loadBalancersByArn = {};
for (const loadBalancer of loadBalancers) {
loadBalancersByArn[loadBalancer.LoadBalancerArn] = loadBalancer;
}
return loadBalancersByArn;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"loadBalancers() {\n return new LoadBalancers(this.getSDK(), this.getToken());\n }",
"async function describeLoadBalancers(elbv2, request) {\n var _a;\n const loadBalancers = Array();\n let page;\n do {\n page = await elbv2.describeLoadBalancers({\n ...request,\n Marke... | [
"0.6220872",
"0.5971758",
"0.58210677",
"0.5757015",
"0.5323823",
"0.52188593",
"0.5214052",
"0.5213802",
"0.51323307",
"0.5059055",
"0.5059055",
"0.50134075",
"0.49662432",
"0.48994145",
"0.4891143",
"0.4885644",
"0.48449463",
"0.48138893",
"0.47996512",
"0.4785345",
"0.4754... | 0.7158163 | 0 |
Sets up picture polyfill by polling the document and running the polyfill every 250ms until the document is ready. Also attaches picturefill on resize | function runPicturefill() {
picturefill();
var intervalId = setInterval( function() {
// When the document has finished loading, stop checking for new images
// https://github.com/ded/domready/blob/master/ready.js#L15
picturefill();
if ( /^loaded|^i|^c/.test( doc.readyState ) ) {
clearInterval( inte... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function runPicturefill() {\n picturefill();\n var intervalId = setInterval( function() {\n // When the document has finished loading, stop checking for new images\n // https://github.com/ded/domready/blob/master/ready.js#L15\n picturefill();\n if ( /^loade... | [
"0.7783158",
"0.77822113",
"0.77363485",
"0.74007154",
"0.57750124",
"0.57439935",
"0.5684817",
"0.5676581",
"0.5649972",
"0.56442225",
"0.55654645",
"0.5564997",
"0.5548294",
"0.55360764",
"0.55288655",
"0.547229",
"0.5467483",
"0.5439096",
"0.5418402",
"0.536474",
"0.536448... | 0.7852566 | 1 |
removed expired aggregated total from local store | function removeExpiredAggTotals() {
var now = new Date().getTime();
var cache_time = 3600000; //1 hour (3600000 ms)
for (var i = 0; i < localStorage.length; i++) {
var key = localStorage.key(i);
var agg_data = JSON.parse(localStorage[key]);
//check within cache time
if ((now... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"clearExpired () {\n // return list\n const ret = []\n\n // iterate over storage keys to find all counters\n const that = this\n this._iterKeys(function (storageKey) {\n // if its not a timestamp key, skip it\n if (storageKey.indexOf(that._expiration_key_prefix) === 0) {\n // get ite... | [
"0.6398248",
"0.5914871",
"0.5890392",
"0.5804562",
"0.5701719",
"0.56518817",
"0.56195235",
"0.559968",
"0.55637133",
"0.5531583",
"0.55045193",
"0.54875964",
"0.54803246",
"0.54528576",
"0.54448307",
"0.5434856",
"0.54276496",
"0.54188675",
"0.5415997",
"0.5411508",
"0.5408... | 0.7334492 | 0 |
store aggregated total in local store | function setAggTotals(url, agg_total) {
if (Modernizr.localstorage && window.JSON) {
var now = new Date().getTime();
localStorage['art-' + url] = JSON.stringify({
agg: agg_total,
set: now
});
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getTotalAmount(){\n this.total = 0;\n this.total = this.data.reduce((sum,item) => sum+item.price,0);\n localStorage.setItem(\"totalAmount\", this.total);\n}",
"function calcTotal() {\r\n // Get chosen package items\r\n var depFlight = JSON.parse(localStorage.getItem('departure'));\r\n var hotel... | [
"0.70492816",
"0.66453636",
"0.6553976",
"0.6553748",
"0.65437233",
"0.64830744",
"0.6478989",
"0.64634824",
"0.64061314",
"0.6378009",
"0.63551265",
"0.6348769",
"0.63382256",
"0.6328139",
"0.63059384",
"0.62746125",
"0.6269189",
"0.62664974",
"0.6259071",
"0.62484217",
"0.6... | 0.68081534 | 1 |
Function to create the ajax pager | function createAjaxPager(pager)
{
pager.next('.item-list').hide();
pager_cnt = pager.find('.ajax-pager-cnt');
pager_cnt.css('display', 'block');
t = pager.find('.ajax-pager');
t.click(function(e) {
pager.addClass(ajax_loader_class);
var txtCopy = t.text();
t.text('Loading..... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function renderpager(pagenumber, pagecount,totalcount, buttonClickCallback) { // setup $pager to hold render \r\n\t\tvar $pager = $('<ul class=\"pages\"></ul>'); // add in the previous and next buttons \r\n\t\t$pager.append(\"<li class='thpoint'>\"+pagenumber+\"/\"+pagecount+\" </li>\");\r\n... | [
"0.7129755",
"0.7034498",
"0.6988945",
"0.68606675",
"0.6853641",
"0.68333656",
"0.6807379",
"0.68055564",
"0.67904985",
"0.67862827",
"0.67707014",
"0.6724932",
"0.670998",
"0.6706919",
"0.6699687",
"0.6660762",
"0.66218996",
"0.6613368",
"0.66027224",
"0.6595493",
"0.657907... | 0.7944023 | 0 |
Function to create the view options | function createViewOptions()
{
// Set up the listing view buttons
if(jQuery('.list-view-options').length > 0) {
jQuery('.list-view-options').show();
jQuery('.list-view-options a').each(function() {
jQuery(this).click(function() {
href = jQuery(this).attr('href');
viewo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_register_view_options() {\n let current_renderers = renderers.getInstance();\n render(options(current_renderers), this._vis_selector);\n }",
"_register_view_options() {\n let current_renderers = renderers.getInstance();\n for (let name in current_renderers) {\n const display_name... | [
"0.68591684",
"0.66572124",
"0.64441526",
"0.64082336",
"0.6288756",
"0.61365396",
"0.6117909",
"0.6117909",
"0.6117909",
"0.61067694",
"0.60337466",
"0.60337466",
"0.6025546",
"0.6018806",
"0.60025114",
"0.5999805",
"0.5958288",
"0.5916703",
"0.5909281",
"0.590404",
"0.58848... | 0.7801309 | 0 |
Attack functions Turn Log Constructor | function LogTurnObject (atk, def, system) {
this.atk = atk;
this.def = def;
this.system = system;
this.hits = 0;
this.hpDam = 0;
this.spDam = 0;
this.ionDam = 0;
this.soaks = 0;
this.kill = false;
this.sBreak = false;
this.compDest = [];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Log() {}",
"function OogaahPlayLog() {\n\tthis.mPos = new Vec2(); // base position of the log (elements are offset by this)\n\t\n\tthis.mLogCanvas = new RenderCanvas(); // the canvas that the log is rendered too\n\tthis.mLogTab = new Polygon(); // tab used to show and hide the log\n\tthis.mCamera = new ... | [
"0.60000634",
"0.5906264",
"0.5859145",
"0.5852989",
"0.583389",
"0.58160436",
"0.57425565",
"0.5739282",
"0.5725555",
"0.5701776",
"0.566369",
"0.56513286",
"0.56428397",
"0.55969495",
"0.5589484",
"0.55856675",
"0.5561481",
"0.5560243",
"0.5556571",
"0.55433774",
"0.5534019... | 0.7359836 | 0 |
initialise TabButton for each button | _loadTabButton() {
for ( let i = 0; i < this._tabButtonList.length; i++ ) {
let tabButton = new TabButton();
tabButton.init(
this._tabButtonList[ i ],
this._tabContentList[ i ],
this._tabContentList,
this._tabButtonList
);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setupTabs(){\n const content = document.getElementById('content');\n buttons = Array.from(content.getElementsByTagName('button'));\n\n buttons.forEach(button => {\n button.addEventListener(\"click\", changeTab);\n });\n\n loadHome();\n buttons[0].classList.add('button-active');\n}... | [
"0.7132287",
"0.7060762",
"0.68497705",
"0.6729976",
"0.66092294",
"0.65910923",
"0.6514886",
"0.6488614",
"0.6483157",
"0.6464533",
"0.6456395",
"0.64416283",
"0.6426629",
"0.6261078",
"0.6255137",
"0.62511927",
"0.6212894",
"0.6212417",
"0.61992246",
"0.6197935",
"0.6193375... | 0.843569 | 0 |
lajikohtainen haku havainnotTaulukosta ja taulukon muuttaminen lajikohtaiseksi | function etsiLajiHavainnot(laji){
var aputaulukko=[];
for(var i in havainnotTaulukko){ //käydään kaikki havainnot läpi yksi kerrallaan
if (havainnotTaulukko[i].laji==laji){ //jos objektin lajinimi vastaa parametrina saatua nimeä
aputaulukko.push(havainnotTaulukko[i]); //objekti aputaulukkoon
}
}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function hitungLuasSegitiga(alas,tinggi) {\n var luas = 1/2 * alas * tinggi;\n\n return luas;\n\n}",
"function hitungLuasSegiEmpat(sisi){\n //tidak ada nilai balik\n var luas = sisi * sisi\n return luas\n}",
"function HyderabadTirupati() // extends PhoneticMapper\n{\n var map = [ \n new KeyMap... | [
"0.6540492",
"0.639513",
"0.6371688",
"0.6368154",
"0.636645",
"0.6347681",
"0.6320189",
"0.63034564",
"0.6277662",
"0.6197413",
"0.61945075",
"0.6191112",
"0.6171911",
"0.6162041",
"0.61368865",
"0.61237216",
"0.60894424",
"0.60779464",
"0.60716355",
"0.60701716",
"0.6061983... | 0.69590807 | 0 |
type: GET desc: Get all imbuements auth: Public | async function findImbuements(req, res) {
try {
const imbuements = await Imbuement.find();
res.status(200).send(imbuements);
} catch(e) {
console.log(`There was a problem trying to retrieve imbuements. Error: ${e.message}`);
res.status(500).json({ message: `There was a problem tr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getAll(){\n this.server.get('/api/get-users-banned', (req, res) => {\n try {\n this.App.BanOrm.getAll((err, rows) => {\n if (err) this.App.throwErr(err, this.prefix, res);\n else res.send(rows)\n })\n }\n ca... | [
"0.62270594",
"0.6128454",
"0.61019003",
"0.59456444",
"0.5932039",
"0.5926758",
"0.59050065",
"0.585846",
"0.5824148",
"0.58079016",
"0.5780642",
"0.5766442",
"0.56813365",
"0.56660235",
"0.5657437",
"0.5648752",
"0.5643255",
"0.56280035",
"0.5605036",
"0.56023014",
"0.55731... | 0.6367339 | 0 |
type: GET desc: Get a single imbuement by id auth: Public | async function findImbuementById(req, res) {
try {
const imbuement = await Imbuement.findById(req.params.id);
res.status(200).send(imbuement);
} catch(e) {
console.log(`There was a problem trying to retrieve imbuement ${req.params.id}. Error: ${e.message}`);
res.status(500).json(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get(id) {\n\n }",
"async showBillById(req, res) {\r\n console.log(req.params.id);\r\n const bill = await Bill.findById(req.params.id);\r\n return res.json(bill);\r\n }",
"getById(id)\n {\n return this.getModel()\n .find(id)\n .first();\n }",
"getB... | [
"0.7080151",
"0.6722294",
"0.66818404",
"0.66771966",
"0.664179",
"0.66296",
"0.65403044",
"0.6530534",
"0.64901114",
"0.64897287",
"0.64761114",
"0.64609057",
"0.6453239",
"0.6453239",
"0.6425687",
"0.6417163",
"0.64065343",
"0.64016664",
"0.63772726",
"0.63672525",
"0.63672... | 0.7140796 | 0 |
type: POST desc: Post profile images to Cloudinary auth: Private | async function postProfileImage(req, res) {
try {
const fileStr = req.body.data;
const uploaded = await Cloudinary.uploader.upload(fileStr, {
upload_preset: 'tibiahuntingrecords_profiles'
});
if (!uploaded) {
throw new Error();
}
cons... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async UploadImage(url) {\n const ClientId = 'Client-ID '+'546c25a59c58ad7'\n const reqOpts = {\n headers: {\n Accept: \"application/json\",\n Authorization: ClientId,\n \"Content-Type\": \"application/json\"\n },\n method: \"POST\",\n body: JSON.stringify({\n ... | [
"0.68410224",
"0.6683061",
"0.65537035",
"0.6527026",
"0.6498342",
"0.6493692",
"0.64641476",
"0.6416474",
"0.6410591",
"0.63725024",
"0.6333602",
"0.6313469",
"0.62911433",
"0.62376827",
"0.6204915",
"0.62025386",
"0.6183321",
"0.614702",
"0.61254936",
"0.61092365",
"0.60964... | 0.74393636 | 0 |
type: POST desc: Post hunting images to Cloudinary auth: Private | async function postHuntingRecordImage(req, res) {
try {
const fileStr = req.body.data;
const uploaded = await Cloudinary.uploader.upload(fileStr, {
upload_preset: 'tibiahuntingrecords_hunting-records'
});
if (!uploaded) {
throw new Error();
}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_handleSubmit(e) {\n e.preventDefault();\n const image = this.state.file;\n\n const cloudName = 'dgjnetyeq';\n const url = `https://api.cloudinary.com/v1_1/${cloudName}/image/upload`;\n\n const timestamp = Date.now()/1000;\n const uploadPreset = 'jlgmapzb';\n\n const paramsStr = `timestamp=${... | [
"0.7004361",
"0.6620235",
"0.6619656",
"0.6559094",
"0.6493865",
"0.64936846",
"0.6425222",
"0.6317972",
"0.6300816",
"0.62459415",
"0.62375873",
"0.61977106",
"0.61611575",
"0.61230975",
"0.6097605",
"0.6069925",
"0.6047763",
"0.60231966",
"0.6005646",
"0.5988853",
"0.597419... | 0.68725735 | 1 |
Display path on map, along with markers for start and end waypoints, and for the next waypoint. | displayPath()
{
// Show start and end waypoints.
let startMarker = new google.maps.Marker({
position: this._navPath.waypoints[0],
map: this._map,
icon: {
path: google.maps.SymbolPath.CIRCLE,
scale: 5,
fillCo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showPath() {\n\tlet object = {\n\t\ttype: \"geojson\",\n\t\tdata: {\n\t\t\ttype: \"Feature\",\n\t\t\tproperties: {\n description: \"\"\n },\n\t\t\tgeometry: {\n\t\t\t\ttype: \"LineString\",\n\t\t\t\tcoordinates: []\n\t\t\t}\n\t\t}\n\t};\n\n //let airportRoutes = [];\n\tfor (le... | [
"0.70049256",
"0.6902126",
"0.6763769",
"0.67246693",
"0.6702072",
"0.6632143",
"0.66273624",
"0.6620431",
"0.65888417",
"0.65262973",
"0.6441609",
"0.643849",
"0.6430496",
"0.6424937",
"0.64028084",
"0.6383241",
"0.6370001",
"0.63387656",
"0.6322734",
"0.6309306",
"0.6300981... | 0.78584504 | 0 |
Distance to next waypoint | _distanceToNext()
{
return this._navPath.distanceToWaypoint(this._position, this._waypointIdx);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateNextWaypoint() {\n\tnextWaypoint.dist = airlineDistanceOf(deviceLocation.latitude, deviceLocation.longitude, nextWaypoint.latitude, nextWaypoint.longitude);\n\tnextWaypoint.dir = degreeBetween(deviceLocation.latitude, deviceLocation.longitude, nextWaypoint.latitude, nextWaypoint.longitude);\n}",
"... | [
"0.72570086",
"0.7226546",
"0.7145537",
"0.6877083",
"0.6738778",
"0.66822284",
"0.66652673",
"0.66301614",
"0.6536461",
"0.64552534",
"0.6302685",
"0.6226351",
"0.61880827",
"0.61820096",
"0.6158743",
"0.6121669",
"0.6095808",
"0.6084879",
"0.6056796",
"0.6041845",
"0.604112... | 0.81945896 | 0 |
Update heading as bearing from last position to current position. Update distance between last position and current position. Update position array with current position. | _updatePositionAndHeading(position)
{
if (this._position !== null)
{
this._heading = google.maps.geometry.spherical.computeHeading(this._position, position);
this._totalDistance += google.maps.geometry.spherical.computeDistanceBetween(this._position, position);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"heading() {\n this.update();\n let truncate = [0, 0, 0];\n for (let i = X; i < Z + 1; i += 1) {\n let theSign = this._accel[i] >= 0 ? 1 : -1;\n truncate[i] = theSign * Math.abs(Math.min(Math.abs(this._accel[i]), 1.0));\n }\n\n try {\n let pitch = ... | [
"0.6452943",
"0.5986927",
"0.5891789",
"0.58789456",
"0.58097196",
"0.57711333",
"0.57385325",
"0.5727118",
"0.57133555",
"0.56057453",
"0.55850106",
"0.55704963",
"0.55685097",
"0.5528105",
"0.55264664",
"0.5524792",
"0.5481917",
"0.548144",
"0.5478521",
"0.54446006",
"0.544... | 0.6717192 | 0 |
Average speed from beginning of journey (m/s). | _getAverageSpeed()
{
let endTime = Date.now()
// Get elapsed time in seconds.
let elapsedTime = (endTime - this._startTime) / 1000;
// Return average speed in m/s.
return this._totalDistance / elapsedTime;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"averageSpeed(){\n var resultSpeed = this._distanceRan/this._timeTaken\n return resultSpeed.toFixed(2);\n }",
"getAvgSpeed (trip) {\n // Gets average speed in km/h, duration is in minutes\n const avgSpeed = ((trip.distance / trip.duration) * 60)\n return avgSpeed\n }",
"get averageSpe... | [
"0.7351108",
"0.6908918",
"0.68347096",
"0.6532511",
"0.6501435",
"0.6450335",
"0.63862526",
"0.6364365",
"0.62907845",
"0.62349075",
"0.6120862",
"0.5970294",
"0.59601057",
"0.5905476",
"0.58834696",
"0.5874028",
"0.58419555",
"0.5797711",
"0.5785106",
"0.5756208",
"0.574948... | 0.76772404 | 0 |
Index of waypoint to navigate to. | get waypointIdx()
{
return this._waypointIdx
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getIndex(waypointId) {\n const m = waypointId.match(/:([0-9]+)$/);\n return m && m[1] ? parseInt(m[1]) : 0;\n}",
"function getNewWaypointIndex(itinerary, startDragPoint) {\n var waypoints = itinerary.waypoints;\n\n if (!waypoints || !waypoints.length) {\n return 0;\n }\... | [
"0.73227537",
"0.6610426",
"0.6409344",
"0.61861134",
"0.61241704",
"0.60681546",
"0.60477763",
"0.59049565",
"0.589733",
"0.58282",
"0.58232695",
"0.5762073",
"0.575624",
"0.5740144",
"0.5737018",
"0.5724288",
"0.56705177",
"0.5633477",
"0.5620996",
"0.55766034",
"0.5548362"... | 0.78845763 | 0 |
Distance to next waypoint as a readable string. | get distanceToNext()
{
if (!this._endOfPath)
{
// Return remaining distance in m.
let distanceValue = this._distanceToNext().toFixed(2);
return distanceValue.toString() + " m"
}
else
{
return "None"
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_distanceToNext()\r\n {\r\n return this._navPath.distanceToWaypoint(this._position, this._waypointIdx);\r\n }",
"get remainingDistance()\r\n {\r\n if (!this._endOfPath)\r\n {\r\n // Return remaining distance in km.\r\n let distanceValue = this._getRemainingDist... | [
"0.65801024",
"0.624288",
"0.6204574",
"0.60985845",
"0.6091373",
"0.6010434",
"0.5937024",
"0.5901614",
"0.5845182",
"0.58168954",
"0.5815441",
"0.5770802",
"0.57697207",
"0.5754449",
"0.56889457",
"0.56683445",
"0.5640151",
"0.5603585",
"0.5601498",
"0.55769473",
"0.5539898... | 0.73664874 | 0 |
Average speed from start of navigation as a readable string. | get averageSpeed()
{
// Return average speed in m/s.
let speedValue = this._getAverageSpeed().toFixed(2);
return speedValue.toString() + " m/s"
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_getAverageSpeed()\r\n {\r\n let endTime = Date.now()\r\n // Get elapsed time in seconds.\r\n let elapsedTime = (endTime - this._startTime) / 1000;\r\n\r\n // Return average speed in m/s.\r\n return this._totalDistance / elapsedTime;\r\n }",
"averageSpeed(){\n var ... | [
"0.651581",
"0.6480688",
"0.5876908",
"0.5830276",
"0.5675529",
"0.56274426",
"0.5590425",
"0.5583819",
"0.5569444",
"0.5518464",
"0.54751444",
"0.5463994",
"0.54483324",
"0.53968036",
"0.53931266",
"0.53386366",
"0.5324742",
"0.5320214",
"0.53163123",
"0.5314272",
"0.5294842... | 0.665986 | 0 |
Remaining time until end of path is reached as a readable string. | get remainingTime()
{
if (!this._endOfPath)
{
// Return remaining time in minutes.
let minutesValue = (this._getRemainingTime() / 60).toFixed(2);
if (isNaN(minutesValue))
{
return "NaN"
}
return minute... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"remaining() {\n if (this._remaining === undefined) {\n this._remaining = (this.eof ?\n \"\" : this._chars.slice(this._pointer + 1).join(''));\n }\n return this._remaining;\n }",
"getReadableTime() {\n // Debugging line.\n Helper.printDebugLine(this.getReada... | [
"0.598802",
"0.5870565",
"0.56102574",
"0.54358315",
"0.53740364",
"0.5330347",
"0.52915686",
"0.5225749",
"0.5221135",
"0.5210981",
"0.5134935",
"0.50927716",
"0.5083183",
"0.50445527",
"0.49246615",
"0.4900106",
"0.4883296",
"0.48607603",
"0.48439893",
"0.48404735",
"0.4827... | 0.6572946 | 0 |
Change the direction arrow image depending on user's current location and heading. | function showDirection(direction)
{
// Get DOM element reference.
let arrowRef = document.getElementById("direction-arrow");
// Set image based on direction.
if(-180 < direction && direction <= -112.5)
{
arrowRef.src = "images/uturn.svg";
}
else if(-112.5 < directio... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function arrowChange(){\n if(goingForward === true){\n image(upArrow, 100, 0, 100, 100);\n }\n else if(goingForward === false){\n image(downArrow, 100, 0, 100, 100);\n }\n}",
"function userHeadingUpdate(){\n // rotating marker\n mapUpdates.marker.icon.rotation = currentLocation.heading;\n \n ... | [
"0.7344161",
"0.6677096",
"0.6521259",
"0.6458589",
"0.64193743",
"0.6306712",
"0.6306712",
"0.6203259",
"0.61199963",
"0.6100619",
"0.6092049",
"0.6090224",
"0.60142756",
"0.6011588",
"0.5959142",
"0.5940705",
"0.59258354",
"0.59178597",
"0.591168",
"0.589263",
"0.58700234",... | 0.70953923 | 1 |
Display data output in HTML, in the div given by the idString. Used for the navigation info output. | function infoOutput(idString, data)
{
let elementRef = document.getElementById(idString);
elementRef.innerHTML = "<b>" + data + "</b>";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"RenderOnId(id_Name) {\n this.m_Output += \"</div>\";\n document.getElementById(id_Name).innerHTML = this.m_Output;\n }",
"function printData(data) {\n // console.log(data)\n var show = '';\n data.forEach(function (val) {\n // Store data in variable\n show += `\n <br><br>\n ... | [
"0.6975024",
"0.67359686",
"0.6674035",
"0.66661066",
"0.6591943",
"0.6485117",
"0.6480486",
"0.64654094",
"0.60751194",
"0.6058897",
"0.60393316",
"0.60282993",
"0.60194606",
"0.5999193",
"0.5976958",
"0.595177",
"0.5940983",
"0.5940983",
"0.5934409",
"0.5900693",
"0.5885709... | 0.6938856 | 1 |
Get path to naviagte from local storage, initialise path as instance of Path class. | function getPathToNavigate()
{
if (typeof(Storage) !== "undefined")
{
// Retrieve the object containing the path list storage key and the path index.
let pathKeyAndIdx = JSON.parse(localStorage.getItem(NAVIGATE_KEY));
// Retrieve the path list PDO from the storage key
le... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get localPath() {\n return this._manager.contents.localPath(this._path);\n }",
"function retrieveUserPaths()\n{\n if (typeof(localStorage) !== \"undefined\") {\n let userRoutesFromLocalStorage = localStorage.getItem(\"userRoutes\");\n userRoutesFromLocalStorage = JSON.parse(userRoutesF... | [
"0.6603166",
"0.65837604",
"0.63697386",
"0.6271157",
"0.61218244",
"0.5916171",
"0.58673346",
"0.5855958",
"0.5838614",
"0.583811",
"0.5829277",
"0.58146495",
"0.58000696",
"0.57923436",
"0.5789897",
"0.57485974",
"0.5661637",
"0.56526357",
"0.56452036",
"0.56012905",
"0.559... | 0.76283616 | 0 |
You've prevented any part of your program from inadvertently changing the social security number; mike.social = 672159826; just won't work. But what we have is a bit lame. Sure, we can't change the data, but we can't view the data either! Luckily, we can create a public method that lets your program read the informatio... | function User(name, ssn){
var social = ssn;
this.name = name;
// Adds a so-called 'getter' function to allow reading private variables
this.getSSN = function(){
return social;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getUserData() {\n return {\n \"id\": Math.floor(Math.random() * 100 + 1),\n \"username\": generateName(),\n \"balance\":2500\n }\n}",
"function updateUserStuff(user) {\n console.log(\"doing stuff for\", user.get('username'));\n}",
"function getUser () {return user;}",
"func... | [
"0.61893404",
"0.6060656",
"0.60494304",
"0.60299116",
"0.60291135",
"0.60291135",
"0.601123",
"0.5970592",
"0.5901585",
"0.5837533",
"0.58069044",
"0.58055127",
"0.5787493",
"0.57831174",
"0.5758121",
"0.5758049",
"0.5755092",
"0.5753719",
"0.57455194",
"0.5738854",
"0.56996... | 0.61090636 | 1 |
var grid = [null, null, null, null, null, null, null, null, null] var player = 1 playTurn(index) It should take one parameter which is a zerobased index to your grid, indicating where the current player's token should be played. It should return a boolean value to indicate whether the move was allowed or not true if it... | function playTurn (index) {
console.log('entered');
if (grid[index] || isGameOver()){
return false
} else {
grid[index] = player
if (player === 1) player = 2
else player = 1
return true
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function playTurn (index) {\n if(grid[index] || isGameOver()) {\n return false\n } else {\n console.log(\"player: \" + player)\n grid[index] = player\n if (player === 1) player = 2\n else player = 1\n console.log(\"grid: \" + grid.join(\" \"))\n return true\n }\n}",
"function ... | [
"0.8477865",
"0.7294059",
"0.6853553",
"0.684084",
"0.67689365",
"0.67689365",
"0.6760721",
"0.67593163",
"0.6695667",
"0.6686469",
"0.66613513",
"0.66276604",
"0.6581334",
"0.6552796",
"0.65144503",
"0.6499283",
"0.6495963",
"0.6495273",
"0.6493858",
"0.64863765",
"0.6481825... | 0.8393511 | 1 |
isGameOver() It should return a true or false if the game is over. | function isGameOver (){
if (whoWon()) return true
return false
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isGameOver() {\n return FallingShape.isAboveBoard();\n }",
"function isGameOver () {\n return (state.round > config.maxRounds || !movesRemaining());\n}",
"checkIfGameOver() {\n if (this.character.dead || this.endBoss.dead) {\n this.gameOver.gameFinished = true;\n ... | [
"0.87242764",
"0.834357",
"0.8302888",
"0.8293698",
"0.8246561",
"0.82407796",
"0.81598157",
"0.81372184",
"0.80877185",
"0.80643684",
"0.79105735",
"0.7910483",
"0.78923386",
"0.7851565",
"0.78269476",
"0.778314",
"0.77734",
"0.77707475",
"0.7768292",
"0.77647215",
"0.774907... | 0.8407595 | 1 |
removes blank space in every string element in a list | function removeSpaces(array){
for (var i = 0; i < array.length; i++)
{
array[i] = array[i].replace(/ /g, '');
}
return array;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function split_remove_white_space(x)\n{\n\n x = x.replace(/(\\r\\n|\\n|\\r)/gm,\" \");\n var x = x.split(\" \");\n\n // going backwards means you don't miss items when \n // after removing them the array size changes\n\n \n for (var i=x.length; i>0 ;i--)\n { \n if (x[i]===\"\") {\n \n x.splice(i,1)... | [
"0.7129647",
"0.70155305",
"0.6951047",
"0.68913203",
"0.68363744",
"0.6812329",
"0.6784328",
"0.67028993",
"0.6686227",
"0.66772854",
"0.6649189",
"0.6626572",
"0.66117543",
"0.65936273",
"0.65936273",
"0.6560111",
"0.65309614",
"0.6492207",
"0.6470523",
"0.6462015",
"0.6442... | 0.7046328 | 1 |
Promts the downloading of a zip file containing the cropped files as well as scaled variants | download_zip() {
this.download_btn.prop("disabled", 1);
if (this.mode === Cropper.modes.ARTWORK) {
console.info("Preparing .zip for Cropper.modes.ARTWORK, basename:", this.fname);
// Ratio with which the original width (614px) needs to scale
// Height is always fully... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function downloadZip() {\n $(\"#zipDialog\").modal('hide');\n $(\"#progressDialog\").modal('show');\n piecesToZip(\n {\n cropped: $(\"#cropped\").prop('selected'),\n trapezoidal: $(\"#trapezoidal\").prop('selected')\n },\n {\n maxPieces: parseInt($(\"#... | [
"0.6432397",
"0.5863248",
"0.57272774",
"0.56392664",
"0.5537444",
"0.5473564",
"0.5440703",
"0.53621817",
"0.52824616",
"0.52640814",
"0.5234031",
"0.5209861",
"0.5156814",
"0.5156296",
"0.51435953",
"0.51359516",
"0.512706",
"0.51154584",
"0.51125276",
"0.5109899",
"0.50928... | 0.65290666 | 0 |
if REACT_APP_URL is set, we send back end requests to that, otherwise we default to the same host that served up the client useful for dev mode where the server might be hosted in a different url | baseUrl() {
// console.log("baseUrl: " + process.env.REACT_APP_URL);
return (process.env.REACT_APP_URL) ? process.env.REACT_APP_URL : "/api/";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getServerURL() {\n const url = isDev ? \"http://localhost:4000\" : document.location.host;\n log(\"Requested server: \", url);\n return url;\n}",
"function getBackendUrl(){\n let backendHost;\n const hostname = window && window.location && window.location.hostname;\n \n if(hostname === 'reals... | [
"0.699972",
"0.6821749",
"0.64500725",
"0.6428583",
"0.6402477",
"0.63878226",
"0.61990255",
"0.6148322",
"0.6142741",
"0.60616356",
"0.6027283",
"0.60135037",
"0.5996269",
"0.5955993",
"0.59210145",
"0.59166276",
"0.5898644",
"0.58647215",
"0.58273363",
"0.5823428",
"0.58098... | 0.71590865 | 0 |
For the currently signed in user we need to retrieve their workspaces. We then retrieve the embedviews associated with this user.. | async populateWorkspace() {
const token = await authService.getAccessToken();
const response = await fetch('workspaces', {
headers: !token ? {} : { 'Authorization': `Bearer ${token}` }
});
const data = await response.json();
console.log(data);
this.setState({ ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async getChannelsInWorkspace(workspace){\n\n //TODO: change this to a single query\n\n let workspaceChannels = await workspace.getChannels();\n\n // boolean array of the same length as workspaceChannels\n // element i is true if the workspaceChannels[i] hasUser user\n let appartenanceArray... | [
"0.56206006",
"0.5500207",
"0.5281111",
"0.51373225",
"0.5113339",
"0.50215334",
"0.50149506",
"0.50086135",
"0.498719",
"0.4950315",
"0.4903373",
"0.4898073",
"0.4871293",
"0.4870152",
"0.48482096",
"0.48428208",
"0.48193768",
"0.4799481",
"0.47990364",
"0.47456056",
"0.4717... | 0.60639435 | 0 |
Send new sentence for classification | classifySentence(key, sentence) {
this.socketClient.sendRequest(JSON.stringify({ key: key, sentence: sentence }));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function submitSentence() {\n\tvar params = getUrlParams();\n\tvar url = \"cmd=sentence&sentence=\"+encodeURIComponent($(\"sentenceInput\").value)+\"&gameid=\"+params.gameid+\"&turn=\"+params.turn;\n\tvar sentence = $(\"sentenceInput\").value.trim();\n \n\tif (!validateSentence(sentence)) {\n \treturn;\n } \n\t... | [
"0.6556356",
"0.5941073",
"0.5883199",
"0.58374476",
"0.56647116",
"0.5657031",
"0.5651499",
"0.56144917",
"0.561019",
"0.553272",
"0.5486456",
"0.54861623",
"0.54844767",
"0.5483144",
"0.54728025",
"0.5426347",
"0.5404563",
"0.539004",
"0.537374",
"0.5366815",
"0.5353515",
... | 0.73278046 | 0 |
Converts sentiment to color | sentimentToColor(sentiment, min, max) {
var base = (max - min);
if (base == 0) { sentiment = 100; }
else {
sentiment = (sentiment - min) / base * 100;
}
var r, g, b = 0;
if (sentiment < 50) {
r = 255;
g = Math.round(5.1 * sentiment);
}
else {
g = 255;
r = M... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getChalkColor(sentimentScore){\n let chalkColor = '\\x1b[33m';\n if(sentimentScore > 0.2) chalkColor = '\\x1b[32m';\n else if(sentimentScore < -0.2) chalkColor = '\\x1b[31m';\n return chalkColor;\n}",
"renderCapturedText() {\n // prepare an array of sentences\n const sentence_array = new Array... | [
"0.7039317",
"0.6809392",
"0.6496671",
"0.58685786",
"0.5865612",
"0.58134454",
"0.5732995",
"0.5724238",
"0.5678026",
"0.5655213",
"0.562272",
"0.5578133",
"0.5566439",
"0.55143154",
"0.5511032",
"0.5481247",
"0.5477257",
"0.54763013",
"0.54693675",
"0.54597896",
"0.54501367... | 0.81127596 | 0 |
render for capture text area | renderEntry() {
return (
<textarea id="capture" name="capture" rows="25" cols="100" onInput={(event) => this.handleCapture(event.target.value)}></textarea>
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function monitorText(event){\r\n\tvar frame = frames['editorText'];\r\n\tvar text = document.getElementById('htmlText');\r\n\r\n\tframe.srcdoc = \"<!DOCTYPE html><html><head><link href='editor/embedded.css' rel='stylesheet' type='text/css'></head><body><pre class='postTextPre'>\" + text.value + \"</pre></body></ht... | [
"0.6416426",
"0.63126343",
"0.6214379",
"0.6138661",
"0.60019",
"0.59311783",
"0.5909534",
"0.58696634",
"0.58234394",
"0.58016825",
"0.57875836",
"0.57875836",
"0.57825875",
"0.57723784",
"0.57598263",
"0.57593584",
"0.57583547",
"0.57583547",
"0.57583547",
"0.57583547",
"0.... | 0.71271867 | 0 |
get the frame object by frame name | function getFrame(objFrames,strFrameName)
{
try
{
var i = 0;
for (i=0; i<objFrames.length; i++)
if (objFrames(i).name.toUpperCase() == strFrameName.toUpperCase())
return objFrames(i);
}
catch (e)
{
return null;
}
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getFrameByName(name) {\n\t for (var i = 0; i < frames.length; i++)\n\t\tif (frames[i].name == name)\n\t\t return frames[i];\n\t \n\t return null;\n\t}",
"getFrame(win, frameName) {\n EnigmailLog.DEBUG(\"windows.jsm: getFrame: name=\" + frameName + \"\\n\");\n for (var j = 0; j < win.frames.leng... | [
"0.7960137",
"0.76743335",
"0.6779234",
"0.6401901",
"0.63114834",
"0.6256957",
"0.61937135",
"0.61589766",
"0.6094114",
"0.6094114",
"0.6094114",
"0.60704166",
"0.6069607",
"0.60251296",
"0.5871114",
"0.57817596",
"0.57729006",
"0.5723232",
"0.56940866",
"0.56087255",
"0.558... | 0.7842953 | 1 |
Safe get element value : boolean value = "1": true; else false | function getElementValueSafe_Bool(strElemId)
{
var objControl = document.getElementById(strElemId);
var strValue = "";
if (objControl)
strValue = objControl.value;
if (strValue == "1")
return true;
else
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get boolValue() {}",
"function boolHandler( elem, name, isXML ) {\n\tvar val;\n\treturn isXML ?\n\t\tundefined :\n\t\t(val = elem.getAttributeNode( name )) && val.specified ?\n\t\t\tval.value :\n\t\t\telem[ name ] === true ? name.toLowerCase() : null;\n}",
"getValue() {\n attribute = true;\n const value ... | [
"0.7452072",
"0.70618206",
"0.6926221",
"0.69248974",
"0.6783813",
"0.6623348",
"0.6471094",
"0.6281552",
"0.6240714",
"0.6207894",
"0.6207894",
"0.61574197",
"0.6144863",
"0.61422235",
"0.6111868",
"0.6092398",
"0.60824615",
"0.60803777",
"0.60621136",
"0.6011599",
"0.600150... | 0.71201503 | 1 |
Shows the directions along the path from point 0 to each point on the path, uses code from Google Maps API documentation | function showDirections(points, path){
var isCar = $('#travel-mode').val() === 'car';
var waypoints = [];
for (var i = 0; i < path.length-1; i++){
waypoints.push({'location':points[path[i]].lat+','+points[path[i]].lng});
}
directionsService.route({
origin: points[0].lat+','+points[0].lng,
destina... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getDirections(){\n\tvar waypts = [];\n\tfor(landmark in itinerary){\n\t\tvar point = itinerary[landmark].mapData.geometry.location\n\t\tvar loc = new google.maps.LatLng(point.lat, point.lng);\n\t\twaypts.push({location: loc, stopover: true});\n\t\tconsole.log(itinerary[landmark].yelpData);\n\t}\n\n\tvar r... | [
"0.65199983",
"0.6474693",
"0.64505136",
"0.64403415",
"0.6415119",
"0.62932473",
"0.62351435",
"0.6218948",
"0.6184512",
"0.6184324",
"0.61775947",
"0.61644167",
"0.6160309",
"0.61467737",
"0.6144654",
"0.61311775",
"0.61233854",
"0.60190815",
"0.6004096",
"0.59658635",
"0.5... | 0.69097215 | 0 |
Updates the address field in the search form using the geolocation of the user | function updateAddressField(){
geocoder.geocode({
'latLng': pos
}, function (results, status) {
if (status === google.maps.GeocoderStatus.OK) {
if (results[1]) {
$('#start-address').val(results[1].formatted_address);
}
}
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onchangeAddress() {\n\tgetGeoByAddress();\t\n}",
"function _geocodeAddress () {\n if ($location_field.val() !== '') {\n /**\n * If the user has entered a new location we need to hide previous results\n */\n if (routes_calculated &&... | [
"0.73296404",
"0.7039775",
"0.69825304",
"0.69815123",
"0.6923396",
"0.6899369",
"0.6827957",
"0.68126",
"0.6728236",
"0.670956",
"0.6705171",
"0.6702606",
"0.66980034",
"0.66645133",
"0.66579735",
"0.66397846",
"0.6628871",
"0.66288114",
"0.6564897",
"0.65625566",
"0.6548468... | 0.7644056 | 0 |
colorize the interface on base of the extracted colors | function colorizeUI(uiColors) {
document.body.style.backgroundColor = 'rgb(' + uiColors[1].join(',') + ')';
find('.currentTrack').style.background = 'linear-gradient(to bottom, rgba(' + uiColors[0].join(',') + ',0) 0%, rgba(' + uiColors[0].join(',') + ',1) 50%)';
find('.controls').style.backgrou... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function colorConverter (string) {\n \n// todo: study the Object.freeze \n const colorCodes = Object.freeze({\n \"blue\":\"rgb(40, 116, 237)\",\n \"brown\":\"rgb(255, 102, 102)\",\n \"brownish-red\":\"rgb(196, 136, 124)\",\n \"coral\":\"rgb(255, 102, 102)\",\n \"cream\":\"rgb(240, 237, 218)\",\n... | [
"0.64680934",
"0.6368863",
"0.63634354",
"0.6361937",
"0.6335355",
"0.6334086",
"0.6292084",
"0.62734085",
"0.62199837",
"0.62121135",
"0.62001014",
"0.6192925",
"0.61908233",
"0.61829925",
"0.61517817",
"0.6139812",
"0.61194456",
"0.6105123",
"0.6103772",
"0.6085114",
"0.607... | 0.6393965 | 1 |
create the background, very light threshold version of the current cover, rest is done via CSS | function createBgImage(src) {
var image = new CanvasImage(src);
image.applyFilter('threshold', { min: 100 });;
find('.bgBox').style.backgroundImage = 'url(' + image.get() + ')';
image.remove();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function makeBackground(){\n\timg = createImage(width, height);\n\n\timg.loadPixels();\n\tlet xoff = 0;\n\tfor (let i = 0; i < width; i++){\n\n\t\tlet yoff = 0;\n\n\t\tfor (let j = 0; j<height; j++){\n\n\t\t\tlet col = map(noise(xoff, yoff), 0,1,0,255);\n\t\t\timg.set(i, j, color(col, 0, col));\n\n\n\t\t\tyoff+=0.... | [
"0.68082434",
"0.6388817",
"0.6335601",
"0.6241602",
"0.6120963",
"0.6050005",
"0.5957355",
"0.59301883",
"0.59140795",
"0.5901236",
"0.5893302",
"0.589079",
"0.5881042",
"0.58464843",
"0.5811007",
"0.58080417",
"0.5796977",
"0.57917273",
"0.57820904",
"0.57685906",
"0.576852... | 0.64112574 | 1 |
eventhandling for the playlist choose track, trigger rebuilding of interface setting the values for title, image, etc. | function doPlaylist() {
var size = playlist = findAll('.playlist li');
itemOnClick = function () {
currentTrackID = this.getAttribute('data-trackid');
find('h1').innerHTML = find('strong', this).textContent;
find('h2').innerHTML = find('span', this).textContent;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function itemInvoked(e) {\n currentMIXID = e.detail.itemPromise._value.data.id;\n currentMIXNAME = e.detail.itemPromise._value.data.name\n currentMIXURL = e.detail.itemPromise._value.data.restful_url;\n playMix(currentMIXID);\n window.location.hash = '#playingsectionofpage';\n ... | [
"0.67707825",
"0.65848607",
"0.6567769",
"0.6553185",
"0.6540381",
"0.6513352",
"0.65012443",
"0.647644",
"0.6426972",
"0.63827616",
"0.63593125",
"0.62966263",
"0.6280206",
"0.6258295",
"0.62285507",
"0.62030554",
"0.6142881",
"0.61331916",
"0.6131467",
"0.6116611",
"0.60979... | 0.68315405 | 0 |
Method to decides if a color is light or dark | function isLightOrDark(colorValue) {
var rgb = colorToRGB(colorValue);
hsp = Math.sqrt(
0.299 * (rgb.r * rgb.r) +
0.587 * (rgb.g * rgb.g) +
0.114 * (rgb.b * rgb.b)
);
return (hsp > 100.5) ? 'light' : 'dark';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function lightOrDark(color) {\n // Variables for red, green, blue values\n let r, g, b, hsp\n\n // Check the format of the color, HEX or RGB?\n if (color.match(/^rgb/)) {\n // If RGB --> store the red, green, blue values in separate variables\n color = color.match(\n /^rgba?\\(... | [
"0.80030483",
"0.778146",
"0.7468986",
"0.7263233",
"0.7244195",
"0.7012917",
"0.6829038",
"0.6822369",
"0.6751107",
"0.6749078",
"0.6741296",
"0.66860396",
"0.6645521",
"0.6640977",
"0.64496195",
"0.64350885",
"0.64267",
"0.64089566",
"0.6365031",
"0.63472915",
"0.63443303",... | 0.7959911 | 1 |
histo (1d array, giving the number of pixels in each quantized region of color space), or null on error | function getHisto(pixels) {
var histosize = 1 << (3 * sigbits),
histo = new Array(histosize),
index, rval, gval, bval;
pixels.forEach(function (pixel) {
rval = pixel[0] >> rshift;
gval = pixel[1] >> rshift;
bval = pixel[2] >> rshift;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getHisto(pixels) {\r\n var histosize = 1 << (3 * sigbits),\r\n histo = new Array(histosize),\r\n index, rval, gval, bval;\r\n pixels.forEach(function (pixel) {\r\n rval = pixel[0] >> rshift;\r\n gval = pixel[1] >> rshift;\r\... | [
"0.6254351",
"0.6243601",
"0.6243601",
"0.5940547",
"0.572836",
"0.56492835",
"0.55328244",
"0.5532231",
"0.5174343",
"0.5061864",
"0.49369162",
"0.48198658",
"0.47609475",
"0.47535864",
"0.47510436",
"0.4748378",
"0.46358687",
"0.46348172",
"0.4592713",
"0.45868903",
"0.4572... | 0.625082 | 1 |
generate cryptnum for postcard | function generateCryptnum() {
if(window.crypto) {
var buf = new Uint32Array(1);
window.crypto.getRandomValues(buf);
return buf[0];
}
return generateUUID().replace('-',''); // fallback
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function nonce_generate() {\r\n return (Math.floor(Math.random() * 1e12).toString());\r\n }",
"function numPass(){\n var password = \"\";\n var i;\n for (i = 0; i <= len - 1; i++) {\n password += letNum[getRandomInt(36)];\n }\n return password;\n }",
"function nonceGenerator(){\n... | [
"0.6107715",
"0.6081475",
"0.6060967",
"0.59914404",
"0.59914404",
"0.5885485",
"0.58733946",
"0.58371866",
"0.57947224",
"0.5740207",
"0.57384986",
"0.5711902",
"0.5704061",
"0.5702963",
"0.56693023",
"0.56652296",
"0.56198823",
"0.5515014",
"0.5498304",
"0.54908043",
"0.544... | 0.72570926 | 0 |
Use HTML5 capture as replacement for Cordova Camera on desktop | function proxyCordovaCamera() {
if (IS_MOCKMOBILE) {
console.log("*** HTML5 Camera Capture ***");
navigator.camera = {
getPicture : localFileInput
};
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function capturePhoto() {\n\tnavigator.camera.getPicture(onSuccess, onFail, { quality : 20, \n\t destinationType : 1, \n\t sourceType : 1, \n\t allowEdit : false,\n\t encodingType: Camera.EncodingType.JPEG,\n\t targetWidth: 1280,\n\t targetHeight: 960 }\n \t); \n }",
"function captureCamera(capture) {\... | [
"0.7465708",
"0.73011655",
"0.7231396",
"0.720412",
"0.71789414",
"0.71789414",
"0.7174293",
"0.7167074",
"0.7148372",
"0.7129074",
"0.7121299",
"0.71207416",
"0.71148723",
"0.7110471",
"0.71050084",
"0.709757",
"0.70953774",
"0.70909065",
"0.70909065",
"0.7052325",
"0.704031... | 0.7588799 | 0 |
set teams after selecting organization | setTeams() {
const options = this.selectOrganization.options;
const selectOrganization = options[options.selectedIndex].text;
Team.getAllTeams(selectOrganization).then((response) => {
this.setState(() => {
return {
teams: response,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setTeams(teams, hostOrGuest) {\n let capitalizedPlace = hostOrGuest.charAt(0).toUpperCase() + hostOrGuest.slice(1);\n let content = '<option selected value=\"\">Select ' + capitalizedPlace + '</option>';\n $(hostOrGuest + \"-team\").html(\"\");\n if (Array.isArray(teams, hostOr... | [
"0.7539565",
"0.7293381",
"0.6839145",
"0.6581554",
"0.63377625",
"0.6257645",
"0.6101756",
"0.60929406",
"0.59967756",
"0.59812975",
"0.59798336",
"0.5969331",
"0.59547514",
"0.59402615",
"0.5924008",
"0.5895865",
"0.58893096",
"0.5875931",
"0.586983",
"0.58274734",
"0.57851... | 0.7721716 | 0 |
make group id required | makeGroupIdRequired() {
const checkedValue = this.inputNexus.checked;
if (checkedValue === true) {
this.setState(() => {
return {
groupIdInputRequired: true,
groupIdInputSpan: <span className="required">*</span>,
};
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function validateGroupEvent(event){assert(event.anonymousId||event.userId,'You must pass either an \"anonymousId\" or a \"userId\".');assert(event.groupId,'You must pass a \"groupId\".');}",
"function validateGroup() {\n $scope.errorGroup = false;\n \n if($scope.group !== '') {\n... | [
"0.6615038",
"0.62526125",
"0.6119536",
"0.6029282",
"0.6007208",
"0.5983547",
"0.5936162",
"0.5922176",
"0.590013",
"0.5880807",
"0.5871735",
"0.5871735",
"0.5867752",
"0.58573025",
"0.58573025",
"0.58573025",
"0.58573025",
"0.58573025",
"0.58573025",
"0.58573025",
"0.585730... | 0.6461325 | 1 |
Adds a VM marker on the map | function addVmMarkers() {
for (vm in svm) {
var latLng = new google.maps.LatLng(svm[vm].loc.lat, svm[vm].loc.lng);
var marker = new google.maps.Marker({
position: latLng,
label: svm[vm].id.substr(4, svm[vm].id.length-1),
map: map,
/* Additional propert... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"addMarker(marker) {\n this._markers[marker.id] = marker;\n this._markerListDirty = true;\n }",
"addMarker(markerObj) {\n this.level.addMarker(this.level.maze, this.level.openings, markerObj);\n }",
"handleAddMarker() {\n const markerData = this._mapInstance.addMarker(0);\n this... | [
"0.6778289",
"0.66788024",
"0.6604334",
"0.656207",
"0.65451676",
"0.6535597",
"0.6509672",
"0.6499008",
"0.64811826",
"0.64495903",
"0.6435948",
"0.6429252",
"0.64272976",
"0.64255226",
"0.64242065",
"0.6423473",
"0.6414069",
"0.6413432",
"0.6372408",
"0.63652587",
"0.635551... | 0.7059548 | 0 |
Shows the route for visiting the VMs | function showRoute() {
var num_visit = $(this).prev().prev().val();
if (num_visit <= 1 || num_visit > svm.length) {
showAlert("Invalid number of visits!", "danger");
return;
}
var num_waypoints = num_visit - 2;
var waypts = [];
var dirRendOpt = {
//suppressMarkers: true
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showRouteView(dataObj) {\n _view.showRouteView(dataObj);\n }",
"show(req, res) {\n logging.logTheinfo(\"widgets show Router\");\n res.status(200).send(\"show\");\n\n }",
"function findRoute() {\r\n\tGMO.showRoute();\r\n\treturn true;\r\n}",
"function showRoute(evt) {\n clearRout... | [
"0.6206631",
"0.6009968",
"0.60023683",
"0.5983139",
"0.59396434",
"0.5899726",
"0.58582926",
"0.5806538",
"0.5696429",
"0.56535286",
"0.5610153",
"0.55731684",
"0.55706567",
"0.5568182",
"0.5549532",
"0.55305225",
"0.551807",
"0.5459044",
"0.5450285",
"0.5372562",
"0.5372364... | 0.60974604 | 1 |
randomTarget takes a function which creates possible targets for an entity and returns a function which returns just one of them. | function randomTarget(possibleTargets) {
return (entity, oldTarget) => {
const targets = possibleTargets(entity, oldTarget)
if (targets.length > 0) {
return targets[random.int(0, targets.length - 1)]
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function generateTarget() {\n return Math.floor(Math.random() * 10);\n}",
"function generateTarget() {\n return Math.floor(Math.random() * 10);\n}",
"function generateTarget() {\n return Math.floor(Math.random() * 10)\n}",
"function generateTarget() {\n return Math.floor(Math.random() * 10);\n}",
"... | [
"0.7220837",
"0.7220837",
"0.7195009",
"0.71918863",
"0.71918863",
"0.7181161",
"0.71329916",
"0.71295506",
"0.70647484",
"0.70646673",
"0.7044354",
"0.7044354",
"0.7028789",
"0.7006347",
"0.69803196",
"0.69750655",
"0.6911139",
"0.68688494",
"0.6813806",
"0.6672109",
"0.6564... | 0.8213633 | 0 |
Get the most recently cached config | function getConfig() {
if (Date.now() - lastCache > 10000) {
cachedConfig = JSON.parse(fs.readFileSync("config.json"))
lastCache = Date.now()
}
return cachedConfig
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getConfig() {\n // If the global config is not defined, load it from the file system.\n if (cachedConfig === null) {\n // The full path to the configuration file.\n var configPath = path.join(getRepoBaseDir(), CONFIG_FILE_PATH);\n // Read the configuration and validate it before... | [
"0.68964034",
"0.6819787",
"0.6759333",
"0.6755412",
"0.6344615",
"0.62062675",
"0.6176785",
"0.6161949",
"0.6042007",
"0.59675676",
"0.592625",
"0.5920789",
"0.5917989",
"0.5903945",
"0.5891744",
"0.5887381",
"0.5886387",
"0.588445",
"0.5856448",
"0.585596",
"0.585596",
"0... | 0.8188883 | 0 |
recursively converts all circular references of an object to a string `replacement` | function convertCircRefsRecursively(oldObj, currObj, newObj, replacement = 'Circular Ref') {
each(currObj, (val, prop) => {
if (isObject(val) || isArray(val)) {
// detect a circular reference
if (val === oldObj) {
newObj[prop] = replacement;
}
// otherwise initialize the cur... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"stringify (object) {\n const seen = new Map\n const replacements = new Map\n function visit (path, value) {\n switch (typeof value) {\n case 'object': {\n if (value != null) {\n const reference = seen.g... | [
"0.71434134",
"0.6436457",
"0.6244377",
"0.6193594",
"0.6092523",
"0.59384507",
"0.5861421",
"0.5809998",
"0.57698226",
"0.57698226",
"0.5739144",
"0.56972927",
"0.569093",
"0.56741273",
"0.5635249",
"0.56339836",
"0.5560161",
"0.5519306",
"0.5509193",
"0.5509193",
"0.5509193... | 0.66457236 | 1 |
SaveTranscript added by KV to write/append to GAMENAMEtranscript.html in Documents\Quest Transcripts | function SaveTranscript(data) {
data = data + "<style>*{color:black !important;background:white !important;text-align:left !important}</style>";
if (!webPlayer && transcriptString != '') { UIEvent("SaveTranscript", data); }
transcriptString += data;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function saveAllTranscriptEntries () {\n saveTranscriptEntries([1, 2, 3, 4]);\n}",
"function saveSingleTranscriptEntry (player) {\n saveTranscriptEntries([player]);\n}",
"function saveTranscriptMessage(msg) {\n transcriptHistory.push(msg)\n}",
"function save_options() {\r\n var transcript_to_be_sav... | [
"0.6353464",
"0.625571",
"0.6140639",
"0.5923194",
"0.5829728",
"0.5592897",
"0.55886513",
"0.55315846",
"0.5504832",
"0.5440342",
"0.54113007",
"0.54043084",
"0.5396388",
"0.5385709",
"0.53747773",
"0.5371351",
"0.53591573",
"0.5358952",
"0.53402704",
"0.53171146",
"0.531323... | 0.6678771 | 0 |
import logo from './logocreasume.png'; | function Header() {
const [logoUrl] = useState('./logo-creasume.png');
return(
<Container>
<img src={logoUrl} alt="Crea-Sume"/>
</Container>
)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function OjoBot() {\n // Import result is the URL of your image\n return <img src={logo} alt=\"Logo\" />;\n}",
"function LogoTitle() {\n return(\n <Image\n style={{ width: 47, resizeMode: 'contain'}}\n source={require(\"../Images/croissant-only.png\")}\n />\n );\n}",
... | [
"0.7646631",
"0.7000539",
"0.6891762",
"0.68446237",
"0.663125",
"0.64618105",
"0.64494836",
"0.6421915",
"0.64188075",
"0.63570654",
"0.6334379",
"0.6327279",
"0.6324181",
"0.6277441",
"0.62754464",
"0.6248019",
"0.62431335",
"0.62017685",
"0.619271",
"0.61670697",
"0.616450... | 0.70592684 | 1 |
Init our Scene stacks object | initStacks() {
this.stacks = {
// planes
"pingPong": [],
"renderTargets": [],
"opaque": [],
"transparent": [],
// post processing
"renderPasses": [],
"scenePasses": [],
};
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"initStacks() {\n this.stacks = {\n \"opaque\": {\n length: 0,\n programs: [],\n order: [],\n },\n \"transparent\": {\n length: 0,\n programs: [],\n order: [],\n },\n ... | [
"0.82097256",
"0.73826796",
"0.67002153",
"0.6687809",
"0.66864306",
"0.6643867",
"0.6634657",
"0.6618643",
"0.6608793",
"0.66080725",
"0.6489992",
"0.64655536",
"0.6455492",
"0.6430492",
"0.64175224",
"0.6410453",
"0.6401333",
"0.6401333",
"0.63619816",
"0.6317946",
"0.63046... | 0.831108 | 0 |
RESET STACKS Reset the plane stacks (used when disposing a plane) | resetPlaneStacks() {
// clear the plane stacks
this.stacks.pingPong = [];
this.stacks.renderTargets = [];
this.stacks.opaque = [];
this.stacks.transparent = [];
// rebuild them with the new plane indexes
for(let i = 0; i < this.renderer.planes.length; i++) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"resetPlaneStacks() {\n // clear the plane stacks\n this.stacks.opaque = {\n length: 0,\n programs: [],\n order: [],\n };\n\n this.stacks.transparent = {\n length: 0,\n programs: [],\n order: [],\n };\n\n // ... | [
"0.8168403",
"0.7919169",
"0.77612686",
"0.7343788",
"0.73373777",
"0.70557874",
"0.691026",
"0.6821131",
"0.6772818",
"0.66302836",
"0.65667456",
"0.6539759",
"0.6539759",
"0.6539759",
"0.6519282",
"0.6470936",
"0.6470936",
"0.6470936",
"0.6470936",
"0.6470936",
"0.6470936",... | 0.8070848 | 1 |
Reset the shader pass stacks (used when disposing a shader pass) | resetShaderPassStacks() {
// now rebuild the drawStacks
// start by clearing all drawstacks
this.stacks.scenePasses = [];
this.stacks.renderPasses = [];
// restack our planes with new indexes
for(let i = 0; i < this.renderer.shaderPasses.length; i++) {
this.r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"resetShaderPassStacks() {\n // now rebuild the drawStacks\n // start by clearing all drawstacks\n this.stacks.scenePasses = [];\n this.stacks.renderPasses = [];\n\n // restack our planes with new indexes\n for(let i = 0; i < this.renderer.shaderPasses.length; i++) {\n ... | [
"0.838415",
"0.7076262",
"0.70502603",
"0.69227177",
"0.68644303",
"0.6856716",
"0.6682302",
"0.6682302",
"0.6420189",
"0.62168944",
"0.6206998",
"0.61803174",
"0.61530435",
"0.615168",
"0.6148418",
"0.61323243",
"0.61223334",
"0.61113036",
"0.61100453",
"0.60901666",
"0.6090... | 0.8389433 | 0 |
ADDING PLANES Add a plane to our renderTargets stack params: | addToRenderTargetsStack(plane) {
// find all planes that are rendered onto a render target
const renderTargetsPlanes = this.renderer.planes.filter(el => el.type !== "PingPongPlane" && el.target && el.uuid !== plane.uuid);
// is there any plane that is already rendered onto that plane's render t... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"addPlane(plane) {\n if(plane.type === \"PingPongPlane\") {\n this.stacks.pingPong.push(plane);\n }\n else if(plane.target) {\n this.addToRenderTargetsStack(plane);\n }\n else {\n if(plane._transparent) {\n // rebuild a stack of all ... | [
"0.7058507",
"0.6780442",
"0.6488717",
"0.6391276",
"0.6298401",
"0.6294785",
"0.59991574",
"0.58894706",
"0.5843691",
"0.5806595",
"0.5789933",
"0.5706198",
"0.5697931",
"0.56937546",
"0.56778675",
"0.56671226",
"0.5662246",
"0.56585956",
"0.5569395",
"0.556645",
"0.5531007"... | 0.7203512 | 0 |
This function will add a plane into one of our 4 stacks : pingPong, renderTargets, transparent and opaque pingPong is just a simple array (ordered by order of creation) renderTargets array is ordered by render target creation order, planes renderOrder value and then planes indexes (order of creation) transparent array ... | addPlane(plane) {
if(plane.type === "PingPongPlane") {
this.stacks.pingPong.push(plane);
}
else if(plane.target) {
this.addToRenderTargetsStack(plane);
}
else {
if(plane._transparent) {
// rebuild a stack of all transparent plan... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"addToRenderTargetsStack(plane) {\n // find all planes that are rendered onto a render target\n const renderTargetsPlanes = this.renderer.planes.filter(el => el.type !== \"PingPongPlane\" && el.target && el.uuid !== plane.uuid);\n\n // is there any plane that is already rendered onto that plane... | [
"0.8045639",
"0.75099224",
"0.7286813",
"0.7042698",
"0.6986868",
"0.6776923",
"0.6567397",
"0.65116805",
"0.63492954",
"0.63460726",
"0.62869436",
"0.6280292",
"0.62035805",
"0.61559343",
"0.6138195",
"0.6121225",
"0.60946333",
"0.6092763",
"0.6033107",
"0.6008364",
"0.59984... | 0.81774294 | 0 |
ADDING POST PROCESSING Add a shader pass to the stack params: | addShaderPass(shaderPass) {
if(!shaderPass._isScenePass) {
this.stacks.renderPasses.push(shaderPass);
this.sortShaderPassStack(this.stacks.renderPasses);
}
else {
this.stacks.scenePasses.push(shaderPass);
this.sortShaderPassStack(this.stacks.sceneP... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"addShaderPass(shaderPass) {\n if(!shaderPass._isScenePass) {\n this.stacks.renderPasses.push(shaderPass.index);\n }\n else {\n this.stacks.scenePasses.push(shaderPass.index);\n }\n }",
"enableShaderPass() {\n if(this.stacks.scenePasses.length && this.st... | [
"0.6724399",
"0.66015613",
"0.650463",
"0.6135508",
"0.5894701",
"0.58356297",
"0.58295417",
"0.5787412",
"0.57570904",
"0.5744989",
"0.57259095",
"0.56968623",
"0.5690994",
"0.5673384",
"0.56630445",
"0.56630445",
"0.56449664",
"0.5640997",
"0.5637088",
"0.55776334",
"0.5542... | 0.6721885 | 1 |
This function will remove a shader pass from our scene. This just reset the shaderPass stacks for now. Useful if we'd want to change the way our draw stacks work and keep the logic separated from our renderer params: | removeShaderPass(shaderPass) {
this.resetShaderPassStacks();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"resetShaderPassStacks() {\n // now rebuild the drawStacks\n // start by clearing all drawstacks\n this.stacks.scenePasses = [];\n this.stacks.renderPasses = [];\n\n // restack our planes with new indexes\n for(let i = 0; i < this.renderer.shaderPasses.length; i++) {\n ... | [
"0.7097996",
"0.70878774",
"0.67251986",
"0.6529767",
"0.6471031",
"0.64694345",
"0.62109196",
"0.6139835",
"0.61363864",
"0.58938855",
"0.58851844",
"0.5773966",
"0.5702961",
"0.5626852",
"0.5598968",
"0.5594224",
"0.5586439",
"0.5583255",
"0.5569163",
"0.5564352",
"0.553148... | 0.8421522 | 1 |
Sorts the shader pass stack by index then by renderOrder property params: | sortShaderPassStack(passStack) {
passStack.sort((a, b) => a.index - b.index);
passStack.sort((a, b) => a.renderOrder - b.renderOrder);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setPlaneRenderOrder(plane) {\n if(plane.type === \"ShaderPass\") {\n this.sortShaderPassStack(plane._isScenePass ? this.stacks.scenePasses : this.stacks.renderPasses);\n }\n else if(plane.type === \"PingPongPlane\") {\n // this does not makes any sense for ping pong plane... | [
"0.6678501",
"0.6599804",
"0.62382907",
"0.57789826",
"0.5709507",
"0.5703573",
"0.56496745",
"0.562605",
"0.55662334",
"0.5482954",
"0.54636484",
"0.54144675",
"0.54080087",
"0.5400133",
"0.5352456",
"0.53304905",
"0.5312185",
"0.53082347",
"0.53014666",
"0.5300978",
"0.5296... | 0.82354194 | 0 |
DRAWING SCENE Enable the first Shader pass scene pass | enableShaderPass() {
if(this.stacks.scenePasses.length && this.stacks.renderPasses.length === 0 && this.renderer.planes.length) {
this.renderer.state.scenePassIndex = 0;
this.renderer.bindFrameBuffer(this.stacks.scenePasses[0].target);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"enableShaderPass() {\n if(this.stacks.scenePasses.length && this.stacks.renderPasses.length === 0 && this.renderer.planes.length) {\n this.renderer.state.scenePassIndex = 0;\n this.renderer.bindFrameBuffer(this.renderer.shaderPasses[this.stacks.scenePasses[0]].target);\n }\n ... | [
"0.79598576",
"0.726604",
"0.7218402",
"0.68441546",
"0.68405527",
"0.66994274",
"0.66492176",
"0.66374266",
"0.66213435",
"0.65722454",
"0.6565166",
"0.6558187",
"0.6552469",
"0.6528055",
"0.65075576",
"0.6507304",
"0.64951324",
"0.64179796",
"0.6384187",
"0.63811666",
"0.63... | 0.80200493 | 0 |
Draw the render passes | drawRenderPasses() {
// if we got one or multiple scene passes after the render passes, bind the first scene pass here
if(this.stacks.scenePasses.length && this.stacks.renderPasses.length && this.renderer.planes.length) {
this.renderer.state.scenePassIndex = 0;
this.renderer.bind... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"draw() {\n this.checkContext();\n this.setRendered();\n if (this.unbeamable) return;\n\n if (!this.postFormatted) {\n this.postFormat();\n }\n\n this.drawStems();\n this.applyStyle();\n this.drawBeamLines();\n this.restoreStyle();\n }",
"draw() {\n // enable first frame bu... | [
"0.74456733",
"0.7433133",
"0.73598367",
"0.7215249",
"0.71541595",
"0.70894367",
"0.70389825",
"0.7023258",
"0.69994515",
"0.69887656",
"0.69887656",
"0.6946003",
"0.69279885",
"0.69279885",
"0.69279885",
"0.69274014",
"0.69245756",
"0.69115007",
"0.68837297",
"0.6871401",
"... | 0.7435468 | 1 |
Draw the scene passes | drawScenePasses() {
// then the scene passes
for(let i = 0; i < this.stacks.scenePasses.length; i++) {
this.stacks.scenePasses[i]._startDrawing();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"draw() {\n // enable first frame buffer for shader passes if needed\n this.enableShaderPass();\n\n // loop on our stacked planes\n this.drawStack(\"opaque\");\n\n // draw transparent planes if needed\n if(this.stacks[\"transparent\"].length) {\n // clear our dep... | [
"0.73656046",
"0.7316849",
"0.72614574",
"0.72454023",
"0.7238128",
"0.7195771",
"0.7173698",
"0.7172457",
"0.71653664",
"0.7155106",
"0.71375394",
"0.711982",
"0.7114539",
"0.7095971",
"0.70195603",
"0.7009676",
"0.6999944",
"0.69961435",
"0.6975626",
"0.6955339",
"0.6941862... | 0.7919685 | 0 |
Loop through the special ping pong planes stack and draw its planes | drawPingPongStack() {
for(let i = 0; i < this.stacks.pingPong.length; i++) {
const plane = this.stacks.pingPong[i];
// be sure the plane exists
if(plane) {
// draw the plane
plane._startDrawing();
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function draw() {\n\n background(0);\n for(let i = 0; i < h; i += 10) {\n for(let j = 0; j < w; j+= 10) {\n \n point_color = 'rgb(0,255,0)';\n strokeWeight(noise_color/90);\n // stroke(point_color);\n point(cx[c... | [
"0.65929335",
"0.6554649",
"0.64993304",
"0.62334496",
"0.6187213",
"0.6163923",
"0.6069698",
"0.59210074",
"0.5910412",
"0.5898105",
"0.58525354",
"0.58477837",
"0.58349025",
"0.58116204",
"0.57952833",
"0.57602924",
"0.57427156",
"0.5721268",
"0.572004",
"0.57134",
"0.57132... | 0.8261623 | 0 |
This is used to update the data on the page at the interval set within the generateChartFromAnswers(arrayForChart, arrayForChartLabels) function Also updates the rest of the page and not just the chart so the figures are accurate across the whole page | function updateChartFromAnswers() {
var params = "apikey="+apikey+"&action=getanswers&locationid="+locationidSaved;
$.ajax({
url: apiurl,
data: params,
dataType: "json",
type: "POST"
}).done(function(response) {
// Save the object that contains all of the answers
var theseAnswers = respons... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function chartUpdater() {\n for (var l = 0; l < imgArray.length; l++) {\n clickedChart.chart.config.data.labels.push('Times ' + imgArray[l].name + ' was picked');\n clickedChart.chart.config.data.labels.push('Times ' + imgArray[l].name + ' was displayed');\n clickedChart.chart.config.data.datasets[0].dat... | [
"0.69552207",
"0.6855402",
"0.64571303",
"0.6448757",
"0.6425481",
"0.62534416",
"0.62269694",
"0.621566",
"0.61669827",
"0.6164266",
"0.61465037",
"0.6123837",
"0.6060309",
"0.5968302",
"0.59614813",
"0.59255606",
"0.58923036",
"0.5887056",
"0.5883311",
"0.58594906",
"0.5845... | 0.742293 | 0 |
Detects if analytics are active on current environment (via body.attr('dataenableanalytics')) and binds where necessary | function init() {
if (!IS_ENABLED) {
log('Analytics : IS_ENABLED is false, not init\'ing');
return;
}
if (window.hasOwnProperty('ga')) {
log('Analytics : init : UA-16821714-5');
ga('create', '... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkAnalytics() {\n if (_enableCheck && typeof window[_gaGlobal] === 'function') {\n\n for (var i = 0; i < _analyticsQueue.length; i++) {\n _analyticsQueue[i].call();\n }\n\n //override push to execute the command immediately from now on\n _analyticsQueue.push = function (fn) {\n f... | [
"0.5836701",
"0.58342046",
"0.5783407",
"0.5767422",
"0.571736",
"0.5665252",
"0.55922484",
"0.5496952",
"0.54686475",
"0.54686475",
"0.53765714",
"0.53198886",
"0.5288085",
"0.52863806",
"0.5273831",
"0.5245374",
"0.515188",
"0.5139171",
"0.50843436",
"0.50808525",
"0.507540... | 0.60562617 | 0 |
Emits a GA pageview event | function pageview() {
if (!IS_ENABLED) {
return;
}
if (!_init) {
init();
}
if (ga) {
log('Analytics : pageview', window.location);
ga('send', 'pageview');
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function trackAnalyticsPageView() {\n var url = location.pathname + location.search + location.hash;\n ga('send', 'pageview', { 'page': url });\n}",
"pageview(path, title)\r\n {\r\n console.log('spoj-analytics pageview: ', this);\r\n this.parameters.t = 'pageview';\r\n var param =\r\n {\r\n ... | [
"0.7408964",
"0.72278273",
"0.7104474",
"0.70647204",
"0.70416844",
"0.68449515",
"0.68397397",
"0.6679318",
"0.66524833",
"0.6570521",
"0.6493652",
"0.6315808",
"0.6277682",
"0.6141634",
"0.6117751",
"0.6049074",
"0.59873164",
"0.5917197",
"0.58608526",
"0.5832772",
"0.58132... | 0.7642624 | 0 |
Finds elements matching [dataanalytics:not('[dataanalyticscount]')] and binds onFragmentClick (tracking handler) | function bindClickFragments() {
if (!IS_ENABLED) {
log('Analytics !IS_ENABLED');
return;
}
$('[data-analytics]').not('[data-analytics-count]').on('click', (onFragmentClick)).attr('data-analytics-count', 0);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function invokeCustomEventTracking() {\n $('body').addClass('google-analytics-loaded');\n\n // Utility method\n if (!Array.prototype.last){\n Array.prototype.last = function(){\n return this[this.length - 1];\n };\n };\n\n function analyticsTrackInteraction(actedOnItem, parentContainer) {\n var ... | [
"0.527224",
"0.5223137",
"0.5205193",
"0.5094978",
"0.5052692",
"0.5030945",
"0.5010713",
"0.4985169",
"0.4943128",
"0.49233153",
"0.4890709",
"0.48782903",
"0.48684904",
"0.48519415",
"0.4784358",
"0.4773278",
"0.47653636",
"0.4735079",
"0.47278532",
"0.47128078",
"0.4712592... | 0.74214804 | 0 |
Background moves up and is zoomed after a certain point is reached The background image gets moved up as the user scrolls. This is captured by this.props.percentScrolled The main calculations here are simply to stretch the image to create a "zoom" effect. We move the leftmost edge of the image further off screen, while... | render() {
const stickyPercentage = this.props.stickyPercentage;
const zoomFactor = this.props.zoomFactor;
const startPosition = stickyPercentage / 2;
let a = (1 - zoomFactor) / (startPosition - (1 - stickyPercentage));
let b = (startPosition * zoomFactor - (1 - stickyPercentage... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"handleOuterMousewheel (event) {\n // Prevent scrolling of the background\n event.preventDefault()\n event.stopPropagation()\n\n const xThreshold = WHEEL_MOVE_X_THRESHOLD\n let actionDelay = 0\n const imageMoveDelay = 500\n\n this.clearTimeout(this.resetScrollTimeout)\n this.resetScrollTimeo... | [
"0.63994575",
"0.6389984",
"0.611908",
"0.6114289",
"0.60452175",
"0.5960041",
"0.58646435",
"0.58453685",
"0.5824857",
"0.5822536",
"0.5812507",
"0.57939637",
"0.57766885",
"0.5776358",
"0.5758886",
"0.5753445",
"0.5753445",
"0.5748172",
"0.5748172",
"0.5748172",
"0.5748172"... | 0.7724205 | 0 |
This function checks if URL was visited before by the user, if it was visited then returns action take otherwise returns | function checkIfVisited(url){
urlModified = processURL(url);
//If user is undefined return null - not possible though but shit can happen
if(typeof user == "undefined"){
return null;
}
var website = user.website;
if(typeof website == "undefined"){
return null;
}
if(websit... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"hasBeenVisited (options) {\n return false\n }",
"function has_visited() {\n return document.cookie[0] = \"has_visited=true\";\n}",
"function checkUrl(details) {\n if (details) {\n var url = details.url;\n if (url) {\n var rule = findRule(url);\n if (rule) {\n ... | [
"0.6315297",
"0.6195091",
"0.61712444",
"0.6060601",
"0.6028083",
"0.58095735",
"0.5791183",
"0.5758696",
"0.5735072",
"0.5716004",
"0.5714713",
"0.569044",
"0.56607056",
"0.56357",
"0.55916643",
"0.5581116",
"0.5552214",
"0.5547236",
"0.55281585",
"0.54651845",
"0.54152274",... | 0.7225314 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.