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 |
|---|---|---|---|---|---|---|
Checks if all required slots are occupied on a weapon and all it's mods | isWeaponValid(itemList)
{
for (const item of itemList)
{
const template = global._database.items[item._tpl];
if (!template._props.Slots || !template._props.Slots.length)
{
continue;
}
for (const slot of template._... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"isOccupied() {\n \n if (this.blocked || this.weapon != null || this.player != null) {\n return true;\n }\n else {\n return false;\n }\n }",
"function allSlotsFilled() {\n\t\tif (($(\"li\", slot0).length) && ($(\"li\", slot1).length) && ($(\"li\", slot2).length) && ($(\"li\", slot3).leng... | [
"0.6565644",
"0.6542053",
"0.6431213",
"0.6359975",
"0.6243995",
"0.60254776",
"0.60095274",
"0.60030013",
"0.59819067",
"0.59791833",
"0.5979167",
"0.59789854",
"0.59165347",
"0.59053075",
"0.58986676",
"0.58695203",
"0.5862894",
"0.5835693",
"0.5833752",
"0.579844",
"0.5783... | 0.6773343 | 0 |
Generates extra magazines or bullets (if magazine is internal) and adds them to TacticalVest and Pockets. Additionally, adds extra bullets to SecuredContainer | generateExtraMagazines(weaponMods, weaponTemplate, magCounts, ammoTpl)
{
let magazineTpl = "";
const magazine = weaponMods.find(m => m.slotId === "mod_magazine");
if (!magazine)
{
logger.logWarning(`Generated weapon with tpl ${weaponTemplate._id} had no magazine`);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"shoot(){\n\t\tif(this.loaded <= 0)\n\t\t\treturn;\n\t\t\n\t\tfor(var i=-1; i<2;i++){\n\t\t\t// each bullet has 75 degrees of spacing\n\t\t\tvar spacing = 75 * Math.PI / 180;\n\t\t\tvar hand = this.owner.getOffset(12, this.owner.facing + i * spacing);\n\t\t\tthis.addBullet(hand);\n\t\t}\n\t\tthis.loaded--;\n\t}",
... | [
"0.5572655",
"0.55715024",
"0.54954994",
"0.54593843",
"0.5398628",
"0.5394397",
"0.5394397",
"0.5394209",
"0.5394209",
"0.5378712",
"0.5318255",
"0.5294974",
"0.5219623",
"0.52122164",
"0.5197983",
"0.5194197",
"0.51933503",
"0.5190986",
"0.5153308",
"0.5128661",
"0.5126885"... | 0.6271813 | 0 |
Finds and returns tpl of ammo that should be used, while making sure it's compatible | getCompatibleAmmo(weaponMods, weaponTemplate)
{
let ammoTpl = "";
let ammoToUse = weaponMods.find(mod => mod.slotId === "patron_in_weapon");
if (!ammoToUse)
{
// No bullet found in chamber, search for ammo in magazines instead
ammoToUse = weaponMods.fin... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getPreferredUnitOfMeasureTemplate(){\n\t\t\tproductHierarchyApi.getEmptySubCommodityPreferredUnitOfMeasure({},\n\t\t\t\tfunction(result){\n\t\t\t\t\tpreferredUnitOfMeasureTemplate = result;\n\t\t\t\t},\n\t\t\t\tfunction(error){\n\t\t\t\t\tfetchError(error);\n\t\t\t\t});\n\t\t}",
"randomTeam() {\n\t\t// ... | [
"0.5394759",
"0.53454244",
"0.526339",
"0.52565724",
"0.5203375",
"0.5118282",
"0.50961584",
"0.5075741",
"0.5057526",
"0.5018775",
"0.50106615",
"0.49790546",
"0.49691147",
"0.49459165",
"0.4930014",
"0.4926028",
"0.49149364",
"0.49102733",
"0.49022546",
"0.4876957",
"0.4850... | 0.6389345 | 0 |
Fill existing magazines to full, while replacing their contents with specified ammo | fillExistingMagazines(weaponMods, magazine, ammoTpl)
{
const modTemplate = global._database.items[magazine._tpl];
if (!modTemplate)
{
logger.logError(`Could not find magazine template with tpl ${magazine._tpl}`);
return;
}
const stackSize = m... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"generateExtraMagazines(weaponMods, weaponTemplate, magCounts, ammoTpl)\r\n {\r\n let magazineTpl = \"\";\r\n const magazine = weaponMods.find(m => m.slotId === \"mod_magazine\");\r\n if (!magazine)\r\n {\r\n logger.logWarning(`Generated weapon with tpl ${weaponTemplate._id... | [
"0.62855524",
"0.6142649",
"0.5819013",
"0.571195",
"0.56506026",
"0.56501454",
"0.5499048",
"0.54903185",
"0.54588366",
"0.5412713",
"0.5398024",
"0.5397846",
"0.53588784",
"0.52964",
"0.5277339",
"0.5261275",
"0.5235506",
"0.5214669",
"0.5203739",
"0.5183265",
"0.5182592",
... | 0.7154057 | 0 |
Adds an item with all its childern into specified equipmentSlots, wherever it fits. Returns a `boolean` indicating success. | addItemWithChildrenToEquipmentSlot(equipmentSlots, parentId, parentTpl, itemWithChildren)
{
for (const slot of equipmentSlots)
{
const container = this.inventory.items.find(i => i.slotId === slot);
if (!container)
{
continue;
}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function AddToInventory(item : GameItem){\n\t\tif(!InventoryFull()){\n\t\t\tfor(var i = 0; i < bagSlots.length; i++){\n\t\t\t\tif(!bagSlots[i]){\n\t\t\t\t\tbagSlots[i] = item;\n\t\t\t\t\tif(uLink.NetworkView.Get(this).isMine) InventoryGUI.instance.slots[i].item = item;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}... | [
"0.67796934",
"0.6365729",
"0.59124875",
"0.5903482",
"0.58905673",
"0.5867135",
"0.57881397",
"0.57844967",
"0.5766107",
"0.5657073",
"0.5596625",
"0.5557311",
"0.5453215",
"0.5452027",
"0.5425853",
"0.53993154",
"0.53990525",
"0.53948545",
"0.5386342",
"0.5385279",
"0.53753... | 0.7868542 | 0 |
Compares two item templates by their price to spawn chance ratio | compareByValue(a, b)
{
// If an item has no price or spawn chance, it should be moved to the back when sorting
if (!a._props.CreditsPrice || !a._props.SpawnChance)
{
return 1;
}
if (!b._props.CreditsPrice || !b._props.SpawnChance)
{
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function purchase() {\r\n let randnum = Math.random();\r\n\r\n if (randnum < 0.01) {\r\n document.getElementById(\"loot\").innerHTML +=\r\n '<img src=\"images/socks.png\" height=80px>';\r\n } else if (randnum > 0.66) {\r\n document.getElementById(\"loot\").innerHTML +=\r\n '<img src=\"images/rin... | [
"0.5590355",
"0.5408548",
"0.53286505",
"0.530627",
"0.52764875",
"0.52371424",
"0.5235246",
"0.5228275",
"0.5213231",
"0.5191123",
"0.51879567",
"0.5165737",
"0.5136947",
"0.5132095",
"0.511486",
"0.51046646",
"0.50902295",
"0.5078129",
"0.5058888",
"0.50464827",
"0.5038962"... | 0.61426574 | 0 |
Saves the video file on end | async function handleEnd() {
// Combine chunks to blob data type
const blob = new Blob(recordedChunks, {
type: format
});
// Convert BLOB to buffer data
const buffer = Buffer.from(await blob.arrayBuffer());
const { filePath } = await dialog.showSaveDialog({
buttonLabel: 'Save video',
defaultPa... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function handleStop(e) {\n const blob = new Blob(recordedChunks, {\n type: \"video/webm; codecs=vp9\",\n });\n const buffer = Buffer.from(await blob.arrayBuffer());\n\n // const { filePath } = await dialog.showSaveDialog({\n // buttonLabel: \"Save video\",\n // defaultPath: `... | [
"0.7445082",
"0.7342372",
"0.7278955",
"0.692946",
"0.6717772",
"0.6460124",
"0.6448091",
"0.64169997",
"0.64066947",
"0.62613887",
"0.6194706",
"0.618396",
"0.6171554",
"0.6106195",
"0.6105706",
"0.60443974",
"0.6000933",
"0.5940667",
"0.5920191",
"0.5919348",
"0.59065557",
... | 0.74591684 | 0 |
iterate through note, checking for words in MagMap. | function makeRansomNote() {
//let allWordsFound = true;
for (let word of note) {
if (!getWordfromMagMap(word)) {
console.log('No');
return;
//console.log('Yes');
}
}
console.log('Yes');
return;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkMagazine(magazine, note) {\n\t// create map for magazine words that has value of howm many\n\t// times word is in array\n\tconst MagMap = new Map();\n\tmagazine.forEach(element => {\n\t\t//console.log(MagMap.get(element));\n\t\tlet ifExist = MagMap.get(element);\n\t\tif (!ifExist) {\n\t\t\tMagMap.set... | [
"0.7269559",
"0.69018656",
"0.6718759",
"0.64271075",
"0.6415646",
"0.63043314",
"0.6100395",
"0.60588235",
"0.59587866",
"0.5949648",
"0.5915106",
"0.5895539",
"0.58762157",
"0.58059436",
"0.57063985",
"0.569513",
"0.56711733",
"0.5657454",
"0.56439805",
"0.5618691",
"0.5600... | 0.6950999 | 1 |
check for word in MagMap. If exists, return true, decrement count in map, else return false | function getWordfromMagMap(word) {
let found = MagMap.get(word);
if (found) {
console.log('found word ' + word, found);
MagMap.set(word, found - 1);
return true;
} else {
console.log('word not found ' + word);
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkMagazine(magazine, note) {\n\t// create map for magazine words that has value of howm many\n\t// times word is in array\n\tconst MagMap = new Map();\n\tmagazine.forEach(element => {\n\t\t//console.log(MagMap.get(element));\n\t\tlet ifExist = MagMap.get(element);\n\t\tif (!ifExist) {\n\t\t\tMagMap.set... | [
"0.667646",
"0.666523",
"0.6270435",
"0.6108205",
"0.6032603",
"0.6004026",
"0.60016716",
"0.5955255",
"0.5919813",
"0.5907257",
"0.5905681",
"0.5905681",
"0.5905681",
"0.5905681",
"0.5905681",
"0.5905681",
"0.5905681",
"0.5905681",
"0.58921033",
"0.5888238",
"0.5852785",
"... | 0.7802815 | 0 |
functions to let you know whether your formula has good grammar or not. | function good(truthTable){
if (truthTable){
return true;
} else {
alert('Your formula is grammatically correct. Congratulations!');
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function is_valid_formula(str) {\n\n var isValid = /\\d*[A-Z]{1}[a-z]?\\d*/.test(str).valueOf();\n var usedElements = [];\n var formulaString = str;\n var qty = 0;\n\n /* Gets rid of the leading number for validation*/\n if(/^\\d+/.test(str)){\n qty = str.match(/^\\d+/)[0];\n formul... | [
"0.6522409",
"0.6352446",
"0.6232887",
"0.6193225",
"0.61024666",
"0.61024666",
"0.6084528",
"0.6082742",
"0.6033876",
"0.59958565",
"0.58471245",
"0.5835558",
"0.5783791",
"0.57701933",
"0.5724632",
"0.57216626",
"0.570695",
"0.57038575",
"0.5664907",
"0.5599601",
"0.5598162... | 0.71413624 | 0 |
this function will take a string and start at an index (the position of a connective in the formula), moving left or right checking each character and counting the left and right parentheses. when the program is looking for the main connective of a formula, it will use this information. the main connective is not found... | function parenCheck(formula, index, direction){
var leftParen = 0;
var rightParen = 0;
var done = false;
while (done === false){
if (index === 0 && direction === 'left'){
done = true;
}
if (index === formula.length && direction === 'right'){
done = true;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function parenThesis(str){\n // in order to see str values , need to loop\n // if open paren\n // if close paren\n let count = 0\n for (let x = 0; x<str.length; x++){\n if(str[x] ==\"(\"){\n //do something\n count ++\n } else if(str[x] == \")\"){\n //do... | [
"0.7273387",
"0.69776523",
"0.6931843",
"0.68466645",
"0.6715306",
"0.6710888",
"0.670543",
"0.666806",
"0.66424066",
"0.6641979",
"0.6531671",
"0.65030706",
"0.64779603",
"0.6451237",
"0.64310646",
"0.6417658",
"0.639784",
"0.6359368",
"0.6354654",
"0.63487875",
"0.63442093"... | 0.71656406 | 1 |
if the connective is a negation sign, this function will be used instead of the one above. it gathers more information. for instance, it tells us whether there is another connective found outside all parentheses. if so, then the negation sign is not the main connective. | function negParenCheck(formula, index, direction){
var leftParens = 0;
var rightParens = 0;
var negs = 0;
var connects = 0;
var done = false;
while (done === false){
if (index === 0 && direction === 'left'){
done = true;
}
if (index === formula.length... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"visitNegate(ctx) {\n \t\treturn -1 * this.visitExpression(ctx.expr(0));\n\t}",
"function isNotMinusOperator(char) {\n\t\treturn isOperator(char) && !isMinus(char);\n\t}",
"function isOxy(){\n\treturn d2b(c1) == opposite(c2);\n}",
"function isNegation(node) {\n var value\n\n value = nlcstToString(node).toL... | [
"0.5839419",
"0.55786633",
"0.5443577",
"0.53922534",
"0.53288805",
"0.52712864",
"0.52658075",
"0.5250011",
"0.5221685",
"0.5221685",
"0.5208471",
"0.52072173",
"0.51891935",
"0.5183061",
"0.513651",
"0.509865",
"0.5079384",
"0.5072195",
"0.50553113",
"0.5041767",
"0.5011325... | 0.5994435 | 0 |
this function is used to determine whether a formula has outer parentheses that need to be removed. moving from left to right, it counts parentheses and tracks whether they are closed by the end. if the first character in the formula is a left paren, and the last character is a right paren that closes it, this formula ... | function removeParens(formula){
var firstParen = false;
var firstParenOpen = true;
var lastParen = formula[formula.length - 1] === ')';
var leftParens = 0;
var rightParens = 0;
var closedParens = 0;
for (var i = 0; i < formula.length; i++){
if (formula[i] === '('){
if (i ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function parensvalid(str){\n var leftp = 0; //set counters for left and right parentheses\n var rightp = 0;\n var arr = str.split(\"\"); //split the str on every character into an array\n for(var i =0;i<arr.length;i++){ //loop through the whole array\n if(rightp > leftp){ //check every iteration if rig... | [
"0.7381704",
"0.7320579",
"0.72238255",
"0.71411186",
"0.712842",
"0.7108542",
"0.7069721",
"0.701028",
"0.69502676",
"0.69500345",
"0.6900453",
"0.68977195",
"0.68740267",
"0.6869323",
"0.6864701",
"0.6856225",
"0.6846829",
"0.68272233",
"0.6822353",
"0.68177325",
"0.6806867... | 0.807627 | 0 |
this function takes a complex formula and the index of its main connective and returns an array of constituent formulas. | function getConstituents(formula, index){
var constituents = [];
if (formula[index] === '~'){
constituents.push(formula.slice(index + 1));
} else {
if (formula.slice(0, index).length === 1 || formula[0] === '~'){
constituents.push(formula.slice(0, index));
} else {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getComplexWithIndex(complex, index) {\n const real = complex[index * 2];\n const imag = complex[index * 2 + 1];\n return { real, imag };\n}",
"function getComplexWithIndex(complex, index) {\n var real = complex[index * 2];\n var imag = complex[index * 2 + 1];\n return { real: real, ima... | [
"0.63519144",
"0.62513113",
"0.6248696",
"0.5502402",
"0.5326927",
"0.53026056",
"0.5252351",
"0.52409464",
"0.5147829",
"0.51410174",
"0.5137308",
"0.51319355",
"0.50054073",
"0.4967233",
"0.49643195",
"0.49436164",
"0.49216893",
"0.4852994",
"0.48424858",
"0.48353577",
"0.4... | 0.7031988 | 0 |
when a compound formula is subjected to a recursive test this function is used to test its constituents. if it's an atomic formula it has to be a variable, if it's two characters long it has to be the negation of a well formed atomic formula. otherwise it gets the recursive test. simple negations could be handled just ... | function checkConstituent(formula, truthTable){
if (formula.length === 1) {
if (isAVariable(formula)){
return true;
} else {
return false;
}
} else if (formula.length === 2) {
if (formula[0] === '~' && isAVariable(formula[1]... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function compoundFormula(toTest, firstIteration, truthTable){\n if (removeParens(toTest)){\n formula = toTest.slice(1,-1);\n } else {\n formula = toTest;\n }\n var connectives = [];\n var main = [];\n for (var i = 0; i < formula.length; i++){\n if (isAConnective(formula[i])){... | [
"0.6761545",
"0.6129305",
"0.6049574",
"0.5733437",
"0.5668219",
"0.5561062",
"0.5561062",
"0.5510492",
"0.54414123",
"0.54414123",
"0.54125476",
"0.5310469",
"0.53049886",
"0.5272999",
"0.52535176",
"0.5241092",
"0.5201774",
"0.5194031",
"0.51461357",
"0.50743145",
"0.501750... | 0.69939035 | 0 |
anything more complex than the negation of an atomic formula gets this recursive test. it does the following: 1. checks whether the formula has outer parentheses and strips them if necessary; 2. puts the index of every connective in an array; 3. tests each connective to see if it is the main connective; 4. if more than... | function compoundFormula(toTest, firstIteration, truthTable){
if (removeParens(toTest)){
formula = toTest.slice(1,-1);
} else {
formula = toTest;
}
var connectives = [];
var main = [];
for (var i = 0; i < formula.length; i++){
if (isAConnective(formula[i])){
c... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function preliminaryTests(formula, truthTable){\n if (formula.length === 1){\n if (isAVariable(formula)){\n return good(truthTable);\n } else {\n return bad(truthTable);\n }\n } else if (formula.length === 2){\n if (formula[0] === '~' && isAVariable(formula[1... | [
"0.655859",
"0.6493073",
"0.60589653",
"0.5976132",
"0.5966569",
"0.5903588",
"0.5903588",
"0.5674558",
"0.56662464",
"0.56367165",
"0.56143814",
"0.5554128",
"0.55393416",
"0.54732007",
"0.54256743",
"0.53586864",
"0.53455037",
"0.52992564",
"0.5293124",
"0.5291486",
"0.5232... | 0.84141946 | 0 |
Iterate the traversal steps and inject the .profile()steps. | prepTraversalForProfiling(traversal) {
// Add .profile() step after every pre-existing step.
const steps = traversal.getSteps();
const numSteps = steps.size();
for (let ii = 0; ii < numSteps; ii++) {
// Get the original step
const step = steps.get(ii * 2);
// Do not inject profiling after ProfileSideE... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getSteps() {\n return [\n this.sourceStep,\n ...this.transformerSteps,\n this.loaderStep\n ]; \n }",
"iterate() {\n this.prunePaths();\n this.buildTree();\n\n if (this.paths != undefined && this.paths instanceof Array && this.paths.length > 0 && !this.p... | [
"0.5866298",
"0.55874485",
"0.5456642",
"0.53890324",
"0.535825",
"0.53456694",
"0.53381765",
"0.5300272",
"0.5286366",
"0.5281219",
"0.5247085",
"0.52452457",
"0.5244139",
"0.52326864",
"0.5214545",
"0.520591",
"0.5199816",
"0.5188852",
"0.51377666",
"0.5134657",
"0.5130244"... | 0.76390266 | 0 |
getDependentPicklistOptions by Benj Kamm, 2012 (inspired by CC BYSA 3.0 ( Build an Object in which keys are valid options for the controlling field and values are lists of valid options for the dependent field. Method: dependent PickListEntry.validFor provides a base64 encoded string. After decoding, each of the bits (... | function getDependentOptions (objName, ctrlFieldName, depFieldName) {
// Isolate the Describe info for the relevant fields
var objDesc = sforce.connection.describeSObject(objName);
var ctrlFieldDesc, depFieldDesc;
var found = 0;
for (var i=0; i<objDesc.fields.length; i++) {
var f = objDesc.fields[i];
if (f.nam... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function GetCustomfieldOptionlist(customFieldId, entityid, cellInd, type) {\r\n \r\n var customoption = customfieldOptionList;\r\n var optionlist;\r\n var clistitem = [];\r\n function filterbyparent(obj) {\r\n if (obj.customFieldId == customFieldId && obj.ParentOptionId != null && obj.ParentOp... | [
"0.5385702",
"0.5081888",
"0.50600684",
"0.50297236",
"0.48365787",
"0.48236147",
"0.48093802",
"0.4800253",
"0.47995374",
"0.47956675",
"0.477365",
"0.47354937",
"0.46415827",
"0.46147686",
"0.4604621",
"0.45901433",
"0.44978237",
"0.44965655",
"0.44942865",
"0.44841132",
"0... | 0.68738765 | 0 |
Find and cache dependent values for state and country picklists | function ec_findDependentValues(index) {
var ret = [];
// check the cache for the values first
if (typeof ec_cspicklist_dep_cache[index] !== 'undefined') {
ret = ec_cspicklist_dep_cache[index];
}
else {
// values weren't in the cache so loop through and get them
var stat... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getState(country) {\n let selectStateEle = document.querySelector('.state');\n let selectCityEle = document.querySelector('.Cities');\n let stateVale = '';\n resetOptions(selectStateEle, selectCityEle);\n for (let i = 0; i < locationMap.get(country).length; i++) {\n stateVale = locat... | [
"0.60579896",
"0.5929784",
"0.58795613",
"0.5856939",
"0.5833414",
"0.5806479",
"0.57060105",
"0.56960213",
"0.5650776",
"0.5649665",
"0.5602712",
"0.5544195",
"0.55330545",
"0.5532347",
"0.5409319",
"0.5391913",
"0.5352535",
"0.5351263",
"0.5343198",
"0.53298956",
"0.5321502... | 0.6551125 | 0 |
Get the latest tier data and update the app | function ec_refreshTierData() {
eContacts.Queue_Controller.getTierData(function (result, event) {
if (event.status) {
if (result != null) {
result.Processing_Cap = parseInt(result.Processing_Cap);
result.Records_Processed = parseInt(result.Records_Processed);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"initAppData() {\n /* FETCH DATA FROM LOCALSTORAGE */\n const appReady = this.loadStatusFromStorage();\n\n // Get time of last API call\n let lastAPICall = localStorage.getItem('lastAPICall');\n try {\n lastAPICall = JSON.parse(lastAPICall);\n if (lastAPICall - Date.now() > DAY_MS) {\n ... | [
"0.61938256",
"0.56593686",
"0.5572127",
"0.5569086",
"0.55550593",
"0.5498463",
"0.5488104",
"0.548269",
"0.5406334",
"0.5390705",
"0.5389127",
"0.538386",
"0.53671527",
"0.53574413",
"0.530333",
"0.52871346",
"0.5284716",
"0.5283862",
"0.52694863",
"0.5261814",
"0.52320063"... | 0.73048824 | 0 |
Create a dialog so the user can select a record for a lookup field | function ec_create_lookup_dialog(type, field) {
var dialog = $('#ec_dialog_lookup');
// make sure only the search bar is showing
dialog.find('.modal-body > div.ec_search_results, .modal-body > div.ec_search_results > ul').hide();
$('#lookupFilters').html('');
if (type == 'Account' && typeo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function selectLookupDialogListItem(strItem){\n if (lookupDialog.VisibleOnScreen=True){\n LogUtilities.message(lookupDialog.GetText & \" Pop up has been displayed\");\n LogUtilities.eventMessage(strItem & \" Selecting from the list\" & WindowsUtils.clickOnListItem (lookupDialog.PanelBoarder.PanelBack.ListB... | [
"0.66379726",
"0.6293361",
"0.6259045",
"0.61734116",
"0.601381",
"0.59438604",
"0.5922839",
"0.5841679",
"0.57940483",
"0.5775363",
"0.57643926",
"0.5756889",
"0.5753485",
"0.5748993",
"0.5739644",
"0.5732824",
"0.5728046",
"0.57260364",
"0.5719397",
"0.5713386",
"0.5707674"... | 0.6535045 | 1 |
TODO: check if it's already in the population | function insert_into_population(individual,newPopulation){
for(var i=0;i<newPopulation.length;i++){
if(arrays_equal(individual.chromosome,newPopulation[i].chromosome))
return false;
}
newPopulation.push(individual);
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get population() {\n\t\treturn this.__population;\n\t}",
"populate() {}",
"mate() {\n const new_pop = [];\n // ELITISM\n this.duplicateElite(new_pop);\n // REPRODUCTION\n this.crossover(new_pop);\n this.mutate(new_pop);\n // uptate the population\n this.p... | [
"0.6430151",
"0.6053308",
"0.5905146",
"0.5565",
"0.5554311",
"0.55477005",
"0.5516983",
"0.5514126",
"0.55018467",
"0.54870194",
"0.5392962",
"0.53718746",
"0.5337218",
"0.5331128",
"0.5328719",
"0.53063303",
"0.52999043",
"0.5296967",
"0.5287433",
"0.5265668",
"0.5253698",
... | 0.61511815 | 1 |
Chain promises. And aggregate results. Call .then() on the return promise to access the geoLoations[]. | function chainHttpRequsts_(requests) {
return $q_.all(requests).then(function(result) {
// result contains all geocoded respones (lat, lon) values of each
// requests.
var geoLocations = [];
angular.forEach(result, function(value) {
geoLocations.push(value);
});
return geoLocations;
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function storeCityData(cities){ //Gets a list of cities, converts to geocode, then does a for loop, storing business data in the database for each city using \"getAndStoreBusinessData\"\n promiseList = [];\n var searchRadius = 500000; //radius of search in meters\n return new Promise(resolve=>{\n c... | [
"0.6101994",
"0.59374005",
"0.5852504",
"0.5789392",
"0.5780648",
"0.56249046",
"0.5529746",
"0.5525501",
"0.5523942",
"0.5516353",
"0.547385",
"0.54552126",
"0.5440574",
"0.5371518",
"0.5359609",
"0.5351714",
"0.534352",
"0.5319217",
"0.5304007",
"0.52936864",
"0.5288694",
... | 0.6478155 | 0 |
Pandorabot talk function Display user input, send to bot, display response. Then, push chat session to Firebase. | function doTalk() {
var date = Firebase.ServerValue.TIMESTAMP;
// Handle users input
var user_input = document.getElementById("user-input").value;
document.getElementById("user-input").value = "";
output_area.innerHTML = output_area.innerHTML + (`<div class="message right"><div class="bubble">${use... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function pushChat() {\n // if there is text to be sent...\n if (userInput.val() && userInput.val().trim().length > 0) {\n // disable input to show we're sending it\n var userText = userInput.val().trim()\n userInput.val('...')\n\n sh... | [
"0.6801534",
"0.6453963",
"0.64050037",
"0.6318231",
"0.6272574",
"0.626035",
"0.62443626",
"0.62308115",
"0.6161283",
"0.6140882",
"0.61344504",
"0.6127604",
"0.6114806",
"0.6099289",
"0.60901344",
"0.6059957",
"0.6021943",
"0.6019208",
"0.6003591",
"0.59826523",
"0.5982295"... | 0.85246986 | 0 |
Make a cover for the page_holder_id div | function make_cover() {
var main_div = document.getElementById(page_holder_id) ;
var parent = main_div.parentNode ;
var cover_div = document.createElement("div") ;
cover_div.className = "main-content-cover" ;
cover_div.id = page_holder_id + "-cover" ;
parent.insertBefore... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showCover() {\n var coverDiv = document.createElement('div');\n coverDiv.id = 'cover-div';\n document.body.appendChild(coverDiv);\n}",
"function createCoverBlock() {\n var coverBlock = $( '<div></div>' );\n\n coverBlock.css({\n 'position' : 'fixed',\n ... | [
"0.68016744",
"0.6324947",
"0.6312505",
"0.6217212",
"0.62101066",
"0.6151289",
"0.5924721",
"0.58999795",
"0.57617456",
"0.57399005",
"0.56988156",
"0.5638453",
"0.55988824",
"0.559333",
"0.5578502",
"0.5470256",
"0.5466191",
"0.5394568",
"0.53900504",
"0.5377406",
"0.537020... | 0.81487006 | 0 |
Loads a view (html file) into div with id 'div_id' It looks in views/ and append the extension .php | function load_view(view_name, div_id, user_callback) {
ajax("views/"+view_name+".php", load_view_callback, "GET", {div_id:div_id, user_callback:user_callback}) ;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function load_view_callback(view_content, param) {\n var div_id = param.div_id ;\n document.getElementById(div_id).innerHTML = view_content ;\n var hold = document.getElementById(div_id).getElementsByTagName(\"script\") ;\n for(var i=0;i<hold.length;i++)\n {\n if ( hol... | [
"0.70130163",
"0.64805436",
"0.63221514",
"0.6173292",
"0.5972061",
"0.59670216",
"0.5950001",
"0.5942361",
"0.5848544",
"0.58280236",
"0.5826459",
"0.58197993",
"0.5810871",
"0.57823175",
"0.57238483",
"0.5703774",
"0.5697335",
"0.565739",
"0.56463253",
"0.5630516",
"0.56214... | 0.71130323 | 0 |
callback of load_view fill div_id with view_content executes javascript | function load_view_callback(view_content, param) {
var div_id = param.div_id ;
document.getElementById(div_id).innerHTML = view_content ;
var hold = document.getElementById(div_id).getElementsByTagName("script") ;
for(var i=0;i<hold.length;i++)
{
if ( hold[i].src) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function load_view(view_name, div_id, user_callback) {\n ajax(\"views/\"+view_name+\".php\", load_view_callback, \"GET\", {div_id:div_id, user_callback:user_callback}) ;\n }",
"function displayView(view) {\n document.getElementById('pageContent').innerHTML = view.innerHTML;\n}",
"function getfachvie... | [
"0.7114434",
"0.6708599",
"0.66215587",
"0.6522689",
"0.630688",
"0.6276478",
"0.6276478",
"0.6276478",
"0.62140185",
"0.6129119",
"0.6119572",
"0.6039763",
"0.59323096",
"0.5927659",
"0.5894213",
"0.5880347",
"0.5872321",
"0.58437026",
"0.5762086",
"0.57571703",
"0.570487",
... | 0.8034819 | 0 |
Extracts models from div_id | function extract_models_from(div_id, user_callback) {
var obj = document.getElementById(div_id) ;
var hold = obj.getElementsByTagName("*") ;
var views = Array() ;
// Extract models names from view
for(var i=0;i<hold.length;i++) {
if( hold[i].getAttribute("nt-... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function loadModel(div){\n\t\treturn eval('(' + div.text() + ')');\n\t}",
"function getDivsById(myId) {\r\n\tvar tabRetour = new Array();\r\n var tabTmp = new Array();\r\n tabTmp = document.getElementsByTagName(\"div\");\r\n j=0;\r\n for (i=0; i<tabTmp.length; i++) {\r\n\t\tvar anId = tabTmp[i].id +'... | [
"0.6061525",
"0.58491564",
"0.56433916",
"0.5479375",
"0.54364485",
"0.5339576",
"0.5325026",
"0.5312446",
"0.5268454",
"0.5221059",
"0.516966",
"0.5158595",
"0.5158595",
"0.5158595",
"0.5158094",
"0.515463",
"0.51231194",
"0.50914156",
"0.50868046",
"0.5084144",
"0.50717443"... | 0.71598303 | 0 |
Loads data model 'model' looks in loaded models first unless force_update is set | function get_model(model, force_update) {
force_update = force_update || false ;
for(var i=0;i<models.length;i++) {
// If model already exists
if( models[i].name == model ) {
// Force update the model instead of using the saved one
if( for... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function loadModel () {\n if (modelJSON && imageLoaded) {\n loaded3dModel = loadDae(gl, modelJSON, {texture: image})\n }\n }",
"function loadedModel(){\n\t\tcompleted++;\n\n\t\tif(completed >= data.length)\n\t\t\tassociateTeams();\n\t}",
"async function loadModel () {\n setNodeStatus(node, 'mo... | [
"0.6356877",
"0.6327821",
"0.6284849",
"0.6246459",
"0.61875033",
"0.6147223",
"0.60902166",
"0.60413516",
"0.6023254",
"0.597795",
"0.5966224",
"0.593516",
"0.59311754",
"0.59296083",
"0.5887286",
"0.5879565",
"0.5862718",
"0.5854019",
"0.5854019",
"0.5854019",
"0.5851895",
... | 0.7325999 | 0 |
Binds data in model to matching views in waiting_views, and remove matching views from waiting_views TODO, solve this issue: in order to have force_update model, you have to have to force update in ALL matching views | function bind_model_to_views(model) {
// Get the model from models
var model_obj ;
for(var l=0;l<models.length;l++) {
if( models[l].name == model ) {
model_obj = models[l].content ;
break ;
}
}
// Bind mode... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function refreshModelViews( model )\r\n{\r\n\tmodel.calculateTuples( false );\r\n\tfor( var i in model.views )\r\n\t\tmodel.views[ i ].refreshRenderer();\r\n}",
"_updateView() {\n this.controls.forEach((control) => {\n control.setOutdated();\n });\n }",
"function updateAfterRender( view ) {\n\t\t\t... | [
"0.59584314",
"0.5805716",
"0.5782845",
"0.5731635",
"0.5708565",
"0.57067996",
"0.56935805",
"0.565098",
"0.55904627",
"0.5499671",
"0.5453625",
"0.5432115",
"0.542145",
"0.54202884",
"0.5403305",
"0.5380829",
"0.5379109",
"0.53682333",
"0.53558826",
"0.5342019",
"0.5337784"... | 0.6637686 | 0 |
Save field callback, to save changes in local model | function save_field_callback(response, sender) {
update_local_model(sender, "html") ;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"save() {\r\n }",
"save() {\n // not implemented\n }",
"save() {\n \n }",
"function save(){\n \n }",
"saveToCore() {\n this.set(\"saved\", true);\n }",
"handleSave() {\n }",
"_saveValue(value, options) {\n this.model.setDraftField(\n _.... | [
"0.7147939",
"0.7022295",
"0.7017833",
"0.6673898",
"0.6644455",
"0.6636421",
"0.6608729",
"0.63594836",
"0.6282364",
"0.62615025",
"0.62615025",
"0.6257327",
"0.62203294",
"0.60765433",
"0.6016766",
"0.59907717",
"0.5966596",
"0.59421396",
"0.593371",
"0.5933365",
"0.5910055... | 0.7730897 | 0 |
Upload image callback, to update displayed image | function upload_image_callback(sender) {
sender.src = "images/"+document.getElementById("nt_edit_model_img").value.split(/(\\|\/)/g).pop() ;
update_local_model(sender, "src") ;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function handleUpload(e){\n setImage(e);\n }",
"function uploadImage(callback) {\n // no sense in reuploading an image if it's already been uploaded\n if (uploadResults != null) {\n callback(uploadResults);\n } else {\n document.getElementById('model_imgur_title').innerHTML =\n ... | [
"0.75658274",
"0.75156474",
"0.7177395",
"0.707945",
"0.70643896",
"0.70527387",
"0.6968307",
"0.6872842",
"0.68697816",
"0.68660164",
"0.6849978",
"0.6847071",
"0.68014324",
"0.679956",
"0.67926604",
"0.67799425",
"0.6699723",
"0.6668569",
"0.6655728",
"0.6653852",
"0.662189... | 0.77116364 | 0 |
Replaces English words with Pirate words words not in array are ignored and stay as English | function Translate(text) {
for (var i = 0; i < english2pirate.length; i++)
{
var toReplace = new RegExp("\\b"+english2pirate[i][0]+"\\b", "i");
var index = text.search(toReplace);
//If the english word is capitalized -- replace pirate word in array with captialized pirate word
while (index != -1)
{
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function replaceWords(story,overusedArray) {\nvar replaced = story\n overusedArray.forEach( word => {\n var reg = new RegExp(` ${word}`, \"g\")\nvar odd = true\nreplaced = replaced.replace(reg,word => {\n odd = !odd\n return odd ? \"\" : word //change word to replace the overused word\n})\n } )\nconsole.l... | [
"0.72936916",
"0.6834115",
"0.6701223",
"0.6509679",
"0.649955",
"0.64797",
"0.64771134",
"0.64342153",
"0.63574934",
"0.6134664",
"0.6128197",
"0.6099347",
"0.6075058",
"0.60671294",
"0.6058099",
"0.60472304",
"0.60388076",
"0.6030526",
"0.60164416",
"0.6005416",
"0.5979105"... | 0.70952433 | 1 |
Calls translate using the english textarea, and displays pirate speak in the translation textarea | function displayTranslation()
{
$("Pirate").value = Translate($("English").value);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function translateTextThenSpeak() {\r\n document.getElementById(\"loadingContainer\").style.display = \"block\";\r\n\r\n var inputText = document.getElementById(\"inputText\");\r\n\r\n emitAppSpecificEvent(\"translateTextThenSpeak\", {\r\n textToSpeak: inputText.value\r\n });\r\n}",
"function ... | [
"0.6922825",
"0.68576854",
"0.6824004",
"0.66374314",
"0.65442026",
"0.652643",
"0.64931947",
"0.6453595",
"0.6403989",
"0.63727826",
"0.6328124",
"0.62766385",
"0.62255645",
"0.6198494",
"0.61289686",
"0.6115429",
"0.6115166",
"0.61061114",
"0.6075746",
"0.60485554",
"0.5996... | 0.6958238 | 0 |
Attempt to decrement box_index. If it's less than 0 (outside the boundaries of the array), reset it so that it's the last item in the array. Returns the new index | function previousBoxIndex() {
if (box_index - 1 < 0) {
return boxes.length - 1;
}
return box_index - 1;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function decrementIndex() {\n currentIndex = currentIndex ? currentIndex - 1 : dataShapes.length - 1;\n resetDisplay();\n }",
"function decrement() {\n if($index === 0)\n $index = getLastIndex();\n else\n $index--;\n }",
"function decrementIndex... | [
"0.69564927",
"0.6502253",
"0.62266296",
"0.6072197",
"0.5867452",
"0.5825792",
"0.58226824",
"0.57896054",
"0.5727115",
"0.5677717",
"0.5664263",
"0.5664263",
"0.5655465",
"0.56549865",
"0.56265706",
"0.5623872",
"0.55164963",
"0.5481983",
"0.5480205",
"0.54758626",
"0.54682... | 0.7370669 | 0 |
surface water detection algorithm | function SurfaceWaterAlgorithm(images, pcnt_perm, pcnt_temp, water_thresh, ndvi_thresh, hand_thresh) {
// calculate percentile images
var prcnt_img_permanent = images.reduce(ee.Reducer.percentile([pcnt_perm])).rename(STD_NAMES).clip(geometry2);
var prcnt_img_temporary = images.reduce(ee.Reducer.percentile([pcn... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function SurfaceWaterToolResults(inputParams) {\n \n // get input params\n var time_start = ee.Date(inputParams.date_start);\n var time_end = ee.Date(inputParams.date_end);\n var do_months = inputParams.do_months;\n var defringe = inputParams.defringe;\n var pcnt_perm = parseFloat(inputParam... | [
"0.62748957",
"0.6087309",
"0.59658235",
"0.59577197",
"0.5907284",
"0.5873843",
"0.5830505",
"0.5818692",
"0.58082455",
"0.5807075",
"0.58038294",
"0.5788017",
"0.56914985",
"0.56891704",
"0.56772214",
"0.56746197",
"0.5659251",
"0.5642794",
"0.56297684",
"0.5580664",
"0.556... | 0.72773165 | 0 |
cloud busting ( Ian Housman and Carson Stam) adapted to be able to use within another function with ICs and/or cloud thresholds only defined there: | function bustCloudsIC(ic, cloud_thresh) {
return ic.map(function(img) {
var t = img;
var cs = ee.Algorithms.Landsat.simpleCloudScore(img).select('cloud');
var out = img.mask(img.mask().and(cs.lt(ee.Number(cloud_thresh))));
return out.copyProperties(t);
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function CloudMask (image){\n var cloud_mask = image.expression(\n \"((b('MSK_CLDPRB') >= 90)) || ((b('MSK_CLDPRB') >= 50) && (b('B8A') >= 3000)) || ((b('MSK_CLDPRB') >= 20) && (b('B8A') >= 9000)) ? 1 \" +\n \": 0\").rename('CloudMask');\n return image.addBands(cloud_mask);\n }",
"funct... | [
"0.6117709",
"0.6007457",
"0.58886456",
"0.58737314",
"0.580632",
"0.5785221",
"0.57777715",
"0.5761209",
"0.573883",
"0.57255125",
"0.572459",
"0.5722252",
"0.5697352",
"0.56738687",
"0.5646668",
"0.56123704",
"0.5600636",
"0.5597926",
"0.5570502",
"0.55378234",
"0.54874134"... | 0.75447184 | 0 |
Define number of non null observations for pixel to not be classified as a fringe | function defringeLandsat(img) {
var m = img.mask().reduce(ee.Reducer.min());
var sum = m.reduceNeighborhood(ee.Reducer.sum(), k, 'kernel');
sum = sum.gte(fringeCountThreshold);
img = img.mask(img.mask().and(sum));
return img;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function dim(ef) {\n return ef.featuresMask.length;\n}",
"countPixels(imgData) {\n var count = 0;\n for (var i = 3; i < imgData.data.length; i += 4) {\n if (imgData.data[i] > 0) {\n count++;\n }\n }\n return count;\n }",
"intensite() {\n r... | [
"0.53779584",
"0.5368129",
"0.5367976",
"0.5251059",
"0.5056386",
"0.49744153",
"0.4966156",
"0.4945281",
"0.49096718",
"0.48899147",
"0.48791945",
"0.48747265",
"0.48708045",
"0.48268533",
"0.48101002",
"0.4774407",
"0.47705775",
"0.4759061",
"0.4754383",
"0.47534767",
"0.47... | 0.6785824 | 0 |
get input parameters from UI | function getInputParameters() {
var params_list = input.widgets();
var date_start = params_list.get(1).widgets().get(1).getValue();
var date_end = params_list.get(2).widgets().get(1).getValue();
var do_months = params_list.get(3).widgets().get(1).getValue();
var pcnt_perm = params_list.get(4... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function readInputParameters () {\n verityUrl = await readlineInput('Verity Application URL', process.env.VERITY_URL)\n if ((await validateVerityUrl(verityUrl)) === 'Invalid') {\n console.log('Invalid Verity Url')\n process.exit(1)\n }\n domainDid = await readlineInput('Domain DID', process.env.DOM... | [
"0.64044243",
"0.64044243",
"0.63382494",
"0.6331615",
"0.62725586",
"0.6263098",
"0.625924",
"0.625924",
"0.6190524",
"0.61330134",
"0.60286105",
"0.5986088",
"0.5954514",
"0.58871573",
"0.58820426",
"0.5877349",
"0.58207804",
"0.58055973",
"0.5788239",
"0.5774516",
"0.57685... | 0.7466717 | 0 |
reset input parameters to default values defined at top of script | function resetParamsToDefault() {
var params_list = input.widgets();
params_list.get(1).widgets().get(1).setValue(default_startdate);
params_list.get(2).widgets().get(1).setValue(default_enddate);
params_list.get(3).widgets().get(1).setValue(default_do_months);
params_list.get(4).widgets().get(1).setValue(def... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"resetParameters() {\n let description = this.module.getDescription();\n description.params.forEach((param) => {\n let v = param.default;\n this.guiVars[param.varname] = v;\n this.parameterControllers[param.varname].updateDisplay();\n });\n }",
"function re... | [
"0.73934907",
"0.6872234",
"0.6817522",
"0.6817522",
"0.65704095",
"0.65704095",
"0.6553573",
"0.6526673",
"0.6486403",
"0.6482179",
"0.6258786",
"0.6234728",
"0.62189",
"0.6151165",
"0.612917",
"0.61053383",
"0.6089532",
"0.6040398",
"0.6035661",
"0.603195",
"0.60144746",
... | 0.7593491 | 0 |
define insert function for min binary heap | function minheap_insert(heap, new_element) {
// STENCIL: implement your min binary heap insert operation
// heap[i] = new_element;
heap.push(new_element);
var n = heap.length - 1;
while(n > 0){
var parentN = Math.floor((n+1)/2)-1;
parent = heap[parentN];
if(new_element >= par... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function minheap_insert(heap, new_element) {\n var index = heap.length;\n var temp;\n heap[index] = new_element;\n //console.log(\"successfully inserted\");\n //console.log(Math.floor(((index - 1) / 2)));\n while (index > 0) {\n if (heap[index] < heap[Math.floor((index - 1) / 2)]) {\n ... | [
"0.8095353",
"0.7876799",
"0.75255203",
"0.7420236",
"0.7219369",
"0.7044242",
"0.6711327",
"0.6657572",
"0.65765786",
"0.65653026",
"0.6489402",
"0.648428",
"0.6448915",
"0.64307106",
"0.63911605",
"0.6339042",
"0.6317001",
"0.6289731",
"0.62813395",
"0.62813157",
"0.6263469... | 0.79263353 | 1 |
User selected a playlist from the playlist list | onSelectPlaylist (playlistId, playlistName) {
this.setState({ playlistId, playlistName })
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function selectPlaylistItem(index) {\n\t\t\tvm.playlists[index].selected = !vm.playlists[index].selected;\n\t\t}",
"function playlistChanged( app )\n{\n\tif ( app.selection1 != null )\n\t{\n\t\t$(\"#text1\").empty().append( window.playlists[ app.selection1 ] );\n\t}\n\tif ( app.selection2 != null )\n\t{\n\t\t$(\... | [
"0.69864404",
"0.6615355",
"0.65691394",
"0.6544473",
"0.6522316",
"0.64729005",
"0.6458465",
"0.63983107",
"0.6386243",
"0.6370059",
"0.6365443",
"0.63576597",
"0.62974393",
"0.6280485",
"0.62657756",
"0.62560064",
"0.6197522",
"0.6196425",
"0.6192067",
"0.61892354",
"0.6172... | 0.66552633 | 1 |
Substitute the content of span id=aid_totalprice with price qta in the form of . | function prettyTotalPrice(aid, price, qta)
{
var totalprice;
totalprice = (price * qta).toFixed(2);
document.getElementById("itemPrice_" + aid).innerHTML = "€ " + totalprice;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setTotalPriceInHTML(total){\nvar totalPlaceholder = get.getElementById(\"total\")\ntotalPlaceholder.innerHTML = total.innerfixed\n}",
"function addTotalPrice(price){\n var total = $(\"aside strong\").text();\n //Convert from Currency to Number\n var number =Number(total.replace(/[^0-9\\.]+/g,\"\"))\n... | [
"0.71733665",
"0.69796187",
"0.69746447",
"0.69114536",
"0.6827868",
"0.6773804",
"0.6760833",
"0.6729518",
"0.6726137",
"0.6691168",
"0.6684485",
"0.6668143",
"0.665391",
"0.6611514",
"0.66000205",
"0.6569849",
"0.6564687",
"0.654515",
"0.65369356",
"0.6534101",
"0.6522336",... | 0.7282514 | 0 |
Parses the page body into a simple object Continues to call 'scrape' while there are still products available | function parse( body ) {
console.log( 'Parse - page: ' + index );
// turns the body into soup
let soup = new JSSoup( body );
// locates all the products
let products = soup.findAll( 'div', { itemtype: 'http://schema.org/Product' } );
// assumes we're complete if no products were located
let complete =... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function scrapeCurrentPage() {\n await page.waitForSelector(\".product-container\");\n\n let prodCatalogueData = await page.$$eval(\n \".productContainer\",\n (prodCardsData, category) => {\n prodCardsData = prodCardsData.map((prodCard) => {\n // Get At... | [
"0.6934472",
"0.6507007",
"0.6483876",
"0.639626",
"0.63021064",
"0.6237124",
"0.62214917",
"0.62182325",
"0.6101369",
"0.60750073",
"0.60509014",
"0.602003",
"0.6018514",
"0.5958976",
"0.59522605",
"0.59475946",
"0.5938801",
"0.5920442",
"0.58871984",
"0.5871151",
"0.585766"... | 0.7933142 | 0 |
Outputs the processed data in various formats | function output() {
// outputs a json file
// this does not include $ and % signs to make it easier to process elsewhere
console.log( 'Output - results.json file...' );
items = _.orderBy( items, [ 'discount', 'price'], [ 'desc', 'asc' ] );
fs.writeFileSync( 'results.json', JSON.stringify( items ), 'utf-8' );... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async processOutput(){\n\n let format = this.options.format\n \n if ( format == \"json\" ){\n console.log(JSON.stringify(this.results,null,4))\n }\n \n if ( format == \"table\" ){\n if ( !this.options.hideRootKeys ) console.table(this.results.rootKeys )\n ... | [
"0.6669482",
"0.6194199",
"0.6087389",
"0.6061325",
"0.60580146",
"0.6023616",
"0.5952312",
"0.5916275",
"0.5909228",
"0.5885795",
"0.58498275",
"0.5824775",
"0.5823371",
"0.574853",
"0.5716647",
"0.5701926",
"0.56870925",
"0.5684693",
"0.5661026",
"0.56603074",
"0.563939",
... | 0.64488876 | 1 |
Transition to the next photo, animating it over the specified time (ms). This is used when the user pans and also for the slideshow. | function nextPhoto(time) {
// If already displaying the last one, do nothing.
if (currentPhotoIndex === images.length - 1)
return;
// Set a flag to ignore pan and zoom gestures during the transition.
transitioning = true;
setTimeout(function() { transitioning = false; }, time);
// Set transitions for ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function nextPhoto(time) {\n // If already displaying the last one, do nothing.\n if (currentPhotoIndex === NUM_PHOTOS - 1)\n return;\n\n // Set transitions for the visible photos\n previousPhotoFrame.style.MozTransition = ''; // Not visible\n currentPhotoFrame.style.MozTransition = 'all ' + time + 'ms li... | [
"0.81295294",
"0.7454426",
"0.74260604",
"0.71857494",
"0.71784115",
"0.6887203",
"0.68702203",
"0.6812856",
"0.6789061",
"0.67339396",
"0.6703146",
"0.66835296",
"0.66823244",
"0.66513187",
"0.66512674",
"0.6622989",
"0.6615107",
"0.6601809",
"0.6578398",
"0.65580493",
"0.65... | 0.77130485 | 1 |
The id of the current overlay or null if none. If id is null then hide the overlay. Otherwise, look up the localized text for the specified id and display the overlay with that text. Supported ids include: nocard: no sdcard is installed in the phone cardinuse: the sdcard is being used by USB mass storage nopix: no pict... | function showOverlay(id) {
currentOverlay = id;
if (id === null) {
$('overlay').classList.add('hidden');
return;
}
$('overlay-title').textContent = navigator.mozL10n.get(id + '-title');
$('overlay-text').textContent = navigator.mozL10n.get(id + '-text');
$('overlay').classList.remove('hidden');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function makeOverlayFromId(id) {\n var type = Overlays.getOverlayType(id);\n if (!type) {\n return null;\n }\n var overlay = new overlayTypes[type]();\n overlay._id = id;\n overlays[id] = overlay;\n return overlay;\n }",
"function openOverlay (id) {\... | [
"0.62072843",
"0.5737474",
"0.56678635",
"0.5500614",
"0.5409431",
"0.5398624",
"0.5363746",
"0.53373164",
"0.5229216",
"0.52143645",
"0.52138174",
"0.51975745",
"0.5186584",
"0.51542234",
"0.5149559",
"0.512915",
"0.5102946",
"0.5061861",
"0.50398284",
"0.50376904",
"0.50327... | 0.71066374 | 0 |
This can be done for many reasons like moving your domain to a new one or You have builtup various pages based on browser versions or their names or may be based on different countries. Most popular way to redirect to another webpage using JavaScript is location.href and location.replace | function Redirect() {
window.location = "https://www.google.com";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function redirect () {\n\twindow.location.assign('https://www.google.com');\n}",
"function redirect() {\n window.location.replace(\"https://growthgenius.io\");\n}",
"function Redirect() {\n\n window.location=\"http://www.google.ca\";\n}",
"function redirect( url )\n{\n window.location = url;\... | [
"0.74446905",
"0.7267923",
"0.72435516",
"0.72142154",
"0.7165782",
"0.71427506",
"0.71143115",
"0.71089447",
"0.7083616",
"0.70397687",
"0.70342034",
"0.7023274",
"0.7019661",
"0.700145",
"0.69723386",
"0.69616824",
"0.6934755",
"0.6927366",
"0.68948555",
"0.6886692",
"0.687... | 0.7415212 | 1 |
For an auto refresh you would use the following script | function AutoRefresh( t ) {
setTimeout("location.reload(true);", t);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function AutoRefresh(t) {\n setTimeout(\"location.reload(true);\", t);\n}",
"function refresh(time) {\n location.reload();\n}",
"function AutoRefresh( timeDuration ){\n\twindow.location.replace( 'goToInbox.do?method=allInbox' );\n\t//setTimeout( \"location.reload(true);\", timeDuration );\n}",
"functio... | [
"0.8151246",
"0.7731539",
"0.763085",
"0.76249737",
"0.7559846",
"0.75449497",
"0.75439674",
"0.75439674",
"0.7490975",
"0.7488579",
"0.7483207",
"0.74065304",
"0.7394513",
"0.738961",
"0.73851585",
"0.736771",
"0.7353742",
"0.7335072",
"0.7318267",
"0.73035175",
"0.7296113",... | 0.8220007 | 0 |
Author: Jason W. Thompson Commentary: Being productive isn't just something that needs to happen at work. Sometimes you need to be productive in other places too, like scoring a fantasy professional wrestling sheet. This extension to Google Sheets does just that! cerner_2^5_2018 To actually try this out, there's a few ... | function score() {
// Location of cell calling the function
var activeCell = SpreadsheetApp.getActiveRange();
var rowIndex = activeCell.getRow();
var colIndex = activeCell.getColumn();
// Information on the ranges for the answers
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheets()... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function testCheckAnswer(){\n var doc = SpreadsheetApp.getActiveSpreadsheet();\n var sheet = doc.getSheetByName(\"Sheet1\");\n \n var ans = checkAnswer(sheet, \"PUZZLEB\", \"yikes\");\n \n return;\n}",
"function calculateResults(answer1, answer2, answer3, answer4, answer5, answer6) {\n let pythonScore=0;\... | [
"0.675084",
"0.6525833",
"0.62079346",
"0.6205829",
"0.62006927",
"0.6173516",
"0.61380744",
"0.6120613",
"0.6085667",
"0.60665584",
"0.606575",
"0.6025789",
"0.59961206",
"0.5958812",
"0.5958306",
"0.5943711",
"0.59415674",
"0.59322405",
"0.5927598",
"0.5916796",
"0.5909114"... | 0.7330826 | 0 |
shows all the filterable items to give us a clean slate before running executeFilters() | function showAllFilterables() {
$(".filterable").removeClass("hidden")
$(".filter-clear-link").hide()
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function clearFilter() {\n for (var i = 0; i < allProducts.length; i++) {\n allProducts[i].style.display = \"block\";\n }\n\n // display filder button\n filterButton.style.display = \"none\";\n }",
"function filterAll() {\n displayList(allAnimals);\n}",
"filter() {\n window.clearTim... | [
"0.71575713",
"0.71164644",
"0.7025698",
"0.69866467",
"0.68914604",
"0.6825737",
"0.6743961",
"0.6732223",
"0.6720501",
"0.67135215",
"0.670942",
"0.6703111",
"0.6610113",
"0.65797466",
"0.6514803",
"0.6504123",
"0.6494165",
"0.6473849",
"0.6469294",
"0.6440741",
"0.6432893"... | 0.7461952 | 0 |
Tries to update a div with id "filtered_record_count" with the number of filterables that are visible. | function updateRecordCount(filter_key) {
$('#filtered_record_count').html($('.filterable:not(.hidden)').size() + " of")
// $('#total_record_count').html($('.filterable').size())
$(".filter_checkbox").each(function(i) {
$(this).siblings("small").html(
$(".filterable:not(.hidden)[data-filter-" + $(this).... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateCount() {\n $(\"numEmployees\").innerHTML = `Showing ${employeeList.length} employees`;\n}",
"function updateCounter(){\n const count = +$('#ad_form_images div.form-groupe').length;\n $('#widgets-counter').val(count);\n }",
"function countResults(){\n var count = 0;\n $(... | [
"0.6590681",
"0.6575459",
"0.652277",
"0.6477418",
"0.6397717",
"0.6381869",
"0.62741286",
"0.6213488",
"0.61389726",
"0.6082148",
"0.607822",
"0.60775906",
"0.6075082",
"0.6061434",
"0.6059703",
"0.6054598",
"0.60302824",
"0.6011709",
"0.6005101",
"0.5993499",
"0.5992842",
... | 0.7867251 | 0 |
Function to call when a Stage selector is clicked. | function clickStageSelector(event) {
event.preventDefault()
$( this ).toggleClass("selected")
updateLocationHashWithFilters()
executeFilters()
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"handleMousePressed() {\n this.doActionBySelectedIndex();\n }",
"function clickHandler(e) {\n //Depending on the stage we are in we activate different functions.\n if(stage == \"playing\") {\n //In the playing stage we call the attackHandler\n attackHandler(e);\n } else if(stage =... | [
"0.6376279",
"0.63089633",
"0.6230759",
"0.6063915",
"0.60045075",
"0.5943822",
"0.5935386",
"0.5912969",
"0.58950996",
"0.5886624",
"0.587418",
"0.5869291",
"0.5868962",
"0.585312",
"0.581574",
"0.58031845",
"0.5793405",
"0.5752966",
"0.57298815",
"0.5719646",
"0.57114166",
... | 0.7264583 | 0 |
Updates the hash in the URL with the selected filterables and stages. | function updateLocationHashWithFilters() {
var filterHash = []
$(".filter_checkbox.enabled").each(function (i, element) {
filterHash.push($(this).data("target-filter-id") + ":" + $(this).val())
})
var stagesHash = []
$("#stages_selector [data-stage].selected").each(function( i, element) {
stagesHa... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateFiltersWithLocationHash(otherHash) {\n var currentHash = otherHash || window.location.hash\n var hashParts = currentHash.replace(\"#!\", \"\").split(\"&\")\n for (var i=0; i < hashParts.length; i++) {\n if (hashParts[i].length > 0) { \n var key = hashParts[i].split(\"=\")[0], stringV... | [
"0.6638383",
"0.615117",
"0.58999276",
"0.58840793",
"0.5836772",
"0.5828146",
"0.5827181",
"0.58152324",
"0.5787072",
"0.559469",
"0.5582896",
"0.5572991",
"0.5540179",
"0.5516935",
"0.54425657",
"0.5428221",
"0.542623",
"0.5390852",
"0.53657484",
"0.5309632",
"0.5298623",
... | 0.7611683 | 0 |
Updates filter selections with the values in the location hash. | function updateFiltersWithLocationHash(otherHash) {
var currentHash = otherHash || window.location.hash
var hashParts = currentHash.replace("#!", "").split("&")
for (var i=0; i < hashParts.length; i++) {
if (hashParts[i].length > 0) {
var key = hashParts[i].split("=")[0], stringValue = hashParts[i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateLocationHashWithFilters() {\n var filterHash = []\n $(\".filter_checkbox.enabled\").each(function (i, element) {\n filterHash.push($(this).data(\"target-filter-id\") + \":\" + $(this).val())\n })\n \n var stagesHash = []\n $(\"#stages_selector [data-stage].selected\").each(function( i, ele... | [
"0.7197501",
"0.6234863",
"0.6184569",
"0.61455977",
"0.6144904",
"0.60807186",
"0.60649675",
"0.6024529",
"0.60145473",
"0.6011116",
"0.60076356",
"0.5915504",
"0.58901113",
"0.5864475",
"0.5854142",
"0.5809357",
"0.57924455",
"0.57900363",
"0.5786013",
"0.5783712",
"0.57604... | 0.68690956 | 1 |
Section: Param (to string) Method: jQuery.param.querystring Retrieve the query string from a URL or if no arguments are passed, the current window.location.href. Usage: > jQuery.param.querystring( [ url ] ); Arguments: url (String) A URL containing query string params to be parsed. If url is not passed, the current win... | function jq_param_sub(is_fragment, get_func, url, params, merge_mode) {
var result,
qs,
matches,
url_params,
hash;
if (params !== undefined) {
// Build URL by merging params into url string.
// matches[1] = url part that precedes params, not in... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function jq_param_sub( is_fragment, get_func, url, params, merge_mode ) {\n var result,\n qs,\n matches,\n url_params,\n hash;\n \n if ( params !== undefined ) {\n // Build URL by merging params into url string.\n \n // matches[1] = url part that precedes params, not inc... | [
"0.7110619",
"0.6503699",
"0.6480204",
"0.61484647",
"0.605681",
"0.60454756",
"0.6030894",
"0.60192573",
"0.6008869",
"0.5989849",
"0.5983961",
"0.5959609",
"0.59466726",
"0.5932325",
"0.5923919",
"0.5916086",
"0.5897803",
"0.5891091",
"0.5871962",
"0.5869671",
"0.58676684",... | 0.7088709 | 1 |
Store template items in jQuery.data(), ensuring a unique tmplItem data data structure for each rendered template instance. | function storeTmplItems(content) {
var keySuffix = "_" + cloneIndex, elem, elems, newClonedItems = {}, i, l, m;
for (i = 0, l = content.length; i < l; i++) {
if ((elem = content[i]).nodeType !== 1) {
continue;
}
elems = elem.getElementsByTagName(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function storeTmplItems( content ) {\n\t\tvar keySuffix = \"_\" + cloneIndex, elem, elems, newClonedItems = {}, i, l, m, elemCreated = [];\n\t\tfor ( i = 0, l = content.length; i < l; i++ ) {\n\t\t\tif ( (elem = content[i]).nodeType !== 1 ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\telems = elem.getElementsByTagName(\"*... | [
"0.73103034",
"0.7171048",
"0.71369904",
"0.71369904",
"0.71256727",
"0.622393",
"0.6122211",
"0.6029726",
"0.54964393",
"0.5405891",
"0.5374701",
"0.5321067",
"0.52563435",
"0.52563435",
"0.5248347",
"0.5248347",
"0.5248347",
"0.52256083",
"0.52046967",
"0.5193561",
"0.51935... | 0.72857237 | 1 |
This functions provides the "save" mechanism to store the jStorage object | function _save() {
try {
_storage_service.jStorage = json_encode(_storage);
// If userData is used as the storage engine, additional
if (_storage_elm) {
_storage_elm.setAttribute("jStorage", _storage_service.jStorage);
_storage_elm.save("... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _save(){\n _dropOldEvents(); // remove expired events\n try{\n _storage_service.jStorage = JSON.stringify(_storage);\n // If userData is used as the storage engine, additional\n if(_storage_elm) {\n _storage_elm.setAttribute(\"jStorage\",_stora... | [
"0.7974238",
"0.7936929",
"0.71333885",
"0.7009059",
"0.6872779",
"0.68564093",
"0.6813704",
"0.6783579",
"0.67154247",
"0.67057246",
"0.6703704",
"0.66990423",
"0.6685754",
"0.66590333",
"0.6646398",
"0.66439265",
"0.6634913",
"0.6611274",
"0.66053015",
"0.6543322",
"0.65110... | 0.81849384 | 0 |
Unobtrusive modal dialog link handling. | function _handleModalDialogLinks() {
$('.dialog-link').live('click', function (e) {
var link = $.param.querystring(this.href, {
_layout: 'layouts\\emptylayout'
});
var iframe = $('<iframe name="' + escape(window.location) + '"/>');
var width ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"openModal() {\n\t\tthis.modal.addClass(\"modal--is-visible\");\n\t\treturn false; /* it's a link element; prevents default behavior of scrolling up */\n\t}",
"function bindModalToLink($link, $modal, $body) {\n\t\t$link.click(function(evt) {\n evt.preventDefault();\n\n $modal.addClass('inter... | [
"0.67408437",
"0.6705797",
"0.66931444",
"0.6407285",
"0.63885295",
"0.6328115",
"0.63054615",
"0.6244874",
"0.6205979",
"0.6129542",
"0.61091805",
"0.6003605",
"0.6003524",
"0.59848064",
"0.5953397",
"0.59297955",
"0.59278077",
"0.5912065",
"0.5863943",
"0.5798329",
"0.57829... | 0.76344043 | 0 |
Convert RGB to XYZ | function rgbToXyz(r, g, b) {
var _r = (r / 255);
var _g = (g / 255);
var _b = (b / 255);
if (_r > 0.04045) {
_r = Math.pow(((_r + 0.055) / 1.055), 2.4);
} else {
_r = _r / 12.92;
}
if (_g > 0.04045) {
_g = Math.pow(((_g + 0.055) / 1.055), 2.4);
} else {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"toXYZ() {\r\n const [r, g, b] = this.values;\r\n const x = 0.4124 * r + 0.3576 * g + 0.1805 * b;\r\n const y = 0.2126 * r + 0.7152 * g + 0.0722 * b;\r\n const z = 0.0193 * r + 0.1192 * g + 0.9505 * b;\r\n return new XYZColor_1.XYZColor(x, y, z);\r\n }",
"function lin_sRGB_to... | [
"0.8005605",
"0.76055926",
"0.73664284",
"0.6842052",
"0.68114376",
"0.6664529",
"0.64396656",
"0.64361304",
"0.6280569",
"0.6202707",
"0.6170477",
"0.6149169",
"0.6098007",
"0.6059329",
"0.6042105",
"0.6016625",
"0.6014907",
"0.59590244",
"0.59504235",
"0.5945694",
"0.593409... | 0.76491475 | 1 |
Convert XYZ to LAB | function xyzToLab(x, y, z) {
var ref_X = 95.047;
var ref_Y = 100.000;
var ref_Z = 108.883;
var _X = x / ref_X;
var _Y = y / ref_Y;
var _Z = z / ref_Z;
if (_X > 0.008856) {
_X = Math.pow(_X, (1 / 3));
} else {
_X = (7.787 * _X) + (16 / 116);
}
if (_Y > 0.008856)... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"toLAB() {\r\n return this.toXYZ().toLAB();\r\n }",
"function XYZToCieLab ({ x, y, z, a }) {\n // Wikipedia: http://en.wikipedia.org/wiki/Lab_color_space\n\n const xn = WHITEPOINT_D65_X;\n const yn = WHITEPOINT_D65_Y;\n const zn = WHITEPOINT_D65_Z;\n\n const f = t =>\n t >= 8.85645... | [
"0.7645313",
"0.74762243",
"0.7134956",
"0.66758436",
"0.654961",
"0.6454314",
"0.6369284",
"0.6254462",
"0.6091079",
"0.60900164",
"0.60497725",
"0.59510875",
"0.59043014",
"0.5849241",
"0.58467025",
"0.55978084",
"0.5573894",
"0.5468386",
"0.54178494",
"0.5416676",
"0.53179... | 0.7655397 | 0 |
Put an object into the world's list, and remove any object that shares the same vector row/col. | function put(world, putObj){
world.forEach( (o, index) => {
if ( o['vector'][0] === putObj['vector'][0] && o['vector'][1] === putObj['vector'][1] ){ //they share the same row/col
world[index] = putObj;
return true;
}
});
return new Error('Tried to put '+putObj+' into the world but that vector... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"remove(...object) {\n objects = objects.concat(...objects)\n\n objects.forEach((object) => {\n const index = this.objects.indexOf(object)\n\n if(~index) {\n this.objects.splice(index, 1)\n delete object.scene\n }\n })\n }",
"function removeObjectById(id) {\r\n var coords =... | [
"0.6420038",
"0.62326247",
"0.61839986",
"0.6093446",
"0.5970703",
"0.5960967",
"0.59387547",
"0.5918001",
"0.59055954",
"0.58871216",
"0.5826027",
"0.57985467",
"0.57630146",
"0.5754899",
"0.5750028",
"0.57387465",
"0.5735663",
"0.57245463",
"0.5720064",
"0.5715505",
"0.5652... | 0.63270473 | 1 |
Returns the list of objects that match the vectors row/col coordinates. | function objectsAt(world, vector){
var list = world.filter( o => o['vector'][0] === vector[0] && o['vector'][1] === vector[1] );
return list;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"objectsNearBoundingBox(box) {\n var objs = new Set()\n\n for (var c of this.cellsIntersectingWith(box))\n for (var o of this.map.get(this.hashCell(c)))\n objs.add(o)\n\n return objs\n }",
"getObjectsAtPoint (x /*: number */, y /*: number */) /*: Array<THREE.Object3D> */ {\n const mouse... | [
"0.6495582",
"0.61023986",
"0.584267",
"0.5756335",
"0.56554115",
"0.5552451",
"0.5377395",
"0.53752637",
"0.5328785",
"0.53106755",
"0.5264454",
"0.52484256",
"0.5242877",
"0.5241028",
"0.5217251",
"0.52065694",
"0.5172625",
"0.51699436",
"0.51411265",
"0.5128119",
"0.511121... | 0.699616 | 0 |
The current client alerts polling rate | get clientAlertsPollRate() {
if (this._clientAlertsTimer && this._clientAlertsTimer.interval) {
return this._clientAlertsTimer.interval;
} else {
return this._POLLING_MAX_PERIOD;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"rate(): number {\n return this.currentRate * 1000;\n }",
"getPollSec() {\n return this.pollsec;\n }",
"getPlaybackRate() {\n return __awaiter(this, void 0, void 0, function* () {\n return (yield this.status()).rate;\n });\n }",
"function calculateStreamRate() {\n client... | [
"0.6561165",
"0.6376079",
"0.6354542",
"0.6246815",
"0.6084194",
"0.602404",
"0.5992051",
"0.5988705",
"0.5965308",
"0.59524524",
"0.59337693",
"0.5930545",
"0.5930545",
"0.58662516",
"0.58642155",
"0.5856764",
"0.5833261",
"0.58163106",
"0.5803902",
"0.58014077",
"0.5791941"... | 0.8563893 | 0 |
Ask and save name to chrome storage | function askName() {
nameForm.addEventListener("submit", function(e) {
e.preventDefault();
let inputValue = inputName.value;
nameForm.classList.remove("show");
document.getElementById("firstname").innerHTML = `Hello ${inputValue}`;
chrome.storage.sync.set({
name: inputValue
});
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function saveName () {\n\t var textNameInput = document.getElementById(\"enterName\").value;\n\tlocalStorage.setItem(\"Name\", textNameInput);\n}",
"function saveLocalStorage() {\n const nameValue = nameInput.value;\n if (nameValue.length > 0) {\n localStorage.setItem('name', nameValue);\n } else {\n lo... | [
"0.7570297",
"0.7143917",
"0.7082663",
"0.6986657",
"0.6973397",
"0.69703734",
"0.6951944",
"0.6825705",
"0.68185806",
"0.6802843",
"0.67061317",
"0.6700942",
"0.66935366",
"0.66472363",
"0.66022664",
"0.6589548",
"0.65858436",
"0.6570417",
"0.6557855",
"0.65567106",
"0.65254... | 0.72673076 | 1 |
Returns all tweeted URLs | function getLinks() {
var links = [];
for (var tweet in favs) {
links.push(favs[tweet].entities.urls[TWEET_URL_INFO].expanded_url);
}
return links;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getAllLinks(req, res) {\n let returnJson = {};\n twitterJson.forEach(function(tweet, index) {\n returnJson[tweet.id_str] = [];\n checkLinksRecursively(tweet, returnJson[tweet.id_str]); \n });\n res.json({ message: returnJson });\n}",
"function getTweets() {\n twitterClient.get('statuses/u... | [
"0.6521933",
"0.63583875",
"0.6351794",
"0.6278684",
"0.6274696",
"0.62579644",
"0.6244727",
"0.62389725",
"0.623781",
"0.6233528",
"0.6231283",
"0.6225777",
"0.6210004",
"0.6188617",
"0.61667335",
"0.616344",
"0.6151194",
"0.61374664",
"0.6132861",
"0.6126306",
"0.6114784",
... | 0.72688663 | 0 |
Returns tweet information given a tweet id | function getTweetInfo(tweetId) {
var tweetInfo = {};
for (var tweet in favs) {
if (tweetId == favs[tweet].id_str) {
tweetInfo["id_str"] = favs[tweet].id_str;
tweetInfo["created_at"] = favs[tweet].created_at;
tweetInfo["user"] = favs[tweet].user.screen_name;
tweetInfo["text"] = favs[tweet].text;
}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getTweetById(req, res) {\n let returnJson = {};\n let isFound = false;\n twitterJson.forEach(function(tweet) {\n if (tweet.id_str === req.params.tweet_id) {\n returnJson = tweet;\n isFound = true;\n }\n });\n if (!isFound) {\n res.status(404).send('Not found');\n } else {\n res... | [
"0.7337155",
"0.73336464",
"0.7054036",
"0.69758284",
"0.69161034",
"0.6863383",
"0.6674962",
"0.66278064",
"0.6626135",
"0.6535645",
"0.65345556",
"0.6515055",
"0.6504277",
"0.64877605",
"0.64792466",
"0.6450356",
"0.6443205",
"0.6434909",
"0.6407378",
"0.63929456",
"0.63913... | 0.7491064 | 0 |
Returns profile information given a screen name | function getProfileInfo(screenName) {
var profileInfo = {};
for (var tweet in favs) {
if (favs[tweet].user.screen_name == screenName) {
profileInfo["name"] = favs[tweet].user.name;
profileInfo["location"] = favs[tweet].user.location;
profileInfo["description"] = favs[tweet].user.description;
profile... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getTwitterProfile(screenName){\n\tlet config = {\n\t\t\"profile\": {\"screenName\": screenName},\n\t\t\"domId\": 'exampleProfile',\n\t\t\"maxTweets\": 30,\n\t\t\"enableLinks\": false,\n\t\t\"showUser\": false,\n\t\t\"showTime\": false,\n\t\t\"showImages\": false,\n\t\t\"showInteraction\": false,\n\t\t\"la... | [
"0.70136875",
"0.62376076",
"0.61959827",
"0.61134446",
"0.61061364",
"0.60894704",
"0.60688776",
"0.6064631",
"0.60537386",
"0.6024633",
"0.6024633",
"0.6024633",
"0.6000757",
"0.5915953",
"0.590695",
"0.5901005",
"0.59002775",
"0.5884321",
"0.58637565",
"0.58519346",
"0.582... | 0.752448 | 0 |
Returns all tweets made in a specified year | function getTweetsByYear(year) {
var tweets = {};
for (var tweet in favs) {
if (favs[tweet].created_at.split(" ")[TWEET_YEAR_INDEX] == year) {
tweets[tweet] = {};
tweets[tweet]["user"] = favs[tweet].user.screen_name;
tweets[tweet]["text"] = favs[tweet].text;
}
}
return tweets;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getYears() {\r\n\t// body...\r\n\tvar itemLen = tweet_index.length;\r\n\tvar currItem = {};\r\n\tvar arrYears = [];\r\n\r\n\tfor (i=0; i<itemLen; i++)\r\n\t{\r\n\t\tcurrItem = tweet_index[i];\r\n\r\n\t\t// check if year is already added to the arrYears array\r\n\t\tif (arrYears.indexOf(currItem.year) === ... | [
"0.66369873",
"0.65240693",
"0.6075238",
"0.5964173",
"0.5923597",
"0.5877903",
"0.58170295",
"0.5796033",
"0.5724882",
"0.5723719",
"0.56972253",
"0.5690397",
"0.5685355",
"0.5685137",
"0.56593585",
"0.56462485",
"0.5643364",
"0.5605953",
"0.560549",
"0.5601652",
"0.5598865"... | 0.74676263 | 0 |
post users score to db | function postScore() {
let body = {
player_id: player_id,
score: score
}
fetch(gamesEndpoint, {
method: "POST",
headers: {
"Content-Type": "application/json",
"Accepts": "application/json"
},
body: JSON.stringify(body)
})
.then(resp... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async saveScore() {\n let result = await this.scoreTable.add({\n name: this.username,\n score: this.score\n });\n if (result) console.log(\"Score saved successfully!\");\n else console.log(\"Score failed to save!\");\n }",
"async saveScore() \n {\n l... | [
"0.7165869",
"0.70143205",
"0.6972064",
"0.6857825",
"0.68479216",
"0.68479216",
"0.682074",
"0.680173",
"0.6799635",
"0.67715335",
"0.6763402",
"0.67318195",
"0.66938984",
"0.6690405",
"0.6669941",
"0.6649337",
"0.6628216",
"0.6618472",
"0.66152054",
"0.6602361",
"0.6590635"... | 0.7259902 | 0 |
should return an object containing `username` and `domain` as keys. See the examples. You can assume that the argument will be a valid email address. | function emailParse(str){
words = str.split("@");
let obj = {}
obj.username = words[0]
obj.domain = words[1]
return obj;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getEmailInfo(email) {\n if (!email) return null;\n\n var result = new Object;\n\n var emailData = email.split('@');\n\n if (emailData.length != 2) {\n dump(\"bad e-mail address!\\n\");\n return null;\n }\n\n // all the variables we'll be returning\n result.username = ema... | [
"0.7431617",
"0.6143152",
"0.58990884",
"0.5821958",
"0.5765974",
"0.5765974",
"0.57494605",
"0.57482755",
"0.5711321",
"0.5707913",
"0.5660341",
"0.5648222",
"0.5635596",
"0.5625367",
"0.5606956",
"0.56034416",
"0.5600321",
"0.5595663",
"0.55430514",
"0.55305964",
"0.5523688... | 0.70330924 | 1 |
convert a value to a node at given parent and subpath. attempts to reuse old node if possible and given | function valueAsNode(childType, parent, subpath, newValue, oldNode) {
// ensure the value is valid-ish
typecheck$$1(childType, newValue);
// the new value has a MST node
if (isStateTreeNode$$1(newValue)) {
var childNode_1 = getStateTreeNode$$1(newValue);
childNode_1.assertAlive();
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function valueAsNode(childType, parent, subpath, newValue, oldNode) {\n // ensure the value is valid-ish\n typecheckInternal$$1(childType, newValue);\n // the new value has a MST node\n if (isStateTreeNode$$1(newValue)) {\n var childNode = getStateTreeNode$$1(newValue);\n childNode.assert... | [
"0.6709121",
"0.6683018",
"0.62616503",
"0.60057694",
"0.60057694",
"0.60057694",
"0.5953061",
"0.58596843",
"0.5775904",
"0.57234854",
"0.57184315",
"0.57184315",
"0.56902856",
"0.568684",
"0.5679986",
"0.56579715",
"0.56457335",
"0.56425047",
"0.5622957",
"0.56196165",
"0.5... | 0.6738352 | 1 |
Finds out whether any dependency of the derivation has actually changed. If dependenciesState is 1 then it will recalculate dependencies, if any dependency changed it will propagate it by changing dependenciesState to 2. By iterating over the dependencies in the same order that they were reported and stopping on the fi... | function shouldCompute(derivation) {
switch (derivation.dependenciesState) {
case IDerivationState.UP_TO_DATE:
return false;
case IDerivationState.NOT_TRACKING:
case IDerivationState.STALE:
return true;
case IDerivationState.POSSIBLY_STALE: {
var p... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function shouldCompute(derivation) {\n switch (derivation.dependenciesState_) {\n case IDerivationState_.UP_TO_DATE_:\n return false;\n\n case IDerivationState_.NOT_TRACKING_:\n case IDerivationState_.STALE_:\n return true;\n\n case IDerivationState_.POSSIBLY_STALE_:\n {... | [
"0.7007383",
"0.68535584",
"0.68435746",
"0.67600214",
"0.6738004",
"0.6738004",
"0.6738004",
"0.6735084",
"0.6721158",
"0.6720711",
"0.6720711",
"0.6720711",
"0.6720711",
"0.6578491",
"0.65698326",
"0.6478027",
"0.6446531",
"0.6431871",
"0.6418975",
"0.6418975",
"0.6418975",... | 0.68652153 | 1 |
Inline Parser class. Note that link validation is stricter in Remarkable than what is specified by CommonMark. If you want to change this you can use a custom validator. | function ParserInline() {
this.ruler = new Ruler();
for (var i = 0; i < _rules.length; i++) {
this.ruler.push(_rules[i][0], _rules[i][1]);
}
// Can be overridden with a custom validator
this.validateLink = validateLink;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ParserInline() {\n\t this.ruler = new Ruler();\n\t for (var i = 0; i < _rules.length; i++) {\n\t this.ruler.push(_rules[i][0], _rules[i][1]);\n\t }\n\n\t // Can be overridden with a custom validator\n\t this.validateLink = validateLink;\n\t}",
"function ParserInline() {\n\t this.ruler = new Rul... | [
"0.8079994",
"0.8079994",
"0.8079994",
"0.740807",
"0.6890077",
"0.6879747",
"0.6877566",
"0.6877566",
"0.6877566",
"0.6877566",
"0.6877566",
"0.6877566",
"0.6877566",
"0.68753207",
"0.6871674",
"0.6858491",
"0.6858491",
"0.68546695",
"0.68546695",
"0.68546695",
"0.6834678",
... | 0.81389135 | 0 |
parse sequence of emphasis markers, "start" should point at a valid marker | function scanDelims(state, start) {
var pos = start, lastChar, nextChar, count,
can_open = true,
can_close = true,
max = state.posMax,
marker = state.src.charCodeAt(start);
lastChar = start > 0 ? state.src.charCodeAt(start - 1) : -1;
while (pos < max && state.src.charCodeAt(pos) === mark... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function scanDelims(state, start) {\n\t var pos = start, lastChar, nextChar, count,\n\t can_open = true,\n\t can_close = true,\n\t max = state.posMax,\n\t marker = state.src.charCodeAt(start);\n\n\t lastChar = start > 0 ? state.src.charCodeAt(start - 1) : -1;\n\n\t while (pos < max && state.... | [
"0.64253616",
"0.64253616",
"0.64253616",
"0.6196686",
"0.60176027",
"0.5766016",
"0.5656857",
"0.5656857",
"0.5459477",
"0.5294428",
"0.5231066",
"0.52308863",
"0.5202086",
"0.5190616",
"0.51782256",
"0.510086",
"0.50578666",
"0.5046484",
"0.5034838",
"0.50123316",
"0.501233... | 0.6500377 | 1 |
:: config > Component > WrappedComponent Higher order component that allows the wrapped component to become aware of it's size, by receiving it as an object within it's props. | function sizeMe() {
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultConfig;
var _config$monitorWidth = config.monitorWidth,
monitorWidth = _config$monitorWidth === undefined ? defaultConfig.monitorWidth : _config$monitorWidth,
_config$monitorHeight = config.monito... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function withSize() {\n var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultConfig;\n var _config$monitorWidth = config.monitorWidth,\n monitorWidth = _config$monitorWidth === undefined ? defaultConfig.monitorWidth : _config$monitorWidth,\n _config$monitorHeight = co... | [
"0.7591762",
"0.7462205",
"0.7446078",
"0.6576589",
"0.6246228",
"0.61851203",
"0.6151056",
"0.61491376",
"0.61389506",
"0.6049534",
"0.60441333",
"0.6001224",
"0.59845006",
"0.59541494",
"0.59214056",
"0.5899018",
"0.5891737",
"0.58906406",
"0.5879014",
"0.5875705",
"0.58541... | 0.747237 | 1 |
Wraps a function to exchange wallId to wall instance, all other arguments are passed on intact. The function assumes at least a 3rd callback argument, that will be called if the wall does not exist or an error was raised. | function wrapToWall(func, wallId){
if(arguments.length < 3) {
throw Error('Missing arguments.');
}
var args = Array.prototype.slice.call(arguments).splice(1); // drop func
var cb = args[args.length-1];
Wall.findById(wallId, function(err, wall){
if(err) {
cb(err);
} else if(wall === null) ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function wallPostMaker(\n\t\t\t\t\t\twallpost_id,\n\t\t\t\t\t\tuser_id,\n\t\t\t\t\t\tuser_type,\n\t\t\t\t\t\tuser_full_name, \n\t\t\t\t\t\tuser_image, \n\t\t\t\t\t\twall_post_text, \n\t\t\t\t\t\tdisplayyNone, \n\t\t\t\t\t\tlike_count, \n\t\t\t\t\t\tcomment_count, \n\t\t\t\t\t\tshare_count, \n\t\t\t\t\t\tcomments_j... | [
"0.46456185",
"0.4461239",
"0.4418711",
"0.44149536",
"0.43897355",
"0.4371568",
"0.43595865",
"0.43595865",
"0.43593454",
"0.43227267",
"0.42848384",
"0.42848384",
"0.42848384",
"0.42848384",
"0.42848384",
"0.425789",
"0.42414144",
"0.42414144",
"0.4237602",
"0.4237602",
"0.... | 0.75224775 | 0 |
Open an overlay menu | function openMenu(event) {
// Determine the id of the overlay element to open
// by using the id of the nav element
var id = parseInt(event.srcElement.id.substring(4));
// Hide all other overlay boxes
for(var i = 0; i < infoboxes.length; i++) {
$("#" + infoboxes[i].id).hide();
}
$("... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function openMoadl() {\noverlay.style.display='block';\n}",
"openMenu()\n {\n this.$menu.addClass('open');\n this.$overlay.addClass('show');\n }",
"function UI_openOverlay(map)\r\n{\r\n UI_show('overlay');\r\n UI_hide('fortitude');\r\n UI_hide('narrowsmap'); \r\n UI_hide('bureaumap'); ... | [
"0.7468535",
"0.72829014",
"0.7259256",
"0.71936864",
"0.71443087",
"0.6994468",
"0.6932527",
"0.6882594",
"0.6858378",
"0.6826596",
"0.6819372",
"0.6773423",
"0.6700684",
"0.66715664",
"0.66258943",
"0.6604262",
"0.65861464",
"0.65707123",
"0.65605724",
"0.6554704",
"0.65412... | 0.7736672 | 0 |
Close an overlay menu | function closeMenu(event) {
$("#overlay").fadeOut(200);
$("#toolbox").fadeIn(200);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function closeMenu() {\n\n document.getElementById(\"overlay-menu\").classList.remove(\"show-overlay-menu\");\n document.getElementById(\"burger-menu\").classList.remove(\"d-none\");\n }",
"closeMenu() {\n if (!this.isClosed()) {\n this.close();\n $gameBattleMap.absPause = false;\n $game... | [
"0.7817901",
"0.78070974",
"0.76332045",
"0.7617058",
"0.7607611",
"0.75375766",
"0.7499912",
"0.7493879",
"0.7480183",
"0.74078184",
"0.74005836",
"0.73520005",
"0.734548",
"0.7311685",
"0.7238447",
"0.7236913",
"0.7233065",
"0.72061795",
"0.7204752",
"0.72024167",
"0.718415... | 0.79099405 | 0 |
returns array of extensions from platform.json dependencies | function fetchPlatformExtensions() {
const platformJson = fs.readJsonSync(PLATFORM_PATH);
return Object.keys(platformJson.dependencies);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getMissingExtensions() {\n let json = this.loadJson() || { dependencies: {} };\n let ids = [];\n for (let key of Object.keys(json.dependencies)) {\n let folder = path_1.default.join(this.root, 'node_modules', key);\n if (!fs_1.default.existsSync(folder)) {\n ... | [
"0.7466669",
"0.7380784",
"0.70300585",
"0.68408585",
"0.6540725",
"0.6425419",
"0.6372045",
"0.61726934",
"0.6101555",
"0.60931385",
"0.6018882",
"0.5933505",
"0.5930195",
"0.59070176",
"0.58633304",
"0.5842481",
"0.58206105",
"0.5791875",
"0.5720873",
"0.56473666",
"0.56381... | 0.8654538 | 0 |
returns all extensions found in the ./extensions directory currently unused due to deprecated extensions in the directory | function fetchAllExtensions() {
const listOfExtensions = fs.readdirSync(EXT_PATH_ROOT, { withFileTypes: true })
.filter(file => file.startsWith('shoutem.'))
return listOfExtensions;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function fetchAllExtensions() {\n const extensionsDir = prependProjectPath('extensions');\n\n const listOfExtensions = fs.readdirSync(\n prependProjectPath('extensions'),\n { withFileTypes: true },\n ).filter(file => {\n // Depending on the environment's OS, 'file' can be an object or just the\n // ... | [
"0.7850703",
"0.7122768",
"0.7108862",
"0.7033167",
"0.6746276",
"0.6726845",
"0.6710299",
"0.67041326",
"0.6681151",
"0.6601733",
"0.6595946",
"0.6202556",
"0.6147715",
"0.5981366",
"0.5880671",
"0.5880671",
"0.5861893",
"0.58568686",
"0.58490723",
"0.58126354",
"0.5795592",... | 0.77179664 | 1 |
returns all dependencies of a specific extension | function fetchExtensionDependencies(extName) {
const extPackageJson = fs.readJsonSync(EXT_PATH_ROOT + extName + EXT_PACKAGE_PATH);
return extPackageJson.dependencies;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get Dependencies() {\n var deps = this.data['dependencies'];\n var result = [];\n for (var name in deps) {\n if (deps.hasOwnProperty(name)) {\n result.push(name);\n }\n }\n return result;\n }",
"function _getDependents (component_name) {\... | [
"0.6825253",
"0.67657644",
"0.67011964",
"0.66594434",
"0.65877545",
"0.6575499",
"0.6481083",
"0.64307487",
"0.6415924",
"0.6387482",
"0.6283912",
"0.62745404",
"0.62382686",
"0.6202553",
"0.6153741",
"0.6146545",
"0.61296785",
"0.6115559",
"0.6093422",
"0.6086054",
"0.60860... | 0.74796665 | 0 |
Function to move the winner onto the next round | function Winner(matchwinner, winnername){
//Define player-box clicked as the "winner"
matchwinner.classList = "player-box winner"
//Get Opponent Name to set as "loser"
var roundName = matchwinner.name
var roundPosition = parseInt(roundName.substring(4));
otherNumber = (roundPosition % ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"nextRound(){\n if(this.playerHandler.highScore()>=this.playerHandler.winningScore){\n let winners = this.playerHandler.getWinners();\n let score = this.playerHandler.highScore();\n this.eventService.publish(this.gameEvents.winnersDecided, {winners: winners, score: score});\n this.s... | [
"0.7626875",
"0.7345847",
"0.7344409",
"0.7325428",
"0.7288988",
"0.7288345",
"0.7262934",
"0.72536325",
"0.72414726",
"0.7238436",
"0.72363985",
"0.7209997",
"0.7185072",
"0.7131045",
"0.71284187",
"0.7124543",
"0.70985746",
"0.7068553",
"0.706609",
"0.7051641",
"0.70439094"... | 0.73579174 | 1 |
Return Buffer object for given varying name. | getBuffer(varyingName = null) {
assert(varyingName && this.feedbackBuffers[this.currentIndex][varyingName]);
return this.feedbackBuffers[this.currentIndex][varyingName];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getBufferByName(name){\n\n return getBufferByProperty('name',name);\n}",
"function createBuffer(name){\n\n var buffer = new Buffer(name,undefined);\n buffers.push(buffer);\n return buffer;\n}",
"function Buffer(name,file){\n\n //Name of the buffer (should be unique)\n this.name = get... | [
"0.7186748",
"0.6596068",
"0.62499183",
"0.5971398",
"0.5940999",
"0.5940999",
"0.58489007",
"0.5840181",
"0.5837574",
"0.5836518",
"0.5739581",
"0.57376105",
"0.5670031",
"0.563815",
"0.5589455",
"0.5449223",
"0.5449223",
"0.5436234",
"0.5366218",
"0.52676797",
"0.52676797",... | 0.69594747 | 1 |
eslintenable complexity setup source and destination buffers | _setupBuffers({sourceBuffers = null, feedbackBuffers = null}) {
this.sourceBuffers[0] = Object.assign({}, sourceBuffers);
this.feedbackBuffers[0] = Object.assign({}, feedbackBuffers);
this._createFeedbackBuffers({feedbackBuffers});
this.sourceBuffers[1] = {};
this.feedbackBuffers[1] = {};
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"prepareBuffers() {}",
"SetTargetBuffers() {}",
"function setUpBuffers() {\n \"use strict\";\n}",
"function setUpBuffers() {\n \"use strict\";\n}",
"function setUpBuffers() {\n\n \"use strict\";\n\n}",
"_setupSwapBuffers() {\n if (!this.feedbackMap) {\n // feedbackMap required set up swap... | [
"0.66498667",
"0.6211531",
"0.61729467",
"0.61729467",
"0.6143076",
"0.5870347",
"0.57871825",
"0.57037675",
"0.5632316",
"0.5608145",
"0.5605506",
"0.550547",
"0.54966325",
"0.548469",
"0.54453826",
"0.5426176",
"0.54214364",
"0.54052436",
"0.53806114",
"0.537323",
"0.534976... | 0.69172597 | 0 |
auto create any feedback buffers | _createFeedbackBuffers({feedbackBuffers}) {
if (!this.feedbackMap) {
// feedbackMap required to auto create buffers.
return;
}
const current = this.currentIndex;
for (const sourceBufferName in this.feedbackMap) {
const feedbackBufferName = this.feedbackMap[sourceBufferName];
if (... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_setupBuffers({sourceBuffers = null, feedbackBuffers = null}) {\n this.sourceBuffers[0] = Object.assign({}, sourceBuffers);\n this.feedbackBuffers[0] = Object.assign({}, feedbackBuffers);\n this._createFeedbackBuffers({feedbackBuffers});\n this.sourceBuffers[1] = {};\n this.feedbackBuffers[1] = {};\... | [
"0.71231794",
"0.69834644",
"0.6508003",
"0.62113124",
"0.6173944",
"0.6133377",
"0.59385705",
"0.5835799",
"0.57682097",
"0.56972444",
"0.569336",
"0.56841004",
"0.5682844",
"0.56573063",
"0.56573063",
"0.56573063",
"0.5651884",
"0.5638968",
"0.5638968",
"0.5638968",
"0.5637... | 0.71341586 | 0 |
setup buffers for swapping. Second set of source and feedback objects are setup to point to corresponding feedback and source buffers. | _setupSwapBuffers() {
if (!this.feedbackMap) {
// feedbackMap required set up swap buffers.
return;
}
const current = this.currentIndex;
const next = (current + 1) % 2;
for (const sourceBufferName in this.feedbackMap) {
const feedbackBufferName = this.feedbackMap[sourceBufferName]... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_setupBuffers({sourceBuffers = null, feedbackBuffers = null}) {\n this.sourceBuffers[0] = Object.assign({}, sourceBuffers);\n this.feedbackBuffers[0] = Object.assign({}, feedbackBuffers);\n this._createFeedbackBuffers({feedbackBuffers});\n this.sourceBuffers[1] = {};\n this.feedbackBuffers[1] = {};\... | [
"0.8414252",
"0.7286514",
"0.67707753",
"0.66774666",
"0.662603",
"0.65364593",
"0.6498882",
"0.64107543",
"0.63826585",
"0.6369216",
"0.6337358",
"0.5840376",
"0.5825638",
"0.5766796",
"0.57280546",
"0.5686743",
"0.56730145",
"0.5582762",
"0.55749816",
"0.54784405",
"0.54784... | 0.86647993 | 0 |
build Model and TransformFeedback objects | _buildModel(props = {}) {
const {vs, elementCount} = props;
// use a minimal fragment shader with matching version of vertex shader.
const fs = getShaderVersion(vs) === 300 ? FS300 : FS100;
this.model = new Model(this.gl, Object.assign({}, props, {
fs,
vertexCount: elementCount
}));
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_initialize(props = {}) {\n let {feedbackBuffers, feedbackMap} = props;\n const {destinationBuffers, sourceDestinationMap} = props;\n if (destinationBuffers) {\n log.deprecated('destinationBuffers', 'feedbackBuffers')();\n feedbackBuffers = feedbackBuffers || destinationBuffers;\n }\n if (... | [
"0.6922684",
"0.5779084",
"0.56898195",
"0.5631175",
"0.5611989",
"0.559083",
"0.559083",
"0.5578533",
"0.55459523",
"0.5515416",
"0.54758745",
"0.5458755",
"0.5362082",
"0.5345633",
"0.5337033",
"0.53224593",
"0.5311495",
"0.5252543",
"0.5244774",
"0.52181077",
"0.52146566",... | 0.77701664 | 0 |
Create extendable base ES3compatible function "Every builtin function and every builtin constructor has the Function prototype object, which is the initial value of the expression Function.prototype (15.3.2.1), as the value of its internal [[Prototype]] property." First argument: return type Subsequent arguments: type ... | function CreateFunction() {
var returnType = arguments[0];
arguments = Array.prototype.slice.call(arguments, 1);
var fun = {
"[[Class]]": "Function",
"[[Type]]": "Function", //Non-standard
"[[Prototype]]": fn_proto,
"[[DontEnum]]": true,
type: jsdef.FUNCTION,
returntype: returnType,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function CreateGlobal(node) {\n\n\t//Create extendable base ES3-compatible object\n\t//\"Every built-in prototype object has the Object prototype object, which is\n\t// the initial value of the expression Object.prototype (15.2.3.1), as the \n\t// value of its internal [[Prototype]] property, except the Object pro... | [
"0.68336064",
"0.649957",
"0.6369491",
"0.63136226",
"0.63136226",
"0.6170195",
"0.61085767",
"0.6088637",
"0.6070249",
"0.6014923",
"0.5966763",
"0.59501684",
"0.58398515",
"0.58102256",
"0.5799545",
"0.5782392",
"0.5731143",
"0.56762886",
"0.56458324",
"0.562274",
"0.562274... | 0.7887582 | 0 |
Gets the upcoming semester to get courses for. | getLookupSemester() {
const date = new Date();
return (date.getMonth() < 7) ? "Fall" : "Spring";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"course() {\n var course = Courses.findOne({ slug: FlowRouter.getParam(\"slug\") });\n if (course) {\n Template.instance().day.set(course.days.length-1);\n }\n return course;\n }",
"function Get_Courses_Offered(jo) {\r\n\tavail = new Array();\r\n\tfor(var i = 0; i < MAX_S... | [
"0.56862706",
"0.562083",
"0.53971756",
"0.5311487",
"0.5231491",
"0.5145474",
"0.5145018",
"0.5134956",
"0.5131585",
"0.51253843",
"0.51246214",
"0.5119252",
"0.5112389",
"0.51022565",
"0.50953823",
"0.5085611",
"0.50836635",
"0.5033978",
"0.5020376",
"0.5009781",
"0.5006760... | 0.56840694 | 1 |
Get courses from the server using a specified query. | getCoursesByQuery(query) {
const semester = this.getLookupSemester();
const year = this.getLookupYear();
return fetch(Constants.SERVER_URL + "q?" + query + `&Semester=${semester}&Year=${year}&limit=1000`)
.then((response) => response.json());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function queryUFCourses(query) {\n let courses = [];\n return loop(0);\n\n function loop(lastControlNumber) {\n let queryString = \"\";\n function modifyIfNotNull(field) {\n if (query.hasOwnProperty(field)) {\n if (queryString !== \"\") {... | [
"0.6653292",
"0.6459213",
"0.64282376",
"0.64197063",
"0.6389934",
"0.6353281",
"0.62759155",
"0.6244069",
"0.62429804",
"0.62367064",
"0.6225158",
"0.62195444",
"0.62045604",
"0.6151529",
"0.6136799",
"0.61000055",
"0.6096377",
"0.607185",
"0.60014045",
"0.59849423",
"0.5976... | 0.6602556 | 1 |
Get courses from the server using a courseID (ex. CSCI 204). | getCourseByID(courseID) {
const semester = this.getLookupSemester();
const year = this.getLookupYear();
const department = courseID.slice(0, 4).toUpperCase();
const courseNum = courseID.substring(4).trim().toUpperCase();
const query = `Department=${department}&CrseNum=${courseNum}&Semester=${semeste... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async get_course_list(id) {\n\t\tawait this.get_login_creds(id);\n\t\tawait this.login();\n\t\treturn await this.scrapeCourses();\n\t}",
"async getCourse(id) {\n const response = await this.api(`/courses/${id}`, 'GET', null, false);\n if (response.status === 200) {\n return response.json... | [
"0.77504903",
"0.73888576",
"0.73622847",
"0.7137128",
"0.70341945",
"0.6988448",
"0.68799204",
"0.68379974",
"0.6825211",
"0.6810706",
"0.68093425",
"0.67344284",
"0.67338943",
"0.6706959",
"0.6640127",
"0.6605366",
"0.65709966",
"0.6530526",
"0.64768547",
"0.647111",
"0.643... | 0.76494247 | 1 |
This modal is shown when a verification email has been sent | function showVerificationEmailSentModal(username)
{
var header = labels.email_sent ;
var body = '<p style="width:320px">' + sprintf(labels.an_email_has_been_sent_to, username) + '</p>';
var footer = '<div class="button" onclick="hideModalContainer()">' + labels.ok + '</div>';
displayModalConta... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function show404mail() {\n\n $('.modal h2').html('This email hasn\\'t been compromised');\n }",
"async sendVerification() {\n await this.send(\n 'Welcome to My Thoughts! Confirm Your Email Address.',\n `\n <center>\n <h1>.::My Thoughts::.</h1>\n <h3>Welcome ${this.name}! We'... | [
"0.682998",
"0.6812757",
"0.6742151",
"0.66438127",
"0.6573929",
"0.6573929",
"0.64835906",
"0.6448781",
"0.6433572",
"0.64040077",
"0.63839275",
"0.63184184",
"0.63117903",
"0.62803507",
"0.6256436",
"0.62418056",
"0.6236199",
"0.6234007",
"0.6226905",
"0.62184274",
"0.61731... | 0.758817 | 0 |
Prepares the state matrix acording to the strategy | function prepare(state, strategy) {
initialize();
if(strategy.permRows) permuteRows();
if(strategy.permCollums) {
state = mod.transpose(state);
this.transposed = !this.transposed;
permuteRows();
state = mod.transpose(state);
this.transposed = !this.transposed;
}
if(strategy.transpose){
state = mod.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"resetBoard(state) {\n state.board = [];\n for (let i = 0; i < state.rows; i++) {\n let currentRow = [];\n for (let j = 0; j < state.cols; j++) {\n currentRow.push({\n row: i,\n col: j,\n isWall: false,\n isPath: false,\n g: Infinity, // for A*\n ... | [
"0.6433659",
"0.61883444",
"0.6143871",
"0.6042482",
"0.6026298",
"0.5872715",
"0.58168423",
"0.5750852",
"0.56875753",
"0.56563306",
"0.5655987",
"0.5655286",
"0.5631363",
"0.55448973",
"0.55352503",
"0.5523052",
"0.55060303",
"0.55060303",
"0.54959875",
"0.5487662",
"0.5485... | 0.6766004 | 0 |
This function orders the row blocks by the number of filled cells of their most filled row (row blocks: rows 0 2, 3 5 and 6 8) Then it orders the rows within each row block by their number of filled cells | function permuteRows() {
// swaping blocks of rows
let max;
let bigY;
let filledMaxOverall;
for(let i = 0; i <= 1; i++) {
max = i *3;
for(let j = i *3; j < 9; j++) {
if(mod.filledSpacesRow(state, j) > mod.filledSpacesRow(state, max))
max = j;
}
bigY = mod.bigSquareIndex(max);
state = ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function CheckRows() {\n let target_rows = [... new Set(activeBlocks.map(x => x.y))]\n const columns = Array(width).fill().map((x, i) => i) //[1,2,...,width-1]\n let remove_rows = target_rows.filter(y => columns.every(x => get_grid(x, y) instanceof GridItem))\n let dy = Array(height).fill(0)\n\n //r... | [
"0.5854166",
"0.5827499",
"0.57136995",
"0.5676581",
"0.559023",
"0.55096805",
"0.5480212",
"0.5470888",
"0.54501635",
"0.53921586",
"0.5391877",
"0.5377909",
"0.5358779",
"0.53568983",
"0.53487694",
"0.53215426",
"0.5316842",
"0.53026426",
"0.529959",
"0.5298267",
"0.5278868... | 0.65054 | 0 |
after fetching files delete json files which is older than 12 hrs | deleteOldSource() {
let result = findRemoveSync(path.join(rootPath, "store"), {
age: { seconds: 3600 * 12 }, // 12 hr
maxLevel: 2,
extensions: ".json",
ignore: "index.json"
});
console.log("Old json source file which were deleted :", result);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function fetchData() {\n const files = await File.find({ createdAt : { $lt: new Date(Date.now() - 24 * 60 * 60 * 1000)} })\n if(files.length) {\n for (const file of files) {\n try {\n fs.unlinkSync(file.path);\n await file.remove();\n conso... | [
"0.71109",
"0.6637421",
"0.63010705",
"0.618535",
"0.60965",
"0.6056596",
"0.6035927",
"0.5993568",
"0.59700197",
"0.5904809",
"0.58622074",
"0.58576185",
"0.584114",
"0.58084285",
"0.57834524",
"0.5780781",
"0.5752627",
"0.57494646",
"0.5748705",
"0.5739124",
"0.571519",
"... | 0.7240451 | 0 |
declare function 'close' to close the database and exit the function. This is to avoid repeating code (DRY). | function close(){
database.close();
return;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"closeDB() {\n\t\tdb.close();\n\t}",
"function close(cb){\n if(DB)\n DB.close()\n cb()\n}",
"async close() {\n debug(`I am in the sql.close funciton`);\n if (!this._dbOpen) return; //if not open, quietly do nothing\n this._dbOpen = false;\n await this._userInsertStmt.fin... | [
"0.80086875",
"0.7942203",
"0.79338527",
"0.785391",
"0.77977765",
"0.7750348",
"0.77321887",
"0.771503",
"0.7702248",
"0.7697009",
"0.7636479",
"0.7628277",
"0.7614349",
"0.7602887",
"0.7566097",
"0.75030476",
"0.75030476",
"0.74626446",
"0.7454984",
"0.7401707",
"0.73811334... | 0.84629583 | 0 |
parse decimal into nonrepeating, first half, second half | function parseDecimal(d) {
let nonRepeating = d.length - d.repeating;
d.periodNonRepeating = nonRepeating ? d.decimal.substr(0, nonRepeating) : '';
let periodRepeating = d.repeating > 0 ? d.decimal.substr(nonRepeating) : '';
if (d.repeating % 2 === 0 && d.repeating > 0) {
let half = d.repeating / 2;
let... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function eliminaDecimals(segons) {\n\tvar resultat;\n\tif (String(segons).indexOf(\".\") <= 0) resultat = segons;\n\telse resultat = parseInt(String(segons).substring(0, String(segons).indexOf(\".\")));\n\treturn resultat;\n}",
"function splitOnDecimal() {\n // An array of each integer from the number in an a... | [
"0.6350192",
"0.6276546",
"0.6266237",
"0.6188071",
"0.6166721",
"0.6116078",
"0.6045258",
"0.60127515",
"0.60060316",
"0.5991099",
"0.598187",
"0.5854709",
"0.58543414",
"0.5853507",
"0.5853507",
"0.5853507",
"0.5853507",
"0.5853507",
"0.5853507",
"0.5853507",
"0.5853507",
... | 0.7564903 | 0 |
generate all possible binary sequences with length n. e.g. for n = 2 the return value is [ '00', '01', '10', '11' ] | function generateSequences(n) {
const sequences = [];
const maxDecimal = 2 ** n;
for (let i = 0; i < maxDecimal; i++) {
sequences.push(i.toString(2).padStart(n, '0'));
}
return sequences;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function binaryCombos(n) {\n var result = [];\n for (let y = 0; y < Math.pow(2, n); y++) {\n var combo = [];\n for (let x = 0; x < n; x++) {\n //shift bit and and it with 1\n if... | [
"0.7072402",
"0.6722765",
"0.6722765",
"0.6341949",
"0.62395734",
"0.6217808",
"0.62057185",
"0.62020934",
"0.6201745",
"0.6192827",
"0.61399746",
"0.6121933",
"0.61148256",
"0.60937715",
"0.6079479",
"0.6068596",
"0.6056899",
"0.6048415",
"0.60366887",
"0.60057974",
"0.60048... | 0.7554238 | 0 |
Navigate to the next Flow Screen | nextScreen() {
let navigateNextEvent = new FlowNavigationNextEvent();
this.dispatchEvent(navigateNextEvent);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"showNextScreen() {\n switch (this.currentStep) {\n case AssistantUIState.VALUE_PROP:\n this.showStep(AssistantUIState.RELATED_INFO);\n break;\n case AssistantUIState.RELATED_INFO:\n if (this.voiceMatchEnforcedOff || this.voiceMatchDisabled ||\n this.shouldSkipVoiceMatch... | [
"0.74390686",
"0.7418684",
"0.74036616",
"0.70948565",
"0.6897882",
"0.68905234",
"0.6845031",
"0.68243843",
"0.6809666",
"0.6777961",
"0.67452794",
"0.66324174",
"0.66228884",
"0.65856713",
"0.65411997",
"0.65108424",
"0.65108424",
"0.64836705",
"0.6481029",
"0.6476282",
"0.... | 0.79658395 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.