text:
package clif

import (
	"fmt"
	. "github.com/smartystreets/goconvey/convey"
	"strings"
	"testing"
)

var testsStringLenth = []struct {
	str string
	len int
}{
	{
		str: "foo",
		len: 3,
	},
	{
		str: "♞♞♞",
		len: 3,
	},
	{
		str: "\033[1mfoo\033[0m",
		len: 3,
	},
	{
		str: "\033[34m\033[1mfoo\033[0m",
		len: 3,
	},
}

func TestStringLength(t *testing.T) {
	Convey("Length of strings", t, func() {
		for idx, test := range testsStringLenth {
			name := rxControlCharacters.ReplaceAllString(test.str, "<CTRL>")
			Convey(fmt.Sprintf("%d) %s", idx, name), func() {
				l := StringLength(test.str)
				So(l, ShouldEqual, test.len)
			})
		}
	})
}

var testsSplitFormattedString = []struct {
	str    string
	expect string
}{
	{
		str:    "fffff",
		expect: "fffff",
	},
	{
		str:    "\033[1mfffff\033[0m",
		expect: "\033[1mfffff\033[0m",
	},
	{
		str:    "\033[1mfffff\033[0m\n",
		expect: "\033[1mfffff\033[0m\n",
	},
	{
		str:    "\033[1mfff\nfff\033[0m",
		expect: "\033[1mfff\033[0m\n\033[1mfff\033[0m",
	},
	{
		str: strings.Join([]string{
			"\033[34;1mfff",
			"fff",
			"fff\033[0m",
		}, "\n"),
		expect: strings.Join([]string{
			"\033[34;1mfff\033[0m",
			"\033[34;1mfff\033[0m",
			"\033[34;1mfff\033[0m",
		}, "\n"),
	},
	{
		str: strings.Join([]string{
			"\033[34;1mfff",
			"fff",
			"fff",
			"fff",
			"fff\033[0m",
		}, "\n"),
		expect: strings.Join([]string{
			"\033[34;1mfff\033[0m",
			"\033[34;1mfff\033[0m",
			"\033[34;1mfff\033[0m",
			"\033[34;1mfff\033[0m",
			"\033[34;1mfff\033[0m",
		}, "\n"),
	},
	{
		str: strings.Join([]string{
			"\033[34;1mfff\033[35m",
			"fff",
			"fff\033[0m",
		}, "\n"),
		expect: strings.Join([]string{
			"\033[34;1mfff\033[35m\033[0m",
			"\033[34;1m\033[35mfff\033[0m",
			"\033[34;1m\033[35mfff\033[0m",
		}, "\n"),
	},
	{
		str: strings.Join([]string{
			"\033[34;1mfff",
			"\033[35mfff",
			"fff\033[0m",
		}, "\n"),
		expect: strings.Join([]string{
			"\033[34;1mfff\033[0m",
			"\033[34;1m\033[35mfff\033[0m",
			"\033[34;1m\033[35mfff\033[0m",
		}, "\n"),
	},
	{
		str:    "\033[34;1mfff",
		expect: "\033[34;1mfff\033[0m",
	},
	{
		str:    "fff\nfff",
		expect: "fff\nfff",
	},
}

func TestSplitFormattedString(t *testing.T) {
	Convey("Split lines with control characters", t, func() {
		for idx, test := range testsSplitFormattedString {
			from := strings.Replace(test.str, "\n", "<BR>", -1)
			from = rxControlCharacters.ReplaceAllString(from, "<CTRL>")
			Convey(fmt.Sprintf("%d) from \"%s\"", idx, from), func() {
				to := strings.Join(SplitFormattedString(test.str), "\n")
				//_testDumpStrings(to, test.expect)
				So(to, ShouldEqual, test.expect)
			})
		}
	})
}

repository: ukautz/clif

repo_name: ukautz/clif


text:
@InProceedings{ravanbakhsh14,
  supplementary = {Supplementary:ravanbakhsh14-supp.pdf},
  title = {Min-Max Problems on Factor Graphs},
  author = {Siamak Ravanbakhsh and Christopher  Srinivasa and Brendan Frey and Russell Greiner},
  pages = {1035-1043},
  abstract = {We study the min-max problem in factor graphs, which seeks the assignment that minimizes the maximum value over all factors. We reduce this problem to both min-sum and sum-product inference, and focus on the later. This approach reduces the min-max inference problem to a sequence of constraint satisfaction problems (CSPs) which allows us to sample from a uniform distribution over the set of solutions. We demonstrate how this scheme provides a message passing solution to several NP-hard combinatorial problems, such as min-max clustering (a.k.a. K-clustering), the asymmetric K-center problem, K-packing and the bottleneck traveling salesman problem. Furthermore we theoretically relate the min-max reductions to several NP hard decision problems, such as clique cover, set cover, maximum clique and Hamiltonian cycle, therefore also providing message passing solutions for these problems. Experimental results suggest that message passing often provides near optimal min-max solutions for moderate size instances.},
  section = {cycle-2},
}

license: MIT

repository: mreid/papersite

license_type: permissive

repo_name: mreid/papersite

branch_name: refs/heads/master

gha_license_id: MIT

gha_language: TeX

extension: bib


