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 |
|---|---|---|---|---|---|---|
Determines if the plots near fit the requirements | nearPlotsFitRequirements(plots) {
const nearFlavors = [0, 0, 0, 0, 0];
plots.forEach(idx => {
const plot = App.game.farming.plotList[idx];
if (!plot.isUnlocked) {
return;
}
if (plot.isEmpty()) {
return;
}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"plotFitRequirements(plot, idx) {\n if (!App.game.oakItems.isActive(this.oakItem)) {\n return false;\n }\n if (this.originalBerry && plot.berry !== this.originalBerry) {\n return false;\n }\n return true;\n }",
"nearPlotsFitRequirements(plots) {\n ... | [
"0.7417207",
"0.715871",
"0.71440053",
"0.71440053",
"0.6849944",
"0.6684856",
"0.6112767",
"0.6028959",
"0.57521904",
"0.56995255",
"0.56995255",
"0.5696896",
"0.5628632",
"0.5612167",
"0.5605919",
"0.5546039",
"0.5546039",
"0.5546039",
"0.5545111",
"0.5513709",
"0.5501463",... | 0.7353015 | 1 |
Checks an individual plot for a Berry requirement | checkRequirement(index, berryReq) {
const plot = App.game.farming.plotList[index];
if (!plot.isUnlocked) {
return false;
}
if (plot.berry !== berryReq) {
return false;
}
if (plot.stage() !== PlotStage.Berry) {
return false;
}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"plotFitRequirements(plot, idx) {\n if (!App.game.oakItems.isActive(this.oakItem)) {\n return false;\n }\n if (this.originalBerry && plot.berry !== this.originalBerry) {\n return false;\n }\n return true;\n }",
"function checkAndPlotData() {\n if (loc... | [
"0.6837698",
"0.60401887",
"0.60112786",
"0.5883436",
"0.5883436",
"0.5701848",
"0.5520253",
"0.5515364",
"0.5490171",
"0.5447596",
"0.5447596",
"0.5424788",
"0.5410245",
"0.5371586",
"0.5369236",
"0.5340096",
"0.5281461",
"0.52573687",
"0.52573687",
"0.52573687",
"0.52573687... | 0.76160645 | 1 |
Constructor for a FlavorMutation | constructor(mutationChance, mutatedBerry, flavorReqs, options) {
super(mutationChance, mutatedBerry, options);
this.flavorRatio = [0.5, 0.75, 1]; // Determines how much flavor a Berry plant has before fully mature.
this.flavorReqs = flavorReqs;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"constructor(mutationChance, mutatedBerry, originalBerry, flavorReqs, options) {\n super(mutationChance, mutatedBerry, originalBerry, options);\n this.flavorRatio = [0.5, 0.75, 1]; // Determines how much flavor a Berry plant has before fully mature.\n this.flavorReqs = flavorReqs;\n }",
"c... | [
"0.5732598",
"0.5058663",
"0.5007943",
"0.49995616",
"0.48803833",
"0.48227066",
"0.47711775",
"0.47655407",
"0.46943575",
"0.46553716",
"0.46485916",
"0.46166447",
"0.46157643",
"0.46154073",
"0.46154073",
"0.46154073",
"0.46154073",
"0.45836723",
"0.45679685",
"0.45492762",
... | 0.6021693 | 0 |
Handles getting the mutation chance. Will decrease the mutation chance if the mutatedBerry already exists around this one. | mutationChance(idx) {
const sameBerries = Plot.findNearPlots(idx).filter(plotIndex => {
return App.game.farming.plotList[plotIndex].berry === this.mutatedBerry;
}).length;
return super.mutationChance(idx) * Math.pow(4, -sameBerries);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"mutate() {\n if (!this.unlocked) {\n return false;\n }\n const plots = this.getMutationPlots();\n if (!plots.length) {\n return false;\n }\n let mutated = false;\n plots.forEach((idx) => {\n const willMutate = Rand.chance(this.mutati... | [
"0.64432025",
"0.64213914",
"0.6051752",
"0.59656525",
"0.5954886",
"0.58799124",
"0.5810425",
"0.57610136",
"0.57409585",
"0.56986505",
"0.56649894",
"0.5636657",
"0.56003714",
"0.55910224",
"0.544982",
"0.5411077",
"0.5387237",
"0.53859663",
"0.53856105",
"0.53808427",
"0.5... | 0.66819745 | 0 |
Checks whether a plot fits the requirements for a mutation | plotFitRequirements(plot, idx) {
if (!App.game.oakItems.isActive(this.oakItem)) {
return false;
}
if (this.originalBerry && plot.berry !== this.originalBerry) {
return false;
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getMutationPlots() {\n const plots = super.getMutationPlots();\n const reqs = EnigmaMutation.getReqs();\n return plots.filter((idx) => {\n const nearPlots = Plot.findPlusPlots(idx);\n if (nearPlots.length !== 4) {\n return false;\n }\n ... | [
"0.6400667",
"0.63125265",
"0.62747574",
"0.62747574",
"0.6149414",
"0.6149414",
"0.6144604",
"0.6114672",
"0.602372",
"0.602372",
"0.59373665",
"0.5918029",
"0.5918029",
"0.5874833",
"0.5871815",
"0.58562994",
"0.5835513",
"0.5727881",
"0.57032037",
"0.5699381",
"0.5689973",... | 0.71673757 | 0 |
Determines which plots can mutate. Excludes the parasite berry | getMutationPlots() {
const plots = super.getMutationPlots();
return plots.filter((idx) => {
return App.game.farming.plotList[idx].berry !== this.mutatedBerry;
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getMutationPlots() {\n const plots = super.getMutationPlots();\n const reqs = EnigmaMutation.getReqs();\n return plots.filter((idx) => {\n const nearPlots = Plot.findPlusPlots(idx);\n if (nearPlots.length !== 4) {\n return false;\n }\n ... | [
"0.68427515",
"0.666262",
"0.6515407",
"0.6515407",
"0.6348838",
"0.6285425",
"0.6108205",
"0.585375",
"0.5838846",
"0.5834614",
"0.5825041",
"0.58054787",
"0.57729197",
"0.5747462",
"0.56793845",
"0.5634279",
"0.55789995",
"0.5560963",
"0.5420466",
"0.5340341",
"0.5309049",
... | 0.69611245 | 0 |
Gets the display name for the item | static displayName(item) {
if (!item) {
return '';
}
switch (item.type) {
case ItemType.item:
return this.getItem(item.id).displayName;
case ItemType.underground:
return this.getUndergroundItem(item.id).displayName;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function itemName(item) {\n return item.name;\n }",
"get displayName() {\n return \"Item\";\n }",
"static getItemName(item) {\n if(!item) return \"\"\n else return item.data.identified || !item.data.unidentified || !item.data.unidentified.name || item.data.unidentifi... | [
"0.77008826",
"0.7272558",
"0.7215635",
"0.7106492",
"0.7011003",
"0.7011003",
"0.68463105",
"0.67018664",
"0.66887105",
"0.66559786",
"0.6598839",
"0.6598839",
"0.6598839",
"0.6598839",
"0.6598839",
"0.6598839",
"0.659739",
"0.6594643",
"0.6512807",
"0.6504772",
"0.6494196",... | 0.8196524 | 0 |
Gets the image path for the item | static image(item) {
if (!item) {
return '';
}
switch (item.type) {
case ItemType.item:
return this.getItem(item.id).image;
case ItemType.underground:
return this.getUndergroundItem(item.id).image;
case ItemType.berr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getImagePath(itemId) {\n return (API_SITE + \"getthumbnail/collection/\" + COLLECTION_NAME + \"/id/\" +\n itemId + \"/json\");\n }",
"getItemImg(item) {\n\t\tlet url = 'https://www.serebii.net/itemdex/sprites/pgl/';\n\t\turl += this.toId(item.name);\n\t\turl += '.png';\n\t\treturn url;\n\... | [
"0.7656313",
"0.7248002",
"0.6942439",
"0.6879651",
"0.68573874",
"0.6803479",
"0.6664083",
"0.6648175",
"0.6648175",
"0.6414341",
"0.6355642",
"0.6294587",
"0.62940365",
"0.6259352",
"0.6228388",
"0.61885786",
"0.61867535",
"0.6104769",
"0.6081893",
"0.6078499",
"0.6060525",... | 0.7618691 | 1 |
Gets the amount observable for the item. NOTE: You shouldn't use this to modify the amount, as there might be some additional code that needs to be run via the base gainItem API calls. Use BagHandler.gainItem instead. | static amount(item) {
if (!item) {
return null;
}
switch (item.type) {
case ItemType.item:
return player.itemList[this.getItem(item.id).name];
case ItemType.underground:
return player.mineInventory()[player.mineInventoryIndex(th... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get amount() {\n\t\treturn this.__amount;\n\t}",
"get amount() { return Math.floor(this[AMOUNT]); }",
"get value() {\n return this.amount;\n }",
"getWeight() {\n let sum = 0;\n for (let i = 0; i < this._items.length; i++) {\n sum += this._items[i].getWeight() * this._items[i].cou... | [
"0.6052326",
"0.5704534",
"0.56922036",
"0.56775576",
"0.5669633",
"0.55382496",
"0.55308765",
"0.55280715",
"0.55262697",
"0.5524935",
"0.5516383",
"0.5502523",
"0.54916334",
"0.5424453",
"0.54211164",
"0.5417163",
"0.53601795",
"0.5356719",
"0.5356231",
"0.53462",
"0.534251... | 0.6204173 | 0 |
Johto QuestLines Started upon defeating Ecruteak City's gym. | static createRocketJohtoQuestLine() {
const rocketJohtoQuestLine = new QuestLine('Team Rocket Again', 'Team Rocket is up to no good again!');
const clearTeamRocketHideout = new CustomQuest(1, 0, 'Clear the Team Rocket\'s Hideout dungeon in Mahogany Town', () => App.game.statistics.dungeonsCleared[GameCo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static createAquaMagmaHoennQuestLine() {\n const aquaMagmaHoennQuestLine = new QuestLine('Land vs. Water', 'Put a stop to the schemes of Team Aqua and Team Magma!');\n const clearMtChimney = new CustomQuest(1, 0, 'Stop Team Magma at Mt. Chimney Crater.', () => App.game.statistics.dungeonsCleared[Game... | [
"0.69037193",
"0.6892573",
"0.67242",
"0.6706547",
"0.6444625",
"0.64082074",
"0.6381467",
"0.6361244",
"0.63287127",
"0.629543",
"0.6270795",
"0.5886767",
"0.58176005",
"0.5792728",
"0.5750635",
"0.5711041",
"0.56572646",
"0.5598763",
"0.54539585",
"0.54232544",
"0.54161656"... | 0.6928376 | 0 |
Hoenn QuestLines Started upon defeating Mauville City's gym. | static createAquaMagmaHoennQuestLine() {
const aquaMagmaHoennQuestLine = new QuestLine('Land vs. Water', 'Put a stop to the schemes of Team Aqua and Team Magma!');
const clearMtChimney = new CustomQuest(1, 0, 'Stop Team Magma at Mt. Chimney Crater.', () => App.game.statistics.dungeonsCleared[GameConstan... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static createGalacticSinnohQuestLine() {\n const galacticSinnohQuestLine = new QuestLine('A New World', 'End Team Galactic\\'s plan to destroy the world and create a new one in its place.');\n const clearValleyWindworks = new CustomQuest(1, 0, 'Team Galactic is stealing energy. Clear Valley Windworks... | [
"0.73727125",
"0.69298965",
"0.6901638",
"0.68943566",
"0.68431723",
"0.67746174",
"0.6756347",
"0.67422855",
"0.6719245",
"0.6429485",
"0.64187574",
"0.61872345",
"0.5894195",
"0.5815524",
"0.56889176",
"0.5628654",
"0.55247504",
"0.5488702",
"0.54717904",
"0.5464991",
"0.54... | 0.7596271 | 0 |
Sinnoh QuestLines Started upon defeating Oreburgh City's gym. | static createGalacticSinnohQuestLine() {
const galacticSinnohQuestLine = new QuestLine('A New World', 'End Team Galactic\'s plan to destroy the world and create a new one in its place.');
const clearValleyWindworks = new CustomQuest(1, 0, 'Team Galactic is stealing energy. Clear Valley Windworks.', () =... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static createAquaMagmaHoennQuestLine() {\n const aquaMagmaHoennQuestLine = new QuestLine('Land vs. Water', 'Put a stop to the schemes of Team Aqua and Team Magma!');\n const clearMtChimney = new CustomQuest(1, 0, 'Stop Team Magma at Mt. Chimney Crater.', () => App.game.statistics.dungeonsCleared[Game... | [
"0.72173756",
"0.7079373",
"0.690424",
"0.6853716",
"0.6837157",
"0.6793793",
"0.6727536",
"0.66614026",
"0.6522491",
"0.64687294",
"0.62834865",
"0.60576767",
"0.59343344",
"0.5919089",
"0.58611006",
"0.5825031",
"0.57033145",
"0.560645",
"0.5566155",
"0.5532325",
"0.5517848... | 0.7519356 | 0 |
Unova QuestLines Started upon defeating Virbank City's gym. | static createPlasmaUnovaQuestLine() {
const plasmaUnovaQuestLine = new QuestLine('Quest for the DNA Splicers', 'Prevent Team Plasma from using these dangerous Splicers.');
const clearVirbankGrunt = new CustomQuest(1, 0, 'A Team Plasma Grunt in Virbank City would like to steal your Pokémon. Defeat the gr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static createAquaMagmaHoennQuestLine() {\n const aquaMagmaHoennQuestLine = new QuestLine('Land vs. Water', 'Put a stop to the schemes of Team Aqua and Team Magma!');\n const clearMtChimney = new CustomQuest(1, 0, 'Stop Team Magma at Mt. Chimney Crater.', () => App.game.statistics.dungeonsCleared[Game... | [
"0.5982932",
"0.58516985",
"0.58002687",
"0.57675445",
"0.56520593",
"0.55046123",
"0.54782414",
"0.5421817",
"0.53682667",
"0.53481877",
"0.534048",
"0.53351665",
"0.5332577",
"0.53128403",
"0.52517855",
"0.52455956",
"0.5177482",
"0.50903994",
"0.50865555",
"0.50566524",
"0... | 0.6792567 | 0 |
Gets a quest line by name | getQuestLine(name) {
return this.questLines().find(ql => ql.name.toLowerCase() == name.toLowerCase());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getLine(line) {\n return line;\n }",
"function getQuest(number)\n{\nvar font2=LoadFont(\"tahoma12fett.rfn\");\n\tif (isMemberDouble(questlist[0],number)==true){\n\tquestlist[0].push(number);\n\tRenderMap();\n\tdisplayEntry(GetScreenWidth()/3, GetScreenHeight()/3,GetScreenWidth()/3, Get... | [
"0.57283974",
"0.56016046",
"0.558572",
"0.5580155",
"0.5520787",
"0.5501148",
"0.54680204",
"0.53889346",
"0.53797317",
"0.52968246",
"0.52798945",
"0.5273737",
"0.5231694",
"0.519938",
"0.5192117",
"0.5187329",
"0.51823175",
"0.5168252",
"0.516312",
"0.50860983",
"0.5078314... | 0.89157027 | 0 |
Formula for the Money cost for refreshing quests | getRefreshCost() {
// If we have a free refersh, just assume all the quest are completed
const notComplete = this.freeRefresh() ? 0 : this.incompleteQuests().length;
const cost = Math.floor((250000 * Math.LOG10E * Math.log(Math.pow(notComplete, 4) + 1)) / 1000) * 1000;
return new Amount(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function calcIt()\n\t{\t\n\t\tvar Amount = 0;\n\t\tvar NOP = $('#N').val();\n\t\tvar PerPrice = parseFloat($('#theCost').text());\n\t\tAmount = (PerPrice * NOP).toFixed(2);\n\n\t\t$('#Answer').html(\"Your total price will be $\"+Amount);\t\n\t\n\t}",
"function calculateTicketCost() {\n const firstClassCount = g... | [
"0.68614995",
"0.67859244",
"0.6679988",
"0.66549367",
"0.66095424",
"0.659401",
"0.6540544",
"0.65052116",
"0.65016747",
"0.649955",
"0.6493337",
"0.64791495",
"0.64784306",
"0.6473575",
"0.64723235",
"0.6464112",
"0.6461855",
"0.64295673",
"0.6415946",
"0.64021784",
"0.6382... | 0.72964495 | 0 |
Determines if all quests have been completed and claimed. | allQuestClaimed() {
return !this.incompleteQuests().length && !this.currentQuests().length;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkComplete() {\n if (listQuestion.length === Object.keys(listResult).length){\n return true\n } else {\n return false\n }\n}",
"isEveryoneFinished() {\n\t\treturn Object.values(this.answered).every(value => value);\n\t}",
"checkComplete() {\n for (let i = 0; i < this.build... | [
"0.6473223",
"0.6444043",
"0.6244362",
"0.6180448",
"0.6178699",
"0.6131891",
"0.60977125",
"0.60823816",
"0.60324377",
"0.60294646",
"0.6008789",
"0.6003176",
"0.59422445",
"0.5921836",
"0.5903391",
"0.58977985",
"0.5880676",
"0.5874293",
"0.5867039",
"0.586566",
"0.5861621"... | 0.83067054 | 0 |
Below are GameOfLife Functions 3 modes of execution 1) use the function bindGameOfLife(DOMElement, options) this is the raw method that method 2 and 3 relies on. this function can be invoked on the raw DOM reference. 2) use the jQuery function $(DOMSelector).GameOfLife(); this method can be used when the DOM element is... | function bindGameOfLife(elem, options){
if (!elem.gameoflife){
function ConwayController(){
var self = this;
//helper: svg rectangle generator
function boxFactory(x, y){
//this should be called only after self.cells[][] is defined.
var box = svgelem('rect', self.view);
$(box).attr({
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function GameOfLife(tag_id, params) { \n let self = this;\n\n let dom = this.dom = {};\n \n // remember identification tag in the dom\n let tag = this.dom.tag_id = tag_id;\n \n /* keep reference to container in the object props*/\n let wrp = this.dom.gameOfLifeWrapper = document.querySelector... | [
"0.69374275",
"0.54339147",
"0.5302956",
"0.5261337",
"0.5226909",
"0.515244",
"0.51446277",
"0.51315325",
"0.5128861",
"0.5099556",
"0.5055986",
"0.50270677",
"0.50171113",
"0.49790964",
"0.4953106",
"0.4950969",
"0.49373117",
"0.49245235",
"0.49090838",
"0.49035472",
"0.489... | 0.6215219 | 1 |
intersection method will return the intersection of two sets as a new set | intersection(otherSet) {
const intersectionSet = new mySet();
const firstSet = this.values();
firstSet
.filter( e => otherSet.has(e))
.forEach(e => intersectionSet.add(e));
return intersectionSet;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"intersection(otherSet) {\n var intersectionSet = new Sets();\n var firstSet = this.values();\n\n firstSet.forEach(e => {\n // go over first set, if it's in the second set add to new set\n if (otherSet.has(e)) {\n intersectionSet.add(e);\n }\n });\n\n return intersectionSet;\n ... | [
"0.82796735",
"0.8113559",
"0.7942265",
"0.7942265",
"0.7942265",
"0.7829872",
"0.7813785",
"0.7719378",
"0.7710044",
"0.7704046",
"0.7633882",
"0.75749475",
"0.7528693",
"0.74372566",
"0.74182063",
"0.7305919",
"0.72590744",
"0.7231235",
"0.7224798",
"0.72118706",
"0.7194892... | 0.81604093 | 1 |
difference method will return the difference of two sets as new set | difference(otherSet) {
const differenceSet = new mySet();
const firstSet = this.values();
firstSet
.filter( e => !otherSet.has(e))
.forEach(e => differenceSet.add(e));
return differenceSet;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"difference(otherSet) {\n var differenceSet = new Sets();\n\n var firstSet = this.values();\n\n firstSet.forEach(e => {\n if (!otherSet.has(e)) {\n differenceSet.add(e);\n }\n });\n\n return differenceSet;\n }",
"difference(otherSet) {\n let differenceSet = new CustomSet();\n ... | [
"0.8438513",
"0.8242957",
"0.81317633",
"0.8097656",
"0.80650055",
"0.7985506",
"0.7897455",
"0.77137846",
"0.7679126",
"0.7648046",
"0.7496737",
"0.73213655",
"0.72505283",
"0.7182152",
"0.7006106",
"0.70039284",
"0.70027655",
"0.6840585",
"0.68054414",
"0.6747971",
"0.66888... | 0.8466048 | 0 |
Using the opposite of the above, we already know that if a star is highlighted, we can just loop through all of them and replace them with the "empty" star. updateCount() Updates the count of characters in the wordCountBox element. | function updateCount() {
var commentText = document.getElementById("comment").value;
var charCount = countCharacters(commentText);
var wordCountBox = document.getElementById("wordCount");
wordCountBox.value = charCount + "/1000";
if (charCount > 1000) {
wordCountBox.style.color = "white";
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function offStar() {\n\tfor (let i = 0; i < stars.length; ++i) {\n\t\tstars[i].children[0].style.fill = emptyStarColor;\n\t}\n}",
"function updateCount() {\r\n // The commentText variable is declared to refrence the value stored in the comment text area box\r\n var commentText = document.getElementById... | [
"0.59498125",
"0.57166296",
"0.57011473",
"0.5647852",
"0.56398433",
"0.5627529",
"0.56075495",
"0.55870706",
"0.55774045",
"0.55571675",
"0.5527049",
"0.55043864",
"0.5496758",
"0.54950285",
"0.54930186",
"0.5484619",
"0.54841065",
"0.54755694",
"0.5459188",
"0.54590017",
"0... | 0.6115 | 0 |
Add new book to library array when addForm is submitted | function addBookToLibray(event) {
event.preventDefault();
author = document.getElementById("author").value;
title = document.getElementById("title").value;
pageNumber = document.getElementById("pageNumber").value;
read = document.getElementById("read").checked;
newBook = new Book(author, title, page... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addBookToLibrary(book) {\n const newBook = new Book();\n myLibrary.push(newBook);\n displayBook();\n updateLocalStorage(myLibrary); \n clearForm();\n}",
"function addNewBookToBookList(e) {\n\te.preventDefault();\n\t\n\t// Add book book to global array\n\tconst name = bookAddForm.children[... | [
"0.8548639",
"0.8461697",
"0.83134866",
"0.83067495",
"0.7992449",
"0.7962899",
"0.7929012",
"0.7884913",
"0.7839512",
"0.78267926",
"0.78265584",
"0.7773213",
"0.77182055",
"0.7708656",
"0.76753145",
"0.7666497",
"0.76488006",
"0.76348084",
"0.763058",
"0.76180696",
"0.76019... | 0.85511726 | 0 |
Display library when clicking "Show Library" button | function showLibrary() {
resetLibrary();
// Hide book form and display library
if (addForm.style.display == "block") {
addForm.style.display = "none";
}
if (libraryContainer.style.display == "none") {
libraryContainer.style.display = "flex";
} else { libraryContainer.style.display = "none" }... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function openLibrary(e){\n\t\tlibrary.style.display = \"block\";\n\t\tlibraryHeaderH3.innerHTML = e.currentTarget.id + \" For Part Number #123\";\n\t}",
"function libraryshow() {\n lib.addEventListener(\"click\", function () {\n libwindow.style.display = \"block\";\n });\n\n libspan.onclick = function () {... | [
"0.7364742",
"0.72717917",
"0.7113615",
"0.6828796",
"0.67835635",
"0.6647951",
"0.6347072",
"0.62274885",
"0.6072282",
"0.59922",
"0.57976955",
"0.57639295",
"0.5754251",
"0.5749368",
"0.5668822",
"0.56374496",
"0.56316584",
"0.5618552",
"0.5599768",
"0.5595479",
"0.556335",... | 0.7786501 | 0 |
Set the libray using local storage | function setLibrary() {
if (!localStorage.getItem('myLibrary')) {
myLibrary = [];
} else { myLibrary = JSON.parse(localStorage.getItem('myLibrary')) }
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setData() {\n\tlocalStorage.setItem(`myLibrary`, JSON.stringify(myLibrary));\n}",
"set(local){\n let arr = [];\n arr = this.getArray();\n arr.push(local);\n localStorage.setItem('arr_locais', JSON.stringify(arr));\n }",
"function saveLocal() {\n localStorage.setItem(\"m... | [
"0.70702034",
"0.645844",
"0.64092976",
"0.6299163",
"0.62865406",
"0.6193155",
"0.6182207",
"0.614402",
"0.61149496",
"0.6114565",
"0.60990703",
"0.6036188",
"0.5959711",
"0.5946313",
"0.59234583",
"0.5916231",
"0.5916137",
"0.59062034",
"0.5904072",
"0.58674186",
"0.5859245... | 0.6992908 | 1 |
find is a method on User. Use it to find a specific user | static find (name) {
const u = users.find(user => user.username === name)
if (!u) {
return Promise.reject(
Object.assign(new Error('User not found'), {
statusCode: 404
})
)
} else {
const user = new User(u)
return Promise.resolve(user)
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async findUser(id){\n return User.findOne({where:{id}})\n }",
"function findUserById(id) {\n return userdb('users').where({ id }).first();\n}",
"async findUser () {\n\t\tthis.user = await this.data.users.getOneByQuery(\n\t\t\t{ searchableEmail: this.providerInfo.email.toLowerCase() },\n\t\t\t{ hint: Ind... | [
"0.80294865",
"0.7441903",
"0.73695153",
"0.73374975",
"0.7328087",
"0.726772",
"0.726772",
"0.72658354",
"0.7258775",
"0.7240317",
"0.7229078",
"0.7223495",
"0.71996844",
"0.71956855",
"0.71851826",
"0.7154834",
"0.71126676",
"0.7108834",
"0.7101304",
"0.7100923",
"0.7099736... | 0.7472507 | 1 |
Check if date (timestamp) is today | checkIfToday(timestamp) {
let other_date = new Date(timestamp);
if (this.today.toDateString() == other_date.toDateString()) {
return true;
} else {
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"isItToday(timestamp)\n {\n return moment(timestamp).format('DD/MM/YYYY') == moment(new Date()).format('DD/MM/YYYY');\n }",
"function isToday(date) {\n var today = new Date();\n return date.getFullYear() == today.getFullYear() &&\n date.getMonth() == today.getMonth() &&\n ... | [
"0.8156811",
"0.77690405",
"0.77623",
"0.77167094",
"0.7496798",
"0.73992956",
"0.73427194",
"0.71870303",
"0.7177713",
"0.7131349",
"0.70771176",
"0.7057076",
"0.705642",
"0.69881237",
"0.6913761",
"0.6862749",
"0.6809744",
"0.6703291",
"0.6699553",
"0.66140723",
"0.6532175"... | 0.82529545 | 0 |
Check if date (timestamp) is yesterday | checkIfYesterday(timestamp) {
let other_date = new Date(timestamp);
if ((this.today.getDate() - 1) == other_date.getDate()) {
return true;
} else {
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isYesterday(date) {\n var today = new Date();\n var yesterday = new Date();\n yesterday.setDate(today.getDate() - 1);\n return date.getFullYear() == yesterday.getFullYear() &&\n date.getMonth() == yesterday.getMonth() &&\n date.getDate() == yesterday.getDate();\n}",
"vali... | [
"0.7432263",
"0.68389666",
"0.63865405",
"0.6257899",
"0.6192826",
"0.6184734",
"0.6153801",
"0.6034891",
"0.5867965",
"0.5843253",
"0.5788716",
"0.5740528",
"0.5679334",
"0.56391764",
"0.5618488",
"0.5596756",
"0.5554078",
"0.55482954",
"0.55257523",
"0.5519504",
"0.55037534... | 0.8711102 | 0 |
Check if date (timestamp) is last week | checkIfLastWeek(timestamp) {
let today = this.today;
let first_of_year_today = new Date(today.getFullYear(), 0, 1);
let first_of_year_today_day = first_of_year_today.getDay();
let today_week = Math.ceil( (((today - first_of_year_today.valueOf()) / 86400000) + first_of_year_today_day + 1) / 7 );
let... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function withinWeek(date) {\n console.log(date);\n return new Date() - date < sevenDaysInMS;\n}",
"function getLastWeekDate(date) {\n var lastWeekDate = new Date(date.getTime() - 7 * 24 * 3600 * 1000);\n return lastWeekDate;\n}",
"function isLastWeek(pastTime, now) {\n 'use strict';\n now = now |... | [
"0.7449441",
"0.72602427",
"0.7101163",
"0.69937855",
"0.69727993",
"0.69654685",
"0.6943627",
"0.6853195",
"0.67900795",
"0.66229045",
"0.6492712",
"0.64777106",
"0.64649206",
"0.64548093",
"0.6395024",
"0.6365265",
"0.63358116",
"0.624983",
"0.6209823",
"0.6186927",
"0.6124... | 0.7881548 | 0 |
Extends the |base| prototype with |derived| by merging the two objects into a new object. | function extend(base, derived) {
var proto = {};
for (var i in base)
proto[i] = base[i];
for (var i in derived)
proto[i] = derived[i];
return proto;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function extend(base) {\r\n return Object.assign({}, base, devSpecific);\r\n}",
"function extend(base)\r\n{\r\n /* save base properies/methods, to use in our methods */\r\n $super = base;\r\n\r\n /* merge and overwrite base module attributes */\r\n return (Object.assign({}, base, devSpecific));\r\... | [
"0.6892813",
"0.6808945",
"0.6598212",
"0.65474623",
"0.65474623",
"0.65474623",
"0.65474623",
"0.65474623",
"0.65474623",
"0.65474623",
"0.65474623",
"0.65306216",
"0.6530554",
"0.6372771",
"0.6372771",
"0.6372771",
"0.61760974",
"0.6116401",
"0.6111114",
"0.604654",
"0.6034... | 0.7926536 | 0 |
Return flat forms if cached, otherwise call getFlatFormsFromDatabase() method | function getFlatForms(hardReload) {
if ((!areFlatFormsLoaded && !areFlatFormsLoading) || hardReload) {
getFlatFormsFromDatabase();
}
return flatForms;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getAllFlatForms(hardReload) {\n if ((!areAllFlatFormsLoaded && !areAllFlatFormsLoading) || hardReload) {\n getAllFlatFormsFromDatabase();\n }\n return allFlatForms;\n }",
"function loadExistingFormsAsList(){\n \n }",
"_denormalizeFormU... | [
"0.75419176",
"0.5831927",
"0.53698915",
"0.5312167",
"0.5123781",
"0.5039738",
"0.50007814",
"0.49437022",
"0.49417838",
"0.49210367",
"0.48533165",
"0.48385882",
"0.48265174",
"0.4812804",
"0.47971815",
"0.47931558",
"0.47555378",
"0.472275",
"0.4694973",
"0.46940243",
"0.4... | 0.78358585 | 0 |
Get file path for export Flat Forms. | function getFilePath() {
return $BASE_PATH + 'adminPanel/flatForms/export';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getExportDir() {\n return exportFormsDir;\n }",
"function getDefaultExportPath() {\r\n var exportPath = String(app.activeDocument.fullName);\r\n exportPath = exportPath.substring(0, exportPath.lastIndexOf('/')) + '/' + image.exportDir;\r\n return exportPath\r\n}",
"getFilePath () ... | [
"0.6911201",
"0.61177313",
"0.5908918",
"0.5703624",
"0.5682923",
"0.55840117",
"0.5576322",
"0.54858375",
"0.5426504",
"0.53563994",
"0.5345182",
"0.5290855",
"0.5258906",
"0.5246365",
"0.52313095",
"0.51516455",
"0.5126188",
"0.5087704",
"0.5025397",
"0.5021112",
"0.5014852... | 0.84050274 | 0 |
If msg = "unban member" | execute(msg, args) {
// Unban user
const id = args[0];
guild.members.unban(id);
// Let msg author know member was unbanned
msg.reply(`Member unbanned. Unbanned member ID: ${id}`)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function unbanMember(message, args) {\n //check if message has correct mention\n const userID = args.join(\" \");\n try {\n await unbanUserDB(userID);\n } catch (e) {\n console.log(`DB ERROR-ban member handler: ${e}`)\n }\n message.client.guilds.cache.forEach(guild => {\n ... | [
"0.7258176",
"0.71193",
"0.71046007",
"0.69467527",
"0.6880803",
"0.6571057",
"0.65108854",
"0.64753044",
"0.6444784",
"0.6426369",
"0.6424281",
"0.6251578",
"0.6071167",
"0.6049799",
"0.60116994",
"0.5978287",
"0.5968476",
"0.5933907",
"0.58740926",
"0.5841983",
"0.57170784"... | 0.78447425 | 0 |
Howdy Richard! Defaults and destructuring arrays The createGrid() function expects an array to be passed to it for destructuring . It uses destructuring to set the first item in the array to the width and the second item to be the height. if createGrid() is called without any argument then it will use the default empty... | function createGrid([width = 5, height = 5] = []) {
console.log(`Generates a ${width} x ${height} grid`);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function newGrid(){\n\n var pixelsX = window.prompt(\"How many pixels wide?\");\n var pixelsY = window.prompt(\"How many pixels high?\");\n var pixelDims = [pixelsX,pixelsY];\n return pixelDims;\n\n}",
"function setGrid() {\n defaultGridSize(3);\n makeGrid(3);\n}",
"function newGrid() {\n ... | [
"0.704065",
"0.699912",
"0.69791293",
"0.6882017",
"0.6871728",
"0.6774656",
"0.67487204",
"0.67487204",
"0.67477983",
"0.6711175",
"0.670451",
"0.6698983",
"0.6687531",
"0.6672207",
"0.6617715",
"0.65963405",
"0.65856785",
"0.657616",
"0.657616",
"0.6562765",
"0.65438586",
... | 0.77788216 | 0 |
xhr request for skills status getter | static getSkillsStatus() {
$.ajax({
type: "POST",
url: "/?getSkillsStatus",
dataType: "json",
success: (result) => {
let skills = result.response
skills.map((skill) => {
skill.status += "%"
$(`#${skill.id} h3`)[0].innerText += ` ${skill.status}`;
$(`#${skill.id} .progress`).css({ w... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ajaxMySkills() {\n return $.ajax({\n url: apiBasePath + apiProfilePath + \"skills/\",\n dataType: 'json',\n success: function(response) {\n\n }.bind(this),\n error: function(xhr, status, err) {\n console.error(this.props.url, status, err.toString());\n ... | [
"0.7155999",
"0.67681414",
"0.6557887",
"0.6053711",
"0.6021793",
"0.5998592",
"0.5965309",
"0.5893449",
"0.5892153",
"0.581521",
"0.5799081",
"0.57803047",
"0.5703122",
"0.5621626",
"0.5621284",
"0.55981743",
"0.558262",
"0.5581396",
"0.5560816",
"0.5551353",
"0.5549074",
... | 0.72667307 | 0 |
Handles mouse selection of components, if enabled. | _mouseSelect() {
if(this.mouseFocus) {
for(var i = this._drawOrder.length-1; i >= 0; i --) {
if(this._drawOrder[i] in this._components && this._components[this._drawOrder[i]].allowMouse) {
var com = this._components[this._drawOrder[i]];
if(com.mouseHovered && com.visible) {
if(com != this... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"handleContextClick(args){\n if(this.shapeSelectionEnabled) {\n this.selectShape(args);\n }\n }",
"function setupMouseEvents (parent, canvas, selection) {\n \n function mousedownHandler(evt) {\n \n var mousePos = selection.geometry().m2v(offsetMousePos(parent, evt));\n switc... | [
"0.67078745",
"0.6698795",
"0.65941125",
"0.65385413",
"0.65312797",
"0.6468783",
"0.6456858",
"0.64416254",
"0.6413431",
"0.638475",
"0.63803184",
"0.6375769",
"0.6354328",
"0.6335301",
"0.63274544",
"0.63156",
"0.63038385",
"0.6270991",
"0.62674296",
"0.62287563",
"0.622152... | 0.6931825 | 0 |
getNetwork Converts a named common networks or chain ID (network ID) to a Network and verifies a network is a valid Network.. | function getNetwork(network) {
// No network (null)
if (network == null) {
return null;
}
if (typeof (network) === 'number') {
for (var name_1 in networks) {
var n_1 = networks[name_1];
if (n_1.chainId === network) {
return {
na... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getNetwork(network) {\n // No network (null)\n if (network == null) {\n return null;\n }\n if (typeof (network) === \"number\") {\n for (var name_1 in networks) {\n var standard_1 = networks[name_1];\n if (standard_1.chainId === network) {\n r... | [
"0.78908736",
"0.7855365",
"0.7844118",
"0.7825031",
"0.750906",
"0.724803",
"0.65061325",
"0.6446552",
"0.63960135",
"0.6363162",
"0.6357892",
"0.630286",
"0.6290419",
"0.62109625",
"0.6136952",
"0.60523266",
"0.59244996",
"0.58547133",
"0.5854142",
"0.5854142",
"0.58433163"... | 0.80753 | 0 |
Search an Object and its children recursively, caselessly. | function searchPath(object, path) {
var currentChild = object;
var comps = path.toLowerCase().split('/');
for (var i = 0; i < comps.length; i++) {
// Search for a child object with a case-insensitive matching key
var matchingChild = null;
for (var key in currentChild) {
i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function searchPath(object, path) {\n var currentChild = object;\n var comps = path.toLowerCase().split(\"/\");\n for (var i = 0; i < comps.length; i++) {\n // Search for a child object with a case-insensitive matching key\n var matchingChild = null;\n for (var key in currentChild) {\... | [
"0.70005876",
"0.6968639",
"0.6555977",
"0.65102124",
"0.6469868",
"0.640638",
"0.62672514",
"0.6257546",
"0.61026883",
"0.5923015",
"0.58601946",
"0.58468854",
"0.5845894",
"0.58156973",
"0.5803962",
"0.5782955",
"0.57481724",
"0.5702824",
"0.5643661",
"0.56356",
"0.56009895... | 0.698538 | 1 |
Returns: true is all networks match false if any network is null throws if any 2 networks do not match | function checkNetworks(networks) {
var result = true;
var check = null;
networks.forEach(function (network) {
// Null
if (network == null) {
result = false;
return;
}
// Have nothing to compre to yet
if (check == null) {
check = net... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkNetworks(networks) {\n\t var result = null;\n\t for (var i = 0; i < networks.length; i++) {\n\t var network = networks[i];\n\t // Null! We do not know our network; bail.\n\t if (network == null) {\n\t return null;\n\t }\n\t if (result) {\n\t ... | [
"0.7083987",
"0.7046683",
"0.698012",
"0.6226785",
"0.59940064",
"0.59940064",
"0.59541094",
"0.5841608",
"0.57439363",
"0.57429546",
"0.56422347",
"0.5584212",
"0.5571649",
"0.5521883",
"0.5509024",
"0.5509024",
"0.54674095",
"0.5453335",
"0.54518497",
"0.5446434",
"0.542888... | 0.77350307 | 0 |
Normalize words using the transform | function normalize(word) {
var result = '';
for (var i = 0; i < word.length; i++) {
var kana = word[i];
var target = transform[kana];
if (target === false) {
continue;
}
if (target) {
kana = target;
}... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Normalize() {}",
"function normalize(word) {\n return stem(word.toLowerCase()).replace(/[^a-z]/g, '');\n}",
"function normalize(word) {\n return stem(word.toLowerCase()).replace(/[^a-z]/g, '');\n}",
"function normalize(word) {\n return stem(word.toLowerCase()).replace(/[^a-z]/g, '');\n}",
"function norm... | [
"0.7005437",
"0.6737253",
"0.6737253",
"0.6737253",
"0.66794235",
"0.66794235",
"0.62349606",
"0.6077729",
"0.6069701",
"0.5895998",
"0.58644366",
"0.5860572",
"0.5791593",
"0.5778903",
"0.57557213",
"0.57508546",
"0.574204",
"0.5734097",
"0.56271434",
"0.56224775",
"0.559968... | 0.71745473 | 0 |
Sort how the Japanese list is sorted | function sortJapanese(a, b) {
a = normalize(a);
b = normalize(b);
if (a < b) {
return -1;
}
if (a > b) {
return 1;
}
return 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function SortGameList ()\n{\n\t// Sub-function. Sorts strings, but ignores case.\n\tfunction SortIgnoreCase(a, b)\n\t{\n\t\tvar ua = a.toUpperCase();\n\t\tvar ub = b.toUpperCase();\n\t\tvar char_pos = 0;\n\t\tvar max_chars = 0;\n\t\tvar match = true;\n\t\t\n\t\tif (ua == ub) return 0;\n\t\t\n\t\tmax_chars = Math.m... | [
"0.5980327",
"0.59690547",
"0.59392154",
"0.5891588",
"0.5884394",
"0.5831361",
"0.5810681",
"0.5794824",
"0.57630646",
"0.56954294",
"0.56852216",
"0.56852216",
"0.5677298",
"0.5672915",
"0.5639387",
"0.5636326",
"0.5625649",
"0.56236726",
"0.56193084",
"0.5618122",
"0.56124... | 0.78588736 | 0 |
Gets the photo URL from the style attribute of the photo container | function createPhotoUrl(styleAttrib) {
var cleanStyle = createStyleObj(styleAttrib);
var photoUrl = cleanStyle['background-image'];
var linkLinter = /\(([^\)]+)\)/;
var theLink = ((photoUrl.match(linkLinter)[1]));
return theLink;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"previewStyle() {\n return `background-image: url(${this.user.photo_url})`;\n }",
"previewStyle() {\n return `background-image: url(${this.user.photo_url})`;\n }",
"get url() { return this.currentPhoto.url; }",
"function photoStyle(feature, resolution) {\n if (!styleCache[... | [
"0.6160635",
"0.6160635",
"0.61407495",
"0.6096529",
"0.6048135",
"0.60017246",
"0.5919335",
"0.5909774",
"0.5872923",
"0.57612044",
"0.5757849",
"0.5757849",
"0.57244986",
"0.5698404",
"0.56797266",
"0.5643881",
"0.56097335",
"0.5578491",
"0.5577466",
"0.55720216",
"0.557080... | 0.7093232 | 0 |
parses styleAttrib string into a hash of styles | function createStyleObj(styleAttrib) {
var parts = styleAttrib.split("; ");
var obj = {};
for (var i = 0; i < parts.length; i++) {
var subParts = parts[i].split(': ');
obj[subParts[0]]=subParts[1];
}
return obj;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function parseStyleText(styleText) {\n styleText = String(styleText);\n var retval = {};\n styleText.replace(/"/g, '\"')\n .replace(/\\s*([^ :;]+)\\s*:\\s*([^;]+)\\s*(?=;|$)/g,\n function (match, name, value) {\n retval[ name ] = value;\n })... | [
"0.66917014",
"0.6633549",
"0.65917784",
"0.65043247",
"0.6363527",
"0.628808",
"0.628808",
"0.62714005",
"0.62404656",
"0.6159519",
"0.6159519",
"0.61193085",
"0.5984562",
"0.5878787",
"0.5838727",
"0.5838727",
"0.5838727",
"0.5838727",
"0.5838727",
"0.5838727",
"0.5838727",... | 0.7531283 | 0 |
adds https to image path if not already there | function addZeHTTPS(imagePath) {
if (imagePath.match(/https/g) || imagePath.match(/http/g)) {
return imagePath;
}
else {
imagePath = 'https' + imagePath;
return imagePath;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static ensureImageResourceHttps(imageUrl) {\n if (imageUrl) {\n try {\n let parsedImageUrl = new URL(imageUrl);\n if (parsedImageUrl.hostname === 'localhost' ||\n parsedImageUrl.hostname.indexOf('192.168') !== -1 ||\n parsedImage... | [
"0.7187717",
"0.6712783",
"0.6376564",
"0.632887",
"0.607638",
"0.6018158",
"0.5917071",
"0.5832585",
"0.5795037",
"0.5780803",
"0.56443703",
"0.5638823",
"0.5471285",
"0.5467644",
"0.54464465",
"0.5427066",
"0.5422068",
"0.5399519",
"0.5394342",
"0.53888273",
"0.53885657",
... | 0.8383343 | 0 |
Creating 153 sparkline charts is quite fast in modern browsers, but IE8 and mobile can take some seconds, so we split the input into chunks and apply them in timeouts in order avoid locking up the browser process and allow interaction. | function doChunk() {
var time = +new Date(),
i,
len = $tds.length,
$td,
stringdata,
arr,
data,
chart;
try{
for (i = 0; i < len;... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function doChunk() {\n\t\t\t var time = +new Date(),\n\t\t\t i,\n\t\t\t len = $tds.length,\n\t\t\t $td,\n\t\t\t stringdata,\n\t\t\t arr,\n\t\t\t data,\n\t\t\t chart;\n\n\t\t\t for (i = 0; i < len; i += 1) {\n\t\t\t ... | [
"0.6952792",
"0.59347826",
"0.59347826",
"0.5784726",
"0.57754934",
"0.5628368",
"0.5605544",
"0.5584341",
"0.5573622",
"0.5554731",
"0.5537123",
"0.548082",
"0.54791176",
"0.5479008",
"0.54761714",
"0.54070413",
"0.5397869",
"0.5387962",
"0.5362893",
"0.53502",
"0.5348849",
... | 0.7131307 | 0 |
should be used to fetch the list of issues and used as a data store (local storage) we can call this function multiple times. fetching issue items from local storage. | function fetchIssues() {
var issues = JSON.parse(localStorage.getItem('issues'));
var issuesListe = document.getElementById('issuesList'); // retreive refference from div section from the index.html
issuesList.innerHTML = ''; // intitialize the content. make sure its empty. (empty string the inner html)
/... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"fetchAndLoadOpenIssues() {\n this.adapter\n .getOpenIssues()\n .then(issues => {\n issues.forEach(issue => this.openIssuesArray.push(new Issue(issue)))\n })\n .then(() => {\n this.renderOpenIssues()\n })\n .catch(err => alert('Something went wrong'));\n }",
"functi... | [
"0.7369778",
"0.7330557",
"0.6915745",
"0.67069614",
"0.6511112",
"0.64379525",
"0.6425762",
"0.6409581",
"0.6346815",
"0.634374",
"0.6259068",
"0.608063",
"0.6050952",
"0.6040714",
"0.6031963",
"0.60131794",
"0.5940757",
"0.5940089",
"0.5936767",
"0.593207",
"0.59256434",
... | 0.7391078 | 0 |
deal and shuffle all cards | function dealShuffledDeck() {
self.reset();
self.shuffle();
self.dealAll();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function shuffleDeck() {\n\n for(let currentCard = 0; currentCard < allCards.length; currentCard++){\n let temp = allCards[currentCard];\n let randomCard = Math.floor(Math.random() * allCards.length);\n allCards[currentCard] = allCards[randomCard];\n ... | [
"0.81305814",
"0.79201144",
"0.7852391",
"0.7803719",
"0.7789432",
"0.778683",
"0.77811277",
"0.777582",
"0.77660775",
"0.7698544",
"0.7697789",
"0.76918894",
"0.76710457",
"0.7624276",
"0.7612899",
"0.7587174",
"0.7574851",
"0.7539304",
"0.7538802",
"0.7537383",
"0.75265175"... | 0.8501109 | 1 |
GET all comments of a blog | async function getAllComments(req, res) {
CommentModel.find({ postid: req.params.blogid }, function (err, Comments) {
if (err) {
res.send(err);
}
res.json(Comments);
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getComments (blogId, $comments) {\n //if there aren't any currently loaded comments in the dom, make AJAX GET request\n if ($comments.children().length === 0) {\n $.ajax({\n \"method\": \"GET\",\n \"url\": \"get_comments/\",\n \"data\":... | [
"0.7454657",
"0.70141697",
"0.69988644",
"0.6947573",
"0.6934096",
"0.68426687",
"0.68301296",
"0.68140733",
"0.68101096",
"0.6797295",
"0.6787174",
"0.678589",
"0.67755574",
"0.67560095",
"0.6735093",
"0.6727039",
"0.66991156",
"0.6680705",
"0.6656251",
"0.6583856",
"0.65582... | 0.7810495 | 0 |
Save all result to cache | function saveToCache(keyPrefix, allResults, callback) {
cache.set(ASSETS_KEY_PREFIX + keyPrefix, JSON.stringify(allResults), function(redisErr, redisRes) {
if(redisErr) {
if(callback) {
callback(redisErr);
} else {
utils.logError(redisErr, null);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function save_result(expr, result) {\n\tif (cache_max == 0) {\n\t\treturn;\n\t}\n\tif (cache.size == cache_max) {\n\t\tfor (var key of cache.keys()) {\n\t\t\tcache.delete(key);\n\t\t\tbreak;\n\t\t}\t\n\t}\n\tcache.set(expr,result);\n}",
"_saveCache() {\n try {\n if(!(this._wikis instanceof Arra... | [
"0.7014398",
"0.65088046",
"0.6374636",
"0.6293504",
"0.61177206",
"0.61074394",
"0.61047184",
"0.6092777",
"0.6076346",
"0.6047478",
"0.6047478",
"0.6047478",
"0.6047478",
"0.6047478",
"0.6047478",
"0.6047478",
"0.6047478",
"0.6000379",
"0.59866345",
"0.59031564",
"0.5872540... | 0.703562 | 0 |
Upload file to AWS S3 assets from base64 binary data | function uploadFileFromBase64(parentFolderName, binaryData, saveInCache, callback) {
var error;
if(!parentFolderName) {
error = new Error(consts.UNKNOWN_ASSETS_FOLDER_NAME);
error.status = 422;
callback(error, null);
} else if(!binaryData) {
error = new Error(consts.UNKNOWN_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function uploadToS3(fileBuffer) {\n var params = {\n ACL: 'public-read',\n Bucket: 'edugator-items',\n Key: Date.now().toString(),\n Body: fileBuffer,\n }\n\n return s3.upload(params).promise()\n}",
"function postUploadToS3(file) {\n let s3bucket = new AWS.S3({\n accessKeyId: process.env.AWS_U... | [
"0.69583446",
"0.69166535",
"0.68937606",
"0.67206144",
"0.6546076",
"0.64495283",
"0.63796264",
"0.63684404",
"0.63607186",
"0.6341726",
"0.6329543",
"0.62487525",
"0.6223948",
"0.6217618",
"0.61737657",
"0.6155421",
"0.61124146",
"0.60754406",
"0.60602117",
"0.6057445",
"0.... | 0.707508 | 0 |
1.1.5 processInvoiceLines(); places XML file into array and passes variables to split function | function processInvoiceLines(type)
{
nlapiLogExecution('error', 'type', type);
var process='FALSE';
// load the audit record (which contains the XML payload).
loadAuditRecord(type);
if(auditRec.getFieldValue('custrecord_processed')=='FALSE')
{
loadParameters();
// load the xml from the audi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getInvoiceLineDetails()\r\n{\r\n\r\n\t//========================================\r\n\t// items\r\n\t//========================================\r\n\tif(invoiceElement.indexOf('<ServiceCode>')!=-1)\r\n\t{\r\n\t\titemObj=new Object();\r\n\t\titemObj.code= splitOutValue(invoiceElement,'ServiceCode');\r\n\t}\r... | [
"0.618007",
"0.5386681",
"0.5342829",
"0.531445",
"0.5269244",
"0.523834",
"0.5167356",
"0.5161571",
"0.51548797",
"0.50846255",
"0.5080212",
"0.50543976",
"0.50251603",
"0.5017004",
"0.4976475",
"0.4962611",
"0.49534187",
"0.49300182",
"0.49226436",
"0.49120608",
"0.48848793... | 0.6231054 | 0 |
load the audit record which also contains the xml payload | function loadAuditRecord(type)
{
var recordID = nlapiGetRecordId();
auditRec = nlapiLoadRecord('customrecord_xml_load_audit', recordID);
nlapiLogExecution('DEBUG', 'xml', auditRec.getFieldValue('custrecord_payload'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getAndProcessAuditData() {\n \tlet input = document.createElement('input');\n \tinput.type = 'file';\n\n\tinput.onchange = e => { \n\n \t// get the file reference\n \tlet file = e.target.files[0]; \n\n \t// set up FileReader\n \tlet reader = new FileReader();\n \treader.readAsText(file,'U... | [
"0.5158072",
"0.505207",
"0.4990007",
"0.48949185",
"0.48156184",
"0.47457108",
"0.47361234",
"0.47071165",
"0.4651445",
"0.46185592",
"0.45822424",
"0.4581192",
"0.45657992",
"0.45502594",
"0.4550231",
"0.45338818",
"0.4522809",
"0.4506829",
"0.44865218",
"0.4480943",
"0.448... | 0.7439427 | 0 |
load parameters for the script 1.1.4 ignore large invoice charge bands 1.1.5 introduce location specific 'ignore large invoice' logic | function loadParameters()
{
try
{
COSAccrualID = nlapiGetContext().getSetting('SCRIPT', 'custscript_cos_accrual_intid');
medicalSuppliesID = nlapiGetContext().getSetting('SCRIPT', 'custscript_medical_accrual_intid');
surgeonAccrualID = nlapiGetContext().getSetting('SCRIPT', 'custscript_consultant_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function loadParam(startDate, endDate) {\n param = {};\n if (Banana.document) {\n param = {\n \"scriptVersion\": \"20180529\",\n \"headerLeft\": Banana.document.info(\"Base\", \"HeaderLeft\"),\n \"vatNumber\": Banana.document.info(\"AccountingDataBase\", \"VatNumber\")... | [
"0.6095154",
"0.562111",
"0.53270394",
"0.5217243",
"0.5178128",
"0.5129925",
"0.50765514",
"0.50301605",
"0.5027566",
"0.50131863",
"0.49865687",
"0.49661553",
"0.4933689",
"0.4917972",
"0.48973626",
"0.4892931",
"0.48895237",
"0.48884898",
"0.48731008",
"0.4871035",
"0.4859... | 0.65364945 | 0 |
post invoice details to netsuite 1.0.9 remove journals for failures 1.1.1 amended trap invalid subsidiary error: Invalid location reference | function postInvoiceIntoNetsuite()
{
var entity='';
var item='';
var auditDesc='Success';
var dateInvoice = null;
var errorMessage = '';
// location (clinic) is based on the message sender name in the DGL XML invoice
if(debug == true)
{
journalLocationID = lookupLocation(msgSender);
}
e... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function removeJournals()\r\n{\r\n\t\r\n\ttry\r\n\t{\r\n\t\tfor(var x=0; x<=journalIntIds.length-1;x++)\r\n\t\t{\r\n\t\t\tvar id = nlapiDeleteRecord('journalentry', journalIntIds[x]);\r\n\t\t}\r\n\r\n\t\tnlapiLogExecution('AUDIT', 'Journals removed: ', journalNumbers);\r\n\t}\r\n\r\n\tcatch(e)\r\n\t{\r\n\t\terrorH... | [
"0.6155656",
"0.6139541",
"0.5835612",
"0.57648367",
"0.5676872",
"0.56611603",
"0.5592074",
"0.55702156",
"0.55640864",
"0.5554033",
"0.5538457",
"0.55062616",
"0.55037487",
"0.54957926",
"0.5469929",
"0.5418305",
"0.5409591",
"0.5404294",
"0.53791785",
"0.53761274",
"0.5367... | 0.76010686 | 0 |
set invoice header details | function invoiceHeader()
{
invoiceRecord = nlapiCreateRecord("invoice");
// set internal ID for Optegra form 137
invoiceRecord.setFieldValue('customform', optegraInvoiceForm);
invoiceRecord.setFieldValue('tranid', invoiceNo);
invoiceRecord.setFieldValue('recordtype', 'invoice');
// invoiceRecor... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addPageHeader(invoiceObj, repDocObj, repStyleObj, param, texts) {\n\n // Page header\n if (repDocObj === undefined || repStyleObj === undefined)\n return;\n\n /***********\n LOGO\n ***********/\n var headerLogoSection = repDocObj.addSection(\"\");\n if (param.print_logo) {\n //Check the ver... | [
"0.7191028",
"0.6624187",
"0.6604705",
"0.66003853",
"0.65675306",
"0.6506118",
"0.6501749",
"0.64994234",
"0.6495422",
"0.64560837",
"0.6442919",
"0.643039",
"0.6430294",
"0.64254135",
"0.63758576",
"0.63433343",
"0.63253945",
"0.6292712",
"0.62840503",
"0.6280184",
"0.62147... | 0.7847622 | 0 |
set invoice line item details 1.1.2 16/8/2012 add consumable pack cost to tran | function invoiceDetailLine(x)
{
itemObj = itemsArray[x];
item = lookupItem(itemObj.code); // lookup item
invoiceRecord.selectNewLineItem('item');
invoiceRecord.setCurrentLineItemValue('item', 'item', item);
invoiceRecord.setCurrentLineItemValue('item', 'description', itemObj.desc);
invoiceReco... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addItemToBasket()\r\n{\r\n\r\n\tvar amount = 0;\r\n\tvar vatAmount = 0;\r\n\tvar priceEXVat=0;\r\n\tvar response = true;\r\n\tvar desc='';\r\n\tvar iCode = '';\r\n\r\n\r\n\ttry\r\n\t{\r\n\t\tnlapiSelectNewLineItem('item');\r\n\t\tnlapiSetCurrentLineItemValue('item', 'item', givenItem, false, true);\r\n\r\... | [
"0.6448783",
"0.64004284",
"0.6213053",
"0.6187894",
"0.60405684",
"0.6038297",
"0.6026474",
"0.6006944",
"0.60042864",
"0.5964772",
"0.59550494",
"0.594886",
"0.593874",
"0.59342545",
"0.5864733",
"0.5770707",
"0.57484764",
"0.5730532",
"0.5729734",
"0.56769705",
"0.5667142"... | 0.74424016 | 0 |
post journals for surgeon and anaesthnatist zzz fixed nominal codes require revision 1.0.6 added journal post for deferred revenue | function journalPosts()
{
var today = new Date();
var desc='';
var objServDate = nlapiStringToDate(serviceDate);
// journal for deferred revenue - this is where the procedure happens in the future
if(objServDate > today)
{
nlapiLogExecution('DEBUG', 'future post', 'future post');
journal... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function journalPostsFuture()\r\n{\r\n\r\n\tvar desc='';\r\n\t\r\n\t// journal for surgeon\r\n\tif(itemObj.surgeonAmount != 0)\r\n\t{\r\n\t\tdesc = 'Surgeon commission (future) for invoice ' + invoiceNo;\r\n\t\tcreateJournal(itemObj.surgeonAmount, COSAccrualID, surgeonAccrualID, journalDeptID, journalLocationID, j... | [
"0.74455476",
"0.5797087",
"0.5631199",
"0.5318566",
"0.51449734",
"0.51117414",
"0.50758314",
"0.5055104",
"0.5038119",
"0.5005621",
"0.49977222",
"0.49965084",
"0.4994777",
"0.49470487",
"0.4943326",
"0.49382392",
"0.4912538",
"0.49100548",
"0.49078175",
"0.49059302",
"0.48... | 0.75462383 | 0 |
post journals for surgeon and anaesthnatist etc 1.0.8 deals with future posts | function journalPostsFuture()
{
var desc='';
// journal for surgeon
if(itemObj.surgeonAmount != 0)
{
desc = 'Surgeon commission (future) for invoice ' + invoiceNo;
createJournal(itemObj.surgeonAmount, COSAccrualID, surgeonAccrualID, journalDeptID, journalLocationID, journalSubsidiary,journalClass, i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function journalPosts()\r\n{\r\n\r\n\tvar today = new Date();\r\n\tvar desc='';\r\n\r\n\tvar objServDate = nlapiStringToDate(serviceDate);\r\n\t\r\n\t// journal for deferred revenue - this is where the procedure happens in the future\r\n\t\t\r\n\tif(objServDate > today)\r\n\t{\r\n\t\tnlapiLogExecution('DEBUG', 'fu... | [
"0.70975363",
"0.56693935",
"0.56557703",
"0.56551194",
"0.5637193",
"0.5585272",
"0.55150676",
"0.5511942",
"0.549335",
"0.5484495",
"0.5437948",
"0.5408167",
"0.5393703",
"0.5295298",
"0.5256396",
"0.52529377",
"0.5247834",
"0.52353996",
"0.5230448",
"0.5221784",
"0.5205857... | 0.69638866 | 1 |
get invoice header details 1.0.9 memo populated 1.1.0 live modification made 4/7/2012 use charge band rather than chargeband name | function getInvoiceHeaderDetails()
{
//msg details
if(invoiceElement.indexOf('<MsgID>') != -1)
{
msgID = splitOutValue(invoiceElement, 'MsgID');
}
if(invoiceElement.indexOf('<MsgSenderLicenseName>') != -1)
{
msgSender = splitOutValue(invoiceElement, 'MsgSenderLicenseName');
}
if(invoiceElem... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function invoiceHeader()\r\n{\r\n\r\n\r\n\tinvoiceRecord = nlapiCreateRecord(\"invoice\");\r\n\t\r\n\t// set internal ID for Optegra form 137\r\n\tinvoiceRecord.setFieldValue('customform', optegraInvoiceForm); \r\n\t\r\n\tinvoiceRecord.setFieldValue('tranid', invoiceNo);\r\n\tinvoiceRecord.setFieldValue('recordtyp... | [
"0.7309001",
"0.6503332",
"0.6120914",
"0.5916368",
"0.5883264",
"0.58133703",
"0.5773502",
"0.5771731",
"0.576186",
"0.5758645",
"0.575102",
"0.57469326",
"0.57292306",
"0.57292306",
"0.5655896",
"0.5636552",
"0.5636552",
"0.5636552",
"0.5636552",
"0.5622535",
"0.5619439",
... | 0.77779937 | 0 |
check and set for large NHS Invoice 1.1.4 added check for large NHS Invoice 1.1.5 amended introduce location specific for 'ignore invoices' | function checkIfInvoiceIsLargeNHS()
{
var cbCheck = '';
cbCheck = "," + chargeBand + ",";
if(msgSender=='Optegra Yorkshire')
{
if(largeinvoiceChargeBandsYorkshire.indexOf(cbCheck) != -1)
{
largeInvoice = true;
}
}
else
{
if(largeinvoiceChargeBands.indexOf(cbCheck) != -1)
{
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function processInvoiceLines(type)\r\n{\r\n\t\r\n\tnlapiLogExecution('error', 'type', type);\r\n\t\r\n\tvar process='FALSE';\r\n\t// load the audit record (which contains the XML payload).\r\n\tloadAuditRecord(type);\r\n\r\n\tif(auditRec.getFieldValue('custrecord_processed')=='FALSE')\r\n\t{\r\n\t\tloadParameters(... | [
"0.5723444",
"0.54099804",
"0.53726554",
"0.5321757",
"0.51771724",
"0.5154634",
"0.51500386",
"0.5128431",
"0.5125968",
"0.5102981",
"0.509244",
"0.5069041",
"0.5057511",
"0.50399673",
"0.4994156",
"0.49895898",
"0.4899145",
"0.48956746",
"0.4893732",
"0.48900113",
"0.488731... | 0.6938148 | 0 |
create journal entries for consultants 1.0.3 reversed the from and too accounts as DR and CR were the wrong way around 1.0.5 added set class field | function createJournal(totalValue, toAcc, fromAcc, dept, location, subsidiary, jClass, invDate, Desc)
{
var dateInvoice = null;
var journal = '';
//var id = null;
try
{
// get the journal record
var journalRecord = nlapiCreateRecord('journalentry');
// get todays date and put the soDate into a ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Journal(date) {\n this.date = date\n}",
"function Journal() {\n this.places = {};\n this.currentId = 0;\n}",
"function journalPost(date,title,entry){\nthis.date=date;\nthis.title=title;\nthis.text=entry;\n}",
"function makeJournalEntry(journalEntries) {\n journalEntries.forEach((entry) => ... | [
"0.59865904",
"0.5974071",
"0.594941",
"0.59369695",
"0.5645432",
"0.5552122",
"0.54748833",
"0.5383602",
"0.53047365",
"0.52275544",
"0.516739",
"0.5105892",
"0.50748575",
"0.50688845",
"0.5053076",
"0.5024476",
"0.49889225",
"0.4930197",
"0.49097905",
"0.48962885",
"0.48722... | 0.661192 | 0 |
create a customer 1.0.9 lookup charge band 1.1.0 status required [todo] customer closed won | function createCustomer()
{
var custID=0;
var name='';
var locationIntId = 0;
var parentCustIntId = 0;
var locationName='';
try
{
newCust = nlapiCreateRecord('customer');
//name = title + ' ' + givenName + ' ' + familyName;
//Set the title field on the Customer record
newCust.setFieldVa... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function lookupChargeBand(band, clinicName)\r\n{\r\n\tvar customerID=0;\r\n\r\n\t// Arrays\r\n\tvar cbSearchFilters = new Array();\r\n\tvar cbSearchColumns = new Array();\r\n\r\n\ttry\r\n\t{\r\n\t\t\r\n\t\tnlapiLogExecution('DEBUG', 'looking up charge band', band + ':' + clinicName);\r\n\t\t\r\n\t\t\r\n\t\t//searc... | [
"0.6225864",
"0.6020526",
"0.60171354",
"0.577589",
"0.56014717",
"0.5595846",
"0.5519421",
"0.5441369",
"0.5439458",
"0.52922016",
"0.5237424",
"0.5229118",
"0.5222442",
"0.52190876",
"0.52118963",
"0.5210011",
"0.5208618",
"0.5200594",
"0.5196443",
"0.51868546",
"0.5135693"... | 0.7333032 | 0 |
fix internal location ID based on Hospital [todo] this will need to be changed to be a lookup 1.1.3 London added | function lookupLocation(hospitalDesc)
{
/*
?Optegra Birmingham?
?Optegra Guildford?
?Optegra Solent?
?Optegra Manchester?
?Optegra Yorkshire? */
nlapiLogExecution('DEBUG', 'lookuplocation', hospitalDesc);
try
{
var hospitalInternalID=0;
hospitalInternalID = 23;
if(hospitalDesc=='Opte... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function lookupLocationLive(hospitalDesc)\r\n{\r\n\t/*\r\n\t?Optegra Birmingham?\r\n\t?Optegra Guildford?\r\n\t?Optegra Solent?\r\n\t?Optegra Manchester?\r\n\t?Optegra Yorkshire? */\r\n\r\n\ttry \r\n\t{\r\n\t\tvar hospitalInternalID=0;\r\n\t\thospitalInternalID = 24;\r\n\r\n\t\tif(hospitalDesc=='Optegra Birmingham... | [
"0.65977246",
"0.5775182",
"0.56867564",
"0.56160605",
"0.5557439",
"0.5498575",
"0.54524106",
"0.5421428",
"0.5357937",
"0.52599657",
"0.51657635",
"0.51636463",
"0.51592803",
"0.5153534",
"0.51496994",
"0.51344806",
"0.5116332",
"0.5113088",
"0.51120114",
"0.51088",
"0.5090... | 0.68541205 | 0 |
fix internal location ID based on Hospital [todo] this will need to be changed to be a lookup 1.1.3 London added | function lookupLocationLive(hospitalDesc)
{
/*
?Optegra Birmingham?
?Optegra Guildford?
?Optegra Solent?
?Optegra Manchester?
?Optegra Yorkshire? */
try
{
var hospitalInternalID=0;
hospitalInternalID = 24;
if(hospitalDesc=='Optegra Birmingham')
{
hospitalInternalID=24;
}
if(h... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function lookupLocation(hospitalDesc)\r\n{\r\n\t/*\r\n\t?Optegra Birmingham?\r\n\t?Optegra Guildford?\r\n\t?Optegra Solent?\r\n\t?Optegra Manchester?\r\n\t?Optegra Yorkshire? */\r\n\r\n\tnlapiLogExecution('DEBUG', 'lookuplocation', hospitalDesc);\r\n\t\r\n\ttry \r\n\t{\r\n\t\tvar hospitalInternalID=0;\r\n\t\thospi... | [
"0.6854514",
"0.5776318",
"0.5685982",
"0.56161755",
"0.5556559",
"0.5499644",
"0.54509723",
"0.54210603",
"0.53594965",
"0.5260217",
"0.5166436",
"0.51651937",
"0.5160155",
"0.5153017",
"0.514928",
"0.51370203",
"0.51170546",
"0.511407",
"0.5110502",
"0.511037",
"0.50928617"... | 0.6598375 | 1 |
lookup charge band example usage: lookupChargeBand(2,'1400 Manchester'); 1.0.9 added | function lookupChargeBand(band, clinicName)
{
var customerID=0;
// Arrays
var cbSearchFilters = new Array();
var cbSearchColumns = new Array();
try
{
nlapiLogExecution('DEBUG', 'looking up charge band', band + ':' + clinicName);
//search filters
cbSearchFilters[0]... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getBand(name) {\n return bands.find(function (band){\n return band.name === name;\n });\n}",
"function lookup(json) {\n\n postcode = json;\n\n var getcode = null;\n\n if(typeof arguments[1] === 'string') {\n\n getcode = arguments... | [
"0.5926763",
"0.5386793",
"0.537592",
"0.53447866",
"0.5284579",
"0.5249394",
"0.49885783",
"0.49507758",
"0.4923005",
"0.4907254",
"0.48481897",
"0.4830389",
"0.48259014",
"0.48248318",
"0.47514805",
"0.4734278",
"0.4725485",
"0.4725485",
"0.4709951",
"0.47062352",
"0.469877... | 0.76920855 | 0 |
reverse date i.e. 20120517 to 17.05.2012 1.0.9 remove leading zeros from days and months or nlapistringtodate fails | function reverseDate(dateStr)
{
var retVal = null;
var day='';
var month='';
var year = '';
var newDate='';
year = dateStr.substring(0,4);
month = dateStr.substring(4,6);
day = dateStr.substring(6,8);
if(day.substring(0,1)=='0')
{
day = day.substring(1,2);
}
if(month.substring(0,1)==... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function reverseDate(date) {\n listOfChars = date.split('').reverse().join('')\n return listOfChars;\n}",
"function reverse_date(inputdate){\n let brokendate = inputdate.replace(\",\", \"\").split(' ');\n const months = [\"Jan.\", \"Feb.\", \"March\", \"April\", \"May\", \"June\", \"July\", \"Aug.\", \"S... | [
"0.7157842",
"0.7063634",
"0.68436015",
"0.6609228",
"0.6609228",
"0.65709317",
"0.65508807",
"0.648003",
"0.6428817",
"0.6391386",
"0.63797843",
"0.6364069",
"0.6328993",
"0.63074213",
"0.62741685",
"0.6232272",
"0.62109804",
"0.62074834",
"0.6199004",
"0.6160042",
"0.615287... | 0.7553253 | 0 |
remove journals where the invoice fails to post 1.0.9 remove journals for failures | function removeJournals()
{
try
{
for(var x=0; x<=journalIntIds.length-1;x++)
{
var id = nlapiDeleteRecord('journalentry', journalIntIds[x]);
}
nlapiLogExecution('AUDIT', 'Journals removed: ', journalNumbers);
}
catch(e)
{
errorHandler(e);
nlapiLogExecution('AUDIT', 'Journals rem... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function purgeJunkUnhandledJoints() {\n\tif (bCatchingUp || Date.now() - coming_online_time < 3600 * 1000)\n\t\treturn;\n\n\tdb.query(\"DELETE FROM unhandled_joints WHERE creation_date < \" + db.addTime(\"-1 HOUR\"), function () {\n\t\tdb.query(\"DELETE FROM dependencies WHERE NOT EXISTS (SELECT * FROM unhandled_j... | [
"0.5119236",
"0.49779442",
"0.4971656",
"0.49321142",
"0.49188974",
"0.48916715",
"0.48814303",
"0.4855074",
"0.48545897",
"0.48211455",
"0.48101276",
"0.4804344",
"0.47383994",
"0.47256985",
"0.46993276",
"0.46984226",
"0.46940476",
"0.46444717",
"0.46342048",
"0.4625183",
"... | 0.7571198 | 0 |
looks up item internal ID from item name 1.0.5 class looked up from item 1.1.1 changed income_acc_intid to be looked up from item rather than being a fixed parameter | function lookupItem(itemID)
{
var internalID='';
// Arrays
var itemSearchFilters = new Array();
var itemSearchColumns = new Array();
try
{
//search filters
itemSearchFilters[0] = new nlobjSearchFilter('itemid', null, 'is', itemID);
// return columns
itemSearchCo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getMyId(item)\n { \n var mbr = item.attr(\"id\");\n var res = mbr.split(\"mbr_chs_\");\n return Number(res[1]);\n }",
"function getID(arg)\r\n{\r\n var counter = 0;\r\n while(items[counter].name != arg)\r\n {\r\n counter++;\r\n }\r\n\r\n return items[co... | [
"0.6652438",
"0.6086297",
"0.5993583",
"0.59601194",
"0.58458245",
"0.57948256",
"0.57110715",
"0.5692026",
"0.5678089",
"0.56141716",
"0.56119007",
"0.5597914",
"0.55663335",
"0.5563465",
"0.55607957",
"0.5539191",
"0.5468082",
"0.5429282",
"0.5405514",
"0.53888834",
"0.5351... | 0.72240156 | 0 |
send signed order parameters to alipay gateway | function sendAlipayOrder(signedTrans, methodType, cb) {
let alipayUrl = config.ALIPAY_GATEWAY + signedTrans;
let replyParams = {};
request(alipayUrl, function (error, res, body) {
if (!error && res.statusCode == 200) {
var JSONParams = JSON.parse(body);
if (methodType =... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sign(account, destination, currency, value, secretKey){\n\tlet json = '{\"id\": 9,\"command\": \"sign\",\"tx_json\": {\"TransactionType\": \"Payment\",\"Account\": \"' + account + '\",\"Destination\": \"' + destination + '\",\"Amount\": {\"currency\": \"' + currency + '\",\"value\": \"' + value + '\",\"is... | [
"0.63185096",
"0.6282593",
"0.60636175",
"0.58701885",
"0.5808245",
"0.5754894",
"0.5752112",
"0.5751873",
"0.5742093",
"0.57149535",
"0.5707113",
"0.5693291",
"0.56813854",
"0.56693584",
"0.56196433",
"0.55987394",
"0.55987394",
"0.5578378",
"0.5555856",
"0.55251986",
"0.550... | 0.6379692 | 0 |
checks if a URL is a link to an AWS Marketplace report | function isReportUrl(string){
var awsURLmatcher = /^\w+:\/\/aws-marketplace-reports\.s3\.amazonaws\.com\S*/m
var match = string.match(awsURLmatcher)
return match ? match[0] : ''
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static isExternalLink(link) {\n\t\t\tif (Story.has(link)) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tconst urlRegExp = new RegExp(`^${Patterns.url}`, 'gim');\n\t\t\treturn urlRegExp.test(link) || /[\\/\\.\\?#]/.test(link);\n\t\t}",
"function isUrlExternal(match) {\n return (match.indexOf('http://') !== -1 || ... | [
"0.6589243",
"0.6498892",
"0.6487373",
"0.617914",
"0.6163647",
"0.6094713",
"0.60556984",
"0.6048096",
"0.60431683",
"0.603632",
"0.60213226",
"0.6006433",
"0.5959998",
"0.59566075",
"0.5956259",
"0.5901068",
"0.5895952",
"0.5832941",
"0.58159244",
"0.5812521",
"0.58062017",... | 0.74622595 | 0 |
HELPER TO BUILD PARTIAL MESSAGE FOR PRODUCTS the function returns a message corresponding to the number of products of a customer | function partialMessage(resp) {
let products = "";
let temp = "";
let counter = 1;
// run through the products list
resp.forEach(prod => {
console.log(prod);
// if there is only one product then exist the loop
if (resp.length === 1) {
products = prod;
return products;
} else {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function partialMessage(resp) {\n let products = \"\";\n let temp = \"\";\n let counter = 1;\n\n // run through the products list\n resp.forEach(prod => {\n console.log(prod);\n // if there is only one product then exist the loop\n if (resp.length === 1) {\n products = prod;\n return produc... | [
"0.7000041",
"0.5647563",
"0.56307185",
"0.5600704",
"0.55806595",
"0.5475728",
"0.54663837",
"0.54590565",
"0.5446062",
"0.5442002",
"0.5434053",
"0.54254204",
"0.5411551",
"0.54010135",
"0.5362217",
"0.535921",
"0.5349941",
"0.5319429",
"0.52708185",
"0.5270012",
"0.5266328... | 0.7113856 | 0 |
Checks the operation for the presences of a consumes | function hasConsumes(operation, consumes) {
return isObject(operation) && Array.isArray(operation.consumes) && operation.consumes.some( c => c === consumes)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"active () {\n return this.consumers > 0\n }",
"function checkOperationConsumes(targetVal) {\n const { paths } = targetVal;\n const errors = [];\n if (paths && typeof paths === 'object') {\n Object.keys(paths).forEach((path) => {\n ['post', 'put'].forEach((method) => {\n if (paths[path][... | [
"0.5577566",
"0.552941",
"0.5269728",
"0.52626973",
"0.51945263",
"0.51945263",
"0.51558954",
"0.51484966",
"0.5100892",
"0.50600356",
"0.5056819",
"0.5013812",
"0.49912998",
"0.49776348",
"0.49443895",
"0.4939995",
"0.49383304",
"0.49092066",
"0.4899954",
"0.489597",
"0.4816... | 0.7816114 | 0 |
If a paramter with `in: formData` exists, a param with `in: body` cannot | function assertationOne(params, path) {
// Assertion 1
const inBodyIndex = params.findIndex(p => isObject(p) && p["in"] === "body")
const formData = params.filter(p => isObject(p) && p["in"] === "formData")
const hasFormData = !!formData.length
if(~inBodyIndex && hasFormData) {
// We"ll blame... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function parseBodyParam (req, res, next) {\n let params = getParams(req);\n\n params.some((param) => {\n if (param.in === \"body\") {\n util.debug(' Parsing the \"%s\" body parameter', param.name);\n\n if (_.isPlainObject(req.body) && _.isEmpty(req.body)) {\n if (param.type === \"string\" ... | [
"0.6223197",
"0.57420605",
"0.5741199",
"0.57400423",
"0.57243127",
"0.567523",
"0.56123614",
"0.56123614",
"0.56123614",
"0.56123614",
"0.56123614",
"0.56123614",
"0.56123614",
"0.56123614",
"0.56123614",
"0.56123614",
"0.56123614",
"0.56123614",
"0.56123614",
"0.56123614",
... | 0.669903 | 0 |
If a parameter with `type: file` exists a. It must have `in: formData` b. The consumes property must have `multipart/formdata` | function assertationTwo(params, path, operation) {
const typeFileIndex = params.findIndex(p => isObject(p) && p.type === "file")
// No type: file?
if(!~typeFileIndex) {
return
}
let hasErrors = false
const param = params[typeFileIndex]
const pathStr = [...path, typeFileIndex].join("."... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"formdata (formdata, next) {\n // ensure that we only process the file type\n async.eachSeries(_.filter(formdata.all(), { type: 'file' }), function (formparam, callback) {\n if (!formparam || formparam.disabled) {\n return callback(); // disabl... | [
"0.64790595",
"0.64165056",
"0.61762416",
"0.61762416",
"0.61762416",
"0.61762416",
"0.61762416",
"0.61762416",
"0.61762416",
"0.61762416",
"0.61762416",
"0.61762416",
"0.61762416",
"0.61762416",
"0.61762416",
"0.61762416",
"0.6085215",
"0.59652627",
"0.59109116",
"0.5889346",
... | 0.69186264 | 0 |
Traverse down peer chain to get open position. Note: this requires peer position graph to be built | getOpenPosition() {
if (this.isOpenPosition()) {
return this
}
let t = this.peer()
while (t && !t.isOpenPosition()) {
t = t.peer()
}
return t
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getShortestPath() {\n /**\n * Find source to begin traverse or \n * can we iterate and works when source dounds?\n */\n let {\n matrixMap, \n sourcePoint, \n destPoint\n } = this.getMapWithConnectedEdges();\n\n /* Validating proce... | [
"0.5346806",
"0.53300345",
"0.5239403",
"0.5196994",
"0.51193535",
"0.5104834",
"0.50861764",
"0.505385",
"0.5040249",
"0.50209564",
"0.4988588",
"0.49855953",
"0.4977395",
"0.4930064",
"0.49044666",
"0.4901441",
"0.48955214",
"0.48948926",
"0.48757687",
"0.48744756",
"0.4849... | 0.7176695 | 0 |
Split a close position against multiple open positions | split(peers) {
if (!this.isClosePosition) {
throw new Error("Cannot split a non-close position")
}
if (this.id) {
throw new Error("Cannot split saved position: " + this.id)
}
if (this.openTradeId) {
console.dir(this)
throw new Err... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"split () {\n const directions = this.getChildDirections()\n\n if (this.range === 1) {\n return this.getAllDirections()\n .map(([ dx, dy, dz ]) => [ this.x + dx, this.y + dy, this.z + dz ])\n .map(center => new Cube(center, 0))\n }\n\n return directions\n .map(coords => coords.ma... | [
"0.55835766",
"0.5501988",
"0.5473982",
"0.5473982",
"0.5411901",
"0.5402933",
"0.53333306",
"0.5252784",
"0.52145463",
"0.5195396",
"0.51393",
"0.51393",
"0.51393",
"0.50857294",
"0.50669885",
"0.5062833",
"0.50589794",
"0.50472194",
"0.50472194",
"0.50472194",
"0.5025709",
... | 0.62796754 | 0 |
Triggered when table creates cell (td). Note: this is called only at creation time. | function onCreateCell(cell, cellData, rowData, rowIndex, colIndex){
jQuery(cell).attr('data-fieldname', columns[colIndex].name);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function cell() {\n\t\tvar td = $(\"<td>\");\n\t\trow.append(td);\n\t\treturn td;\n\t}",
"function renderCell(cellData) {\n // variable that holds a reference to a new td created each time a new data set is added to firebase\n let newTD = $(\"<td>\");\n // sets the text of the ne... | [
"0.65879077",
"0.6563992",
"0.64994675",
"0.63241786",
"0.63160574",
"0.62973523",
"0.6222624",
"0.62125397",
"0.61674213",
"0.61674213",
"0.61653465",
"0.6160684",
"0.61352265",
"0.60823494",
"0.6068757",
"0.6048703",
"0.60458785",
"0.60458785",
"0.590411",
"0.5902874",
"0.5... | 0.66823715 | 0 |
Triggers animation of pricechange for given row. | function animatePriceChange($row, stock){
var $cell = $row.children('[data-fieldname="current_price"]');
var animationName;
if(stock.get('current_price') > stock.get('previous_price')){
$cell.addClass('priceUp');
animationName = 'priceUpFlash';
} else if(stock.get('current_price') < stock.get... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"handleRowClick(row, event) {\n if (row !== this.state.selectedRow) {\n const rowElement = $(event.target).closest(\n 'div[data-display=\"table-row\"]',\n );\n let { top } = rowElement.position();\n top += 23;\n this.setState({ top });\n this.setSelectedRoom(row);\n this... | [
"0.57852405",
"0.57762766",
"0.5503126",
"0.549227",
"0.5486406",
"0.5377308",
"0.53513855",
"0.534179",
"0.5326049",
"0.52954865",
"0.5261855",
"0.52610236",
"0.52609956",
"0.52553725",
"0.52265364",
"0.5221822",
"0.52100265",
"0.51332533",
"0.512205",
"0.5103187",
"0.508387... | 0.7702125 | 0 |
Applying a perspective to a point (x,y) means: x' = (H11 x + H12 y + H13) / (H31 x + H32 y + H33) y' = (H21 x + H22 y + H23) / (H31 x + H32 y + H33) (matrix index notation) | function applyPerspectiveToPoint_x(x, y, H) {
return (H[0][0]*x + H[0][1]*y + H[0][2])/(H[2][0]*x + H[2][1]*y + H[2][2]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function perspective(l, r, t, b, n, f) {\r\n\r\n\t// Assuming that l = -r, b = -t, \r\n \tvar persp = [n/r, 0, 0, 0,\r\n 0, n/t, 0, 0,\r\n 0, 0, (-(f + n)/(f - n)), -1,\r\n 0, 0, ((-2*f*n)/(f - n)), 0];\r\n ... | [
"0.7231194",
"0.70804197",
"0.7075378",
"0.70437956",
"0.6919109",
"0.67786294",
"0.6614841",
"0.65103304",
"0.65090597",
"0.6344376",
"0.62785226",
"0.62783056",
"0.6232067",
"0.6188243",
"0.61805224",
"0.5964087",
"0.59573466",
"0.59088105",
"0.58953035",
"0.58864176",
"0.5... | 0.77816355 | 0 |
NodeRules would probably allow us to pass the object from the callback function back into the rule engine, but I created this function to create a fact that only has the variables needed to create the story. createFact gets called once with no parameters and another with a single object parameter with additional variab... | function createFact({
protagonist = new c.Character("John", "FooBar"),
world = new w.World(),
flags = {},
currentRuleFiles = [],
characters = {},
output = [],
debug = {},
events = [],
currentJob = null,
lastEvent = null
} = {}) {
var fact = {};
fact.protagonist = protagon... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createData(step, location, action, dirtCollected, wallsHit) {\n return { step, location, action, dirtCollected, wallsHit };\n}",
"[factorify](name, definition) {\n const properties = Object.keys(definition);\n const required = new Set(properties.filter(p => definition[p].required));\n const ... | [
"0.5124574",
"0.5066198",
"0.49279836",
"0.48669145",
"0.48083642",
"0.4734933",
"0.4721533",
"0.47196683",
"0.47169185",
"0.4702497",
"0.46667796",
"0.46652",
"0.46521208",
"0.46504235",
"0.46223977",
"0.4608018",
"0.45951402",
"0.45874506",
"0.45753586",
"0.45694417",
"0.45... | 0.6365698 | 0 |
Chat controller for a AIM | function AimChatController() {
ExternalChatBaseController.call(this);
/**
* Chat message ID generator
* @type {ChatMessageIdService}
*/
this.chatMessageId = new ChatMessageIdService();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"handleChat(text) {\n this.room.broadcast({\n name: this.name,\n type: 'chat',\n text: text\n });\n }",
"function initiateChat(p, id, o) {\r\n\tparticipant = p;\r\n\tif (o)\r\n\t\toriginator = o;\r\n\tvar chat = getElement('chat_frame');\r\n\tchat.style.display = ... | [
"0.6654064",
"0.6350491",
"0.6319119",
"0.63173485",
"0.62763566",
"0.62646353",
"0.6232498",
"0.6229558",
"0.61746246",
"0.61567944",
"0.61458707",
"0.61199045",
"0.61100847",
"0.6104306",
"0.6068512",
"0.60042727",
"0.5994209",
"0.5983261",
"0.5979471",
"0.5960051",
"0.5947... | 0.7520966 | 0 |
Create the function for the county class breaks renderer | function countyRenderer(field, classField) {
//Insert the selected field into the legend text function
var text = legendText(field); //Parameters for the class breaks renderer
var params = {
layer: county,
field: field,
basemap: map.basemap,
classificationMethod: classField,
n... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onCountyChange() {\n const state = this.stateSelector.options[this.stateSelector.selectedIndex].value;\n const co = this.countySelector.options[this.countySelector.selectedIndex].value;\n const ops = getCityOptionsByStateIdAndCounty(state, co);\n populateOptions(this.citySelector, ops, '');\n ... | [
"0.61000717",
"0.60688514",
"0.5998769",
"0.587195",
"0.5793735",
"0.56934875",
"0.5681188",
"0.5646438",
"0.5616166",
"0.55927664",
"0.5484093",
"0.5446894",
"0.5424765",
"0.5394771",
"0.5394435",
"0.5380713",
"0.5365638",
"0.534775",
"0.5346973",
"0.53270733",
"0.5317249",
... | 0.70451474 | 0 |
Get a line function with 'interpolation' interpolation ('linear', 'cardinal', 'stepbefore', etc.) | function getLine(interpolation, tension, xfn, yfn) {
return d3.svg.line()
.x(function(d,i) { return xfn(i); })
.y(function(d) { return -1 * yfn(d); })
.interpolate(interpolation)
.tension(tension);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function lineInterpolate(line) {\n var _line = _slicedToArray(line, 2),\n _line$ = _slicedToArray(_line[0], 2),\n x1 = _line$[0],\n y1 = _line$[1],\n _line$2 = _slicedToArray(_line[1], 2),\n x2 = _line$2[0],\n y2 = _line$2[1];\n\n var x = function x(v) {\n retur... | [
"0.724399",
"0.66872203",
"0.6182656",
"0.60529375",
"0.60529375",
"0.6029679",
"0.6029679",
"0.6029679",
"0.5982624",
"0.5895816",
"0.5866656",
"0.58306265",
"0.57593733",
"0.5752721",
"0.57442427",
"0.57325304",
"0.57161343",
"0.56924444",
"0.5643312",
"0.5636091",
"0.56206... | 0.7304451 | 0 |
Draw a graphs labels given its x function, y function, maxX value, and max Y value | function drawGraphAxis(xfn, yfn, maxX, maxY) {
// Draw the X axis
g.append("svg:line")
.attr("x1", xfn(0))
.attr("y1", -1 * yfn(0))
.attr("x2", xfn(maxX))
.attr("y2", -1 * yfn(0))
// Draw the Y axis
g.append("svg:line")
.attr("x1", xfn(0))
.attr("y1", -1 * yfn(0))
.att... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addLabel(maxX, minX,maxY,minY ) {\n var xMax = d3.selectAll(\"#cmlLabels\").select(\"#xmaxlabel\").select(\"text\");\n var xMin = d3.selectAll(\"#cmlLabels\").select(\"#xminlabel\").select(\"text\");\n var yMax = d3.selectAll(\"#cmlLabels\").select(\"#ymaxlabel\").select(\"text\");\n var yMin ... | [
"0.7215366",
"0.623511",
"0.61249846",
"0.6024531",
"0.59031963",
"0.5877968",
"0.58602315",
"0.5795875",
"0.5757838",
"0.57294023",
"0.5704658",
"0.568965",
"0.56677365",
"0.56611574",
"0.56604934",
"0.5631349",
"0.5559981",
"0.55194664",
"0.5508548",
"0.5497015",
"0.5473465... | 0.6363543 | 1 |
Get the html for a word item in the current word list | function getWordListItem(text, color) {
var ret =
"<li> <span class='word-list-item' style='background:" + color + ";'>" + text +
"</span><a class='icon-button delete-ci' href='#'><span class='ui-icon ui-icon-closethick' alt='delete'></span></a></li>";
return ret;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getWord () {\n let w = words[i].split('');\n let newHTML = '';\n for (let i = 0; i < w.length; i++) {\n if (w[i] === 'A' || w[i] === 'E' || w[i] === 'I' ||\n w[i] === 'O' || w[i] === 'U' ) {\n w[i] = `<span class='sounds-vowel'>${w[i]}</span>`;\n }\n if ( lowerCase === true ) newHT... | [
"0.6561378",
"0.60792696",
"0.6056143",
"0.599735",
"0.5965916",
"0.5963696",
"0.58835423",
"0.5872942",
"0.58709663",
"0.58286154",
"0.5818302",
"0.58005667",
"0.5785184",
"0.5773845",
"0.5746935",
"0.5736974",
"0.572205",
"0.5711811",
"0.5680342",
"0.56672996",
"0.5666835",... | 0.6758807 | 0 |
Draw the popup for this mouseover event | function drawMouseOverPopup(event, xAxisValue) {
$("#overlay-text").text(xAxisValue);
$("div.overlay").css("left", event.offsetX - $("#chart").offset().left + "px").css("top", (event.offsetY+40) + "px").css('visibility','visible');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onHover(e) {\n\n\t\tconsole.log(e);\n\n\t\t// Get the properties of the selected shape\n\t\tvar cx = parseFloat(e.selectedShape.attr(\"x\")), cy = parseFloat(e.selectedShape.attr(\"y\"));\n\n\t\t// Set the size and position of the popup\n\t\tvar width = 150, height = 70, x = (cx + width + 10 < svg.attr(\"... | [
"0.7220789",
"0.6928775",
"0.68479234",
"0.6722247",
"0.6722247",
"0.66762984",
"0.6623302",
"0.6557614",
"0.6533204",
"0.6525419",
"0.65187097",
"0.6420934",
"0.6409868",
"0.6393914",
"0.63349086",
"0.63212734",
"0.6315922",
"0.6315922",
"0.62600416",
"0.62295717",
"0.616952... | 0.6955315 | 1 |
Remove popup for this mouseout event | function drawMouseOutPopup(event) {
$("div.overlay").css('visibility','hidden');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"dispose(): void {\n this._map.off('mouseout', this._onMouseOut, this);\n\n if (this._container) {\n this._popupPane.removeChild(this._container);\n this._container = null;\n }\n }",
"function mouseout(e) {\n countryLayer.resetStyle(e.target)\n closeTooltip = window.setTimeout(fu... | [
"0.7568396",
"0.7307685",
"0.7238187",
"0.72342503",
"0.7172119",
"0.7122737",
"0.7028462",
"0.6908348",
"0.688516",
"0.688516",
"0.688516",
"0.688516",
"0.688516",
"0.688516",
"0.688516",
"0.688516",
"0.688516",
"0.68777025",
"0.6852142",
"0.6830129",
"0.68287843",
"0.6824... | 0.7708468 | 0 |
The anonymous function after "test.csv" gets each datapoint passed to it. The d3.csv method treats everything as string, so line "d.age = +d.age;" turn the age variable into a number, then returns the d object, so that in the ready function, you don't have to worry about the data being strings | function ready(error, datapoints) {
if (error) throw error;
// Write your D3 inside this function!
// Datapoints should be a list of 3 objects, each with a the three attributes from the test.csv file
// You can see the result of this by opening the developer tools window of your browser
console.lo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function cargardatos(url){ \nd3.csv(url, function(error, data) { \nif (error) return console.warn(error);\n \ndatos=data; \nconsole.log(\"datos\"); \npreprocesarDatosExpoAgentes();\nconsole.log(\"datos preprocesados\"); \n//actualizarcarga(in_carga); \niniciarfuerza();\nconsole.log(\"fuerza inicada\... | [
"0.7013655",
"0.6828305",
"0.68055797",
"0.67938864",
"0.6673113",
"0.6578408",
"0.6550363",
"0.6518193",
"0.6507213",
"0.6491453",
"0.6442356",
"0.6423474",
"0.6363852",
"0.6331672",
"0.63133913",
"0.6299349",
"0.62911034",
"0.6184526",
"0.6144633",
"0.61438376",
"0.6133598"... | 0.6848024 | 1 |
Updates the window parameters in case users resize the screen. | function updateWindowParameters() {
windowWidth = document.body.offsetWidth;
windowHeight = document.body.offsetHeight;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function update_window_dimensions(){\n window_width = window.innerWidth ? window.innerWidth : $(window).width();\n window_height = window.innerHeight ? window.innerHeight : $(window).height();\n }",
"function onWindowResize(e)\n{\n\t// TODO: I don't think it works.\n\twindowProperties.update();\... | [
"0.79995936",
"0.79062223",
"0.7638329",
"0.7627088",
"0.75547373",
"0.74924767",
"0.74613756",
"0.7421469",
"0.74104613",
"0.7405219",
"0.7405219",
"0.734864",
"0.7342122",
"0.73079145",
"0.72989136",
"0.7283783",
"0.7244233",
"0.7244233",
"0.72379863",
"0.72239566",
"0.7214... | 0.8405196 | 0 |
Checks to see if the ball has collided with the wall. | function wallCollisionCheck() {
if ((ball.x1 <= SCREEN_X1) || (ball.x2 >= SCREEN_X2)) {
ball.velocityx = -ball.velocityx;
}
else if ((ball.y1 <= SCREEN_Y1)) {
ball.velocityy = -ball.velocityy;
ball.cy += 2;
}
else if (ball.y2 >= SCREEN_Y2) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkCollided(index, ourX, ourY)\n{\n\tfor (var j = 0; j < index; j++) // Check with all previous balls that they are not colliding with your x and y\n {\n if (dist(ourX, ourY, balls[j].x, balls[j].y) <= 2*balls[j].r) { // If the distance between the points\n return tru... | [
"0.7558192",
"0.7492075",
"0.74208266",
"0.7414518",
"0.73881334",
"0.7350052",
"0.7294812",
"0.72617954",
"0.71880895",
"0.71554106",
"0.71277285",
"0.7070276",
"0.70466906",
"0.70423234",
"0.7021116",
"0.69948775",
"0.6986099",
"0.69856465",
"0.6960201",
"0.69564927",
"0.69... | 0.76664793 | 0 |
Displays the losing screen. | function losingScreen() {
endGame();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function renderGameLostScreen() {\n hideGameScreen()\n showGuessWord()\n\n // Show the game lost screen\n document.querySelector('.game-lost-screen').style.display = 'block'\n}",
"function displayLostScreen(){\n if (end){\n // Plays loss sound for 3 seconds\n bgSound.pause();\n if (millis() - milli... | [
"0.71628433",
"0.6934571",
"0.6911305",
"0.68281454",
"0.6737648",
"0.66584116",
"0.6644003",
"0.6544426",
"0.6520906",
"0.6510742",
"0.6481497",
"0.6464128",
"0.6464019",
"0.64192367",
"0.641329",
"0.6358179",
"0.63492686",
"0.6324175",
"0.63080674",
"0.6295281",
"0.6281162"... | 0.7796152 | 0 |
Draws the start screen. | function drawStartScreen() {
canvas.addEventListener('click', startGame);
var x = SCREEN_WIDTH / 2;
var y = 175;
context.textAlign = 'center';
context.fillStyle = TEXT_COLOR;
context.font = '30px Verdana bold';
context.textBaseline = 'top';
context.fillTex... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function startScreen() {\n draw();\n startBtn.draw();\n }",
"renderStartScreen(ctx) {\n this.startScreen.draw(ctx);\n this.game.trump.drawStart(ctx);\n this.game.trump.move();\n }",
"function startScreen() {\n drawBackground()\n drawGround()\n}",
"function draw() ... | [
"0.84962153",
"0.79367226",
"0.75664115",
"0.75615317",
"0.7480679",
"0.7369997",
"0.7345094",
"0.7341381",
"0.7340235",
"0.7340235",
"0.73180157",
"0.7292818",
"0.72814727",
"0.72651047",
"0.71931493",
"0.71496147",
"0.7067067",
"0.7040258",
"0.70240927",
"0.70240915",
"0.70... | 0.80533785 | 1 |
Draws the turns on the screen. | function drawTurns() {
context.textAlign = 'left';
context.fillStyle = TEXT_COLOR;
context.font = '15px arial';
context.textBaseline = 'top';
context.fillText('Turns: ' + turns, SCREEN_WIDTH - 100, SCREEN_HEIGHT - STATUS_BAR_Y_OFFSET);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function draw() {\r\n\t//if the game is in checkmate it will change the color to the opposite color of the turn\r\n\tif (checkMate) {\r\n\t\tctx.fillStyle = board.tiles[0][0].pieceColors[1 - turn]; //gets colors from the tiles (they store black and white)\r\n\r\n\t\t//if the game is in a stalemate position it will... | [
"0.7419695",
"0.71141887",
"0.701369",
"0.69846404",
"0.6931401",
"0.6886027",
"0.68777514",
"0.68500024",
"0.6834712",
"0.6831454",
"0.68255275",
"0.68093",
"0.68036187",
"0.6792802",
"0.6790699",
"0.6770509",
"0.6718263",
"0.6711119",
"0.67105484",
"0.6706392",
"0.670582",
... | 0.7615144 | 0 |
This class represents one suggestion that autocomplete may return. Attributes: mainTextParts: A list of strings that, when joined, are a string that partially or fully matches the input string. Even indices are strings that matched something in the input string, and odd indices are strings that did not. secondaryText: ... | function Suggestion(){
this.mainTextParts = [];
this.secondaryText = "";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function AC_match(autoComplete)\n{\n var matches = new Array()\n var text = document.getElementById(autoComplete.fieldId).value\n if (text == '' && !autoComplete.openOnEmptyText)\n return matches\n textLower = text.toLowerCase()\n\n for (iv in autoComplete.options)\n {\n var option ... | [
"0.5525395",
"0.55199736",
"0.5271449",
"0.5159717",
"0.5147902",
"0.51299816",
"0.5062841",
"0.5058556",
"0.50270236",
"0.5014637",
"0.5011401",
"0.50080854",
"0.50049025",
"0.49608514",
"0.488585",
"0.48676527",
"0.48505166",
"0.4844167",
"0.47995943",
"0.47875765",
"0.4776... | 0.74325055 | 0 |
Updates commonAncestorContainer and collapsed after boundary change | function updateCollapsedAndCommonAncestor(range) {
range.collapsed = (range.startContainer === range.endContainer && range.startOffset === range.endOffset);
range.commonAncestorContainer = range.collapsed ?
range.startContainer : dom.getCommonAncestor(range.startContainer, range.endContai... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateCollapsedAndCommonAncestor(range) {\n range.collapsed = (range.startContainer === range.endContainer && range.startOffset === range.endOffset);\n range.commonAncestorContainer = range.collapsed ?\n range.startContainer : dom.getCommonAncestor(range.startContainer... | [
"0.7359054",
"0.7359054",
"0.7346168",
"0.7346168",
"0.7346168",
"0.73425907",
"0.73375475",
"0.6246091",
"0.6246091",
"0.5597768",
"0.55747956",
"0.5542671",
"0.5490845",
"0.54311174",
"0.54111975",
"0.537851",
"0.5365756",
"0.53580177",
"0.5351582",
"0.533122",
"0.52515507"... | 0.73893815 | 1 |
Utility function to support direction parameters in the API that may be a string ("backward" or "forward") or a Boolean (true for backwards). | function isDirectionBackward(dir) {
return (typeof dir == "string") ? (dir == "backward") : !!dir;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isDirectionBackward(dir) {\n\t return (typeof dir == \"string\") ? /^backward(s)?$/i.test(dir) : !!dir;\n\t }",
"function isDirectionBackward(dir) {\n return (typeof dir == \"string\") ? /^backward(s)?$/i.test(dir) : !!dir;\n }",
"function isDirectionBackward(dir) {... | [
"0.7176319",
"0.71467006",
"0.71467006",
"0.70957494",
"0.694289",
"0.694289",
"0.62702715",
"0.6191853",
"0.61653984",
"0.61050916",
"0.61050916",
"0.6066722",
"0.6042828",
"0.60163015",
"0.59790033",
"0.5953184",
"0.59503406",
"0.59168804",
"0.5865361",
"0.586465",
"0.58561... | 0.72782576 | 0 |
Simple, quick test which only needs to distinguish between a TextRange and a ControlRange | function isTextRange(range) {
return !!range && typeof range.text != "undefined";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isTextRange(range) {\n\t return !!range && typeof range.text != \"undefined\";\n\t }",
"function isTextRange(range) {\n return !!range && typeof range.text != \"undefined\";\n }",
"function isTextRange(range) {\n return !!range && typeof range.text != \"u... | [
"0.7019116",
"0.695488",
"0.695488",
"0.6108744",
"0.6015084",
"0.60091716",
"0.59678286",
"0.59314",
"0.5925111",
"0.5925111",
"0.59160066",
"0.59160066",
"0.590549",
"0.590549",
"0.5900648",
"0.58955824",
"0.58476484",
"0.5845757",
"0.5845757",
"0.58303297",
"0.57133824",
... | 0.69828194 | 1 |
Returns true only if test value is equals true...will return false for anything else Example isBool(5) > false isBool() > false isBool(isBool(isBool(0))) > false isBool(true) > true | function isBool(test) {
if (test === true) {
return true;
} else {
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isTrue (value) {\r\n return (value === true);\r\n}",
"function bool(value) {\n return value && value !== \"false\" && value !== \"0\";\n}",
"function isBool(value)\n{\n if (value === 'false' || value === '0' || value === false)\n return false;\n if (value === 'true' || value === '1' |... | [
"0.7499452",
"0.73842657",
"0.7365729",
"0.7297939",
"0.72469187",
"0.7226294",
"0.7162199",
"0.7160415",
"0.7113377",
"0.7058694",
"0.7024915",
"0.70098764",
"0.7002837",
"0.6943021",
"0.6928302",
"0.6899048",
"0.68590814",
"0.68590814",
"0.6834183",
"0.6799006",
"0.6797167"... | 0.77472466 | 0 |
add well method created here when we click on add well button, we will navigate to add well component | addWell(){
this.props.history.push('/Well'); //when we click on add well, this route will be called
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_onClickAdd() {\n\t\tconst model = appManager.getActiveDesignEditor().getModel();\n\t\tthis.createFromTemplate(BEHAVIOUR_ITEM_TEMPLATE_PATH, {\n\t\t\tbefore: this._$list.find('.li-add-button'),\n\t\t\tcallback: ($content) => {\n\t\t\t\tthis._refreshForm(() => {\n\t\t\t\t\tconst event = $content.find('.behavior-eve... | [
"0.55916625",
"0.5390598",
"0.5337582",
"0.53247535",
"0.53080106",
"0.5306814",
"0.5293359",
"0.5279803",
"0.527022",
"0.5245885",
"0.5213398",
"0.52122873",
"0.5197628",
"0.5195686",
"0.5194026",
"0.51596725",
"0.51587886",
"0.51372075",
"0.51340055",
"0.51298946",
"0.51102... | 0.7085982 | 0 |
Returns an array of 3channel lookup tables which contains values from a gammacorrection curve with a gamma of 2.2. Each lookup table contains 3 65 entries, or 65 entries for each color channel, and there is one table for each pixel in the display. Mod Note: for simplicity we are using the same gamma curve for each chan... | function getGammaData() {
var calibration = [];
for (var i = 0; i < 65; i++) {
var lookup = [];
// Calculate gamma curve for all three channels
var r = g = b = Math.round(3865 * Math.pow(i / 64, 2.2));
for (var j = 0; j < DisplayConfig.pixelsPerUnit; j++) {
lookup.push(r);
lookup.p... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function init_tables(prim){\n\tprim = prim || 0x11d;\n\n\tgf_exp = new Uint8Array(512);\n\tgf_log = new Uint8Array(256);\n\n\tvar x = 1;\n\tfor(var i=0; i < 255;i++){\n\t\tgf_exp[i] = x;\n\t\tgf_log[x] = i;\n\t\tx = gf_mult_noLUT(x,2,prim);\n\t}\n\n\tfor(var i=255; i < 512; i++){\n\t\tgf_exp[i] = gf_exp[i - 255];\... | [
"0.60154",
"0.5871098",
"0.5757382",
"0.5757382",
"0.57413244",
"0.57413244",
"0.57126206",
"0.5672646",
"0.5637076",
"0.56233877",
"0.54357433",
"0.54154325",
"0.53473383",
"0.53449166",
"0.5342208",
"0.5342208",
"0.53249556",
"0.5314975",
"0.5314975",
"0.5314975",
"0.531497... | 0.8055588 | 0 |
Returns an array of 8bit values repacked from a given array of 12bit values Example: 12bit input: [ 0xFFF, 0xAAA, 0xFFF ] 8bit output: [ 0xFF, 0xFA, 0xAA, 0xFF, 0xF0 ] | function repack12bitTo8bit(array12) {
var array8 = [];
for (var i = 0; i < array12.length; i++) {
var msb = array12[i] >> 4;
array8.push(msb);
// Now get the last 4 bits. So this is the first 4 bits of the next.
// Do an extra shift so we can add it to the next byte.
var lsb = (array12[i] - (m... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"fromBits(arr) {\n\t\t\t\tconst bl = bitArray.bitLength(arr);\n\t\t\t\tconst byteLength = bl / 8;\n\t\t\t\tconst out = new Uint8Array(byteLength);\n\t\t\t\tlet tmp;\n\t\t\t\tfor (let i = 0; i < byteLength; i++) {\n\t\t\t\t\tif ((i & 3) === 0) {\n\t\t\t\t\t\ttmp = arr[i / 4];\n\t\t\t\t\t}\n\t\t\t\t\tout[i] = tmp >>>... | [
"0.6585493",
"0.6445657",
"0.63608944",
"0.63501614",
"0.6095122",
"0.5965655",
"0.5964799",
"0.5934749",
"0.5929533",
"0.59170026",
"0.5872481",
"0.5835286",
"0.5802029",
"0.577253",
"0.56804097",
"0.56558514",
"0.56236184",
"0.5613573",
"0.5600551",
"0.5590619",
"0.5581607"... | 0.80239487 | 0 |
A function that 'zero's' the clock. This involves setting all inputs to 00. | function zeroClock() {
var clock = document.getElementById('clockdiv');
clock.querySelector('#hours').value = '00';
clock.querySelector('#minutes').value = '00';
clock.querySelector('#seconds').value = '00';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function resetTimer() {\n //write code here\n stopClock = true;\n seconds = 0;//reset time back to zero(\"It took me a day to realize how easy it is\")\n minutes = 0;\n hours = 0;\n timerEl.textContent = \"00:00:00\";\n }",
"function resetCurrentHours(){\n\t\t/*\n\t\t... | [
"0.65227866",
"0.6479957",
"0.6445566",
"0.6418973",
"0.64129394",
"0.6390442",
"0.63634443",
"0.6358899",
"0.635876",
"0.6331922",
"0.63289094",
"0.62995553",
"0.61788553",
"0.6178788",
"0.6175167",
"0.61407197",
"0.6094247",
"0.6063824",
"0.6061889",
"0.6055552",
"0.6013714... | 0.77485913 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.