text:
Research},
    author = {Bergstra, James and Bengio, Yoshua},
    number = {1},
    pages = {281--305},
    volume = {13},
    url = {https://dl.acm.org/citation.cfm?id=2188395}
}

@article{RossZ2017DeclutterTools,
    title = {{Declutter your R workflow with tidy tools}},
    year = {2017},
    journal = {PeerJ Preprints},
    author = {Ross, Zev and Wickham, Hadley and Robinson, David},
    doi = {10.7287/peerj.preprints.3180v1},
    issn = {2167-9843}
}

@article{Millman2011PythonEngineers,
    title = {{Python for scientists and engineers}},
    year = {2011},
    journal = {Computing in Science and Engineering},
    author = {Millman, K. Jarrod and Aivazis, Michael},
    number = {2},
    pages = {9--12},
    volume = {13},
    url = {http://ieeexplore.ieee.org/document/5725235/},
    doi = {10.1109/MCSE.2011.36},
    keywords = {Programming languages, Python, Python libraries, Python tools, Scientific computing, interactive research}
}

@article{Long2000RigourResearch,
    title = {{Rigour, reliability and validity in qualitative research}},
    year = {2000},
    journal = {Clinical Effectiveness in Nursing},
    author = {Long, T. and Johnson, M.},
    number = {1},
    pages = {30--37},
    volume = {4},
    publisher = {Churchill Livingstone},
    url = {https://www.sciencedirect.com/science/article/pii/S1361900400901067},
    isbn = {0803924704},
    doi = {10.1054/cein.2000.0106},
    issn = {13619004},
    keywords = {Qualitative research, Reliability, Rigour, Validity}
}

@article{Durao2014AComputing,
    title = {{A systematic review on cloud computing}},
    year = {2014},
    journal = {Journal of Supercomputing},
    author = {Durao, Frederico and Carvalho, Jose Fernando S. and Fonseka, Anderson and Garcia, Vinicius Cardoso},
    number = {3},
    pages = {1321--1346},
    volume = {68},
    url = {https://doi.org/10.1007/s11227-014-1089-x},
    doi = {10.1007/s11227-014-1089-x},
    keywords = {Cloud computing, On-demand business model, Service layer agreement, Virtualization}
}

@article{Zhang2010CloudChallenges,
    title = {{Cloud computing: State-of-the-art and research challenges}},
    year = {2010},
    journal = {Journal of Internet Services and Applications},
    author = {Zhang, Qi and Cheng, Lu and Boutaba, Raouf},
    number = {1},
    pages = {7--18},
    volume = {1},
    url = {https://doi.org/10.1007/s13174-010-0007-6},
    doi = {10.1007/s13174-010-0007-6},
    keywords = {Cloud computing, Data centers, Virtualization}
}

@article{Pahl2015ContainerizationCloud,
    title = {{Containerization and the PaaS Cloud}},
    year = {2015},
    journal = {IEEE Cloud Computing},
    author = {Pahl, Claus},
    number = {3},
    pages = {24--31},
    volume = {2},
    url = {http://ieeexplore.ieee.org/document/7158965},
    doi = {10.1109/MCC.2015.51},
    keywords = {Docker, Kubernetes, PaaS, cloud, cloud computing, cluster, container, multicloud, virtualization}
}

@article{DickInteractive2014,
    title = {{Interactive Infographics and News Values}},
    year = {2014},
    journal = {Digital Journalism},
    author = {Dick, Murray},
    number = {4},
    pages = {490--506},
    volume = {2},
    doi = {10.1080/21670811.2013.841368},
    keywords = {digital journalism, infographics, interactive graphics, interactives, interactivity, news values, online journalism, visual journalism}
}

@article{SegelHeer2010,
    title = {{Narrative visualization: Telling stories with data}},
    year = {2010},
    journal = {IEEE Transactions on Visualization and Computer Graphics},
    author = {Segel, Edward and Heer, Jeffrey},
    number = {6},
    pages = {1139--1148},
    volume = {16},
    doi = {10.1109/TVCG.2010.179},
    keywords = {Narrative visualization, case study, design methods, journalism, social data analysis, storytelling}
}

@book{WardInteractiveApps2010,
    title = {{Interactive Data Visualization: Foundations, Techniques, and Applications}},
    year = {2010},
    author = {Ward, M. O. and Grinstein, G. and Keim, D.},
    publisher = {CRC Press},
    url = {https://www.crcpress.com/Interactive-Data-Visualization-Foundations-Techniques-and-Applications/Ward-Grinstein-Keim/p/book/9781482257373},
    isbn = {9781482257373}
}

@article{IBMMLSamuel1959,
    title = {{Some Studies in Machine Learning Using the Game of Checkers}},
    year = {1959},
    journal = {IBM Journal of Research and Development},
    author = {Samuel, A. L.},
    number = {3},
    volume = {3},
    url = {http://ieeexplore.ieee.org/document/5389202/},
    doi = {10.1147/rd.441.0206}
}

@book{DL2016Mit,
    title = {{Deep Learning}},
    year = {2016},
    author = {Goodfellow, Ian and Bengio, Yoshua and Courville, Aaron},
    publisher = {MIT Press},
    url = {http://www.deeplearningbook.org}
}

@article{Lichman:2013,
    title = {{Using the ADAP Learning Algorithm to Forecast the Onset of Diabetes Mellitus}},
    year = {1988},
    journal = {Proceedings of the Annual Symposium on Computer Application in Medical Care},
    author = {Smith, Jack W. and Everhart, J.E. and Dickson, W.C. and Knowler, W.C. and Johannes, R.S.},
    pages = {261--265},
    note = "\url{https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2245318/} and \url{https://www.kaggle.com/uciml/pima-indians-diabetes-database}"
}

@book{Olson2008,
    title = {{Advanced data mining techniques}},
    year = {2008},
    author = {Olson, D.L. and Delen, D.},
    publisher = {Springer},
    url = {http://www.springer.com/de/book/9783540769163},
    isbn = {9783540769163},
    doi = {10.1007/978-3-540-76917-0}
}

@article{ReviewHyperOpt2015,
    title = {{Beyond Manual Tuning of Hyperparameters}},
    year = {2015},
    journal = {KI-K{\"{u}}nstliche Intelligenz},
    author = {Hutter, F. and L{\"{u}}cke, J. and Schmidt-Thieme, L.},
    number = {4},
    volume = {29},
    doi = {10.1007/s13218-015-0381-0}
}

@book{EnsembleML2012,
    title = {{Ensemble Machine Learning: Methods and Applications}},
    year = {2012},
    author = {Zhang, Cha. and Ma, Yunqian.},
    publisher = {Springer},
    url = {http://www.springer.com/de/book/9781441993250},
    isbn = {9781441993250}
}

@article{Netflix2009,
    title = {{The bellkor solution to the netflix grand prize}},
    year = {2009},
    author = {Koren, Yehuda},
    pages = {1--10},
    url = {http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.162.2118}
}

@article{BauerErikChan1999,
    title = {{An Empirical Comparison of Voting Classification Algorithms: Bagging, Boosting, and Variants}},
    year = {1999},
    journal = {Machine Learning},
    author = {Bauer, Eric and Kohavi, Ron and Chan, Philip and Stolfo, Salvatore and Wolpert, David},
    volume = {36},
    doi = {10.1023/A:1007515423169},
    keywords = {Bagging, Naive-Bayes, boosting, classification, decision trees, mean-squared error}
}

@article{GranaMichal2014,
    title = {{A survey of multiple classifier systems as hybrid systems}},
    year = {2014},
    journal = {Information Fusion},
    author = {Wo{\'{z}}niak, Michał and Gra{\~{n}}a, Manuel and Corchado, Emilio},
    number = {1},
    pages = {3--17},
    volume = {16},
    url = {https://www.sciencedirect.com/science/article/pii/S156625351300047X},
    doi = {10.1016/j.inffus.2013.04.006},
    keywords = {Classifier ensemble, Classifier fusion, Combined classifier, Hybrid classifier, Multiple classifier system}
}

@article{EnsambleBioinf2010,
    title = {{A Review of Ensemble Methods in Bioinformatics}},
    year = {2010},
    journal = {Current Bioinformatics},
    author = {Yang, Pengyi and Hwa Yang, Yee and B. Zhou, Bing and Y. Zomaya, Albert},
    number = {4},
    pages = {296--308},
    volume = {5},
    url = {http://www.ingentaconnect.com/content/ben/cbio/2010/00000005/00000004/art00006}
}

@incollection{PeterETHZ2012,
    title = {{Bagging, boosting and ensemble methods}},
    year = {2012},
    booktitle = {Handbook of Computational Statistics: Concepts and Methods},
    edition = {2nd},
    author = {B{\"{u}}hlmann, Peter},
    editor = {Gentle, J. and Härdle, W. and Mori, Y.},
    pages = {985--1022},
    publisher = {Springer},
    doi = {10.1007/978-3-642-21551-3_33}
}

@article{NagiSajid2013,
    title = {{Classification of microarray cancer data using ensemble approach}},
    year = {2013},
    journal = {Network Modeling Analysis in Health Informatics and Bioinformatics},
    author = {Nagi, Sajid and Bhattacharyya, Dhruba Kr.},
    number = {3},
    pages = {159--173},
    volume = {2},
    url = {http://link.springer.com/10.1007/s13721-013-0034-x},
    doi = {10.1007/s13721-013-0034-x}
}

@article{Opitz1999,
    title = {{Popular Ensemble Methods: An Empirical Study}},
    year = {1999},
    journal = {Journal Of Artificial Intelligence Research},
    author = {Maclin, R. and Opitz, D.},
    volume = {11},
    doi = {10.1613/jair.614},
    arxivId = {1106.0257}
}

@article{IndBIHistory2013,
    title = {{Cloud Business Intelligence - Is What Business Need Today}},
    year = {2013},
    journal = {International Journal of Recent Technology and Engineering},
    author = {Gurjar, Yuvraj Singh and Rathore, Vijay Singh},
    number = {6},
    volume = {1},
    url = {http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.675.8516&rep=rep1&type=pdf}
}

@inproceedings{ArelDL2009,
    title = {{DeSTIN: A Scalable Deep Learning Architecture with Application to High-Dimensional Robust Pattern Recognition}},
    year = {2009},
    booktitle = {Proc. of the AAAI 2009 Fall Symposium on Biologically Inspired Cognitive Architectures},
    author = {Arel, Itamar and Rose, Derek and Coop, Robert},
    url = {http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.232.9693},
    isbn = {9781577354352}
}

@article{WilsonGred2017,
    title = {{Good enough practices in scientific computing}},
    year = {2017},
    journal = {PLoS Computational Biology},
    author = {Wilson, Greg and Bryan, Jennifer and Cranston, Karen and Kitzes, Justin and Nederbragt, Lex and Teal, Tracy K.},
    number = {6},
    volume = {13},
    doi = {10.1371/journal.pcbi.1005510}
}

@article{Bhatt2001,
    title = {{Knowledge management in organizations: examining the interaction between technologies, techniques, and people}},
    year = {2001},
    journal = {Journal of Knowledge Management},
    author = {Bhatt, Ganesh D.},
    number = {1},
    volume = {5},
    url = {https://doi.org/10.1108/13673270110384419},
    doi = {10.1108/13673270110384419}
}

@article{MarstonSean2011,
    title = {{Cloud computing - The business perspective}},
    year = {2011},
    journal = {Decision Support Systems},
    author = {Marston, Sean and Li, Zhi and Bandyopadhyay, Subhajyoti and Zhang, Juheng and Ghalsasi, Anand},
    number = {1},
    pages = {176--189},
    volume = {51},
    publisher = {North-Holland},
    url = {https://www.sciencedirect.com/science/article/pii/S0167923610002393},
    doi = {10.1016/J.DSS.2010.12.006}
}

@inproceedings{JusticeMartinis2015Cloud,
    title = {{Critical review of vendor lock-in and its impact on adoption of cloud computing}},
    year = {2015},
    booktitle = {International Conference on Information Society},
    author = {Opara-Martins, Justice and Sahandi, Reza and Tian, Feng},
    pages = {92--97},
    doi = {10.1109/i-Society.2014.7009018},
    keywords = {API's, cloud computing, data, enterprise migration, interoperability, portability, standards, vendor lock-in}
}

@misc{PythonCoreStandartLib,
    title = {{The Python Standard Library}},
    year = {2018},
    author = {{Python Core Team}},
    url = {https://docs.python.org/3/library/index.html}
}

@article{StoneAdamPrivSecCloud2010,
    title = {{Security and privacy challenges in cloud computing environments}},
    year = {2010},
    journal = {IEEE Security {\&} Privacy},
    author = {Stone, Adam and Takabi, Hassan and Joshi, James B D and Ahn, Gail-Joon},
    number = {6},
    pages = {24--31},
    volume = {8},
    doi = {10.1109/MSP.2010.186}
}

@book{Boehmke2016DataR,
    title = {{Data Wrangling with R}},
    year = {2016},
    author = {Boehmke, Bradley C.},
    publisher = {Springer},
    url = {http://www.springer.com/gp/book/9783319455983},
    doi = {10.1007/978-3-319-45599-0}
}

@misc{Rickert2017,
    title = {{What is the tidyverse?}},
    year = {2017},
    author = {Rickert, Joseph},
    publisher = {R Views},
    url = {https://rviews.rstudio.com/2017/06/08/what-is-the-tidyverse/}
}

@inproceedings{BinasGitLab2013,
    title = {{Version Control System in CS1 Course: Practical Experience}},
    year = {2013},
    booktitle = {11th IEEE International Conference on Emerging eLearning Technologies and Applications},
    author = {Biňas, M.},
    publisher = {IEEE},
    url = {http://ieeexplore.ieee.org/abstract/document/6674398/},
    doi = {10.1109/ICETA.2013.6674398}
}

@misc{PaulGitlab2016,
    title = {{Enterprise repo wars: GitHub vs. GitLab vs. Bitbucket}},
    year = {2016},
    booktitle = {InfoWorld},
    author = {Krill, Paul},
    url = {https://www.infoworld.com/article/3123244/application-development/enterprise-repo-wars-github-vs-gitlab-vs-bitbucket.html}
}

@article{Codd:1970:RMD:362384.362685,
    title = {{A Relational Model of Data for Large Shared Data Banks}},
    year = {1970},
    journal = {Commun. ACM},
    author = {Codd, E F},
    number = {6},
    pages = {377--387},
    volume = {13},
    publisher = {ACM},
    url = {http://doi.acm.org/10.1145/362384.362685},
    doi = {10.1145/362384.362685},
    keywords = {composition, consistency, data bank, data base, data integrity, data organization, data structure, derivability, hierarchies of data, join, networks of data, predicate calculus, redundancy, relations, retrieval language, security}
}

@techreport{CMACanada2003,
    title = {{Best Practices in Data Mining}},
    year = {2003},
    author = {Boire, Richard and Tyndall, Paul and Carriere, Greg and Champion, Rob},
    number = {August},
    pages = {36},
    url = {https://www.the-cma.org/disciplines/analytics/archive/best-practices-in-data-mining}
}

@book{DataBoK2017,
    title = {{DAMA-DMBOK: Data Management Body of Knowledge}},
    year = {2017},
    booktitle = {Dama International},
    author = {{DAMA}},
    edition = {2nd},
    pages = {624},
    publisher = {Technics Publications},
    url = {https://dama.org/content/body-knowledge},
    isbn = {9781634622349}
}

@inproceedings{GuhaSEngCloud2010,
    title = {{Impact of Web 2.0 and Cloud Computing Platform on Software Engineering}},
    year = {2010},
    booktitle = {International Symposium on Electronic System Design},
    author = {Guha, Radha and Al-Dabass, David},
    pages = {213--218},
    url = {http://ieeexplore.ieee.org/abstract/document/5715178/},
    doi = {10.1109/ISED.2010.48},
    keywords = {- web 2, 0, agile process model, cloud computing, engineering, software}
}

@inproceedings{Kohavi:1995:SCB:1643031.1643047,
    title = {{A Study of Cross-Validation and Bootstrap for Accuracy Estimation and Model Selection}},
    year = {1995},
    booktitle = {Proceedings of the 14th International Joint Conference on Artificial Intelligence - Volume 2},
    author = {Kohavi, Ron},
    pages = {1--7},
    url = {https://dl.acm.org/citation.cfm?id=1643047}
}

@book{BookCV201,
    title = {{Cross-Validation - Encyclopedia of Database Systems}},
    year = {2017},
    author = {Refaeilzadeh, Payam and Tang, Lei and Liu, Huan},
    editor = {L., Liu and M.T., Özsu},
    publisher = {Springer},
    isbn = {978-0-387-35544-3},
    doi = {10.1007/978-0-387-39940-9}
}

@article{KuhnMax2013,
    title = {{Applied predictive modeling}},
    year = {2013},
    journal = {Applied Predictive Modeling},
    author = {Kuhn, Max and Johnson, Kjell},
    pages = {1--600},
    url = {http://www.springer.com/gp/book/9781461468486},
    isbn = {9781461468493},
    doi = {10.1007/978-1-4614-6849-3},
    issn = {03781119}
}

@misc{Gutierrez-Osuna2002LECTURECross-validation,
    title = {{LECTURE 13: Cross-validation}},
    year = {2002},
    author = {Gutierrez-Osuna, Ricardo},
    pages = {15},
    publisher = {Texas A{\&}M University},
    url = {https://www.cs.tau.ac.il/~nin/Courses/NC05/pr_l13.pdf}
}

@inproceedings{Vanwinckelen2012OnCross-validation,
    title = {{On estimating model accuracy with repeated cross-validation}},
    year = {2012},
    booktitle = {21st Belgian-Dutch Conference on Machine Learning},
    author = {Vanwinckelen, Gitte and Blockeel, Hendrik},
    pages = {39--44},
    url = {https://lirias.kuleuven.be/handle/123456789/346385},
    keywords = {conditional prediction error, predictive model evaluation, repeated cross-validation}
}

@article{arlot2010,
    title = {{A survey of cross-validation procedures for model selection}},
    year = {2010},
    journal = {Statistics Surveys},
    author = {Arlot, Sylvain and Celisse, Alain},
    pages = {40--79},
    volume = {4},
    publisher = {The American Statistical Association, the Bernoulli Society, the Institute of Mathematical Statistics, and the Statistical Society of Canada},
    doi = {10.1214/09-SS054}
}

@incollection{CVStandart2008,
    title = {{In silico QSAR-based predictions of class I and class II MHC epitopes}},
    year = {2008},
    booktitle = {Immunoinformatics},
    author = {Hattotuwagama, Channa K. and Doytchinova, Irini A. and Guan, Pingping and Flower, Darren R.},
    pages = {63--89},
    doi = {10.1007/978-0-387-72968-8_4}
}

@book{limrperf2015,
    title = {{R High Performance Programming}},
    year = {2015},
    author = {Lim, Aloysius and Tjhi, William},
    pages = {176},
    publisher = {Packt Publishing},
    url = {https://www.packtpub.com/application-development/r-high-performance-programming},
    isbn = {9781783989263}
}

@book{Rubin2002,
    title = {{Statistical Analysis with Missing Data}},
    year = {2002},
    author = {Little, Roderick J. A. and Rubin, Donald B.},
    publisher = {Wiley},
    edition = {2nd},
    url = {https://www.wiley.com/en-us/Statistical+Analysis+with+Missing+Data%2C+2nd+Edition-p-9780471183860},
    isbn = {9780471183860}
}

@book{Gelman2007,
    title = {{Data Analysis Using Regression and Multilevel/Hierarchical Models}},
    year = {2006},
    author = {Gelman, Andrew and Hill, Jennifer},
    publisher = {Cambridge University Press},
    url = {http://www.stat.columbia.edu/~gelman/arm/},
    isbn = {978-0521686891}
}

@article{ZhangSingleImput2016,
    title = {{Missing data imputation: focusing on single imputation.}},
    year = {2016},
    journal = {Annals of translational medicine},
    author = {Zhang, Zhongheng},
    number = {1},
    pages = {9},
    volume = {4},
    url = {https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4716933/},
    doi = {10.3978/j.issn.2305-5839.2015.12.38}
}

@article{DabneyAlanNormalization2012,
    title = {{Normalization and missing value imputation for label-free LC-MS analysis}},
    year = {2012},
    journal = {BMC Bioinformatics},
    author = {Karpievitch, Yuliya V and Dabney, Alan R and Smith, Richard D},
    number = {16},
    volume = {13},
    url = {http://bmcbioinformatics.biomedcentral.com/articles/10.1186/1471-2105-13-S16-S5},
    doi = {10.1186/1471-2105-13-S16-S5}
}

@article{GarcijaGomez2010,
    title = {{Pattern classification with missing data: a review}},
    year = {2010},
    journal = {Neural Computing and Applications},
    author = {Garc{\'{i}}a-Laencina, P. J. and Sancho-G{\'{o}}mez, JL. and Figueiras-Vidal, A. R.},
    number = {2},
    pages = {263--282},
    volume = {19},
    url = {http://link.springer.com/10.1007/s00521-009-0295-6},
    doi = {10.1007/s00521-009-0295-6}
}

@article{Grahama2002,
    title = {{Missing data: Our view of the state of the art}},
    year = {2002},
    journal = {Psychological Methods},
    author = {Schafer, Josepn L. and Graham, John W.},
    number = {2},
    pages = {147--177},
    volume = {7},
    doi = {10.1037/1082-989X.7.2.147}
}

@article{Lynn2002,
    title = {{Using multiple imputation for analysis of incomplete data in clinical research}},
    year = {2002},
    journal = {Nursing Research},
    author = {McCleary, Lynn},
    number = {5},
    pages = {339--343},
    volume = {51},
    doi = {10.1097/00006199-200209000-00012},
    keywords = {Data interpretation, Models, Research design, Statistical}
}

@article{Takahasi2012,
    title = {{Multiple Imputation of Turnover in EDINET Data: Toward the Improvement of Imputation for the Economic Census}},
    year = {2012},
    journal = {Work Session on Statistical Data Editing, UNECE},
    author = {Takahashi, M and Ito, T},
    url = {https://www.unece.org/fileadmin/DAM/stats/documents/ece/ces/ge.44/2012/35_Japan.pdf}
}

@article{Hasan2017,
    title = {{A comparison of model-based imputation methods for handling missing predictor values in a linear regression model: A simulation study}},
    year = {2017},
    journal = {AIP Conference Proceedings},
    author = {Hasan, Haliza and Ahmad, Sanizah and Osman, Balkish Mohd and Sapri, Shamsiah and Othman, Nadirah},
    volume = {1870},
    url = {http://aip.scitation.org/doi/pdf/10.1063/1.4995930},
    doi = {10.1063/1.4995930}
}

@article{AzurMellissa2011,
    title = {{Multiple imputation by chained equations: What is it and how does it work?}},
    year = {2011},
    journal = {International Journal of Methods in Psychiatric Research},
    author = {Azur, Melissa J. and Stuart, Elizabeth A. and Frangakis, Constantine and Leaf, Philip J.},
    number = {1},
    pages = {40--49},
    volume = {20},
    doi = {10.1002/mpr.329},
    keywords = {Analyze, Missing data, Multiple imputation}
}

@article{BaraldiCraig2010,
    title = {{An introduction to modern missing data analyses}},
    year = {2010},
    journal = {Journal of School Psychology},
    author = {Baraldi, Amanda N. and Enders, Craig K.},
    number = {1},
    pages = {5--37},
    volume = {48},
    doi = {10.1016/j.jsp.2009.10.001},
    keywords = {Maximum likelihood, Missing data, Multiple imputation, Planned missingness}
}

@article{DWSlideDice,
    title = {{Designing data warehouses with OO conceptual models}},
    year = {2001},
    journal = {Computer},
    author = {Trujillo, Juan and Palomar, Manuel and Gomez, Jaime and Song, Il Yeol},
    number = {12},
    volume = {34},
    doi = {10.1109/2.970579}
}

@article{InformaVisualiz,
    title = {{The Concept of Information Overload - A Review of Literature from Organization Science, Accounting, Marketing, MIS, and Related Disciplines}},
    year = {2004},
    journal = {The Information Society},
    author = {Eppler, Martin J. and Mengis, J.},
    number = {5},
    pages = {325--344},
    volume = {20},
    doi = {10.1080/01972240490507974},
    keywords = {gies, information explosion, information management strate-, information overload, information processing, information skills, information technology}
}

@article{Gershon1998,
    title = {{Visualization of an imperfect world}},
    year = {1998},
    journal = {IEEE Computer Graphics and Applications},
    author = {Gershon, Nahum},
    number = {4},
    pages = {43--45},
    volume = {18},
    doi = {10.1109/38.689662}
}

@inproceedings{Carr1999,
    title = {{Guidelines for designing information visualization applications}},
    year = {1999},
    booktitle = {Proceedings of the 1999 Ericsson Conference on Usability Engineering},
    author = {Carr, D},
    url = {http://urn.kb.se/resolve?urn=urn:nbn:se:ltu:diva-39533}
}

@misc{TabPatriVisual2015,
    title = {{Talk Data to Me: Data Visualization Best Practices}},
    year = {2015},
    author = {Nguyen, Hugh and Hyde, Patrick Van Der},
    publisher = {Tableau},
    url = {https://www.youtube.com/watch?v=GnMSjSWDQNk}
}

@article{NatureBPDASNMRI2017,
    title = {{Best practices in data analysis and sharing in neuroimaging using MRI}},
    year = {2017},
    journal = {Nature Neuroscience},
    author = {Nichols, Thomas E. and Das, Samir and Eickhoff, Simon B. and Evans, Alan C. and Glatard, Tristan and Hanke, Michael and Kriegeskorte, Nikolaus and Milham, Michael P. and Poldrack, Russell A. and Poline, Jean Baptiste and Proal, Erika and Thirion, Bertrand and Van Essen, David C. and White, Tonya and Yeo, B. T.Thomas},
    number = {3},
    pages = {299--303},
    volume = {20},
    doi = {10.1038/nn.4500}
}

@misc{EslamiAli2012,
    title = {{Patterns for Research in Machine Learning}},
    year = {2012},
    author = {Eslami, Ali},
    url = {http://arkitus.com/patterns-for-research-in-machine-learning/}
}

@article{Numpy2011,
    title = {{The NumPy array: A structure for efficient numerical computation}},
    year = {2011},
    journal = {Computing in Science and Engineering},
    author = {Walt, Stéfan Van Der and Colbert, S. Chris and Varoquaux, Gaël},
    number = {2},
    pages = {22--30},
    volume = {13},
    doi = {10.1109/MCSE.2011.37},
    keywords = {NumPy, Python, numerical computations, programming libraries, scientific programming}
}

@misc{MatrixCran2017,
    title = {{Matrix: Sparse and Dense Matrix Classes and Methods}},
    year = {2018},
    author = {Maechler, Martin and Bates, Douglas},
    url = {https://cran.r-project.org/package=Matrix}
}

@techreport{SAS2016,
    title = {{Best Practices for Machine Learning Applications}},
    year = {2016},
    booktitle = {SAS Paper SAS2360-2016},
    author = {Wujek, Brett and Hall, Patrick and G{\"{u}}neș, Funda},
    pages = {1--23},
    url = {https://support.sas.com/resources/papers/proceedings16/SAS2360-2016.pdf},
    institution = {SAS}
}

@book{PSDS2017,
    title = {{Practical Statistics for Data Scientists}},
    year = {2017},
    author = {Bruce, Peter and Bruce, Andrew},
    publisher = {O'Reilly Media},
    url = {http://shop.oreilly.com/product/0636920048992.do},
    isbn = {978-1491952962}
}

@article{imput2006,
    title = {{Imputation of missing values is superior to complete case analysis and the missing-indicator method in multivariable diagnostic research: A clinical example}},
    year = {2006},
    journal = {Journal of Clinical Epidemiology},
    author = {Heijden, Geert J M G van der and T. Donders, A. Rogier and Stijnen, Theo and Moons, Karel G M},
    number = {10},
    pages = {1102--1109},
    volume = {59},
    url = {https://www.sciencedirect.com/science/article/pii/S0895435606001983},
    doi = {10.1016/j.jclinepi.2006.01.015},
    keywords = {Bias, Complete case analysis, Indicator method, Missing data, Multiple imputation, Precision, Single imputation}
}

@article{minleegrid2005,
    title = {{Bankruptcy prediction using support vector machine with optimal choice of kernel function parameters}},
    year = {2005},
    journal = {Expert systems with applications},
    author = {Min, JH and Lee, YC},
    number = {4},
    pages = {603--614},
    volume = {28},
    url = {https://www.sciencedirect.com/science/article/pii/S0957417404001526},
    doi = {10.1016/j.eswa.2004.12.008}
}

@book{Trevor2017,
    title = {{The Elements of Statistical Learning: Data Mining, Inference, and Prediction}},
    year = {2017},
    author = {Hastie, Trevor and Tibshirani, Robert and Friedman, Jerome},
    pages = {757},
    url = {https://doi.org/10.1007/978-0-387-84858-7},
    doi = {10.1007/978-0-387-84858-7}
}

@article{ClusteringAnil2010,
    title = {{Data clustering: 50 years beyond K-means}},
    year = {2010},
    journal = {Pattern Recognition Letters},
    author = {Jain, Anil K.},
    number = {8},
    volume = {31},
    url = {https://www.sciencedirect.com/science/article/pii/S0167865509002323},
    doi = {10.1016/j.patrec.2009.09.011}
}

@inproceedings{Movies2012,
    title = {{Guess Who Rated This Movie: Identifying Users Through Subspace Clustering}},
    year = {2012},
    booktitle = {28th Conference on Uncertainty in Artificial Intelligence},
    author = {Zhang, Amy and Fawaz, Nadia and Ioannidis, Stratis and Montanari, Andrea},
    url = {https://arxiv.org/abs/1208.1544},
    arxivId = {1208.1544}
}

@article{MBAMR2012,
    title = {{Using Market Basket Analysis in Management Research}},
    year = {2012},
    journal = {Journal of Management},
    author = {Aguinis, Herman and Forcum, Lura E. and Joo, Harry},
    number = {7},
    pages = {1799--1824},
    volume = {39},
    url = {http://jom.sagepub.com/cgi/doi/10.1177/0149206312466147},
    doi = {10.1177/0149206312466147},
    keywords = {behavior, data analysis, impact, methodology, research design}
}

@techreport{Tillburg2009,
    title = {{Dimensionality reduction: A comparative review}},
    year = {2009},
    author = {Maaten, Laurens van der and Postma, Eric and Herik, Jaap van den},
    url = {https://www.tilburguniversity.edu/upload/59afb3b8-21a5-4c78-8eb3-6510597382db_TR2009005.pdf},
    institution = {Technical Report TiCC TR 2009-005},
    keywords = {dimensionality reduction, feature extraction, manifold learning}
}

@article{Brylspam2008,
    title = {{A survey of learning-based techniques of email spam filtering}},
    year = {2008},
    journal = {Artificial Intelligence Review},
    author = {Blanzieri, Enrico and Bryl, Anton},
    number = {1},
    pages = {63--92},
    volume = {29},
    doi = {10.1007/s10462-009-9109-6},
    keywords = {Machine learning, Spam filtering}
}

@inproceedings{ForestFires2007,
    title = {{A Data Mining Approach to Predict Forest Fires using Meteorological Data}},
    year = {2007},
    booktitle = {New trends in artificial intelligence: proceedings of the 13th Portuguese Conference on Artificial Intelligence},
    author = {Cortez, P and Morais, A},
    editor = {Neves, José Maia and Santos, Manuel Filipe and Machado, José Manuel},
    pages = {512--523},
    url = {http://hdl.handle.net/1822/8039}
}

@techreport{Zinkevitch2016,
    title = {{Rules of Machine Learning: Best Practices for ML Engineering}},
    year = {2016},
    author = {Zinkevich, Martin},
    url = {http://martin.zinkevich.org/rules_of_ml/rules_of_ml.pdf}
}

@inproceedings{BreckMLTest2016,
    title = {{What's your ML Test Score? A rubric for ML production systems}},
    year = {2016},
    booktitle = {Reliable Machine Learning in the Wild - NIPS 2016 Workshop},
    author = {Breck, Eric and Cai, Shanqing and Nielsen, Eric and Salib, Michael and Sculley, D},
    url = {https://research.google.com/pubs/pub45742.html}
}

@article{NadaML2004,
    title = {{Introduction: Lessons Learned from Data Mining Applications and Collaborative Problem Solving}},
    year = {2004},
    journal = {Machine Learning},
    author = {Lavra{\v{c}}, Nada and Motoda, Hiroshi and Fawcett, Tom and Holte, Robert and Langley, Pat and Adriaans, Pieter},
    number = {1-2},
    volume = {57},
    url = {https://link.springer.com/article/10.1023/B:MACH.0000035516.74817.51},
    doi = {10.1023/B:MACH.0000035516.74817.51}
}

@techreport{SASBP2007,
    title = {{Best Practices for Managing Predictive Models in a Production Environment}},
    year = {2007},
    booktitle = {Paper 076-2007},
    author = {Chu, Robert and Duling, David and Thompson, Wayne},
    pages = {1--10},
    url = {http://www2.sas.com/proceedings/forum2007/076-2007.pdf}
}

@misc{JonJupyter2016,
    title = {{Jupyter Notebook Best Practices for Data Science}},
    year = {2016},
    booktitle = {SVDC},
    author = {Whitmore, Jonathan},
    url = {https://www.svds.com/tbt-jupyter-notebook-best-practices-data-science/}
}

@misc{CharlerSutton2012,
    title = {{Principles of Research Code}},
    year = {2012},
    booktitle = {The Exclusive Or},
    author = {Sutton, Charles},
    url = {http://www.theexclusive.org/2012/08/principles-of-research-code.html}
}

@book{SimonBGDRAMR2016,
    title = {{Big Data Analytics with R}},
    year = {2016},
    author = {Walkowiak, Simon},
    publisher = {Packt Publishing},
    url = {https://www.packtpub.com/big-data-and-business-intelligence/big-data-analytics-r},
    isbn = {9781786463722}
}

@article{HortonNickKen2007,
    title = {{Much Ado About Nothing: A Comparison of Missing Data Methods and Software to Fit Incomplete Data Regression Models}},
    year = {2007},
    journal = {The American Statistician},
    author = {Horton, Nicholas J and Kleinman, Ken P},
    number = {1},
    volume = {61},
    url = {https://www.ncbi.nlm.nih.gov/pmc/articles/PMC1839993/},
    doi = {10.1198/000313007X172556},
    keywords = {Conditional Gaussian, Health services research, Maximum likelihood, Multiple imputation, Psychiatric epidemi-ology}
}

@unpublished{MittagNik2013,
    title = {{Imputations: Benefits, Risks and a Method for Missing Data}},
    year = {2013},
    author = {Mittag, Nikolas},
    url = {http://home.cerge-ei.cz/mittag/papers/Imputations.pdf},
    institution = {CERGE-EI},
    keywords = {data combination, imputation, missing data}
}

@techreport{Clarke2013,
    title = {{Seven steps to success machine learning in practice}},
    year = {2013},
    author = {Clarke, Daoud},
    pages = {1--14},
    url = {http://daoudclarke.github.io/guide.pdf}
}

@misc{WinVektro2014,
    title = {{Factors are not first-class citizens in R}},
    year = {2014},
    booktitle = {Win-Vector Blog},
    author = {Mount, John},
    url = {http://www.win-vector.com/blog/2014/09/factors-are-not-first-class-citizens-in-r/}
}

@inproceedings{AgileCI2009,
    title = {{Enabling agile testing through continuous integration}},
    year = {2009},
    booktitle = {Agile Conference},
    author = {Stolberg, Sean},
    pages = {369--374},
    url = {http://ieeexplore.ieee.org/abstract/document/5261055/},
    doi = {10.1109/AGILE.2009.16}
}

@incollection{BakerTOE2012,
    title = {{The Technology-Organization-Environment Framework}},
    year = {2012},
    booktitle = {Information Systems Theory},
    author = {Baker, Jeff},
    pages = {231--245},
    publisher = {Springer},
    doi = {10.1007%2F978-1-4419-6108-2_12},
    isbn = {978-1-4419-6107-5}
}

@article{OlivertraTOE2011,
    title = {{Literature Review of Information Technology Adoption Models at Firm Level}},
    year = {2011},
    journal = {Electronic Journal of Information Systems Evaluation},
    author = {Oliveira, T and Martins, MF},
    number = {1},
    pages = {110--121},
    volume = {14},
    url = {http://www.ejise.com/issue/download.html?idArticle=705},
    keywords = {diffusion of innovations, diffusion of innovations (, doi, framework, information technology, institutional theory, interorganizational systems, ioss, technology-organization-environment, theory, toe}
}

@incollection{tornatzky1990processes,
    title = {{The context for change: Organization, technology and environment}},
    year = {1990},
    booktitle = {The processes of technological innovation},
    author = {DePietro, Rocco and Wiarda, Edith and Fleischer, Mitchell},
    editor = {Tornatzky, L. G. and Fleischer, M.},
    pages = {151--175},
    publisher = {Lexington Books},
    url = {https://books.google.com/books?id=EotRAAAAMAAJ},
    isbn = {9780669203486}
}

@misc{SmithDavid2009159,
    title = {{Batch mode in R: a primer}},
    year = {2009},
    author = {Smith, David},
    publisher = {Revolutions},
    url = {http://blog.revolutionanalytics.com/2009/06/batch-mode-in-r-a-primer.html}
}

@book{PDLMLRaschka2016,
    title = {{Python: Deeper Insights into Machine Learning}},
    year = {2016},
    author = {Raschka, Sebastian and Julian, David and Hearty, John},
    publisher = {Packt Publishing},
    url = {https://www.packtpub.com/big-data-and-business-intelligence/python-deeper-insights-machine-learning},
    isbn = {9781787128545}
}

@book{RamlhoLucFPython2015,
    title = {{Fluent Python: Clear, Concise, and Effective Programming}},
    year = {2015},
    author = {Ramalho, Luciano},
    publisher = {O'Reilly Media},
    url = {http://shop.oreilly.com/product/0636920032519.do},
    isbn = {9781491946008}
}

@misc{DJ2013,
    title = {{Stanford Seminar - The Things I Wish I Knew - Lessons Learned from Making Data Product}},
    year = {2013},
    author = {Patil, DJ},
    url = {https://www.youtube.com/watch?v=YqQ86NDeGpo%0A}
}

@article{WandaSusan2008,
    title = {{Sociomateriality: Challenging the Separation of Technology, Work and Organization}},
    year = {2008},
    journal = {The Academy of Management Annals},
    author = {Orlikowski, Wanda J. and Scott, Susan V.},
    number = {1},
    pages = {433--474},
    volume = {2},
    doi = {10.1080/19416520802211644}
}

@article{BaxterST2011,
    title = {{Socio-technical systems: From design methods to systems engineering}},
    year = {2011},
    journal = {Interacting with Computers},
    author = {Baxter, Gordon D. and Sommerville, Ian},
    number = {1},
    pages = {4--17},
    volume = {23},
    url = {http://linkinghub.elsevier.com/retrieve/pii/S0953543810000652},
    doi = {10.1016/j.intcom.2010.07.003},
    keywords = {socio-technical systems, software engineering, systems engineering}
}

@article{BrianSTS2009,
    title = {{A Brief Introduction to Sociotechnical Systems}},
    year = {2009},
    journal = {Encyclopedia of Information Science and Technology},
    author = {Whitworth, Brian},
    edition = {2nd},
    pages = {394--400},
    url = {http://services.igi-global.com/resolvedoi/resolve.aspx?doi=10.4018/978-1-60566-026-4.ch066},
    doi = {10.4018/978-1-60566-026-4.ch066},
    keywords = {System, System Environment, System Levels, information system, social system, system elements}
}

@article{Holfstede1993,
    title = {{Cultural constraints in management theories}},
    year = {1993},
    journal = {Academy of Management Perspectives},
    author = {Hofstede, Geert},
    number = {1},
    pages = {81--94},
    volume = {7},
    url = {http://amp.aom.org/cgi/doi/10.5465/AME.1993.9409142061},
    doi = {10.5465/AME.1993.9409142061}
}

@article{Holfestede2011,
    title = {{Dimensionalizing Cultures: The Hofstede Model in Context}},
    year = {2011},
    journal = {Online Readings in Psychology and Culture},
    author = {Hofstede, Geert},
    number = {1},
    volume = {2},
    url = {http://scholarworks.gvsu.edu/orpc/vol2/iss1/8},
    doi = {10.9707/2307-0919.1014}
}

@incollection{BI2.0Ov2012,
    title = {{Business intelligence 2.0: A general overview}},
    year = {2012},
    booktitle = {Lecture Notes in Business Information Processing 96},
    author = {Trujillo, Juan and Mat{\'{e}}, Alejandro},
    pages = {98--116},
    doi = {10.1007/978-3-642-27358-2_5},
    keywords = {Data warehouses, business intelligence 2.0, cloud computing, collaborative BI, collective intelligence, crowdsourcing, real-time, social networks, web 2.0}
}

@book{OrelyJavaDP2009,
    title = {{Head First Design Patterns: A Brain-Friendly Guide}},
    year = {2009},
    author = {Freeman, Eric and Robson, Elisabeth and Bates, Bert and Sierra, Kathy},
    edition = {1st},
    publisher = {O'Reilly Media},
    url = {http://shop.oreilly.com/product/9780596007126.do}
}

@book{RubyDP2007,
    title = {{Design Patterns in Ruby}},
    year = {2007},
    author = {Olsen, Russ},
    publisher = {Addison-Wesley Professional},
    url = {https://dl.acm.org/citation.cfm?id=1349728},
    isbn = {9780321490452}
}

license: MIT

license_type: permissive

branch_name: refs/heads/master

gha_license_id: MIT

extension: bib


text:
# base recipe: meta/recipes-graphics/harfbuzz/harfbuzz_2.3.1.bb
# base branch: warrior
# base commit: 69438e515657e27c1afe6f852ed035de578441ef

SUMMARY = "Text shaping library"
DESCRIPTION = "HarfBuzz is an OpenType text shaping engine."
HOMEPAGE = "http://www.freedesktop.org/wiki/Software/HarfBuzz"
BUGTRACKER = "https://bugs.freedesktop.org/enter_bug.cgi?product=HarfBuzz"
SECTION = "libs"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://COPYING;md5=e021dd6dda6ff1e6b1044002fc662b9b \
                    file://src/hb-ucdn/COPYING;md5=994ba0f1295f15b4bda4999a5bbeddef \
"

inherit debian-package
require recipes-debian/sources/harfbuzz.inc
DEBIAN_QUILT_PATCHES = ""

DEPENDS = "glib-2.0 cairo fontconfig freetype"

inherit autotools pkgconfig lib_package gtk-doc

PACKAGECONFIG ??= "icu"
PACKAGECONFIG[icu] = "--with-icu,--without-icu,icu"

EXTRA_OECONF = " \
    --with-cairo \
    --with-fontconfig \
    --with-freetype \
    --with-glib \
    --without-graphite2 \
"

PACKAGES =+ "${PN}-icu ${PN}-icu-dev"

LEAD_SONAME = "libharfbuzz.so"

FILES_${PN}-icu = "${libdir}/libharfbuzz-icu.so.*"
FILES_${PN}-icu-dev = "${libdir}/libharfbuzz-icu.la \
                       ${libdir}/libharfbuzz-icu.so \
                       ${libdir}/pkgconfig/harfbuzz-icu.pc \
"

BBCLASSEXTEND = "native nativesdk"

repository: miraclelinux/meta-debian-extended

repo_name: miraclelinux/meta-debian-extended

branch_name: refs/heads/warrior

gha_language: BitBake

extension: bb


text:
@INPROCEEDINGS{catena-bitcoin,
author={Alin Tomescu and Srinivas Devadas},
booktitle={2017 IEEE Symposium on Security and Privacy (SP)},
title={Catena: Efficient Non-equivocation via Bitcoin},
year={2017},
pages={393-409},
keywords={Java;file servers;public key cryptography;Bitcoin blockchain;CONIKS;Catena;Java;OP_RETURN transaction chain;adversarial server;bitcoinj library;efficiently-verifiable Bitcoin witnessing scheme;key transparency scheme;nonequivocation;public-key directory;Bandwidth;Bitcoin;Prototypes;Public key;Servers;Software},
doi={10.1109/SP.2017.19},
month={May},}

gha_language: SCSS


text:
# Copyright 2019 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Register an rclcpp component with the ament
# resource index and create an executable.
#
# usage: rclcpp_components_register_node(
#        <target> PLUGIN <component> EXECUTABLE <node>)
#
# :param target: the shared library target
# :type target: string
# :param PLUGIN: the plugin name
# :type PLUGIN: string
# :param EXECUTABLE: the node's executable name
# :type EXECUTABLE: string
# :param RESOURCE_INDEX: the ament resource index to register the components
# :type RESOURCE_INDEX: string
#
macro(rclcpp_components_register_node target)
  cmake_parse_arguments(ARGS "" "PLUGIN;EXECUTABLE;EXECUTOR;RESOURCE_INDEX" "" ${ARGN})
  if(ARGS_UNPARSED_ARGUMENTS)
    message(FATAL_ERROR "rclcpp_components_register_node() called with unused "
      "arguments: ${ARGS_UNPARSED_ARGUMENTS}")
  endif()
  if("${ARGS_PLUGIN}" STREQUAL "")
    message(FATAL_ERROR "rclcpp_components_register_node macro requires a PLUGIN argument for target ${target}")
  endif()
  if("${ARGS_EXECUTABLE}" STREQUAL "")
    message(FATAL_ERROR "rclcpp_components_register_node macro requires a EXECUTABLE argument for target ${target}")
  endif()
  # default to rclcpp_components if not specified otherwise
  set(resource_index "rclcpp_components")
  if(NOT "${ARGS_RESOURCE_INDEX}" STREQUAL "")
    set(resource_index ${ARGS_RESOURCE_INDEX})
    message(STATUS "Setting component resource index to non-default value ${resource_index}")
  endif()

  # default to executor if not specified otherwise
  set(executor "SingleThreadedExecutor")
  if(NOT "${ARGS_EXECUTOR}" STREQUAL "")
    set(executor ${ARGS_EXECUTOR})
    message(STATUS "Setting executor non-default value ${executor}")
  endif()

  set(component ${ARGS_PLUGIN})
  set(node ${ARGS_EXECUTABLE})
  _rclcpp_components_register_package_hook()
  set(_path "lib")
  set(library_name "$<TARGET_FILE_NAME:${target}>")
  if(WIN32)
    set(_path "bin")
  endif()
  set(_RCLCPP_COMPONENTS_${resource_index}__NODES
    "${_RCLCPP_COMPONENTS_${resource_index}__NODES}${component};${_path}/$<TARGET_FILE_NAME:${target}>\n")
  list(APPEND _RCLCPP_COMPONENTS_PACKAGE_RESOURCE_INDICES ${resource_index})

  configure_file(${rclcpp_components_NODE_TEMPLATE}
    ${PROJECT_BINARY_DIR}/rclcpp_components/node_main_configured_${node}.cpp.in)
  file(GENERATE OUTPUT ${PROJECT_BINARY_DIR}/rclcpp_components/node_main_${node}.cpp
    INPUT ${PROJECT_BINARY_DIR}/rclcpp_components/node_main_configured_${node}.cpp.in)
  add_executable(${node} ${PROJECT_BINARY_DIR}/rclcpp_components/node_main_${node}.cpp)
  ament_target_dependencies(${node}
    "rclcpp"
    "class_loader"
    "rclcpp_components")
  install(TARGETS
    ${node}
    DESTINATION lib/${PROJECT_NAME})
endmacro()

branch_name: refs/heads/rolling

extension: cmake


text:
// +build !integration

package vsphere

import (
	"testing"
)

func TestDeployOVATemplate(t *testing.T) {
	var err error
	sim.conn.Network, err = sim.conn.GetNetworkOrDefault("/DC0/network/VM Network")
	if err != nil {
		t.Fatal(err)
	}
	sim.conn.ResourcePool, err = sim.conn.GetResourcePoolOrDefault("/DC0/host/DC0_H0/Resources")
	if err != nil {
		t.Fatal(err)
	}
	sim.conn.Datastore, err = sim.conn.GetDatastoreOrDefault("/DC0/datastore/LocalDS_0")
	if err != nil {
		t.Fatal(err)
	}
	//templateOVA := "https://storage.googleapis.com/capv-images/release/v1.17.3/DC0_C0_RP0_VM1.ova"
	//templateOVA = "https://storage.googleapis.com/capv-images/release/v1.17.3/ubuntu-1804-kube-v1.17.3.ova"
	templateOVA := "https://communities.vmware.com/servlet/JiveServlet/downloadBody/21621-102-3-28798/Tiny Linux VM.ova"

	_, err = sim.conn.DeployOVATemplate(templateOVA)
	if err != nil {
		t.Fatalf(err.Error())
	}
}

repository: jacobweinstock/ovaimporter

repo_name: jacobweinstock/ovaimporter

branch_name: refs/heads/main

extension: go


text:
package internal

// UpdateKeyValuesInMap updates every instance of a key within an arbitrary
// `map[string]interface{}` with the given value.
func UpdateKeyValuesInMap(key string, value interface{}, m map[string]interface{}) map[string]interface{} {
	return updateMap(key, value, m)
}

// Recursively update the map to update the specified key.
func updateMap(key string, value interface{}, m map[string]interface{}) map[string]interface{} {
	for k, v := range m {
		switch v.(type) {
		// If slice, iterate through each entry and call updateMap
		// only if it's a map[string]interface{}.
		case []interface{}:
			for i := range v.([]interface{}) {
				switch v.([]interface{})[i].(type) {
				case map[string]interface{}:
					v.([]interface{})[i] = updateMap(key, value, v.([]interface{})[i].(map[string]interface{}))
				}
			}
		case map[string]interface{}:
			m[k] = updateMap(key, value, v.(map[string]interface{}))
		default:
			if k == key {
				m[k] = value
			}
			break
		}
	}

	return m
}

repository: beme/abide

repo_name: beme/abide

gha_language: Go


text:
package testutil

import (
	"fmt"
	"os"
	"os/signal"
	"runtime"
	"testing"

	"github.com/rjeczalik/flyingexec/util"
)

func init() {
	util.DefaultNet = InMemNet
	runtime.GOMAXPROCS(runtime.NumCPU())
	WatchInterrupt()
}

func stack(full bool) string {
	size := 1024
	if full {
		size = 8192
	}
	stack := make([]byte, size)
	_ = runtime.Stack(stack, full)
	return string(stack)
}

func WatchInterrupt() {
	ch := make(chan os.Signal, 1)
	signal.Notify(ch, os.Interrupt, os.Kill)
	go func() {
		if _, ok := <-ch; ok {
			fmt.Printf("error: interrupted; stacktrace:\n\n%s\n", stack(true))
			os.Exit(1)
		}
	}()
}

func GuardPanic(t *testing.T) {
	if r := recover(); r != nil {
		t.Errorf("recovered from panic \"%v\"; stacktrace:\n\n%s", r, stack(false))
	}
}

func Must(t *testing.T, f func() error) {
	wait := make(chan error, 1)
	for {
		select {
		case wait <- f():
		case err := <-wait:
			if err != nil {
				t.Fatalf("testutil.Must: expected err to be nil, got %q instead", err)
			}
			break
		}
	}
}

repository: rjeczalik/flyingexec

repo_name: rjeczalik/flyingexec


text:
DESCRIPTION = "A high performance, open source, general-purpose RPC framework. \
Provides gRPC libraries for multiple languages written on top of shared C core library \
(C++, Node.js, Python, Ruby, Objective-C, PHP, C#)"
HOMEPAGE = "https://github.com/grpc/grpc"
SECTION = "libs"
LICENSE = "Apache-2"

DEPENDS = "gflags c-ares protobuf protobuf-native protobuf-c protobuf-c-native openssl"
DEPENDS_append_class-target = " gtest grpc-native "

INSANE_SKIP_${PN} = "file-rdeps ldflags dev-so build-deps installed-vs-shipped "

LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57"

SRC_URI = "https://github.com/grpc/grpc/archive/v${PV}.tar.gz \
           file://0001-CMakeLists.txt-Fix-libraries-installation-for-Linux.patch \
           file://0004-CMakeLists.txt-Find-c-ares-in-target-sysroot-alone.patch \
           "
SRC_URI[md5sum] = "b565fa6787e42f4969395870c2ad436e"
SRC_URI[sha256sum] = "df9168da760fd2ee970c74c9d1b63377e0024be248deaa844e784d0df47599de"

SRC_URI_append_class-target = " file://0001-CMakeLists.txt-Fix-grpc_cpp_plugin-path-during-cross.patch"

inherit cmake

EXTRA_OECMAKE = " \
    -DgRPC_CARES_PROVIDER=package \
    -DgRPC_ZLIB_PROVIDER=package \
    -DgRPC_SSL_PROVIDER=package \
    -DgRPC_PROTOBUF_PROVIDER=package \
    -DgRPC_GFLAGS_PROVIDER=package \
    -DgRPC_INSTALL=1 \
    -DBUILD_SHARED_LIBS=ON \
    "

FILES_${PN}-dev += "${libdir}/cmake"

BBCLASSEXTEND = "native"


text:
# Distributed under the OSI-approved BSD 3-Clause License.
# Copyright Stefano Sinigardi

#.rst:
# FindPThreads
# ------------
#
# Find the PThreads includes and library.
#
# Result Variables
# ^^^^^^^^^^^^^^^^
#
# This module defines the following variables:
#
# ``PThreads_windows_FOUND``
#   True if PThreads_windows library found
#
# ``PThreads_windows_INCLUDE_DIR``
#   Location of PThreads_windows headers
#
# ``PThreads_windows_LIBRARY``
#   List of libraries to link with when using PThreads_windows
#

include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
include(${CMAKE_ROOT}/Modules/SelectLibraryConfigurations.cmake)

if(NOT PThreads_windows_INCLUDE_DIR)
  find_path(PThreads_windows_INCLUDE_DIR NAMES pthread.h PATHS ${PThreads_windows_DIR} PATH_SUFFIXES include)
endif()

# Allow libraries to be set manually
if(NOT PThreads_windows_LIBRARY)
  find_library(PThreads_windows_LIBRARY_RELEASE NAMES pthreadsVC2 pthreadVC2 PATHS ${PThreads_windows_DIR} PATH_SUFFIXES lib)
  find_library(PThreads_windows_LIBRARY_DEBUG NAMES pthreadsVC2d pthreadVC2d PATHS ${PThreads_windows_DIR} PATH_SUFFIXES lib)
  select_library_configurations(PThreads_windows)
endif()

find_package_handle_standard_args(PThreads_windows DEFAULT_MSG PThreads_windows_LIBRARY PThreads_windows_INCLUDE_DIR)
mark_as_advanced(PThreads_windows_INCLUDE_DIR PThreads_windows_LIBRARY)

set(PThreads_windows_DLL_DIR ${PThreads_windows_INCLUDE_DIR})
list(TRANSFORM PThreads_windows_DLL_DIR APPEND "/../bin")
message(STATUS "PThreads_windows_DLL_DIR: ${PThreads_windows_DLL_DIR}")

find_file(PThreads_windows_LIBRARY_RELEASE_DLL NAMES pthreadVC2.dll PATHS ${PThreads_windows_DLL_DIR})
find_file(PThreads_windows_LIBRARY_DEBUG_DLL NAMES pthreadVC2d.dll PATHS ${PThreads_windows_DLL_DIR})

# Register imported libraries:
# 1. If we can find a Windows .dll file (or if we can find both Debug and
#    Release libraries), we will set appropriate target properties for these.
# 2. However, for most systems, we will only register the import location and
#    include directory.

if( PThreads_windows_FOUND AND NOT TARGET PThreads_windows::PThreads_windows )
  if( EXISTS "${PThreads_windows_LIBRARY_RELEASE_DLL}" )
    add_library( PThreads_windows::PThreads_windows      SHARED IMPORTED )
    set_target_properties( PThreads_windows::PThreads_windows PROPERTIES
      IMPORTED_LOCATION_RELEASE         "${PThreads_windows_LIBRARY_RELEASE_DLL}"
      IMPORTED_IMPLIB                   "${PThreads_windows_LIBRARY_RELEASE}"
      INTERFACE_INCLUDE_DIRECTORIES     "${PThreads_windows_INCLUDE_DIR}"
      IMPORTED_CONFIGURATIONS           Release
      IMPORTED_LINK_INTERFACE_LANGUAGES "C" )
    if( EXISTS "${PThreads_windows_LIBRARY_DEBUG_DLL}" )
      set_property( TARGET PThreads_windows::PThreads_windows APPEND PROPERTY IMPORTED_CONFIGURATIONS Debug )
      set_target_properties( PThreads_windows::PThreads_windows PROPERTIES
        IMPORTED_LOCATION_DEBUG           "${PThreads_windows_LIBRARY_DEBUG_DLL}"
        IMPORTED_IMPLIB_DEBUG             "${PThreads_windows_LIBRARY_DEBUG}" )
    endif()
  else()
    add_library( PThreads_windows::PThreads_windows      UNKNOWN IMPORTED )
    set_target_properties( PThreads_windows::PThreads_windows PROPERTIES
      IMPORTED_LOCATION_RELEASE         "${PThreads_windows_LIBRARY_RELEASE}"
      INTERFACE_INCLUDE_DIRECTORIES     "${PThreads_windows_INCLUDE_DIR}"
      IMPORTED_CONFIGURATIONS           Release
      IMPORTED_LINK_INTERFACE_LANGUAGES "C" )
    if( EXISTS "${PThreads_windows_LIBRARY_DEBUG}" )
      set_property( TARGET PThreads_windows::PThreads_windows APPEND PROPERTY IMPORTED_CONFIGURATIONS Debug )
      set_target_properties( PThreads_windows::PThreads_windows PROPERTIES
        IMPORTED_LOCATION_DEBUG           "${PThreads_windows_LIBRARY_DEBUG}" )
    endif()
  endif()
endif()


text:
package main

import (
	"fmt"
	"os"
	"os/exec"
	"strings"
)

func RemoteHeadCommitId() (string, error) {
	cmd := exec.Command("git", "ls-remote", "origin", "HEAD")
	cmd.Stderr = os.Stderr

	id, err := cmd.Output()

	if err != nil {
		return "", err
	}

	return strings.Split(string(id), "\t")[0], nil
}

func LocalHeadCommitId() (string, error) {
	cmd := exec.Command("git", "show", "HEAD", "-s", "--format=%H")
	cmd.Stderr = os.Stderr

	id, err := cmd.Output()

	if err != nil {
		return "", err
	}

	return strings.TrimSpace(string(id)), nil
}

func IsLatest(localId, remoteId string) bool {
	if localId == "" || remoteId == "" {
		return false
	}
	return localId == remoteId
}

func GitPull() string {
	cmd := exec.Command("git", "pull")
	cmd.Stderr = os.Stderr

	merged, _ := cmd.Output()

	return string(merged)
}

func SyncRepository() (string, error) {
	localId, err := LocalHeadCommitId()
	if err != nil {
		fmt.Println(err)
		return "", err
	}

	remoteId, err := RemoteHeadCommitId()
	if err != nil {
		fmt.Println(err)
		return "", err
	}

	if IsLatest(localId, remoteId) {
		return "", nil
	}

	return GitPull(), nil
}


text:
// Copyright 2014 Caleb Brose, Chris Fogerty, Rob Sheehy, Zach Taylor, Nick Miller
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package auth

import (
	"testing"

	"bytes"
	"encoding/json"
	"fmt"
	"net/http"
	"net/http/httptest"
	"strings"

	"github.com/gorilla/mux"
	"github.com/stretchr/testify/assert"

	"github.com/lighthouse/lighthouse/databases"
	"github.com/lighthouse/lighthouse/session"
)

func setup() {
	SetupTestingTable()
}

func teardown() {
	TeardownTestingTable()
}

func addUsers(list ...User) {
	for _, user := range list {

		users.Insert(map[string]interface{}{
			"Email":       user.Email,
			"Salt":        user.Salt,
			"Password":    user.Password,
			"AuthLevel":   user.AuthLevel,
			"Permissions": user.Permissions,
		})
	}
}

func handleAndServe(endpoint string, f http.HandlerFunc, r *http.Request) *httptest.ResponseRecorder {
	w := httptest.NewRecorder()
	m := mux.NewRouter()
	m.HandleFunc(endpoint, f)
	m.ServeHTTP(w, r)
	return w
}

func Test_WriteResponse_OK(t *testing.T) {
	w := httptest.NewRecorder()
	writeResponse(w, 200, nil)
	assert.Equal(t, 200, w.Code)
}

func Test_CreateUser(t *testing.T) {
	setup()
	defer teardown()

	email := "EMAIL"
	salt := "SALT"
	password := "PASSWORD"

	CreateUser(email, salt, password)

	keyUser := User{
		email, salt, password, DefaultAuthLevel, NewPermission(),
	}

	var actual User
	users.SelectRow(nil, nil, nil, &actual)

	assert.Equal(t, keyUser, actual)
}

func Test_CreateUserWithAuthLevel(t *testing.T) {
	setup()
	defer teardown()

	email := "EMAIL"
	salt := "SALT"
	password := "PASSWORD"
	authLevel := 3

	createUserWithAuthLevel(email, salt, password, authLevel)

	keyUser := User{
		email, salt, password, authLevel, NewPermission(),
	}

	var actual User
	users.SelectRow(nil, nil, nil, &actual)

	assert.Equal(t, keyUser, actual)
}

func Test_GetUser_Valid(t *testing.T) {
	setup()
	defer teardown()

	perms := NewPermission()
	perms["TestField"] = map[string]interface{}{"TestKey": 1}

	keyUser := User{
		"EMAIL", "SALT", "PASSWORD", 3, perms,
	}

	addUsers(keyUser)

	user, err := GetUser(keyUser.Email)

	assert.Nil(t, err)
	assert.Equal(t, keyUser.Email, user.Email)
	assert.Equal(t, keyUser.Salt, user.Salt)
	assert.Equal(t, keyUser.Password, user.Password)
	assert.Equal(t, keyUser.AuthLevel, user.AuthLevel)
	assert.Equal(t, keyUser.Permissions, user.Permissions)
}

func Test_GetUser_Invalid(t *testing.T) {
	setup()
	defer teardown()

	user, err := GetUser("BAD EMAIL")

	assert.NotNil(t, err)
	assert.Nil(t, user)
}

func Test_GetCurrentUser(t *testing.T) {
	setup()
	defer teardown()

	r, _ := http.NewRequest("GET", "/", nil)
	session.SetValue(r, "auth", "email", "EMAIL")

	perms := NewPermission()
	perms["TestField"] = map[string]interface{}{"TestKey": 1}

	keyUser := User{
		"EMAIL", "SALT", "PASSWORD", 3, perms,
	}

	addUsers(keyUser)

	user := GetCurrentUser(r)

	assert.Equal(t, keyUser.Email, user.Email)
	assert.Equal(t, keyUser.Salt, user.Salt)
	assert.Equal(t, keyUser.Password, user.Password)
	assert.Equal(t, keyUser.AuthLevel, user.AuthLevel)
	assert.Equal(t, keyUser.Permissions, user.Permissions)
}

func Test_SetUserBeaconAuthLevel(t *testing.T) {
	setup()
	defer teardown()

	perms := NewPermission()
	perms["Beacons"] = map[string]interface{}{"OVERWRITE": 0}

	keyPerms := map[string]interface{}{
		"OVERWRITE": 1, "NEW": 2,
	}

	user := &User{Email: "EMAIL", Permissions: perms}

	addUsers(*user)

	SetUserBeaconAuthLevel(user, "OVERWRITE", 1)
	SetUserBeaconAuthLevel(user, "NEW", 2)

	cols := []string{"Permissions"}
	users.SelectRow(cols, nil, nil, user)

	assert.Equal(t, keyPerms, user.Permissions["Beacons"])
}

func Test_GetAllUsers(t *testing.T) {
	setup()
	defer teardown()

	current := &User{Email: "current", AuthLevel: 1}

	addUsers(
		*current,
		User{Email: "lower", AuthLevel: 0},
		User{Email: "equal", AuthLevel: 1},
		User{Email: "higher", AuthLevel: 2},
	)

	users, _ := getAllUsers(current)

	assert.Equal(t, 2, len(users))
	if len(users) != 2 {
		return
	}

	assert.True(t, users[0] == "current" || users[1] == "current",
		"getAllUsers should list current user")

	assert.True(t, users[0] == "lower" || users[1] == "lower",
		"getAllUsers should list less privileged users")
}

func Test_ParseUserUpdateRequest_AuthLevel_Valid(t *testing.T) {
	curUser := &User{AuthLevel: 1}
	modUser := &User{AuthLevel: 0}

	var update []byte
	var vals map[string]interface{}
	var code int

	update = []byte(`{"AuthLevel" : 1}`)
	vals, code = parseUserUpdateRequest(curUser, modUser, update)
	assert.Equal(t, http.StatusOK, code)
	assert.Equal(t, 1, vals["AuthLevel"])
}

func Test_ParseUserUpdateRequest_AuthLevel_Invalid(t *testing.T) {
	curUser := &User{AuthLevel: 1}
	modUser := &User{AuthLevel: 0}

	var update []byte
	var vals map[string]interface{}
	var code int

	update = []byte(`{"AuthLevel" : -1}`)
	vals, code = parseUserUpdateRequest(curUser, modUser, update)
	assert.Equal(t, http.StatusBadRequest, code)
	assert.Nil(t, vals)

	update = []byte(`{"AuthLevel" : 2}`)
	vals, code = parseUserUpdateRequest(curUser, modUser, update)
	assert.Equal(t, http.StatusForbidden, code)
	assert.Nil(t, vals)
}

func Test_ParseUserUpdateRequest_Password(t *testing.T) {
	modUser := &User{AuthLevel: 0, Password: "OLD"}

	keyPassword := SaltPassword("PASSWORD", modUser.Salt)

	update := []byte(`{"Password" : "PASSWORD"}`)
	vals, code := parseUserUpdateRequest(nil, modUser, update)
	assert.Equal(t, http.StatusOK, code)
	assert.Equal(t, keyPassword, vals["Password"])
}

func Test_ParseUserUpdateRequest_Beacons_Valid(t *testing.T) {
	curPerms := NewPermission()
	curPerms["Beacons"] = map[string]interface{}{
		"Beacon 1": ModifyAuthLevel,
		"Beacon 2": ModifyAuthLevel,
		"Beacon 3": ModifyAuthLevel,
	}

	modPerms := NewPermission()
	modPerms["Beacons"] = map[string]interface{}{
		"Beacon 1": AccessAuthLevel,
		"Beacon 3": ModifyAuthLevel,
	}

	curUser := &User{Permissions: curPerms}
	modUser := &User{Permissions: modPerms}

	updateStr := fmt.Sprintf(
		`{"Beacons" : {"Beacon 1": %d, "Beacon 2" : %d, "Beacon 3" : %d}}`,
		ModifyAuthLevel, AccessAuthLevel, -1)

	vals, code := parseUserUpdateRequest(curUser, modUser, []byte(updateStr))
	assert.Equal(t, http.StatusOK, code)
	if code != http.StatusOK {
		return
	}

	perms := vals["Permissions"].(Permission)
	beacons := perms["Beacons"].(map[string]interface{})
	_, found := beacons["Beacon 3"]

	assert.Equal(t, ModifyAuthLevel, beacons["Beacon 1"])
	assert.Equal(t, AccessAuthLevel, beacons["Beacon 2"])
	assert.False(t, found) // Beacon 3 removed
}

func Test_ParseUserUpdateRequest_Beacons_CantModify(t *testing.T) {
	curPerms := NewPermission()
	curPerms["Beacons"] = map[string]interface{}{
		"Beacon": AccessAuthLevel,
	}

	modPerms := NewPermission()

	curUser := &User{Permissions: curPerms}
	modUser := &User{Permissions: modPerms}

	updateStr := fmt.Sprintf(`{"Beacons" : {"Beacon" : %d}}`, AccessAuthLevel)

	vals, code := parseUserUpdateRequest(curUser, modUser, []byte(updateStr))
	assert.Equal(t, http.StatusForbidden, code)
	assert.Nil(t, vals)
}

func Test_ParseUserUpdateRequest_Beacons_TooHigh(t *testing.T) {
	curPerms := NewPermission()
	curPerms["Beacons"] = map[string]interface{}{
		"Beacon": ModifyAuthLevel,
	}

	modPerms := NewPermission()

	curUser := &User{Permissions: curPerms}
	modUser := &User{Permissions: modPerms}

	updateStr := fmt.Sprintf(`{"Beacons" : {"Beacon" : %d}}`, OwnerAuthLevel)

	vals, code := parseUserUpdateRequest(curUser, modUser, []byte(updateStr))
	assert.Equal(t, http.StatusForbidden, code)
	assert.Nil(t, vals)
}

func Test_ParseUserUpdateRequest_BadJSON(t *testing.T) {
	curPerms := NewPermission()
	curPerms["Beacons"] = map[string]interface{}{
		"Beacon": ModifyAuthLevel,
	}

	modPerms := NewPermission()

	curUser := &User{Permissions: curPerms}
	modUser := &User{Permissions: modPerms}

	updateStr := "{"

	vals, code := parseUserUpdateRequest(curUser, modUser, []byte(updateStr))
	assert.Equal(t, http.StatusBadRequest, code)
	assert.Nil(t, vals)
}

func Test_HandleListUsers(t *testing.T) {
	setup()
	defer teardown()

	keyEmail := "EMAIL"

	w := httptest.NewRecorder()
	r, _ := http.NewRequest("GET", "/", nil)
	session.SetValue(r, "auth", "email", keyEmail)

	addUsers(User{Email: keyEmail})

	http.Handler(http.HandlerFunc(handleListUsers)).ServeHTTP(w, r)

	assert.Equal(t, http.StatusOK, w.Code)
	assert.True(t, strings.Contains(w.Body.String(), keyEmail))
}

func Test_HandleGetUsers_Valid(t *testing.T) {
	setup()
	defer teardown()

	keyEmail := "EMAIL"

	r, _ := http.NewRequest("GET", "/EMAIL", nil)

	session.SetValue(r, "auth", "email", keyEmail)
	addUsers(User{Email: keyEmail, AuthLevel: 2})

	w := handleAndServe("/{Email}", handleGetUser, r)

	assert.Equal(t, http.StatusOK, w.Code)

	resp := make(map[string]interface{})
	json.Unmarshal(w.Body.Bytes(), &resp)

	assert.Equal(t, "EMAIL", resp["Email"])
	assert.Equal(t, float64(2), resp["AuthLevel"])
}

func Test_HandleGetUsers_NotFound(t *testing.T) {
	setup()
	defer teardown()

	r, _ := http.NewRequest("GET", "/BAD", nil)

	session.SetValue(r, "auth", "email", "USER")
	addUsers(User{Email: "USER", AuthLevel: 0})

	w := handleAndServe("/{Email}", handleGetUser, r)

	assert.Equal(t, http.StatusNotFound, w.Code)
}

func Test_HandleGetUsers_NotAuthorized(t *testing.T) {
	setup()
	defer teardown()

	r, _ := http.NewRequest("GET", "/ADMIN", nil)

	session.SetValue(r, "auth", "email", "USER")
	addUsers(
		User{Email: "ADMIN", AuthLevel: 2},
		User{Email: "USER", AuthLevel: 0},
	)

	w := handleAndServe("/{Email}", handleGetUser, r)

	assert.Equal(t, http.StatusNotFound, w.Code)
}

func Test_HandleUpdateUser_Valid(t *testing.T) {
	setup()
	defer teardown()

	keyUser := User{
		Email:     "USER",
		AuthLevel: 1,
		Password:  SaltPassword("PASSWORD", ""),
		Permissions: map[string]interface{}{
			"Beacons": map[string]interface{}{
				"BEACON": AccessAuthLevel,
			},
		},
	}

	baseUser := User{
		Email:     "USER",
		AuthLevel: 2,
		Password:  "OLD",
		Permissions: map[string]interface{}{
			"Beacons": map[string]interface{}{
				"BEACON": OwnerAuthLevel,
			},
		},
	}

	addUsers(baseUser)

	updateJSON, _ := json.Marshal(
		map[string]interface{}{
			"AuthLevel": 1,
			"Password":  "PASSWORD",
			"Beacons": map[string]interface{}{
				"BEACON": AccessAuthLevel,
			},
		})

	r, _ := http.NewRequest("PUT", "/USER", bytes.NewBuffer(updateJSON))

	session.SetValue(r, "auth", "email", "USER")

	w := handleAndServe("/{Email}", handleUpdateUser, r)

	var user User
	users.SelectRow(nil, nil, nil, &user)

	assert.Equal(t, http.StatusOK, w.Code)
	assert.Equal(t, keyUser, user)
}

func Test_HandleUpdateUser_NotAuthorized(t *testing.T) {
	setup()
	defer teardown()

	keyUser := User{
		Email:     "USER",
		AuthLevel: 0,
		Password:  "OLD",
		Permissions: map[string]interface{}{
			"Beacons": map[string]interface{}{
				"BEACON": OwnerAuthLevel,
			},
		},
	}

	addUsers(keyUser)

	updateJSON := []byte(`{"AuthLevel" : 1}`)

	r, _ := http.NewRequest("PUT", "/USER", bytes.NewBuffer(updateJSON))

	session.SetValue(r, "auth", "email", "USER")

	w := handleAndServe("/{Email}", handleUpdateUser, r)

	var user User
	users.SelectRow(nil, nil, nil, &user)

	assert.Equal(t, http.StatusForbidden, w.Code)
	assert.Equal(t, keyUser, user)
}

func Test_HandleUpdateUser_CantView(t *testing.T) {
	setup()
	defer teardown()

	actingUser := User{
		Email: "USER", AuthLevel: 0,
	}

	modUser := User{
		Email: "USER2", AuthLevel: 1,
	}

	addUsers(actingUser, modUser)

	r, _ := http.NewRequest("PUT", "/USER2", bytes.NewBuffer([]byte(`{}`)))

	session.SetValue(r, "auth", "email", "USER")

	w := handleAndServe("/{Email}", handleUpdateUser, r)

	var user User
	users.SelectRow(nil, nil, nil, &user)

	assert.Equal(t, http.StatusNotFound, w.Code)
}

func Test_HandleUpdateUser_UnknownUser(t *testing.T) {
	setup()
	defer teardown()

	actingUser := User{
		Email: "USER", AuthLevel: 0,
	}

	addUsers(actingUser)

	r, _ := http.NewRequest("PUT", "/BAD_USER", bytes.NewBuffer([]byte(`{}`)))

	session.SetValue(r, "auth", "email", "USER")

	w := handleAndServe("/{Email}", handleUpdateUser, r)

	var user User
	users.SelectRow(nil, nil, nil, &user)

	assert.Equal(t, http.StatusNotFound, w.Code)
}

func Test_HandleCreateUser_Valid(t *testing.T) {
	setup()
	defer teardown()

	admin := User{Email: "ADMIN", AuthLevel: 1}
	addUsers(admin)

	add := map[string]string{"Email": "USER", "Password": "PASSWORD"}
	addJSON, _ := json.Marshal(add)

	r, _ := http.NewRequest("POST", "/", bytes.NewBuffer(addJSON))
	session.SetValue(r, "auth", "email", "ADMIN")

	w := handleAndServe("/", handleCreateUser, r)

	var user User
	where := databases.Filter{"Email": "USER"}
	users.SelectRow(nil, where, nil, &user)

	assert.Equal(t, http.StatusOK, w.Code)
	assert.Equal(t, "USER", user.Email)
	assert.Equal(t, SaltPassword("PASSWORD", user.Salt), user.Password)
	assert.Equal(t, 0, user.AuthLevel)
}

func Test_HandleCreateUser_Unauthorized(t *testing.T) {
	setup()
	defer teardown()

	admin := User{Email: "ADMIN", AuthLevel: 0}
	addUsers(admin)

	add := map[string]string{"Email": "USER", "Password": "PASSWORD"}
	addJSON, _ := json.Marshal(add)

	r, _ := http.NewRequest("POST", "/", bytes.NewBuffer(addJSON))
	session.SetValue(r, "auth", "email", "ADMIN")

	w := handleAndServe("/", handleCreateUser, r)

	assert.Equal(t, http.StatusForbidden, w.Code)
}

func Test_HandleCreateUser_BadJSON(t *testing.T) {
	setup()
	defer teardown()

	admin := User{Email: "ADMIN", AuthLevel: 1}
	addUsers(admin)

	add := []int{1}
	addJSON, _ := json.Marshal(add)

	r, _ := http.NewRequest("POST", "/", bytes.NewBuffer(addJSON))
	session.SetValue(r, "auth", "email", "ADMIN")

	w := handleAndServe("/", handleCreateUser, r)

	assert.Equal(t, http.StatusBadRequest, w.Code)
}

func Test_HandleCreateUser_Exists(t *testing.T) {
	setup()
	defer teardown()

	admin := User{Email: "ADMIN", AuthLevel: 1}
	addUsers(admin)

	add := map[string]string{"Email": "ADMIN", "Password": "PASSWORD"}
	addJSON, _ := json.Marshal(add)

	r, _ := http.NewRequest("POST", "/", bytes.NewBuffer(addJSON))
	session.SetValue(r, "auth", "email", "ADMIN")

	w := handleAndServe("/", handleCreateUser, r)

	assert.Equal(t, http.StatusBadRequest, w.Code)
}

repository: lighthouse-isu/lighthouse

repo_name: lighthouse-isu/lighthouse


text:
file(REMOVE_RECURSE
  "CMakeFiles/convert_woff2ttf_fuzzer_new_entry.dir/src/convert_woff2ttf_fuzzer_new_entry.cc.o"
  "libconvert_woff2ttf_fuzzer_new_entry.pdb"
  "libconvert_woff2ttf_fuzzer_new_entry.bc"
)

# Per-language clean rules from dependency scanning.
foreach(lang CXX)
  include(CMakeFiles/convert_woff2ttf_fuzzer_new_entry.dir/cmake_clean_${lang}.cmake OPTIONAL)
endforeach()


text:
# base recipe: meta-security/meta-tpm/recipes-tpm2/tpm2-tss/tpm2-tss_2.2.1.bb
# base branch: warrior

SUMMARY = "Software stack for TPM2."
DESCRIPTION = "OSS implementation of the TCG TPM2 Software Stack (TSS2) "
LICENSE = "BSD-2-Clause"
LIC_FILES_CHKSUM = "file://LICENSE;md5=0b1d631c4218b72f6b05cb58613606f4"
SECTION = "tpm"

inherit debian-package
require recipes-debian/sources/tpm2-tss.inc

DEPENDS = "autoconf-archive-native libgcrypt openssl"

inherit autotools-brokensep pkgconfig systemd

PACKAGECONFIG ??= ""
PACKAGECONFIG[oxygen] = ",--disable-doxygen-doc, "

do_configure_prepend () {
	./bootstrap
}

INHERIT += "extrausers"
EXTRA_USERS_PARAMS = "\
	useradd -p '' tss; \
	groupadd tss; \
	"

PACKAGES = " \
    ${PN} \
    ${PN}-dbg \
    ${PN}-doc \
    libtss2-mu \
    libtss2-mu-dev \
    libtss2-mu-staticdev \
    libtss2-tcti-device \
    libtss2-tcti-device-dev \
    libtss2-tcti-device-staticdev \
    libtss2-tcti-mssim \
    libtss2-tcti-mssim-dev \
    libtss2-tcti-mssim-staticdev \
    libtss2 \
    libtss2-dev \
    libtss2-staticdev \
"

FILES_libtss2-tcti-device = "${libdir}/libtss2-tcti-device.so.*"
FILES_libtss2-tcti-device-dev = " \
    ${includedir}/tss2/tss2_tcti_device.h \
    ${libdir}/pkgconfig/tss2-tcti-device.pc \
    ${libdir}/libtss2-tcti-device.so"
FILES_libtss2-tcti-device-staticdev = "${libdir}/libtss2-tcti-device.*a"

FILES_libtss2-tcti-mssim = "${libdir}/libtss2-tcti-mssim.so.*"
FILES_libtss2-tcti-mssim-dev = " \
    ${includedir}/tss2/tss2_tcti_mssim.h \
    ${libdir}/pkgconfig/tss2-tcti-mssim.pc \
    ${libdir}/libtss2-tcti-mssim.so"
FILES_libtss2-tcti-mssim-staticdev = "${libdir}/libtss2-tcti-mssim.*a"

FILES_libtss2-mu = "${libdir}/libtss2-mu.so.*"
FILES_libtss2-mu-dev = " \
    ${includedir}/tss2/tss2_mu.h \
    ${libdir}/pkgconfig/tss2-mu.pc \
    ${libdir}/libtss2-mu.so"
FILES_libtss2-mu-staticdev = "${libdir}/libtss2-mu.*a"

FILES_libtss2 = "${libdir}/libtss2*so.*"
FILES_libtss2-dev = " \
    ${includedir} \
    ${libdir}/pkgconfig \
    ${libdir}/libtss2*so"
FILES_libtss2-staticdev = "${libdir}/libtss*a"

FILES_${PN} = "${libdir}/udev"

RDEPENDS_libtss2 = "libgcrypt"

BBCLASSEXTEND = "native"

repository: meta-debian/meta-debian

repo_name: meta-debian/meta-debian


text:
/*
Copyright (c) 2019-present ServiceMax Inc. All rights reserved.
*/
module.exports = { extends: ['@commitlint/config-conventional'] };

gha_language: JavaScript

extension: js


text:
SUMMARY = "Sensor/Actuator repository for Mraa"
SECTION = "libs"
AUTHOR = "Brendan Le Foll, Tom Ingleby, Yevgeniy Kiveisha"

LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=d1cc191275d6a8c5ce039c75b2b3dc29"

DEPENDS = "nodejs swig-native mraa"

SRC_URI = "git://github.com/intel-iot-devkit/upm.git;protocol=git;rev=3d453811fb7760e14da1a3461e05bfba1893c2bd \
           file://0001-adafruitms1438-CMakeLists.txt-stop-RPATH-being-added.patch \
           file://0001-hcsr04-Fixed-compilation-error-after-MRAA-enum-renam.patch"

S = "${WORKDIR}/git"

inherit distutils-base pkgconfig python-dir cmake

FILES_${PN}-doc += "${datadir}/upm/examples/"

repository: gizero/meta-intel-iot-middleware

repo_name: gizero/meta-intel-iot-middleware

branch_name: refs/heads/dizzy


text:
/*
 * jQuery File Upload Plugin GAE Go Example 3.1.1
 * https://github.com/blueimp/jQuery-File-Upload
 *
 * Copyright 2011, Sebastian Tschan
 * https://blueimp.net
 *
 * Licensed under the MIT license:
 * http://www.opensource.org/licenses/MIT
 */

package app

import (
	"appengine"
	"appengine/blobstore"
	"appengine/image"
	"appengine/taskqueue"
	"bytes"
	"encoding/json"
	"fmt"
	"io"
	"log"
	"mime/multipart"
	"net/http"
	"net/url"
	"regexp"
	"strings"
	"time"
)

const (
	WEBSITE           = "http://blueimp.github.io/jQuery-File-Upload/"
	MIN_FILE_SIZE     = 1       // bytes
	MAX_FILE_SIZE     = 5000000 // bytes
	IMAGE_TYPES       = "image/(gif|p?jpeg|(x-)?png)"
	ACCEPT_FILE_TYPES = IMAGE_TYPES
	EXPIRATION_TIME   = 300 // seconds
	THUMBNAIL_PARAM   = "=s80"
)

var (
	imageTypes      = regexp.MustCompile(IMAGE_TYPES)
	acceptFileTypes = regexp.MustCompile(ACCEPT_FILE_TYPES)
)

type FileInfo struct {
	Key          appengine.BlobKey `json:"-"`
	Url          string            `json:"url,omitempty"`
	ThumbnailUrl string            `json:"thumbnailUrl,omitempty"`
	Name         string            `json:"name"`
	Type         string            `json:"type"`
	Size         int64             `json:"size"`
	Error        string            `json:"error,omitempty"`
	DeleteUrl    string            `json:"deleteUrl,omitempty"`
	DeleteType   string            `json:"deleteType,omitempty"`
}

func (fi *FileInfo) ValidateType() (valid bool) {
	if acceptFileTypes.MatchString(fi.Type) {
		return true
	}
	fi.Error = "Filetype not allowed"
	return false
}

func (fi *FileInfo) ValidateSize() (valid bool) {
	if fi.Size < MIN_FILE_SIZE {
		fi.Error = "File is too small"
	} else if fi.Size > MAX_FILE_SIZE {
		fi.Error = "File is too big"
	} else {
		return true
	}
	return false
}

func (fi *FileInfo) CreateUrls(r *http.Request, c appengine.Context) {
	u := &url.URL{
		Scheme: r.URL.Scheme,
		Host:   appengine.DefaultVersionHostname(c),
		Path:   "/",
	}
	uString := u.String()
	fi.Url = uString + escape(string(fi.Key)) + "/" +
		escape(string(fi.Name))
	fi.DeleteUrl = fi.Url + "?delete=true"
	fi.DeleteType = "DELETE"
	if imageTypes.MatchString(fi.Type) {
		servingUrl, err := image.ServingURL(
			c,
			fi.Key,
			&image.ServingURLOptions{
				Secure: strings.HasSuffix(u.Scheme, "s"),
				Size:   0,
				Crop:   false,
			},
		)
		check(err)
		fi.ThumbnailUrl = servingUrl.String() + THUMBNAIL_PARAM
	}
}

func check(err error) {
	if err != nil {
		panic(err)
	}
}

func escape(s string) string {
	return strings.Replace(url.QueryEscape(s), "+", "%20", -1)
}

func delayedDelete(c appengine.Context, fi *FileInfo) {
	if key := string(fi.Key); key != "" {
		task := &taskqueue.Task{
			Path:   "/" + escape(key) + "/-",
			Method: "DELETE",
			Delay:  time.Duration(EXPIRATION_TIME) * time.Second,
		}
		taskqueue.Add(c, task, "")
	}
}

func handleUpload(r *http.Request, p *multipart.Part) (fi *FileInfo) {
	fi = &FileInfo{
		Name: p.FileName(),
		Type: p.Header.Get("Content-Type"),
	}
	if !fi.ValidateType() {
		return
	}
	defer func() {
		if rec := recover(); rec != nil {
			log.Println(rec)
			fi.Error = rec.(error).Error()
		}
	}()
	lr := &io.LimitedReader{R: p, N: MAX_FILE_SIZE + 1}
	context := appengine.NewContext(r)
	w, err := blobstore.Create(context, fi.Type)
	defer func() {
		w.Close()
		fi.Size = MAX_FILE_SIZE + 1 - lr.N
		fi.Key, err = w.Key()
		check(err)
		if !fi.ValidateSize() {
			err := blobstore.Delete(context, fi.Key)
			check(err)
			return
		}
		delayedDelete(context, fi)
		fi.CreateUrls(r, context)
	}()
	check(err)
	_, err = io.Copy(w, lr)
	return
}

func getFormValue(p *multipart.Part) string {
	var b bytes.Buffer
	io.CopyN(&b, p, int64(1<<20)) // Copy max: 1 MiB
	return b.String()
}

func handleUploads(r *http.Request) (fileInfos []*FileInfo) {
	fileInfos = make([]*FileInfo, 0)
	mr, err := r.MultipartReader()
	check(err)
	r.Form, err = url.ParseQuery(r.URL.RawQuery)
	check(err)
	part, err := mr.NextPart()
	for err == nil {
		if name := part.FormName(); name != "" {
			if part.FileName() != "" {
				fileInfos = append(fileInfos, handleUpload(r, part))
			} else {
				r.Form[name] = append(r.Form[name], getFormValue(part))
			}
		}
		part, err = mr.NextPart()
	}
	return
}

func get(w http.ResponseWriter, r *http.Request) {
	if r.URL.Path == "/" {
		http.Redirect(w, r, WEBSITE, http.StatusFound)
		return
	}
	parts := strings.Split(r.URL.Path, "/")
	if len(parts) == 3 {
		if key := parts[1]; key != "" {
			blobKey := appengine.BlobKey(key)
			bi, err := blobstore.Stat(appengine.NewContext(r), blobKey)
			if err == nil {
				w.Header().Add("X-Content-Type-Options", "nosniff")
				if !imageTypes.MatchString(bi.ContentType) {
					w.Header().Add("Content-Type", "application/octet-stream")
					w.Header().Add(
						"Content-Disposition",
						fmt.Sprintf("attachment; filename=\"%s\"", parts[2]),
					)
				}
				w.Header().Add(
					"Cache-Control",
					fmt.Sprintf("public,max-age=%d", EXPIRATION_TIME),
				)
				blobstore.Send(w, blobKey)
				return
			}
		}
	}
	http.Error(w, "404 Not Found", http.StatusNotFound)
}

func post(w http.ResponseWriter, r *http.Request) {
    result := make(map[string][]*FileInfo, 1)
    result["files"] = handleUploads(r)
	b, err := json.Marshal(result)
	check(err)
	if redirect := r.FormValue("redirect"); redirect != "" {
	    if strings.Contains(redirect, "%s") {
	        redirect = fmt.Sprintf(
    			redirect,
    			escape(string(b)),
    		)
	    }
		http.Redirect(w, r, redirect, http.StatusFound)
		return
	}
	w.Header().Set("Cache-Control", "no-cache")
	jsonType := "application/json"
	if strings.Index(r.Header.Get("Accept"), jsonType) != -1 {
		w.Header().Set("Content-Type", jsonType)
	}
	fmt.Fprintln(w, string(b))
}

func delete(w http.ResponseWriter, r *http.Request) {
	parts := strings.Split(r.URL.Path, "/")
	if len(parts) != 3 {
		return
	}
	result := make(map[string]bool, 1)
	if key := parts[1]; key != "" {
		c := appengine.NewContext(r)
		blobKey := appengine.BlobKey(key)
		err := blobstore.Delete(c, blobKey)
		check(err)
		err = image.DeleteServingURL(c, blobKey)
		check(err)
		result[key] = true
	}
	jsonType := "application/json"
	if strings.Index(r.Header.Get("Accept"), jsonType) != -1 {
		w.Header().Set("Content-Type", jsonType)
	}
	b, err := json.Marshal(result)
	check(err)
	fmt.Fprintln(w, string(b))
}

func handle(w http.ResponseWriter, r *http.Request) {
	params, err := url.ParseQuery(r.URL.RawQuery)
	check(err)
	w.Header().Add("Access-Control-Allow-Origin", "*")
	w.Header().Add(
		"Access-Control-Allow-Methods",
		"OPTIONS, HEAD, GET, POST, PUT, DELETE",
	)
	w.Header().Add(
		"Access-Control-Allow-Headers",
		"Content-Type, Content-Range, Content-Disposition",
	)
	switch r.Method {
	case "OPTIONS":
	case "HEAD":
	case "GET":
		get(w, r)
	case "POST":
		if len(params["_method"]) > 0 && params["_method"][0] == "DELETE" {
			delete(w, r)
		} else {
			post(w, r)
		}
	case "DELETE":
		delete(w, r)
	default:
		http.Error(w, "501 Not Implemented", http.StatusNotImplemented)
	}
}

func init() {
	http.HandleFunc("/", handle)
}

repository: Zihaoo/miaosha

repo_name: Zihaoo/miaosha

gha_language: Java


text:
package gallium

import (
	"os"
	"syscall"
)

// RedirectStdoutStderr overwrites the stdout and stderr streams with a file
// descriptor that writes to the given path. This is done with os.Dup2,
// meaning that even C functions that write to stdout or stderr will be
// redirected to the file.
func RedirectStdoutStderr(path string) (*os.File, error) {
	return redirect(path, os.Stdout.Fd(), os.Stderr.Fd())
}

// RedirectStdout overwrites the stdout streams with a file
// descriptor that writes to the given path. This is done with os.Dup2,
// meaning that even C functions that write to stdout will be
// redirected to the file.
func RedirectStdout(path string) (*os.File, error) {
	return redirect(path, os.Stdout.Fd())
}

// RedirectStderr overwrites the stderr streams with a file
// descriptor that writes to the given path. This is done with os.Dup2,
// meaning that even C functions that write to stderr will be
// redirected to the file.
func RedirectStderr(path string) (*os.File, error) {
	return redirect(path, os.Stderr.Fd())
}

func redirect(path string, fds ...uintptr) (*os.File, error) {
	f, err := os.OpenFile(path, os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0777)
	if err != nil {
		return nil, err
	}

	for _, fd := range fds {
		err = syscall.Dup2(int(f.Fd()), int(fd))
		if err != nil {
			return nil, err
		}
	}

	return f, nil
}

repository: HaraldNordgren/gallium

repo_name: HaraldNordgren/gallium


text:
package main

import (
	"database/sql"
	"fmt"
	"net/http"
	"time"

	"github.com/Preetam/onecontactlink/internal-api/client"
	"github.com/Preetam/onecontactlink/middleware"
	"github.com/Preetam/onecontactlink/schema"
	"github.com/Preetam/onecontactlink/web/linktoken"
	log "github.com/Sirupsen/logrus"
	"github.com/VividCortex/siesta"
	"github.com/mailgun/mailgun-go"
)

func sendAuthEmail(c siesta.Context, w http.ResponseWriter, r *http.Request) {
	mg := c.Get(MailgunContextKey).(mailgun.Mailgun)
	requestData := c.Get(middleware.RequestDataKey).(*middleware.RequestData)

	var params siesta.Params
	emailAddress := params.String("email", "", "email address of user")
	err := params.Parse(r.Form)
	if err != nil {
		requestData.StatusCode = http.StatusBadRequest
		requestData.ResponseError = err.Error()
		log.WithFields(log.Fields{"request_id": requestData.RequestID,
			"method": r.Method,
			"url":    r.URL,
			"error":  err.Error()}).
			Warnf("[Req %s] %v", requestData.RequestID, err)
		return
	}

	userID := 0
	userName := ""
	mainEmail := ""
	log.Printf("[Req %s] using auth email %v", requestData.RequestID, *emailAddress)
	// Get the main email address of user with the given email address
	log.Println("SELECT users.id, users.name, e2.address FROM emails e1"+
		" JOIN users on users.id = e1.user"+
		" JOIN emails e2 ON users.main_email = e2.id"+
		" WHERE e1.address = ? AND e1.deleted = 0 AND users.deleted = 0 AND users.status = ?",
		*emailAddress, schema.UserStatusActive)
	err = requestData.DB.QueryRow("SELECT users.id, users.name, e2.address FROM emails e1"+
		" JOIN users on users.id = e1.user"+
		" JOIN emails e2 ON users.main_email = e2.id"+
		" WHERE e1.address = ? AND e1.deleted = 0 AND users.deleted = 0 AND users.status = ?",
		*emailAddress, schema.UserStatusActive).
		Scan(&userID, &userName, &mainEmail)
	if err != nil {
		if err == sql.ErrNoRows {
			requestData.StatusCode = http.StatusNotFound
			requestData.ResponseError = "not found"
			log.WithFields(log.Fields{"request_id": requestData.RequestID,
				"method": r.Method,
				"url":    r.URL,
				"error":  err.Error()}).
				Warnf("[Req %s] %v", requestData.RequestID, err)
			return
		}
	}

	// Send an auth email
	linkToken := linktoken.NewLinkToken(&linktoken.UserTokenData{
		User: userID,
	}, int(time.Now().Unix()+900))
	tokenStr, err := tokenCodec.EncodeToken(linkToken)
	if err != nil {
		requestData.StatusCode = http.StatusInternalServerError
		requestData.ResponseError = err.Error()
		log.WithFields(log.Fields{"request_id": requestData.RequestID,
			"method": r.Method,
			"url":    r.URL,
			"error":  err.Error()}).
			Warnf("[Req %s] %v", requestData.RequestID, err)
		return
	}

	err = sendMail(mg, client.EmailMessage{
		To:      mainEmail,
		From:    `"OneContactLink Notifications" <notify@onecontact.link>`,
		Subject: "OneContactLink Login Link",
		Content: fmt.Sprintf("Hi %s,\n\nHere's your login link. It'll be active for 15 minutes.\n\n"+
			"%s", userName, "https://www.onecontact.link/auth/"+tokenStr),
		HTMLContent: fmt.Sprintf("
Hi %s,

Click here to log in.
"+
			"
This link will only be active for 15 minutes.
",
			userName, "https://www.onecontact.link/auth/"+tokenStr),
	})
	if err != nil {
		requestData.StatusCode = http.StatusInternalServerError
		requestData.ResponseError = err.Error()
		log.WithFields(log.Fields{"request_id": requestData.RequestID,
			"method": r.Method,
			"url":    r.URL,
			"error":  err.Error()}).
			Warnf("[Req %s] %v", requestData.RequestID, err)
		return
	}
}

func sendMail(mg mailgun.Mailgun, msg client.EmailMessage) error {
	var err error

	if !DevMode {
		textContent := fmt.Sprintf(textEmailTemplate, msg.Content)
		mailgunMessage := mailgun.NewMessage(msg.From, msg.Subject, textContent, msg.To)
		if msg.HTMLContent != "" {
			htmlContent := fmt.Sprintf(htmlEmailTemplate, msg.HTMLContent)
			mailgunMessage.SetHtml(htmlContent)
		}
		_, _, err = mg.Send(mailgunMessage)
	} else {
		log.Printf(`Sending mail:
From: %s
To: %s
Subject: %s
Content:
%s
`, msg.From, msg.To, msg.Subject, msg.Content)
	}

	return err
}

func sendUserActivationEmail(c siesta.Context, w http.ResponseWriter, r *http.Request) {
	mg := c.Get(MailgunContextKey).(mailgun.Mailgun)
	requestData := c.Get(middleware.RequestDataKey).(*middleware.RequestData)

	var params siesta.Params
	userID := params.Int("id", 0, "user ID")
	err := params.Parse(r.Form)
	if err != nil {
		requestData.StatusCode = http.StatusBadRequest
		requestData.ResponseError = err.Error()
		log.WithFields(log.Fields{"request_id": requestData.RequestID,
			"method": r.Method,
			"url":    r.URL,
			"error":  err.Error()}).
			Warnf("[Req %s] %v", requestData.RequestID, err)
		return
	}

	name := ""
	status := 0
	emailAddress := ""

	err = requestData.DB.QueryRow("SELECT users.name, users.status, emails.address"+
		" FROM users JOIN emails ON users.main_email = emails.id"+
		" WHERE users.id = ?", *userID).Scan(&name, &status, &emailAddress)
	if err != nil {
		if err == sql.ErrNoRows {
			requestData.StatusCode = http.StatusNotFound
			return
		}
		requestData.StatusCode = http.StatusInternalServerError
		requestData.ResponseError = err.Error()
		log.WithFields(log.Fields{"request_id": requestData.RequestID,
			"method": r.Method,
			"url":    r.URL,
			"error":  err.Error()}).
			Warnf("[Req %s] %v", requestData.RequestID, err)
		return
	}

	if status == schema.UserStatusActive {
		// Request has not been approved
		requestData.StatusCode = http.StatusNotModified
		return
	}

	token, err := tokenCodec.EncodeToken(linktoken.NewLinkToken(&linktoken.ActivationTokenData{
		ActivateUser: *userID,
	}, int(time.Now().Unix()+86400)))
	if err != nil {
		requestData.StatusCode = http.StatusInternalServerError
		requestData.ResponseError = err.Error()
		log.WithFields(log.Fields{"request_id": requestData.RequestID,
			"method": r.Method,
			"url":    r.URL,
			"error":  err.Error()}).
			Warnf("[Req %s] %v", requestData.RequestID, err)
		return
	}

	err = sendMail(mg, client.EmailMessage{
		From:    `"OneContactLink" <noreply@onecontact.link>`,
		To:      emailAddress,
		Subject: "Activate OneContactLink Account",
		Content: fmt.Sprintf("Hi %s,\n\n"+
			"Thanks for signing up. Click the following link to activate your account: https://www.onecontact.link/activate/%s\n\n"+
			"That link will only be valid for 1 day.", name, token),
		HTMLContent: fmt.Sprintf("
Hi %s,
"+
			"
Thanks for signing up. Click "+
			"here"+
			" to activate your account.
"+
			"
That link will only be valid for 1 day.
", name, token),
	})
	if err != nil {
		requestData.StatusCode = http.StatusInternalServerError
		requestData.ResponseError = err.Error()
		log.WithFields(log.Fields{"request_id": requestData.RequestID,
			"method": r.Method,
			"url":    r.URL,
			"error":  err.Error()}).
			Warnf("[Req %s] %v", requestData.RequestID, err)
		return
	}
}

repository: Preetam/onecontactlink

repo_name: Preetam/onecontactlink


text:
import React from 'react';
import { graphql } from 'gatsby';
import GatsbyImage from 'gatsby-image';

// this can be in different file
const ImgWithSVGSupport = ({ childImageSharp, extension, publicURL, alt, ...rest }) => {
    if (!childImageSharp && extension === 'svg') {
        return <img src={publicURL} {...rest} alt={alt} />;
    }
    return <GatsbyImage {...childImageSharp} {...rest} />;
};

export default ImgWithSVGSupport;

// you can even declare fragment
export const fragment = graphql`
  fragment ImageWithSVG on File {
    childImageSharp {
      fluid(maxWidth: 2600) {
        ...GatsbyImageSharpFluid_withWebp_tracedSVG
      }
    }
    extension
    publicURL
  }
`;


text:
## test/sweet_config_test.cmake
##
## Copyright (c) 2017 ChienYu Lin
##
## Author: ChienYu Lin <cy20lin@gmail.com>
## License: MIT
##

macro(sweet_config_test)
  monitor(_sweet_target_add)
  testcase(sweet_config_test)
  # if(COMMAND sweet_config)
  #   set(CHECK_RESULT 1)
  # elseif()
  #   set(CHECK_RESULT 0)
  # endif()
  # check_result_equal("if COMMAND sweet_config defined")
  #
  reset_log()
  sweet_config(c1 ADD INCLUDES arg1 arg2)
  _sweet_target_add_configs(t c1)
  log_expect_command(_sweet_target_add t INCLUDES arg1 arg2)
  check_log_equal("target_config(c1 ADD INCLUDES arg1 arg2)")
  save_log()
  # _sweet_target_add is called only if config is not empty
  reset_log()
  sweet_config(c1 RESET)
  _sweet_target_add_configs(t c1)
  check_log_equal("target_config(c2 RESET)")
  save_log()
  #
  reset_log()
  sweet_config(c3 ADD INCLUDES "")
  _sweet_target_add_configs(t c3)
  log_expect_command(_sweet_target_add t INCLUDES)
  check_log_equal("target_config(c1 ADD INCLUDES \"\")")
  save_log()
  #
  endtestcase()
endmacro()
sweet_config_test()


text:
require ${PN}.inc

PR = "r0"

SRC_URI = "http://sources.openembedded.org/opie-1.2.5-split_i18n.tar.bz2;name=split_i18n \
	   http://sources.openembedded.org/opie-1.2.5-split_etc_dict.tar.bz2;name=split_etc_dict"
SRC_URI[split_i18n.md5sum] = "0877eb0c761b06de8dc64f28d1d4bd6f"
SRC_URI[split_i18n.sha256sum] = "5005fa9825bbbdb10367882ec8a9c2df6e755ecc0c9705e674d4dea00abdea0c"
SRC_URI[split_etc_dict.md5sum] = "1112ee99cf14220ca63ec6c49d4f4e61"
SRC_URI[split_etc_dict.sha256sum] = "43e67873ec83ec33b4ad2d441a8606ac8418ff27581bdffa85eef071bee1f7ce"

repository: overo/overo-oe-natty

repo_name: overo/overo-oe-natty

branch_name: HEAD


text:
@article{Wilson2019a,
 abstract = {Proton MRS (  H MRS) provides noninvasive, quantitative metabolite profiles of tissue and has been shown to aid the clinical management of several brain diseases. Although most modern clinical MR scanners support MRS capabilities, routine use is largely restricted to specialized centers with good access to MR research support. Widespread adoption has been slow for several reasons, and technical challenges toward obtaining reliable good-quality results have been identified as a contributing factor. Considerable progress has been made by the research community to address many of these challenges, and in this paper a consensus is presented on deficiencies in widely available MRS methodology and validated improvements that are currently in routine use at several clinical research institutions. In particular, the localization error for the PRESS localization sequence was found to be unacceptably high at 3 T, and use of the semi-adiabatic localization by adiabatic selective refocusing sequence is a recommended solution. Incorporation of simulated metabolite basis sets into analysis routines is recommended for reliably capturing the full spectral detail available from short TE acquisitions. In addition, the importance of achieving a highly homogenous static magnetic field (B  ) in the acquisition region is emphasized, and the limitations of current methods and hardware are discussed. Most recommendations require only software improvements, greatly enhancing the capabilities of clinical MRS on existing hardware. Implementation of these recommendations should strengthen current clinical applications and advance progress toward developing and validating new MRS biomarkers for clinical use.},
 author = {Wilson, Martin and Andronesi, Ovidiu and Barker, Peter B. and Bartha, Robert and Bizzi, Alberto and Bolan, Patrick J. and Brindle, Kevin M. and Choi, In-Young and Cudalbu, Cristina and Dydak, Ulrike and Emir, Uzay E. and Gonzalez, Ramon G. and Gruber, Stephan and Gruetter, Rolf and Gupta, Rakesh K. and Heerschap, Arend and Henning, Anke and Hetherington, Hoby P. and Huppi, Petra S. and Hurd, Ralph E. and Kantarci, Kejal and Kauppinen, Risto A. and Klomp, Dennis W. J. and Kreis, Roland and Kruiskamp, Marijn J. and Leach, Martin O. and Lin, Alexander P. and Luijten, Peter R. and Marjańska, Małgorzata and Maudsley, Andrew A. and Meyerhoff, Dieter J. and Mountford, Carolyn E. and Mullins, Paul G. and Murdoch, James B. and Nelson, Sarah J. and Noeske, Ralph and Öz, Gülin and Pan, Julie W. and Peet, Andrew C. and Poptani, Harish and Posse, Stefan and Ratai, Eva-Maria and Salibi, Nouha and Scheenen, Tom W. J. and Smith, Ian C. P. and Soher, Brian J. and Tkáč, Ivan and Vigneron, Daniel B. and Howe, Franklyn A.},
 citation-subset = {IM},
 country = {United States},
 doi = {10.1002/mrm.27742},
 issn = {1522-2594},
 issn-linking = {0740-3194},
 issue = {2},
 journal = {Magnetic resonance in medicine},
 keywords = {MRS; brain; consensus; metabolites; semi-LASER; shimming},
 month = {August},
 nlm-id = {8505245},
 owner = {NLM},
 pages = {527--550},
 pmid = {30919510},
 pubmodel = {Print-Electronic},
 pubstate = {ppublish},
 revised = {2019-12-07},
 title = {Methodological consensus on clinical proton MRS of the brain: Review and recommendations.},
 volume = {82},
 year = {2019}
}


text:
@InProceedings{reumann2012supercomputing,
  title = {Supercomputing enabling exhaustive statistical analysis of genome wide association study data: Preliminary results},
  author = {Matthias Reumann and Enes Makalic and Benjamin W Goudey and Michael Inouye and Adrian Bickerstaffe and Minh Bui and Daniel J Park and Miroslaw K Kapuscinski and Daniel F Schmidt and Zeyu Zhou and {others}},
  pages = {1258--1261},
  year = {2012},
  booktitle = {2012 Annual International Conference of the IEEE Engineering in Medicine and Biology Society},
  organization = {IEEE},
  date = {2012-01-01},
}

repository: bwgoudey/starter-academic

repo_name: bwgoudey/starter-academic


text:
package cmd

import (
	"fmt"
	"github.com/spf13/cobra"
	"os"
)

var bucket string
var noDirectIo bool
var blockSize uint32
var retries uint8

var rootCmd = &cobra.Command{
	Use:   "s3-fast-transfer",
	Short: "Maximise throughput to S3",
}

func Execute() {
	if err := rootCmd.Execute(); err != nil {
		fmt.Println(err)
		os.Exit(1)
	}
}

func init() {
	rootCmd.PersistentFlags().StringVar(&bucket, "bucket", "", "S3 bucket")
	rootCmd.PersistentFlags().BoolVar(&noDirectIo, "no-direct-io", false, "Use normal io even on block devices")
	rootCmd.PersistentFlags().Uint32Var(&blockSize, "block-size", 1024 * 1024 * 8, "For non-direct io only, what block size to use")
	rootCmd.PersistentFlags().Uint8Var(&retries, "retries", 3, "Number of retry attempts to make for each call to S3")
}