text:
@article{pcgml::paper,
	author    = {Adam Summerville and
	Sam Snodgrass and
	Matthew Guzdial and
	Christoffer Holmg{\aa}rd and
	Amy K. Hoover and
	Aaron Isaksen and
	Andy Nealen and
	Julian Togelius},
	title     = {{Procedural Content Generation via Machine Learning {(PCGML)}}},
	journal   = {CoRR},
	volume    = {abs/1702.00539},
	year      = {2017},
	url       = {http://arxiv.org/abs/1702.00539},
	archivePrefix = {arXiv},
	eprint    = {1702.00539},
	timestamp = {Wed, 07 Jun 2017 14:40:53 +0200},
	biburl    = {https://dblp.org/rec/bib/journals/corr/SummervilleSGHH17},
	bibsource = {dblp computer science bibliography, https://dblp.org},
	urldate = {12.03.2018},
}

@inproceedings{pcg::whatIsPCG,
	author = {Togelius, Julian and Kastbjerg, Emil and Schedl, David and Yannakakis, Georgios N.},
	title = {{What is Procedural Content Generation?: Mario on the Borderline}},
	booktitle = {Proceedings of the 2Nd International Workshop on Procedural Content Generation in Games},
	series = {PCGames '11},
	year = {2011},
	isbn = {978-1-4503-0872-4},
	location = {Bordeaux, France},
	pages = {3:1--3:6},
	articleno = {3},
	numpages = {6},
	url = {http://doi.acm.org/10.1145/2000919.2000922},
	doi = {10.1145/2000919.2000922},
	acmid = {2000922},
	publisher = {ACM},
	address = {New York, NY, USA},
}

@book{pcg::book,
	author={Noor Shaker and Julian Togelius and Mark J. Nelson},
	title={Procedural Content Generation in Games: A Textbook and an Overview of Current Research},
	publisher={Springer},
	year={2016}
}

@incollection{ai::aiBasedGameDesignPattern,
	booktitle = {Proceedings of the 10th International Conference on the Foundations of Digital Games 2015 (FDG 2015)},
	month = {December},
	title = {AI-based game design patterns},
	author = {Mike Treanor and Alexander Zook and Mirjam P Eladhari and Julian Togelius and Gillian Smith and Michael Cook and Tommy Thompson and Brian Magerko and John Levine and Adam Smith},
	address = {Santa Cruz, CA},
	publisher = {Society for the Advancement of Digital Games},
	year = {2015},
	url = {https://strathprints.strath.ac.uk/57219/},
	urldate = {12.03.2018},
}

@book{ai::book,
	title={{Artificial Intelligence and Games}},
	author={Georgios N. Yannakakis and Julian Togelius},
	publisher={Springer},
	note={\url{http://gameaibook.org}},
	year={2018}
}

@book{gameDesign::bookOfLenses,
	author = {Jesse Schell},
	title = {The Art of Game Design: A Book of Lenses},
	year = {2008},
	isbn = {0-12-369496-5},
	publisher = {Morgan Kaufmann Publishers Inc.},
	address = {San Francisco, CA, USA},
}

@book{gameDesign::gameMechanicsAdvancedGameDesign,
	author = {Adams, Ernest and Dormans, Joris},
	title = {Game Mechanics: Advanced Game Design},
	year = {2012},
	isbn = {0321820274, 9780321820273},
	edition = {1st},
	publisher = {New Riders Publishing},
	address = {Thousand Oaks, CA, USA},
}

@online{mechanic::gamasutra::MikeStout,
	author = {Mike Stout},
	title = {Trinity, Part 3: Game Mechanics},
	publisher = {Gamasutra},
	medium = {Online},
	month = {June},
	year = {2015},
	url = {https://www.gamasutra.com/blogs/MikeStout/20150622/246683/Trinity_Part_3_Game_Mechanics.php},
	urldate = {12.03.2018},
}

@online{mechanic::gamasutra::MaxPears,
	author = {Max Pears},
	title = {Game Design: Introducing Mechanics},
	publisher = {Gamasutra},
	medium = {Online},
	month = {March},
	year = {2018},
	url = {https://www.gamasutra.com/blogs/MaxPears/20180307/315172/Game_Design_Introducing_Mechanics.php},
	urldate = {12.03.2018},
}

@online{mechanic::gamasutra::DanielDoan,
	author = {Daniel Doan},
	title = {GameDev Protips: How To Design More Meaningful And Engaging Game Mechanics},
	publisher = {Gamasutra},
	medium = {Online},
	month = {March},
	year = {2017},
	url = {https://www.gamasutra.com/blogs/DanielDoan/20170322/294224/GameDev_Protips_How_To_Design_More_Meaningful_And_Engaging_Game_Mechanics.php},
	urldate = {12.03.2018},
}

@article{mechanic::MDA,
	author = {Hunicke, Robin and Leblanc, Marc and Zubek, Robert},
	year = {2004},
	month = {01},
	pages = {},
	title = {{MDA: A Formal Approach to Game Design and Game Research}},
	volume = {1},
	booktitle = {AAAI Workshop - Technical Report},
	url = {http://www.cs.northwestern.edu/~hunicke/pubs/MDA.pdf},
	urldate = {12.03.2018},
}

@book{mechanic::BasicGrammarModel,
	author = {Koster, Raph},
	title = {Theory of Fun for Game Design},
	year = {2013},
	isbn = {1449363210, 9781449363215},
	edition = {2nd},
	publisher = {O'Reilly Media, Inc.},
}

@inproceedings{pcg::computationalGameCreativity,
	title={Computational Game Creativity},
	author={Antonios Liapis and Georgios N. Yannakakis and Julian Togelius},
	booktitle={ICCC},
	year={2014},
}

@inproceedings{pcg::shortHistoryOfDynamicAndPCG,
	author    = {Michael Blatz and Oliver Korn},
	title     = {{A Very Short History of Dynamic and Procedural Content Generation}},
	booktitle = {Game Dynamics: Best Practices in Procedural and Dynamic Game Content Generation},
	pages = {1-13},
	year      = {2017},
	month = {03},
	isbn      = {978-3-319-53087-1},
}

@inproceedings{pcg::PCGinGameIndustry,
	author = {Alba Amato},
	title = {{Procedural Content Generation in the Game Industry}},
	booktitle={Game Dynamics: Best Practices in Procedural and Dynamic Game Content Generation},
	pages = {15-25},
	year = {2017},
	month = {03},
	isbn = {978-3-319-53087-1},
}

@inproceedings{mechanic::fromMdaToDde,
	author = {Walk, Wolfgang and Görlich, Daniel and Barrett, Mark},
	title = {{Design, Dynamics, Experience (DDE): An Advancement of the MDA Framework for Game Design}},
	booktitle={Game Dynamics: Best Practices in Procedural and Dynamic Game Content Generation},
	pages = {27-45},
	year = {2017},
	month = {03},
	isbn = {978-3-319-53087-1},
}

@paper{pcg::futureOfPcgInGames,
	author = {Gillian Smith},
	title = {The Future of Procedural Content Generation in Games},
	conference = {AAAI Conference on Artificial Intelligence and Interactive Digital Entertainment},
	year = {2014},
	url = {https://www.aaai.org/ocs/index.php/AIIDE/AIIDE14/paper/view/9078},
	urldate = {16.03.2018},
}

@paper{mechanic::generateAndAdaptingMechanics,
	title={Generating and Adapting Game Mechanics},
	author={Alexander Zook and Mark O. Riedl},
	year={2014},
	conference = {Foundations of Digital Games},
	url = {http://www.fdg2014.org/workshops/pcg2014_paper_03.pdf},
	urldate = {19.03.2018}
}

@article {pcg::endlessWeb,
	title = {{PCG-Based Game Design: Creating Endless Web}},
	journal = {Foundations of Digital Games 2012 (FDG {\textquoteright}12)},
	year = {2012},
	address = {Raleigh, NC},
	keywords = {AI, endless-web, procedural content},
	attachments = {https://games.soe.ucsc.edu/sites/default/files/smith-fdg12.pdf},
	author = {Smith, Gillian and Othenin-Girard, Alexei and Whitehead, Jim and Wardrip-Fruin, Noah}
}

@report{ai::gameDesign,
	author = {Mirjam P. Eladhari and Anne Sullivan and Gillian Smith and Josh McCoy},
	title = {{AI-Based Game Design: Enabling New Playable Experiences}},
	type = {Technical Report},
	institution = {UC Santa Cruz},
	year = {2011},
	date = {07.12.2011},
	url = {https://www.soe.ucsc.edu/research/technical-reports/UCSC-SOE-11-27},
	urldate = {19.03.2018},
}

@ARTICLE{pcg::galacticArmsRace,
	author={E. J. Hastings and R. K. Guha and K. O. Stanley},
	journal={IEEE Transactions on Computational Intelligence and AI in Games},
	title={Automatic Content Generation in the Galactic Arms Race Video Game},
	year={2009},
	volume={1},
	number={4},
	pages={245-263},
	keywords={augmented reality;computer games;groupware;Galactic Arms Race video game;automatic content generation;cgNEAT algorithm;content generating neuroevolution of augmenting topologies algorithm;evolutionary content generation;massively multiplayer online game;multiplayer online games;multiplayer video game;online gaming platform;particle system weapons;simulation software;Galactic Arms Race (GAR);Collaborative content evolution (CCE);NeuroEvolution of Augmenting Topologies (NEAT);collaborative content generation;content-generating NeuroEvolution of Augmenting Topologies (cgNEAT);interactive evolutionary computation (IEC);particle systems},
	doi={10.1109/TCIAIG.2009.2038365},
	ISSN={1943-068X},
	month={Dec},
}

@INPROCEEDINGS{pcg::galacticArmsRace::evolvingContent,
	author={E. J. Hastings and R. K. Guha and K. O. Stanley},
	booktitle={2009 IEEE Symposium on Computational Intelligence and Games},
	title={Evolving content in the Galactic Arms Race video game},
	year={2009},
	volume={},
	number={},
	pages={241-248},
	keywords={computer games;human computer interaction;video signal processing;augmenting topologies algorithm;content-generating neuroevolution;galactic arms race video game;particle system weapons;Arm;Artificial neural networks;Costs;Evolutionary computation;Games;Machine learning;Marine vehicles;Streaming media;Topology;Weapons},
	doi={10.1109/CIG.2009.5286468},
	ISSN={2325-4270},
	month={Sept},
}

@book{pcg::inGameDesign,
	title={Procedural Generation in Game Design},
	author={Short, T.X. and Adams, T.},
	isbn={9781351642910},
	OPTurl={https://books.google.com/books?id=-ZcnDwAAQBAJ},
	year={2017},
	publisher={CRC Press}
}

@ARTICLE{pcg::survey,
	author = {Hendrikx, Mark and Meijer, Sebastiaan and Van Der Velden, Joeri and Iosup, Alexandru},
	title = {Procedural Content Generation for Games: A Survey},
	journal = {ACM Trans. Multimedia Comput. Commun. Appl.},
	issue_date = {February 2013},
	volume = {9},
	number = {1},
	month = feb,
	year = {2013},
	issn = {1551-6857},
	pages = {1:1--1:22},
	articleno = {1},
	numpages = {22},
	OPTurl = {http://doi.acm.org/10.1145/2422956.2422957},
	OPTurldate = {19.03.2018},
	doi = {10.1145/2422956.2422957},
	acmid = {2422957},
	publisher = {ACM},
	address = {New York, NY, USA},
	keywords = {Game content generation, procedural, survey},
}

@online{pcg::gamasutra::tips,
	author = {Mike Rose},
	title = {5 tips for using procedurally-generated content in your game},
	publisher = {Gamasutra},
	medium = {Online},
	month = {November},
	year = {2012},
	url = {https://www.gamasutra.com/view/news/181853/5_tips_for_using_procedurallygenerated_content_in_your_game.php},
	urldate = {21.03.2018},
}

@online{pcg::angelina,
	author = {Michael Cook},
	title = {Games By Angelina - Developing an AI that can automatically design videogames},
	publisher = {Michael Cook},
	medium = {Online},
	month = {March},
	year = {2018},
	url = {http://www.gamesbyangelina.org/},
	urldate = {21.03.2018},
}

@online{speedTree,
	author = {IDV},
	title = {SpeedTree Vegetation Modeling},
	publisher = {IDV},
	medium = {Online},
	month = {March},
	year = {2018},
	url = {https://store.speedtree.com/},
	urldate = {21.03.2018},
}

@online{game::noMansSky,
	author = {{Hello Games}},
	title = {No Man's Sky},
	publisher = {Hello Games},
	medium = {Online},
	month = {June},
	year = {2016},
	url = {https://www.nomanssky.com/},
	urldate = {21.03.2018},
}

@online{nvidia::cascades,
	author = {NVIDIA},
	title = {Cascades},
	publisher = {NVIDIA},
	medium = {Online},
	month = {February},
	year = {2007},
	url = {http://www.nvidia.co.uk/coolstuff/demos#!/cascades},
	urldate = {21.03.2018},
}

@online{game::galacticArmsRace,
	author = {{Evolutionary Games}},
	title = {Galactic Arms Race},
	publisher = {{Evolutionary Games}},
	medium = {Online},
	month = {May},
	year = {2014},
	url = {http://gar.eecs.ucf.edu/},
	urldate = {22.03.2018},
}

@online{game::insideAStarFilledSky,
	author = {Jason Rohrer},
	title = {Inside a Star-filled Sky},
	publisher = {Jason Rohrer},
	medium = {Online},
	month = {May},
	year = {2011},
	url = {http://insideastarfilledsky.net/},
	urldate = {22.03.2018},
}

@inproceedings{pcg::questGenerator,
	author = {Doran, Jonathon and Parberry, Ian},
	title = {A Prototype Quest Generator Based on a Structural Analysis of Quests from Four MMORPGs},
	booktitle = {Proceedings of the 2Nd International Workshop on Procedural Content Generation in Games},
	series = {PCGames '11},
	year = {2011},
	isbn = {978-1-4503-0872-4},
	location = {Bordeaux, France},
	pages = {1:1--1:8},
	articleno = {1},
	numpages = {8},
	url = {http://doi.acm.org/10.1145/2000919.2000920},
	doi = {10.1145/2000919.2000920},
	acmid = {2000920},
	publisher = {ACM},
	address = {New York, NY, USA},
	keywords = {BNF, Java, MMORPG, NPC, Prolog, RPG, intractability, planning, procedural content generation, quest, role-playing game},
}

@online{game::spore,
	author = {Maxis},
	title = {Spore},
	publisher = {{Electronic Arts Inc.}},
	medium = {Online},
	month = {September},
	year = {2008},
	url = {http://www.spore.com/},
	urldate = {22.03.2018},
}

@BOOK{ml::book::algorithms,
	author = {Bonaccorso, Giuseppe},
	title = {Machine Learning Algorithms: A Reference Guide to Popular Algorithms for Data Science and Machine Learning},
	year = {2017},
	isbn = {1785889621, 9781785889622},
	publisher = {Packt Publishing},
}

@BOOK{ml::book::developer,
	author = {Rodolfo Bonnin},
	title = {Machine Learning for Developers},
	month = {October},
	year = {2017},
	isbn = {9781786469878},
	publisher = {Packt Publishing},
}

@BOOK{ml::book::statistics,
	author = {Pratap Dangeti},
	title = {Statistics for Machine Learning},
	month = {July},
	year = {2017},
	isbn = {9781788295758},
	publisher = {Packt Publishing},
}

@online{unity::ml,
	author = {{Unity Technologies}},
	title = {Unity - Unity Machine Learning tools and resources},
	publisher = {{Unity Technologies}},
	medium = {Online},
	year = {2018},
	url = {https://unity3d.com/machine-learning},
	urldate = {29.03.2018}
}

@online{unity::mlGithub,
	author = {{Unity Technologies}},
	title = {Unity-Technologies/ml-agents: Unity Machine Learning Agents},
	publisher = {GitHub},
	medium = {Online},
	year = {2018},
	url = {https://github.com/Unity-Technologies/ml-agents},
	urldate = {29.03.2018}
}

@online{api::tensorFlow,
	author = {Google},
	title = {TensorFlow},
	publisher = {Google},
	medium = {Online},
	year = {2018},
	url = {https://www.tensorflow.org/},
	urldate = {29.03.2018}
}

@online{ue4::tensorFlowPlugin,
	author = {Jan Kaniewski},
	title = {getnamo/tensorflow-ue4: TensorFlow plugin for Unreal Engine 4},
	publisher = {GitHub},
	medium = {Online},
	year = {2018},
	url = {https://github.com/getnamo/tensorflow-ue4},
	urldate = {29.03.2018}
}

@online{ml::gamasutra::ml,
	author = {Daniel Sánchez-Crespo Dalmau},
	title = {Postcard from GDC 2005: Tutorial - Machine Learning},
	publisher = {Gamasutra},
	medium = {Online},
	month = {March},
	year = {2005},
	url = {https://www.gamasutra.com/view/feature/130633/postcard_from_gdc_2005_tutorial__.php},
	urldate = {30.03.2018},
}

@online{ml::mostInfluentalAiGames,
	author = {Alex J. Champandard},
	title = {Top 10 Most Influential AI Games},
	publisher = {AiGameDev.com},
	medium = {Online},
	month = {September},
	year = {2007},
	url = {http://aigamedev.com/open/highlights/top-ai-games/},
	urldate = {30.03.2018},
}

@online{game::superhot,
	author = {{SUPERHOT Team}},
	title = {SUPERHOT - The FPS where time moves only when you move},
	publisher = {{SUPERHOT Team}},
	medium = {Online},
	month = {February},
	year = {2016},
	url = {https://superhotgame.com/},
	urldate = {04.04.2018},
}

@inproceedings{intro::tamagotchiEffect,
	author = { Andreas Holzinger and Arnold Pichler and Wolfgang Almer and Hermann Maurer },
	title = { TRIANGLE: A Multi-Media test-bed for examining incidental learning, motivation and the Tamagotchi-Effect within a Game-Show like Computer Based Learning Module },
	editor = { Craig Montgomerie and Jarmo Viteli },
	booktitle = { Proceedings of EdMedia: World Conference on Educational Media and Technology 2001 },
	year = { 2001 },
	pages = { 766--771 },
	address = { Norfolk, VA USA },
	publisher = { Association for the Advancement of Computing in Education (AACE) }
}

@online{nvidia::cudaToolkit,
	author = {NVIDIA Corporation},
	title = {CUDA Toolkit | NVIDIA Developer},
	publisher = {NVIDIA Corporation},
	medium = {Online},
	year = {2018},
	url = {https://developer.nvidia.com/cuda-toolkit},
	urldate = {16.05.2018}
}

@online{symthic::bf1stats,
	author = {Symthic},
	title = {BF1 Weapon Stats: Damage, Accuracy etc. | Symthic},
	publisher = {Symthic},
	medium = {Online},
	year = {2018},
	url = {http://symthic.com/bf1-stats},
	urldate = {24.05.2018}
}

@online{epicGames::unrealTournamentSourceCode,
	author = {Epic Games, Inc.},
	title = {UnrealTournament - Help us build the next Unreal Tournament game!},
	publisher = {GitHub},
	medium = {Online},
	year = {2018},
	url = {https://github.com/EpicGames/UnrealTournament},
	urldate = {24.05.2018}
}

@online{epicGames::shooterGame,
	author = {Epic Games, Inc.},
	title = {Shooter Game},
	publisher = {GitHub},
	medium = {Online},
	year = {2018},
	url = {https://docs.unrealengine.com/en-us/Resources/SampleGames/ShooterGame},
	urldate = {24.05.2018}
}

@online{counterstrike::wikiWeapons,
	author = {{FANDOM Games Community}},
	title = {Category:Weapons | Counter-Strike Wiki | FANDOM powered by Wikia},
	publisher = {FANDOM Games Community},
	medium = {Online},
	year = {2018},
	url = {http://counterstrike.wikia.com/wiki/Category:Weapons},
	urldate = {24.05.2018}
}

@online{neuralNetworkZoo,
	author = {{The Asimov Institute}},
	title = {The Neural Network Zoo - The Asimov Institute},
	publisher = {{The Asimov Institute}},
	medium = {Online},
	year = {2018},
	url = {http://www.asimovinstitute.org/neural-network-zoo/},
	urldate = {24.05.2018}
}

@BOOK{ml::book::nnProgrammingTF,
	author = {Manpreet Singh Ghotra and Rajdeep Dua},
	title = {Neural Network Programming with Tensorflow},
	month = {November},
	year = {2017},
	isbn = {9781788390392},
	publisher = {Packt Publishing},
}

@article{ml::vae::tutorial,
	title = {Tutorial on Variational Autoencoders},
	author = {Doersch, Carl},
	journal = {arXiv preprint arXiv:1606.05908},
	year = {2016},
}

@online{bf1::community1,
	author = {{FANDOM Games Community}},
	title = {Battlefield Wiki | FANDOM powered by Wikia},
	publisher = {FANDOM Games Community},
	medium = {Online},
	year = {2018},
	url = {http://battlefield.wikia.com},
	urldate = {18.06.2018}
}

@online{bf1::community2,
	author = {{IGN Entertainment, Inc.}},
	title = {Weapons - Battlefield 1},
	publisher = {IGN Entertainment, Inc.},
	medium = {Online},
	year = {2018},
	url = {http://www.ign.com/wikis/battlefield-1/Weapons},
	urldate = {18.06.2018}
}

@online{tutorial::vaeTF,
	author = {Jan Hendrik Metzen},
	title = {Variational Autoencoder in TensorFlow},
	publisher = {Jan Hendrik Metzen},
	medium = {Online},
	year = {2015},
	url = {https://jmetzen.github.io/2015-11-27/vae.html},
	urldate = {19.06.2018}
}

@article{ml::activation::elu,
	added-at = {2015-12-01T00:00:00.000+0100},
	author = {Clevert, Djork-Arné and Unterthiner, Thomas and Hochreiter, Sepp},
	biburl = {https://www.bibsonomy.org/bibtex/27adc5dad2ec8dd53463151b7f10142c8/dblp},
	ee = {http://arxiv.org/abs/1511.07289},
	interhash = {c97bacc77934cdc495ed7afea311bf3b},
	intrahash = {7adc5dad2ec8dd53463151b7f10142c8},
	journal = {CoRR},
	keywords = {dblp},
	timestamp = {2015-12-02T11:34:39.000+0100},
	title = {Fast and Accurate Deep Network Learning by Exponential Linear Units (ELUs).},
	url = {http://dblp.uni-trier.de/db/journals/corr/corr1511.html#ClevertUH15},
	volume = {abs/1511.07289},
	year = 2015,
	urldate = {19.06.2018}
}

@misc{ml::optimizer::overview,
	abstract = {Gradient descent optimization algorithms, while increasingly popular, are
	often used as black-box optimizers, as practical explanations of their
	strengths and weaknesses are hard to come by. This article aims to provide the
	reader with intuitions with regard to the behaviour of different algorithms
	that will allow her to put them to use. In the course of this overview, we look
	at different variants of gradient descent, summarize challenges, introduce the
	most common optimization algorithms, review architectures in a parallel and
	distributed setting, and investigate additional strategies for optimizing
	gradient descent.},
	added-at = {2018-06-13T17:21:04.000+0200},
	author = {Ruder, Sebastian},
	biburl = {https://www.bibsonomy.org/bibtex/24d1336b721e9154546ba8e1d87046316/achakraborty},
	description = {[1609.04747] An overview of gradient descent optimization algorithms},
	interhash = {6e9f951ec79eba6cb7eb27db1e6d4ad6},
	intrahash = {4d1336b721e9154546ba8e1d87046316},
	keywords = {2016 arxiv deep-learning gradient-descent paper survey tutorial},
	note = {cite arxiv:1609.04747Comment: Added derivations of AdaMax and Nadam},
	timestamp = {2018-06-13T17:21:04.000+0200},
	title = {An overview of gradient descent optimization algorithms},
	url = {http://arxiv.org/abs/1609.04747},
	year = 2016,
	urldate = {19.06.2018}
}

repository: piandpower/PCGML-Game-Mechanics

path: /Master Thesis LaTeX/Literatur.bib

repo_name: piandpower/PCGML-Game-Mechanics


text:
@InProceedings{durrant13,
  pdf = {http://jmlr.org/proceedings/papers/v28/durrant13.pdf},
  number = {3},
  section = {cycle-3},
  title = {Sharp Generalization Error Bounds for Randomly-projected Classifiers},
  author = {Durrant, Robert and Kaban, Ata},
  pages = {693-701},
  abstract = {We derive sharp bounds on the generalization error of a generic linear classifier trained by   empirical risk minimization on randomly-projected data. We make no restrictive assumptions   (such as sparsity or separability) on the data: Instead we use the fact that, in a classification setting, the question of interest is really `what is the effect of random projection on the predicted class labels?' and we therefore derive the exact probability of `label flipping' under Gaussian random projection in order to quantify this effect precisely in our bounds.},
}


text:
package server

import (
	"context"

	api_pb "github.com/genzai-io/sliced/proto/api"
)

//
//
//
func (s *Web) Auth(ctx context.Context, req *api_pb.AuthRequest) (*api_pb.AuthReply, error) {
	return nil, nil
}

//
//
//
func (s *Web) Register(ctx context.Context, req *api_pb.RegisterRequest) (*api_pb.RegisterReply, error) {
	return nil, nil
}

//
//
//
func (s *Web) Events(req *api_pb.EventsRequest, srv api_pb.APIService_EventsServer) error {
	return nil
}

repository: genzai-io/sliced

repo_name: genzai-io/sliced

extension: go


text:
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}:"

LINUX_VERSION ?= "4.9.177"
LINUX_VERSION_odroid-c4-hardkernel ?= "4.9.218"

KBRANCH ?= "odroidn2-4.9.y"
KBRANCH_odroid-c4-hardkernel ?= "odroidg12-4.9.y"

SRCREV ?= "c1116eecfb0a085f813ad8925b083e7ffaa7d7d7"
SRCREV_odroid-c4-hardkernel = "46c52cc30d8f7631aeddf5266e93a8e9f9077deb"

KBUILD_DEFCONFIG_odroid-c4-hardkernel = "odroidg12_defconfig"

require linux-hardkernel.inc

KERNEL_EXTRA_FEATURES = ""

O_KERNEL_CONFIG_odroid-n2-hardkernel  = "odroid-n2-hardkernel"

SRC_URI += "file://0001-perf-Make-perf-able-to-build-with-latest-libbfd.patch"

SRC_URI_append_odroid-n2-hardkernel ?= "file://${O_KERNEL_CONFIG}/defconfig"

SRC_URI_append_odroid-c4-hardkernel = "\
    file://0001-Disable-Werror.patch \
    file://0001-ODROID-C4-Enable-LCD-and-Touchscreen.patch \
"

do_install_prepend() {
    bbnote "custom kernel_do_install customization"
    cp ${B}/arch/arm64/boot/dts/amlogic/*.dtb ${B}/arch/arm64/boot/dts/
}

COMPATIBLE_MACHINE = "(odroid-n2-hardkernel|odroid-c4-hardkernel)"

repository: dozylynx/meta-odroid

repo_name: dozylynx/meta-odroid

extension: bb


text:
# base on the file: https://github.com/openembedded/openembedded/blob/master/recipes/ffmpeg/ffmpeg_0.6.1.bb
LICENSE = "GPLv2"

SRC_URI = "https://github.com/xbmc/FFmpeg/archive/2.6.4-Isengard.tar.gz"
SRC_URI[md5sum] = "3dbd015fbfea2cbedf1fbd0779ab987e"
SRC_URI[sha256sum] = "2487a6d4ad5701ad22582fc064ce39b60c383eec4958ca1e3218379035fa523f"

LIC_FILES_CHKSUM = "file://COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263"

inherit autotools pkgconfig

RCONFLICTS_libav = "libav"
RREPLACES_libav = "libav"

S = "${WORKDIR}/FFmpeg-2.6.4-Isengard"

EXTRA_FFCONF_armv7a = "--cpu=cortex-a8"
EXTRA_FFCONF_mipsel = "--arch=mips"

EXTRA_OECONF = " \
        --arch=${TARGET_ARCH} \
        --cross-prefix=${TARGET_PREFIX} \
        --disable-stripping \
        --enable-cross-compile \
        --enable-pthreads \
	--enable-pic \
	--enable-swscale \
	--enable-nonfree \
	--enable-gpl \
        --extra-cflags="${TARGET_CFLAGS} ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" \
        --extra-ldflags="${TARGET_LDFLAGS} ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" \
        --target-os=linux \
	--pkg-config=pkg-config \
        ${EXTRA_FFCONF} \
"

do_configure() {
	cd ${S}
	echo ${D}
	./configure ${EXTRA_OECONF}
}

do_compile() {
	cd ${S}
	oe_runmake -j8
}

do_install() {
	cd ${S}
	oe_runmake DESTDIR=${D} install
	rm -rf ${D}${datadir}/examples
	ls ${D}${datadir}/
}

FULL_OPTIMIZATION_armv7a = "-fexpensive-optimizations  -ftree-vectorize -fomit-frame-pointer -O4 -ffast-math"
BUILD_OPTIMIZATION = "${FULL_OPTIMIZATION}"

FILES_${PN} = "${bindir} ${datadir}/ffprobe.xsd ${datadir}/*.ffpreset"
FILES_${PN}-dev = "${includedir} ${libdir} ${libdir}/pkgconfig/*"


text:
@article{poloczanska_little_2011,
 abstract = {Rocky shore faunal communities are tractable systems which are sensitive to climate change. Here, we resurveyed a historical census of rocky shore fauna conducted in the 1940s and 1950s to assess whether there were latitudinal changes in distribution and abundance consistent with global climate change along Australia's east coast. This region has undergone rapid warming, with increases in temperature of ~1.5 °C over the past 60 years. We also tested a historical hypothesis that a dramatic transition from tropical species to temperate species at 25°S represents a biogeographical boundary caused by environmental transitions in wave action and dispersal barriers. Twenty-two rocky shores were sampled between 23°S and 35°S, covering 1500 km of the coastline. A total of 80 species of macro-fauna were identiﬁed. Historical comparison of the 30 most common species revealed little change in species distribution with warming ocean temperature. We conclude that the environmental transition driven by wave exposure, local currents and the presence of large sand islands, and not temperature, is the primary factor inﬂuencing biogeographic distributions along the subtropical east coast of Australia.},
 author = {Poloczanska, Elvira S. and Smith, Sam and Fauconnet, Laurence and Healy, John and Tibbetts, Ian R. and Burrows, Michael T. and Richardson, Anthony J.},
 doi = {10.1016/j.jembe.2011.02.018},
 file = {Poloczanska et al. - 2011 - Little change in the distribution of rocky shore f.pdf:/Users/ric325/Zotero/storage/KPKGNFAR/Poloczanska et al. - 2011 - Little change in the distribution of rocky shore f.pdf:application/pdf},
 issn = {00220981},
 journal = {Journal of Experimental Marine Biology and Ecology},
 language = {en},
 month = {April},
 number = {1-2},
 pages = {145--154},
 title = {Little change in the distribution of rocky shore faunal communities on the Australian east coast after 50years of rapid warming},
 url = {https://linkinghub.elsevier.com/retrieve/pii/S0022098111000669},
 urldate = {2019-10-24},
 volume = {400},
 year = {2011}
}


text:
package main

import "fmt"

type Student struct {
	name, roll string
	sap        int
}

func main() {
	nishkarsh := Student{name: "Nishkarsh Raj Khare", roll: "R171217041"}
	nishkarsh.sap = 500060720
	fmt.Println(nishkarsh)
}

repository: muharihar/The-Golang-Guide

repo_name: muharihar/The-Golang-Guide

branch_name: refs/heads/main


text:
@article{chanski2016association,
 author = {Cha\ŉski, Wojciech and González-Prendes, Rayner and Castelló, Anna and Jordana, Jordi and Manunza, Arianna and Quintanilla, Raquel and Amills, Marcel},
 journal = {Livestock Science},
 pages = {27--30},
 publisher = {Elsevier},
 title = {An association analysis between a missense polymorphism at the pig PCSK9 gene and serum lipid and meat quality traits in Duroc pigs},
 volume = {190},
 year = {2016}
}

repository: rprendes/starter-academic-rayner

repo_name: rprendes/starter-academic-rayner


text:
SUMMARY = "Fast data collector for Embedded Linux"
HOMEPAGE = "http://fluentbit.io"
BUGTRACKER = "https://github.com/fluent/fluent-bit/issues"

SRC_URI = "http://fluentbit.io/releases/0.12/fluent-bit-${PV}.tar.gz \
           file://jemalloc.patch \
           file://cmake_multilib.patch \
           "
SRC_URI[md5sum] = "7c8708312ac9122faacf9e2a4751eb34"
SRC_URI[sha256sum] = "23a81087edf0e2c6f2d49411c6a82308afc5224f67bbaa45729c057af62e9241"

S = "${WORKDIR}/fluent-bit-${PV}"

LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=2ee41112a44fe7014dce33e26468ba93"

DEPENDS = "zlib"
INSANE_SKIP_${PN}-dev += "dev-elf"

inherit cmake systemd

EXTRA_OECMAKE = "-DGNU_HOST=${HOST_SYS} -DFLB_ALL=ON -DFLB_TD=1"

# With Ninja it fails with:
# ninja: error: build.ninja:134: bad $-escape (literal $ must be written as $$)
OECMAKE_GENERATOR = "Unix Makefiles"

SYSTEMD_SERVICE_${PN} = "td-agent-bit.service"

TARGET_CC_ARCH_append = " ${SELECTED_OPTIMIZATION}"


text:
@inproceedings{Neubauer:2017:RTS:3136755.3136804,
 author = {Neubauer, Catherine and Chollet, Mathieu and Mozgai, Sharon and Dennison, Mark and Khooshabeh, Peter and Scherer, Stefan},
 title = {The Relationship Between Task-induced Stress, Vocal Changes, and Physiological State During a Dyadic Team Task},
 booktitle = {Proceedings of the 19th ACM International Conference on Multimodal Interaction},
 series = {ICMI 2017},
 year = {2017},
 isbn = {978-1-4503-5543-8},
 location = {Glasgow, UK},
 pages = {426--432},
 numpages = {7},
 url = {http://doi.acm.org/10.1145/3136755.3136804},
 doi = {10.1145/3136755.3136804},
 acmid = {3136804},
 publisher = {ACM},
 address = {New York, NY, USA},
 keywords = {Physiological features, Small Group Interaction, Stress, Voice Quality},
}

repository: matchollet/academic-kickstart

repo_name: matchollet/academic-kickstart


text:
package http

import (
	"errors"
	"fmt"
	"github.com/golang/glog"
	"github.com/mssola/user_agent"
	"github.com/nranchev/go-libGeoIP"
	"net/http"
	"strings"
)

type RequestParser struct {
	geoIp *libgeo.GeoIP
}

type Location struct {
	CountryCode string
	CountryName string
	Region      string
	City        string
	PostalCode  string
	Latitude    float64
	Longitude   float64
}

type UserAgent struct {
	Bot            bool
	Mobile         bool
	Platform       string // Linux, iPhone, iPad
	OS             string // Android, OS 7_1
	Make           string // samsung, kindle, etc.
	Browser        string
	BrowserVersion string
	Header         string // original header
}

type RequestOrigin struct {
	Ip          string
	Referrer    string
	UserAgent   *UserAgent
	Location    *Location
	HttpRequest *http.Request
	Cookied     bool
	Visits      int
	Destination string
	ShortCode   string
	LastVisit   string
}

func FingerPrint(origin *RequestOrigin) string {
	if origin.Location == nil {
		return origin.Ip // Not very good...
	}
	return strings.Join([]string{
		origin.Ip,
		fmt.Sprintf("%.5f", origin.Location.Longitude),
		fmt.Sprintf("%.5f", origin.Location.Latitude),
	}, ":")
}

func GetFingerPrintMatchQuery(fingerprint string) string {
	return fingerprint + "*"
}

func MatchFingerPrint(fp string, fingerprints []string) (match string, score float64) {
	// TODO - given list of candidates, return the highest score match
	for _, test := range fingerprints {
		if test == fp {
			score = 1.
		}

		glog.V(50).Infoln("Checking fingerprint", fp, ", candidate=", test, score)
		if score >= 1. {
			match = test
			return
		}

		// TODO - Otherwise, look for partial matches
		parts := strings.Split(test, ":")
		if test == parts[0] { // by ip
			return test, 0.8
		}
	}
	return "", 0.
}

func NewRequestParser(geoDb string) (parser *RequestParser, err error) {
	parser = &RequestParser{}
	parser.geoIp, err = libgeo.Load(geoDb)
	if err != nil {
		return nil, err
	}
	return parser, nil
}

func ParseUserAgent(req *http.Request) *UserAgent {
	ua := new(user_agent.UserAgent)
	ua.Parse(req.UserAgent())
	val := &UserAgent{
		Header:   req.UserAgent(),
		Bot:      ua.Bot(),
		Mobile:   ua.Mobile(),
		Platform: ua.Platform(),
		OS:       ua.OS(),
		Make:     req.UserAgent(), // TODO - fix the library
	}
	val.Browser, val.BrowserVersion = ua.Browser()
	return val
}

func (this *RequestParser) Parse(req *http.Request) (r *RequestOrigin, err error) {
	ip, location, _ := this.geo(req)
	r = &RequestOrigin{
		HttpRequest: req,
		Ip:          ip,
		UserAgent:   ParseUserAgent(req),
	}

	if location != nil {
		r.Location = &Location{
			CountryCode: location.CountryCode,
			CountryName: location.CountryName,
			Region:      location.Region,
			City:        location.City,
			PostalCode:  location.PostalCode,
			Latitude:    float64(location.Latitude),
			Longitude:   float64(location.Longitude),
		}
	} else {
		r.Location = &Location{}
	}

	r.Referrer = req.Referer()
	if r.Referrer == "" {
		r.Referrer = "DIRECT"
	}

	return r, err
}

func (this *RequestParser) geo(req *http.Request) (string, *libgeo.Location, error) {
	ip := req.Header.Get("X-Real-Ip")
	forwarded := req.Header.Get("X-Forwarded-For")
	if ip == "" && forwarded == "" {
		i := strings.LastIndex(req.RemoteAddr, ":")
		if i != -1 {
			ip = req.RemoteAddr[:i]
		} else {
			ip = req.RemoteAddr
		}
	} else if forwarded != "" {
		// X-Forwarded-For is potentially a list of addresses separated with ","
		parts := strings.Split(forwarded, ",")
		// TODO: should return first non-local address
		ip = parts[0]
	}

	ip = strings.TrimSpace(ip)
	if ip == "" {
		return "", nil, errors.New("Could not obtain IP address from request")
	} else if ip == "[::1]" {
		ip = "50.184.95.238" // fake ip -- for local development etc.
	}

	if location := this.geoIp.GetLocationByIP(ip); location == nil {
		return ip, nil, nil
	} else {
		return ip, location, nil
	}
}

func (this *RequestParser) Browser(req *http.Request) (bot bool, mobile bool, os string, browser string, version string) {
	ua := new(user_agent.UserAgent)
	ua.Parse(req.UserAgent())
	browserName, browserVersion := ua.Browser()
	return ua.Bot(), ua.Mobile(), ua.OS(), browserName, browserVersion
}

repository: infradash/dash

repo_name: infradash/dash


text:
@InProceedings{yan10a,
  title = {Modeling annotator expertise: Learning when everybody knows a bit of something},
  author = {Yan Yan and Romer Rosales and Glenn Fung and Mark Schmidt and Gerardo Hermosillo and Luca Bogoni and Linda Moy and Jennifer Dy},
  pages = {932--939},
  abstract = {Supervised learning from multiple labeling sources is an increasingly important problem in machine learning and data mining. This paper develops a probabilistic approach to this problem when annotators may be unreliable (labels are noisy), but also their expertise varies depending on the data they observe (annotators may have knowledge about different parts of the input space). That is, an annotator may not be consistently accurate (or inaccurate) across the task domain. The presented approach produces classification and annotator models that allow us to provide estimates of the true labels and annotator variable expertise. We provide an analysis of the proposed model under various scenarios and show experimentally that annotator expertise can indeed vary in real tasks and that the presented approach provides clear advantages over previously introduced multi-annotator methods, which only consider general annotator characteristics.},
  pdf = {http://jmlr.org/proceedings/papers/v9/yan10a/yan10a.pdf},
}


text:
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
  message(STATUS "Setting build type to 'Debug' as none was specified.")
  set(CMAKE_BUILD_TYPE
      Debug
      CACHE STRING "Choose the type of build." FORCE)
  set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release"
                                               "MinSizeRel" "RelWithDebInfo")
endif()

repository: kamilturek/factory

repo_name: kamilturek/factory

extension: cmake


text:
SUMMARY = "Intel(R) Enclosure LED Utilities"

DESCRIPTION = "The utilities are designed primarily to be used on storage servers \
 utilizing MD devices (aka Linux Software RAID) for RAID arrays.\
"
HOMEPAGE = "https://github.com/intel/ledmon"

LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \
"

DEPENDS = "sg3-utils udev"

inherit autotools systemd

SYSTEMD_SERVICE:${PN} = "ledmon.service"

# 0.93
SRC_URI = "git://github.com/intel/ledmon;branch=master;protocol=https \
           file://0002-include-sys-select.h-and-sys-types.h.patch \
           file://0001-Don-t-build-with-Werror-to-fix-compile-error.patch \
          "

SRCREV = "1d72f9cb5c9163b2ecdf19709935720e65f5b90e"

COMPATIBLE_HOST = "(i.86|x86_64).*-linux"
COMPATIBLE_HOST:libc-musl = "null"

S = "${WORKDIR}/git"
EXTRA_OEMAKE = "CC='${CC}' LDFLAGS='${LDFLAGS}' CFLAGS='${CFLAGS}'"

# The ledmon sources include headers in ${S}/config to build but not in CFLAGS.
# We need to add this include path in CFLAGS.
CFLAGS += "-I${S}/config"

do_install:append() {
        if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
	        install -d ${D}${systemd_unitdir}/system
	        install -m 0755 ${S}/systemd/ledmon.service ${D}${systemd_unitdir}/system
        fi
}

repository: openembedded/meta-openembedded

repo_name: openembedded/meta-openembedded

gha_language: BitBake


text:
@article{DBLP:journals/corr/abs-1812-04202,
  author    = {Ziwei Zhang and Peng Cui and Wenwu Zhu},
  title     = {Deep Learning on Graphs: {A} Survey},
  journal   = {CoRR},
  volume    = {abs/1812.04202},
  year      = {2018},
  url       = {http://arxiv.org/abs/1812.04202}
}

url: https://raw.githubusercontent.com/Hugh-Shi/DL-NLP-Readings/924e4d189e5660c5b5d4854278f3df755ae2231d/Bibtex/Deep Learning on Graphs - A Survey.bib

repository: Hugh-Shi/DL-NLP-Readings

repo_name: Hugh-Shi/DL-NLP-Readings

filename: Deep Learning on Graphs - A Survey.bib


text:
%% This BibTeX bibliography file was created using BibDesk.
%% http://bibdesk.sourceforge.net/

%% Created for Folker Meyer at 2013-05-18 07:10:28 -0500

%% Saved with string encoding Unicode (UTF-8)

@article{DIAMOND,
  title={Fast and sensitive protein alignment using DIAMOND},
  author={Buchfink, Benjamin and Xie, Chao and Huson, Daniel H},
  journal={Nature methods},
  volume={12},
  number={1},
  pages={59--60},
  year={2015},
  publisher={Nature Publishing Group}
}

@inproceedings{SHOCK,
  author    = {Andreas Wilke and
               Wolfgang Gerlach and
               Travis Harrison and
               Tobias Paczian and
               Wei Tang and
               William L. Trimble and
               Jared Wilkening and
               Narayan Desai and
               Folker Meyer},
  title     = {Shock: Active Storage for Multicloud Streaming Data Analysis},
  booktitle = {2nd {IEEE/ACM} International Symposium on Big Data Computing, {BDC}
               2015, Limassol, Cyprus, December 7-10, 2015},
  pages     = {68--72},
  year      = {2015},
  crossref  = {DBLP:conf/bdc/2015},
  url       = {http://dx.doi.org/10.1109/BDC.2015.40},
  doi       = {10.1109/BDC.2015.40},
  timestamp = {Fri, 19 Feb 2016 13:45:58 +0100},
  biburl    = {http://dblp.uni-trier.de/rec/bib/conf/bdc/WilkeGHPTTWDM15},
  bibsource = {dblp computer science bibliography, http://dblp.org}
}
@proceedings{DBLP:conf/bdc/2015,
  editor    = {Ioan Raicu and
               Omer F. Rana and
               Rajkumar Buyya},
  title     = {2nd {IEEE/ACM} International Symposium on Big Data Computing, {BDC}
               2015, Limassol, Cyprus, December 7-10, 2015},
  publisher = {{IEEE}},
  year      = {2015},
  url       = {http://ieeexplore.ieee.org/xpl/mostRecentIssue.jsp?punumber=7406204},
  isbn      = {978-0-7695-5696-3},
  timestamp = {Fri, 19 Feb 2016 13:45:26 +0100},
  biburl    = {http://dblp.uni-trier.de/rec/bib/conf/bdc/2015},
  bibsource = {dblp computer science bibliography, http://dblp.org}
}

@inproceedings{SKYPORT,
 author = {Gerlach, Wolfgang and Tang, Wei and Keegan, Kevin and Harrison, Travis and Wilke, Andreas and Bischof, Jared and D'Souza, Mark and Devoid, Scott and Murphy-Olson, Daniel and Desai, Narayan and Meyer, Folker},
 title = {Skyport: Container-based Execution Environment Management for Multi-cloud Scientific Workflows},
 booktitle = {Proceedings of the 5th International Workshop on Data-Intensive Computing in the Clouds},
 series = {DataCloud '14},
 year = {2014},
 isbn = {978-1-4799-7034-6},
 location = {New Orleans, Louisiana},
 pages = {25--32},
 numpages = {8},
 url = {http://dx.doi.org/10.1109/DataCloud.2014.6},
 doi = {10.1109/DataCloud.2014.6},
 acmid = {2689680},
 publisher = {IEEE Press},
 address = {Piscataway, NJ, USA},
}

@article{MGREVIEW,
	Author = {Riesenfeld, C.S. and Schloss, P.D. and Handelsman, J.},
	Journal = {Annu Rev Genet},
	Keywords = {Archaea/*genetics Bacteria/*genetics Bacteriophages/*genetics Biodiversity *Environmental Microbiology Gene Library Genome, Archaeal *Genome, Bacterial Genomic Library Microscopy Phylogeny Rhodopsin/genetics Sequence Analysis},
	Pages = {525-52},
	Title = {Metagenomics: genomic analysis of microbial communities},
	Volume = {38},
	Year = {2004}}

@article{CLOVR,
	Author = {Angiuoli, S.V. and Matalka, M. and Gussman, A. and Galens, K. and Vangala, M. and Riley, D.R. and Arze, C. and White, J.R. and White, O. and Fricke, W.F.},
	Journal = {BMC Bioinformatics},
	Keywords = {Computational Biology *Computers Genomics High-Throughput Nucleotide Sequencing *Internet *Sequence Analysis, DNA *Software},
	Pages = {356},
	Title = {Clo{VR}: a virtual machine for automated and portable sequence analysis from the desktop using cloud computing},
	Volume = {12},
	Year = {2011}}

@article{GENBANK,
	Author = {Benson, D.A. and Cavanaugh, M. and Clark, K. and Karsch-Mizrachi, I. and Lipman, D.J. and Ostell, J. and Sayers, E.W.},
	Journal = {Nucleic Acids Res},
	Keywords = {*Base Sequence *Databases, Nucleic Acid Genomics High-Throughput Nucleotide Sequencing Internet Molecular Sequence Annotation Sequence Analysis, DNA},
	Number = {Database issue},
	Pages = {D36-42},
	Title = {Gen{B}ank},
	Volume = {41},
	Year = {2013}}

@article{QIIME,
	Author = {Caporaso, J.G. and Kuczynski, J. and Stombaugh, J. and Bittinger, K. and Bushman, F.D. and Costello, E.K. and Fierer, N. and Pena, A.G. and Goodrich, J.K. and Gordon, J.I. and Huttley, G.A. and Kelley, S.T. and Knights, D. and Koenig, J.E. and Ley, R.E. and Lozupone, C.A. and McDonald, D. and Muegge, B.D. and Pirrung, M. and Reeder, J. and Sevinsky, J.R. and Turnbaugh, P.J. and Walters, W.A. and Widmann, J. and Yatsunenko, T. and Zaneveld, J. and Knight, R.},
	Journal = {Nat Methods},
	Keywords = {Animals Feces/microbiology Humans Mice RNA, Ribosomal, 16S/*genetics Sequence Analysis, RNA/*methods *Software Twins, Dizygotic/genetics Twins, Monozygotic/genetics},
	Number = {5},
	Pages = {335-6},
	Title = {{QIIME} allows analysis of high-throughput community sequencing data},
	Volume = {7},
	Year = {2010}}

@article{UCLUST,
	Author = {Edgar, R.C.},
	Journal = {Bioinformatics},
	Number = {19},
	Pages = {2460-1},
	Title = {Search and clustering orders of magnitude faster than {BLAST}},
	Volume = {26},
	Year = {2010}}

@article{GSC,
	Author = {Field, D. and Amaral-Zettler, L. and Cochrane, G. and Cole, J.R. and Dawyndt, P. and Garrity, G.M. and Gilbert, J. and Gl{\"o}ckner, F.O. and Hirschman, L. and Karsch-Mizrachi, I.},
	Journal = {PLOS Biology},
	Number = {6},
	Pages = {e1001088},
	Title = {The {G}enomic {S}tandards {C}onsortium},
	Volume = {9},
	Year = {2011}}

@article{ADRS,
	Author = {Gomez-Alvarez, V. and Teal, T.K. and Schmidt, T.M.},
	Journal = {ISME J},
	Keywords = {Base Sequence Databases, Genetic/*standards *Metagenome Metagenomics/*standards Molecular Sequence Data Sequence Alignment Sequence Analysis, DNA/standards *Soil Microbiology},
	Number = {11},
	Pages = {1314-7},
	Title = {Systematic artifacts in metagenomes from complex microbial communities},
	Volume = {3},
	Year = {2009}}

@article{HUSEPYRO,
	Author = {Huse, S.M. and Huber, J.A. and Morrison, H.G. and Sogin, M.L. and Welch, D.M.},
	Date-Modified = {2013-05-18 12:09:14 +0000},
	Journal = {Genome Biol},
	Number = {7},
	Pages = {R143},
	Title = {Accuracy and quality of massively parallel {DNA} pyrosequencing},
	Volume = {8},
	Year = {2007}}

@article{MEGAN,
	Author = {Huson, D.H. and Auch, A.F. and Qi, J. and Schuster, S.C.},
	Journal = {Genome Res},
	Keywords = {Atlantic Ocean *Biodiversity Computational Biology/methods *Ecosystem *Genetic Variation Genome/*genetics Genomics/*methods *Phylogeny *Software Species Specificity},
	Number = {3},
	Pages = {377-86},
	Title = {{MEGAN} analysis of metagenomic data},
	Volume = {17},
	Year = {2007}}

@article{EGGNOG,
	Author = {Jensen, L.J. and Julien, P. and Kuhn, M. and von Mering, C. and Muller, J. and Doerks, T. and Bork, P.},
	Journal = {Nucleic Acids Res},
	Keywords = {Animals *Databases, Genetic/standards/statistics & numerical data *Genes *Genomics Internet *Phylogeny Proteins/classification/*genetics/physiology Quality Control User-Computer Interface},
	Number = {Database issue},
	Pages = {D250-4},
	Title = {egg{NOG}: automated construction and annotation of orthologous groups of genes},
	Volume = {36},
	Year = {2008}}

@article{KEGG,
	Author = {Kanehisa, M.},
	Journal = {Novartis Found Symp},
	Keywords = {Amino Acid Sequence Animals Computer Simulation Databases *Genome Ligands Models, Biological Models, Genetic Molecular Sequence Data Protein Binding Proteome Research Support, Non-U.S. Gov't},
	Pages = {91-101; discussion 101-3, 119-28, 244-52},
	Title = {The {KEGG} database},
	Volume = {247},
	Year = {2002}}

@article{DRISEE,
	Author = {Keegan, K.P. and Trimble, W.L. and Wilkening, J. and Wilke, A. and Harrison, T. and D'Souza, M. and Meyer, F.},
	Journal = {PLOS Comput Biol},
	Number = {6},
	Pages = {e1002541},
	Title = {A platform-independent method for detecting errors in metagenomic sequencing data: {DRISEE}},
	Volume = {8},
	Year = {2012}}

@article{BLAT,
	Author = {Kent, W.J.},
	Journal = {Genome Res},
	Keywords = {Animals Computational Biology/*methods/statistics & numerical data DNA/genetics Humans Mice Protein Biosynthesis Proteins/chemistry RNA, Messenger/genetics Sequence Alignment/*methods/statistics & numerical data *Software},
	Number = {4},
	Pages = {656-64},
	Title = {{BLAT}--the {BLAST}-like alignment tool},
	Volume = {12},
	Year = {2002}}

@article{BOWTIE,
	Author = {Langmead, B. and Trapnell, C. and Pop, M. and Salzberg, S.L.},
	Journal = {Genome Biol},
	Keywords = {Algorithms *Base Sequence Genome, Human/*genetics Humans Sequence Alignment/*methods},
	Number = {3},
	Pages = {R25},
	Title = {Ultrafast and memory-efficient alignment of short {DNA} sequences to the human genome},
	Volume = {10},
	Year = {2009}}

@article{BIOM,
	Author = {McDonald, D. and Clemente, J.C. and Kuczynski, J. and Rideout, J. and Stombaugh, J. and Wendel, D. and Wilke, A. and Huse, S. and Hufnagle, J. and Meyer, F.},
	Journal = {Gigascience},
	Title = {The {B}iological {O}bservation {M}atrix ({BIOM}) format or: how {I} learned to stop worrying and love the ome-ome},
	Year = {2012}}

@article{FGS,
	Title={Frag{G}ene{S}can: predicting genes in short and error-prone reads},
	Author={Rho, Mina and Tang, Haixu and Ye, Yuzhen},
	Journal={Nucleic acids research},
	Volume={38},
	Number={20},
	Pages={e191--e191},
	Year={2010},
}

@article{SUBSYSTEMS,
	Author = {Overbeek, R. and Begley, T. and Butler, R.M. and Choudhuri, J.V. and Diaz, N. and Chuang, H.-Y. and Cohoon, M. and de Cr{\'e}cy-Lagard, V. and Disz, T. and Edwards, R and Fonstein, M and Frank, E.D. and Gerdes, S. and Glass, E.M. and Goesmann, A. and Krause, L. and Linke, B. and McHardy, A.C. and Meyer, F. and Hanson, A. and Iwata-Reuyl, D. and Jensen, R. and Jamshidi, N. and Kubal, M. and Larsen, N. and Neuweger, H. and R{\"u}ckert, C. and Olsen, G.J. and Olson, R. and Osterman, A. and Portnoy, V. and Pusch, G.D. and Rodionov, D.A. and Steiner, J. and Stevens, R. and Thiele, I. and Vassieva, O. and Ye, Y. and Zagnitko, O. and Vonstein, V.},
	Journal = {Nucleic Acids Res},
	Number = {17},
	Title = {The {S}ubsystems {A}pproach to {G}enome {A}nnotation and its {U}se in the {P}roject to {A}nnotate 1000 {G}enomes},
	Volume = {33},
	Year = {2005}}

@article{RARE,
	Author = {Reeder, J. and Knight, R.},
	Journal = {Nat Methods},
	Keywords = {Bacteria/genetics Base Sequence DNA, Bacterial/*genetics *Genome, Bacterial Genomics/*methods Sequence Analysis, DNA/*methods Software},
	Number = {9},
	Pages = {636-7},
	Title = {The `rare biosphere': a reality check},
	Volume = {6},
	Year = {2009}}

@article{TRIMBLE_SHORT,
	Author = {Trimble, W.L. and Keegan, K.P. and D'Souza, M. and Wilke, A. and Wilkening, J. and Gilbert, J. and Meyer, F.},
	Journal = {BMC Bioinformatics},
		Number = {1},
	Pages = {183},
	Title = {Short-read reading-frame predictors are not created equal: sequence error causes loss of signal},
	Volume = {13},
	Year = {2012}}

@article{OBESEMICE,
	Author = {Turnbaugh, P.J. and Ley, R.E. and Mahowald, M.A. and Magrini, V. and Mardis, E.R. and Gordon, J.I.},
	Journal = {Nature},
	Keywords = {Animals Bacteria/classification/genetics/isolation & purification/metabolism Cecum/*metabolism/*microbiology *Energy Metabolism Genome, Bacterial/genetics Mice Mice, Inbred C57BL Mice, Obese Obesity/*metabolism/*microbiology Sequence Analysis, DNA Thinness/microbiology},
	Number = {7122},
	Pages = {1027-31},
	Title = {An obesity-associated gut microbiome with increased capacity for energy harvest},
	Volume = {444},
	Year = {2006}}

@inproceedings{MGCLOUD,
	Author = {Wilkening, J. and Wilke, A. and Desai, N. and Meyer, F.},
	Booktitle = {IEEE Cluster 2009},
	year = {2009},
	Title = {Using Clouds for {M}etagenomics: A case study}}

@article{MIENS,
	Author = {Yilmaz, Pelin and Kottmann, Renzo and Field, Dawn and Knight, Rob and Cole, James and Amaral-Zettler, Linda and Gilbert, Jack and Karsch-Mizrachi, Ilene and Johnston, Anjanette  and Cochrane, Guy and Vaughan, Robert  and Hunter, Christopher and Park, Joonhong and Morrison, Norman and Rocca-Serra, Phillipe and Sterk, Peter and Arumugam, Mani and Baumgartner, Laura and Birren, Bruce and Blaser, Martin and Bonazzi, Vivien and Bork, Peer and Buttigieg, Pier Luigi and Chain, Patrick and Costello, Elizabeth and Huot-Creasy, Heather and Dawyndt, Peter and DeSantis, Todd and Fierer, Noah and Fuhrman, Jed and Gallery, Rachel and Gibbs, Richard and Giglio, Michelle Gwinn and San Gil, Inigo and Glass, Elizabeth and Gonzalez, Antonio and Gordon, Jeffrey and Guralnick, Robert and Hankeln, Wolfgang and Highlander, Sarah and Hugenholtz, Philip and Jansson, Janet and Kennedy, Jerry and Knights, Dan and Koren, Omry and Kuczynski, Justin and Kyrpides, Nikos and Larsen, Robert and Lauber, Christian and Legg, Teresa and Ley, Ruth and Lozupone, Catherine  and Ludwig, Wolfgang and Lyons, Donna and Maguire, Eamonn  and Meth{\'e}, Barbara and Meyer, Folker and Nakielny, Sara and Nelson, Karen and Nemergut, Diana and Neufeld, Josh and Pace, Norman and Palanisamy, Giriprakash and Peplies, J{\"o}rg and Peterson, Jane and Petrosino, Joseph and Proctor, Lita and Raes, Jeroen and Ratnasingham, Sujeevan and Ravel, Jacques and Relman, David and Assunta-Sansone, Susanna and Schriml, Lynn and Sodergren, Erica and Spor, Aym{\'e} and Stombaugh, Jesse and Tiedje, James and Ward, Doyle and Weinstock, George and Wendel, Doug and White, Owen and Wilke, Andreas and Wortmann, Jennifer and  Gl{\"o}ckner, Frank Oliver},
	Journal = {Nature Biotechnology},
	Title = {The ``{M}inimum {I}nformation about an {EN}vironmental {S}equence'' ({MIENS}) specification},
	Year = {2010}}
}

@unpublished{OPENMP,
    author = {OpenMP Architecture Review Board},
    title = {{OpenMP Application Program Interface Version 3.1}},
    month = {July},
    year = {2011},
    note = "This document is available as a PDF from \texttt{http://www.openmp.org/mp-documents/OpenMP3.1.pdf}",
}

@book{OPENMP.BAK,
   author = {Chapman, B. and Jost, G and Pas, R. van der},
   title = {Using OpenMP: Portable Shared Memory Parallel Programming (Scientific and Engineering Computation)},
   publisher = {The MIT Press},
   year = {2007}
}

@article{SOLEXAQA,
   author = {Cox, M.P. and Peterson, D. A. and Biggs, P.J.},
   title = {Solexa{QA}: {A}t-a-glance quality assessment of {I}llumina second-generation sequencing data},
   journal = {BMC Bioinformatics},
   volume = {11},
   pages = {485},
   keywords = {Base Sequence
Internet
Sequence Analysis, DNA/*methods
Sequence Analysis, RNA/*methods
*Software},
   year = {2010}
}

@article{IMG,
   author = {Markowitz, V.M. and Ivanova, N.N. and Szeto, E. and Palaniappan, K. and Chu, K. and Dalevi, D. and Chen, I. M. and Grechkin, Y. and Dubchak, I. and Anderson, I. and Lykidis, A. and Mavromatis, K. and Hugenholtz, P. and Kyrpides, N.C.},
   title = {{IMG/M}: a data management and analysis system for metagenomes},
   journal = {Nucleic Acids Res},
   volume = {36},
   number = {Database issue},
   pages = {D534-8},
   keywords = {Database Management Systems
*Databases, Genetic
*Environmental Microbiology
*Genome, Archaeal
*Genome, Bacterial
Genomics
Internet
Software},
   year = {2008}
}

@article{COG,
   author = {Tatusov, R.L. and Fedorova, N.D. and Jackson, J.D. and Jacobs, A.R. and Kiryutin, B. and Koonin, E.V. and Krylov, D.M. and Mazumder, R. and Mekhedov, S.L. and Nikolskaya, A.N. and Rao, B.S. and Smirnov, S. and Sverdlov, A.V. and Vasudevan, S. and Wolf, Y.I. and Yin, J.J. and Natale, D.A.},
   title = {The {COG} database: an updated version includes eukaryotes},
   journal = {BMC Bioinformatics},
   volume = {4},
   pages = {41},
   year = {2003}
}

@article{AWE,
   author = {Wilke, A. and Wilkening, J. and Glass, E.M. and Desai, N. and Meyer, F.},
   title = {An experience report: porting the {MG-RAST} rapid metagenomics analysis pipeline to the cloud. },
   journal = {Concurrency and Computation: Practice and Experience},
   volume = { 23},
   number = {17},
   pages = {2250–2257},
   year = {2011}
}

@article{M5NR,
   author = {Wilke, A. and Harrison, T. and Wilkening, J. and Field, D. and Glass, E.M. and Kyrpides, N. and Mavrommatis, K. and Meyer, F.},
   title = {The {M}5nr: a novel non-redundant database containing protein sequences and annotations from multiple sources and associated tools},
   journal = {BMC Bioinformatics},
   volume = {13},
   pages = {141},
   year = {2012}
}

@article{KRONA,
   author = {Ondov, B.D. and Bergman, N.H. and Phillippy, A.M.},
   title = {Interactive metagenomic visualization in a Web browser},
   journal = {BMC Bioinformatics},
   volume = {12},
   pages = {385},
   year = {2011}
}

@article{CRISPRS,
   author = {Bolotin, A. and Quinquis, B. and Sorokin, A. and Ehrlich, S.D.},
   title = {Clustered regularly interspaced short palindrome repeats ({CRISPR}s) have spacers of extrachromosomal origin},
   journal = {Microbiology},
   volume = {151},
   number = {Pt 8},
   pages = {2551-61},
   abstract = {Numerous prokaryote genomes contain structures known as clustered regularly interspaced short palindromic repeats (CRISPRs), composed of 25-50 bp repeats separated by unique sequence spacers of similar length. CRISPR structures are found in the vicinity of four genes named cas1 to cas4. In silico analysis revealed another cluster of three genes associated with CRISPR structures in many bacterial species, named here as cas1B, cas5 and cas6, and also revealed a certain number of spacers that have homology with extant genes, most frequently derived from phages, but also derived from other extrachromosomal elements. Sequence analysis of CRISPR structures from 24 strains of Streptococcus thermophilus and Streptococcus vestibularis confirmed the homology of spacers with extrachromosomal elements. Phage sensitivity of S. thermophilus strains appears to be correlated with the number of spacers in the CRISPR locus the strain carries. The authors suggest that the spacer elements are the traces of past invasions by extrachromosomal elements, and hypothesize that they provide the cell immunity against phage infection, and more generally foreign DNA expression, by coding an anti-sense RNA. The presence of gene fragments in CRISPR structures and the nuclease motifs in cas genes of both cluster types suggests that CRISPR formation involves a DNA degradation step.},
   keywords = {DNA, Intergenic/*genetics
Extrachromosomal Inheritance/*genetics
Genes, Bacterial
Genome, Bacterial
Molecular Sequence Data
Phylogeny
Repetitive Sequences, Nucleic Acid/*genetics
Streptococcus/chemistry/*genetics},
   year = {2005}
}
@Article{MG-RAST,
AUTHOR = {Meyer, F. and Paarmann, D. and D'Souza, M. and Olson, R. and Glass, E.M. and Kubal, M. and Paczian, T. and Rodriguez, A. and Stevens, R. and Wilke, A. and Wilkening, J. and Edwards, R.A.},
TITLE = {The metagenomics {RAST} server - a public resource for the automatic phylogenetic and functional analysis of metagenomes},
JOURNAL = {BMC Bioinformatics},
VOLUME = {9},
YEAR = {2008},
NUMBER = {1},
PAGES = {386},
URL = {http://www.biomedcentral.com/1471-2105/9/386},
DOI = {10.1186/1471-2105-9-386},
PubMedID = {18803844},
ISSN = {1471-2105},
ABSTRACT = {BACKGROUND:Random community genomes (metagenomes) are now commonly used to study microbes in different environments. Over the past few years, the major challenge associated with metagenomics shifted from generating to analyzing sequences. High-throughput, low-cost next-generation sequencing has provided access to metagenomics to a wide range of researchers.RESULTS:A high-throughput pipeline has been constructed to provide high-performance computing to all researchers interested in using metagenomics. The pipeline produces automated functional assignments of sequences in the metagenome by comparing both protein and nucleotide databases. Phylogenetic and functional summaries of the metagenomes are generated, and tools for comparative metagenomics are incorporated into the standard views. User access is controlled to ensure data privacy, but the collaborative environment underpinning the service provides a framework for sharing datasets between multiple users. In the metagenomics RAST, all users retain full control of their data, and everything is available for download in a variety of formats.CONCLUSION:The open-source metagenomics RAST service provides a new paradigm for the annotation and analysis of metagenomes. With built-in support for multiple data sources and a back end that houses abstract data types, the metagenomics RAST is stable, extensible, and freely available to all researchers. This service has removed one of the primary bottlenecks in metagenome sequence analysis - the availability of high-performance computing for annotating the data.http://metagenomics.nmpdr.org webcite},
}

@book{1584883278,
  Author = {Terry Speed},
  Title = {Statistical Analysis of Gene Expression Microarray Data},
  Publisher = {Chapman and Hall/CRC},
  Year = {2003},
  ISBN = {1584883278},
  URL = {http://www.amazon.com/Statistical-Analysis-Gene-Expression-Microarray/dp/1584883278/}
}

@Article{THOMASREVIEW,
AUTHOR = {Thomas, Torsten and Gilbert, Jack and Meyer, Folker},
TITLE = {Metagenomics - a guide from sampling to data analysis},
JOURNAL = {Microbial Informatics and Experimentation},
VOLUME = {2},
YEAR = {2012},
NUMBER = {1},
PAGES = {3},
URL = {http://www.microbialinformaticsj.com/content/2/1/3},
DOI = {10.1186/2042-5783-2-3},
PubMedID = {22587947},
ISSN = {2042-5783},
ABSTRACT = {Metagenomics applies a suite of genomic technologies and bioinformatics tools to directly access the genetic content of entire communities of organisms. The field of metagenomics has been responsible for substantial advances in microbial ecology, evolution, and diversity over the past 5 to 10 years, and many research laboratories are actively engaged in it now. With the growing numbers of activities also comes a plethora of methodological knowledge and expertise that should guide future developments in the field. This review summarizes the current opinions in metagenomics, and provides practical guidance and advice on sample processing, sequencing technology, assembly, binning, annotation, experimental design, statistical analysis, data storage, and data sharing. As more metagenomic datasets are generated, the availability of standardized procedures and shared data storage and analysis becomes increasingly important to ensure that output of individual projects can be assessed and compared.},
}

@Article{LOMAN,
title={Performance comparison of benchtop high-throughput sequencing platforms},
url={http://www.nature.com/nbt/journal/v30/n5/full/nbt.2198.html},
DOI={10.1038/nbt.2198},
journal={Nature Biotechnology},
author={Nicholas J. Loman and Raju V. Misra and Timothy J. Dallman and Chrystala Constantinidou and Saheer E Gharbia and John Wain and Mark J. Pallen},
year={2012},
volume={30},
number={5},
pages={434--439}
}

@Article{GCDML,
title={A standard {MIGS/MIMS} compliant {XML} {S}chema: toward the development of the {G}enomic {C}ontextual {D}ata {M}arkup {L}anguage ({GCDML})},
DOI={10.1089/omi.2008.0A10},
number={2},
volume={12},
journal={OMICS},
author={Kottmann R. and Gray T. and Murphy S. and Kagan L. and Kravitz S. and Lombardot T. and Field D. and Glöckner FO; Genomic Standards Consortium},
year={2008},
pages={115-21}
}

@Misc{NHGRI_COST,
title={Cost per Raw Megabase of DNA Sequence},
author={National Human Genome Research Institute},
note = "This document is available on the NHGRI website at \texttt{http://www.genome.gov/sequencingcosts/}",
url={http://www.genome.gov/images/content/cost\_per\_megabase.jpg},
year={2012}
}

@Misc{HTML5FILEAPI,
title={File {API}; {W3C} {W}orking {D}raft, 25 {O}ctober 2012},
author={W3C},
url={http://www.w3.org/TR/FileAPI/},
year={2012}
}

@Article{RAST,
AUTHOR = {Aziz, Ramy and Bartels, Daniela and Best, Aaron and DeJongh, Matthew and Disz, Terrence and Edwards, Robert and Formsma, Kevin and Gerdes, Svetlana and Glass, Elizabeth and Kubal, Michael and Meyer, Folker and Olsen, Gary and Olson, Robert and Osterman, Andrei and Overbeek, Ross and McNeil, Leslie and Paarmann, Daniel and Paczian, Tobias and Parrello, Bruce and Pusch, Gordon and Reich, Claudia and Stevens, Rick and Vassieva, Olga and Vonstein, Veronika and Wilke, Andreas and Zagnitko, Olga},
TITLE = {The {RAST} {S}erver: {R}apid {A}nnotations using {S}ubsystems {T}echnology},
JOURNAL = {BMC Genomics},
VOLUME = {9},
YEAR = {2008},
NUMBER = {1},
PAGES = {75},
URL = {http://www.biomedcentral.com/1471-2164/9/75},
DOI = {10.1186/1471-2164-9-75},
PubMedID = {18261238},
ISSN = {1471-2164},
}

@article{REFSEQ,
       address = {National Center for Biotechnology Information, National Library of Medicine, National Institutes of Health, Rm 6An.12J, 45 Center Drive, Bethesda, MD 20892-6510, USA. pruitt@ncbi.nlm.nih.gov},
    author = {Pruitt, K.D. and Tatusova, T. and Maglott, D.R.},
    citeulike-article-id = {1453943},
    citeulike-linkout-0 = {http://view.ncbi.nlm.nih.gov/pubmed/17130148},
    citeulike-linkout-1 = {http://www.hubmed.org/display.cgi?uids=17130148},
    issn = {1362-4962},
    journal = {Nucleic Acids Res},
    keywords = {database, protein},
    month = jan,
    number = {Database issue},
    pmid = {17130148},
    posted-at = {2007-08-08 08:39:02},
    priority = {2},
    title = {{NCBI} reference sequences ({R}ef{S}eq): a curated non-redundant sequence database of genomes, transcripts and proteins.},
    url = {http://view.ncbi.nlm.nih.gov/pubmed/17130148},
    volume = {35},
    year = {2007}
}

@article{UNIPROT,
    author = {Magrane, Michele and Consortium, UniProt},
    citeulike-article-id = {9076667},
    citeulike-linkout-0 = {http://dx.doi.org/10.1093/database/bar009},
    citeulike-linkout-1 = {http://database.oxfordjournals.org/content/2011/bar009.abstract},
    citeulike-linkout-2 = {http://database.oxfordjournals.org/content/2011/bar009.full.pdf},
    citeulike-linkout-3 = {http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3070428/},
    citeulike-linkout-4 = {http://view.ncbi.nlm.nih.gov/pubmed/21447597},
    citeulike-linkout-5 = {http://www.hubmed.org/display.cgi?uids=21447597},
    day = {1},
    doi = {10.1093/database/bar009},
    issn = {1758-0463},
    journal = {Database: the journal of biological databases and curation},
    keywords = {uniprot},
    month = jan,
    pmcid = {PMC3070428},
    pmid = {21447597},
    posted-at = {2011-08-09 13:13:31},
    priority = {2},
    publisher = {Oxford University Press},
    title = {Uni{P}rot {K}nowledgebase: a hub of integrated protein data.},
    url = {http://dx.doi.org/10.1093/database/bar009},
    volume = {2011},
    year = {2011}
}
@article{PATRIC,
        address = {Virginia Bioinformatics Institute, Virginia Polytechnic Institute and State University, Blacksburg, VA 24061, USA. eesnyder@vbi.vt.edu},
    author = {Snyder, E.E. and Kampanya, N. and Lu, J. and Nordberg, E.K. and Karur, H.R. and Shukla, M. and Soneja, J. and Tian, Y. and Xue, T. and Yoo, H. and Zhang, F. and Dharmanolla, C. and Dongre, N.V. and Gillespie, J.J. and Hamelius, J. and Hance, M. and Huntington, K.I. and Jukneliene, D. and Koziski, J. and Mackasmiel, L. and Mane, S.P. and Nguyen, V. and Purkayastha, A. and Shallom, J. and Yu, G. and Guo, Y. and Gabbard, J. and Hix, D. and Azad, A.F. and Baker, S.C. and Boyle, S.M. and Khudyakov, Y. and Meng, X.J. and Rupprecht, C. and Vinje, J. and Crasta, O.R. and Czar, M.J. and Dickerman, A. and Eckart, J.D. and Kenyon, R. and Will, R. and Setubal, J.C. and Sobral, B.W.},
    citeulike-article-id = {1825242},
    citeulike-linkout-0 = {http://dx.doi.org/10.1093/nar/gkl858},
    citeulike-linkout-1 = {http://view.ncbi.nlm.nih.gov/pubmed/17142235},
    citeulike-linkout-2 = {http://www.hubmed.org/display.cgi?uids=17142235},
    doi = {10.1093/nar/gkl858},
    issn = {1362-4962},
    journal = {Nucleic Acids Res},
    keywords = {bruno-sobral, patric, vbi},
    month = jan,
    number = {Database issue},
    pmid = {17142235},
    posted-at = {2007-10-26 15:15:57},
    priority = {2},
    title = {{PATRIC}: the {VBI} {PathoSystems} {R}esource {I}ntegration {C}enter.},
    url = {http://dx.doi.org/10.1093/nar/gkl858},
    volume = {35},
    year = {2007}
}

@article{SILVA,
    author = {Pruesse, Elmar and Quast, Christian and Knittel, Katrin and Fuchs, Bernhard M. and Ludwig, Wolfgang and Peplies, J\"{o}rg and Gl\"{o}ckner, Frank Oliver O.},
    day = {1},
    doi = {10.1093/nar/gkm864},
    issn = {1362-4962},
    journal = {Nucleic acids research},
    keywords = {database, rna},
    month = dec,
    number = {21},
    pages = {7188--7196},
    pmcid = {PMC2175337},
    pmid = {17947321},
    posted-at = {2011-03-17 14:27:25},
    priority = {2},
    title = {{SILVA}: a comprehensive online resource for quality checked and aligned ribosomal {RNA} sequence data compatible with {ARB}.},
    url = {http://dx.doi.org/10.1093/nar/gkm864},
    volume = {35},
    year = {2007}
}

@article{GREENGENES,
    address = {Center for Environmental Biotechnology, Lawrence Berkeley National Laboratory, 1 Cyclotron Road, Mail Stop 70A-3317, Berkeley, CA 94720, USA.},
    author = {DeSantis, T.Z. and Hugenholtz, P. and Larsen, N. and Rojas, M. and Brodie, E.L. and Keller, K. and Huber, T. and Dalevi, D. and Hu, P. and Andersen, G.L.},
    day = {1},
    doi = {10.1128/aem.03006-05},
    issn = {0099-2240},
    journal = {Appl. Environ. Microbiol.},
    keywords = {greengenes},
    month = jul,
    number = {7},
    pages = {5069--5072},
    pmcid = {PMC1489311},
    pmid = {16820507},
    posted-at = {2011-04-21 00:36:50},
    priority = {2},
    title = {Greengenes, a {C}himera-{C}hecked{16S} {rRNA} {G}ene {D}atabase and {W}orkbench {C}ompatible with {ARB}},
    url = {http://dx.doi.org/10.1128/aem.03006-05},
    volume = {72},
    year = {2006}
}

@article{RDP,
    author = {Cole, J.R. and Chai, B. and Marsh, T.L. and Farris, R.J. and Wang, Q. and Kulam, S.A. and Chandra, S. and McGarrell, D.M. and Schmidt, T.M. and Garrity, G.M. and Tiedje, J.M. and {R}ibosomal {D}atabase {P}roject},
    day = {1},
    issn = {1362-4962},
    journal = {Nucleic acids research},
    keywords = {bacteria, database, rna},
    month = jan,
    number = {1},
    pages = {442--443},
    pmcid = {PMC165486},
    pmid = {12520046},
    posted-at = {2011-03-25 11:32:56},
    priority = {2},
    title = {The {R}ibosomal {D}atabase {P}roject ({RDP}-{II}): previewing a new autoaligner that allows regular updates and the new prokaryotic taxonomy.},
    url = {http://www.ncbi.nlm.nih.gov/pmc/articles/PMC165486/},
    volume = {31},
    year = {2003}
}

repository: wltrimbl/tech-report

repo_name: wltrimbl/tech-report


text:
// Copyright (c) 2015 Uber Technologies, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

package ringpop

import (
	"github.com/temporalio/tchannel-go/json"
	"golang.org/x/net/context"
)

// TODO: EVERYTHING!

// Arg is a blank arg
type Arg struct{}

func (rp *Ringpop) registerHandlers() error {
	handlers := map[string]interface{}{
		"/health":       rp.health,
		"/admin/stats":  rp.adminStatsHandler,
		"/admin/lookup": rp.adminLookupHandler,
	}

	return json.Register(rp.subChannel, handlers, func(ctx context.Context, err error) {
		rp.logger.WithField("error", err).Info("error occured")
	})
}

func (rp *Ringpop) health(ctx json.Context, req *Arg) (*Arg, error) {
	return nil, nil
}

func (rp *Ringpop) adminStatsHandler(ctx json.Context, req *Arg) (map[string]interface{}, error) {
	return handleStats(rp), nil
}

type lookupRequest struct {
	Key string `json:"key"`
}

type lookupResponse struct {
	Dest string `json:"dest"`
}

func (rp *Ringpop) adminLookupHandler(ctx json.Context, req *lookupRequest) (*lookupResponse, error) {
	dest, err := rp.Lookup(req.Key)
	if err != nil {
		return nil, err
	}
	return &lookupResponse{Dest: dest}, nil
}

func (rp *Ringpop) adminReloadHandler(ctx json.Context, req *Arg) (*Arg, error) {
	return nil, nil
}

repository: temporalio/ringpop-go

repo_name: temporalio/ringpop-go

gha_language: Go


text:
package config

import (
	"fmt"
	"github.com/viant/toolbox"
	"strings"
	"sync/atomic"
	"time"
)

//Rotation rotation rotation config
type Rotation struct {
	EveryMs        int
	MaxEntries     int
	URL            string
	Codec          string
	Emit           *Event
	url            string
	hasSeq         bool
	timeStartIndex int
	timeEndIndex   int
	timeLayout     string
	sequence       int32
}

//IsGzip returns true if gzip codec specified
func (r *Rotation) IsGzip() bool {
	return strings.ToLower(r.Codec) == "gzip"
}

//Init initialises rotation
func (r *Rotation) Init() {
	r.hasSeq = strings.Contains(r.URL, "%")
	r.timeLayout = r.URL
	r.timeEndIndex = strings.Index(r.URL, "]")
	r.timeStartIndex = strings.Index(r.URL, "[")
	if r.timeStartIndex != -1 && r.timeEndIndex == -1 {
		timeTemplate := r.URL[r.timeStartIndex+1 : r.timeEndIndex]
		r.timeLayout = toolbox.DateFormatToLayout(timeTemplate)
	}
	if r.Emit != nil {
		r.Emit.Init()
	}
}

//ExpiryTime returns expiry time
func (r Rotation) ExpiryTime(created time.Time) *time.Time {
	if r.EveryMs == 0 {
		return nil
	}
	expiry := created.Add(time.Duration(r.EveryMs) * time.Millisecond)
	return &expiry
}

//ExpandURL expand rotation URL with log sequence,  time and ID
func (r *Rotation) ExpandURL(t time.Time, ID string) string {
	URL := r.URL
	if r.timeEndIndex > 0 {
		timeValue := t.Format(r.timeLayout)
		URL = r.URL[:r.timeStartIndex] + timeValue + r.URL[r.timeEndIndex+1:]
	}
	if !r.hasSeq {
		return URL
	}
	if r.url == URL {
		atomic.AddInt32(&r.sequence, 1)
	} else {
		atomic.StoreInt32(&r.sequence, 0)
	}
	r.url = URL
	return fmt.Sprintf(URL, fmt.Sprintf("%v-%v", ID, atomic.LoadInt32(&r.sequence)))
}

repository: qasimhbti/tapper

repo_name: qasimhbti/tapper


text:
include(CMakeDependentOption)

# Installation directories
##########################

set(INSTALL_INCLUDE_DIR include CACHE PATH
   "Installation directory for headers")
if(WIN32 AND NOT CYGWIN)
   set(DEF_INSTALL_CMAKE_DIR CMake)
else()
   set(DEF_INSTALL_CMAKE_DIR lib/cmake/viennagrid)
endif()
set(INSTALL_CMAKE_DIR ${DEF_INSTALL_CMAKE_DIR} CACHE PATH
   "Installation directory for CMake files")

if(NOT IS_ABSOLUTE "${INSTALL_CMAKE_DIR}")
   set(INSTALL_CMAKE_DIR "${CMAKE_INSTALL_PREFIX}/${INSTALL_CMAKE_DIR}")
endif()
file(RELATIVE_PATH CONF_REL_INSTALL_PREFIX "${INSTALL_CMAKE_DIR}"
   "${CMAKE_INSTALL_PREFIX}")
if(NOT IS_ABSOLUTE "${INSTALL_INCLUDE_DIR}")
   set(INSTALL_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/${INSTALL_INCLUDE_DIR}")
endif()
file(RELATIVE_PATH CONF_REL_INCLUDE_DIR "${INSTALL_CMAKE_DIR}"
   "${INSTALL_INCLUDE_DIR}")

# User options
##############

option(BUILD_DOXYGEN_DOCS "Build the Doxygen-generated API docs" OFF)

option(BUILD_MANUAL "Build the PDF manual" OFF)

option(BUILD_EXAMPLES "Build example programs" ON)

option(ENABLE_VIENNADATA "Enable ViennaData for advanced accessors" OFF)

mark_as_advanced(ENABLE_PEDANTIC_FLAGS)

include_directories(${PROJECT_SOURCE_DIR})
INCLUDE_DIRECTORIES("${PROJECT_SOURCE_DIR}/external/")

# Set high warning level on GCC
if(ENABLE_PEDANTIC_FLAGS)
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic")
endif()

if(ENABLE_VIENNADATA)
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DVIENNAGRID_WITH_VIENNADATA")
endif()

# Export
########

configure_file(cmake/ViennaGridConfig.cmake.in
   ${PROJECT_BINARY_DIR}/ViennaGridConfig.cmake @ONLY)

configure_file(cmake/ViennaGridConfigVersion.cmake.in
   ${PROJECT_BINARY_DIR}/ViennaGridConfigVersion.cmake @ONLY)

if (CMAKE_MINOR_VERSION GREATER 6)  # export(PACKAGE ...) introduced with CMake 2.8.0
  export(PACKAGE ViennaGrid)
endif()

# Install
#########

install(FILES
   ${PROJECT_BINARY_DIR}/ViennaGridConfig.cmake
   ${PROJECT_BINARY_DIR}/ViennaGridConfigVersion.cmake
   DESTINATION ${INSTALL_CMAKE_DIR} COMPONENT dev)

repository: viennagrid/viennagrid-dev

repo_name: viennagrid/viennagrid-dev


text:
package main

import (
	"database/sql"
	"encoding/base64"
	"encoding/json"
	"fmt"
	"io/ioutil"
	"log"
	"net/http"
	"os"
	"regexp"
	"strconv"
	"strings"
	"time"

	"github.com/joho/godotenv"

	_ "github.com/go-sql-driver/mysql"

	"golang.org/x/net/context"
	"golang.org/x/oauth2"
	"golang.org/x/oauth2/google"
	"google.golang.org/api/gmail/v1"
)

// Indicators for extracting features.
const (
	GrandTotal   = "Grand total:"
	DeliveryTime = "delivery time:"
	OrderID      = "Details Order"
)

// String Longform used for Parsing Strings to type Time
const (
	longform  = "Jan 2, 2006 at 3:04pm (MST)"
	shortform = "2006-Jan-02"
)

const query = "{from:order-update@amazon.com} 'your delivery is complete' 'Grand total'"

// Monthmap connects abbreviated name of month to corresponding int
var Monthmap = map[string]string{
	"Jan": "01",
	"Feb": "02",
	"Mar": "03",
	"Apr": "04",
	"May": "05",
	"Jun": "06",
	"Jul": "07",
	"Aug": "08",
	"Sep": "09",
	"Oct": "10",
	"Nov": "11",
	"Dec": "12",
}

// Retrieve a token, saves the token, then returns the generated client.
func getClient(config *oauth2.Config) *http.Client {
	// The file token.json stores the user's access and refresh tokens, and is
	// created automatically when the authorization flow completes for the first
	// time.
	tokFile := "token.json"
	tok, err := tokenFromFile(tokFile)
	if err != nil {
		tok = getTokenFromWeb(config)
		saveToken(tokFile, tok)
	}
	return config.Client(context.Background(), tok)
}

// Request a token from the web, then returns the retrieved token.
func getTokenFromWeb(config *oauth2.Config) *oauth2.Token {
	authURL := config.AuthCodeURL("state-token", oauth2.AccessTypeOffline)
	fmt.Printf("Go to the following link in your browser then type the "+
		"authorization code: \n%v\n", authURL)

	var authCode string
	if _, err := fmt.Scan(&authCode); err != nil {
		log.Fatalf("Unable to read authorization code: %v", err)
	}

	tok, err := config.Exchange(context.TODO(), authCode)
	if err != nil {
		log.Fatalf("Unable to retrieve token from web: %v", err)
	}
	return tok
}

// Retrieves a token from a local file.
func tokenFromFile(file string) (*oauth2.Token, error) {
	f, err := os.Open(file)
	if err != nil {
		return nil, err
	}
	defer f.Close()
	tok := &oauth2.Token{}
	err = json.NewDecoder(f).Decode(tok)
	return tok, err
}

// Saves a token to a file path.
func saveToken(path string, token *oauth2.Token) {
	fmt.Printf("Saving credential file to: %s\n", path)
	f, err := os.OpenFile(path, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0600)
	if err != nil {
		log.Fatalf("Unable to cache oauth token: %v", err)
	}
	defer f.Close()
	json.NewEncoder(f).Encode(token)
}

// Order TYPE has properties ID, Date, Total.
type Order struct {
	OrdNum     string
	OrdDate    string
	GrandTotal float64
}

//GetSummary of the properties.
func (order Order) GetSummary() {
	fmt.Println(order.OrdNum, order.OrdDate, order.GrandTotal)
}

// GetOrdDate changes OrdDate in Stringform to time.Time
func (order Order) GetOrdDate() time.Time {
	date, err := time.Parse(shortform, order.OrdDate)
	if err != nil {
		log.Fatal("cannot convert OrdDate to time.Time", err)
	}
	return date
}

// ConvtoTime casts dates written in strings to type time.Time.
func ConvtoTime(t string) string {
	rawtime := strings.Fields(t)[1:]
	month := rawtime[0][:3]
	day := strings.Trim(rawtime[1], ",")
	dayint, err := strconv.Atoi(day)
	if err != nil {
		log.Fatal("cannot convert day to int", err)
	}
	if dayint < 10 {
		day = "0" + day
	}
	year := rawtime[2]
	shortdate := year + "-" + Monthmap[month] + "-" + day
	return shortdate
}

// ExtractFeat finds the order Id, Date, Grand Total given email body as string.
func ExtractFeat(s *[]byte) (id string, date string, tot float64) {
	info := strings.Fields(string(*s))
	var idFound bool = false
	var dtFound bool = false
	var totFound bool = false
	for i := 0; i < len(info)-20; i++ {
		if !dtFound && strings.Join(info[i:i+2], " ") == DeliveryTime {
			rawdate := strings.Join(info[i+2:i+2+4], " ")
			date = ConvtoTime(rawdate)
			dtFound = true
		} else if !totFound && strings.Join(info[i:i+2], " ") == GrandTotal {
			trim := strings.Trim(info[i+2], "$")
			total, err := strconv.ParseFloat(trim, 64)
			if err != nil {
				log.Fatal("cannot convert Grand Total to float", err)
			}
			if total <= 0 {
				log.Fatal("cannot convert Grand Total to float")
			} else {
				tot = total
			}
			totFound = true
		} else if !idFound && strings.Join(info[i:i+2], " ") == OrderID {
			id = info[i+2]
			idFound = true
		}
	}
	return id, date, tot
}

// GetOrderFeats creates an array of Order structs.
func GetOrderFeats(user string, srv *gmail.Service, r *gmail.ListMessagesResponse) []Order {
	Orders := []Order{}
	for _, msg := range r.Messages {
		RawMsg, err := srv.Users.Messages.Get(user, msg.Id).Do()
		if err != nil {
			log.Fatalf("Message %v not retrieved. Moving on to the next message", err)
		}
		BodyMsg := RawMsg.Payload.Parts[0].Body.Data
		StrBody, err := base64.URLEncoding.DecodeString(BodyMsg)
		if err != nil {
			log.Fatalf("Message %v not retrieved. Moving on to the next message", err)
		}
		id, date, tot := ExtractFeat(&StrBody)
		fmt.Println(id, date, tot)
		Orders = append(Orders, Order{OrdNum: id, OrdDate: date, GrandTotal: tot})
	}
	return Orders
}

// InsertOrder to db.
func InsertOrder(Orders []Order, db *sql.DB) {
	for i, ord := range Orders {
		id := ord.OrdNum
		DateString := ord.OrdDate
		total := fmt.Sprintf("%f", ord.GrandTotal)
		values := "'" + id + "', '" + DateString + "', " + total
		sql := "INSERT INTO WholeFoods(order_id, order_date, grand_total) VALUES" +
			"(" + values + ")"
		_, err := db.Exec(sql)
		if err != nil {
			log.Printf("cannot add %d th row to database", i)
			log.Fatal(err)
		}
	}
}

// GetQuery forms a SQL Query using lastupdate
func GetQuery(query string, lastupdate string) string {
	re := regexp.MustCompile("-")
	lastupdate = re.ReplaceAllString(lastupdate, "/")
	re = regexp.MustCompile("[A-Za-z]+")
	lastupdate = re.ReplaceAllString(lastupdate, Monthmap[lastupdate[5:8]])
	NewQuery := query + " after:" + lastupdate
	return NewQuery
}

// ReadData retrieves relevant Emails.
func ReadData(srv *gmail.Service, lastupdate string) []Order {
	const user = "me"
	NewQuery := GetQuery(query, lastupdate)
	r, err := srv.Users.Messages.List(user).IncludeSpamTrash(false).MaxResults(10).Q(NewQuery).Do()
	if err != nil {
		log.Fatalf("Unable to retrieve mails: %v", err)
	}
	fmt.Println("The length of the list is", len(r.Messages))

	//extract features from emails
	Orders := GetOrderFeats(user, srv, r)
	if len(Orders) == 0 {
		log.Fatal("Orders is empty")
	}

	//Save Newly extracted Data as temporary json file
	Ordfile, err := json.Marshal(Orders)
	if err != nil {
		log.Fatal("Can't marshall json", err)
	}
	ioutil.WriteFile("Orders.json", Ordfile, os.ModePerm)

	return Orders
}

//UpdateDB with new records after the lastupdate date
func UpdateDB(srv *gmail.Service, lastupdate string, db *sql.DB) {

	// Retrieve Data from Email Address
	Orders := ReadData(srv, lastupdate)

	//insert data into db
	InsertOrder(Orders, db)
	fmt.Println("successfully uploaded data")
}

//RetrieveOrders from mySQL Database.
func RetrieveOrders(db *sql.DB, cond *Conditions) *[]Order {
	var OrdData []Order
	sql := (*cond).GetQuery()
	fmt.Println(sql)
	rows, err := db.Query(sql)
	if err != nil {
		log.Fatal("cannot load data from mySQL database")
	}
	defer rows.Close()

	for rows.Next() {
		var ord Order
		var id string
		err = rows.Scan(&id, &ord.OrdNum, &ord.OrdDate, &ord.GrandTotal)
		if err != nil {
			log.Fatal("cannot retrieve data", err)
		}
		fmt.Print(id)
		ord.GetSummary()
		OrdData = append(OrdData, ord)
	}
	return &OrdData
}

// Conditions is a struct which contains information for writing a select query
type Conditions struct {
	start   string
	end     string
	lb      string
	ub      string
	numrows string
}

// GetNumRows Retrieves the property numrows as float64
func (c Conditions) GetNumRows() int {
	nr, err := strconv.Atoi(c.numrows)
	if err != nil {
		log.Fatal("cannot retrieve numrows as int", err)
	}
	return nr
}

// GetConditions retrieves summary of the conditions as a string
func (c Conditions) GetConditions() string {
	cond := "Date: " + c.start + "~" + c.end + "/ "
	cond += "Total amount: " + c.lb + " ~ " + c.ub + "/ "
	cond += "Number of Rows: " + c.numrows + "/ "
	return cond
}

//GetQuery function creates a Query for retrieving data from mySQL
func (c Conditions) GetQuery() string {
	Query := "SELECT * from Wholefoods where '" + c.start + "' < order_date and order_date < '" + c.end + "' and " + c.lb + " < grand_total and grand_total < " + c.ub + " limit " + c.numrows
	return Query
}

//GetSumQuery writes a Query that retrieves a summary statistics
func (c Conditions) GetSumQuery() string {
	subquery := c.GetQuery()
	Query := "SELECT DATEDIFF(max(t1.order_date), min(t1.order_date)) as gap, avg(t1.grand_total) as spending from (" + subquery + ") t1;"
	return Query
}

//CreateView collects conditions for desired data
func CreateView(srv *gmail.Service, db *sql.DB) {
	Condmap := map[int]bool{
		1: false,
		2: false,
		3: false,
	}
	condInit := Conditions{
		start:   "2021-01-01",
		end:     "2021-05-01",
		lb:      "0.0",
		ub:      "100000",
		numrows: "100",
	}
	cond := condInit
	var cat int
CondPanel:
	for {
		fmt.Println("Specify conditions for the data you want to view: ")
		fmt.Println("Current Conditions are: ", cond.GetConditions())
		fmt.Println("Add Conditions of...")
		fmt.Println("1. Date")
		fmt.Println("2. Total Amount")
		fmt.Println("3. Number of Rows")
		fmt.Println("4. Retrieve All data")
		fmt.Println("5. Retrieve With Current Condition")
		fmt.Println("6. Return to Main")
		fmt.Scanln(&cat)
		switch cat {
		case 1:
			if Condmap[1] {
				var resp string
				fmt.Println("Dates Already Specified. Do you want to Override? yes/no")
				fmt.Scanln(&resp)
				if resp == "no" {
					continue
				}
			}
			var start string
			var end string
			fmt.Println("Enter Starting Date: (format yyyy-mm-dd)")
			fmt.Scanln(&start)
			cond.start = start
			fmt.Println("Enter End Date: (format yyyy-mm-dd)")
			fmt.Scanln(&end)
			cond.end = end
			Condmap[1] = true
		case 2:
			if Condmap[2] {
				var resp string
				fmt.Println("Total Amount Already Specified. Do you want to Override? yes/no")
				fmt.Scanln(&resp)
				if resp == "no" {
					continue
				}
			}
			var lb string
			var ub string
			fmt.Println("1. Greater Than")
			fmt.Scanln(&lb)
			cond.lb = lb
			fmt.Println("2. Less Than")
			fmt.Scanln(&ub)
			cond.ub = ub
			Condmap[2] = true
		case 3:
			if Condmap[3] {
				var resp string
				fmt.Println("Number of Rows Already Specified. Do you want to Override? yes/no")
				fmt.Scanln(&resp)
				if resp == "no" {
					continue
				}
			}
			var numrows string
			fmt.Println("How Many Rows do you want?")
			fmt.Scanln(&numrows)
			cond.numrows = numrows
			Condmap[3] = true
		case 4:
			fmt.Println("Retrieving All data")
			_ = RetrieveOrders(db, &condInit)
		case 5:
			fmt.Println("Retrieving Data with conditions: ", cond.GetConditions())
			_ = RetrieveOrders(db, &cond)
			break CondPanel
		case 6:
			break CondPanel
		default:
			fmt.Println("Not a valid category")
			continue
		}
	}
	return
}

// ShowPattern summarizes purchase patterns
func ShowPattern(db *sql.DB, cond *Conditions) {
	SumQuery := cond.GetSumQuery()
	rows, err := db.Query(SumQuery)
	if err != nil {
		log.Fatal("cannot get summary data", err)
	}
	var gap int
	var spending float64
	for rows.Next() {
		rows.Scan(&gap, &spending)
		fmt.Println(gap)
		fmt.Println(spending)
	}
	AvgGap := gap / cond.GetNumRows()
	AvgSpend := spending
	fmt.Printf("You are purchasing every %d days \n", AvgGap)
	fmt.Printf("You are spending about %f $s per order \n", AvgSpend)
}

// CreateStats based on the Database.
func CreateStats(db *sql.DB) {
	CondStats := Conditions{
		start:   "2021-01-01",
		end:     "2021-05-01",
		lb:      "0.0",
		ub:      "100000",
		numrows: "7",
	}
	fmt.Println("What do you want to do?")
	fmt.Println("1. Summarize Purchase Pattern")
	fmt.Println("2. Predict next order date. (amount fixed)")
	fmt.Println("3. Predict how much I should order (date fixed)")
	fmt.Println("4. Return to main menu")
	var stats int
	fmt.Scanln(&stats)
StatsQuery:
	for {
		switch stats {
		case 1:
			ShowPattern(db, &CondStats)
			break StatsQuery
		case 2:
			//PredictDate(db)
			break StatsQuery
		case 3:
			//PredictAmt(db)
			break StatsQuery
		case 4:
			break StatsQuery
		default:
			fmt.Println("Not a Valid input. Try again.")
			fmt.Scanln(&stats)
		}
	}

}

func main() {
	// Welcome Message
	fmt.Println("Welcome! Initiating...")

	//Read Gmail Credientials
	fmt.Println("Reading Credentials...")
	b, err := ioutil.ReadFile("credentials.json")
	if err != nil {
		log.Fatalf("Unable to read client secret file: %v", err)
	}
	fmt.Println("Creating Client...")

	// Create a new client using credentials
	config, err := google.ConfigFromJSON(b, gmail.GmailReadonlyScope)
	if err != nil {
		log.Fatalf("Unable to parse client secret file to config: %v", err)
	}
	client := getClient(config)

	//instantiate a gmail service
	fmt.Println("Instantiating Gmail Service...")
	srv, err := gmail.New(client)
	if err != nil {
		log.Fatalf("Unable to retrieve Gmail client: %v", err)
	}

	//Get Environmental Variables
	fmt.Println("Loading Environmental Variables...")
	godotenv.Load(".env")

	//retrieve db password
	password := os.Getenv("password")
	if len(password) == 0 {
		log.Fatal("cannot load password")
	}

	//Instantiate Database Driver
	fmt.Println("Connecting to mySQL Database")
	db, err := sql.Open("mysql", "root:"+password+"@tcp(127.0.0.1:3306)/sys")
	if err != nil {
		log.Fatal("cannot instantaite database driver", err)
	}

	//Check if Database should be Updated
	LastUpdate, found := os.LookupEnv("LastUpdate")
	if !found {
		LastUpdate = "2021-Jan-01"
		os.Setenv("LastUpdate", LastUpdate)
	}
	fmt.Println("Your last update is on ", LastUpdate)
	LastUpdateTime, err := time.Parse(shortform, LastUpdate)
	if err != nil {
		log.Fatal("cannot parse lastupdate date to time")
	}
	TimeNow := time.Now()
	if !LastUpdateTime.Equal(TimeNow) {
		fmt.Println("You have not updated your database for", TimeNow.Sub(LastUpdateTime).Hours(), "hours")
	}
	fmt.Print("Do you want to update your database?: yes/no (lowercase)")
	var update string
	fmt.Scanln(&update)

UpdateQ:
	for {
		switch update {
		case "yes":
			UpdateDB(srv, LastUpdate, db)
			os.Setenv("LastUpdate", LastUpdate)
			fmt.Println("Update is complete. Latest Update is now", LastUpdate)
			break UpdateQ
		case "no":
			fmt.Println("Not Updating Database. Latest Update is", LastUpdate)
			break UpdateQ
		default:
			fmt.Println("Not a proper command. Type 'yes' or 'no'")
			fmt.Scanln(&update)
		}
	}

	fmt.Println("Directing you to Control Panel")
	fmt.Println("...........................................................")

	var action int
ActionPanel:
	for {
		//Choose Action
		fmt.Println("Choose Options: ")
		fmt.Println("1: View Order Records")
		fmt.Println("2: Edit Order Records")
		fmt.Println("3: Get Stats")
		fmt.Println("4: Quit")
		fmt.Scanln(&action)
		switch action {
		case 1:
			fmt.Println("Directing to View...")
			CreateView(srv, db)
		case 2:
			fmt.Println("Directing to Edit...")
			//CreateEdit(srv, db)
		case 3:
			fmt.Println("Directing to Stats...")
			CreateStats(db)
		case 4:
			fmt.Println("Bye bye")
			break ActionPanel
		default:
			fmt.Println("Not a valid choice")
			continue
		}
	}
}

// Update Once then view directs to db
// unmarshall json file (temp)